@wordpress/components 28.0.3 → 28.2.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 (50) hide show
  1. package/CHANGELOG.md +133 -120
  2. package/build/custom-select-control-v2/custom-select.js +1 -3
  3. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  4. package/build/custom-select-control-v2/legacy-component/index.js +16 -10
  5. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  6. package/build/custom-select-control-v2/styles.js +34 -19
  7. package/build/custom-select-control-v2/styles.js.map +1 -1
  8. package/build/custom-select-control-v2/types.js.map +1 -1
  9. package/build/drop-zone/index.js +16 -79
  10. package/build/drop-zone/index.js.map +1 -1
  11. package/build/radio-control/index.js +1 -1
  12. package/build/radio-control/index.js.map +1 -1
  13. package/build-module/custom-select-control-v2/custom-select.js +1 -3
  14. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  15. package/build-module/custom-select-control-v2/legacy-component/index.js +16 -11
  16. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  17. package/build-module/custom-select-control-v2/styles.js +33 -18
  18. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  19. package/build-module/custom-select-control-v2/types.js.map +1 -1
  20. package/build-module/drop-zone/index.js +17 -80
  21. package/build-module/drop-zone/index.js.map +1 -1
  22. package/build-module/radio-control/index.js +1 -1
  23. package/build-module/radio-control/index.js.map +1 -1
  24. package/build-style/style-rtl.css +30 -5
  25. package/build-style/style.css +30 -5
  26. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  27. package/build-types/custom-select-control/stories/index.story.d.ts +15 -0
  28. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  29. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  30. package/build-types/custom-select-control-v2/styles.d.ts +4 -0
  31. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  32. package/build-types/custom-select-control-v2/types.d.ts +1 -0
  33. package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
  34. package/build-types/drop-zone/index.d.ts +3 -0
  35. package/build-types/drop-zone/index.d.ts.map +1 -1
  36. package/package.json +19 -19
  37. package/src/checkbox-control/stories/index.story.tsx +3 -0
  38. package/src/checkbox-control/style.scss +4 -2
  39. package/src/custom-select-control/stories/index.story.tsx +32 -3
  40. package/src/custom-select-control/test/index.js +205 -22
  41. package/src/custom-select-control-v2/custom-select.tsx +1 -1
  42. package/src/custom-select-control-v2/legacy-component/index.tsx +18 -10
  43. package/src/custom-select-control-v2/legacy-component/test/index.tsx +220 -38
  44. package/src/custom-select-control-v2/styles.ts +22 -10
  45. package/src/custom-select-control-v2/types.ts +1 -0
  46. package/src/drop-zone/index.tsx +17 -76
  47. package/src/drop-zone/style.scss +51 -16
  48. package/src/radio-control/index.tsx +1 -1
  49. package/src/radio-control/style.scss +1 -1
  50. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useInstanceId","BaseControl","VStack","jsx","_jsx","jsxs","_jsxs","RadioControl","props","label","className","selected","help","onChange","hideLabelFromVision","options","additionalProps","instanceId","id","onChangeValue","event","target","value","length","__nextHasNoMarginBottom","children","spacing","map","option","index","type","name","checked","undefined","htmlFor"],"sources":["@wordpress/components/src/radio-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../context';\nimport type { RadioControlProps } from './types';\nimport { VStack } from '../v-stack';\n\n/**\n * Render a user interface to select the user type using radio inputs.\n *\n * ```jsx\n * import { RadioControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRadioControl = () => {\n * const [ option, setOption ] = useState( 'a' );\n *\n * return (\n * <RadioControl\n * label=\"User type\"\n * help=\"The type of the current user\"\n * selected={ option }\n * options={ [\n * { label: 'Author', value: 'a' },\n * { label: 'Editor', value: 'e' },\n * ] }\n * onChange={ ( value ) => setOption( value ) }\n * />\n * );\n * };\n * ```\n */\nexport function RadioControl(\n\tprops: WordPressComponentProps< RadioControlProps, 'input', false >\n) {\n\tconst {\n\t\tlabel,\n\t\tclassName,\n\t\tselected,\n\t\thelp,\n\t\tonChange,\n\t\thideLabelFromVision,\n\t\toptions = [],\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( RadioControl );\n\tconst id = `inspector-radio-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.value );\n\n\tif ( ! options?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ label }\n\t\t\tid={ id }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\thelp={ help }\n\t\t\tclassName={ clsx( className, 'components-radio-control' ) }\n\t\t>\n\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t{ options.map( ( option, index ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={ `${ id }-${ index }` }\n\t\t\t\t\t\tclassName=\"components-radio-control__option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={ `${ id }-${ index }` }\n\t\t\t\t\t\t\tclassName=\"components-radio-control__input\"\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\tname={ id }\n\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\t\t\tchecked={ option.value === selected }\n\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t!! help ? `${ id }__help` : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\tclassName=\"components-radio-control__label\"\n\t\t\t\t\t\t\thtmlFor={ `${ id }-${ index }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t) ) }\n\t\t\t</VStack>\n\t\t</BaseControl>\n\t);\n}\n\nexport default RadioControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AAGzC,SAASC,MAAM,QAAQ,YAAY;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxBA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAyBA,OAAO,SAASC,YAAYA,CAC3BC,KAAmE,EAClE;EACD,MAAM;IACLC,KAAK;IACLC,SAAS;IACTC,QAAQ;IACRC,IAAI;IACJC,QAAQ;IACRC,mBAAmB;IACnBC,OAAO,GAAG,EAAE;IACZ,GAAGC;EACJ,CAAC,GAAGR,KAAK;EACT,MAAMS,UAAU,GAAGjB,aAAa,CAAEO,YAAa,CAAC;EAChD,MAAMW,EAAE,GAAI,2BAA2BD,UAAY,EAAC;EACpD,MAAME,aAAa,GAAKC,KAAsC,IAC7DP,QAAQ,CAAEO,KAAK,CAACC,MAAM,CAACC,KAAM,CAAC;EAE/B,IAAK,CAAEP,OAAO,EAAEQ,MAAM,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACCnB,IAAA,CAACH,WAAW;IACXuB,uBAAuB;IACvBf,KAAK,EAAGA,KAAO;IACfS,EAAE,EAAGA,EAAI;IACTJ,mBAAmB,EAAGA,mBAAqB;IAC3CF,IAAI,EAAGA,IAAM;IACbF,SAAS,EAAGX,IAAI,CAAEW,SAAS,EAAE,0BAA2B,CAAG;IAAAe,QAAA,eAE3DrB,IAAA,CAACF,MAAM;MAACwB,OAAO,EAAG,CAAG;MAAAD,QAAA,EAClBV,OAAO,CAACY,GAAG,CAAE,CAAEC,MAAM,EAAEC,KAAK,kBAC7BvB,KAAA;QAECI,SAAS,EAAC,kCAAkC;QAAAe,QAAA,gBAE5CrB,IAAA;UACCc,EAAE,EAAI,GAAGA,EAAI,IAAIW,KAAO,EAAG;UAC3BnB,SAAS,EAAC,iCAAiC;UAC3CoB,IAAI,EAAC,OAAO;UACZC,IAAI,EAAGb,EAAI;UACXI,KAAK,EAAGM,MAAM,CAACN,KAAO;UACtBT,QAAQ,EAAGM,aAAe;UAC1Ba,OAAO,EAAGJ,MAAM,CAACN,KAAK,KAAKX,QAAU;UACrC,oBACC,CAAC,CAAEC,IAAI,GAAI,GAAGM,EAAI,QAAO,GAAGe,SAC5B;UAAA,GACIjB;QAAe,CACpB,CAAC,eACFZ,IAAA;UACCM,SAAS,EAAC,iCAAiC;UAC3CwB,OAAO,EAAI,GAAGhB,EAAI,IAAIW,KAAO,EAAG;UAAAJ,QAAA,EAE9BG,MAAM,CAACnB;QAAK,CACR,CAAC;MAAA,GArBD,GAAGS,EAAI,IAAIW,KAAO,EAsBrB,CACJ;IAAC,CACI;EAAC,CACG,CAAC;AAEhB;AAEA,eAAetB,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useInstanceId","BaseControl","VStack","jsx","_jsx","jsxs","_jsxs","RadioControl","props","label","className","selected","help","onChange","hideLabelFromVision","options","additionalProps","instanceId","id","onChangeValue","event","target","value","length","__nextHasNoMarginBottom","children","spacing","map","option","index","type","name","checked","undefined","htmlFor"],"sources":["@wordpress/components/src/radio-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../context';\nimport type { RadioControlProps } from './types';\nimport { VStack } from '../v-stack';\n\n/**\n * Render a user interface to select the user type using radio inputs.\n *\n * ```jsx\n * import { RadioControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRadioControl = () => {\n * const [ option, setOption ] = useState( 'a' );\n *\n * return (\n * <RadioControl\n * label=\"User type\"\n * help=\"The type of the current user\"\n * selected={ option }\n * options={ [\n * { label: 'Author', value: 'a' },\n * { label: 'Editor', value: 'e' },\n * ] }\n * onChange={ ( value ) => setOption( value ) }\n * />\n * );\n * };\n * ```\n */\nexport function RadioControl(\n\tprops: WordPressComponentProps< RadioControlProps, 'input', false >\n) {\n\tconst {\n\t\tlabel,\n\t\tclassName,\n\t\tselected,\n\t\thelp,\n\t\tonChange,\n\t\thideLabelFromVision,\n\t\toptions = [],\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( RadioControl );\n\tconst id = `inspector-radio-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.value );\n\n\tif ( ! options?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ label }\n\t\t\tid={ id }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\thelp={ help }\n\t\t\tclassName={ clsx( className, 'components-radio-control' ) }\n\t\t>\n\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t{ options.map( ( option, index ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={ `${ id }-${ index }` }\n\t\t\t\t\t\tclassName=\"components-radio-control__option\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={ `${ id }-${ index }` }\n\t\t\t\t\t\t\tclassName=\"components-radio-control__input\"\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\tname={ id }\n\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\t\t\tchecked={ option.value === selected }\n\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t!! help ? `${ id }__help` : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\tclassName=\"components-radio-control__label\"\n\t\t\t\t\t\t\thtmlFor={ `${ id }-${ index }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t) ) }\n\t\t\t</VStack>\n\t\t</BaseControl>\n\t);\n}\n\nexport default RadioControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AAGzC,SAASC,MAAM,QAAQ,YAAY;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxBA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAyBA,OAAO,SAASC,YAAYA,CAC3BC,KAAmE,EAClE;EACD,MAAM;IACLC,KAAK;IACLC,SAAS;IACTC,QAAQ;IACRC,IAAI;IACJC,QAAQ;IACRC,mBAAmB;IACnBC,OAAO,GAAG,EAAE;IACZ,GAAGC;EACJ,CAAC,GAAGR,KAAK;EACT,MAAMS,UAAU,GAAGjB,aAAa,CAAEO,YAAa,CAAC;EAChD,MAAMW,EAAE,GAAI,2BAA2BD,UAAY,EAAC;EACpD,MAAME,aAAa,GAAKC,KAAsC,IAC7D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kbox-control {
492
492
  --checkbox-input-size: 24px;
493
+ --checkbox-input-margin: 8px;
493
494
  }
494
495
  @media (min-width: 600px) {
495
496
  .components-checkbox-control {
@@ -633,7 +634,7 @@ p + .components-button.is-tertiary {
633
634
  .components-checkbox-control__input-container {
634
635
  position: relative;
635
636
  display: inline-block;
636
- margin-left: 12px;
637
+ margin-left: var(--checkbox-input-margin);
637
638
  vertical-align: middle;
638
639
  width: var(--checkbox-input-size);
639
640
  aspect-ratio: 1;
@@ -664,7 +665,7 @@ svg.components-checkbox-control__indeterminate {
664
665
 
665
666
  .components-checkbox-control__help {
666
667
  display: inline-block;
667
- margin-inline-start: calc(var(--checkbox-input-size) + 12px);
668
+ margin-inline-start: calc(var(--checkbox-input-size) + var(--checkbox-input-margin));
668
669
  }
669
670
 
670
671
  .components-circular-option-picker {
@@ -1172,8 +1173,7 @@ body.is-dragging-components-draggable {
1172
1173
  opacity: 1;
1173
1174
  visibility: visible;
1174
1175
  }
1175
-
1176
- .components-drop-zone__content {
1176
+ .components-drop-zone .components-drop-zone__content {
1177
1177
  position: absolute;
1178
1178
  top: 0;
1179
1179
  bottom: 0;
@@ -1188,6 +1188,31 @@ body.is-dragging-components-draggable {
1188
1188
  z-index: 50;
1189
1189
  text-align: center;
1190
1190
  color: #fff;
1191
+ opacity: 0;
1192
+ pointer-events: none;
1193
+ }
1194
+ .components-drop-zone .components-drop-zone__content-inner {
1195
+ opacity: 0;
1196
+ transform: scale(0.9);
1197
+ }
1198
+ .components-drop-zone.is-active:not(.has-dragged-out) .components-drop-zone__content {
1199
+ opacity: 1;
1200
+ transition: opacity 0.2s ease-in-out;
1201
+ }
1202
+ @media (prefers-reduced-motion) {
1203
+ .components-drop-zone.is-active:not(.has-dragged-out) .components-drop-zone__content {
1204
+ transition: none;
1205
+ }
1206
+ }
1207
+ .components-drop-zone.is-active:not(.has-dragged-out) .components-drop-zone__content-inner {
1208
+ opacity: 1;
1209
+ transform: scale(1);
1210
+ transition: opacity 0.1s ease-in-out 0.1s, transform 0.1s ease-in-out 0.1s;
1211
+ }
1212
+ @media (prefers-reduced-motion) {
1213
+ .components-drop-zone.is-active:not(.has-dragged-out) .components-drop-zone__content-inner {
1214
+ transition: none;
1215
+ }
1191
1216
  }
1192
1217
 
1193
1218
  .components-drop-zone__content-icon,
@@ -2643,7 +2668,7 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
2643
2668
  min-width: 24px;
2644
2669
  max-width: 24px;
2645
2670
  display: inline-flex;
2646
- margin: 0 0 0 6px;
2671
+ margin: 0 0 0 8px;
2647
2672
  padding: 0;
2648
2673
  appearance: none;
2649
2674
  cursor: pointer;
@@ -490,6 +490,7 @@ p + .components-button.is-tertiary {
490
490
  }
491
491
  .components-checkbox-control {
492
492
  --checkbox-input-size: 24px;
493
+ --checkbox-input-margin: 8px;
493
494
  }
494
495
  @media (min-width: 600px) {
495
496
  .components-checkbox-control {
@@ -633,7 +634,7 @@ p + .components-button.is-tertiary {
633
634
  .components-checkbox-control__input-container {
634
635
  position: relative;
635
636
  display: inline-block;
636
- margin-right: 12px;
637
+ margin-right: var(--checkbox-input-margin);
637
638
  vertical-align: middle;
638
639
  width: var(--checkbox-input-size);
639
640
  aspect-ratio: 1;
@@ -664,7 +665,7 @@ svg.components-checkbox-control__indeterminate {
664
665
 
665
666
  .components-checkbox-control__help {
666
667
  display: inline-block;
667
- margin-inline-start: calc(var(--checkbox-input-size) + 12px);
668
+ margin-inline-start: calc(var(--checkbox-input-size) + var(--checkbox-input-margin));
668
669
  }
669
670
 
670
671
  .components-circular-option-picker {
@@ -1177,8 +1178,7 @@ body.is-dragging-components-draggable {
1177
1178
  opacity: 1;
1178
1179
  visibility: visible;
1179
1180
  }
1180
-
1181
- .components-drop-zone__content {
1181
+ .components-drop-zone .components-drop-zone__content {
1182
1182
  position: absolute;
1183
1183
  top: 0;
1184
1184
  bottom: 0;
@@ -1193,6 +1193,31 @@ body.is-dragging-components-draggable {
1193
1193
  z-index: 50;
1194
1194
  text-align: center;
1195
1195
  color: #fff;
1196
+ opacity: 0;
1197
+ pointer-events: none;
1198
+ }
1199
+ .components-drop-zone .components-drop-zone__content-inner {
1200
+ opacity: 0;
1201
+ transform: scale(0.9);
1202
+ }
1203
+ .components-drop-zone.is-active:not(.has-dragged-out) .components-drop-zone__content {
1204
+ opacity: 1;
1205
+ transition: opacity 0.2s ease-in-out;
1206
+ }
1207
+ @media (prefers-reduced-motion) {
1208
+ .components-drop-zone.is-active:not(.has-dragged-out) .components-drop-zone__content {
1209
+ transition: none;
1210
+ }
1211
+ }
1212
+ .components-drop-zone.is-active:not(.has-dragged-out) .components-drop-zone__content-inner {
1213
+ opacity: 1;
1214
+ transform: scale(1);
1215
+ transition: opacity 0.1s ease-in-out 0.1s, transform 0.1s ease-in-out 0.1s;
1216
+ }
1217
+ @media (prefers-reduced-motion) {
1218
+ .components-drop-zone.is-active:not(.has-dragged-out) .components-drop-zone__content-inner {
1219
+ transition: none;
1220
+ }
1196
1221
  }
1197
1222
 
1198
1223
  .components-drop-zone__content-icon,
@@ -2652,7 +2677,7 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
2652
2677
  min-width: 24px;
2653
2678
  max-width: 24px;
2654
2679
  display: inline-flex;
2655
- margin: 0 6px 0 0;
2680
+ margin: 0 8px 0 0;
2656
2681
  padding: 0;
2657
2682
  appearance: none;
2658
2683
  cursor: pointer;
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/checkbox-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,eAAe,MAAM,IAAI,CAAC;AAIjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,eAAe,CAmBvC,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,eAAe,CAEpD,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,OAAO,CAAE,OAAO,eAAe,CAgD1D,CAAC;AAMF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,CAAE,OAAO,eAAe,CA4B5D,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/checkbox-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,eAAe,MAAM,IAAI,CAAC;AAIjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,eAAe,CAmBvC,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,eAAe,CAEpD,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,OAAO,CAAE,OAAO,eAAe,CAgD1D,CAAC;AAMF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,CAAE,OAAO,eAAe,CA+B5D,CAAC"}
@@ -26,6 +26,21 @@ declare const _default: {
26
26
  type: string;
27
27
  };
28
28
  };
29
+ onChange: {
30
+ control: {
31
+ type: null;
32
+ };
33
+ };
34
+ value: {
35
+ control: {
36
+ type: null;
37
+ };
38
+ };
39
+ };
40
+ parameters: {
41
+ actions: {
42
+ argTypesRegex: string;
43
+ };
29
44
  };
30
45
  };
31
46
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,OAAO,mBAAmB,MAAM,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;AAErC,wBAaE;AAEF,eAAO,MAAM,OAAO,EAAE,OAAwC,CAAC;AA4B/D,eAAO,MAAM,cAAc,EAAE,OAAwC,CAAC;AAmBtE,eAAO,MAAM,SAAS,EAAE,OAAwC,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOhD;;GAEG;AACH,OAAO,mBAAmB,MAAM,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErC,wBAkBE;AAqBF,eAAO,MAAM,OAAO,EAAE,OAA6B,CAAC;AA4BpD,eAAO,MAAM,cAAc,EAAE,OAA6B,CAAC;AAmB3D,eAAO,MAAM,SAAS,EAAE,OAA6B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/legacy-component/index.tsx"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGxD,iBAAS,mBAAmB,CAAE,KAAK,EAAE,uBAAuB,+BA2G3D;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/legacy-component/index.tsx"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGxD,iBAAS,mBAAmB,CAAE,KAAK,EAAE,uBAAuB,+BAmH3D;AAED,eAAe,mBAAmB,CAAC"}
@@ -8,6 +8,10 @@ export declare const WithHintWrapper: import("@emotion/styled").StyledComponent<
8
8
  theme?: import("@emotion/react").Theme | undefined;
9
9
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
10
10
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
+ export declare const SelectedExperimentalHintWrapper: import("@emotion/styled").StyledComponent<{
12
+ theme?: import("@emotion/react").Theme | undefined;
13
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
14
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
15
  export declare const SelectedExperimentalHintItem: import("@emotion/styled").StyledComponent<{
12
16
  theme?: import("@emotion/react").Theme | undefined;
13
17
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/custom-select-control-v2/styles.ts"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAQ1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAItD,eAAO,MAAM,eAAe;;;yGAI3B,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;2GAGxC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;2GAIhC,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;UAMvB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;UAOZ,YAAa,sBAAsB,CAAE,MAAM,CAAE,CAAE;yBAChC,OAAO;UA2C1B,CAAC;AAEJ,eAAO,MAAM,aAAa;;;;;;;;;UAQzB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;UAUtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;UAK7B,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/custom-select-control-v2/styles.ts"],"names":[],"mappings":";AAAA;;GAEG;AAEH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAS1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAUtD,eAAO,MAAM,eAAe;;;yGAI3B,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;yGAE3C,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;2GAGxC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;2GAIhC,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;UAMvB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;UAOZ,YAAa,sBAAsB,CAAE,MAAM,CAAE,CAAE;yBAChC,OAAO;UA4C1B,CAAC;AAEJ,eAAO,MAAM,aAAa;;;;;;;;;UAQzB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;UAUtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;UAK7B,CAAC"}
@@ -64,6 +64,7 @@ type LegacyOption = {
64
64
  style?: React.CSSProperties;
65
65
  className?: string;
66
66
  __experimentalHint?: string;
67
+ [key: string]: any;
67
68
  };
68
69
  /**
69
70
  * The legacy object returned from the onChange event.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/custom-select-control-v2/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG;IAC/B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAEhE,KAAK,gBAAgB,CAAE,IAAI,GAAG,SAAS,GAAG,SAAS,IAAK;IACvD;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CACpD,SAAS,GAAG,SAAS,GAAG,OAAO,CAC/B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACrC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG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qB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC"}
@@ -1,4 +1,7 @@
1
1
  /// <reference types="react" />
2
+ /**
3
+ * Internal dependencies
4
+ */
2
5
  import type { DropZoneProps } from './types';
3
6
  import type { WordPressComponentProps } from '../context';
4
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drop-zone/index.tsx"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EAAY,aAAa,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAmE1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAE,EAClC,SAAS,EACT,KAAK,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,GAAG,SAAS,EACZ,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAE,+BA6ExD;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/drop-zone/index.tsx"],"names":[],"mappings":";AAcA;;GAEG;AACH,OAAO,KAAK,EAAY,aAAa,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAE,EAClC,SAAS,EACT,KAAK,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,GAAG,SAAS,EACZ,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAE,+BA0FxD;AAED,eAAe,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "28.0.3",
3
+ "version": "28.2.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -43,23 +43,23 @@
43
43
  "@types/gradient-parser": "0.1.3",
44
44
  "@types/highlight-words-core": "1.2.1",
45
45
  "@use-gesture/react": "^10.3.1",
46
- "@wordpress/a11y": "^4.0.1",
47
- "@wordpress/compose": "^7.0.1",
48
- "@wordpress/date": "^5.0.1",
49
- "@wordpress/deprecated": "^4.0.1",
50
- "@wordpress/dom": "^4.0.1",
51
- "@wordpress/element": "^6.0.1",
52
- "@wordpress/escape-html": "^3.0.1",
53
- "@wordpress/hooks": "^4.0.1",
54
- "@wordpress/html-entities": "^4.0.1",
55
- "@wordpress/i18n": "^5.0.1",
56
- "@wordpress/icons": "^10.0.2",
57
- "@wordpress/is-shallow-equal": "^5.0.1",
58
- "@wordpress/keycodes": "^4.0.1",
59
- "@wordpress/primitives": "^4.0.1",
60
- "@wordpress/private-apis": "^1.0.2",
61
- "@wordpress/rich-text": "^7.0.2",
62
- "@wordpress/warning": "^3.0.1",
46
+ "@wordpress/a11y": "^4.2.0",
47
+ "@wordpress/compose": "^7.2.0",
48
+ "@wordpress/date": "^5.2.0",
49
+ "@wordpress/deprecated": "^4.2.0",
50
+ "@wordpress/dom": "^4.2.0",
51
+ "@wordpress/element": "^6.2.0",
52
+ "@wordpress/escape-html": "^3.2.0",
53
+ "@wordpress/hooks": "^4.2.0",
54
+ "@wordpress/html-entities": "^4.2.0",
55
+ "@wordpress/i18n": "^5.2.0",
56
+ "@wordpress/icons": "^10.2.0",
57
+ "@wordpress/is-shallow-equal": "^5.2.0",
58
+ "@wordpress/keycodes": "^4.2.0",
59
+ "@wordpress/primitives": "^4.2.0",
60
+ "@wordpress/private-apis": "^1.2.0",
61
+ "@wordpress/rich-text": "^7.2.0",
62
+ "@wordpress/warning": "^3.2.0",
63
63
  "change-case": "^4.1.2",
64
64
  "clsx": "^2.1.1",
65
65
  "colord": "^2.7.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "9dd5f8dcfa4fc7242e5d48be20ee789ad087b432"
89
+ "gitHead": "aa5b14bb5bdbb8d8a02914e154c3bc1c2f18ace6"
90
90
  }
@@ -142,6 +142,8 @@ export const WithCustomLabel: StoryFn< typeof CheckboxControl > = ( {
142
142
  setChecked( v );
143
143
  onChange( v );
144
144
  } }
145
+ // Disable reason: For simplicity of the code snippet.
146
+ // eslint-disable-next-line no-restricted-syntax
145
147
  id="my-checkbox-with-custom-label"
146
148
  aria-describedby="my-custom-description"
147
149
  />
@@ -149,6 +151,7 @@ export const WithCustomLabel: StoryFn< typeof CheckboxControl > = ( {
149
151
  <label htmlFor="my-checkbox-with-custom-label">
150
152
  My custom label
151
153
  </label>
154
+ { /* eslint-disable-next-line no-restricted-syntax */ }
152
155
  <div id="my-custom-description" style={ { fontSize: 13 } }>
153
156
  A custom description.
154
157
  </div>
@@ -5,6 +5,8 @@
5
5
  @include break-small() {
6
6
  --checkbox-input-size: 20px;
7
7
  }
8
+
9
+ --checkbox-input-margin: #{$grid-unit-10};
8
10
  }
9
11
 
10
12
  .components-checkbox-control__label {
@@ -55,7 +57,7 @@
55
57
  .components-checkbox-control__input-container {
56
58
  position: relative;
57
59
  display: inline-block;
58
- margin-right: $grid-unit-15;
60
+ margin-right: var(--checkbox-input-margin);
59
61
  vertical-align: middle;
60
62
  width: var(--checkbox-input-size);
61
63
  aspect-ratio: 1;
@@ -84,5 +86,5 @@ svg.components-checkbox-control__indeterminate {
84
86
 
85
87
  .components-checkbox-control__help {
86
88
  display: inline-block;
87
- margin-inline-start: calc(var(--checkbox-input-size) + #{$grid-unit-15});
89
+ margin-inline-start: calc(var(--checkbox-input-size) + var(--checkbox-input-margin));
88
90
  }
@@ -3,6 +3,11 @@
3
3
  */
4
4
  import type { StoryFn } from '@storybook/react';
5
5
 
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { useState } from '@wordpress/element';
10
+
6
11
  /**
7
12
  * Internal dependencies
8
13
  */
@@ -20,10 +25,34 @@ export default {
20
25
  type: 'radio',
21
26
  },
22
27
  },
28
+ onChange: { control: { type: null } },
29
+ value: { control: { type: null } },
30
+ },
31
+ parameters: {
32
+ actions: { argTypesRegex: '^on.*' },
23
33
  },
24
34
  };
25
35
 
26
- export const Default: StoryFn = CustomSelectControl.bind( {} );
36
+ const Template: StoryFn< typeof CustomSelectControl > = ( props ) => {
37
+ const [ value, setValue ] = useState( props.options[ 0 ] );
38
+
39
+ const onChange: React.ComponentProps<
40
+ typeof CustomSelectControl
41
+ >[ 'onChange' ] = ( changeObject: { selectedItem: any } ) => {
42
+ setValue( changeObject.selectedItem );
43
+ props.onChange?.( changeObject );
44
+ };
45
+
46
+ return (
47
+ <CustomSelectControl
48
+ { ...props }
49
+ onChange={ onChange }
50
+ value={ value }
51
+ />
52
+ );
53
+ };
54
+
55
+ export const Default: StoryFn = Template.bind( {} );
27
56
  Default.args = {
28
57
  label: 'Label',
29
58
  options: [
@@ -51,7 +80,7 @@ Default.args = {
51
80
  ],
52
81
  };
53
82
 
54
- export const WithLongLabels: StoryFn = CustomSelectControl.bind( {} );
83
+ export const WithLongLabels: StoryFn = Template.bind( {} );
55
84
  WithLongLabels.args = {
56
85
  ...Default.args,
57
86
  options: [
@@ -70,7 +99,7 @@ WithLongLabels.args = {
70
99
  ],
71
100
  };
72
101
 
73
- export const WithHints: StoryFn = CustomSelectControl.bind( {} );
102
+ export const WithHints: StoryFn = Template.bind( {} );
74
103
  WithHints.args = {
75
104
  ...Default.args,
76
105
  options: [