@wordpress/components 28.7.0 → 28.8.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 +45 -0
- package/build/box-control/all-input-control.js +1 -2
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/utils.js +1 -1
- package/build/box-control/utils.js.map +1 -1
- package/build/card/card/component.js +2 -2
- package/build/card/card/component.js.map +1 -1
- package/build/card/styles.js +18 -18
- package/build/card/styles.js.map +1 -1
- package/build/combobox-control/index.js +3 -1
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/types.js.map +1 -1
- package/build/composite/context.js +1 -1
- package/build/composite/context.js.map +1 -1
- package/build/composite/group-label.js +1 -1
- package/build/composite/group-label.js.map +1 -1
- package/build/composite/group.js +1 -1
- package/build/composite/group.js.map +1 -1
- package/build/composite/hover.js +1 -1
- package/build/composite/hover.js.map +1 -1
- package/build/composite/index.js +17 -26
- package/build/composite/index.js.map +1 -1
- package/build/composite/item.js +1 -1
- package/build/composite/item.js.map +1 -1
- package/build/composite/legacy/index.js +59 -8
- package/build/composite/legacy/index.js.map +1 -1
- package/build/composite/row.js +1 -1
- package/build/composite/row.js.map +1 -1
- package/build/composite/typeahead.js +1 -1
- package/build/composite/typeahead.js.map +1 -1
- package/build/composite/types.js.map +1 -1
- package/build/custom-select-control-v2/styles.js +9 -9
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/date-time/date/index.js +1 -1
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date/styles.js +35 -24
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/date/use-lilius/index.js +163 -0
- package/build/date-time/date/use-lilius/index.js.map +1 -0
- package/build/dropdown-menu-v2/styles.js +17 -17
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/modal/index.js +27 -12
- package/build/modal/index.js.map +1 -1
- package/build/modal/types.js.map +1 -1
- package/build/modal/use-modal-exit-animation.js +75 -0
- package/build/modal/use-modal-exit-animation.js.map +1 -0
- package/build/navigator/navigator-screen/component.js +5 -0
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/private-apis.js +0 -9
- package/build/private-apis.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +28 -28
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/slot-fill/index.js +1 -0
- package/build/slot-fill/index.js.map +1 -1
- package/build/tabs/styles.js +3 -3
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tablist.js +5 -4
- package/build/tabs/tablist.js.map +1 -1
- package/build/utils/config-values.js +4 -5
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/element-rect.js +73 -105
- package/build/utils/element-rect.js.map +1 -1
- package/build-module/box-control/all-input-control.js +2 -2
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/utils.js +1 -1
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/card/card/component.js +2 -2
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/styles.js +18 -18
- package/build-module/card/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +3 -1
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/types.js.map +1 -1
- package/build-module/composite/context.js +1 -1
- package/build-module/composite/context.js.map +1 -1
- package/build-module/composite/group-label.js +1 -1
- package/build-module/composite/group-label.js.map +1 -1
- package/build-module/composite/group.js +1 -1
- package/build-module/composite/group.js.map +1 -1
- package/build-module/composite/hover.js +1 -1
- package/build-module/composite/hover.js.map +1 -1
- package/build-module/composite/index.js +17 -26
- package/build-module/composite/index.js.map +1 -1
- package/build-module/composite/item.js +1 -1
- package/build-module/composite/item.js.map +1 -1
- package/build-module/composite/legacy/index.js +56 -8
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/composite/row.js +1 -1
- package/build-module/composite/row.js.map +1 -1
- package/build-module/composite/typeahead.js +1 -1
- package/build-module/composite/typeahead.js.map +1 -1
- package/build-module/composite/types.js.map +1 -1
- package/build-module/custom-select-control-v2/styles.js +9 -9
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/date-time/date/index.js +1 -2
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js +31 -24
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/date/use-lilius/index.js +158 -0
- package/build-module/date-time/date/use-lilius/index.js.map +1 -0
- package/build-module/dropdown-menu-v2/styles.js +17 -17
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/modal/index.js +29 -12
- package/build-module/modal/index.js.map +1 -1
- package/build-module/modal/types.js.map +1 -1
- package/build-module/modal/use-modal-exit-animation.js +68 -0
- package/build-module/modal/use-modal-exit-animation.js.map +1 -0
- package/build-module/navigator/navigator-screen/component.js +4 -0
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/private-apis.js +0 -9
- package/build-module/private-apis.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +28 -28
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/slot-fill/index.js +1 -0
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/tabs/styles.js +3 -3
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tablist.js +5 -4
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/utils/config-values.js +4 -5
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/element-rect.js +74 -105
- package/build-module/utils/element-rect.js.map +1 -1
- package/build-style/style-rtl.css +51 -10
- package/build-style/style.css +51 -10
- package/build-types/box-control/all-input-control.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +1 -1
- package/build-types/box-control/utils.d.ts.map +1 -1
- package/build-types/button-group/stories/index.story.d.ts +2 -2
- package/build-types/button-group/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +4 -0
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/types.d.ts +4 -0
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/composite/context.d.ts.map +1 -1
- package/build-types/composite/index.d.ts +36 -24
- package/build-types/composite/index.d.ts.map +1 -1
- package/build-types/composite/legacy/index.d.ts +25 -2
- package/build-types/composite/legacy/index.d.ts.map +1 -1
- package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/stories/index.story.d.ts +9 -9
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/types.d.ts +11 -10
- package/build-types/composite/types.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +0 -3
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
- package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
- package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
- package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
- package/build-types/index.d.ts +1 -0
- package/build-types/index.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.story.d.ts +3 -0
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/modal/types.d.ts +6 -10
- package/build-types/modal/types.d.ts.map +1 -1
- package/build-types/modal/use-modal-exit-animation.d.ts +9 -0
- package/build-types/modal/use-modal-exit-animation.d.ts.map +1 -0
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +3 -0
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +0 -1
- package/build-types/utils/element-rect.d.ts +32 -74
- package/build-types/utils/element-rect.d.ts.map +1 -1
- package/package.json +19 -20
- package/src/box-control/README.md +7 -0
- package/src/box-control/all-input-control.tsx +2 -3
- package/src/box-control/utils.ts +1 -1
- package/src/button-group/stories/index.story.tsx +10 -15
- package/src/card/card/component.tsx +1 -1
- package/src/card/styles.ts +1 -1
- package/src/card/test/__snapshots__/index.tsx.snap +54 -54
- package/src/combobox-control/README.md +7 -0
- package/src/combobox-control/index.tsx +2 -0
- package/src/combobox-control/test/index.tsx +40 -0
- package/src/combobox-control/types.ts +4 -0
- package/src/composite/README.md +5 -24
- package/src/composite/{context.ts → context.tsx} +1 -2
- package/src/composite/group-label.tsx +1 -1
- package/src/composite/group.tsx +1 -1
- package/src/composite/hover.tsx +1 -1
- package/src/composite/index.tsx +17 -28
- package/src/composite/item.tsx +1 -1
- package/src/composite/legacy/index.tsx +72 -11
- package/src/composite/legacy/stories/index.story.tsx +2 -1
- package/src/composite/legacy/test/index.tsx +57 -1
- package/src/composite/row.tsx +1 -1
- package/src/composite/stories/index.story.tsx +185 -169
- package/src/composite/typeahead.tsx +1 -1
- package/src/composite/types.ts +13 -15
- package/src/custom-select-control-v2/styles.ts +1 -0
- package/src/date-time/date/index.tsx +1 -1
- package/src/date-time/date/styles.ts +31 -11
- package/src/date-time/date/test/use-lilius.ts +417 -0
- package/src/date-time/date/use-lilius/index.ts +394 -0
- package/src/dropdown-menu-v2/styles.ts +1 -1
- package/src/form-toggle/style.scss +1 -0
- package/src/index.ts +1 -0
- package/src/modal/index.tsx +42 -19
- package/src/modal/stories/index.story.tsx +8 -14
- package/src/modal/style.scss +30 -8
- package/src/modal/types.ts +6 -18
- package/src/modal/use-modal-exit-animation.ts +99 -0
- package/src/navigator/navigator-screen/component.tsx +7 -0
- package/src/navigator/test/index.tsx +8 -0
- package/src/popover/style.scss +3 -2
- package/src/private-apis.ts +0 -9
- package/src/range-control/styles/range-control-styles.ts +1 -0
- package/src/resizable-box/style.scss +1 -1
- package/src/select-control/README.md +2 -2
- package/src/slot-fill/index.tsx +1 -0
- package/src/snackbar/style.scss +1 -1
- package/src/tabs/styles.ts +40 -11
- package/src/tabs/tablist.tsx +5 -4
- package/src/tooltip/style.scss +1 -0
- package/src/utils/config-values.js +4 -5
- package/src/utils/element-rect.ts +93 -130
- package/tsconfig.tsbuildinfo +1 -1
- package/build/composite/store.js +0 -54
- package/build/composite/store.js.map +0 -1
- package/build-module/composite/store.js +0 -46
- package/build-module/composite/store.js.map +0 -1
- package/build-types/composite/store.d.ts +0 -25
- package/build-types/composite/store.d.ts.map +0 -1
- package/build-types/composite/stories/utils.d.ts +0 -29
- package/build-types/composite/stories/utils.d.ts.map +0 -1
- package/src/composite/store.ts +0 -46
- package/src/composite/stories/utils.tsx +0 -76
|
@@ -1,79 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `useTrackElementRectUpdates` options.
|
|
3
|
-
*/
|
|
4
|
-
export type UseTrackElementRectUpdatesOptions = {
|
|
5
|
-
/**
|
|
6
|
-
* Whether to trigger the callback when an element's ResizeObserver is
|
|
7
|
-
* first set up, including when the target element changes.
|
|
8
|
-
*
|
|
9
|
-
* @default true
|
|
10
|
-
*/
|
|
11
|
-
fireOnElementInit?: boolean;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Tracks an element's "rect" (size and position) and fires `onRect` for all
|
|
15
|
-
* of its discrete values. The element can be changed dynamically and **it
|
|
16
|
-
* must not be stored in a ref**. Instead, it should be stored in a React
|
|
17
|
-
* state or equivalent.
|
|
18
|
-
*
|
|
19
|
-
* By default, `onRect` is called initially for the target element (including
|
|
20
|
-
* when the target element changes), not only on size or position updates.
|
|
21
|
-
* This allows consumers of the hook to always be in sync with all rect values
|
|
22
|
-
* of the target element throughout its lifetime. This behavior can be
|
|
23
|
-
* disabled by setting the `fireOnElementInit` option to `false`.
|
|
24
|
-
*
|
|
25
|
-
* Under the hood, it sets up a `ResizeObserver` that tracks the element. The
|
|
26
|
-
* target element can be changed dynamically, and the observer will be
|
|
27
|
-
* updated accordingly.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
*
|
|
31
|
-
* ```tsx
|
|
32
|
-
* const [ targetElement, setTargetElement ] = useState< HTMLElement | null >();
|
|
33
|
-
*
|
|
34
|
-
* useTrackElementRectUpdates( targetElement, ( element ) => {
|
|
35
|
-
* console.log( 'Element resized:', element );
|
|
36
|
-
* } );
|
|
37
|
-
*
|
|
38
|
-
* <div ref={ setTargetElement } />;
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare function useTrackElementRectUpdates(
|
|
42
|
-
/**
|
|
43
|
-
* The target element to observe. It can be changed dynamically.
|
|
44
|
-
*/
|
|
45
|
-
targetElement: HTMLElement | undefined | null,
|
|
46
|
-
/**
|
|
47
|
-
* Callback to fire when the element is resized. It will also be
|
|
48
|
-
* called when the observer is set up, unless `fireOnElementInit` is
|
|
49
|
-
* set to `false`.
|
|
50
|
-
*/
|
|
51
|
-
onRect: (
|
|
52
|
-
/**
|
|
53
|
-
* The element being tracked at the time of this update.
|
|
54
|
-
*/
|
|
55
|
-
element: HTMLElement,
|
|
56
|
-
/**
|
|
57
|
-
* The list of
|
|
58
|
-
* [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)
|
|
59
|
-
* objects passed to the `ResizeObserver.observe` callback. This list
|
|
60
|
-
* won't be available when the observer is set up, and only on updates.
|
|
61
|
-
*/
|
|
62
|
-
resizeObserverEntries?: ResizeObserverEntry[]) => void, { fireOnElementInit }?: UseTrackElementRectUpdatesOptions): void;
|
|
63
1
|
/**
|
|
64
2
|
* The position and dimensions of an element, relative to its offset parent.
|
|
65
3
|
*/
|
|
66
4
|
export type ElementOffsetRect = {
|
|
67
5
|
/**
|
|
68
|
-
* The distance from the
|
|
6
|
+
* The distance from the top edge of the offset parent to the top edge of
|
|
69
7
|
* the element.
|
|
70
8
|
*/
|
|
71
|
-
|
|
9
|
+
top: number;
|
|
72
10
|
/**
|
|
73
|
-
* The distance from the
|
|
11
|
+
* The distance from the right edge of the offset parent to the right edge
|
|
12
|
+
* of the element.
|
|
13
|
+
*/
|
|
14
|
+
right: number;
|
|
15
|
+
/**
|
|
16
|
+
* The distance from the bottom edge of the offset parent to the bottom edge
|
|
17
|
+
* of the element.
|
|
18
|
+
*/
|
|
19
|
+
bottom: number;
|
|
20
|
+
/**
|
|
21
|
+
* The distance from the left edge of the offset parent to the left edge of
|
|
74
22
|
* the element.
|
|
75
23
|
*/
|
|
76
|
-
|
|
24
|
+
left: number;
|
|
77
25
|
/**
|
|
78
26
|
* The width of the element.
|
|
79
27
|
*/
|
|
@@ -87,25 +35,35 @@ export type ElementOffsetRect = {
|
|
|
87
35
|
* An `ElementOffsetRect` object with all values set to zero.
|
|
88
36
|
*/
|
|
89
37
|
export declare const NULL_ELEMENT_OFFSET_RECT: {
|
|
90
|
-
left: number;
|
|
91
38
|
top: number;
|
|
39
|
+
right: number;
|
|
40
|
+
bottom: number;
|
|
41
|
+
left: number;
|
|
92
42
|
width: number;
|
|
93
43
|
height: number;
|
|
94
44
|
};
|
|
95
45
|
/**
|
|
96
46
|
* Returns the position and dimensions of an element, relative to its offset
|
|
97
|
-
* parent
|
|
98
|
-
*
|
|
47
|
+
* parent, with subpixel precision. Values reflect the real measures before any
|
|
48
|
+
* potential scaling distortions along the X and Y axes.
|
|
99
49
|
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
50
|
+
* Useful in contexts where plain `getBoundingClientRect` calls or `ResizeObserver`
|
|
51
|
+
* entries are not suitable, such as when the element is transformed, and when
|
|
52
|
+
* `element.offset<Top|Left|Width|Height>` methods are not precise enough.
|
|
53
|
+
*
|
|
54
|
+
* **Note:** in some contexts, like when the scale is 0, this method will fail
|
|
55
|
+
* because it's impossible to calculate a scaling ratio. When that happens, it
|
|
56
|
+
* will return `undefined`.
|
|
104
57
|
*/
|
|
105
|
-
export declare function getElementOffsetRect(element: HTMLElement): ElementOffsetRect;
|
|
58
|
+
export declare function getElementOffsetRect(element: HTMLElement): ElementOffsetRect | undefined;
|
|
106
59
|
/**
|
|
107
60
|
* Tracks the position and dimensions of an element, relative to its offset
|
|
108
61
|
* parent. The element can be changed dynamically.
|
|
62
|
+
*
|
|
63
|
+
* **Note:** sometimes, the measurement will fail (see `getElementOffsetRect`'s
|
|
64
|
+
* documentation for more details). When that happens, this hook will attempt
|
|
65
|
+
* to measure again after a frame, and if that fails, it will poll every 100
|
|
66
|
+
* milliseconds until it succeeds.
|
|
109
67
|
*/
|
|
110
68
|
export declare function useTrackElementOffsetRect(targetElement: HTMLElement | undefined | null): ElementOffsetRect;
|
|
111
69
|
//# sourceMappingURL=element-rect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-rect.d.ts","sourceRoot":"","sources":["../../src/utils/element-rect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"element-rect.d.ts","sourceRoot":"","sources":["../../src/utils/element-rect.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;CAOR,CAAC;AAE9B;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,WAAW,GAClB,iBAAiB,GAAG,SAAS,CAmC/B;AAID;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACxC,aAAa,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,qBAoC7C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "28.
|
|
3
|
+
"version": "28.8.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
"@types/gradient-parser": "0.1.3",
|
|
44
44
|
"@types/highlight-words-core": "1.2.1",
|
|
45
45
|
"@use-gesture/react": "^10.3.1",
|
|
46
|
-
"@wordpress/a11y": "^4.
|
|
47
|
-
"@wordpress/compose": "^7.
|
|
48
|
-
"@wordpress/date": "^5.
|
|
49
|
-
"@wordpress/deprecated": "^4.
|
|
50
|
-
"@wordpress/dom": "^4.
|
|
51
|
-
"@wordpress/element": "^6.
|
|
52
|
-
"@wordpress/escape-html": "^3.
|
|
53
|
-
"@wordpress/hooks": "^4.
|
|
54
|
-
"@wordpress/html-entities": "^4.
|
|
55
|
-
"@wordpress/i18n": "^5.
|
|
56
|
-
"@wordpress/icons": "^10.
|
|
57
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
58
|
-
"@wordpress/keycodes": "^4.
|
|
59
|
-
"@wordpress/primitives": "^4.
|
|
60
|
-
"@wordpress/private-apis": "^1.
|
|
61
|
-
"@wordpress/rich-text": "^7.
|
|
62
|
-
"@wordpress/warning": "^3.
|
|
46
|
+
"@wordpress/a11y": "^4.8.0",
|
|
47
|
+
"@wordpress/compose": "^7.8.0",
|
|
48
|
+
"@wordpress/date": "^5.8.0",
|
|
49
|
+
"@wordpress/deprecated": "^4.8.0",
|
|
50
|
+
"@wordpress/dom": "^4.8.0",
|
|
51
|
+
"@wordpress/element": "^6.8.0",
|
|
52
|
+
"@wordpress/escape-html": "^3.8.0",
|
|
53
|
+
"@wordpress/hooks": "^4.8.0",
|
|
54
|
+
"@wordpress/html-entities": "^4.8.0",
|
|
55
|
+
"@wordpress/i18n": "^5.8.0",
|
|
56
|
+
"@wordpress/icons": "^10.8.0",
|
|
57
|
+
"@wordpress/is-shallow-equal": "^5.8.0",
|
|
58
|
+
"@wordpress/keycodes": "^4.8.0",
|
|
59
|
+
"@wordpress/primitives": "^4.8.0",
|
|
60
|
+
"@wordpress/private-apis": "^1.8.0",
|
|
61
|
+
"@wordpress/rich-text": "^7.8.0",
|
|
62
|
+
"@wordpress/warning": "^3.8.0",
|
|
63
63
|
"change-case": "^4.1.2",
|
|
64
64
|
"clsx": "^2.1.1",
|
|
65
65
|
"colord": "^2.7.0",
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
"re-resizable": "^6.4.0",
|
|
76
76
|
"react-colorful": "^5.3.1",
|
|
77
77
|
"remove-accents": "^0.5.0",
|
|
78
|
-
"use-lilius": "^2.0.5",
|
|
79
78
|
"uuid": "^9.0.1"
|
|
80
79
|
},
|
|
81
80
|
"peerDependencies": {
|
|
@@ -85,5 +84,5 @@
|
|
|
85
84
|
"publishConfig": {
|
|
86
85
|
"access": "public"
|
|
87
86
|
},
|
|
88
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "cecf5e14d317aa67407f77a7e5c8b6a43016bd42"
|
|
89
88
|
}
|
|
@@ -100,3 +100,10 @@ A handler for onMouseOver events.
|
|
|
100
100
|
A handler for onMouseOut events.
|
|
101
101
|
|
|
102
102
|
- Required: No
|
|
103
|
+
|
|
104
|
+
### `__next40pxDefaultSize`: `boolean`
|
|
105
|
+
|
|
106
|
+
Start opting into the larger default size that will become the default size in a future version.
|
|
107
|
+
|
|
108
|
+
- Required: No
|
|
109
|
+
- Default: `false`
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
FlexedRangeControl,
|
|
11
11
|
StyledUnitControl,
|
|
12
12
|
} from './styles/box-control-styles';
|
|
13
|
-
import { HStack } from '../h-stack';
|
|
14
13
|
import type { BoxControlInputControlProps } from './types';
|
|
15
14
|
import { parseQuantityAndUnitFromRawValue } from '../unit-control';
|
|
16
15
|
import {
|
|
@@ -72,7 +71,7 @@ export default function AllInputControl( {
|
|
|
72
71
|
};
|
|
73
72
|
|
|
74
73
|
return (
|
|
75
|
-
|
|
74
|
+
<>
|
|
76
75
|
<StyledUnitControl
|
|
77
76
|
{ ...props }
|
|
78
77
|
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
@@ -104,6 +103,6 @@ export default function AllInputControl( {
|
|
|
104
103
|
value={ parsedQuantity ?? 0 }
|
|
105
104
|
withInputField={ false }
|
|
106
105
|
/>
|
|
107
|
-
|
|
106
|
+
</>
|
|
108
107
|
);
|
|
109
108
|
}
|
package/src/box-control/utils.ts
CHANGED
|
@@ -179,7 +179,7 @@ export function isValuesMixed(
|
|
|
179
179
|
*/
|
|
180
180
|
export function isValuesDefined( values?: BoxControlValue ) {
|
|
181
181
|
return (
|
|
182
|
-
values
|
|
182
|
+
values &&
|
|
183
183
|
Object.values( values ).filter(
|
|
184
184
|
// Switching units when input is empty causes values only
|
|
185
185
|
// containing units. This gives false positive on mixed values
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { Meta,
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
@@ -22,18 +22,13 @@ const meta: Meta< typeof ButtonGroup > = {
|
|
|
22
22
|
};
|
|
23
23
|
export default meta;
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Button
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</Button>
|
|
35
|
-
</ButtonGroup>
|
|
36
|
-
);
|
|
25
|
+
export const Default: StoryObj< typeof ButtonGroup > = {
|
|
26
|
+
args: {
|
|
27
|
+
children: (
|
|
28
|
+
<>
|
|
29
|
+
<Button variant="primary">Button 1</Button>
|
|
30
|
+
<Button>Button 2</Button>
|
|
31
|
+
</>
|
|
32
|
+
),
|
|
33
|
+
},
|
|
37
34
|
};
|
|
38
|
-
|
|
39
|
-
export const Default: StoryFn< typeof ButtonGroup > = Template.bind( {} );
|
package/src/card/styles.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { COLORS, CONFIG } from '../utils';
|
|
|
12
12
|
// (as opposed to the `border` property), the value of the border radius needs
|
|
13
13
|
// to be adjusted by removing 1px (this is because the `box-shadow` renders
|
|
14
14
|
// as an "outer radius").
|
|
15
|
-
const adjustedBorderRadius = `calc(${ CONFIG.
|
|
15
|
+
const adjustedBorderRadius = `calc(${ CONFIG.radiusLarge } - 1px)`;
|
|
16
16
|
|
|
17
17
|
export const Card = css`
|
|
18
18
|
box-shadow: 0 0 0 1px ${ CONFIG.surfaceBorderColor };
|
|
@@ -8,8 +8,8 @@ Snapshot Diff:
|
|
|
8
8
|
@@ -1,8 +1,8 @@
|
|
9
9
|
<div>
|
|
10
10
|
<div
|
|
11
|
-
- class="components-card__body components-card-body css-
|
|
12
|
-
+ class="components-scrollable components-card__body components-card-body css-
|
|
11
|
+
- class="components-card__body components-card-body css-12jqy32-PolymorphicDiv-Body-borderRadius-medium e19lxcc00"
|
|
12
|
+
+ class="components-scrollable components-card__body components-card-body css-26nv7r-PolymorphicDiv-Scrollable-scrollableScrollbar-scrollY-Body-borderRadius-medium e19lxcc00"
|
|
13
13
|
data-wp-c16t="true"
|
|
14
14
|
data-wp-component="CardBody"
|
|
15
15
|
>
|
|
@@ -25,8 +25,8 @@ Snapshot Diff:
|
|
|
25
25
|
@@ -1,8 +1,8 @@
|
|
26
26
|
<div>
|
|
27
27
|
<div
|
|
28
|
-
- class="components-card__body components-card-body css-
|
|
29
|
-
+ class="components-card__body components-card-body css-
|
|
28
|
+
- class="components-card__body components-card-body css-12jqy32-PolymorphicDiv-Body-borderRadius-medium e19lxcc00"
|
|
29
|
+
+ class="components-card__body components-card-body css-1j7lja1-PolymorphicDiv-Body-borderRadius-medium-shady e19lxcc00"
|
|
30
30
|
data-wp-c16t="true"
|
|
31
31
|
data-wp-component="CardBody"
|
|
32
32
|
>
|
|
@@ -42,8 +42,8 @@ Snapshot Diff:
|
|
|
42
42
|
@@ -1,8 +1,8 @@
|
|
43
43
|
<div>
|
|
44
44
|
<div
|
|
45
|
-
- class="components-flex components-card__footer components-card-footer css-
|
|
46
|
-
+ class="components-flex components-card__footer components-card-footer css-
|
|
45
|
+
- class="components-flex components-card__footer components-card-footer css-19sc0cg-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-medium e19lxcc00"
|
|
46
|
+
+ class="components-flex components-card__footer components-card-footer css-14budie-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-medium-shady e19lxcc00"
|
|
47
47
|
data-wp-c16t="true"
|
|
48
48
|
data-wp-component="CardFooter"
|
|
49
49
|
>
|
|
@@ -59,8 +59,8 @@ Snapshot Diff:
|
|
|
59
59
|
@@ -1,8 +1,8 @@
|
|
60
60
|
<div>
|
|
61
61
|
<div
|
|
62
|
-
- class="components-flex components-card__footer components-card-footer css-
|
|
63
|
-
+ class="components-flex components-card__footer components-card-footer css-
|
|
62
|
+
- class="components-flex components-card__footer components-card-footer css-19sc0cg-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-medium e19lxcc00"
|
|
63
|
+
+ class="components-flex components-card__footer components-card-footer css-2io175-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-medium e19lxcc00"
|
|
64
64
|
data-wp-c16t="true"
|
|
65
65
|
data-wp-component="CardFooter"
|
|
66
66
|
>
|
|
@@ -76,8 +76,8 @@ Snapshot Diff:
|
|
|
76
76
|
@@ -1,8 +1,8 @@
|
|
77
77
|
<div>
|
|
78
78
|
<div
|
|
79
|
-
- class="components-flex components-card__header components-card-header css-
|
|
80
|
-
+ class="components-flex components-card__header components-card-header css-
|
|
79
|
+
- class="components-flex components-card__header components-card-header css-1qwshfy-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-medium e19lxcc00"
|
|
80
|
+
+ class="components-flex components-card__header components-card-header css-1bzc8bz-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-medium-shady e19lxcc00"
|
|
81
81
|
data-wp-c16t="true"
|
|
82
82
|
data-wp-component="CardHeader"
|
|
83
83
|
>
|
|
@@ -96,16 +96,16 @@ Snapshot Diff:
|
|
|
96
96
|
class="css-76dw7d-PolymorphicDiv-Content e19lxcc00"
|
|
97
97
|
>
|
|
98
98
|
<div
|
|
99
|
-
- class="components-flex components-card__header components-card-header css-
|
|
100
|
-
+ class="components-flex components-card__header components-card-header css-
|
|
99
|
+
- class="components-flex components-card__header components-card-header css-1qwshfy-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-medium e19lxcc00"
|
|
100
|
+
+ class="components-flex components-card__header components-card-header css-1t2zg3y-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-large e19lxcc00"
|
|
101
101
|
data-wp-c16t="true"
|
|
102
102
|
data-wp-component="CardHeader"
|
|
103
103
|
>
|
|
104
104
|
Header
|
|
105
105
|
</div>
|
|
106
106
|
<div
|
|
107
|
-
- class="components-card__body components-card-body css-
|
|
108
|
-
+ class="components-card__body components-card-body css-
|
|
107
|
+
- class="components-card__body components-card-body css-12jqy32-PolymorphicDiv-Body-borderRadius-medium e19lxcc00"
|
|
108
|
+
+ class="components-card__body components-card-body css-e0vrqx-PolymorphicDiv-Body-borderRadius-large e19lxcc00"
|
|
109
109
|
data-wp-c16t="true"
|
|
110
110
|
data-wp-component="CardBody"
|
|
111
111
|
>
|
|
@@ -122,7 +122,7 @@ Snapshot Diff:
|
|
|
122
122
|
Array [
|
|
123
123
|
Object {
|
|
124
124
|
"background-color": "#fff",
|
|
125
|
-
- "border-radius": "calc(
|
|
125
|
+
- "border-radius": "calc(8px - 1px)",
|
|
126
126
|
"box-shadow": "0 0 0 1px rgba(0, 0, 0, 0.1)",
|
|
127
127
|
"color": "#1e1e1e",
|
|
128
128
|
"outline": "none",
|
|
@@ -141,24 +141,24 @@ Snapshot Diff:
|
|
|
141
141
|
class="css-76dw7d-PolymorphicDiv-Content e19lxcc00"
|
|
142
142
|
>
|
|
143
143
|
<div
|
|
144
|
-
- class="components-flex components-card__header components-card-header css-
|
|
145
|
-
+ class="components-flex components-card__header components-card-header css-
|
|
144
|
+
- class="components-flex components-card__header components-card-header css-ubn8f6-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-large-borderless e19lxcc00"
|
|
145
|
+
+ class="components-flex components-card__header components-card-header css-1t1rswf-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-small e19lxcc00"
|
|
146
146
|
data-wp-c16t="true"
|
|
147
147
|
data-wp-component="CardHeader"
|
|
148
148
|
>
|
|
149
149
|
Header
|
|
150
150
|
</div>
|
|
151
151
|
<div
|
|
152
|
-
- class="components-card__body components-card-body css-
|
|
153
|
-
+ class="components-card__body components-card-body css-
|
|
152
|
+
- class="components-card__body components-card-body css-e0vrqx-PolymorphicDiv-Body-borderRadius-large e19lxcc00"
|
|
153
|
+
+ class="components-card__body components-card-body css-12jqy32-PolymorphicDiv-Body-borderRadius-medium e19lxcc00"
|
|
154
154
|
data-wp-c16t="true"
|
|
155
155
|
data-wp-component="CardBody"
|
|
156
156
|
>
|
|
157
157
|
Body
|
|
158
158
|
</div>
|
|
159
159
|
<div
|
|
160
|
-
- class="components-flex components-card__footer components-card-footer css-
|
|
161
|
-
+ class="components-flex components-card__footer components-card-footer css-
|
|
160
|
+
- class="components-flex components-card__footer components-card-footer css-167csgt-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-large-borderless e19lxcc00"
|
|
161
|
+
+ class="components-flex components-card__footer components-card-footer css-1kcgqsk-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-xSmallCardPadding e19lxcc00"
|
|
162
162
|
data-wp-c16t="true"
|
|
163
163
|
data-wp-component="CardFooter"
|
|
164
164
|
>
|
|
@@ -174,8 +174,8 @@ Snapshot Diff:
|
|
|
174
174
|
@@ -1,30 +1,30 @@
|
|
175
175
|
<div>
|
|
176
176
|
<div
|
|
177
|
-
- class="components-surface components-card css-
|
|
178
|
-
+ class="components-surface components-card css-
|
|
177
|
+
- class="components-surface components-card css-1hs39fv-PolymorphicDiv-Surface-getBorders-primary-Card-boxShadowless-rounded e19lxcc00"
|
|
178
|
+
+ class="components-surface components-card css-1c6nh8q-PolymorphicDiv-Surface-getBorders-primary-Card-rounded e19lxcc00"
|
|
179
179
|
data-wp-c16t="true"
|
|
180
180
|
data-wp-component="Card"
|
|
181
181
|
>
|
|
@@ -183,24 +183,24 @@ Snapshot Diff:
|
|
|
183
183
|
class="css-76dw7d-PolymorphicDiv-Content e19lxcc00"
|
|
184
184
|
>
|
|
185
185
|
<div
|
|
186
|
-
- class="components-flex components-card__header components-card-header css-
|
|
187
|
-
+ class="components-flex components-card__header components-card-header css-
|
|
186
|
+
- class="components-flex components-card__header components-card-header css-ubn8f6-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-large-borderless e19lxcc00"
|
|
187
|
+
+ class="components-flex components-card__header components-card-header css-1t1rswf-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-small e19lxcc00"
|
|
188
188
|
data-wp-c16t="true"
|
|
189
189
|
data-wp-component="CardHeader"
|
|
190
190
|
>
|
|
191
191
|
Header
|
|
192
192
|
</div>
|
|
193
193
|
<div
|
|
194
|
-
- class="components-card__body components-card-body css-
|
|
195
|
-
+ class="components-card__body components-card-body css-
|
|
194
|
+
- class="components-card__body components-card-body css-e0vrqx-PolymorphicDiv-Body-borderRadius-large e19lxcc00"
|
|
195
|
+
+ class="components-card__body components-card-body css-hms9n9-PolymorphicDiv-Body-borderRadius-small e19lxcc00"
|
|
196
196
|
data-wp-c16t="true"
|
|
197
197
|
data-wp-component="CardBody"
|
|
198
198
|
>
|
|
199
199
|
Body
|
|
200
200
|
</div>
|
|
201
201
|
<div
|
|
202
|
-
- class="components-flex components-card__footer components-card-footer css-
|
|
203
|
-
+ class="components-flex components-card__footer components-card-footer css-
|
|
202
|
+
- class="components-flex components-card__footer components-card-footer css-167csgt-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-large-borderless e19lxcc00"
|
|
203
|
+
+ class="components-flex components-card__footer components-card-footer css-18yn3ff-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-small e19lxcc00"
|
|
204
204
|
data-wp-c16t="true"
|
|
205
205
|
data-wp-component="CardFooter"
|
|
206
206
|
>
|
|
@@ -215,7 +215,7 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
215
215
|
position: relative;
|
|
216
216
|
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
217
217
|
outline: none;
|
|
218
|
-
border-radius: calc(
|
|
218
|
+
border-radius: calc(8px - 1px);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
.emotion-2 {
|
|
@@ -254,13 +254,13 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
.emotion-4:first-of-type {
|
|
257
|
-
border-top-left-radius: calc(
|
|
258
|
-
border-top-right-radius: calc(
|
|
257
|
+
border-top-left-radius: calc(8px - 1px);
|
|
258
|
+
border-top-right-radius: calc(8px - 1px);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
.emotion-4:last-of-type {
|
|
262
|
-
border-bottom-left-radius: calc(
|
|
263
|
-
border-bottom-right-radius: calc(
|
|
262
|
+
border-bottom-left-radius: calc(8px - 1px);
|
|
263
|
+
border-bottom-right-radius: calc(8px - 1px);
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
.emotion-6 {
|
|
@@ -271,13 +271,13 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
.emotion-6:first-of-type {
|
|
274
|
-
border-top-left-radius: calc(
|
|
275
|
-
border-top-right-radius: calc(
|
|
274
|
+
border-top-left-radius: calc(8px - 1px);
|
|
275
|
+
border-top-right-radius: calc(8px - 1px);
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
.emotion-6:last-of-type {
|
|
279
|
-
border-bottom-left-radius: calc(
|
|
280
|
-
border-bottom-right-radius: calc(
|
|
279
|
+
border-bottom-left-radius: calc(8px - 1px);
|
|
280
|
+
border-bottom-right-radius: calc(8px - 1px);
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
.emotion-10 {
|
|
@@ -306,13 +306,13 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
.emotion-14:first-of-type {
|
|
309
|
-
border-top-left-radius: calc(
|
|
310
|
-
border-top-right-radius: calc(
|
|
309
|
+
border-top-left-radius: calc(8px - 1px);
|
|
310
|
+
border-top-right-radius: calc(8px - 1px);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
.emotion-14:last-of-type {
|
|
314
|
-
border-bottom-left-radius: calc(
|
|
315
|
-
border-bottom-right-radius: calc(
|
|
314
|
+
border-bottom-left-radius: calc(8px - 1px);
|
|
315
|
+
border-bottom-right-radius: calc(8px - 1px);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
.emotion-16 {
|
|
@@ -347,13 +347,13 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
.emotion-16:first-of-type {
|
|
350
|
-
border-top-left-radius: calc(
|
|
351
|
-
border-top-right-radius: calc(
|
|
350
|
+
border-top-left-radius: calc(8px - 1px);
|
|
351
|
+
border-top-right-radius: calc(8px - 1px);
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
.emotion-16:last-of-type {
|
|
355
|
-
border-bottom-left-radius: calc(
|
|
356
|
-
border-bottom-right-radius: calc(
|
|
355
|
+
border-bottom-left-radius: calc(8px - 1px);
|
|
356
|
+
border-bottom-right-radius: calc(8px - 1px);
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
.emotion-18 {
|
|
@@ -370,7 +370,7 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
370
370
|
left: 0;
|
|
371
371
|
right: 0;
|
|
372
372
|
top: 0;
|
|
373
|
-
border-radius:
|
|
373
|
+
border-radius: 8px;
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
@media not ( prefers-reduced-motion ) {
|
|
@@ -469,15 +469,15 @@ Snapshot Diff:
|
|
|
469
469
|
</div>
|
|
470
470
|
<div
|
|
471
471
|
aria-hidden="true"
|
|
472
|
-
- class="components-elevation css-
|
|
473
|
-
+ class="components-elevation css-
|
|
472
|
+
- class="components-elevation css-a91pvj-PolymorphicDiv-Elevation-sx-Base-sx-Base-elevationClassName e19lxcc00"
|
|
473
|
+
+ class="components-elevation css-1q4cuxd-PolymorphicDiv-Elevation-sx-Base-sx-Base-elevationClassName e19lxcc00"
|
|
474
474
|
data-wp-c16t="true"
|
|
475
475
|
data-wp-component="Elevation"
|
|
476
476
|
/>
|
|
477
477
|
<div
|
|
478
478
|
aria-hidden="true"
|
|
479
|
-
- class="components-elevation css-
|
|
480
|
-
+ class="components-elevation css-
|
|
479
|
+
- class="components-elevation css-5u83fl-PolymorphicDiv-Elevation-sx-Base-sx-Base-elevationClassName e19lxcc00"
|
|
480
|
+
+ class="components-elevation css-1q4cuxd-PolymorphicDiv-Elevation-sx-Base-sx-Base-elevationClassName e19lxcc00"
|
|
481
481
|
data-wp-c16t="true"
|
|
482
482
|
data-wp-component="Elevation"
|
|
483
483
|
/>
|
|
@@ -497,7 +497,7 @@ exports[`Card Card component should warn when the isElevated prop is passed 1`]
|
|
|
497
497
|
position: relative;
|
|
498
498
|
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
499
499
|
outline: none;
|
|
500
|
-
border-radius: calc(
|
|
500
|
+
border-radius: calc(8px - 1px);
|
|
501
501
|
}
|
|
502
502
|
|
|
503
503
|
.emotion-2 {
|
|
@@ -518,7 +518,7 @@ exports[`Card Card component should warn when the isElevated prop is passed 1`]
|
|
|
518
518
|
left: 0;
|
|
519
519
|
right: 0;
|
|
520
520
|
top: 0;
|
|
521
|
-
border-radius:
|
|
521
|
+
border-radius: 8px;
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
@media not ( prefers-reduced-motion ) {
|
|
@@ -542,7 +542,7 @@ exports[`Card Card component should warn when the isElevated prop is passed 1`]
|
|
|
542
542
|
left: 0;
|
|
543
543
|
right: 0;
|
|
544
544
|
top: 0;
|
|
545
|
-
border-radius:
|
|
545
|
+
border-radius: 8px;
|
|
546
546
|
}
|
|
547
547
|
|
|
548
548
|
@media not ( prefers-reduced-motion ) {
|
|
@@ -111,6 +111,13 @@ If the control is clicked, the dropdown will expand regardless of this prop.
|
|
|
111
111
|
- Required: No
|
|
112
112
|
- Default: `true`
|
|
113
113
|
|
|
114
|
+
### placeholder
|
|
115
|
+
|
|
116
|
+
If passed, the combobox input will show a placeholder string if no values are present.
|
|
117
|
+
|
|
118
|
+
- Type: `string`
|
|
119
|
+
- Required: No
|
|
120
|
+
|
|
114
121
|
#### __experimentalRenderItem
|
|
115
122
|
|
|
116
123
|
Custom renderer invoked for each option in the suggestion list. The render prop receives as its argument an object containing, under the `item` key, the single option's data (directly from the array of data passed to the `options` prop).
|
|
@@ -129,6 +129,7 @@ function ComboboxControl( props: ComboboxControlProps ) {
|
|
|
129
129
|
},
|
|
130
130
|
__experimentalRenderItem,
|
|
131
131
|
expandOnFocus = true,
|
|
132
|
+
placeholder,
|
|
132
133
|
} = useDeprecated36pxDefaultSizeProp( props );
|
|
133
134
|
|
|
134
135
|
const [ value, setValue ] = useControlledValue( {
|
|
@@ -340,6 +341,7 @@ function ComboboxControl( props: ComboboxControlProps ) {
|
|
|
340
341
|
className="components-combobox-control__input"
|
|
341
342
|
instanceId={ instanceId }
|
|
342
343
|
ref={ inputContainer }
|
|
344
|
+
placeholder={ placeholder }
|
|
343
345
|
value={ isExpanded ? inputValue : currentLabel }
|
|
344
346
|
onFocus={ onFocus }
|
|
345
347
|
onBlur={ onBlur }
|