@bettercms-ai/kit 0.1.0 → 1.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/_virtual/_rolldown/runtime.js +13 -0
- package/adapters/icons.d.ts +15 -0
- package/adapters/icons.js +27 -0
- package/adapters/icons.js.map +1 -0
- package/adapters/lossy.d.ts +267 -0
- package/adapters/lossy.js +233 -0
- package/adapters/lossy.js.map +1 -0
- package/adapters/prod-types.d.ts +468 -0
- package/adapters/prod-types.js +646 -0
- package/adapters/prod-types.js.map +1 -0
- package/adapters/schema.d.ts +115 -0
- package/adapters/schema.js +2203 -0
- package/adapters/schema.js.map +1 -0
- package/adapters/values.d.ts +200 -0
- package/adapters/values.js +553 -0
- package/adapters/values.js.map +1 -0
- package/brand/logo.d.ts +17 -0
- package/brand/logo.js +9 -0
- package/brand/logo.js.map +1 -0
- package/context.d.ts +269 -0
- package/context.js +214 -0
- package/context.js.map +1 -0
- package/controls/button.d.ts +58 -0
- package/controls/button.js +507 -0
- package/controls/button.js.map +1 -0
- package/controls/c1.d.ts +11 -0
- package/controls/c1.js +24 -0
- package/controls/c1.js.map +1 -0
- package/controls/c2.d.ts +10 -0
- package/controls/c2.js +19 -0
- package/controls/c2.js.map +1 -0
- package/controls/choice.d.ts +39 -0
- package/controls/choice.js +410 -0
- package/controls/choice.js.map +1 -0
- package/controls/code-register.d.ts +1 -0
- package/controls/code-register.js +8 -0
- package/controls/code-register.js.map +1 -0
- package/controls/code.d.ts +42 -0
- package/controls/code.js +396 -0
- package/controls/code.js.map +1 -0
- package/controls/color.d.ts +5 -0
- package/controls/color.js +130 -0
- package/controls/color.js.map +1 -0
- package/controls/component-services.d.ts +114 -0
- package/controls/date-register.d.ts +1 -0
- package/controls/date-register.js +9 -0
- package/controls/date-register.js.map +1 -0
- package/controls/date-zone.d.ts +104 -0
- package/controls/date-zone.js +272 -0
- package/controls/date-zone.js.map +1 -0
- package/controls/date.d.ts +7 -0
- package/controls/date.js +458 -0
- package/controls/date.js.map +1 -0
- package/controls/form-picker-register.d.ts +1 -0
- package/controls/form-picker-register.js +19 -0
- package/controls/form-picker-register.js.map +1 -0
- package/controls/form-picker.d.ts +43 -0
- package/controls/form-picker.js +83 -0
- package/controls/form-picker.js.map +1 -0
- package/controls/icon-register.d.ts +1 -0
- package/controls/icon-register.js +8 -0
- package/controls/icon-register.js.map +1 -0
- package/controls/icon.d.ts +38 -0
- package/controls/icon.js +355 -0
- package/controls/icon.js.map +1 -0
- package/controls/index.d.ts +5 -0
- package/controls/index.js +37 -0
- package/controls/index.js.map +1 -0
- package/controls/json-register.d.ts +1 -0
- package/controls/json-register.js +8 -0
- package/controls/json-register.js.map +1 -0
- package/controls/json.d.ts +2 -0
- package/controls/json.js +72 -0
- package/controls/json.js.map +1 -0
- package/controls/link.d.ts +260 -0
- package/controls/link.js +1186 -0
- package/controls/link.js.map +1 -0
- package/controls/location-register.d.ts +1 -0
- package/controls/location-register.js +8 -0
- package/controls/location-register.js.map +1 -0
- package/controls/location.d.ts +16 -0
- package/controls/location.js +197 -0
- package/controls/location.js.map +1 -0
- package/controls/media-register.d.ts +1 -0
- package/controls/media-register.js +12 -0
- package/controls/media-register.js.map +1 -0
- package/controls/media-services.d.ts +40 -0
- package/controls/media.d.ts +73 -0
- package/controls/media.js +1076 -0
- package/controls/media.js.map +1 -0
- package/controls/number.d.ts +22 -0
- package/controls/number.js +195 -0
- package/controls/number.js.map +1 -0
- package/controls/reference-register.d.ts +1 -0
- package/controls/reference-register.js +10 -0
- package/controls/reference-register.js.map +1 -0
- package/controls/reference-services.d.ts +54 -0
- package/controls/reference.d.ts +23 -0
- package/controls/reference.js +761 -0
- package/controls/reference.js.map +1 -0
- package/controls/rich-text/blocks.d.ts +28 -0
- package/controls/rich-text/blocks.js +1532 -0
- package/controls/rich-text/blocks.js.map +1 -0
- package/controls/rich-text/catalog.d.ts +98 -0
- package/controls/rich-text/catalog.js +613 -0
- package/controls/rich-text/catalog.js.map +1 -0
- package/controls/rich-text/codec.d.ts +56 -0
- package/controls/rich-text/codec.js +32 -0
- package/controls/rich-text/codec.js.map +1 -0
- package/controls/rich-text/component-card.d.ts +14 -0
- package/controls/rich-text/component-card.js +706 -0
- package/controls/rich-text/component-card.js.map +1 -0
- package/controls/rich-text/control.d.ts +21 -0
- package/controls/rich-text/control.js +254 -0
- package/controls/rich-text/control.js.map +1 -0
- package/controls/rich-text/dom.d.ts +190 -0
- package/controls/rich-text/dom.js +690 -0
- package/controls/rich-text/dom.js.map +1 -0
- package/controls/rich-text/editor.d.ts +50 -0
- package/controls/rich-text/editor.js +1530 -0
- package/controls/rich-text/editor.js.map +1 -0
- package/controls/rich-text/floating.d.ts +23 -0
- package/controls/rich-text/floating.js +137 -0
- package/controls/rich-text/floating.js.map +1 -0
- package/controls/rich-text/index.d.ts +1 -0
- package/controls/rich-text/index.js +12 -0
- package/controls/rich-text/index.js.map +1 -0
- package/controls/rich-text/link-form.d.ts +13 -0
- package/controls/rich-text/link-form.js +111 -0
- package/controls/rich-text/link-form.js.map +1 -0
- package/controls/rich-text/markdown.d.ts +6 -0
- package/controls/rich-text/markdown.js +179 -0
- package/controls/rich-text/markdown.js.map +1 -0
- package/controls/rich-text/ops.d.ts +35 -0
- package/controls/rich-text/ops.js +314 -0
- package/controls/rich-text/ops.js.map +1 -0
- package/controls/rich-text/toolbar.d.ts +85 -0
- package/controls/rich-text/toolbar.js +338 -0
- package/controls/rich-text/toolbar.js.map +1 -0
- package/controls/scale.d.ts +56 -0
- package/controls/scale.js +563 -0
- package/controls/scale.js.map +1 -0
- package/controls/slot-register.d.ts +1 -0
- package/controls/slot-register.js +16 -0
- package/controls/slot-register.js.map +1 -0
- package/controls/slot-services.d.ts +97 -0
- package/controls/slot-services.js +38 -0
- package/controls/slot-services.js.map +1 -0
- package/controls/slot.d.ts +33 -0
- package/controls/slot.js +348 -0
- package/controls/slot.js.map +1 -0
- package/controls/table/index.d.ts +1 -0
- package/controls/table/index.js +12 -0
- package/controls/table/index.js.map +1 -0
- package/controls/table/prod.d.ts +21 -0
- package/controls/table/prod.js +79 -0
- package/controls/table/prod.js.map +1 -0
- package/controls/table/refs.d.ts +50 -0
- package/controls/table/refs.js +68 -0
- package/controls/table/refs.js.map +1 -0
- package/controls/table/stored.d.ts +15 -0
- package/controls/table/stored.js +44 -0
- package/controls/table/stored.js.map +1 -0
- package/controls/table/table-editor.d.ts +103 -0
- package/controls/table/table-editor.js +2722 -0
- package/controls/table/table-editor.js.map +1 -0
- package/controls/table/table-link.d.ts +24 -0
- package/controls/table/table-link.js +180 -0
- package/controls/table/table-link.js.map +1 -0
- package/controls/table/table.d.ts +9 -0
- package/controls/table/table.js +103 -0
- package/controls/table/table.js.map +1 -0
- package/controls/text.d.ts +17 -0
- package/controls/text.js +287 -0
- package/controls/text.js.map +1 -0
- package/engine/array.d.ts +101 -0
- package/engine/array.js +893 -0
- package/engine/array.js.map +1 -0
- package/engine/bits.d.ts +24 -0
- package/engine/bits.js +60 -0
- package/engine/bits.js.map +1 -0
- package/engine/breadcrumb.d.ts +45 -0
- package/engine/breadcrumb.js +87 -0
- package/engine/breadcrumb.js.map +1 -0
- package/engine/expand.d.ts +68 -0
- package/engine/expand.js +170 -0
- package/engine/expand.js.map +1 -0
- package/engine/field-list.d.ts +20 -0
- package/engine/field-list.js +19 -0
- package/engine/field-list.js.map +1 -0
- package/engine/field-shell.d.ts +49 -0
- package/engine/field-shell.js +860 -0
- package/engine/field-shell.js.map +1 -0
- package/engine/frame.d.ts +120 -0
- package/engine/frame.js +599 -0
- package/engine/frame.js.map +1 -0
- package/engine/group-summary.d.ts +4 -0
- package/engine/group-summary.js +66 -0
- package/engine/group-summary.js.map +1 -0
- package/engine/grouping.d.ts +224 -0
- package/engine/grouping.js +824 -0
- package/engine/grouping.js.map +1 -0
- package/engine/item-list.d.ts +89 -0
- package/engine/item-list.js +703 -0
- package/engine/item-list.js.map +1 -0
- package/engine/kit-field.d.ts +72 -0
- package/engine/kit-field.js +523 -0
- package/engine/kit-field.js.map +1 -0
- package/engine/schema-form.d.ts +91 -0
- package/engine/schema-form.js +320 -0
- package/engine/schema-form.js.map +1 -0
- package/engine/slot.d.ts +13 -0
- package/engine/slot.js +226 -0
- package/engine/slot.js.map +1 -0
- package/index.d.ts +46 -0
- package/index.js +55 -0
- package/index.js.map +1 -0
- package/kit.css +56 -0
- package/lib/cn.d.ts +4 -0
- package/lib/cn.js +53 -0
- package/lib/cn.js.map +1 -0
- package/lib/columns.d.ts +14 -0
- package/lib/columns.js +27 -0
- package/lib/columns.js.map +1 -0
- package/lib/frames.d.ts +36 -0
- package/lib/frames.js +214 -0
- package/lib/frames.js.map +1 -0
- package/lib/icons.d.ts +16 -0
- package/lib/icons.js +172 -0
- package/lib/icons.js.map +1 -0
- package/lib/path.d.ts +29 -0
- package/lib/path.js +64 -0
- package/lib/path.js.map +1 -0
- package/lib/schema.d.ts +49 -0
- package/lib/schema.js +287 -0
- package/lib/schema.js.map +1 -0
- package/lib/utils.d.ts +7 -0
- package/lib/utils.js +37 -0
- package/lib/utils.js.map +1 -0
- package/lib/validate.d.ts +20 -0
- package/lib/validate.js +150 -0
- package/lib/validate.js.map +1 -0
- package/package.json +31 -59
- package/schema/adapters.d.ts +28 -0
- package/schema/adapters.js +493 -0
- package/schema/adapters.js.map +1 -0
- package/schema/help.d.ts +25 -0
- package/schema/help.js +54 -0
- package/schema/help.js.map +1 -0
- package/schema/scale.d.ts +69 -0
- package/schema/scale.js +250 -0
- package/schema/scale.js.map +1 -0
- package/schema/sources.d.ts +103 -0
- package/schema/sources.js +65 -0
- package/schema/sources.js.map +1 -0
- package/schema/table.d.ts +319 -0
- package/schema/table.js +1198 -0
- package/schema/table.js.map +1 -0
- package/schema/types.d.ts +269 -0
- package/schema/types.js +14 -0
- package/schema/types.js.map +1 -0
- package/types.d.ts +17 -0
- package/ui/action-tray.d.ts +54 -0
- package/ui/action-tray.js +153 -0
- package/ui/action-tray.js.map +1 -0
- package/ui/button.d.ts +57 -0
- package/ui/button.js +202 -0
- package/ui/button.js.map +1 -0
- package/ui/choice-switch.d.ts +36 -0
- package/ui/choice-switch.js +57 -0
- package/ui/choice-switch.js.map +1 -0
- package/ui/controls.d.ts +83 -0
- package/ui/controls.js +319 -0
- package/ui/controls.js.map +1 -0
- package/ui/display.d.ts +156 -0
- package/ui/display.js +444 -0
- package/ui/display.js.map +1 -0
- package/ui/expanded-editor-modal.d.ts +26 -0
- package/ui/expanded-editor-modal.js +140 -0
- package/ui/expanded-editor-modal.js.map +1 -0
- package/ui/field-context.d.ts +12 -0
- package/ui/field-context.js +23 -0
- package/ui/field-context.js.map +1 -0
- package/ui/floating-panel.d.ts +152 -0
- package/ui/floating-panel.js +912 -0
- package/ui/floating-panel.js.map +1 -0
- package/ui/index.d.ts +12 -0
- package/ui/index.js +13 -0
- package/ui/input.d.ts +78 -0
- package/ui/input.js +250 -0
- package/ui/input.js.map +1 -0
- package/ui/mode-bar.d.ts +31 -0
- package/ui/mode-bar.js +65 -0
- package/ui/mode-bar.js.map +1 -0
- package/ui/overlay.d.ts +123 -0
- package/ui/overlay.js +378 -0
- package/ui/overlay.js.map +1 -0
- package/ui/path-crumbs.d.ts +90 -0
- package/ui/path-crumbs.js +532 -0
- package/ui/path-crumbs.js.map +1 -0
- package/ui/presence.d.ts +16 -0
- package/ui/presence.js +65 -0
- package/ui/presence.js.map +1 -0
- package/ui/select.d.ts +66 -0
- package/ui/select.js +405 -0
- package/ui/select.js.map +1 -0
- package/ui/shortcut-hint.d.ts +14 -0
- package/ui/shortcut-hint.js +35 -0
- package/ui/shortcut-hint.js.map +1 -0
- package/ui/surfaces.d.ts +23 -0
- package/ui/surfaces.js +26 -0
- package/ui/surfaces.js.map +1 -0
- package/ui/tooltip-root.d.ts +12 -0
- package/ui/tooltip-root.js +76 -0
- package/ui/tooltip-root.js.map +1 -0
- package/ui/variants.d.ts +15 -0
- package/ui/variants.js +14 -0
- package/ui/variants.js.map +1 -0
- package/LICENSE +0 -21
- package/README.md +0 -27
- 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.d.ts +0 -3140
- package/dist/index.js +0 -2036
- package/dist/index.mjs +0 -2044
- package/dist/theme.d.mts +0 -1506
- package/dist/theme.d.ts +0 -1506
- package/dist/theme.js +0 -4126
- 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
package/engine/array.js
ADDED
|
@@ -0,0 +1,893 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { ensureKeys, isObj, itemId, newKey, pathKey } from "../lib/path.js";
|
|
3
|
+
import { KitIcon } from "../lib/icons.js";
|
|
4
|
+
import { useForm, useKitEnv, useKitServices } from "../context.js";
|
|
5
|
+
import { FieldLabelForContext } from "../ui/field-context.js";
|
|
6
|
+
import { Button } from "../ui/button.js";
|
|
7
|
+
import { Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuTrigger, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Popover, PopoverAnchor, PopoverContent, Tooltip } from "../ui/overlay.js";
|
|
8
|
+
import { initialFor, itemNoun, itemOpenMode, itemSchemaFor, itemSchemas, newItem, previewOf, primitiveItem } from "../lib/schema.js";
|
|
9
|
+
import { IssueDot, Thumb } from "./bits.js";
|
|
10
|
+
import { FieldShell, PeerStack } from "./field-shell.js";
|
|
11
|
+
import { INSET_LINE, InsetScope } from "./grouping.js";
|
|
12
|
+
import { FieldList } from "./field-list.js";
|
|
13
|
+
import { ItemList, arrayMove, useDragReorder } from "./item-list.js";
|
|
14
|
+
import { CONTROLS, FallbackControl, useFieldAccess } from "./kit-field.js";
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
import { IconArrowDown, IconArrowUp, IconArrowsDiagonal, IconCheck, IconChevronDown, IconChevronRight, IconCopy, IconDots, IconGripVertical, IconMinus, IconPlus, IconRowInsertBottom, IconRowInsertTop, IconTrash, IconX } from "@tabler/icons-react";
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
19
|
+
//#region src/kit/engine/array.tsx
|
|
20
|
+
/**
|
|
21
|
+
* ARRAYS — compact PREVIEW ROWS that rest closed (CPO D8 + production; V2 HEAD 9829bf1 kit/engine/array.tsx): grip ·
|
|
22
|
+
* thumb · title + subtitle · validation dot · presence · always-visible ⋯ (Move up/down, Duplicate, Add above/below,
|
|
23
|
+
* Remove). Opening a row follows ONE rule (CPO D43): ≤3 simple fields expand inline, else it drills in (`openMode`
|
|
24
|
+
* overrides). Reorder by drag with layout animation; delete with an Undo toast; "Add {noun}" (a type menu when several
|
|
25
|
+
* item types); min/max honoured.
|
|
26
|
+
* Arrays of primitives render as a gallery (images), reference chips, or — for text, numbers and URLs — the ITEM LIST
|
|
27
|
+
* (CPO D47): one input per row, no drill. Arrays of one-field objects (`[{ text }]`) use the same item list. Small
|
|
28
|
+
* objects with an `included` / `isIncluded` switch get that switch as a check on the row itself.
|
|
29
|
+
*
|
|
30
|
+
* Host wiring (RowsHostContext): a drill row calls `drill(path)` (the frame push); without one it falls back to
|
|
31
|
+
* `form.navigate` while the form draws frames (`form.canNavigate`), else drill rows are inert (no button, no ›).
|
|
32
|
+
* Dialog items render the host's `NestedForm` (V2 kit-field NestedForm: its own navigation stack); without one the
|
|
33
|
+
* dialog shows the item's FieldList.
|
|
34
|
+
*
|
|
35
|
+
* Kit deviations from V2: sorting is `useDragReorder` (no @dnd-kit in the kit; it keeps dnd-kit's pointer and keyboard
|
|
36
|
+
* sensor semantics: Space / Enter picks up, arrows move, Space / Enter drops as one write, Escape cancels; the table editor's cross-list drag via
|
|
37
|
+
* `sortableId` is not ported); toasts come from KitServices (absent → silent); the gallery and reference-chip controls come from
|
|
38
|
+
* ARRAY_CONTROLS (registered by the controls lane); a host that never registered them edits the raw list (FallbackControl).
|
|
39
|
+
*/
|
|
40
|
+
var RowsHostContext = React.createContext({});
|
|
41
|
+
/** The frame push for a drill row, or undefined when nothing can draw the frame (the row is then inert). */
|
|
42
|
+
function useDrill() {
|
|
43
|
+
const host = React.useContext(RowsHostContext);
|
|
44
|
+
const form = useForm();
|
|
45
|
+
return host.drill ?? (form?.canNavigate ? form.navigate : void 0);
|
|
46
|
+
}
|
|
47
|
+
/** Primitive-array controls V2 imports from controls/media (GalleryControl) and controls/reference (ReferencesControl). */
|
|
48
|
+
var ARRAY_CONTROLS = {};
|
|
49
|
+
var plural = (noun) => noun.endsWith("y") && !/[aeiou]y$/.test(noun) ? `${noun.slice(0, -1)}ies` : noun.endsWith("s") ? noun : `${noun}s`;
|
|
50
|
+
function ArrayField({ field, path }) {
|
|
51
|
+
const prim = primitiveItem(field);
|
|
52
|
+
if (prim) return /* @__PURE__ */ jsx(PrimitiveArray, {
|
|
53
|
+
field,
|
|
54
|
+
item: prim,
|
|
55
|
+
path
|
|
56
|
+
});
|
|
57
|
+
const one = oneFieldItem(field);
|
|
58
|
+
if (one) return /* @__PURE__ */ jsx(OneFieldArray, {
|
|
59
|
+
field,
|
|
60
|
+
item: one.item,
|
|
61
|
+
inner: one.inner,
|
|
62
|
+
path
|
|
63
|
+
});
|
|
64
|
+
return /* @__PURE__ */ jsx(ObjectArray, {
|
|
65
|
+
field,
|
|
66
|
+
path
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/** Item types that edit as one line in the item list. */
|
|
70
|
+
var LIST_KIND = {
|
|
71
|
+
string: "text",
|
|
72
|
+
text: "text",
|
|
73
|
+
slug: "text",
|
|
74
|
+
url: "url",
|
|
75
|
+
email: "email",
|
|
76
|
+
number: "number"
|
|
77
|
+
};
|
|
78
|
+
/** `[{ _key, text }]` — an object item with exactly one line-like field edits as the item list (unless the schema forces another open mode). */
|
|
79
|
+
function oneFieldItem(field) {
|
|
80
|
+
if (field.openMode && field.openMode !== "inline") return void 0;
|
|
81
|
+
const of = itemSchemas(field);
|
|
82
|
+
const item = of.length === 1 ? of[0] : void 0;
|
|
83
|
+
const inner = item?.type === "object" && item.fields?.length === 1 ? item.fields[0] : void 0;
|
|
84
|
+
return item && inner && LIST_KIND[inner.type] && !inner.scale ? {
|
|
85
|
+
item,
|
|
86
|
+
inner
|
|
87
|
+
} : void 0;
|
|
88
|
+
}
|
|
89
|
+
/** The boolean an item shows as a check on its row ("included" in a feature list). */
|
|
90
|
+
var ROW_TOGGLE = /^(is)?included$/i;
|
|
91
|
+
var rowToggleField = (s) => s?.fields?.find((f) => f.type === "boolean" && ROW_TOGGLE.test(f.name));
|
|
92
|
+
/** List meta on the message line: "3 items · max 6". */
|
|
93
|
+
function listMeta(n, field) {
|
|
94
|
+
const { min, max } = field.validation ?? {};
|
|
95
|
+
const base = `${n} ${n === 1 ? "item" : "items"}`;
|
|
96
|
+
return max != null ? `${base} · max ${max}` : min != null ? `${base} · min ${min}` : n ? base : "";
|
|
97
|
+
}
|
|
98
|
+
function PrimitiveArray({ field, item, path }) {
|
|
99
|
+
const form = useForm();
|
|
100
|
+
const id = React.useId();
|
|
101
|
+
const { readOnly } = useFieldAccess(field);
|
|
102
|
+
const key = pathKey(path);
|
|
103
|
+
const value = form.getAt(path);
|
|
104
|
+
const list = Array.isArray(value) ? value : [];
|
|
105
|
+
const onChange = (v) => form.setAt(path, v);
|
|
106
|
+
const props = {
|
|
107
|
+
field,
|
|
108
|
+
value: list,
|
|
109
|
+
onChange,
|
|
110
|
+
id,
|
|
111
|
+
readOnly,
|
|
112
|
+
path,
|
|
113
|
+
onBlur: () => form.touch(key)
|
|
114
|
+
};
|
|
115
|
+
const kind = LIST_KIND[item.type];
|
|
116
|
+
const adapter = React.useMemo(() => kind ? {
|
|
117
|
+
kind,
|
|
118
|
+
read: (v) => v == null ? "" : String(v),
|
|
119
|
+
write: (v) => v,
|
|
120
|
+
valuePath: (i) => [i],
|
|
121
|
+
placeholder: item.placeholder ?? (item.title && !/^(item|value)$/i.test(item.title) ? item.title : void 0)
|
|
122
|
+
} : void 0, [
|
|
123
|
+
kind,
|
|
124
|
+
item.placeholder,
|
|
125
|
+
item.title
|
|
126
|
+
]);
|
|
127
|
+
const Gallery = ARRAY_CONTROLS.gallery;
|
|
128
|
+
const References = ARRAY_CONTROLS.references;
|
|
129
|
+
const control = item.type === "image" ? Gallery ? /* @__PURE__ */ jsx(Gallery, { ...props }) : /* @__PURE__ */ jsx(FallbackControl, { ...props }) : item.type === "reference" ? References ? /* @__PURE__ */ jsx(References, {
|
|
130
|
+
...props,
|
|
131
|
+
field: {
|
|
132
|
+
...field,
|
|
133
|
+
reference: item.reference
|
|
134
|
+
}
|
|
135
|
+
}) : /* @__PURE__ */ jsx(FallbackControl, { ...props }) : adapter ? /* @__PURE__ */ jsx(ItemList, {
|
|
136
|
+
field,
|
|
137
|
+
path,
|
|
138
|
+
list,
|
|
139
|
+
readOnly,
|
|
140
|
+
adapter,
|
|
141
|
+
inputId: id
|
|
142
|
+
}) : /* @__PURE__ */ jsx(InlineList, {
|
|
143
|
+
field,
|
|
144
|
+
item,
|
|
145
|
+
path,
|
|
146
|
+
list,
|
|
147
|
+
readOnly
|
|
148
|
+
});
|
|
149
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
150
|
+
field,
|
|
151
|
+
path,
|
|
152
|
+
id,
|
|
153
|
+
value: list,
|
|
154
|
+
onChange,
|
|
155
|
+
readOnly,
|
|
156
|
+
issue: form.visibleIssue(key),
|
|
157
|
+
meta: item.type === "reference" ? void 0 : /* @__PURE__ */ jsx("span", {
|
|
158
|
+
className: "text-kit-xs text-kit-fg-3",
|
|
159
|
+
children: listMeta(list.length, field)
|
|
160
|
+
}),
|
|
161
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
162
|
+
className: "@container",
|
|
163
|
+
children: control
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function OneFieldArray({ field, item, inner, path }) {
|
|
168
|
+
const form = useForm();
|
|
169
|
+
const id = React.useId();
|
|
170
|
+
const { readOnly } = useFieldAccess(field);
|
|
171
|
+
const key = pathKey(path);
|
|
172
|
+
const value = form.getAt(path);
|
|
173
|
+
const list = Array.isArray(value) ? value : [];
|
|
174
|
+
const adapter = React.useMemo(() => ({
|
|
175
|
+
kind: LIST_KIND[inner.type],
|
|
176
|
+
read: (v) => {
|
|
177
|
+
const x = isObj(v) ? v[inner.name] : void 0;
|
|
178
|
+
return x == null ? "" : String(x);
|
|
179
|
+
},
|
|
180
|
+
write: (v, prev) => ({
|
|
181
|
+
...isObj(prev) ? prev : newItem(field, item),
|
|
182
|
+
[inner.name]: v
|
|
183
|
+
}),
|
|
184
|
+
keyOf: (v) => isObj(v) && typeof v._key === "string" ? v._key : void 0,
|
|
185
|
+
valuePath: (i) => [i, inner.name],
|
|
186
|
+
placeholder: inner.placeholder ?? item.preview?.fallback?.replace(/^Untitled /i, "").replace(/^./, (c) => c.toUpperCase())
|
|
187
|
+
}), [
|
|
188
|
+
field,
|
|
189
|
+
item,
|
|
190
|
+
inner
|
|
191
|
+
]);
|
|
192
|
+
React.useEffect(() => {
|
|
193
|
+
if (!readOnly && list.some((it) => isObj(it) && typeof it._key !== "string")) form.setAt(path, ensureKeys(list));
|
|
194
|
+
}, [list, readOnly]);
|
|
195
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
196
|
+
field,
|
|
197
|
+
path,
|
|
198
|
+
id,
|
|
199
|
+
value: list,
|
|
200
|
+
onChange: (v) => form.setAt(path, v),
|
|
201
|
+
readOnly,
|
|
202
|
+
issue: form.visibleIssue(key),
|
|
203
|
+
meta: /* @__PURE__ */ jsx("span", {
|
|
204
|
+
className: "text-kit-xs text-kit-fg-3",
|
|
205
|
+
children: listMeta(list.length, field)
|
|
206
|
+
}),
|
|
207
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
208
|
+
className: "@container",
|
|
209
|
+
children: /* @__PURE__ */ jsx(ItemList, {
|
|
210
|
+
field,
|
|
211
|
+
path,
|
|
212
|
+
list,
|
|
213
|
+
readOnly,
|
|
214
|
+
adapter,
|
|
215
|
+
inputId: id
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function InlineList({ field, item, path, list, readOnly }) {
|
|
221
|
+
const form = useForm();
|
|
222
|
+
const Control = CONTROLS[item.type] ?? FallbackControl;
|
|
223
|
+
const max = field.validation?.max;
|
|
224
|
+
const ids = list.map((_, i) => `p${i}`);
|
|
225
|
+
const sort = useDragReorder(ids, (from, to) => form.setAt(path, arrayMove(list, from, to)), { disabled: readOnly });
|
|
226
|
+
const rowControl = (v, i) => /* @__PURE__ */ jsx(Control, {
|
|
227
|
+
field: {
|
|
228
|
+
...item,
|
|
229
|
+
title: `${item.title} ${i + 1}`
|
|
230
|
+
},
|
|
231
|
+
value: v,
|
|
232
|
+
onChange: (n) => form.setAt([...path, i], n),
|
|
233
|
+
id: `${pathKey(path)}-${i}`,
|
|
234
|
+
path: [...path, i],
|
|
235
|
+
readOnly
|
|
236
|
+
});
|
|
237
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
238
|
+
className: "flex flex-col gap-1.5",
|
|
239
|
+
children: [
|
|
240
|
+
list.map((v, i) => /* @__PURE__ */ jsxs(InlineRow, {
|
|
241
|
+
id: ids[i],
|
|
242
|
+
labelId: `${pathKey(path)}-${i}-label`,
|
|
243
|
+
sort,
|
|
244
|
+
readOnly,
|
|
245
|
+
onRemove: () => form.setAt(path, list.filter((_, j) => j !== i)),
|
|
246
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
247
|
+
id: `${pathKey(path)}-${i}-label`,
|
|
248
|
+
className: "sr-only",
|
|
249
|
+
children: `${item.title} ${i + 1}`
|
|
250
|
+
}), /* @__PURE__ */ jsx(FieldLabelForContext.Provider, {
|
|
251
|
+
value: {
|
|
252
|
+
htmlFor: `${pathKey(path)}-${i}`,
|
|
253
|
+
labelId: `${pathKey(path)}-${i}-label`
|
|
254
|
+
},
|
|
255
|
+
children: rowControl(v, i)
|
|
256
|
+
})]
|
|
257
|
+
}, ids[i])),
|
|
258
|
+
sort.a11y,
|
|
259
|
+
readOnly ? null : /* @__PURE__ */ jsxs(Button, {
|
|
260
|
+
size: "sm",
|
|
261
|
+
variant: "ghost",
|
|
262
|
+
className: "self-start text-kit-fg-2",
|
|
263
|
+
leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
|
|
264
|
+
disabled: max != null && list.length >= max,
|
|
265
|
+
onClick: () => form.setAt(path, [...list, initialFor(item)]),
|
|
266
|
+
children: ["Add ", itemNoun(field)]
|
|
267
|
+
})
|
|
268
|
+
]
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function InlineRow({ id, labelId, sort, children, onRemove, readOnly }) {
|
|
272
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
273
|
+
ref: sort.register(id),
|
|
274
|
+
style: sort.style(id),
|
|
275
|
+
className: cn("group/il flex items-start gap-1", sort.active === id && "relative z-10"),
|
|
276
|
+
children: [
|
|
277
|
+
readOnly ? null : /* @__PURE__ */ jsx("button", {
|
|
278
|
+
type: "button",
|
|
279
|
+
"aria-label": "Drag to reorder",
|
|
280
|
+
...sort.handle(id),
|
|
281
|
+
className: "mt-1.5 flex h-5 w-4 shrink-0 cursor-grab touch-none items-center justify-center text-kit-fg-4 hover:text-kit-fg-2 active:cursor-grabbing",
|
|
282
|
+
children: /* @__PURE__ */ jsx(IconGripVertical, {
|
|
283
|
+
className: "size-3.5",
|
|
284
|
+
stroke: 1.5
|
|
285
|
+
})
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ jsx("div", {
|
|
288
|
+
role: "group",
|
|
289
|
+
"aria-labelledby": labelId,
|
|
290
|
+
className: "min-w-0 flex-1",
|
|
291
|
+
children
|
|
292
|
+
}),
|
|
293
|
+
readOnly ? null : /* @__PURE__ */ jsx(Tooltip, {
|
|
294
|
+
content: "Remove",
|
|
295
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
296
|
+
type: "button",
|
|
297
|
+
"aria-label": "Remove",
|
|
298
|
+
onClick: onRemove,
|
|
299
|
+
className: "mt-1 flex size-6 shrink-0 items-center justify-center rounded-kit-md text-kit-fg-3 opacity-0 transition-opacity hover:bg-kit-hover hover:text-kit-fg focus-visible:opacity-100 group-hover/il:opacity-100",
|
|
300
|
+
children: /* @__PURE__ */ jsx(IconX, {
|
|
301
|
+
className: "size-3.5",
|
|
302
|
+
stroke: 1.5
|
|
303
|
+
})
|
|
304
|
+
})
|
|
305
|
+
})
|
|
306
|
+
]
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function ObjectArray({ field, path }) {
|
|
310
|
+
const form = useForm();
|
|
311
|
+
const host = React.useContext(RowsHostContext);
|
|
312
|
+
const drill = useDrill();
|
|
313
|
+
const id = React.useId();
|
|
314
|
+
const { readOnly } = useFieldAccess(field);
|
|
315
|
+
const key = pathKey(path);
|
|
316
|
+
const value = form.getAt(path);
|
|
317
|
+
const list = Array.isArray(value) ? value : [];
|
|
318
|
+
const of = itemSchemas(field);
|
|
319
|
+
const mode = itemOpenMode(field);
|
|
320
|
+
const rows = list.map((it, i) => {
|
|
321
|
+
const s = itemSchemaFor(field, it);
|
|
322
|
+
const tf = rowToggleField(s);
|
|
323
|
+
return {
|
|
324
|
+
id: itemId(it, i),
|
|
325
|
+
index: i,
|
|
326
|
+
item: it,
|
|
327
|
+
preview: previewOf(s, it, i, s?.title ?? itemNoun(field)),
|
|
328
|
+
path: [...path, i],
|
|
329
|
+
chip: of.length > 1 ? s?.title : void 0,
|
|
330
|
+
dim: tf ? isObj(it) && it[tf.name] === false : void 0
|
|
331
|
+
};
|
|
332
|
+
});
|
|
333
|
+
const write = (next) => form.setAt(path, ensureKeys(next));
|
|
334
|
+
const ops = useListOps(field, path, list, write, (i) => mode === "drill" ? drill?.([...path, i]) : void 0);
|
|
335
|
+
const [openId, setOpenId] = React.useState(null);
|
|
336
|
+
const dialogNav = React.useRef(null);
|
|
337
|
+
const Nested = host.NestedForm;
|
|
338
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
339
|
+
field,
|
|
340
|
+
path,
|
|
341
|
+
id,
|
|
342
|
+
value: list,
|
|
343
|
+
onChange: (v) => form.setAt(path, v),
|
|
344
|
+
readOnly,
|
|
345
|
+
issue: form.visibleIssue(key),
|
|
346
|
+
meta: /* @__PURE__ */ jsx("span", {
|
|
347
|
+
className: "text-kit-xs text-kit-fg-3",
|
|
348
|
+
children: listMeta(list.length, field)
|
|
349
|
+
}),
|
|
350
|
+
children: /* @__PURE__ */ jsx(RowList, {
|
|
351
|
+
field,
|
|
352
|
+
rows,
|
|
353
|
+
readOnly,
|
|
354
|
+
layout: field.arrayLayout ?? "list",
|
|
355
|
+
mode,
|
|
356
|
+
openId,
|
|
357
|
+
onOpen: mode === "drill" ? drill && ((r) => drill(r.path)) : (r) => setOpenId(openId === r.id ? null : r.id),
|
|
358
|
+
onCloseInline: () => setOpenId(null),
|
|
359
|
+
ops,
|
|
360
|
+
dialogNav,
|
|
361
|
+
rowToggle: (r) => {
|
|
362
|
+
const tf = rowToggleField(itemSchemaFor(field, r.item));
|
|
363
|
+
if (!tf) return null;
|
|
364
|
+
const on = isObj(r.item) && r.item[tf.name] !== false;
|
|
365
|
+
return /* @__PURE__ */ jsx(RowCheck, {
|
|
366
|
+
on,
|
|
367
|
+
label: tf.title,
|
|
368
|
+
title: r.preview.title,
|
|
369
|
+
readOnly,
|
|
370
|
+
onToggle: () => form.setAt([...r.path, tf.name], !on)
|
|
371
|
+
});
|
|
372
|
+
},
|
|
373
|
+
renderInline: (r) => {
|
|
374
|
+
const s = itemSchemaFor(field, r.item);
|
|
375
|
+
if (mode === "dialog" && Nested) return /* @__PURE__ */ jsx(Nested, {
|
|
376
|
+
fields: s?.fields ?? [],
|
|
377
|
+
title: r.preview.title,
|
|
378
|
+
icon: s?.icon,
|
|
379
|
+
path: r.path,
|
|
380
|
+
navRef: dialogNav
|
|
381
|
+
});
|
|
382
|
+
const tf = rowToggleField(s);
|
|
383
|
+
return /* @__PURE__ */ jsx(FieldList, {
|
|
384
|
+
fields: (s?.fields ?? []).filter((f) => f !== tf),
|
|
385
|
+
basePath: r.path,
|
|
386
|
+
memoryKey: `inl:${pathKey(r.path)}`
|
|
387
|
+
});
|
|
388
|
+
},
|
|
389
|
+
emptyLabel: `No ${plural(itemNoun(field))} yet.`,
|
|
390
|
+
addButton: /* @__PURE__ */ jsx(AddItemButton, {
|
|
391
|
+
field,
|
|
392
|
+
disabled: readOnly || field.validation?.max != null && list.length >= field.validation.max,
|
|
393
|
+
onAdd: ops.add
|
|
394
|
+
})
|
|
395
|
+
})
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
/** Shared list operations (arrays and slots). Remove shows an Undo toast; add can drill into the new item. */
|
|
399
|
+
function useListOps(field, _path, list, write, afterAdd) {
|
|
400
|
+
const { toast } = useKitServices();
|
|
401
|
+
const { min, max } = field.validation ?? {};
|
|
402
|
+
const atMax = max != null && list.length >= max;
|
|
403
|
+
const atMin = min != null && list.length <= min;
|
|
404
|
+
const limit = () => toast?.("Limit reached", { description: `${field.title} allows ${max} at most.` });
|
|
405
|
+
return {
|
|
406
|
+
atMax,
|
|
407
|
+
atMin,
|
|
408
|
+
add: (item, at = list.length) => {
|
|
409
|
+
if (atMax) return limit();
|
|
410
|
+
write([
|
|
411
|
+
...list.slice(0, at),
|
|
412
|
+
item,
|
|
413
|
+
...list.slice(at)
|
|
414
|
+
]);
|
|
415
|
+
window.setTimeout(() => afterAdd?.(at), 0);
|
|
416
|
+
},
|
|
417
|
+
duplicate: (i) => {
|
|
418
|
+
if (atMax) return limit();
|
|
419
|
+
const copy = isObj(list[i]) ? {
|
|
420
|
+
...structuredClone(list[i]),
|
|
421
|
+
_key: newKey()
|
|
422
|
+
} : list[i];
|
|
423
|
+
write([
|
|
424
|
+
...list.slice(0, i + 1),
|
|
425
|
+
copy,
|
|
426
|
+
...list.slice(i + 1)
|
|
427
|
+
]);
|
|
428
|
+
},
|
|
429
|
+
move: (i, d) => write(arrayMove(list, i, i + d)),
|
|
430
|
+
reorder: (from, to) => write(arrayMove(list, from, to)),
|
|
431
|
+
remove: (i, title) => {
|
|
432
|
+
if (atMin) return toast?.(`At least ${min} required`, { description: `${field.title} needs ${min} or more.` });
|
|
433
|
+
const prev = list;
|
|
434
|
+
write(list.filter((_, j) => j !== i));
|
|
435
|
+
toast?.(`“${title}” removed`, {
|
|
436
|
+
action: {
|
|
437
|
+
label: "Undo",
|
|
438
|
+
onClick: () => write(prev)
|
|
439
|
+
},
|
|
440
|
+
duration: 1e4
|
|
441
|
+
});
|
|
442
|
+
},
|
|
443
|
+
insertBlank: (at) => {
|
|
444
|
+
const s = itemSchemas(field)[0];
|
|
445
|
+
if (!s || atMax) return;
|
|
446
|
+
write([
|
|
447
|
+
...list.slice(0, at),
|
|
448
|
+
newItem(field, s),
|
|
449
|
+
...list.slice(at)
|
|
450
|
+
]);
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
function AddItemButton({ field, onAdd, disabled }) {
|
|
455
|
+
const of = itemSchemas(field);
|
|
456
|
+
const noun = itemNoun(field);
|
|
457
|
+
if (of.length <= 1) return /* @__PURE__ */ jsxs(Button, {
|
|
458
|
+
size: "sm",
|
|
459
|
+
variant: "ghost",
|
|
460
|
+
className: "text-kit-fg-2",
|
|
461
|
+
leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
|
|
462
|
+
disabled,
|
|
463
|
+
onClick: () => of[0] && onAdd(newItem(field, of[0])),
|
|
464
|
+
children: ["Add ", noun]
|
|
465
|
+
});
|
|
466
|
+
return /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuTrigger, {
|
|
467
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
468
|
+
size: "sm",
|
|
469
|
+
variant: "ghost",
|
|
470
|
+
className: "text-kit-fg-2",
|
|
471
|
+
leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
|
|
472
|
+
disabled
|
|
473
|
+
}),
|
|
474
|
+
children: ["Add ", noun]
|
|
475
|
+
}), /* @__PURE__ */ jsxs(MenuContent, {
|
|
476
|
+
align: "start",
|
|
477
|
+
className: "w-64",
|
|
478
|
+
children: [/* @__PURE__ */ jsxs(MenuLabel, { children: ["Add to ", field.title.toLowerCase()] }), of.map((s) => /* @__PURE__ */ jsx(MenuItem, {
|
|
479
|
+
icon: /* @__PURE__ */ jsx(KitIcon, { name: s.icon }),
|
|
480
|
+
onClick: () => onAdd(newItem(field, s)),
|
|
481
|
+
className: "h-auto py-1.5",
|
|
482
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
483
|
+
className: "flex flex-col",
|
|
484
|
+
children: [/* @__PURE__ */ jsx("span", { children: s.title }), s.description ? /* @__PURE__ */ jsx("span", {
|
|
485
|
+
className: "whitespace-normal text-kit-xs text-kit-fg-3",
|
|
486
|
+
children: s.description
|
|
487
|
+
}) : null]
|
|
488
|
+
})
|
|
489
|
+
}, s.name))]
|
|
490
|
+
})] });
|
|
491
|
+
}
|
|
492
|
+
/** The row list used by arrays AND slots. Without `onOpen` the rows are inert (a drill nothing can draw yet). */
|
|
493
|
+
function RowList({ field, rows, readOnly, layout, mode, openId, onOpen, onCloseInline, ops, renderInline, emptyLabel, addButton, leading, rowToggle, dialogNav, menuExtra }) {
|
|
494
|
+
const sort = useDragReorder(rows.map((r) => r.id), ops.reorder, {
|
|
495
|
+
axis: layout === "grid" ? "grid" : "y",
|
|
496
|
+
disabled: readOnly,
|
|
497
|
+
distance: 5
|
|
498
|
+
});
|
|
499
|
+
const openRow = rows.find((r) => r.id === openId);
|
|
500
|
+
if (rows.length === 0) return /* @__PURE__ */ jsxs("div", {
|
|
501
|
+
className: "flex flex-col items-center gap-2 rounded-kit-lg border border-dashed border-kit-line-strong px-4 py-5 text-center",
|
|
502
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
503
|
+
className: "text-kit-sm text-kit-fg-3",
|
|
504
|
+
children: emptyLabel
|
|
505
|
+
}), readOnly ? null : addButton]
|
|
506
|
+
});
|
|
507
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
508
|
+
className: "flex flex-col gap-1.5",
|
|
509
|
+
children: [
|
|
510
|
+
/* @__PURE__ */ jsx("div", {
|
|
511
|
+
className: cn(layout === "grid" ? "grid grid-cols-2 gap-1.5 @[520px]:grid-cols-3" : "overflow-hidden rounded-kit-lg border border-kit-line bg-kit-surface"),
|
|
512
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
513
|
+
initial: false,
|
|
514
|
+
children: rows.map((r) => /* @__PURE__ */ jsx(Row, {
|
|
515
|
+
r,
|
|
516
|
+
count: rows.length,
|
|
517
|
+
field,
|
|
518
|
+
readOnly,
|
|
519
|
+
grid: layout === "grid",
|
|
520
|
+
mode,
|
|
521
|
+
open: openId === r.id,
|
|
522
|
+
onOpen: onOpen ? () => onOpen(r) : void 0,
|
|
523
|
+
ops,
|
|
524
|
+
sort,
|
|
525
|
+
leading: leading?.(r),
|
|
526
|
+
toggle: rowToggle?.(r),
|
|
527
|
+
extra: menuExtra?.(r),
|
|
528
|
+
inline: mode === "inline" && openId === r.id ? renderInline(r) : null,
|
|
529
|
+
popover: mode === "popover" && openId === r.id ? renderInline(r) : null,
|
|
530
|
+
onClosePopover: onCloseInline
|
|
531
|
+
}, r.id))
|
|
532
|
+
})
|
|
533
|
+
}),
|
|
534
|
+
sort.a11y,
|
|
535
|
+
readOnly ? null : /* @__PURE__ */ jsx("div", {
|
|
536
|
+
className: "flex items-center",
|
|
537
|
+
children: addButton
|
|
538
|
+
}),
|
|
539
|
+
mode === "dialog" && openRow ? /* @__PURE__ */ jsx(Modal, {
|
|
540
|
+
open: true,
|
|
541
|
+
onOpenChange: (o, d) => {
|
|
542
|
+
if (o) return;
|
|
543
|
+
if (d.reason === "escape-key" && dialogNav?.current?.back()) return d.cancel();
|
|
544
|
+
onCloseInline();
|
|
545
|
+
},
|
|
546
|
+
children: /* @__PURE__ */ jsxs(ModalContent, {
|
|
547
|
+
size: "lg",
|
|
548
|
+
children: [
|
|
549
|
+
/* @__PURE__ */ jsx(ModalHeader, {
|
|
550
|
+
title: openRow.preview.title,
|
|
551
|
+
description: `${field.title} · ${openRow.index + 1} of ${rows.length}`,
|
|
552
|
+
icon: /* @__PURE__ */ jsx(KitIcon, { name: openRow.preview.icon ?? field.icon })
|
|
553
|
+
}),
|
|
554
|
+
/* @__PURE__ */ jsx(ModalBody, {
|
|
555
|
+
className: "flex min-h-[320px] flex-col gap-5",
|
|
556
|
+
children: renderInline(openRow)
|
|
557
|
+
}),
|
|
558
|
+
/* @__PURE__ */ jsxs(ModalFooter, { children: [/* @__PURE__ */ jsx("span", {
|
|
559
|
+
className: "mr-auto text-kit-xs text-kit-fg-3",
|
|
560
|
+
children: "Changes save as you type"
|
|
561
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
562
|
+
variant: "primary",
|
|
563
|
+
onClick: onCloseInline,
|
|
564
|
+
children: "Done"
|
|
565
|
+
})] })
|
|
566
|
+
]
|
|
567
|
+
})
|
|
568
|
+
}) : null
|
|
569
|
+
]
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
function Row({ r, count, field, readOnly, grid, mode, open, onOpen, ops, sort, leading, toggle, extra, inline, popover, onClosePopover }) {
|
|
573
|
+
const form = useForm();
|
|
574
|
+
const env = useKitEnv();
|
|
575
|
+
const uid = React.useId();
|
|
576
|
+
const isDragging = sort.active === r.id;
|
|
577
|
+
const dragging = sort.active != null;
|
|
578
|
+
const roll = form?.rollup(r.path) ?? {
|
|
579
|
+
errors: 0,
|
|
580
|
+
warnings: 0
|
|
581
|
+
};
|
|
582
|
+
const peers = Object.entries(env.presence).filter(([k]) => k === pathKey(r.path) || k.startsWith(`${pathKey(r.path)}.`)).flatMap(([, p]) => p);
|
|
583
|
+
const menu = readOnly ? null : /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
|
|
584
|
+
"aria-label": `${r.preview.title} actions`,
|
|
585
|
+
onClick: (e) => e.stopPropagation(),
|
|
586
|
+
className: "flex size-7 shrink-0 items-center justify-center rounded-kit-md text-kit-fg-3 hover:bg-kit-hover hover:text-kit-fg data-[popup-open]:bg-kit-hover data-[popup-open]:text-kit-fg",
|
|
587
|
+
children: /* @__PURE__ */ jsx(IconDots, {
|
|
588
|
+
className: "size-4",
|
|
589
|
+
stroke: 1.5
|
|
590
|
+
})
|
|
591
|
+
}), /* @__PURE__ */ jsxs(MenuContent, {
|
|
592
|
+
align: "end",
|
|
593
|
+
className: "w-52",
|
|
594
|
+
children: [
|
|
595
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
596
|
+
icon: /* @__PURE__ */ jsx(IconArrowUp, { stroke: 1.5 }),
|
|
597
|
+
disabled: r.index === 0,
|
|
598
|
+
onClick: () => ops.move(r.index, -1),
|
|
599
|
+
children: "Move up"
|
|
600
|
+
}),
|
|
601
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
602
|
+
icon: /* @__PURE__ */ jsx(IconArrowDown, { stroke: 1.5 }),
|
|
603
|
+
disabled: r.index === count - 1,
|
|
604
|
+
onClick: () => ops.move(r.index, 1),
|
|
605
|
+
children: "Move down"
|
|
606
|
+
}),
|
|
607
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
608
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
609
|
+
icon: /* @__PURE__ */ jsx(IconCopy, { stroke: 1.5 }),
|
|
610
|
+
disabled: ops.atMax,
|
|
611
|
+
onClick: () => ops.duplicate(r.index),
|
|
612
|
+
children: ops.atMax ? "Duplicate · limit reached" : "Duplicate"
|
|
613
|
+
}),
|
|
614
|
+
field.type === "array" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuItem, {
|
|
615
|
+
icon: /* @__PURE__ */ jsx(IconRowInsertTop, { stroke: 1.5 }),
|
|
616
|
+
disabled: ops.atMax,
|
|
617
|
+
onClick: () => ops.insertBlank(r.index),
|
|
618
|
+
children: "Add item above"
|
|
619
|
+
}), /* @__PURE__ */ jsx(MenuItem, {
|
|
620
|
+
icon: /* @__PURE__ */ jsx(IconRowInsertBottom, { stroke: 1.5 }),
|
|
621
|
+
disabled: ops.atMax,
|
|
622
|
+
onClick: () => ops.insertBlank(r.index + 1),
|
|
623
|
+
children: "Add item below"
|
|
624
|
+
})] }) : null,
|
|
625
|
+
extra ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuSeparator, {}), extra] }) : null,
|
|
626
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
627
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
628
|
+
danger: true,
|
|
629
|
+
icon: /* @__PURE__ */ jsx(IconTrash, { stroke: 1.5 }),
|
|
630
|
+
disabled: ops.atMin,
|
|
631
|
+
onClick: () => ops.remove(r.index, r.preview.title),
|
|
632
|
+
children: ops.atMin ? `Remove · at least ${field.validation?.min} required` : "Remove"
|
|
633
|
+
})
|
|
634
|
+
]
|
|
635
|
+
})] });
|
|
636
|
+
const grip = readOnly ? null : /* @__PURE__ */ jsx("button", {
|
|
637
|
+
type: "button",
|
|
638
|
+
"aria-label": `Reorder ${r.preview.title}`,
|
|
639
|
+
onClick: (e) => e.stopPropagation(),
|
|
640
|
+
...sort.handle(r.id),
|
|
641
|
+
className: "relative flex h-7 w-4 shrink-0 cursor-grab touch-none items-center justify-center text-kit-fg-4 transition-colors before:absolute before:-inset-2 hover:text-kit-fg-2 active:cursor-grabbing",
|
|
642
|
+
children: /* @__PURE__ */ jsx(IconGripVertical, {
|
|
643
|
+
className: "size-3.5",
|
|
644
|
+
stroke: 1.5
|
|
645
|
+
})
|
|
646
|
+
});
|
|
647
|
+
if (grid) {
|
|
648
|
+
const tile = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
649
|
+
className: "flex aspect-[4/3] items-center justify-center bg-kit-muted",
|
|
650
|
+
children: r.preview.media ? /* @__PURE__ */ jsx("img", {
|
|
651
|
+
src: r.preview.media,
|
|
652
|
+
alt: "",
|
|
653
|
+
className: "size-full object-cover"
|
|
654
|
+
}) : /* @__PURE__ */ jsx(KitIcon, {
|
|
655
|
+
name: r.preview.icon ?? field.icon,
|
|
656
|
+
className: "size-5 text-kit-fg-3"
|
|
657
|
+
})
|
|
658
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
659
|
+
className: "block truncate px-2 pb-1.5 pt-1.5 text-kit-xs font-medium text-kit-fg",
|
|
660
|
+
children: r.preview.title
|
|
661
|
+
})] });
|
|
662
|
+
return /* @__PURE__ */ jsx("div", {
|
|
663
|
+
ref: sort.register(r.id),
|
|
664
|
+
style: sort.style(r.id),
|
|
665
|
+
className: cn("relative", isDragging && "z-10"),
|
|
666
|
+
children: /* @__PURE__ */ jsxs(motion.div, {
|
|
667
|
+
layout: !isDragging ? "position" : false,
|
|
668
|
+
initial: {
|
|
669
|
+
opacity: 0,
|
|
670
|
+
scale: .97
|
|
671
|
+
},
|
|
672
|
+
animate: {
|
|
673
|
+
opacity: 1,
|
|
674
|
+
scale: 1
|
|
675
|
+
},
|
|
676
|
+
exit: {
|
|
677
|
+
opacity: 0,
|
|
678
|
+
scale: .97
|
|
679
|
+
},
|
|
680
|
+
className: cn("group/row relative overflow-hidden rounded-kit-lg border border-kit-line bg-kit-surface transition-colors hover:border-kit-line-strong", isDragging && "shadow-kit-lg"),
|
|
681
|
+
children: [
|
|
682
|
+
onOpen ? /* @__PURE__ */ jsx("button", {
|
|
683
|
+
type: "button",
|
|
684
|
+
onClick: onOpen,
|
|
685
|
+
"aria-label": `Open ${r.preview.title}, ${r.index + 1} of ${count}`,
|
|
686
|
+
"aria-haspopup": mode === "popover" || mode === "dialog" ? "dialog" : void 0,
|
|
687
|
+
className: "block w-full text-left",
|
|
688
|
+
children: tile
|
|
689
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
690
|
+
className: "block w-full text-left",
|
|
691
|
+
children: tile
|
|
692
|
+
}),
|
|
693
|
+
/* @__PURE__ */ jsxs("div", {
|
|
694
|
+
className: "absolute right-1 top-1 flex items-center gap-0.5 rounded-kit-md bg-kit-surface/90 opacity-0 shadow-kit-xs transition-opacity group-hover/row:opacity-100 [@media(pointer:coarse)]:opacity-100",
|
|
695
|
+
children: [grip, menu]
|
|
696
|
+
}),
|
|
697
|
+
/* @__PURE__ */ jsx(IssueDot, {
|
|
698
|
+
errors: roll.errors,
|
|
699
|
+
warnings: roll.warnings,
|
|
700
|
+
className: "absolute left-2 top-2 ring-2 ring-kit-surface"
|
|
701
|
+
})
|
|
702
|
+
]
|
|
703
|
+
})
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
const inlineMode = mode === "inline";
|
|
707
|
+
const bodyId = `${uid}${r.id}-body`;
|
|
708
|
+
const verb = inlineMode ? open ? "Collapse" : "Expand" : "Open";
|
|
709
|
+
const trailing = !onOpen ? null : inlineMode ? /* @__PURE__ */ jsx(IconChevronDown, {
|
|
710
|
+
"aria-hidden": true,
|
|
711
|
+
className: cn("size-4 shrink-0 text-kit-fg-3 transition-transform duration-200", open && "rotate-180 text-kit-fg-2"),
|
|
712
|
+
stroke: 1.5
|
|
713
|
+
}) : mode === "drill" ? /* @__PURE__ */ jsx(IconChevronRight, {
|
|
714
|
+
"aria-hidden": true,
|
|
715
|
+
className: "size-4 shrink-0 text-kit-fg-3 transition-transform duration-150 group-hover/row:translate-x-0.5",
|
|
716
|
+
stroke: 1.5
|
|
717
|
+
}) : /* @__PURE__ */ jsx(IconArrowsDiagonal, {
|
|
718
|
+
"aria-hidden": true,
|
|
719
|
+
className: "size-3.5 shrink-0 text-kit-fg-3",
|
|
720
|
+
stroke: 1.5
|
|
721
|
+
});
|
|
722
|
+
const titleInner = /* @__PURE__ */ jsxs(Fragment, { children: [leading ?? (toggle && !r.preview.media ? null : /* @__PURE__ */ jsx(Thumb, {
|
|
723
|
+
media: r.preview.media,
|
|
724
|
+
icon: r.preview.icon ?? field.icon
|
|
725
|
+
})), /* @__PURE__ */ jsxs("span", {
|
|
726
|
+
className: "min-w-0 flex-1",
|
|
727
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
728
|
+
className: cn("flex items-center gap-1.5 truncate text-kit-sm", r.preview.empty || r.dim ? "text-kit-fg-3" : "text-kit-fg", open && "font-medium"),
|
|
729
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
730
|
+
className: "truncate",
|
|
731
|
+
children: r.preview.title
|
|
732
|
+
}), r.chip ? /* @__PURE__ */ jsx("span", {
|
|
733
|
+
className: "shrink-0 rounded-kit-md bg-kit-muted px-1 text-kit-2xs font-medium text-kit-fg-2",
|
|
734
|
+
children: r.chip
|
|
735
|
+
}) : null]
|
|
736
|
+
}), r.extra ?? r.preview.subtitle ? /* @__PURE__ */ jsx("span", {
|
|
737
|
+
className: "block truncate text-kit-xs text-kit-fg-3",
|
|
738
|
+
children: r.extra ?? r.preview.subtitle
|
|
739
|
+
}) : null]
|
|
740
|
+
})] });
|
|
741
|
+
const rowInner = /* @__PURE__ */ jsxs("div", {
|
|
742
|
+
onClick: (e) => {
|
|
743
|
+
const target = e.target;
|
|
744
|
+
if (!onOpen || !e.currentTarget.contains(target) || target.closest("button,[role^=menuitem],a,input")) return;
|
|
745
|
+
onOpen();
|
|
746
|
+
},
|
|
747
|
+
className: cn("group/row flex min-h-12 items-center gap-2 py-1.5 pl-1.5 pr-2 transition-colors", onOpen && "cursor-pointer", open ? "bg-kit-subtle" : onOpen && "hover:bg-kit-subtle"),
|
|
748
|
+
children: [
|
|
749
|
+
grip,
|
|
750
|
+
toggle,
|
|
751
|
+
onOpen ? /* @__PURE__ */ jsx("button", {
|
|
752
|
+
type: "button",
|
|
753
|
+
onClick: onOpen,
|
|
754
|
+
"data-row-open": r.id,
|
|
755
|
+
"aria-expanded": mode === "drill" ? void 0 : open,
|
|
756
|
+
"aria-controls": inlineMode && open ? bodyId : void 0,
|
|
757
|
+
"aria-haspopup": mode === "popover" || mode === "dialog" ? "dialog" : void 0,
|
|
758
|
+
"aria-label": `${verb} ${r.preview.title}${r.chip ? `, ${r.chip}` : ""}, ${r.index + 1} of ${count}`,
|
|
759
|
+
className: "flex min-w-0 flex-1 items-center gap-2.5 rounded-kit-md text-left outline-none",
|
|
760
|
+
children: titleInner
|
|
761
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
762
|
+
"data-row-open": r.id,
|
|
763
|
+
className: "flex min-w-0 flex-1 items-center gap-2.5 text-left",
|
|
764
|
+
children: titleInner
|
|
765
|
+
}),
|
|
766
|
+
/* @__PURE__ */ jsx(IssueDot, {
|
|
767
|
+
errors: roll.errors,
|
|
768
|
+
warnings: roll.warnings
|
|
769
|
+
}),
|
|
770
|
+
peers.length ? /* @__PURE__ */ jsx(PeerStack, {
|
|
771
|
+
peers,
|
|
772
|
+
size: 16
|
|
773
|
+
}) : null,
|
|
774
|
+
menu,
|
|
775
|
+
trailing
|
|
776
|
+
]
|
|
777
|
+
});
|
|
778
|
+
return /* @__PURE__ */ jsx("div", {
|
|
779
|
+
ref: sort.register(r.id),
|
|
780
|
+
style: sort.style(r.id),
|
|
781
|
+
"data-row-id": r.id,
|
|
782
|
+
className: cn("relative border-b border-kit-line-subtle bg-kit-surface last:border-b-0", isDragging && "z-10 rounded-kit-lg shadow-kit-lg ring-1 ring-kit-line-strong"),
|
|
783
|
+
children: /* @__PURE__ */ jsxs(motion.div, {
|
|
784
|
+
layout: !isDragging && !dragging ? "position" : false,
|
|
785
|
+
initial: dragging ? false : {
|
|
786
|
+
opacity: 0,
|
|
787
|
+
height: 0
|
|
788
|
+
},
|
|
789
|
+
animate: {
|
|
790
|
+
opacity: 1,
|
|
791
|
+
height: "auto"
|
|
792
|
+
},
|
|
793
|
+
exit: dragging ? {
|
|
794
|
+
opacity: 0,
|
|
795
|
+
height: 0,
|
|
796
|
+
transition: { duration: 0 }
|
|
797
|
+
} : {
|
|
798
|
+
opacity: 0,
|
|
799
|
+
height: 0
|
|
800
|
+
},
|
|
801
|
+
transition: {
|
|
802
|
+
duration: .2,
|
|
803
|
+
ease: [
|
|
804
|
+
.22,
|
|
805
|
+
1,
|
|
806
|
+
.36,
|
|
807
|
+
1
|
|
808
|
+
]
|
|
809
|
+
},
|
|
810
|
+
className: "overflow-hidden",
|
|
811
|
+
children: [mode === "popover" ? /* @__PURE__ */ jsxs(Popover, {
|
|
812
|
+
open,
|
|
813
|
+
onOpenChange: (o) => !o && onClosePopover(),
|
|
814
|
+
children: [/* @__PURE__ */ jsx(PopoverAnchor, { render: rowInner }), /* @__PURE__ */ jsx(PopoverContent, {
|
|
815
|
+
className: "w-[340px] p-4",
|
|
816
|
+
align: "end",
|
|
817
|
+
side: "left",
|
|
818
|
+
sideOffset: 10,
|
|
819
|
+
children: popover
|
|
820
|
+
})]
|
|
821
|
+
}) : rowInner, inlineMode ? /* @__PURE__ */ jsx(AnimatePresence, {
|
|
822
|
+
initial: false,
|
|
823
|
+
children: open ? /* @__PURE__ */ jsx(motion.div, {
|
|
824
|
+
initial: {
|
|
825
|
+
height: 0,
|
|
826
|
+
opacity: 0
|
|
827
|
+
},
|
|
828
|
+
animate: {
|
|
829
|
+
height: "auto",
|
|
830
|
+
opacity: 1
|
|
831
|
+
},
|
|
832
|
+
exit: {
|
|
833
|
+
height: 0,
|
|
834
|
+
opacity: 0
|
|
835
|
+
},
|
|
836
|
+
transition: {
|
|
837
|
+
duration: .2,
|
|
838
|
+
ease: [
|
|
839
|
+
.22,
|
|
840
|
+
1,
|
|
841
|
+
.36,
|
|
842
|
+
1
|
|
843
|
+
]
|
|
844
|
+
},
|
|
845
|
+
className: "overflow-hidden",
|
|
846
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
847
|
+
className: "px-3 pb-3 pt-1",
|
|
848
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
849
|
+
id: bodyId,
|
|
850
|
+
role: "group",
|
|
851
|
+
"aria-label": r.preview.title,
|
|
852
|
+
"data-group": "inset",
|
|
853
|
+
className: INSET_LINE,
|
|
854
|
+
children: /* @__PURE__ */ jsx(InsetScope, { children: inline })
|
|
855
|
+
})
|
|
856
|
+
})
|
|
857
|
+
}) : null
|
|
858
|
+
}) : null]
|
|
859
|
+
})
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
/** The included / not-included check on a feature row (D47): a real checkbox, outside the row's open button. */
|
|
863
|
+
function RowCheck({ on, label, title, readOnly, onToggle }) {
|
|
864
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
865
|
+
content: on ? label : `Not ${label.toLowerCase()}`,
|
|
866
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
867
|
+
type: "button",
|
|
868
|
+
role: "checkbox",
|
|
869
|
+
"aria-checked": on,
|
|
870
|
+
"aria-label": `${label}: ${title}`,
|
|
871
|
+
disabled: readOnly,
|
|
872
|
+
onClick: (e) => {
|
|
873
|
+
e.stopPropagation();
|
|
874
|
+
onToggle();
|
|
875
|
+
},
|
|
876
|
+
className: "group/chk flex size-7 shrink-0 items-center justify-center rounded-kit-md transition-colors hover:bg-kit-hover disabled:pointer-events-none",
|
|
877
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
878
|
+
className: cn("flex size-[18px] items-center justify-center rounded-full transition-colors", on ? "bg-kit-inverse text-kit-fg-inverse" : "border border-dashed border-kit-field-border-hover text-kit-fg-3 group-hover/chk:border-[var(--kit-emphasis-line)]"),
|
|
879
|
+
children: on ? /* @__PURE__ */ jsx(IconCheck, {
|
|
880
|
+
className: "size-3",
|
|
881
|
+
stroke: 2.5
|
|
882
|
+
}) : /* @__PURE__ */ jsx(IconMinus, {
|
|
883
|
+
className: "size-3",
|
|
884
|
+
stroke: 2
|
|
885
|
+
})
|
|
886
|
+
})
|
|
887
|
+
})
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
//#endregion
|
|
891
|
+
export { ARRAY_CONTROLS, ArrayField, RowList, RowsHostContext, rowToggleField, useDrill, useListOps };
|
|
892
|
+
|
|
893
|
+
//# sourceMappingURL=array.js.map
|