@bettercms-ai/kit 0.1.1 → 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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PATH CRUMBS (CPO D38): the one breadcrumb for every drill-in path: Visuals inspector, Block Kit drill-in,
|
|
3
|
+
* nested documents, media details, the workspace top bar.
|
|
4
|
+
*
|
|
5
|
+
* <PathCrumbs items={[{ id, label, icon, onSelect }, …, current]} />
|
|
6
|
+
*
|
|
7
|
+
* Look (D38 v3): ancestors fg-3 with an invisible 4px-radius pill that appears on hover (bg-hover) and darkens while
|
|
8
|
+
* pressed (bg-selected); the current item is fg/semibold with its icon, NO box; thin fg-4 chevrons flush between pills (6px from text);
|
|
9
|
+
* the fold chip is a ghost crumb ("Columns… +2 ⌄") whose open state is bg-selected; keyboard-only neutral focus ring.
|
|
10
|
+
*
|
|
11
|
+
* Back (←) and current never collapse, and every visible crumb keeps READABLE TEXT (no icon-only crumbs). The trail
|
|
12
|
+
* adapts to the width it ACTUALLY has (ResizeObserver on the nav + document.fonts.ready, not viewport breakpoints),
|
|
13
|
+
* using space greedily; the first plan that fits wins:
|
|
14
|
+
*
|
|
15
|
+
* stage 0 everything at full length
|
|
16
|
+
* stage 1 long labels shorten to their first words (~16ch, word boundary: "Seasoning & care…", "Columns…"):
|
|
17
|
+
* middle items root side first, then the parent, then the root
|
|
18
|
+
* stage 2 the middle folds, root side first, into ONE readable chip "[▦] Columns… +2" (its first folded level +
|
|
19
|
+
* the count) that opens the Pathway popover; the immediate parent stays out of the fold
|
|
20
|
+
* stage 3 the root joins the fold, then (last) the parent
|
|
21
|
+
* last the current item middle-truncates ("Seasoning…ail kit"), full name in a tooltip
|
|
22
|
+
*
|
|
23
|
+
* Every variant is measured once in a hidden mirror and the stage is picked in a layout effect, so the first paint
|
|
24
|
+
* is already right (no flicker, no layout jump). The Pathway popover lists the whole path as an indented tree
|
|
25
|
+
* (↑↓ · Enter · Esc, focus returns to the chip). Siblings menus on crumbs were considered and left out (D6 calm).
|
|
26
|
+
*
|
|
27
|
+
* Links: a crumb with `to` renders through `linkAs` (default: a plain <a href>), so a host can pass its router's Link.
|
|
28
|
+
*/
|
|
29
|
+
import * as React from "react";
|
|
30
|
+
export interface PathCrumb {
|
|
31
|
+
/** stable key */
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
/** type icon (16px glyph; sized by the crumb) */
|
|
35
|
+
icon?: React.ReactNode;
|
|
36
|
+
/** navigate here (ignored on the current item) */
|
|
37
|
+
onSelect?: () => void;
|
|
38
|
+
/** …or a link (rendered through PathCrumbs `linkAs`) */
|
|
39
|
+
to?: string;
|
|
40
|
+
/** a meaningful container (a block, a folder): may name the collapsed group ("Columns +2") */
|
|
41
|
+
container?: boolean;
|
|
42
|
+
/** red dot: something under this level has errors */
|
|
43
|
+
errors?: number;
|
|
44
|
+
}
|
|
45
|
+
export type PathCrumbLinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
46
|
+
to: string;
|
|
47
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
48
|
+
};
|
|
49
|
+
export interface PathCrumbsProps {
|
|
50
|
+
/** root → current; the last item is the current one */
|
|
51
|
+
items: PathCrumb[];
|
|
52
|
+
/** ← goes up one level. Default: the parent's onSelect/to. `false` hides it (top-bar style). */
|
|
53
|
+
onBack?: (() => void) | false;
|
|
54
|
+
/** tooltip/aria for ←, default "Back to {parent}" */
|
|
55
|
+
backLabel?: string;
|
|
56
|
+
/** a key hint in the ← tooltip, shown only while keyboard hints are on (D44) */
|
|
57
|
+
backShortcut?: string;
|
|
58
|
+
/** @deprecated (D38 v3): the current item is always text: weight + colour, never a box. Kept for call-site compat. */
|
|
59
|
+
current?: "chip" | "text";
|
|
60
|
+
/** nav aria-label */
|
|
61
|
+
label?: string;
|
|
62
|
+
size?: "sm" | "md";
|
|
63
|
+
/** renders crumbs that have `to` (a router Link); must forward its ref and spread props. Default: <a href> */
|
|
64
|
+
linkAs?: React.ComponentType<PathCrumbLinkProps>;
|
|
65
|
+
className?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare function clipWords(s: string, max?: number): string;
|
|
68
|
+
type Form = "full" | "trunc";
|
|
69
|
+
type Group = {
|
|
70
|
+
start: number;
|
|
71
|
+
end: number;
|
|
72
|
+
};
|
|
73
|
+
type Plan = {
|
|
74
|
+
forms: Form[];
|
|
75
|
+
group: Group | null;
|
|
76
|
+
};
|
|
77
|
+
/** Degradation order: the first plan that fits wins. Every visible crumb keeps readable text (no icon-only crumbs). */
|
|
78
|
+
export declare function plansFor(items: PathCrumb[]): Plan[];
|
|
79
|
+
/** Keep the head and the tail: "Seasoning wax & chainmail kit" → "Seasoning…mail kit". */
|
|
80
|
+
export declare function middleEllipsis(text: string, maxPx: number, measure: (s: string) => number): string | null;
|
|
81
|
+
export declare function PathCrumbs({ items, onBack, backLabel, backShortcut, label, size, linkAs: Link, className }: PathCrumbsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
82
|
+
export type PathCrumbState = "rest" | "hover" | "pressed" | "focus" | "open" | "current" | "disabled";
|
|
83
|
+
export declare function PathCrumbSpecimen({ state, label, icon, group, size }: {
|
|
84
|
+
state: PathCrumbState;
|
|
85
|
+
label: string;
|
|
86
|
+
icon?: React.ReactNode;
|
|
87
|
+
group?: number;
|
|
88
|
+
size?: "sm" | "md";
|
|
89
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { IconButton } from "./button.js";
|
|
3
|
+
import { Menu as Menu$1, MenuContent, MenuTrigger, Tooltip } from "./overlay.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { IconArrowLeft, IconChevronDown, IconChevronRight } from "@tabler/icons-react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Menu } from "@base-ui/react/menu";
|
|
8
|
+
//#region src/kit/ui/path-crumbs.tsx
|
|
9
|
+
/**
|
|
10
|
+
* PATH CRUMBS (CPO D38): the one breadcrumb for every drill-in path: Visuals inspector, Block Kit drill-in,
|
|
11
|
+
* nested documents, media details, the workspace top bar.
|
|
12
|
+
*
|
|
13
|
+
* <PathCrumbs items={[{ id, label, icon, onSelect }, …, current]} />
|
|
14
|
+
*
|
|
15
|
+
* Look (D38 v3): ancestors fg-3 with an invisible 4px-radius pill that appears on hover (bg-hover) and darkens while
|
|
16
|
+
* pressed (bg-selected); the current item is fg/semibold with its icon, NO box; thin fg-4 chevrons flush between pills (6px from text);
|
|
17
|
+
* the fold chip is a ghost crumb ("Columns… +2 ⌄") whose open state is bg-selected; keyboard-only neutral focus ring.
|
|
18
|
+
*
|
|
19
|
+
* Back (←) and current never collapse, and every visible crumb keeps READABLE TEXT (no icon-only crumbs). The trail
|
|
20
|
+
* adapts to the width it ACTUALLY has (ResizeObserver on the nav + document.fonts.ready, not viewport breakpoints),
|
|
21
|
+
* using space greedily; the first plan that fits wins:
|
|
22
|
+
*
|
|
23
|
+
* stage 0 everything at full length
|
|
24
|
+
* stage 1 long labels shorten to their first words (~16ch, word boundary: "Seasoning & care…", "Columns…"):
|
|
25
|
+
* middle items root side first, then the parent, then the root
|
|
26
|
+
* stage 2 the middle folds, root side first, into ONE readable chip "[▦] Columns… +2" (its first folded level +
|
|
27
|
+
* the count) that opens the Pathway popover; the immediate parent stays out of the fold
|
|
28
|
+
* stage 3 the root joins the fold, then (last) the parent
|
|
29
|
+
* last the current item middle-truncates ("Seasoning…ail kit"), full name in a tooltip
|
|
30
|
+
*
|
|
31
|
+
* Every variant is measured once in a hidden mirror and the stage is picked in a layout effect, so the first paint
|
|
32
|
+
* is already right (no flicker, no layout jump). The Pathway popover lists the whole path as an indented tree
|
|
33
|
+
* (↑↓ · Enter · Esc, focus returns to the chip). Siblings menus on crumbs were considered and left out (D6 calm).
|
|
34
|
+
*
|
|
35
|
+
* Links: a crumb with `to` renders through `linkAs` (default: a plain <a href>), so a host can pass its router's Link.
|
|
36
|
+
*/
|
|
37
|
+
var METRICS = {
|
|
38
|
+
sm: {
|
|
39
|
+
row: "h-7",
|
|
40
|
+
text: "text-[13px] leading-5",
|
|
41
|
+
pill: "h-6 px-1.5",
|
|
42
|
+
cur: "pr-0.5",
|
|
43
|
+
gap: "gap-1.5",
|
|
44
|
+
icon: "[&_svg]:size-3.5",
|
|
45
|
+
sep: "size-3",
|
|
46
|
+
back: "sm"
|
|
47
|
+
},
|
|
48
|
+
md: {
|
|
49
|
+
row: "h-8",
|
|
50
|
+
text: "text-[14px] leading-5",
|
|
51
|
+
pill: "h-7 px-2",
|
|
52
|
+
cur: "pr-0.5",
|
|
53
|
+
gap: "gap-1.5",
|
|
54
|
+
icon: "[&_svg]:size-4",
|
|
55
|
+
sep: "size-3.5",
|
|
56
|
+
back: "md"
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
/** Ancestor / group pill: fg-3 at rest, a quiet pill on hover, darker while pressed, fg-4 + inert when it can't navigate. */
|
|
60
|
+
var PILL = "inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-kit-sm text-kit-fg-3 transition-colors duration-100 hover:bg-kit-hover hover:text-kit-fg active:bg-kit-selected disabled:pointer-events-none disabled:text-kit-fg-4";
|
|
61
|
+
function DefaultLink({ to, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsx("a", {
|
|
63
|
+
href: to,
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Word-boundary shortening: the first 2–3 words that fit ~16ch ("Seasoning & care kit" → "Seasoning & care…",
|
|
68
|
+
* "Columns / Bento" → "Columns…"). Never mid-word unless a single word is itself too long. */
|
|
69
|
+
var isJoiner = (w) => /^[/&·\-–—|:,+]+$/.test(w);
|
|
70
|
+
function clipWords(s, max = 16) {
|
|
71
|
+
const words = s.trim().split(/\s+/);
|
|
72
|
+
if (s.length <= 12 && words.length <= 2) return s;
|
|
73
|
+
const out = [];
|
|
74
|
+
for (let i = 0; i < words.length - 1; i++) {
|
|
75
|
+
if ([...out, words[i]].join(" ").length > max) break;
|
|
76
|
+
out.push(words[i]);
|
|
77
|
+
}
|
|
78
|
+
while (out.length && isJoiner(out[out.length - 1])) out.pop();
|
|
79
|
+
if (!out.length) return words[0].length > max ? `${words[0].slice(0, max - 2)}…` : `${words[0]}…`;
|
|
80
|
+
return `${out.join(" ")}…`;
|
|
81
|
+
}
|
|
82
|
+
var long = (s) => clipWords(s) !== s;
|
|
83
|
+
var clip = (s) => clipWords(s);
|
|
84
|
+
/** Degradation order: the first plan that fits wins. Every visible crumb keeps readable text (no icon-only crumbs). */
|
|
85
|
+
function plansFor(items) {
|
|
86
|
+
const n = items.length;
|
|
87
|
+
const plans = [];
|
|
88
|
+
const forms = items.map(() => "full");
|
|
89
|
+
const push = (group = null) => plans.push({
|
|
90
|
+
forms: [...forms],
|
|
91
|
+
group: group ? { ...group } : null
|
|
92
|
+
});
|
|
93
|
+
push();
|
|
94
|
+
if (n < 2) return plans;
|
|
95
|
+
const parent = n - 2;
|
|
96
|
+
const middle = Array.from({ length: Math.max(0, n - 2) }, (_, k) => k + 1);
|
|
97
|
+
for (const i of middle) if (i !== parent && long(items[i].label)) {
|
|
98
|
+
forms[i] = "trunc";
|
|
99
|
+
push();
|
|
100
|
+
}
|
|
101
|
+
if (parent >= 1 && long(items[parent].label)) {
|
|
102
|
+
forms[parent] = "trunc";
|
|
103
|
+
push();
|
|
104
|
+
}
|
|
105
|
+
if (long(items[0].label)) {
|
|
106
|
+
forms[0] = "trunc";
|
|
107
|
+
push();
|
|
108
|
+
}
|
|
109
|
+
for (let end = 1; end <= parent - 1; end++) push({
|
|
110
|
+
start: 1,
|
|
111
|
+
end
|
|
112
|
+
});
|
|
113
|
+
if (parent >= 1) push({
|
|
114
|
+
start: 0,
|
|
115
|
+
end: parent - 1
|
|
116
|
+
});
|
|
117
|
+
push({
|
|
118
|
+
start: 0,
|
|
119
|
+
end: parent
|
|
120
|
+
});
|
|
121
|
+
return plans;
|
|
122
|
+
}
|
|
123
|
+
/** Keep the head and the tail: "Seasoning wax & chainmail kit" → "Seasoning…mail kit". */
|
|
124
|
+
function middleEllipsis(text, maxPx, measure) {
|
|
125
|
+
if (measure(text) <= maxPx) return text;
|
|
126
|
+
let lo = 2;
|
|
127
|
+
let hi = text.length - 1;
|
|
128
|
+
let best = "";
|
|
129
|
+
while (lo <= hi) {
|
|
130
|
+
const keep = lo + hi >> 1;
|
|
131
|
+
const head = Math.ceil(keep * .6);
|
|
132
|
+
const s = `${text.slice(0, head).trimEnd()}…${text.slice(text.length - (keep - head)).trimStart()}`;
|
|
133
|
+
if (measure(s) <= maxPx) {
|
|
134
|
+
best = s;
|
|
135
|
+
lo = keep + 1;
|
|
136
|
+
} else hi = keep - 1;
|
|
137
|
+
}
|
|
138
|
+
return best || null;
|
|
139
|
+
}
|
|
140
|
+
var canvas = null;
|
|
141
|
+
function textMeasurer(el) {
|
|
142
|
+
if (!el) return null;
|
|
143
|
+
canvas ??= document.createElement("canvas");
|
|
144
|
+
let ctx = null;
|
|
145
|
+
try {
|
|
146
|
+
ctx = canvas.getContext("2d");
|
|
147
|
+
} catch {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
if (!ctx) return null;
|
|
151
|
+
const cs = getComputedStyle(el);
|
|
152
|
+
ctx.font = `${cs.fontStyle} ${cs.fontWeight} ${cs.fontSize} ${cs.fontFamily}`;
|
|
153
|
+
return (s) => ctx.measureText(s).width;
|
|
154
|
+
}
|
|
155
|
+
function PathCrumbs({ items, onBack, backLabel, backShortcut, label = "Breadcrumb", size = "sm", linkAs: Link = DefaultLink, className }) {
|
|
156
|
+
const n = items.length;
|
|
157
|
+
const parent = n > 1 ? items[n - 2] : void 0;
|
|
158
|
+
const back = onBack === false ? void 0 : onBack ?? (parent ? () => go(parent) : void 0);
|
|
159
|
+
const sig = items.map((i) => `${i.id}\u0001${i.label}\u0001${i.icon ? 1 : 0}\u0001${i.errors ? 1 : 0}\u0001${i.container ? 1 : 0}`).join("");
|
|
160
|
+
const plans = React.useMemo(() => plansFor(items), [sig]);
|
|
161
|
+
const navRef = React.useRef(null);
|
|
162
|
+
const mirrorRef = React.useRef(null);
|
|
163
|
+
const backRef = React.useRef(null);
|
|
164
|
+
const [fit, setFit] = React.useState({
|
|
165
|
+
plan: 0,
|
|
166
|
+
currentText: null
|
|
167
|
+
});
|
|
168
|
+
const measure = React.useCallback(() => {
|
|
169
|
+
const nav = navRef.current;
|
|
170
|
+
const mirror = mirrorRef.current;
|
|
171
|
+
if (!nav || !mirror) return;
|
|
172
|
+
const rect = nav.getBoundingClientRect().width;
|
|
173
|
+
const scale = nav.offsetWidth && rect ? rect / nav.offsetWidth : 1;
|
|
174
|
+
const w = (key) => (mirror.querySelector(`[data-m="${key}"]`)?.getBoundingClientRect().width ?? 0) / scale;
|
|
175
|
+
const avail = nav.clientWidth - (backRef.current ? backRef.current.getBoundingClientRect().width / scale : 0) - .5;
|
|
176
|
+
const sep = w("sep");
|
|
177
|
+
const cur = w("cur");
|
|
178
|
+
const widthOf = (p) => {
|
|
179
|
+
const parts = [];
|
|
180
|
+
if (n > 1) {
|
|
181
|
+
const gk = (g) => `g:${g.start}:${g.end}`;
|
|
182
|
+
if (p.group?.start === 0) parts.push(w(gk(p.group)));
|
|
183
|
+
else {
|
|
184
|
+
parts.push(w(`0:${p.forms[0]}`));
|
|
185
|
+
if (p.group) parts.push(w(gk(p.group)));
|
|
186
|
+
}
|
|
187
|
+
for (let i = 1; i < n - 1; i++) if (!p.group || i > p.group.end) parts.push(w(`${i}:${p.forms[i]}`));
|
|
188
|
+
}
|
|
189
|
+
parts.push(cur);
|
|
190
|
+
return parts.reduce((a, b) => a + b, 0) + sep * (parts.length - 1);
|
|
191
|
+
};
|
|
192
|
+
let pick = plans.length - 1;
|
|
193
|
+
let total = 0;
|
|
194
|
+
for (let k = 0; k < plans.length; k++) {
|
|
195
|
+
total = widthOf(plans[k]);
|
|
196
|
+
if (total <= avail) {
|
|
197
|
+
pick = k;
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
let currentText = null;
|
|
202
|
+
if (pick === plans.length - 1 && (total = widthOf(plans[pick])) > avail) {
|
|
203
|
+
const textEl = mirror.querySelector("[data-m=\"curtext\"]");
|
|
204
|
+
const textW = textEl?.getBoundingClientRect().width ?? 0;
|
|
205
|
+
const room = cur - (total - avail) - (cur - textW);
|
|
206
|
+
const m = textMeasurer(textEl);
|
|
207
|
+
if (m && room > 24) currentText = middleEllipsis(items[n - 1].label, room, m);
|
|
208
|
+
}
|
|
209
|
+
setFit((f) => f.plan === pick && f.currentText === currentText ? f : {
|
|
210
|
+
plan: pick,
|
|
211
|
+
currentText
|
|
212
|
+
});
|
|
213
|
+
}, [plans, n]);
|
|
214
|
+
React.useLayoutEffect(() => {
|
|
215
|
+
measure();
|
|
216
|
+
}, [measure, sig]);
|
|
217
|
+
React.useLayoutEffect(() => {
|
|
218
|
+
const nav = navRef.current;
|
|
219
|
+
if (!nav || typeof ResizeObserver === "undefined") return;
|
|
220
|
+
const ro = new ResizeObserver(() => measure());
|
|
221
|
+
ro.observe(nav);
|
|
222
|
+
let alive = true;
|
|
223
|
+
document.fonts?.ready.then(() => alive && measure());
|
|
224
|
+
return () => {
|
|
225
|
+
alive = false;
|
|
226
|
+
ro.disconnect();
|
|
227
|
+
};
|
|
228
|
+
}, [measure]);
|
|
229
|
+
if (!n) return null;
|
|
230
|
+
const plan = plans[Math.min(fit.plan, plans.length - 1)];
|
|
231
|
+
const m = METRICS[size];
|
|
232
|
+
const curItem = items[n - 1];
|
|
233
|
+
const icon = (c) => c.icon ? /* @__PURE__ */ jsx("span", {
|
|
234
|
+
className: cn("flex shrink-0 items-center", m.icon),
|
|
235
|
+
"aria-hidden": true,
|
|
236
|
+
children: c.icon
|
|
237
|
+
}) : null;
|
|
238
|
+
const dot = (c) => c.errors ? /* @__PURE__ */ jsx("span", {
|
|
239
|
+
role: "img",
|
|
240
|
+
"aria-label": "Has errors",
|
|
241
|
+
className: "size-1.5 shrink-0 rounded-full bg-kit-danger"
|
|
242
|
+
}) : null;
|
|
243
|
+
const crumbCls = cn(PILL, m.pill);
|
|
244
|
+
const body = (c, form) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
245
|
+
icon(c),
|
|
246
|
+
/* @__PURE__ */ jsx("span", { children: form === "trunc" ? clip(c.label) : c.label }),
|
|
247
|
+
dot(c)
|
|
248
|
+
] });
|
|
249
|
+
/** The fold chip names its first folded level (the root only when nothing else is folded): "[▦] Columns… +2". */
|
|
250
|
+
const groupBody = (g) => {
|
|
251
|
+
const count = g.end - g.start + 1;
|
|
252
|
+
const lead = items[g.start === 0 && g.end > 0 ? 1 : g.start];
|
|
253
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
254
|
+
icon(lead),
|
|
255
|
+
/* @__PURE__ */ jsx("span", { children: clipWords(lead.label, 12) }),
|
|
256
|
+
count > 1 ? /* @__PURE__ */ jsxs("span", {
|
|
257
|
+
className: "tabular-nums",
|
|
258
|
+
children: ["+", count - 1]
|
|
259
|
+
}) : null,
|
|
260
|
+
/* @__PURE__ */ jsx(IconChevronDown, {
|
|
261
|
+
className: cn("-mx-0.5 shrink-0 text-kit-fg-4", m.sep),
|
|
262
|
+
stroke: 1.75,
|
|
263
|
+
"aria-hidden": true
|
|
264
|
+
})
|
|
265
|
+
] });
|
|
266
|
+
};
|
|
267
|
+
const currentCls = cn("inline-flex min-w-0 max-w-full items-center whitespace-nowrap rounded-kit-sm font-semibold text-kit-fg", m.pill, m.cur, m.gap, "[&_[data-crumb-icon]]:text-kit-fg-2");
|
|
268
|
+
const sepEl = /* @__PURE__ */ jsx(IconChevronRight, {
|
|
269
|
+
className: cn("shrink-0 text-kit-fg-4", m.sep),
|
|
270
|
+
stroke: 1.75,
|
|
271
|
+
"aria-hidden": true
|
|
272
|
+
});
|
|
273
|
+
function go(c) {
|
|
274
|
+
c.onSelect?.();
|
|
275
|
+
}
|
|
276
|
+
const crumb = (c, i, form) => {
|
|
277
|
+
const tip = form !== "full" || void 0;
|
|
278
|
+
const inner = body(c, form);
|
|
279
|
+
const aria = form === "trunc" ? c.errors ? `${c.label}, has errors` : c.label : void 0;
|
|
280
|
+
const el = c.to ? /* @__PURE__ */ jsx(Link, {
|
|
281
|
+
to: c.to,
|
|
282
|
+
className: crumbCls,
|
|
283
|
+
"aria-label": aria,
|
|
284
|
+
onClick: c.onSelect,
|
|
285
|
+
children: inner
|
|
286
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
287
|
+
type: "button",
|
|
288
|
+
className: crumbCls,
|
|
289
|
+
"aria-label": aria,
|
|
290
|
+
onClick: () => go(c),
|
|
291
|
+
disabled: !c.onSelect,
|
|
292
|
+
children: inner
|
|
293
|
+
});
|
|
294
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
295
|
+
className: "flex shrink-0 items-center",
|
|
296
|
+
children: [i > 0 ? sepEl : null, tip ? /* @__PURE__ */ jsx(Tooltip, {
|
|
297
|
+
content: c.label,
|
|
298
|
+
side: "bottom",
|
|
299
|
+
children: el
|
|
300
|
+
}) : el]
|
|
301
|
+
}, c.id);
|
|
302
|
+
};
|
|
303
|
+
const shown = [];
|
|
304
|
+
if (n > 1) {
|
|
305
|
+
const g = plan.group;
|
|
306
|
+
const group = (first) => /* @__PURE__ */ jsx(GroupLi, {
|
|
307
|
+
items,
|
|
308
|
+
group: g,
|
|
309
|
+
first,
|
|
310
|
+
trigger: groupBody(g),
|
|
311
|
+
sep: sepEl,
|
|
312
|
+
navRef,
|
|
313
|
+
label,
|
|
314
|
+
cls: crumbCls,
|
|
315
|
+
link: Link
|
|
316
|
+
}, "grp");
|
|
317
|
+
if (g?.start === 0) shown.push(group(true));
|
|
318
|
+
else {
|
|
319
|
+
shown.push(crumb(items[0], 0, plan.forms[0]));
|
|
320
|
+
if (g) shown.push(group());
|
|
321
|
+
}
|
|
322
|
+
for (let i = 1; i < n - 1; i++) if (!g || i > g.end) shown.push(crumb(items[i], i, plan.forms[i]));
|
|
323
|
+
}
|
|
324
|
+
const curLabel = fit.currentText ?? curItem.label;
|
|
325
|
+
const curNode = /* @__PURE__ */ jsxs("span", {
|
|
326
|
+
"aria-current": "page",
|
|
327
|
+
className: currentCls,
|
|
328
|
+
children: [
|
|
329
|
+
curItem.icon ? /* @__PURE__ */ jsx("span", {
|
|
330
|
+
"data-crumb-icon": true,
|
|
331
|
+
className: cn("flex shrink-0 items-center", m.icon),
|
|
332
|
+
"aria-hidden": true,
|
|
333
|
+
children: curItem.icon
|
|
334
|
+
}) : null,
|
|
335
|
+
/* @__PURE__ */ jsx("span", {
|
|
336
|
+
className: "min-w-0 truncate",
|
|
337
|
+
"aria-label": curLabel !== curItem.label ? curItem.label : void 0,
|
|
338
|
+
children: curLabel
|
|
339
|
+
}),
|
|
340
|
+
dot(curItem)
|
|
341
|
+
]
|
|
342
|
+
});
|
|
343
|
+
const backText = backLabel ?? (parent ? `Back to ${parent.label}` : "Back");
|
|
344
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
345
|
+
ref: navRef,
|
|
346
|
+
"aria-label": label,
|
|
347
|
+
"data-size": size,
|
|
348
|
+
className: cn("relative flex min-w-0 flex-1 items-center", m.row, m.text, className),
|
|
349
|
+
children: [
|
|
350
|
+
back ? /* @__PURE__ */ jsx("div", {
|
|
351
|
+
ref: backRef,
|
|
352
|
+
className: "flex shrink-0 items-center",
|
|
353
|
+
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
354
|
+
content: backText,
|
|
355
|
+
shortcut: backShortcut,
|
|
356
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
357
|
+
label: backText,
|
|
358
|
+
size: m.back,
|
|
359
|
+
onClick: back,
|
|
360
|
+
className: "shrink-0 rounded-kit-sm",
|
|
361
|
+
children: /* @__PURE__ */ jsx(IconArrowLeft, { stroke: 1.75 })
|
|
362
|
+
})
|
|
363
|
+
})
|
|
364
|
+
}) : null,
|
|
365
|
+
/* @__PURE__ */ jsxs("ol", {
|
|
366
|
+
className: "flex min-w-0 flex-1 items-center overflow-hidden",
|
|
367
|
+
children: [shown, /* @__PURE__ */ jsxs("li", {
|
|
368
|
+
className: "flex min-w-0 shrink items-center",
|
|
369
|
+
children: [n > 1 ? sepEl : null, fit.currentText || fit.plan === plans.length - 1 && long(curItem.label) ? /* @__PURE__ */ jsx(Tooltip, {
|
|
370
|
+
content: curItem.label,
|
|
371
|
+
side: "bottom",
|
|
372
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
373
|
+
tabIndex: 0,
|
|
374
|
+
className: "flex min-w-0 rounded-kit-sm",
|
|
375
|
+
children: curNode
|
|
376
|
+
})
|
|
377
|
+
}) : curNode]
|
|
378
|
+
})]
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ jsx("div", {
|
|
381
|
+
ref: mirrorRef,
|
|
382
|
+
"aria-hidden": true,
|
|
383
|
+
className: "pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",
|
|
384
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
385
|
+
className: "flex w-max flex-col items-start",
|
|
386
|
+
children: [
|
|
387
|
+
/* @__PURE__ */ jsx("span", {
|
|
388
|
+
"data-m": "sep",
|
|
389
|
+
className: "flex",
|
|
390
|
+
children: sepEl
|
|
391
|
+
}),
|
|
392
|
+
items.slice(0, -1).map((c, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
393
|
+
"data-m": `${i}:full`,
|
|
394
|
+
className: crumbCls,
|
|
395
|
+
children: body(c, "full")
|
|
396
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
397
|
+
"data-m": `${i}:trunc`,
|
|
398
|
+
className: crumbCls,
|
|
399
|
+
children: body(c, "trunc")
|
|
400
|
+
})] }, c.id)),
|
|
401
|
+
[0, 1].flatMap((start) => items.slice(0, -1).map((_, end) => end < start ? null : /* @__PURE__ */ jsx("span", {
|
|
402
|
+
"data-m": `g:${start}:${end}`,
|
|
403
|
+
className: crumbCls,
|
|
404
|
+
children: groupBody({
|
|
405
|
+
start,
|
|
406
|
+
end
|
|
407
|
+
})
|
|
408
|
+
}, `g${start}:${end}`))),
|
|
409
|
+
/* @__PURE__ */ jsxs("span", {
|
|
410
|
+
"data-m": "cur",
|
|
411
|
+
className: currentCls,
|
|
412
|
+
children: [
|
|
413
|
+
curItem.icon ? /* @__PURE__ */ jsx("span", {
|
|
414
|
+
"data-crumb-icon": true,
|
|
415
|
+
className: cn("flex shrink-0 items-center", m.icon),
|
|
416
|
+
children: curItem.icon
|
|
417
|
+
}) : null,
|
|
418
|
+
/* @__PURE__ */ jsx("span", {
|
|
419
|
+
"data-m": "curtext",
|
|
420
|
+
children: curItem.label
|
|
421
|
+
}),
|
|
422
|
+
dot(curItem)
|
|
423
|
+
]
|
|
424
|
+
})
|
|
425
|
+
]
|
|
426
|
+
})
|
|
427
|
+
})
|
|
428
|
+
]
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
function GroupLi({ items, group, trigger, sep, first, navRef, label, cls, link: Link }) {
|
|
432
|
+
const count = group.end - group.start + 1;
|
|
433
|
+
const last = items.length - 1;
|
|
434
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
435
|
+
className: "flex shrink-0 items-center",
|
|
436
|
+
children: [first ? null : sep, /* @__PURE__ */ jsxs(Menu$1, { children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
437
|
+
content: "Show the full path",
|
|
438
|
+
side: "bottom",
|
|
439
|
+
children: /* @__PURE__ */ jsx(MenuTrigger, {
|
|
440
|
+
"data-crumb-group": "",
|
|
441
|
+
className: cn(cls, "aria-expanded:bg-kit-selected aria-expanded:text-kit-fg"),
|
|
442
|
+
"aria-label": `Show ${count} more ${count === 1 ? "level" : "levels"}`,
|
|
443
|
+
children: trigger
|
|
444
|
+
})
|
|
445
|
+
}), /* @__PURE__ */ jsxs(MenuContent, {
|
|
446
|
+
align: "start",
|
|
447
|
+
finalFocus: () => {
|
|
448
|
+
requestAnimationFrame(() => {
|
|
449
|
+
const nav = navRef.current?.isConnected ? navRef.current : document.querySelector(`nav[aria-label="${CSS.escape(label)}"]`);
|
|
450
|
+
if (!nav) return;
|
|
451
|
+
(nav.querySelector("[data-crumb-group]") ?? nav.querySelector("button, [aria-current], [tabindex='0']"))?.focus({ preventScroll: true });
|
|
452
|
+
});
|
|
453
|
+
return false;
|
|
454
|
+
},
|
|
455
|
+
className: "w-64 max-w-[calc(100vw-24px)] text-[13px] leading-5",
|
|
456
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
457
|
+
className: "px-2 pb-1 pt-1 text-kit-xs font-medium text-kit-fg-3",
|
|
458
|
+
children: "Pathway"
|
|
459
|
+
}), /* @__PURE__ */ jsx("ol", {
|
|
460
|
+
role: "none",
|
|
461
|
+
className: "flex flex-col",
|
|
462
|
+
children: items.map((c, i) => {
|
|
463
|
+
const isCurrent = i === last;
|
|
464
|
+
const hidden = i >= group.start && i <= group.end;
|
|
465
|
+
const rowCls = cn("relative flex h-7 select-none items-center gap-1.5 rounded-kit-sm pr-2 outline-none transition-colors", isCurrent ? "cursor-default font-semibold text-kit-fg data-[highlighted]:bg-kit-hover" : cn("cursor-pointer data-[highlighted]:bg-kit-hover data-[highlighted]:text-kit-fg active:bg-kit-selected", hidden ? "text-kit-fg" : "text-kit-fg-3"));
|
|
466
|
+
const style = { paddingLeft: 8 + Math.min(i, 8) * 12 };
|
|
467
|
+
return /* @__PURE__ */ jsx("li", {
|
|
468
|
+
role: "none",
|
|
469
|
+
children: c.to && !isCurrent ? /* @__PURE__ */ jsx(Menu.LinkItem, {
|
|
470
|
+
closeOnClick: true,
|
|
471
|
+
render: /* @__PURE__ */ jsx(Link, { to: c.to }),
|
|
472
|
+
onClick: () => c.onSelect?.(),
|
|
473
|
+
className: rowCls,
|
|
474
|
+
style,
|
|
475
|
+
children: /* @__PURE__ */ jsx(PathRow, {
|
|
476
|
+
c,
|
|
477
|
+
depth: i
|
|
478
|
+
})
|
|
479
|
+
}) : /* @__PURE__ */ jsx(Menu.Item, {
|
|
480
|
+
onClick: () => isCurrent ? void 0 : c.onSelect?.(),
|
|
481
|
+
"aria-current": isCurrent ? "page" : void 0,
|
|
482
|
+
className: rowCls,
|
|
483
|
+
style,
|
|
484
|
+
children: /* @__PURE__ */ jsx(PathRow, {
|
|
485
|
+
c,
|
|
486
|
+
depth: i,
|
|
487
|
+
current: isCurrent
|
|
488
|
+
})
|
|
489
|
+
})
|
|
490
|
+
}, c.id);
|
|
491
|
+
})
|
|
492
|
+
})]
|
|
493
|
+
})] })]
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
function PathRow({ c, depth, current }) {
|
|
497
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
498
|
+
depth > 0 ? /* @__PURE__ */ jsx("span", {
|
|
499
|
+
"aria-hidden": true,
|
|
500
|
+
className: "-mt-2 h-3 w-2 shrink-0 rounded-bl-[3px] border-b border-l border-kit-line-strong"
|
|
501
|
+
}) : null,
|
|
502
|
+
c.icon ? /* @__PURE__ */ jsx("span", {
|
|
503
|
+
"aria-hidden": true,
|
|
504
|
+
className: "flex shrink-0 items-center text-kit-fg-3 [&_svg]:size-3.5",
|
|
505
|
+
children: c.icon
|
|
506
|
+
}) : null,
|
|
507
|
+
c.label.length > 28 ? /* @__PURE__ */ jsx(Tooltip, {
|
|
508
|
+
content: c.label,
|
|
509
|
+
side: "right",
|
|
510
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
511
|
+
className: "min-w-0 flex-1 truncate",
|
|
512
|
+
children: c.label
|
|
513
|
+
})
|
|
514
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
515
|
+
className: "min-w-0 flex-1 truncate",
|
|
516
|
+
children: c.label
|
|
517
|
+
}),
|
|
518
|
+
c.errors ? /* @__PURE__ */ jsx("span", {
|
|
519
|
+
role: "img",
|
|
520
|
+
"aria-label": "Has errors",
|
|
521
|
+
className: "size-1.5 shrink-0 rounded-full bg-kit-danger"
|
|
522
|
+
}) : null,
|
|
523
|
+
current ? /* @__PURE__ */ jsx("span", {
|
|
524
|
+
"aria-hidden": true,
|
|
525
|
+
className: "size-1.5 shrink-0 rounded-full bg-kit-accent"
|
|
526
|
+
}) : null
|
|
527
|
+
] });
|
|
528
|
+
}
|
|
529
|
+
//#endregion
|
|
530
|
+
export { PathCrumbs };
|
|
531
|
+
|
|
532
|
+
//# sourceMappingURL=path-crumbs.js.map
|