@kaizen/components 1.48.0 → 1.49.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/dist/cjs/DateInput/DateInput/DateInput.cjs +1 -0
- package/dist/cjs/DatePicker/DatePicker.cjs +7 -3
- package/dist/cjs/DateRangePicker/DateRangePicker.cjs +7 -2
- package/dist/cjs/RichTextEditor/EditableRichTextContent/EditableRichTextContent.cjs +1 -0
- package/dist/cjs/RichTextEditor/EditableRichTextContent/EditableRichTextContent.module.scss.cjs +1 -0
- package/dist/cjs/RichTextEditor/RichTextEditor/RichTextEditor.cjs +1 -0
- package/dist/cjs/RichTextEditor/RichTextEditor/RichTextEditor.module.scss.cjs +1 -0
- package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.cjs +5 -1
- package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.module.scss.cjs +6 -0
- package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/validation.cjs +8 -1
- package/dist/cjs/Select/Select.cjs +6 -2
- package/dist/cjs/__future__/Select/Select.cjs +12 -11
- package/dist/esm/DateInput/DateInput/DateInput.mjs +1 -0
- package/dist/esm/DatePicker/DatePicker.mjs +7 -3
- package/dist/esm/DateRangePicker/DateRangePicker.mjs +7 -2
- package/dist/esm/RichTextEditor/EditableRichTextContent/EditableRichTextContent.mjs +3 -2
- package/dist/esm/RichTextEditor/EditableRichTextContent/EditableRichTextContent.module.scss.mjs +1 -0
- package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.mjs +3 -2
- package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.module.scss.mjs +1 -0
- package/dist/esm/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.mjs +5 -1
- package/dist/esm/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.module.scss.mjs +4 -0
- package/dist/esm/RichTextEditor/utils/plugins/LinkManager/validation.mjs +2 -1
- package/dist/esm/Select/Select.mjs +6 -2
- package/dist/esm/__future__/Select/Select.mjs +12 -11
- package/dist/styles.css +9 -8
- package/dist/types/Input/Input/Input.d.ts +5 -0
- package/dist/types/RichTextEditor/utils/plugins/LinkManager/validation.d.ts +1 -0
- package/dist/types/Select/Select.d.ts +10 -0
- package/dist/types/TextArea/TextArea.d.ts +5 -0
- package/dist/types/__future__/Select/Select.d.ts +5 -0
- package/dist/types/__future__/Select/subcomponents/SelectToggle/SelectToggle.d.ts +8 -0
- package/package.json +8 -8
- package/src/DateInput/DateInput/DateInput.tsx +1 -0
- package/src/DatePicker/DatePicker.spec.tsx +14 -14
- package/src/DatePicker/DatePicker.tsx +20 -11
- package/src/DateRangePicker/DateRangePicker.tsx +14 -2
- package/src/DateRangePicker/_docs/DateRangePicker.mdx +5 -1
- package/src/DateRangePicker/_docs/DateRangePicker.stories.tsx +99 -3
- package/src/FieldGroup/_docs/FieldGroup.stickersheet.stories.tsx +2 -12
- package/src/FieldGroup/_docs/FieldGroup.stories.tsx +4 -9
- package/src/Input/Input/Input.tsx +5 -0
- package/src/Input/InputSearch/InputSearch.spec.tsx +10 -7
- package/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.module.scss +1 -1
- package/src/RichTextEditor/EditableRichTextContent/EditableRichTextContent.module.scss +25 -7
- package/src/RichTextEditor/EditableRichTextContent/EditableRichTextContent.tsx +3 -1
- package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.mdx +6 -4
- package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.stickersheet.stories.tsx +98 -0
- package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.stories.tsx +8 -5
- package/src/RichTextEditor/EditableRichTextContent/_docs/defaultContent.json +11 -0
- package/src/RichTextEditor/EditableRichTextContent/_docs/dummyContent.json +44 -39
- package/src/RichTextEditor/RichTextContent/_docs/RichTextContent.mdx +11 -1
- package/src/RichTextEditor/RichTextContent/_docs/RichTextContent.stories.tsx +47 -2
- package/src/RichTextEditor/RichTextEditor/RichTextEditor.module.scss +6 -1
- package/src/RichTextEditor/RichTextEditor/RichTextEditor.spec.stories.tsx +48 -0
- package/src/RichTextEditor/RichTextEditor/RichTextEditor.tsx +7 -2
- package/src/RichTextEditor/RichTextEditor/_docs/RichTextEditor.mdx +66 -7
- package/src/RichTextEditor/RichTextEditor/_docs/RichTextEditor.stories.tsx +60 -7
- package/src/RichTextEditor/_mixins.scss +1 -0
- package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.module.scss +5 -0
- package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.spec.stories.tsx +37 -0
- package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.stories.tsx +33 -0
- package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.tsx +9 -1
- package/src/RichTextEditor/utils/plugins/LinkManager/{validation.ts → validation.tsx} +11 -1
- package/src/Select/Select.tsx +9 -1
- package/src/Select/_docs/Select.stories.tsx +0 -3
- package/src/TextArea/TextArea.tsx +5 -0
- package/src/__future__/Select/Select.tsx +6 -1
- package/src/__future__/Select/_docs/Select.stickersheet.stories.tsx +0 -9
- package/src/__future__/Select/subcomponents/SelectToggle/SelectToggle.tsx +4 -0
|
@@ -28,6 +28,7 @@ var DateInput = React__default.default.forwardRef(function (_a, ref) {
|
|
|
28
28
|
className: classnames__default.default(DateInput_module.dateInput, classNameOverride)
|
|
29
29
|
}, React__default.default.createElement(Label.Label, {
|
|
30
30
|
htmlFor: id,
|
|
31
|
+
id: "".concat(id, "-input-label"),
|
|
31
32
|
labelText: labelText,
|
|
32
33
|
reversed: isReversed,
|
|
33
34
|
disabled: disabled
|
|
@@ -15,6 +15,7 @@ var parseDateAsTextOrNumeral = require('../Calendar/utils/parseDateAsTextOrNumer
|
|
|
15
15
|
require('date-fns');
|
|
16
16
|
var setFocusInCalendar = require('../Calendar/utils/setFocusInCalendar.cjs');
|
|
17
17
|
var CalendarPopover = require('../Calendar/CalendarPopover/CalendarPopover.cjs');
|
|
18
|
+
var VisuallyHidden = require('../VisuallyHidden/VisuallyHidden.cjs');
|
|
18
19
|
var DateInputField = require('./subcomponents/DateInputField/DateInputField.cjs');
|
|
19
20
|
var getLocale = require('./utils/getLocale.cjs');
|
|
20
21
|
var validateDate = require('./utils/validateDate.cjs');
|
|
@@ -219,8 +220,11 @@ var DatePicker = function (_a) {
|
|
|
219
220
|
status: status !== undefined || !shouldUseInbuiltValidation ? status : inbuiltStatus,
|
|
220
221
|
validationMessage: validationMessage !== undefined || !shouldUseInbuiltValidation ? validationMessage : inbuiltValidationMessage
|
|
221
222
|
}, restDateInputFieldProps))), isOpen && React__default.default.createElement(CalendarPopover.CalendarPopover, {
|
|
222
|
-
referenceElement: containerRef.current
|
|
223
|
-
|
|
223
|
+
referenceElement: containerRef.current,
|
|
224
|
+
"aria-labelledby": "".concat(id, "-calendar-label ").concat(id, "-input-label")
|
|
225
|
+
}, React__default.default.createElement(React__default.default.Fragment, null, React__default.default.createElement(VisuallyHidden.VisuallyHidden, {
|
|
226
|
+
id: "".concat(id, "-calendar-label")
|
|
227
|
+
}, "Select date from calendar for:"), React__default.default.createElement(CalendarSingle.CalendarSingle, {
|
|
224
228
|
id: calendarId,
|
|
225
229
|
selected: selectedDay,
|
|
226
230
|
defaultMonth: defaultMonth,
|
|
@@ -229,7 +233,7 @@ var DatePicker = function (_a) {
|
|
|
229
233
|
locale: locale,
|
|
230
234
|
onDayClick: handleCalendarDayChange,
|
|
231
235
|
onMount: handleCalendarMount
|
|
232
|
-
})));
|
|
236
|
+
}))));
|
|
233
237
|
};
|
|
234
238
|
DatePicker.displayName = "DatePicker";
|
|
235
239
|
exports.DatePicker = DatePicker;
|
|
@@ -16,6 +16,7 @@ var LegacyCalendarRange = require('../Calendar/LegacyCalendarRange/LegacyCalenda
|
|
|
16
16
|
require('../Icon/subcomponents/SVG/SVG.cjs');
|
|
17
17
|
var DateStartIcon = require('../Icon/DateStartIcon.cjs');
|
|
18
18
|
var Label = require('../Label/Label.cjs');
|
|
19
|
+
var VisuallyHidden = require('../VisuallyHidden/VisuallyHidden.cjs');
|
|
19
20
|
var DateRangePicker_module = require('./DateRangePicker.module.scss.cjs');
|
|
20
21
|
function _interopDefault(e) {
|
|
21
22
|
return e && e.__esModule ? e : {
|
|
@@ -110,6 +111,7 @@ var DateRangePicker = function (_a) {
|
|
|
110
111
|
ref: containerRef,
|
|
111
112
|
className: classNameOverride
|
|
112
113
|
}, React__default.default.createElement(Label.Label, {
|
|
114
|
+
id: "".concat(id, "-input-label"),
|
|
113
115
|
disabled: isDisabled,
|
|
114
116
|
htmlFor: id,
|
|
115
117
|
labelText: labelText
|
|
@@ -134,8 +136,11 @@ var DateRangePicker = function (_a) {
|
|
|
134
136
|
onEscapeKey: handleOpenClose,
|
|
135
137
|
enabled: isOpen
|
|
136
138
|
}, React__default.default.createElement(CalendarPopover.CalendarPopover, {
|
|
137
|
-
referenceElement: containerRef.current
|
|
138
|
-
|
|
139
|
+
referenceElement: containerRef.current,
|
|
140
|
+
"aria-labelledby": "".concat(id, "-calendar-label ").concat(id, "-input-label")
|
|
141
|
+
}, React__default.default.createElement(VisuallyHidden.VisuallyHidden, {
|
|
142
|
+
id: "".concat(id, "-calendar-label")
|
|
143
|
+
}, "Select dates from calendar for:"), React__default.default.createElement(LegacyCalendarRange.LegacyCalendarRange, {
|
|
139
144
|
selectedRange: selectedDateRange,
|
|
140
145
|
defaultMonth: defaultMonth,
|
|
141
146
|
weekStartsOn: weekStartsOn,
|
|
@@ -30,6 +30,7 @@ var EditableRichTextContent = function (_a) {
|
|
|
30
30
|
contentProps = _a.contentProps,
|
|
31
31
|
restProps = tslib.__rest(_a, ["onClick", "content", "classNameOverride", "labelText", "isLabelHidden", "contentProps"]);
|
|
32
32
|
return React__default.default.createElement(React__default.default.Fragment, null, !isLabelHidden && React__default.default.createElement(Label.Label, {
|
|
33
|
+
classNameOverride: EditableRichTextContent_module.editorLabel,
|
|
33
34
|
labelText: labelText
|
|
34
35
|
}), React__default.default.createElement("div", tslib.__assign({
|
|
35
36
|
onClick: function (e) {
|
|
@@ -134,6 +134,7 @@ var RichTextEditor = function (_a) {
|
|
|
134
134
|
// Including `onContentChange` in the dependencies here will cause a 'Maximum update depth exceeded' issue
|
|
135
135
|
}, [editorState]);
|
|
136
136
|
return React__default.default.createElement(React__default.default.Fragment, null, !labelledBy && labelText && React__default.default.createElement(Label.Label, {
|
|
137
|
+
classNameOverride: RichTextEditor_module.editorLabel,
|
|
137
138
|
id: labelId,
|
|
138
139
|
labelText: labelText
|
|
139
140
|
}), React__default.default.createElement("div", {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var styles = {
|
|
4
4
|
"editor": "RichTextEditor-module_editor__pVKqW",
|
|
5
5
|
"hasToolbar": "RichTextEditor-module_hasToolbar__EBxnG",
|
|
6
|
+
"editorLabel": "RichTextEditor-module_editorLabel__om-dJ",
|
|
6
7
|
"editorWrapper": "RichTextEditor-module_editorWrapper__5q3mG",
|
|
7
8
|
"toolbar": "RichTextEditor-module_toolbar__ceLvw",
|
|
8
9
|
"error": "RichTextEditor-module_error__Xugz8",
|
package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.cjs
CHANGED
|
@@ -13,6 +13,7 @@ require('../../../../../../Modal/GenericModal/subcomponents/ModalBody/ModalBody.
|
|
|
13
13
|
var InputEditModal = require('../../../../../../Modal/InputEditModal/InputEditModal.cjs');
|
|
14
14
|
var TextField = require('../../../../../../TextField/TextField.cjs');
|
|
15
15
|
var validation = require('../../validation.cjs');
|
|
16
|
+
var LinkModal_module = require('./LinkModal.module.scss.cjs');
|
|
16
17
|
function _interopDefault(e) {
|
|
17
18
|
return e && e.__esModule ? e : {
|
|
18
19
|
default: e
|
|
@@ -61,8 +62,11 @@ var LinkModal = function (_a) {
|
|
|
61
62
|
type: "text",
|
|
62
63
|
defaultValue: href !== null && href !== void 0 ? href : "",
|
|
63
64
|
labelText: "Link URL",
|
|
65
|
+
description: "Must start with http:// or https://",
|
|
64
66
|
inputRef: inputRef,
|
|
65
|
-
validationMessage: validationStatus.message,
|
|
67
|
+
validationMessage: (validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.message) && React__default.default.createElement("div", {
|
|
68
|
+
className: LinkModal_module.validationErrorMessage
|
|
69
|
+
}, validationStatus.message),
|
|
66
70
|
status: validationStatus.status,
|
|
67
71
|
onChange: function (e) {
|
|
68
72
|
setHref(e.target.value);
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var React = require('react');
|
|
4
|
+
function _interopDefault(e) {
|
|
5
|
+
return e && e.__esModule ? e : {
|
|
6
|
+
default: e
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
3
10
|
var validateLink = function (href) {
|
|
4
11
|
var isValidLink = /^https?:\/\//.test(href);
|
|
5
12
|
if (!isValidLink) {
|
|
6
13
|
return {
|
|
7
14
|
status: "error",
|
|
8
|
-
message: "
|
|
15
|
+
message: React__default.default.createElement(React__default.default.Fragment, null, "Empty or invalid link. Links must start with http or https, e.g:", React__default.default.createElement("ul", null, React__default.default.createElement("li", null, "https://google.com"), React__default.default.createElement("li", null, "http://www.google.com")))
|
|
9
16
|
};
|
|
10
17
|
}
|
|
11
18
|
return {
|
|
@@ -40,7 +40,8 @@ var Select = React__default.default.forwardRef(function (_a, ref) {
|
|
|
40
40
|
propsFullWidth = _a.fullWidth,
|
|
41
41
|
propsClassName = _a.className,
|
|
42
42
|
isDisabled = _a.isDisabled,
|
|
43
|
-
|
|
43
|
+
placeholder = _a.placeholder,
|
|
44
|
+
props = tslib.__rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className", "isDisabled", "placeholder"]);
|
|
44
45
|
var reactId = React.useId();
|
|
45
46
|
// the default for fullWidth depends on the variant
|
|
46
47
|
var fullWidth = propsFullWidth != null ? propsFullWidth : variant === "secondary" || variant === "secondary-small" ? false : true;
|
|
@@ -52,6 +53,7 @@ var Select = React__default.default.forwardRef(function (_a, ref) {
|
|
|
52
53
|
}, label) : null, React__default.default.createElement(ReactSelect__default.default, tslib.__assign({}, props, {
|
|
53
54
|
ref: ref,
|
|
54
55
|
"aria-labelledby": labelId,
|
|
56
|
+
placeholder: placeholder || "",
|
|
55
57
|
components: {
|
|
56
58
|
Control: Control,
|
|
57
59
|
Placeholder: Placeholder,
|
|
@@ -79,9 +81,11 @@ var Select = React__default.default.forwardRef(function (_a, ref) {
|
|
|
79
81
|
Select.displayName = "Select";
|
|
80
82
|
var AsyncSelect = React__default.default.forwardRef(function (_a, ref) {
|
|
81
83
|
var propsClassName = _a.className,
|
|
82
|
-
|
|
84
|
+
placeholder = _a.placeholder,
|
|
85
|
+
props = tslib.__rest(_a, ["className", "placeholder"]);
|
|
83
86
|
return React__default.default.createElement(Async__default.default, tslib.__assign({}, props, {
|
|
84
87
|
ref: ref,
|
|
88
|
+
placeholder: placeholder || "",
|
|
85
89
|
components: {
|
|
86
90
|
Control: Control,
|
|
87
91
|
Placeholder: Placeholder,
|
|
@@ -49,7 +49,8 @@ var Select = function (_a) {
|
|
|
49
49
|
classNameOverride = _a.classNameOverride,
|
|
50
50
|
selectedKey = _a.selectedKey,
|
|
51
51
|
description = _a.description,
|
|
52
|
-
|
|
52
|
+
_c = _a.placeholder,
|
|
53
|
+
placeholder = _c === void 0 ? "" : _c,
|
|
53
54
|
isDisabled = _a.isDisabled,
|
|
54
55
|
portalContainerId = _a.portalContainerId,
|
|
55
56
|
restProps = tslib.__rest(_a, ["label", "items", "id", "trigger", "children", "status", "validationMessage", "isReversed", "isFullWidth", "disabledValues", "classNameOverride", "selectedKey", "description", "placeholder", "isDisabled", "portalContainerId"]);
|
|
@@ -70,13 +71,13 @@ var Select = function (_a) {
|
|
|
70
71
|
isDisabled: isDisabled
|
|
71
72
|
}, restProps);
|
|
72
73
|
var state = select.useSelectState(ariaSelectProps);
|
|
73
|
-
var
|
|
74
|
-
labelProps =
|
|
75
|
-
reactAriaTriggerProps =
|
|
76
|
-
valueProps =
|
|
77
|
-
menuProps =
|
|
78
|
-
errorMessageProps =
|
|
79
|
-
descriptionProps =
|
|
74
|
+
var _d = select$1.useSelect(ariaSelectProps, state, triggerRef),
|
|
75
|
+
labelProps = _d.labelProps,
|
|
76
|
+
reactAriaTriggerProps = _d.triggerProps,
|
|
77
|
+
valueProps = _d.valueProps,
|
|
78
|
+
menuProps = _d.menuProps,
|
|
79
|
+
errorMessageProps = _d.errorMessageProps,
|
|
80
|
+
descriptionProps = _d.descriptionProps;
|
|
80
81
|
// Hack incoming:
|
|
81
82
|
// react-aria/useSelect wants to prefix the combobox's accessible name with the value of the select.
|
|
82
83
|
// We use role=combobox, meaning screen readers will read the value.
|
|
@@ -99,9 +100,9 @@ var Select = function (_a) {
|
|
|
99
100
|
isReversed: isReversed,
|
|
100
101
|
ref: refs.setReference
|
|
101
102
|
});
|
|
102
|
-
var
|
|
103
|
-
portalContainer =
|
|
104
|
-
setPortalContainer =
|
|
103
|
+
var _e = React.useState(),
|
|
104
|
+
portalContainer = _e[0],
|
|
105
|
+
setPortalContainer = _e[1];
|
|
105
106
|
React.useEffect(function () {
|
|
106
107
|
if (portalContainerId) {
|
|
107
108
|
var portalElement = document.getElementById(portalContainerId);
|
|
@@ -20,6 +20,7 @@ const DateInput = /*#__PURE__*/function () {
|
|
|
20
20
|
className: classnames(styles.dateInput, classNameOverride)
|
|
21
21
|
}, /*#__PURE__*/React.createElement(Label, {
|
|
22
22
|
htmlFor: id,
|
|
23
|
+
id: "".concat(id, "-input-label"),
|
|
23
24
|
labelText: labelText,
|
|
24
25
|
reversed: isReversed,
|
|
25
26
|
disabled: disabled
|
|
@@ -13,6 +13,7 @@ import { parseDateAsTextOrNumeral } from '../Calendar/utils/parseDateAsTextOrNum
|
|
|
13
13
|
import 'date-fns';
|
|
14
14
|
import { setFocusInCalendar } from '../Calendar/utils/setFocusInCalendar.mjs';
|
|
15
15
|
import { CalendarPopover } from '../Calendar/CalendarPopover/CalendarPopover.mjs';
|
|
16
|
+
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.mjs';
|
|
16
17
|
import { DateInputField } from './subcomponents/DateInputField/DateInputField.mjs';
|
|
17
18
|
import { getLocale } from './utils/getLocale.mjs';
|
|
18
19
|
import { validateDate } from './utils/validateDate.mjs';
|
|
@@ -212,8 +213,11 @@ const DatePicker = /*#__PURE__*/function () {
|
|
|
212
213
|
status: status !== undefined || !shouldUseInbuiltValidation ? status : inbuiltStatus,
|
|
213
214
|
validationMessage: validationMessage !== undefined || !shouldUseInbuiltValidation ? validationMessage : inbuiltValidationMessage
|
|
214
215
|
}, restDateInputFieldProps))), isOpen && ( /*#__PURE__*/React.createElement(CalendarPopover, {
|
|
215
|
-
referenceElement: containerRef.current
|
|
216
|
-
|
|
216
|
+
referenceElement: containerRef.current,
|
|
217
|
+
"aria-labelledby": "".concat(id, "-calendar-label ").concat(id, "-input-label")
|
|
218
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
219
|
+
id: "".concat(id, "-calendar-label")
|
|
220
|
+
}, "Select date from calendar for:"), /*#__PURE__*/React.createElement(CalendarSingle, {
|
|
217
221
|
id: calendarId,
|
|
218
222
|
selected: selectedDay,
|
|
219
223
|
defaultMonth: defaultMonth,
|
|
@@ -222,7 +226,7 @@ const DatePicker = /*#__PURE__*/function () {
|
|
|
222
226
|
locale: locale,
|
|
223
227
|
onDayClick: handleCalendarDayChange,
|
|
224
228
|
onMount: handleCalendarMount
|
|
225
|
-
}))));
|
|
229
|
+
})))));
|
|
226
230
|
};
|
|
227
231
|
DatePicker.displayName = "DatePicker";
|
|
228
232
|
return DatePicker;
|
|
@@ -14,6 +14,7 @@ import { LegacyCalendarRange } from '../Calendar/LegacyCalendarRange/LegacyCalen
|
|
|
14
14
|
import '../Icon/subcomponents/SVG/SVG.mjs';
|
|
15
15
|
import { DateStartIcon } from '../Icon/DateStartIcon.mjs';
|
|
16
16
|
import { Label } from '../Label/Label.mjs';
|
|
17
|
+
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.mjs';
|
|
17
18
|
import styles from './DateRangePicker.module.scss.mjs';
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -102,6 +103,7 @@ const DateRangePicker = /*#__PURE__*/function () {
|
|
|
102
103
|
ref: containerRef,
|
|
103
104
|
className: classNameOverride
|
|
104
105
|
}, /*#__PURE__*/React.createElement(Label, {
|
|
106
|
+
id: "".concat(id, "-input-label"),
|
|
105
107
|
disabled: isDisabled,
|
|
106
108
|
htmlFor: id,
|
|
107
109
|
labelText: labelText
|
|
@@ -126,8 +128,11 @@ const DateRangePicker = /*#__PURE__*/function () {
|
|
|
126
128
|
onEscapeKey: handleOpenClose,
|
|
127
129
|
enabled: isOpen
|
|
128
130
|
}, /*#__PURE__*/React.createElement(CalendarPopover, {
|
|
129
|
-
referenceElement: containerRef.current
|
|
130
|
-
|
|
131
|
+
referenceElement: containerRef.current,
|
|
132
|
+
"aria-labelledby": "".concat(id, "-calendar-label ").concat(id, "-input-label")
|
|
133
|
+
}, /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
134
|
+
id: "".concat(id, "-calendar-label")
|
|
135
|
+
}, "Select dates from calendar for:"), /*#__PURE__*/React.createElement(LegacyCalendarRange, {
|
|
131
136
|
selectedRange: selectedDateRange,
|
|
132
137
|
defaultMonth: defaultMonth,
|
|
133
138
|
weekStartsOn: weekStartsOn,
|
|
@@ -21,9 +21,10 @@ const EditableRichTextContent = /*#__PURE__*/function () {
|
|
|
21
21
|
isLabelHidden = _b === void 0 ? false : _b,
|
|
22
22
|
contentProps = _a.contentProps,
|
|
23
23
|
restProps = __rest(_a, ["onClick", "content", "classNameOverride", "labelText", "isLabelHidden", "contentProps"]);
|
|
24
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, !isLabelHidden && /*#__PURE__*/React.createElement(Label, {
|
|
24
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !isLabelHidden && ( /*#__PURE__*/React.createElement(Label, {
|
|
25
|
+
classNameOverride: styles.editorLabel,
|
|
25
26
|
labelText: labelText
|
|
26
|
-
}), /*#__PURE__*/React.createElement("div", __assign({
|
|
27
|
+
})), /*#__PURE__*/React.createElement("div", __assign({
|
|
27
28
|
onClick: function (e) {
|
|
28
29
|
return handleEditableClick(e, onClick);
|
|
29
30
|
},
|
|
@@ -101,10 +101,11 @@ const RichTextEditor = /*#__PURE__*/function () {
|
|
|
101
101
|
onChange(editorState);
|
|
102
102
|
// Including `onContentChange` in the dependencies here will cause a 'Maximum update depth exceeded' issue
|
|
103
103
|
}, [editorState]);
|
|
104
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, !labelledBy && labelText && /*#__PURE__*/React.createElement(Label, {
|
|
104
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !labelledBy && labelText && ( /*#__PURE__*/React.createElement(Label, {
|
|
105
|
+
classNameOverride: styles.editorLabel,
|
|
105
106
|
id: labelId,
|
|
106
107
|
labelText: labelText
|
|
107
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
108
109
|
className: classnames(styles.editorWrapper, styles[status])
|
|
109
110
|
}, controls && ( /*#__PURE__*/React.createElement(Toolbar, {
|
|
110
111
|
"aria-controls": editorId,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var styles = {
|
|
2
2
|
"editor": "RichTextEditor-module_editor__pVKqW",
|
|
3
3
|
"hasToolbar": "RichTextEditor-module_hasToolbar__EBxnG",
|
|
4
|
+
"editorLabel": "RichTextEditor-module_editorLabel__om-dJ",
|
|
4
5
|
"editorWrapper": "RichTextEditor-module_editorWrapper__5q3mG",
|
|
5
6
|
"toolbar": "RichTextEditor-module_toolbar__ceLvw",
|
|
6
7
|
"error": "RichTextEditor-module_error__Xugz8",
|
package/dist/esm/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import '../../../../../../Modal/GenericModal/subcomponents/ModalBody/ModalBody.m
|
|
|
11
11
|
import { InputEditModal } from '../../../../../../Modal/InputEditModal/InputEditModal.mjs';
|
|
12
12
|
import { TextField } from '../../../../../../TextField/TextField.mjs';
|
|
13
13
|
import { validateLink } from '../../validation.mjs';
|
|
14
|
+
import styles from './LinkModal.module.scss.mjs';
|
|
14
15
|
const LinkModal = /*#__PURE__*/function () {
|
|
15
16
|
const LinkModal = function (_a) {
|
|
16
17
|
var onSubmit = _a.onSubmit,
|
|
@@ -54,8 +55,11 @@ const LinkModal = /*#__PURE__*/function () {
|
|
|
54
55
|
type: "text",
|
|
55
56
|
defaultValue: href !== null && href !== void 0 ? href : "",
|
|
56
57
|
labelText: "Link URL",
|
|
58
|
+
description: "Must start with http:// or https://",
|
|
57
59
|
inputRef: inputRef,
|
|
58
|
-
validationMessage: validationStatus.message,
|
|
60
|
+
validationMessage: (validationStatus === null || validationStatus === void 0 ? void 0 : validationStatus.message) && ( /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: styles.validationErrorMessage
|
|
62
|
+
}, validationStatus.message)),
|
|
59
63
|
status: validationStatus.status,
|
|
60
64
|
onChange: function (e) {
|
|
61
65
|
setHref(e.target.value);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
var validateLink = function (href) {
|
|
2
3
|
var isValidLink = /^https?:\/\//.test(href);
|
|
3
4
|
if (!isValidLink) {
|
|
4
5
|
return {
|
|
5
6
|
status: "error",
|
|
6
|
-
message: "
|
|
7
|
+
message: ( /*#__PURE__*/React.createElement(React.Fragment, null, "Empty or invalid link. Links must start with http or https, e.g:", /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, "https://google.com"), /*#__PURE__*/React.createElement("li", null, "http://www.google.com"))))
|
|
7
8
|
};
|
|
8
9
|
}
|
|
9
10
|
return {
|
|
@@ -30,7 +30,8 @@ const Select = /*#__PURE__*/function () {
|
|
|
30
30
|
propsFullWidth = _a.fullWidth,
|
|
31
31
|
propsClassName = _a.className,
|
|
32
32
|
isDisabled = _a.isDisabled,
|
|
33
|
-
|
|
33
|
+
placeholder = _a.placeholder,
|
|
34
|
+
props = __rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className", "isDisabled", "placeholder"]);
|
|
34
35
|
var reactId = useId();
|
|
35
36
|
// the default for fullWidth depends on the variant
|
|
36
37
|
var fullWidth = propsFullWidth != null ? propsFullWidth : variant === "secondary" || variant === "secondary-small" ? false : true;
|
|
@@ -42,6 +43,7 @@ const Select = /*#__PURE__*/function () {
|
|
|
42
43
|
}, label)) : null, /*#__PURE__*/React.createElement(ReactSelect, __assign({}, props, {
|
|
43
44
|
ref: ref,
|
|
44
45
|
"aria-labelledby": labelId,
|
|
46
|
+
placeholder: placeholder || "",
|
|
45
47
|
components: {
|
|
46
48
|
Control: Control,
|
|
47
49
|
Placeholder: Placeholder,
|
|
@@ -72,9 +74,11 @@ const Select = /*#__PURE__*/function () {
|
|
|
72
74
|
const AsyncSelect = /*#__PURE__*/function () {
|
|
73
75
|
const AsyncSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
74
76
|
var propsClassName = _a.className,
|
|
75
|
-
|
|
77
|
+
placeholder = _a.placeholder,
|
|
78
|
+
props = __rest(_a, ["className", "placeholder"]);
|
|
76
79
|
return /*#__PURE__*/React.createElement(Async, __assign({}, props, {
|
|
77
80
|
ref: ref,
|
|
81
|
+
placeholder: placeholder || "",
|
|
78
82
|
components: {
|
|
79
83
|
Control: Control,
|
|
80
84
|
Placeholder: Placeholder,
|
|
@@ -41,7 +41,8 @@ const Select = /*#__PURE__*/function () {
|
|
|
41
41
|
classNameOverride = _a.classNameOverride,
|
|
42
42
|
selectedKey = _a.selectedKey,
|
|
43
43
|
description = _a.description,
|
|
44
|
-
|
|
44
|
+
_c = _a.placeholder,
|
|
45
|
+
placeholder = _c === void 0 ? "" : _c,
|
|
45
46
|
isDisabled = _a.isDisabled,
|
|
46
47
|
portalContainerId = _a.portalContainerId,
|
|
47
48
|
restProps = __rest(_a, ["label", "items", "id", "trigger", "children", "status", "validationMessage", "isReversed", "isFullWidth", "disabledValues", "classNameOverride", "selectedKey", "description", "placeholder", "isDisabled", "portalContainerId"]);
|
|
@@ -62,13 +63,13 @@ const Select = /*#__PURE__*/function () {
|
|
|
62
63
|
isDisabled: isDisabled
|
|
63
64
|
}, restProps);
|
|
64
65
|
var state = useSelectState(ariaSelectProps);
|
|
65
|
-
var
|
|
66
|
-
labelProps =
|
|
67
|
-
reactAriaTriggerProps =
|
|
68
|
-
valueProps =
|
|
69
|
-
menuProps =
|
|
70
|
-
errorMessageProps =
|
|
71
|
-
descriptionProps =
|
|
66
|
+
var _d = useSelect(ariaSelectProps, state, triggerRef),
|
|
67
|
+
labelProps = _d.labelProps,
|
|
68
|
+
reactAriaTriggerProps = _d.triggerProps,
|
|
69
|
+
valueProps = _d.valueProps,
|
|
70
|
+
menuProps = _d.menuProps,
|
|
71
|
+
errorMessageProps = _d.errorMessageProps,
|
|
72
|
+
descriptionProps = _d.descriptionProps;
|
|
72
73
|
// Hack incoming:
|
|
73
74
|
// react-aria/useSelect wants to prefix the combobox's accessible name with the value of the select.
|
|
74
75
|
// We use role=combobox, meaning screen readers will read the value.
|
|
@@ -91,9 +92,9 @@ const Select = /*#__PURE__*/function () {
|
|
|
91
92
|
isReversed: isReversed,
|
|
92
93
|
ref: refs.setReference
|
|
93
94
|
});
|
|
94
|
-
var
|
|
95
|
-
portalContainer =
|
|
96
|
-
setPortalContainer =
|
|
95
|
+
var _e = useState(),
|
|
96
|
+
portalContainer = _e[0],
|
|
97
|
+
setPortalContainer = _e[1];
|
|
97
98
|
useEffect(function () {
|
|
98
99
|
if (portalContainerId) {
|
|
99
100
|
var portalElement = document.getElementById(portalContainerId);
|