@remember-web/primitive 0.5.1 → 0.5.2
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/src/Floating/DropdownMenu/index.cjs.js +20 -11
- package/dist/src/Floating/DropdownMenu/index.cjs.js.map +1 -1
- package/dist/src/Floating/DropdownMenu/index.d.ts +1 -1
- package/dist/src/Floating/DropdownMenu/index.d.ts.map +1 -1
- package/dist/src/Floating/DropdownMenu/index.esm.js +20 -11
- package/dist/src/Floating/DropdownMenu/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Floating/DropdownMenu/index.tsx +19 -12
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
5
|
var RadixPopover = require('@radix-ui/react-popover');
|
|
6
|
+
var react = require('react');
|
|
6
7
|
var styles = require('./styles.cjs.js');
|
|
7
8
|
var index = require('../Popover/index.cjs.js');
|
|
8
9
|
var DropdownMenuSection = require('./DropdownMenuSection.cjs.js');
|
|
@@ -40,22 +41,30 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
40
41
|
* @see Popover
|
|
41
42
|
*/
|
|
42
43
|
var DropdownMenu = Object.assign(RadixPopover__namespace.Root.bind(null), {
|
|
43
|
-
Content: function
|
|
44
|
-
var _props$
|
|
44
|
+
Content: /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
45
|
+
var _props$style2;
|
|
45
46
|
var _ref$isInsideCloseabl = _ref.isInsideCloseable,
|
|
46
47
|
isInsideCloseable = _ref$isInsideCloseabl === void 0 ? false : _ref$isInsideCloseabl,
|
|
47
48
|
props = _objectWithoutProperties__default.default(_ref, _excluded);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
children: /*#__PURE__*/jsxRuntime.jsx(styles.
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
if (isInsideCloseable) {
|
|
50
|
+
var _props$style;
|
|
51
|
+
return /*#__PURE__*/jsxRuntime.jsx(RadixPopover__namespace.Close, {
|
|
52
|
+
asChild: true,
|
|
53
|
+
children: /*#__PURE__*/jsxRuntime.jsx(styles.StyledDropdownMenuContentWrapper, {
|
|
54
|
+
$zIndex: (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.zIndex,
|
|
55
|
+
children: /*#__PURE__*/jsxRuntime.jsx(styles.StyledDropdownMenuContent, _objectSpread({
|
|
56
|
+
ref: ref
|
|
57
|
+
}, props))
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return /*#__PURE__*/jsxRuntime.jsx(styles.StyledDropdownMenuContentWrapper, {
|
|
55
62
|
$zIndex: (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.zIndex,
|
|
56
|
-
children: /*#__PURE__*/jsxRuntime.jsx(styles.StyledDropdownMenuContent, _objectSpread({
|
|
63
|
+
children: /*#__PURE__*/jsxRuntime.jsx(styles.StyledDropdownMenuContent, _objectSpread({
|
|
64
|
+
ref: ref
|
|
65
|
+
}, props))
|
|
57
66
|
});
|
|
58
|
-
},
|
|
67
|
+
}),
|
|
59
68
|
Arrow: index.Arrow,
|
|
60
69
|
Trigger: index.Trigger,
|
|
61
70
|
Portal: index.Portal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Floating/DropdownMenu/index.tsx"],"sourcesContent":["import * as RadixPopover from '@radix-ui/react-popover';\
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Floating/DropdownMenu/index.tsx"],"sourcesContent":["import * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef } from 'react';\nimport {\n StyledDropdownMenuContent,\n StyledDropdownMenuContentWrapper,\n StyledDropdownMenuItem,\n} from '@/Floating/DropdownMenu/styles';\nimport type { PopoverContentProps, PopoverProps } from '@/Floating/Popover';\nimport Popover from '@/Floating/Popover';\nimport { DropdownMenuSection } from './DropdownMenuSection';\n\nexport interface DropdownContentProps extends PopoverContentProps {}\nexport interface DropdownMenuProps extends PopoverProps {}\n/**\n * Popover에 DropdownMenu Parts들을 추가한 컴포넌트\n * @see Popover\n */\nconst DropdownMenu = Object.assign(RadixPopover.Root.bind(null), {\n Content: forwardRef<\n React.ElementRef<typeof StyledDropdownMenuContent>,\n DropdownContentProps\n >(({ isInsideCloseable = false, ...props }: DropdownContentProps, ref) => {\n if (isInsideCloseable) {\n return (\n <RadixPopover.Close asChild>\n <StyledDropdownMenuContentWrapper $zIndex={props.style?.zIndex}>\n <StyledDropdownMenuContent ref={ref} {...props} />\n </StyledDropdownMenuContentWrapper>\n </RadixPopover.Close>\n );\n }\n\n return (\n <StyledDropdownMenuContentWrapper $zIndex={props.style?.zIndex}>\n <StyledDropdownMenuContent ref={ref} {...props} />\n </StyledDropdownMenuContentWrapper>\n );\n }),\n Arrow: Popover.Arrow,\n Trigger: Popover.Trigger,\n Portal: Popover.Portal,\n Anchor: Popover.Anchor,\n Close: Popover.Close,\n Section: DropdownMenuSection,\n Item: StyledDropdownMenuItem,\n});\n\nexport default DropdownMenu;\n"],"names":["DropdownMenu","Object","assign","RadixPopover","Root","bind","Content","forwardRef","_ref","ref","_props$style2","_ref$isInsideCloseabl","isInsideCloseable","props","_objectWithoutProperties","_excluded","_props$style","_jsx","Close","asChild","children","StyledDropdownMenuContentWrapper","$zIndex","style","zIndex","StyledDropdownMenuContent","_objectSpread","Arrow","Popover","Trigger","Portal","Anchor","Section","DropdownMenuSection","Item","StyledDropdownMenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;AACA;AACA;AACA;AACA,IAAMA,YAAY,GAAGC,MAAM,CAACC,MAAM,CAACC,uBAAY,CAACC,IAAI,CAACC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC/DC,EAAAA,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,EAAEH,KAAO,CAACG,MAAM;EACtBb,KAAK,EAAEU,KAAO,CAACV,KAAK;AACpBc,EAAAA,OAAO,EAAEC,uCAAmB;AAC5BC,EAAAA,IAAI,EAAEC;AACR,CAAC;;;;"}
|
|
@@ -10,7 +10,7 @@ export interface DropdownMenuProps extends PopoverProps {
|
|
|
10
10
|
* @see Popover
|
|
11
11
|
*/
|
|
12
12
|
declare const DropdownMenu: import("react").FC<RadixPopover.PopoverProps> & {
|
|
13
|
-
Content: (
|
|
13
|
+
Content: import("react").ForwardRefExoticComponent<DropdownContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
14
|
Arrow: import("react").ForwardRefExoticComponent<RadixPopover.PopoverArrowProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
15
15
|
Trigger: (props: RadixPopover.PopoverTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
Portal: import("react").FC<RadixPopover.PopoverPortalProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Floating/DropdownMenu/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AAOxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Floating/DropdownMenu/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AAOxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;CAAG;AACpE,MAAM,WAAW,iBAAkB,SAAQ,YAAY;CAAG;AAC1D;;;GAGG;AACH,QAAA,MAAM,YAAY;;;;;;;;;;;;;CA4BhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import * as RadixPopover from '@radix-ui/react-popover';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
4
5
|
import { StyledDropdownMenuItem, StyledDropdownMenuContentWrapper, StyledDropdownMenuContent } from './styles.esm.js';
|
|
5
6
|
import Popover from '../Popover/index.esm.js';
|
|
6
7
|
import { DropdownMenuSection } from './DropdownMenuSection.esm.js';
|
|
@@ -14,22 +15,30 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
14
15
|
* @see Popover
|
|
15
16
|
*/
|
|
16
17
|
var DropdownMenu = Object.assign(RadixPopover.Root.bind(null), {
|
|
17
|
-
Content: function
|
|
18
|
-
var _props$
|
|
18
|
+
Content: /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
19
|
+
var _props$style2;
|
|
19
20
|
var _ref$isInsideCloseabl = _ref.isInsideCloseable,
|
|
20
21
|
isInsideCloseable = _ref$isInsideCloseabl === void 0 ? false : _ref$isInsideCloseabl,
|
|
21
22
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
children: /*#__PURE__*/jsx(
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
if (isInsideCloseable) {
|
|
24
|
+
var _props$style;
|
|
25
|
+
return /*#__PURE__*/jsx(RadixPopover.Close, {
|
|
26
|
+
asChild: true,
|
|
27
|
+
children: /*#__PURE__*/jsx(StyledDropdownMenuContentWrapper, {
|
|
28
|
+
$zIndex: (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.zIndex,
|
|
29
|
+
children: /*#__PURE__*/jsx(StyledDropdownMenuContent, _objectSpread({
|
|
30
|
+
ref: ref
|
|
31
|
+
}, props))
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/jsx(StyledDropdownMenuContentWrapper, {
|
|
29
36
|
$zIndex: (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.zIndex,
|
|
30
|
-
children: /*#__PURE__*/jsx(StyledDropdownMenuContent, _objectSpread({
|
|
37
|
+
children: /*#__PURE__*/jsx(StyledDropdownMenuContent, _objectSpread({
|
|
38
|
+
ref: ref
|
|
39
|
+
}, props))
|
|
31
40
|
});
|
|
32
|
-
},
|
|
41
|
+
}),
|
|
33
42
|
Arrow: Popover.Arrow,
|
|
34
43
|
Trigger: Popover.Trigger,
|
|
35
44
|
Portal: Popover.Portal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/Floating/DropdownMenu/index.tsx"],"sourcesContent":["import * as RadixPopover from '@radix-ui/react-popover';\
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/Floating/DropdownMenu/index.tsx"],"sourcesContent":["import * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef } from 'react';\nimport {\n StyledDropdownMenuContent,\n StyledDropdownMenuContentWrapper,\n StyledDropdownMenuItem,\n} from '@/Floating/DropdownMenu/styles';\nimport type { PopoverContentProps, PopoverProps } from '@/Floating/Popover';\nimport Popover from '@/Floating/Popover';\nimport { DropdownMenuSection } from './DropdownMenuSection';\n\nexport interface DropdownContentProps extends PopoverContentProps {}\nexport interface DropdownMenuProps extends PopoverProps {}\n/**\n * Popover에 DropdownMenu Parts들을 추가한 컴포넌트\n * @see Popover\n */\nconst DropdownMenu = Object.assign(RadixPopover.Root.bind(null), {\n Content: forwardRef<\n React.ElementRef<typeof StyledDropdownMenuContent>,\n DropdownContentProps\n >(({ isInsideCloseable = false, ...props }: DropdownContentProps, ref) => {\n if (isInsideCloseable) {\n return (\n <RadixPopover.Close asChild>\n <StyledDropdownMenuContentWrapper $zIndex={props.style?.zIndex}>\n <StyledDropdownMenuContent ref={ref} {...props} />\n </StyledDropdownMenuContentWrapper>\n </RadixPopover.Close>\n );\n }\n\n return (\n <StyledDropdownMenuContentWrapper $zIndex={props.style?.zIndex}>\n <StyledDropdownMenuContent ref={ref} {...props} />\n </StyledDropdownMenuContentWrapper>\n );\n }),\n Arrow: Popover.Arrow,\n Trigger: Popover.Trigger,\n Portal: Popover.Portal,\n Anchor: Popover.Anchor,\n Close: Popover.Close,\n Section: DropdownMenuSection,\n Item: StyledDropdownMenuItem,\n});\n\nexport default DropdownMenu;\n"],"names":["DropdownMenu","Object","assign","RadixPopover","Root","bind","Content","forwardRef","_ref","ref","_props$style2","_ref$isInsideCloseabl","isInsideCloseable","props","_objectWithoutProperties","_excluded","_props$style","_jsx","Close","asChild","children","StyledDropdownMenuContentWrapper","$zIndex","style","zIndex","StyledDropdownMenuContent","_objectSpread","Arrow","Popover","Trigger","Portal","Anchor","Section","DropdownMenuSection","Item","StyledDropdownMenuItem"],"mappings":";;;;;;;;;;;;AAaA;AACA;AACA;AACA;AACA,IAAMA,YAAY,GAAGC,MAAM,CAACC,MAAM,CAACC,YAAY,CAACC,IAAI,CAACC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC/DC,EAAAA,OAAO,eAAEC,UAAU,CAGjB,UAAAC,IAAA,EAAgEC,GAAG,EAAK;AAAA,IAAA,IAAAC,aAAA;AAAA,IAAA,IAAAC,qBAAA,GAAAH,IAAA,CAArEI,iBAAiB;AAAjBA,MAAAA,iBAAiB,GAAAD,qBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,qBAAA;AAAKE,MAAAA,KAAK,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AACtC,IAAA,IAAIH,iBAAiB,EAAE;AAAA,MAAA,IAAAI,YAAA;AACrB,MAAA,oBACEC,GAAA,CAACd,YAAY,CAACe,KAAK,EAAA;QAACC,OAAO,EAAA,IAAA;QAAAC,QAAA,eACzBH,GAAA,CAACI,gCAAgC,EAAA;UAACC,OAAO,EAAA,CAAAN,YAAA,GAAEH,KAAK,CAACU,KAAK,MAAA,IAAA,IAAAP,YAAA,KAAA,MAAA,GAAA,MAAA,GAAXA,YAAA,CAAaQ,MAAO;AAAAJ,UAAAA,QAAA,eAC7DH,GAAA,CAACQ,yBAAyB,EAAAC,aAAA,CAAA;AAACjB,YAAAA,GAAG,EAAEA;AAAI,WAAA,EAAKI,KAAK,CAAG;SACjB;AAAC,OACjB,CAAC;AAEzB;IAEA,oBACEI,GAAA,CAACI,gCAAgC,EAAA;MAACC,OAAO,EAAA,CAAAZ,aAAA,GAAEG,KAAK,CAACU,KAAK,MAAA,IAAA,IAAAb,aAAA,KAAA,MAAA,GAAA,MAAA,GAAXA,aAAA,CAAac,MAAO;AAAAJ,MAAAA,QAAA,eAC7DH,GAAA,CAACQ,yBAAyB,EAAAC,aAAA,CAAA;AAACjB,QAAAA,GAAG,EAAEA;AAAI,OAAA,EAAKI,KAAK,CAAG;AAAC,KAClB,CAAC;AAEvC,GAAC,CAAC;EACFc,KAAK,EAAEC,OAAO,CAACD,KAAK;EACpBE,OAAO,EAAED,OAAO,CAACC,OAAO;EACxBC,MAAM,EAAEF,OAAO,CAACE,MAAM;EACtBC,MAAM,EAAEH,OAAO,CAACG,MAAM;EACtBb,KAAK,EAAEU,OAAO,CAACV,KAAK;AACpBc,EAAAA,OAAO,EAAEC,mBAAmB;AAC5BC,EAAAA,IAAI,EAAEC;AACR,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as RadixPopover from '@radix-ui/react-popover';
|
|
2
|
-
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
StyledDropdownMenuContent,
|
|
5
5
|
StyledDropdownMenuContentWrapper,
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
} from '@/Floating/DropdownMenu/styles';
|
|
8
8
|
import type { PopoverContentProps, PopoverProps } from '@/Floating/Popover';
|
|
9
9
|
import Popover from '@/Floating/Popover';
|
|
10
|
-
|
|
11
10
|
import { DropdownMenuSection } from './DropdownMenuSection';
|
|
12
11
|
|
|
13
12
|
export interface DropdownContentProps extends PopoverContentProps {}
|
|
@@ -17,18 +16,26 @@ export interface DropdownMenuProps extends PopoverProps {}
|
|
|
17
16
|
* @see Popover
|
|
18
17
|
*/
|
|
19
18
|
const DropdownMenu = Object.assign(RadixPopover.Root.bind(null), {
|
|
20
|
-
Content:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
Content: forwardRef<
|
|
20
|
+
React.ElementRef<typeof StyledDropdownMenuContent>,
|
|
21
|
+
DropdownContentProps
|
|
22
|
+
>(({ isInsideCloseable = false, ...props }: DropdownContentProps, ref) => {
|
|
23
|
+
if (isInsideCloseable) {
|
|
24
|
+
return (
|
|
25
|
+
<RadixPopover.Close asChild>
|
|
26
|
+
<StyledDropdownMenuContentWrapper $zIndex={props.style?.zIndex}>
|
|
27
|
+
<StyledDropdownMenuContent ref={ref} {...props} />
|
|
28
|
+
</StyledDropdownMenuContentWrapper>
|
|
29
|
+
</RadixPopover.Close>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
28
34
|
<StyledDropdownMenuContentWrapper $zIndex={props.style?.zIndex}>
|
|
29
|
-
<StyledDropdownMenuContent {...props} />
|
|
35
|
+
<StyledDropdownMenuContent ref={ref} {...props} />
|
|
30
36
|
</StyledDropdownMenuContentWrapper>
|
|
31
|
-
)
|
|
37
|
+
);
|
|
38
|
+
}),
|
|
32
39
|
Arrow: Popover.Arrow,
|
|
33
40
|
Trigger: Popover.Trigger,
|
|
34
41
|
Portal: Popover.Portal,
|