@wordpress/components 29.13.1-next.719a03cbe.0 → 30.1.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 +34 -3
- package/build/autocomplete/index.js +4 -0
- package/build/autocomplete/index.js.map +1 -1
- package/build/calendar/date-calendar/index.js +13 -4
- package/build/calendar/date-calendar/index.js.map +1 -1
- package/build/calendar/date-range-calendar/index.js +8 -4
- package/build/calendar/date-range-calendar/index.js.map +1 -1
- package/build/calendar/types.js.map +1 -1
- package/build/color-picker/styles.js +7 -7
- package/build/color-picker/styles.js.map +1 -1
- package/build/icon/index.js +2 -0
- package/build/icon/index.js.map +1 -1
- package/build/index.js +0 -19
- package/build/index.js.map +1 -1
- package/build/palette-edit/index.js +1 -1
- package/build/palette-edit/index.js.map +1 -1
- package/build/private-apis.js +9 -1
- package/build/private-apis.js.map +1 -1
- package/build/range-control/index.js +1 -1
- package/build/range-control/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +35 -35
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/range-control/tooltip.js +15 -15
- package/build/range-control/tooltip.js.map +1 -1
- package/build/range-control/types.js.map +1 -1
- package/build/select-control/index.js +1 -1
- package/build/select-control/index.js.map +1 -1
- package/build/textarea-control/index.js +7 -1
- package/build/textarea-control/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build/utils/hooks/use-controlled-value.js +8 -4
- package/build/utils/hooks/use-controlled-value.js.map +1 -1
- package/build/validated-form-controls/components/checkbox-control.js +52 -0
- package/build/validated-form-controls/components/checkbox-control.js.map +1 -0
- package/build/validated-form-controls/components/combobox-control.js +64 -0
- package/build/validated-form-controls/components/combobox-control.js.map +1 -0
- package/build/validated-form-controls/components/custom-select-control.js +71 -0
- package/build/validated-form-controls/components/custom-select-control.js.map +1 -0
- package/build/validated-form-controls/components/index.js +138 -0
- package/build/validated-form-controls/components/index.js.map +1 -0
- package/build/validated-form-controls/components/input-control.js +50 -0
- package/build/validated-form-controls/components/input-control.js.map +1 -0
- package/build/validated-form-controls/components/number-control.js +53 -0
- package/build/validated-form-controls/components/number-control.js.map +1 -0
- package/build/validated-form-controls/components/radio-control.js +51 -0
- package/build/validated-form-controls/components/radio-control.js.map +1 -0
- package/build/validated-form-controls/components/range-control.js +51 -0
- package/build/validated-form-controls/components/range-control.js.map +1 -0
- package/build/validated-form-controls/components/select-control.js +53 -0
- package/build/validated-form-controls/components/select-control.js.map +1 -0
- package/build/validated-form-controls/components/text-control.js +51 -0
- package/build/validated-form-controls/components/text-control.js.map +1 -0
- package/build/validated-form-controls/components/textarea-control.js +50 -0
- package/build/validated-form-controls/components/textarea-control.js.map +1 -0
- package/build/validated-form-controls/components/toggle-control.js +60 -0
- package/build/validated-form-controls/components/toggle-control.js.map +1 -0
- package/build/validated-form-controls/components/toggle-group-control.js +69 -0
- package/build/validated-form-controls/components/toggle-group-control.js.map +1 -0
- package/build/validated-form-controls/components/types.js +6 -0
- package/build/validated-form-controls/components/types.js.map +1 -0
- package/build/validated-form-controls/control-with-error.js +137 -0
- package/build/validated-form-controls/control-with-error.js.map +1 -0
- package/build/validated-form-controls/index.js +28 -0
- package/build/validated-form-controls/index.js.map +1 -0
- package/build-module/autocomplete/index.js +4 -0
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/calendar/date-calendar/index.js +11 -3
- package/build-module/calendar/date-calendar/index.js.map +1 -1
- package/build-module/calendar/date-range-calendar/index.js +8 -4
- package/build-module/calendar/date-range-calendar/index.js.map +1 -1
- package/build-module/calendar/types.js.map +1 -1
- package/build-module/color-picker/styles.js +7 -7
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/icon/index.js +2 -0
- package/build-module/icon/index.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-module/palette-edit/index.js +2 -2
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/private-apis.js +9 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/range-control/index.js +1 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +35 -35
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/range-control/tooltip.js +15 -15
- package/build-module/range-control/tooltip.js.map +1 -1
- package/build-module/range-control/types.js.map +1 -1
- package/build-module/select-control/index.js +1 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/textarea-control/index.js +7 -1
- package/build-module/textarea-control/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-value.js +9 -5
- package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
- package/build-module/validated-form-controls/components/checkbox-control.js +44 -0
- package/build-module/validated-form-controls/components/checkbox-control.js.map +1 -0
- package/build-module/validated-form-controls/components/combobox-control.js +56 -0
- package/build-module/validated-form-controls/components/combobox-control.js.map +1 -0
- package/build-module/validated-form-controls/components/custom-select-control.js +63 -0
- package/build-module/validated-form-controls/components/custom-select-control.js.map +1 -0
- package/build-module/validated-form-controls/components/index.js +13 -0
- package/build-module/validated-form-controls/components/index.js.map +1 -0
- package/build-module/validated-form-controls/components/input-control.js +42 -0
- package/build-module/validated-form-controls/components/input-control.js.map +1 -0
- package/build-module/validated-form-controls/components/number-control.js +45 -0
- package/build-module/validated-form-controls/components/number-control.js.map +1 -0
- package/build-module/validated-form-controls/components/radio-control.js +43 -0
- package/build-module/validated-form-controls/components/radio-control.js.map +1 -0
- package/build-module/validated-form-controls/components/range-control.js +43 -0
- package/build-module/validated-form-controls/components/range-control.js.map +1 -0
- package/build-module/validated-form-controls/components/select-control.js +45 -0
- package/build-module/validated-form-controls/components/select-control.js.map +1 -0
- package/build-module/validated-form-controls/components/text-control.js +43 -0
- package/build-module/validated-form-controls/components/text-control.js.map +1 -0
- package/build-module/validated-form-controls/components/textarea-control.js +42 -0
- package/build-module/validated-form-controls/components/textarea-control.js.map +1 -0
- package/build-module/validated-form-controls/components/toggle-control.js +52 -0
- package/build-module/validated-form-controls/components/toggle-control.js.map +1 -0
- package/build-module/validated-form-controls/components/toggle-group-control.js +62 -0
- package/build-module/validated-form-controls/components/toggle-group-control.js.map +1 -0
- package/build-module/validated-form-controls/components/types.js +2 -0
- package/build-module/validated-form-controls/components/types.js.map +1 -0
- package/build-module/validated-form-controls/control-with-error.js +129 -0
- package/build-module/validated-form-controls/control-with-error.js.map +1 -0
- package/build-module/validated-form-controls/index.js +3 -0
- package/build-module/validated-form-controls/index.js.map +1 -0
- package/build-style/style-rtl.css +81 -71
- package/build-style/style.css +81 -71
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +7 -7
- package/build-types/calendar/date-calendar/index.d.ts.map +1 -1
- package/build-types/calendar/date-range-calendar/index.d.ts.map +1 -1
- package/build-types/calendar/types.d.ts +2 -2
- package/build-types/calendar/types.d.ts.map +1 -1
- package/build-types/calendar/utils/use-localization-props.d.ts +3 -3
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/constants.d.ts +2 -2
- package/build-types/dimension-control/sizes.d.ts +5 -5
- package/build-types/font-size-picker/constants.d.ts +2 -2
- package/build-types/font-size-picker/constants.d.ts.map +1 -1
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/index.d.ts +0 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/range-control/types.d.ts +2 -2
- package/build-types/range-control/types.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/text-control/stories/index.story.d.ts.map +1 -1
- package/build-types/textarea-control/index.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts +2 -2
- package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/checkbox-control.d.ts +9 -0
- package/build-types/validated-form-controls/components/checkbox-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/combobox-control.d.ts +21 -0
- package/build-types/validated-form-controls/components/combobox-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/custom-select-control.d.ts +4 -0
- package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/index.d.ts +13 -0
- package/build-types/validated-form-controls/components/index.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/input-control.d.ts +4 -0
- package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/number-control.d.ts +17 -0
- package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/radio-control.d.ts +11 -0
- package/build-types/validated-form-controls/components/radio-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/range-control.d.ts +36 -0
- package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/select-control.d.ts +9 -0
- package/build-types/validated-form-controls/components/select-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts +12 -0
- package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts +12 -0
- package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts +12 -0
- package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/input-control.story.d.ts +18 -0
- package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/number-control.story.d.ts +12 -0
- package/build-types/validated-form-controls/components/stories/number-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts +19 -0
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts +12 -0
- package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/range-control.story.d.ts +9 -0
- package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/select-control.story.d.ts +12 -0
- package/build-types/validated-form-controls/components/stories/select-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/story-utils.d.ts +9 -0
- package/build-types/validated-form-controls/components/stories/story-utils.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/text-control.story.d.ts +9 -0
- package/build-types/validated-form-controls/components/stories/text-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts +9 -0
- package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts +9 -0
- package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts +9 -0
- package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/text-control.d.ts +8 -0
- package/build-types/validated-form-controls/components/text-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/textarea-control.d.ts +7 -0
- package/build-types/validated-form-controls/components/textarea-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/toggle-control.d.ts +7 -0
- package/build-types/validated-form-controls/components/toggle-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/toggle-group-control.d.ts +15 -0
- package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/components/types.d.ts +27 -0
- package/build-types/validated-form-controls/components/types.d.ts.map +1 -0
- package/build-types/validated-form-controls/control-with-error.d.ts +36 -0
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -0
- package/build-types/validated-form-controls/index.d.ts +3 -0
- package/build-types/validated-form-controls/index.d.ts.map +1 -0
- package/package.json +19 -19
- package/src/autocomplete/index.tsx +4 -0
- package/src/calendar/date-calendar/README.md +57 -46
- package/src/calendar/date-calendar/index.tsx +22 -8
- package/src/calendar/date-range-calendar/README.md +63 -52
- package/src/calendar/date-range-calendar/index.tsx +23 -11
- package/src/calendar/types.ts +2 -2
- package/src/color-picker/styles.ts +10 -0
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +8 -8
- package/src/icon/index.tsx +2 -0
- package/src/index.ts +0 -1
- package/src/modal/style.scss +2 -2
- package/src/palette-edit/index.tsx +3 -3
- package/src/private-apis.ts +13 -0
- package/src/range-control/index.tsx +1 -1
- package/src/range-control/styles/range-control-styles.ts +3 -3
- package/src/range-control/tooltip.tsx +13 -13
- package/src/range-control/types.ts +2 -2
- package/src/select-control/index.tsx +1 -1
- package/src/style.scss +2 -2
- package/src/text-control/stories/index.story.tsx +1 -0
- package/src/text-control/style.scss +6 -1
- package/src/textarea-control/index.tsx +8 -1
- package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +3 -1
- package/src/utils/hooks/use-controlled-value.ts +16 -8
- package/src/utils/theme-variables.scss +3 -0
- package/src/validated-form-controls/components/checkbox-control.tsx +64 -0
- package/src/validated-form-controls/components/combobox-control.tsx +77 -0
- package/src/validated-form-controls/components/custom-select-control.tsx +86 -0
- package/src/validated-form-controls/components/index.ts +12 -0
- package/src/validated-form-controls/components/input-control.tsx +59 -0
- package/src/validated-form-controls/components/number-control.tsx +61 -0
- package/src/validated-form-controls/components/radio-control.tsx +60 -0
- package/src/validated-form-controls/components/range-control.tsx +60 -0
- package/src/validated-form-controls/components/select-control.tsx +75 -0
- package/src/validated-form-controls/components/stories/checkbox-control.story.tsx +57 -0
- package/src/validated-form-controls/components/stories/combobox-control.story.tsx +64 -0
- package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +64 -0
- package/src/validated-form-controls/components/stories/input-control.story.tsx +132 -0
- package/src/validated-form-controls/components/stories/number-control.story.tsx +62 -0
- package/src/validated-form-controls/components/stories/overview.mdx +52 -0
- package/src/validated-form-controls/components/stories/overview.story.tsx +100 -0
- package/src/validated-form-controls/components/stories/radio-control.story.tsx +64 -0
- package/src/validated-form-controls/components/stories/range-control.story.tsx +60 -0
- package/src/validated-form-controls/components/stories/select-control.story.tsx +60 -0
- package/src/validated-form-controls/components/stories/story-utils.tsx +46 -0
- package/src/validated-form-controls/components/stories/text-control.story.tsx +55 -0
- package/src/validated-form-controls/components/stories/textarea-control.story.tsx +52 -0
- package/src/validated-form-controls/components/stories/toggle-control.story.tsx +55 -0
- package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +66 -0
- package/src/validated-form-controls/components/text-control.tsx +60 -0
- package/src/validated-form-controls/components/textarea-control.tsx +59 -0
- package/src/validated-form-controls/components/toggle-control.tsx +69 -0
- package/src/validated-form-controls/components/toggle-group-control.tsx +82 -0
- package/src/validated-form-controls/components/types.ts +28 -0
- package/src/validated-form-controls/control-with-error.tsx +198 -0
- package/src/validated-form-controls/index.ts +2 -0
- package/src/validated-form-controls/style.scss +75 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/calendar/utils/use-controlled-value.js +0 -58
- package/build/calendar/utils/use-controlled-value.js.map +0 -1
- package/build-module/calendar/utils/use-controlled-value.js +0 -51
- package/build-module/calendar/utils/use-controlled-value.js.map +0 -1
- package/build-types/calendar/utils/use-controlled-value.d.ts +0 -27
- package/build-types/calendar/utils/use-controlled-value.d.ts.map +0 -1
- package/src/calendar/utils/use-controlled-value.ts +0 -61
- package/src/dimension-control/style.scss +0 -22
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# `DateRangeCalendar`
|
|
2
2
|
|
|
3
|
+
🔒 This component is locked as a [private API](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-private-apis/). We do not yet recommend using this outside of the Gutenberg project.
|
|
4
|
+
|
|
3
5
|
`DateRangeCalendar` is a React component that provides a customizable calendar interface for **date range** selection.
|
|
4
6
|
|
|
5
7
|
The component is built with accessibility in mind and follows ARIA best practices for calendar widgets. It provides keyboard navigation, screen reader support, and customizable labels for internationalization.
|
|
@@ -7,7 +9,7 @@ The component is built with accessibility in mind and follows ARIA best practice
|
|
|
7
9
|
## Usage example
|
|
8
10
|
|
|
9
11
|
```tsx
|
|
10
|
-
import { DateRangeCalendar } from '@
|
|
12
|
+
import { DateRangeCalendar } from '@wordpress/components';
|
|
11
13
|
|
|
12
14
|
type DateRange = {
|
|
13
15
|
from: Date | undefined;
|
|
@@ -30,16 +32,16 @@ These props are shared between both single date and date range calendar modes.
|
|
|
30
32
|
|
|
31
33
|
### `required`
|
|
32
34
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
35
|
+
- Type: `boolean`
|
|
36
|
+
- Required: No
|
|
37
|
+
- Default: `false`
|
|
36
38
|
|
|
37
39
|
Whether the selection is required. When `true`, there always needs to be a date selected.
|
|
38
40
|
|
|
39
41
|
### `selected`
|
|
40
42
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
+
- Type: `DateRange | undefined | null`
|
|
44
|
+
- Required: No
|
|
43
45
|
|
|
44
46
|
The selected date range. A `DateRange` object has the following shape:
|
|
45
47
|
|
|
@@ -52,101 +54,101 @@ The selected date range. A `DateRange` object has the following shape:
|
|
|
52
54
|
|
|
53
55
|
### `onSelect`
|
|
54
56
|
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
+
- Type: `(selected: DateRange | undefined, triggerDate: Date, modifiers: Modifiers, e: React.MouseEvent | React.KeyboardEvent) => void`
|
|
58
|
+
- Required: No
|
|
57
59
|
|
|
58
60
|
Event handler when the selection changes. The `selected` parameter will contain the new date range.
|
|
59
61
|
|
|
60
62
|
### `defaultSelected`
|
|
61
63
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
+
- Type: `DateRange`
|
|
65
|
+
- Required: No
|
|
64
66
|
|
|
65
67
|
The default selected range (for uncontrolled usage).
|
|
66
68
|
|
|
67
69
|
### `excludeDisabled`
|
|
68
70
|
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
+
- Type: `boolean`
|
|
72
|
+
- Required: No
|
|
71
73
|
|
|
72
74
|
When `true`, the range will reset when including a disabled day. This is useful to prevent users from selecting ranges that include unavailable dates.
|
|
73
75
|
|
|
74
76
|
### `min`
|
|
75
77
|
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
+
- Type: `number`
|
|
79
|
+
- Required: No
|
|
78
80
|
|
|
79
81
|
The minimum number of days to include in the range. If a user tries to select a range shorter than this, the selection will be adjusted to meet the minimum requirement.
|
|
80
82
|
|
|
81
83
|
### `max`
|
|
82
84
|
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
+
- Type: `number`
|
|
86
|
+
- Required: No
|
|
85
87
|
|
|
86
88
|
The maximum number of days to include in the range. If a user tries to select a range longer than this, the selection will be adjusted to meet the maximum requirement.
|
|
87
89
|
|
|
88
90
|
### `defaultMonth`
|
|
89
91
|
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
92
|
+
- Type: `Date`
|
|
93
|
+
- Required: No
|
|
94
|
+
- Default: Current month
|
|
93
95
|
|
|
94
96
|
The initial month to show in the calendar view (uncontrolled).
|
|
95
97
|
|
|
96
98
|
### `month`
|
|
97
99
|
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
+
- Type: `Date`
|
|
101
|
+
- Required: No
|
|
100
102
|
|
|
101
103
|
The month displayed in the calendar view (controlled). Use together with `onMonthChange` to change the month programmatically.
|
|
102
104
|
|
|
103
105
|
### `numberOfMonths`
|
|
104
106
|
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
107
|
+
- Type: `number`
|
|
108
|
+
- Required: No
|
|
109
|
+
- Default: `1`
|
|
108
110
|
|
|
109
111
|
The number of months displayed at once.
|
|
110
112
|
|
|
111
113
|
### `startMonth`
|
|
112
114
|
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
+
- Type: `Date`
|
|
116
|
+
- Required: No
|
|
115
117
|
|
|
116
118
|
The earliest month to start the month navigation.
|
|
117
119
|
|
|
118
120
|
### `endMonth`
|
|
119
121
|
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
+
- Type: `Date`
|
|
123
|
+
- Required: No
|
|
122
124
|
|
|
123
125
|
The latest month to end the month navigation.
|
|
124
126
|
|
|
125
127
|
### `autoFocus`
|
|
126
128
|
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
+
- Type: `boolean`
|
|
130
|
+
- Required: No
|
|
129
131
|
|
|
130
132
|
Focus the first selected day (if set) or today's date (if not disabled). Use this prop when you need to focus the calendar after a user action (e.g. opening the dialog with the calendar).
|
|
131
133
|
|
|
132
134
|
### `disabled`
|
|
133
135
|
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
+
- Type: `Matcher | Matcher[] | undefined`
|
|
137
|
+
- Required: No
|
|
136
138
|
|
|
137
139
|
Specify which days are disabled. Using `true` will disable all dates. See the [Matcher Types](#matcher-types) section for more details.
|
|
138
140
|
|
|
139
141
|
### `disableNavigation`
|
|
140
142
|
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
+
- Type: `boolean`
|
|
144
|
+
- Required: No
|
|
143
145
|
|
|
144
146
|
Disable the navigation buttons.
|
|
145
147
|
|
|
146
148
|
### `labels`
|
|
147
149
|
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
+
- Type: `object`
|
|
151
|
+
- Required: No
|
|
150
152
|
|
|
151
153
|
Use custom labels for internationalization. All labels are optional and have sensible defaults:
|
|
152
154
|
|
|
@@ -166,9 +168,9 @@ Use custom labels for internationalization. All labels are optional and have sen
|
|
|
166
168
|
|
|
167
169
|
### `locale`
|
|
168
170
|
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
171
|
+
- Type: `Locale`
|
|
172
|
+
- Required: No
|
|
173
|
+
- Default: `enUS` from `@date-fns/locale`
|
|
172
174
|
|
|
173
175
|
The locale object used to localize dates. Pass a locale from `@date-fns/locale` to localize the calendar.
|
|
174
176
|
|
|
@@ -176,30 +178,30 @@ The locale object used to localize dates. Pass a locale from `@date-fns/locale`
|
|
|
176
178
|
|
|
177
179
|
### `weekStartsOn`
|
|
178
180
|
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
181
|
+
- Type: `0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined`
|
|
182
|
+
- Required: No
|
|
183
|
+
- Default: Based on the `locale` prop
|
|
182
184
|
|
|
183
185
|
The index of the first day of the week (0 - Sunday). Overrides the locale's setting.
|
|
184
186
|
|
|
185
187
|
### `onMonthChange`
|
|
186
188
|
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
+
- Type: `(month: Date) => void`
|
|
190
|
+
- Required: No
|
|
189
191
|
|
|
190
192
|
Event fired when the user navigates between months.
|
|
191
193
|
|
|
192
194
|
### `timeZone`
|
|
193
195
|
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
+
- Type: `string`
|
|
197
|
+
- Required: No
|
|
196
198
|
|
|
197
199
|
The time zone (IANA or UTC offset) to use in the calendar. See [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for possible values.
|
|
198
200
|
|
|
199
201
|
When working with time zones, use the `TZDate` object exported by this package instead of the native `Date` object.
|
|
200
202
|
|
|
201
203
|
```tsx
|
|
202
|
-
import { DateRangeCalendar, TZDate } from '@
|
|
204
|
+
import { DateRangeCalendar, TZDate } from '@wordpress/components';
|
|
203
205
|
|
|
204
206
|
export function WithTimeZone() {
|
|
205
207
|
const timeZone = 'America/New_York';
|
|
@@ -207,15 +209,21 @@ export function WithTimeZone() {
|
|
|
207
209
|
from: new TZDate( 2024, 12, 10, timeZone ), // Use `TZDate` instead of `Date`
|
|
208
210
|
to: new TZDate( 2024, 12, 8, timeZone ), // Use `TZDate` instead of `Date`
|
|
209
211
|
} );
|
|
210
|
-
return
|
|
212
|
+
return (
|
|
213
|
+
<DateRangeCalendar
|
|
214
|
+
timeZone={ timeZone }
|
|
215
|
+
selected={ selected }
|
|
216
|
+
onSelect={ setSelected }
|
|
217
|
+
/>
|
|
218
|
+
);
|
|
211
219
|
}
|
|
212
220
|
```
|
|
213
221
|
|
|
214
222
|
### `role`
|
|
215
223
|
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
224
|
+
- Type: `'application' | 'dialog' | undefined`
|
|
225
|
+
- Required: No
|
|
226
|
+
- Default: `'application'`
|
|
219
227
|
|
|
220
228
|
The role attribute to add to the container element.
|
|
221
229
|
|
|
@@ -238,7 +246,10 @@ const dateMatcher: Matcher = new Date(); // Will match today's date
|
|
|
238
246
|
### Array Matcher
|
|
239
247
|
|
|
240
248
|
```typescript
|
|
241
|
-
const arrayMatcher: Matcher = [
|
|
249
|
+
const arrayMatcher: Matcher = [
|
|
250
|
+
new Date( 2019, 1, 2 ),
|
|
251
|
+
new Date( 2019, 1, 4 ),
|
|
252
|
+
]; // Will match the days in the array
|
|
242
253
|
```
|
|
243
254
|
|
|
244
255
|
### Date After Matcher
|
|
@@ -7,15 +7,19 @@ import { enUS } from 'react-day-picker/locale';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import { useMemo, useState } from '@wordpress/element';
|
|
10
|
+
import { useMemo, useState, useCallback } from '@wordpress/element';
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
import { COMMON_PROPS, MODIFIER_CLASSNAMES } from '../utils/constants';
|
|
15
15
|
import { clampNumberOfMonths } from '../utils/misc';
|
|
16
|
-
import { useControlledValue } from '
|
|
16
|
+
import { useControlledValue } from '../../utils/hooks';
|
|
17
17
|
import { useLocalizationProps } from '../utils/use-localization-props';
|
|
18
|
-
import type {
|
|
18
|
+
import type {
|
|
19
|
+
DateRangeCalendarProps,
|
|
20
|
+
DateRange,
|
|
21
|
+
OnSelectHandler,
|
|
22
|
+
} from '../types';
|
|
19
23
|
|
|
20
24
|
export function usePreviewRange( {
|
|
21
25
|
selected,
|
|
@@ -151,13 +155,21 @@ export const DateRangeCalendar = ( {
|
|
|
151
155
|
mode: 'range',
|
|
152
156
|
} );
|
|
153
157
|
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
const onChange: OnSelectHandler< typeof selectedProp > = useCallback(
|
|
159
|
+
( selected, triggerDate, modifiers, e ) => {
|
|
160
|
+
// Convert internal `null` to `undefined` for the public event handler.
|
|
161
|
+
onSelect?.( selected ?? undefined, triggerDate, modifiers, e );
|
|
162
|
+
},
|
|
163
|
+
[ onSelect ]
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
const [ selected, setSelected ] = useControlledValue< typeof selectedProp >(
|
|
167
|
+
{
|
|
168
|
+
defaultValue: defaultSelected,
|
|
169
|
+
value: selectedProp,
|
|
170
|
+
onChange,
|
|
171
|
+
}
|
|
172
|
+
);
|
|
161
173
|
|
|
162
174
|
const [ hoveredDate, setHoveredDate ] = useState< Date | undefined >(
|
|
163
175
|
undefined
|
|
@@ -192,7 +204,7 @@ export const DateRangeCalendar = ( {
|
|
|
192
204
|
excludeDisabled={ excludeDisabled }
|
|
193
205
|
min={ min }
|
|
194
206
|
max={ max }
|
|
195
|
-
selected={ selected }
|
|
207
|
+
selected={ selected ?? undefined }
|
|
196
208
|
onSelect={ setSelected }
|
|
197
209
|
onDayMouseEnter={ ( date ) => setHoveredDate( date ) }
|
|
198
210
|
onDayMouseLeave={ () => setHoveredDate( undefined ) }
|
package/src/calendar/types.ts
CHANGED
|
@@ -153,7 +153,7 @@ type DayOfWeek = {
|
|
|
153
153
|
* @param {Modifiers} modifiers - The modifiers associated with the event.
|
|
154
154
|
* @param {React.MouseEvent | React.KeyboardEvent} e - The event object.
|
|
155
155
|
*/
|
|
156
|
-
type OnSelectHandler< T > = (
|
|
156
|
+
export type OnSelectHandler< T > = (
|
|
157
157
|
selected: T,
|
|
158
158
|
triggerDate: Date,
|
|
159
159
|
modifiers: Modifiers,
|
|
@@ -284,7 +284,7 @@ export interface BaseProps
|
|
|
284
284
|
* When working with time zones, use the `TZDate` object exported by this
|
|
285
285
|
* package instead of the native `Date` object.
|
|
286
286
|
* @example
|
|
287
|
-
* import { DateCalendar, TZDate } from "@
|
|
287
|
+
* import { DateCalendar, TZDate } from "@wordpress/components";
|
|
288
288
|
*
|
|
289
289
|
* export function WithTimeZone() {
|
|
290
290
|
* const timeZone = "America/New_York";
|
|
@@ -91,6 +91,16 @@ export const ColorfulWrapper = styled.div`
|
|
|
91
91
|
|
|
92
92
|
// Shown instead of box-shadow to Windows high contrast mode.
|
|
93
93
|
outline: 2px solid transparent;
|
|
94
|
+
|
|
95
|
+
@media not ( prefers-reduced-motion ) {
|
|
96
|
+
transition: transform ${ CONFIG.transitionDurationFast } ease-in-out;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.react-colorful__interactive:focus .react-colorful__pointer {
|
|
101
|
+
box-shadow: 0 0 0 ${ CONFIG.borderWidthFocus } ${ CONFIG.surfaceColor };
|
|
102
|
+
border: ${ CONFIG.borderWidthFocus } solid black;
|
|
103
|
+
transform: translate( -50%, -50% ) scale( 1.5 );
|
|
94
104
|
}
|
|
95
105
|
|
|
96
106
|
.react-colorful__pointer-fill {
|
|
@@ -193,13 +193,13 @@ exports[`DimensionControl rendering renders with custom sizes 1`] = `
|
|
|
193
193
|
|
|
194
194
|
<div>
|
|
195
195
|
<div
|
|
196
|
-
class="components-base-control emotion-0 emotion-1"
|
|
196
|
+
class="components-base-control components-select-control block-editor-dimension-control emotion-0 emotion-1"
|
|
197
197
|
>
|
|
198
198
|
<div
|
|
199
199
|
class="components-base-control__field emotion-2 emotion-3"
|
|
200
200
|
>
|
|
201
201
|
<div
|
|
202
|
-
class="components-flex components-input-base
|
|
202
|
+
class="components-flex components-input-base emotion-4 emotion-5 emotion-6 emotion-7"
|
|
203
203
|
data-wp-c16t="true"
|
|
204
204
|
data-wp-component="InputBase"
|
|
205
205
|
>
|
|
@@ -475,13 +475,13 @@ exports[`DimensionControl rendering renders with defaults 1`] = `
|
|
|
475
475
|
|
|
476
476
|
<div>
|
|
477
477
|
<div
|
|
478
|
-
class="components-base-control emotion-0 emotion-1"
|
|
478
|
+
class="components-base-control components-select-control block-editor-dimension-control emotion-0 emotion-1"
|
|
479
479
|
>
|
|
480
480
|
<div
|
|
481
481
|
class="components-base-control__field emotion-2 emotion-3"
|
|
482
482
|
>
|
|
483
483
|
<div
|
|
484
|
-
class="components-flex components-input-base
|
|
484
|
+
class="components-flex components-input-base emotion-4 emotion-5 emotion-6 emotion-7"
|
|
485
485
|
data-wp-c16t="true"
|
|
486
486
|
data-wp-component="InputBase"
|
|
487
487
|
>
|
|
@@ -767,13 +767,13 @@ exports[`DimensionControl rendering renders with icon and custom icon label 1`]
|
|
|
767
767
|
|
|
768
768
|
<div>
|
|
769
769
|
<div
|
|
770
|
-
class="components-base-control emotion-0 emotion-1"
|
|
770
|
+
class="components-base-control components-select-control block-editor-dimension-control emotion-0 emotion-1"
|
|
771
771
|
>
|
|
772
772
|
<div
|
|
773
773
|
class="components-base-control__field emotion-2 emotion-3"
|
|
774
774
|
>
|
|
775
775
|
<div
|
|
776
|
-
class="components-flex components-input-base
|
|
776
|
+
class="components-flex components-input-base emotion-4 emotion-5 emotion-6 emotion-7"
|
|
777
777
|
data-wp-c16t="true"
|
|
778
778
|
data-wp-component="InputBase"
|
|
779
779
|
>
|
|
@@ -1071,13 +1071,13 @@ exports[`DimensionControl rendering renders with icon and default icon label 1`]
|
|
|
1071
1071
|
|
|
1072
1072
|
<div>
|
|
1073
1073
|
<div
|
|
1074
|
-
class="components-base-control emotion-0 emotion-1"
|
|
1074
|
+
class="components-base-control components-select-control block-editor-dimension-control emotion-0 emotion-1"
|
|
1075
1075
|
>
|
|
1076
1076
|
<div
|
|
1077
1077
|
class="components-base-control__field emotion-2 emotion-3"
|
|
1078
1078
|
>
|
|
1079
1079
|
<div
|
|
1080
|
-
class="components-flex components-input-base
|
|
1080
|
+
class="components-flex components-input-base emotion-4 emotion-5 emotion-6 emotion-7"
|
|
1081
1081
|
data-wp-c16t="true"
|
|
1082
1082
|
data-wp-component="InputBase"
|
|
1083
1083
|
>
|
package/src/icon/index.tsx
CHANGED
package/src/index.ts
CHANGED
|
@@ -57,7 +57,6 @@ export {
|
|
|
57
57
|
CardHeader,
|
|
58
58
|
CardMedia,
|
|
59
59
|
} from './card';
|
|
60
|
-
export { DateCalendar, DateRangeCalendar, TZDate } from './calendar';
|
|
61
60
|
export { default as CheckboxControl } from './checkbox-control';
|
|
62
61
|
export { default as ClipboardButton } from './clipboard-button';
|
|
63
62
|
export { default as __experimentalPaletteEdit } from './palette-edit';
|
package/src/modal/style.scss
CHANGED
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
flex-direction: row;
|
|
129
129
|
justify-content: space-between;
|
|
130
130
|
align-items: center;
|
|
131
|
-
height: $header-height + $grid-unit-
|
|
131
|
+
height: $header-height + $grid-unit-10; // 72px
|
|
132
132
|
width: 100%;
|
|
133
133
|
z-index: z-index(".components-modal__header");
|
|
134
134
|
position: absolute;
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
// Modal contents.
|
|
176
176
|
.components-modal__content {
|
|
177
177
|
flex: 1;
|
|
178
|
-
margin-top: $header-height + $grid-unit-
|
|
178
|
+
margin-top: $header-height + $grid-unit-10;
|
|
179
179
|
// Small top padding required to avoid cutting off the visible outline when the first child element is focusable.
|
|
180
180
|
padding: $grid-unit-05 $grid-unit-40 $grid-unit-40;
|
|
181
181
|
overflow: auto;
|
|
@@ -22,7 +22,7 @@ import { useDebounce } from '@wordpress/compose';
|
|
|
22
22
|
*/
|
|
23
23
|
import Button from '../button';
|
|
24
24
|
import { ColorPicker } from '../color-picker';
|
|
25
|
-
import { FlexItem } from '../flex';
|
|
25
|
+
import { FlexBlock, FlexItem } from '../flex';
|
|
26
26
|
import { HStack } from '../h-stack';
|
|
27
27
|
import { Item, ItemGroup } from '../item-group';
|
|
28
28
|
import { VStack } from '../v-stack';
|
|
@@ -229,7 +229,7 @@ function Option< T extends PaletteElement >( {
|
|
|
229
229
|
>
|
|
230
230
|
<IndicatorStyled colorValue={ value } />
|
|
231
231
|
</Button>
|
|
232
|
-
<
|
|
232
|
+
<FlexBlock>
|
|
233
233
|
{ ! canOnlyChangeValues ? (
|
|
234
234
|
<NameInput
|
|
235
235
|
label={
|
|
@@ -256,7 +256,7 @@ function Option< T extends PaletteElement >( {
|
|
|
256
256
|
'\u00A0' }
|
|
257
257
|
</NameContainer>
|
|
258
258
|
) }
|
|
259
|
-
</
|
|
259
|
+
</FlexBlock>
|
|
260
260
|
{ ! canOnlyChangeValues && (
|
|
261
261
|
<FlexItem>
|
|
262
262
|
<RemoveButton
|
package/src/private-apis.ts
CHANGED
|
@@ -11,6 +11,13 @@ import { withIgnoreIMEEvents } from './utils/with-ignore-ime-events';
|
|
|
11
11
|
import { lock } from './lock-unlock';
|
|
12
12
|
import Badge from './badge';
|
|
13
13
|
|
|
14
|
+
import { DateCalendar, DateRangeCalendar, TZDate } from './calendar';
|
|
15
|
+
import {
|
|
16
|
+
ValidatedNumberControl,
|
|
17
|
+
ValidatedTextControl,
|
|
18
|
+
ValidatedToggleControl,
|
|
19
|
+
} from './validated-form-controls';
|
|
20
|
+
|
|
14
21
|
export const privateApis = {};
|
|
15
22
|
lock( privateApis, {
|
|
16
23
|
__experimentalPopoverLegacyPositionToPlacement,
|
|
@@ -22,4 +29,10 @@ lock( privateApis, {
|
|
|
22
29
|
withIgnoreIMEEvents,
|
|
23
30
|
Badge,
|
|
24
31
|
normalizeTextString,
|
|
32
|
+
DateCalendar,
|
|
33
|
+
DateRangeCalendar,
|
|
34
|
+
TZDate,
|
|
35
|
+
ValidatedNumberControl,
|
|
36
|
+
ValidatedTextControl,
|
|
37
|
+
ValidatedToggleControl,
|
|
25
38
|
} );
|
|
@@ -314,7 +314,7 @@ function UnforwardedRangeControl(
|
|
|
314
314
|
<SimpleTooltip
|
|
315
315
|
className="components-range-control__tooltip"
|
|
316
316
|
inputRef={ inputRef }
|
|
317
|
-
|
|
317
|
+
tooltipPlacement="bottom"
|
|
318
318
|
renderTooltipContent={ renderTooltipContent }
|
|
319
319
|
show={ isCurrentlyFocused || showTooltip }
|
|
320
320
|
style={ offsetStyle }
|
|
@@ -283,8 +283,8 @@ const tooltipShow = ( { show }: TooltipProps ) => {
|
|
|
283
283
|
`;
|
|
284
284
|
};
|
|
285
285
|
|
|
286
|
-
const
|
|
287
|
-
const isBottom =
|
|
286
|
+
const tooltipPlacement = ( { placement }: TooltipProps ) => {
|
|
287
|
+
const isBottom = placement === 'bottom';
|
|
288
288
|
|
|
289
289
|
if ( isBottom ) {
|
|
290
290
|
return css`
|
|
@@ -312,7 +312,7 @@ export const Tooltip = styled.span< TooltipProps >`
|
|
|
312
312
|
|
|
313
313
|
${ tooltipShow };
|
|
314
314
|
|
|
315
|
-
${
|
|
315
|
+
${ tooltipPlacement };
|
|
316
316
|
${ rtl(
|
|
317
317
|
{ transform: 'translateX(-50%)' },
|
|
318
318
|
{ transform: 'translateX(50%)' }
|
|
@@ -22,7 +22,7 @@ export default function SimpleTooltip(
|
|
|
22
22
|
const {
|
|
23
23
|
className,
|
|
24
24
|
inputRef,
|
|
25
|
-
|
|
25
|
+
tooltipPlacement,
|
|
26
26
|
show = false,
|
|
27
27
|
style = {},
|
|
28
28
|
value = 0,
|
|
@@ -30,7 +30,7 @@ export default function SimpleTooltip(
|
|
|
30
30
|
zIndex = 100,
|
|
31
31
|
...restProps
|
|
32
32
|
} = props;
|
|
33
|
-
const
|
|
33
|
+
const placement = useTooltipPlacement( { inputRef, tooltipPlacement } );
|
|
34
34
|
const classes = clsx( 'components-simple-tooltip', className );
|
|
35
35
|
const styles = {
|
|
36
36
|
...style,
|
|
@@ -42,7 +42,7 @@ export default function SimpleTooltip(
|
|
|
42
42
|
{ ...restProps }
|
|
43
43
|
aria-hidden="false"
|
|
44
44
|
className={ classes }
|
|
45
|
-
|
|
45
|
+
placement={ placement }
|
|
46
46
|
show={ show }
|
|
47
47
|
role="tooltip"
|
|
48
48
|
style={ styles }
|
|
@@ -52,26 +52,26 @@ export default function SimpleTooltip(
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
function
|
|
56
|
-
const [
|
|
55
|
+
function useTooltipPlacement( { inputRef, tooltipPlacement }: TooltipProps ) {
|
|
56
|
+
const [ placement, setPlacement ] = useState< string >();
|
|
57
57
|
|
|
58
|
-
const
|
|
58
|
+
const setTooltipPlacement = useCallback( () => {
|
|
59
59
|
if ( inputRef && inputRef.current ) {
|
|
60
|
-
|
|
60
|
+
setPlacement( tooltipPlacement );
|
|
61
61
|
}
|
|
62
|
-
}, [
|
|
62
|
+
}, [ tooltipPlacement, inputRef ] );
|
|
63
63
|
|
|
64
64
|
useEffect( () => {
|
|
65
|
-
|
|
66
|
-
}, [
|
|
65
|
+
setTooltipPlacement();
|
|
66
|
+
}, [ setTooltipPlacement ] );
|
|
67
67
|
|
|
68
68
|
useEffect( () => {
|
|
69
|
-
window.addEventListener( 'resize',
|
|
69
|
+
window.addEventListener( 'resize', setTooltipPlacement );
|
|
70
70
|
|
|
71
71
|
return () => {
|
|
72
|
-
window.removeEventListener( 'resize',
|
|
72
|
+
window.removeEventListener( 'resize', setTooltipPlacement );
|
|
73
73
|
};
|
|
74
74
|
} );
|
|
75
75
|
|
|
76
|
-
return
|
|
76
|
+
return placement;
|
|
77
77
|
}
|
|
@@ -269,9 +269,9 @@ export type ThumbProps = {
|
|
|
269
269
|
|
|
270
270
|
export type TooltipProps = {
|
|
271
271
|
show?: boolean;
|
|
272
|
-
|
|
272
|
+
placement?: string;
|
|
273
273
|
inputRef?: MutableRefObject< HTMLElement | undefined >;
|
|
274
|
-
|
|
274
|
+
tooltipPlacement?: string;
|
|
275
275
|
value?: ControlledRangeValue;
|
|
276
276
|
renderTooltipContent?: (
|
|
277
277
|
value?: ControlledRangeValue
|
|
@@ -107,11 +107,11 @@ function UnforwardedSelectControl< V extends string >(
|
|
|
107
107
|
<BaseControl
|
|
108
108
|
help={ help }
|
|
109
109
|
id={ id }
|
|
110
|
+
className={ classes }
|
|
110
111
|
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
111
112
|
__associatedWPComponentName="SelectControl"
|
|
112
113
|
>
|
|
113
114
|
<StyledInputBase
|
|
114
|
-
className={ classes }
|
|
115
115
|
disabled={ disabled }
|
|
116
116
|
hideLabelFromVision={ hideLabelFromVision }
|
|
117
117
|
id={ id }
|
package/src/style.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Include the default WP Components color variables.
|
|
2
2
|
// TODO: Remove this once all admin-scheme variables are accounted for in the wp-components fallback values.
|
|
3
3
|
:root {
|
|
4
|
-
@include admin-scheme(#3858e9);
|
|
4
|
+
@include admin-scheme( #3858e9 );
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
// Variables
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
@import "./combobox-control/style.scss";
|
|
22
22
|
@import "./color-palette/style.scss";
|
|
23
23
|
@import "./custom-gradient-picker/style.scss";
|
|
24
|
-
@import "./dimension-control/style.scss";
|
|
25
24
|
@import "./draggable/style.scss";
|
|
26
25
|
@import "./drop-zone/style.scss";
|
|
27
26
|
@import "./dropdown/style.scss";
|
|
@@ -56,3 +55,4 @@
|
|
|
56
55
|
@import "./toolbar/toolbar-button/style.scss";
|
|
57
56
|
@import "./toolbar/toolbar-group/style.scss";
|
|
58
57
|
@import "./tooltip/style.scss";
|
|
58
|
+
@import "./validated-form-controls/style.scss";
|
|
@@ -56,6 +56,7 @@ export const Default: StoryFn< typeof TextControl > = DefaultTemplate.bind(
|
|
|
56
56
|
Default.args = {
|
|
57
57
|
__nextHasNoMarginBottom: true,
|
|
58
58
|
__next40pxDefaultSize: true,
|
|
59
|
+
placeholder: 'Placeholder',
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
export const WithLabelAndHelpText: StoryFn< typeof TextControl > =
|