@wordpress/components 29.9.0 → 29.10.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 (55) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/build/color-picker/color-copy-button.js +3 -2
  3. package/build/color-picker/color-copy-button.js.map +1 -1
  4. package/build/notice/types.js.map +1 -1
  5. package/build/popover/types.js.map +1 -1
  6. package/build/snackbar/index.js +16 -11
  7. package/build/snackbar/index.js.map +1 -1
  8. package/build/snackbar/types.js.map +1 -1
  9. package/build/spinner/index.js +5 -5
  10. package/build/spinner/index.js.map +1 -1
  11. package/build/textarea-control/styles/textarea-control-styles.js +3 -3
  12. package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
  13. package/build/utils/with-ignore-ime-events.js +5 -5
  14. package/build/utils/with-ignore-ime-events.js.map +1 -1
  15. package/build-module/color-picker/color-copy-button.js +4 -3
  16. package/build-module/color-picker/color-copy-button.js.map +1 -1
  17. package/build-module/notice/types.js.map +1 -1
  18. package/build-module/popover/types.js.map +1 -1
  19. package/build-module/snackbar/index.js +16 -11
  20. package/build-module/snackbar/index.js.map +1 -1
  21. package/build-module/snackbar/types.js.map +1 -1
  22. package/build-module/spinner/index.js +5 -5
  23. package/build-module/spinner/index.js.map +1 -1
  24. package/build-module/textarea-control/styles/textarea-control-styles.js +3 -3
  25. package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
  26. package/build-module/utils/with-ignore-ime-events.js +5 -5
  27. package/build-module/utils/with-ignore-ime-events.js.map +1 -1
  28. package/build-style/style-rtl.css +75 -64
  29. package/build-style/style.css +75 -64
  30. package/build-types/notice/types.d.ts +3 -1
  31. package/build-types/notice/types.d.ts.map +1 -1
  32. package/build-types/popover/types.d.ts +4 -0
  33. package/build-types/popover/types.d.ts.map +1 -1
  34. package/build-types/snackbar/index.d.ts +1 -1
  35. package/build-types/snackbar/index.d.ts.map +1 -1
  36. package/build-types/snackbar/types.d.ts +1 -1
  37. package/build-types/snackbar/types.d.ts.map +1 -1
  38. package/build-types/spinner/index.d.ts +5 -5
  39. package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
  40. package/build-types/utils/with-ignore-ime-events.d.ts +4 -4
  41. package/build-types/utils/with-ignore-ime-events.d.ts.map +1 -1
  42. package/package.json +19 -19
  43. package/src/color-picker/color-copy-button.tsx +4 -4
  44. package/src/notice/README.md +3 -2
  45. package/src/notice/types.ts +3 -1
  46. package/src/popover/README.md +11 -0
  47. package/src/popover/types.ts +4 -0
  48. package/src/snackbar/index.tsx +30 -17
  49. package/src/snackbar/style.scss +2 -1
  50. package/src/snackbar/types.ts +4 -1
  51. package/src/spinner/index.tsx +5 -5
  52. package/src/text-control/style.scss +3 -1
  53. package/src/textarea-control/styles/textarea-control-styles.ts +2 -0
  54. package/src/utils/with-ignore-ime-events.ts +5 -5
  55. package/tsconfig.tsbuildinfo +1 -1
@@ -1,16 +1,13 @@
1
1
  @charset "UTF-8";
2
- /**
3
- * Converts a hex value into the rgb equivalent.
4
- *
5
- * @param {string} hex - the hexadecimal value to convert
6
- * @return {string} comma separated rgb values
7
- */
8
2
  /**
9
3
  * Colors
10
4
  */
11
5
  /**
12
6
  * Breakpoints & Media Queries
13
7
  */
8
+ /**
9
+ * Colors
10
+ */
14
11
  /**
15
12
  * SCSS Variables.
16
13
  *
@@ -19,14 +16,50 @@
19
16
  * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
20
17
  */
21
18
  /**
22
- * Converts a hex value into the rgb equivalent.
23
- *
24
- * @param {string} hex - the hexadecimal value to convert
25
- * @return {string} comma separated rgb values
26
- */
19
+ * Fonts & basic variables.
20
+ */
21
+ /**
22
+ * Typography
23
+ */
24
+ /**
25
+ * Grid System.
26
+ * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
27
+ */
28
+ /**
29
+ * Radius scale.
30
+ */
31
+ /**
32
+ * Elevation scale.
33
+ */
34
+ /**
35
+ * Dimensions.
36
+ */
37
+ /**
38
+ * Mobile specific styles
39
+ */
40
+ /**
41
+ * Editor styles.
42
+ */
43
+ /**
44
+ * Block & Editor UI.
45
+ */
46
+ /**
47
+ * Block paddings.
48
+ */
49
+ /**
50
+ * React Native specific.
51
+ * These variables do not appear to be used anywhere else.
52
+ */
27
53
  /**
28
54
  * Colors
29
55
  */
56
+ /**
57
+ * SCSS Variables.
58
+ *
59
+ * Please use variables from this sheet to ensure consistency across the UI.
60
+ * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
61
+ * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
62
+ */
30
63
  /**
31
64
  * Fonts & basic variables.
32
65
  */
@@ -62,6 +95,9 @@
62
95
  * React Native specific.
63
96
  * These variables do not appear to be used anywhere else.
64
97
  */
98
+ /**
99
+ * Breakpoints & Media Queries
100
+ */
65
101
  /**
66
102
  * Converts a hex value into the rgb equivalent.
67
103
  *
@@ -569,19 +605,19 @@ p + .components-button.is-tertiary {
569
605
  }
570
606
 
571
607
  .components-checkbox-control__input[type=checkbox] {
608
+ border: 1px solid #1e1e1e;
609
+ margin-right: 12px;
610
+ transition: none;
611
+ border-radius: 2px;
572
612
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
573
613
  padding: 6px 8px;
574
- box-shadow: 0 0 0 transparent;
575
- border-radius: 2px;
576
- border: 1px solid #949494;
577
614
  /* Fonts smaller than 16px causes mobile safari to zoom. */
578
615
  font-size: 16px;
579
616
  /* Override core line-height. To be reviewed. */
580
617
  line-height: normal;
581
- border: 1px solid #1e1e1e;
582
- margin-right: 12px;
583
- transition: none;
618
+ box-shadow: 0 0 0 transparent;
584
619
  border-radius: 2px;
620
+ border: 1px solid #949494;
585
621
  background: #fff;
586
622
  color: #1e1e1e;
587
623
  clear: none;
@@ -910,13 +946,13 @@ input.components-combobox-control__input[type=text]:focus {
910
946
  .components-combobox-control__suggestions-container {
911
947
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
912
948
  padding: 6px 8px;
913
- box-shadow: 0 0 0 transparent;
914
- border-radius: 2px;
915
- border: 1px solid #949494;
916
949
  /* Fonts smaller than 16px causes mobile safari to zoom. */
917
950
  font-size: 16px;
918
951
  /* Override core line-height. To be reviewed. */
919
952
  line-height: normal;
953
+ box-shadow: 0 0 0 transparent;
954
+ border-radius: 2px;
955
+ border: 1px solid #949494;
920
956
  display: flex;
921
957
  flex-wrap: wrap;
922
958
  align-items: flex-start;
@@ -1436,13 +1472,13 @@ body.is-dragging-components-draggable {
1436
1472
  .components-form-token-field__input-container {
1437
1473
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
1438
1474
  padding: 6px 8px;
1439
- box-shadow: 0 0 0 transparent;
1440
- border-radius: 2px;
1441
- border: 1px solid #949494;
1442
1475
  /* Fonts smaller than 16px causes mobile safari to zoom. */
1443
1476
  font-size: 16px;
1444
1477
  /* Override core line-height. To be reviewed. */
1445
1478
  line-height: normal;
1479
+ box-shadow: 0 0 0 transparent;
1480
+ border-radius: 2px;
1481
+ border: 1px solid #949494;
1446
1482
  width: 100%;
1447
1483
  padding: 0;
1448
1484
  cursor: text;
@@ -2389,13 +2425,13 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
2389
2425
  .components-placeholder__input[type=url] {
2390
2426
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
2391
2427
  padding: 6px 8px;
2392
- box-shadow: 0 0 0 transparent;
2393
- border-radius: 2px;
2394
- border: 1px solid #949494;
2395
2428
  /* Fonts smaller than 16px causes mobile safari to zoom. */
2396
2429
  font-size: 16px;
2397
2430
  /* Override core line-height. To be reviewed. */
2398
2431
  line-height: normal;
2432
+ box-shadow: 0 0 0 transparent;
2433
+ border-radius: 2px;
2434
+ border: 1px solid #949494;
2399
2435
  flex: 1 1 auto;
2400
2436
  }
2401
2437
  @media not (prefers-reduced-motion) {
@@ -2671,15 +2707,6 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
2671
2707
  .components-radio-control__input[type=radio] {
2672
2708
  grid-column: 1;
2673
2709
  grid-row: 1;
2674
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
2675
- padding: 6px 8px;
2676
- box-shadow: 0 0 0 transparent;
2677
- border-radius: 2px;
2678
- border: 1px solid #949494;
2679
- /* Fonts smaller than 16px causes mobile safari to zoom. */
2680
- font-size: 16px;
2681
- /* Override core line-height. To be reviewed. */
2682
- line-height: normal;
2683
2710
  border: 1px solid #1e1e1e;
2684
2711
  margin-right: 12px;
2685
2712
  transition: none;
@@ -2700,27 +2727,6 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
2700
2727
  transition: box-shadow 0.1s linear;
2701
2728
  }
2702
2729
  }
2703
- @media (min-width: 600px) {
2704
- .components-radio-control__input[type=radio] {
2705
- font-size: 13px;
2706
- /* Override core line-height. To be reviewed. */
2707
- line-height: normal;
2708
- }
2709
- }
2710
- .components-radio-control__input[type=radio]:focus {
2711
- border-color: var(--wp-admin-theme-color);
2712
- box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);
2713
- outline: 2px solid transparent;
2714
- }
2715
- .components-radio-control__input[type=radio]::-webkit-input-placeholder {
2716
- color: rgba(30, 30, 30, 0.62);
2717
- }
2718
- .components-radio-control__input[type=radio]::-moz-placeholder {
2719
- color: rgba(30, 30, 30, 0.62);
2720
- }
2721
- .components-radio-control__input[type=radio]:-ms-input-placeholder {
2722
- color: rgba(30, 30, 30, 0.62);
2723
- }
2724
2730
  @media (min-width: 600px) {
2725
2731
  .components-radio-control__input[type=radio] {
2726
2732
  height: 16px;
@@ -3028,16 +3034,19 @@ body.lockscroll {
3028
3034
  cursor: pointer;
3029
3035
  }
3030
3036
 
3031
- .components-snackbar__action.components-button {
3037
+ .components-snackbar__action.components-button,
3038
+ .components-snackbar__action.components-external-link {
3032
3039
  margin-left: 32px;
3033
3040
  color: #fff;
3034
3041
  flex-shrink: 0;
3035
3042
  }
3036
- .components-snackbar__action.components-button:focus {
3043
+ .components-snackbar__action.components-button:focus,
3044
+ .components-snackbar__action.components-external-link:focus {
3037
3045
  box-shadow: none;
3038
3046
  outline: 1px dotted #fff;
3039
3047
  }
3040
- .components-snackbar__action.components-button:hover {
3048
+ .components-snackbar__action.components-button:hover,
3049
+ .components-snackbar__action.components-external-link:hover {
3041
3050
  text-decoration: none;
3042
3051
  color: currentColor;
3043
3052
  }
@@ -3157,15 +3166,17 @@ body.lockscroll {
3157
3166
  width: 100%;
3158
3167
  height: 32px;
3159
3168
  margin: 0;
3169
+ background: var(--wp-components-color-background, #fff);
3170
+ color: var(--wp-components-color-foreground, #1e1e1e);
3160
3171
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
3161
3172
  padding: 6px 8px;
3162
- box-shadow: 0 0 0 transparent;
3163
- border-radius: 2px;
3164
- border: 1px solid #949494;
3165
3173
  /* Fonts smaller than 16px causes mobile safari to zoom. */
3166
3174
  font-size: 16px;
3167
3175
  /* Override core line-height. To be reviewed. */
3168
3176
  line-height: normal;
3177
+ box-shadow: 0 0 0 transparent;
3178
+ border-radius: 2px;
3179
+ border: 1px solid #949494;
3169
3180
  }
3170
3181
  @media not (prefers-reduced-motion) {
3171
3182
  .components-text-control__input,
@@ -3219,8 +3230,8 @@ body.lockscroll {
3219
3230
  .components-text-control__input[type=email]:focus,
3220
3231
  .components-text-control__input[type=month]:focus,
3221
3232
  .components-text-control__input[type=number]:focus {
3222
- border-color: var(--wp-admin-theme-color);
3223
- box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);
3233
+ border-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
3234
+ box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
3224
3235
  outline: 2px solid transparent;
3225
3236
  }
3226
3237
  .components-text-control__input::-webkit-input-placeholder,
@@ -10,11 +10,13 @@ type CommonNoticeActionProps = {
10
10
  };
11
11
  type NoticeActionWithURL = CommonNoticeActionProps & {
12
12
  url: string;
13
+ openInNewTab?: boolean;
13
14
  onClick?: never;
14
15
  };
15
16
  type NoticeActionWithOnClick = CommonNoticeActionProps & {
16
17
  url?: never;
17
- onClick: MouseEventHandler<HTMLButtonElement>;
18
+ openInNewTab?: never;
19
+ onClick: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
18
20
  };
19
21
  export type NoticeAction = NoticeActionWithURL | NoticeActionWithOnClick;
20
22
  export type NoticeChildren = string | JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/notice/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,KAAK,uBAAuB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;CAC3C,CAAC;AAIF,KAAK,mBAAmB,GAAG,uBAAuB,GAAG;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,KAAK,CAAC;CAChB,CAAC;AACF,KAAK,uBAAuB,GAAG,uBAAuB,GAAG;IACxD,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,iBAAiB,CAAE,iBAAiB,CAAE,CAAC;CAChD,CAAC;AAEF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;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,EAAE,KAAK,CAAE,YAAY,CAAE,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B;;OAEG;IACH,OAAO,EAAE,KAAK,CACb,IAAI,CAAE,WAAW,EAAE,UAAU,CAAE,GAAG;QACjC,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;KAChB,CACD,CAAC;IACF;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAE,EAAE,EAAE,MAAM,KAAM,IAAI,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC"}
@@ -121,6 +121,8 @@ export type PopoverProps = {
121
121
  /**
122
122
  * Adjusts the size of the popover to prevent its contents from going out of
123
123
  * view when meeting the viewport edges.
124
+ * _Note: The `resize` and `shift` props are not intended to be used together.
125
+ * Enabling both can cause unexpected behavior._
124
126
  *
125
127
  * @default true
126
128
  */
@@ -128,6 +130,8 @@ export type PopoverProps = {
128
130
  /**
129
131
  * Enables the `Popover` to shift in order to stay in view when meeting the
130
132
  * viewport edges.
133
+ * _Note: The `resize` and `shift` props are not intended to be used together.
134
+ * Enabling both can cause unexpected behavior._
131
135
  *
132
136
  * @default false
133
137
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/popover/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,KAAK,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACjD,KAAK,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AACjD,KAAK,cAAc,GAAG,KAA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EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EACN,GAAI,aAAc,EAAE,GACpB,GAAI,aAAc,IAAK,aAAc,EAAE,GACvC,GAAI,aAAc,IAAK,aAAc,IAAK,cAAe,EAAE,CAAC;IAC/D;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC;;;;;;OAMG;IACH,SAAS,CAAC,EACP,OAAO,GACP,yBAAyB,GACzB,yBAAyB,GACzB,KAAK,CAAC;IACT;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CACf,wBAAwB,EAAE,OAAO,GAAG,IAAI,KACpC,wBAAwB,CAAC;IAC9B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -16,7 +16,7 @@ export declare const Snackbar: import("react").ForwardRefExoticComponent<Pick<im
16
16
  explicitDismiss?: boolean;
17
17
  listRef?: import("react").MutableRefObject<HTMLDivElement | null>;
18
18
  } & {
19
- actions?: Pick<NoticeAction, "label" | "url" | "onClick">[];
19
+ actions?: Pick<NoticeAction, "label" | "url" | "onClick" | "openInNewTab">[];
20
20
  } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className" | "children" | "as" | "actions" | "onRemove" | "spokenMessage" | "politeness" | "onDismiss" | keyof {
21
21
  icon?: import("react").ReactNode;
22
22
  explicitDismiss?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snackbar/index.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA6JpD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;uCAAoC,CAAC;AAE1D,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snackbar/index.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAyKpD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;uCAAoC,CAAC;AAE1D,eAAe,QAAQ,CAAC"}
@@ -40,7 +40,7 @@ export type SnackbarProps = Pick<NoticeProps, 'className' | 'children' | 'spoken
40
40
  *
41
41
  * @default []
42
42
  */
43
- actions?: Pick<NoticeAction, 'label' | 'url' | 'onClick'>[];
43
+ actions?: Pick<NoticeAction, 'label' | 'url' | 'onClick' | 'openInNewTab'>[];
44
44
  };
45
45
  export type SnackbarListProps = {
46
46
  notices: Array<Omit<SnackbarProps, 'children'> & {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/snackbar/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD;;GAEG;AACH,OAAO,KAAK,EACX,WAAW,EACX,cAAc,EACd,YAAY,EACZ,MAAM,iBAAiB,CAAC;AAEzB,KAAK,iBAA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,GAAG,IAAI,CAAE,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,CAC/B,WAAW,EACT,WAAW,GACX,UAAU,GACV,eAAe,GACf,UAAU,GACV,YAAY,GACZ,WAAW,CACb,GACA,iBAAiB,GAAG;IACnB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,IAAI,CACb,YAAY,EACZ,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,cAAc,CAC5C,EAAE,CAAC;CACJ,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,KAAK,CACb,IAAI,CAAE,aAAa,EAAE,UAAU,CAAE,GAAG;QACnC,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;KAChB,CACD,CAAC;IACF,QAAQ,EAAE,CAAE,EAAE,EAAE,MAAM,KAAM,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,cAAc,GAAG,KAAK,CAAE,cAAc,CAAE,CAAC;CACpD,CAAC"}
@@ -4,12 +4,12 @@ export declare function UnforwardedSpinner({ className, ...props }: WordPressCom
4
4
  /**
5
5
  * `Spinner` is a component used to notify users that their action is being processed.
6
6
  *
7
- * ```js
8
- * import { Spinner } from '@wordpress/components';
7
+ * ```jsx
8
+ * import { Spinner } from '@wordpress/components';
9
9
  *
10
- * function Example() {
11
- * return <Spinner />;
12
- * }
10
+ * function Example() {
11
+ * return <Spinner />;
12
+ * }
13
13
  * ```
14
14
  */
15
15
  export declare const Spinner: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref">, "children" | "as"> & import("react").RefAttributes<any>>;
@@ -1 +1 @@
1
- {"version":3,"file":"textarea-control-styles.d.ts","sourceRoot":"","sources":["../../../src/textarea-control/styles/textarea-control-styles.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,cAAc;;SAfI,MAAQ,WAC/B;2HAgEP,CAAC"}
1
+ {"version":3,"file":"textarea-control-styles.d.ts","sourceRoot":"","sources":["../../../src/textarea-control/styles/textarea-control-styles.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,cAAc;;SAfI,MAAQ,WAC/B;2HAkEP,CAAC"}
@@ -1,14 +1,14 @@
1
1
  /**
2
- * A higher-order function that wraps a keydown event handler to ensure it is not an IME event.
2
+ * A higher-order function that wraps a keyboard event handler to ensure it is not an IME event.
3
3
  *
4
4
  * In CJK languages, an IME (Input Method Editor) is used to input complex characters.
5
- * During an IME composition, keydown events (e.g. Enter or Escape) can be fired
5
+ * During an IME composition, keyboard events (e.g. Enter or Escape) can be fired
6
6
  * which are intended to control the IME and not the application.
7
7
  * These events should be ignored by any application logic.
8
8
  *
9
- * @param keydownHandler The keydown event handler to execute after ensuring it was not an IME event.
9
+ * @param handler The keyboard event handler to execute after ensuring it was not an IME event.
10
10
  *
11
11
  * @return A wrapped version of the given event handler that ignores IME events.
12
12
  */
13
- export declare function withIgnoreIMEEvents<E extends React.KeyboardEvent | KeyboardEvent>(keydownHandler: (event: E) => void): (event: E) => void;
13
+ export declare function withIgnoreIMEEvents<E extends React.KeyboardEvent | KeyboardEvent>(handler: (event: E) => void): (event: E) => void;
14
14
  //# sourceMappingURL=with-ignore-ime-events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"with-ignore-ime-events.d.ts","sourceRoot":"","sources":["../../src/utils/with-ignore-ime-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAClC,CAAC,SAAS,KAAK,CAAC,aAAa,GAAG,aAAa,EAC3C,cAAc,EAAE,CAAE,KAAK,EAAE,CAAC,KAAM,IAAI,WACtB,CAAC,UAgBjB"}
1
+ {"version":3,"file":"with-ignore-ime-events.d.ts","sourceRoot":"","sources":["../../src/utils/with-ignore-ime-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAClC,CAAC,SAAS,KAAK,CAAC,aAAa,GAAG,aAAa,EAC3C,OAAO,EAAE,CAAE,KAAK,EAAE,CAAC,KAAM,IAAI,WACf,CAAC,UAgBjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "29.9.0",
3
+ "version": "29.10.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -44,23 +44,23 @@
44
44
  "@types/gradient-parser": "0.1.3",
45
45
  "@types/highlight-words-core": "1.2.1",
46
46
  "@use-gesture/react": "^10.3.1",
47
- "@wordpress/a11y": "^4.23.0",
48
- "@wordpress/compose": "^7.23.0",
49
- "@wordpress/date": "^5.23.0",
50
- "@wordpress/deprecated": "^4.23.0",
51
- "@wordpress/dom": "^4.23.0",
52
- "@wordpress/element": "^6.23.0",
53
- "@wordpress/escape-html": "^3.23.0",
54
- "@wordpress/hooks": "^4.23.0",
55
- "@wordpress/html-entities": "^4.23.0",
56
- "@wordpress/i18n": "^5.23.0",
57
- "@wordpress/icons": "^10.23.0",
58
- "@wordpress/is-shallow-equal": "^5.23.0",
59
- "@wordpress/keycodes": "^4.23.0",
60
- "@wordpress/primitives": "^4.23.0",
61
- "@wordpress/private-apis": "^1.23.0",
62
- "@wordpress/rich-text": "^7.23.0",
63
- "@wordpress/warning": "^3.23.0",
47
+ "@wordpress/a11y": "^4.24.0",
48
+ "@wordpress/compose": "^7.24.0",
49
+ "@wordpress/date": "^5.24.0",
50
+ "@wordpress/deprecated": "^4.24.0",
51
+ "@wordpress/dom": "^4.24.0",
52
+ "@wordpress/element": "^6.24.0",
53
+ "@wordpress/escape-html": "^3.24.0",
54
+ "@wordpress/hooks": "^4.24.0",
55
+ "@wordpress/html-entities": "^4.24.0",
56
+ "@wordpress/i18n": "^5.24.0",
57
+ "@wordpress/icons": "^10.24.0",
58
+ "@wordpress/is-shallow-equal": "^5.24.0",
59
+ "@wordpress/keycodes": "^4.24.0",
60
+ "@wordpress/primitives": "^4.24.0",
61
+ "@wordpress/private-apis": "^1.24.0",
62
+ "@wordpress/rich-text": "^7.24.0",
63
+ "@wordpress/warning": "^3.24.0",
64
64
  "change-case": "^4.1.2",
65
65
  "clsx": "^2.1.1",
66
66
  "colord": "^2.7.0",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "ab5c79cd40adbb68898536c50e035b0a734338ea"
88
+ "gitHead": "9c03d1458cae76792ae15e67b421205836bf4393"
89
89
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { useCopyToClipboard } from '@wordpress/compose';
5
5
  import { useState, useEffect, useRef } from '@wordpress/element';
6
- import { copy } from '@wordpress/icons';
6
+ import { copy, check } from '@wordpress/icons';
7
7
  import { __ } from '@wordpress/i18n';
8
8
 
9
9
  /**
@@ -55,8 +55,8 @@ export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
55
55
  };
56
56
  }, [] );
57
57
 
58
- const label =
59
- copiedColor === color.toHex() ? __( 'Copied!' ) : __( 'Copy' );
58
+ const isCopied = copiedColor === color.toHex();
59
+ const label = isCopied ? __( 'Copied!' ) : __( 'Copy' );
60
60
 
61
61
  return (
62
62
  <Tooltip delay={ 0 } hideOnClick={ false } text={ label }>
@@ -64,7 +64,7 @@ export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
64
64
  size="compact"
65
65
  aria-label={ label }
66
66
  ref={ copyRef }
67
- icon={ copy }
67
+ icon={ isCopied ? check : copy }
68
68
  showTooltip={ false }
69
69
  />
70
70
  </Tooltip>
@@ -61,7 +61,7 @@ If an icon is included in the Notice, it should be color-coded to match the Noti
61
61
  To display a plain notice, pass `Notice` a string:
62
62
 
63
63
  ```jsx
64
- import { Notice } from `@wordpress/components`;
64
+ import { Notice } from '@wordpress/components';
65
65
 
66
66
  const MyNotice = () => (
67
67
  <Notice status="error">An unknown error occurred.</Notice>
@@ -71,7 +71,7 @@ const MyNotice = () => (
71
71
  For more complex markup, you can pass any JSX element:
72
72
 
73
73
  ```jsx
74
- import { Notice } from `@wordpress/components`;
74
+ import { Notice } from '@wordpress/components';
75
75
 
76
76
  const MyNotice = () => (
77
77
  <Notice status="error">
@@ -145,6 +145,7 @@ An array of notice actions. Each member object should contain:
145
145
 
146
146
  - `label`: `string` containing the text of the button/link
147
147
  - `url`: `string` OR `onClick`: `( event: SyntheticEvent ) => void` to specify what the action does.
148
+ - `openInNewTab`: `boolean` (optional) When set to `true`, opens the URL in a new browser tab.
148
149
  - `className`: `string` (optional) to add custom classes to the button styles.
149
150
  - `noDefaultClasses`: `boolean` (optional) A value of `true` will remove all default styling.
150
151
  - `variant`: `'primary' | 'secondary' | 'link'` (optional) You can denote a primary button action for a notice by passing a value of `primary`.
@@ -14,11 +14,13 @@ type CommonNoticeActionProps = {
14
14
  // `onClick` will be ignored.
15
15
  type NoticeActionWithURL = CommonNoticeActionProps & {
16
16
  url: string;
17
+ openInNewTab?: boolean;
17
18
  onClick?: never;
18
19
  };
19
20
  type NoticeActionWithOnClick = CommonNoticeActionProps & {
20
21
  url?: never;
21
- onClick: MouseEventHandler< HTMLButtonElement >;
22
+ openInNewTab?: never;
23
+ onClick: MouseEventHandler< HTMLButtonElement | HTMLAnchorElement >;
22
24
  };
23
25
 
24
26
  export type NoticeAction = NoticeActionWithURL | NoticeActionWithOnClick;
@@ -223,9 +223,20 @@ Possible values:
223
223
 
224
224
  Adjusts the size of the popover to prevent its contents from going out of view when meeting the viewport edges.
225
225
 
226
+ **Note:** The `resize` and `shift` props are not intended to be used together. Enabling both can cause unexpected behavior.
227
+
226
228
  - Required: No
227
229
  - Default: `true`
228
230
 
231
+ ### `shift`: `boolean`
232
+
233
+ Enables the `Popover` to shift in order to stay in view when meeting the viewport edges.
234
+
235
+ **Note:** The `shift` and `resize` props are not intended to be used together. If you enable `shift`, set `resize` to `false`.
236
+
237
+ - Required: No
238
+ - Default: `false`
239
+
229
240
  ### `variant`: `'toolbar' | 'unstyled'`
230
241
 
231
242
  Specifies the popover's style.
@@ -129,6 +129,8 @@ export type PopoverProps = {
129
129
  /**
130
130
  * Adjusts the size of the popover to prevent its contents from going out of
131
131
  * view when meeting the viewport edges.
132
+ * _Note: The `resize` and `shift` props are not intended to be used together.
133
+ * Enabling both can cause unexpected behavior._
132
134
  *
133
135
  * @default true
134
136
  */
@@ -136,6 +138,8 @@ export type PopoverProps = {
136
138
  /**
137
139
  * Enables the `Popover` to shift in order to stay in view when meeting the
138
140
  * viewport edges.
141
+ * _Note: The `resize` and `shift` props are not intended to be used together.
142
+ * Enabling both can cause unexpected behavior._
139
143
  *
140
144
  * @default false
141
145
  */
@@ -22,6 +22,7 @@ import warning from '@wordpress/warning';
22
22
  * Internal dependencies
23
23
  */
24
24
  import Button from '../button';
25
+ import ExternalLink from '../external-link';
25
26
  import type { SnackbarProps } from './types';
26
27
  import type { NoticeAction } from '../notice/types';
27
28
  import type { WordPressComponentProps } from '../context';
@@ -80,7 +81,7 @@ function UnforwardedSnackbar(
80
81
  }
81
82
 
82
83
  function onActionClick(
83
- event: MouseEvent< HTMLButtonElement >,
84
+ event: MouseEvent< HTMLButtonElement | HTMLAnchorElement >,
84
85
  onClick: NoticeAction[ 'onClick' ]
85
86
  ) {
86
87
  event.stopPropagation();
@@ -147,22 +148,34 @@ function UnforwardedSnackbar(
147
148
  <div className="components-snackbar__icon">{ icon }</div>
148
149
  ) }
149
150
  { children }
150
- { actions.map( ( { label, onClick, url }, index ) => {
151
- return (
152
- <Button
153
- __next40pxDefaultSize
154
- key={ index }
155
- href={ url }
156
- variant="link"
157
- onClick={ (
158
- event: MouseEvent< HTMLButtonElement >
159
- ) => onActionClick( event, onClick ) }
160
- className="components-snackbar__action"
161
- >
162
- { label }
163
- </Button>
164
- );
165
- } ) }
151
+ { actions.map(
152
+ ( { label, onClick, url, openInNewTab = false }, index ) =>
153
+ url !== undefined && openInNewTab ? (
154
+ <ExternalLink
155
+ key={ index }
156
+ href={ url }
157
+ onClick={ ( event ) =>
158
+ onActionClick( event, onClick )
159
+ }
160
+ className="components-snackbar__action"
161
+ >
162
+ { label }
163
+ </ExternalLink>
164
+ ) : (
165
+ <Button
166
+ __next40pxDefaultSize
167
+ key={ index }
168
+ href={ url }
169
+ variant="link"
170
+ onClick={ (
171
+ event: MouseEvent< HTMLButtonElement >
172
+ ) => onActionClick( event, onClick ) }
173
+ className="components-snackbar__action"
174
+ >
175
+ { label }
176
+ </Button>
177
+ )
178
+ ) }
166
179
  { explicitDismiss && (
167
180
  <span
168
181
  role="button"
@@ -45,7 +45,8 @@
45
45
  }
46
46
  }
47
47
 
48
- .components-snackbar__action.components-button {
48
+ .components-snackbar__action.components-button,
49
+ .components-snackbar__action.components-external-link {
49
50
  margin-left: $grid-unit-40;
50
51
  color: $white;
51
52
  flex-shrink: 0;
@@ -56,7 +56,10 @@ export type SnackbarProps = Pick<
56
56
  *
57
57
  * @default []
58
58
  */
59
- actions?: Pick< NoticeAction, 'label' | 'url' | 'onClick' >[];
59
+ actions?: Pick<
60
+ NoticeAction,
61
+ 'label' | 'url' | 'onClick' | 'openInNewTab'
62
+ >[];
60
63
  };
61
64
 
62
65
  export type SnackbarListProps = {