@bioturing/components 0.39.1 → 0.40.1
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/dist/base.d.ts +35 -1
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +47 -1
- package/dist/base.js.map +1 -1
- package/dist/components/base-menu/component.d.ts +1 -1
- package/dist/components/base-menu/index.d.ts +1 -1
- package/dist/components/base-menu/index.d.ts.map +1 -1
- package/dist/components/base-menu/item.d.ts +1 -1
- package/dist/components/base-menu/item.d.ts.map +1 -1
- package/dist/components/base-menu/item.js +1 -1
- package/dist/components/base-menu/item.js.map +1 -1
- package/dist/components/button/component.d.ts +1 -1
- package/dist/components/button/component.d.ts.map +1 -1
- package/dist/components/button/component.js +18 -17
- package/dist/components/button/component.js.map +1 -1
- package/dist/components/checkbox/component.d.ts.map +1 -1
- package/dist/components/choice-list/component.d.ts +8 -4
- package/dist/components/choice-list/component.d.ts.map +1 -1
- package/dist/components/choice-list/component.js +89 -94
- package/dist/components/choice-list/component.js.map +1 -1
- package/dist/components/color-select/component.js +6 -6
- package/dist/components/combobox/component.js +1 -1
- package/dist/components/combobox/component.js.map +1 -1
- package/dist/components/command-palette/component.d.ts +6 -0
- package/dist/components/command-palette/component.d.ts.map +1 -1
- package/dist/components/command-palette/component.js +182 -63
- package/dist/components/command-palette/component.js.map +1 -1
- package/dist/components/command-palette/index.d.ts +3 -1
- package/dist/components/command-palette/index.d.ts.map +1 -1
- package/dist/components/command-palette/style.css +1 -1
- package/dist/components/drag-drop/draggable.js +1 -1
- package/dist/components/drag-drop/draggable.js.map +1 -1
- package/dist/components/drag-drop/droppable.js +1 -1
- package/dist/components/drag-drop/droppable.js.map +1 -1
- package/dist/components/drag-drop/types.d.ts +1 -1
- package/dist/components/drag-drop/types.d.ts.map +1 -1
- package/dist/components/drag-drop/value.js +13 -13
- package/dist/components/dropdown-menu/component.d.ts +1 -1
- package/dist/components/dropdown-menu/component.d.ts.map +1 -1
- package/dist/components/dropdown-menu/component.js +162 -135
- package/dist/components/dropdown-menu/component.js.map +1 -1
- package/dist/components/dropdown-menu/divider.js +2 -2
- package/dist/components/dropdown-menu/divider.js.map +1 -1
- package/dist/components/dropdown-menu/item.js +2 -2
- package/dist/components/dropdown-menu/item.js.map +1 -1
- package/dist/components/dropdown-menu/style.css +1 -1
- package/dist/components/dropdown-menu/useDropdownMenu.js +1 -1
- package/dist/components/dropdown-menu/useDropdownMenu.js.map +1 -1
- package/dist/components/hooks/antd.d.ts.map +1 -1
- package/dist/components/hooks/index.d.ts +1 -0
- package/dist/components/hooks/index.d.ts.map +1 -1
- package/dist/components/hooks/useBaseUIPlacement.d.ts +64 -0
- package/dist/components/hooks/useBaseUIPlacement.d.ts.map +1 -0
- package/dist/components/hooks/useBaseUIPlacement.js +61 -0
- package/dist/components/hooks/useBaseUIPlacement.js.map +1 -0
- package/dist/components/hooks/useControlledState.d.ts +1 -0
- package/dist/components/hooks/useControlledState.d.ts.map +1 -1
- package/dist/components/hooks/useControlledState.js +16 -16
- package/dist/components/hooks/useControlledState.js.map +1 -1
- package/dist/components/hooks/useTransitionStatus.js +2 -2
- package/dist/components/hooks/useTransitionStatus.js.map +1 -1
- package/dist/components/icon-button/style.css +1 -1
- package/dist/components/nav/index.d.ts.map +1 -1
- package/dist/components/nav/item.d.ts +1 -1
- package/dist/components/nav/item.d.ts.map +1 -1
- package/dist/components/nav/item.js +1 -1
- package/dist/components/nav/item.js.map +1 -1
- package/dist/components/popup-panel/component.d.ts +4 -4
- package/dist/components/popup-panel/component.d.ts.map +1 -1
- package/dist/components/popup-panel/component.js +142 -152
- package/dist/components/popup-panel/component.js.map +1 -1
- package/dist/components/resizable/component.js +1 -1
- package/dist/components/resizable/component.js.map +1 -1
- package/dist/components/scroll-area/component.d.ts +1 -1
- package/dist/components/scroll-area/component.d.ts.map +1 -1
- package/dist/components/scroll-area/component.js +1 -1
- package/dist/components/scroll-area/component.js.map +1 -1
- package/dist/components/select/component.d.ts.map +1 -1
- package/dist/components/select/component.js +153 -138
- package/dist/components/select/component.js.map +1 -1
- package/dist/components/select/item.js +13 -13
- package/dist/components/select-trigger/component.js +19 -19
- package/dist/components/splitter/splitter.d.ts.map +1 -1
- package/dist/components/splitter/splitter.js +53 -51
- package/dist/components/splitter/splitter.js.map +1 -1
- package/dist/components/stack/StackChild.js +2 -2
- package/dist/components/stack/StackChild.js.map +1 -1
- package/dist/components/toast/component.d.ts +1 -1
- package/dist/components/toast/component.d.ts.map +1 -1
- package/dist/components/toast/component.js +1 -1
- package/dist/components/toast/component.js.map +1 -1
- package/dist/components/toast/function.d.ts +2 -2
- package/dist/components/toast/function.d.ts.map +1 -1
- package/dist/components/toast/function.js +1 -1
- package/dist/components/toast/function.js.map +1 -1
- package/dist/components/transition/component.d.ts +1 -1
- package/dist/components/transition/component.d.ts.map +1 -1
- package/dist/components/transition/component.js +2 -2
- package/dist/components/transition/component.js.map +1 -1
- package/dist/components/tree/useTreeCommon.d.ts.map +1 -1
- package/dist/components/utils/WithRenderProp.d.ts +1 -1
- package/dist/components/utils/WithRenderProp.d.ts.map +1 -1
- package/dist/components/utils/WithRenderProp.js +1 -1
- package/dist/components/utils/WithRenderProp.js.map +1 -1
- package/dist/components/utils/index.d.ts +1 -0
- package/dist/components/utils/index.d.ts.map +1 -1
- package/dist/components/utils/renderProp.d.ts +24 -0
- package/dist/components/utils/renderProp.d.ts.map +1 -0
- package/dist/components/utils/renderProp.js +19 -0
- package/dist/components/utils/renderProp.js.map +1 -0
- package/dist/components/vertical-collapsible-panel/component.js +1 -1
- package/dist/components/vertical-collapsible-panel/component.js.map +1 -1
- package/dist/index.js +162 -158
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +14 -14
- package/dist/metadata.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/tailwind.css +125 -1
- package/package.json +3 -3
- package/dist/components/cmdk/command-score.d.ts +0 -2
- package/dist/components/cmdk/command-score.d.ts.map +0 -1
- package/dist/components/cmdk/command-score.js +0 -48
- package/dist/components/cmdk/command-score.js.map +0 -1
- package/dist/components/cmdk/index.d.ts +0 -440
- package/dist/components/cmdk/index.d.ts.map +0 -1
- package/dist/components/cmdk/index.js +0 -595
- package/dist/components/cmdk/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.ds-command-palette-overlay{background-color:var(--ds-color-bg-mask);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);position:fixed;inset:0;z-index:var(--ds-z-index-modal-mask)}.ds-command-palette-content{position:fixed;top:20%;left:50%;transform:translate(-50%);width:90%;max-width:640px;max-height:60vh;background:var(--ds-color-bg-elevated);border:1px solid var(--ds-color-border);border-radius:var(--ds-border-radius-lg);box-shadow:0 10px 38px -10px #16171859,0 10px 20px -15px #16171833;overflow:hidden;z-index:var(--ds-z-index-modal);animation:commandPaletteIn var(--ds-motion-duration-fast) var(--ds-motion-ease-out)}.ds-command-palette-content:focus:not(:focus-visible){outline:none}.ds-command-palette{display:flex;flex-direction:column;height:100%}.ds-command-palette-
|
|
1
|
+
@layer components{.ds-command-palette-overlay{background-color:var(--ds-color-bg-mask);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);position:fixed;inset:0;z-index:var(--ds-z-index-modal-mask)}.ds-command-palette-content{position:fixed;top:20%;left:50%;transform:translate(-50%);width:90%;max-width:640px;max-height:60vh;background:var(--ds-color-bg-elevated);border:1px solid var(--ds-color-border);border-radius:var(--ds-border-radius-lg);box-shadow:0 10px 38px -10px #16171859,0 10px 20px -15px #16171833;overflow:hidden;z-index:var(--ds-z-index-modal);animation:commandPaletteIn var(--ds-motion-duration-fast) var(--ds-motion-ease-out)}.ds-command-palette-content:focus:not(:focus-visible){outline:none}.ds-command-palette{display:flex;flex-direction:column;height:100%}.ds-command-palette-search-wrapper{border-bottom:1px solid var(--ds-color-border)}.ds-command-palette-search{border:none!important;border-radius:0!important;box-shadow:none!important}.ds-command-palette-search:focus,.ds-command-palette-search:focus-within{border:none!important;box-shadow:none!important}.ds-command-palette-list{padding:.5rem}.ds-command-palette-empty{display:flex;align-items:center;justify-content:center;height:5rem}@keyframes commandPaletteIn{0%{opacity:0;transform:translate(-50%) scale(.95) translateY(-10px)}to{opacity:1;transform:translate(-50%) scale(1) translateY(0)}}@media(prefers-color-scheme:dark){.ds-command-palette-overlay{background-color:var(--ds-color-bg-mask)}}@media(max-width:640px){.ds-command-palette-content{top:10%;width:95%;max-height:70vh}}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as p } from "react/jsx-runtime";
|
|
3
3
|
import { useDraggable as A } from "./hooks.js";
|
|
4
|
-
import { useRender as D } from "@base-ui
|
|
4
|
+
import { useRender as D } from "@base-ui/react/use-render";
|
|
5
5
|
import { DotsSixVerticalIcon as C } from "@bioturing/assets";
|
|
6
6
|
import { isValidElement as N, cloneElement as R } from "react";
|
|
7
7
|
import { useCls as V } from "../utils/antdUtils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draggable.js","sources":["../../../src/components/drag-drop/draggable.tsx"],"sourcesContent":["\"use client\";\n\nimport { useDraggable } from \"./hooks\";\nimport { clsx, useCls } from \"../utils\";\nimport { useRender } from \"@base-ui
|
|
1
|
+
{"version":3,"file":"draggable.js","sources":["../../../src/components/drag-drop/draggable.tsx"],"sourcesContent":["\"use client\";\n\nimport { useDraggable } from \"./hooks\";\nimport { clsx, useCls } from \"../utils\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type { Data, DragDropDraggableProps } from \"./types\";\nimport { DotsSixVerticalIcon } from \"@bioturing/assets\";\nimport { cloneElement, isValidElement, HTMLProps } from \"react\";\n\n/**\n * A draggable item component that can be used within the Drag context\n */\nexport const Draggable = <T extends Data = Data>({\n id,\n children,\n className,\n disabled = false,\n data,\n style,\n render,\n onDragEnd,\n onDragStart,\n indicator = true,\n onlyIndicatorDraggable = false,\n ...rest\n}: DragDropDraggableProps<T>) => {\n const cls = useCls();\n\n const { attributes, listeners, isDragging, setNodeRef } = useDraggable({\n id,\n data,\n disabled,\n onDragEnd,\n onDragStart,\n });\n\n const indicatorIcon =\n indicator === true ? (\n <DotsSixVerticalIcon\n className={cls(\"draggable-indicator\")}\n key={\"indicator-icon\" + id}\n />\n ) : (\n indicator\n );\n const indicatorElement = isValidElement(indicatorIcon)\n ? onlyIndicatorDraggable\n ? cloneElement(indicatorIcon, {\n ...attributes,\n ...listeners,\n key: \"indicator\" + id,\n })\n : indicatorIcon\n : null;\n\n const combinedChildren = [\n indicatorElement,\n ...(Array.isArray(children) ? children : [children]),\n ];\n\n const renderedElement = useRender({\n render: render ? (\n render\n ) : (\n <div className={clsx(cls(\"draggable\"), className)} />\n ),\n ref: setNodeRef,\n props: {\n children: combinedChildren,\n className,\n style: {\n ...style,\n touchAction: \"none\", // Prevents scrolling on touch devices while dragging\n cursor: disabled ? \"default\" : \"grab\",\n opacity: isDragging ? 0.5 : 1, // Visual feedback when dragging\n },\n ...rest,\n ...attributes,\n ...(!onlyIndicatorDraggable ? listeners : {}),\n },\n state: {\n isDragging,\n id,\n data,\n },\n });\n\n return renderedElement;\n};\n"],"names":["Draggable","id","children","className","disabled","data","style","render","onDragEnd","onDragStart","indicator","onlyIndicatorDraggable","rest","cls","useCls","attributes","listeners","isDragging","setNodeRef","useDraggable","indicatorIcon","jsx","DotsSixVerticalIcon","combinedChildren","isValidElement","cloneElement","useRender","clsx"],"mappings":";;;;;;;;AAYO,MAAMA,IAAY,CAAwB;AAAA,EAC/C,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,wBAAAC,IAAyB;AAAA,EACzB,GAAGC;AACL,MAAiC;AAC/B,QAAMC,IAAMC,E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
|
import { useDroppable as h } from "./hooks.js";
|
|
5
5
|
import { ArrowsOutCardinalIcon as B } from "@bioturing/assets";
|
|
6
|
-
import { useRender as F } from "@base-ui
|
|
6
|
+
import { useRender as F } from "@base-ui/react/use-render";
|
|
7
7
|
import { Value as G } from "./value.js";
|
|
8
8
|
import { uniqWith as H, isEqual as I } from "es-toolkit";
|
|
9
9
|
import { useCls as J } from "../utils/antdUtils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"droppable.js","sources":["../../../src/components/drag-drop/droppable.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useCallback, useMemo, memo } from \"react\";\nimport { useDroppable } from \"./hooks\";\nimport { clsx, useCls } from \"../utils\";\nimport { ArrowsOutCardinalIcon } from \"@bioturing/assets\";\nimport { useRender } from \"@base-ui
|
|
1
|
+
{"version":3,"file":"droppable.js","sources":["../../../src/components/drag-drop/droppable.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { useCallback, useMemo, memo } from \"react\";\nimport { useDroppable } from \"./hooks\";\nimport { clsx, useCls } from \"../utils\";\nimport { ArrowsOutCardinalIcon } from \"@bioturing/assets\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type { Data, DragDropDroppableProps, DraggableInfo } from \"./types\";\nimport { Value } from \"./value\";\nimport { uniqWith, isEqual } from \"es-toolkit\";\n\n/**\n * A drop zone component that can receive draggable items\n * Styled similarly to the Upload component's droppable area\n */\nconst DroppableInner = <T extends Data = Data, M extends boolean = false>({\n id,\n children,\n className,\n disabled = false,\n placeholder = \"Drop items here\",\n icon = <ArrowsOutCardinalIcon />,\n render,\n onDrop,\n validate,\n multiple,\n value,\n onChange,\n maxItems,\n renderValueLabel,\n renderValueIcon,\n ...rest\n}: DragDropDroppableProps<T, M>) => {\n const cls = useCls();\n const handleOnDrop = useCallback(\n (item: DraggableInfo<T>) => {\n if (onDrop) {\n onDrop(item);\n }\n if (onChange) {\n if (multiple) {\n (onChange as (value: T[]) => void)(\n uniqWith([...(value as T[]), item.data], isEqual)\n );\n } else {\n (onChange as (value: T) => void)(item.data);\n }\n }\n },\n [onDrop, onChange, multiple, value]\n );\n const { isOver, setNodeRef, attributes, listeners } = useDroppable({\n id,\n disabled,\n onDrop: handleOnDrop,\n validate,\n });\n\n // memoize value props to avoid re-renders\n const valueProps = useMemo(\n () => ({\n value,\n onChange,\n multiple,\n renderValueLabel,\n renderValueIcon,\n maxItems,\n }),\n [value, onChange, multiple, renderValueLabel, renderValueIcon, maxItems]\n );\n\n // memoize dropzone content\n const dropzoneContent = useMemo(\n () =>\n children || (\n <div className={cls(\"drop-zone-content\")}>\n <div className={cls(\"drop-zone-icon\")}>{icon}</div>\n <div className={cls(\"drop-zone-text\")}>{placeholder}</div>\n </div>\n ),\n [children, cls, icon, placeholder]\n );\n\n // memoize default render tree\n const defaultRender = useCallback<\n (props: Record<string, unknown>) => React.ReactElement\n >(\n ({ className, ...props }) => {\n if (!value || (multiple && Array.isArray(value) && !value.length)) {\n return (\n <div\n className={clsx(cls(\"drop-zone\"), className as string)}\n {...props}\n >\n {dropzoneContent}\n </div>\n );\n }\n // return value when there is a value\n return (\n <Value<T, M>\n {...valueProps}\n className={className as string}\n {...props}\n />\n );\n },\n [value, multiple, valueProps, dropzoneContent, cls]\n );\n\n const renderedElement = useRender({\n render: render ?? defaultRender,\n ref: setNodeRef,\n props: {\n className: className,\n ...attributes,\n ...listeners,\n ...rest,\n },\n state: {\n isOver,\n value,\n onChange: onChange as (value: M extends true ? T[] : T) => void,\n id,\n },\n });\n\n return renderedElement;\n};\n\nexport const Droppable = memo(DroppableInner) as typeof DroppableInner;\n"],"names":["DroppableInner","id","children","className","disabled","placeholder","icon","ArrowsOutCardinalIcon","render","onDrop","validate","multiple","value","onChange","maxItems","renderValueLabel","renderValueIcon","rest","cls","useCls","handleOnDrop","useCallback","item","uniqWith","isEqual","isOver","setNodeRef","attributes","listeners","useDroppable","valueProps","useMemo","dropzoneContent","jsxs","jsx","defaultRender","props","clsx","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,EAAI,gBAAgB,GAAI,UAAAZ,GAAK;AAAA,wBAC5C,OAAA,EAAI,WAAWY,EAAI,gBAAgB,GAAI,UAAAb,EAAA,CAAY;AAAA,IAAA,GACtD;AAAA,IAEJ,CAACH,GAAUgB,GAAKZ,GAAMD,CAAW;AAAA,EAAA,GAI7B8B,IAAgBd;AAAA,IAGpB,CAAC,EAAE,WAAAlB,GAAW,GAAGiC,QACX,CAACxB,KAAUD,KAAY,MAAM,QAAQC,CAAK,KAAK,CAACA,EAAM,SAEtD,gBAAAsB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWG,EAAKnB,EAAI,WAAW,GAAGf,CAAmB;AAAA,QACpD,GAAGiC;AAAA,QAEH,UAAAJ;AAAA,MAAA;AAAA,IAAA,IAML,gBAAAE;AAAA,MAACI;AAAA,MAAA;AAAA,QACE,GAAGR;AAAA,QACJ,WAAW3B;AAAAA,QACV,GAAGiC;AAAA,MAAA;AAAA,IAAA;AAAA,IAIV,CAACxB,GAAOD,GAAUmB,GAAYE,GAAiBd,CAAG;AAAA,EAAA;AAoBpD,SAjBwBqB,EAAU;AAAA,IAChC,QAAQ/B,KAAU2B;AAAA,IAClB,KAAKT;AAAA,IACL,OAAO;AAAA,MACL,WAAAvB;AAAA,MACA,GAAGwB;AAAA,MACH,GAAGC;AAAA,MACH,GAAGX;AAAA,IAAA;AAAA,IAEL,OAAO;AAAA,MACL,QAAAQ;AAAA,MACA,OAAAb;AAAA,MACA,UAAAC;AAAA,MACA,IAAAZ;AAAA,IAAA;AAAA,EACF,CACD;AAGH,GAEauC,IAAYC,EAAKzC,CAAc;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactElement, ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import { useRender } from '@base-ui
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
3
|
/**
|
|
4
4
|
* Base data type for drag and drop operations
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/drag-drop/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EAEZ,SAAS,EACT,wBAAwB,EACzB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/drag-drop/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EAEZ,SAAS,EACT,wBAAwB,EACzB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/C,MAAM,MAAM,IAAI,GAAG,OAAO,CAAC;AAE3B,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI;IACjD,EAAE,EAAE,gBAAgB,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI;IACnD,MAAM,EAAE;QACN,EAAE,EAAE,gBAAgB,CAAC;QACrB,IAAI,EAAE,CAAC,CAAC;KACT,CAAC;CACH;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI;IACjD,MAAM,EAAE;QACN,EAAE,EAAE,gBAAgB,CAAC;QACrB,IAAI,EAAE,CAAC,CAAC;KACT,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,gBAAgB,CAAC;KACtB,GAAG,IAAI,CAAC;CACV;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI;IACtD,EAAE,EAAE,gBAAgB,CAAC;IACrB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,QAA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C,CAAC,KAAK,IAAI,CAAC;IAEjD;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB,CACjC,CAAC,SAAS,IAAI,GAAG,IAAI,EACrB,CAAC,SAAS,OAAO,GAAG,KAAK,CACzB,SAAQ,IAAI,CACV,wBAAwB,CAAC,KAAK,CAAC,EAC/B,aAAa,GAAG,YAAY,GAAG,aAAa,GAAG,QAAQ,GAAG,UAAU,CACrE;IACD;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,SAAS,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IACtE;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,YAAY,GAAG,MAAM,CAAC;IAC7D;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,YAAY,CAAC;IACnD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -13,18 +13,18 @@ function J({
|
|
|
13
13
|
value: s,
|
|
14
14
|
onChange: c,
|
|
15
15
|
multiple: t,
|
|
16
|
-
renderValueLabel:
|
|
17
|
-
renderValueIcon:
|
|
16
|
+
renderValueLabel: f,
|
|
17
|
+
renderValueIcon: p,
|
|
18
18
|
className: R,
|
|
19
19
|
style: E,
|
|
20
20
|
maxItems: m,
|
|
21
21
|
...N
|
|
22
22
|
}, S) {
|
|
23
|
-
const l = D(), [u,
|
|
24
|
-
|
|
23
|
+
const l = D(), [u, g] = B(null), k = n((e) => {
|
|
24
|
+
g(e);
|
|
25
25
|
}, []), i = n(
|
|
26
26
|
(e) => {
|
|
27
|
-
const r =
|
|
27
|
+
const r = f(e);
|
|
28
28
|
return typeof r == "string" ? /* @__PURE__ */ o(
|
|
29
29
|
G,
|
|
30
30
|
{
|
|
@@ -35,12 +35,12 @@ function J({
|
|
|
35
35
|
}
|
|
36
36
|
) : /* @__PURE__ */ o("span", { className: l("dropzone-value-label"), children: r });
|
|
37
37
|
},
|
|
38
|
-
[l, u,
|
|
38
|
+
[l, u, f]
|
|
39
39
|
), a = n(
|
|
40
|
-
(e) => C(
|
|
40
|
+
(e) => C(p(e) || /* @__PURE__ */ o(M, {}), {
|
|
41
41
|
className: l("dropzone-value-icon")
|
|
42
42
|
}),
|
|
43
|
-
[l,
|
|
43
|
+
[l, p]
|
|
44
44
|
), b = n(
|
|
45
45
|
(e) => {
|
|
46
46
|
c(
|
|
@@ -50,7 +50,7 @@ function J({
|
|
|
50
50
|
[c, s]
|
|
51
51
|
), z = n(() => {
|
|
52
52
|
t ? c([]) : c?.(null);
|
|
53
|
-
}, [c, t]),
|
|
53
|
+
}, [c, t]), d = n(
|
|
54
54
|
(e) => {
|
|
55
55
|
const r = i(e);
|
|
56
56
|
return /* @__PURE__ */ I(h, { children: [
|
|
@@ -61,7 +61,7 @@ function J({
|
|
|
61
61
|
},
|
|
62
62
|
[i, a, z]
|
|
63
63
|
), j = n(
|
|
64
|
-
(e) => m == 1 ?
|
|
64
|
+
(e) => m == 1 ? d(e[0]) : /* @__PURE__ */ o(h, { children: (e || []).map((r, w) => {
|
|
65
65
|
const F = i(r);
|
|
66
66
|
return /* @__PURE__ */ o(
|
|
67
67
|
A,
|
|
@@ -79,14 +79,14 @@ function J({
|
|
|
79
79
|
i,
|
|
80
80
|
a,
|
|
81
81
|
m,
|
|
82
|
-
|
|
82
|
+
d,
|
|
83
83
|
b
|
|
84
84
|
]
|
|
85
85
|
);
|
|
86
86
|
return /* @__PURE__ */ o(
|
|
87
87
|
X,
|
|
88
88
|
{
|
|
89
|
-
ref: v(S,
|
|
89
|
+
ref: v(S, k),
|
|
90
90
|
gap: t ? 4 : 8,
|
|
91
91
|
align: "center",
|
|
92
92
|
wrap: t && m !== 1,
|
|
@@ -97,7 +97,7 @@ function J({
|
|
|
97
97
|
),
|
|
98
98
|
style: E,
|
|
99
99
|
...N,
|
|
100
|
-
children: t ? j(s) :
|
|
100
|
+
children: t ? j(s) : d(s)
|
|
101
101
|
}
|
|
102
102
|
);
|
|
103
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAepD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAmB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAQ1E,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC;IAChD,0DAA0D;IAC1D,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/D;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAEvC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,OAAO,cAAc,CAAC;IAC5C;;OAEG;IACH,WAAW,CAAC,EAAE;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,YAAY,GAAI,sWA0B1B,iBAAiB,4CA0NnB,CAAC"}
|
|
@@ -1,62 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Menu as
|
|
4
|
-
import { Combobox as t } from "@base-ui
|
|
5
|
-
import { useRef as
|
|
6
|
-
import { FormItemInputContext as
|
|
7
|
-
import { PopupPanelSize as
|
|
8
|
-
import { useDropdownMenu as
|
|
9
|
-
import { BaseMenu as
|
|
10
|
-
import { parseAntdPlacement as
|
|
11
|
-
import {
|
|
12
|
-
import { ScrollArea as
|
|
13
|
-
import { DROPDOWN_COLLISION_AVOIDANCE as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
2
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { Menu as u } from "@base-ui/react/menu";
|
|
4
|
+
import { Combobox as t } from "@base-ui/react/combobox";
|
|
5
|
+
import { useRef as O, useState as V, useEffect as te, useCallback as ie } from "react";
|
|
6
|
+
import { FormItemInputContext as le } from "antd/es/form/context";
|
|
7
|
+
import { PopupPanelSize as B } from "../popup-panel/constants.js";
|
|
8
|
+
import { useDropdownMenu as me } from "./useDropdownMenu.js";
|
|
9
|
+
import { BaseMenu as F } from "../base-menu/index.js";
|
|
10
|
+
import { parseAntdPlacement as ce } from "../utils/placement.js";
|
|
11
|
+
import { useBaseUIPlacement as ue } from "../hooks/useBaseUIPlacement.js";
|
|
12
|
+
import { ScrollArea as _ } from "../scroll-area/component.js";
|
|
13
|
+
import { DROPDOWN_COLLISION_AVOIDANCE as pe } from "../utils/constants.js";
|
|
14
|
+
import { Input as de } from "../input/component.js";
|
|
15
|
+
import { createRenderProp as se } from "../utils/renderProp.js";
|
|
16
|
+
import { useControlledState as ae } from "../hooks/useControlledState.js";
|
|
17
|
+
import { useCls as fe } from "../utils/antdUtils.js";
|
|
18
|
+
import { useTheme as ge } from "../theme-provider/context/themeStore.js";
|
|
19
|
+
import { clsx as f } from "../utils/cn.js";
|
|
20
|
+
import { reactNodeToString as he } from "../utils/reactToString.js";
|
|
21
|
+
const je = ({
|
|
22
|
+
children: j,
|
|
23
|
+
items: k,
|
|
24
|
+
placement: G,
|
|
25
|
+
openOnHover: H,
|
|
26
|
+
open: L,
|
|
27
|
+
onOpenChange: U,
|
|
28
|
+
defaultOpen: z = !1,
|
|
29
|
+
className: K,
|
|
30
|
+
itemRender: W,
|
|
29
31
|
classNames: r,
|
|
30
|
-
size:
|
|
32
|
+
size: R = "auto",
|
|
31
33
|
showSearch: p,
|
|
32
|
-
inCombobox:
|
|
33
|
-
searchProps:
|
|
34
|
+
inCombobox: N,
|
|
35
|
+
searchProps: l = {
|
|
34
36
|
placeholder: "Search..."
|
|
35
37
|
},
|
|
36
|
-
popupMatchTriggerWidth:
|
|
37
|
-
beforeList:
|
|
38
|
-
afterList:
|
|
39
|
-
keepOpenOnSelect:
|
|
40
|
-
highlightedItemKey:
|
|
41
|
-
selectedItemKeys:
|
|
42
|
-
getItemKeywords:
|
|
43
|
-
showCheckbox:
|
|
44
|
-
itemLabelRender:
|
|
38
|
+
popupMatchTriggerWidth: q,
|
|
39
|
+
beforeList: g,
|
|
40
|
+
afterList: h,
|
|
41
|
+
keepOpenOnSelect: J,
|
|
42
|
+
highlightedItemKey: Pe,
|
|
43
|
+
selectedItemKeys: Q,
|
|
44
|
+
getItemKeywords: X,
|
|
45
|
+
showCheckbox: y,
|
|
46
|
+
itemLabelRender: Y
|
|
45
47
|
}) => {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
), n =
|
|
51
|
-
items:
|
|
52
|
-
keepOpenOnSelect:
|
|
53
|
-
selectedItemKeys:
|
|
54
|
-
showCheckbox:
|
|
55
|
-
getItemKeywords:
|
|
56
|
-
itemLabelRender:
|
|
57
|
-
itemRender:
|
|
58
|
-
inCombobox:
|
|
59
|
-
onOpenChange:
|
|
48
|
+
const Z = typeof N == "boolean" ? N : p, [P, b] = ae(
|
|
49
|
+
L,
|
|
50
|
+
U,
|
|
51
|
+
z
|
|
52
|
+
), n = fe(), { className: T } = ge(), d = ce(G), $ = O(null), { itemGroups: S, renderGroup: w } = me({
|
|
53
|
+
items: k,
|
|
54
|
+
keepOpenOnSelect: J,
|
|
55
|
+
selectedItemKeys: Q,
|
|
56
|
+
showCheckbox: y,
|
|
57
|
+
getItemKeywords: X,
|
|
58
|
+
itemLabelRender: Y,
|
|
59
|
+
itemRender: W,
|
|
60
|
+
inCombobox: Z,
|
|
61
|
+
onOpenChange: b,
|
|
60
62
|
classNames: {
|
|
61
63
|
item: r?.item,
|
|
62
64
|
itemIcon: r?.itemIcon,
|
|
@@ -65,111 +67,136 @@ const Ne = ({
|
|
|
65
67
|
groupLabel: r?.groupLabel,
|
|
66
68
|
divider: r?.divider
|
|
67
69
|
}
|
|
68
|
-
}), [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
70
|
+
}), [C, ee] = V(""), [oe, re] = V(
|
|
71
|
+
null
|
|
72
|
+
), v = O(null), x = O(!1), { currentSide: ne } = ue({
|
|
73
|
+
positionerRef: oe,
|
|
74
|
+
open: P,
|
|
75
|
+
initialSide: d.side,
|
|
76
|
+
initialAlign: d.align
|
|
77
|
+
}), s = ne === "top";
|
|
78
|
+
te(() => {
|
|
79
|
+
x.current && v.current && v.current.focus();
|
|
80
|
+
}, [s]);
|
|
81
|
+
const A = ie(() => {
|
|
82
|
+
if (!p)
|
|
83
|
+
return /* @__PURE__ */ c("div", { className: n("dropdown-menu-container"), children: [
|
|
84
|
+
g,
|
|
85
|
+
/* @__PURE__ */ e(_, { fadeEdges: !0, children: S.map(w) }),
|
|
86
|
+
h
|
|
87
|
+
] });
|
|
88
|
+
const o = /* @__PURE__ */ e(le.Provider, { value: {}, children: /* @__PURE__ */ e(
|
|
89
|
+
t.Input,
|
|
90
|
+
{
|
|
91
|
+
placeholder: l?.placeholder || "Search",
|
|
92
|
+
render: ({ ref: a, ...m }) => /* @__PURE__ */ e(
|
|
93
|
+
de,
|
|
94
|
+
{
|
|
95
|
+
...m,
|
|
96
|
+
ref: (i) => {
|
|
97
|
+
if (!i || !i.input) return;
|
|
98
|
+
a(i.input), v.current = i.input;
|
|
99
|
+
},
|
|
100
|
+
allowClear: !0,
|
|
101
|
+
placeholder: l?.placeholder || "Search",
|
|
102
|
+
value: C,
|
|
103
|
+
onChange: (i) => ee(i.target.value),
|
|
104
|
+
onFocus: () => {
|
|
105
|
+
x.current = !0;
|
|
106
|
+
},
|
|
107
|
+
onBlur: () => {
|
|
108
|
+
x.current = !1;
|
|
109
|
+
},
|
|
110
|
+
className: f(
|
|
111
|
+
n("dropdown-menu-search"),
|
|
112
|
+
l?.className
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
...l
|
|
117
|
+
},
|
|
118
|
+
"search"
|
|
119
|
+
) }), I = /* @__PURE__ */ c(_, { fadeEdges: !0, children: [
|
|
120
|
+
/* @__PURE__ */ e(t.Empty, { className: n("dropdown-menu-empty"), children: "No results found." }),
|
|
121
|
+
/* @__PURE__ */ e(t.List, { className: n("dropdown-menu-list"), children: (a, m) => w(a, m) })
|
|
122
|
+
] });
|
|
123
|
+
return /* @__PURE__ */ c("div", { className: n("dropdown-menu-container"), children: [
|
|
124
|
+
!s && o,
|
|
125
|
+
g,
|
|
126
|
+
I,
|
|
111
127
|
h,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
128
|
+
s && o
|
|
129
|
+
] });
|
|
130
|
+
}, [
|
|
131
|
+
p,
|
|
132
|
+
n,
|
|
133
|
+
l,
|
|
134
|
+
C,
|
|
135
|
+
g,
|
|
136
|
+
h,
|
|
137
|
+
S,
|
|
138
|
+
w,
|
|
139
|
+
s
|
|
140
|
+
]), D = {
|
|
141
|
+
ref: $,
|
|
142
|
+
// nativeButton: false,
|
|
143
|
+
openOnHover: H,
|
|
144
|
+
className: f(
|
|
123
145
|
n("dropdown-menu-trigger"),
|
|
124
146
|
r?.trigger,
|
|
125
|
-
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
147
|
+
T
|
|
148
|
+
),
|
|
149
|
+
render: (o, I) => {
|
|
150
|
+
const { openOnHover: a, ...m } = o;
|
|
151
|
+
return se(j, m, I);
|
|
152
|
+
}
|
|
153
|
+
}, E = {
|
|
154
|
+
ref: re,
|
|
155
|
+
side: d.side,
|
|
156
|
+
align: d.align,
|
|
130
157
|
sideOffset: 4,
|
|
131
|
-
className:
|
|
158
|
+
className: f(
|
|
132
159
|
n("dropdown-menu-root"),
|
|
133
|
-
|
|
160
|
+
T,
|
|
134
161
|
r?.root
|
|
135
162
|
),
|
|
136
|
-
collisionAvoidance:
|
|
137
|
-
render: (o) => /* @__PURE__ */ e(
|
|
138
|
-
},
|
|
139
|
-
className:
|
|
163
|
+
collisionAvoidance: pe,
|
|
164
|
+
render: (o) => /* @__PURE__ */ e(F.Root, { ...o })
|
|
165
|
+
}, M = {
|
|
166
|
+
className: f(
|
|
140
167
|
n(
|
|
141
168
|
"dropdown-menu",
|
|
142
|
-
|
|
143
|
-
|
|
169
|
+
y && "dropdown-menu-show-checkbox",
|
|
170
|
+
q && "dropdown-menu-match-trigger-width"
|
|
144
171
|
),
|
|
145
|
-
|
|
172
|
+
K,
|
|
146
173
|
r?.popup
|
|
147
174
|
),
|
|
148
175
|
style: {
|
|
149
|
-
"--size-width":
|
|
176
|
+
"--size-width": R in B ? B[R] : void 0
|
|
150
177
|
},
|
|
151
|
-
render: (o) => /* @__PURE__ */ e(
|
|
178
|
+
render: (o) => /* @__PURE__ */ e(F.Popup, { ...o })
|
|
152
179
|
};
|
|
153
|
-
return p ? /* @__PURE__ */
|
|
180
|
+
return p ? /* @__PURE__ */ c(
|
|
154
181
|
t.Root,
|
|
155
182
|
{
|
|
156
|
-
open:
|
|
157
|
-
onOpenChange:
|
|
158
|
-
items:
|
|
159
|
-
itemToStringLabel: (o) => o.type == "item" ?
|
|
183
|
+
open: P,
|
|
184
|
+
onOpenChange: b,
|
|
185
|
+
items: S,
|
|
186
|
+
itemToStringLabel: (o) => o.type == "item" ? he(o.label) : "",
|
|
160
187
|
itemToStringValue: (o) => o.type == "item" ? String(o.key) : "",
|
|
161
|
-
inputValue:
|
|
188
|
+
inputValue: C,
|
|
162
189
|
children: [
|
|
163
|
-
/* @__PURE__ */ e(t.Trigger, { ...
|
|
164
|
-
/* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(t.Positioner, { ...
|
|
190
|
+
/* @__PURE__ */ e(t.Trigger, { ...D }),
|
|
191
|
+
/* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(t.Positioner, { ...E, children: /* @__PURE__ */ e(t.Popup, { ...M, children: A() }) }) })
|
|
165
192
|
]
|
|
166
193
|
}
|
|
167
|
-
) : /* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */ e(
|
|
169
|
-
/* @__PURE__ */ e(
|
|
194
|
+
) : /* @__PURE__ */ c(u.Root, { open: P, onOpenChange: b, children: [
|
|
195
|
+
/* @__PURE__ */ e(u.Trigger, { ...D }),
|
|
196
|
+
/* @__PURE__ */ e(u.Portal, { children: /* @__PURE__ */ e(u.Positioner, { ...E, children: /* @__PURE__ */ e(u.Popup, { ...M, children: A() }) }) })
|
|
170
197
|
] });
|
|
171
198
|
};
|
|
172
199
|
export {
|
|
173
|
-
|
|
200
|
+
je as DropdownMenu
|
|
174
201
|
};
|
|
175
202
|
//# sourceMappingURL=component.js.map
|