@bettercms-ai/kit 0.1.1 → 2.0.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 +22 -16
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/adapters/dock-values.d.ts +28 -0
- package/dist/adapters/dock-values.js +41 -0
- package/dist/adapters/dock-values.js.map +1 -0
- package/dist/adapters/icons.d.ts +15 -0
- package/dist/adapters/icons.js +27 -0
- package/dist/adapters/icons.js.map +1 -0
- package/dist/adapters/lossy.d.ts +326 -0
- package/dist/adapters/lossy.js +414 -0
- package/dist/adapters/lossy.js.map +1 -0
- package/dist/adapters/prod-types.d.ts +546 -0
- package/dist/adapters/prod-types.js +714 -0
- package/dist/adapters/prod-types.js.map +1 -0
- package/dist/adapters/schema.d.ts +154 -0
- package/dist/adapters/schema.js +3020 -0
- package/dist/adapters/schema.js.map +1 -0
- package/dist/adapters/values.d.ts +221 -0
- package/dist/adapters/values.js +623 -0
- package/dist/adapters/values.js.map +1 -0
- package/dist/brand/logo.d.ts +17 -0
- package/dist/brand/logo.js +96 -0
- package/dist/brand/logo.js.map +1 -0
- package/dist/context.d.ts +359 -0
- package/dist/context.js +217 -0
- package/dist/context.js.map +1 -0
- package/dist/controls/button.d.ts +72 -0
- package/dist/controls/button.js +578 -0
- package/dist/controls/button.js.map +1 -0
- package/dist/controls/c1.d.ts +11 -0
- package/dist/controls/c1.js +24 -0
- package/dist/controls/c1.js.map +1 -0
- package/dist/controls/c2.d.ts +10 -0
- package/dist/controls/c2.js +19 -0
- package/dist/controls/c2.js.map +1 -0
- package/dist/controls/choice.d.ts +44 -0
- package/dist/controls/choice.js +463 -0
- package/dist/controls/choice.js.map +1 -0
- package/dist/controls/code-register.d.ts +1 -0
- package/dist/controls/code-register.js +8 -0
- package/dist/controls/code-register.js.map +1 -0
- package/dist/controls/code.d.ts +42 -0
- package/dist/controls/code.js +397 -0
- package/dist/controls/code.js.map +1 -0
- package/dist/controls/color.d.ts +5 -0
- package/dist/controls/color.js +130 -0
- package/dist/controls/color.js.map +1 -0
- package/dist/controls/component-services.d.ts +156 -0
- package/dist/controls/component-services.js +7 -0
- package/dist/controls/component-services.js.map +1 -0
- package/dist/controls/date-register.d.ts +1 -0
- package/dist/controls/date-register.js +9 -0
- package/dist/controls/date-register.js.map +1 -0
- package/dist/controls/date-zone.d.ts +104 -0
- package/dist/controls/date-zone.js +278 -0
- package/dist/controls/date-zone.js.map +1 -0
- package/dist/controls/date.d.ts +7 -0
- package/dist/controls/date.js +466 -0
- package/dist/controls/date.js.map +1 -0
- package/dist/controls/form-picker-register.d.ts +1 -0
- package/dist/controls/form-picker-register.js +19 -0
- package/dist/controls/form-picker-register.js.map +1 -0
- package/dist/controls/form-picker.d.ts +43 -0
- package/dist/controls/form-picker.js +85 -0
- package/dist/controls/form-picker.js.map +1 -0
- package/dist/controls/icon-register.d.ts +1 -0
- package/dist/controls/icon-register.js +8 -0
- package/dist/controls/icon-register.js.map +1 -0
- package/dist/controls/icon.d.ts +40 -0
- package/dist/controls/icon.js +360 -0
- package/dist/controls/icon.js.map +1 -0
- package/dist/controls/index.d.ts +5 -0
- package/dist/controls/index.js +38 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/controls/json-register.d.ts +1 -0
- package/dist/controls/json-register.js +8 -0
- package/dist/controls/json-register.js.map +1 -0
- package/dist/controls/json.d.ts +2 -0
- package/dist/controls/json.js +82 -0
- package/dist/controls/json.js.map +1 -0
- package/dist/controls/link.d.ts +260 -0
- package/dist/controls/link.js +1186 -0
- package/dist/controls/link.js.map +1 -0
- package/dist/controls/location-register.d.ts +1 -0
- package/dist/controls/location-register.js +8 -0
- package/dist/controls/location-register.js.map +1 -0
- package/dist/controls/location.d.ts +16 -0
- package/dist/controls/location.js +221 -0
- package/dist/controls/location.js.map +1 -0
- package/dist/controls/media-register.d.ts +1 -0
- package/dist/controls/media-register.js +12 -0
- package/dist/controls/media-register.js.map +1 -0
- package/dist/controls/media-services.d.ts +46 -0
- package/dist/controls/media-services.js +0 -0
- package/dist/controls/media.d.ts +104 -0
- package/dist/controls/media.js +1396 -0
- package/dist/controls/media.js.map +1 -0
- package/dist/controls/number.d.ts +22 -0
- package/dist/controls/number.js +196 -0
- package/dist/controls/number.js.map +1 -0
- package/dist/controls/reference-register.d.ts +1 -0
- package/dist/controls/reference-register.js +10 -0
- package/dist/controls/reference-register.js.map +1 -0
- package/dist/controls/reference-services.d.ts +58 -0
- package/dist/controls/reference-services.js +0 -0
- package/dist/controls/reference.d.ts +23 -0
- package/dist/controls/reference.js +777 -0
- package/dist/controls/reference.js.map +1 -0
- package/dist/controls/rich-text/blocks.d.ts +49 -0
- package/dist/controls/rich-text/blocks.js +1859 -0
- package/dist/controls/rich-text/blocks.js.map +1 -0
- package/dist/controls/rich-text/catalog.d.ts +101 -0
- package/dist/controls/rich-text/catalog.js +623 -0
- package/dist/controls/rich-text/catalog.js.map +1 -0
- package/dist/controls/rich-text/codec.d.ts +64 -0
- package/dist/controls/rich-text/codec.js +34 -0
- package/dist/controls/rich-text/codec.js.map +1 -0
- package/dist/controls/rich-text/component-card.d.ts +14 -0
- package/dist/controls/rich-text/component-card.js +1024 -0
- package/dist/controls/rich-text/component-card.js.map +1 -0
- package/dist/controls/rich-text/component-panel.d.ts +47 -0
- package/dist/controls/rich-text/component-panel.js +141 -0
- package/dist/controls/rich-text/component-panel.js.map +1 -0
- package/dist/controls/rich-text/control.d.ts +20 -0
- package/dist/controls/rich-text/control.js +296 -0
- package/dist/controls/rich-text/control.js.map +1 -0
- package/dist/controls/rich-text/dom.d.ts +233 -0
- package/dist/controls/rich-text/dom.js +1019 -0
- package/dist/controls/rich-text/dom.js.map +1 -0
- package/dist/controls/rich-text/editor.d.ts +57 -0
- package/dist/controls/rich-text/editor.js +1630 -0
- package/dist/controls/rich-text/editor.js.map +1 -0
- package/dist/controls/rich-text/floating.d.ts +28 -0
- package/dist/controls/rich-text/floating.js +154 -0
- package/dist/controls/rich-text/floating.js.map +1 -0
- package/dist/controls/rich-text/index.d.ts +1 -0
- package/dist/controls/rich-text/index.js +12 -0
- package/dist/controls/rich-text/index.js.map +1 -0
- package/dist/controls/rich-text/link-form.d.ts +13 -0
- package/dist/controls/rich-text/link-form.js +147 -0
- package/dist/controls/rich-text/link-form.js.map +1 -0
- package/dist/controls/rich-text/markdown.d.ts +6 -0
- package/dist/controls/rich-text/markdown.js +181 -0
- package/dist/controls/rich-text/markdown.js.map +1 -0
- package/dist/controls/rich-text/ops.d.ts +35 -0
- package/dist/controls/rich-text/ops.js +316 -0
- package/dist/controls/rich-text/ops.js.map +1 -0
- package/dist/controls/rich-text/plain.d.ts +17 -0
- package/dist/controls/rich-text/plain.js +44 -0
- package/dist/controls/rich-text/plain.js.map +1 -0
- package/dist/controls/rich-text/toolbar.d.ts +89 -0
- package/dist/controls/rich-text/toolbar.js +343 -0
- package/dist/controls/rich-text/toolbar.js.map +1 -0
- package/dist/controls/scale.d.ts +56 -0
- package/dist/controls/scale.js +563 -0
- package/dist/controls/scale.js.map +1 -0
- package/dist/controls/slot-register.d.ts +1 -0
- package/dist/controls/slot-register.js +16 -0
- package/dist/controls/slot-register.js.map +1 -0
- package/dist/controls/slot-services.d.ts +122 -0
- package/dist/controls/slot-services.js +155 -0
- package/dist/controls/slot-services.js.map +1 -0
- package/dist/controls/slot.d.ts +33 -0
- package/dist/controls/slot.js +366 -0
- package/dist/controls/slot.js.map +1 -0
- package/dist/controls/table/index.d.ts +1 -0
- package/dist/controls/table/index.js +12 -0
- package/dist/controls/table/index.js.map +1 -0
- package/dist/controls/table/prod.d.ts +21 -0
- package/dist/controls/table/prod.js +79 -0
- package/dist/controls/table/prod.js.map +1 -0
- package/dist/controls/table/refs.d.ts +50 -0
- package/dist/controls/table/refs.js +79 -0
- package/dist/controls/table/refs.js.map +1 -0
- package/dist/controls/table/stored.d.ts +15 -0
- package/dist/controls/table/stored.js +44 -0
- package/dist/controls/table/stored.js.map +1 -0
- package/dist/controls/table/table-editor.d.ts +103 -0
- package/dist/controls/table/table-editor.js +2725 -0
- package/dist/controls/table/table-editor.js.map +1 -0
- package/dist/controls/table/table-link.d.ts +24 -0
- package/dist/controls/table/table-link.js +180 -0
- package/dist/controls/table/table-link.js.map +1 -0
- package/dist/controls/table/table.d.ts +9 -0
- package/dist/controls/table/table.js +103 -0
- package/dist/controls/table/table.js.map +1 -0
- package/dist/controls/text.d.ts +17 -0
- package/dist/controls/text.js +322 -0
- package/dist/controls/text.js.map +1 -0
- package/dist/controls/unknown-value.d.ts +17 -0
- package/dist/controls/unknown-value.js +66 -0
- package/dist/controls/unknown-value.js.map +1 -0
- package/dist/core/core.d.ts +63 -0
- package/dist/core/core.js +171 -0
- package/dist/core/core.js.map +1 -0
- package/dist/core/facets.d.ts +347 -0
- package/dist/core/facets.js +334 -0
- package/dist/core/facets.js.map +1 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.js +3 -0
- package/dist/engine/array.d.ts +101 -0
- package/dist/engine/array.js +906 -0
- package/dist/engine/array.js.map +1 -0
- package/dist/engine/bits.d.ts +24 -0
- package/dist/engine/bits.js +60 -0
- package/dist/engine/bits.js.map +1 -0
- package/dist/engine/breadcrumb.d.ts +45 -0
- package/dist/engine/breadcrumb.js +63 -0
- package/dist/engine/breadcrumb.js.map +1 -0
- package/dist/engine/expand.d.ts +66 -0
- package/dist/engine/expand.js +153 -0
- package/dist/engine/expand.js.map +1 -0
- package/dist/engine/field-list.d.ts +20 -0
- package/dist/engine/field-list.js +19 -0
- package/dist/engine/field-list.js.map +1 -0
- package/dist/engine/field-shell.d.ts +49 -0
- package/dist/engine/field-shell.js +988 -0
- package/dist/engine/field-shell.js.map +1 -0
- package/dist/engine/frame.d.ts +122 -0
- package/dist/engine/frame.js +601 -0
- package/dist/engine/frame.js.map +1 -0
- package/dist/engine/group-summary.d.ts +5 -0
- package/dist/engine/group-summary.js +70 -0
- package/dist/engine/group-summary.js.map +1 -0
- package/dist/engine/grouping.d.ts +238 -0
- package/dist/engine/grouping.js +996 -0
- package/dist/engine/grouping.js.map +1 -0
- package/dist/engine/item-list.d.ts +99 -0
- package/dist/engine/item-list.js +725 -0
- package/dist/engine/item-list.js.map +1 -0
- package/dist/engine/kit-field.d.ts +72 -0
- package/dist/engine/kit-field.js +558 -0
- package/dist/engine/kit-field.js.map +1 -0
- package/dist/engine/schema-form.d.ts +116 -0
- package/dist/engine/schema-form.js +462 -0
- package/dist/engine/schema-form.js.map +1 -0
- package/dist/engine/slot.d.ts +13 -0
- package/dist/engine/slot.js +216 -0
- package/dist/engine/slot.js.map +1 -0
- package/dist/index.d.ts +45 -3139
- package/dist/index.js +47 -2036
- package/dist/index.js.map +1 -0
- package/dist/kit.css +75 -0
- package/dist/lib/cn.d.ts +4 -0
- package/dist/lib/cn.js +56 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/columns.d.ts +14 -0
- package/dist/lib/columns.js +30 -0
- package/dist/lib/columns.js.map +1 -0
- package/dist/lib/frames.d.ts +36 -0
- package/dist/lib/frames.js +214 -0
- package/dist/lib/frames.js.map +1 -0
- package/dist/lib/icon-image.d.ts +10 -0
- package/dist/lib/icon-image.js +8 -0
- package/dist/lib/icon-image.js.map +1 -0
- package/dist/lib/icons.d.ts +16 -0
- package/dist/lib/icons.js +173 -0
- package/dist/lib/icons.js.map +1 -0
- package/dist/lib/input-modality.d.ts +11 -0
- package/dist/lib/input-modality.js +47 -0
- package/dist/lib/input-modality.js.map +1 -0
- package/dist/lib/key-event.d.ts +11 -0
- package/dist/lib/key-event.js +16 -0
- package/dist/lib/key-event.js.map +1 -0
- package/dist/lib/path.d.ts +29 -0
- package/dist/lib/path.js +66 -0
- package/dist/lib/path.js.map +1 -0
- package/dist/lib/schema.d.ts +80 -0
- package/dist/lib/schema.js +384 -0
- package/dist/lib/schema.js.map +1 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.js +37 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validate.d.ts +30 -0
- package/dist/lib/validate.js +224 -0
- package/dist/lib/validate.js.map +1 -0
- package/dist/library/analysis.d.ts +23 -0
- package/dist/library/analysis.js +160 -0
- package/dist/library/analysis.js.map +1 -0
- package/dist/library/catalog.d.ts +57 -0
- package/dist/library/catalog.js +307 -0
- package/dist/library/catalog.js.map +1 -0
- package/dist/library/coreNotes.d.ts +8 -0
- package/dist/library/coreNotes.js +111 -0
- package/dist/library/coreNotes.js.map +1 -0
- package/dist/library/coverage.d.ts +40 -0
- package/dist/library/coverage.js +59 -0
- package/dist/library/coverage.js.map +1 -0
- package/dist/library/entries/advanced.entries.d.ts +2 -0
- package/dist/library/entries/advanced.entries.js +6579 -0
- package/dist/library/entries/advanced.entries.js.map +1 -0
- package/dist/library/entries/commerce.entries.d.ts +2 -0
- package/dist/library/entries/commerce.entries.js +4140 -0
- package/dist/library/entries/commerce.entries.js.map +1 -0
- package/dist/library/entries/company.entries.d.ts +2 -0
- package/dist/library/entries/company.entries.js +2731 -0
- package/dist/library/entries/company.entries.js.map +1 -0
- package/dist/library/entries/conversion.entries.d.ts +2 -0
- package/dist/library/entries/conversion.entries.js +3707 -0
- package/dist/library/entries/conversion.entries.js.map +1 -0
- package/dist/library/entries/data.entries.d.ts +7 -0
- package/dist/library/entries/data.entries.js +4613 -0
- package/dist/library/entries/data.entries.js.map +1 -0
- package/dist/library/entries/events.entries.d.ts +2 -0
- package/dist/library/entries/events.entries.js +3428 -0
- package/dist/library/entries/events.entries.js.map +1 -0
- package/dist/library/entries/features.entries.d.ts +2 -0
- package/dist/library/entries/features.entries.js +3157 -0
- package/dist/library/entries/features.entries.js.map +1 -0
- package/dist/library/entries/heroes.entries.d.ts +2 -0
- package/dist/library/entries/heroes.entries.js +3401 -0
- package/dist/library/entries/heroes.entries.js.map +1 -0
- package/dist/library/entries/index.d.ts +3 -0
- package/dist/library/entries/index.js +35 -0
- package/dist/library/entries/index.js.map +1 -0
- package/dist/library/entries/listings.entries.d.ts +2 -0
- package/dist/library/entries/listings.entries.js +2976 -0
- package/dist/library/entries/listings.entries.js.map +1 -0
- package/dist/library/entries/longform.entries.d.ts +2 -0
- package/dist/library/entries/longform.entries.js +4227 -0
- package/dist/library/entries/longform.entries.js.map +1 -0
- package/dist/library/entries/media.entries.d.ts +2 -0
- package/dist/library/entries/media.entries.js +2781 -0
- package/dist/library/entries/media.entries.js.map +1 -0
- package/dist/library/entries/navigation.entries.d.ts +2 -0
- package/dist/library/entries/navigation.entries.js +4011 -0
- package/dist/library/entries/navigation.entries.js.map +1 -0
- package/dist/library/entries/pricing.entries.d.ts +2 -0
- package/dist/library/entries/pricing.entries.js +2383 -0
- package/dist/library/entries/pricing.entries.js.map +1 -0
- package/dist/library/entries/social-proof.entries.d.ts +2 -0
- package/dist/library/entries/social-proof.entries.js +2297 -0
- package/dist/library/entries/social-proof.entries.js.map +1 -0
- package/dist/library/examples/bento.d.ts +92 -0
- package/dist/library/examples/bento.js +201 -0
- package/dist/library/examples/bento.js.map +1 -0
- package/dist/library/examples/blocks.d.ts +14 -0
- package/dist/library/examples/blocks.js +313 -0
- package/dist/library/examples/blocks.js.map +1 -0
- package/dist/library/examples/faq.d.ts +28 -0
- package/dist/library/examples/faq.js +230 -0
- package/dist/library/examples/faq.js.map +1 -0
- package/dist/library/examples/hero.d.ts +43 -0
- package/dist/library/examples/hero.js +222 -0
- package/dist/library/examples/hero.js.map +1 -0
- package/dist/library/examples/index.d.ts +36 -0
- package/dist/library/examples/index.js +109 -0
- package/dist/library/examples/index.js.map +1 -0
- package/dist/library/examples/journalStory.d.ts +93 -0
- package/dist/library/examples/journalStory.js +338 -0
- package/dist/library/examples/journalStory.js.map +1 -0
- package/dist/library/examples/megaMenu.d.ts +134 -0
- package/dist/library/examples/megaMenu.js +442 -0
- package/dist/library/examples/megaMenu.js.map +1 -0
- package/dist/library/examples/pricing.d.ts +103 -0
- package/dist/library/examples/pricing.js +479 -0
- package/dist/library/examples/pricing.js.map +1 -0
- package/dist/library/examples/tabs.d.ts +87 -0
- package/dist/library/examples/tabs.js +180 -0
- package/dist/library/examples/tabs.js.map +1 -0
- package/dist/library/export.d.ts +42 -0
- package/dist/library/export.js +80 -0
- package/dist/library/export.js.map +1 -0
- package/dist/library/index.d.ts +13 -0
- package/dist/library/index.js +6 -0
- package/dist/library/kit-catalog.json +1510 -0
- package/dist/library/types.d.ts +42 -0
- package/dist/library/types.js +0 -0
- package/dist/schema/adapters.d.ts +28 -0
- package/dist/schema/adapters.js +492 -0
- package/dist/schema/adapters.js.map +1 -0
- package/dist/schema/help.d.ts +27 -0
- package/dist/schema/help.js +56 -0
- package/dist/schema/help.js.map +1 -0
- package/dist/schema/scale.d.ts +69 -0
- package/dist/schema/scale.js +250 -0
- package/dist/schema/scale.js.map +1 -0
- package/dist/schema/sources.d.ts +103 -0
- package/dist/schema/sources.js +65 -0
- package/dist/schema/sources.js.map +1 -0
- package/dist/schema/table.d.ts +319 -0
- package/dist/schema/table.js +1199 -0
- package/dist/schema/table.js.map +1 -0
- package/dist/schema/types.d.ts +297 -0
- package/dist/schema/types.js +14 -0
- package/dist/schema/types.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/table/table-view.d.ts +14 -0
- package/dist/table/table-view.js +140 -0
- package/dist/table/table-view.js.map +1 -0
- package/dist/table/table.css +73 -0
- package/dist/testing/corpus.d.ts +63 -0
- package/dist/testing/corpus.js +129 -0
- package/dist/testing/corpus.js.map +1 -0
- package/dist/testing/test-form.d.ts +11 -0
- package/dist/testing/test-form.js +38 -0
- package/dist/testing/test-form.js.map +1 -0
- package/dist/theme.css +345 -0
- package/dist/theme.d.ts +20 -1504
- package/dist/theme.js +43 -4126
- package/dist/theme.js.map +1 -0
- package/dist/tokens.css +542 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.js +0 -0
- package/dist/ui/action-tray.d.ts +54 -0
- package/dist/ui/action-tray.js +154 -0
- package/dist/ui/action-tray.js.map +1 -0
- package/dist/ui/autocomplete.d.ts +30 -0
- package/dist/ui/autocomplete.js +139 -0
- package/dist/ui/autocomplete.js.map +1 -0
- package/dist/ui/button.d.ts +57 -0
- package/dist/ui/button.js +201 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/choice-switch.d.ts +36 -0
- package/dist/ui/choice-switch.js +57 -0
- package/dist/ui/choice-switch.js.map +1 -0
- package/dist/ui/controls.d.ts +83 -0
- package/dist/ui/controls.js +331 -0
- package/dist/ui/controls.js.map +1 -0
- package/dist/ui/display.d.ts +163 -0
- package/dist/ui/display.js +455 -0
- package/dist/ui/display.js.map +1 -0
- package/dist/ui/expanded-editor-modal.d.ts +26 -0
- package/dist/ui/expanded-editor-modal.js +140 -0
- package/dist/ui/expanded-editor-modal.js.map +1 -0
- package/dist/ui/field-context.d.ts +12 -0
- package/dist/ui/field-context.js +23 -0
- package/dist/ui/field-context.js.map +1 -0
- package/dist/ui/floating-panel.d.ts +152 -0
- package/dist/ui/floating-panel.js +928 -0
- package/dist/ui/floating-panel.js.map +1 -0
- package/dist/ui/index.d.ts +16 -0
- package/dist/ui/index.js +18 -0
- package/dist/ui/input.d.ts +78 -0
- package/dist/ui/input.js +250 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/mode-bar.d.ts +31 -0
- package/dist/ui/mode-bar.js +65 -0
- package/dist/ui/mode-bar.js.map +1 -0
- package/dist/ui/overlay.d.ts +195 -0
- package/dist/ui/overlay.js +697 -0
- package/dist/ui/overlay.js.map +1 -0
- package/dist/ui/path-crumbs.d.ts +90 -0
- package/dist/ui/path-crumbs.js +566 -0
- package/dist/ui/path-crumbs.js.map +1 -0
- package/dist/ui/presence.d.ts +16 -0
- package/dist/ui/presence.js +65 -0
- package/dist/ui/presence.js.map +1 -0
- package/dist/ui/select.d.ts +66 -0
- package/dist/ui/select.js +407 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/shortcut-hint.d.ts +14 -0
- package/dist/ui/shortcut-hint.js +35 -0
- package/dist/ui/shortcut-hint.js.map +1 -0
- package/dist/ui/spinner.d.ts +24 -0
- package/dist/ui/spinner.js +42 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/split-button.d.ts +32 -0
- package/dist/ui/split-button.js +60 -0
- package/dist/ui/split-button.js.map +1 -0
- package/dist/ui/surfaces.d.ts +23 -0
- package/dist/ui/surfaces.js +26 -0
- package/dist/ui/surfaces.js.map +1 -0
- package/dist/ui/tab.d.ts +38 -0
- package/dist/ui/tab.js +87 -0
- package/dist/ui/tab.js.map +1 -0
- package/dist/ui/toast.d.ts +20 -0
- package/dist/ui/toast.js +115 -0
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/tooltip-root.d.ts +13 -0
- package/dist/ui/tooltip-root.js +77 -0
- package/dist/ui/tooltip-root.js.map +1 -0
- package/dist/ui/variants.d.ts +15 -0
- package/dist/ui/variants.js +14 -0
- package/dist/ui/variants.js.map +1 -0
- package/package.json +76 -50
- package/LICENSE +0 -21
- package/dist/_chunks-cjs/_visual-editing.js +0 -5898
- package/dist/_chunks-cjs/refractor.js +0 -22
- package/dist/_chunks-es/_visual-editing.mjs +0 -5904
- package/dist/_chunks-es/refractor.mjs +0 -25
- package/dist/_color.d.mts +0 -119
- package/dist/_color.d.ts +0 -119
- package/dist/_color.js +0 -1412
- package/dist/_color.mjs +0 -1411
- package/dist/_visual-editing.d.mts +0 -1126
- package/dist/_visual-editing.d.ts +0 -1126
- package/dist/_visual-editing.js +0 -30
- package/dist/_visual-editing.mjs +0 -30
- package/dist/index.d.mts +0 -3140
- package/dist/index.mjs +0 -2044
- package/dist/theme.d.mts +0 -1506
- package/dist/theme.mjs +0 -4126
- package/exports/_visual-editing.ts +0 -31
- package/exports/index.ts +0 -1
- package/exports/theme.ts +0 -1
- package/src/color/index.d.mts +0 -119
- package/src/color/index.mjs +0 -1411
- package/src/core/__workshop__/constants.ts +0 -293
- package/src/core/_compat.ts +0 -264
- package/src/core/components/autocomplete/__mocks__/apiStore.ts +0 -49
- package/src/core/components/autocomplete/__mocks__/countries.ts +0 -245
- package/src/core/components/autocomplete/__workshop__/async.tsx +0 -156
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -137
- package/src/core/components/autocomplete/__workshop__/custom.tsx +0 -89
- package/src/core/components/autocomplete/__workshop__/example.tsx +0 -79
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +0 -294
- package/src/core/components/autocomplete/__workshop__/index.ts +0 -39
- package/src/core/components/autocomplete/__workshop__/types.ts +0 -4
- package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -39
- package/src/core/components/autocomplete/autocomplete.tsx +0 -767
- package/src/core/components/autocomplete/autocompleteOption.tsx +0 -45
- package/src/core/components/autocomplete/autocompleteReducer.ts +0 -47
- package/src/core/components/autocomplete/constants.ts +0 -28
- package/src/core/components/autocomplete/index.ts +0 -2
- package/src/core/components/autocomplete/types.ts +0 -108
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +0 -62
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -14
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -18
- package/src/core/components/breadcrumbs/breadcrumbs.test.tsx +0 -51
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +0 -133
- package/src/core/components/breadcrumbs/index.ts +0 -1
- package/src/core/components/dialog/__workshop__/activate.tsx +0 -134
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +0 -29
- package/src/core/components/dialog/__workshop__/index.ts +0 -19
- package/src/core/components/dialog/__workshop__/layering.tsx +0 -41
- package/src/core/components/dialog/__workshop__/nested.tsx +0 -72
- package/src/core/components/dialog/__workshop__/onScroll.tsx +0 -39
- package/src/core/components/dialog/__workshop__/panes.tsx +0 -82
- package/src/core/components/dialog/__workshop__/position.tsx +0 -30
- package/src/core/components/dialog/__workshop__/props.tsx +0 -75
- package/src/core/components/dialog/__workshop__/provider.tsx +0 -11
- package/src/core/components/dialog/__workshop__/wrapped.tsx +0 -76
- package/src/core/components/dialog/dialog.tsx +0 -430
- package/src/core/components/dialog/dialogContext.ts +0 -20
- package/src/core/components/dialog/dialogProvider.tsx +0 -35
- package/src/core/components/dialog/index.ts +0 -4
- package/src/core/components/dialog/styles.ts +0 -77
- package/src/core/components/dialog/useDialog.ts +0 -11
- package/src/core/components/hotkeys/__workshop__/index.ts +0 -14
- package/src/core/components/hotkeys/__workshop__/plain.tsx +0 -9
- package/src/core/components/hotkeys/hotkeys.test.tsx +0 -42
- package/src/core/components/hotkeys/hotkeys.tsx +0 -66
- package/src/core/components/hotkeys/index.ts +0 -1
- package/src/core/components/index.ts +0 -9
- package/src/core/components/menu/__workshop__/asComponent.tsx +0 -45
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +0 -51
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +0 -46
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +0 -45
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +0 -39
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
- package/src/core/components/menu/__workshop__/groups.tsx +0 -156
- package/src/core/components/menu/__workshop__/index.ts +0 -89
- package/src/core/components/menu/__workshop__/menuButton.tsx +0 -80
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +0 -58
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +0 -22
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
- package/src/core/components/menu/__workshop__/selectedItem.tsx +0 -69
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +0 -47
- package/src/core/components/menu/__workshop__/tones.tsx +0 -25
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +0 -32
- package/src/core/components/menu/helpers.ts +0 -82
- package/src/core/components/menu/index.ts +0 -5
- package/src/core/components/menu/menu.spacing.test.tsx +0 -63
- package/src/core/components/menu/menu.test.tsx +0 -125
- package/src/core/components/menu/menu.tsx +0 -178
- package/src/core/components/menu/menuButton.tsx +0 -268
- package/src/core/components/menu/menuContext.ts +0 -18
- package/src/core/components/menu/menuDivider.ts +0 -23
- package/src/core/components/menu/menuGroup.spacing.test.tsx +0 -63
- package/src/core/components/menu/menuGroup.tsx +0 -233
- package/src/core/components/menu/menuItem.spacing.test.tsx +0 -59
- package/src/core/components/menu/menuItem.tsx +0 -197
- package/src/core/components/menu/useMenu.ts +0 -21
- package/src/core/components/menu/useMenuController.ts +0 -231
- package/src/core/components/skeleton/__workshop__/delay.tsx +0 -70
- package/src/core/components/skeleton/__workshop__/index.ts +0 -11
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +0 -64
- package/src/core/components/skeleton/index.ts +0 -2
- package/src/core/components/skeleton/skeleton.tsx +0 -57
- package/src/core/components/skeleton/styles.ts +0 -50
- package/src/core/components/skeleton/textSkeleton.tsx +0 -122
- package/src/core/components/tab/__workshop__/example.tsx +0 -79
- package/src/core/components/tab/__workshop__/index.ts +0 -14
- package/src/core/components/tab/index.ts +0 -3
- package/src/core/components/tab/tab.tsx +0 -101
- package/src/core/components/tab/tabList.test.tsx +0 -48
- package/src/core/components/tab/tabList.tsx +0 -70
- package/src/core/components/tab/tabPanel.tsx +0 -39
- package/src/core/components/toast/__workshop__/hook.tsx +0 -71
- package/src/core/components/toast/__workshop__/index.ts +0 -19
- package/src/core/components/toast/__workshop__/toast.tsx +0 -26
- package/src/core/components/toast/index.ts +0 -4
- package/src/core/components/toast/styles.ts +0 -77
- package/src/core/components/toast/toast.test.tsx +0 -101
- package/src/core/components/toast/toast.tsx +0 -198
- package/src/core/components/toast/toastContext.ts +0 -7
- package/src/core/components/toast/toastLayer.tsx +0 -51
- package/src/core/components/toast/toastProvider.tsx +0 -113
- package/src/core/components/toast/toastState.ts +0 -6
- package/src/core/components/toast/types.ts +0 -26
- package/src/core/components/toast/useToast.ts +0 -25
- package/src/core/components/tree/__workshop__/basic.perf.ts +0 -19
- package/src/core/components/tree/__workshop__/basic.tsx +0 -105
- package/src/core/components/tree/__workshop__/index.ts +0 -21
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +0 -84
- package/src/core/components/tree/helpers.ts +0 -105
- package/src/core/components/tree/index.ts +0 -4
- package/src/core/components/tree/style.ts +0 -105
- package/src/core/components/tree/tree.test.tsx +0 -55
- package/src/core/components/tree/tree.tsx +0 -240
- package/src/core/components/tree/treeContext.ts +0 -10
- package/src/core/components/tree/treeGroup.tsx +0 -28
- package/src/core/components/tree/treeItem.test.tsx +0 -65
- package/src/core/components/tree/treeItem.tsx +0 -224
- package/src/core/components/tree/types.ts +0 -25
- package/src/core/components/tree/useTree.ts +0 -17
- package/src/core/constants.ts +0 -79
- package/src/core/helpers/animation.ts +0 -27
- package/src/core/helpers/element.ts +0 -55
- package/src/core/helpers/focus.ts +0 -100
- package/src/core/helpers/index.ts +0 -4
- package/src/core/helpers/scroll.ts +0 -15
- package/src/core/hooks/index.ts +0 -12
- package/src/core/hooks/useArrayProp.ts +0 -17
- package/src/core/hooks/useClickOutside.test.tsx +0 -482
- package/src/core/hooks/useClickOutside.ts +0 -118
- package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -115
- package/src/core/hooks/useClickOutsideEvent.ts +0 -73
- package/src/core/hooks/useCustomValidity.ts +0 -13
- package/src/core/hooks/useDelayed.test.ts +0 -88
- package/src/core/hooks/useDelayedState.ts +0 -36
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -32
- package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
- package/src/core/hooks/useElementRect/index.ts +0 -1
- package/src/core/hooks/useElementRect/useElementRect.ts +0 -13
- package/src/core/hooks/useElementSize.ts +0 -19
- package/src/core/hooks/useForwardedRef.ts +0 -19
- package/src/core/hooks/useGlobalKeyDown.ts +0 -24
- package/src/core/hooks/useIsomorphicEffect.ts +0 -7
- package/src/core/hooks/useMatchMedia.ts +0 -28
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +0 -14
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
- package/src/core/hooks/useMediaIndex/index.ts +0 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -36
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +0 -102
- package/src/core/hooks/useMounted.ts +0 -15
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +0 -56
- package/src/core/hooks/usePrefersDark.test.tsx +0 -19
- package/src/core/hooks/usePrefersDark.ts +0 -16
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -56
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +0 -19
- package/src/core/hooks/usePrefersReducedMotion.ts +0 -16
- package/src/core/index.ts +0 -10
- package/src/core/lib/createGlobalScopedContext.ts +0 -36
- package/src/core/lib/globalScope.ts +0 -19
- package/src/core/lib/isRecord.ts +0 -3
- package/src/core/middleware/origin.ts +0 -47
- package/src/core/observers/elementSizeObserver.ts +0 -116
- package/src/core/observers/index.ts +0 -2
- package/src/core/observers/resizeObserver.ts +0 -9
- package/src/core/primitives/_selectable/index.ts +0 -1
- package/src/core/primitives/_selectable/selectable.tsx +0 -15
- package/src/core/primitives/_selectable/style.ts +0 -115
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +0 -14
- package/src/core/primitives/avatar/__workshop__/index.ts +0 -29
- package/src/core/primitives/avatar/__workshop__/stack.tsx +0 -25
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +0 -63
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -70
- package/src/core/primitives/avatar/avatar.tsx +0 -200
- package/src/core/primitives/avatar/avatarCounter.tsx +0 -91
- package/src/core/primitives/avatar/avatarStack.tsx +0 -100
- package/src/core/primitives/avatar/index.ts +0 -4
- package/src/core/primitives/avatar/styles.ts +0 -167
- package/src/core/primitives/avatar/types.ts +0 -17
- package/src/core/primitives/badge/__workshop__/index.ts +0 -19
- package/src/core/primitives/badge/__workshop__/props.tsx +0 -30
- package/src/core/primitives/badge/__workshop__/tones.tsx +0 -21
- package/src/core/primitives/badge/badge.test.tsx +0 -16
- package/src/core/primitives/badge/badge.tsx +0 -70
- package/src/core/primitives/badge/index.ts +0 -1
- package/src/core/primitives/badge/styles.ts +0 -20
- package/src/core/primitives/badge/types.ts +0 -8
- package/src/core/primitives/box/__workshop__/asComponent.tsx +0 -31
- package/src/core/primitives/box/__workshop__/index.ts +0 -24
- package/src/core/primitives/box/__workshop__/props.tsx +0 -20
- package/src/core/primitives/box/__workshop__/responsive.tsx +0 -20
- package/src/core/primitives/box/box.test.tsx +0 -142
- package/src/core/primitives/box/box.tsx +0 -154
- package/src/core/primitives/box/index.ts +0 -1
- package/src/core/primitives/button/__workshop__/custom.tsx +0 -51
- package/src/core/primitives/button/__workshop__/customIcons.tsx +0 -30
- package/src/core/primitives/button/__workshop__/disabled.tsx +0 -74
- package/src/core/primitives/button/__workshop__/index.ts +0 -59
- package/src/core/primitives/button/__workshop__/labelUploadButton.tsx +0 -36
- package/src/core/primitives/button/__workshop__/mixedChildren.tsx +0 -12
- package/src/core/primitives/button/__workshop__/props.tsx +0 -55
- package/src/core/primitives/button/__workshop__/stacked.tsx +0 -58
- package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
- package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +0 -28
- package/src/core/primitives/button/button.test.tsx +0 -82
- package/src/core/primitives/button/button.tsx +0 -210
- package/src/core/primitives/button/index.ts +0 -1
- package/src/core/primitives/button/styles.ts +0 -117
- package/src/core/primitives/card/__workshop__/allTones.tsx +0 -25
- package/src/core/primitives/card/__workshop__/asButton.tsx +0 -107
- package/src/core/primitives/card/__workshop__/asComponent.tsx +0 -27
- package/src/core/primitives/card/__workshop__/checkered.tsx +0 -26
- package/src/core/primitives/card/__workshop__/index.ts +0 -18
- package/src/core/primitives/card/__workshop__/interactive.tsx +0 -30
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +0 -80
- package/src/core/primitives/card/__workshop__/props.tsx +0 -53
- package/src/core/primitives/card/__workshop__/selected.tsx +0 -94
- package/src/core/primitives/card/__workshop__/styled.tsx +0 -14
- package/src/core/primitives/card/card.tsx +0 -128
- package/src/core/primitives/card/index.ts +0 -2
- package/src/core/primitives/card/styles.ts +0 -147
- package/src/core/primitives/card/types.ts +0 -11
- package/src/core/primitives/checkbox/__workshop__/example.tsx +0 -25
- package/src/core/primitives/checkbox/__workshop__/index.ts +0 -13
- package/src/core/primitives/checkbox/__workshop__/props.tsx +0 -33
- package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +0 -16
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +0 -28
- package/src/core/primitives/checkbox/checkbox.tsx +0 -73
- package/src/core/primitives/checkbox/index.ts +0 -1
- package/src/core/primitives/checkbox/styles.ts +0 -128
- package/src/core/primitives/code/__workshop__/index.ts +0 -19
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/code/__workshop__/props.tsx +0 -21
- package/src/core/primitives/code/code.tsx +0 -55
- package/src/core/primitives/code/index.ts +0 -1
- package/src/core/primitives/code/refractor.tsx +0 -20
- package/src/core/primitives/code/styles.ts +0 -77
- package/src/core/primitives/container/__workshop__/example.tsx +0 -20
- package/src/core/primitives/container/__workshop__/index.ts +0 -8
- package/src/core/primitives/container/container.tsx +0 -54
- package/src/core/primitives/container/index.ts +0 -2
- package/src/core/primitives/container/styles.ts +0 -23
- package/src/core/primitives/container/types.ts +0 -6
- package/src/core/primitives/flex/__workshop__/example.tsx +0 -34
- package/src/core/primitives/flex/__workshop__/gap.tsx +0 -25
- package/src/core/primitives/flex/__workshop__/index.ts +0 -11
- package/src/core/primitives/flex/flex.tsx +0 -64
- package/src/core/primitives/flex/index.ts +0 -1
- package/src/core/primitives/grid/__workshop__/index.ts +0 -10
- package/src/core/primitives/grid/__workshop__/responsive.tsx +0 -54
- package/src/core/primitives/grid/grid.test.tsx +0 -80
- package/src/core/primitives/grid/grid.tsx +0 -74
- package/src/core/primitives/grid/index.ts +0 -1
- package/src/core/primitives/heading/__workshop__/index.ts +0 -19
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
- package/src/core/primitives/heading/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/heading/heading.tsx +0 -88
- package/src/core/primitives/heading/index.ts +0 -1
- package/src/core/primitives/heading/styles.ts +0 -64
- package/src/core/primitives/heading/types.ts +0 -7
- package/src/core/primitives/index.ts +0 -27
- package/src/core/primitives/inline/__workshop__/index.ts +0 -8
- package/src/core/primitives/inline/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/inline/index.ts +0 -1
- package/src/core/primitives/inline/inline.test.tsx +0 -51
- package/src/core/primitives/inline/inline.tsx +0 -63
- package/src/core/primitives/inline/styles.ts +0 -32
- package/src/core/primitives/inline/types.ts +0 -6
- package/src/core/primitives/kbd/__workshop__/index.ts +0 -8
- package/src/core/primitives/kbd/__workshop__/plain.tsx +0 -9
- package/src/core/primitives/kbd/index.ts +0 -1
- package/src/core/primitives/kbd/kbd.tsx +0 -69
- package/src/core/primitives/label/__workshop__/index.ts +0 -19
- package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/label/__workshop__/plain.tsx +0 -24
- package/src/core/primitives/label/index.ts +0 -1
- package/src/core/primitives/label/label.tsx +0 -87
- package/src/core/primitives/label/styles.ts +0 -45
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
- package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +0 -89
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +0 -97
- package/src/core/primitives/popover/__workshop__/index.ts +0 -49
- package/src/core/primitives/popover/constants.ts +0 -22
- package/src/core/primitives/popover/floating-ui/size.ts +0 -99
- package/src/core/primitives/popover/helpers.ts +0 -31
- package/src/core/primitives/popover/index.ts +0 -2
- package/src/core/primitives/popover/popover.tsx +0 -511
- package/src/core/primitives/popover/popoverCard.tsx +0 -166
- package/src/core/primitives/popover/types.ts +0 -7
- package/src/core/primitives/radio/__workshop__/example.tsx +0 -63
- package/src/core/primitives/radio/__workshop__/index.ts +0 -11
- package/src/core/primitives/radio/__workshop__/plain.tsx +0 -28
- package/src/core/primitives/radio/index.ts +0 -1
- package/src/core/primitives/radio/radio.tsx +0 -51
- package/src/core/primitives/radio/styles.ts +0 -117
- package/src/core/primitives/select/__workshop__/index.ts +0 -11
- package/src/core/primitives/select/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/select/__workshop__/readOnly.tsx +0 -23
- package/src/core/primitives/select/index.ts +0 -1
- package/src/core/primitives/select/select.test.tsx +0 -52
- package/src/core/primitives/select/select.tsx +0 -94
- package/src/core/primitives/select/styles.ts +0 -166
- package/src/core/primitives/spinner/__workshop__/Props.tsx +0 -15
- package/src/core/primitives/spinner/__workshop__/index.ts +0 -14
- package/src/core/primitives/spinner/index.ts +0 -1
- package/src/core/primitives/spinner/spinner.tsx +0 -46
- package/src/core/primitives/stack/__workshop__/index.ts +0 -14
- package/src/core/primitives/stack/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/stack/index.ts +0 -1
- package/src/core/primitives/stack/stack.test.tsx +0 -57
- package/src/core/primitives/stack/stack.tsx +0 -57
- package/src/core/primitives/stack/styles.ts +0 -32
- package/src/core/primitives/switch/__workshop__/example.tsx +0 -23
- package/src/core/primitives/switch/__workshop__/index.ts +0 -11
- package/src/core/primitives/switch/__workshop__/props.tsx +0 -21
- package/src/core/primitives/switch/index.ts +0 -1
- package/src/core/primitives/switch/styles.ts +0 -173
- package/src/core/primitives/switch/switch.tsx +0 -68
- package/src/core/primitives/text/__workshop__/colored.tsx +0 -30
- package/src/core/primitives/text/__workshop__/example.tsx +0 -39
- package/src/core/primitives/text/__workshop__/index.ts +0 -24
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/text/index.ts +0 -1
- package/src/core/primitives/text/styles.ts +0 -74
- package/src/core/primitives/text/text.tsx +0 -89
- package/src/core/primitives/textArea/__workshop__/index.ts +0 -14
- package/src/core/primitives/textArea/__workshop__/plain.tsx +0 -50
- package/src/core/primitives/textArea/index.ts +0 -1
- package/src/core/primitives/textArea/textArea.tsx +0 -120
- package/src/core/primitives/textInput/__workshop__/clearButton.tsx +0 -30
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +0 -17
- package/src/core/primitives/textInput/__workshop__/index.ts +0 -44
- package/src/core/primitives/textInput/__workshop__/plain.tsx +0 -98
- package/src/core/primitives/textInput/__workshop__/readOnly.tsx +0 -9
- package/src/core/primitives/textInput/__workshop__/states.tsx +0 -53
- package/src/core/primitives/textInput/__workshop__/tones.tsx +0 -277
- package/src/core/primitives/textInput/__workshop__/typed.tsx +0 -23
- package/src/core/primitives/textInput/index.ts +0 -1
- package/src/core/primitives/textInput/textInput.test.tsx +0 -48
- package/src/core/primitives/textInput/textInput.tsx +0 -395
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
- package/src/core/primitives/tooltip/__workshop__/index.ts +0 -29
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
- package/src/core/primitives/tooltip/__workshop__/props.tsx +0 -107
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
- package/src/core/primitives/tooltip/constants.ts +0 -23
- package/src/core/primitives/tooltip/index.ts +0 -2
- package/src/core/primitives/tooltip/tooltip.test.tsx +0 -452
- package/src/core/primitives/tooltip/tooltip.tsx +0 -495
- package/src/core/primitives/tooltip/tooltipCard.tsx +0 -109
- package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +0 -4
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -11
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -57
- package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +0 -10
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -13
- package/src/core/primitives/types.ts +0 -179
- package/src/core/styles/border/borderStyle.ts +0 -56
- package/src/core/styles/border/index.ts +0 -2
- package/src/core/styles/border/types.ts +0 -10
- package/src/core/styles/box/boxStyle.ts +0 -69
- package/src/core/styles/box/index.ts +0 -2
- package/src/core/styles/box/types.ts +0 -11
- package/src/core/styles/card/_cardColorStyle.ts +0 -108
- package/src/core/styles/card/index.ts +0 -1
- package/src/core/styles/flex/flexItemStyle.ts +0 -27
- package/src/core/styles/flex/flexStyle.ts +0 -70
- package/src/core/styles/flex/index.ts +0 -3
- package/src/core/styles/flex/types.ts +0 -25
- package/src/core/styles/focusRing/index.ts +0 -25
- package/src/core/styles/font/codeFontStyle.ts +0 -13
- package/src/core/styles/font/headingFontStyle.ts +0 -13
- package/src/core/styles/font/index.ts +0 -6
- package/src/core/styles/font/labelFontStyle.ts +0 -13
- package/src/core/styles/font/responsiveFont.ts +0 -103
- package/src/core/styles/font/textAlignStyle.ts +0 -19
- package/src/core/styles/font/textFontStyle.ts +0 -13
- package/src/core/styles/font/types.ts +0 -35
- package/src/core/styles/grid/gridItemStyle.ts +0 -82
- package/src/core/styles/grid/gridStyle.ts +0 -108
- package/src/core/styles/grid/index.ts +0 -3
- package/src/core/styles/grid/types.ts +0 -37
- package/src/core/styles/helpers.ts +0 -72
- package/src/core/styles/index.ts +0 -5
- package/src/core/styles/input/index.ts +0 -2
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +0 -78
- package/src/core/styles/input/textInputStyle.ts +0 -263
- package/src/core/styles/internal.ts +0 -12
- package/src/core/styles/margin/index.ts +0 -2
- package/src/core/styles/margin/marginStyle.ts +0 -21
- package/src/core/styles/margin/marginsStyle.test.ts +0 -33
- package/src/core/styles/margin/types.ts +0 -9
- package/src/core/styles/padding/index.ts +0 -2
- package/src/core/styles/padding/paddingStyle.test.ts +0 -33
- package/src/core/styles/padding/paddingStyle.ts +0 -21
- package/src/core/styles/padding/types.ts +0 -12
- package/src/core/styles/radius/index.ts +0 -2
- package/src/core/styles/radius/radiusStyle.ts +0 -23
- package/src/core/styles/radius/types.ts +0 -8
- package/src/core/styles/shadow/index.ts +0 -2
- package/src/core/styles/shadow/shadowStyle.ts +0 -29
- package/src/core/styles/shadow/types.ts +0 -6
- package/src/core/styles/types.ts +0 -8
- package/src/core/theme/__workshop__/build/Root.tsx +0 -367
- package/src/core/theme/__workshop__/build/helpers.ts +0 -46
- package/src/core/theme/__workshop__/build/story.tsx +0 -465
- package/src/core/theme/__workshop__/canvas.tsx +0 -352
- package/src/core/theme/__workshop__/color.tsx +0 -62
- package/src/core/theme/__workshop__/debug/story.tsx +0 -408
- package/src/core/theme/__workshop__/index.ts +0 -39
- package/src/core/theme/__workshop__/layer.tsx +0 -78
- package/src/core/theme/__workshop__/nestedProvider.tsx +0 -15
- package/src/core/theme/index.ts +0 -5
- package/src/core/theme/theme.test.tsx +0 -73
- package/src/core/theme/themeColorProvider.tsx +0 -29
- package/src/core/theme/themeContext.ts +0 -10
- package/src/core/theme/themeProvider.tsx +0 -62
- package/src/core/theme/types.ts +0 -12
- package/src/core/theme/useRootTheme.ts +0 -17
- package/src/core/theme/useTheme.ts +0 -16
- package/src/core/types/avatar.ts +0 -14
- package/src/core/types/badge.ts +0 -12
- package/src/core/types/box.ts +0 -19
- package/src/core/types/button.ts +0 -21
- package/src/core/types/card.ts +0 -6
- package/src/core/types/component.ts +0 -32
- package/src/core/types/dialog.ts +0 -4
- package/src/core/types/flex.ts +0 -30
- package/src/core/types/grid.ts +0 -14
- package/src/core/types/gridItem.ts +0 -29
- package/src/core/types/index.ts +0 -15
- package/src/core/types/placement.ts +0 -18
- package/src/core/types/popover.ts +0 -4
- package/src/core/types/radius.ts +0 -4
- package/src/core/types/selectable.ts +0 -6
- package/src/core/types/text.ts +0 -4
- package/src/core/utils/arrow/arrow.tsx +0 -123
- package/src/core/utils/arrow/cmds.ts +0 -91
- package/src/core/utils/arrow/index.ts +0 -1
- package/src/core/utils/boundaryElement/__workshop__/index.ts +0 -14
- package/src/core/utils/boundaryElement/__workshop__/plain.tsx +0 -19
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +0 -100
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +0 -7
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +0 -24
- package/src/core/utils/boundaryElement/index.ts +0 -3
- package/src/core/utils/boundaryElement/types.ts +0 -7
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +0 -26
- package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -21
- package/src/core/utils/conditionalWrapper/index.ts +0 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
- package/src/core/utils/elementQuery/__workshop__/index.ts +0 -14
- package/src/core/utils/elementQuery/elementQuery.tsx +0 -53
- package/src/core/utils/elementQuery/helpers.ts +0 -27
- package/src/core/utils/elementQuery/index.ts +0 -1
- package/src/core/utils/errorBoundary.tsx +0 -48
- package/src/core/utils/getElementRef.ts +0 -26
- package/src/core/utils/index.ts +0 -9
- package/src/core/utils/layer/__workshop__/_debug.tsx +0 -17
- package/src/core/utils/layer/__workshop__/index.ts +0 -24
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +0 -49
- package/src/core/utils/layer/__workshop__/nested.tsx +0 -98
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
- package/src/core/utils/layer/getLayerContext.test.ts +0 -30
- package/src/core/utils/layer/getLayerContext.ts +0 -21
- package/src/core/utils/layer/index.ts +0 -4
- package/src/core/utils/layer/layer.test.tsx +0 -108
- package/src/core/utils/layer/layer.tsx +0 -98
- package/src/core/utils/layer/layerContext.ts +0 -7
- package/src/core/utils/layer/layerProvider.tsx +0 -111
- package/src/core/utils/layer/types.ts +0 -9
- package/src/core/utils/layer/useLayer.ts +0 -26
- package/src/core/utils/portal/__workshop__/index.ts +0 -14
- package/src/core/utils/portal/__workshop__/named.tsx +0 -63
- package/src/core/utils/portal/index.ts +0 -4
- package/src/core/utils/portal/portal.test.tsx +0 -103
- package/src/core/utils/portal/portal.ts +0 -32
- package/src/core/utils/portal/portalContext.ts +0 -31
- package/src/core/utils/portal/portalProvider.tsx +0 -47
- package/src/core/utils/portal/types.ts +0 -9
- package/src/core/utils/portal/usePortal.ts +0 -25
- package/src/core/utils/spanWithTextOverflow.tsx +0 -10
- package/src/core/utils/srOnly/index.ts +0 -1
- package/src/core/utils/srOnly/srOnly.tsx +0 -36
- package/src/core/utils/virtualList/__workshop__/changingProps.tsx +0 -36
- package/src/core/utils/virtualList/__workshop__/elementScroll.tsx +0 -24
- package/src/core/utils/virtualList/__workshop__/index.ts +0 -29
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
- package/src/core/utils/virtualList/__workshop__/windowScrolll.tsx +0 -22
- package/src/core/utils/virtualList/index.ts +0 -1
- package/src/core/utils/virtualList/virtualList.tsx +0 -200
- package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +0 -76
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +0 -54
- package/src/theme/build/_deprecated/color/button/createButtonModes.ts +0 -22
- package/src/theme/build/_deprecated/color/button/createButtonTones.ts +0 -55
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +0 -60
- package/src/theme/build/_deprecated/color/color.test.ts +0 -63
- package/src/theme/build/_deprecated/color/defaults.ts +0 -390
- package/src/theme/build/_deprecated/color/factory.ts +0 -142
- package/src/theme/build/_deprecated/color/index.ts +0 -1
- package/src/theme/build/_deprecated/color/input/createInputModes.ts +0 -81
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +0 -54
- package/src/theme/build/_deprecated/color/spot/createSpot.ts +0 -20
- package/src/theme/build/buildColorTheme.test.ts +0 -183
- package/src/theme/build/buildColorTheme.ts +0 -499
- package/src/theme/build/buildTheme.test.ts +0 -87
- package/src/theme/build/buildTheme.ts +0 -36
- package/src/theme/build/colorToken/colorToken.ts +0 -19
- package/src/theme/build/colorToken/compileColorToken.ts +0 -21
- package/src/theme/build/colorToken/index.ts +0 -2
- package/src/theme/build/colorToken/types.ts +0 -6
- package/src/theme/build/index.ts +0 -3
- package/src/theme/build/lib/color-fns/blend/index.ts +0 -3
- package/src/theme/build/lib/color-fns/blend/mix.ts +0 -21
- package/src/theme/build/lib/color-fns/blend/multiply.ts +0 -18
- package/src/theme/build/lib/color-fns/blend/screen.ts +0 -18
- package/src/theme/build/lib/color-fns/color-fns.test.ts +0 -68
- package/src/theme/build/lib/color-fns/contrastRatio.ts +0 -31
- package/src/theme/build/lib/color-fns/convert.ts +0 -150
- package/src/theme/build/lib/color-fns/index.ts +0 -6
- package/src/theme/build/lib/color-fns/parse.ts +0 -60
- package/src/theme/build/lib/color-fns/rgba.ts +0 -10
- package/src/theme/build/lib/color-fns/types.ts +0 -28
- package/src/theme/build/lib/isRecord.ts +0 -3
- package/src/theme/build/lib/lazy.ts +0 -30
- package/src/theme/build/lib/utils.ts +0 -19
- package/src/theme/build/merge.ts +0 -26
- package/src/theme/build/mixThemeColor.test.ts +0 -21
- package/src/theme/build/mixThemeColor.ts +0 -53
- package/src/theme/build/renderColorTheme.ts +0 -532
- package/src/theme/build/renderColorValue.ts +0 -85
- package/src/theme/build/resolveColorTokens.ts +0 -268
- package/src/theme/build/theme.test.ts +0 -27
- package/src/theme/config/helpers.ts +0 -55
- package/src/theme/config/index.ts +0 -4
- package/src/theme/config/system.ts +0 -115
- package/src/theme/config/tokens/color/index.ts +0 -1
- package/src/theme/config/tokens/color/types.ts +0 -133
- package/src/theme/config/tokens/index.ts +0 -4
- package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
- package/src/theme/config/tokens/parseTokenKey.ts +0 -67
- package/src/theme/config/tokens/parseTokenValue.test.ts +0 -42
- package/src/theme/config/tokens/parseTokenValue.ts +0 -133
- package/src/theme/config/tokens/types.ts +0 -53
- package/src/theme/config/types.ts +0 -46
- package/src/theme/defaults/colorPalette.ts +0 -5
- package/src/theme/defaults/colorTokens.ts +0 -648
- package/src/theme/defaults/config.ts +0 -84
- package/src/theme/defaults/fonts.ts +0 -227
- package/src/theme/getScopedTheme.ts +0 -98
- package/src/theme/index.ts +0 -5
- package/src/theme/system/avatar.ts +0 -14
- package/src/theme/system/color/_constants.ts +0 -45
- package/src/theme/system/color/_helpers.ts +0 -24
- package/src/theme/system/color/_system.ts +0 -40
- package/src/theme/system/color/avatar.ts +0 -15
- package/src/theme/system/color/badge.ts +0 -16
- package/src/theme/system/color/button.ts +0 -17
- package/src/theme/system/color/color.ts +0 -34
- package/src/theme/system/color/index.ts +0 -13
- package/src/theme/system/color/input.ts +0 -25
- package/src/theme/system/color/kbd.ts +0 -8
- package/src/theme/system/color/selectable.ts +0 -12
- package/src/theme/system/color/shadow.ts +0 -7
- package/src/theme/system/color/state.ts +0 -43
- package/src/theme/system/color/syntax.ts +0 -41
- package/src/theme/system/css.ts +0 -14
- package/src/theme/system/focusRing.ts +0 -7
- package/src/theme/system/font.ts +0 -52
- package/src/theme/system/index.ts +0 -11
- package/src/theme/system/input.ts +0 -33
- package/src/theme/system/layer.ts +0 -8
- package/src/theme/system/shadow.ts +0 -19
- package/src/theme/system/styles.ts +0 -13
- package/src/theme/system/theme.ts +0 -138
- package/src/theme/system/v0/avatar.ts +0 -10
- package/src/theme/system/v0/color/_generic.ts +0 -35
- package/src/theme/system/v0/color/_system.ts +0 -17
- package/src/theme/system/v0/color/base.ts +0 -21
- package/src/theme/system/v0/color/button.ts +0 -42
- package/src/theme/system/v0/color/card.ts +0 -19
- package/src/theme/system/v0/color/color.ts +0 -40
- package/src/theme/system/v0/color/index.ts +0 -11
- package/src/theme/system/v0/color/input.ts +0 -34
- package/src/theme/system/v0/color/muted.ts +0 -26
- package/src/theme/system/v0/color/selectable.ts +0 -31
- package/src/theme/system/v0/color/solid.ts +0 -26
- package/src/theme/system/v0/color/spot.ts +0 -13
- package/src/theme/system/v0/index.ts +0 -3
- package/src/theme/system/v0/input.ts +0 -23
- package/src/theme/versioning/getTheme_v2.ts +0 -57
- package/src/theme/versioning/index.ts +0 -5
- package/src/theme/versioning/is_v0.ts +0 -6
- package/src/theme/versioning/is_v2.ts +0 -6
- package/src/theme/versioning/themeColor_v0_v2.ts +0 -243
- package/src/theme/versioning/themeColor_v2_v2_9.ts +0 -49
- package/src/theme/versioning/v0_v2.ts +0 -94
- package/src/theme/versioning/v2_v0.ts +0 -135
|
@@ -0,0 +1,928 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { KIT_SCOPE } from "./surfaces.js";
|
|
3
|
+
import { eventKey } from "../lib/key-event.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { motion, useMotionValue, useReducedMotion } from "framer-motion";
|
|
7
|
+
import { createPortal } from "react-dom";
|
|
8
|
+
//#region src/ui/floating-panel.tsx
|
|
9
|
+
/**
|
|
10
|
+
* FloatingPanel (CPO D54): ONE primitive for every non-modal window over the work surface. It owns drag, magnetic snap,
|
|
11
|
+
* resize and "remember where I put it"; the ⌘J assistant (D30) and the component properties panel both use it.
|
|
12
|
+
*
|
|
13
|
+
* geometry track() · snapRect() · <SnapGuides> · <ResizeEdges> (4 edges + 4 corners) · <ResizeGrip> (keyboard)
|
|
14
|
+
* (the low-level pieces, shared with the assistant's floating window)
|
|
15
|
+
* <FloatingPanel> a small properties window anchored to the thing it edits:
|
|
16
|
+
* float (≥768 with a mouse) docks in the editor column's right gutter (≥356px), else the left gutter, else it
|
|
17
|
+
* overlays the right edge; avoids a floating assistant, the Publish tray and the 56px navbar. While docked
|
|
18
|
+
* it follows the anchor's top (sticky between 72px from the top and 16px from the bottom); once dragged it
|
|
19
|
+
* stays where it was put. 340 × auto (≤560), resizable 300×240 … 520 × (viewport − 96). Header = drag
|
|
20
|
+
* handle; double-click resets it to its docked default. Side, offset and size persist per user and per
|
|
21
|
+
* width bucket (≥1280 · 768–1279).
|
|
22
|
+
* side (768–1279 on touch) a 340px right sheet, no scrim.
|
|
23
|
+
* sheet (<768) a bottom sheet, 50% or 90% tall; drag the grabber down to close.
|
|
24
|
+
* modal inside a D49 ExpandedEditorModal (`container`): docked into the modal's right 340px (the reading column
|
|
25
|
+
* shifts left), or over the modal's edge when it is narrow.
|
|
26
|
+
* Non-modal: `role="dialog"` + `aria-modal="false"`, no focus trap, outside clicks never close it. Esc closes (menus,
|
|
27
|
+
* pickers and field drafts first), F6 moves focus between the panel and `focusBack()`. Marked `data-floating-layer`.
|
|
28
|
+
* Layering: canvas toolbars < panel 52 (= the D30 window) < sheets 55 < dialogs 60 < menus 80 < tooltips 90.
|
|
29
|
+
*/
|
|
30
|
+
var NAV = 56;
|
|
31
|
+
var SNAP = 16;
|
|
32
|
+
var EDGE = 16;
|
|
33
|
+
var Z_FLOAT = "z-[var(--kit-z-float,52)]";
|
|
34
|
+
var EASE = [
|
|
35
|
+
.32,
|
|
36
|
+
.72,
|
|
37
|
+
0,
|
|
38
|
+
1
|
|
39
|
+
];
|
|
40
|
+
var NO_GUIDES = {
|
|
41
|
+
v: [],
|
|
42
|
+
h: []
|
|
43
|
+
};
|
|
44
|
+
var vw = () => window.innerWidth;
|
|
45
|
+
var vh = () => window.innerHeight;
|
|
46
|
+
var clampN = (n, lo, hi) => Math.max(lo, Math.min(hi, n));
|
|
47
|
+
function fitRect(g, b) {
|
|
48
|
+
const w = clampN(g.w, b.minW, Math.max(b.minW, b.maxW()));
|
|
49
|
+
const h = clampN(g.h, b.minH, Math.max(b.minH, b.maxH()));
|
|
50
|
+
return {
|
|
51
|
+
w,
|
|
52
|
+
h,
|
|
53
|
+
x: clampN(g.x, b.pad, Math.max(b.pad, vw() - w - b.pad)),
|
|
54
|
+
y: clampN(g.y, b.top, Math.max(b.top, vh() - h - b.pad))
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** Clamp to the viewport, then pull any edge within SNAP px of a line onto it (the nearest wins). */
|
|
58
|
+
function snapRect(x, y, w, h, lines, b) {
|
|
59
|
+
let nx = clampN(x, b.pad, Math.max(b.pad, vw() - w - b.pad));
|
|
60
|
+
let ny = clampN(y, b.top, Math.max(b.top, vh() - h - b.pad));
|
|
61
|
+
const g = {
|
|
62
|
+
v: [],
|
|
63
|
+
h: []
|
|
64
|
+
};
|
|
65
|
+
let best = 17;
|
|
66
|
+
let gx = null;
|
|
67
|
+
let sx = nx;
|
|
68
|
+
for (const L of lines.v) {
|
|
69
|
+
const a = Math.abs(nx - L);
|
|
70
|
+
if (a <= 16 && a < best) best = a, sx = L, gx = L - 1;
|
|
71
|
+
const z = Math.abs(nx + w - L);
|
|
72
|
+
if (z <= 16 && z < best) best = z, sx = L - w, gx = L;
|
|
73
|
+
}
|
|
74
|
+
nx = sx;
|
|
75
|
+
if (gx != null) g.v.push(gx);
|
|
76
|
+
best = 17;
|
|
77
|
+
let gy = null;
|
|
78
|
+
let sy = ny;
|
|
79
|
+
for (const L of lines.h) {
|
|
80
|
+
const a = Math.abs(ny - L);
|
|
81
|
+
if (a <= 16 && a < best) best = a, sy = L, gy = L - 1;
|
|
82
|
+
const z = Math.abs(ny + h - L);
|
|
83
|
+
if (z <= 16 && z < best) best = z, sy = L - h, gy = L;
|
|
84
|
+
}
|
|
85
|
+
ny = sy;
|
|
86
|
+
if (gy != null) g.h.push(gy);
|
|
87
|
+
return {
|
|
88
|
+
x: nx,
|
|
89
|
+
y: ny,
|
|
90
|
+
g
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/** Runs a pointer drag on window-level listeners (works from any handle, survives leaving the element). */
|
|
94
|
+
function track(e, onMove, onEnd, cursor) {
|
|
95
|
+
const sx = e.clientX;
|
|
96
|
+
const sy = e.clientY;
|
|
97
|
+
let moved = false;
|
|
98
|
+
if (cursor) document.body.style.cursor = cursor;
|
|
99
|
+
document.body.style.userSelect = "none";
|
|
100
|
+
const move = (ev) => {
|
|
101
|
+
const dx = ev.clientX - sx;
|
|
102
|
+
const dy = ev.clientY - sy;
|
|
103
|
+
if (!moved && Math.abs(dx) + Math.abs(dy) < 3) return;
|
|
104
|
+
moved = true;
|
|
105
|
+
onMove(dx, dy);
|
|
106
|
+
};
|
|
107
|
+
const up = () => {
|
|
108
|
+
window.removeEventListener("pointermove", move);
|
|
109
|
+
window.removeEventListener("pointerup", up);
|
|
110
|
+
window.removeEventListener("pointercancel", up);
|
|
111
|
+
document.body.style.cursor = "";
|
|
112
|
+
document.body.style.userSelect = "";
|
|
113
|
+
onEnd(moved);
|
|
114
|
+
};
|
|
115
|
+
window.addEventListener("pointermove", move);
|
|
116
|
+
window.addEventListener("pointerup", up);
|
|
117
|
+
window.addEventListener("pointercancel", up);
|
|
118
|
+
}
|
|
119
|
+
/** Magnetic guides: a 1px hairline along each line the window is snapped to. */
|
|
120
|
+
function SnapGuides({ guides }) {
|
|
121
|
+
const line = cn("pointer-events-none fixed bg-[var(--kit-brand)]", Z_FLOAT);
|
|
122
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [guides.v.map((p) => /* @__PURE__ */ jsx("span", {
|
|
123
|
+
"aria-hidden": true,
|
|
124
|
+
className: line,
|
|
125
|
+
style: {
|
|
126
|
+
left: p,
|
|
127
|
+
top: 8,
|
|
128
|
+
bottom: 8,
|
|
129
|
+
width: 1
|
|
130
|
+
}
|
|
131
|
+
}, `v${p}`)), guides.h.map((p) => /* @__PURE__ */ jsx("span", {
|
|
132
|
+
"aria-hidden": true,
|
|
133
|
+
className: line,
|
|
134
|
+
style: {
|
|
135
|
+
top: p,
|
|
136
|
+
left: 8,
|
|
137
|
+
right: 8,
|
|
138
|
+
height: 1
|
|
139
|
+
}
|
|
140
|
+
}, `h${p}`))] });
|
|
141
|
+
}
|
|
142
|
+
var HANDLES = [
|
|
143
|
+
{
|
|
144
|
+
d: "n",
|
|
145
|
+
cls: "inset-x-3 top-0 h-1.5",
|
|
146
|
+
cursor: "ns-resize"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
d: "s",
|
|
150
|
+
cls: "inset-x-3 bottom-0 h-1.5",
|
|
151
|
+
cursor: "ns-resize"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
d: "w",
|
|
155
|
+
cls: "inset-y-3 left-0 w-1.5",
|
|
156
|
+
cursor: "ew-resize"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
d: "e",
|
|
160
|
+
cls: "inset-y-3 right-0 w-1.5",
|
|
161
|
+
cursor: "ew-resize"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
d: "nw",
|
|
165
|
+
cls: "left-0 top-0 size-3",
|
|
166
|
+
cursor: "nwse-resize"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
d: "se",
|
|
170
|
+
cls: "bottom-0 right-0 size-3",
|
|
171
|
+
cursor: "nwse-resize"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
d: "ne",
|
|
175
|
+
cls: "right-0 top-0 size-3",
|
|
176
|
+
cursor: "nesw-resize"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
d: "sw",
|
|
180
|
+
cls: "bottom-0 left-0 size-3",
|
|
181
|
+
cursor: "nesw-resize"
|
|
182
|
+
}
|
|
183
|
+
];
|
|
184
|
+
/** Resize from 4 edges and 4 corners. `onStart` runs before the first read (e.g. turn an auto height into a number). */
|
|
185
|
+
function ResizeEdges({ geom, bounds, onStart, onEnd }) {
|
|
186
|
+
const { x, y, w, h } = geom;
|
|
187
|
+
return /* @__PURE__ */ jsx(Fragment, { children: HANDLES.map((hd) => /* @__PURE__ */ jsx("div", {
|
|
188
|
+
"aria-hidden": true,
|
|
189
|
+
style: { cursor: hd.cursor },
|
|
190
|
+
className: cn("absolute z-30 touch-none", hd.cls),
|
|
191
|
+
onPointerDown: (e) => {
|
|
192
|
+
if (e.button !== 0) return;
|
|
193
|
+
e.preventDefault();
|
|
194
|
+
e.stopPropagation();
|
|
195
|
+
onStart?.();
|
|
196
|
+
const o = {
|
|
197
|
+
x: x.get(),
|
|
198
|
+
y: y.get(),
|
|
199
|
+
w: w.get(),
|
|
200
|
+
h: h.get()
|
|
201
|
+
};
|
|
202
|
+
const maxW = bounds.maxW();
|
|
203
|
+
const maxH = bounds.maxH();
|
|
204
|
+
track(e, (dx, dy) => {
|
|
205
|
+
let nw = o.w;
|
|
206
|
+
let nh = o.h;
|
|
207
|
+
if (hd.d.includes("e")) nw = o.w + dx;
|
|
208
|
+
if (hd.d.includes("w")) nw = o.w - dx;
|
|
209
|
+
if (hd.d.includes("s")) nh = o.h + dy;
|
|
210
|
+
if (hd.d.includes("n")) nh = o.h - dy;
|
|
211
|
+
nw = clampN(nw, bounds.minW, maxW);
|
|
212
|
+
nh = clampN(nh, bounds.minH, maxH);
|
|
213
|
+
const nx = clampN(hd.d.includes("w") ? o.x + o.w - nw : o.x, bounds.pad, vw() - nw - bounds.pad);
|
|
214
|
+
const ny = clampN(hd.d.includes("n") ? o.y + o.h - nh : o.y, bounds.top, vh() - nh - bounds.pad);
|
|
215
|
+
x.set(nx);
|
|
216
|
+
y.set(ny);
|
|
217
|
+
w.set(nw);
|
|
218
|
+
h.set(nh);
|
|
219
|
+
}, (moved) => moved && onEnd(hd.d), hd.cursor);
|
|
220
|
+
}
|
|
221
|
+
}, hd.d)) });
|
|
222
|
+
}
|
|
223
|
+
/** Keyboard resize: a focusable grip (role="separator"). ←/→ width, ↑/↓ height (±16, Shift ±64); grows toward the open side. */
|
|
224
|
+
function ResizeGrip({ geom, bounds, label, onStart, onEnd, className }) {
|
|
225
|
+
const { x, y, w, h } = geom;
|
|
226
|
+
const [size, setSize] = React.useState(() => ({
|
|
227
|
+
w: Math.round(w.get()),
|
|
228
|
+
h: Math.round(h.get())
|
|
229
|
+
}));
|
|
230
|
+
return /* @__PURE__ */ jsx("div", {
|
|
231
|
+
role: "separator",
|
|
232
|
+
tabIndex: 0,
|
|
233
|
+
"aria-label": label,
|
|
234
|
+
"aria-valuetext": `${size.w} by ${size.h} pixels`,
|
|
235
|
+
"aria-keyshortcuts": "ArrowLeft ArrowRight ArrowUp ArrowDown",
|
|
236
|
+
onFocus: () => setSize({
|
|
237
|
+
w: Math.round(w.get()),
|
|
238
|
+
h: Math.round(h.get())
|
|
239
|
+
}),
|
|
240
|
+
onKeyDown: (e) => {
|
|
241
|
+
const step = e.shiftKey ? 64 : 16;
|
|
242
|
+
const dw = e.key === "ArrowRight" ? step : e.key === "ArrowLeft" ? -step : 0;
|
|
243
|
+
const dh = e.key === "ArrowDown" ? step : e.key === "ArrowUp" ? -step : 0;
|
|
244
|
+
if (!dw && !dh) return;
|
|
245
|
+
e.preventDefault();
|
|
246
|
+
e.stopPropagation();
|
|
247
|
+
onStart?.();
|
|
248
|
+
const nw = clampN(w.get() + dw, bounds.minW, bounds.maxW());
|
|
249
|
+
const nh = clampN(h.get() + dh, bounds.minH, bounds.maxH());
|
|
250
|
+
x.set(clampN(x.get(), bounds.pad, Math.max(bounds.pad, vw() - nw - bounds.pad)));
|
|
251
|
+
y.set(clampN(y.get(), bounds.top, Math.max(bounds.top, vh() - nh - bounds.pad)));
|
|
252
|
+
w.set(nw);
|
|
253
|
+
h.set(nh);
|
|
254
|
+
setSize({
|
|
255
|
+
w: Math.round(nw),
|
|
256
|
+
h: Math.round(nh)
|
|
257
|
+
});
|
|
258
|
+
onEnd();
|
|
259
|
+
},
|
|
260
|
+
className: cn("group/kgrip pointer-events-none absolute bottom-0.5 right-0.5 z-40 flex size-4 items-end justify-end rounded-kit-sm outline-none", className),
|
|
261
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
262
|
+
"aria-hidden": true,
|
|
263
|
+
viewBox: "0 0 10 10",
|
|
264
|
+
className: "size-2.5 text-kit-fg-4 opacity-0 transition-opacity group-focus-visible/kgrip:opacity-100",
|
|
265
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
266
|
+
d: "M9 3 3 9M9 6 6 9",
|
|
267
|
+
stroke: "currentColor",
|
|
268
|
+
strokeWidth: "1.2",
|
|
269
|
+
strokeLinecap: "round"
|
|
270
|
+
})
|
|
271
|
+
})
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
var PREFS_KEY = "bcms-kit-floating-panel";
|
|
275
|
+
var prefListeners = /* @__PURE__ */ new Set();
|
|
276
|
+
function readPrefs() {
|
|
277
|
+
try {
|
|
278
|
+
const raw = typeof localStorage === "undefined" ? null : localStorage.getItem(PREFS_KEY);
|
|
279
|
+
const parsed = raw ? JSON.parse(raw) : null;
|
|
280
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
281
|
+
} catch {
|
|
282
|
+
return {};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
var prefState = {
|
|
286
|
+
prefs: readPrefs(),
|
|
287
|
+
patch: (key, p) => {
|
|
288
|
+
const next = p === null ? {} : {
|
|
289
|
+
...prefState.prefs[key],
|
|
290
|
+
...p
|
|
291
|
+
};
|
|
292
|
+
for (const k of Object.keys(next)) if (next[k] === void 0) delete next[k];
|
|
293
|
+
prefState.prefs = {
|
|
294
|
+
...prefState.prefs,
|
|
295
|
+
[key]: next
|
|
296
|
+
};
|
|
297
|
+
try {
|
|
298
|
+
localStorage.setItem(PREFS_KEY, JSON.stringify(prefState.prefs));
|
|
299
|
+
} catch {}
|
|
300
|
+
prefListeners.forEach((l) => l());
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
var subscribePrefs = (l) => {
|
|
304
|
+
prefListeners.add(l);
|
|
305
|
+
return () => prefListeners.delete(l);
|
|
306
|
+
};
|
|
307
|
+
/** Read the remembered placements with a selector; `useFloatingPanelPrefs.getState()` for imperative reads and writes. */
|
|
308
|
+
function useFloatingPanelPrefs(select) {
|
|
309
|
+
return React.useSyncExternalStore(subscribePrefs, () => select(prefState), () => select(prefState));
|
|
310
|
+
}
|
|
311
|
+
useFloatingPanelPrefs.getState = () => prefState;
|
|
312
|
+
var bucketNow = () => vw() >= 1280 ? "wide" : "mid";
|
|
313
|
+
function useMedia(q) {
|
|
314
|
+
const [ok, setOk] = React.useState(() => typeof window !== "undefined" && window.matchMedia(q).matches);
|
|
315
|
+
React.useEffect(() => {
|
|
316
|
+
const m = window.matchMedia(q);
|
|
317
|
+
const on = () => setOk(m.matches);
|
|
318
|
+
on();
|
|
319
|
+
m.addEventListener("change", on);
|
|
320
|
+
return () => m.removeEventListener("change", on);
|
|
321
|
+
}, [q]);
|
|
322
|
+
return ok;
|
|
323
|
+
}
|
|
324
|
+
/** How a panel presents at this width and pointer: float · side (tablet touch) · sheet (phones) · modal (inside a D49 modal). */
|
|
325
|
+
function usePanelMode(inModal) {
|
|
326
|
+
const phone = useMedia("(max-width: 767px)");
|
|
327
|
+
const touchTablet = useMedia("(max-width: 1279px) and (pointer: coarse)");
|
|
328
|
+
if (inModal) return "modal";
|
|
329
|
+
return phone ? "sheet" : touchTablet ? "side" : "float";
|
|
330
|
+
}
|
|
331
|
+
function scrollParent(el) {
|
|
332
|
+
let p = el?.parentElement ?? null;
|
|
333
|
+
while (p && p !== document.body && p !== document.documentElement) {
|
|
334
|
+
const o = getComputedStyle(p).overflowY;
|
|
335
|
+
if ((o === "auto" || o === "scroll") && p.scrollHeight > p.clientHeight) return p;
|
|
336
|
+
p = p.parentElement;
|
|
337
|
+
}
|
|
338
|
+
return null;
|
|
339
|
+
}
|
|
340
|
+
/** Things a panel never covers by default: a floating or docked assistant, anything marked `data-floating-avoid`. */
|
|
341
|
+
var AVOID = "#assistant-panel, [data-floating-avoid]";
|
|
342
|
+
/** Right-side panels of the page (the editor's Publishing · History · Comments): the panel takes the other side. */
|
|
343
|
+
var SIDE_PANELS = "[data-doc-settings], [data-side-panel]";
|
|
344
|
+
/** A menu, picker, popover or another dialog is open: it takes Esc first. */
|
|
345
|
+
/** An open Base UI popup (popover, menu, select, combobox): it carries data-open and data-side. Kit tooltips don't count. */
|
|
346
|
+
var POPUP_OPEN = "[data-open][data-side]:not([data-kit-tooltip])";
|
|
347
|
+
/** A tooltip (the kit's, or the host's `data-slot="tooltip-content"`), its positioner or arrow: a hint left open never takes Esc. */
|
|
348
|
+
var TOOLTIP = "[data-kit-tooltip], [data-slot=tooltip-content]";
|
|
349
|
+
var isTooltip = (n) => !!n.closest(TOOLTIP) || !!n.querySelector(TOOLTIP);
|
|
350
|
+
var OWNS_ESCAPE = `[role=menu],[role=listbox],[data-cell-editing],${POPUP_OPEN}`;
|
|
351
|
+
function layerOpen(self) {
|
|
352
|
+
if (document.querySelector("[data-cell-editing]") || Array.from(document.querySelectorAll(POPUP_OPEN)).some((n) => !isTooltip(n))) return true;
|
|
353
|
+
const floating = (n) => n.getAttribute("role") === "menu" || !!n.closest("[data-floating-layer]:not([data-floating-panel])");
|
|
354
|
+
if (Array.from(document.querySelectorAll("[role=menu], [role=listbox]")).some((n) => n.getClientRects().length && floating(n))) return true;
|
|
355
|
+
return Array.from(document.querySelectorAll("[role=dialog]:is([data-open],[data-state=open])")).some((d) => d !== self && !d.hasAttribute("data-expanded-editor") && !d.hasAttribute("data-floating-panel") && d.id !== "assistant-panel" && !d.hasAttribute("data-doc-panel"));
|
|
356
|
+
}
|
|
357
|
+
var FOCUSABLE = "input:not([type=hidden]):not([disabled]), textarea:not([disabled]), [contenteditable=true], select:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex='-1'])";
|
|
358
|
+
/** Events from the panel never reach the React tree it was rendered from (the card, the editor around it). */
|
|
359
|
+
var stop = (e) => e.stopPropagation();
|
|
360
|
+
var FENCE = {
|
|
361
|
+
onFocus: stop,
|
|
362
|
+
onBlur: stop,
|
|
363
|
+
onClick: stop,
|
|
364
|
+
onDoubleClick: stop,
|
|
365
|
+
onMouseDown: stop,
|
|
366
|
+
onMouseUp: stop,
|
|
367
|
+
onMouseMove: stop,
|
|
368
|
+
onInput: stop,
|
|
369
|
+
onPaste: stop,
|
|
370
|
+
onCut: stop,
|
|
371
|
+
onCopy: stop,
|
|
372
|
+
onKeyUp: stop,
|
|
373
|
+
onContextMenu: stop
|
|
374
|
+
};
|
|
375
|
+
var PANEL_W = 340;
|
|
376
|
+
var PANEL_MAX_AUTO_H = 560;
|
|
377
|
+
var TOP_LIMIT = 72;
|
|
378
|
+
var BOTTOM_GAP = 16;
|
|
379
|
+
var FLOAT_BOUNDS = {
|
|
380
|
+
minW: 300,
|
|
381
|
+
minH: 240,
|
|
382
|
+
maxW: () => Math.min(520, vw() - 32),
|
|
383
|
+
maxH: () => vh() - 96,
|
|
384
|
+
top: 60,
|
|
385
|
+
pad: 8
|
|
386
|
+
};
|
|
387
|
+
var FloatingPanel = React.forwardRef(function FloatingPanel({ id, labelledBy, anchor, container, header, children, sheetFooter, onClose, focusBack, instant, bodyClassName, onPanelKeyDown }, handle) {
|
|
388
|
+
const reduce = useReducedMotion();
|
|
389
|
+
const mode = usePanelMode(!!container);
|
|
390
|
+
const root = React.useRef(null);
|
|
391
|
+
const live = React.useRef(null);
|
|
392
|
+
const [bucket, setBucket] = React.useState(bucketNow);
|
|
393
|
+
const key = `${id}:${bucket}`;
|
|
394
|
+
const pref = useFloatingPanelPrefs((s) => s.prefs[key]) ?? EMPTY;
|
|
395
|
+
const patch = (p) => {
|
|
396
|
+
useFloatingPanelPrefs.getState().patch(key, p);
|
|
397
|
+
prefRef.current = useFloatingPanelPrefs.getState().prefs[key] ?? EMPTY;
|
|
398
|
+
};
|
|
399
|
+
const x = useMotionValue(-9999);
|
|
400
|
+
const y = useMotionValue(-9999);
|
|
401
|
+
const w = useMotionValue(pref.w ?? 340);
|
|
402
|
+
const h = useMotionValue(pref.h ?? 0);
|
|
403
|
+
const geom = React.useMemo(() => ({
|
|
404
|
+
x,
|
|
405
|
+
y,
|
|
406
|
+
w,
|
|
407
|
+
h
|
|
408
|
+
}), [
|
|
409
|
+
x,
|
|
410
|
+
y,
|
|
411
|
+
w,
|
|
412
|
+
h
|
|
413
|
+
]);
|
|
414
|
+
const [explicitH, setExplicitH] = React.useState(!!pref.h);
|
|
415
|
+
const [maxAuto, setMaxAuto] = React.useState(PANEL_MAX_AUTO_H);
|
|
416
|
+
const [guides, setGuides] = React.useState(NO_GUIDES);
|
|
417
|
+
const [kbd, setKbd] = React.useState(null);
|
|
418
|
+
const [sheetH, setSheetH] = React.useState(50);
|
|
419
|
+
const busy = React.useRef(false);
|
|
420
|
+
const prefRef = React.useRef(pref);
|
|
421
|
+
prefRef.current = pref;
|
|
422
|
+
const kbdRef = React.useRef(kbd);
|
|
423
|
+
kbdRef.current = kbd;
|
|
424
|
+
const closeRef = React.useRef(onClose);
|
|
425
|
+
closeRef.current = onClose;
|
|
426
|
+
const backRef = React.useRef(focusBack);
|
|
427
|
+
backRef.current = focusBack;
|
|
428
|
+
React.useEffect(() => {
|
|
429
|
+
const on = () => setBucket(bucketNow());
|
|
430
|
+
window.addEventListener("resize", on);
|
|
431
|
+
return () => window.removeEventListener("resize", on);
|
|
432
|
+
}, []);
|
|
433
|
+
React.useEffect(() => {
|
|
434
|
+
w.set(pref.w ?? 340);
|
|
435
|
+
setExplicitH(!!pref.h);
|
|
436
|
+
if (pref.h) h.set(pref.h);
|
|
437
|
+
}, [key]);
|
|
438
|
+
const column = React.useCallback(() => (anchor?.closest("[data-rt-editor]") ?? anchor)?.getBoundingClientRect() ?? null, [anchor]);
|
|
439
|
+
/** Where the panel sits now (float mode): its remembered spot, or docked beside the column, following the anchor. */
|
|
440
|
+
const layout = React.useCallback(() => {
|
|
441
|
+
const el = root.current;
|
|
442
|
+
if (!el || !anchor || mode !== "float" || busy.current || kbdRef.current) return;
|
|
443
|
+
const p = prefRef.current;
|
|
444
|
+
const sc = scrollParent(anchor)?.getBoundingClientRect();
|
|
445
|
+
const top = Math.max(TOP_LIMIT, (sc?.top ?? 0) + 8);
|
|
446
|
+
let bottom = vh() - BOTTOM_GAP;
|
|
447
|
+
const tray = document.querySelector("[data-action-tray]")?.getBoundingClientRect();
|
|
448
|
+
if (tray && tray.height && tray.top > top + 240) bottom = Math.min(bottom, tray.top - 8);
|
|
449
|
+
if (sc && sc.bottom > top + 240) bottom = Math.min(bottom, sc.bottom - 8);
|
|
450
|
+
const room = Math.max(FLOAT_BOUNDS.minH, bottom - top);
|
|
451
|
+
const nextMax = Math.min(PANEL_MAX_AUTO_H, room);
|
|
452
|
+
setMaxAuto((m) => m === nextMax ? m : nextMax);
|
|
453
|
+
const ww = w.get();
|
|
454
|
+
const ph = Math.min(el.offsetHeight || 320, room);
|
|
455
|
+
if (p.pos) {
|
|
456
|
+
x.set(clampN(p.pos.x, 8, Math.max(8, vw() - ww - 8)));
|
|
457
|
+
y.set(clampN(p.pos.y, 60, Math.max(60, vh() - ph - 8)));
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
const col = column();
|
|
461
|
+
const a = anchor.getBoundingClientRect();
|
|
462
|
+
if (!col) return;
|
|
463
|
+
let L = Math.max(8, sc?.left ?? 0);
|
|
464
|
+
let R = Math.min(vw() - 8, sc?.right ?? vw());
|
|
465
|
+
for (const o of Array.from(document.querySelectorAll(AVOID))) {
|
|
466
|
+
if (o === el || el.contains(o)) continue;
|
|
467
|
+
const r = o.getBoundingClientRect();
|
|
468
|
+
if (!r.width || !r.height || r.bottom < top || r.top > bottom) continue;
|
|
469
|
+
if (r.left + r.width / 2 < col.left + col.width / 2) L = Math.max(L, r.right);
|
|
470
|
+
else R = Math.min(R, r.left);
|
|
471
|
+
}
|
|
472
|
+
const need = ww + 16;
|
|
473
|
+
const fits = {
|
|
474
|
+
right: R - col.right >= need,
|
|
475
|
+
left: col.left - L >= need
|
|
476
|
+
};
|
|
477
|
+
const rightBusy = Array.from(document.querySelectorAll(SIDE_PANELS)).some((n) => n.getBoundingClientRect().width > 40);
|
|
478
|
+
const nx = (p.side ?? (rightBusy ? "left" : fits.right ? "right" : fits.left ? "left" : "right")) === "right" ? fits.right ? col.right + 16 : R - ww - 8 : fits.left ? col.left - 16 - ww : L + 8;
|
|
479
|
+
x.set(clampN(nx, 8, Math.max(8, vw() - ww - 8)));
|
|
480
|
+
y.set(clampN(a.top, top, Math.max(top, bottom - ph)));
|
|
481
|
+
}, [
|
|
482
|
+
anchor,
|
|
483
|
+
mode,
|
|
484
|
+
column,
|
|
485
|
+
w,
|
|
486
|
+
x,
|
|
487
|
+
y
|
|
488
|
+
]);
|
|
489
|
+
React.useLayoutEffect(() => {
|
|
490
|
+
layout();
|
|
491
|
+
}, [
|
|
492
|
+
layout,
|
|
493
|
+
pref.pos,
|
|
494
|
+
pref.side,
|
|
495
|
+
pref.w,
|
|
496
|
+
explicitH
|
|
497
|
+
]);
|
|
498
|
+
React.useEffect(() => {
|
|
499
|
+
if (mode !== "float") return;
|
|
500
|
+
let raf = 0;
|
|
501
|
+
let settle = 0;
|
|
502
|
+
const on = () => {
|
|
503
|
+
cancelAnimationFrame(raf);
|
|
504
|
+
raf = requestAnimationFrame(layout);
|
|
505
|
+
window.clearTimeout(settle);
|
|
506
|
+
settle = window.setTimeout(layout, 320);
|
|
507
|
+
};
|
|
508
|
+
window.addEventListener("scroll", on, true);
|
|
509
|
+
window.addEventListener("resize", on);
|
|
510
|
+
window.addEventListener("pointerup", on);
|
|
511
|
+
const ro = new ResizeObserver(on);
|
|
512
|
+
if (root.current) ro.observe(root.current);
|
|
513
|
+
if (anchor) ro.observe(anchor);
|
|
514
|
+
const sc = scrollParent(anchor);
|
|
515
|
+
if (sc) ro.observe(sc);
|
|
516
|
+
return () => {
|
|
517
|
+
cancelAnimationFrame(raf);
|
|
518
|
+
window.clearTimeout(settle);
|
|
519
|
+
window.removeEventListener("scroll", on, true);
|
|
520
|
+
window.removeEventListener("resize", on);
|
|
521
|
+
window.removeEventListener("pointerup", on);
|
|
522
|
+
ro.disconnect();
|
|
523
|
+
};
|
|
524
|
+
}, [
|
|
525
|
+
mode,
|
|
526
|
+
layout,
|
|
527
|
+
anchor
|
|
528
|
+
]);
|
|
529
|
+
const [modalFit, setModalFit] = React.useState("dock");
|
|
530
|
+
React.useLayoutEffect(() => {
|
|
531
|
+
if (mode !== "modal" || !container) return;
|
|
532
|
+
const fit = () => {
|
|
533
|
+
const cw = container.clientWidth;
|
|
534
|
+
const next = cw < 560 ? "bottom" : cw >= 1020 ? "dock" : "overlay";
|
|
535
|
+
setModalFit(next);
|
|
536
|
+
if (next === "dock") container.setAttribute("data-floating-dock", "right");
|
|
537
|
+
else container.removeAttribute("data-floating-dock");
|
|
538
|
+
};
|
|
539
|
+
fit();
|
|
540
|
+
const ro = new ResizeObserver(fit);
|
|
541
|
+
ro.observe(container);
|
|
542
|
+
return () => {
|
|
543
|
+
ro.disconnect();
|
|
544
|
+
container.removeAttribute("data-floating-dock");
|
|
545
|
+
};
|
|
546
|
+
}, [mode, container]);
|
|
547
|
+
const toExplicit = () => {
|
|
548
|
+
if (explicitH || !root.current) return;
|
|
549
|
+
h.set(root.current.offsetHeight);
|
|
550
|
+
setExplicitH(true);
|
|
551
|
+
};
|
|
552
|
+
const say = (text) => {
|
|
553
|
+
const el = live.current;
|
|
554
|
+
if (!el) return;
|
|
555
|
+
el.textContent = "";
|
|
556
|
+
window.setTimeout(() => {
|
|
557
|
+
if (live.current) live.current.textContent = text;
|
|
558
|
+
}, 60);
|
|
559
|
+
};
|
|
560
|
+
const reset = () => {
|
|
561
|
+
patch(null);
|
|
562
|
+
setExplicitH(false);
|
|
563
|
+
w.set(340);
|
|
564
|
+
};
|
|
565
|
+
React.useImperativeHandle(handle, () => ({
|
|
566
|
+
dock: (side) => patch({
|
|
567
|
+
side,
|
|
568
|
+
pos: void 0
|
|
569
|
+
}),
|
|
570
|
+
reset,
|
|
571
|
+
keyboard: (m) => {
|
|
572
|
+
if (mode !== "float") return;
|
|
573
|
+
if (m === "resize") toExplicit();
|
|
574
|
+
setKbd({
|
|
575
|
+
mode: m,
|
|
576
|
+
start: {
|
|
577
|
+
x: x.get(),
|
|
578
|
+
y: y.get(),
|
|
579
|
+
w: w.get(),
|
|
580
|
+
h: root.current?.offsetHeight ?? h.get()
|
|
581
|
+
},
|
|
582
|
+
explicit: explicitH
|
|
583
|
+
});
|
|
584
|
+
window.setTimeout(() => root.current?.focus({ preventScroll: true }), 80);
|
|
585
|
+
say(m === "move" ? "Moving the panel. Arrow keys move it, Enter keeps it there, Escape cancels." : "Resizing the panel. Arrow keys resize it, Enter keeps the size, Escape cancels.");
|
|
586
|
+
},
|
|
587
|
+
announce: say,
|
|
588
|
+
el: () => root.current
|
|
589
|
+
}));
|
|
590
|
+
/** Esc: keyboard mode cancels first, then the panel closes and focus goes back to the card. */
|
|
591
|
+
const escape = React.useCallback(() => {
|
|
592
|
+
const k = kbdRef.current;
|
|
593
|
+
if (k) {
|
|
594
|
+
x.set(k.start.x);
|
|
595
|
+
y.set(k.start.y);
|
|
596
|
+
w.set(k.start.w);
|
|
597
|
+
if (!k.explicit) setExplicitH(false);
|
|
598
|
+
else h.set(k.start.h);
|
|
599
|
+
setKbd(null);
|
|
600
|
+
say("Cancelled");
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
closeRef.current();
|
|
604
|
+
backRef.current?.();
|
|
605
|
+
}, [
|
|
606
|
+
x,
|
|
607
|
+
y,
|
|
608
|
+
w,
|
|
609
|
+
h
|
|
610
|
+
]);
|
|
611
|
+
React.useEffect(() => {
|
|
612
|
+
const el = root.current;
|
|
613
|
+
const onKey = (e) => {
|
|
614
|
+
if (el?.contains(e.target)) return;
|
|
615
|
+
if (e.key === "F6") {
|
|
616
|
+
e.preventDefault();
|
|
617
|
+
(Array.from(el?.querySelectorAll(`[data-panel-body] :is(${FOCUSABLE})`) ?? []).find((n) => n.getClientRects().length) ?? el)?.focus({ preventScroll: true });
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
if (e.key !== "Escape" || e.defaultPrevented || layerOpen(el)) return;
|
|
621
|
+
if (!container && document.querySelector("[data-expanded-editor]")) return;
|
|
622
|
+
e.preventDefault();
|
|
623
|
+
escape();
|
|
624
|
+
};
|
|
625
|
+
const onForward = () => escape();
|
|
626
|
+
window.addEventListener("keydown", onKey);
|
|
627
|
+
el?.addEventListener("floatingpanel:escape", onForward);
|
|
628
|
+
return () => {
|
|
629
|
+
window.removeEventListener("keydown", onKey);
|
|
630
|
+
el?.removeEventListener("floatingpanel:escape", onForward);
|
|
631
|
+
};
|
|
632
|
+
}, [container, escape]);
|
|
633
|
+
const keyRef = React.useRef(() => {});
|
|
634
|
+
keyRef.current = (e) => {
|
|
635
|
+
const native = e;
|
|
636
|
+
onPanelKeyDown?.(e);
|
|
637
|
+
const k = kbdRef.current;
|
|
638
|
+
if (k) {
|
|
639
|
+
const step = e.shiftKey ? 64 : 16;
|
|
640
|
+
const dx = e.key === "ArrowRight" ? step : e.key === "ArrowLeft" ? -step : 0;
|
|
641
|
+
const dy = e.key === "ArrowDown" ? step : e.key === "ArrowUp" ? -step : 0;
|
|
642
|
+
if (dx || dy) {
|
|
643
|
+
e.preventDefault();
|
|
644
|
+
if (k.mode === "move") {
|
|
645
|
+
x.set(clampN(x.get() + dx, 8, vw() - w.get() - 8));
|
|
646
|
+
y.set(clampN(y.get() + dy, 60, vh() - h.get() - 8));
|
|
647
|
+
} else {
|
|
648
|
+
w.set(clampN(w.get() + dx, FLOAT_BOUNDS.minW, FLOAT_BOUNDS.maxW()));
|
|
649
|
+
h.set(clampN(h.get() + dy, FLOAT_BOUNDS.minH, FLOAT_BOUNDS.maxH()));
|
|
650
|
+
x.set(clampN(x.get(), 8, vw() - w.get() - 8));
|
|
651
|
+
}
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
if (e.key === "Enter") {
|
|
655
|
+
e.preventDefault();
|
|
656
|
+
patch(k.mode === "move" ? { pos: {
|
|
657
|
+
x: x.get(),
|
|
658
|
+
y: y.get()
|
|
659
|
+
} } : {
|
|
660
|
+
w: w.get(),
|
|
661
|
+
h: h.get(),
|
|
662
|
+
pos: {
|
|
663
|
+
x: x.get(),
|
|
664
|
+
y: y.get()
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
setKbd(null);
|
|
668
|
+
say(k.mode === "move" ? "Panel moved" : "Panel resized");
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
if (e.key === "F6") {
|
|
673
|
+
e.preventDefault();
|
|
674
|
+
backRef.current?.();
|
|
675
|
+
} else if (e.key === "Escape" && !native.bcmsPanelHandled && !e.target.closest?.(OWNS_ESCAPE) && !layerOpen(root.current)) {
|
|
676
|
+
e.preventDefault();
|
|
677
|
+
native.bcmsPanelHandled = true;
|
|
678
|
+
escape();
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
React.useEffect(() => {
|
|
682
|
+
const el = root.current;
|
|
683
|
+
if (!el) return;
|
|
684
|
+
const on = (e) => keyRef.current(e);
|
|
685
|
+
el.addEventListener("keydown", on);
|
|
686
|
+
return () => el.removeEventListener("keydown", on);
|
|
687
|
+
}, [mode]);
|
|
688
|
+
const onKeyDown = (e) => {
|
|
689
|
+
if (!(e.metaKey || e.ctrlKey) || eventKey(e) === "z") e.stopPropagation();
|
|
690
|
+
};
|
|
691
|
+
const onHeaderDown = (e) => {
|
|
692
|
+
if (mode !== "float" || e.button !== 0 || e.target.closest("button, a, input, textarea, [role=menuitem], [contenteditable]")) return;
|
|
693
|
+
e.preventDefault();
|
|
694
|
+
const ox = x.get();
|
|
695
|
+
const oy = y.get();
|
|
696
|
+
const ww = w.get();
|
|
697
|
+
const hh = root.current?.offsetHeight ?? h.get();
|
|
698
|
+
const col = column();
|
|
699
|
+
const lines = {
|
|
700
|
+
v: [
|
|
701
|
+
16,
|
|
702
|
+
vw() - 16,
|
|
703
|
+
...col ? [col.left, col.right] : []
|
|
704
|
+
],
|
|
705
|
+
h: [TOP_LIMIT, vh() - 16]
|
|
706
|
+
};
|
|
707
|
+
busy.current = true;
|
|
708
|
+
track(e, (dx, dy) => {
|
|
709
|
+
const r = snapRect(ox + dx, oy + dy, ww, hh, lines, FLOAT_BOUNDS);
|
|
710
|
+
x.set(r.x);
|
|
711
|
+
y.set(r.y);
|
|
712
|
+
setGuides((g) => g.v.join() === r.g.v.join() && g.h.join() === r.g.h.join() ? g : r.g);
|
|
713
|
+
}, (moved) => {
|
|
714
|
+
busy.current = false;
|
|
715
|
+
setGuides(NO_GUIDES);
|
|
716
|
+
if (moved) patch({ pos: {
|
|
717
|
+
x: x.get(),
|
|
718
|
+
y: y.get()
|
|
719
|
+
} });
|
|
720
|
+
}, "grabbing");
|
|
721
|
+
};
|
|
722
|
+
const headerEl = /* @__PURE__ */ jsx("div", {
|
|
723
|
+
"data-panel-header": "",
|
|
724
|
+
onPointerDown: onHeaderDown,
|
|
725
|
+
onDoubleClick: (e) => {
|
|
726
|
+
if (mode !== "float" || e.target.closest("button, a, input, [role=menuitem]")) return;
|
|
727
|
+
reset();
|
|
728
|
+
},
|
|
729
|
+
className: cn("flex h-10 shrink-0 items-center gap-1 border-b border-kit-line-subtle pl-3 pr-1.5", mode === "float" && "cursor-grab touch-none select-none active:cursor-grabbing"),
|
|
730
|
+
children: header
|
|
731
|
+
});
|
|
732
|
+
const body = /* @__PURE__ */ jsx("div", {
|
|
733
|
+
"data-panel-body": "",
|
|
734
|
+
className: cn("min-h-0 flex-1 overflow-y-auto overscroll-contain", bodyClassName),
|
|
735
|
+
children
|
|
736
|
+
});
|
|
737
|
+
const liveEl = /* @__PURE__ */ jsx("div", {
|
|
738
|
+
ref: live,
|
|
739
|
+
"aria-live": "polite",
|
|
740
|
+
className: "sr-only"
|
|
741
|
+
});
|
|
742
|
+
const common = {
|
|
743
|
+
ref: root,
|
|
744
|
+
role: "dialog",
|
|
745
|
+
"aria-modal": false,
|
|
746
|
+
"aria-labelledby": labelledBy,
|
|
747
|
+
tabIndex: -1,
|
|
748
|
+
...KIT_SCOPE,
|
|
749
|
+
"data-floating-layer": "",
|
|
750
|
+
"data-floating-panel": "",
|
|
751
|
+
"data-state": "open",
|
|
752
|
+
"data-kbd": kbd ? kbd.mode : void 0,
|
|
753
|
+
onKeyDown,
|
|
754
|
+
...FENCE
|
|
755
|
+
};
|
|
756
|
+
const fade = reduce || instant ? { duration: 0 } : {
|
|
757
|
+
duration: .16,
|
|
758
|
+
ease: EASE
|
|
759
|
+
};
|
|
760
|
+
let node;
|
|
761
|
+
if (mode === "sheet") node = /* @__PURE__ */ jsxs(motion.div, {
|
|
762
|
+
...common,
|
|
763
|
+
initial: { y: reduce || instant ? 0 : "100%" },
|
|
764
|
+
animate: { y: 0 },
|
|
765
|
+
transition: reduce || instant ? { duration: 0 } : {
|
|
766
|
+
duration: .24,
|
|
767
|
+
ease: EASE
|
|
768
|
+
},
|
|
769
|
+
style: { height: `${sheetH}dvh` },
|
|
770
|
+
className: "fixed inset-x-0 bottom-0 z-[var(--kit-z-sheet,55)] flex flex-col overflow-hidden rounded-t-kit-xl border-t border-kit-line bg-kit-surface-raised pb-[env(safe-area-inset-bottom)] shadow-kit-sheet-b outline-none",
|
|
771
|
+
children: [
|
|
772
|
+
/* @__PURE__ */ jsx(SheetGrabber, {
|
|
773
|
+
height: sheetH,
|
|
774
|
+
onHeight: setSheetH,
|
|
775
|
+
onClose: () => escape()
|
|
776
|
+
}),
|
|
777
|
+
headerEl,
|
|
778
|
+
body,
|
|
779
|
+
sheetFooter ? /* @__PURE__ */ jsx("div", {
|
|
780
|
+
className: "flex shrink-0 justify-end border-t border-kit-line-subtle px-3 py-2",
|
|
781
|
+
children: sheetFooter
|
|
782
|
+
}) : null,
|
|
783
|
+
liveEl
|
|
784
|
+
]
|
|
785
|
+
});
|
|
786
|
+
else if (mode === "side") node = /* @__PURE__ */ jsxs(motion.div, {
|
|
787
|
+
...common,
|
|
788
|
+
initial: { x: reduce || instant ? 0 : "100%" },
|
|
789
|
+
animate: { x: 0 },
|
|
790
|
+
transition: reduce || instant ? { duration: 0 } : {
|
|
791
|
+
duration: .22,
|
|
792
|
+
ease: EASE
|
|
793
|
+
},
|
|
794
|
+
style: {
|
|
795
|
+
width: 340,
|
|
796
|
+
top: 56
|
|
797
|
+
},
|
|
798
|
+
className: "fixed bottom-0 right-0 z-[var(--kit-z-sheet,55)] flex flex-col border-l border-kit-line bg-kit-surface-raised shadow-kit-sheet-r outline-none",
|
|
799
|
+
children: [
|
|
800
|
+
headerEl,
|
|
801
|
+
body,
|
|
802
|
+
liveEl
|
|
803
|
+
]
|
|
804
|
+
});
|
|
805
|
+
else if (mode === "modal") node = /* @__PURE__ */ jsxs(motion.div, {
|
|
806
|
+
...common,
|
|
807
|
+
initial: { opacity: 0 },
|
|
808
|
+
animate: { opacity: 1 },
|
|
809
|
+
transition: fade,
|
|
810
|
+
style: modalFit === "dock" ? {
|
|
811
|
+
width: 340,
|
|
812
|
+
top: 48,
|
|
813
|
+
right: 0,
|
|
814
|
+
bottom: 0
|
|
815
|
+
} : modalFit === "overlay" ? {
|
|
816
|
+
width: 340,
|
|
817
|
+
top: 56,
|
|
818
|
+
right: 8,
|
|
819
|
+
bottom: 8
|
|
820
|
+
} : {
|
|
821
|
+
left: 0,
|
|
822
|
+
right: 0,
|
|
823
|
+
bottom: 0,
|
|
824
|
+
height: "55%"
|
|
825
|
+
},
|
|
826
|
+
className: cn("absolute z-[20] flex flex-col overflow-hidden bg-kit-surface-raised outline-none", modalFit === "dock" ? "border-l border-kit-line" : modalFit === "overlay" ? "rounded-kit-xl border border-kit-floating-line shadow-kit-lg" : "rounded-t-kit-xl border-t border-kit-line shadow-kit-sheet-b"),
|
|
827
|
+
children: [
|
|
828
|
+
headerEl,
|
|
829
|
+
body,
|
|
830
|
+
liveEl
|
|
831
|
+
]
|
|
832
|
+
});
|
|
833
|
+
else node = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SnapGuides, { guides }), /* @__PURE__ */ jsxs(motion.div, {
|
|
834
|
+
...common,
|
|
835
|
+
style: {
|
|
836
|
+
x,
|
|
837
|
+
y,
|
|
838
|
+
width: w,
|
|
839
|
+
height: explicitH ? h : void 0,
|
|
840
|
+
maxHeight: explicitH ? void 0 : maxAuto,
|
|
841
|
+
left: 0,
|
|
842
|
+
top: 0
|
|
843
|
+
},
|
|
844
|
+
initial: {
|
|
845
|
+
opacity: 0,
|
|
846
|
+
scale: reduce || instant ? 1 : .98
|
|
847
|
+
},
|
|
848
|
+
animate: {
|
|
849
|
+
opacity: 1,
|
|
850
|
+
scale: 1
|
|
851
|
+
},
|
|
852
|
+
transition: fade,
|
|
853
|
+
className: cn("fixed flex flex-col overflow-hidden rounded-kit-xl border bg-kit-surface-raised shadow-kit-xl outline-none", kbd ? "border-dashed border-[var(--kit-emphasis-line)]" : "border-kit-floating-line", Z_FLOAT),
|
|
854
|
+
children: [
|
|
855
|
+
/* @__PURE__ */ jsx(ResizeEdges, {
|
|
856
|
+
geom,
|
|
857
|
+
bounds: FLOAT_BOUNDS,
|
|
858
|
+
onStart: () => {
|
|
859
|
+
busy.current = true;
|
|
860
|
+
toExplicit();
|
|
861
|
+
},
|
|
862
|
+
onEnd: (dir) => {
|
|
863
|
+
busy.current = false;
|
|
864
|
+
const moved = dir.includes("w") || dir.includes("n") || !!prefRef.current.pos;
|
|
865
|
+
patch({
|
|
866
|
+
w: w.get(),
|
|
867
|
+
h: h.get(),
|
|
868
|
+
...moved ? { pos: {
|
|
869
|
+
x: x.get(),
|
|
870
|
+
y: y.get()
|
|
871
|
+
} } : {}
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
}),
|
|
875
|
+
headerEl,
|
|
876
|
+
body,
|
|
877
|
+
/* @__PURE__ */ jsx(ResizeGrip, {
|
|
878
|
+
geom,
|
|
879
|
+
bounds: FLOAT_BOUNDS,
|
|
880
|
+
label: "Resize panel",
|
|
881
|
+
onStart: toExplicit,
|
|
882
|
+
onEnd: () => patch({
|
|
883
|
+
w: w.get(),
|
|
884
|
+
h: h.get(),
|
|
885
|
+
pos: {
|
|
886
|
+
x: x.get(),
|
|
887
|
+
y: y.get()
|
|
888
|
+
}
|
|
889
|
+
})
|
|
890
|
+
}),
|
|
891
|
+
liveEl
|
|
892
|
+
]
|
|
893
|
+
})] });
|
|
894
|
+
return createPortal(node, container ?? document.body);
|
|
895
|
+
});
|
|
896
|
+
var EMPTY = {};
|
|
897
|
+
/** Bottom-sheet grabber: drag down to close, up for 90%; a tap toggles 50% ↔ 90%. */
|
|
898
|
+
function SheetGrabber({ height, onHeight, onClose }) {
|
|
899
|
+
const dy = React.useRef(0);
|
|
900
|
+
const dragged = React.useRef(false);
|
|
901
|
+
return /* @__PURE__ */ jsx("button", {
|
|
902
|
+
type: "button",
|
|
903
|
+
"aria-label": height === 50 ? "Expand panel" : "Shrink panel",
|
|
904
|
+
onPointerDown: (e) => {
|
|
905
|
+
dy.current = 0;
|
|
906
|
+
dragged.current = false;
|
|
907
|
+
track(e, (_dx, d) => {
|
|
908
|
+
dy.current = d;
|
|
909
|
+
dragged.current = true;
|
|
910
|
+
}, (moved) => {
|
|
911
|
+
if (!moved) return;
|
|
912
|
+
if (dy.current > 80) onClose();
|
|
913
|
+
else if (dy.current < -40) onHeight(90);
|
|
914
|
+
else if (dy.current > 40 && height === 90) onHeight(50);
|
|
915
|
+
});
|
|
916
|
+
},
|
|
917
|
+
onClick: () => {
|
|
918
|
+
if (dragged.current) return void (dragged.current = false);
|
|
919
|
+
onHeight(height === 50 ? 90 : 50);
|
|
920
|
+
},
|
|
921
|
+
className: "flex h-5 w-full shrink-0 touch-none items-center justify-center",
|
|
922
|
+
children: /* @__PURE__ */ jsx("span", { className: "h-1 w-9 rounded-full bg-kit-line-strong" })
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
//#endregion
|
|
926
|
+
export { EASE, EDGE, FloatingPanel, NAV, NO_GUIDES, PANEL_W, ResizeEdges, ResizeGrip, SNAP, SnapGuides, Z_FLOAT, clampN, fitRect, snapRect, track, useFloatingPanelPrefs, usePanelMode, vh, vw };
|
|
927
|
+
|
|
928
|
+
//# sourceMappingURL=floating-panel.js.map
|