@wordpress/components 30.6.1 → 30.7.1-next.36001005c.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 (103) hide show
  1. package/CHANGELOG.md +10 -2
  2. package/build/color-palette/styles.js +2 -12
  3. package/build/color-palette/styles.js.map +2 -2
  4. package/build/custom-select-control-v2/custom-select.js +2 -2
  5. package/build/custom-select-control-v2/custom-select.js.map +2 -2
  6. package/build/date-time/date/styles.js +9 -9
  7. package/build/date-time/date/styles.js.map +2 -2
  8. package/build/font-size-picker/font-size-picker-select.js +19 -20
  9. package/build/font-size-picker/font-size-picker-select.js.map +3 -3
  10. package/build/font-size-picker/font-size-picker-toggle-group.js +3 -27
  11. package/build/font-size-picker/font-size-picker-toggle-group.js.map +2 -2
  12. package/build/font-size-picker/index.js +11 -23
  13. package/build/font-size-picker/index.js.map +2 -2
  14. package/build/font-size-picker/styles.js +13 -30
  15. package/build/font-size-picker/styles.js.map +3 -3
  16. package/build/font-size-picker/utils.js +0 -11
  17. package/build/font-size-picker/utils.js.map +2 -2
  18. package/build/palette-edit/styles.js +9 -9
  19. package/build/palette-edit/styles.js.map +2 -2
  20. package/build/popover/index.js +13 -2
  21. package/build/popover/index.js.map +2 -2
  22. package/build/tools-panel/styles.js +14 -22
  23. package/build/tools-panel/styles.js.map +2 -2
  24. package/build/utils/base-label.js +12 -12
  25. package/build/utils/base-label.js.map +3 -3
  26. package/build/utils/config-values.js +2 -0
  27. package/build/utils/config-values.js.map +2 -2
  28. package/build-module/color-palette/styles.js +2 -12
  29. package/build-module/color-palette/styles.js.map +2 -2
  30. package/build-module/custom-select-control-v2/custom-select.js +1 -1
  31. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  32. package/build-module/date-time/date/styles.js +9 -9
  33. package/build-module/date-time/date/styles.js.map +2 -2
  34. package/build-module/font-size-picker/font-size-picker-select.js +10 -21
  35. package/build-module/font-size-picker/font-size-picker-select.js.map +2 -2
  36. package/build-module/font-size-picker/font-size-picker-toggle-group.js +3 -27
  37. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +2 -2
  38. package/build-module/font-size-picker/index.js +11 -23
  39. package/build-module/font-size-picker/index.js.map +2 -2
  40. package/build-module/font-size-picker/styles.js +12 -28
  41. package/build-module/font-size-picker/styles.js.map +2 -2
  42. package/build-module/font-size-picker/utils.js +0 -10
  43. package/build-module/font-size-picker/utils.js.map +2 -2
  44. package/build-module/palette-edit/styles.js +9 -9
  45. package/build-module/palette-edit/styles.js.map +2 -2
  46. package/build-module/popover/index.js +13 -2
  47. package/build-module/popover/index.js.map +2 -2
  48. package/build-module/tools-panel/styles.js +14 -22
  49. package/build-module/tools-panel/styles.js.map +2 -2
  50. package/build-module/utils/base-label.js +2 -12
  51. package/build-module/utils/base-label.js.map +2 -2
  52. package/build-module/utils/config-values.js +2 -0
  53. package/build-module/utils/config-values.js.map +2 -2
  54. package/build-style/style-rtl.css +8 -4
  55. package/build-style/style.css +8 -4
  56. package/build-types/color-palette/styles.d.ts.map +1 -1
  57. package/build-types/date-time/date/styles.d.ts.map +1 -1
  58. package/build-types/font-size-picker/font-size-picker-select.d.ts +0 -3
  59. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  60. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  61. package/build-types/font-size-picker/index.d.ts.map +1 -1
  62. package/build-types/font-size-picker/styles.d.ts +0 -3
  63. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  64. package/build-types/font-size-picker/types.d.ts +4 -18
  65. package/build-types/font-size-picker/types.d.ts.map +1 -1
  66. package/build-types/font-size-picker/utils.d.ts +1 -10
  67. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  68. package/build-types/popover/index.d.ts.map +1 -1
  69. package/build-types/utils/base-label.d.ts.map +1 -1
  70. package/build-types/utils/config-values.d.ts +1 -0
  71. package/package.json +20 -20
  72. package/src/badge/styles.scss +0 -1
  73. package/src/button/style.scss +4 -1
  74. package/src/color-palette/styles.ts +2 -1
  75. package/src/custom-select-control-v2/custom-select.tsx +1 -1
  76. package/src/date-time/date/styles.ts +1 -0
  77. package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
  78. package/src/dropdown-menu/style.scss +1 -0
  79. package/src/font-size-picker/README.md +0 -10
  80. package/src/font-size-picker/font-size-picker-select.tsx +11 -44
  81. package/src/font-size-picker/font-size-picker-toggle-group.tsx +4 -58
  82. package/src/font-size-picker/index.tsx +19 -44
  83. package/src/font-size-picker/styles.ts +0 -9
  84. package/src/font-size-picker/test/index.tsx +2 -460
  85. package/src/font-size-picker/types.ts +4 -24
  86. package/src/font-size-picker/utils.ts +1 -23
  87. package/src/menu-group/style.scss +1 -1
  88. package/src/menu-item/style.scss +1 -0
  89. package/src/palette-edit/styles.ts +1 -1
  90. package/src/panel/style.scss +1 -1
  91. package/src/popover/index.tsx +23 -2
  92. package/src/tab-panel/style.scss +1 -1
  93. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +4 -4
  94. package/src/tools-panel/styles.ts +2 -2
  95. package/src/utils/base-label.ts +6 -1
  96. package/src/utils/config-values.js +1 -0
  97. package/tsconfig.tsbuildinfo +1 -1
  98. package/build-types/font-size-picker/test/font-size-picker-select.d.ts +0 -2
  99. package/build-types/font-size-picker/test/font-size-picker-select.d.ts.map +0 -1
  100. package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts +0 -2
  101. package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts.map +0 -1
  102. package/src/font-size-picker/test/font-size-picker-select.tsx +0 -221
  103. package/src/font-size-picker/test/font-size-picker-toggle-group.tsx +0 -275
@@ -178,7 +178,6 @@
178
178
  min-height: 24px;
179
179
  border-radius: 2px;
180
180
  line-height: 0;
181
- max-width: 100%;
182
181
  display: inline-block;
183
182
  }
184
183
  .components-badge:where(.is-default) {
@@ -258,6 +257,7 @@
258
257
  text-decoration: none;
259
258
  font-family: inherit;
260
259
  font-size: 13px;
260
+ font-weight: 499;
261
261
  margin: 0;
262
262
  border: 0;
263
263
  cursor: pointer;
@@ -437,6 +437,7 @@ p + .components-button.is-tertiary {
437
437
  background: none;
438
438
  outline: none;
439
439
  text-align: left;
440
+ font-weight: 400;
440
441
  color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
441
442
  text-decoration: underline;
442
443
  }
@@ -536,6 +537,7 @@ p + .components-button.is-tertiary {
536
537
  .components-button svg {
537
538
  fill: currentColor;
538
539
  outline: none;
540
+ flex-shrink: 0;
539
541
  }
540
542
  @media (forced-colors: active) {
541
543
  .components-button svg {
@@ -1597,6 +1599,7 @@ body.is-dragging-components-draggable {
1597
1599
  outline: none;
1598
1600
  cursor: pointer;
1599
1601
  white-space: nowrap;
1602
+ font-weight: 400;
1600
1603
  }
1601
1604
  .components-dropdown-menu__menu .components-dropdown-menu__menu-item.has-separator,
1602
1605
  .components-dropdown-menu__menu .components-menu-item.has-separator {
@@ -2143,13 +2146,14 @@ body.is-dragging-components-draggable {
2143
2146
  color: #757575;
2144
2147
  text-transform: uppercase;
2145
2148
  font-size: 11px;
2146
- font-weight: 500;
2149
+ font-weight: 499;
2147
2150
  white-space: nowrap;
2148
2151
  }
2149
2152
 
2150
2153
  .components-menu-item__button,
2151
2154
  .components-menu-item__button.components-button {
2152
2155
  width: 100%;
2156
+ font-weight: 400;
2153
2157
  }
2154
2158
  .components-menu-item__button[role=menuitemradio] .components-menu-item__item:only-child, .components-menu-item__button[role=menuitemcheckbox] .components-menu-item__item:only-child,
2155
2159
  .components-menu-item__button.components-button[role=menuitemradio] .components-menu-item__item:only-child,
@@ -2595,7 +2599,7 @@ body.is-dragging-components-draggable {
2595
2599
  padding: 16px 48px 16px 16px;
2596
2600
  outline: none;
2597
2601
  width: 100%;
2598
- font-weight: 500;
2602
+ font-weight: 499;
2599
2603
  text-align: left;
2600
2604
  color: #1e1e1e;
2601
2605
  border: none;
@@ -3422,7 +3426,7 @@ body.lockscroll {
3422
3426
  cursor: pointer;
3423
3427
  padding: 3px 16px;
3424
3428
  margin-left: 0;
3425
- font-weight: 500;
3429
+ font-weight: 400;
3426
3430
  }
3427
3431
  .components-tab-panel__tabs-item:focus:not(:disabled) {
3428
3432
  position: relative;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/color-palette/styles.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY;;;;;;;;;UAQxB,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/color-palette/styles.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY;;;;;;;;;UAQxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/date-time/date/styles.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,OAAO;;SAO8B,MAC/C,WAAW;yGANb,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;UAMrB,CAAC;AAEF,eAAO,MAAM,uBAAuB;;UAEnC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;UAE/B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;UAQ5B,CAAC;AAEF,eAAO,MAAM,QAAQ;;SAvB6B,MAC/C,WAAW;yGA4Bb,CAAC;AAEF,eAAO,MAAM,SAAS;;SA/B4B,MAC/C,WAAW;yGAkCb,CAAC;AAEF,eAAO,MAAM,SAAS;;;YAIb,MAAM;gBACF,OAAO;aACV,OAAO;eACL,OAAO;UAmElB,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/date-time/date/styles.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,OAAO;;SAO8B,MAC/C,WAAW;yGANb,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;UAMrB,CAAC;AAEF,eAAO,MAAM,uBAAuB;;UAEnC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;UAE/B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;UAQ5B,CAAC;AAEF,eAAO,MAAM,QAAQ;;SAvB6B,MAC/C,WAAW;yGA4Bb,CAAC;AAEF,eAAO,MAAM,SAAS;;SA/B4B,MAC/C,WAAW;yGAkCb,CAAC;AAEF,eAAO,MAAM,SAAS;;;YAIb,MAAM;gBACF,OAAO;aACV,OAAO;eACL,OAAO;UAoElB,CAAC"}
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import type { FontSizePickerSelectProps } from './types';
5
2
  declare const FontSizePickerSelect: (props: FontSizePickerSelectProps) => import("react").JSX.Element;
6
3
  export default FontSizePickerSelect;
@@ -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":"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
+ {"version":3,"file":"font-size-picker-select.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/font-size-picker-select.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACX,yBAAyB,EAEzB,MAAM,SAAS,CAAC;AASjB,QAAA,MAAM,oBAAoB,UAAY,yBAAyB,gCA+C9D,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,gCA+ExE,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
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,gCAyBxE,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;AAiRnD,eAAO,MAAM,cAAc,qGAA0C,CAAC;AAEtE,eAAe,cAAc,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;AAwPnD,eAAO,MAAM,cAAc,qGAA0C,CAAC;AAEtE,eAAe,cAAc,CAAC"}
@@ -18,7 +18,4 @@ 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
- }, {}, {}>;
24
21
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/styles.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,SAAS;;SAeR,MAAO,WAAW;2HAV/B,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;UAElB,CAAC;AAEF,eAAO,MAAM,YAAY;;UAExB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;UAKvB,CAAC"}
@@ -37,14 +37,6 @@ 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';
48
40
  /**
49
41
  * If `true`, a slider will be displayed alongside the input field when a
50
42
  * custom font size is active. Has no effect when `disableCustomFontSizes`
@@ -100,17 +92,11 @@ export type FontSize = {
100
92
  * size. Used for the class generation process.
101
93
  */
102
94
  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;
109
95
  };
110
- export type FontSizePickerSelectProps = Pick<FontSizePickerProps, 'value' | 'size' | 'valueMode'> & {
96
+ export type FontSizePickerSelectProps = Pick<FontSizePickerProps, 'value' | 'size'> & {
111
97
  fontSizes: NonNullable<FontSizePickerProps['fontSizes']>;
112
98
  disableCustomFontSizes: NonNullable<FontSizePickerProps['disableCustomFontSizes']>;
113
- onChange: (value: number | string | undefined, selectedItem?: FontSize) => void;
99
+ onChange: NonNullable<FontSizePickerProps['onChange']>;
114
100
  onSelectCustom: () => void;
115
101
  __next40pxDefaultSize: boolean;
116
102
  };
@@ -120,8 +106,8 @@ export type FontSizePickerSelectOption = {
120
106
  value?: FontSize['size'];
121
107
  hint?: string;
122
108
  };
123
- export type FontSizePickerToggleGroupProps = Pick<FontSizePickerProps, 'value' | 'size' | '__next40pxDefaultSize' | 'valueMode'> & {
109
+ export type FontSizePickerToggleGroupProps = Pick<FontSizePickerProps, 'value' | 'size' | '__next40pxDefaultSize'> & {
124
110
  fontSizes: NonNullable<FontSizePickerProps['fontSizes']>;
125
- onChange: (value: number | string | undefined, selectedItem?: FontSize) => void;
111
+ onChange: NonNullable<FontSizePickerProps['onChange']>;
126
112
  };
127
113
  //# 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,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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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,CAC1C,GAAG;IACH,SAAS,EAAE,WAAW,CAAE,mBAAmB,CAAE,WAAW,CAAE,CAAE,CAAC;IAC7D,QAAQ,EAAE,WAAW,CAAE,mBAAmB,CAAE,UAAU,CAAE,CAAE,CAAC;CAC3D,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import type { FontSizePickerProps, FontSize } from './types';
4
+ import type { FontSizePickerProps } 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,13 +10,4 @@ import type { FontSizePickerProps, FontSize } 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;
22
13
  //# 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,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
+ {"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;AAEnD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,WAAW,CAAE,mBAAmB,CAAE,OAAO,CAAE,CAAE,WAKpD"}
@@ -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;AAuanC,eAAO,MAAM,WAAW,6GAWvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,OAAO;IAGlB;;OAEG;;;;IAIH;;;;OAIG;;;;CAKJ,CAAC;AAEF,eAAe,OAAO,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":"AAOA,eAAO,MAAM,mBAAmB,2CAK/B,CAAC"}
1
+ {"version":3,"file":"base-label.d.ts","sourceRoot":"","sources":["../../src/utils/base-label.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,mBAAmB,2CAK/B,CAAC"}
@@ -37,6 +37,7 @@ declare const _default: {
37
37
  fontSizeXSmall: string;
38
38
  fontLineHeightBase: string;
39
39
  fontWeight: string;
40
+ fontWeightMedium: string;
40
41
  fontWeightHeading: string;
41
42
  gridBase: string;
42
43
  cardPaddingXSmall: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "30.6.1",
3
+ "version": "30.7.1-next.36001005c.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.33.1",
58
- "@wordpress/base-styles": "^6.9.1",
59
- "@wordpress/compose": "^7.33.1",
60
- "@wordpress/date": "^5.33.1",
61
- "@wordpress/deprecated": "^4.33.1",
62
- "@wordpress/dom": "^4.33.1",
63
- "@wordpress/element": "^6.33.1",
64
- "@wordpress/escape-html": "^3.33.1",
65
- "@wordpress/hooks": "^4.33.1",
66
- "@wordpress/html-entities": "^4.33.1",
67
- "@wordpress/i18n": "^6.6.1",
68
- "@wordpress/icons": "^11.0.1",
69
- "@wordpress/is-shallow-equal": "^5.33.1",
70
- "@wordpress/keycodes": "^4.33.1",
71
- "@wordpress/primitives": "^4.33.1",
72
- "@wordpress/private-apis": "^1.33.1",
73
- "@wordpress/rich-text": "^7.33.1",
74
- "@wordpress/warning": "^3.33.1",
57
+ "@wordpress/a11y": "^4.33.1-next.36001005c.0",
58
+ "@wordpress/base-styles": "^6.10.1-next.36001005c.0",
59
+ "@wordpress/compose": "^7.33.1-next.36001005c.0",
60
+ "@wordpress/date": "^5.33.1-next.36001005c.0",
61
+ "@wordpress/deprecated": "^4.33.1-next.36001005c.0",
62
+ "@wordpress/dom": "^4.33.1-next.36001005c.0",
63
+ "@wordpress/element": "^6.33.1-next.36001005c.0",
64
+ "@wordpress/escape-html": "^3.33.1-next.36001005c.0",
65
+ "@wordpress/hooks": "^4.33.1-next.36001005c.0",
66
+ "@wordpress/html-entities": "^4.33.1-next.36001005c.0",
67
+ "@wordpress/i18n": "^6.6.1-next.36001005c.0",
68
+ "@wordpress/icons": "^11.0.1-next.36001005c.0",
69
+ "@wordpress/is-shallow-equal": "^5.33.1-next.36001005c.0",
70
+ "@wordpress/keycodes": "^4.33.1-next.36001005c.0",
71
+ "@wordpress/primitives": "^4.33.1-next.36001005c.0",
72
+ "@wordpress/private-apis": "^1.33.1-next.36001005c.0",
73
+ "@wordpress/rich-text": "^7.33.1-next.36001005c.0",
74
+ "@wordpress/warning": "^3.33.1-next.36001005c.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": "5f84bafdec1bed05247c1080c12f6a237951b862"
100
+ "gitHead": "b73a8a22e779c59efb8f911e32b681652f237d60"
101
101
  }
@@ -18,7 +18,6 @@ $badge-colors: (
18
18
  min-height: $grid-unit-30;
19
19
  border-radius: $radius-small;
20
20
  line-height: 0;
21
- max-width: 100%;
22
21
 
23
22
  // Prevents anchor text-decoration styles from being applied through a parent.
24
23
  display: inline-block;
@@ -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/.
@@ -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: 500;
15
+ font-weight: ${ CONFIG.fontWeightMedium };
15
16
  &&& {
16
17
  font-size: 11px;
17
18
  margin-bottom: 0;
@@ -12,7 +12,7 @@ import { __, _n, sprintf } from '@wordpress/i18n';
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
- import { VisuallyHidden } from '../visually-hidden';
15
+ import { VisuallyHidden } from '..';
16
16
  import * as Styled from './styles';
17
17
  import type {
18
18
  CustomSelectContext as CustomSelectContextType,
@@ -79,6 +79,7 @@ export const DayButton = styled( Button, {
79
79
  border-radius: ${ CONFIG.radiusRound };
80
80
  height: ${ space( 7 ) };
81
81
  width: ${ space( 7 ) };
82
+ font-weight: 400;
82
83
 
83
84
  ${ ( props ) =>
84
85
  props.isSelected &&
@@ -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: 500;
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: 500;
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: 500;
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: 500;
955
+ font-weight: 499;
956
956
  line-height: 1.4;
957
957
  text-transform: uppercase;
958
958
  box-sizing: border-box;
@@ -18,6 +18,7 @@
18
18
  outline: none;
19
19
  cursor: pointer;
20
20
  white-space: nowrap;
21
+ font-weight: $font-weight-regular;
21
22
 
22
23
  &.has-separator {
23
24
  margin-top: 6px;
@@ -103,16 +103,6 @@ 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
-
116
106
  ### `withReset`: `boolean`
117
107
 
118
108
  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`.
@@ -2,17 +2,16 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __, sprintf } from '@wordpress/i18n';
5
- import { useMemo } from '@wordpress/element';
6
5
 
7
6
  /**
8
7
  * Internal dependencies
9
8
  */
9
+ import CustomSelectControl from '../custom-select-control';
10
10
  import type {
11
11
  FontSizePickerSelectProps,
12
12
  FontSizePickerSelectOption,
13
13
  } from './types';
14
- import { generateFontSizeHint } from './utils';
15
- import { StyledCustomSelectControl } from './styles';
14
+ import { isSimpleCssValue } from './utils';
16
15
 
17
16
  const DEFAULT_OPTION: FontSizePickerSelectOption = {
18
17
  key: 'default',
@@ -21,19 +20,15 @@ const DEFAULT_OPTION: FontSizePickerSelectOption = {
21
20
  };
22
21
 
23
22
  const FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {
24
- const {
25
- __next40pxDefaultSize,
26
- fontSizes,
27
- value,
28
- size,
29
- valueMode = 'literal',
30
- onChange,
31
- } = props;
23
+ const { __next40pxDefaultSize, fontSizes, value, size, onChange } = props;
32
24
 
33
25
  const options: FontSizePickerSelectOption[] = [
34
26
  DEFAULT_OPTION,
35
27
  ...fontSizes.map( ( fontSize ) => {
36
- const hint = generateFontSizeHint( fontSize );
28
+ let hint;
29
+ if ( isSimpleCssValue( fontSize.size ) ) {
30
+ hint = String( fontSize.size );
31
+ }
37
32
  return {
38
33
  key: fontSize.slug,
39
34
  name: fontSize.name || fontSize.slug,
@@ -43,30 +38,11 @@ const FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {
43
38
  } ),
44
39
  ];
45
40
 
46
- const selectedOption = useMemo( () => {
47
- if ( value === undefined ) {
48
- return DEFAULT_OPTION;
49
- }
50
-
51
- // If valueMode is 'slug', find by slug
52
- if ( valueMode === 'slug' ) {
53
- const optionBySlug = options.find(
54
- ( option ) => option.key === value
55
- );
56
- if ( optionBySlug ) {
57
- return optionBySlug;
58
- }
59
- }
60
-
61
- // If valueMode is 'literal', find by value (size)
62
- return (
63
- options.find( ( option ) => option.value === value ) ??
64
- DEFAULT_OPTION
65
- );
66
- }, [ value, valueMode, options ] );
41
+ const selectedOption =
42
+ options.find( ( option ) => option.value === value ) ?? DEFAULT_OPTION;
67
43
 
68
44
  return (
69
- <StyledCustomSelectControl
45
+ <CustomSelectControl
70
46
  __next40pxDefaultSize={ __next40pxDefaultSize }
71
47
  __shouldNotWarnDeprecated36pxSize
72
48
  className="components-font-size-picker__select"
@@ -85,16 +61,7 @@ const FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {
85
61
  }: {
86
62
  selectedItem: FontSizePickerSelectOption;
87
63
  } ) => {
88
- // Find the corresponding FontSize object
89
- const matchingFontSize =
90
- selectedItem.key === 'default'
91
- ? undefined
92
- : fontSizes.find(
93
- ( fontSize ) =>
94
- fontSize.slug === selectedItem.key
95
- );
96
-
97
- onChange( selectedItem.value, matchingFontSize );
64
+ onChange( selectedItem.value );
98
65
  } }
99
66
  size={ size }
100
67
  />
@@ -14,46 +14,7 @@ import { T_SHIRT_ABBREVIATIONS, T_SHIRT_NAMES } from './constants';
14
14
  import type { FontSizePickerToggleGroupProps } from './types';
15
15
 
16
16
  const FontSizePickerToggleGroup = ( props: FontSizePickerToggleGroupProps ) => {
17
- const {
18
- fontSizes,
19
- value,
20
- valueMode = 'literal',
21
- __next40pxDefaultSize,
22
- size,
23
- onChange,
24
- } = props;
25
-
26
- // Find the current value based on valueMode
27
- const currentValue = ( () => {
28
- if ( ! value ) {
29
- return undefined;
30
- }
31
-
32
- // If valueMode is 'slug', the value is already the slug
33
- if ( valueMode === 'slug' ) {
34
- return String( value );
35
- }
36
-
37
- // If valueMode is 'literal', find the font size by size value
38
- // If multiple font sizes have the same size value, we can't distinguish them
39
- // without additional information, so we return undefined to avoid incorrect selection
40
- const matchingFontSizes = fontSizes.filter(
41
- ( fontSize ) => fontSize.size === value
42
- );
43
-
44
- // If there are multiple matches, return undefined to avoid selecting the wrong font size
45
- if ( matchingFontSizes.length > 1 ) {
46
- return undefined;
47
- }
48
-
49
- // Find the font size by size value
50
- const fontSizeBySize = fontSizes.find(
51
- ( fontSize ) => fontSize.size === value
52
- );
53
-
54
- return fontSizeBySize?.slug;
55
- } )();
56
-
17
+ const { fontSizes, value, __next40pxDefaultSize, size, onChange } = props;
57
18
  return (
58
19
  <ToggleGroupControl
59
20
  __nextHasNoMarginBottom
@@ -61,30 +22,15 @@ const FontSizePickerToggleGroup = ( props: FontSizePickerToggleGroupProps ) => {
61
22
  __shouldNotWarnDeprecated36pxSize
62
23
  label={ __( 'Font size' ) }
63
24
  hideLabelFromVision
64
- value={ currentValue }
65
- onChange={ ( newSlug: string | number | undefined ) => {
66
- if ( newSlug === undefined ) {
67
- onChange( undefined );
68
- } else {
69
- // Find the font size by slug
70
- const selectedFontSize = fontSizes.find(
71
- ( fontSize ) => fontSize.slug === String( newSlug )
72
- );
73
- if ( selectedFontSize ) {
74
- onChange(
75
- selectedFontSize.size as number | string,
76
- selectedFontSize
77
- );
78
- }
79
- }
80
- } }
25
+ value={ value }
26
+ onChange={ onChange }
81
27
  isBlock
82
28
  size={ size }
83
29
  >
84
30
  { fontSizes.map( ( fontSize, index ) => (
85
31
  <ToggleGroupControlOption
86
32
  key={ fontSize.slug }
87
- value={ fontSize.slug }
33
+ value={ fontSize.size }
88
34
  label={ T_SHIRT_ABBREVIATIONS[ index ] }
89
35
  aria-label={ fontSize.name || T_SHIRT_NAMES[ index ] }
90
36
  showTooltip