@wordpress/components 19.8.3 → 19.10.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 +42 -0
- package/CONTRIBUTING.md +80 -7
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +11 -11
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +5 -7
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/box-control/index.js +0 -21
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/utils.js +1 -8
- package/build/box-control/utils.js.map +1 -1
- package/build/button/index.js +3 -5
- package/build/button/index.js.map +1 -1
- package/build/circular-option-picker/index.js +1 -2
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/disabled/index.js +4 -76
- package/build/disabled/index.js.map +1 -1
- package/build/heading/hook.js +1 -1
- package/build/heading/hook.js.map +1 -1
- package/build/input-control/index.js +27 -4
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +42 -30
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +1 -0
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +12 -12
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/notice/index.native.js +44 -40
- package/build/notice/index.native.js.map +1 -1
- package/build/notice/list.native.js +27 -45
- package/build/notice/list.native.js.map +1 -1
- package/build/popover/index.js +6 -52
- package/build/popover/index.js.map +1 -1
- package/build/sandbox/index.js +2 -2
- package/build/sandbox/index.js.map +1 -1
- package/build/select-control/index.js +31 -4
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +8 -8
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/surface/styles.js +8 -8
- package/build/surface/styles.js.map +1 -1
- package/build/text/hook.js +5 -5
- package/build/text/hook.js.map +1 -1
- package/build/text/styles/text-mixins.native.js +1 -1
- package/build/text/styles/text-mixins.native.js.map +1 -1
- package/build/text/styles.js +7 -7
- package/build/text/styles.js.map +1 -1
- package/build/text-control/index.js +35 -28
- package/build/text-control/index.js.map +1 -1
- package/build/text-control/types.js +6 -0
- package/build/text-control/types.js.map +1 -0
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js +6 -4
- package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +52 -36
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/ui/spinner/component.js +1 -1
- package/build/ui/spinner/component.js.map +1 -1
- package/build/unit-control/index.js +3 -3
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +11 -20
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/unit-control/utils.js.map +1 -1
- package/build/utils/colors-values.js +9 -24
- package/build/utils/colors-values.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +11 -11
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +5 -7
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/box-control/index.js +1 -20
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/utils.js +0 -6
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/index.js +3 -4
- package/build-module/button/index.js.map +1 -1
- package/build-module/circular-option-picker/index.js +1 -2
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/disabled/index.js +5 -76
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/heading/hook.js +1 -1
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/input-control/index.js +24 -3
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +42 -30
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -0
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +13 -13
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/notice/index.native.js +45 -41
- package/build-module/notice/index.native.js.map +1 -1
- package/build-module/notice/list.native.js +28 -46
- package/build-module/notice/list.native.js.map +1 -1
- package/build-module/popover/index.js +6 -52
- package/build-module/popover/index.js.map +1 -1
- package/build-module/sandbox/index.js +2 -2
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/select-control/index.js +29 -3
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +8 -8
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/surface/styles.js +8 -8
- package/build-module/surface/styles.js.map +1 -1
- package/build-module/text/hook.js +5 -5
- package/build-module/text/hook.js.map +1 -1
- package/build-module/text/styles/text-mixins.native.js +2 -2
- package/build-module/text/styles/text-mixins.native.js.map +1 -1
- package/build-module/text/styles.js +7 -7
- package/build-module/text/styles.js.map +1 -1
- package/build-module/text-control/index.js +35 -27
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/text-control/types.js +2 -0
- package/build-module/text-control/types.js.map +1 -0
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -5
- package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +51 -36
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/ui/spinner/component.js +1 -1
- package/build-module/ui/spinner/component.js.map +1 -1
- package/build-module/unit-control/index.js +3 -3
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +11 -20
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/unit-control/utils.js.map +1 -1
- package/build-module/utils/colors-values.js +19 -23
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-style/style-rtl.css +24 -0
- package/build-style/style.css +24 -0
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/circular-option-picker/index.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +3 -3
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +23 -3
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/stories/index.d.ts +5 -5
- package/build-types/input-control/styles/input-control-styles.d.ts +1 -0
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +79 -3
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/popover/index.d.ts +0 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +30 -26
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.d.ts +23 -0
- package/build-types/select-control/stories/index.d.ts.map +1 -0
- package/build-types/select-control/styles/select-control-styles.d.ts +3 -4
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/test/select-control.d.ts +2 -0
- package/build-types/select-control/test/select-control.d.ts.map +1 -0
- package/build-types/select-control/types.d.ts +52 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +32 -0
- package/build-types/text-control/index.d.ts.map +1 -0
- package/build-types/text-control/stories/index.d.ts +13 -0
- package/build-types/text-control/stories/index.d.ts.map +1 -0
- package/build-types/text-control/types.d.ts +25 -0
- package/build-types/text-control/types.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
- package/build-types/tools-panel/types.d.ts +0 -1
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +2 -2
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/test/index.d.ts +2 -0
- package/build-types/unit-control/test/index.d.ts.map +1 -0
- package/build-types/unit-control/test/utils.d.ts +2 -0
- package/build-types/unit-control/test/utils.d.ts.map +1 -0
- package/build-types/unit-control/types.d.ts +1 -1
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/unit-control/utils.d.ts +3 -3
- package/build-types/unit-control/utils.d.ts.map +1 -1
- package/build-types/utils/colors-values.d.ts +6 -146
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +5 -3
- package/src/angle-picker-control/angle-circle.js +3 -3
- package/src/box-control/README.md +0 -74
- package/src/box-control/index.js +0 -15
- package/src/box-control/stories/index.js +0 -29
- package/src/box-control/utils.js +0 -7
- package/src/button/index.js +2 -4
- package/src/button/test/index.js +16 -1
- package/src/circular-option-picker/index.js +1 -2
- package/src/color-palette/README.md +0 -1
- package/src/color-palette/test/__snapshots__/index.js.snap +2 -3
- package/src/confirm-dialog/stories/index.js +87 -99
- package/src/date-time/stories/index.js +19 -0
- package/src/date-time/test/date.js +107 -78
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
- package/src/disabled/index.js +5 -90
- package/src/form-file-upload/test/index.js +15 -12
- package/src/heading/hook.ts +1 -1
- package/src/heading/test/__snapshots__/index.js.snap +3 -3
- package/src/input-control/README.md +3 -3
- package/src/input-control/index.tsx +23 -3
- package/src/input-control/stories/index.tsx +63 -0
- package/src/input-control/styles/input-control-styles.tsx +20 -7
- package/src/input-control/types.ts +79 -2
- package/src/menu-item/style.scss +10 -0
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +8 -1
- package/src/mobile/bottom-sheet-select-control/index.native.js +1 -0
- package/src/mobile/html-text-input/style.android.scss +1 -0
- package/src/mobile/html-text-input/style.ios.scss +1 -0
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +9 -1
- package/src/navigation/styles/navigation-styles.js +5 -5
- package/src/notice/index.native.js +44 -54
- package/src/notice/list.native.js +27 -51
- package/src/notice/style.native.scss +1 -0
- package/src/popover/index.js +5 -51
- package/src/query-controls/README.md +2 -2
- package/src/sandbox/index.js +2 -2
- package/src/select-control/README.md +2 -2
- package/src/select-control/index.tsx +30 -29
- package/src/select-control/stories/index.tsx +90 -0
- package/src/select-control/styles/select-control-styles.ts +10 -9
- package/src/select-control/test/{select-control.js → select-control.tsx} +2 -2
- package/src/select-control/types.ts +66 -1
- package/src/surface/styles.js +1 -1
- package/src/text/hook.js +1 -1
- package/src/text/styles/text-mixins.native.js +2 -2
- package/src/text/styles.js +1 -1
- package/src/text/test/__snapshots__/{index.js.snap → index.tsx.snap} +16 -0
- package/src/text/test/{index.js → index.tsx} +12 -6
- package/src/text-control/index.tsx +84 -0
- package/src/text-control/stories/index.tsx +66 -0
- package/src/text-control/types.ts +29 -0
- package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -5
- package/src/toolbar-group/style.scss +20 -0
- package/src/tools-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/tools-panel/test/index.js +71 -18
- package/src/tools-panel/tools-panel-header/component.tsx +75 -33
- package/src/tools-panel/types.ts +0 -1
- package/src/tooltip/test/index.js +6 -0
- package/src/ui/spinner/component.js +1 -1
- package/src/ui/spinner/test/__snapshots__/index.js.snap +3 -3
- package/src/unit-control/index.tsx +2 -5
- package/src/unit-control/styles/unit-control-styles.ts +3 -13
- package/src/unit-control/test/__snapshots__/index.tsx.snap +33 -0
- package/src/unit-control/test/{index.js → index.tsx} +214 -165
- package/src/unit-control/test/{utils.js → utils.ts} +38 -19
- package/src/unit-control/types.ts +4 -1
- package/src/unit-control/utils.ts +5 -3
- package/src/utils/colors-values.js +18 -22
- package/tsconfig.json +9 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build/box-control/visualizer.js +0 -165
- package/build/box-control/visualizer.js.map +0 -1
- package/build-module/box-control/visualizer.js +0 -154
- package/build-module/box-control/visualizer.js.map +0 -1
- package/src/box-control/visualizer.js +0 -116
- package/src/input-control/stories/index.js +0 -71
- package/src/select-control/stories/index.js +0 -104
- package/src/text-control/index.js +0 -72
- package/src/text-control/stories/index.js +0 -46
|
@@ -20,7 +20,7 @@ import type { StateReducer } from '../input-control/reducer/state';
|
|
|
20
20
|
* };
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
export declare const UnitControl: import("react").ForwardRefExoticComponent<Pick<Omit<import("./types").UnitSelectControlProps, "unit"> & Pick<import("../input-control/types").InputControlProps, "hideLabelFromVision"> & {
|
|
23
|
+
export declare const UnitControl: import("react").ForwardRefExoticComponent<Pick<Omit<import("./types").UnitSelectControlProps, "unit"> & Pick<import("../input-control/types").InputControlProps, "hideLabelFromVision" | "__next36pxDefaultSize"> & {
|
|
24
24
|
__unstableStateReducer?: StateReducer | undefined;
|
|
25
25
|
__unstableInputWidth?: import("csstype").Property.Width<string | number> | undefined;
|
|
26
26
|
disableUnits?: boolean | undefined;
|
|
@@ -35,7 +35,7 @@ export declare const UnitControl: import("react").ForwardRefExoticComponent<Pick
|
|
|
35
35
|
onBlur?: FocusEventHandler<HTMLInputElement | HTMLSelectElement> | undefined;
|
|
36
36
|
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & {
|
|
37
37
|
ref?: ((instance: HTMLInputElement | null) => void) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
38
|
-
}, "children" | "value" | "label" | "as" | "onBlur" | "onChange" | "size" | "hideLabelFromVision" | "__unstableInputWidth" | "isPressEnterToChange" | "__unstableStateReducer" | "unit" | "isUnitSelectTabbable" | "units" | "disableUnits" | "isShiftStepEnabled" | "shiftStep" | "isResetValueOnUnitChange" | "onUnitChange">, "type" | "value" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "className" | "color" | "height" | "id" | "lang" | "max" | "min" | "name" | "width" | "role" | "tabIndex" | "crossOrigin" | "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" | "css" | "key" | "list" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "alt" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "autoComplete" | "accept" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "size" | "step" | "hideLabelFromVision" | "__unstableInputWidth" | "isPressEnterToChange" | "__unstableStateReducer" | "unit" | "isUnitSelectTabbable" | "units" | "disableUnits" | "isShiftStepEnabled" | "shiftStep" | "isResetValueOnUnitChange" | "onUnitChange"> & import("react").RefAttributes<any>>;
|
|
38
|
+
}, "children" | "value" | "label" | "as" | "onBlur" | "onChange" | "size" | "hideLabelFromVision" | "__next36pxDefaultSize" | "__unstableInputWidth" | "isPressEnterToChange" | "__unstableStateReducer" | "unit" | "isUnitSelectTabbable" | "units" | "disableUnits" | "isShiftStepEnabled" | "shiftStep" | "isResetValueOnUnitChange" | "onUnitChange">, "type" | "value" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "className" | "color" | "height" | "id" | "lang" | "max" | "min" | "name" | "width" | "role" | "tabIndex" | "crossOrigin" | "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" | "css" | "key" | "list" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "alt" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "autoComplete" | "accept" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "size" | "step" | "hideLabelFromVision" | "__next36pxDefaultSize" | "__unstableInputWidth" | "isPressEnterToChange" | "__unstableStateReducer" | "unit" | "isUnitSelectTabbable" | "units" | "disableUnits" | "isShiftStepEnabled" | "shiftStep" | "isResetValueOnUnitChange" | "onUnitChange"> & import("react").RefAttributes<any>>;
|
|
39
39
|
export { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';
|
|
40
40
|
export default UnitControl;
|
|
41
41
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unit-control/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,iBAAiB,EAMjB,MAAM,OAAO,CAAC;AAyBf,OAAO,KAAK,EAAoB,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unit-control/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,iBAAiB,EAMjB,MAAM,OAAO,CAAC;AAyBf,OAAO,KAAK,EAAoB,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AA0PnE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;8gLAAuC,CAAC;AAEhE,OAAO,EAAE,gCAAgC,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC3E,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-control-styles.d.ts","sourceRoot":"","sources":["../../../src/unit-control/styles/unit-control-styles.ts"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,aAAK,WAAW,GAAG;IAClB,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,aAAK,UAAU,GAAG;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,UAAU,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,IAAI;;;yGAGhB,CAAC;
|
|
1
|
+
{"version":3,"file":"unit-control-styles.d.ts","sourceRoot":"","sources":["../../../src/unit-control/styles/unit-control-styles.ts"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,aAAK,WAAW,GAAG;IAClB,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,aAAK,UAAU,GAAG;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,UAAU,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,IAAI;;;yGAGhB,CAAC;AAyBF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;uBAYtB,CAAC;AAqBF,eAAO,MAAM,SAAS;;;uHAMrB,CAAC;AAEF,eAAO,MAAM,UAAU;;;mIAyBtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/unit-control/test/index.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/unit-control/test/utils.ts"],"names":[],"mappings":""}
|
|
@@ -61,7 +61,7 @@ export declare type UnitSelectControlProps = {
|
|
|
61
61
|
*/
|
|
62
62
|
units?: WPUnitControlUnit[];
|
|
63
63
|
};
|
|
64
|
-
export declare type UnitControlProps = Omit<UnitSelectControlProps, 'unit'> & Pick<InputControlProps, 'hideLabelFromVision'> & {
|
|
64
|
+
export declare type UnitControlProps = Omit<UnitSelectControlProps, 'unit'> & Pick<InputControlProps, 'hideLabelFromVision' | '__next36pxDefaultSize'> & {
|
|
65
65
|
__unstableStateReducer?: StateReducer;
|
|
66
66
|
__unstableInputWidth?: CSSProperties['width'];
|
|
67
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/unit-control/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE9E;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EACX,mBAAmB,EACnB,iBAAiB,EACjB,IAAI,IAAI,SAAS,EACjB,MAAM,wBAAwB,CAAC;AAEhC,oBAAY,UAAU,GAAG,SAAS,CAAC;AAEnC,oBAAY,iBAAiB,GAAG;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,2BAA2B,GAAG,mBAAmB,CAC5D,cAAc,CAAE,iBAAiB,GAAG,gBAAgB,CAAE,EACtD;IAAE,IAAI,CAAC,EAAE,iBAAiB,CAAA;CAAE,CAC5B,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACpC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IACvC;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC5B,CAAC;AAGF,oBAAY,gBAAgB,GAAG,IAAI,CAAE,sBAAsB,EAAE,MAAM,CAAE,GACpE,IAAI,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/unit-control/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE9E;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EACX,mBAAmB,EACnB,iBAAiB,EACjB,IAAI,IAAI,SAAS,EACjB,MAAM,wBAAwB,CAAC;AAEhC,oBAAY,UAAU,GAAG,SAAS,CAAC;AAEnC,oBAAY,iBAAiB,GAAG;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,2BAA2B,GAAG,mBAAmB,CAC5D,cAAc,CAAE,iBAAiB,GAAG,gBAAgB,CAAE,EACtD;IAAE,IAAI,CAAC,EAAE,iBAAiB,CAAA;CAAE,CAC5B,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACpC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IACvC;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC5B,CAAC;AAGF,oBAAY,gBAAgB,GAAG,IAAI,CAAE,sBAAsB,EAAE,MAAM,CAAE,GACpE,IAAI,CACH,iBAAiB,EACjB,qBAAqB,GAAG,uBAAuB,CAC/C,GAAG;IACH,sBAAsB,CAAC,EAAE,YAAY,CAAC;IACtC,oBAAoB,CAAC,EAAE,aAAa,CAAE,OAAO,CAAE,CAAC;IAChD;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,2BAA2B,CAAC;IAC3C;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAE,gBAAgB,GAAG,iBAAiB,CAAE,CAAC;CACnE,CAAC"}
|
|
@@ -32,7 +32,7 @@ export declare function getParsedQuantityAndUnit(rawValue?: string | number, fal
|
|
|
32
32
|
* @param units List of units.
|
|
33
33
|
* @return Whether the list actually contains any units.
|
|
34
34
|
*/
|
|
35
|
-
export declare function hasUnits(units?: WPUnitControlUnit[]):
|
|
35
|
+
export declare function hasUnits(units?: WPUnitControlUnit[]): units is WPUnitControlUnit[];
|
|
36
36
|
/**
|
|
37
37
|
* Parses a quantity and unit from a raw string value, given a list of allowed
|
|
38
38
|
* units and otherwise falling back to the default unit.
|
|
@@ -58,7 +58,7 @@ export declare function parseQuantityAndUnitFromRawValue(rawValue?: string | num
|
|
|
58
58
|
* the list of allowed units, the `fallbackQuantity` is also `undefined` and the list of
|
|
59
59
|
* `allowedUnits` is passed empty.
|
|
60
60
|
*/
|
|
61
|
-
export declare function getValidParsedQuantityAndUnit(rawValue: string | number, allowedUnits
|
|
61
|
+
export declare function getValidParsedQuantityAndUnit(rawValue: string | number, allowedUnits?: WPUnitControlUnit[], fallbackQuantity?: number, fallbackUnit?: string): [number | undefined, string | undefined];
|
|
62
62
|
/**
|
|
63
63
|
* Takes a unit value and finds the matching accessibility label for the
|
|
64
64
|
* unit abbreviation.
|
|
@@ -91,7 +91,7 @@ export declare function filterUnitsWithSettings(allowedUnitValues: string[] | un
|
|
|
91
91
|
export declare const useCustomUnits: ({ units, availableUnits, defaultValues, }: {
|
|
92
92
|
units?: WPUnitControlUnit[] | undefined;
|
|
93
93
|
availableUnits?: string[] | undefined;
|
|
94
|
-
defaultValues
|
|
94
|
+
defaultValues?: Record<string, number> | undefined;
|
|
95
95
|
}) => WPUnitControlUnit[];
|
|
96
96
|
/**
|
|
97
97
|
* Get available units with the unit for the currently selected value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/unit-control/utils.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAiGjD;;GAEG;AACH,eAAO,MAAM,aAAa,qBAA4B,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,SAAS,qBAOrB,CAAC;AAEF,eAAO,MAAM,YAAY,mBAAc,CAAC;AAExC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACvC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAC1B,YAAY,CAAC,EAAE,MAAM,EACrB,YAAY,CAAC,EAAE,iBAAiB,EAAE,GAChC,CAAE,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAE,CAM5C;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/unit-control/utils.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAiGjD;;GAEG;AACH,eAAO,MAAM,aAAa,qBAA4B,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,SAAS,qBAOrB,CAAC;AAEF,eAAO,MAAM,YAAY,mBAAc,CAAC;AAExC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACvC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAC1B,YAAY,CAAC,EAAE,MAAM,EACrB,YAAY,CAAC,EAAE,iBAAiB,EAAE,GAChC,CAAE,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAE,CAM5C;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACvB,KAAK,CAAC,EAAE,iBAAiB,EAAE,GACzB,KAAK,IAAI,iBAAiB,EAAE,CAK9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAC/C,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAC1B,YAAY,GAAE,iBAAiB,EAAkB,GAC/C,CAAE,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAE,CAyB5C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,6BAA6B,CAC5C,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,YAAY,CAAC,EAAE,iBAAiB,EAAE,EAClC,gBAAgB,CAAC,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,GACnB,CAAE,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAE,CAmB5C;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAE,IAAI,EAAE,MAAM,GAAI,MAAM,GAAG,SAAS,CAG5E;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACtC,iBAAiB,sBAAe,EAChC,cAAc,EAAE,iBAAiB,EAAE,GACjC,iBAAiB,EAAE,CASrB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc;;;;MAQtB,iBAAiB,EAmBrB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAC1B,UAAU,CAAC,EAAE,MAAM,EACnB,KAAK,GAAE,iBAAiB,EAAkB,GACxC,iBAAiB,EAAE,CAkBrB"}
|
|
@@ -1,146 +1,3 @@
|
|
|
1
|
-
export namespace BASE {
|
|
2
|
-
const black: string;
|
|
3
|
-
const white: string;
|
|
4
|
-
}
|
|
5
|
-
export namespace G2 {
|
|
6
|
-
namespace blue {
|
|
7
|
-
namespace medium {
|
|
8
|
-
const focus: string;
|
|
9
|
-
const focusDark: string;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
const gray: {
|
|
13
|
-
900: string;
|
|
14
|
-
700: string;
|
|
15
|
-
600: string;
|
|
16
|
-
400: string;
|
|
17
|
-
300: string;
|
|
18
|
-
200: string;
|
|
19
|
-
100: string;
|
|
20
|
-
};
|
|
21
|
-
namespace darkGray {
|
|
22
|
-
const primary: string;
|
|
23
|
-
const heading: string;
|
|
24
|
-
}
|
|
25
|
-
namespace mediumGray {
|
|
26
|
-
const text: string;
|
|
27
|
-
}
|
|
28
|
-
namespace lightGray {
|
|
29
|
-
const ui: string;
|
|
30
|
-
const secondary: string;
|
|
31
|
-
const tertiary: string;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export const DARK_GRAY: {
|
|
35
|
-
900: string;
|
|
36
|
-
800: string;
|
|
37
|
-
700: string;
|
|
38
|
-
600: string;
|
|
39
|
-
500: string;
|
|
40
|
-
400: string;
|
|
41
|
-
300: string;
|
|
42
|
-
200: string;
|
|
43
|
-
150: string;
|
|
44
|
-
100: string;
|
|
45
|
-
placeholder: string;
|
|
46
|
-
};
|
|
47
|
-
export const DARK_OPACITY: {
|
|
48
|
-
900: string;
|
|
49
|
-
800: string;
|
|
50
|
-
700: string;
|
|
51
|
-
600: string;
|
|
52
|
-
500: string;
|
|
53
|
-
400: string;
|
|
54
|
-
300: string;
|
|
55
|
-
200: string;
|
|
56
|
-
100: string;
|
|
57
|
-
backgroundFill: string;
|
|
58
|
-
};
|
|
59
|
-
export const DARK_OPACITY_LIGHT: {
|
|
60
|
-
900: string;
|
|
61
|
-
800: string;
|
|
62
|
-
700: string;
|
|
63
|
-
600: string;
|
|
64
|
-
500: string;
|
|
65
|
-
400: string;
|
|
66
|
-
300: string;
|
|
67
|
-
200: string;
|
|
68
|
-
100: string;
|
|
69
|
-
};
|
|
70
|
-
export const LIGHT_GRAY: {
|
|
71
|
-
900: string;
|
|
72
|
-
800: string;
|
|
73
|
-
700: string;
|
|
74
|
-
600: string;
|
|
75
|
-
500: string;
|
|
76
|
-
400: string;
|
|
77
|
-
300: string;
|
|
78
|
-
200: string;
|
|
79
|
-
100: string;
|
|
80
|
-
placeholder: string;
|
|
81
|
-
};
|
|
82
|
-
export const LIGHT_OPACITY_LIGHT: {
|
|
83
|
-
900: string;
|
|
84
|
-
800: string;
|
|
85
|
-
700: string;
|
|
86
|
-
600: string;
|
|
87
|
-
500: string;
|
|
88
|
-
400: string;
|
|
89
|
-
300: string;
|
|
90
|
-
200: string;
|
|
91
|
-
100: string;
|
|
92
|
-
backgroundFill: string;
|
|
93
|
-
};
|
|
94
|
-
export namespace BLUE {
|
|
95
|
-
export const wordpress: {
|
|
96
|
-
700: string;
|
|
97
|
-
};
|
|
98
|
-
export const dark: {
|
|
99
|
-
900: string;
|
|
100
|
-
};
|
|
101
|
-
const medium_1: {
|
|
102
|
-
900: string;
|
|
103
|
-
800: string;
|
|
104
|
-
700: string;
|
|
105
|
-
600: string;
|
|
106
|
-
500: string;
|
|
107
|
-
400: string;
|
|
108
|
-
300: string;
|
|
109
|
-
200: string;
|
|
110
|
-
100: string;
|
|
111
|
-
highlight: string;
|
|
112
|
-
focus: string;
|
|
113
|
-
};
|
|
114
|
-
export { medium_1 as medium };
|
|
115
|
-
}
|
|
116
|
-
export namespace ALERT {
|
|
117
|
-
const yellow: string;
|
|
118
|
-
const red: string;
|
|
119
|
-
const green: string;
|
|
120
|
-
}
|
|
121
|
-
export namespace ADMIN {
|
|
122
|
-
const theme: string;
|
|
123
|
-
const themeDark10: string;
|
|
124
|
-
}
|
|
125
|
-
export namespace UI {
|
|
126
|
-
import theme_1 = ADMIN.theme;
|
|
127
|
-
export { theme_1 as theme };
|
|
128
|
-
import background = BASE.white;
|
|
129
|
-
export { background };
|
|
130
|
-
export const backgroundDisabled: string;
|
|
131
|
-
export const border: string;
|
|
132
|
-
export const borderHover: string;
|
|
133
|
-
import borderFocus = ADMIN.themeDark10;
|
|
134
|
-
export { borderFocus };
|
|
135
|
-
export const borderDisabled: string;
|
|
136
|
-
export const borderLight: string;
|
|
137
|
-
export const label: string;
|
|
138
|
-
export const textDisabled: string;
|
|
139
|
-
import textDark = BASE.white;
|
|
140
|
-
export { textDark };
|
|
141
|
-
import textLight = BASE.black;
|
|
142
|
-
export { textLight };
|
|
143
|
-
}
|
|
144
1
|
export const COLORS: {
|
|
145
2
|
black: string;
|
|
146
3
|
white: string;
|
|
@@ -157,9 +14,6 @@ export const COLORS: {
|
|
|
157
14
|
150: string;
|
|
158
15
|
100: string;
|
|
159
16
|
placeholder: string;
|
|
160
|
-
} & {
|
|
161
|
-
primary: string;
|
|
162
|
-
heading: string;
|
|
163
17
|
};
|
|
164
18
|
darkOpacity: {
|
|
165
19
|
900: string;
|
|
@@ -187,6 +41,12 @@ export const COLORS: {
|
|
|
187
41
|
mediumGray: {
|
|
188
42
|
text: string;
|
|
189
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* The main gray color object (since Apr 16, 2022).
|
|
46
|
+
*
|
|
47
|
+
* We are in the process of simplifying the colors in this file,
|
|
48
|
+
* please prefer this `gray` object in the meantime.
|
|
49
|
+
*/
|
|
190
50
|
gray: {
|
|
191
51
|
900: string;
|
|
192
52
|
700: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors-values.d.ts","sourceRoot":"","sources":["../../src/utils/colors-values.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"colors-values.d.ts","sourceRoot":"","sources":["../../src/utils/colors-values.js"],"names":[],"mappings":"AAgKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKC;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.10.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,21 +37,21 @@
|
|
|
37
37
|
"@emotion/styled": "^11.6.0",
|
|
38
38
|
"@emotion/utils": "1.0.0",
|
|
39
39
|
"@use-gesture/react": "^10.2.6",
|
|
40
|
-
"@wordpress/a11y": "^3.
|
|
41
|
-
"@wordpress/compose": "^5.
|
|
42
|
-
"@wordpress/date": "^4.
|
|
43
|
-
"@wordpress/deprecated": "^3.
|
|
44
|
-
"@wordpress/dom": "^3.
|
|
45
|
-
"@wordpress/element": "^4.
|
|
46
|
-
"@wordpress/escape-html": "^2.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/i18n": "^4.
|
|
49
|
-
"@wordpress/icons": "^8.
|
|
50
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
51
|
-
"@wordpress/keycodes": "^3.
|
|
52
|
-
"@wordpress/primitives": "^3.
|
|
53
|
-
"@wordpress/rich-text": "^5.
|
|
54
|
-
"@wordpress/warning": "^2.
|
|
40
|
+
"@wordpress/a11y": "^3.8.0",
|
|
41
|
+
"@wordpress/compose": "^5.6.0",
|
|
42
|
+
"@wordpress/date": "^4.8.0",
|
|
43
|
+
"@wordpress/deprecated": "^3.8.0",
|
|
44
|
+
"@wordpress/dom": "^3.8.0",
|
|
45
|
+
"@wordpress/element": "^4.6.0",
|
|
46
|
+
"@wordpress/escape-html": "^2.8.0",
|
|
47
|
+
"@wordpress/hooks": "^3.8.0",
|
|
48
|
+
"@wordpress/i18n": "^4.8.0",
|
|
49
|
+
"@wordpress/icons": "^8.4.0",
|
|
50
|
+
"@wordpress/is-shallow-equal": "^4.8.0",
|
|
51
|
+
"@wordpress/keycodes": "^3.8.0",
|
|
52
|
+
"@wordpress/primitives": "^3.6.0",
|
|
53
|
+
"@wordpress/rich-text": "^5.6.0",
|
|
54
|
+
"@wordpress/warning": "^2.8.0",
|
|
55
55
|
"classnames": "^2.3.1",
|
|
56
56
|
"colord": "^2.7.0",
|
|
57
57
|
"dom-scroll-into-view": "^1.2.1",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "4631d515033397fcfeda77e5755960253caef9bf"
|
|
80
80
|
}
|
|
@@ -43,9 +43,11 @@ export const Row = styled.div`
|
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
45
|
const pointActive = ( { isActive } ) => {
|
|
46
|
-
const boxShadow = isActive ? `0 0 0 2px ${ COLORS.
|
|
47
|
-
const pointColor = isActive ? COLORS.
|
|
48
|
-
const pointColorHover = isActive
|
|
46
|
+
const boxShadow = isActive ? `0 0 0 2px ${ COLORS.gray[ 900 ] }` : null;
|
|
47
|
+
const pointColor = isActive ? COLORS.gray[ 900 ] : COLORS.lightGray[ 800 ];
|
|
48
|
+
const pointColorHover = isActive
|
|
49
|
+
? COLORS.gray[ 900 ]
|
|
50
|
+
: COLORS.blue.medium.focus;
|
|
49
51
|
|
|
50
52
|
return css`
|
|
51
53
|
box-shadow: ${ boxShadow };
|
|
@@ -28,12 +28,11 @@ function AngleCircle( { value, onChange, ...props } ) {
|
|
|
28
28
|
|
|
29
29
|
const changeAngleToPosition = ( event ) => {
|
|
30
30
|
const { x: centerX, y: centerY } = angleCircleCenter.current;
|
|
31
|
-
const { ownerDocument } = angleCircleRef.current;
|
|
32
31
|
// Prevent (drag) mouse events from selecting and accidentally
|
|
33
32
|
// triggering actions from other elements.
|
|
34
33
|
event.preventDefault();
|
|
35
|
-
//
|
|
36
|
-
|
|
34
|
+
// Input control needs to lose focus and by preventDefault above, it doesn't.
|
|
35
|
+
event.target.focus();
|
|
37
36
|
onChange( getAngle( centerX, centerY, event.clientX, event.clientY ) );
|
|
38
37
|
};
|
|
39
38
|
|
|
@@ -72,6 +71,7 @@ function AngleCircle( { value, onChange, ...props } ) {
|
|
|
72
71
|
value ? { transform: `rotate(${ value }deg)` } : undefined
|
|
73
72
|
}
|
|
74
73
|
className="components-angle-picker-control__angle-circle-indicator-wrapper"
|
|
74
|
+
tabIndex={ -1 }
|
|
75
75
|
>
|
|
76
76
|
<CircleIndicator className="components-angle-picker-control__angle-circle-indicator" />
|
|
77
77
|
</CircleIndicatorWrapper>
|
|
@@ -29,73 +29,6 @@ const Example = () => {
|
|
|
29
29
|
};
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
### Visualizer
|
|
33
|
-
|
|
34
|
-
BoxControl provides a companion component that visually renders value changes. Place the component you would like the sides visualized within the companion `<Visualizer>` component.
|
|
35
|
-
|
|
36
|
-
```jsx
|
|
37
|
-
import { __experimentalBoxControl as BoxControl } from '@wordpress/components';
|
|
38
|
-
import { useState } from '@wordpress/element';
|
|
39
|
-
|
|
40
|
-
import MyComponent from './my-component';
|
|
41
|
-
|
|
42
|
-
const { Visualizer } = BoxControl;
|
|
43
|
-
|
|
44
|
-
const Example = () => {
|
|
45
|
-
const [ values, setValues ] = useState( {
|
|
46
|
-
top: '50px',
|
|
47
|
-
left: '10%',
|
|
48
|
-
right: '10%',
|
|
49
|
-
bottom: '50px',
|
|
50
|
-
} );
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<>
|
|
54
|
-
<BoxControl
|
|
55
|
-
values={ values }
|
|
56
|
-
onChange={ ( nextValues ) => setValues( nextValues ) }
|
|
57
|
-
/>
|
|
58
|
-
<Visualizer>
|
|
59
|
-
<MyComponent />
|
|
60
|
-
</Visualizer>
|
|
61
|
-
</>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Alternatively, the `<Visualizer>` can be nested as a sibling to the component you would like visualized. Using `<Visualizer />` in this manner will require the parent element having a `position` style.
|
|
67
|
-
|
|
68
|
-
```jsx
|
|
69
|
-
import { __experimentalBoxControl as BoxControl } from '@wordpress/components';
|
|
70
|
-
import { useState } from '@wordpress/element';
|
|
71
|
-
|
|
72
|
-
import MyComponent from './my-component';
|
|
73
|
-
|
|
74
|
-
const { Visualizer } = BoxControl;
|
|
75
|
-
|
|
76
|
-
const Example = () => {
|
|
77
|
-
const [ values, setValues ] = useState( {
|
|
78
|
-
top: '50px',
|
|
79
|
-
left: '10%',
|
|
80
|
-
right: '10%',
|
|
81
|
-
bottom: '50px',
|
|
82
|
-
} );
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<>
|
|
86
|
-
<BoxControl
|
|
87
|
-
values={ values }
|
|
88
|
-
onChange={ ( nextValues ) => setValues( nextValues ) }
|
|
89
|
-
/>
|
|
90
|
-
<div style={ { position: 'relative' } }>
|
|
91
|
-
<Visualizer />
|
|
92
|
-
<MyComponent />
|
|
93
|
-
</div>
|
|
94
|
-
</>
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
```
|
|
98
|
-
|
|
99
32
|
## Props
|
|
100
33
|
### allowReset
|
|
101
34
|
|
|
@@ -135,13 +68,6 @@ A callback function when an input value changes.
|
|
|
135
68
|
- Type: `Function`
|
|
136
69
|
- Required: Yes
|
|
137
70
|
|
|
138
|
-
### onChangeShowVisualizer
|
|
139
|
-
|
|
140
|
-
A callback function for visualizer changes, based on input hover interactions.
|
|
141
|
-
|
|
142
|
-
- Type: `Function`
|
|
143
|
-
- Required: Yes
|
|
144
|
-
|
|
145
71
|
### resetValues
|
|
146
72
|
|
|
147
73
|
The `top`, `right`, `bottom`, and `left` box dimension values to use when the control is reset.
|
package/src/box-control/index.js
CHANGED
|
@@ -21,7 +21,6 @@ import AxialInputControls from './axial-input-controls';
|
|
|
21
21
|
import BoxControlIcon from './icon';
|
|
22
22
|
import { Text } from '../text';
|
|
23
23
|
import LinkedButton from './linked-button';
|
|
24
|
-
import Visualizer from './visualizer';
|
|
25
24
|
import {
|
|
26
25
|
Root,
|
|
27
26
|
Header,
|
|
@@ -30,7 +29,6 @@ import {
|
|
|
30
29
|
import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
|
|
31
30
|
import {
|
|
32
31
|
DEFAULT_VALUES,
|
|
33
|
-
DEFAULT_VISUALIZER_VALUES,
|
|
34
32
|
getInitialSide,
|
|
35
33
|
isValuesMixed,
|
|
36
34
|
isValuesDefined,
|
|
@@ -50,7 +48,6 @@ export default function BoxControl( {
|
|
|
50
48
|
id: idProp,
|
|
51
49
|
inputProps = defaultInputProps,
|
|
52
50
|
onChange = noop,
|
|
53
|
-
onChangeShowVisualizer = noop,
|
|
54
51
|
label = __( 'Box Control' ),
|
|
55
52
|
values: valuesProp,
|
|
56
53
|
units,
|
|
@@ -103,14 +100,6 @@ export default function BoxControl( {
|
|
|
103
100
|
setIsDirty( true );
|
|
104
101
|
};
|
|
105
102
|
|
|
106
|
-
const handleOnHoverOn = ( next = {} ) => {
|
|
107
|
-
onChangeShowVisualizer( { ...DEFAULT_VISUALIZER_VALUES, ...next } );
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const handleOnHoverOff = ( next = {} ) => {
|
|
111
|
-
onChangeShowVisualizer( { ...DEFAULT_VISUALIZER_VALUES, ...next } );
|
|
112
|
-
};
|
|
113
|
-
|
|
114
103
|
const handleOnReset = () => {
|
|
115
104
|
onChange( resetValues );
|
|
116
105
|
setValues( resetValues );
|
|
@@ -122,8 +111,6 @@ export default function BoxControl( {
|
|
|
122
111
|
...inputProps,
|
|
123
112
|
onChange: handleOnChange,
|
|
124
113
|
onFocus: handleOnFocus,
|
|
125
|
-
onHoverOn: handleOnHoverOn,
|
|
126
|
-
onHoverOff: handleOnHoverOff,
|
|
127
114
|
isLinked,
|
|
128
115
|
units,
|
|
129
116
|
selectedUnits,
|
|
@@ -189,5 +176,3 @@ export default function BoxControl( {
|
|
|
189
176
|
</Root>
|
|
190
177
|
);
|
|
191
178
|
}
|
|
192
|
-
|
|
193
|
-
BoxControl.__Visualizer = Visualizer;
|
|
@@ -11,7 +11,6 @@ import { useState } from '@wordpress/element';
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import BoxControl from '../';
|
|
14
|
-
import BoxControlVisualizer from '../visualizer';
|
|
15
14
|
import { Flex, FlexBlock } from '../../flex';
|
|
16
15
|
|
|
17
16
|
export default {
|
|
@@ -36,7 +35,6 @@ function DemoExample( {
|
|
|
36
35
|
splitOnAxis = false,
|
|
37
36
|
} ) {
|
|
38
37
|
const [ values, setValues ] = useState( defaultValues );
|
|
39
|
-
const [ showVisualizer, setShowVisualizer ] = useState( {} );
|
|
40
38
|
|
|
41
39
|
return (
|
|
42
40
|
<Container align="top" gap={ 8 }>
|
|
@@ -47,31 +45,14 @@ function DemoExample( {
|
|
|
47
45
|
values={ values }
|
|
48
46
|
sides={ sides }
|
|
49
47
|
onChange={ setValues }
|
|
50
|
-
onChangeShowVisualizer={ setShowVisualizer }
|
|
51
48
|
splitOnAxis={ splitOnAxis }
|
|
52
49
|
/>
|
|
53
50
|
</Content>
|
|
54
51
|
</FlexBlock>
|
|
55
|
-
<FlexBlock>
|
|
56
|
-
<Content>
|
|
57
|
-
<BoxContainer>
|
|
58
|
-
<BoxControlVisualizer
|
|
59
|
-
showValues={ showVisualizer }
|
|
60
|
-
values={ values }
|
|
61
|
-
>
|
|
62
|
-
<Box />
|
|
63
|
-
</BoxControlVisualizer>
|
|
64
|
-
</BoxContainer>
|
|
65
|
-
</Content>
|
|
66
|
-
</FlexBlock>
|
|
67
52
|
</Container>
|
|
68
53
|
);
|
|
69
54
|
}
|
|
70
55
|
|
|
71
|
-
export const visualizer = () => {
|
|
72
|
-
return <DemoExample />;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
56
|
export const arbitrarySides = () => {
|
|
76
57
|
return (
|
|
77
58
|
<DemoExample
|
|
@@ -108,16 +89,6 @@ const Container = styled( Flex )`
|
|
|
108
89
|
max-width: 780px;
|
|
109
90
|
`;
|
|
110
91
|
|
|
111
|
-
const BoxContainer = styled.div`
|
|
112
|
-
width: 300px;
|
|
113
|
-
height: 300px;
|
|
114
|
-
`;
|
|
115
|
-
|
|
116
|
-
const Box = styled.div`
|
|
117
|
-
background: #ddd;
|
|
118
|
-
height: 300px;
|
|
119
|
-
`;
|
|
120
|
-
|
|
121
92
|
const Content = styled.div`
|
|
122
93
|
padding: 20px;
|
|
123
94
|
`;
|
package/src/box-control/utils.js
CHANGED
|
@@ -31,13 +31,6 @@ export const DEFAULT_VALUES = {
|
|
|
31
31
|
left: undefined,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
export const DEFAULT_VISUALIZER_VALUES = {
|
|
35
|
-
top: false,
|
|
36
|
-
right: false,
|
|
37
|
-
bottom: false,
|
|
38
|
-
left: false,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
34
|
export const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];
|
|
42
35
|
|
|
43
36
|
/**
|
package/src/button/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
5
|
import classnames from 'classnames';
|
|
6
|
-
import { isArray } from 'lodash';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* WordPress dependencies
|
|
@@ -140,8 +139,7 @@ export function Button( props, ref ) {
|
|
|
140
139
|
// There's a label and...
|
|
141
140
|
( !! label &&
|
|
142
141
|
// The children are empty and...
|
|
143
|
-
|
|
144
|
-
( isArray( children ) && ! children.length ) ) &&
|
|
142
|
+
! children?.length &&
|
|
145
143
|
// The tooltip is not explicitly disabled.
|
|
146
144
|
false !== showTooltip ) );
|
|
147
145
|
|
|
@@ -186,7 +184,7 @@ export function Button( props, ref ) {
|
|
|
186
184
|
return (
|
|
187
185
|
<>
|
|
188
186
|
<Tooltip
|
|
189
|
-
text={ describedBy ? describedBy : label }
|
|
187
|
+
text={ children?.length && describedBy ? describedBy : label }
|
|
190
188
|
shortcut={ shortcut }
|
|
191
189
|
position={ tooltipPosition }
|
|
192
190
|
>
|