@wordpress/components 19.9.0 → 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.
Files changed (185) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/CONTRIBUTING.md +80 -7
  3. package/build/angle-picker-control/angle-circle.js +5 -7
  4. package/build/angle-picker-control/angle-circle.js.map +1 -1
  5. package/build/box-control/index.js +0 -21
  6. package/build/box-control/index.js.map +1 -1
  7. package/build/box-control/utils.js +1 -8
  8. package/build/box-control/utils.js.map +1 -1
  9. package/build/button/index.js +3 -5
  10. package/build/button/index.js.map +1 -1
  11. package/build/circular-option-picker/index.js +1 -2
  12. package/build/circular-option-picker/index.js.map +1 -1
  13. package/build/disabled/index.js +4 -76
  14. package/build/disabled/index.js.map +1 -1
  15. package/build/input-control/index.js +3 -2
  16. package/build/input-control/index.js.map +1 -1
  17. package/build/input-control/styles/input-control-styles.js +42 -30
  18. package/build/input-control/styles/input-control-styles.js.map +1 -1
  19. package/build/mobile/bottom-sheet-select-control/index.native.js +1 -0
  20. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  21. package/build/popover/index.js +6 -52
  22. package/build/popover/index.js.map +1 -1
  23. package/build/select-control/index.js +31 -4
  24. package/build/select-control/index.js.map +1 -1
  25. package/build/select-control/styles/select-control-styles.js +8 -8
  26. package/build/select-control/styles/select-control-styles.js.map +1 -1
  27. package/build/text-control/index.js +35 -28
  28. package/build/text-control/index.js.map +1 -1
  29. package/build/text-control/types.js +6 -0
  30. package/build/text-control/types.js.map +1 -0
  31. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +6 -4
  32. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  33. package/build/tools-panel/tools-panel-header/component.js +52 -36
  34. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  35. package/build/unit-control/index.js +3 -3
  36. package/build/unit-control/index.js.map +1 -1
  37. package/build/unit-control/styles/unit-control-styles.js +11 -20
  38. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  39. package/build/unit-control/utils.js.map +1 -1
  40. package/build-module/angle-picker-control/angle-circle.js +5 -7
  41. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  42. package/build-module/box-control/index.js +1 -20
  43. package/build-module/box-control/index.js.map +1 -1
  44. package/build-module/box-control/utils.js +0 -6
  45. package/build-module/box-control/utils.js.map +1 -1
  46. package/build-module/button/index.js +3 -4
  47. package/build-module/button/index.js.map +1 -1
  48. package/build-module/circular-option-picker/index.js +1 -2
  49. package/build-module/circular-option-picker/index.js.map +1 -1
  50. package/build-module/disabled/index.js +5 -76
  51. package/build-module/disabled/index.js.map +1 -1
  52. package/build-module/input-control/index.js +3 -2
  53. package/build-module/input-control/index.js.map +1 -1
  54. package/build-module/input-control/styles/input-control-styles.js +42 -30
  55. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  56. package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -0
  57. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  58. package/build-module/popover/index.js +6 -52
  59. package/build-module/popover/index.js.map +1 -1
  60. package/build-module/select-control/index.js +29 -3
  61. package/build-module/select-control/index.js.map +1 -1
  62. package/build-module/select-control/styles/select-control-styles.js +8 -8
  63. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  64. package/build-module/text-control/index.js +35 -27
  65. package/build-module/text-control/index.js.map +1 -1
  66. package/build-module/text-control/types.js +2 -0
  67. package/build-module/text-control/types.js.map +1 -0
  68. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -5
  69. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  70. package/build-module/tools-panel/tools-panel-header/component.js +51 -36
  71. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  72. package/build-module/unit-control/index.js +3 -3
  73. package/build-module/unit-control/index.js.map +1 -1
  74. package/build-module/unit-control/styles/unit-control-styles.js +11 -20
  75. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  76. package/build-module/unit-control/utils.js.map +1 -1
  77. package/build-style/style-rtl.css +7 -0
  78. package/build-style/style.css +7 -0
  79. package/build-types/button/index.d.ts.map +1 -1
  80. package/build-types/circular-option-picker/index.d.ts.map +1 -1
  81. package/build-types/color-picker/styles.d.ts +3 -3
  82. package/build-types/disabled/index.d.ts.map +1 -1
  83. package/build-types/input-control/index.d.ts +4 -3
  84. package/build-types/input-control/index.d.ts.map +1 -1
  85. package/build-types/input-control/stories/index.d.ts +5 -5
  86. package/build-types/input-control/stories/index.d.ts.map +1 -1
  87. package/build-types/input-control/styles/input-control-styles.d.ts +1 -0
  88. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  89. package/build-types/input-control/types.d.ts +6 -0
  90. package/build-types/input-control/types.d.ts.map +1 -1
  91. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  92. package/build-types/popover/index.d.ts +0 -1
  93. package/build-types/popover/index.d.ts.map +1 -1
  94. package/build-types/select-control/index.d.ts +30 -26
  95. package/build-types/select-control/index.d.ts.map +1 -1
  96. package/build-types/select-control/stories/index.d.ts +23 -0
  97. package/build-types/select-control/stories/index.d.ts.map +1 -0
  98. package/build-types/select-control/styles/select-control-styles.d.ts +3 -4
  99. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  100. package/build-types/select-control/test/select-control.d.ts +2 -0
  101. package/build-types/select-control/test/select-control.d.ts.map +1 -0
  102. package/build-types/select-control/types.d.ts +52 -1
  103. package/build-types/select-control/types.d.ts.map +1 -1
  104. package/build-types/text-control/index.d.ts +32 -0
  105. package/build-types/text-control/index.d.ts.map +1 -0
  106. package/build-types/text-control/stories/index.d.ts +13 -0
  107. package/build-types/text-control/stories/index.d.ts.map +1 -0
  108. package/build-types/text-control/types.d.ts +25 -0
  109. package/build-types/text-control/types.d.ts.map +1 -0
  110. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  111. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  112. package/build-types/tools-panel/types.d.ts +0 -1
  113. package/build-types/tools-panel/types.d.ts.map +1 -1
  114. package/build-types/unit-control/index.d.ts +2 -2
  115. package/build-types/unit-control/index.d.ts.map +1 -1
  116. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  117. package/build-types/unit-control/test/index.d.ts +2 -0
  118. package/build-types/unit-control/test/index.d.ts.map +1 -0
  119. package/build-types/unit-control/test/utils.d.ts +2 -0
  120. package/build-types/unit-control/test/utils.d.ts.map +1 -0
  121. package/build-types/unit-control/types.d.ts +1 -1
  122. package/build-types/unit-control/types.d.ts.map +1 -1
  123. package/build-types/unit-control/utils.d.ts +3 -3
  124. package/build-types/unit-control/utils.d.ts.map +1 -1
  125. package/package.json +17 -17
  126. package/src/angle-picker-control/angle-circle.js +3 -3
  127. package/src/box-control/README.md +0 -74
  128. package/src/box-control/index.js +0 -15
  129. package/src/box-control/stories/index.js +0 -29
  130. package/src/box-control/utils.js +0 -7
  131. package/src/button/index.js +2 -4
  132. package/src/button/test/index.js +16 -1
  133. package/src/circular-option-picker/index.js +1 -2
  134. package/src/color-palette/README.md +0 -1
  135. package/src/color-palette/test/__snapshots__/index.js.snap +2 -3
  136. package/src/confirm-dialog/stories/index.js +87 -99
  137. package/src/date-time/stories/index.js +19 -0
  138. package/src/date-time/test/date.js +107 -78
  139. package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
  140. package/src/disabled/index.js +5 -90
  141. package/src/form-file-upload/test/index.js +15 -12
  142. package/src/input-control/README.md +1 -1
  143. package/src/input-control/index.tsx +3 -2
  144. package/src/input-control/stories/index.tsx +1 -1
  145. package/src/input-control/styles/input-control-styles.tsx +19 -5
  146. package/src/input-control/types.ts +6 -0
  147. package/src/menu-item/style.scss +10 -0
  148. package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +8 -1
  149. package/src/mobile/bottom-sheet-select-control/index.native.js +1 -0
  150. package/src/mobile/html-text-input/style.android.scss +1 -0
  151. package/src/mobile/html-text-input/style.ios.scss +1 -0
  152. package/src/mobile/link-settings/test/link-settings-navigation.native.js +9 -1
  153. package/src/popover/index.js +5 -51
  154. package/src/select-control/README.md +2 -2
  155. package/src/select-control/index.tsx +30 -29
  156. package/src/select-control/stories/index.tsx +90 -0
  157. package/src/select-control/styles/select-control-styles.ts +9 -8
  158. package/src/select-control/test/{select-control.js → select-control.tsx} +2 -2
  159. package/src/select-control/types.ts +66 -1
  160. package/src/text-control/index.tsx +84 -0
  161. package/src/text-control/stories/index.tsx +66 -0
  162. package/src/text-control/types.ts +29 -0
  163. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -5
  164. package/src/tools-panel/test/__snapshots__/index.js.snap +1 -1
  165. package/src/tools-panel/test/index.js +71 -18
  166. package/src/tools-panel/tools-panel-header/component.tsx +75 -33
  167. package/src/tools-panel/types.ts +0 -1
  168. package/src/tooltip/test/index.js +6 -0
  169. package/src/unit-control/index.tsx +2 -5
  170. package/src/unit-control/styles/unit-control-styles.ts +3 -13
  171. package/src/unit-control/test/__snapshots__/index.tsx.snap +33 -0
  172. package/src/unit-control/test/{index.js → index.tsx} +214 -165
  173. package/src/unit-control/test/{utils.js → utils.ts} +38 -19
  174. package/src/unit-control/types.ts +4 -1
  175. package/src/unit-control/utils.ts +5 -3
  176. package/tsconfig.json +2 -1
  177. package/tsconfig.tsbuildinfo +1 -1
  178. package/build/box-control/visualizer.js +0 -165
  179. package/build/box-control/visualizer.js.map +0 -1
  180. package/build-module/box-control/visualizer.js +0 -154
  181. package/build-module/box-control/visualizer.js.map +0 -1
  182. package/src/box-control/visualizer.js +0 -116
  183. package/src/select-control/stories/index.js +0 -104
  184. package/src/text-control/index.js +0 -72
  185. package/src/text-control/stories/index.js +0 -46
@@ -1,2 +1,53 @@
1
- export declare type Size = 'default' | 'small' | '__unstable-large';
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ChangeEvent, FocusEvent, ReactNode } from 'react';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import type { InputBaseProps } from '../input-control/types';
9
+ import type { BaseControlProps } from '../base-control/types';
10
+ export interface SelectControlProps extends Pick<InputBaseProps, 'disabled' | 'hideLabelFromVision' | 'label' | 'labelPosition' | 'prefix' | 'size' | 'suffix'>, Pick<BaseControlProps, 'help'> {
11
+ /**
12
+ * If this property is added, multiple values can be selected. The value passed should be an array.
13
+ *
14
+ * @default false
15
+ */
16
+ multiple?: boolean;
17
+ onBlur?: (event: FocusEvent<HTMLSelectElement>) => void;
18
+ onFocus?: (event: FocusEvent<HTMLSelectElement>) => void;
19
+ /**
20
+ * A function that receives the value of the new option that is being selected as input.
21
+ *
22
+ * If `multiple` is `true`, the value received is an array of the selected value.
23
+ * Otherwise, the value received is a single value with the new selected value.
24
+ */
25
+ onChange?: (value: string | string[], extra?: {
26
+ event?: ChangeEvent<HTMLSelectElement>;
27
+ }) => void;
28
+ options?: {
29
+ /**
30
+ * The label to be shown to the user.
31
+ */
32
+ label: string;
33
+ /**
34
+ * The internal value used to choose the selected value.
35
+ * This is also the value passed to `onChange` when the option is selected.
36
+ */
37
+ value: string;
38
+ id?: string;
39
+ /**
40
+ * Whether or not the option should have the disabled attribute.
41
+ *
42
+ * @default false
43
+ */
44
+ disabled?: boolean;
45
+ }[];
46
+ value?: string | string[];
47
+ /**
48
+ * As an alternative to the `options` prop, `optgroup`s and `options` can be
49
+ * passed in as `children` for more customizability.
50
+ */
51
+ children?: ReactNode;
52
+ }
2
53
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/select-control/types.ts"],"names":[],"mappings":"AAAA,oBAAY,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/select-control/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhE;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,WAAW,kBAChB,SAAQ,IAAI,CACV,cAAc,EACZ,UAAU,GACV,qBAAqB,GACrB,OAAO,GACP,eAAe,GACf,QAAQ,GACR,MAAM,GACN,QAAQ,CACV,EACD,IAAI,CAAE,gBAAgB,EAAE,MAAM,CAAE;IACjC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,CAAE,KAAK,EAAE,UAAU,CAAE,iBAAiB,CAAE,KAAM,IAAI,CAAC;IAC5D,OAAO,CAAC,EAAE,CAAE,KAAK,EAAE,UAAU,CAAE,iBAAiB,CAAE,KAAM,IAAI,CAAC;IAC7D;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CACV,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EACxB,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,WAAW,CAAE,iBAAiB,CAAE,CAAA;KAAE,KAChD,IAAI,CAAC;IACV,OAAO,CAAC,EAAE;QACT;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;;WAGG;QACH,KAAK,EAAE,MAAM,CAAC;QACd,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ;;;;WAIG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;KACnB,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"}
@@ -0,0 +1,32 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * TextControl components let users enter and edit text.
4
+ *
5
+ *
6
+ * @example
7
+ * ```jsx
8
+ * import { TextControl } from '@wordpress/components';
9
+ * import { useState } from '@wordpress/element';
10
+ *
11
+ * const MyTextControl = () => {
12
+ * const [ className, setClassName ] = useState( '' );
13
+ *
14
+ * return (
15
+ * <TextControl
16
+ * label="Additional CSS Class"
17
+ * value={ className }
18
+ * onChange={ ( value ) => setClassName( value ) }
19
+ * />
20
+ * );
21
+ * };
22
+ * ```
23
+ */
24
+ export declare const TextControl: import("react").ForwardRefExoticComponent<Pick<Pick<import("../base-control/types").BaseControlProps, "label" | "className" | "help" | "hideLabelFromVision"> & {
25
+ onChange: (value: string) => void;
26
+ value: string | number;
27
+ type?: import("react").HTMLInputTypeAttribute | undefined;
28
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & {
29
+ ref?: ((instance: HTMLInputElement | null) => void) | import("react").RefObject<HTMLInputElement> | null | undefined;
30
+ }, "type" | "children" | "value" | "label" | "as" | "className" | "onChange" | "help" | "hideLabelFromVision">, "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" | "help" | "hideLabelFromVision"> & import("react").RefAttributes<HTMLInputElement>>;
31
+ export default TextControl;
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/text-control/index.tsx"],"names":[],"mappings":";AA2DA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW;;;;;;kkKAAuC,CAAC;AAEhE,eAAe,WAAW,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ComponentMeta, ComponentStory } from '@storybook/react';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import TextControl from '..';
9
+ declare const meta: ComponentMeta<typeof TextControl>;
10
+ export default meta;
11
+ export declare const Default: ComponentStory<typeof TextControl>;
12
+ export declare const WithLabelAndHelpText: ComponentStory<typeof TextControl>;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/text-control/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOtE;;GAEG;AACH,OAAO,WAAW,MAAM,IAAI,CAAC;AAE7B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,WAAW,CAiB5C,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO,EAAE,cAAc,CACnC,OAAO,WAAW,CACW,CAAC;AAG/B,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAChD,OAAO,WAAW,CACW,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { HTMLInputTypeAttribute } from 'react';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import type { BaseControlProps } from '../base-control/types';
9
+ export declare type TextControlProps = Pick<BaseControlProps, 'className' | 'hideLabelFromVision' | 'help' | 'label'> & {
10
+ /**
11
+ * A function that receives the value of the input.
12
+ */
13
+ onChange: (value: string) => void;
14
+ /**
15
+ * The current value of the input.
16
+ */
17
+ value: string | number;
18
+ /**
19
+ * Type of the input element to render. Defaults to "text".
20
+ *
21
+ * @default 'text'
22
+ */
23
+ type?: HTMLInputTypeAttribute;
24
+ };
25
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/text-control/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAEpD;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,oBAAY,gBAAgB,GAAG,IAAI,CAClC,gBAAgB,EAChB,WAAW,GAAG,qBAAqB,GAAG,MAAM,GAAG,OAAO,CACtD,GAAG;IACH;;OAEG;IACH,QAAQ,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,sBAAsB,CAAC;CAC9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control-option-icon/component.tsx"],"names":[],"mappings":";AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAGlE,MAAM,CAAC,OAAO,UAAU,4BAA4B,CACnD,KAAK,EAAE,uBAAuB,CAC7B,iCAAiC,EACjC,QAAQ,EACR,KAAK,CACL,eAQD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control-option-icon/component.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAIlE,MAAM,CAAC,OAAO,UAAU,4BAA4B,CACnD,KAAK,EAAE,uBAAuB,CAC7B,iCAAiC,EACjC,QAAQ,EACR,KAAK,CACL,eAQD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG"}
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/tools-panel/tools-panel-header/component.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAEX,qBAAqB,EACrB,MAAM,UAAU,CAAC;AAmKlB,QAAA,MAAM,yBAAyB,kFAG9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/tools-panel/tools-panel-header/component.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAEX,qBAAqB,EACrB,MAAM,UAAU,CAAC;AA4MlB,QAAA,MAAM,yBAAyB,kFAG9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -138,7 +138,6 @@ export declare type ToolsPanelContext = {
138
138
  };
139
139
  export declare type ToolsPanelControlsGroupProps = {
140
140
  items: [string, boolean][];
141
- onClose: () => void;
142
141
  toggleItem: (label: string) => void;
143
142
  };
144
143
  export declare type ToolsPanelMenuItemsConfig = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tools-panel/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,aAAK,cAAc,GAAG,MAAM,IAAI,CAAC;AACjC,aAAK,QAAQ,GAAG,CAAE,OAAO,CAAC,EAAE,cAAc,EAAE,KAAM,IAAI,CAAC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WAAW,IAAI,qBAAqB,GAAI;QAAE,CAAE,GAAG,EAAE,MAAM,GAAI,OAAO,CAAA;KAAE;CACtE,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;IACpD,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,qBAAqB,EAAE,CACtB,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,qBAAqB,KACzB,IAAI,CAAC;IACV,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B,EAAE,OAAO,CAAC;IACtC,4BAA4B,EAAE,OAAO,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mCAAmC,CAAC,EAAE,MAAM,CAAC;IAC7C,kCAAkC,CAAC,EAAE,MAAM,CAAC;CAC5C,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IAC1C,KAAK,EAAE,CAAE,MAAM,EAAE,OAAO,CAAE,EAAE,CAAC;IAC7B,UAAU,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;CACtC,CAAC;AAEF,oBAAY,yBAAyB,GAAG;IACvC,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;CACvC,CAAC"}
@@ -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;AA6PnE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;09KAAuC,CAAC;AAEhE,OAAO,EAAE,gCAAgC,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC3E,eAAe,WAAW,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;AAmCF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;uBAYtB,CAAC;AAqBF,eAAO,MAAM,SAAS;;;uHAMrB,CAAC;AAEF,eAAO,MAAM,UAAU;;;mIAyBtB,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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/unit-control/test/index.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -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,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AAI,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[]): boolean;
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: WPUnitControlUnit[], fallbackQuantity?: number, fallbackUnit?: string): [number | undefined, string | undefined];
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: Record<string, number>;
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,CAAE,KAAK,CAAC,EAAE,iBAAiB,EAAE,GAAI,OAAO,CAK/D;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,EAAE,iBAAiB,EAAE,EACjC,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,sBA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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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "19.9.0",
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.7.0",
41
- "@wordpress/compose": "^5.5.0",
42
- "@wordpress/date": "^4.7.0",
43
- "@wordpress/deprecated": "^3.7.0",
44
- "@wordpress/dom": "^3.7.0",
45
- "@wordpress/element": "^4.5.0",
46
- "@wordpress/escape-html": "^2.7.0",
47
- "@wordpress/hooks": "^3.7.0",
48
- "@wordpress/i18n": "^4.7.0",
49
- "@wordpress/icons": "^8.3.0",
50
- "@wordpress/is-shallow-equal": "^4.7.0",
51
- "@wordpress/keycodes": "^3.7.0",
52
- "@wordpress/primitives": "^3.5.0",
53
- "@wordpress/rich-text": "^5.5.0",
54
- "@wordpress/warning": "^2.7.0",
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": "1ba52312b56db563df2d8d4fba5b00613fb46d8c"
79
+ "gitHead": "4631d515033397fcfeda77e5755960253caef9bf"
80
80
  }
@@ -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
- // Ensure the input isn't focused as preventDefault would leave it.
36
- ownerDocument.activeElement.blur();
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.
@@ -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
  `;
@@ -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
  /**