@wordpress/components 19.8.1 → 19.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +11 -11
  3. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  4. package/build/heading/hook.js +1 -1
  5. package/build/heading/hook.js.map +1 -1
  6. package/build/input-control/index.js +26 -4
  7. package/build/input-control/index.js.map +1 -1
  8. package/build/input-control/styles/input-control-styles.js +25 -25
  9. package/build/input-control/styles/input-control-styles.js.map +1 -1
  10. package/build/navigation/styles/navigation-styles.js +12 -12
  11. package/build/navigation/styles/navigation-styles.js.map +1 -1
  12. package/build/notice/index.native.js +44 -40
  13. package/build/notice/index.native.js.map +1 -1
  14. package/build/notice/list.native.js +27 -45
  15. package/build/notice/list.native.js.map +1 -1
  16. package/build/palette-edit/index.js +2 -1
  17. package/build/palette-edit/index.js.map +1 -1
  18. package/build/sandbox/index.js +2 -2
  19. package/build/sandbox/index.js.map +1 -1
  20. package/build/select-control/styles/select-control-styles.js +5 -5
  21. package/build/select-control/styles/select-control-styles.js.map +1 -1
  22. package/build/surface/styles.js +8 -8
  23. package/build/surface/styles.js.map +1 -1
  24. package/build/text/hook.js +5 -5
  25. package/build/text/hook.js.map +1 -1
  26. package/build/text/styles/text-mixins.native.js +1 -1
  27. package/build/text/styles/text-mixins.native.js.map +1 -1
  28. package/build/text/styles.js +7 -7
  29. package/build/text/styles.js.map +1 -1
  30. package/build/ui/spinner/component.js +1 -1
  31. package/build/ui/spinner/component.js.map +1 -1
  32. package/build/utils/colors-values.js +9 -24
  33. package/build/utils/colors-values.js.map +1 -1
  34. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +11 -11
  35. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  36. package/build-module/heading/hook.js +1 -1
  37. package/build-module/heading/hook.js.map +1 -1
  38. package/build-module/input-control/index.js +23 -3
  39. package/build-module/input-control/index.js.map +1 -1
  40. package/build-module/input-control/styles/input-control-styles.js +25 -25
  41. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  42. package/build-module/navigation/styles/navigation-styles.js +13 -13
  43. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  44. package/build-module/notice/index.native.js +45 -41
  45. package/build-module/notice/index.native.js.map +1 -1
  46. package/build-module/notice/list.native.js +28 -46
  47. package/build-module/notice/list.native.js.map +1 -1
  48. package/build-module/palette-edit/index.js +3 -2
  49. package/build-module/palette-edit/index.js.map +1 -1
  50. package/build-module/sandbox/index.js +2 -2
  51. package/build-module/sandbox/index.js.map +1 -1
  52. package/build-module/select-control/styles/select-control-styles.js +5 -5
  53. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  54. package/build-module/surface/styles.js +8 -8
  55. package/build-module/surface/styles.js.map +1 -1
  56. package/build-module/text/hook.js +5 -5
  57. package/build-module/text/hook.js.map +1 -1
  58. package/build-module/text/styles/text-mixins.native.js +2 -2
  59. package/build-module/text/styles/text-mixins.native.js.map +1 -1
  60. package/build-module/text/styles.js +7 -7
  61. package/build-module/text/styles.js.map +1 -1
  62. package/build-module/ui/spinner/component.js +1 -1
  63. package/build-module/ui/spinner/component.js.map +1 -1
  64. package/build-module/utils/colors-values.js +19 -23
  65. package/build-module/utils/colors-values.js.map +1 -1
  66. package/build-style/style-rtl.css +17 -0
  67. package/build-style/style.css +17 -0
  68. package/build-types/color-picker/styles.d.ts +1 -1
  69. package/build-types/input-control/index.d.ts +22 -3
  70. package/build-types/input-control/index.d.ts.map +1 -1
  71. package/build-types/input-control/input-field.d.ts +1 -1
  72. package/build-types/input-control/input-field.d.ts.map +1 -1
  73. package/build-types/input-control/stories/index.d.ts +5 -5
  74. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  75. package/build-types/input-control/types.d.ts +73 -3
  76. package/build-types/input-control/types.d.ts.map +1 -1
  77. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  78. package/build-types/text/test/index.d.ts +2 -0
  79. package/build-types/text/test/index.d.ts.map +1 -0
  80. package/build-types/utils/colors-values.d.ts +6 -146
  81. package/build-types/utils/colors-values.d.ts.map +1 -1
  82. package/package.json +17 -17
  83. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +5 -3
  84. package/src/heading/hook.ts +1 -1
  85. package/src/heading/test/__snapshots__/index.js.snap +3 -3
  86. package/src/input-control/README.md +2 -2
  87. package/src/input-control/index.tsx +22 -3
  88. package/src/input-control/stories/index.tsx +63 -0
  89. package/src/input-control/styles/input-control-styles.tsx +1 -2
  90. package/src/input-control/types.ts +73 -2
  91. package/src/navigation/styles/navigation-styles.js +5 -5
  92. package/src/notice/index.native.js +44 -54
  93. package/src/notice/list.native.js +27 -51
  94. package/src/notice/style.native.scss +1 -0
  95. package/src/palette-edit/index.js +8 -2
  96. package/src/query-controls/README.md +2 -2
  97. package/src/sandbox/index.js +2 -2
  98. package/src/select-control/styles/select-control-styles.ts +1 -1
  99. package/src/surface/styles.js +1 -1
  100. package/src/text/hook.js +1 -1
  101. package/src/text/styles/text-mixins.native.js +2 -2
  102. package/src/text/styles.js +1 -1
  103. package/src/text/test/__snapshots__/{index.js.snap → index.tsx.snap} +16 -0
  104. package/src/text/test/{index.js → index.tsx} +12 -6
  105. package/src/toolbar-group/style.scss +20 -0
  106. package/src/tools-panel/test/__snapshots__/index.js.snap +1 -1
  107. package/src/ui/spinner/component.js +1 -1
  108. package/src/ui/spinner/test/__snapshots__/index.js.snap +3 -3
  109. package/src/utils/colors-values.js +18 -22
  110. package/tsconfig.json +8 -2
  111. package/tsconfig.tsbuildinfo +1 -1
  112. package/build-types/spinner/styles/spinner-styles.d.ts +0 -5
  113. package/build-types/spinner/styles/spinner-styles.d.ts.map +0 -1
  114. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts +0 -15
  115. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +0 -1
  116. package/src/input-control/stories/index.js +0 -71
@@ -12,7 +12,7 @@ Snapshot Diff:
12
12
  <div
13
13
  class="css-tada40-BarsView e1s9yo7h0"
14
14
  - style="color: blue;"
15
- + style="color: rgb(0, 0, 0);"
15
+ + style="color: rgb(30, 30, 30);"
16
16
  >
17
17
  <div
18
18
  class="InnerBar1"
@@ -193,7 +193,7 @@ exports[`props should render correctly 1`] = `
193
193
  >
194
194
  <div
195
195
  class="emotion-4 emotion-5"
196
- style="color: rgb(0, 0, 0);"
196
+ style="color: rgb(30, 30, 30);"
197
197
  >
198
198
  <div
199
199
  class="InnerBar1"
@@ -258,6 +258,6 @@ Snapshot Diff:
258
258
  >
259
259
  <div
260
260
  class="css-tada40-BarsView e1s9yo7h0"
261
- style="color: rgb(0, 0, 0);"
261
+ style="color: rgb(30, 30, 30);"
262
262
  >
263
263
  `;
@@ -8,18 +8,12 @@ import { merge } from 'lodash';
8
8
  */
9
9
  import { rgba } from './colors';
10
10
 
11
- export const BASE = {
11
+ const BASE = {
12
12
  black: '#000',
13
13
  white: '#fff',
14
14
  };
15
15
 
16
- /**
17
- * TODO: Continue to update values as "G2" design evolves.
18
- *
19
- * "G2" refers to the movement to advance the interface of the block editor.
20
- * https://github.com/WordPress/gutenberg/issues/18667
21
- */
22
- export const G2 = {
16
+ const G2 = {
23
17
  blue: {
24
18
  medium: {
25
19
  focus: '#007cba',
@@ -35,10 +29,6 @@ export const G2 = {
35
29
  200: '#e0e0e0', // Used sparingly for light borders.
36
30
  100: '#f0f0f0', // Used for light gray backgrounds.
37
31
  },
38
- darkGray: {
39
- primary: '#1e1e1e',
40
- heading: '#050505',
41
- },
42
32
  mediumGray: {
43
33
  text: '#757575',
44
34
  },
@@ -49,7 +39,7 @@ export const G2 = {
49
39
  },
50
40
  };
51
41
 
52
- export const DARK_GRAY = {
42
+ const DARK_GRAY = {
53
43
  900: '#191e23',
54
44
  800: '#23282d',
55
45
  700: '#32373c',
@@ -63,7 +53,7 @@ export const DARK_GRAY = {
63
53
  placeholder: rgba( G2.gray[ 900 ], 0.62 ),
64
54
  };
65
55
 
66
- export const DARK_OPACITY = {
56
+ const DARK_OPACITY = {
67
57
  900: rgba( '#000510', 0.9 ),
68
58
  800: rgba( '#00000a', 0.85 ),
69
59
  700: rgba( '#06060b', 0.8 ),
@@ -76,7 +66,7 @@ export const DARK_OPACITY = {
76
66
  backgroundFill: rgba( DARK_GRAY[ 700 ], 0.7 ),
77
67
  };
78
68
 
79
- export const DARK_OPACITY_LIGHT = {
69
+ const DARK_OPACITY_LIGHT = {
80
70
  900: rgba( '#304455', 0.45 ),
81
71
  800: rgba( '#425863', 0.4 ),
82
72
  700: rgba( '#667886', 0.35 ),
@@ -88,7 +78,7 @@ export const DARK_OPACITY_LIGHT = {
88
78
  100: rgba( '#747474', 0.05 ),
89
79
  };
90
80
 
91
- export const LIGHT_GRAY = {
81
+ const LIGHT_GRAY = {
92
82
  900: '#a2aab2',
93
83
  800: '#b5bcc2',
94
84
  700: '#ccd0d4',
@@ -101,7 +91,7 @@ export const LIGHT_GRAY = {
101
91
  placeholder: rgba( BASE.white, 0.65 ),
102
92
  };
103
93
 
104
- export const LIGHT_OPACITY_LIGHT = {
94
+ const LIGHT_OPACITY_LIGHT = {
105
95
  900: rgba( BASE.white, 0.5 ),
106
96
  800: rgba( BASE.white, 0.45 ),
107
97
  700: rgba( BASE.white, 0.4 ),
@@ -117,7 +107,7 @@ export const LIGHT_OPACITY_LIGHT = {
117
107
  // Additional colors.
118
108
  // Some are from https://make.wordpress.org/design/handbook/foundations/colors/.
119
109
 
120
- export const BLUE = {
110
+ const BLUE = {
121
111
  wordpress: {
122
112
  700: '#00669b',
123
113
  },
@@ -139,19 +129,19 @@ export const BLUE = {
139
129
  },
140
130
  };
141
131
 
142
- export const ALERT = {
132
+ const ALERT = {
143
133
  yellow: '#f0b849',
144
134
  red: '#d94f4f',
145
135
  green: '#4ab866',
146
136
  };
147
137
 
148
- export const ADMIN = {
138
+ const ADMIN = {
149
139
  theme: `var( --wp-admin-theme-color, ${ BLUE.wordpress[ 700 ] })`,
150
140
  themeDark10: `var( --wp-admin-theme-color-darker-10, ${ BLUE.medium.focus })`,
151
141
  };
152
142
 
153
143
  // Namespaced values for raw colors hex codes.
154
- export const UI = {
144
+ const UI = {
155
145
  theme: ADMIN.theme,
156
146
  background: BASE.white,
157
147
  backgroundDisabled: LIGHT_GRAY[ 200 ],
@@ -169,10 +159,16 @@ export const UI = {
169
159
  // Using Object.assign instead of { ...spread } syntax helps TypeScript
170
160
  // to extract the correct type defs here.
171
161
  export const COLORS = Object.assign( {}, BASE, {
172
- darkGray: merge( {}, DARK_GRAY, G2.darkGray ),
162
+ darkGray: DARK_GRAY,
173
163
  darkOpacity: DARK_OPACITY,
174
164
  darkOpacityLight: DARK_OPACITY_LIGHT,
175
165
  mediumGray: G2.mediumGray,
166
+ /**
167
+ * The main gray color object (since Apr 16, 2022).
168
+ *
169
+ * We are in the process of simplifying the colors in this file,
170
+ * please prefer this `gray` object in the meantime.
171
+ */
176
172
  gray: G2.gray,
177
173
  lightGray: merge( {}, LIGHT_GRAY, G2.lightGray ),
178
174
  lightGrayLight: LIGHT_OPACITY_LIGHT,
package/tsconfig.json CHANGED
@@ -3,7 +3,13 @@
3
3
  "compilerOptions": {
4
4
  "rootDir": "src",
5
5
  "declarationDir": "build-types",
6
- "types": [ "gutenberg-env" ],
6
+ "types": [
7
+ "gutenberg-env",
8
+ "gutenberg-test-env",
9
+ "jest",
10
+ "@testing-library/jest-dom",
11
+ "snapshot-diff",
12
+ ],
7
13
  // Some errors in Reakit types with TypeScript 4.3
8
14
  // Remove the following line when they've been addressed.
9
15
  "skipLibCheck": true,
@@ -90,7 +96,7 @@
90
96
  "src/**/*.native.js",
91
97
  "src/**/react-native-*",
92
98
  "src/**/stories/**.js", // only exclude js files, tsx files should be checked
93
- "src/**/test",
99
+ "src/**/test/**.js", // only exclude js files, ts{x} files should be checked
94
100
  "src/ui/__storybook-utils",
95
101
  "src/ui/font-size-control"
96
102
  ]