@festo-ui/react 9.0.0-dev.681 → 9.0.0-dev.683

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.
@@ -1,155 +0,0 @@
1
- import { useEffect, useRef, useState } from "react";
2
- import classNames from "classnames";
3
- import flatpickr from "flatpickr";
4
- import { IconCalendar } from "@festo-ui/react-icons";
5
- import useId from "../../helper/useId.js";
6
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
- function DatePicker(_ref) {
8
- let {
9
- children,
10
- className,
11
- disabled,
12
- required,
13
- error,
14
- hint,
15
- value,
16
- defaultValue = new Date(),
17
- formatDate = Intl.DateTimeFormat().format,
18
- options,
19
- onChange,
20
- id: idProps,
21
- allowManualInput = false,
22
- dateFormat = "d/m/Y",
23
- openOnInputClick = true
24
- } = _ref;
25
- const id = useId(idProps);
26
- const [open, setOpen] = useState(false);
27
- const [calendar, setCalendar] = useState(null);
28
- const innerDefaultValue = value || defaultValue;
29
- function toggle() {
30
- const newOpen = !open;
31
- setOpen(newOpen);
32
- if (newOpen) {
33
- calendar?.open();
34
- } else {
35
- calendar?.close();
36
- }
37
- }
38
- const datePickerRef = useRef(null);
39
- const {
40
- keepOpenOnDateChange,
41
- maxDate,
42
- minDate,
43
- position = "below center"
44
- } = options || {};
45
- useEffect(() => {
46
- if (calendar !== null && value !== undefined) {
47
- calendar.setDate(value);
48
- }
49
- }, [calendar, value]);
50
- useEffect(() => {
51
- function handleChange(date) {
52
- datePickerRef.current?.blur();
53
- if (onChange) {
54
- onChange(date);
55
- }
56
- }
57
- function handleClose() {
58
- setOpen(false);
59
- datePickerRef.current?.blur();
60
- }
61
- if (datePickerRef.current) {
62
- if (calendar === null) {
63
- setCalendar(flatpickr(datePickerRef.current, {
64
- defaultDate: innerDefaultValue,
65
- onChange: v => handleChange(v[0]),
66
- onClose: handleClose,
67
- position,
68
- formatDate,
69
- closeOnSelect: !keepOpenOnDateChange,
70
- clickOpens: false,
71
- minDate,
72
- maxDate,
73
- allowInput: allowManualInput,
74
- dateFormat
75
- }));
76
- } else {
77
- calendar.set({
78
- defaultDate: innerDefaultValue,
79
- minDate,
80
- maxDate,
81
- position,
82
- closeOnSelect: !keepOpenOnDateChange,
83
- allowInput: allowManualInput,
84
- dateFormat
85
- });
86
- }
87
- }
88
- }, [datePickerRef, calendar, maxDate, minDate, onChange, innerDefaultValue, formatDate, keepOpenOnDateChange, position, allowManualInput, dateFormat]);
89
- useEffect(() => () => {
90
- if (calendar !== null) {
91
- calendar.destroy();
92
- }
93
- }, [calendar]);
94
- const handleKeyDown = event => {
95
- if (event.key === "Enter") {
96
- toggle();
97
- }
98
- };
99
- const handleKeyUp = event => {
100
- if (event.key === " ") {
101
- toggle();
102
- }
103
- };
104
- return /*#__PURE__*/_jsx("div", {
105
- tabIndex: 0,
106
- role: "button",
107
- onClick: toggle,
108
- onKeyDown: handleKeyDown,
109
- onKeyUp: handleKeyUp,
110
- children: /*#__PURE__*/_jsxs("label", {
111
- className: classNames("fwe-input-text fwe-input-text-icon", className),
112
- htmlFor: id,
113
- children: [/*#__PURE__*/_jsx(IconCalendar, {
114
- className: classNames({
115
- "fwe-color-hero": open && !disabled,
116
- "fwe-color-control-disabled": disabled,
117
- "icon-hover": allowManualInput && !openOnInputClick
118
- })
119
- }), /*#__PURE__*/_jsx("input", {
120
- id: id,
121
- ref: datePickerRef,
122
- "aria-label": "picked date",
123
- type: "text",
124
- readOnly: !allowManualInput,
125
- onClick: e => {
126
- if (allowManualInput && !openOnInputClick) e.stopPropagation();
127
- },
128
- onKeyDown: e => {
129
- if (allowManualInput && !openOnInputClick) e.stopPropagation();
130
- },
131
- onBlur: () => {
132
- if (allowManualInput && calendar && datePickerRef.current) {
133
- const raw = datePickerRef.current.value;
134
- if (raw) calendar.setDate(raw, true, dateFormat);
135
- }
136
- },
137
- required: required,
138
- className: classNames("fr-date-picker", {
139
- "fwe-border-hero": open && !disabled
140
- }),
141
- disabled: disabled
142
- }), /*#__PURE__*/_jsx("span", {
143
- className: "fwe-input-text-label",
144
- children: children
145
- }), hint && /*#__PURE__*/_jsx("span", {
146
- className: "fwe-input-text-info",
147
- children: hint
148
- }), error && /*#__PURE__*/_jsx("span", {
149
- className: "fwe-input-text-invalid",
150
- children: error
151
- })]
152
- })
153
- });
154
- }
155
- export default DatePicker;
@@ -1,19 +0,0 @@
1
- import type { ClassNamePropsWithChildren } from "../../helper/types";
2
- import "./DateRangePicker.scss";
3
- export interface DatePickerOptions {
4
- maxDate?: Date;
5
- minDate?: Date;
6
- keepOpenOnDateChange?: boolean;
7
- }
8
- export interface DateRangePickerProps extends ClassNamePropsWithChildren {
9
- disabled?: boolean;
10
- required?: boolean;
11
- hint?: string;
12
- error?: string;
13
- defaultValue?: Date;
14
- formatDate?: (date: Date) => string;
15
- options?: DatePickerOptions;
16
- onChange?: (dates: Date[]) => void;
17
- }
18
- declare function DateRangePicker({ children, className, disabled, error, formatDate, hint, onChange, options, required, defaultValue, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
19
- export default DateRangePicker;
@@ -1,135 +0,0 @@
1
- import classNames from "classnames";
2
- import flatpickr from "flatpickr";
3
- import rangePlugin from "flatpickr/dist/plugins/rangePlugin.js";
4
- import { useEffect, useRef, useState } from "react";
5
- import { IconCalendar } from "@festo-ui/react-icons";
6
- import useId from "../../helper/useId.js";
7
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- function DateRangePicker(_ref) {
9
- let {
10
- children,
11
- className,
12
- disabled,
13
- error,
14
- formatDate,
15
- hint,
16
- onChange,
17
- options,
18
- required,
19
- defaultValue = new Date()
20
- } = _ref;
21
- const [open, setOpen] = useState(false);
22
- const [calendar, setCalendar] = useState(null);
23
- const id = useId();
24
- function toggle() {
25
- const newOpen = !open;
26
- setOpen(newOpen);
27
- if (newOpen) {
28
- calendar?.open();
29
- } else {
30
- calendar?.close();
31
- }
32
- }
33
- const inputRef = useRef(null);
34
- const input2Ref = useRef(null);
35
- const containerRef = useRef(null);
36
- useEffect(() => {
37
- function handleChange(dates) {
38
- if (onChange) {
39
- onChange(dates);
40
- }
41
- }
42
- function handleClose() {
43
- setOpen(false);
44
- inputRef.current?.blur();
45
- input2Ref.current?.blur();
46
- }
47
- if (containerRef.current && inputRef.current && input2Ref.current && calendar === null) {
48
- setCalendar(flatpickr(inputRef.current, {
49
- defaultDate: defaultValue,
50
- plugins: [rangePlugin({
51
- input: input2Ref.current
52
- })],
53
- onChange: v => handleChange(v),
54
- position: "below center",
55
- positionElement: containerRef.current,
56
- formatDate,
57
- closeOnSelect: !options?.keepOpenOnDateChange ?? true,
58
- clickOpens: false,
59
- onClose: handleClose,
60
- minDate: options?.minDate,
61
- maxDate: options?.maxDate
62
- }));
63
- }
64
- }, [inputRef, input2Ref, containerRef, formatDate, options, onChange, calendar, defaultValue]);
65
- useEffect(() => () => {
66
- if (calendar !== null) {
67
- calendar.destroy();
68
- }
69
- }, [calendar]);
70
- const handleKeyDown = event => {
71
- if (event.key === "Enter") {
72
- toggle();
73
- }
74
- };
75
- const handleKeyUp = event => {
76
- if (event.key === " ") {
77
- toggle();
78
- }
79
- };
80
- return /*#__PURE__*/_jsx("div", {
81
- tabIndex: 0,
82
- role: "button",
83
- className: classNames("fr-date-range-picker", className),
84
- onClick: toggle,
85
- onKeyDown: handleKeyDown,
86
- onKeyUp: handleKeyUp,
87
- children: /*#__PURE__*/_jsxs("label", {
88
- className: "fwe-input-text fwe-input-text-icon",
89
- htmlFor: id,
90
- children: [/*#__PURE__*/_jsx(IconCalendar, {
91
- className: classNames({
92
- "fwe-color-hero": open && !disabled,
93
- "fwe-color-control-disabled": disabled
94
- })
95
- }), /*#__PURE__*/_jsxs("div", {
96
- ref: containerRef,
97
- className: "fr-date-range-picker-inputs",
98
- children: [/*#__PURE__*/_jsx("input", {
99
- ref: inputRef,
100
- "aria-label": "picked start date",
101
- type: "text",
102
- readOnly: true,
103
- required: required,
104
- className: classNames({
105
- "fwe-border-hero": open && !disabled
106
- }),
107
- disabled: disabled,
108
- id: id
109
- }), /*#__PURE__*/_jsx("input", {
110
- ref: input2Ref,
111
- "aria-label": "picked end date",
112
- type: "text",
113
- readOnly: true,
114
- required: required,
115
- className: classNames({
116
- "fwe-border-hero": open && !disabled
117
- }),
118
- disabled: disabled
119
- })]
120
- }), /*#__PURE__*/_jsx("span", {
121
- className: classNames("fwe-input-text-label", {
122
- "fwe-color-text-disabled": disabled
123
- }),
124
- children: children
125
- }), hint && /*#__PURE__*/_jsx("span", {
126
- className: "fwe-input-text-info",
127
- children: hint
128
- }), error && /*#__PURE__*/_jsx("span", {
129
- className: "fwe-input-text-invalid",
130
- children: error
131
- })]
132
- })
133
- });
134
- }
135
- export default DateRangePicker;
@@ -1,29 +0,0 @@
1
- import "./TextEditor.scss";
2
- export interface TextEditorConfiguration {
3
- toolbar?: {
4
- bold?: boolean;
5
- italic?: boolean;
6
- underline?: boolean;
7
- alignCenter?: boolean;
8
- alignRight?: boolean;
9
- bulletList?: boolean;
10
- orderedList?: boolean;
11
- image?: boolean;
12
- link?: boolean;
13
- };
14
- }
15
- export interface TextEditorProps {
16
- readonly disabled?: boolean;
17
- readonly label: string;
18
- readonly maxLength?: number;
19
- readonly value?: string;
20
- readonly defaultValue?: string;
21
- readonly hint?: string;
22
- readonly error?: string;
23
- readonly readOnly?: boolean;
24
- readonly onChange?: (value: string | null) => void;
25
- readonly className?: string;
26
- readonly config?: TextEditorConfiguration;
27
- }
28
- declare function TextEditor({ disabled, defaultValue, label, maxLength, value, hint, error, readOnly, onChange, className, config: configProps, }: TextEditorProps): import("react/jsx-runtime").JSX.Element;
29
- export default TextEditor;
@@ -1,256 +0,0 @@
1
- import { useCallback, useEffect, useRef, useState } from "react";
2
- import classNames from "classnames";
3
- import * as xss from "xss";
4
- import { IconAlignCenter, IconAlignRight, IconEnumeration, IconImage, IconLink, IconListView } from "@festo-ui/react-icons";
5
- import useId from "../../helper/useId.js";
6
- import TextEditorButton from "./TextEditorButton.js";
7
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
8
- const defaultConfig = {
9
- toolbar: {
10
- bold: true,
11
- italic: true,
12
- underline: true,
13
- alignCenter: false,
14
- alignRight: false,
15
- bulletList: true,
16
- orderedList: true,
17
- image: true,
18
- link: true
19
- }
20
- };
21
- function postpone(fn) {
22
- Promise.resolve().then(fn);
23
- }
24
- function TextEditor(_ref) {
25
- let {
26
- disabled = false,
27
- defaultValue,
28
- label,
29
- maxLength,
30
- value,
31
- hint,
32
- error,
33
- readOnly = false,
34
- onChange,
35
- className,
36
- config: configProps
37
- } = _ref;
38
- const editorRef = useRef(null);
39
- const [editor, setEditor] = useState(null);
40
- const id = useId();
41
- const [innerValue, setInnerValue] = useState(null);
42
- const config = {
43
- toolbar: {
44
- ...defaultConfig.toolbar,
45
- ...configProps?.toolbar
46
- }
47
- };
48
- const setEditorContents = useCallback((e, v) => {
49
- if (e) {
50
- const whiteList = {
51
- ...xss.whiteList,
52
- p: [...(xss.whiteList?.p ?? []), "class"],
53
- li: [...(xss.whiteList?.li ?? []), "class"],
54
- a: [...(xss.whiteList?.a ?? []), "rel", "class"]
55
- };
56
- const sanitizedValue = xss.filterXSS(v, {
57
- whiteList
58
- });
59
- const content = e.clipboard.convert({
60
- html: sanitizedValue
61
- });
62
- const selection = e.getSelection();
63
- e.setContents(content, "silent");
64
- setInnerValue(sanitizedValue);
65
- postpone(() => e.setSelection(selection));
66
- }
67
- }, []);
68
- useEffect(() => {
69
- const initializeQuill = async () => {
70
- let Quill;
71
- if (typeof window !== "undefined") {
72
- const QuillModule = await import("quill");
73
- Quill = QuillModule.default;
74
- }
75
- if (editorRef.current && Quill && editor === null) {
76
- const newEditor = new Quill(editorRef.current, {
77
- modules: {
78
- toolbar: `#editor-toolbar-${CSS.escape(id ?? "")}`
79
- },
80
- theme: "snow"
81
- });
82
- newEditor.root.setAttribute("role", "textbox");
83
- newEditor.root.setAttribute("aria-labelledby", `editor-label-${id}`);
84
- newEditor.root.setAttribute("aria-multiline", "true");
85
- newEditor.enable(!readOnly);
86
- if (disabled) {
87
- newEditor.disable();
88
- } else if (!readOnly) {
89
- newEditor.enable();
90
- }
91
- setEditor(newEditor);
92
- if (defaultValue) {
93
- setEditorContents(newEditor, defaultValue);
94
- }
95
- }
96
- };
97
- initializeQuill();
98
- }, [editor, disabled, readOnly, id, setEditorContents, defaultValue]);
99
- useEffect(() => {
100
- if (editor) {
101
- editor.on("text-change", () => {
102
- let html = editor.getSemanticHTML();
103
- if (html === "<p><br></p>" || html === "<div><br></div>" || html === undefined) {
104
- html = null;
105
- }
106
- if (html !== null) {
107
- // Repairs relative links in an HTML string by prepending "https://".
108
- // It ignores links that are already absolute (http, https) as well as mailto: and tel: links.
109
- const relativeLinkRegex = /href="(?!https?:\/\/|mailto:|tel:)([^"]+)"/g;
110
- html = html.replace(relativeLinkRegex, 'href="https://$1"');
111
- }
112
- if (onChange) {
113
- onChange(html);
114
- }
115
- setInnerValue(html);
116
- });
117
- }
118
- }, [editor, onChange]);
119
- useEffect(() => {
120
- if (value !== innerValue && value !== undefined && value !== null) {
121
- setEditorContents(editor, value);
122
- }
123
- }, [editor, innerValue, setEditorContents, value]);
124
- function currentLength() {
125
- return innerValue?.length || 0;
126
- }
127
- function hideDivider(name) {
128
- const linkOrImage = config.toolbar?.image || config.toolbar?.link;
129
- const lists = config.toolbar?.bulletList || config.toolbar?.orderedList;
130
- const typos = config.toolbar?.bold || config.toolbar?.italic || config.toolbar?.underline;
131
- const textAlign = config.toolbar?.alignCenter || config.toolbar?.alignRight;
132
- switch (name) {
133
- case "typo":
134
- return !typos || !textAlign && !linkOrImage && !lists;
135
- case "text-align":
136
- return !textAlign || !linkOrImage && !lists;
137
- case "lists":
138
- return !lists || !linkOrImage;
139
- case "image":
140
- return !config.toolbar?.image || !config.toolbar.link;
141
- default:
142
- break;
143
- }
144
- return true;
145
- }
146
- return /*#__PURE__*/_jsxs("label", {
147
- className: classNames("fwe-input-text", {
148
- disabled
149
- }),
150
- htmlFor: `editor-label-${id}`,
151
- children: [/*#__PURE__*/_jsx("div", {
152
- className: classNames("fwe-editor-toolbar", {
153
- [`fwe-editor-toolbar-${className}`]: className
154
- }),
155
- id: `editor-toolbar-${id}`,
156
- children: /*#__PURE__*/_jsxs("span", {
157
- className: "ql-formats fwe-mr-3",
158
- children: [config?.toolbar?.bold && /*#__PURE__*/_jsx(TextEditorButton, {
159
- disabled: disabled,
160
- type: "bold",
161
- className: "fwe-mr-3",
162
- label: "B"
163
- }), config?.toolbar?.italic && /*#__PURE__*/_jsx(TextEditorButton, {
164
- disabled: disabled,
165
- type: "italic",
166
- className: "fwe-mr-3",
167
- label: "I"
168
- }), config?.toolbar?.underline && /*#__PURE__*/_jsx(TextEditorButton, {
169
- disabled: disabled,
170
- type: "underline",
171
- label: "U"
172
- }), !hideDivider("typo") && /*#__PURE__*/_jsx("div", {
173
- className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
174
- }), config?.toolbar?.alignCenter && /*#__PURE__*/_jsx(TextEditorButton, {
175
- disabled: disabled,
176
- category: "align",
177
- type: "align-center",
178
- icon: /*#__PURE__*/_jsx(IconAlignCenter, {
179
- className: classNames({
180
- "fwe-gray": disabled
181
- })
182
- }),
183
- value: "center",
184
- className: classNames({
185
- "fwe-mr-3": config?.toolbar?.alignRight
186
- })
187
- }), config?.toolbar?.alignRight && /*#__PURE__*/_jsx(TextEditorButton, {
188
- disabled: disabled,
189
- category: "align",
190
- type: "align-right",
191
- icon: /*#__PURE__*/_jsx(IconAlignRight, {
192
- className: classNames({
193
- "fwe-gray": disabled
194
- })
195
- }),
196
- value: "right"
197
- }), !hideDivider("text-align") && /*#__PURE__*/_jsx("div", {
198
- className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
199
- }), config?.toolbar?.bulletList && /*#__PURE__*/_jsx(TextEditorButton, {
200
- disabled: disabled,
201
- className: "fwe-mr-3",
202
- type: "ul",
203
- list: true,
204
- icon: /*#__PURE__*/_jsx(IconListView, {}),
205
- value: "bullet"
206
- }), config?.toolbar?.orderedList && /*#__PURE__*/_jsx(TextEditorButton, {
207
- disabled: disabled,
208
- type: "ol",
209
- list: true,
210
- icon: /*#__PURE__*/_jsx(IconEnumeration, {}),
211
- value: "ordered"
212
- }), config?.toolbar?.image && /*#__PURE__*/_jsxs(_Fragment, {
213
- children: [/*#__PURE__*/_jsx("div", {
214
- className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
215
- }), /*#__PURE__*/_jsx(TextEditorButton, {
216
- disabled: disabled,
217
- type: "image",
218
- icon: /*#__PURE__*/_jsx(IconImage, {}),
219
- noAction: true
220
- })]
221
- }), config?.toolbar?.link && /*#__PURE__*/_jsxs(_Fragment, {
222
- children: [/*#__PURE__*/_jsx("div", {
223
- className: "fwe-divider-y fwe-d-inline-flex fwe-mx-4"
224
- }), /*#__PURE__*/_jsx(TextEditorButton, {
225
- disabled: disabled,
226
- type: "link",
227
- icon: /*#__PURE__*/_jsx(IconLink, {}),
228
- noAction: true
229
- })]
230
- })]
231
- })
232
- }), /*#__PURE__*/_jsx("div", {
233
- className: classNames("fwe-editor-container", {
234
- "fwe-editor-container--error": error
235
- }),
236
- id: `editor-container-${id}`,
237
- children: /*#__PURE__*/_jsx("div", {
238
- className: "fwe-editor",
239
- ref: editorRef
240
- })
241
- }), /*#__PURE__*/_jsx("span", {
242
- className: "fwe-input-text-label",
243
- children: label
244
- }), error && /*#__PURE__*/_jsx("span", {
245
- className: "fwe-text-editor-invalid",
246
- children: error
247
- }), hint && /*#__PURE__*/_jsx("span", {
248
- className: "fwe-text-editor-info",
249
- children: hint
250
- }), maxLength && maxLength > 0 && value != null && /*#__PURE__*/_jsx("span", {
251
- className: "fwe-input-text-count",
252
- children: `${currentLength()} / ${maxLength}`
253
- })]
254
- });
255
- }
256
- export default TextEditor;
@@ -1,14 +0,0 @@
1
- import { ReactElement } from "react";
2
- interface TextEditorButtonProps {
3
- type: string;
4
- label?: string;
5
- icon?: ReactElement;
6
- disabled: boolean;
7
- className?: string;
8
- list?: boolean;
9
- value?: string;
10
- noAction?: boolean;
11
- category?: string;
12
- }
13
- declare function TextEditorButton({ disabled, label, type, className, icon, list, value, noAction, category, }: Readonly<TextEditorButtonProps>): import("react/jsx-runtime").JSX.Element;
14
- export default TextEditorButton;
@@ -1,80 +0,0 @@
1
- import { useEffect, useRef, useState } from "react";
2
- import classNames from "classnames";
3
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
- function TextEditorButton(_ref) {
5
- let {
6
- disabled,
7
- label,
8
- type,
9
- className,
10
- icon,
11
- list,
12
- value,
13
- noAction,
14
- category
15
- } = _ref;
16
- const [active, setActive] = useState(false);
17
- const btnRef = useRef(null);
18
- function handleClick() {
19
- const btn = btnRef.current;
20
- setActive(prevActive => !prevActive);
21
- btn?.click();
22
- }
23
- useEffect(() => {
24
- function callback(mutationRecords) {
25
- mutationRecords.forEach(mutationRecord => {
26
- const {
27
- classList
28
- } = mutationRecord.target;
29
- const {
30
- oldValue
31
- } = mutationRecord;
32
- if (classList.contains("ql-active")) {
33
- setActive(true);
34
- }
35
- if (!classList.contains("ql-active") && oldValue?.includes("ql-active")) {
36
- setActive(false);
37
- }
38
- });
39
- }
40
- if (btnRef.current && !noAction) {
41
- const observer = new MutationObserver(callback);
42
- observer.observe(btnRef.current, {
43
- attributes: true,
44
- attributeFilter: ["class"],
45
- attributeOldValue: true
46
- });
47
- }
48
- }, [btnRef, noAction]);
49
- return /*#__PURE__*/_jsxs(_Fragment, {
50
- children: [/*#__PURE__*/_jsx("button", {
51
- ref: btnRef,
52
- type: "button",
53
- className: classNames({
54
- [`ql-${category || type}`]: !list
55
- }, {
56
- "ql-list": list
57
- }, "fwe-d-none", {
58
- [`action-${type}`]: !noAction
59
- }),
60
- "aria-hidden": "true",
61
- value: value
62
- }), /*#__PURE__*/_jsxs("button", {
63
- type: "button",
64
- className: classNames({
65
- "fr-icon-button": !!icon
66
- }, "fr-button", className, {
67
- "fwe-active": active && !noAction
68
- }),
69
- onClick: () => handleClick(),
70
- disabled: disabled,
71
- children: [label && /*#__PURE__*/_jsx("div", {
72
- className: `fr-button-text fwe-text-${type}`,
73
- children: label
74
- }), /*#__PURE__*/_jsx("div", {
75
- children: icon
76
- })]
77
- })]
78
- });
79
- }
80
- export default TextEditorButton;