@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
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { error } from '@wordpress/icons';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* External dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { cloneElement, forwardRef, useEffect, useState } from '@wordpress/element';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';
|
|
16
|
+
import Icon from '../icon';
|
|
17
|
+
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
function appendRequiredIndicator(label, required, markWhenOptional) {
|
|
19
|
+
if (required && !markWhenOptional) {
|
|
20
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
21
|
+
children: [label, " ", `(${__('Required')})`]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
if (!required && markWhenOptional) {
|
|
25
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
26
|
+
children: [label, " ", `(${__('Optional')})`]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return label;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* HTML elements that support the Constraint Validation API.
|
|
34
|
+
*
|
|
35
|
+
* Here, we exclude HTMLButtonElement because although it does technically support the API,
|
|
36
|
+
* normal buttons are actually exempted from any validation.
|
|
37
|
+
* @see https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation
|
|
38
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/willValidate
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
function UnforwardedControlWithError({
|
|
42
|
+
required,
|
|
43
|
+
markWhenOptional,
|
|
44
|
+
customValidator,
|
|
45
|
+
getValidityTarget,
|
|
46
|
+
children
|
|
47
|
+
}, forwardedRef) {
|
|
48
|
+
const [errorMessage, setErrorMessage] = useState();
|
|
49
|
+
const [isTouched, setIsTouched] = useState(false);
|
|
50
|
+
|
|
51
|
+
// Ensure that error messages are visible after user attemps to submit a form
|
|
52
|
+
// with multiple invalid fields.
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const validityTarget = getValidityTarget();
|
|
55
|
+
const showValidationMessage = () => setErrorMessage(validityTarget?.validationMessage);
|
|
56
|
+
validityTarget?.addEventListener('invalid', showValidationMessage);
|
|
57
|
+
return () => {
|
|
58
|
+
validityTarget?.removeEventListener('invalid', showValidationMessage);
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
const validate = () => {
|
|
62
|
+
const message = customValidator?.();
|
|
63
|
+
const validityTarget = getValidityTarget();
|
|
64
|
+
validityTarget?.setCustomValidity(message !== null && message !== void 0 ? message : '');
|
|
65
|
+
setErrorMessage(validityTarget?.validationMessage);
|
|
66
|
+
};
|
|
67
|
+
const onBlur = event => {
|
|
68
|
+
// Only consider "blurred from the component" if focus has fully left the wrapping div.
|
|
69
|
+
// This prevents unnecessary blurs from components with multiple focusable elements.
|
|
70
|
+
if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
|
|
71
|
+
setIsTouched(true);
|
|
72
|
+
const validityTarget = getValidityTarget();
|
|
73
|
+
|
|
74
|
+
// Prevents a double flash of the native error tooltip when the control is already showing one.
|
|
75
|
+
if (!validityTarget?.validity.valid) {
|
|
76
|
+
if (!errorMessage) {
|
|
77
|
+
setErrorMessage(validityTarget?.validationMessage);
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
validate();
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const onChange = (...args) => {
|
|
85
|
+
children.props.onChange?.(...args);
|
|
86
|
+
|
|
87
|
+
// Only validate incrementally if the field has blurred at least once,
|
|
88
|
+
// or currently has an error message.
|
|
89
|
+
if (isTouched || errorMessage) {
|
|
90
|
+
validate();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const onKeyDown = event => {
|
|
94
|
+
// Ensures that custom validators are triggered when the user submits by pressing Enter,
|
|
95
|
+
// without ever blurring the control.
|
|
96
|
+
if (event.key === 'Enter') {
|
|
97
|
+
validate();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return (
|
|
101
|
+
/*#__PURE__*/
|
|
102
|
+
// Disable reason: Just listening to a bubbled event, not for interaction.
|
|
103
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
104
|
+
_jsxs("div", {
|
|
105
|
+
className: "components-validated-control",
|
|
106
|
+
ref: forwardedRef,
|
|
107
|
+
onBlur: onBlur,
|
|
108
|
+
onKeyDown: withIgnoreIMEEvents(onKeyDown),
|
|
109
|
+
children: [cloneElement(children, {
|
|
110
|
+
label: appendRequiredIndicator(children.props.label, required, markWhenOptional),
|
|
111
|
+
onChange,
|
|
112
|
+
required
|
|
113
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
114
|
+
"aria-live": "polite",
|
|
115
|
+
children: errorMessage && /*#__PURE__*/_jsxs("p", {
|
|
116
|
+
className: "components-validated-control__error",
|
|
117
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
118
|
+
className: "components-validated-control__error-icon",
|
|
119
|
+
icon: error,
|
|
120
|
+
size: 16,
|
|
121
|
+
fill: "currentColor"
|
|
122
|
+
}), errorMessage]
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
125
|
+
})
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
export const ControlWithError = forwardRef(UnforwardedControlWithError);
|
|
129
|
+
//# sourceMappingURL=control-with-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","error","cloneElement","forwardRef","useEffect","useState","withIgnoreIMEEvents","Icon","Fragment","_Fragment","jsxs","_jsxs","jsx","_jsx","appendRequiredIndicator","label","required","markWhenOptional","children","UnforwardedControlWithError","customValidator","getValidityTarget","forwardedRef","errorMessage","setErrorMessage","isTouched","setIsTouched","validityTarget","showValidationMessage","validationMessage","addEventListener","removeEventListener","validate","message","setCustomValidity","onBlur","event","relatedTarget","currentTarget","contains","validity","valid","onChange","args","props","onKeyDown","key","className","ref","icon","size","fill","ControlWithError"],"sources":["@wordpress/components/src/validated-form-controls/control-with-error.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { error } from '@wordpress/icons';\n\n/**\n * External dependencies\n */\nimport {\n\tcloneElement,\n\tforwardRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\n\nimport Icon from '../icon';\n\nfunction appendRequiredIndicator(\n\tlabel: React.ReactNode,\n\trequired: boolean | undefined,\n\tmarkWhenOptional: boolean | undefined\n) {\n\tif ( required && ! markWhenOptional ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ label } { `(${ __( 'Required' ) })` }\n\t\t\t</>\n\t\t);\n\t}\n\tif ( ! required && markWhenOptional ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ label } { `(${ __( 'Optional' ) })` }\n\t\t\t</>\n\t\t);\n\t}\n\treturn label;\n}\n\n/**\n * HTML elements that support the Constraint Validation API.\n *\n * Here, we exclude HTMLButtonElement because although it does technically support the API,\n * normal buttons are actually exempted from any validation.\n * @see https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/willValidate\n */\ntype ValidityTarget =\n\t| HTMLFieldSetElement\n\t| HTMLInputElement\n\t| HTMLSelectElement\n\t| HTMLTextAreaElement;\n\nfunction UnforwardedControlWithError< C extends React.ReactElement >(\n\t{\n\t\trequired,\n\t\tmarkWhenOptional,\n\t\tcustomValidator,\n\t\tgetValidityTarget,\n\t\tchildren,\n\t}: {\n\t\t/**\n\t\t * Whether the control is required.\n\t\t */\n\t\trequired?: boolean;\n\t\t/**\n\t\t * Label the control as \"optional\" when _not_ `required`, instead of the inverse.\n\t\t */\n\t\tmarkWhenOptional?: boolean;\n\t\t/**\n\t\t * A function that returns a custom validity message when applicable.\n\t\t *\n\t\t * This message will be applied to the element returned by `getValidityTarget`.\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity\n\t\t */\n\t\tcustomValidator?: () => string | void;\n\t\t/**\n\t\t * A function that returns the actual element on which the validity data should be applied.\n\t\t */\n\t\tgetValidityTarget: () => ValidityTarget | null | undefined;\n\t\t/**\n\t\t * The control component to apply validation to.\n\t\t */\n\t\tchildren: C;\n\t},\n\tforwardedRef: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst [ errorMessage, setErrorMessage ] = useState< string | undefined >();\n\tconst [ isTouched, setIsTouched ] = useState( false );\n\n\t// Ensure that error messages are visible after user attemps to submit a form\n\t// with multiple invalid fields.\n\tuseEffect( () => {\n\t\tconst validityTarget = getValidityTarget();\n\t\tconst showValidationMessage = () =>\n\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\n\t\tvalidityTarget?.addEventListener( 'invalid', showValidationMessage );\n\n\t\treturn () => {\n\t\t\tvalidityTarget?.removeEventListener(\n\t\t\t\t'invalid',\n\t\t\t\tshowValidationMessage\n\t\t\t);\n\t\t};\n\t} );\n\n\tconst validate = () => {\n\t\tconst message = customValidator?.();\n\t\tconst validityTarget = getValidityTarget();\n\n\t\tvalidityTarget?.setCustomValidity( message ?? '' );\n\t\tsetErrorMessage( validityTarget?.validationMessage );\n\t};\n\n\tconst onBlur = ( event: React.FocusEvent< HTMLDivElement > ) => {\n\t\t// Only consider \"blurred from the component\" if focus has fully left the wrapping div.\n\t\t// This prevents unnecessary blurs from components with multiple focusable elements.\n\t\tif (\n\t\t\t! event.relatedTarget ||\n\t\t\t! event.currentTarget.contains( event.relatedTarget )\n\t\t) {\n\t\t\tsetIsTouched( true );\n\n\t\t\tconst validityTarget = getValidityTarget();\n\n\t\t\t// Prevents a double flash of the native error tooltip when the control is already showing one.\n\t\t\tif ( ! validityTarget?.validity.valid ) {\n\t\t\t\tif ( ! errorMessage ) {\n\t\t\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvalidate();\n\t\t}\n\t};\n\n\tconst onChange = ( ...args: unknown[] ) => {\n\t\tchildren.props.onChange?.( ...args );\n\n\t\t// Only validate incrementally if the field has blurred at least once,\n\t\t// or currently has an error message.\n\t\tif ( isTouched || errorMessage ) {\n\t\t\tvalidate();\n\t\t}\n\t};\n\n\tconst onKeyDown = ( event: React.KeyboardEvent< HTMLDivElement > ) => {\n\t\t// Ensures that custom validators are triggered when the user submits by pressing Enter,\n\t\t// without ever blurring the control.\n\t\tif ( event.key === 'Enter' ) {\n\t\t\tvalidate();\n\t\t}\n\t};\n\n\treturn (\n\t\t// Disable reason: Just listening to a bubbled event, not for interaction.\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"components-validated-control\"\n\t\t\tref={ forwardedRef }\n\t\t\tonBlur={ onBlur }\n\t\t\tonKeyDown={ withIgnoreIMEEvents( onKeyDown ) }\n\t\t>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tlabel: appendRequiredIndicator(\n\t\t\t\t\tchildren.props.label,\n\t\t\t\t\trequired,\n\t\t\t\t\tmarkWhenOptional\n\t\t\t\t),\n\t\t\t\tonChange,\n\t\t\t\trequired,\n\t\t\t} ) }\n\t\t\t<div aria-live=\"polite\">\n\t\t\t\t{ errorMessage && (\n\t\t\t\t\t<p className=\"components-validated-control__error\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-validated-control__error-icon\"\n\t\t\t\t\t\t\ticon={ error }\n\t\t\t\t\t\t\tsize={ 16 }\n\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ errorMessage }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport const ControlWithError = forwardRef( UnforwardedControlWithError );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,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,CAAC;IACX;EACD,CAAC;EAED;IAAA;IACC;IACA;IACArB,KAAA;MACCoC,SAAS,EAAC,8BAA8B;MACxCC,GAAG,EAAG1B,YAAc;MACpBa,MAAM,EAAGA,MAAQ;MACjBU,SAAS,EAAGvC,mBAAmB,CAAEuC,SAAU,CAAG;MAAA3B,QAAA,GAE5ChB,YAAY,CAAEgB,QAAQ,EAAE;QACzBH,KAAK,EAAED,uBAAuB,CAC7BI,QAAQ,CAAC0B,KAAK,CAAC7B,KAAK,EACpBC,QAAQ,EACRC,gBACD,CAAC;QACDyB,QAAQ;QACR1B;MACD,CAAE,CAAC,eACHH,IAAA;QAAK,aAAU,QAAQ;QAAAK,QAAA,EACpBK,YAAY,iBACbZ,KAAA;UAAGoC,SAAS,EAAC,qCAAqC;UAAA7B,QAAA,gBACjDL,IAAA,CAACN,IAAI;YACJwC,SAAS,EAAC,0CAA0C;YACpDE,IAAI,EAAGhD,KAAO;YACdiD,IAAI,EAAG,EAAI;YACXC,IAAI,EAAC;UAAc,CACnB,CAAC,EACA5B,YAAY;QAAA,CACZ;MACH,CACG,CAAC;IAAA,CACF;EAAC;AAER;AAEA,OAAO,MAAM6B,gBAAgB,GAAGjD,UAAU,CAAEgB,2BAA4B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/validated-form-controls/index.ts"],"sourcesContent":["export * from './components';\nexport * from './control-with-error';\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,sBAAsB","ignoreList":[]}
|
|
@@ -1484,23 +1484,6 @@ input.components-combobox-control__input[type=text]:focus {
|
|
|
1484
1484
|
z-index: 0;
|
|
1485
1485
|
}
|
|
1486
1486
|
|
|
1487
|
-
.block-editor-dimension-control .components-base-control__field {
|
|
1488
|
-
display: flex;
|
|
1489
|
-
align-items: center;
|
|
1490
|
-
}
|
|
1491
|
-
.block-editor-dimension-control .components-base-control__label {
|
|
1492
|
-
display: flex;
|
|
1493
|
-
align-items: center;
|
|
1494
|
-
margin-left: 1em;
|
|
1495
|
-
margin-bottom: 0;
|
|
1496
|
-
}
|
|
1497
|
-
.block-editor-dimension-control .components-base-control__label .dashicon {
|
|
1498
|
-
margin-left: 0.5em;
|
|
1499
|
-
}
|
|
1500
|
-
.block-editor-dimension-control.is-manual .components-base-control__label {
|
|
1501
|
-
width: 10em;
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
1487
|
body.is-dragging-components-draggable {
|
|
1505
1488
|
cursor: move; /* Fallback for IE/Edge < 14 */
|
|
1506
1489
|
cursor: grabbing !important;
|
|
@@ -2035,7 +2018,7 @@ body.is-dragging-components-draggable {
|
|
|
2035
2018
|
border-bottom: none;
|
|
2036
2019
|
padding: 0;
|
|
2037
2020
|
position: sticky;
|
|
2038
|
-
height:
|
|
2021
|
+
height: 64px;
|
|
2039
2022
|
}
|
|
2040
2023
|
.components-guide .components-modal__header .components-button {
|
|
2041
2024
|
align-self: flex-start;
|
|
@@ -2049,7 +2032,7 @@ body.is-dragging-components-draggable {
|
|
|
2049
2032
|
display: flex;
|
|
2050
2033
|
flex-direction: column;
|
|
2051
2034
|
justify-content: space-between;
|
|
2052
|
-
margin-top: -
|
|
2035
|
+
margin-top: -64px;
|
|
2053
2036
|
min-height: 100%;
|
|
2054
2037
|
}
|
|
2055
2038
|
.components-guide .components-guide__page {
|
|
@@ -2346,7 +2329,7 @@ body.is-dragging-components-draggable {
|
|
|
2346
2329
|
width: auto;
|
|
2347
2330
|
min-width: 350px;
|
|
2348
2331
|
max-width: calc(100% - 32px);
|
|
2349
|
-
max-height: calc(100% -
|
|
2332
|
+
max-height: calc(100% - 128px);
|
|
2350
2333
|
}
|
|
2351
2334
|
}
|
|
2352
2335
|
@media (min-width: 600px) and (min-width: 600px) {
|
|
@@ -2851,8 +2834,7 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2851
2834
|
display: flex;
|
|
2852
2835
|
box-shadow: none;
|
|
2853
2836
|
border-radius: 0;
|
|
2854
|
-
|
|
2855
|
-
backdrop-filter: blur(100px);
|
|
2837
|
+
backdrop-filter: blur(100px);
|
|
2856
2838
|
background-color: transparent;
|
|
2857
2839
|
backface-visibility: hidden;
|
|
2858
2840
|
overflow: hidden;
|
|
@@ -3338,8 +3320,7 @@ body.lockscroll {
|
|
|
3338
3320
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
3339
3321
|
font-size: 13px;
|
|
3340
3322
|
background: rgba(0, 0, 0, 0.85);
|
|
3341
|
-
|
|
3342
|
-
backdrop-filter: blur(16px) saturate(180%);
|
|
3323
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
3343
3324
|
border-radius: 4px;
|
|
3344
3325
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02);
|
|
3345
3326
|
color: #fff;
|
|
@@ -3518,6 +3499,7 @@ body.lockscroll {
|
|
|
3518
3499
|
box-shadow: 0 0 0 transparent;
|
|
3519
3500
|
border-radius: 2px;
|
|
3520
3501
|
border: 1px solid #949494;
|
|
3502
|
+
border-color: var(--wp-components-color-gray-600, #949494);
|
|
3521
3503
|
}
|
|
3522
3504
|
@media not (prefers-reduced-motion) {
|
|
3523
3505
|
.components-text-control__input,
|
|
@@ -3575,53 +3557,21 @@ body.lockscroll {
|
|
|
3575
3557
|
box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
|
|
3576
3558
|
outline: 2px solid transparent;
|
|
3577
3559
|
}
|
|
3578
|
-
.components-text-control__input
|
|
3579
|
-
.components-text-control__input[type=text]
|
|
3580
|
-
.components-text-control__input[type=tel]
|
|
3581
|
-
.components-text-control__input[type=time]
|
|
3582
|
-
.components-text-control__input[type=url]
|
|
3583
|
-
.components-text-control__input[type=week]
|
|
3584
|
-
.components-text-control__input[type=password]
|
|
3585
|
-
.components-text-control__input[type=color]
|
|
3586
|
-
.components-text-control__input[type=date]
|
|
3587
|
-
.components-text-control__input[type=datetime]
|
|
3588
|
-
.components-text-control__input[type=datetime-local]
|
|
3589
|
-
.components-text-control__input[type=email]
|
|
3590
|
-
.components-text-control__input[type=month]
|
|
3591
|
-
.components-text-control__input[type=number]
|
|
3592
|
-
color:
|
|
3593
|
-
}
|
|
3594
|
-
.components-text-control__input::-moz-placeholder,
|
|
3595
|
-
.components-text-control__input[type=text]::-moz-placeholder,
|
|
3596
|
-
.components-text-control__input[type=tel]::-moz-placeholder,
|
|
3597
|
-
.components-text-control__input[type=time]::-moz-placeholder,
|
|
3598
|
-
.components-text-control__input[type=url]::-moz-placeholder,
|
|
3599
|
-
.components-text-control__input[type=week]::-moz-placeholder,
|
|
3600
|
-
.components-text-control__input[type=password]::-moz-placeholder,
|
|
3601
|
-
.components-text-control__input[type=color]::-moz-placeholder,
|
|
3602
|
-
.components-text-control__input[type=date]::-moz-placeholder,
|
|
3603
|
-
.components-text-control__input[type=datetime]::-moz-placeholder,
|
|
3604
|
-
.components-text-control__input[type=datetime-local]::-moz-placeholder,
|
|
3605
|
-
.components-text-control__input[type=email]::-moz-placeholder,
|
|
3606
|
-
.components-text-control__input[type=month]::-moz-placeholder,
|
|
3607
|
-
.components-text-control__input[type=number]::-moz-placeholder {
|
|
3608
|
-
color: rgba(30, 30, 30, 0.62);
|
|
3609
|
-
}
|
|
3610
|
-
.components-text-control__input:-ms-input-placeholder,
|
|
3611
|
-
.components-text-control__input[type=text]:-ms-input-placeholder,
|
|
3612
|
-
.components-text-control__input[type=tel]:-ms-input-placeholder,
|
|
3613
|
-
.components-text-control__input[type=time]:-ms-input-placeholder,
|
|
3614
|
-
.components-text-control__input[type=url]:-ms-input-placeholder,
|
|
3615
|
-
.components-text-control__input[type=week]:-ms-input-placeholder,
|
|
3616
|
-
.components-text-control__input[type=password]:-ms-input-placeholder,
|
|
3617
|
-
.components-text-control__input[type=color]:-ms-input-placeholder,
|
|
3618
|
-
.components-text-control__input[type=date]:-ms-input-placeholder,
|
|
3619
|
-
.components-text-control__input[type=datetime]:-ms-input-placeholder,
|
|
3620
|
-
.components-text-control__input[type=datetime-local]:-ms-input-placeholder,
|
|
3621
|
-
.components-text-control__input[type=email]:-ms-input-placeholder,
|
|
3622
|
-
.components-text-control__input[type=month]:-ms-input-placeholder,
|
|
3623
|
-
.components-text-control__input[type=number]:-ms-input-placeholder {
|
|
3624
|
-
color: rgba(30, 30, 30, 0.62);
|
|
3560
|
+
.components-text-control__input::placeholder,
|
|
3561
|
+
.components-text-control__input[type=text]::placeholder,
|
|
3562
|
+
.components-text-control__input[type=tel]::placeholder,
|
|
3563
|
+
.components-text-control__input[type=time]::placeholder,
|
|
3564
|
+
.components-text-control__input[type=url]::placeholder,
|
|
3565
|
+
.components-text-control__input[type=week]::placeholder,
|
|
3566
|
+
.components-text-control__input[type=password]::placeholder,
|
|
3567
|
+
.components-text-control__input[type=color]::placeholder,
|
|
3568
|
+
.components-text-control__input[type=date]::placeholder,
|
|
3569
|
+
.components-text-control__input[type=datetime]::placeholder,
|
|
3570
|
+
.components-text-control__input[type=datetime-local]::placeholder,
|
|
3571
|
+
.components-text-control__input[type=email]::placeholder,
|
|
3572
|
+
.components-text-control__input[type=month]::placeholder,
|
|
3573
|
+
.components-text-control__input[type=number]::placeholder {
|
|
3574
|
+
color: color-mix(in srgb, var(--wp-components-color-foreground, #1e1e1e), transparent 38%);
|
|
3625
3575
|
}
|
|
3626
3576
|
.components-text-control__input.is-next-40px-default-size,
|
|
3627
3577
|
.components-text-control__input[type=text].is-next-40px-default-size,
|
|
@@ -3866,4 +3816,64 @@ div.components-toolbar > div + div.has-left-divider::before {
|
|
|
3866
3816
|
|
|
3867
3817
|
.components-tooltip__shortcut {
|
|
3868
3818
|
margin-right: 8px;
|
|
3819
|
+
}
|
|
3820
|
+
|
|
3821
|
+
.components-validated-control:has(:is(input, select):user-invalid) .components-input-control__backdrop {
|
|
3822
|
+
--wp-components-color-accent: $alert-red;
|
|
3823
|
+
border-color: #cc1818;
|
|
3824
|
+
}
|
|
3825
|
+
.components-validated-control :is(textarea, input[type=text]):user-invalid {
|
|
3826
|
+
--wp-admin-theme-color: $alert-red;
|
|
3827
|
+
--wp-components-color-accent: $alert-red;
|
|
3828
|
+
border-color: #cc1818;
|
|
3829
|
+
}
|
|
3830
|
+
.components-validated-control .components-combobox-control__suggestions-container:has(input:user-invalid):not(:has([aria-expanded=true])) {
|
|
3831
|
+
border-color: #cc1818;
|
|
3832
|
+
}
|
|
3833
|
+
|
|
3834
|
+
.components-validated-control__wrapper-with-error-delegate {
|
|
3835
|
+
position: relative;
|
|
3836
|
+
}
|
|
3837
|
+
.components-validated-control__wrapper-with-error-delegate:has(select:user-invalid) .components-input-control__backdrop {
|
|
3838
|
+
--wp-components-color-accent: $alert-red;
|
|
3839
|
+
border-color: #cc1818;
|
|
3840
|
+
}
|
|
3841
|
+
.components-validated-control__wrapper-with-error-delegate:has(input[type=radio]:invalid) {
|
|
3842
|
+
--wp-components-color-accent: $alert-red;
|
|
3843
|
+
}
|
|
3844
|
+
|
|
3845
|
+
.components-validated-control__error-delegate {
|
|
3846
|
+
position: absolute;
|
|
3847
|
+
top: 0;
|
|
3848
|
+
height: 100%;
|
|
3849
|
+
width: 100%;
|
|
3850
|
+
opacity: 0;
|
|
3851
|
+
pointer-events: none;
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
.components-validated-control__error {
|
|
3855
|
+
display: flex;
|
|
3856
|
+
align-items: flex-start;
|
|
3857
|
+
gap: 4px;
|
|
3858
|
+
margin: 8px 0 0;
|
|
3859
|
+
font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
3860
|
+
font-size: 0.75rem;
|
|
3861
|
+
line-height: 16px;
|
|
3862
|
+
color: #cc1818;
|
|
3863
|
+
animation: components-validated-control__error-jump 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
|
|
3864
|
+
}
|
|
3865
|
+
|
|
3866
|
+
.components-validated-control__error-icon {
|
|
3867
|
+
flex-shrink: 0;
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3870
|
+
@keyframes components-validated-control__error-jump {
|
|
3871
|
+
0% {
|
|
3872
|
+
transform: translateY(-4px);
|
|
3873
|
+
opacity: 0;
|
|
3874
|
+
}
|
|
3875
|
+
100% {
|
|
3876
|
+
transform: translateY(0);
|
|
3877
|
+
opacity: 1;
|
|
3878
|
+
}
|
|
3869
3879
|
}
|
package/build-style/style.css
CHANGED
|
@@ -1489,23 +1489,6 @@ input.components-combobox-control__input[type=text]:focus {
|
|
|
1489
1489
|
z-index: 0;
|
|
1490
1490
|
}
|
|
1491
1491
|
|
|
1492
|
-
.block-editor-dimension-control .components-base-control__field {
|
|
1493
|
-
display: flex;
|
|
1494
|
-
align-items: center;
|
|
1495
|
-
}
|
|
1496
|
-
.block-editor-dimension-control .components-base-control__label {
|
|
1497
|
-
display: flex;
|
|
1498
|
-
align-items: center;
|
|
1499
|
-
margin-right: 1em;
|
|
1500
|
-
margin-bottom: 0;
|
|
1501
|
-
}
|
|
1502
|
-
.block-editor-dimension-control .components-base-control__label .dashicon {
|
|
1503
|
-
margin-right: 0.5em;
|
|
1504
|
-
}
|
|
1505
|
-
.block-editor-dimension-control.is-manual .components-base-control__label {
|
|
1506
|
-
width: 10em;
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
1492
|
body.is-dragging-components-draggable {
|
|
1510
1493
|
cursor: move; /* Fallback for IE/Edge < 14 */
|
|
1511
1494
|
cursor: grabbing !important;
|
|
@@ -2040,7 +2023,7 @@ body.is-dragging-components-draggable {
|
|
|
2040
2023
|
border-bottom: none;
|
|
2041
2024
|
padding: 0;
|
|
2042
2025
|
position: sticky;
|
|
2043
|
-
height:
|
|
2026
|
+
height: 64px;
|
|
2044
2027
|
}
|
|
2045
2028
|
.components-guide .components-modal__header .components-button {
|
|
2046
2029
|
align-self: flex-start;
|
|
@@ -2054,7 +2037,7 @@ body.is-dragging-components-draggable {
|
|
|
2054
2037
|
display: flex;
|
|
2055
2038
|
flex-direction: column;
|
|
2056
2039
|
justify-content: space-between;
|
|
2057
|
-
margin-top: -
|
|
2040
|
+
margin-top: -64px;
|
|
2058
2041
|
min-height: 100%;
|
|
2059
2042
|
}
|
|
2060
2043
|
.components-guide .components-guide__page {
|
|
@@ -2351,7 +2334,7 @@ body.is-dragging-components-draggable {
|
|
|
2351
2334
|
width: auto;
|
|
2352
2335
|
min-width: 350px;
|
|
2353
2336
|
max-width: calc(100% - 32px);
|
|
2354
|
-
max-height: calc(100% -
|
|
2337
|
+
max-height: calc(100% - 128px);
|
|
2355
2338
|
}
|
|
2356
2339
|
}
|
|
2357
2340
|
@media (min-width: 600px) and (min-width: 600px) {
|
|
@@ -2858,8 +2841,7 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2858
2841
|
display: flex;
|
|
2859
2842
|
box-shadow: none;
|
|
2860
2843
|
border-radius: 0;
|
|
2861
|
-
|
|
2862
|
-
backdrop-filter: blur(100px);
|
|
2844
|
+
backdrop-filter: blur(100px);
|
|
2863
2845
|
background-color: transparent;
|
|
2864
2846
|
backface-visibility: hidden;
|
|
2865
2847
|
overflow: hidden;
|
|
@@ -3350,8 +3332,7 @@ body.lockscroll {
|
|
|
3350
3332
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
3351
3333
|
font-size: 13px;
|
|
3352
3334
|
background: rgba(0, 0, 0, 0.85);
|
|
3353
|
-
|
|
3354
|
-
backdrop-filter: blur(16px) saturate(180%);
|
|
3335
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
3355
3336
|
border-radius: 4px;
|
|
3356
3337
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02);
|
|
3357
3338
|
color: #fff;
|
|
@@ -3530,6 +3511,7 @@ body.lockscroll {
|
|
|
3530
3511
|
box-shadow: 0 0 0 transparent;
|
|
3531
3512
|
border-radius: 2px;
|
|
3532
3513
|
border: 1px solid #949494;
|
|
3514
|
+
border-color: var(--wp-components-color-gray-600, #949494);
|
|
3533
3515
|
}
|
|
3534
3516
|
@media not (prefers-reduced-motion) {
|
|
3535
3517
|
.components-text-control__input,
|
|
@@ -3587,53 +3569,21 @@ body.lockscroll {
|
|
|
3587
3569
|
box-shadow: 0 0 0 0.5px var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
|
|
3588
3570
|
outline: 2px solid transparent;
|
|
3589
3571
|
}
|
|
3590
|
-
.components-text-control__input
|
|
3591
|
-
.components-text-control__input[type=text]
|
|
3592
|
-
.components-text-control__input[type=tel]
|
|
3593
|
-
.components-text-control__input[type=time]
|
|
3594
|
-
.components-text-control__input[type=url]
|
|
3595
|
-
.components-text-control__input[type=week]
|
|
3596
|
-
.components-text-control__input[type=password]
|
|
3597
|
-
.components-text-control__input[type=color]
|
|
3598
|
-
.components-text-control__input[type=date]
|
|
3599
|
-
.components-text-control__input[type=datetime]
|
|
3600
|
-
.components-text-control__input[type=datetime-local]
|
|
3601
|
-
.components-text-control__input[type=email]
|
|
3602
|
-
.components-text-control__input[type=month]
|
|
3603
|
-
.components-text-control__input[type=number]
|
|
3604
|
-
color:
|
|
3605
|
-
}
|
|
3606
|
-
.components-text-control__input::-moz-placeholder,
|
|
3607
|
-
.components-text-control__input[type=text]::-moz-placeholder,
|
|
3608
|
-
.components-text-control__input[type=tel]::-moz-placeholder,
|
|
3609
|
-
.components-text-control__input[type=time]::-moz-placeholder,
|
|
3610
|
-
.components-text-control__input[type=url]::-moz-placeholder,
|
|
3611
|
-
.components-text-control__input[type=week]::-moz-placeholder,
|
|
3612
|
-
.components-text-control__input[type=password]::-moz-placeholder,
|
|
3613
|
-
.components-text-control__input[type=color]::-moz-placeholder,
|
|
3614
|
-
.components-text-control__input[type=date]::-moz-placeholder,
|
|
3615
|
-
.components-text-control__input[type=datetime]::-moz-placeholder,
|
|
3616
|
-
.components-text-control__input[type=datetime-local]::-moz-placeholder,
|
|
3617
|
-
.components-text-control__input[type=email]::-moz-placeholder,
|
|
3618
|
-
.components-text-control__input[type=month]::-moz-placeholder,
|
|
3619
|
-
.components-text-control__input[type=number]::-moz-placeholder {
|
|
3620
|
-
color: rgba(30, 30, 30, 0.62);
|
|
3621
|
-
}
|
|
3622
|
-
.components-text-control__input:-ms-input-placeholder,
|
|
3623
|
-
.components-text-control__input[type=text]:-ms-input-placeholder,
|
|
3624
|
-
.components-text-control__input[type=tel]:-ms-input-placeholder,
|
|
3625
|
-
.components-text-control__input[type=time]:-ms-input-placeholder,
|
|
3626
|
-
.components-text-control__input[type=url]:-ms-input-placeholder,
|
|
3627
|
-
.components-text-control__input[type=week]:-ms-input-placeholder,
|
|
3628
|
-
.components-text-control__input[type=password]:-ms-input-placeholder,
|
|
3629
|
-
.components-text-control__input[type=color]:-ms-input-placeholder,
|
|
3630
|
-
.components-text-control__input[type=date]:-ms-input-placeholder,
|
|
3631
|
-
.components-text-control__input[type=datetime]:-ms-input-placeholder,
|
|
3632
|
-
.components-text-control__input[type=datetime-local]:-ms-input-placeholder,
|
|
3633
|
-
.components-text-control__input[type=email]:-ms-input-placeholder,
|
|
3634
|
-
.components-text-control__input[type=month]:-ms-input-placeholder,
|
|
3635
|
-
.components-text-control__input[type=number]:-ms-input-placeholder {
|
|
3636
|
-
color: rgba(30, 30, 30, 0.62);
|
|
3572
|
+
.components-text-control__input::placeholder,
|
|
3573
|
+
.components-text-control__input[type=text]::placeholder,
|
|
3574
|
+
.components-text-control__input[type=tel]::placeholder,
|
|
3575
|
+
.components-text-control__input[type=time]::placeholder,
|
|
3576
|
+
.components-text-control__input[type=url]::placeholder,
|
|
3577
|
+
.components-text-control__input[type=week]::placeholder,
|
|
3578
|
+
.components-text-control__input[type=password]::placeholder,
|
|
3579
|
+
.components-text-control__input[type=color]::placeholder,
|
|
3580
|
+
.components-text-control__input[type=date]::placeholder,
|
|
3581
|
+
.components-text-control__input[type=datetime]::placeholder,
|
|
3582
|
+
.components-text-control__input[type=datetime-local]::placeholder,
|
|
3583
|
+
.components-text-control__input[type=email]::placeholder,
|
|
3584
|
+
.components-text-control__input[type=month]::placeholder,
|
|
3585
|
+
.components-text-control__input[type=number]::placeholder {
|
|
3586
|
+
color: color-mix(in srgb, var(--wp-components-color-foreground, #1e1e1e), transparent 38%);
|
|
3637
3587
|
}
|
|
3638
3588
|
.components-text-control__input.is-next-40px-default-size,
|
|
3639
3589
|
.components-text-control__input[type=text].is-next-40px-default-size,
|
|
@@ -3879,4 +3829,64 @@ div.components-toolbar > div + div.has-left-divider::before {
|
|
|
3879
3829
|
|
|
3880
3830
|
.components-tooltip__shortcut {
|
|
3881
3831
|
margin-left: 8px;
|
|
3832
|
+
}
|
|
3833
|
+
|
|
3834
|
+
.components-validated-control:has(:is(input, select):user-invalid) .components-input-control__backdrop {
|
|
3835
|
+
--wp-components-color-accent: $alert-red;
|
|
3836
|
+
border-color: #cc1818;
|
|
3837
|
+
}
|
|
3838
|
+
.components-validated-control :is(textarea, input[type=text]):user-invalid {
|
|
3839
|
+
--wp-admin-theme-color: $alert-red;
|
|
3840
|
+
--wp-components-color-accent: $alert-red;
|
|
3841
|
+
border-color: #cc1818;
|
|
3842
|
+
}
|
|
3843
|
+
.components-validated-control .components-combobox-control__suggestions-container:has(input:user-invalid):not(:has([aria-expanded=true])) {
|
|
3844
|
+
border-color: #cc1818;
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3847
|
+
.components-validated-control__wrapper-with-error-delegate {
|
|
3848
|
+
position: relative;
|
|
3849
|
+
}
|
|
3850
|
+
.components-validated-control__wrapper-with-error-delegate:has(select:user-invalid) .components-input-control__backdrop {
|
|
3851
|
+
--wp-components-color-accent: $alert-red;
|
|
3852
|
+
border-color: #cc1818;
|
|
3853
|
+
}
|
|
3854
|
+
.components-validated-control__wrapper-with-error-delegate:has(input[type=radio]:invalid) {
|
|
3855
|
+
--wp-components-color-accent: $alert-red;
|
|
3856
|
+
}
|
|
3857
|
+
|
|
3858
|
+
.components-validated-control__error-delegate {
|
|
3859
|
+
position: absolute;
|
|
3860
|
+
top: 0;
|
|
3861
|
+
height: 100%;
|
|
3862
|
+
width: 100%;
|
|
3863
|
+
opacity: 0;
|
|
3864
|
+
pointer-events: none;
|
|
3865
|
+
}
|
|
3866
|
+
|
|
3867
|
+
.components-validated-control__error {
|
|
3868
|
+
display: flex;
|
|
3869
|
+
align-items: flex-start;
|
|
3870
|
+
gap: 4px;
|
|
3871
|
+
margin: 8px 0 0;
|
|
3872
|
+
font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
3873
|
+
font-size: 0.75rem;
|
|
3874
|
+
line-height: 16px;
|
|
3875
|
+
color: #cc1818;
|
|
3876
|
+
animation: components-validated-control__error-jump 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
|
|
3877
|
+
}
|
|
3878
|
+
|
|
3879
|
+
.components-validated-control__error-icon {
|
|
3880
|
+
flex-shrink: 0;
|
|
3881
|
+
}
|
|
3882
|
+
|
|
3883
|
+
@keyframes components-validated-control__error-jump {
|
|
3884
|
+
0% {
|
|
3885
|
+
transform: translateY(-4px);
|
|
3886
|
+
opacity: 0;
|
|
3887
|
+
}
|
|
3888
|
+
100% {
|
|
3889
|
+
transform: translateY(0);
|
|
3890
|
+
opacity: 1;
|
|
3891
|
+
}
|
|
3882
3892
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EACX,iBAAiB,EAMjB,oBAAoB,EAEpB,MAAM,SAAS,CAAC;AAQjB,wBAAgB,eAAe,CAAE,EAChC,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GACV,EAAE,oBAAoB;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EACX,iBAAiB,EAMjB,oBAAoB,EAEpB,MAAM,SAAS,CAAC;AAQjB,wBAAgB,eAAe,CAAE,EAChC,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GACV,EAAE,oBAAoB;;;;;EAkVtB;AAeD,wBAAgB,oBAAoB,CAAE,OAAO,EAAE,oBAAoB;;;;;;;;;;;;EAsClE;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,EACrC,QAAQ,EACR,UAAU,EACV,GAAG,OAAO,EACV,EAAE,iBAAiB,+BAQnB"}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
import type { BoxControlInputControlProps, BoxControlProps, BoxControlValue, CustomValueUnits, Preset } from './types';
|
|
5
5
|
export declare const CUSTOM_VALUE_SETTINGS: CustomValueUnits;
|
|
6
6
|
export declare const LABELS: {
|
|
7
|
-
all: import("@wordpress/i18n
|
|
8
|
-
top: import("@wordpress/i18n
|
|
9
|
-
bottom: import("@wordpress/i18n
|
|
10
|
-
left: import("@wordpress/i18n
|
|
11
|
-
right: import("@wordpress/i18n
|
|
12
|
-
vertical: import("@wordpress/i18n
|
|
13
|
-
horizontal: import("@wordpress/i18n
|
|
7
|
+
all: import("@wordpress/i18n").TranslatableText<"All sides">;
|
|
8
|
+
top: import("@wordpress/i18n").TranslatableText<"Top side">;
|
|
9
|
+
bottom: import("@wordpress/i18n").TranslatableText<"Bottom side">;
|
|
10
|
+
left: import("@wordpress/i18n").TranslatableText<"Left side">;
|
|
11
|
+
right: import("@wordpress/i18n").TranslatableText<"Right side">;
|
|
12
|
+
vertical: import("@wordpress/i18n").TranslatableText<"Top and bottom sides">;
|
|
13
|
+
horizontal: import("@wordpress/i18n").TranslatableText<"Left and right sides">;
|
|
14
14
|
};
|
|
15
15
|
export declare const DEFAULT_VALUES: {
|
|
16
16
|
top: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/calendar/date-calendar/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/calendar/date-calendar/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,UAAU,CAAC;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,sGAQtB,iBAAiB,gCAkCnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/calendar/date-range-calendar/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/calendar/date-range-calendar/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACX,sBAAsB,EACtB,SAAS,EAET,MAAM,UAAU,CAAC;AAElB,wBAAgB,eAAe,CAAE,EAChC,QAAQ,EACR,WAAW,EACX,eAAe,EACf,GAAG,EACH,GAAG,EACH,QAAQ,GACR,EAAE,IAAI,CACN,sBAAsB,EACtB,UAAU,GAAG,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,CAC3D,GAAG;IACH,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC;CAC9B,yBA6FA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,2IAY3B,sBAAsB,gCAgExB,CAAC"}
|
|
@@ -141,7 +141,7 @@ type DayOfWeek = {
|
|
|
141
141
|
* @param {Modifiers} modifiers - The modifiers associated with the event.
|
|
142
142
|
* @param {React.MouseEvent | React.KeyboardEvent} e - The event object.
|
|
143
143
|
*/
|
|
144
|
-
type OnSelectHandler<T> = (selected: T, triggerDate: Date, modifiers: Modifiers, e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
144
|
+
export type OnSelectHandler<T> = (selected: T, triggerDate: Date, modifiers: Modifiers, e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
145
145
|
export interface BaseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'defaultValue'> {
|
|
146
146
|
/**
|
|
147
147
|
* Whether the selection is required.
|
|
@@ -260,7 +260,7 @@ export interface BaseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'o
|
|
|
260
260
|
* When working with time zones, use the `TZDate` object exported by this
|
|
261
261
|
* package instead of the native `Date` object.
|
|
262
262
|
* @example
|
|
263
|
-
* import { DateCalendar, TZDate } from "@
|
|
263
|
+
* import { DateCalendar, TZDate } from "@wordpress/components";
|
|
264
264
|
*
|
|
265
265
|
* export function WithTimeZone() {
|
|
266
266
|
* const timeZone = "America/New_York";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/calendar/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,KAAK,OAAO,GACT,OAAO,GACP,CAAE,CAAE,IAAI,EAAE,IAAI,KAAM,OAAO,CAAE,GAC7B,IAAI,GACJ,IAAI,EAAE,GACN,SAAS,GACT,UAAU,GACV,SAAS,GACT,YAAY,GACZ,SAAS,CAAC;AACb;;;;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