@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,996 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { KitSectionTitle, useForm, useKitEnv } from "../context.js";
|
|
3
|
+
import { isObj, keyStartsWith, pathKey } from "../lib/path.js";
|
|
4
|
+
import { KitIcon } from "../lib/icons.js";
|
|
5
|
+
import { Segmented } from "../ui/controls.js";
|
|
6
|
+
import { Menu, MenuContent, MenuItem, MenuTrigger, Tooltip } from "../ui/overlay.js";
|
|
7
|
+
import { condCtx, isEmptyValue, isHidden } from "../lib/schema.js";
|
|
8
|
+
import { IssueDot } from "./bits.js";
|
|
9
|
+
import { PeerStack } from "./field-shell.js";
|
|
10
|
+
import { groupSummary } from "./group-summary.js";
|
|
11
|
+
import { SHORT_TEXT_MAX, columnSpans, isColumnField } from "../lib/columns.js";
|
|
12
|
+
import { isIconImage } from "../lib/icon-image.js";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { IconChevronDown, IconChevronRight, IconDeviceDesktop, IconDeviceLaptop, IconDeviceMobile, IconDeviceTablet, IconMessage } from "@tabler/icons-react";
|
|
16
|
+
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
|
|
17
|
+
//#region src/engine/grouping.tsx
|
|
18
|
+
/**
|
|
19
|
+
* GROUPING (CPO D45; V2 HEAD 9829bf1 kit/engine/grouping.tsx + the layout half of kit/engine/field-list.tsx) — the four
|
|
20
|
+
* ways the Block Kit puts fields together, and the rules for nesting them.
|
|
21
|
+
*
|
|
22
|
+
* Group tabs Content · Media · Design · Settings top of a frame only (FieldList)
|
|
23
|
+
* <FieldSection> ────────────────────────────────── a titled set of siblings: hairline above, 36px header,
|
|
24
|
+
* Spacing Top 56 · Bottom 88 › no box, no left rule; collapsed = one-line summary
|
|
25
|
+
* <FieldInset> Rating line a small object (≤3 simple fields): its label, then the
|
|
26
|
+
* │ Stars [ 4.9 / 5 ] children behind ONE 1px --line inset line (D63). No tint,
|
|
27
|
+
* │ Text [ 4.9 from 2,400+ reviews ] no box, no radius: never a box inside a line.
|
|
28
|
+
* <FieldUnit> ┌ Shop cookware Primary › ┐ ONE compound control (button = label + link, image + alt)
|
|
29
|
+
* └ /products ┘
|
|
30
|
+
* Drill row [▣] Desktop › anything bigger, or anything one level deeper
|
|
31
|
+
*
|
|
32
|
+
* Nesting: section (level 1, spacing only) → inset (level 2, the inset line) → level 3+ always drills. Never two
|
|
33
|
+
* containers in one level. Rhythm: field gap 16 · group gap 24, the same gap inside an inset; dense (form width ≤ 360px)
|
|
34
|
+
* 12 · 20; document 20 · 32.
|
|
35
|
+
* Columns (D63, `columnSpans`): side by side only for genuinely short fields (number, switch, select, date, colour, icon,
|
|
36
|
+
* rating, text with max ≤ 24) AND only when the form is at least 420px wide (a container query). Everything else is full
|
|
37
|
+
* width, so a text value never wraps in a cramped column.
|
|
38
|
+
* `<BreakpointGroup>`: per-screen-size objects (desktop / tablet / phone) as ONE group with a segmented switcher.
|
|
39
|
+
*
|
|
40
|
+
* Port notes (kit vs V2): V2 token utilities carry the kit- prefix (text-fg-3 → text-kit-fg-3, bg-well →
|
|
41
|
+
* bg-kit-well, border-field → border-kit-field-border); `motion/react` is `framer-motion`; V2's `scrollbar-none` and
|
|
42
|
+
* `tabular` utilities are written out. V2's FieldList imports KitField directly; here it takes `renderField` so the
|
|
43
|
+
* engine has no grouping ↔ kit-field import cycle.
|
|
44
|
+
*/
|
|
45
|
+
/** Gaps per host. `stack` = between sibling fields; `group` = before a section / after one; `gridY` = rows of a column grid.
|
|
46
|
+
* An inset uses the same field gap as everything else (D63: one rhythm). */
|
|
47
|
+
var RHYTHM = {
|
|
48
|
+
panel: {
|
|
49
|
+
tabs: "pb-4 @max-[360px]:pb-3",
|
|
50
|
+
stack: "gap-4 @max-[360px]:gap-3",
|
|
51
|
+
field: "pt-4 @max-[360px]:pt-3",
|
|
52
|
+
group: "pt-6 @max-[360px]:pt-5",
|
|
53
|
+
gridY: "gap-y-4 @max-[360px]:gap-y-3"
|
|
54
|
+
},
|
|
55
|
+
document: {
|
|
56
|
+
tabs: "pb-5",
|
|
57
|
+
stack: "gap-5",
|
|
58
|
+
field: "pt-5",
|
|
59
|
+
group: "pt-8",
|
|
60
|
+
gridY: "gap-y-5"
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var useRhythm = () => RHYTHM[useKitEnv().variant];
|
|
64
|
+
var InsetDepth = React.createContext(0);
|
|
65
|
+
/** 0 at a frame's top level and inside sections; 1 inside an inset (or an expanded array row). */
|
|
66
|
+
var useInsetDepth = () => React.useContext(InsetDepth);
|
|
67
|
+
/** Mark children as sitting inside one container (array inline rows use this so objects inside them drill). */
|
|
68
|
+
function InsetScope({ children }) {
|
|
69
|
+
const d = React.useContext(InsetDepth);
|
|
70
|
+
return /* @__PURE__ */ jsx(InsetDepth.Provider, {
|
|
71
|
+
value: d + 1,
|
|
72
|
+
children
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function useGroupStatus(paths) {
|
|
76
|
+
const form = useForm();
|
|
77
|
+
const env = useKitEnv();
|
|
78
|
+
let errors = 0;
|
|
79
|
+
let warnings = 0;
|
|
80
|
+
const peers = [];
|
|
81
|
+
let comments = 0;
|
|
82
|
+
const keys = paths.map(pathKey);
|
|
83
|
+
for (const p of paths) {
|
|
84
|
+
const r = form?.rollup(p) ?? {
|
|
85
|
+
errors: 0,
|
|
86
|
+
warnings: 0
|
|
87
|
+
};
|
|
88
|
+
errors += r.errors;
|
|
89
|
+
warnings += r.warnings;
|
|
90
|
+
}
|
|
91
|
+
for (const [k, list] of Object.entries(env.presence)) if (keys.some((g) => keyStartsWith(k, g))) {
|
|
92
|
+
for (const p of list) if (!peers.some((x) => x.name === p.name)) peers.push(p);
|
|
93
|
+
}
|
|
94
|
+
for (const [k, n] of Object.entries(env.comments)) if (keys.some((g) => keyStartsWith(k, g))) comments += n;
|
|
95
|
+
return {
|
|
96
|
+
errors,
|
|
97
|
+
warnings,
|
|
98
|
+
peers,
|
|
99
|
+
comments
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/** A field that animates its height in and out when a condition shows or hides it (D45). `space` = its top spacing. */
|
|
103
|
+
var Appear = React.forwardRef(({ children, space, className }, ref) => {
|
|
104
|
+
const t = {
|
|
105
|
+
duration: useReducedMotion() ? 0 : .2,
|
|
106
|
+
ease: [
|
|
107
|
+
.22,
|
|
108
|
+
1,
|
|
109
|
+
.36,
|
|
110
|
+
1
|
|
111
|
+
]
|
|
112
|
+
};
|
|
113
|
+
const el = React.useRef(null);
|
|
114
|
+
const clip = (on) => {
|
|
115
|
+
if (el.current) el.current.style.overflow = on ? "hidden" : "";
|
|
116
|
+
};
|
|
117
|
+
return /* @__PURE__ */ jsx(motion.div, {
|
|
118
|
+
ref: (n) => {
|
|
119
|
+
el.current = n;
|
|
120
|
+
if (typeof ref === "function") ref(n);
|
|
121
|
+
else if (ref) ref.current = n;
|
|
122
|
+
},
|
|
123
|
+
initial: {
|
|
124
|
+
height: 0,
|
|
125
|
+
opacity: 0
|
|
126
|
+
},
|
|
127
|
+
animate: {
|
|
128
|
+
height: "auto",
|
|
129
|
+
opacity: 1
|
|
130
|
+
},
|
|
131
|
+
exit: {
|
|
132
|
+
height: 0,
|
|
133
|
+
opacity: 0
|
|
134
|
+
},
|
|
135
|
+
transition: t,
|
|
136
|
+
onAnimationStart: () => clip(true),
|
|
137
|
+
onAnimationComplete: () => clip(false),
|
|
138
|
+
className: cn("min-w-0", className),
|
|
139
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
140
|
+
className: space,
|
|
141
|
+
children
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
Appear.displayName = "Appear";
|
|
146
|
+
/** Sibling fields that appear / disappear smoothly. `gapless`: the parent draws the gaps (grid, inset). */
|
|
147
|
+
function AnimatedFields({ fields, render, gapless, space }) {
|
|
148
|
+
const rhythm = useRhythm();
|
|
149
|
+
return /* @__PURE__ */ jsx(AnimatePresence, {
|
|
150
|
+
initial: false,
|
|
151
|
+
children: fields.map((f, i) => /* @__PURE__ */ jsx(Appear, {
|
|
152
|
+
space: gapless || i === 0 ? void 0 : space ?? rhythm.field,
|
|
153
|
+
children: render(f)
|
|
154
|
+
}, f.name))
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function GroupBadges({ status }) {
|
|
158
|
+
const { errors, warnings, peers, comments } = status;
|
|
159
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
160
|
+
errors ? /* @__PURE__ */ jsx(Tooltip, {
|
|
161
|
+
content: `${errors} ${errors === 1 ? "issue" : "issues"} to fix inside`,
|
|
162
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
163
|
+
role: "img",
|
|
164
|
+
"aria-label": `${errors} ${errors === 1 ? "issue" : "issues"} to fix`,
|
|
165
|
+
className: "inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-kit-danger-soft px-1 text-kit-2xs font-medium tabular-nums text-kit-danger-fg",
|
|
166
|
+
children: errors
|
|
167
|
+
})
|
|
168
|
+
}) : warnings ? /* @__PURE__ */ jsx(IssueDot, {
|
|
169
|
+
errors: 0,
|
|
170
|
+
warnings
|
|
171
|
+
}) : null,
|
|
172
|
+
comments ? /* @__PURE__ */ jsx(Tooltip, {
|
|
173
|
+
content: `${comments} open ${comments === 1 ? "comment" : "comments"} inside`,
|
|
174
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
175
|
+
role: "img",
|
|
176
|
+
"aria-label": `${comments} open ${comments === 1 ? "comment" : "comments"}`,
|
|
177
|
+
className: "inline-flex h-4 shrink-0 items-center gap-0.5 rounded-kit-md px-0.5 text-kit-2xs tabular-nums text-kit-fg-3",
|
|
178
|
+
children: [/* @__PURE__ */ jsx(IconMessage, {
|
|
179
|
+
className: "size-3",
|
|
180
|
+
stroke: 1.75,
|
|
181
|
+
"aria-hidden": true
|
|
182
|
+
}), comments]
|
|
183
|
+
})
|
|
184
|
+
}) : null,
|
|
185
|
+
peers.length ? /* @__PURE__ */ jsx(PeerStack, {
|
|
186
|
+
peers,
|
|
187
|
+
size: 16
|
|
188
|
+
}) : null
|
|
189
|
+
] });
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Sibling fields, laid out by the D63 rule: a plain animated stack, or (when `columns` and at least one pair of short
|
|
193
|
+
* neighbours) a grid that turns two-up only when the form is ≥ 420px wide. Used by sections, insets and array rows.
|
|
194
|
+
*/
|
|
195
|
+
function FieldRun({ fields, render, columns = true, values }) {
|
|
196
|
+
const rhythm = useRhythm();
|
|
197
|
+
const icons = splitIcons(fields, values ?? {});
|
|
198
|
+
if (icons) return /* @__PURE__ */ jsxs("div", {
|
|
199
|
+
className: "flex min-w-0 flex-col",
|
|
200
|
+
children: [
|
|
201
|
+
icons.before.length ? /* @__PURE__ */ jsx(FieldRun, {
|
|
202
|
+
fields: icons.before,
|
|
203
|
+
render,
|
|
204
|
+
columns
|
|
205
|
+
}) : null,
|
|
206
|
+
/* @__PURE__ */ jsx("div", {
|
|
207
|
+
className: icons.before.length ? rhythm.field : void 0,
|
|
208
|
+
children: /* @__PURE__ */ jsx(IconGroup, {
|
|
209
|
+
fields: icons.icons,
|
|
210
|
+
render
|
|
211
|
+
})
|
|
212
|
+
}),
|
|
213
|
+
icons.after.length ? /* @__PURE__ */ jsx("div", {
|
|
214
|
+
className: rhythm.field,
|
|
215
|
+
children: /* @__PURE__ */ jsx(FieldRun, {
|
|
216
|
+
fields: icons.after,
|
|
217
|
+
render,
|
|
218
|
+
columns
|
|
219
|
+
})
|
|
220
|
+
}) : null
|
|
221
|
+
]
|
|
222
|
+
});
|
|
223
|
+
const spans = columns ? columnSpans(fields) : fields.map(() => false);
|
|
224
|
+
if (!spans.some(Boolean)) return /* @__PURE__ */ jsx("div", {
|
|
225
|
+
className: "flex min-w-0 flex-col",
|
|
226
|
+
children: /* @__PURE__ */ jsx(AnimatedFields, {
|
|
227
|
+
fields,
|
|
228
|
+
render
|
|
229
|
+
})
|
|
230
|
+
});
|
|
231
|
+
return /* @__PURE__ */ jsx("div", {
|
|
232
|
+
"data-slot": "field-columns",
|
|
233
|
+
className: cn("grid min-w-0 grid-cols-1 gap-x-3 @[420px]:grid-cols-2", rhythm.gridY),
|
|
234
|
+
children: fields.map((f, i) => /* @__PURE__ */ jsx("div", {
|
|
235
|
+
className: cn("min-w-0", !spans[i] && "@[420px]:col-span-2"),
|
|
236
|
+
children: render(f)
|
|
237
|
+
}, f.name))
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* A header with eight social icons would otherwise stack eight rows between its texts. A lone icon is just its row:
|
|
242
|
+
* no heading for one. `isIconImage` is the same rule the image control draws the row by.
|
|
243
|
+
*/
|
|
244
|
+
function splitIcons(fields, values) {
|
|
245
|
+
const icons = fields.filter((f) => isIconImage(f, values[f.name]));
|
|
246
|
+
if (icons.length < 2) return null;
|
|
247
|
+
const at = fields.indexOf(icons[0]);
|
|
248
|
+
const rest = fields.filter((f) => !icons.includes(f));
|
|
249
|
+
return {
|
|
250
|
+
before: rest.slice(0, at),
|
|
251
|
+
icons,
|
|
252
|
+
after: rest.slice(at)
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function IconGroup({ fields, render }) {
|
|
256
|
+
const id = React.useId();
|
|
257
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
258
|
+
role: "group",
|
|
259
|
+
"aria-labelledby": id,
|
|
260
|
+
"data-slot": "kit-icon-group",
|
|
261
|
+
className: "flex min-w-0 flex-col gap-1.5",
|
|
262
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
263
|
+
id,
|
|
264
|
+
className: "text-kit-xs font-medium text-kit-fg-3",
|
|
265
|
+
children: "Icons"
|
|
266
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
267
|
+
className: "flex min-w-0 flex-col gap-2",
|
|
268
|
+
children: fields.map((f) => /* @__PURE__ */ jsx("div", {
|
|
269
|
+
className: "min-w-0",
|
|
270
|
+
children: render(f)
|
|
271
|
+
}, f.name))
|
|
272
|
+
})]
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function FieldSection({ title, description, collapsible = true, defaultOpen = true, open: openProp, onOpenChange, summary, status, divider = true, revealWhen, disabled, actions, lead, columns, icon, adornment, className, bodyClassName, children }) {
|
|
276
|
+
const rhythm = useRhythm();
|
|
277
|
+
const { variant } = useKitEnv();
|
|
278
|
+
const id = React.useId();
|
|
279
|
+
const [inner, setInner] = React.useState(defaultOpen);
|
|
280
|
+
const open = !collapsible || (openProp ?? inner);
|
|
281
|
+
const setOpen = (o) => {
|
|
282
|
+
if (openProp === void 0) setInner(o);
|
|
283
|
+
onOpenChange?.(o);
|
|
284
|
+
};
|
|
285
|
+
React.useEffect(() => {
|
|
286
|
+
if (revealWhen && !open) setOpen(true);
|
|
287
|
+
}, [revealWhen]);
|
|
288
|
+
const st = {
|
|
289
|
+
errors: 0,
|
|
290
|
+
warnings: 0,
|
|
291
|
+
peers: [],
|
|
292
|
+
comments: 0,
|
|
293
|
+
...status
|
|
294
|
+
};
|
|
295
|
+
const titleCls = cn("min-w-0 truncate font-semibold text-kit-fg", variant === "document" ? "text-kit-base" : "text-kit-sm", disabled && "text-kit-fg-4");
|
|
296
|
+
const body = /* @__PURE__ */ jsxs("div", {
|
|
297
|
+
id: `${id}-body`,
|
|
298
|
+
className: cn("flex flex-col pb-2 pt-1", rhythm.stack, bodyClassName),
|
|
299
|
+
children: [
|
|
300
|
+
description ? /* @__PURE__ */ jsx("p", {
|
|
301
|
+
className: "-mt-1 text-kit-xs leading-4 text-kit-fg-3",
|
|
302
|
+
children: description
|
|
303
|
+
}) : null,
|
|
304
|
+
lead,
|
|
305
|
+
columns === 2 ? /* @__PURE__ */ jsx("div", {
|
|
306
|
+
className: cn("grid grid-cols-1 gap-x-3 @[420px]:grid-cols-2", rhythm.gridY),
|
|
307
|
+
children
|
|
308
|
+
}) : children
|
|
309
|
+
]
|
|
310
|
+
});
|
|
311
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
312
|
+
role: "group",
|
|
313
|
+
"aria-labelledby": `${id}-title`,
|
|
314
|
+
"data-group": "section",
|
|
315
|
+
"data-state": open ? "open" : "closed",
|
|
316
|
+
className: cn("group/section relative", divider && "border-t border-kit-line pt-1", "before:pointer-events-none before:absolute before:-left-2.5 before:bottom-2 before:top-11 before:w-px before:bg-transparent before:transition-colors before:duration-200 data-[state=open]:focus-within:before:bg-kit-line", "[&:has([data-group=inset]:focus-within)]:before:!bg-transparent", className),
|
|
317
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
318
|
+
className: "flex min-h-9 items-center gap-2",
|
|
319
|
+
children: [collapsible ? /* @__PURE__ */ jsxs("button", {
|
|
320
|
+
type: "button",
|
|
321
|
+
onClick: () => !disabled && setOpen(!open),
|
|
322
|
+
"aria-expanded": open,
|
|
323
|
+
"aria-controls": open ? `${id}-body` : void 0,
|
|
324
|
+
"aria-disabled": disabled || void 0,
|
|
325
|
+
className: cn("group/sh -mx-2 flex h-9 min-w-0 flex-1 items-center gap-2 rounded-kit-md px-2 text-left transition-colors", disabled ? "cursor-not-allowed" : "hover:bg-kit-hover"),
|
|
326
|
+
children: [
|
|
327
|
+
icon ? /* @__PURE__ */ jsx("span", {
|
|
328
|
+
"aria-hidden": true,
|
|
329
|
+
className: "flex shrink-0 text-kit-fg-3 [&_svg]:size-3.5",
|
|
330
|
+
children: icon
|
|
331
|
+
}) : null,
|
|
332
|
+
/* @__PURE__ */ jsx("span", {
|
|
333
|
+
id: `${id}-title`,
|
|
334
|
+
className: titleCls,
|
|
335
|
+
children: title
|
|
336
|
+
}),
|
|
337
|
+
adornment,
|
|
338
|
+
!open && Array.isArray(summary) ? /* @__PURE__ */ jsx(SummaryChips, { chips: summary }) : !open && summary ? /* @__PURE__ */ jsx("span", {
|
|
339
|
+
className: "min-w-0 flex-1 truncate text-right text-kit-xs text-kit-fg-3",
|
|
340
|
+
children: summary
|
|
341
|
+
}) : /* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
342
|
+
!open ? /* @__PURE__ */ jsx(GroupBadges, { status: st }) : null,
|
|
343
|
+
/* @__PURE__ */ jsx(IconChevronRight, {
|
|
344
|
+
"aria-hidden": true,
|
|
345
|
+
stroke: 1.5,
|
|
346
|
+
className: cn("size-4 shrink-0 text-kit-fg-3 transition-transform duration-200 group-hover/sh:text-kit-fg-2", open && "rotate-90")
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
}) : /* @__PURE__ */ jsx("h3", {
|
|
350
|
+
id: `${id}-title`,
|
|
351
|
+
className: cn(titleCls, "flex-1"),
|
|
352
|
+
children: title
|
|
353
|
+
}), actions]
|
|
354
|
+
}), /* @__PURE__ */ jsx(KitSectionTitle.Provider, {
|
|
355
|
+
value: title,
|
|
356
|
+
children: collapsible ? /* @__PURE__ */ jsx(SectionBody, {
|
|
357
|
+
open,
|
|
358
|
+
children: body
|
|
359
|
+
}) : body
|
|
360
|
+
})]
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
/** A collapsed section's summary as neutral chips (the schema editor's field settings): 2 chips, then "+N" with the rest
|
|
364
|
+
* in its tooltip; none = a quiet "Nothing set". Colour stays for type and status, so these are --constraint chips. */
|
|
365
|
+
function SummaryChips({ chips }) {
|
|
366
|
+
if (!chips.length) return /* @__PURE__ */ jsx("span", {
|
|
367
|
+
className: "min-w-0 flex-1 truncate text-right text-kit-xs text-kit-fg-3",
|
|
368
|
+
children: "Nothing set"
|
|
369
|
+
});
|
|
370
|
+
const shown = chips.slice(0, 2);
|
|
371
|
+
const rest = chips.slice(2);
|
|
372
|
+
const chip = "inline-flex h-5 min-w-0 shrink items-center rounded-[4px] bg-kit-constraint-bg px-1.5 text-kit-2xs font-medium text-kit-constraint-fg";
|
|
373
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
374
|
+
className: "flex min-w-0 flex-1 items-center justify-end gap-1",
|
|
375
|
+
children: [shown.map((c) => /* @__PURE__ */ jsx("span", {
|
|
376
|
+
className: chip,
|
|
377
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
378
|
+
className: "truncate",
|
|
379
|
+
children: c
|
|
380
|
+
})
|
|
381
|
+
}, c)), rest.length ? /* @__PURE__ */ jsx(Tooltip, {
|
|
382
|
+
content: rest.join(" · "),
|
|
383
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
384
|
+
className: cn(chip, "shrink-0 tabular-nums"),
|
|
385
|
+
children: ["+", rest.length]
|
|
386
|
+
})
|
|
387
|
+
}) : null]
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* The open / close motion of a section (D52: no jitter). Height only, 200ms, the same curve as conditional fields. The
|
|
392
|
+
* body is clipped ONLY while the height moves, so focus rings, the gutter edge and popovers are never cut at rest and
|
|
393
|
+
* nothing snaps when the clip comes off; no opacity flash on the content; instant with reduced motion.
|
|
394
|
+
*/
|
|
395
|
+
function SectionBody({ open, children }) {
|
|
396
|
+
const reduce = useReducedMotion();
|
|
397
|
+
const el = React.useRef(null);
|
|
398
|
+
const clip = (on) => {
|
|
399
|
+
if (el.current) el.current.style.overflow = on ? "hidden" : "";
|
|
400
|
+
};
|
|
401
|
+
return /* @__PURE__ */ jsx(AnimatePresence, {
|
|
402
|
+
initial: false,
|
|
403
|
+
children: open ? /* @__PURE__ */ jsx(motion.div, {
|
|
404
|
+
ref: el,
|
|
405
|
+
initial: { height: 0 },
|
|
406
|
+
animate: { height: "auto" },
|
|
407
|
+
exit: { height: 0 },
|
|
408
|
+
transition: {
|
|
409
|
+
duration: reduce ? 0 : .2,
|
|
410
|
+
ease: [
|
|
411
|
+
.22,
|
|
412
|
+
1,
|
|
413
|
+
.36,
|
|
414
|
+
1
|
|
415
|
+
]
|
|
416
|
+
},
|
|
417
|
+
onAnimationStart: () => clip(true),
|
|
418
|
+
onAnimationComplete: () => clip(false),
|
|
419
|
+
className: "min-w-0",
|
|
420
|
+
children
|
|
421
|
+
}) : null
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* D63: the ONE way to show "these fields belong together" inside a form. The object's label sits above (the field shell);
|
|
426
|
+
* the children sit behind a single 1px --line inset line, `ml-1.5 pl-3`. No tint, no ring, no radius, no padding box.
|
|
427
|
+
* Children keep the form's own field gap. Short neighbours pair up on wide forms through `FieldRun`.
|
|
428
|
+
*/
|
|
429
|
+
function FieldInset({ children, labelledBy, label, className }) {
|
|
430
|
+
return /* @__PURE__ */ jsx(InsetScope, { children: /* @__PURE__ */ jsx("div", {
|
|
431
|
+
role: "group",
|
|
432
|
+
"aria-labelledby": labelledBy,
|
|
433
|
+
"aria-label": labelledBy ? void 0 : label,
|
|
434
|
+
"data-group": "inset",
|
|
435
|
+
className: cn(INSET_LINE, "flex flex-col", className),
|
|
436
|
+
children
|
|
437
|
+
}) });
|
|
438
|
+
}
|
|
439
|
+
/** The inset line every nested group uses (inline objects, expanded array rows). */
|
|
440
|
+
var INSET_LINE = "ml-1.5 min-w-0 border-l border-kit-line pl-3";
|
|
441
|
+
/**
|
|
442
|
+
* Reads as ONE input: the field border, radius 6, the input focus treatment on the whole unit; rows inside are split by a
|
|
443
|
+
* hairline and have no borders of their own. Use for values that only make sense together (founder rule: a button's
|
|
444
|
+
* label and link are one unit).
|
|
445
|
+
*/
|
|
446
|
+
var FieldUnit = React.forwardRef(({ invalid, disabled, className, children, ...rest }, ref) => /* @__PURE__ */ jsx("div", {
|
|
447
|
+
ref,
|
|
448
|
+
role: "group",
|
|
449
|
+
"data-slot": "field-unit",
|
|
450
|
+
"data-invalid": invalid || void 0,
|
|
451
|
+
"aria-disabled": disabled || void 0,
|
|
452
|
+
...rest,
|
|
453
|
+
className: cn("flex min-w-0 flex-col divide-y divide-kit-line-subtle rounded-kit-md border border-kit-field-border bg-kit-field-bg shadow-kit-field transition-[border-color,box-shadow] duration-150", "hover:border-kit-field-border-hover focus-within:border-kit-field-border-focus focus-within:shadow-kit-ring-field", "[&>*:first-child]:rounded-t-[5px] [&>*:last-child]:rounded-b-[5px]", invalid && "border-[var(--kit-field-invalid)] hover:border-[var(--kit-field-invalid)]", disabled && "pointer-events-none bg-kit-subtle opacity-60", className),
|
|
454
|
+
children
|
|
455
|
+
}));
|
|
456
|
+
FieldUnit.displayName = "FieldUnit";
|
|
457
|
+
/** One row of a unit: 36px, 8px side padding, no border (the unit draws the hairline between rows). */
|
|
458
|
+
function FieldUnitRow({ className, children, ...rest }) {
|
|
459
|
+
return /* @__PURE__ */ jsx("div", {
|
|
460
|
+
...rest,
|
|
461
|
+
className: cn("flex min-h-9 min-w-0 items-center gap-2 px-1", className),
|
|
462
|
+
children
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
var BREAKPOINT_NAMES = [
|
|
466
|
+
"desktop",
|
|
467
|
+
"laptop",
|
|
468
|
+
"tablet",
|
|
469
|
+
"mobile",
|
|
470
|
+
"phone"
|
|
471
|
+
];
|
|
472
|
+
var isBreakpointName = (n) => BREAKPOINT_NAMES.includes(n.toLowerCase());
|
|
473
|
+
var BP_ICON = {
|
|
474
|
+
desktop: IconDeviceDesktop,
|
|
475
|
+
laptop: IconDeviceLaptop,
|
|
476
|
+
tablet: IconDeviceTablet,
|
|
477
|
+
mobile: IconDeviceMobile,
|
|
478
|
+
phone: IconDeviceMobile
|
|
479
|
+
};
|
|
480
|
+
/** An object field "differs" from the base breakpoint when it has an inherit switch that is off, or (without one) any value. */
|
|
481
|
+
function overrides(f, v) {
|
|
482
|
+
if (!isObj(v)) return false;
|
|
483
|
+
const inherit = (f.fields ?? []).find((x) => x.type === "boolean" && /^(inherit|same|sameAs|useDesktop|inheritDesktop)/i.test(x.name));
|
|
484
|
+
if (inherit) return v[inherit.name] === false;
|
|
485
|
+
return (f.fields ?? []).some((x) => !isEmptyValue(v[x.name]));
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Per-screen-size settings as ONE group: the section header, then a segmented switcher (Desktop · Tablet · Phone) with a
|
|
489
|
+
* dot on every size that has its own values; only the chosen size's fields show. Replaces three stacked groups.
|
|
490
|
+
*/
|
|
491
|
+
function BreakpointGroup({ set, members, basePath, memoryKey, divider, renderField }) {
|
|
492
|
+
const form = useForm();
|
|
493
|
+
const rhythm = useRhythm();
|
|
494
|
+
const [bp, setBp] = React.useState(() => form.memory.get(`${memoryKey}:bp`) ?? members[0].name);
|
|
495
|
+
const active = members.find((m) => m.name === bp) ?? members[0];
|
|
496
|
+
const select = (n) => {
|
|
497
|
+
setBp(n);
|
|
498
|
+
form.memory.set(`${memoryKey}:bp`, n);
|
|
499
|
+
};
|
|
500
|
+
const [open, setOpen] = React.useState(() => form.memory.get(memoryKey) ?? !set.collapsed);
|
|
501
|
+
const status = useGroupStatus(members.map((m) => [...basePath, m.name]));
|
|
502
|
+
const valueOf = (m) => form.getAt([...basePath, m.name]);
|
|
503
|
+
const differing = members.slice(1).filter((m) => overrides(m, valueOf(m)));
|
|
504
|
+
const summary = differing.length ? `Own settings on ${differing.map((m) => m.title.toLowerCase()).join(" and ")}` : `Same on every screen`;
|
|
505
|
+
const activeValue = valueOf(active);
|
|
506
|
+
const obj = isObj(activeValue) ? activeValue : {};
|
|
507
|
+
const cc = condCtx(form, [...basePath, active.name]);
|
|
508
|
+
const fields = (active.fields ?? []).filter((f) => !isHidden(f, obj, cc));
|
|
509
|
+
const id = React.useId();
|
|
510
|
+
const compactBp = members.length >= 4 && members.every((m) => BP_ICON[m.name.toLowerCase()] || m.icon);
|
|
511
|
+
return /* @__PURE__ */ jsx(FieldSection, {
|
|
512
|
+
title: set.title,
|
|
513
|
+
description: set.description,
|
|
514
|
+
collapsible: set.collapsible !== false,
|
|
515
|
+
open,
|
|
516
|
+
onOpenChange: (o) => {
|
|
517
|
+
setOpen(o);
|
|
518
|
+
form.memory.set(memoryKey, o);
|
|
519
|
+
},
|
|
520
|
+
summary,
|
|
521
|
+
status,
|
|
522
|
+
divider,
|
|
523
|
+
revealWhen: form.showAllErrors && status.errors > 0,
|
|
524
|
+
lead: /* @__PURE__ */ jsxs("div", {
|
|
525
|
+
className: "flex flex-col gap-1.5",
|
|
526
|
+
children: [/* @__PURE__ */ jsx(Segmented, {
|
|
527
|
+
"aria-label": `${set.title}: screen size`,
|
|
528
|
+
size: "sm",
|
|
529
|
+
value: active.name,
|
|
530
|
+
onChange: select,
|
|
531
|
+
collapseInactive: compactBp,
|
|
532
|
+
className: "w-full [&>button]:flex-1",
|
|
533
|
+
items: members.map((m, i) => {
|
|
534
|
+
const Icon = BP_ICON[m.name.toLowerCase()];
|
|
535
|
+
const own = i > 0 && differing.includes(m);
|
|
536
|
+
const errs = form.rollup([...basePath, m.name]).errors;
|
|
537
|
+
const dot = errs ? /* @__PURE__ */ jsx("span", {
|
|
538
|
+
"aria-hidden": true,
|
|
539
|
+
className: "size-1.5 rounded-full bg-kit-danger"
|
|
540
|
+
}) : own ? /* @__PURE__ */ jsx("span", {
|
|
541
|
+
"aria-hidden": true,
|
|
542
|
+
className: "size-1.5 rounded-full bg-kit-accent"
|
|
543
|
+
}) : null;
|
|
544
|
+
const sr = errs ? ", has issues" : own ? ", has its own settings" : "";
|
|
545
|
+
const glyph = Icon ? /* @__PURE__ */ jsx(Icon, { stroke: 1.5 }) : m.icon ? /* @__PURE__ */ jsx(KitIcon, { name: m.icon }) : void 0;
|
|
546
|
+
if (compactBp) return {
|
|
547
|
+
value: m.name,
|
|
548
|
+
name: `${m.title}${sr}`,
|
|
549
|
+
tooltip: m.title,
|
|
550
|
+
icon: /* @__PURE__ */ jsxs("span", {
|
|
551
|
+
className: "relative inline-flex",
|
|
552
|
+
children: [glyph, dot ? /* @__PURE__ */ jsx("span", {
|
|
553
|
+
className: "absolute -right-1 -top-0.5 inline-flex",
|
|
554
|
+
children: dot
|
|
555
|
+
}) : null]
|
|
556
|
+
}),
|
|
557
|
+
label: /* @__PURE__ */ jsxs("span", { children: [m.title, sr ? /* @__PURE__ */ jsx("span", {
|
|
558
|
+
className: "sr-only",
|
|
559
|
+
children: sr
|
|
560
|
+
}) : null] })
|
|
561
|
+
};
|
|
562
|
+
return {
|
|
563
|
+
value: m.name,
|
|
564
|
+
icon: glyph,
|
|
565
|
+
label: /* @__PURE__ */ jsxs("span", {
|
|
566
|
+
className: "inline-flex items-center gap-1",
|
|
567
|
+
children: [
|
|
568
|
+
m.title,
|
|
569
|
+
dot,
|
|
570
|
+
sr ? /* @__PURE__ */ jsx("span", {
|
|
571
|
+
className: "sr-only",
|
|
572
|
+
children: sr
|
|
573
|
+
}) : null
|
|
574
|
+
]
|
|
575
|
+
})
|
|
576
|
+
};
|
|
577
|
+
})
|
|
578
|
+
}), active.description ? /* @__PURE__ */ jsxs("p", {
|
|
579
|
+
className: "text-kit-xs leading-4 text-kit-fg-3",
|
|
580
|
+
children: [
|
|
581
|
+
active.title,
|
|
582
|
+
" · ",
|
|
583
|
+
active.description
|
|
584
|
+
]
|
|
585
|
+
}) : null]
|
|
586
|
+
}),
|
|
587
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
588
|
+
role: "group",
|
|
589
|
+
"aria-labelledby": `${id}-bp`,
|
|
590
|
+
className: "flex flex-col",
|
|
591
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
592
|
+
id: `${id}-bp`,
|
|
593
|
+
className: "sr-only",
|
|
594
|
+
children: [active.title, " settings"]
|
|
595
|
+
}), /* @__PURE__ */ jsx(AnimatePresence, {
|
|
596
|
+
initial: false,
|
|
597
|
+
children: fields.map((f, i) => /* @__PURE__ */ jsx(Appear, {
|
|
598
|
+
space: i === 0 ? void 0 : rhythm.field,
|
|
599
|
+
children: renderField(f, [
|
|
600
|
+
...basePath,
|
|
601
|
+
active.name,
|
|
602
|
+
f.name
|
|
603
|
+
], obj)
|
|
604
|
+
}, f.name))
|
|
605
|
+
}, active.name)]
|
|
606
|
+
})
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
var ADVANCED = {
|
|
610
|
+
name: "__advanced",
|
|
611
|
+
title: "Advanced",
|
|
612
|
+
description: "Rarely-changed and developer settings",
|
|
613
|
+
collapsed: true
|
|
614
|
+
};
|
|
615
|
+
var BREAKPOINTS = {
|
|
616
|
+
name: "__breakpoints",
|
|
617
|
+
title: "Screen sizes",
|
|
618
|
+
layout: "breakpoints"
|
|
619
|
+
};
|
|
620
|
+
/** Fields in schema order, with each fieldset (and the auto "Advanced" / "Screen sizes" sets) placed at its first member. */
|
|
621
|
+
function arrangeFields(fields, fieldsets = []) {
|
|
622
|
+
const items = [];
|
|
623
|
+
const sets = /* @__PURE__ */ new Map();
|
|
624
|
+
const adv = [];
|
|
625
|
+
const bpCount = fields.filter((f) => !f.fieldset && !f.advanced && f.type === "object" && isBreakpointName(f.name)).length;
|
|
626
|
+
for (const f of fields) {
|
|
627
|
+
const auto = !f.fieldset && !f.advanced && bpCount >= 2 && f.type === "object" && isBreakpointName(f.name);
|
|
628
|
+
const setName = f.fieldset ?? (auto ? BREAKPOINTS.name : void 0);
|
|
629
|
+
if (setName) {
|
|
630
|
+
let s = sets.get(setName);
|
|
631
|
+
if (!s) {
|
|
632
|
+
s = {
|
|
633
|
+
kind: "set",
|
|
634
|
+
set: auto ? BREAKPOINTS : fieldsets.find((x) => x.name === setName) ?? {
|
|
635
|
+
name: setName,
|
|
636
|
+
title: setName
|
|
637
|
+
},
|
|
638
|
+
fields: []
|
|
639
|
+
};
|
|
640
|
+
sets.set(setName, s);
|
|
641
|
+
items.push(s);
|
|
642
|
+
}
|
|
643
|
+
s.fields.push(f);
|
|
644
|
+
} else if (f.advanced) adv.push(f);
|
|
645
|
+
else items.push({
|
|
646
|
+
kind: "field",
|
|
647
|
+
field: f
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
if (adv.length) items.push({
|
|
651
|
+
kind: "set",
|
|
652
|
+
set: ADVANCED,
|
|
653
|
+
fields: adv
|
|
654
|
+
});
|
|
655
|
+
return items;
|
|
656
|
+
}
|
|
657
|
+
/** The frame's loose icon fields (not those inside a fieldset) as one "Icons" item where the first was. @see splitIcons */
|
|
658
|
+
function gatherIcons(items, obj) {
|
|
659
|
+
const icons = items.flatMap((it) => it.kind === "field" ? [it.field] : []).filter((f) => isIconImage(f, obj[f.name]));
|
|
660
|
+
if (icons.length < 2) return items;
|
|
661
|
+
const out = [];
|
|
662
|
+
for (const it of items) if (it.kind !== "field" || !icons.includes(it.field)) out.push(it);
|
|
663
|
+
else if (it.field === icons[0]) out.push({
|
|
664
|
+
kind: "icons",
|
|
665
|
+
fields: icons
|
|
666
|
+
});
|
|
667
|
+
return out;
|
|
668
|
+
}
|
|
669
|
+
/** The group a field without `group` belongs to: the one marked `default`, else the first. */
|
|
670
|
+
var defaultGroup = (groups) => groups?.find((g) => g.default) ?? groups?.[0];
|
|
671
|
+
/**
|
|
672
|
+
* FieldList — lays out one frame's fields (CPO D45 grouping): group TABS (with error dots) at the top of the frame only,
|
|
673
|
+
* FIELDSETS as <FieldSection> (hairline + 36px header, no box, collapsed = one-line summary), breakpoint objects as ONE
|
|
674
|
+
* <BreakpointGroup> with a switcher, an auto "Advanced" section for `advanced` fields, and `hidden` conditions that
|
|
675
|
+
* appear / disappear with a height animation.
|
|
676
|
+
* Rhythm: label→control 6 · fields 16 · groups 24 (dense ≤360px: 12 · 20; document: 20 · 32).
|
|
677
|
+
*/
|
|
678
|
+
function FieldList({ fields, fieldsets, groups, basePath, memoryKey, renderField }) {
|
|
679
|
+
const form = useForm();
|
|
680
|
+
const env = useKitEnv();
|
|
681
|
+
const raw = form.getAt(basePath);
|
|
682
|
+
const obj = isObj(raw) ? raw : {};
|
|
683
|
+
const cc = condCtx(form, basePath);
|
|
684
|
+
const visible = fields.filter((f) => !isHidden(f, obj, cc));
|
|
685
|
+
const usable = (groups ?? []).filter((g) => visible.some((f) => (f.group ?? defaultGroup(groups)?.name) === g.name));
|
|
686
|
+
const tabs = usable.length >= 2;
|
|
687
|
+
const allTab = tabs && env.variant === "document";
|
|
688
|
+
const memTab = form.memory.get(`${memoryKey}:tab`);
|
|
689
|
+
const [tab, setTab] = React.useState(memTab ?? (allTab ? "__all" : defaultGroup(usable)?.name ?? ""));
|
|
690
|
+
const select = (t) => {
|
|
691
|
+
setTab(t);
|
|
692
|
+
form.memory.set(`${memoryKey}:tab`, t);
|
|
693
|
+
};
|
|
694
|
+
const validTabs = [...allTab ? ["__all"] : [], ...usable.map((g) => g.name)];
|
|
695
|
+
const active = validTabs.includes(tab) ? tab : validTabs[0] ?? "";
|
|
696
|
+
const inTab = (f) => !tabs || active === "__all" || (f.group ?? defaultGroup(groups)?.name) === active;
|
|
697
|
+
const groupErrors = (g) => visible.filter((f) => (f.group ?? defaultGroup(groups)?.name) === g).reduce((n, f) => n + form.rollup([...basePath, f.name]).errors, 0);
|
|
698
|
+
const items = gatherIcons(arrangeFields(visible.filter(inTab), fieldsets), obj);
|
|
699
|
+
const rhythm = useRhythm();
|
|
700
|
+
const review = env.review;
|
|
701
|
+
const [openRuns, setOpenRuns] = React.useState(() => /* @__PURE__ */ new Set());
|
|
702
|
+
const itemChanged = (it) => !review || (it.kind === "field" ? review.count([...basePath, it.field.name]) > 0 : it.fields.some((f) => review.count([...basePath, f.name]) > 0));
|
|
703
|
+
const segs = [];
|
|
704
|
+
for (const it of items) {
|
|
705
|
+
if (!review?.onlyChanges || itemChanged(it)) {
|
|
706
|
+
segs.push({
|
|
707
|
+
kind: "item",
|
|
708
|
+
it
|
|
709
|
+
});
|
|
710
|
+
continue;
|
|
711
|
+
}
|
|
712
|
+
const last = segs[segs.length - 1];
|
|
713
|
+
const n = it.kind === "field" ? 1 : it.fields.length;
|
|
714
|
+
if (last?.kind === "fold") {
|
|
715
|
+
last.items.push(it);
|
|
716
|
+
last.n += n;
|
|
717
|
+
} else segs.push({
|
|
718
|
+
kind: "fold",
|
|
719
|
+
key: `fold:${it.kind === "field" ? it.field.name : it.kind === "set" ? it.set.name : "icons"}`,
|
|
720
|
+
items: [it],
|
|
721
|
+
n
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
const rows = segs.flatMap((sg) => sg.kind === "item" ? [sg] : [sg, ...openRuns.has(sg.key) ? sg.items.map((it) => ({
|
|
725
|
+
kind: "item",
|
|
726
|
+
it
|
|
727
|
+
})) : []]);
|
|
728
|
+
const toggleRun = (key) => setOpenRuns((o) => {
|
|
729
|
+
const n = new Set(o);
|
|
730
|
+
if (n.has(key)) n.delete(key);
|
|
731
|
+
else n.add(key);
|
|
732
|
+
return n;
|
|
733
|
+
});
|
|
734
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
735
|
+
className: "flex flex-col",
|
|
736
|
+
children: [
|
|
737
|
+
tabs ? /* @__PURE__ */ jsx("div", {
|
|
738
|
+
className: rhythm.tabs,
|
|
739
|
+
children: /* @__PURE__ */ jsx(GroupTabs, {
|
|
740
|
+
id: memoryKey,
|
|
741
|
+
value: active,
|
|
742
|
+
onChange: select,
|
|
743
|
+
items: [...allTab ? [{
|
|
744
|
+
name: "__all",
|
|
745
|
+
title: "All fields"
|
|
746
|
+
}] : [], ...usable].map((g) => ({
|
|
747
|
+
value: g.name,
|
|
748
|
+
label: g.title,
|
|
749
|
+
icon: "icon" in g ? g.icon : void 0,
|
|
750
|
+
errors: g.name === "__all" ? 0 : groupErrors(g.name)
|
|
751
|
+
}))
|
|
752
|
+
})
|
|
753
|
+
}) : null,
|
|
754
|
+
/* @__PURE__ */ jsx(AnimatePresence, {
|
|
755
|
+
initial: false,
|
|
756
|
+
children: rows.map((row, i) => {
|
|
757
|
+
if (row.kind === "fold") {
|
|
758
|
+
const open = openRuns.has(row.key);
|
|
759
|
+
const label = `${row.n} unchanged ${row.n === 1 ? "field" : "fields"}`;
|
|
760
|
+
return /* @__PURE__ */ jsx(Appear, {
|
|
761
|
+
space: i === 0 ? void 0 : rhythm.field,
|
|
762
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
763
|
+
type: "button",
|
|
764
|
+
"aria-expanded": open,
|
|
765
|
+
onClick: () => toggleRun(row.key),
|
|
766
|
+
className: "flex w-full items-center gap-2 rounded-kit-md text-kit-xs text-kit-fg-3 outline-none hover:text-kit-fg-2 focus-visible:text-kit-fg",
|
|
767
|
+
children: [
|
|
768
|
+
/* @__PURE__ */ jsx("span", {
|
|
769
|
+
"aria-hidden": true,
|
|
770
|
+
className: "h-px flex-1 bg-kit-line-subtle"
|
|
771
|
+
}),
|
|
772
|
+
open ? `Hide ${label}` : label,
|
|
773
|
+
/* @__PURE__ */ jsx("span", {
|
|
774
|
+
"aria-hidden": true,
|
|
775
|
+
className: "h-px flex-1 bg-kit-line-subtle"
|
|
776
|
+
})
|
|
777
|
+
]
|
|
778
|
+
})
|
|
779
|
+
}, row.key);
|
|
780
|
+
}
|
|
781
|
+
const it = row.it;
|
|
782
|
+
const prev = rows[i - 1];
|
|
783
|
+
const space = i === 0 ? void 0 : it.kind === "set" ? prev?.kind === "item" && prev.it.kind === "set" ? void 0 : rhythm.group : rhythm.field;
|
|
784
|
+
return it.kind === "field" ? /* @__PURE__ */ jsx(Appear, {
|
|
785
|
+
space,
|
|
786
|
+
children: renderField(it.field, [...basePath, it.field.name], obj)
|
|
787
|
+
}, it.field.name) : it.kind === "icons" ? /* @__PURE__ */ jsx(Appear, {
|
|
788
|
+
space,
|
|
789
|
+
children: /* @__PURE__ */ jsx(IconGroup, {
|
|
790
|
+
fields: it.fields,
|
|
791
|
+
render: (f) => renderField(f, [...basePath, f.name], obj)
|
|
792
|
+
})
|
|
793
|
+
}, "icons") : /* @__PURE__ */ jsx(Appear, {
|
|
794
|
+
space,
|
|
795
|
+
children: /* @__PURE__ */ jsx(FieldsetSection, {
|
|
796
|
+
set: it.set,
|
|
797
|
+
fields: it.fields,
|
|
798
|
+
basePath,
|
|
799
|
+
obj,
|
|
800
|
+
memoryKey: `${memoryKey}:fs:${it.set.name}`,
|
|
801
|
+
divider: i > 0,
|
|
802
|
+
renderField
|
|
803
|
+
})
|
|
804
|
+
}, `set:${it.set.name}`);
|
|
805
|
+
})
|
|
806
|
+
}, active || "all"),
|
|
807
|
+
items.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
808
|
+
className: "py-6 text-center text-kit-sm text-kit-fg-3",
|
|
809
|
+
children: "No fields here yet."
|
|
810
|
+
}) : null
|
|
811
|
+
]
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
var MORE_W = 72;
|
|
815
|
+
/** Tabs that don't fit the width fold into a "More" menu, never clipped (V2 HEAD c896beb field-list.tsx GroupTabs). The
|
|
816
|
+
* active tab always shows its label: when it sits in the fold it takes the last visible slot. */
|
|
817
|
+
function GroupTabs({ id, value, onChange, items }) {
|
|
818
|
+
const { variant } = useKitEnv();
|
|
819
|
+
const uid = React.useId();
|
|
820
|
+
const gap = variant === "document" ? 20 : 16;
|
|
821
|
+
const wrap = React.useRef(null);
|
|
822
|
+
const measure = React.useRef(null);
|
|
823
|
+
const [fit, setFit] = React.useState(items.length);
|
|
824
|
+
const sig = items.map((t) => `${t.value}:${t.label}:${t.icon ?? ""}`).join("|");
|
|
825
|
+
React.useLayoutEffect(() => {
|
|
826
|
+
const w = wrap.current;
|
|
827
|
+
const m = measure.current;
|
|
828
|
+
if (!w || !m) return;
|
|
829
|
+
const run = () => {
|
|
830
|
+
const widths = Array.from(m.querySelectorAll("[data-seg-value]")).map((el) => el.offsetWidth);
|
|
831
|
+
const room = w.clientWidth;
|
|
832
|
+
if (!room || !widths.length) return;
|
|
833
|
+
if (widths.reduce((a, b) => a + b, 0) + gap * (widths.length - 1) <= room) return setFit(widths.length);
|
|
834
|
+
let used = 0;
|
|
835
|
+
let k = 0;
|
|
836
|
+
for (; k < widths.length; k++) {
|
|
837
|
+
const next = used + (k ? gap : 0) + widths[k];
|
|
838
|
+
if (next + gap + MORE_W > room) break;
|
|
839
|
+
used = next;
|
|
840
|
+
}
|
|
841
|
+
setFit(Math.max(1, k));
|
|
842
|
+
};
|
|
843
|
+
run();
|
|
844
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
845
|
+
const ro = new ResizeObserver(run);
|
|
846
|
+
ro.observe(w);
|
|
847
|
+
return () => ro.disconnect();
|
|
848
|
+
}, [sig, gap]);
|
|
849
|
+
const toTab = (t) => ({
|
|
850
|
+
value: t.value,
|
|
851
|
+
icon: t.icon ? /* @__PURE__ */ jsx(KitIcon, {
|
|
852
|
+
name: t.icon,
|
|
853
|
+
className: "size-3.5"
|
|
854
|
+
}) : void 0,
|
|
855
|
+
label: /* @__PURE__ */ jsxs("span", {
|
|
856
|
+
className: "inline-flex items-center gap-1.5",
|
|
857
|
+
"aria-label": t.errors ? `${t.label}, has errors` : void 0,
|
|
858
|
+
children: [t.label, t.errors ? /* @__PURE__ */ jsx("span", {
|
|
859
|
+
className: "size-1.5 rounded-full bg-kit-danger",
|
|
860
|
+
"aria-hidden": true
|
|
861
|
+
}) : null]
|
|
862
|
+
})
|
|
863
|
+
});
|
|
864
|
+
let shown = items.slice(0, fit);
|
|
865
|
+
if (fit < items.length && !shown.some((t) => t.value === value)) {
|
|
866
|
+
const act = items.find((t) => t.value === value);
|
|
867
|
+
if (act) shown = [...shown.slice(0, Math.max(0, fit - 1)), act];
|
|
868
|
+
}
|
|
869
|
+
const rest = items.filter((t) => !shown.includes(t));
|
|
870
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
871
|
+
ref: wrap,
|
|
872
|
+
className: "relative -mt-1 flex min-w-0 items-stretch",
|
|
873
|
+
children: [
|
|
874
|
+
/* @__PURE__ */ jsx(Segmented, {
|
|
875
|
+
variant: "tabs",
|
|
876
|
+
bordered: true,
|
|
877
|
+
"aria-label": "Field groups",
|
|
878
|
+
size: "md",
|
|
879
|
+
layoutId: `kit-tab-${uid}-${id}`,
|
|
880
|
+
value,
|
|
881
|
+
onChange,
|
|
882
|
+
className: cn("min-w-0 flex-1", variant === "document" ? "gap-5" : "gap-4"),
|
|
883
|
+
items: shown.map(toTab)
|
|
884
|
+
}),
|
|
885
|
+
rest.length ? /* @__PURE__ */ jsxs("span", {
|
|
886
|
+
className: "flex shrink-0 items-center border-b border-kit-line pl-2",
|
|
887
|
+
children: [/* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuTrigger, {
|
|
888
|
+
render: /* @__PURE__ */ jsx("button", {
|
|
889
|
+
type: "button",
|
|
890
|
+
className: "inline-flex h-8 items-center gap-1 text-kit-sm font-medium text-kit-fg-3 transition-colors hover:text-kit-fg-2 data-[popup-open]:text-kit-fg"
|
|
891
|
+
}),
|
|
892
|
+
children: [
|
|
893
|
+
"More",
|
|
894
|
+
rest.some((t) => t.errors) ? /* @__PURE__ */ jsx("span", {
|
|
895
|
+
className: "size-1.5 rounded-full bg-kit-danger",
|
|
896
|
+
"aria-label": "has errors"
|
|
897
|
+
}) : null,
|
|
898
|
+
/* @__PURE__ */ jsx(IconChevronDown, {
|
|
899
|
+
className: "size-3.5",
|
|
900
|
+
stroke: 1.5,
|
|
901
|
+
"aria-hidden": true
|
|
902
|
+
})
|
|
903
|
+
]
|
|
904
|
+
}), /* @__PURE__ */ jsx(MenuContent, {
|
|
905
|
+
align: "end",
|
|
906
|
+
children: rest.map((t) => /* @__PURE__ */ jsxs(MenuItem, {
|
|
907
|
+
icon: t.icon ? /* @__PURE__ */ jsx(KitIcon, {
|
|
908
|
+
name: t.icon,
|
|
909
|
+
className: "size-3.5"
|
|
910
|
+
}) : void 0,
|
|
911
|
+
onClick: () => onChange(t.value),
|
|
912
|
+
children: [t.label, t.errors ? /* @__PURE__ */ jsx("span", {
|
|
913
|
+
className: "ml-1.5 inline-block size-1.5 rounded-full bg-kit-danger",
|
|
914
|
+
"aria-label": "has errors"
|
|
915
|
+
}) : null]
|
|
916
|
+
}, t.value))
|
|
917
|
+
})] }), /* @__PURE__ */ jsx("span", {
|
|
918
|
+
hidden: true,
|
|
919
|
+
children: rest.map((t) => /* @__PURE__ */ jsx("button", {
|
|
920
|
+
type: "button",
|
|
921
|
+
tabIndex: -1,
|
|
922
|
+
"data-seg-value": t.value,
|
|
923
|
+
onClick: () => onChange(t.value)
|
|
924
|
+
}, t.value))
|
|
925
|
+
})]
|
|
926
|
+
}) : null,
|
|
927
|
+
/* @__PURE__ */ jsx("div", {
|
|
928
|
+
ref: measure,
|
|
929
|
+
"aria-hidden": true,
|
|
930
|
+
inert: true,
|
|
931
|
+
className: "pointer-events-none invisible absolute left-0 top-0 flex whitespace-nowrap",
|
|
932
|
+
children: /* @__PURE__ */ jsx(Segmented, {
|
|
933
|
+
variant: "tabs",
|
|
934
|
+
size: "md",
|
|
935
|
+
value: "__measure",
|
|
936
|
+
onChange: () => {},
|
|
937
|
+
className: variant === "document" ? "gap-5" : "gap-4",
|
|
938
|
+
items: items.map(toTab)
|
|
939
|
+
})
|
|
940
|
+
})
|
|
941
|
+
]
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
function FieldsetSection({ set, fields, basePath, obj, memoryKey, divider, renderField }) {
|
|
945
|
+
const form = useForm();
|
|
946
|
+
const env = useKitEnv();
|
|
947
|
+
const breakpoints = set.layout === "breakpoints" && fields.length >= 2 && fields.every((f) => f.type === "object");
|
|
948
|
+
const remembered = form.memory.get(memoryKey);
|
|
949
|
+
const [open, setOpen] = React.useState(remembered ?? !set.collapsed);
|
|
950
|
+
const status = useGroupStatus(fields.map((f) => [...basePath, f.name]));
|
|
951
|
+
if (breakpoints) return /* @__PURE__ */ jsx(BreakpointGroup, {
|
|
952
|
+
set,
|
|
953
|
+
members: fields,
|
|
954
|
+
basePath,
|
|
955
|
+
memoryKey,
|
|
956
|
+
divider,
|
|
957
|
+
renderField
|
|
958
|
+
});
|
|
959
|
+
return /* @__PURE__ */ jsx(FieldSection, {
|
|
960
|
+
title: set.title,
|
|
961
|
+
description: set.description,
|
|
962
|
+
collapsible: set.collapsible !== false,
|
|
963
|
+
open,
|
|
964
|
+
onOpenChange: (o) => {
|
|
965
|
+
setOpen(o);
|
|
966
|
+
form.memory.set(memoryKey, o);
|
|
967
|
+
},
|
|
968
|
+
summary: env.sectionSummary?.(set, obj) ?? (groupSummary(fields, obj) || "Nothing set yet"),
|
|
969
|
+
status,
|
|
970
|
+
divider,
|
|
971
|
+
revealWhen: form.showAllErrors && status.errors > 0,
|
|
972
|
+
children: /* @__PURE__ */ jsx(FieldRun, {
|
|
973
|
+
fields,
|
|
974
|
+
columns: set.columns === 2,
|
|
975
|
+
render: (f) => renderField(f, [...basePath, f.name], obj)
|
|
976
|
+
})
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
/** D41: a short field shares a 2-column row; a scale, slider, cards or radio select needs the full row. */
|
|
980
|
+
var isShort = (f) => [
|
|
981
|
+
"string",
|
|
982
|
+
"number",
|
|
983
|
+
"select",
|
|
984
|
+
"color",
|
|
985
|
+
"icon",
|
|
986
|
+
"boolean",
|
|
987
|
+
"date",
|
|
988
|
+
"slug",
|
|
989
|
+
"email",
|
|
990
|
+
"url",
|
|
991
|
+
"rating"
|
|
992
|
+
].includes(f.type) && !(f.type === "select" && (f.layout === "cards" || f.layout === "radio")) && !(f.type === "number" && (f.scale || f.layout === "slider"));
|
|
993
|
+
//#endregion
|
|
994
|
+
export { AnimatedFields, Appear, BreakpointGroup, FieldInset, FieldList, FieldRun, FieldSection, FieldUnit, FieldUnitRow, FieldsetSection, GroupTabs, INSET_LINE, IconGroup, InsetScope, RHYTHM, SHORT_TEXT_MAX, arrangeFields, columnSpans, defaultGroup, groupSummary, isBreakpointName, isColumnField, isShort, splitIcons, useGroupStatus, useInsetDepth, useRhythm };
|
|
995
|
+
|
|
996
|
+
//# sourceMappingURL=grouping.js.map
|