@wordpress/components 25.15.0 → 25.16.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 +26 -0
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +3 -1
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/types.js.map +1 -1
- package/build/border-control/border-control/component.js +5 -1
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +18 -15
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +2 -1
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-style-picker/component.js +21 -49
- package/build/border-control/border-control-style-picker/component.js.map +1 -1
- package/build/border-control/styles.js +15 -27
- package/build/border-control/styles.js.map +1 -1
- package/build/border-control/types.js.map +1 -1
- package/build/box-control/all-input-control.js +35 -29
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/axial-input-controls.js +40 -54
- package/build/box-control/axial-input-controls.js.map +1 -1
- package/build/box-control/index.js +21 -24
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/input-controls.js +45 -37
- package/build/box-control/input-controls.js.map +1 -1
- package/build/box-control/styles/box-control-styles.js +50 -112
- package/build/box-control/styles/box-control-styles.js.map +1 -1
- package/build/box-control/types.js.map +1 -1
- package/build/box-control/utils.js +123 -8
- package/build/box-control/utils.js.map +1 -1
- package/build/button/index.js +14 -16
- package/build/button/index.js.map +1 -1
- package/build/button/types.js.map +1 -1
- package/build/color-palette/index.native.js +11 -7
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/hsl-input.js +55 -33
- package/build/color-picker/hsl-input.js.map +1 -1
- package/build/custom-select-control-v2/index.js +3 -2
- package/build/custom-select-control-v2/index.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +8 -4
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
- package/build/theme/styles.js +11 -6
- package/build/theme/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/utils.js +7 -1
- package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build/tooltip/index.js +35 -8
- package/build/tooltip/index.js.map +1 -1
- package/build/tooltip/types.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js +3 -1
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-box-control/types.js.map +1 -1
- package/build-module/border-control/border-control/component.js +5 -1
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +18 -15
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +2 -1
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-style-picker/component.js +21 -48
- package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
- package/build-module/border-control/styles.js +14 -24
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/border-control/types.js.map +1 -1
- package/build-module/box-control/all-input-control.js +38 -28
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/axial-input-controls.js +42 -57
- package/build-module/box-control/axial-input-controls.js.map +1 -1
- package/build-module/box-control/index.js +22 -25
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/input-controls.js +47 -40
- package/build-module/box-control/input-controls.js.map +1 -1
- package/build-module/box-control/styles/box-control-styles.js +45 -105
- package/build-module/box-control/styles/box-control-styles.js.map +1 -1
- package/build-module/box-control/types.js.map +1 -1
- package/build-module/box-control/utils.js +121 -7
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/button/index.js +14 -16
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/types.js.map +1 -1
- package/build-module/color-palette/index.native.js +11 -7
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/hsl-input.js +55 -33
- package/build-module/color-picker/hsl-input.js.map +1 -1
- package/build-module/custom-select-control-v2/index.js +3 -2
- package/build-module/custom-select-control-v2/index.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +8 -4
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
- package/build-module/theme/styles.js +11 -2
- package/build-module/theme/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/utils.js +7 -1
- package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build-module/tooltip/index.js +34 -9
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/types.js.map +1 -1
- package/build-style/style-rtl.css +6 -4
- package/build-style/style.css +6 -4
- package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +3 -3
- package/build-types/border-box-control/stories/index.story.d.ts +2 -1
- package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +6 -0
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +1 -0
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +2 -0
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts +1 -0
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -0
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/component.d.ts +3 -4
- package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
- package/build-types/border-control/stories/index.story.d.ts +12 -6
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts +0 -2
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +12 -1
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/box-control/all-input-control.d.ts +1 -1
- package/build-types/box-control/all-input-control.d.ts.map +1 -1
- package/build-types/box-control/axial-input-controls.d.ts +1 -1
- package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts +1 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/input-controls.d.ts +1 -1
- package/build-types/box-control/input-controls.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +24 -18
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +49 -23
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +12 -12
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +2 -1
- package/build-types/box-control/utils.d.ts.map +1 -1
- package/build-types/button/deprecated.d.ts +1 -1
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/types.d.ts +7 -3
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/color-picker/hsl-input.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +1 -1
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +4 -4
- package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +2 -2
- package/build-types/navigator/navigator-button/hook.d.ts +2 -2
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/search-control/index.d.ts +1 -1
- package/build-types/search-control/stories/index.story.d.ts +2 -2
- package/build-types/text-control/index.d.ts +1 -1
- package/build-types/textarea-control/index.d.ts +1 -1
- package/build-types/theme/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control/utils.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +1 -1
- package/build-types/tooltip/index.d.ts +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts +10 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/types.d.ts +3 -0
- package/build-types/tooltip/types.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
- package/package.json +19 -19
- package/src/border-box-control/border-box-control/component.tsx +0 -1
- package/src/border-box-control/border-box-control/hook.ts +5 -1
- package/src/border-box-control/types.ts +6 -0
- package/src/border-control/border-control/component.tsx +4 -0
- package/src/border-control/border-control/hook.ts +22 -16
- package/src/border-control/border-control-dropdown/component.tsx +2 -1
- package/src/border-control/border-control-style-picker/component.tsx +31 -66
- package/src/border-control/styles.ts +0 -15
- package/src/border-control/types.ts +15 -1
- package/src/box-control/all-input-control.tsx +57 -34
- package/src/box-control/axial-input-controls.tsx +79 -69
- package/src/box-control/index.tsx +47 -54
- package/src/box-control/input-controls.tsx +114 -83
- package/src/box-control/styles/box-control-styles.ts +21 -61
- package/src/box-control/test/index.tsx +126 -18
- package/src/box-control/types.ts +10 -21
- package/src/box-control/utils.ts +43 -8
- package/src/button/README.md +1 -1
- package/src/button/index.tsx +21 -33
- package/src/button/test/index.tsx +122 -0
- package/src/button/types.ts +7 -3
- package/src/circular-option-picker/test/index.tsx +10 -16
- package/src/color-palette/index.native.js +18 -7
- package/src/color-picker/hsl-input.tsx +56 -30
- package/src/color-picker/test/index.tsx +190 -16
- package/src/custom-select-control-v2/index.tsx +5 -2
- package/src/mobile/color-settings/palette.screen.native.js +7 -5
- package/src/palette-edit/test/index.tsx +326 -10
- package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
- package/src/tabs/test/index.tsx +3 -1
- package/src/theme/styles.ts +3 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -6
- package/src/toggle-group-control/test/index.tsx +73 -36
- package/src/toggle-group-control/toggle-group-control/utils.ts +8 -3
- package/src/tooltip/README.md +4 -0
- package/src/tooltip/index.tsx +46 -8
- package/src/tooltip/stories/index.story.tsx +18 -1
- package/src/tooltip/test/index.tsx +77 -12
- package/src/tooltip/types.ts +4 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/border-control/border-control-style-picker/hook.js +0 -41
- package/build/border-control/border-control-style-picker/hook.js.map +0 -1
- package/build/box-control/styles/box-control-visualizer-styles.js +0 -93
- package/build/box-control/styles/box-control-visualizer-styles.js.map +0 -1
- package/build/box-control/unit-control.js +0 -76
- package/build/box-control/unit-control.js.map +0 -1
- package/build-module/border-control/border-control-style-picker/hook.js +0 -32
- package/build-module/border-control/border-control-style-picker/hook.js.map +0 -1
- package/build-module/box-control/styles/box-control-visualizer-styles.js +0 -86
- package/build-module/box-control/styles/box-control-visualizer-styles.js.map +0 -1
- package/build-module/box-control/unit-control.js +0 -68
- package/build-module/box-control/unit-control.js.map +0 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -267
- package/build-types/border-control/border-control-style-picker/hook.d.ts.map +0 -1
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +0 -46
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +0 -1
- package/build-types/box-control/unit-control.d.ts +0 -4
- package/build-types/box-control/unit-control.d.ts.map +0 -1
- package/src/border-control/border-control-style-picker/hook.ts +0 -35
- package/src/box-control/styles/box-control-visualizer-styles.ts +0 -75
- package/src/box-control/unit-control.tsx +0 -74
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
export declare const ToggleGroupControlOptionIcon: import("react").ForwardRefExoticComponent<Pick<import("../types").ToggleGroupControlOptionBaseProps, "value"> & {
|
|
33
33
|
icon: JSX.Element;
|
|
34
34
|
label: string;
|
|
35
|
-
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>>, "children" | "label" | "
|
|
35
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>>, "children" | "label" | "value" | "as" | "icon"> & import("react").RefAttributes<any>>;
|
|
36
36
|
export default ToggleGroupControlOptionIcon;
|
|
37
37
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -67,7 +67,7 @@ export declare const ToolbarButton: import("react").ForwardRefExoticComponent<To
|
|
|
67
67
|
tooltipPosition?: ("top" | "middle" | "bottom") | "top left" | "top center" | "top right" | "middle left" | "middle center" | "middle right" | "bottom left" | "bottom center" | "bottom right" | "top left top" | "top left bottom" | "top left left" | "top left right" | "top center top" | "top center bottom" | "top center left" | "top center right" | "top right top" | "top right bottom" | "top right left" | "top right right" | "middle left top" | "middle left bottom" | "middle left left" | "middle left right" | "middle center top" | "middle center bottom" | "middle center left" | "middle center right" | "middle right top" | "middle right bottom" | "middle right left" | "middle right right" | "bottom left top" | "bottom left bottom" | "bottom left left" | "bottom left right" | "bottom center top" | "bottom center bottom" | "bottom center left" | "bottom center right" | "bottom right top" | "bottom right bottom" | "bottom right left" | "bottom right right" | undefined;
|
|
68
68
|
variant?: "link" | "primary" | "secondary" | "tertiary" | undefined;
|
|
69
69
|
__experimentalIsFocusable?: boolean | undefined;
|
|
70
|
-
}> & import("react").RefAttributes<any>, "className" | "id" | "prefix" | "slot" | "role" | "form" | "style" | "title" | "color" | "translate" | "hidden" | "lang" | "name" | "type" | "tabIndex" | "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" | "
|
|
70
|
+
}> & import("react").RefAttributes<any>, "className" | "id" | "prefix" | "slot" | "role" | "form" | "style" | "title" | "color" | "translate" | "hidden" | "lang" | "name" | "type" | "tabIndex" | "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" | "value" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | keyof {
|
|
71
71
|
__next40pxDefaultSize?: boolean | undefined;
|
|
72
72
|
children?: import("react").ReactNode;
|
|
73
73
|
describedBy?: string | undefined;
|
|
@@ -7,6 +7,6 @@ import type { TooltipProps } from './types';
|
|
|
7
7
|
* Time over anchor to wait before showing tooltip
|
|
8
8
|
*/
|
|
9
9
|
export declare const TOOLTIP_DELAY = 700;
|
|
10
|
-
declare
|
|
10
|
+
export declare const Tooltip: import("react").ForwardRefExoticComponent<TooltipProps & import("react").RefAttributes<any>>;
|
|
11
11
|
export default Tooltip;
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.tsx"],"names":[],"mappings":";AAkBA;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EAEZ,MAAM,SAAS,CAAC;AAQjB;;GAEG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AAyGjC,eAAO,MAAM,OAAO,8FAAmC,CAAC;AAExD,eAAe,OAAO,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
/**
|
|
2
3
|
* External dependencies
|
|
3
4
|
*/
|
|
@@ -9,5 +10,13 @@ import Tooltip from '..';
|
|
|
9
10
|
declare const meta: Meta<typeof Tooltip>;
|
|
10
11
|
export default meta;
|
|
11
12
|
export declare const Default: StoryFn<typeof Tooltip>;
|
|
12
|
-
export declare const KeyboardShortcut: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").TooltipProps
|
|
13
|
+
export declare const KeyboardShortcut: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").TooltipProps & import("react").RefAttributes<any>>;
|
|
14
|
+
/**
|
|
15
|
+
* In case one or more `Tooltip` components are rendered inside another
|
|
16
|
+
* `Tooltip` component, only the tooltip associated to the outermost `Tooltip`
|
|
17
|
+
* component will be rendered in the browser and shown to the user
|
|
18
|
+
* appropriately. The rest of the nested `Tooltip` components will simply no-op
|
|
19
|
+
* and pass-through their anchor.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Nested: StoryFn<typeof Tooltip>;
|
|
13
22
|
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/tooltip/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,OAAO,MAAM,IAAI,CAAC;AAGzB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAsB/B,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,OAAO,CAAwB,CAAC;AAMtE,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/tooltip/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,OAAO,MAAM,IAAI,CAAC;AAGzB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAsB/B,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,OAAO,CAAwB,CAAC;AAMtE,eAAO,MAAM,gBAAgB,qKAAsB,CAAC;AASpD;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,OAAO,CAAE,OAAO,OAAO,CAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tooltip/types.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG;IAC1B;;;;OAIG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAE,UAAU,CAAE,CAAC;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAE,UAAU,CAAE,CAAC;IACvC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tooltip/types.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG;IAC1B;;;;OAIG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAE,UAAU,CAAE,CAAC;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAE,UAAU,CAAE,CAAC;IACvC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACpC,iBAAiB,EAAE,OAAO,CAAC;CAC3B,CAAC"}
|
|
@@ -23,7 +23,7 @@ export declare const UnitControl: import("react").ForwardRefExoticComponent<Pick
|
|
|
23
23
|
value?: string | number | undefined;
|
|
24
24
|
onBlur?: import("react").FocusEventHandler<HTMLInputElement | HTMLSelectElement> | undefined;
|
|
25
25
|
onFocus?: import("react").FocusEventHandler<HTMLInputElement | HTMLSelectElement> | undefined;
|
|
26
|
-
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "className" | "id" | "prefix" | "slot" | "role" | "children" | "form" | "label" | "style" | "title" | "pattern" | "color" | "height" | "translate" | "width" | "help" | "hidden" | "lang" | "max" | "min" | "name" | "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" | "size" | "
|
|
26
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "className" | "id" | "prefix" | "slot" | "role" | "children" | "form" | "label" | "style" | "title" | "pattern" | "color" | "height" | "translate" | "width" | "help" | "hidden" | "lang" | "max" | "min" | "name" | "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" | "size" | "value" | "as" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "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" | "list" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "step" | "__next36pxDefaultSize" | "__next40pxDefaultSize" | "__unstableInputWidth" | "hideLabelFromVision" | "labelPosition" | "dragDirection" | "dragThreshold" | "isDragEnabled" | "isPressEnterToChange" | "onValidate" | "__unstableStateReducer" | "hideHTMLArrows" | "isShiftStepEnabled" | "shiftStep" | "spinFactor" | "disableUnits" | "unit" | "isUnitSelectTabbable" | "units" | "isResetValueOnUnitChange" | "onUnitChange"> & import("react").RefAttributes<any>>;
|
|
27
27
|
export { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';
|
|
28
28
|
export default UnitControl;
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -16,7 +16,7 @@ export declare const ValueInput: import("@emotion/styled").StyledComponent<Omit<
|
|
|
16
16
|
spinFactor?: number | undefined;
|
|
17
17
|
type?: import("react").HTMLInputTypeAttribute | undefined;
|
|
18
18
|
value?: string | number | undefined;
|
|
19
|
-
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "className" | "id" | "prefix" | "slot" | "role" | "children" | "form" | "label" | "style" | "title" | "pattern" | "color" | "height" | "translate" | "width" | "help" | "hidden" | "lang" | "max" | "min" | "name" | "type" | "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" | "size" | "
|
|
19
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "className" | "id" | "prefix" | "slot" | "role" | "children" | "form" | "label" | "style" | "title" | "pattern" | "color" | "height" | "translate" | "width" | "help" | "hidden" | "lang" | "max" | "min" | "name" | "type" | "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" | "size" | "value" | "as" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "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" | "list" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "step" | "__next36pxDefaultSize" | "__next40pxDefaultSize" | "__unstableInputWidth" | "hideLabelFromVision" | "labelPosition" | "suffix" | "dragDirection" | "dragThreshold" | "isDragEnabled" | "isPressEnterToChange" | "onValidate" | "__unstableStateReducer" | "hideHTMLArrows" | "spinControls" | "isShiftStepEnabled" | "shiftStep" | "spinFactor"> & import("react").RefAttributes<any> & {
|
|
20
20
|
theme?: import("@emotion/react").Theme | undefined;
|
|
21
21
|
}, {}, {}>;
|
|
22
22
|
export declare const UnitLabel: import("@emotion/styled").StyledComponent<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.16.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -42,23 +42,23 @@
|
|
|
42
42
|
"@types/gradient-parser": "0.1.3",
|
|
43
43
|
"@types/highlight-words-core": "1.2.1",
|
|
44
44
|
"@use-gesture/react": "^10.2.24",
|
|
45
|
-
"@wordpress/a11y": "^3.
|
|
46
|
-
"@wordpress/compose": "^6.
|
|
47
|
-
"@wordpress/date": "^4.
|
|
48
|
-
"@wordpress/deprecated": "^3.
|
|
49
|
-
"@wordpress/dom": "^3.
|
|
50
|
-
"@wordpress/element": "^5.
|
|
51
|
-
"@wordpress/escape-html": "^2.
|
|
52
|
-
"@wordpress/hooks": "^3.
|
|
53
|
-
"@wordpress/html-entities": "^3.
|
|
54
|
-
"@wordpress/i18n": "^4.
|
|
55
|
-
"@wordpress/icons": "^9.
|
|
56
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
57
|
-
"@wordpress/keycodes": "^3.
|
|
58
|
-
"@wordpress/primitives": "^3.
|
|
59
|
-
"@wordpress/private-apis": "^0.
|
|
60
|
-
"@wordpress/rich-text": "^6.
|
|
61
|
-
"@wordpress/warning": "^2.
|
|
45
|
+
"@wordpress/a11y": "^3.50.0",
|
|
46
|
+
"@wordpress/compose": "^6.27.0",
|
|
47
|
+
"@wordpress/date": "^4.50.0",
|
|
48
|
+
"@wordpress/deprecated": "^3.50.0",
|
|
49
|
+
"@wordpress/dom": "^3.50.0",
|
|
50
|
+
"@wordpress/element": "^5.27.0",
|
|
51
|
+
"@wordpress/escape-html": "^2.50.0",
|
|
52
|
+
"@wordpress/hooks": "^3.50.0",
|
|
53
|
+
"@wordpress/html-entities": "^3.50.0",
|
|
54
|
+
"@wordpress/i18n": "^4.50.0",
|
|
55
|
+
"@wordpress/icons": "^9.41.0",
|
|
56
|
+
"@wordpress/is-shallow-equal": "^4.50.0",
|
|
57
|
+
"@wordpress/keycodes": "^3.50.0",
|
|
58
|
+
"@wordpress/primitives": "^3.48.0",
|
|
59
|
+
"@wordpress/private-apis": "^0.32.0",
|
|
60
|
+
"@wordpress/rich-text": "^6.27.0",
|
|
61
|
+
"@wordpress/warning": "^2.50.0",
|
|
62
62
|
"change-case": "^4.1.2",
|
|
63
63
|
"classnames": "^2.3.1",
|
|
64
64
|
"colord": "^2.7.0",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "45de2cb4212fed7f2763e95f10300d1ff9d0ec08"
|
|
92
92
|
}
|
|
@@ -35,9 +35,13 @@ export function useBorderBoxControl(
|
|
|
35
35
|
size = 'default',
|
|
36
36
|
value,
|
|
37
37
|
__experimentalIsRenderedInSidebar = false,
|
|
38
|
+
__next40pxDefaultSize,
|
|
38
39
|
...otherProps
|
|
39
40
|
} = useContextSystem( props, 'BorderBoxControl' );
|
|
40
41
|
|
|
42
|
+
const computedSize =
|
|
43
|
+
size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;
|
|
44
|
+
|
|
41
45
|
const mixedBorders = hasMixedBorders( value );
|
|
42
46
|
const splitBorders = hasSplitBorders( value );
|
|
43
47
|
|
|
@@ -133,7 +137,7 @@ export function useBorderBoxControl(
|
|
|
133
137
|
onSplitChange,
|
|
134
138
|
toggleLinked,
|
|
135
139
|
linkedValue,
|
|
136
|
-
size,
|
|
140
|
+
size: computedSize,
|
|
137
141
|
splitValue,
|
|
138
142
|
wrapperClassName,
|
|
139
143
|
__experimentalIsRenderedInSidebar,
|
|
@@ -45,6 +45,12 @@ export type BorderBoxControlProps = ColorProps &
|
|
|
45
45
|
* properties but for each side; `top`, `right`, `bottom`, and `left`.
|
|
46
46
|
*/
|
|
47
47
|
value: AnyBorder;
|
|
48
|
+
/**
|
|
49
|
+
* Start opting into the larger default height that will become the default size in a future version.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
__next40pxDefaultSize?: boolean;
|
|
48
54
|
};
|
|
49
55
|
|
|
50
56
|
export type LinkedButtonProps = Pick< BorderBoxControlProps, 'size' > & {
|
|
@@ -38,6 +38,7 @@ const UnconnectedBorderControl = (
|
|
|
38
38
|
forwardedRef: React.ForwardedRef< any >
|
|
39
39
|
) => {
|
|
40
40
|
const {
|
|
41
|
+
__next40pxDefaultSize = false,
|
|
41
42
|
colors,
|
|
42
43
|
disableCustomColors,
|
|
43
44
|
disableUnits,
|
|
@@ -46,6 +47,7 @@ const UnconnectedBorderControl = (
|
|
|
46
47
|
hideLabelFromVision,
|
|
47
48
|
innerWrapperClassName,
|
|
48
49
|
inputWidth,
|
|
50
|
+
isStyleSettable,
|
|
49
51
|
label,
|
|
50
52
|
onBorderChange,
|
|
51
53
|
onSliderChange,
|
|
@@ -80,6 +82,7 @@ const UnconnectedBorderControl = (
|
|
|
80
82
|
disableCustomColors={ disableCustomColors }
|
|
81
83
|
enableAlpha={ enableAlpha }
|
|
82
84
|
enableStyle={ enableStyle }
|
|
85
|
+
isStyleSettable={ isStyleSettable }
|
|
83
86
|
onChange={ onBorderChange }
|
|
84
87
|
previousStyleSelection={ previousStyleSelection }
|
|
85
88
|
showDropdownHeader={ showDropdownHeader }
|
|
@@ -112,6 +115,7 @@ const UnconnectedBorderControl = (
|
|
|
112
115
|
step={ [ 'px', '%' ].includes( widthUnit ) ? 1 : 0.1 }
|
|
113
116
|
value={ widthValue || undefined }
|
|
114
117
|
withInputField={ false }
|
|
118
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
115
119
|
/>
|
|
116
120
|
) }
|
|
117
121
|
</HStack>
|
|
@@ -14,16 +14,12 @@ import { useCx } from '../../utils/hooks/use-cx';
|
|
|
14
14
|
|
|
15
15
|
import type { Border, BorderControlProps } from '../types';
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return border;
|
|
17
|
+
// If either width or color are defined, the border is considered valid
|
|
18
|
+
// and a border style can be set as well.
|
|
19
|
+
const isValidBorder = ( border?: Border ) => {
|
|
20
|
+
const hasWidth = border?.width !== undefined && border.width !== '';
|
|
21
|
+
const hasColor = border?.color !== undefined;
|
|
22
|
+
return hasWidth || hasColor;
|
|
27
23
|
};
|
|
28
24
|
|
|
29
25
|
export function useBorderControl(
|
|
@@ -41,9 +37,13 @@ export function useBorderControl(
|
|
|
41
37
|
value: border,
|
|
42
38
|
width,
|
|
43
39
|
__experimentalIsRenderedInSidebar = false,
|
|
40
|
+
__next40pxDefaultSize,
|
|
44
41
|
...otherProps
|
|
45
42
|
} = useContextSystem( props, 'BorderControl' );
|
|
46
43
|
|
|
44
|
+
const computedSize =
|
|
45
|
+
size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;
|
|
46
|
+
|
|
47
47
|
const [ widthValue, originalWidthUnit ] = parseQuantityAndUnitFromRawValue(
|
|
48
48
|
border?.width
|
|
49
49
|
);
|
|
@@ -53,12 +53,16 @@ export function useBorderControl(
|
|
|
53
53
|
const [ colorSelection, setColorSelection ] = useState< string >();
|
|
54
54
|
const [ styleSelection, setStyleSelection ] = useState< string >();
|
|
55
55
|
|
|
56
|
+
const isStyleSettable = shouldSanitizeBorder
|
|
57
|
+
? isValidBorder( border )
|
|
58
|
+
: true;
|
|
59
|
+
|
|
56
60
|
const onBorderChange = useCallback(
|
|
57
61
|
( newBorder?: Border ) => {
|
|
58
|
-
if ( shouldSanitizeBorder ) {
|
|
59
|
-
|
|
62
|
+
if ( shouldSanitizeBorder && ! isValidBorder( newBorder ) ) {
|
|
63
|
+
onChange( undefined );
|
|
64
|
+
return;
|
|
60
65
|
}
|
|
61
|
-
|
|
62
66
|
onChange( newBorder );
|
|
63
67
|
},
|
|
64
68
|
[ onChange, shouldSanitizeBorder ]
|
|
@@ -130,10 +134,10 @@ export function useBorderControl(
|
|
|
130
134
|
}
|
|
131
135
|
const innerWrapperClassName = useMemo( () => {
|
|
132
136
|
const widthStyle = !! wrapperWidth && styles.wrapperWidth;
|
|
133
|
-
const heightStyle = styles.wrapperHeight(
|
|
137
|
+
const heightStyle = styles.wrapperHeight( computedSize );
|
|
134
138
|
|
|
135
139
|
return cx( styles.innerWrapper(), widthStyle, heightStyle );
|
|
136
|
-
}, [ wrapperWidth, cx,
|
|
140
|
+
}, [ wrapperWidth, cx, computedSize ] );
|
|
137
141
|
|
|
138
142
|
const sliderClassName = useMemo( () => {
|
|
139
143
|
return cx( styles.borderSlider() );
|
|
@@ -147,6 +151,7 @@ export function useBorderControl(
|
|
|
147
151
|
enableStyle,
|
|
148
152
|
innerWrapperClassName,
|
|
149
153
|
inputWidth: wrapperWidth,
|
|
154
|
+
isStyleSettable,
|
|
150
155
|
onBorderChange,
|
|
151
156
|
onSliderChange,
|
|
152
157
|
onWidthChange,
|
|
@@ -155,7 +160,8 @@ export function useBorderControl(
|
|
|
155
160
|
value: border,
|
|
156
161
|
widthUnit,
|
|
157
162
|
widthValue,
|
|
158
|
-
size,
|
|
163
|
+
size: computedSize,
|
|
159
164
|
__experimentalIsRenderedInSidebar,
|
|
165
|
+
__next40pxDefaultSize,
|
|
160
166
|
};
|
|
161
167
|
}
|
|
@@ -142,6 +142,7 @@ const BorderControlDropdown = (
|
|
|
142
142
|
enableStyle,
|
|
143
143
|
indicatorClassName,
|
|
144
144
|
indicatorWrapperClassName,
|
|
145
|
+
isStyleSettable,
|
|
145
146
|
onReset,
|
|
146
147
|
onColorChange,
|
|
147
148
|
onStyleChange,
|
|
@@ -218,7 +219,7 @@ const BorderControlDropdown = (
|
|
|
218
219
|
clearable={ false }
|
|
219
220
|
enableAlpha={ enableAlpha }
|
|
220
221
|
/>
|
|
221
|
-
{ enableStyle && (
|
|
222
|
+
{ enableStyle && isStyleSettable && (
|
|
222
223
|
<BorderControlStylePicker
|
|
223
224
|
label={ __( 'Style' ) }
|
|
224
225
|
value={ style }
|
|
@@ -7,16 +7,12 @@ import { __ } from '@wordpress/i18n';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import Button from '../../button';
|
|
11
|
-
import { StyledLabel } from '../../base-control/styles/base-control-styles';
|
|
12
|
-
import { View } from '../../view';
|
|
13
|
-
import { Flex } from '../../flex';
|
|
14
|
-
import { VisuallyHidden } from '../../visually-hidden';
|
|
15
|
-
import type { WordPressComponentProps } from '../../context';
|
|
16
10
|
import { contextConnect } from '../../context';
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
import type { StylePickerProps } from '../types';
|
|
12
|
+
import {
|
|
13
|
+
ToggleGroupControl,
|
|
14
|
+
ToggleGroupControlOptionIcon,
|
|
15
|
+
} from '../../toggle-group-control';
|
|
20
16
|
|
|
21
17
|
const BORDER_STYLES = [
|
|
22
18
|
{ label: __( 'Solid' ), icon: lineSolid, value: 'solid' },
|
|
@@ -24,67 +20,36 @@ const BORDER_STYLES = [
|
|
|
24
20
|
{ label: __( 'Dotted' ), icon: lineDotted, value: 'dotted' },
|
|
25
21
|
];
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if ( ! label ) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return hideLabelFromVision ? (
|
|
35
|
-
<VisuallyHidden as="label">{ label }</VisuallyHidden>
|
|
36
|
-
) : (
|
|
37
|
-
<StyledLabel>{ label }</StyledLabel>
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const BorderControlStylePicker = (
|
|
42
|
-
props: WordPressComponentProps< StylePickerProps, 'div' >,
|
|
23
|
+
function UnconnectedBorderControlStylePicker(
|
|
24
|
+
{ onChange, ...restProps }: StylePickerProps,
|
|
43
25
|
forwardedRef: React.ForwardedRef< any >
|
|
44
|
-
)
|
|
45
|
-
const {
|
|
46
|
-
buttonClassName,
|
|
47
|
-
hideLabelFromVision,
|
|
48
|
-
label,
|
|
49
|
-
onChange,
|
|
50
|
-
value,
|
|
51
|
-
...otherProps
|
|
52
|
-
} = useBorderControlStylePicker( props );
|
|
53
|
-
|
|
26
|
+
) {
|
|
54
27
|
return (
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
aria-label={ borderStyle.label }
|
|
76
|
-
label={ borderStyle.label }
|
|
77
|
-
showTooltip={ true }
|
|
78
|
-
/>
|
|
79
|
-
) ) }
|
|
80
|
-
</Flex>
|
|
81
|
-
</View>
|
|
28
|
+
<ToggleGroupControl
|
|
29
|
+
__nextHasNoMarginBottom
|
|
30
|
+
__next40pxDefaultSize
|
|
31
|
+
ref={ forwardedRef }
|
|
32
|
+
isDeselectable
|
|
33
|
+
onChange={ ( value ) => {
|
|
34
|
+
onChange?.( value as string | undefined );
|
|
35
|
+
} }
|
|
36
|
+
{ ...restProps }
|
|
37
|
+
>
|
|
38
|
+
{ BORDER_STYLES.map( ( borderStyle ) => (
|
|
39
|
+
<ToggleGroupControlOptionIcon
|
|
40
|
+
key={ borderStyle.value }
|
|
41
|
+
value={ borderStyle.value }
|
|
42
|
+
icon={ borderStyle.icon }
|
|
43
|
+
label={ borderStyle.label }
|
|
44
|
+
/>
|
|
45
|
+
) ) }
|
|
46
|
+
</ToggleGroupControl>
|
|
82
47
|
);
|
|
83
|
-
}
|
|
48
|
+
}
|
|
84
49
|
|
|
85
|
-
const
|
|
86
|
-
|
|
50
|
+
const BorderControlStylePicker = contextConnect(
|
|
51
|
+
UnconnectedBorderControlStylePicker,
|
|
87
52
|
'BorderControlStylePicker'
|
|
88
53
|
);
|
|
89
54
|
|
|
90
|
-
export default
|
|
55
|
+
export default BorderControlStylePicker;
|
|
@@ -165,21 +165,6 @@ export const resetButton = css`
|
|
|
165
165
|
}
|
|
166
166
|
`;
|
|
167
167
|
|
|
168
|
-
export const borderControlStylePicker = css`
|
|
169
|
-
${ StyledLabel } {
|
|
170
|
-
${ labelStyles }
|
|
171
|
-
}
|
|
172
|
-
`;
|
|
173
|
-
|
|
174
|
-
export const borderStyleButton = css`
|
|
175
|
-
&&&&& {
|
|
176
|
-
min-width: 32px;
|
|
177
|
-
width: 32px;
|
|
178
|
-
height: 32px;
|
|
179
|
-
padding: 4px;
|
|
180
|
-
}
|
|
181
|
-
`;
|
|
182
|
-
|
|
183
168
|
export const borderSlider = () => css`
|
|
184
169
|
flex: 1 1 60%;
|
|
185
170
|
${ rtl( { marginRight: space( 3 ) } )() }
|
|
@@ -8,6 +8,7 @@ import type { CSSProperties } from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
import type { ColorPaletteProps } from '../color-palette/types';
|
|
10
10
|
import type { PopoverProps } from '../popover/types';
|
|
11
|
+
import type { ToggleGroupControlProps } from '../toggle-group-control/types';
|
|
11
12
|
|
|
12
13
|
export type Border = {
|
|
13
14
|
color?: CSSProperties[ 'borderColor' ];
|
|
@@ -99,6 +100,12 @@ export type BorderControlProps = ColorProps &
|
|
|
99
100
|
* `RangeControl` for additional control over a border's width.
|
|
100
101
|
*/
|
|
101
102
|
withSlider?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Start opting into the larger default height that will become the default size in a future version.
|
|
105
|
+
*
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
108
|
+
__next40pxDefaultSize?: boolean;
|
|
102
109
|
};
|
|
103
110
|
|
|
104
111
|
export type DropdownProps = ColorProps &
|
|
@@ -109,6 +116,10 @@ export type DropdownProps = ColorProps &
|
|
|
109
116
|
* values for its popover controls.
|
|
110
117
|
*/
|
|
111
118
|
border?: Border;
|
|
119
|
+
/**
|
|
120
|
+
* Whether a border style can be set, based on the border sanitization settings.
|
|
121
|
+
*/
|
|
122
|
+
isStyleSettable: boolean;
|
|
112
123
|
/**
|
|
113
124
|
* An internal prop used to control the visibility of the dropdown.
|
|
114
125
|
*/
|
|
@@ -131,7 +142,10 @@ export type DropdownProps = ColorProps &
|
|
|
131
142
|
showDropdownHeader?: boolean;
|
|
132
143
|
};
|
|
133
144
|
|
|
134
|
-
export type StylePickerProps =
|
|
145
|
+
export type StylePickerProps = Omit<
|
|
146
|
+
ToggleGroupControlProps,
|
|
147
|
+
'value' | 'onChange' | 'children'
|
|
148
|
+
> & {
|
|
135
149
|
/**
|
|
136
150
|
* A callback function invoked when a border style is selected or cleared.
|
|
137
151
|
*/
|