@wordpress/components 25.12.0 → 25.13.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/CHANGELOG.md +28 -0
- package/build/angle-picker-control/index.js +0 -1
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/custom-select-control-v2/index.js +87 -0
- package/build/custom-select-control-v2/index.js.map +1 -0
- package/build/custom-select-control-v2/styles.js +85 -0
- package/build/custom-select-control-v2/styles.js.map +1 -0
- package/build/custom-select-control-v2/types.js +6 -0
- package/build/custom-select-control-v2/types.js.map +1 -0
- package/build/dropdown-menu-v2-ariakit/index.js +49 -20
- package/build/dropdown-menu-v2-ariakit/index.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/styles.js +82 -59
- package/build/dropdown-menu-v2-ariakit/styles.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/types.js.map +1 -1
- package/build/form-token-field/index.js +6 -2
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/types.js.map +1 -1
- package/build/heading/hook.js +6 -3
- package/build/heading/hook.js.map +1 -1
- package/build/heading/types.js.map +1 -1
- package/build/mobile/utils/alignments.native.js +1 -1
- package/build/mobile/utils/alignments.native.js.map +1 -1
- package/build/private-apis.js +3 -2
- package/build/private-apis.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/tabs/index.js +6 -4
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/tab.js +2 -2
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tabpanel.js +1 -1
- package/build/tabs/tabpanel.js.map +1 -1
- package/build/text/types.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +5 -1
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/angle-picker-control/index.js +0 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/index.js +74 -0
- package/build-module/custom-select-control-v2/index.js.map +1 -0
- package/build-module/custom-select-control-v2/styles.js +71 -0
- package/build-module/custom-select-control-v2/styles.js.map +1 -0
- package/build-module/custom-select-control-v2/types.js +2 -0
- package/build-module/custom-select-control-v2/types.js.map +1 -0
- package/build-module/dropdown-menu-v2-ariakit/index.js +46 -18
- package/build-module/dropdown-menu-v2-ariakit/index.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/styles.js +69 -40
- package/build-module/dropdown-menu-v2-ariakit/styles.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/types.js.map +1 -1
- package/build-module/form-token-field/index.js +6 -2
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/types.js.map +1 -1
- package/build-module/heading/hook.js +6 -3
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/heading/types.js.map +1 -1
- package/build-module/mobile/utils/alignments.native.js +1 -1
- package/build-module/mobile/utils/alignments.native.js.map +1 -1
- package/build-module/private-apis.js +4 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/tabs/index.js +7 -5
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/tab.js +4 -4
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tabpanel.js +3 -3
- package/build-module/tabs/tabpanel.js.map +1 -1
- package/build-module/text/types.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +6 -2
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-style/style-rtl.css +31 -5
- package/build-style/style.css +31 -5
- package/build-types/angle-picker-control/index.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +1944 -0
- package/build-types/box-control/stories/index.story.d.ts.map +1 -0
- package/build-types/color-palette/styles.d.ts +4 -1
- package/build-types/color-palette/styles.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/index.d.ts +6 -0
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +19 -0
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/styles.d.ts +47 -0
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/types.d.ts +57 -0
- package/build-types/custom-select-control-v2/types.d.ts.map +1 -0
- package/build-types/date-time/date/styles.d.ts +4 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts +11 -2
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts +26 -18
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts +0 -6
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/token-input.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +1 -1
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/heading/component.d.ts +4 -1
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/heading/types.d.ts +20 -1
- package/build-types/heading/types.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +4 -1
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +4 -1
- package/build-types/palette-edit/styles.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
- package/build-types/slot-fill/types.d.ts +16 -6
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts +1 -0
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/text/types.d.ts +15 -2
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/angle-picker-control/index.tsx +0 -1
- package/src/box-control/stories/index.story.tsx +82 -0
- package/src/button/style.scss +10 -2
- package/src/combobox-control/README.md +1 -3
- package/src/custom-select-control-v2/README.md +73 -0
- package/src/custom-select-control-v2/index.tsx +99 -0
- package/src/custom-select-control-v2/stories/index.story.tsx +149 -0
- package/src/custom-select-control-v2/styles.ts +76 -0
- package/src/custom-select-control-v2/types.ts +63 -0
- package/src/dropdown-menu-v2-ariakit/README.md +19 -5
- package/src/dropdown-menu-v2-ariakit/index.tsx +85 -36
- package/src/dropdown-menu-v2-ariakit/stories/index.story.tsx +204 -90
- package/src/dropdown-menu-v2-ariakit/styles.ts +153 -117
- package/src/dropdown-menu-v2-ariakit/test/index.tsx +5 -10
- package/src/dropdown-menu-v2-ariakit/types.ts +0 -7
- package/src/form-toggle/style.scss +37 -7
- package/src/form-token-field/index.tsx +11 -3
- package/src/form-token-field/token-input.tsx +1 -3
- package/src/form-token-field/types.ts +1 -0
- package/src/heading/README.md +6 -1
- package/src/heading/hook.ts +6 -3
- package/src/heading/types.ts +23 -1
- package/src/mobile/utils/alignments.native.js +1 -0
- package/src/navigable-container/README.md +1 -1
- package/src/private-apis.ts +4 -2
- package/src/slot-fill/README.md +1 -1
- package/src/slot-fill/types.ts +18 -6
- package/src/tabs/index.tsx +12 -2
- package/src/tabs/stories/index.story.tsx +8 -0
- package/src/tabs/tab.tsx +4 -4
- package/src/tabs/tabpanel.tsx +3 -3
- package/src/tabs/test/index.tsx +19 -0
- package/src/text/README.md +5 -1
- package/src/text/types.ts +15 -2
- package/src/toggle-control/README.md +2 -2
- package/src/tools-panel/tools-panel-item/hook.ts +11 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/src/box-control/stories/index.story.js +0 -75
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 25.13.0 (2023-11-29)
|
|
6
|
+
|
|
7
|
+
### Enhancements
|
|
8
|
+
|
|
9
|
+
- `FormToggle`: refine animation and improve high contrast styles ([#56515](https://github.com/WordPress/gutenberg/pull/56515)).
|
|
10
|
+
- `Button`: Add focus rings to focusable disabled buttons ([#56383](https://github.com/WordPress/gutenberg/pull/56383)).
|
|
11
|
+
|
|
12
|
+
### Bug Fix
|
|
13
|
+
|
|
14
|
+
- `ToolsPanelItem`: Use useLayoutEffect to prevent rendering glitch for last panel item styling. ([#56536](https://github.com/WordPress/gutenberg/pull/56536)).
|
|
15
|
+
- `FormTokenField`: Fix broken suggestions scrollbar when the `__experimentalExpandOnFocus` prop is defined ([#56426](https://github.com/WordPress/gutenberg/pull/56426)).
|
|
16
|
+
- `FormTokenField`: `onFocus` prop is now typed as a React `FocusEvent` ([#56426](https://github.com/WordPress/gutenberg/pull/56426)).
|
|
17
|
+
|
|
18
|
+
### Experimental
|
|
19
|
+
|
|
20
|
+
- `Tabs`: Memoize and expose the component context ([#56224](https://github.com/WordPress/gutenberg/pull/56224)).
|
|
21
|
+
- `DropdownMenuV2`: Design tweaks ([#56041](https://github.com/WordPress/gutenberg/pull/56041))
|
|
22
|
+
|
|
23
|
+
### Documentation
|
|
24
|
+
|
|
25
|
+
- `Text` and `Heading`: improve docs around default values and truncation logic ([#56518](https://github.com/WordPress/gutenberg/pull/56518))
|
|
26
|
+
|
|
27
|
+
### Internal
|
|
28
|
+
|
|
29
|
+
- `Slot`: add `style` prop to `bubblesVirtually` version ([#56428](https://github.com/WordPress/gutenberg/pull/56428))
|
|
30
|
+
- Introduce experimental new version of `CustomSelectControl` based on `ariakit` ([#55790](https://github.com/WordPress/gutenberg/pull/55790))
|
|
31
|
+
|
|
5
32
|
## 25.12.0 (2023-11-16)
|
|
6
33
|
|
|
7
34
|
### Bug Fix
|
|
@@ -40,6 +67,7 @@
|
|
|
40
67
|
### Bug Fix
|
|
41
68
|
|
|
42
69
|
- `Autocomplete`: Add `aria-live` announcements for Mac and IOS Voiceover to fix lack of support for `aria-owns` ([#54902](https://github.com/WordPress/gutenberg/pull/54902)).
|
|
70
|
+
- Improve Button saving state accessibility. ([#55547](https://github.com/WordPress/gutenberg/pull/55547))
|
|
43
71
|
|
|
44
72
|
### Internal
|
|
45
73
|
|
|
@@ -39,7 +39,6 @@ function UnforwardedAnglePickerControl(props, ref) {
|
|
|
39
39
|
if (!__nextHasNoMarginBottom) {
|
|
40
40
|
(0, _deprecated.default)('Bottom margin styles for wp.components.AnglePickerControl', {
|
|
41
41
|
since: '6.1',
|
|
42
|
-
version: '6.4',
|
|
43
42
|
hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.'
|
|
44
43
|
});
|
|
45
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_deprecated","_element","_i18n","_flex","_spacer","_numberControl","_angleCircle","_anglePickerControlStyles","UnforwardedAnglePickerControl","props","ref","__nextHasNoMarginBottom","className","label","__","onChange","value","restProps","deprecated","since","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_deprecated","_element","_i18n","_flex","_spacer","_numberControl","_angleCircle","_anglePickerControlStyles","UnforwardedAnglePickerControl","props","ref","__nextHasNoMarginBottom","className","label","__","onChange","value","restProps","deprecated","since","hint","handleOnNumberChange","unprocessedValue","undefined","inputValue","parseInt","classes","classnames","unitText","_react","createElement","UnitText","prefixedUnitText","suffixedUnitText","isRTL","Root","gap","FlexBlock","default","max","min","size","step","spinControls","prefix","suffix","Spacer","marginBottom","marginTop","AnglePickerControl","forwardRef","exports","_default"],"sources":["@wordpress/components/src/angle-picker-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { FlexBlock } from '../flex';\nimport { Spacer } from '../spacer';\nimport NumberControl from '../number-control';\nimport AngleCircle from './angle-circle';\nimport { Root, UnitText } from './styles/angle-picker-control-styles';\n\nimport type { WordPressComponentProps } from '../context';\nimport type { AnglePickerControlProps } from './types';\n\nfunction UnforwardedAnglePickerControl(\n\tprops: WordPressComponentProps< AnglePickerControlProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tclassName,\n\t\tlabel = __( 'Angle' ),\n\t\tonChange,\n\t\tvalue,\n\t\t...restProps\n\t} = props;\n\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\tdeprecated(\n\t\t\t'Bottom margin styles for wp.components.AnglePickerControl',\n\t\t\t{\n\t\t\t\tsince: '6.1',\n\t\t\t\thint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst handleOnNumberChange = ( unprocessedValue: string | undefined ) => {\n\t\tif ( onChange === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== undefined && unprocessedValue !== ''\n\t\t\t\t? parseInt( unprocessedValue, 10 )\n\t\t\t\t: 0;\n\t\tonChange( inputValue );\n\t};\n\n\tconst classes = classnames( 'components-angle-picker-control', className );\n\n\tconst unitText = <UnitText>°</UnitText>;\n\tconst [ prefixedUnitText, suffixedUnitText ] = isRTL()\n\t\t? [ unitText, null ]\n\t\t: [ null, unitText ];\n\n\treturn (\n\t\t<Root\n\t\t\t{ ...restProps }\n\t\t\tref={ ref }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tclassName={ classes }\n\t\t\tgap={ 2 }\n\t\t>\n\t\t\t<FlexBlock>\n\t\t\t\t<NumberControl\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tclassName=\"components-angle-picker-control__input-field\"\n\t\t\t\t\tmax={ 360 }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ handleOnNumberChange }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tstep=\"1\"\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tspinControls=\"none\"\n\t\t\t\t\tprefix={ prefixedUnitText }\n\t\t\t\t\tsuffix={ suffixedUnitText }\n\t\t\t\t/>\n\t\t\t</FlexBlock>\n\t\t\t<Spacer marginBottom=\"1\" marginTop=\"auto\">\n\t\t\t\t<AngleCircle\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t</Root>\n\t);\n}\n\n/**\n * `AnglePickerControl` is a React component to render a UI that allows users to\n * pick an angle. Users can choose an angle in a visual UI with the mouse by\n * dragging an angle indicator inside a circle or by directly inserting the\n * desired angle in a text field.\n *\n * ```jsx\n * import { useState } from '@wordpress/element';\n * import { AnglePickerControl } from '@wordpress/components';\n *\n * function Example() {\n * const [ angle, setAngle ] = useState( 0 );\n * return (\n * <AnglePickerControl\n * value={ angle }\n * onChange={ setAngle }\n * __nextHasNoMarginBottom\n * </>\n * );\n * }\n * ```\n */\nexport const AnglePickerControl = forwardRef( UnforwardedAnglePickerControl );\n\nexport default AnglePickerControl;\n"],"mappings":";;;;;;;;AAIA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,s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;IACrBU,GAAG,EAAG;EAAG,GAET,IAAAP,MAAA,CAAAC,aAAA,EAAC3B,KAAA,CAAAkC,SAAS,QACT,IAAAR,MAAA,CAAAC,aAAA,EAACzB,cAAA,CAAAiC,OAAa;IACbzB,KAAK,EAAGA,KAAO;IACfD,SAAS,EAAC,8CAA8C;IACxD2B,GAAG,EAAG,GAAK;IACXC,GAAG,EAAG,CAAG;IACTzB,QAAQ,EAAGM,oBAAsB;IACjCoB,IAAI,EAAC,kBAAkB;IACvBC,IAAI,EAAC,GAAG;IACR1B,KAAK,EAAGA,KAAO;IACf2B,YAAY,EAAC,MAAM;IACnBC,MAAM,EAAGZ,gBAAkB;IAC3Ba,MAAM,EAAGZ;EAAkB,CAC3B,CACS,CAAC,EACZ,IAAAJ,MAAA,CAAAC,aAAA,EAAC1B,OAAA,CAAA0C,MAAM;IAACC,YAAY,EAAC,GAAG;IAACC,SAAS,EAAC;EAAM,GACxC,IAAAnB,MAAA,CAAAC,aAAA,EAACxB,YAAA,CAAAgC,OAAW;IACX,eAAY,MAAM;IAClBtB,KAAK,EAAGA,KAAO;IACfD,QAAQ,EAAGA;EAAU,CACrB,CACM,CACH,CAAC;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMkC,kBAAkB,GAAG,IAAAC,mBAAU,EAAE1C,6BAA8B,CAAC;AAAC2C,OAAA,CAAAF,kBAAA,GAAAA,kBAAA;AAAA,IAAAG,QAAA,GAE/DH,kBAAkB;AAAAE,OAAA,CAAAb,OAAA,GAAAc,QAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CustomSelect = CustomSelect;
|
|
7
|
+
exports.CustomSelectContext = void 0;
|
|
8
|
+
exports.CustomSelectItem = CustomSelectItem;
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
|
|
11
|
+
var _element = require("@wordpress/element");
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
var Styled = _interopRequireWildcard(require("./styles"));
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
/**
|
|
17
|
+
* External dependencies
|
|
18
|
+
*/
|
|
19
|
+
// eslint-disable-next-line no-restricted-imports
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* WordPress dependencies
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Internal dependencies
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
const CustomSelectContext = (0, _element.createContext)(undefined);
|
|
30
|
+
exports.CustomSelectContext = CustomSelectContext;
|
|
31
|
+
function defaultRenderSelectedValue(value) {
|
|
32
|
+
const isValueEmpty = Array.isArray(value) ? value.length === 0 : value === undefined || value === null;
|
|
33
|
+
if (isValueEmpty) {
|
|
34
|
+
return (0, _i18n.__)('Select an item');
|
|
35
|
+
}
|
|
36
|
+
if (Array.isArray(value)) {
|
|
37
|
+
return value.length === 1 ? value[0] :
|
|
38
|
+
// translators: %s: number of items selected (it will always be 2 or more items)
|
|
39
|
+
(0, _i18n.sprintf)((0, _i18n.__)('%s items selected'), value.length);
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
function CustomSelect(props) {
|
|
44
|
+
const {
|
|
45
|
+
children,
|
|
46
|
+
defaultValue,
|
|
47
|
+
label,
|
|
48
|
+
onChange,
|
|
49
|
+
size = 'default',
|
|
50
|
+
value,
|
|
51
|
+
renderSelectedValue = defaultRenderSelectedValue
|
|
52
|
+
} = props;
|
|
53
|
+
const store = Ariakit.useSelectStore({
|
|
54
|
+
setValue: nextValue => onChange?.(nextValue),
|
|
55
|
+
defaultValue,
|
|
56
|
+
value
|
|
57
|
+
});
|
|
58
|
+
const {
|
|
59
|
+
value: currentValue
|
|
60
|
+
} = store.useState();
|
|
61
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(Styled.CustomSelectLabel, {
|
|
62
|
+
store: store
|
|
63
|
+
}, label), (0, _react.createElement)(Styled.CustomSelectButton, {
|
|
64
|
+
size: size,
|
|
65
|
+
hasCustomRenderProp: !!renderSelectedValue,
|
|
66
|
+
store: store
|
|
67
|
+
}, renderSelectedValue(currentValue), (0, _react.createElement)(Ariakit.SelectArrow, null)), (0, _react.createElement)(Styled.CustomSelectPopover, {
|
|
68
|
+
gutter: 12,
|
|
69
|
+
store: store,
|
|
70
|
+
sameWidth: true
|
|
71
|
+
}, (0, _react.createElement)(CustomSelectContext.Provider, {
|
|
72
|
+
value: {
|
|
73
|
+
store
|
|
74
|
+
}
|
|
75
|
+
}, children)));
|
|
76
|
+
}
|
|
77
|
+
function CustomSelectItem({
|
|
78
|
+
children,
|
|
79
|
+
...props
|
|
80
|
+
}) {
|
|
81
|
+
const customSelectContext = (0, _element.useContext)(CustomSelectContext);
|
|
82
|
+
return (0, _react.createElement)(Styled.CustomSelectItem, {
|
|
83
|
+
store: customSelectContext?.store,
|
|
84
|
+
...props
|
|
85
|
+
}, children !== null && children !== void 0 ? children : props.value, (0, _react.createElement)(Ariakit.SelectItemCheck, null));
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_i18n","Styled","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","CustomSelectContext","createContext","undefined","exports","defaultRenderSelectedValue","value","isValueEmpty","Array","isArray","length","__","sprintf","CustomSelect","props","children","defaultValue","label","onChange","size","renderSelectedValue","store","useSelectStore","setValue","nextValue","currentValue","useState","_react","createElement","Fragment","CustomSelectLabel","CustomSelectButton","hasCustomRenderProp","SelectArrow","CustomSelectPopover","gutter","sameWidth","Provider","CustomSelectItem","customSelectContext","useContext","SelectItemCheck"],"sources":["@wordpress/components/src/custom-select-control-v2/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport * as Styled from './styles';\nimport type {\n\tCustomSelectProps,\n\tCustomSelectItemProps,\n\tCustomSelectContext as CustomSelectContextType,\n} from './types';\n\nexport const CustomSelectContext =\n\tcreateContext< CustomSelectContextType >( undefined );\n\nfunction defaultRenderSelectedValue( value: CustomSelectProps[ 'value' ] ) {\n\tconst isValueEmpty = Array.isArray( value )\n\t\t? value.length === 0\n\t\t: value === undefined || value === null;\n\n\tif ( isValueEmpty ) {\n\t\treturn __( 'Select an item' );\n\t}\n\n\tif ( Array.isArray( value ) ) {\n\t\treturn value.length === 1\n\t\t\t? value[ 0 ]\n\t\t\t: // translators: %s: number of items selected (it will always be 2 or more items)\n\t\t\t sprintf( __( '%s items selected' ), value.length );\n\t}\n\n\treturn value;\n}\n\nexport function CustomSelect( props: CustomSelectProps ) {\n\tconst {\n\t\tchildren,\n\t\tdefaultValue,\n\t\tlabel,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tvalue,\n\t\trenderSelectedValue = defaultRenderSelectedValue,\n\t} = props;\n\n\tconst store = Ariakit.useSelectStore( {\n\t\tsetValue: ( nextValue ) => onChange?.( nextValue ),\n\t\tdefaultValue,\n\t\tvalue,\n\t} );\n\n\tconst { value: currentValue } = store.useState();\n\n\treturn (\n\t\t<>\n\t\t\t<Styled.CustomSelectLabel store={ store }>\n\t\t\t\t{ label }\n\t\t\t</Styled.CustomSelectLabel>\n\t\t\t<Styled.CustomSelectButton\n\t\t\t\tsize={ size }\n\t\t\t\thasCustomRenderProp={ !! renderSelectedValue }\n\t\t\t\tstore={ store }\n\t\t\t>\n\t\t\t\t{ renderSelectedValue( currentValue ) }\n\t\t\t\t<Ariakit.SelectArrow />\n\t\t\t</Styled.CustomSelectButton>\n\t\t\t<Styled.CustomSelectPopover gutter={ 12 } store={ store } sameWidth>\n\t\t\t\t<CustomSelectContext.Provider value={ { store } }>\n\t\t\t\t\t{ children }\n\t\t\t\t</CustomSelectContext.Provider>\n\t\t\t</Styled.CustomSelectPopover>\n\t\t</>\n\t);\n}\n\nexport function CustomSelectItem( {\n\tchildren,\n\t...props\n}: CustomSelectItemProps ) {\n\tconst customSelectContext = useContext( CustomSelectContext );\n\treturn (\n\t\t<Styled.CustomSelectItem\n\t\t\tstore={ customSelectContext?.store }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children ?? props.value }\n\t\t\t<Ariakit.SelectItemCheck />\n\t\t</Styled.CustomSelectItem>\n\t);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IAAAF,MAAA,CAAAC,aAAA,EAAClD,MAAM,CAACoD,iBAAiB;IAACT,KAAK,EAAGA;EAAO,GACtCJ,KACuB,CAAC,EAC3B,IAAAU,MAAA,CAAAC,aAAA,EAAClD,MAAM,CAACqD,kBAAkB;IACzBZ,IAAI,EAAGA,IAAM;IACba,mBAAmB,EAAG,CAAC,CAAEZ,mBAAqB;IAC9CC,KAAK,EAAGA;EAAO,GAEbD,mBAAmB,CAAEK,YAAa,CAAC,EACrC,IAAAE,MAAA,CAAAC,aAAA,EAACvD,OAAO,CAAC4D,WAAW,MAAE,CACI,CAAC,EAC5B,IAAAN,MAAA,CAAAC,aAAA,EAAClD,MAAM,CAACwD,mBAAmB;IAACC,MAAM,EAAG,EAAI;IAACd,KAAK,EAAGA,KAAO;IAACe,SAAS;EAAA,GAClE,IAAAT,MAAA,CAAAC,aAAA,EAAC3B,mBAAmB,CAACoC,QAAQ;IAAC/B,KAAK,EAAG;MAAEe;IAAM;EAAG,GAC9CN,QAC2B,CACH,CAC3B,CAAC;AAEL;AAEO,SAASuB,gBAAgBA,CAAE;EACjCvB,QAAQ;EACR,GAAGD;AACmB,CAAC,EAAG;EAC1B,MAAMyB,mBAAmB,GAAG,IAAAC,mBAAU,EAAEvC,mBAAoB,CAAC;EAC7D,OACC,IAAA0B,MAAA,CAAAC,aAAA,EAAClD,MAAM,CAAC4D,gBAAgB;IACvBjB,KAAK,EAAGkB,mBAAmB,EAAElB,KAAO;IAAA,GAC/BP;EAAK,GAERC,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAID,KAAK,CAACR,KAAK,EACzB,IAAAqB,MAAA,CAAAC,aAAA,EAACvD,OAAO,CAACoE,eAAe,MAAE,CACF,CAAC;AAE5B"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.CustomSelectPopover = exports.CustomSelectLabel = exports.CustomSelectItem = exports.CustomSelectButton = void 0;
|
|
8
|
+
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
+
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
|
|
10
|
+
var _utils = require("../utils");
|
|
11
|
+
var _space = require("../utils/space");
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
/**
|
|
15
|
+
* External dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line no-restricted-imports
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Internal dependencies
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const CustomSelectLabel = ( /*#__PURE__*/0, _base.default)(Ariakit.SelectLabel, process.env.NODE_ENV === "production" ? {
|
|
25
|
+
target: "e1p3eej73"
|
|
26
|
+
} : {
|
|
27
|
+
target: "e1p3eej73",
|
|
28
|
+
label: "CustomSelectLabel"
|
|
29
|
+
})("font-size:11px;font-weight:500;line-height:1.4;text-transform:uppercase;margin-bottom:", (0, _space.space)(2), ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sLXYyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjOEQiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9jdXN0b20tc2VsZWN0LWNvbnRyb2wtdjIvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXJlc3RyaWN0ZWQtaW1wb3J0c1xuaW1wb3J0ICogYXMgQXJpYWtpdCBmcm9tICdAYXJpYWtpdC9yZWFjdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uL3V0aWxzJztcbmltcG9ydCB7IHNwYWNlIH0gZnJvbSAnLi4vdXRpbHMvc3BhY2UnO1xuaW1wb3J0IHR5cGUgeyBDdXN0b21TZWxlY3RQcm9wcyB9IGZyb20gJy4vdHlwZXMnO1xuXG5leHBvcnQgY29uc3QgQ3VzdG9tU2VsZWN0TGFiZWwgPSBzdHlsZWQoIEFyaWFraXQuU2VsZWN0TGFiZWwgKWBcblx0Zm9udC1zaXplOiAxMXB4O1xuXHRmb250LXdlaWdodDogNTAwO1xuXHRsaW5lLWhlaWdodDogMS40O1xuXHR0ZXh0LXRyYW5zZm9ybTogdXBwZXJjYXNlO1xuXHR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iAkeyBDT0xPUlMuZ3JheVsgMzAwIF0gfTtcblx0fVxuYDtcbiJdfQ== */"));
|
|
30
|
+
exports.CustomSelectLabel = CustomSelectLabel;
|
|
31
|
+
const inputHeights = {
|
|
32
|
+
default: 40,
|
|
33
|
+
small: 24
|
|
34
|
+
};
|
|
35
|
+
const CustomSelectButton = ( /*#__PURE__*/0, _base.default)(Ariakit.Select, process.env.NODE_ENV === "production" ? {
|
|
36
|
+
// Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component
|
|
37
|
+
shouldForwardProp: prop => prop !== 'hasCustomRenderProp',
|
|
38
|
+
target: "e1p3eej72"
|
|
39
|
+
} : {
|
|
40
|
+
// Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component
|
|
41
|
+
shouldForwardProp: prop => prop !== 'hasCustomRenderProp',
|
|
42
|
+
target: "e1p3eej72",
|
|
43
|
+
label: "CustomSelectButton"
|
|
44
|
+
})(({
|
|
45
|
+
size,
|
|
46
|
+
hasCustomRenderProp
|
|
47
|
+
}) => {
|
|
48
|
+
const isSmallSize = size === 'small' && !hasCustomRenderProp;
|
|
49
|
+
const heightProperty = hasCustomRenderProp ? 'minHeight' : 'height';
|
|
50
|
+
return {
|
|
51
|
+
display: 'flex',
|
|
52
|
+
justifyContent: 'space-between',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
backgroundColor: _utils.COLORS.white,
|
|
55
|
+
border: `1px solid ${_utils.COLORS.gray[600]}`,
|
|
56
|
+
borderRadius: (0, _space.space)(0.5),
|
|
57
|
+
cursor: 'pointer',
|
|
58
|
+
width: '100%',
|
|
59
|
+
[heightProperty]: `${inputHeights[size]}px`,
|
|
60
|
+
padding: isSmallSize ? (0, _space.space)(2) : (0, _space.space)(4),
|
|
61
|
+
fontSize: isSmallSize ? '11px' : '13px',
|
|
62
|
+
'&[data-focus-visible]': {
|
|
63
|
+
outlineStyle: 'solid'
|
|
64
|
+
},
|
|
65
|
+
'&[aria-expanded="true"]': {
|
|
66
|
+
outlineStyle: `1.5px solid ${_utils.COLORS.theme.accent}`
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sLXYyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUEyQmtDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sLXYyL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1yZXN0cmljdGVkLWltcG9ydHNcbmltcG9ydCAqIGFzIEFyaWFraXQgZnJvbSAnQGFyaWFraXQvcmVhY3QnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBDT0xPUlMgfSBmcm9tICcuLi91dGlscyc7XG5pbXBvcnQgeyBzcGFjZSB9IGZyb20gJy4uL3V0aWxzL3NwYWNlJztcbmltcG9ydCB0eXBlIHsgQ3VzdG9tU2VsZWN0UHJvcHMgfSBmcm9tICcuL3R5cGVzJztcblxuZXhwb3J0IGNvbnN0IEN1c3RvbVNlbGVjdExhYmVsID0gc3R5bGVkKCBBcmlha2l0LlNlbGVjdExhYmVsIClgXG5cdGZvbnQtc2l6ZTogMTFweDtcblx0Zm9udC13ZWlnaHQ6IDUwMDtcblx0bGluZS1oZWlnaHQ6IDEuNDtcblx0dGV4dC10cmFuc2Zvcm06IHVwcGVyY2FzZTtcblx0bWFyZ2luLWJvdH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XlbIDMwMCBdIH07XG5cdH1cbmA7XG4iXX0= */");
|
|
70
|
+
exports.CustomSelectButton = CustomSelectButton;
|
|
71
|
+
const CustomSelectPopover = ( /*#__PURE__*/0, _base.default)(Ariakit.SelectPopover, process.env.NODE_ENV === "production" ? {
|
|
72
|
+
target: "e1p3eej71"
|
|
73
|
+
} : {
|
|
74
|
+
target: "e1p3eej71",
|
|
75
|
+
label: "CustomSelectPopover"
|
|
76
|
+
})("border-radius:", (0, _space.space)(0.5), ";background:", _utils.COLORS.white, ";border:1px solid ", _utils.COLORS.gray[900], ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sLXYyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE2RGtFIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sLXYyL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1yZXN0cmljdGVkLWltcG9ydHNcbmltcG9ydCAqIGFzIEFyaWFraXQgZnJvbSAnQGFyaWFraXQvcmVhY3QnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBDT0xPUlMgfSBmcm9tICcuLi91dGlscyc7XG5pbXBvcnQgeyBzcGFjZSB9IGZyb20gJy4uL3V0aWxzL3NwYWNlJztcbmltcG9ydCB0eXBlIHsgQ3VzdG9tU2VsZWN0UHJvcHMgfSBmcm9tICcuL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ZWN0SXRlbSApYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG5cdHBhZGRpbmc6ICR7IHNwYWNlKCAyICkgfTtcblx0JltkYXRhLWFjdGl2ZS1pdGVtXSB7XG5cdFx0YmFja2dyb3VuZC1jb2xvcjogJHsgQ09MT1JTLmdyYXlbIDMwMCBdIH07XG5cdH1cbmA7XG4iXX0= */"));
|
|
77
|
+
exports.CustomSelectPopover = CustomSelectPopover;
|
|
78
|
+
const CustomSelectItem = ( /*#__PURE__*/0, _base.default)(Ariakit.SelectItem, process.env.NODE_ENV === "production" ? {
|
|
79
|
+
target: "e1p3eej70"
|
|
80
|
+
} : {
|
|
81
|
+
target: "e1p3eej70",
|
|
82
|
+
label: "CustomSelectItem"
|
|
83
|
+
})("display:flex;align-items:center;justify-content:space-between;padding:", (0, _space.space)(2), ";&[data-active-item]{background-color:", _utils.COLORS.gray[300], ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sLXYyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtRTREIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sLXYyL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1yZXN0cmljdGVkLWltcG9ydHNcbmltcG9ydCAqIGFzIEF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0UG9wb3ZlciApYFxuXHRib3JkZXItcmFkaXVzOiAkeyBzcGFjZSggMC41ICkgfTtcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLndoaXRlIH07XG5cdGJvcmRlcjogMXB4IHNvbGlkICR7IENPTE9SUy5ncmF5WyA5MDAgXSB9O1xuYDtcblxuZXhwb3J0IGNvbnN0IEN1c3RvbVNlbGVjdEl0ZW0gPSBzdHlsZWQoIEFyaWFraXQuU2VsZWN0SXRlbSApYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG5cdHBhZGRpbmc6ICR7IHNwYWNlKCAyICkgfTtcblx0JltkYXRhLWFjdGl2ZS1pdGVtXSB7XG5cdFx0YmFja2dyb3VuZC1jb2xvcjogJHsgQ09MT1JTLmdyYXlbIDMwMCBdIH07XG5cdH1cbmA7XG4iXX0= */"));
|
|
84
|
+
exports.CustomSelectItem = CustomSelectItem;
|
|
85
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_utils","_space","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","CustomSelectLabel","_base","SelectLabel","process","env","NODE_ENV","target","label","space","exports","inputHeights","small","CustomSelectButton","Select","shouldForwardProp","prop","size","hasCustomRenderProp","isSmallSize","heightProperty","display","justifyContent","alignItems","backgroundColor","COLORS","white","border","gray","borderRadius","cursor","width","padding","fontSize","outlineStyle","theme","accent","CustomSelectPopover","SelectPopover","CustomSelectItem","SelectItem"],"sources":["@wordpress/components/src/custom-select-control-v2/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS } from '../utils';\nimport { space } from '../utils/space';\nimport type { CustomSelectProps } from './types';\n\nexport const CustomSelectLabel = styled( Ariakit.SelectLabel )`\n\tfont-size: 11px;\n\tfont-weight: 500;\n\tline-height: 1.4;\n\ttext-transform: uppercase;\n\tmargin-bottom: ${ space( 2 ) };\n`;\n\nconst inputHeights = {\n\tdefault: 40,\n\tsmall: 24,\n};\n\nexport const CustomSelectButton = styled( Ariakit.Select, {\n\t// Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component\n\tshouldForwardProp: ( prop ) => prop !== 'hasCustomRenderProp',\n} )( ( {\n\tsize,\n\thasCustomRenderProp,\n}: {\n\tsize: NonNullable< CustomSelectProps[ 'size' ] >;\n\thasCustomRenderProp: boolean;\n} ) => {\n\tconst isSmallSize = size === 'small' && ! hasCustomRenderProp;\n\tconst heightProperty = hasCustomRenderProp ? 'minHeight' : 'height';\n\n\treturn {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'space-between',\n\t\talignItems: 'center',\n\t\tbackgroundColor: COLORS.white,\n\t\tborder: `1px solid ${ COLORS.gray[ 600 ] }`,\n\t\tborderRadius: space( 0.5 ),\n\t\tcursor: 'pointer',\n\t\twidth: '100%',\n\t\t[ heightProperty ]: `${ inputHeights[ size ] }px`,\n\t\tpadding: isSmallSize ? space( 2 ) : space( 4 ),\n\t\tfontSize: isSmallSize ? '11px' : '13px',\n\t\t'&[data-focus-visible]': {\n\t\t\toutlineStyle: 'solid',\n\t\t},\n\t\t'&[aria-expanded=\"true\"]': {\n\t\t\toutlineStyle: `1.5px solid ${ COLORS.theme.accent }`,\n\t\t},\n\t};\n} );\n\nexport const CustomSelectPopover = styled( Ariakit.SelectPopover )`\n\tborder-radius: ${ space( 0.5 ) };\n\tbackground: ${ COLORS.white };\n\tborder: 1px solid ${ COLORS.gray[ 900 ] };\n`;\n\nexport const CustomSelectItem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AgB,aAAM,CAACG,IAAI,CAAE,GAAG,CAAE,UAAAxB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oqGAExC;AAACI,OAAA,CAAA6B,gBAAA,GAAAA,gBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/custom-select-control-v2/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type * as Ariakit from '@ariakit/react';\n\nexport type CustomSelectContext =\n\t| {\n\t\t\t/**\n\t\t\t * The store object returned by Ariakit's `useSelectStore` hook.\n\t\t\t */\n\t\t\tstore: Ariakit.SelectStore;\n\t }\n\t| undefined;\n\nexport type CustomSelectProps = {\n\t/**\n\t * The child elements. This should be composed of CustomSelectItem components.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * An optional default value for the control. If left `undefined`, the first\n\t * non-disabled item will be used.\n\t */\n\tdefaultValue?: string | string[];\n\t/**\n\t * Label for the control.\n\t */\n\tlabel: string;\n\t/**\n\t * A function that receives the new value of the input.\n\t */\n\tonChange?: ( newValue: string | string[] ) => void;\n\t/**\n\t * Can be used to render select UI with custom styled values.\n\t */\n\trenderSelectedValue?: (\n\t\tselectedValue: string | string[]\n\t) => React.ReactNode;\n\t/**\n\t * The size of the control.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'small';\n\t/**\n\t * Can be used to externally control the value of the control.\n\t */\n\tvalue?: string | string[];\n};\n\nexport type CustomSelectItemProps = {\n\t/**\n\t * The value of the select item. This will be used as the children if\n\t * children are left `undefined`.\n\t */\n\tvalue: string;\n\t/**\n\t * The children to display for each select item. The `value` will be\n\t * used if left `undefined`.\n\t */\n\tchildren?: React.ReactNode;\n};\n"],"mappings":""}
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.DropdownMenuSeparator = exports.DropdownMenuRadioItem = exports.
|
|
7
|
+
exports.DropdownMenuSeparator = exports.DropdownMenuRadioItem = exports.DropdownMenuItemLabel = exports.DropdownMenuItemHelpText = exports.DropdownMenuItem = exports.DropdownMenuGroup = exports.DropdownMenuContext = exports.DropdownMenuCheckboxItem = exports.DropdownMenu = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
@@ -42,9 +42,10 @@ const DropdownMenuItem = (0, _element.forwardRef)(function DropdownMenuItem({
|
|
|
42
42
|
return (0, _react.createElement)(Styled.DropdownMenuItem, {
|
|
43
43
|
ref: ref,
|
|
44
44
|
...props,
|
|
45
|
+
accessibleWhenDisabled: true,
|
|
45
46
|
hideOnClick: hideOnClick,
|
|
46
47
|
store: dropdownMenuContext?.store
|
|
47
|
-
},
|
|
48
|
+
}, (0, _react.createElement)(Styled.ItemPrefixWrapper, null, prefix), (0, _react.createElement)(Styled.DropdownMenuItemContentWrapper, null, (0, _react.createElement)(Styled.DropdownMenuItemChildrenWrapper, null, children), suffix && (0, _react.createElement)(Styled.ItemSuffixWrapper, null, suffix)));
|
|
48
49
|
});
|
|
49
50
|
exports.DropdownMenuItem = DropdownMenuItem;
|
|
50
51
|
const DropdownMenuCheckboxItem = (0, _element.forwardRef)(function DropdownMenuCheckboxItem({
|
|
@@ -57,15 +58,22 @@ const DropdownMenuCheckboxItem = (0, _element.forwardRef)(function DropdownMenuC
|
|
|
57
58
|
return (0, _react.createElement)(Styled.DropdownMenuCheckboxItem, {
|
|
58
59
|
ref: ref,
|
|
59
60
|
...props,
|
|
61
|
+
accessibleWhenDisabled: true,
|
|
60
62
|
hideOnClick: hideOnClick,
|
|
61
63
|
store: dropdownMenuContext?.store
|
|
62
64
|
}, (0, _react.createElement)(Ariakit.MenuItemCheck, {
|
|
63
65
|
store: dropdownMenuContext?.store,
|
|
64
66
|
render: (0, _react.createElement)(Styled.ItemPrefixWrapper, null)
|
|
67
|
+
// Override some ariakit inline styles
|
|
68
|
+
,
|
|
69
|
+
style: {
|
|
70
|
+
width: 'auto',
|
|
71
|
+
height: 'auto'
|
|
72
|
+
}
|
|
65
73
|
}, (0, _react.createElement)(_icon.default, {
|
|
66
74
|
icon: _icons.check,
|
|
67
75
|
size: 24
|
|
68
|
-
})), children, suffix && (0, _react.createElement)(Styled.ItemSuffixWrapper, null, suffix));
|
|
76
|
+
})), (0, _react.createElement)(Styled.DropdownMenuItemContentWrapper, null, (0, _react.createElement)(Styled.DropdownMenuItemChildrenWrapper, null, children), suffix && (0, _react.createElement)(Styled.ItemSuffixWrapper, null, suffix)));
|
|
69
77
|
});
|
|
70
78
|
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
71
79
|
const radioCheck = (0, _react.createElement)(_primitives.SVG, {
|
|
@@ -86,15 +94,22 @@ const DropdownMenuRadioItem = (0, _element.forwardRef)(function DropdownMenuRadi
|
|
|
86
94
|
return (0, _react.createElement)(Styled.DropdownMenuRadioItem, {
|
|
87
95
|
ref: ref,
|
|
88
96
|
...props,
|
|
97
|
+
accessibleWhenDisabled: true,
|
|
89
98
|
hideOnClick: hideOnClick,
|
|
90
99
|
store: dropdownMenuContext?.store
|
|
91
100
|
}, (0, _react.createElement)(Ariakit.MenuItemCheck, {
|
|
92
101
|
store: dropdownMenuContext?.store,
|
|
93
102
|
render: (0, _react.createElement)(Styled.ItemPrefixWrapper, null)
|
|
103
|
+
// Override some ariakit inline styles
|
|
104
|
+
,
|
|
105
|
+
style: {
|
|
106
|
+
width: 'auto',
|
|
107
|
+
height: 'auto'
|
|
108
|
+
}
|
|
94
109
|
}, (0, _react.createElement)(_icon.default, {
|
|
95
110
|
icon: radioCheck,
|
|
96
111
|
size: 24
|
|
97
|
-
})), children, suffix);
|
|
112
|
+
})), (0, _react.createElement)(Styled.DropdownMenuItemContentWrapper, null, (0, _react.createElement)(Styled.DropdownMenuItemChildrenWrapper, null, children), suffix && (0, _react.createElement)(Styled.ItemSuffixWrapper, null, suffix)));
|
|
98
113
|
});
|
|
99
114
|
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
100
115
|
const DropdownMenuGroup = (0, _element.forwardRef)(function DropdownMenuGroup(props, ref) {
|
|
@@ -106,17 +121,8 @@ const DropdownMenuGroup = (0, _element.forwardRef)(function DropdownMenuGroup(pr
|
|
|
106
121
|
});
|
|
107
122
|
});
|
|
108
123
|
exports.DropdownMenuGroup = DropdownMenuGroup;
|
|
109
|
-
const DropdownMenuGroupLabel = (0, _element.forwardRef)(function DropdownMenuGroupLabel(props, ref) {
|
|
110
|
-
const dropdownMenuContext = (0, _element.useContext)(DropdownMenuContext);
|
|
111
|
-
return (0, _react.createElement)(Styled.DropdownMenuGroupLabel, {
|
|
112
|
-
ref: ref,
|
|
113
|
-
...props,
|
|
114
|
-
store: dropdownMenuContext?.store
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
exports.DropdownMenuGroupLabel = DropdownMenuGroupLabel;
|
|
118
124
|
const UnconnectedDropdownMenu = (props, ref) => {
|
|
119
|
-
var _props$placement
|
|
125
|
+
var _props$placement;
|
|
120
126
|
const {
|
|
121
127
|
// Store props
|
|
122
128
|
open,
|
|
@@ -190,18 +196,25 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
190
196
|
store: dropdownMenuStore,
|
|
191
197
|
render: dropdownMenuStore.parent ? (0, _element.cloneElement)(trigger, {
|
|
192
198
|
// Add submenu arrow, unless a `suffix` is explicitly specified
|
|
193
|
-
suffix: (
|
|
199
|
+
suffix: (0, _react.createElement)(_react.Fragment, null, trigger.props.suffix, (0, _react.createElement)(Styled.SubmenuChevronIcon, {
|
|
194
200
|
"aria-hidden": "true",
|
|
195
201
|
icon: _icons.chevronRightSmall,
|
|
196
|
-
size: 24
|
|
197
|
-
|
|
202
|
+
size: 24,
|
|
203
|
+
preserveAspectRatio: "xMidYMid slice"
|
|
204
|
+
}))
|
|
198
205
|
}) : trigger
|
|
199
206
|
}), (0, _react.createElement)(Styled.DropdownMenu, {
|
|
200
207
|
...otherProps,
|
|
201
208
|
modal: modal,
|
|
202
|
-
store: dropdownMenuStore
|
|
203
|
-
|
|
204
|
-
|
|
209
|
+
store: dropdownMenuStore
|
|
210
|
+
// Root menu has an 8px distance from its trigger,
|
|
211
|
+
// otherwise 0 (which causes the submenu to slightly overlap)
|
|
212
|
+
,
|
|
213
|
+
gutter: gutter !== null && gutter !== void 0 ? gutter : dropdownMenuStore.parent ? 0 : 8
|
|
214
|
+
// Align nested menu by the same (but opposite) amount
|
|
215
|
+
// as the menu container's padding.
|
|
216
|
+
,
|
|
217
|
+
shift: shift !== null && shift !== void 0 ? shift : dropdownMenuStore.parent ? -4 : 0,
|
|
205
218
|
hideOnHoverOutside: false,
|
|
206
219
|
"data-side": appliedPlacementSide,
|
|
207
220
|
variant: variant,
|
|
@@ -224,4 +237,20 @@ const DropdownMenuSeparator = (0, _element.forwardRef)(function DropdownMenuSepa
|
|
|
224
237
|
});
|
|
225
238
|
});
|
|
226
239
|
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
240
|
+
const DropdownMenuItemLabel = (0, _element.forwardRef)(function DropdownMenuItemLabel(props, ref) {
|
|
241
|
+
return (0, _react.createElement)(Styled.DropdownMenuItemLabel, {
|
|
242
|
+
numberOfLines: 1,
|
|
243
|
+
ref: ref,
|
|
244
|
+
...props
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
exports.DropdownMenuItemLabel = DropdownMenuItemLabel;
|
|
248
|
+
const DropdownMenuItemHelpText = (0, _element.forwardRef)(function DropdownMenuItemHelpText(props, ref) {
|
|
249
|
+
return (0, _react.createElement)(Styled.DropdownMenuItemHelpText, {
|
|
250
|
+
numberOfLines: 2,
|
|
251
|
+
ref: ref,
|
|
252
|
+
...props
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
exports.DropdownMenuItemHelpText = DropdownMenuItemHelpText;
|
|
227
256
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_i18n","_icons","_primitives","_context","_icon","_interopRequireDefault","Styled","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DropdownMenuContext","createContext","undefined","exports","DropdownMenuItem","forwardRef","prefix","suffix","children","hideOnClick","props","ref","dropdownMenuContext","useContext","_react","createElement","store","ItemPrefixWrapper","ItemSuffixWrapper","DropdownMenuCheckboxItem","MenuItemCheck","render","icon","check","size","radioCheck","SVG","xmlns","viewBox","Circle","cx","cy","r","DropdownMenuRadioItem","DropdownMenuGroup","DropdownMenuGroupLabel","UnconnectedDropdownMenu","_props$placement","_trigger$props$suffix","open","defaultOpen","onOpenChange","placement","trigger","gutter","shift","modal","variant","otherProps","useContextSystem","parentContext","computedDirection","isRTL","computedPlacement","test","replace","dropdownMenuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","rtl","contextValue","useMemo","appliedPlacementSide","useState","split","isValidElement","type","console","warn","hideOnEscape","useCallback","event","preventDefault","wrapperProps","dir","style","direction","Fragment","MenuButton","cloneElement","SubmenuChevronIcon","chevronRightSmall","DropdownMenu","hideOnHoverOutside","unmountOnHide","Provider","value","contextConnect","DropdownMenuSeparator"],"sources":["@wordpress/components/src/dropdown-menu-v2-ariakit/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tcloneElement,\n\tisValidElement,\n\tuseCallback,\n} from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\nimport { check, chevronRightSmall } from '@wordpress/icons';\nimport { SVG, Circle } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnect } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport Icon from '../icon';\nimport type {\n\tDropdownMenuContext as DropdownMenuContextType,\n\tDropdownMenuProps,\n\tDropdownMenuGroupProps,\n\tDropdownMenuGroupLabelProps,\n\tDropdownMenuItemProps,\n\tDropdownMenuCheckboxItemProps,\n\tDropdownMenuRadioItemProps,\n\tDropdownMenuSeparatorProps,\n} from './types';\nimport * as Styled from './styles';\n\nexport const DropdownMenuContext = createContext<\n\tDropdownMenuContextType | undefined\n>( undefined );\n\nexport const DropdownMenuItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuItemProps, 'div', false >\n>( function DropdownMenuItem(\n\t{ prefix, suffix, children, hideOnClick = true, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t{ prefix && (\n\t\t\t\t<Styled.ItemPrefixWrapper>{ prefix }</Styled.ItemPrefixWrapper>\n\t\t\t) }\n\t\t\t{ children }\n\t\t\t{ suffix && (\n\t\t\t\t<Styled.ItemSuffixWrapper>{ suffix }</Styled.ItemSuffixWrapper>\n\t\t\t) }\n\t\t</Styled.DropdownMenuItem>\n\t);\n} );\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuCheckboxItemProps, 'div', false >\n>( function DropdownMenuCheckboxItem(\n\t{ suffix, children, hideOnClick = false, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuCheckboxItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t>\n\t\t\t\t<Icon icon={ check } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t{ children }\n\t\t\t{ suffix && (\n\t\t\t\t<Styled.ItemSuffixWrapper>{ suffix }</Styled.ItemSuffixWrapper>\n\t\t\t) }\n\t\t</Styled.DropdownMenuCheckboxItem>\n\t);\n} );\n\nconst radioCheck = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Circle cx={ 12 } cy={ 12 } r={ 3 }></Circle>\n\t</SVG>\n);\n\nexport const DropdownMenuRadioItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuRadioItemProps, 'div', false >\n>( function DropdownMenuRadioItem(\n\t{ suffix, children, hideOnClick = false, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuRadioItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t>\n\t\t\t\t<Icon icon={ radioCheck } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\t\t\t{ children }\n\t\t\t{ suffix }\n\t\t</Styled.DropdownMenuRadioItem>\n\t);\n} );\n\nexport const DropdownMenuGroup = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuGroupProps, 'div', false >\n>( function DropdownMenuGroup( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuGroup\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t/>\n\t);\n} );\n\nexport const DropdownMenuGroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuGroupLabelProps, 'div', false >\n>( function DropdownMenuGroupLabel( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuGroupLabel\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t/>\n\t);\n} );\n\nconst UnconnectedDropdownMenu = (\n\tprops: WordPressComponentProps< DropdownMenuProps, 'div', false >,\n\tref: React.ForwardedRef< HTMLDivElement >\n) => {\n\tconst {\n\t\t// Store props\n\t\topen,\n\t\tdefaultOpen = false,\n\t\tonOpenChange,\n\t\tplacement,\n\n\t\t// Menu trigger props\n\t\ttrigger,\n\n\t\t// Menu props\n\t\tgutter,\n\t\tchildren,\n\t\tshift,\n\t\tmodal = true,\n\n\t\t// From internal components context\n\t\tvariant,\n\n\t\t// Rest\n\t\t...otherProps\n\t} = useContextSystem<\n\t\ttypeof props & Pick< DropdownMenuContextType, 'variant' >\n\t>( props, 'DropdownMenu' );\n\n\tconst parentContext = useContext( DropdownMenuContext );\n\n\tconst computedDirection = isRTL() ? 'rtl' : 'ltr';\n\n\t// If an explicit value for the `placement` prop is not passed,\n\t// apply a default placement of `bottom-start` for the root dropdown,\n\t// and of `right-start` for nested dropdowns.\n\tlet computedPlacement =\n\t\tprops.placement ??\n\t\t( parentContext?.store ? 'right-start' : 'bottom-start' );\n\t// Swap left/right in case of RTL direction\n\tif ( computedDirection === 'rtl' ) {\n\t\tif ( /right/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'right',\n\t\t\t\t'left'\n\t\t\t) as typeof computedPlacement;\n\t\t} else if ( /left/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'left',\n\t\t\t\t'right'\n\t\t\t) as typeof computedPlacement;\n\t\t}\n\t}\n\n\tconst dropdownMenuStore = Ariakit.useMenuStore( {\n\t\tparent: parentContext?.store,\n\t\topen,\n\t\tdefaultOpen,\n\t\tplacement: computedPlacement,\n\t\tfocusLoop: true,\n\t\tsetOpen( willBeOpen ) {\n\t\t\tonOpenChange?.( willBeOpen );\n\t\t},\n\t\trtl: computedDirection === 'rtl',\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { store: dropdownMenuStore, variant } ),\n\t\t[ dropdownMenuStore, variant ]\n\t);\n\n\t// Extract the side from the applied placement — useful for animations.\n\tconst appliedPlacementSide = dropdownMenuStore\n\t\t.useState( 'placement' )\n\t\t.split( '-' )[ 0 ];\n\n\tif (\n\t\tdropdownMenuStore.parent &&\n\t\t! ( isValidElement( trigger ) && DropdownMenuItem === trigger.type )\n\t) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t'For nested DropdownMenus, the `trigger` should always be a `DropdownMenuItem`.'\n\t\t);\n\t}\n\n\tconst hideOnEscape = useCallback(\n\t\t( event: React.KeyboardEvent< Element > ) => {\n\t\t\t// Pressing Escape can cause unexpected consequences (ie. exiting\n\t\t\t// full screen mode on MacOs, close parent modals...).\n\t\t\tevent.preventDefault();\n\t\t\t// Returning `true` causes the menu to hide.\n\t\t\treturn true;\n\t\t},\n\t\t[]\n\t);\n\n\tconst wrapperProps = useMemo(\n\t\t() => ( {\n\t\t\tdir: computedDirection,\n\t\t\tstyle: {\n\t\t\t\tdirection:\n\t\t\t\t\tcomputedDirection as React.CSSProperties[ 'direction' ],\n\t\t\t},\n\t\t} ),\n\t\t[ computedDirection ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ /* Menu trigger */ }\n\t\t\t<Ariakit.MenuButton\n\t\t\t\tref={ ref }\n\t\t\t\tstore={ dropdownMenuStore }\n\t\t\t\trender={\n\t\t\t\t\tdropdownMenuStore.parent\n\t\t\t\t\t\t? cloneElement( trigger, {\n\t\t\t\t\t\t\t\t// Add submenu arrow, unless a `suffix` is explicitly specified\n\t\t\t\t\t\t\t\tsuffix: trigger.props.suffix ?? (\n\t\t\t\t\t\t\t\t\t<Styled.SubmenuChevronIcon\n\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t } )\n\t\t\t\t\t\t: trigger\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t{ /* Menu popover */ }\n\t\t\t<Styled.DropdownMenu\n\t\t\t\t{ ...otherProps }\n\t\t\t\tmodal={ modal }\n\t\t\t\tstore={ dropdownMenuStore }\n\t\t\t\tgutter={ gutter ?? ( dropdownMenuStore.parent ? 16 : 8 ) }\n\t\t\t\tshift={ shift ?? ( dropdownMenuStore.parent ? -8 : 0 ) }\n\t\t\t\thideOnHoverOutside={ false }\n\t\t\t\tdata-side={ appliedPlacementSide }\n\t\t\t\tvariant={ variant }\n\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\thideOnEscape={ hideOnEscape }\n\t\t\t\tunmountOnHide\n\t\t\t>\n\t\t\t\t<DropdownMenuContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</DropdownMenuContext.Provider>\n\t\t\t</Styled.DropdownMenu>\n\t\t</>\n\t);\n};\nexport const DropdownMenu = contextConnect(\n\tUnconnectedDropdownMenu,\n\t'DropdownMenu'\n);\n\nexport const DropdownMenuSeparator = forwardRef<\n\tHTMLHRElement,\n\tWordPressComponentProps< DropdownMenuSeparatorProps, 'hr', false >\n>( function DropdownMenuSeparator( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<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AAC;AAACjC,OAAA,CAAAkF,YAAA,GAAAA,YAAA;AAEK,MAAMM,qBAAqB,GAAG,IAAAtF,mBAAU,EAG5C,SAASsF,qBAAqBA,CAAEjF,KAAK,EAAEC,GAAG,EAAG;EAC/C,MAAMC,mBAAmB,GAAG,IAAAC,mBAAU,EAAEb,mBAAoB,CAAC;EAC7D,OACC,IAAAc,MAAA,CAAAC,aAAA,EAACtC,MAAM,CAACkH,qBAAqB;IAC5BhF,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVM,KAAK,EAAGJ,mBAAmB,EAAEI,KAAO;IACpC+B,OAAO,EAAGnC,mBAAmB,EAAEmC;EAAS,CACxC,CAAC;AAEJ,CAAE,CAAC;AAAC5C,OAAA,CAAAwF,qBAAA,GAAAA,qBAAA"}
|
|
1
|
+
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_i18n","_icons","_primitives","_context","_icon","_interopRequireDefault","Styled","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DropdownMenuContext","createContext","undefined","exports","DropdownMenuItem","forwardRef","prefix","suffix","children","hideOnClick","props","ref","dropdownMenuContext","useContext","_react","createElement","accessibleWhenDisabled","store","ItemPrefixWrapper","DropdownMenuItemContentWrapper","DropdownMenuItemChildrenWrapper","ItemSuffixWrapper","DropdownMenuCheckboxItem","MenuItemCheck","render","style","width","height","icon","check","size","radioCheck","SVG","xmlns","viewBox","Circle","cx","cy","r","DropdownMenuRadioItem","DropdownMenuGroup","UnconnectedDropdownMenu","_props$placement","open","defaultOpen","onOpenChange","placement","trigger","gutter","shift","modal","variant","otherProps","useContextSystem","parentContext","computedDirection","isRTL","computedPlacement","test","replace","dropdownMenuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","rtl","contextValue","useMemo","appliedPlacementSide","useState","split","isValidElement","type","console","warn","hideOnEscape","useCallback","event","preventDefault","wrapperProps","dir","direction","Fragment","MenuButton","cloneElement","SubmenuChevronIcon","chevronRightSmall","preserveAspectRatio","DropdownMenu","hideOnHoverOutside","unmountOnHide","Provider","value","contextConnect","DropdownMenuSeparator","DropdownMenuItemLabel","numberOfLines","DropdownMenuItemHelpText"],"sources":["@wordpress/components/src/dropdown-menu-v2-ariakit/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tcloneElement,\n\tisValidElement,\n\tuseCallback,\n} from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\nimport { check, chevronRightSmall } from '@wordpress/icons';\nimport { SVG, Circle } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnect } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport Icon from '../icon';\nimport type {\n\tDropdownMenuContext as DropdownMenuContextType,\n\tDropdownMenuProps,\n\tDropdownMenuGroupProps,\n\tDropdownMenuItemProps,\n\tDropdownMenuCheckboxItemProps,\n\tDropdownMenuRadioItemProps,\n\tDropdownMenuSeparatorProps,\n} from './types';\nimport * as Styled from './styles';\n\nexport const DropdownMenuContext = createContext<\n\tDropdownMenuContextType | undefined\n>( undefined );\n\nexport const DropdownMenuItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuItemProps, 'div', false >\n>( function DropdownMenuItem(\n\t{ prefix, suffix, children, hideOnClick = true, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\taccessibleWhenDisabled\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Styled.ItemPrefixWrapper>{ prefix }</Styled.ItemPrefixWrapper>\n\n\t\t\t<Styled.DropdownMenuItemContentWrapper>\n\t\t\t\t<Styled.DropdownMenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.DropdownMenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.DropdownMenuItemContentWrapper>\n\t\t</Styled.DropdownMenuItem>\n\t);\n} );\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuCheckboxItemProps, 'div', false >\n>( function DropdownMenuCheckboxItem(\n\t{ suffix, children, hideOnClick = false, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuCheckboxItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\taccessibleWhenDisabled\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t\t// Override some ariakit inline styles\n\t\t\t\tstyle={ { width: 'auto', height: 'auto' } }\n\t\t\t>\n\t\t\t\t<Icon icon={ check } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.DropdownMenuItemContentWrapper>\n\t\t\t\t<Styled.DropdownMenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.DropdownMenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.DropdownMenuItemContentWrapper>\n\t\t</Styled.DropdownMenuCheckboxItem>\n\t);\n} );\n\nconst radioCheck = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Circle cx={ 12 } cy={ 12 } r={ 3 }></Circle>\n\t</SVG>\n);\n\nexport const DropdownMenuRadioItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuRadioItemProps, 'div', false >\n>( function DropdownMenuRadioItem(\n\t{ suffix, children, hideOnClick = false, ...props },\n\tref\n) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuRadioItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\taccessibleWhenDisabled\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t\t// Override some ariakit inline styles\n\t\t\t\tstyle={ { width: 'auto', height: 'auto' } }\n\t\t\t>\n\t\t\t\t<Icon icon={ radioCheck } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.DropdownMenuItemContentWrapper>\n\t\t\t\t<Styled.DropdownMenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.DropdownMenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.DropdownMenuItemContentWrapper>\n\t\t</Styled.DropdownMenuRadioItem>\n\t);\n} );\n\nexport const DropdownMenuGroup = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuGroupProps, 'div', false >\n>( function DropdownMenuGroup( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuGroup\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t/>\n\t);\n} );\n\nconst UnconnectedDropdownMenu = (\n\tprops: WordPressComponentProps< DropdownMenuProps, 'div', false >,\n\tref: React.ForwardedRef< HTMLDivElement >\n) => {\n\tconst {\n\t\t// Store props\n\t\topen,\n\t\tdefaultOpen = false,\n\t\tonOpenChange,\n\t\tplacement,\n\n\t\t// Menu trigger props\n\t\ttrigger,\n\n\t\t// Menu props\n\t\tgutter,\n\t\tchildren,\n\t\tshift,\n\t\tmodal = true,\n\n\t\t// From internal components context\n\t\tvariant,\n\n\t\t// Rest\n\t\t...otherProps\n\t} = useContextSystem<\n\t\ttypeof props & Pick< DropdownMenuContextType, 'variant' >\n\t>( props, 'DropdownMenu' );\n\n\tconst parentContext = useContext( DropdownMenuContext );\n\n\tconst computedDirection = isRTL() ? 'rtl' : 'ltr';\n\n\t// If an explicit value for the `placement` prop is not passed,\n\t// apply a default placement of `bottom-start` for the root dropdown,\n\t// and of `right-start` for nested dropdowns.\n\tlet computedPlacement =\n\t\tprops.placement ??\n\t\t( parentContext?.store ? 'right-start' : 'bottom-start' );\n\t// Swap left/right in case of RTL direction\n\tif ( computedDirection === 'rtl' ) {\n\t\tif ( /right/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'right',\n\t\t\t\t'left'\n\t\t\t) as typeof computedPlacement;\n\t\t} else if ( /left/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'left',\n\t\t\t\t'right'\n\t\t\t) as typeof computedPlacement;\n\t\t}\n\t}\n\n\tconst dropdownMenuStore = Ariakit.useMenuStore( {\n\t\tparent: parentContext?.store,\n\t\topen,\n\t\tdefaultOpen,\n\t\tplacement: computedPlacement,\n\t\tfocusLoop: true,\n\t\tsetOpen( willBeOpen ) {\n\t\t\tonOpenChange?.( willBeOpen );\n\t\t},\n\t\trtl: computedDirection === 'rtl',\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { store: dropdownMenuStore, variant } ),\n\t\t[ dropdownMenuStore, variant ]\n\t);\n\n\t// Extract the side from the applied placement — useful for animations.\n\tconst appliedPlacementSide = dropdownMenuStore\n\t\t.useState( 'placement' )\n\t\t.split( '-' )[ 0 ];\n\n\tif (\n\t\tdropdownMenuStore.parent &&\n\t\t! ( isValidElement( trigger ) && DropdownMenuItem === trigger.type )\n\t) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t'For nested DropdownMenus, the `trigger` should always be a `DropdownMenuItem`.'\n\t\t);\n\t}\n\n\tconst hideOnEscape = useCallback(\n\t\t( event: React.KeyboardEvent< Element > ) => {\n\t\t\t// Pressing Escape can cause unexpected consequences (ie. exiting\n\t\t\t// full screen mode on MacOs, close parent modals...).\n\t\t\tevent.preventDefault();\n\t\t\t// Returning `true` causes the menu to hide.\n\t\t\treturn true;\n\t\t},\n\t\t[]\n\t);\n\n\tconst wrapperProps = useMemo(\n\t\t() => ( {\n\t\t\tdir: computedDirection,\n\t\t\tstyle: {\n\t\t\t\tdirection:\n\t\t\t\t\tcomputedDirection as React.CSSProperties[ 'direction' ],\n\t\t\t},\n\t\t} ),\n\t\t[ computedDirection ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ /* Menu trigger */ }\n\t\t\t<Ariakit.MenuButton\n\t\t\t\tref={ ref }\n\t\t\t\tstore={ dropdownMenuStore }\n\t\t\t\trender={\n\t\t\t\t\tdropdownMenuStore.parent\n\t\t\t\t\t\t? cloneElement( trigger, {\n\t\t\t\t\t\t\t\t// Add submenu arrow, unless a `suffix` is explicitly specified\n\t\t\t\t\t\t\t\tsuffix: (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ trigger.props.suffix }\n\t\t\t\t\t\t\t\t\t\t<Styled.SubmenuChevronIcon\n\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\t\tpreserveAspectRatio=\"xMidYMid slice\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t } )\n\t\t\t\t\t\t: trigger\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t{ /* Menu popover */ }\n\t\t\t<Styled.DropdownMenu\n\t\t\t\t{ ...otherProps }\n\t\t\t\tmodal={ modal }\n\t\t\t\tstore={ dropdownMenuStore }\n\t\t\t\t// Root menu has an 8px distance from its trigger,\n\t\t\t\t// otherwise 0 (which causes the submenu to slightly overlap)\n\t\t\t\tgutter={ gutter ?? ( dropdownMenuStore.parent ? 0 : 8 ) }\n\t\t\t\t// Align nested menu by the same (but opposite) amount\n\t\t\t\t// as the menu container's padding.\n\t\t\t\tshift={ shift ?? ( dropdownMenuStore.parent ? -4 : 0 ) }\n\t\t\t\thideOnHoverOutside={ false }\n\t\t\t\tdata-side={ appliedPlacementSide }\n\t\t\t\tvariant={ variant }\n\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\thideOnEscape={ hideOnEscape }\n\t\t\t\tunmountOnHide\n\t\t\t>\n\t\t\t\t<DropdownMenuContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</DropdownMenuContext.Provider>\n\t\t\t</Styled.DropdownMenu>\n\t\t</>\n\t);\n};\nexport const DropdownMenu = contextConnect(\n\tUnconnectedDropdownMenu,\n\t'DropdownMenu'\n);\n\nexport const DropdownMenuSeparator = forwardRef<\n\tHTMLHRElement,\n\tWordPressComponentProps< DropdownMenuSeparatorProps, 'hr', false >\n>( function DropdownMenuSeparator( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuSeparator\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\tvariant={ dropdownMenuContext?.variant }\n\t\t/>\n\t);\n} );\n\nexport const DropdownMenuItemLabel = forwardRef<\n\tHTMLSpanElement,\n\tWordPressComponentProps< { children: React.ReactNode }, 'span', true >\n>( function DropdownMenuItemLabel( props, ref ) {\n\treturn (\n\t\t<Styled.DropdownMenuItemLabel\n\t\t\tnumberOfLines={ 1 }\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n} );\n\nexport const DropdownMenuItemHelpText = forwardRef<\n\tHTMLSpanElement,\n\tWordPressComponentProps< { children: React.ReactNode }, 'span', true >\n>( function DropdownMenuItemHelpText( props, ref ) {\n\treturn (\n\t\t<Styled.DropdownMenuItemHelpText\n\t\t\tnumberOfLines={ 2 }\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;;;AAIA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AASA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAC,sBAAA,CAAAP,OAAA;AAUA,IAAAQ,MAAA,GAAAT,uBAAA,CAAAC,OAAA;AAAmC,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAX,wBAAAe,GAAA,EAAAJ,WAAA,SAAAA,WA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