@wordpress/components 30.6.1-next.ff1cebbba.0 → 30.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -1
- package/build/color-palette/styles.js +2 -12
- package/build/color-palette/styles.js.map +2 -2
- package/build/combobox-control/index.js +1 -2
- package/build/combobox-control/index.js.map +2 -2
- package/build/custom-select-control-v2/custom-select.js +2 -2
- package/build/custom-select-control-v2/custom-select.js.map +2 -2
- package/build/date-time/date/styles.js +9 -9
- package/build/date-time/date/styles.js.map +2 -2
- package/build/focal-point-picker/index.js +21 -10
- package/build/focal-point-picker/index.js.map +3 -3
- package/build/focal-point-picker/styles/focal-point-picker-style.js +20 -11
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +2 -2
- package/build/font-size-picker/font-size-picker-select.js +20 -19
- package/build/font-size-picker/font-size-picker-select.js.map +3 -3
- package/build/font-size-picker/font-size-picker-toggle-group.js +27 -3
- package/build/font-size-picker/font-size-picker-toggle-group.js.map +2 -2
- package/build/font-size-picker/index.js +23 -11
- package/build/font-size-picker/index.js.map +2 -2
- package/build/font-size-picker/styles.js +30 -13
- package/build/font-size-picker/styles.js.map +3 -3
- package/build/font-size-picker/utils.js +11 -0
- package/build/font-size-picker/utils.js.map +2 -2
- package/build/palette-edit/styles.js +9 -9
- package/build/palette-edit/styles.js.map +2 -2
- package/build/popover/index.js +13 -2
- package/build/popover/index.js.map +2 -2
- package/build/tabs/styles.js +5 -5
- package/build/tabs/styles.js.map +1 -1
- package/build/tools-panel/styles.js +14 -22
- package/build/tools-panel/styles.js.map +2 -2
- package/build/utils/base-label.js +12 -12
- package/build/utils/base-label.js.map +3 -3
- package/build/utils/config-values.js +2 -0
- package/build/utils/config-values.js.map +2 -2
- package/build-module/color-palette/styles.js +2 -12
- package/build-module/color-palette/styles.js.map +2 -2
- package/build-module/combobox-control/index.js +1 -2
- package/build-module/combobox-control/index.js.map +2 -2
- package/build-module/custom-select-control-v2/custom-select.js +1 -1
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/date-time/date/styles.js +9 -9
- package/build-module/date-time/date/styles.js.map +2 -2
- package/build-module/focal-point-picker/index.js +23 -12
- package/build-module/focal-point-picker/index.js.map +2 -2
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +20 -12
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +2 -2
- package/build-module/font-size-picker/font-size-picker-select.js +21 -10
- package/build-module/font-size-picker/font-size-picker-select.js.map +2 -2
- package/build-module/font-size-picker/font-size-picker-toggle-group.js +27 -3
- package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +2 -2
- package/build-module/font-size-picker/index.js +23 -11
- package/build-module/font-size-picker/index.js.map +2 -2
- package/build-module/font-size-picker/styles.js +28 -12
- package/build-module/font-size-picker/styles.js.map +2 -2
- package/build-module/font-size-picker/utils.js +10 -0
- package/build-module/font-size-picker/utils.js.map +2 -2
- package/build-module/palette-edit/styles.js +9 -9
- package/build-module/palette-edit/styles.js.map +2 -2
- package/build-module/popover/index.js +13 -2
- package/build-module/popover/index.js.map +2 -2
- package/build-module/tabs/styles.js +5 -5
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +14 -22
- package/build-module/tools-panel/styles.js.map +2 -2
- package/build-module/utils/base-label.js +2 -12
- package/build-module/utils/base-label.js.map +2 -2
- package/build-module/utils/config-values.js +2 -0
- package/build-module/utils/config-values.js.map +2 -2
- package/build-style/style-rtl.css +11 -5
- package/build-style/style.css +11 -5
- package/build-types/card/card-body/component.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/component.d.ts +1 -3
- package/build-types/card/card-footer/component.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +6 -0
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/component.d.ts +1 -1
- package/build-types/card/card-header/component.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +7 -0
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/card/types.d.ts +3 -8
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/color-palette/styles.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.map +1 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/focal-point-picker/index.d.ts +1 -1
- package/build-types/focal-point-picker/index.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +253 -0
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-select.d.ts +3 -0
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts +3 -0
- package/build-types/font-size-picker/styles.d.ts.map +1 -1
- package/build-types/font-size-picker/test/font-size-picker-select.d.ts +2 -0
- package/build-types/font-size-picker/test/font-size-picker-select.d.ts.map +1 -0
- package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts +2 -0
- package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts.map +1 -0
- package/build-types/font-size-picker/types.d.ts +18 -4
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/font-size-picker/utils.d.ts +10 -1
- package/build-types/font-size-picker/utils.d.ts.map +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/utils/base-label.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +1 -0
- package/package.json +20 -20
- package/src/badge/styles.scss +1 -0
- package/src/button/style.scss +4 -1
- package/src/card/types.ts +3 -9
- package/src/color-palette/styles.ts +2 -1
- package/src/combobox-control/index.tsx +1 -4
- package/src/combobox-control/stories/index.story.tsx +0 -1
- package/src/combobox-control/test/index.tsx +20 -7
- package/src/custom-select-control-v2/custom-select.tsx +1 -1
- package/src/date-time/date/styles.ts +1 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
- package/src/dropdown-menu/style.scss +1 -0
- package/src/focal-point-picker/index.tsx +26 -16
- package/src/focal-point-picker/styles/focal-point-picker-style.ts +11 -1
- package/src/font-size-picker/README.md +10 -0
- package/src/font-size-picker/font-size-picker-select.tsx +44 -11
- package/src/font-size-picker/font-size-picker-toggle-group.tsx +58 -4
- package/src/font-size-picker/index.tsx +44 -19
- package/src/font-size-picker/styles.ts +9 -0
- package/src/font-size-picker/test/font-size-picker-select.tsx +221 -0
- package/src/font-size-picker/test/font-size-picker-toggle-group.tsx +275 -0
- package/src/font-size-picker/test/index.tsx +460 -2
- package/src/font-size-picker/types.ts +24 -4
- package/src/font-size-picker/utils.ts +23 -1
- package/src/menu-group/style.scss +1 -1
- package/src/menu-item/style.scss +1 -0
- package/src/modal/style.scss +1 -1
- package/src/palette-edit/styles.ts +1 -1
- package/src/panel/style.scss +1 -1
- package/src/popover/index.tsx +23 -2
- package/src/tab-panel/style.scss +1 -1
- package/src/tabs/styles.ts +1 -1
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +4 -4
- package/src/tools-panel/styles.ts +2 -2
- package/src/utils/base-label.ts +6 -1
- package/src/utils/config-values.js +1 -0
- package/src/validated-form-controls/style.scss +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focal-point-picker-style.d.ts","sourceRoot":"","sources":["../../../src/focal-point-picker/styles/focal-point-picker-style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"focal-point-picker-style.d.ts","sourceRoot":"","sources":["../../../src/focal-point-picker/styles/focal-point-picker-style.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAG9D,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOrB,CAAC;AAEF,eAAO,MAAM,YAAY;;SALX,MAAO,WAAW;yGAU/B,CAAC;AAEF,eAAO,MAAM,cAAc;;SAZb,MAAO,WAAW;yGA+C/B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;SAjDf,MAAO,WAAW;yGAyD/B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;UAE7B,CAAC;AAsBF,eAAO,MAAM,cAAc;;;;0CAM1B,CAAC;AAEF,eAAO,MAAM,QAAQ;;SA3FP,MAAO,WAAW;;kBAwGgB,OAAO;yGAEtD,CAAC;AAEF,eAAO,MAAM,QAAQ;;SA5GP,MAAO,WAAW;yGAiH/B,CAAC;AAEF,eAAO,MAAM,SAAS;;SAnHR,MAAO,WAAW;;;UAuH/B,CAAC;AAEF,eAAO,MAAM,SAAS;;SAzHR,MAAO,WAAW;;;UA6H/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font-size-picker-select.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/font-size-picker-select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"font-size-picker-select.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/font-size-picker-select.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EACX,yBAAyB,EAEzB,MAAM,SAAS,CAAC;AAUjB,QAAA,MAAM,oBAAoB,UAAY,yBAAyB,gCA+E9D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font-size-picker-toggle-group.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/font-size-picker-toggle-group.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,QAAA,MAAM,yBAAyB,UAAY,8BAA8B,
|
|
1
|
+
{"version":3,"file":"font-size-picker-toggle-group.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/font-size-picker-toggle-group.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,QAAA,MAAM,yBAAyB,UAAY,8BAA8B,gCA+ExE,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAiRnD,eAAO,MAAM,cAAc,qGAA0C,CAAC;AAEtE,eAAe,cAAc,CAAC"}
|
|
@@ -18,4 +18,7 @@ export declare const HeaderLabel: import("@emotion/styled").StyledComponent<impo
|
|
|
18
18
|
} & import("react").RefAttributes<any> & {
|
|
19
19
|
theme?: import("@emotion/react").Theme;
|
|
20
20
|
}, {}, {}>;
|
|
21
|
+
export declare const StyledCustomSelectControl: import("@emotion/styled").StyledComponent<import("../custom-select-control/types").CustomSelectProps<import("../custom-select-control/types").CustomSelectOption> & {
|
|
22
|
+
theme?: import("@emotion/react").Theme;
|
|
23
|
+
}, {}, {}>;
|
|
21
24
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/styles.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,SAAS;;SAWc,MAAO,WACpC;2HAPN,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;UAElB,CAAC;AAEF,eAAO,MAAM,YAAY;;UAExB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;UAKvB,CAAC;AAGF,eAAO,MAAM,yBAAyB;;UAKrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"font-size-picker-select.d.ts","sourceRoot":"","sources":["../../../src/font-size-picker/test/font-size-picker-select.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"font-size-picker-toggle-group.d.ts","sourceRoot":"","sources":["../../../src/font-size-picker/test/font-size-picker-toggle-group.tsx"],"names":[],"mappings":""}
|
|
@@ -37,6 +37,14 @@ export type FontSizePickerProps = {
|
|
|
37
37
|
* as a number, the component operates in "unitless mode" where the `units` property has no effect.
|
|
38
38
|
*/
|
|
39
39
|
value?: number | string;
|
|
40
|
+
/**
|
|
41
|
+
* Determines how the `value` prop should be interpreted.
|
|
42
|
+
* - `'literal'`: The `value` prop contains the actual font size value (number or string)
|
|
43
|
+
* - `'slug'`: The `value` prop contains the slug of the selected font size
|
|
44
|
+
*
|
|
45
|
+
* @default 'literal'
|
|
46
|
+
*/
|
|
47
|
+
valueMode?: 'literal' | 'slug';
|
|
40
48
|
/**
|
|
41
49
|
* If `true`, a slider will be displayed alongside the input field when a
|
|
42
50
|
* custom font size is active. Has no effect when `disableCustomFontSizes`
|
|
@@ -92,11 +100,17 @@ export type FontSize = {
|
|
|
92
100
|
* size. Used for the class generation process.
|
|
93
101
|
*/
|
|
94
102
|
slug: string;
|
|
103
|
+
/**
|
|
104
|
+
* The `hint` property is an optional string that provides additional information
|
|
105
|
+
* about the font size, such as fluid typography ranges or custom descriptions.
|
|
106
|
+
* Consumers can use this to provide their own preferred hints.
|
|
107
|
+
*/
|
|
108
|
+
hint?: string;
|
|
95
109
|
};
|
|
96
|
-
export type FontSizePickerSelectProps = Pick<FontSizePickerProps, 'value' | 'size'> & {
|
|
110
|
+
export type FontSizePickerSelectProps = Pick<FontSizePickerProps, 'value' | 'size' | 'valueMode'> & {
|
|
97
111
|
fontSizes: NonNullable<FontSizePickerProps['fontSizes']>;
|
|
98
112
|
disableCustomFontSizes: NonNullable<FontSizePickerProps['disableCustomFontSizes']>;
|
|
99
|
-
onChange:
|
|
113
|
+
onChange: (value: number | string | undefined, selectedItem?: FontSize) => void;
|
|
100
114
|
onSelectCustom: () => void;
|
|
101
115
|
__next40pxDefaultSize: boolean;
|
|
102
116
|
};
|
|
@@ -106,8 +120,8 @@ export type FontSizePickerSelectOption = {
|
|
|
106
120
|
value?: FontSize['size'];
|
|
107
121
|
hint?: string;
|
|
108
122
|
};
|
|
109
|
-
export type FontSizePickerToggleGroupProps = Pick<FontSizePickerProps, 'value' | 'size' | '__next40pxDefaultSize'> & {
|
|
123
|
+
export type FontSizePickerToggleGroupProps = Pick<FontSizePickerProps, 'value' | 'size' | '__next40pxDefaultSize' | 'valueMode'> & {
|
|
110
124
|
fontSizes: NonNullable<FontSizePickerProps['fontSizes']>;
|
|
111
|
-
onChange:
|
|
125
|
+
onChange: (value: number | string | undefined, selectedItem?: FontSize) => void;
|
|
112
126
|
};
|
|
113
127
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IACjC;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CACV,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAClC,YAAY,CAAC,EAAE,QAAQ,KACnB,IAAI,CAAC;IACV;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,kBAAkB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACtB;;;;OAIG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IACjC;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CACV,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAClC,YAAY,CAAC,EAAE,QAAQ,KACnB,IAAI,CAAC;IACV;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC/B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,kBAAkB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACtB;;;;OAIG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC3C,mBAAmB,EACnB,OAAO,GAAG,MAAM,GAAG,WAAW,CAC9B,GAAG;IACH,SAAS,EAAE,WAAW,CAAE,mBAAmB,CAAE,WAAW,CAAE,CAAE,CAAC;IAC7D,sBAAsB,EAAE,WAAW,CAClC,mBAAmB,CAAE,wBAAwB,CAAE,CAC/C,CAAC;IACF,QAAQ,EAAE,CACT,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAClC,YAAY,CAAC,EAAE,QAAQ,KACnB,IAAI,CAAC;IACV,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,QAAQ,CAAE,MAAM,CAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAChD,mBAAmB,EACnB,OAAO,GAAG,MAAM,GAAG,uBAAuB,GAAG,WAAW,CACxD,GAAG;IACH,SAAS,EAAE,WAAW,CAAE,mBAAmB,CAAE,WAAW,CAAE,CAAE,CAAC;IAC7D,QAAQ,EAAE,CACT,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAClC,YAAY,CAAC,EAAE,QAAQ,KACnB,IAAI,CAAC;CACV,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { FontSizePickerProps } from './types';
|
|
4
|
+
import type { FontSizePickerProps, FontSize } from './types';
|
|
5
5
|
/**
|
|
6
6
|
* Some themes use css vars for their font sizes, so until we
|
|
7
7
|
* have the way of calculating them don't display them.
|
|
@@ -10,4 +10,13 @@ import type { FontSizePickerProps } from './types';
|
|
|
10
10
|
* @return Whether the value is a simple css value.
|
|
11
11
|
*/
|
|
12
12
|
export declare function isSimpleCssValue(value: NonNullable<FontSizePickerProps['value']>): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Generates hint text for a font size.
|
|
15
|
+
* This function returns the hint provided by the consumer, if any.
|
|
16
|
+
* If no hint is provided, it falls back to showing the size value for simple CSS values.
|
|
17
|
+
*
|
|
18
|
+
* @param fontSize The font size object to generate hint text for.
|
|
19
|
+
* @return The hint text provided by the consumer, or the size value for simple CSS values, or undefined.
|
|
20
|
+
*/
|
|
21
|
+
export declare function generateFontSizeHint(fontSize: FontSize): string | undefined;
|
|
13
22
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,WAAW,CAAE,mBAAmB,CAAE,OAAO,CAAE,CAAE,WAKpD;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAE,QAAQ,EAAE,QAAQ,GAAI,MAAM,GAAG,SAAS,CAY7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EACX,YAAY,EAGZ,gBAAgB,EAChB,MAAM,SAAS,CAAC;AAIjB;;;;GAIG;AACH,eAAO,MAAM,SAAS,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EACX,YAAY,EAGZ,gBAAgB,EAChB,MAAM,SAAS,CAAC;AAIjB;;;;GAIG;AACH,eAAO,MAAM,SAAS,YAAY,CAAC;AA4bnC,eAAO,MAAM,WAAW,6GAWvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,OAAO;IAGlB;;OAEG;;;;IAIH;;;;OAIG;;;;CAKJ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-label.d.ts","sourceRoot":"","sources":["../../src/utils/base-label.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-label.d.ts","sourceRoot":"","sources":["../../src/utils/base-label.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,mBAAmB,2CAK/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "30.
|
|
3
|
+
"version": "30.7.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -54,24 +54,24 @@
|
|
|
54
54
|
"@types/gradient-parser": "1.1.0",
|
|
55
55
|
"@types/highlight-words-core": "1.2.1",
|
|
56
56
|
"@use-gesture/react": "^10.3.1",
|
|
57
|
-
"@wordpress/a11y": "^4.
|
|
58
|
-
"@wordpress/base-styles": "^6.
|
|
59
|
-
"@wordpress/compose": "^7.
|
|
60
|
-
"@wordpress/date": "^5.
|
|
61
|
-
"@wordpress/deprecated": "^4.
|
|
62
|
-
"@wordpress/dom": "^4.
|
|
63
|
-
"@wordpress/element": "^6.
|
|
64
|
-
"@wordpress/escape-html": "^3.
|
|
65
|
-
"@wordpress/hooks": "^4.
|
|
66
|
-
"@wordpress/html-entities": "^4.
|
|
67
|
-
"@wordpress/i18n": "^6.
|
|
68
|
-
"@wordpress/icons": "^11.
|
|
69
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
70
|
-
"@wordpress/keycodes": "^4.
|
|
71
|
-
"@wordpress/primitives": "^4.
|
|
72
|
-
"@wordpress/private-apis": "^1.
|
|
73
|
-
"@wordpress/rich-text": "^7.
|
|
74
|
-
"@wordpress/warning": "^3.
|
|
57
|
+
"@wordpress/a11y": "^4.34.0",
|
|
58
|
+
"@wordpress/base-styles": "^6.10.0",
|
|
59
|
+
"@wordpress/compose": "^7.34.0",
|
|
60
|
+
"@wordpress/date": "^5.34.0",
|
|
61
|
+
"@wordpress/deprecated": "^4.34.0",
|
|
62
|
+
"@wordpress/dom": "^4.34.0",
|
|
63
|
+
"@wordpress/element": "^6.34.0",
|
|
64
|
+
"@wordpress/escape-html": "^3.34.0",
|
|
65
|
+
"@wordpress/hooks": "^4.34.0",
|
|
66
|
+
"@wordpress/html-entities": "^4.34.0",
|
|
67
|
+
"@wordpress/i18n": "^6.7.0",
|
|
68
|
+
"@wordpress/icons": "^11.1.0",
|
|
69
|
+
"@wordpress/is-shallow-equal": "^5.34.0",
|
|
70
|
+
"@wordpress/keycodes": "^4.34.0",
|
|
71
|
+
"@wordpress/primitives": "^4.34.0",
|
|
72
|
+
"@wordpress/private-apis": "^1.34.0",
|
|
73
|
+
"@wordpress/rich-text": "^7.34.0",
|
|
74
|
+
"@wordpress/warning": "^3.34.0",
|
|
75
75
|
"change-case": "^4.1.2",
|
|
76
76
|
"clsx": "^2.1.1",
|
|
77
77
|
"colord": "^2.7.0",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"publishConfig": {
|
|
98
98
|
"access": "public"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "ceebff807958d2e8fc755b5a20473939c78b4d1d"
|
|
101
101
|
}
|
package/src/badge/styles.scss
CHANGED
package/src/button/style.scss
CHANGED
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
text-decoration: none;
|
|
16
16
|
font-family: inherit;
|
|
17
17
|
font-size: $default-font-size;
|
|
18
|
+
font-weight: $font-weight-medium;
|
|
18
19
|
margin: 0;
|
|
19
20
|
border: 0;
|
|
20
21
|
cursor: pointer;
|
|
21
22
|
-webkit-appearance: none;
|
|
22
23
|
background: none;
|
|
23
24
|
|
|
24
|
-
@media not (prefers-reduced-motion) {
|
|
25
|
+
@media not ( prefers-reduced-motion ) {
|
|
25
26
|
transition: box-shadow 0.1s linear;
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -251,6 +252,7 @@
|
|
|
251
252
|
background: none;
|
|
252
253
|
outline: none;
|
|
253
254
|
text-align: left;
|
|
255
|
+
font-weight: $font-weight-regular;
|
|
254
256
|
color: $components-color-accent;
|
|
255
257
|
text-decoration: underline;
|
|
256
258
|
|
|
@@ -385,6 +387,7 @@
|
|
|
385
387
|
svg {
|
|
386
388
|
fill: currentColor;
|
|
387
389
|
outline: none;
|
|
390
|
+
flex-shrink: 0;
|
|
388
391
|
|
|
389
392
|
// Optimize for high contrast modes.
|
|
390
393
|
// See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
|
package/src/card/types.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import type { CSSProperties } from 'react';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Internal dependencies
|
|
8
3
|
*/
|
|
9
4
|
import type { SurfaceProps } from '../surface/types';
|
|
5
|
+
import type { FlexProps } from '../flex/types';
|
|
10
6
|
|
|
11
7
|
type DeprecatedSizeOptions = 'extraSmall';
|
|
12
8
|
export type SizeOptions = 'xSmall' | 'small' | 'medium' | 'large';
|
|
@@ -90,8 +86,6 @@ type MarginalSubComponentProps = BaseSubComponentProps & {
|
|
|
90
86
|
isBorderless?: boolean;
|
|
91
87
|
};
|
|
92
88
|
|
|
93
|
-
export type HeaderProps = MarginalSubComponentProps
|
|
89
|
+
export type HeaderProps = MarginalSubComponentProps & Partial< FlexProps >;
|
|
94
90
|
|
|
95
|
-
export type FooterProps = MarginalSubComponentProps &
|
|
96
|
-
justify?: CSSProperties[ 'justifyContent' ];
|
|
97
|
-
};
|
|
91
|
+
export type FooterProps = MarginalSubComponentProps & Partial< FlexProps >;
|
|
@@ -7,11 +7,12 @@ import styled from '@emotion/styled';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { Heading } from '../heading';
|
|
10
|
+
import { CONFIG } from '../utils';
|
|
10
11
|
|
|
11
12
|
export const ColorHeading = styled( Heading )`
|
|
12
13
|
text-transform: uppercase;
|
|
13
14
|
line-height: 24px;
|
|
14
|
-
font-weight:
|
|
15
|
+
font-weight: ${ CONFIG.fontWeightMedium };
|
|
15
16
|
&&& {
|
|
16
17
|
font-size: 11px;
|
|
17
18
|
margin-bottom: 0;
|
|
@@ -365,13 +365,10 @@ function ComboboxControl( props: ComboboxControlProps ) {
|
|
|
365
365
|
/>
|
|
366
366
|
</FlexBlock>
|
|
367
367
|
{ isLoading && <Spinner /> }
|
|
368
|
-
{ allowReset && (
|
|
368
|
+
{ allowReset && Boolean( value ) && ! isExpanded && (
|
|
369
369
|
<Button
|
|
370
370
|
size="small"
|
|
371
371
|
icon={ closeSmall }
|
|
372
|
-
// Disable reason: Focus returns to input field when reset is clicked.
|
|
373
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
374
|
-
disabled={ ! value }
|
|
375
372
|
onClick={ handleOnReset }
|
|
376
373
|
onKeyDown={ handleResetStopPropagation }
|
|
377
374
|
label={ __( 'Reset' ) }
|
|
@@ -356,7 +356,7 @@ describe.each( [
|
|
|
356
356
|
expect( input ).toHaveValue( targetOption.label );
|
|
357
357
|
} );
|
|
358
358
|
|
|
359
|
-
it( 'should render
|
|
359
|
+
it( 'should not render Reset button when no value is set', () => {
|
|
360
360
|
render(
|
|
361
361
|
<Component
|
|
362
362
|
options={ timezones }
|
|
@@ -365,10 +365,23 @@ describe.each( [
|
|
|
365
365
|
/>
|
|
366
366
|
);
|
|
367
367
|
|
|
368
|
-
const resetButton = screen.
|
|
368
|
+
const resetButton = screen.queryByRole( 'button', { name: 'Reset' } );
|
|
369
|
+
|
|
370
|
+
expect( resetButton ).not.toBeInTheDocument();
|
|
371
|
+
} );
|
|
372
|
+
|
|
373
|
+
it( 'should not render Reset button when allowReset is false', () => {
|
|
374
|
+
render(
|
|
375
|
+
<Component
|
|
376
|
+
options={ timezones }
|
|
377
|
+
label={ defaultLabelText }
|
|
378
|
+
allowReset={ false }
|
|
379
|
+
/>
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
const resetButton = screen.queryByRole( 'button', { name: 'Reset' } );
|
|
369
383
|
|
|
370
|
-
expect( resetButton ).
|
|
371
|
-
expect( resetButton ).toBeDisabled();
|
|
384
|
+
expect( resetButton ).not.toBeInTheDocument();
|
|
372
385
|
} );
|
|
373
386
|
|
|
374
387
|
it( 'should reset input when clicking the Reset button', async () => {
|
|
@@ -400,8 +413,8 @@ describe.each( [
|
|
|
400
413
|
|
|
401
414
|
await user.click( resetButton );
|
|
402
415
|
|
|
416
|
+
expect( resetButton ).not.toBeInTheDocument();
|
|
403
417
|
expect( input ).toHaveValue( '' );
|
|
404
|
-
expect( resetButton ).toBeDisabled();
|
|
405
418
|
expect( input ).toHaveFocus();
|
|
406
419
|
} );
|
|
407
420
|
|
|
@@ -439,8 +452,8 @@ describe.each( [
|
|
|
439
452
|
// Pressing Enter/Return resets the input.
|
|
440
453
|
await user.keyboard( '{Enter}' );
|
|
441
454
|
|
|
455
|
+
expect( resetButton ).not.toBeInTheDocument();
|
|
442
456
|
expect( input ).toHaveValue( '' );
|
|
443
|
-
expect( resetButton ).toBeDisabled();
|
|
444
457
|
expect( input ).toHaveFocus();
|
|
445
458
|
} );
|
|
446
459
|
|
|
@@ -478,8 +491,8 @@ describe.each( [
|
|
|
478
491
|
// Pressing Spacebar resets the input.
|
|
479
492
|
await user.keyboard( '[Space]' );
|
|
480
493
|
|
|
494
|
+
expect( resetButton ).not.toBeInTheDocument();
|
|
481
495
|
expect( input ).toHaveValue( '' );
|
|
482
|
-
expect( resetButton ).toBeDisabled();
|
|
483
496
|
expect( input ).toHaveFocus();
|
|
484
497
|
} );
|
|
485
498
|
} );
|
|
@@ -12,7 +12,7 @@ import { __, _n, sprintf } from '@wordpress/i18n';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
import { VisuallyHidden } from '
|
|
15
|
+
import { VisuallyHidden } from '../visually-hidden';
|
|
16
16
|
import * as Styled from './styles';
|
|
17
17
|
import type {
|
|
18
18
|
CustomSelectContext as CustomSelectContextType,
|
|
@@ -74,7 +74,7 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
|
|
|
74
74
|
|
|
75
75
|
.emotion-12.emotion-12.emotion-12 {
|
|
76
76
|
font-size: 11px;
|
|
77
|
-
font-weight:
|
|
77
|
+
font-weight: 499;
|
|
78
78
|
line-height: 1.4;
|
|
79
79
|
text-transform: uppercase;
|
|
80
80
|
box-sizing: border-box;
|
|
@@ -356,7 +356,7 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
|
|
|
356
356
|
|
|
357
357
|
.emotion-12.emotion-12.emotion-12 {
|
|
358
358
|
font-size: 11px;
|
|
359
|
-
font-weight:
|
|
359
|
+
font-weight: 499;
|
|
360
360
|
line-height: 1.4;
|
|
361
361
|
text-transform: uppercase;
|
|
362
362
|
box-sizing: border-box;
|
|
@@ -648,7 +648,7 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
|
|
|
648
648
|
|
|
649
649
|
.emotion-12.emotion-12.emotion-12 {
|
|
650
650
|
font-size: 11px;
|
|
651
|
-
font-weight:
|
|
651
|
+
font-weight: 499;
|
|
652
652
|
line-height: 1.4;
|
|
653
653
|
text-transform: uppercase;
|
|
654
654
|
box-sizing: border-box;
|
|
@@ -952,7 +952,7 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
|
|
|
952
952
|
|
|
953
953
|
.emotion-12.emotion-12.emotion-12 {
|
|
954
954
|
font-size: 11px;
|
|
955
|
-
font-weight:
|
|
955
|
+
font-weight: 499;
|
|
956
956
|
line-height: 1.4;
|
|
957
957
|
text-transform: uppercase;
|
|
958
958
|
box-sizing: border-box;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
+
import type { KeyboardEventHandler } from 'react';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
@@ -10,19 +11,19 @@ import { __ } from '@wordpress/i18n';
|
|
|
10
11
|
import { useEffect, useRef, useState } from '@wordpress/element';
|
|
11
12
|
import {
|
|
12
13
|
__experimentalUseDragging as useDragging,
|
|
13
|
-
useInstanceId,
|
|
14
14
|
useIsomorphicLayoutEffect,
|
|
15
15
|
} from '@wordpress/compose';
|
|
16
|
+
import deprecated from '@wordpress/deprecated';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Internal dependencies
|
|
19
20
|
*/
|
|
20
|
-
import BaseControl from '../base-control';
|
|
21
21
|
import Controls from './controls';
|
|
22
22
|
import FocalPoint from './focal-point';
|
|
23
23
|
import Grid from './grid';
|
|
24
24
|
import Media from './media';
|
|
25
25
|
import {
|
|
26
|
+
Container,
|
|
26
27
|
MediaWrapper,
|
|
27
28
|
MediaContainer,
|
|
28
29
|
} from './styles/focal-point-picker-style';
|
|
@@ -33,7 +34,11 @@ import type {
|
|
|
33
34
|
FocalPoint as FocalPointType,
|
|
34
35
|
FocalPointPickerProps,
|
|
35
36
|
} from './types';
|
|
36
|
-
import
|
|
37
|
+
import {
|
|
38
|
+
StyledLabel,
|
|
39
|
+
StyledHelp,
|
|
40
|
+
} from '../base-control/styles/base-control-styles';
|
|
41
|
+
import { VisuallyHidden } from '../visually-hidden';
|
|
37
42
|
|
|
38
43
|
const GRID_OVERLAY_TIMEOUT = 600;
|
|
39
44
|
|
|
@@ -88,6 +93,7 @@ export function FocalPointPicker( {
|
|
|
88
93
|
autoPlay = true,
|
|
89
94
|
className,
|
|
90
95
|
help,
|
|
96
|
+
hideLabelFromVision,
|
|
91
97
|
label,
|
|
92
98
|
onChange,
|
|
93
99
|
onDrag,
|
|
@@ -104,6 +110,14 @@ export function FocalPointPicker( {
|
|
|
104
110
|
const [ point, setPoint ] = useState( valueProp );
|
|
105
111
|
const [ showGridOverlay, setShowGridOverlay ] = useState( false );
|
|
106
112
|
|
|
113
|
+
if ( ! __nextHasNoMarginBottom ) {
|
|
114
|
+
deprecated( 'Bottom margin styles for wp.components.FocalPointPicker', {
|
|
115
|
+
since: '6.7',
|
|
116
|
+
version: '7.0',
|
|
117
|
+
hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',
|
|
118
|
+
} );
|
|
119
|
+
}
|
|
120
|
+
|
|
107
121
|
const { startDrag, endDrag, isDragging } = useDragging( {
|
|
108
122
|
onDragStart: ( event ) => {
|
|
109
123
|
dragAreaRef.current?.focus();
|
|
@@ -233,9 +247,7 @@ export function FocalPointPicker( {
|
|
|
233
247
|
};
|
|
234
248
|
|
|
235
249
|
const classes = clsx( 'components-focal-point-picker-control', className );
|
|
236
|
-
|
|
237
|
-
const instanceId = useInstanceId( FocalPointPicker );
|
|
238
|
-
const id = `inspector-focal-point-picker-control-${ instanceId }`;
|
|
250
|
+
const Label = hideLabelFromVision ? VisuallyHidden : StyledLabel;
|
|
239
251
|
|
|
240
252
|
useUpdateEffect( () => {
|
|
241
253
|
setShowGridOverlay( true );
|
|
@@ -247,15 +259,8 @@ export function FocalPointPicker( {
|
|
|
247
259
|
}, [ x, y ] );
|
|
248
260
|
|
|
249
261
|
return (
|
|
250
|
-
<
|
|
251
|
-
{
|
|
252
|
-
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
253
|
-
__associatedWPComponentName="FocalPointPicker"
|
|
254
|
-
label={ label }
|
|
255
|
-
id={ id }
|
|
256
|
-
help={ help }
|
|
257
|
-
className={ classes }
|
|
258
|
-
>
|
|
262
|
+
<Container { ...restProps } as="fieldset" className={ classes }>
|
|
263
|
+
{ !! label && <Label as="legend">{ label }</Label> }
|
|
259
264
|
<MediaWrapper className="components-focal-point-picker-wrapper">
|
|
260
265
|
<MediaContainer
|
|
261
266
|
className="components-focal-point-picker"
|
|
@@ -291,7 +296,12 @@ export function FocalPointPicker( {
|
|
|
291
296
|
onChange?.( getFinalValue( value ) );
|
|
292
297
|
} }
|
|
293
298
|
/>
|
|
294
|
-
|
|
299
|
+
{ !! help && (
|
|
300
|
+
<StyledHelp __nextHasNoMarginBottom={ __nextHasNoMarginBottom }>
|
|
301
|
+
{ help }
|
|
302
|
+
</StyledHelp>
|
|
303
|
+
) }
|
|
304
|
+
</Container>
|
|
295
305
|
);
|
|
296
306
|
}
|
|
297
307
|
|
|
@@ -9,10 +9,20 @@ import styled from '@emotion/styled';
|
|
|
9
9
|
*/
|
|
10
10
|
import { Flex } from '../../flex';
|
|
11
11
|
import UnitControl from '../../unit-control';
|
|
12
|
-
import {
|
|
12
|
+
import { View } from '../../view';
|
|
13
|
+
import { COLORS, CONFIG, boxSizingReset, font } from '../../utils';
|
|
13
14
|
import type { FocalPointPickerControlsProps } from '../types';
|
|
14
15
|
import { INITIAL_BOUNDS } from '../utils';
|
|
15
16
|
|
|
17
|
+
export const Container = styled( View )`
|
|
18
|
+
border: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
font-family: ${ font( 'default.fontFamily' ) };
|
|
22
|
+
font-size: ${ font( 'default.fontSize' ) };
|
|
23
|
+
${ boxSizingReset }
|
|
24
|
+
`;
|
|
25
|
+
|
|
16
26
|
export const MediaWrapper = styled.div`
|
|
17
27
|
background-color: transparent;
|
|
18
28
|
display: flex;
|
|
@@ -103,6 +103,16 @@ The current font size value.
|
|
|
103
103
|
|
|
104
104
|
- Required: No
|
|
105
105
|
|
|
106
|
+
### `valueMode`: `'literal' | 'slug'`
|
|
107
|
+
|
|
108
|
+
Determines how the `value` prop should be interpreted.
|
|
109
|
+
|
|
110
|
+
- `'literal'`: The `value` prop contains the actual font size value (number or string).
|
|
111
|
+
- `'slug'`: The `value` prop contains the slug of the selected font size.
|
|
112
|
+
|
|
113
|
+
- Required: No
|
|
114
|
+
- Default: `'literal'`
|
|
115
|
+
|
|
106
116
|
### `withReset`: `boolean`
|
|
107
117
|
|
|
108
118
|
If `true`, a reset button will be displayed alongside the input field when a custom font size is active. Has no effect when `disableCustomFontSizes` is `true`.
|