@wordpress/components 32.5.2-next.v.202604091042.0 → 32.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/build/alignment-matrix-control/cell.cjs +3 -3
- package/build/alignment-matrix-control/cell.cjs.map +2 -2
- package/build/alignment-matrix-control/index.cjs +3 -3
- package/build/alignment-matrix-control/index.cjs.map +2 -2
- package/build/custom-gradient-picker/index.cjs.map +2 -2
- package/build/date-time/{date → date-picker}/index.cjs +6 -6
- package/build/date-time/{date → date-picker}/index.cjs.map +2 -2
- package/build/date-time/{date → date-picker}/styles.cjs +17 -17
- package/build/date-time/{date → date-picker}/styles.cjs.map +2 -2
- package/build/date-time/{date → date-picker}/use-lilius/index.cjs +1 -1
- package/build/date-time/{date → date-picker}/use-lilius/index.cjs.map +1 -1
- package/build/date-time/date-time/index.cjs +6 -6
- package/build/date-time/date-time/index.cjs.map +2 -2
- package/build/date-time/index.cjs +4 -4
- package/build/date-time/index.cjs.map +2 -2
- package/build/date-time/{time → time-picker}/index.cjs +6 -6
- package/build/date-time/time-picker/index.cjs.map +7 -0
- package/build/date-time/{time → time-picker}/styles.cjs +21 -21
- package/build/date-time/{time → time-picker}/styles.cjs.map +2 -2
- package/build/date-time/{time → time-picker}/time-input/index.cjs +1 -1
- package/build/date-time/{time → time-picker}/time-input/index.cjs.map +1 -1
- package/build/date-time/{time → time-picker}/timezone.cjs +1 -1
- package/build/date-time/{time → time-picker}/timezone.cjs.map +1 -1
- package/build/modal/index.cjs.map +2 -2
- package/build/palette-edit/index.cjs.map +2 -2
- package/build/radio-control/index.cjs +2 -0
- package/build/radio-control/index.cjs.map +2 -2
- package/build/sandbox/index.cjs +125 -1
- package/build/sandbox/index.cjs.map +2 -2
- package/build/textarea-control/styles/textarea-control-styles.cjs +3 -3
- package/build/textarea-control/styles/textarea-control-styles.cjs.map +2 -2
- package/build-module/alignment-matrix-control/cell.mjs +3 -3
- package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
- package/build-module/alignment-matrix-control/index.mjs +3 -3
- package/build-module/alignment-matrix-control/index.mjs.map +2 -2
- package/build-module/custom-gradient-picker/index.mjs.map +2 -2
- package/build-module/date-time/{date → date-picker}/index.mjs +3 -3
- package/build-module/date-time/{date → date-picker}/index.mjs.map +2 -2
- package/build-module/date-time/{date → date-picker}/styles.mjs +17 -17
- package/build-module/date-time/{date → date-picker}/styles.mjs.map +2 -2
- package/build-module/date-time/{date → date-picker}/use-lilius/index.mjs +1 -1
- package/build-module/date-time/{date → date-picker}/use-lilius/index.mjs.map +1 -1
- package/build-module/date-time/date-time/index.mjs +2 -2
- package/build-module/date-time/date-time/index.mjs.map +1 -1
- package/build-module/date-time/index.mjs +2 -2
- package/build-module/date-time/index.mjs.map +1 -1
- package/build-module/date-time/{time → time-picker}/index.mjs +3 -3
- package/build-module/date-time/time-picker/index.mjs.map +7 -0
- package/build-module/date-time/{time → time-picker}/styles.mjs +21 -21
- package/build-module/date-time/{time → time-picker}/styles.mjs.map +2 -2
- package/build-module/date-time/{time → time-picker}/time-input/index.mjs +1 -1
- package/build-module/date-time/{time → time-picker}/time-input/index.mjs.map +1 -1
- package/build-module/date-time/{time → time-picker}/timezone.mjs +1 -1
- package/build-module/date-time/{time → time-picker}/timezone.mjs.map +1 -1
- package/build-module/modal/index.mjs.map +2 -2
- package/build-module/palette-edit/index.mjs.map +2 -2
- package/build-module/radio-control/index.mjs +2 -0
- package/build-module/radio-control/index.mjs.map +2 -2
- package/build-module/sandbox/index.mjs +126 -2
- package/build-module/sandbox/index.mjs.map +2 -2
- package/build-module/textarea-control/styles/textarea-control-styles.mjs +3 -3
- package/build-module/textarea-control/styles/textarea-control-styles.mjs.map +2 -2
- package/build-style/style-rtl.css +83 -23
- package/build-style/style.css +83 -23
- package/build-types/checkbox-control/types.d.ts +4 -0
- package/build-types/checkbox-control/types.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
- package/build-types/date-time/date-picker/index.d.ts.map +1 -0
- package/build-types/date-time/date-picker/styles.d.ts.map +1 -0
- package/build-types/date-time/date-picker/test/index.d.ts.map +1 -0
- package/build-types/date-time/date-picker/test/use-lilius.d.ts.map +1 -0
- package/build-types/date-time/date-picker/use-lilius/index.d.ts.map +1 -0
- package/build-types/date-time/date-time/index.d.ts +2 -2
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/index.d.ts +2 -2
- package/build-types/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/stories/date.story.d.ts +1 -1
- package/build-types/date-time/stories/date.story.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts +1 -1
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/date-time/{time → time-picker}/index.d.ts +1 -1
- package/build-types/date-time/time-picker/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/styles.d.ts.map +1 -0
- package/build-types/date-time/time-picker/test/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/time-input/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/time-input/test/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/timezone.d.ts.map +1 -0
- package/build-types/date-time/types.d.ts +1 -1
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/radio-control/index.d.ts.map +1 -1
- package/build-types/radio-control/types.d.ts +6 -0
- package/build-types/radio-control/types.d.ts.map +1 -1
- package/build-types/sandbox/index.d.ts +1 -1
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/sandbox/types.d.ts +11 -0
- package/build-types/sandbox/types.d.ts.map +1 -1
- package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/checkbox-control.d.ts +2 -1
- package/build-types/validated-form-controls/components/checkbox-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/radio-control.d.ts +2 -1
- package/build-types/validated-form-controls/components/radio-control.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/alignment-matrix-control/style.module.scss +1 -1
- package/src/button/style.scss +1 -1
- package/src/calendar/style.scss +3 -3
- package/src/checkbox-control/style.scss +17 -5
- package/src/checkbox-control/types.ts +4 -0
- package/src/circular-option-picker/style.scss +1 -1
- package/src/color-palette/style.scss +1 -1
- package/src/css.d.ts +1 -0
- package/src/custom-gradient-picker/index.tsx +1 -0
- package/src/date-time/README.md +3 -3
- package/src/date-time/date-picker/README.md +65 -0
- package/src/date-time/date-time/index.tsx +2 -2
- package/src/date-time/index.ts +2 -2
- package/src/date-time/stories/date.story.tsx +1 -1
- package/src/date-time/stories/time.story.tsx +1 -1
- package/src/date-time/time-picker/README.md +119 -0
- package/src/date-time/{time → time-picker}/index.tsx +1 -1
- package/src/date-time/types.ts +1 -1
- package/src/dropdown-menu/style.scss +1 -1
- package/src/form-toggle/style.scss +35 -2
- package/src/form-token-field/style.scss +12 -3
- package/src/modal/index.tsx +1 -0
- package/src/palette-edit/index.tsx +1 -0
- package/src/radio-control/index.tsx +2 -0
- package/src/radio-control/style.scss +21 -2
- package/src/radio-control/test/index.tsx +10 -0
- package/src/radio-control/types.ts +6 -0
- package/src/sandbox/index.tsx +189 -9
- package/src/sandbox/test/index.tsx +65 -24
- package/src/sandbox/types.ts +11 -0
- package/src/snackbar/style.scss +2 -2
- package/src/tab-panel/style.scss +1 -1
- package/src/textarea-control/stories/index.story.tsx +3 -0
- package/src/textarea-control/styles/textarea-control-styles.ts +6 -0
- package/src/toggle-control/style.scss +1 -1
- package/src/toggle-control/test/index.tsx +8 -2
- package/build/date-time/time/index.cjs.map +0 -7
- package/build-module/date-time/time/index.mjs.map +0 -7
- package/build-types/date-time/date/index.d.ts.map +0 -1
- package/build-types/date-time/date/styles.d.ts.map +0 -1
- package/build-types/date-time/date/test/index.d.ts.map +0 -1
- package/build-types/date-time/date/test/use-lilius.d.ts.map +0 -1
- package/build-types/date-time/date/use-lilius/index.d.ts.map +0 -1
- package/build-types/date-time/time/index.d.ts.map +0 -1
- package/build-types/date-time/time/styles.d.ts.map +0 -1
- package/build-types/date-time/time/test/index.d.ts.map +0 -1
- package/build-types/date-time/time/time-input/index.d.ts.map +0 -1
- package/build-types/date-time/time/time-input/test/index.d.ts.map +0 -1
- package/build-types/date-time/time/timezone.d.ts.map +0 -1
- /package/build-types/date-time/{date → date-picker}/index.d.ts +0 -0
- /package/build-types/date-time/{date → date-picker}/styles.d.ts +0 -0
- /package/build-types/date-time/{date → date-picker}/test/index.d.ts +0 -0
- /package/build-types/date-time/{date → date-picker}/test/use-lilius.d.ts +0 -0
- /package/build-types/date-time/{date → date-picker}/use-lilius/index.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/styles.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/test/index.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/time-input/index.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/time-input/test/index.d.ts +0 -0
- /package/build-types/date-time/{time → time-picker}/timezone.d.ts +0 -0
- /package/src/date-time/{date → date-picker}/index.tsx +0 -0
- /package/src/date-time/{date → date-picker}/styles.ts +0 -0
- /package/src/date-time/{date → date-picker}/test/index.tsx +0 -0
- /package/src/date-time/{date → date-picker}/test/use-lilius.ts +0 -0
- /package/src/date-time/{date → date-picker}/use-lilius/index.ts +0 -0
- /package/src/date-time/{time → time-picker}/styles.ts +0 -0
- /package/src/date-time/{time → time-picker}/test/index.tsx +0 -0
- /package/src/date-time/{time → time-picker}/time-input/index.tsx +0 -0
- /package/src/date-time/{time → time-picker}/time-input/test/index.tsx +0 -0
- /package/src/date-time/{time → time-picker}/timezone.tsx +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/date-time/time-picker/test/index.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/date-time/time-picker/time-input/index.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AASlD,wBAAgB,SAAS,CAAE,EAC1B,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,QAAQ,GACR,EAAE,cAAc,+BAqJhB;AACD,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/date-time/time-picker/time-input/test/index.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timezone.d.ts","sourceRoot":"","sources":["../../../src/date-time/time-picker/timezone.tsx"],"names":[],"mappings":"AAYA;;;GAGG;AACH,QAAA,MAAM,QAAQ,0CA0Cb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/date-time/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/date-time/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,MAAM,eAAe,GAAG;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAE5C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAEpC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IAEvB;;;OAGG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;IAE9B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAE,OAAO,YAAY,CAAE,CAAC;IAE3D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAE5C;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAEpC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,OAAO,CAAC;IAE1C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAE5C;;;OAGG;IACH,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAE3B;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAE,eAAe,EAAE,UAAU,CAAE,GACpE,IAAI,CACH,eAAe,EACf,aAAa,GAAG,UAAU,GAAG,qBAAqB,CAClD,GAAG;IACH;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAE,IAAI,EAAE,MAAM,GAAG,IAAI,KAAM,IAAI,CAAC;CAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modal/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modal/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAyV1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,KAAK,uGAAiC,CAAC;AAGpD,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/palette-edit/index.tsx"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAMX,gBAAgB,EAChB,cAAc,EACd,MAAM,SAAS,CAAC;AAmBjB,wBAAgB,uBAAuB,CAAE,CAAC,SAAS,cAAc,EAChE,QAAQ,EAAE,CAAC,EAAE;;KAgBb;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACxC,QAAQ,EAAE,cAAc,EAAE,EAC1B,UAAU,EAAE,MAAM;;;EAwBlB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/palette-edit/index.tsx"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAMX,gBAAgB,EAChB,cAAc,EACd,MAAM,SAAS,CAAC;AAmBjB,wBAAgB,uBAAuB,CAAE,CAAC,SAAS,cAAc,EAChE,QAAQ,EAAE,CAAC,EAAE;;KAgBb;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACxC,QAAQ,EAAE,cAAc,EAAE,EAC1B,UAAU,EAAE,MAAM;;;EAwBlB;AAmOD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAE,EAC5B,SAAS,EACT,MAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,wBAA4B,EAC5B,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,UAAe,EACf,YAAY,GACZ,EAAE,gBAAgB,+BAkPlB;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/radio-control/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAiBjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,uBAAuB,CAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,CAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/radio-control/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAiBjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,uBAAuB,CAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,CAAE,sCAuGnE;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { BaseControlProps } from '../base-control/types';
|
|
5
5
|
export type RadioControlProps = Pick<BaseControlProps, 'label' | 'help' | 'hideLabelFromVision'> & {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the radio group should be disabled.
|
|
8
|
+
*
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
6
12
|
/**
|
|
7
13
|
* A function that receives the value of the new option that is being
|
|
8
14
|
* selected as input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/radio-control/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CACnC,gBAAgB,EAChB,OAAO,GAAG,MAAM,GAAG,qBAAqB,CACxC,GAAG;IACH;;;OAGG;IACH,QAAQ,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE;QACT;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACrB,EAAE,CAAC;IACJ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/radio-control/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CACnC,gBAAgB,EAChB,OAAO,GAAG,MAAM,GAAG,qBAAqB,CACxC,GAAG;IACH;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE;QACT;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACrB,EAAE,CAAC;IACJ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -13,6 +13,6 @@ import type { SandBoxProps } from './types';
|
|
|
13
13
|
* );
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
declare function SandBox({
|
|
16
|
+
declare function SandBox({ allowSameOrigin, ...contentProps }: SandBoxProps): import("react").JSX.Element;
|
|
17
17
|
export default SandBox;
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAyb5C;;;;;;;;;;GAUG;AACH,iBAAS,OAAO,CAAE,EAAE,eAAuB,EAAE,GAAG,YAAY,EAAE,EAAE,YAAY,+BAK3E;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export type SandBoxProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Whether to include `allow-same-origin` in the iframe's sandbox
|
|
4
|
+
* attribute. When true, nested iframes (such as third-party embeds)
|
|
5
|
+
* can access their own origin's cookies and storage.
|
|
6
|
+
*
|
|
7
|
+
* Only enable this for content that is NOT directly user-controlled,
|
|
8
|
+
* such as server-fetched oEmbed previews.
|
|
9
|
+
*
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
allowSameOrigin?: boolean;
|
|
2
13
|
/**
|
|
3
14
|
* The HTML to render in the body of the iframe document.
|
|
4
15
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sandbox/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,iBAAiB,CAAE,CAAE,SAAS,CAAE,CAAC;IAChE;;;;OAIG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAE,UAAU,CAAE,CAAC;CACrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sandbox/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IAC1B;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,iBAAiB,CAAE,CAAE,SAAS,CAAE,CAAC;IAChE;;;;OAIG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAE,UAAU,CAAE,CAAC;CACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/textarea-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAO3D;;GAEG;AACH,OAAO,eAAe,MAAM,IAAI,CAAC;AAEjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,eAAe,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/textarea-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAO3D;;GAEG;AACH,OAAO,eAAe,MAAM,IAAI,CAAC;AAEjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,eAAe,CAwBvC,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,eAAe,CAAwB,CAAC"}
|
|
@@ -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;;;
|
|
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;;;2HA8D1B,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ValidatedControlProps } from './types';
|
|
2
2
|
export declare const ValidatedCheckboxControl: import("react").ForwardRefExoticComponent<Pick<import("../../base-control/types").BaseControlProps, "help" | "__nextHasNoMarginBottom"> & {
|
|
3
|
+
disabled?: boolean;
|
|
3
4
|
onChange: (value: boolean) => void;
|
|
4
5
|
label?: string;
|
|
5
6
|
checked?: boolean;
|
|
6
7
|
indeterminate?: boolean;
|
|
7
8
|
heading?: import("react").ReactNode;
|
|
8
|
-
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "onChange" | "label" | "help" | "children" | "as" | "checked" | "heading" | "__nextHasNoMarginBottom" | "indeterminate"> & ValidatedControlProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "onChange" | "label" | "help" | "disabled" | "children" | "as" | "checked" | "heading" | "__nextHasNoMarginBottom" | "indeterminate"> & ValidatedControlProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
10
|
//# sourceMappingURL=checkbox-control.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/components/checkbox-control.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAmCrD,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"checkbox-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/components/checkbox-control.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAmCrD,eAAO,MAAM,wBAAwB;;;;;;;kVAEpC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ValidatedControlProps } from './types';
|
|
2
2
|
export declare const ValidatedRadioControl: import("react").ForwardRefExoticComponent<Pick<import("../../base-control/types").BaseControlProps, "label" | "help" | "hideLabelFromVision"> & {
|
|
3
|
+
disabled?: boolean;
|
|
3
4
|
onChange: (value: string) => void;
|
|
4
5
|
options?: {
|
|
5
6
|
label: string;
|
|
@@ -7,5 +8,5 @@ export declare const ValidatedRadioControl: import("react").ForwardRefExoticComp
|
|
|
7
8
|
description?: string;
|
|
8
9
|
}[];
|
|
9
10
|
selected?: string;
|
|
10
|
-
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "onChange" | "label" | "help" | "children" | "as" | "selected" | "options" | "hideLabelFromVision"> & ValidatedControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "onChange" | "label" | "help" | "disabled" | "children" | "as" | "selected" | "options" | "hideLabelFromVision"> & ValidatedControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
12
|
//# sourceMappingURL=radio-control.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/components/radio-control.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAiCrD,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"radio-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/components/radio-control.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAiCrD,eAAO,MAAM,qBAAqB;;;;;;mBAfZ,CAAC;;;2TAiBtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.6.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -64,24 +64,24 @@
|
|
|
64
64
|
"@types/highlight-words-core": "1.2.1",
|
|
65
65
|
"@types/react": "^18.3.27",
|
|
66
66
|
"@use-gesture/react": "^10.3.1",
|
|
67
|
-
"@wordpress/a11y": "^4.
|
|
68
|
-
"@wordpress/base-styles": "^6.
|
|
69
|
-
"@wordpress/compose": "^7.
|
|
70
|
-
"@wordpress/date": "^5.
|
|
71
|
-
"@wordpress/deprecated": "^4.
|
|
72
|
-
"@wordpress/dom": "^4.
|
|
73
|
-
"@wordpress/element": "^6.44.
|
|
74
|
-
"@wordpress/escape-html": "^3.
|
|
75
|
-
"@wordpress/hooks": "^4.
|
|
76
|
-
"@wordpress/html-entities": "^4.
|
|
77
|
-
"@wordpress/i18n": "^6.17.
|
|
78
|
-
"@wordpress/icons": "^12.
|
|
79
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
80
|
-
"@wordpress/keycodes": "^4.
|
|
81
|
-
"@wordpress/primitives": "^4.
|
|
82
|
-
"@wordpress/private-apis": "^1.
|
|
83
|
-
"@wordpress/rich-text": "^7.
|
|
84
|
-
"@wordpress/warning": "^3.
|
|
67
|
+
"@wordpress/a11y": "^4.44.0",
|
|
68
|
+
"@wordpress/base-styles": "^6.20.0",
|
|
69
|
+
"@wordpress/compose": "^7.44.0",
|
|
70
|
+
"@wordpress/date": "^5.44.0",
|
|
71
|
+
"@wordpress/deprecated": "^4.44.0",
|
|
72
|
+
"@wordpress/dom": "^4.44.0",
|
|
73
|
+
"@wordpress/element": "^6.44.0",
|
|
74
|
+
"@wordpress/escape-html": "^3.44.0",
|
|
75
|
+
"@wordpress/hooks": "^4.44.0",
|
|
76
|
+
"@wordpress/html-entities": "^4.44.0",
|
|
77
|
+
"@wordpress/i18n": "^6.17.0",
|
|
78
|
+
"@wordpress/icons": "^12.2.0",
|
|
79
|
+
"@wordpress/is-shallow-equal": "^5.44.0",
|
|
80
|
+
"@wordpress/keycodes": "^4.44.0",
|
|
81
|
+
"@wordpress/primitives": "^4.44.0",
|
|
82
|
+
"@wordpress/private-apis": "^1.44.0",
|
|
83
|
+
"@wordpress/rich-text": "^7.44.0",
|
|
84
|
+
"@wordpress/warning": "^3.44.0",
|
|
85
85
|
"change-case": "^4.1.2",
|
|
86
86
|
"clsx": "^2.1.1",
|
|
87
87
|
"colord": "^2.7.0",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"@storybook/react-vite": "^10.2.8",
|
|
108
108
|
"@testing-library/jest-dom": "^6.9.1",
|
|
109
109
|
"@types/jest": "^29.5.14",
|
|
110
|
-
"@wordpress/jest-console": "^8.
|
|
110
|
+
"@wordpress/jest-console": "^8.44.0",
|
|
111
111
|
"snapshot-diff": "^0.10.0",
|
|
112
112
|
"storybook": "^10.2.8",
|
|
113
113
|
"timezone-mock": "^1.3.6"
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"publishConfig": {
|
|
120
120
|
"access": "public"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "b862d8c84121a47bbeff882f6c87e61681ce2e0d"
|
|
123
123
|
}
|
package/src/button/style.scss
CHANGED
package/src/calendar/style.scss
CHANGED
|
@@ -53,7 +53,7 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
|
|
|
53
53
|
background: none;
|
|
54
54
|
padding: 0;
|
|
55
55
|
margin: 0;
|
|
56
|
-
cursor:
|
|
56
|
+
cursor: var(--wpds-cursor-control);
|
|
57
57
|
justify-content: center;
|
|
58
58
|
align-items: center;
|
|
59
59
|
display: flex;
|
|
@@ -127,7 +127,7 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
|
|
|
127
127
|
background: none;
|
|
128
128
|
padding: 0;
|
|
129
129
|
margin: 0;
|
|
130
|
-
cursor:
|
|
130
|
+
cursor: var(--wpds-cursor-control);
|
|
131
131
|
appearance: none;
|
|
132
132
|
display: inline-flex;
|
|
133
133
|
align-items: center;
|
|
@@ -244,7 +244,7 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
&:disabled::before {
|
|
247
|
-
background-color: $components-color-
|
|
247
|
+
background-color: $components-color-gray-400;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
&:hover:not(:disabled)::before {
|
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
.components-checkbox-control__label {
|
|
18
18
|
// Ensure label is aligned with checkbox along X axis
|
|
19
19
|
line-height: var(--checkbox-input-size);
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
.components-checkbox-control:not(:has(:disabled)) & {
|
|
22
|
+
cursor: var(--wpds-cursor-control);
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
.components-checkbox-control__input[type="checkbox"] {
|
|
@@ -25,7 +28,6 @@
|
|
|
25
28
|
background: $white;
|
|
26
29
|
color: $gray-900;
|
|
27
30
|
clear: none;
|
|
28
|
-
cursor: pointer;
|
|
29
31
|
display: inline-block;
|
|
30
32
|
line-height: 0;
|
|
31
33
|
margin: 0 $grid-unit-05 0 0;
|
|
@@ -46,12 +48,15 @@
|
|
|
46
48
|
@include button-style-outset__focus(var(--wp-admin-theme-color));
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
&:checked,
|
|
50
|
-
&:indeterminate {
|
|
51
|
+
&:not(:disabled):is(:checked, :indeterminate) {
|
|
51
52
|
background: $components-color-accent;
|
|
52
53
|
border-color: $components-color-accent;
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
&:not(:disabled) {
|
|
57
|
+
cursor: var(--wpds-cursor-control);
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
&:checked::before {
|
|
56
61
|
content: none;
|
|
57
62
|
}
|
|
@@ -73,7 +78,7 @@ svg.components-checkbox-control__indeterminate {
|
|
|
73
78
|
--checkmark-size: var(--checkbox-input-size);
|
|
74
79
|
|
|
75
80
|
fill: $white;
|
|
76
|
-
cursor:
|
|
81
|
+
cursor: var(--wpds-cursor-control);
|
|
77
82
|
position: absolute;
|
|
78
83
|
left: 50%;
|
|
79
84
|
top: 50%;
|
|
@@ -88,6 +93,13 @@ svg.components-checkbox-control__indeterminate {
|
|
|
88
93
|
}
|
|
89
94
|
}
|
|
90
95
|
|
|
96
|
+
.components-checkbox-control:has(:disabled) {
|
|
97
|
+
svg.components-checkbox-control__checked,
|
|
98
|
+
svg.components-checkbox-control__indeterminate {
|
|
99
|
+
fill: $components-color-gray-400;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
91
103
|
.components-checkbox-control__help {
|
|
92
104
|
display: inline-block;
|
|
93
105
|
margin-inline-start: calc(var(--checkbox-input-size) + var(--checkbox-input-margin));
|
|
@@ -12,6 +12,10 @@ export type CheckboxControlProps = Pick<
|
|
|
12
12
|
BaseControlProps,
|
|
13
13
|
'__nextHasNoMarginBottom' | 'help'
|
|
14
14
|
> & {
|
|
15
|
+
/**
|
|
16
|
+
* Whether the checkbox should be disabled.
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
15
19
|
/**
|
|
16
20
|
* A function that receives the checked state (boolean) as input.
|
|
17
21
|
*/
|
|
@@ -16,7 +16,7 @@ $border-as-box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.2);
|
|
|
16
16
|
height: $grid-unit-80;
|
|
17
17
|
width: 100%;
|
|
18
18
|
box-sizing: border-box;
|
|
19
|
-
cursor:
|
|
19
|
+
cursor: var(--wpds-cursor-control);
|
|
20
20
|
// Show a thin outline in Windows high contrast mode.
|
|
21
21
|
outline: 1px solid transparent;
|
|
22
22
|
border-radius: $radius-medium $radius-medium 0 0;
|
package/src/css.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ const GradientTypePicker = ( {
|
|
|
76
76
|
);
|
|
77
77
|
|
|
78
78
|
if ( type === 'linear-gradient' && gradientAST.orientation ) {
|
|
79
|
+
// eslint-disable-next-line react-compiler/react-compiler -- false positive, see https://github.com/facebook/react/issues/29196
|
|
79
80
|
lastLinearOrientationAngle.current = Number(
|
|
80
81
|
gradientAST.orientation.value
|
|
81
82
|
);
|
package/src/date-time/README.md
CHANGED
|
@@ -70,7 +70,7 @@ A callback function which receives a Date object representing a day as an argume
|
|
|
70
70
|
|
|
71
71
|
- Required: No
|
|
72
72
|
|
|
73
|
-
### `onMonthPreviewed`: `( date:
|
|
73
|
+
### `onMonthPreviewed`: `( date: string ) => void`
|
|
74
74
|
|
|
75
75
|
A callback invoked when selecting the previous/next month in the date picker. The callback receives the new month date in the ISO format as an argument.
|
|
76
76
|
|
|
@@ -87,5 +87,5 @@ List of events to show in the date picker. Each event will appear as a dot on th
|
|
|
87
87
|
|
|
88
88
|
The day that the week should start on. 0 for Sunday, 1 for Monday, etc.
|
|
89
89
|
|
|
90
|
-
-
|
|
91
|
-
-
|
|
90
|
+
- Required: No
|
|
91
|
+
- Default: 0
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# DatePicker
|
|
2
|
+
|
|
3
|
+
DatePicker is a React component that renders a calendar for date selection. It can be used independently or as part of the `DateTimePicker` component.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Render a DatePicker.
|
|
8
|
+
|
|
9
|
+
```jsx
|
|
10
|
+
import { useState } from 'react';
|
|
11
|
+
import { DatePicker } from '@wordpress/components';
|
|
12
|
+
|
|
13
|
+
const MyDatePicker = () => {
|
|
14
|
+
const [ date, setDate ] = useState( new Date() );
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<DatePicker
|
|
18
|
+
currentDate={ date }
|
|
19
|
+
onChange={ ( newDate ) => setDate( newDate ) }
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
The component accepts the following props:
|
|
28
|
+
|
|
29
|
+
### `currentDate`: `Date | string | number | null`
|
|
30
|
+
|
|
31
|
+
The current date at initialization. Optionally pass in a `null` value to specify no date is currently selected.
|
|
32
|
+
|
|
33
|
+
- Required: No
|
|
34
|
+
- Default: today's date
|
|
35
|
+
|
|
36
|
+
### `onChange`: `( date: string ) => void`
|
|
37
|
+
|
|
38
|
+
The function called when a new date has been selected. It is passed the `currentDate` as an argument.
|
|
39
|
+
|
|
40
|
+
- Required: No
|
|
41
|
+
|
|
42
|
+
### `events`: `{ date: Date }[]`
|
|
43
|
+
|
|
44
|
+
List of events to show in the date picker. Each event will appear as a dot on the day of the event.
|
|
45
|
+
|
|
46
|
+
- Required: No
|
|
47
|
+
|
|
48
|
+
### `isInvalidDate`: `( date: Date ) => boolean`
|
|
49
|
+
|
|
50
|
+
A callback function which receives a Date object representing a day as an argument, and should return a Boolean to signify if the day is valid or not.
|
|
51
|
+
|
|
52
|
+
- Required: No
|
|
53
|
+
|
|
54
|
+
### `onMonthPreviewed`: `( date: string ) => void`
|
|
55
|
+
|
|
56
|
+
A callback invoked when selecting the previous/next month in the date picker. The callback receives the new month date in the ISO format as an argument.
|
|
57
|
+
|
|
58
|
+
- Required: No
|
|
59
|
+
|
|
60
|
+
### `startOfWeek`: `0 | 1 | 2 | 3 | 4 | 5 | 6`
|
|
61
|
+
|
|
62
|
+
The day that the week should start on. 0 for Sunday, 1 for Monday, etc.
|
|
63
|
+
|
|
64
|
+
- Required: No
|
|
65
|
+
- Default: 0
|
|
@@ -11,8 +11,8 @@ import { forwardRef } from '@wordpress/element';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import { default as DatePicker } from '../date';
|
|
15
|
-
import { default as TimePicker } from '../time';
|
|
14
|
+
import { default as DatePicker } from '../date-picker';
|
|
15
|
+
import { default as TimePicker } from '../time-picker';
|
|
16
16
|
import type { DateTimePickerProps } from '../types';
|
|
17
17
|
import { Wrapper } from './styles';
|
|
18
18
|
|
package/src/date-time/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { default as DatePicker } from './date';
|
|
5
|
-
import { default as TimePicker } from './time';
|
|
4
|
+
import { default as DatePicker } from './date-picker';
|
|
5
|
+
import { default as TimePicker } from './time-picker';
|
|
6
6
|
import { default as DateTimePicker } from './date-time';
|
|
7
7
|
|
|
8
8
|
export { DatePicker, TimePicker };
|
|
@@ -11,7 +11,7 @@ import { useState, useEffect } from '@wordpress/element';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import DatePicker from '../date';
|
|
14
|
+
import DatePicker from '../date-picker';
|
|
15
15
|
import { daysFromNow, isWeekend } from './utils';
|
|
16
16
|
|
|
17
17
|
const meta: Meta< typeof DatePicker > = {
|
|
@@ -11,7 +11,7 @@ import { useState, useEffect } from '@wordpress/element';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import TimePicker from '../time';
|
|
14
|
+
import TimePicker from '../time-picker';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TimePicker > = {
|
|
17
17
|
title: 'Components/Selection & Input/Time & Date/TimePicker',
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# TimePicker
|
|
2
|
+
|
|
3
|
+
TimePicker is a React component that renders form inputs for time and date selection. It can be used independently or as part of the `DateTimePicker` component.
|
|
4
|
+
|
|
5
|
+
**Note:** `TimePicker` also exposes a compound sub-component, `TimePicker.TimeInput`, which can be used independently to render a time input field without the full picker UI.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
Render a TimePicker.
|
|
10
|
+
|
|
11
|
+
```jsx
|
|
12
|
+
import { useState } from 'react';
|
|
13
|
+
import { TimePicker } from '@wordpress/components';
|
|
14
|
+
|
|
15
|
+
const MyTimePicker = () => {
|
|
16
|
+
const [ time, setTime ] = useState( new Date() );
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<TimePicker
|
|
20
|
+
currentTime={ time }
|
|
21
|
+
onChange={ ( newTime ) => setTime( newTime ) }
|
|
22
|
+
is12Hour
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Props
|
|
29
|
+
|
|
30
|
+
The component accepts the following props:
|
|
31
|
+
|
|
32
|
+
### `currentTime`: `Date | string | number | null`
|
|
33
|
+
|
|
34
|
+
The current time at initialization. Optionally pass in a `null` value to specify no time is currently selected.
|
|
35
|
+
|
|
36
|
+
- Required: No
|
|
37
|
+
- Default: current time
|
|
38
|
+
|
|
39
|
+
### `onChange`: `( time: string ) => void`
|
|
40
|
+
|
|
41
|
+
The function called when a new time has been selected. It is passed the time as an ISO-formatted string.
|
|
42
|
+
|
|
43
|
+
- Required: No
|
|
44
|
+
|
|
45
|
+
### `is12Hour`: `boolean`
|
|
46
|
+
|
|
47
|
+
Whether we use a 12-hour clock. With a 12-hour clock, an AM/PM widget is displayed.
|
|
48
|
+
|
|
49
|
+
- Required: No
|
|
50
|
+
- Default: false
|
|
51
|
+
|
|
52
|
+
### `dateOrder`: `'dmy' | 'mdy' | 'ymd'`
|
|
53
|
+
|
|
54
|
+
The order of day, month, and year. This prop overrides the time format determined by `is12Hour` prop.
|
|
55
|
+
|
|
56
|
+
- Required: No
|
|
57
|
+
- Default: `'dmy'` (or `'mdy'` when `is12Hour` is `true`)
|
|
58
|
+
|
|
59
|
+
### `hideLabelFromVision`: `boolean`
|
|
60
|
+
|
|
61
|
+
Whether to visually hide field labels while keeping them accessible to screen readers.
|
|
62
|
+
|
|
63
|
+
- Required: No
|
|
64
|
+
- Default: false
|
|
65
|
+
|
|
66
|
+
## TimePicker.TimeInput
|
|
67
|
+
|
|
68
|
+
A standalone time input component. Values are passed as an object in 24-hour format (`{ hours: number, minutes: number }`).
|
|
69
|
+
|
|
70
|
+
### Usage
|
|
71
|
+
|
|
72
|
+
```jsx
|
|
73
|
+
import { useState } from 'react';
|
|
74
|
+
import { TimePicker } from '@wordpress/components';
|
|
75
|
+
|
|
76
|
+
const MyTimeInput = () => {
|
|
77
|
+
const [ time, setTime ] = useState( { hours: 13, minutes: 30 } );
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<TimePicker.TimeInput
|
|
81
|
+
value={ time }
|
|
82
|
+
onChange={ setTime }
|
|
83
|
+
label="Time"
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Props
|
|
90
|
+
|
|
91
|
+
#### `value`: `{ hours: number, minutes: number }`
|
|
92
|
+
|
|
93
|
+
The time input value in 24-hour format.
|
|
94
|
+
|
|
95
|
+
- Required: No
|
|
96
|
+
|
|
97
|
+
#### `defaultValue`: `{ hours: number, minutes: number }`
|
|
98
|
+
|
|
99
|
+
An optional default value for the control when used in uncontrolled mode. If left `undefined`, the current time will be used.
|
|
100
|
+
|
|
101
|
+
- Required: No
|
|
102
|
+
|
|
103
|
+
#### `onChange`: `( time: { hours: number, minutes: number } ) => void`
|
|
104
|
+
|
|
105
|
+
Called when the time changes. Receives the new value as an object with `hours` and `minutes`.
|
|
106
|
+
|
|
107
|
+
- Required: No
|
|
108
|
+
|
|
109
|
+
#### `is12Hour`: `boolean`
|
|
110
|
+
|
|
111
|
+
Whether to use a 12-hour clock. With a 12-hour clock, an AM/PM widget is displayed.
|
|
112
|
+
|
|
113
|
+
- Required: No
|
|
114
|
+
|
|
115
|
+
#### `label`: `string`
|
|
116
|
+
|
|
117
|
+
The label for the time input.
|
|
118
|
+
|
|
119
|
+
- Required: No
|
|
@@ -30,7 +30,7 @@ import { TimeInput } from './time-input';
|
|
|
30
30
|
const VALID_DATE_ORDERS = [ 'dmy', 'mdy', 'ymd' ];
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* TimePicker is a React component that renders
|
|
33
|
+
* TimePicker is a React component that renders form inputs for time and date selection. It can be used independently or as part of the `DateTimePicker` component.
|
|
34
34
|
*
|
|
35
35
|
* ```jsx
|
|
36
36
|
* import { TimePicker } from '@wordpress/components';
|