@a-type/ui 4.1.2 → 4.1.4
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/cjs/components/collapsible/Collapsible.js +1 -1
- package/dist/cjs/components/collapsible/Collapsible.js.map +1 -1
- package/dist/cjs/components/contextMenu/contextMenu.js +2 -2
- package/dist/cjs/components/contextMenu/contextMenu.js.map +1 -1
- package/dist/cjs/components/dialog/Dialog.js +3 -3
- package/dist/cjs/components/dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/quickAction/QuickAction.d.ts +9 -6
- package/dist/cjs/components/quickAction/QuickAction.js +45 -25
- package/dist/cjs/components/quickAction/QuickAction.js.map +1 -1
- package/dist/cjs/components/select/Select.js +3 -3
- package/dist/cjs/components/tooltip/Tooltip.js +1 -1
- package/dist/cjs/components/tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/systems/ValueMonitor.d.ts +8 -0
- package/dist/cjs/systems/ValueMonitor.js +40 -0
- package/dist/cjs/systems/ValueMonitor.js.map +1 -0
- package/dist/cjs/uno/rules/clipPath.d.ts +2 -0
- package/dist/cjs/uno/rules/clipPath.js +49 -0
- package/dist/cjs/uno/rules/clipPath.js.map +1 -0
- package/dist/cjs/uno/rules/index.js +2 -0
- package/dist/cjs/uno/rules/index.js.map +1 -1
- package/dist/cjs/uno/variants/baseUi.d.ts +2 -0
- package/dist/cjs/uno/variants/baseUi.js +16 -0
- package/dist/cjs/uno/variants/baseUi.js.map +1 -0
- package/dist/cjs/uno/variants/index.js +2 -0
- package/dist/cjs/uno/variants/index.js.map +1 -1
- package/dist/css/main.css +5 -5
- package/dist/esm/components/collapsible/Collapsible.js +1 -1
- package/dist/esm/components/collapsible/Collapsible.js.map +1 -1
- package/dist/esm/components/contextMenu/contextMenu.js +2 -2
- package/dist/esm/components/contextMenu/contextMenu.js.map +1 -1
- package/dist/esm/components/dialog/Dialog.js +3 -3
- package/dist/esm/components/dialog/Dialog.js.map +1 -1
- package/dist/esm/components/quickAction/QuickAction.d.ts +9 -6
- package/dist/esm/components/quickAction/QuickAction.js +41 -21
- package/dist/esm/components/quickAction/QuickAction.js.map +1 -1
- package/dist/esm/components/select/Select.js +3 -3
- package/dist/esm/components/tooltip/Tooltip.js +1 -1
- package/dist/esm/components/tooltip/Tooltip.js.map +1 -1
- package/dist/esm/systems/ValueMonitor.d.ts +8 -0
- package/dist/esm/systems/ValueMonitor.js +34 -0
- package/dist/esm/systems/ValueMonitor.js.map +1 -0
- package/dist/esm/uno/rules/clipPath.d.ts +2 -0
- package/dist/esm/uno/rules/clipPath.js +46 -0
- package/dist/esm/uno/rules/clipPath.js.map +1 -0
- package/dist/esm/uno/rules/index.js +2 -0
- package/dist/esm/uno/rules/index.js.map +1 -1
- package/dist/esm/uno/variants/baseUi.d.ts +2 -0
- package/dist/esm/uno/variants/baseUi.js +13 -0
- package/dist/esm/uno/variants/baseUi.js.map +1 -0
- package/dist/esm/uno/variants/index.js +2 -0
- package/dist/esm/uno/variants/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/collapsible/Collapsible.tsx +71 -74
- package/src/components/contextMenu/contextMenu.tsx +66 -67
- package/src/components/dialog/Dialog.tsx +3 -6
- package/src/components/quickAction/QuickAction.tsx +77 -42
- package/src/components/select/Select.tsx +241 -241
- package/src/components/tooltip/Tooltip.tsx +134 -135
- package/src/systems/ValueMonitor.ts +41 -0
- package/src/uno/rules/clipPath.ts +44 -0
- package/src/uno/rules/index.ts +2 -0
- package/src/uno/variants/baseUi.ts +13 -0
- package/src/uno/variants/index.ts +3 -0
|
@@ -1,74 +1,71 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import {
|
|
3
|
-
Collapsible as BaseCollapsible,
|
|
4
|
-
CollapsiblePanelProps,
|
|
5
|
-
CollapsibleRootProps,
|
|
6
|
-
} from '@base-ui/react/collapsible';
|
|
7
|
-
import { Ref } from 'react';
|
|
8
|
-
import { withClassName } from '../../hooks/withClassName.js';
|
|
9
|
-
|
|
10
|
-
export const CollapsibleRoot = BaseCollapsible.Root;
|
|
11
|
-
const CollapsibleContentBase = withClassName(
|
|
12
|
-
BaseCollapsible.Panel,
|
|
13
|
-
'overflow-hidden transition-all',
|
|
14
|
-
'data-[
|
|
15
|
-
'data-[both]:(h-[--collapsible-panel-height] w-[--collapsible-panel-width])',
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'data-[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Simple: CollapsibleSimple,
|
|
73
|
-
Icon: CollapsibleIcon,
|
|
74
|
-
});
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
Collapsible as BaseCollapsible,
|
|
4
|
+
CollapsiblePanelProps,
|
|
5
|
+
CollapsibleRootProps,
|
|
6
|
+
} from '@base-ui/react/collapsible';
|
|
7
|
+
import { Ref } from 'react';
|
|
8
|
+
import { withClassName } from '../../hooks/withClassName.js';
|
|
9
|
+
|
|
10
|
+
export const CollapsibleRoot = BaseCollapsible.Root;
|
|
11
|
+
const CollapsibleContentBase = withClassName(
|
|
12
|
+
BaseCollapsible.Panel,
|
|
13
|
+
'overflow-hidden transition-all',
|
|
14
|
+
'data-[horizontal]:w-[--collapsible-panel-width] data-[vertical]:h-[--collapsible-panel-height]',
|
|
15
|
+
'data-[both]:(h-[--collapsible-panel-height] w-[--collapsible-panel-width])',
|
|
16
|
+
'start-end:data-[vertical]:(h-0)',
|
|
17
|
+
'start-end:data-[both]:(h-0 w-0)',
|
|
18
|
+
'start-end:data-[horizontal]:(w-0)',
|
|
19
|
+
'data-[hidden]:[&:not([hidden="until-found"])]:(hidden)',
|
|
20
|
+
);
|
|
21
|
+
// specifically removing className... it's causing problems?
|
|
22
|
+
export const CollapsibleContent = function CollapsibleContent({
|
|
23
|
+
ref,
|
|
24
|
+
horizontal,
|
|
25
|
+
both,
|
|
26
|
+
...props
|
|
27
|
+
}: CollapsiblePanelProps & {
|
|
28
|
+
horizontal?: boolean;
|
|
29
|
+
both?: boolean;
|
|
30
|
+
ref?: Ref<HTMLDivElement>;
|
|
31
|
+
}) {
|
|
32
|
+
const extraProps: any = {};
|
|
33
|
+
if (horizontal) {
|
|
34
|
+
extraProps['data-horizontal'] = true;
|
|
35
|
+
} else if (both) {
|
|
36
|
+
extraProps['data-both'] = true;
|
|
37
|
+
} else {
|
|
38
|
+
extraProps['data-vertical'] = true;
|
|
39
|
+
}
|
|
40
|
+
return <CollapsibleContentBase {...extraProps} {...props} ref={ref} />;
|
|
41
|
+
};
|
|
42
|
+
export const CollapsibleTrigger = BaseCollapsible.Trigger;
|
|
43
|
+
|
|
44
|
+
export const CollapsibleSimple = ({
|
|
45
|
+
horizontal,
|
|
46
|
+
both,
|
|
47
|
+
children,
|
|
48
|
+
...props
|
|
49
|
+
}: CollapsibleRootProps & {
|
|
50
|
+
horizontal?: boolean;
|
|
51
|
+
both?: boolean;
|
|
52
|
+
}) => (
|
|
53
|
+
<CollapsibleRoot {...props}>
|
|
54
|
+
<CollapsibleContent horizontal={horizontal} both={both}>
|
|
55
|
+
{children}
|
|
56
|
+
</CollapsibleContent>
|
|
57
|
+
</CollapsibleRoot>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export const CollapsibleIcon = withClassName(
|
|
61
|
+
'span',
|
|
62
|
+
'layer-components:transition-transform',
|
|
63
|
+
'layer-components:[[data-panel-open]_&]:rotate-180',
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export const Collapsible = Object.assign(CollapsibleRoot, {
|
|
67
|
+
Content: CollapsibleContent,
|
|
68
|
+
Trigger: CollapsibleTrigger,
|
|
69
|
+
Simple: CollapsibleSimple,
|
|
70
|
+
Icon: CollapsibleIcon,
|
|
71
|
+
});
|
|
@@ -1,67 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ContextMenu as BaseContextMenu,
|
|
3
|
-
ContextMenuPopupProps,
|
|
4
|
-
} from '@base-ui/react/context-menu';
|
|
5
|
-
import classNames from 'clsx';
|
|
6
|
-
import { withClassName } from '../../hooks/withClassName.js';
|
|
7
|
-
import { GroupScaleReset } from '../../systems/GroupScale.js';
|
|
8
|
-
|
|
9
|
-
export const ContextMenuRoot = BaseContextMenu.Root;
|
|
10
|
-
|
|
11
|
-
export const ContextMenuContent = function Content({
|
|
12
|
-
ref,
|
|
13
|
-
className,
|
|
14
|
-
onClick,
|
|
15
|
-
...props
|
|
16
|
-
}: ContextMenuPopupProps & {
|
|
17
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
18
|
-
}) {
|
|
19
|
-
return (
|
|
20
|
-
<BaseContextMenu.Portal>
|
|
21
|
-
<BaseContextMenu.Positioner alignOffset={-10}>
|
|
22
|
-
<GroupScaleReset>
|
|
23
|
-
<BaseContextMenu.Popup
|
|
24
|
-
className={classNames(
|
|
25
|
-
'layer-components:(z-menu min-w-120px overflow-hidden border rounded-md shadow-md bg-white border-gray-dark)',
|
|
26
|
-
'layer-components:transform-origin-[var(--transform-origin)]',
|
|
27
|
-
'layer-components:
|
|
28
|
-
'layer-components:
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
ev
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
'
|
|
55
|
-
'layer-components:
|
|
56
|
-
'layer-components:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
});
|
|
1
|
+
import {
|
|
2
|
+
ContextMenu as BaseContextMenu,
|
|
3
|
+
ContextMenuPopupProps,
|
|
4
|
+
} from '@base-ui/react/context-menu';
|
|
5
|
+
import classNames from 'clsx';
|
|
6
|
+
import { withClassName } from '../../hooks/withClassName.js';
|
|
7
|
+
import { GroupScaleReset } from '../../systems/GroupScale.js';
|
|
8
|
+
|
|
9
|
+
export const ContextMenuRoot = BaseContextMenu.Root;
|
|
10
|
+
|
|
11
|
+
export const ContextMenuContent = function Content({
|
|
12
|
+
ref,
|
|
13
|
+
className,
|
|
14
|
+
onClick,
|
|
15
|
+
...props
|
|
16
|
+
}: ContextMenuPopupProps & {
|
|
17
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
18
|
+
}) {
|
|
19
|
+
return (
|
|
20
|
+
<BaseContextMenu.Portal>
|
|
21
|
+
<BaseContextMenu.Positioner alignOffset={-10}>
|
|
22
|
+
<GroupScaleReset>
|
|
23
|
+
<BaseContextMenu.Popup
|
|
24
|
+
className={classNames(
|
|
25
|
+
'layer-components:(z-menu min-w-120px overflow-hidden border rounded-md shadow-md bg-white border-gray-dark)',
|
|
26
|
+
'layer-components:transform-origin-[var(--transform-origin)]',
|
|
27
|
+
'layer-components:start-end:(scale-95 opacity-0)',
|
|
28
|
+
'layer-components:(overflow-y-auto overflow-unstable)',
|
|
29
|
+
'important:motion-reduce:animate-none',
|
|
30
|
+
'layer-components:(max-h-[--available-height] max-w-[--available-width])',
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
onClick={(ev) => {
|
|
34
|
+
ev.stopPropagation();
|
|
35
|
+
onClick?.(ev);
|
|
36
|
+
}}
|
|
37
|
+
ref={ref}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
</GroupScaleReset>
|
|
41
|
+
</BaseContextMenu.Positioner>
|
|
42
|
+
</BaseContextMenu.Portal>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const ContextMenuArrow = withClassName(
|
|
47
|
+
BaseContextMenu.Arrow,
|
|
48
|
+
'layer-components:arrow',
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export const ContextMenuItem = withClassName(
|
|
52
|
+
BaseContextMenu.Item,
|
|
53
|
+
'palette-gray',
|
|
54
|
+
'layer-components:(relative min-h-touch-large flex cursor-pointer select-none items-center overflow-hidden px-2 py-sm pl-25px outline-none)',
|
|
55
|
+
'layer-components:[&[data-highlighted=true]]:bg-main-light layer-components:hover:bg-main-light',
|
|
56
|
+
'layer-components:disabled:cursor-default) layer-components:[&[data-disabled=true]]:(cursor-default opacity-50) layer-components:disabled:(opacity-50)',
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
export const ContextMenuTrigger = withClassName(BaseContextMenu.Trigger, '');
|
|
60
|
+
|
|
61
|
+
export const ContextMenu = Object.assign(ContextMenuRoot, {
|
|
62
|
+
Content: ContextMenuContent,
|
|
63
|
+
Arrow: ContextMenuArrow,
|
|
64
|
+
Item: ContextMenuItem,
|
|
65
|
+
Trigger: ContextMenuTrigger,
|
|
66
|
+
});
|
|
@@ -34,8 +34,7 @@ const StyledOverlay = withClassName(
|
|
|
34
34
|
BaseDialog.Backdrop,
|
|
35
35
|
'layer-components:border-top-1 layer-components:border-top-solid layer-components:border-top-gray layer-components:(fixed inset-0 shadow-[0_30px_60px_0px] shadow-black/20 shadow-inset transition bg-black/15)',
|
|
36
36
|
'layer-components:backdrop-blur-sm',
|
|
37
|
-
'
|
|
38
|
-
'data-[ending-style]:(opacity-0)',
|
|
37
|
+
'start-end:opacity-0',
|
|
39
38
|
);
|
|
40
39
|
|
|
41
40
|
const StyledContent = withClassName(
|
|
@@ -45,15 +44,13 @@ const StyledContent = withClassName(
|
|
|
45
44
|
'transform-gpu',
|
|
46
45
|
'layer-components:(left-50% top-50% max-h-85vh max-w-450px w-90vw translate-[-50%] border-b-1 rounded-lg)',
|
|
47
46
|
|
|
48
|
-
'
|
|
49
|
-
'data-[ending-style]:layer-components:(scale-95 opacity-0)',
|
|
47
|
+
'layer-components:start-end:scale-95 layer-components:start-end:opacity-0',
|
|
50
48
|
);
|
|
51
49
|
const sheetClassNames = clsx(
|
|
52
50
|
'layer-variants:lt-sm:(left-0 right-0 top-auto h-min-content max-w-none w-screen translate-0 border-b-0 rounded-b-0 rounded-tl-xl rounded-tr-xl pt-lg shadow-up)',
|
|
53
51
|
'layer-variants:lt-sm:pb-[calc(env(safe-area-inset-bottom,0px))]',
|
|
54
52
|
|
|
55
|
-
'
|
|
56
|
-
'data-[ending-style]:layer-variants:lt-sm:(translate-y-full opacity-0)',
|
|
53
|
+
'layer-variants:start-end:lt-sm:(translate-y-full opacity-0)',
|
|
57
54
|
);
|
|
58
55
|
const sheetClassNameWithOverlayKeyboard = clsx(
|
|
59
56
|
'layer-variants:lt-sm:bottom-[calc(var(--mock-virtual-keyboard-height,env(keyboard-inset-height,0px))+var(--gesture-y,0px))]',
|
|
@@ -1,44 +1,59 @@
|
|
|
1
|
-
import { Dialog } from '@base-ui/react/dialog';
|
|
1
|
+
import { Dialog, DialogRootProps } from '@base-ui/react/dialog';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { createContext, RefObject, useContext, useId, useRef } from 'react';
|
|
4
|
+
import { useSize } from '../../hooks.js';
|
|
5
|
+
import useMergedRef from '../../hooks/useMergedRef.js';
|
|
6
|
+
import {
|
|
7
|
+
useMonitor,
|
|
8
|
+
useValueMonitor,
|
|
9
|
+
ValueMonitor,
|
|
10
|
+
} from '../../systems/ValueMonitor.js';
|
|
5
11
|
import { Button, ButtonProps } from '../button/Button.js';
|
|
6
12
|
|
|
7
13
|
const QuickActionIdContext = createContext<string>('qab');
|
|
8
14
|
|
|
15
|
+
const TriggerSizeContext = createContext<
|
|
16
|
+
ValueMonitor<{ width: number; height: number }>
|
|
17
|
+
>(new ValueMonitor({ width: 0, height: 0 }));
|
|
18
|
+
|
|
9
19
|
export const QuickActionRoot = ({
|
|
10
20
|
children,
|
|
11
|
-
|
|
12
|
-
|
|
21
|
+
...props
|
|
22
|
+
}: Omit<DialogRootProps, 'children'> & {
|
|
23
|
+
children?: React.ReactNode;
|
|
13
24
|
}) => {
|
|
14
25
|
const id = useId();
|
|
26
|
+
const triggerSizeMonitor = useValueMonitor({ width: 0, height: 0 });
|
|
15
27
|
return (
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
<TriggerSizeContext.Provider value={triggerSizeMonitor}>
|
|
29
|
+
<Dialog.Root {...props}>
|
|
30
|
+
<QuickActionIdContext.Provider value={id.replace(/:/g, '')}>
|
|
31
|
+
{children}
|
|
32
|
+
</QuickActionIdContext.Provider>
|
|
33
|
+
</Dialog.Root>
|
|
34
|
+
</TriggerSizeContext.Provider>
|
|
21
35
|
);
|
|
22
36
|
};
|
|
23
37
|
|
|
24
|
-
const transition: Transition = {
|
|
25
|
-
type: 'spring',
|
|
26
|
-
damping: 25,
|
|
27
|
-
stiffness: 300,
|
|
28
|
-
mass: 0.5,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
38
|
export type QuickActionTriggerProps = ButtonProps;
|
|
32
39
|
const QuickActionTrigger = ({
|
|
33
40
|
className,
|
|
34
41
|
emphasis = 'primary',
|
|
35
42
|
children,
|
|
43
|
+
ref,
|
|
36
44
|
...props
|
|
37
45
|
}: QuickActionTriggerProps) => {
|
|
38
46
|
const layoutId = useContext(QuickActionIdContext);
|
|
47
|
+
const sizeMonitor = useContext(TriggerSizeContext);
|
|
48
|
+
const measureRef = useSize((size) => {
|
|
49
|
+
console.log('measure size', size);
|
|
50
|
+
sizeMonitor.set(size);
|
|
51
|
+
});
|
|
52
|
+
const finalRef = useMergedRef(ref, measureRef);
|
|
39
53
|
return (
|
|
40
54
|
<Dialog.Trigger
|
|
41
55
|
{...props}
|
|
56
|
+
ref={finalRef}
|
|
42
57
|
render={({ color: _, ...composed }) => (
|
|
43
58
|
<Button
|
|
44
59
|
color={props.color}
|
|
@@ -64,39 +79,59 @@ interface QuickActionContentProps {
|
|
|
64
79
|
children?: React.ReactNode;
|
|
65
80
|
className?: string;
|
|
66
81
|
align?: 'center' | 'start' | 'end';
|
|
82
|
+
ref?: RefObject<HTMLDivElement>;
|
|
67
83
|
}
|
|
68
84
|
const QuickActionContent = ({
|
|
69
85
|
children,
|
|
70
86
|
className,
|
|
71
87
|
align = 'center',
|
|
88
|
+
ref,
|
|
72
89
|
}: QuickActionContentProps) => {
|
|
90
|
+
const innerRef = useRef<HTMLDivElement>(null);
|
|
91
|
+
const finalRef = useMergedRef(innerRef, ref);
|
|
73
92
|
const layoutId = useContext(QuickActionIdContext);
|
|
93
|
+
const triggerSizeMonitor = useContext(TriggerSizeContext);
|
|
94
|
+
useMonitor(triggerSizeMonitor, (size) => {
|
|
95
|
+
if (innerRef.current) {
|
|
96
|
+
const style = innerRef.current.style;
|
|
97
|
+
style.setProperty('--trigger-width', `${size.width}px`);
|
|
98
|
+
style.setProperty('--trigger-height', `${size.height}px`);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
74
102
|
return (
|
|
75
|
-
<Dialog.Portal>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
'
|
|
88
|
-
|
|
89
|
-
'
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
<Dialog.Portal keepMounted>
|
|
104
|
+
<Dialog.Popup
|
|
105
|
+
ref={finalRef}
|
|
106
|
+
className={clsx(
|
|
107
|
+
'layer-components:(contain-layout border-1 rounded-md border-solid shadow-lg transition-all transition-ease-out bg-white border-black clip-inset-[-50px]-[-50px]-[-50px]-[-50px])',
|
|
108
|
+
'layer-components:(fixed bottom-[anchor(bottom)] overflow-clip)',
|
|
109
|
+
{
|
|
110
|
+
'[justify-self:anchor-center]': align === 'center',
|
|
111
|
+
'left-[anchor(left)]': align === 'start',
|
|
112
|
+
'right-[anchor(right)]': align === 'end',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
'start-end:clip-inset-[calc(100%_-_var(--trigger-height))]-[calc((100%_-_var(--trigger-width))/2)]-[0]-[calc((100%_-_var(--trigger-width))/2)]-[round]-[200px]':
|
|
116
|
+
align === 'center',
|
|
117
|
+
'start-end:clip-inset-[calc(100%_-_var(--trigger-height))]-[calc(100%_-_var(--trigger-width))]-[0]-[0]-[round]-[200px]':
|
|
118
|
+
align === 'start',
|
|
119
|
+
'start-end:clip-inset-[calc(100%_-_var(--trigger-height))]-[0]-[0]-[calc(100%_-_var(--trigger-width))]-[round]-[200px]':
|
|
120
|
+
align === 'end',
|
|
121
|
+
},
|
|
122
|
+
'data-[ending-style]:opacity-0',
|
|
123
|
+
className,
|
|
124
|
+
)}
|
|
125
|
+
style={
|
|
126
|
+
{
|
|
127
|
+
positionAnchor: `--${layoutId}`,
|
|
128
|
+
'--trigger-width': triggerSizeMonitor.get().width + 'px',
|
|
129
|
+
'--trigger-height': triggerSizeMonitor.get().height + 'px',
|
|
130
|
+
} as any
|
|
131
|
+
}
|
|
132
|
+
>
|
|
133
|
+
{children}
|
|
134
|
+
</Dialog.Popup>
|
|
100
135
|
</Dialog.Portal>
|
|
101
136
|
);
|
|
102
137
|
};
|