@wordpress/components 30.9.0 → 31.0.1-next.6deb34194.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 +25 -4
- package/build/alignment-matrix-control/cell.js +131 -3
- package/build/alignment-matrix-control/cell.js.map +4 -4
- package/build/alignment-matrix-control/index.js +134 -6
- package/build/alignment-matrix-control/index.js.map +3 -3
- package/build/angle-picker-control/angle-circle.js +119 -15
- package/build/angle-picker-control/angle-circle.js.map +4 -4
- package/build/angle-picker-control/index.js +12 -7
- package/build/angle-picker-control/index.js.map +3 -3
- package/build/dropdown-menu/index.js +1 -1
- package/build/dropdown-menu/index.js.map +2 -2
- package/build/menu/styles.js +17 -17
- package/build/menu/styles.js.map +2 -2
- package/build/menu-item/index.js +1 -1
- package/build/menu-item/index.js.map +2 -2
- package/build/notice/index.js +1 -1
- package/build/notice/index.js.map +2 -2
- package/build/snackbar/index.js +1 -1
- package/build/snackbar/index.js.map +1 -1
- package/build/validated-form-controls/components/checkbox-control.js +0 -10
- package/build/validated-form-controls/components/checkbox-control.js.map +2 -2
- package/build/validated-form-controls/components/combobox-control.js +1 -11
- package/build/validated-form-controls/components/combobox-control.js.map +2 -2
- package/build/validated-form-controls/components/custom-select-control.js +0 -10
- package/build/validated-form-controls/components/custom-select-control.js.map +2 -2
- package/build/validated-form-controls/components/form-token-field.js +2 -12
- package/build/validated-form-controls/components/form-token-field.js.map +2 -2
- package/build/validated-form-controls/components/input-control.js +0 -10
- package/build/validated-form-controls/components/input-control.js.map +2 -2
- package/build/validated-form-controls/components/number-control.js +0 -10
- package/build/validated-form-controls/components/number-control.js.map +2 -2
- package/build/validated-form-controls/components/radio-control.js +0 -10
- package/build/validated-form-controls/components/radio-control.js.map +2 -2
- package/build/validated-form-controls/components/range-control.js +0 -10
- package/build/validated-form-controls/components/range-control.js.map +2 -2
- package/build/validated-form-controls/components/select-control.js +0 -10
- package/build/validated-form-controls/components/select-control.js.map +2 -2
- package/build/validated-form-controls/components/text-control.js +0 -10
- package/build/validated-form-controls/components/text-control.js.map +2 -2
- package/build/validated-form-controls/components/textarea-control.js +0 -10
- package/build/validated-form-controls/components/textarea-control.js.map +2 -2
- package/build/validated-form-controls/components/toggle-control.js +0 -10
- package/build/validated-form-controls/components/toggle-control.js.map +2 -2
- package/build/validated-form-controls/components/toggle-group-control.js +0 -10
- package/build/validated-form-controls/components/toggle-group-control.js.map +2 -2
- package/build/validated-form-controls/control-with-error.js +53 -58
- package/build/validated-form-controls/control-with-error.js.map +2 -2
- package/build-module/alignment-matrix-control/cell.js +131 -3
- package/build-module/alignment-matrix-control/cell.js.map +3 -3
- package/build-module/alignment-matrix-control/index.js +134 -6
- package/build-module/alignment-matrix-control/index.js.map +3 -3
- package/build-module/angle-picker-control/angle-circle.js +109 -15
- package/build-module/angle-picker-control/angle-circle.js.map +3 -3
- package/build-module/angle-picker-control/index.js +12 -7
- package/build-module/angle-picker-control/index.js.map +2 -2
- package/build-module/dropdown-menu/index.js +1 -1
- package/build-module/dropdown-menu/index.js.map +2 -2
- package/build-module/menu/styles.js +17 -17
- package/build-module/menu/styles.js.map +2 -2
- package/build-module/menu-item/index.js +1 -1
- package/build-module/menu-item/index.js.map +2 -2
- package/build-module/notice/index.js +1 -1
- package/build-module/notice/index.js.map +2 -2
- package/build-module/snackbar/index.js +1 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/validated-form-controls/components/checkbox-control.js +0 -10
- package/build-module/validated-form-controls/components/checkbox-control.js.map +2 -2
- package/build-module/validated-form-controls/components/combobox-control.js +1 -11
- package/build-module/validated-form-controls/components/combobox-control.js.map +2 -2
- package/build-module/validated-form-controls/components/custom-select-control.js +0 -10
- package/build-module/validated-form-controls/components/custom-select-control.js.map +2 -2
- package/build-module/validated-form-controls/components/form-token-field.js +2 -12
- package/build-module/validated-form-controls/components/form-token-field.js.map +2 -2
- package/build-module/validated-form-controls/components/input-control.js +0 -10
- package/build-module/validated-form-controls/components/input-control.js.map +2 -2
- package/build-module/validated-form-controls/components/number-control.js +0 -10
- package/build-module/validated-form-controls/components/number-control.js.map +2 -2
- package/build-module/validated-form-controls/components/radio-control.js +0 -10
- package/build-module/validated-form-controls/components/radio-control.js.map +2 -2
- package/build-module/validated-form-controls/components/range-control.js +0 -10
- package/build-module/validated-form-controls/components/range-control.js.map +2 -2
- package/build-module/validated-form-controls/components/select-control.js +0 -10
- package/build-module/validated-form-controls/components/select-control.js.map +2 -2
- package/build-module/validated-form-controls/components/text-control.js +0 -10
- package/build-module/validated-form-controls/components/text-control.js.map +2 -2
- package/build-module/validated-form-controls/components/textarea-control.js +0 -10
- package/build-module/validated-form-controls/components/textarea-control.js.map +2 -2
- package/build-module/validated-form-controls/components/toggle-control.js +0 -10
- package/build-module/validated-form-controls/components/toggle-control.js.map +2 -2
- package/build-module/validated-form-controls/components/toggle-group-control.js +0 -10
- package/build-module/validated-form-controls/components/toggle-group-control.js.map +2 -2
- package/build-module/validated-form-controls/control-with-error.js +53 -58
- package/build-module/validated-form-controls/control-with-error.js.map +2 -2
- package/build-style/style-rtl.css +21 -33
- package/build-style/style.css +21 -33
- package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
- package/build-types/angle-picker-control/angle-circle.d.ts +1 -1
- package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
- package/build-types/angle-picker-control/index.d.ts.map +1 -1
- package/build-types/notice/index.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/checkbox-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/checkbox-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/combobox-control.d.ts +2 -3
- package/build-types/validated-form-controls/components/combobox-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/custom-select-control.d.ts +1 -2
- package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/form-token-field.d.ts +1 -2
- package/build-types/validated-form-controls/components/form-token-field.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/input-control.d.ts +1 -2
- package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/number-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/radio-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/radio-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/range-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/select-control.d.ts +2 -3
- package/build-types/validated-form-controls/components/select-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/number-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts +7 -0
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/select-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/text-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/text-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/text-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/textarea-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/textarea-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/toggle-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/toggle-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/toggle-group-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/types.d.ts +1 -9
- package/build-types/validated-form-controls/components/types.d.ts.map +1 -1
- package/build-types/validated-form-controls/control-with-error.d.ts +4 -5
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/alignment-matrix-control/cell.tsx +14 -3
- package/src/alignment-matrix-control/index.tsx +15 -6
- package/src/alignment-matrix-control/style.module.scss +84 -0
- package/src/angle-picker-control/angle-circle.tsx +27 -12
- package/src/angle-picker-control/index.tsx +8 -7
- package/src/angle-picker-control/style.module.scss +40 -0
- package/src/button/style.scss +1 -1
- package/src/dropdown-menu/index.tsx +1 -1
- package/src/dropdown-menu/style.scss +1 -1
- package/src/guide/style.scss +3 -3
- package/src/menu/styles.ts +2 -2
- package/src/menu-item/index.tsx +1 -1
- package/src/menu-item/test/__snapshots__/index.js.snap +4 -4
- package/src/modal/style.scss +5 -5
- package/src/notice/index.tsx +53 -46
- package/src/notice/stories/index.story.tsx +17 -1
- package/src/notice/style.scss +3 -20
- package/src/snackbar/index.tsx +1 -1
- package/src/validated-form-controls/components/checkbox-control.tsx +1 -14
- package/src/validated-form-controls/components/combobox-control.tsx +1 -14
- package/src/validated-form-controls/components/custom-select-control.tsx +1 -19
- package/src/validated-form-controls/components/form-token-field.tsx +2 -15
- package/src/validated-form-controls/components/input-control.tsx +1 -14
- package/src/validated-form-controls/components/number-control.tsx +1 -16
- package/src/validated-form-controls/components/radio-control.tsx +2 -18
- package/src/validated-form-controls/components/range-control.tsx +1 -14
- package/src/validated-form-controls/components/select-control.tsx +1 -23
- package/src/validated-form-controls/components/stories/checkbox-control.story.tsx +11 -20
- package/src/validated-form-controls/components/stories/combobox-control.story.tsx +8 -17
- package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +8 -17
- package/src/validated-form-controls/components/stories/form-token-field.story.tsx +14 -26
- package/src/validated-form-controls/components/stories/input-control.story.tsx +25 -50
- package/src/validated-form-controls/components/stories/number-control.story.tsx +10 -19
- package/src/validated-form-controls/components/stories/overview.mdx +3 -3
- package/src/validated-form-controls/components/stories/overview.story.tsx +94 -79
- package/src/validated-form-controls/components/stories/radio-control.story.tsx +11 -20
- package/src/validated-form-controls/components/stories/range-control.story.tsx +8 -17
- package/src/validated-form-controls/components/stories/select-control.story.tsx +9 -18
- package/src/validated-form-controls/components/stories/text-control.story.tsx +11 -17
- package/src/validated-form-controls/components/stories/textarea-control.story.tsx +12 -16
- package/src/validated-form-controls/components/stories/toggle-control.story.tsx +11 -20
- package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +8 -17
- package/src/validated-form-controls/components/text-control.tsx +1 -14
- package/src/validated-form-controls/components/textarea-control.tsx +1 -14
- package/src/validated-form-controls/components/toggle-control.tsx +1 -14
- package/src/validated-form-controls/components/toggle-group-control.tsx +1 -14
- package/src/validated-form-controls/components/types.ts +1 -9
- package/src/validated-form-controls/control-with-error.tsx +57 -84
- package/src/validated-form-controls/style.scss +7 -7
- package/src/validated-form-controls/test/control-with-error.tsx +66 -5
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/alignment-matrix-control/styles.js +0 -105
- package/build/alignment-matrix-control/styles.js.map +0 -7
- package/build/angle-picker-control/styles/angle-picker-control-styles.js +0 -88
- package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +0 -7
- package/build-module/alignment-matrix-control/styles.js +0 -67
- package/build-module/alignment-matrix-control/styles.js.map +0 -7
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +0 -50
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +0 -7
- package/build-types/alignment-matrix-control/styles.d.ts +0 -21
- package/build-types/alignment-matrix-control/styles.d.ts.map +0 -1
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +0 -18
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +0 -1
- package/src/alignment-matrix-control/styles.ts +0 -113
- package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +0 -58
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
1
4
|
import type { ValidatedControlProps } from './components/types';
|
|
2
5
|
/**
|
|
3
6
|
* HTML elements that support the Constraint Validation API.
|
|
@@ -17,11 +20,7 @@ export declare const ControlWithError: import("react").ForwardRefExoticComponent
|
|
|
17
20
|
* Label the control as "optional" when _not_ `required`, instead of the inverse.
|
|
18
21
|
*/
|
|
19
22
|
markWhenOptional?: boolean;
|
|
20
|
-
|
|
21
|
-
* The callback to run when the input should be validated.
|
|
22
|
-
*/
|
|
23
|
-
onValidate?: () => void;
|
|
24
|
-
customValidity?: ValidatedControlProps<unknown>["customValidity"];
|
|
23
|
+
customValidity?: ValidatedControlProps["customValidity"];
|
|
25
24
|
/**
|
|
26
25
|
* A function that returns the actual element on which the validity data should be applied.
|
|
27
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-with-error.d.ts","sourceRoot":"","sources":["../../src/validated-form-controls/control-with-error.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"control-with-error.d.ts","sourceRoot":"","sources":["../../src/validated-form-controls/control-with-error.tsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AA0BhE;;;;;;;GAOG;AACH,KAAK,cAAc,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,CAAC;AA+KvB,eAAO,MAAM,gBAAgB;IArK3B;;OAEG;eACQ,OAAO;IAClB;;OAEG;uBACgB,OAAO;qBACT,qBAAqB,CAAE,gBAAgB,CAAE;IAC1D;;OAEG;uBACgB,MAAM,cAAc,GAAG,IAAI,GAAG,SAAS;IAC1D;;;;;;;OAOG;;kDAiJoE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "31.0.1-next.6deb34194.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -55,24 +55,24 @@
|
|
|
55
55
|
"@types/gradient-parser": "1.1.0",
|
|
56
56
|
"@types/highlight-words-core": "1.2.1",
|
|
57
57
|
"@use-gesture/react": "^10.3.1",
|
|
58
|
-
"@wordpress/a11y": "^4.36.0",
|
|
59
|
-
"@wordpress/base-styles": "^6.12.0",
|
|
60
|
-
"@wordpress/compose": "^7.36.0",
|
|
61
|
-
"@wordpress/date": "^5.36.0",
|
|
62
|
-
"@wordpress/deprecated": "^4.36.0",
|
|
63
|
-
"@wordpress/dom": "^4.36.0",
|
|
64
|
-
"@wordpress/element": "^6.36.0",
|
|
65
|
-
"@wordpress/escape-html": "^3.36.0",
|
|
66
|
-
"@wordpress/hooks": "^4.36.0",
|
|
67
|
-
"@wordpress/html-entities": "^4.36.0",
|
|
68
|
-
"@wordpress/i18n": "^6.9.0",
|
|
69
|
-
"@wordpress/icons": "^11.3.0",
|
|
70
|
-
"@wordpress/is-shallow-equal": "^5.36.0",
|
|
71
|
-
"@wordpress/keycodes": "^4.36.0",
|
|
72
|
-
"@wordpress/primitives": "^4.36.0",
|
|
73
|
-
"@wordpress/private-apis": "^1.36.0",
|
|
74
|
-
"@wordpress/rich-text": "^7.36.0",
|
|
75
|
-
"@wordpress/warning": "^3.36.0",
|
|
58
|
+
"@wordpress/a11y": "^4.36.1-next.6deb34194.0",
|
|
59
|
+
"@wordpress/base-styles": "^6.12.1-next.6deb34194.0",
|
|
60
|
+
"@wordpress/compose": "^7.36.1-next.6deb34194.0",
|
|
61
|
+
"@wordpress/date": "^5.36.1-next.6deb34194.0",
|
|
62
|
+
"@wordpress/deprecated": "^4.36.1-next.6deb34194.0",
|
|
63
|
+
"@wordpress/dom": "^4.36.1-next.6deb34194.0",
|
|
64
|
+
"@wordpress/element": "^6.36.1-next.6deb34194.0",
|
|
65
|
+
"@wordpress/escape-html": "^3.36.1-next.6deb34194.0",
|
|
66
|
+
"@wordpress/hooks": "^4.36.1-next.6deb34194.0",
|
|
67
|
+
"@wordpress/html-entities": "^4.36.1-next.6deb34194.0",
|
|
68
|
+
"@wordpress/i18n": "^6.9.1-next.6deb34194.0",
|
|
69
|
+
"@wordpress/icons": "^11.3.1-next.6deb34194.0",
|
|
70
|
+
"@wordpress/is-shallow-equal": "^5.36.1-next.6deb34194.0",
|
|
71
|
+
"@wordpress/keycodes": "^4.36.1-next.6deb34194.0",
|
|
72
|
+
"@wordpress/primitives": "^4.36.1-next.6deb34194.0",
|
|
73
|
+
"@wordpress/private-apis": "^1.36.1-next.6deb34194.0",
|
|
74
|
+
"@wordpress/rich-text": "^7.36.1-next.6deb34194.0",
|
|
75
|
+
"@wordpress/warning": "^3.36.1-next.6deb34194.0",
|
|
76
76
|
"change-case": "^4.1.2",
|
|
77
77
|
"clsx": "^2.1.1",
|
|
78
78
|
"colord": "^2.7.0",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"publishConfig": {
|
|
102
102
|
"access": "public"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "457096e9e9b3896d2d4fe54fc19d7fb571ee9a44"
|
|
105
105
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Internal dependencies
|
|
3
8
|
*/
|
|
@@ -9,9 +14,9 @@ import { VisuallyHidden } from '../visually-hidden';
|
|
|
9
14
|
* Internal dependencies
|
|
10
15
|
*/
|
|
11
16
|
import { ALIGNMENT_LABEL } from './utils';
|
|
12
|
-
import { Cell as CellView, Point } from './styles';
|
|
13
17
|
import type { AlignmentMatrixControlCellProps } from './types';
|
|
14
18
|
import type { WordPressComponentProps } from '../context';
|
|
19
|
+
import styles from './style.module.scss';
|
|
15
20
|
|
|
16
21
|
export default function Cell( {
|
|
17
22
|
id,
|
|
@@ -22,13 +27,19 @@ export default function Cell( {
|
|
|
22
27
|
<Tooltip text={ ALIGNMENT_LABEL[ value ] }>
|
|
23
28
|
<Composite.Item
|
|
24
29
|
id={ id }
|
|
25
|
-
render={
|
|
30
|
+
render={
|
|
31
|
+
<span
|
|
32
|
+
{ ...props }
|
|
33
|
+
className={ clsx( styles.cell, props.className ) }
|
|
34
|
+
role="gridcell"
|
|
35
|
+
/>
|
|
36
|
+
}
|
|
26
37
|
>
|
|
27
38
|
{ /* VoiceOver needs a text content to be rendered within grid cell,
|
|
28
39
|
otherwise it'll announce the content as "blank". So we use a visually
|
|
29
40
|
hidden element instead of aria-label. */ }
|
|
30
41
|
<VisuallyHidden>{ value }</VisuallyHidden>
|
|
31
|
-
<
|
|
42
|
+
<span className={ styles.point } role="presentation" />
|
|
32
43
|
</Composite.Item>
|
|
33
44
|
</Tooltip>
|
|
34
45
|
);
|
|
@@ -15,11 +15,11 @@ import { useCallback } from '@wordpress/element';
|
|
|
15
15
|
*/
|
|
16
16
|
import Cell from './cell';
|
|
17
17
|
import { Composite } from '../composite';
|
|
18
|
-
import { GridContainer, GridRow } from './styles';
|
|
19
18
|
import AlignmentMatrixControlIcon from './icon';
|
|
20
19
|
import { GRID, getItemId, getItemValue } from './utils';
|
|
21
20
|
import type { WordPressComponentProps } from '../context';
|
|
22
21
|
import type { AlignmentMatrixControlProps } from './types';
|
|
22
|
+
import styles from './style.module.scss';
|
|
23
23
|
|
|
24
24
|
function UnforwardedAlignmentMatrixControl( {
|
|
25
25
|
className,
|
|
@@ -49,7 +49,11 @@ function UnforwardedAlignmentMatrixControl( {
|
|
|
49
49
|
[ baseId, onChange ]
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
const classes = clsx(
|
|
52
|
+
const classes = clsx(
|
|
53
|
+
'component-alignment-matrix-control',
|
|
54
|
+
styles[ 'grid-container' ],
|
|
55
|
+
className
|
|
56
|
+
);
|
|
53
57
|
|
|
54
58
|
return (
|
|
55
59
|
<Composite
|
|
@@ -58,18 +62,23 @@ function UnforwardedAlignmentMatrixControl( {
|
|
|
58
62
|
setActiveId={ setActiveId }
|
|
59
63
|
rtl={ isRTL() }
|
|
60
64
|
render={
|
|
61
|
-
<
|
|
65
|
+
<div
|
|
62
66
|
{ ...props }
|
|
63
|
-
aria-label={ label }
|
|
64
67
|
className={ classes }
|
|
68
|
+
aria-label={ label }
|
|
65
69
|
id={ baseId }
|
|
66
70
|
role="grid"
|
|
67
|
-
|
|
71
|
+
style={ { width: `${ width }px` } }
|
|
68
72
|
/>
|
|
69
73
|
}
|
|
70
74
|
>
|
|
71
75
|
{ GRID.map( ( cells, index ) => (
|
|
72
|
-
<Composite.Row
|
|
76
|
+
<Composite.Row
|
|
77
|
+
render={
|
|
78
|
+
<div className={ styles[ 'grid-row' ] } role="row" />
|
|
79
|
+
}
|
|
80
|
+
key={ index }
|
|
81
|
+
>
|
|
73
82
|
{ cells.map( ( cell ) => (
|
|
74
83
|
<Cell
|
|
75
84
|
id={ getItemId( baseId, cell ) }
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@use "@wordpress/base-styles/variables" as *;
|
|
2
|
+
@use "../utils/theme-variables" as *;
|
|
3
|
+
|
|
4
|
+
.grid-container {
|
|
5
|
+
direction: ltr;
|
|
6
|
+
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: repeat(3, 1fr);
|
|
9
|
+
grid-template-rows: repeat(3, 1fr);
|
|
10
|
+
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
aspect-ratio: 1;
|
|
13
|
+
|
|
14
|
+
border: 1px solid transparent;
|
|
15
|
+
border-radius: $radius-medium;
|
|
16
|
+
outline: none;
|
|
17
|
+
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.grid-row {
|
|
22
|
+
grid-column: 1 / -1;
|
|
23
|
+
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-columns: repeat(3, 1fr);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.cell {
|
|
30
|
+
position: relative;
|
|
31
|
+
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
margin: 0;
|
|
38
|
+
padding: 0;
|
|
39
|
+
|
|
40
|
+
appearance: none;
|
|
41
|
+
border: none;
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.point {
|
|
46
|
+
display: block;
|
|
47
|
+
contain: strict;
|
|
48
|
+
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
width: 6px;
|
|
51
|
+
aspect-ratio: 1;
|
|
52
|
+
|
|
53
|
+
margin: auto;
|
|
54
|
+
|
|
55
|
+
color: $components-color-gray-400;
|
|
56
|
+
|
|
57
|
+
/* Use border instead of background color so that the point shows
|
|
58
|
+
in Windows High Contrast Mode */
|
|
59
|
+
border: 3px solid currentColor;
|
|
60
|
+
|
|
61
|
+
/* Highlight active item */
|
|
62
|
+
.cell[data-active-item] & {
|
|
63
|
+
color: $components-color-foreground;
|
|
64
|
+
transform: scale(calc(5 / 3));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Hover styles for non-active items */
|
|
68
|
+
.cell:not([data-active-item]):hover & {
|
|
69
|
+
color: $components-color-accent;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Show an outline only when interacting with keyboard */
|
|
73
|
+
.cell[data-focus-visible] & {
|
|
74
|
+
outline: 1px solid $components-color-accent;
|
|
75
|
+
outline-offset: 1px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media not (prefers-reduced-motion) {
|
|
79
|
+
transition-property: color, transform;
|
|
80
|
+
transition-duration: 120ms;
|
|
81
|
+
transition-timing-function: linear;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -7,11 +12,7 @@ import { __experimentalUseDragging as useDragging } from '@wordpress/compose';
|
|
|
7
12
|
/**
|
|
8
13
|
* Internal dependencies
|
|
9
14
|
*/
|
|
10
|
-
import
|
|
11
|
-
CircleRoot,
|
|
12
|
-
CircleIndicatorWrapper,
|
|
13
|
-
CircleIndicator,
|
|
14
|
-
} from './styles/angle-picker-control-styles';
|
|
15
|
+
import styles from './style.module.scss';
|
|
15
16
|
|
|
16
17
|
import type { WordPressComponentProps } from '../context';
|
|
17
18
|
import type { AngleCircleProps } from './types';
|
|
@@ -25,6 +26,7 @@ type UseDraggingCallbackEvent =
|
|
|
25
26
|
function AngleCircle( {
|
|
26
27
|
value,
|
|
27
28
|
onChange,
|
|
29
|
+
className,
|
|
28
30
|
...props
|
|
29
31
|
}: WordPressComponentProps< AngleCircleProps, 'div' > ) {
|
|
30
32
|
const angleCircleRef = useRef< HTMLDivElement | null >( null );
|
|
@@ -89,22 +91,35 @@ function AngleCircle( {
|
|
|
89
91
|
}, [ isDragging ] );
|
|
90
92
|
|
|
91
93
|
return (
|
|
92
|
-
|
|
94
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
95
|
+
<div
|
|
93
96
|
ref={ angleCircleRef }
|
|
94
97
|
onMouseDown={ startDrag }
|
|
95
|
-
className=
|
|
98
|
+
className={ clsx(
|
|
99
|
+
'components-angle-picker-control__angle-circle',
|
|
100
|
+
styles[ 'circle-root' ],
|
|
101
|
+
className
|
|
102
|
+
) }
|
|
96
103
|
{ ...props }
|
|
97
104
|
>
|
|
98
|
-
<
|
|
105
|
+
<div
|
|
99
106
|
style={
|
|
100
107
|
value ? { transform: `rotate(${ value }deg)` } : undefined
|
|
101
108
|
}
|
|
102
|
-
className=
|
|
109
|
+
className={ clsx(
|
|
110
|
+
'components-angle-picker-control__angle-circle-indicator-wrapper',
|
|
111
|
+
styles[ 'circle-indicator-wrapper' ]
|
|
112
|
+
) }
|
|
103
113
|
tabIndex={ -1 }
|
|
104
114
|
>
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
115
|
+
<div
|
|
116
|
+
className={ clsx(
|
|
117
|
+
'components-angle-picker-control__angle-circle-indicator',
|
|
118
|
+
styles[ 'circle-indicator' ]
|
|
119
|
+
) }
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
108
123
|
);
|
|
109
124
|
}
|
|
110
125
|
|
|
@@ -16,8 +16,9 @@ import { isRTL, __ } from '@wordpress/i18n';
|
|
|
16
16
|
import { Flex, FlexBlock } from '../flex';
|
|
17
17
|
import { Spacer } from '../spacer';
|
|
18
18
|
import NumberControl from '../number-control';
|
|
19
|
+
import InputControlPrefixWrapper from '../input-control/input-prefix-wrapper';
|
|
20
|
+
import InputControlSuffixWrapper from '../input-control/input-suffix-wrapper';
|
|
19
21
|
import AngleCircle from './angle-circle';
|
|
20
|
-
import { UnitText } from './styles/angle-picker-control-styles';
|
|
21
22
|
|
|
22
23
|
import type { WordPressComponentProps } from '../context';
|
|
23
24
|
import type { AnglePickerControlProps } from './types';
|
|
@@ -48,10 +49,11 @@ function UnforwardedAnglePickerControl(
|
|
|
48
49
|
|
|
49
50
|
const classes = clsx( 'components-angle-picker-control', className );
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
// Override the default behavior and position the degree symbol to the
|
|
53
|
+
// right of the number, regardless of the language direction.
|
|
54
|
+
const prefixOrSuffixProp = isRTL()
|
|
55
|
+
? { prefix: <InputControlPrefixWrapper>°</InputControlPrefixWrapper> }
|
|
56
|
+
: { suffix: <InputControlSuffixWrapper>°</InputControlSuffixWrapper> };
|
|
55
57
|
|
|
56
58
|
return (
|
|
57
59
|
<Flex { ...restProps } ref={ ref } className={ classes } gap={ 2 }>
|
|
@@ -66,8 +68,7 @@ function UnforwardedAnglePickerControl(
|
|
|
66
68
|
step="1"
|
|
67
69
|
value={ value }
|
|
68
70
|
spinControls="none"
|
|
69
|
-
|
|
70
|
-
suffix={ suffixedUnitText }
|
|
71
|
+
{ ...prefixOrSuffixProp }
|
|
71
72
|
/>
|
|
72
73
|
</FlexBlock>
|
|
73
74
|
<Spacer marginBottom="1" marginTop="auto">
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@use "@wordpress/base-styles/variables" as *;
|
|
2
|
+
@use "../utils/theme-variables" as *;
|
|
3
|
+
|
|
4
|
+
.circle-root {
|
|
5
|
+
border-radius: $radius-round;
|
|
6
|
+
border: $border-width solid $components-color-border;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
cursor: grab;
|
|
9
|
+
height: 32px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
width: 32px;
|
|
12
|
+
|
|
13
|
+
&:active {
|
|
14
|
+
cursor: grabbing;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.circle-indicator-wrapper {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
position: relative;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
|
|
24
|
+
&:focus-visible {
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.circle-indicator {
|
|
30
|
+
background: $components-color-accent;
|
|
31
|
+
border-radius: $radius-round;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
display: block;
|
|
34
|
+
left: 50%;
|
|
35
|
+
top: 4px;
|
|
36
|
+
transform: translateX(-50%);
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 6px;
|
|
39
|
+
height: 6px;
|
|
40
|
+
}
|
package/src/button/style.scss
CHANGED
|
@@ -164,7 +164,7 @@ function UnconnectedDropdownMenu( dropdownMenuProps: DropdownMenuProps ) {
|
|
|
164
164
|
{ controlSets?.flatMap( ( controlSet, indexOfSet ) =>
|
|
165
165
|
controlSet.map( ( control, indexOfControl ) => (
|
|
166
166
|
<Button
|
|
167
|
-
|
|
167
|
+
size="compact"
|
|
168
168
|
key={ [
|
|
169
169
|
indexOfSet,
|
|
170
170
|
indexOfControl,
|
package/src/guide/style.scss
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
height: $button-size;
|
|
60
60
|
justify-content: center;
|
|
61
61
|
margin: 0 0 $grid-unit-30 0;
|
|
62
|
-
padding: 0 $grid-unit-
|
|
62
|
+
padding: 0 $grid-unit-30;
|
|
63
63
|
position: relative;
|
|
64
64
|
width: 100%;
|
|
65
65
|
}
|
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
&.components-guide__back-button {
|
|
106
|
-
left: $grid-unit-
|
|
106
|
+
left: $grid-unit-30;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
&.components-guide__forward-button,
|
|
110
110
|
&.components-guide__finish-button {
|
|
111
|
-
right: $grid-unit-
|
|
111
|
+
right: $grid-unit-30;
|
|
112
112
|
}
|
|
113
113
|
}
|
package/src/menu/styles.ts
CHANGED
|
@@ -25,7 +25,7 @@ const ANIMATION_PARAMS = {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const CONTENT_WRAPPER_PADDING = space( 1 );
|
|
28
|
-
const ITEM_PADDING_BLOCK = space(
|
|
28
|
+
const ITEM_PADDING_BLOCK = space( 1 );
|
|
29
29
|
const ITEM_PADDING_INLINE = space( 3 );
|
|
30
30
|
|
|
31
31
|
// TODO:
|
|
@@ -152,7 +152,7 @@ const baseItem = css`
|
|
|
152
152
|
all: unset;
|
|
153
153
|
|
|
154
154
|
position: relative;
|
|
155
|
-
min-height: ${ space(
|
|
155
|
+
min-height: ${ space( 8 ) };
|
|
156
156
|
box-sizing: border-box;
|
|
157
157
|
|
|
158
158
|
/* Occupy the width of all grid columns (ie. full width) */
|
package/src/menu-item/index.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`MenuItem should match snapshot when all props provided 1`] = `
|
|
4
4
|
<button
|
|
5
5
|
aria-checked="true"
|
|
6
|
-
class="components-button components-menu-item__button my-class is-
|
|
6
|
+
class="components-button components-menu-item__button my-class is-compact"
|
|
7
7
|
role="menuitemcheckbox"
|
|
8
8
|
type="button"
|
|
9
9
|
>
|
|
@@ -35,7 +35,7 @@ exports[`MenuItem should match snapshot when all props provided 1`] = `
|
|
|
35
35
|
|
|
36
36
|
exports[`MenuItem should match snapshot when info is provided 1`] = `
|
|
37
37
|
<button
|
|
38
|
-
class="components-button components-menu-item__button is-
|
|
38
|
+
class="components-button components-menu-item__button is-compact"
|
|
39
39
|
role="menuitem"
|
|
40
40
|
type="button"
|
|
41
41
|
>
|
|
@@ -62,7 +62,7 @@ exports[`MenuItem should match snapshot when info is provided 1`] = `
|
|
|
62
62
|
|
|
63
63
|
exports[`MenuItem should match snapshot when isSelected and role are optionally provided 1`] = `
|
|
64
64
|
<button
|
|
65
|
-
class="components-button components-menu-item__button my-class is-
|
|
65
|
+
class="components-button components-menu-item__button my-class is-compact"
|
|
66
66
|
role="menuitem"
|
|
67
67
|
type="button"
|
|
68
68
|
>
|
|
@@ -94,7 +94,7 @@ exports[`MenuItem should match snapshot when isSelected and role are optionally
|
|
|
94
94
|
|
|
95
95
|
exports[`MenuItem should match snapshot when only label provided 1`] = `
|
|
96
96
|
<button
|
|
97
|
-
class="components-button components-menu-item__button is-
|
|
97
|
+
class="components-button components-menu-item__button is-compact"
|
|
98
98
|
role="menuitem"
|
|
99
99
|
type="button"
|
|
100
100
|
>
|
package/src/modal/style.scss
CHANGED
|
@@ -109,10 +109,10 @@
|
|
|
109
109
|
|
|
110
110
|
&.is-full-screen {
|
|
111
111
|
// When full screen, make sure the children container is full height.
|
|
112
|
-
.components-modal__content {
|
|
112
|
+
:where(.components-modal__content) {
|
|
113
113
|
display: flex;
|
|
114
114
|
// If this container is scrollable, bottom padding won't apply so we use margin instead.
|
|
115
|
-
margin-bottom: $grid-unit-
|
|
115
|
+
margin-bottom: $grid-unit-30;
|
|
116
116
|
padding-bottom: 0;
|
|
117
117
|
|
|
118
118
|
> :last-child {
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
.components-modal__header {
|
|
153
153
|
box-sizing: border-box;
|
|
154
154
|
border-bottom: $border-width solid transparent;
|
|
155
|
-
padding: $grid-unit-30
|
|
155
|
+
padding: $grid-unit-30;
|
|
156
156
|
display: flex;
|
|
157
157
|
flex-direction: row;
|
|
158
158
|
justify-content: space-between;
|
|
@@ -206,12 +206,12 @@
|
|
|
206
206
|
flex: 1;
|
|
207
207
|
margin-top: $header-height + $grid-unit-10;
|
|
208
208
|
// Small top padding required to avoid cutting off the visible outline when the first child element is focusable.
|
|
209
|
-
padding: $grid-unit-05 $grid-unit-
|
|
209
|
+
padding: $grid-unit-05 $grid-unit-30 $grid-unit-30;
|
|
210
210
|
overflow: auto;
|
|
211
211
|
|
|
212
212
|
&.hide-header {
|
|
213
213
|
margin-top: 0;
|
|
214
|
-
padding-top: $grid-unit-
|
|
214
|
+
padding-top: $grid-unit-30;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
&.is-scrollable:focus-visible {
|