@wordpress/components 21.0.1 → 21.1.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 +16 -7
- package/build/autocomplete/get-default-use-items.js +3 -3
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/box-control/unit-control.js +0 -1
- package/build/box-control/unit-control.js.map +1 -1
- package/build/button/index.js +5 -1
- package/build/button/index.js.map +1 -1
- package/build/drop-zone/index.js +7 -1
- package/build/drop-zone/index.js.map +1 -1
- package/build/higher-order/with-filters/index.js +1 -1
- package/build/higher-order/with-filters/index.js.map +1 -1
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -3
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js +3 -3
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/range-control/input-range.js +1 -15
- package/build/range-control/input-range.js.map +1 -1
- package/build/range-control/tooltip.js +1 -1
- package/build/range-control/tooltip.js.map +1 -1
- package/build/range-control/utils.js +2 -58
- package/build/range-control/utils.js.map +1 -1
- package/build/tree-grid/index.js +13 -8
- package/build/tree-grid/index.js.map +1 -1
- package/build/unit-control/index.js +2 -2
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/index.native.js +10 -2
- package/build/unit-control/index.native.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +21 -32
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/utils/hooks/use-controlled-state.js +2 -3
- package/build/utils/hooks/use-controlled-state.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js +1 -1
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/box-control/unit-control.js +0 -1
- package/build-module/box-control/unit-control.js.map +1 -1
- package/build-module/button/index.js +5 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/drop-zone/index.js +7 -1
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/higher-order/with-filters/index.js +2 -2
- package/build-module/higher-order/with-filters/index.js.map +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/range-control/input-range.js +1 -14
- package/build-module/range-control/input-range.js.map +1 -1
- package/build-module/range-control/tooltip.js +1 -1
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/range-control/utils.js +2 -57
- package/build-module/range-control/utils.js.map +1 -1
- package/build-module/tree-grid/index.js +13 -8
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/unit-control/index.js +2 -2
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/index.native.js +10 -2
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +20 -31
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-state.js +3 -4
- package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/drop-zone/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.d.ts +8 -0
- package/build-types/popover/stories/e2e/index.d.ts.map +1 -0
- package/build-types/range-control/input-range.d.ts.map +1 -1
- package/build-types/range-control/stories/index.d.ts.map +1 -1
- package/build-types/range-control/types.d.ts +0 -2
- package/build-types/range-control/types.d.ts.map +1 -1
- package/build-types/range-control/utils.d.ts +1 -12
- package/build-types/range-control/utils.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -4
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/autocomplete/get-default-use-items.js +1 -1
- package/src/box-control/unit-control.js +0 -1
- package/src/button/index.js +7 -1
- package/src/button/test/index.js +36 -0
- package/src/color-palette/test/__snapshots__/index.js.snap +169 -1106
- package/src/color-palette/test/index.js +107 -61
- package/src/drop-zone/index.tsx +4 -1
- package/src/font-size-picker/stories/e2e/index.js +47 -0
- package/src/higher-order/with-filters/index.js +2 -2
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -2
- package/src/mobile/link-picker/link-picker-results.native.js +1 -1
- package/src/popover/stories/e2e/index.tsx +25 -0
- package/src/range-control/README.md +6 -7
- package/src/range-control/input-range.tsx +1 -21
- package/src/range-control/stories/index.tsx +2 -1
- package/src/range-control/tooltip.tsx +1 -1
- package/src/range-control/types.ts +0 -2
- package/src/range-control/utils.ts +3 -75
- package/src/tree-grid/index.js +23 -14
- package/src/tree-grid/test/__snapshots__/cell.js.snap +21 -17
- package/src/tree-grid/test/__snapshots__/index.js.snap +1 -1
- package/src/unit-control/index.native.js +8 -0
- package/src/unit-control/index.tsx +2 -2
- package/src/unit-control/styles/unit-control-styles.ts +0 -20
- package/src/unit-control/test/index.tsx +6 -3
- package/src/utils/hooks/use-controlled-state.js +9 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/src/unit-control/test/__snapshots__/index.tsx.snap +0 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drop-zone/index.tsx"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EAAY,aAAa,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAE,EAClC,SAAS,EACT,KAAK,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,GAAG,SAAS,EACZ,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drop-zone/index.tsx"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EAAY,aAAa,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAE,EAClC,SAAS,EACT,KAAK,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,GAAG,SAAS,EACZ,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAE,eA0IxD;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("../../../ui/context").WordPressComponentProps<import("../../types").PopoverProps, "div", false>, "style" | "inherit" | "initial" | "transition" | "layout" | "drag" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "transformTemplate" | "transformValues" | "exit" | "variants" | "onBeforeLayoutMeasure" | "onLayoutMeasure" | "onLayoutAnimationComplete" | "onUpdate" | "onAnimationComplete" | "onUnmount" | "onPan" | "onPanStart" | "onPanSessionStart" | "onPanEnd" | "onTap" | "onTapStart" | "onTapCancel" | "whileTap" | "whileHover" | "onHoverStart" | "onHoverEnd" | "whileFocus" | "whileInView" | "onViewportEnter" | "onViewportLeave" | "viewport" | "whileDrag" | "dragDirectionLock" | "dragPropagation" | "dragConstraints" | "dragElastic" | "dragMomentum" | "dragTransition" | "dragControls" | "dragSnapToOrigin" | "dragListener" | "onMeasureDragConstraints" | "_dragX" | "_dragY" | "onDirectionLock" | "onDragTransitionEnd" | "layoutId" | "layoutDependency" | "layoutScroll" | "custom"> & import("react").RefAttributes<any>>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Default: () => JSX.Element;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/popover/stories/e2e/index.tsx"],"names":[],"mappings":";;;;;AAUA,wBAGE;AAEF,eAAO,MAAM,OAAO,mBASnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-range.d.ts","sourceRoot":"","sources":["../../src/range-control/input-range.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"input-range.d.ts","sourceRoot":"","sources":["../../src/range-control/input-range.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAuB/C,QAAA,MAAM,kBAAkB;;oDAA2B,CAAC;AAEpD,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/range-control/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQtE;;GAEG;AACH,OAAO,YAAY,MAAM,IAAI,CAAC;AAI9B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/range-control/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQtE;;GAEG;AACH,OAAO,YAAY,MAAM,IAAI,CAAC;AAI9B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,YAAY,CAkC7C,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,YAAY,CAExD,CAAC;AASF;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,cAAc,CAAE,OAAO,YAAY,CAoB5D,CAAC;AAwDF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAE,OAAO,YAAY,CACjD,CAAC;AAUzB;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAE,OAAO,YAAY,CACjD,CAAC;AAazB;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,cAAc,CACvD,OAAO,YAAY,CACO,CAAC;AAS5B;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAE,OAAO,YAAY,CACnD,CAAC;AASzB;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAE,OAAO,YAAY,CAC7C,CAAC"}
|
|
@@ -220,10 +220,8 @@ export declare type RailProps = MarksProps & {
|
|
|
220
220
|
export declare type InputRangeProps = {
|
|
221
221
|
describedBy?: string;
|
|
222
222
|
label?: string;
|
|
223
|
-
onHideTooltip?: () => void;
|
|
224
223
|
onMouseLeave?: MouseEventHandler<HTMLInputElement>;
|
|
225
224
|
onMouseMove?: MouseEventHandler<HTMLInputElement>;
|
|
226
|
-
onShowTooltip?: () => void;
|
|
227
225
|
value?: number | '';
|
|
228
226
|
};
|
|
229
227
|
export declare type WrapperProps = Pick<BaseControlProps, '__nextHasNoMarginBottom'> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/range-control/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,OAAO,CAAC;AAEf;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,oBAAY,YAAY,GAAG;IAC1B;;;;OAIG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M,CAAC;CACjB,CAAC;AAEF,oBAAY,YAAY,GAAG,YAAY,GAAG;IACzC,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UseControlledRangeValueArgs
|
|
1
|
+
import type { UseControlledRangeValueArgs } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* A float supported clamp function for a specific value.
|
|
4
4
|
*
|
|
@@ -16,15 +16,4 @@ export declare function floatClamp(value: number | null, min: number, max: numbe
|
|
|
16
16
|
* @return The controlled value and the value setter.
|
|
17
17
|
*/
|
|
18
18
|
export declare function useControlledRangeValue(settings: UseControlledRangeValueArgs): readonly [number | null, (nextValue: number | null) => void];
|
|
19
|
-
/**
|
|
20
|
-
* Hook to encapsulate the debouncing "hover" to better handle the showing
|
|
21
|
-
* and hiding of the Tooltip.
|
|
22
|
-
*
|
|
23
|
-
* @param settings
|
|
24
|
-
* @return Bound properties for use on a React.Node.
|
|
25
|
-
*/
|
|
26
|
-
export declare function useDebouncedHoverInteraction(settings: UseDebouncedHoverInteractionArgs): {
|
|
27
|
-
onMouseMove: (event: any) => void;
|
|
28
|
-
onMouseLeave: (event: any) => void;
|
|
29
|
-
};
|
|
30
19
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/range-control/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/range-control/utils.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAE,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAMzE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,2BAA2B,wCAYvB,MAAM,GAAG,IAAI,WAa3B"}
|
|
@@ -3,9 +3,6 @@ import type { SelectSize } from '../types';
|
|
|
3
3
|
declare type SelectProps = {
|
|
4
4
|
selectSize: SelectSize;
|
|
5
5
|
};
|
|
6
|
-
declare type InputProps = {
|
|
7
|
-
disableUnits?: boolean;
|
|
8
|
-
};
|
|
9
6
|
export declare const Root: import("@emotion/styled").StyledComponent<{
|
|
10
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
11
8
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -23,7 +20,7 @@ export declare const ValueInput: import("@emotion/styled").StyledComponent<Omit<
|
|
|
23
20
|
value?: string | number | undefined;
|
|
24
21
|
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "type" | "children" | "value" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "as" | "name" | "hidden" | "color" | "height" | "translate" | "width" | "size" | "multiple" | "disabled" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "list" | "hideLabelFromVision" | "step" | "max" | "min" | "crossOrigin" | "__next36pxDefaultSize" | "suffix" | "__unstableInputWidth" | "labelPosition" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "readOnly" | "required" | "src" | "dragDirection" | "dragThreshold" | "isDragEnabled" | "isPressEnterToChange" | "onValidate" | "__unstableStateReducer" | "hideHTMLArrows" | "isShiftStepEnabled" | "shiftStep"> & import("react").RefAttributes<any> & {
|
|
25
22
|
theme?: import("@emotion/react").Theme | undefined;
|
|
26
|
-
}
|
|
23
|
+
}, {}, {}>;
|
|
27
24
|
export declare const UnitLabel: import("@emotion/styled").StyledComponent<{
|
|
28
25
|
theme?: import("@emotion/react").Theme | undefined;
|
|
29
26
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-control-styles.d.ts","sourceRoot":"","sources":["../../../src/unit-control/styles/unit-control-styles.ts"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK3C,aAAK,WAAW,GAAG;IAClB,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"unit-control-styles.d.ts","sourceRoot":"","sources":["../../../src/unit-control/styles/unit-control-styles.ts"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK3C,aAAK,WAAW,GAAG;IAClB,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,IAAI;;;yGAQhB,CAAC;AAKF,eAAO,MAAM,UAAU;;;;;;;;;;;;;UAOtB,CAAC;AAmCF,eAAO,MAAM,SAAS;;;uHAQrB,CAAC;AA+CF,eAAO,MAAM,UAAU;;;mIAqBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-controlled-state.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/use-controlled-state.js"],"names":[],"mappings":";;;;;aAac,CAAC,GAAG,SAAS;;;;cACb,CAAC,GAAG,EAAE;;AAapB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,kIAFuC,IAAI,
|
|
1
|
+
{"version":3,"file":"use-controlled-state.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/use-controlled-state.js"],"names":[],"mappings":";;;;;aAac,CAAC,GAAG,SAAS;;;;cACb,CAAC,GAAG,EAAE;;AAapB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,kIAFuC,IAAI,EAmC1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "21.0
|
|
3
|
+
"version": "21.1.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -38,21 +38,21 @@
|
|
|
38
38
|
"@emotion/utils": "^1.0.0",
|
|
39
39
|
"@floating-ui/react-dom": "^1.0.0",
|
|
40
40
|
"@use-gesture/react": "^10.2.6",
|
|
41
|
-
"@wordpress/a11y": "^3.
|
|
42
|
-
"@wordpress/compose": "^5.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^4.
|
|
47
|
-
"@wordpress/escape-html": "^2.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
52
|
-
"@wordpress/keycodes": "^3.
|
|
53
|
-
"@wordpress/primitives": "^3.
|
|
54
|
-
"@wordpress/rich-text": "^5.
|
|
55
|
-
"@wordpress/warning": "^2.
|
|
41
|
+
"@wordpress/a11y": "^3.18.0",
|
|
42
|
+
"@wordpress/compose": "^5.16.0",
|
|
43
|
+
"@wordpress/date": "^4.18.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.18.0",
|
|
45
|
+
"@wordpress/dom": "^3.18.0",
|
|
46
|
+
"@wordpress/element": "^4.16.0",
|
|
47
|
+
"@wordpress/escape-html": "^2.18.0",
|
|
48
|
+
"@wordpress/hooks": "^3.18.0",
|
|
49
|
+
"@wordpress/i18n": "^4.18.0",
|
|
50
|
+
"@wordpress/icons": "^9.9.0",
|
|
51
|
+
"@wordpress/is-shallow-equal": "^4.18.0",
|
|
52
|
+
"@wordpress/keycodes": "^3.18.0",
|
|
53
|
+
"@wordpress/primitives": "^3.16.0",
|
|
54
|
+
"@wordpress/rich-text": "^5.16.0",
|
|
55
|
+
"@wordpress/warning": "^2.18.0",
|
|
56
56
|
"change-case": "^4.1.2",
|
|
57
57
|
"classnames": "^2.3.1",
|
|
58
58
|
"colord": "^2.7.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "23e136283fa1d3b8d9d8b33869f871ad5eb77726"
|
|
82
82
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { debounce } from 'lodash';
|
|
5
4
|
import removeAccents from 'remove-accents';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
9
8
|
*/
|
|
9
|
+
import { debounce } from '@wordpress/compose';
|
|
10
10
|
import { useLayoutEffect, useState } from '@wordpress/element';
|
|
11
11
|
|
|
12
12
|
/**
|
package/src/button/index.js
CHANGED
|
@@ -92,6 +92,12 @@ export function Button( props, ref ) {
|
|
|
92
92
|
'components-button__description'
|
|
93
93
|
);
|
|
94
94
|
|
|
95
|
+
const hasChildren =
|
|
96
|
+
children?.[ 0 ] &&
|
|
97
|
+
children[ 0 ] !== null &&
|
|
98
|
+
// Tooltip should not considered as a child
|
|
99
|
+
children?.[ 0 ]?.props?.className !== 'components-tooltip';
|
|
100
|
+
|
|
95
101
|
const classes = classnames( 'components-button', className, {
|
|
96
102
|
'is-secondary': variant === 'secondary',
|
|
97
103
|
'is-primary': variant === 'primary',
|
|
@@ -101,7 +107,7 @@ export function Button( props, ref ) {
|
|
|
101
107
|
'is-busy': isBusy,
|
|
102
108
|
'is-link': variant === 'link',
|
|
103
109
|
'is-destructive': isDestructive,
|
|
104
|
-
'has-text': !! icon &&
|
|
110
|
+
'has-text': !! icon && hasChildren,
|
|
105
111
|
'has-icon': !! icon,
|
|
106
112
|
} );
|
|
107
113
|
|
package/src/button/test/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import { plusCircle } from '@wordpress/icons';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import Button from '../';
|
|
16
|
+
import { Tooltip } from '../../';
|
|
16
17
|
|
|
17
18
|
jest.mock( '../../icon', () => () => <div data-testid="test-icon" /> );
|
|
18
19
|
|
|
@@ -75,6 +76,41 @@ describe( 'Button', () => {
|
|
|
75
76
|
expect( screen.getByRole( 'button' ) ).toHaveClass( 'is-pressed' );
|
|
76
77
|
} );
|
|
77
78
|
|
|
79
|
+
it( 'should render a button element with has-text when children are passed', async () => {
|
|
80
|
+
render( <Button icon={ plusCircle }>Children</Button> );
|
|
81
|
+
await screen.getByRole( 'button' ).focus();
|
|
82
|
+
expect( screen.getByRole( 'button' ) ).toHaveClass( 'has-text' );
|
|
83
|
+
} );
|
|
84
|
+
|
|
85
|
+
it( 'should render a button element without has-text when children are not passed', async () => {
|
|
86
|
+
render( <Button icon={ plusCircle }></Button> );
|
|
87
|
+
expect( screen.getByRole( 'button' ) ).not.toHaveClass(
|
|
88
|
+
'has-text'
|
|
89
|
+
);
|
|
90
|
+
} );
|
|
91
|
+
|
|
92
|
+
it( 'should render a button element without has-text when children are empty fragment', async () => {
|
|
93
|
+
render(
|
|
94
|
+
<Button icon={ plusCircle }>
|
|
95
|
+
<></>
|
|
96
|
+
</Button>
|
|
97
|
+
);
|
|
98
|
+
expect( screen.getByRole( 'button' ) ).not.toHaveClass(
|
|
99
|
+
'has-text'
|
|
100
|
+
);
|
|
101
|
+
} );
|
|
102
|
+
|
|
103
|
+
it( 'should render a button element without has-text when a button wrapped in Tooltip', async () => {
|
|
104
|
+
render(
|
|
105
|
+
<Tooltip text="Help text">
|
|
106
|
+
<Button icon={ plusCircle } />
|
|
107
|
+
</Tooltip>
|
|
108
|
+
);
|
|
109
|
+
expect( screen.getByRole( 'button' ) ).not.toHaveClass(
|
|
110
|
+
'has-text'
|
|
111
|
+
);
|
|
112
|
+
} );
|
|
113
|
+
|
|
78
114
|
it( 'should add a disabled prop to the button', () => {
|
|
79
115
|
render( <Button disabled /> );
|
|
80
116
|
|