fictoan-react 1.8.4 → 1.9.1-alpha.25
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/components/Accordion/Accordion.js +5 -5
- package/dist/components/Badge/Badge.js +5 -5
- package/dist/components/Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js +3 -3
- package/dist/components/Breadcrumbs/Breadcrumbs/Breadcrumbs.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Callout/Callout.js +3 -3
- package/dist/components/Card/Card.js +3 -3
- package/dist/components/CodeBlock/CodeBlock.js +10 -10
- package/dist/components/Divider/Divider.js +3 -3
- package/dist/components/Drawer/Drawer.js +6 -6
- package/dist/components/Element/Element.js +3 -3
- package/dist/components/Element/Tags.js +3 -3
- package/dist/components/Form/BaseInputComponent/BaseInputComponent.js +6 -6
- package/dist/components/Form/Checkbox/Checkbox.js +3 -3
- package/dist/components/Form/Checkbox/Switch.js +3 -3
- package/dist/components/Form/Form/Form.js +4 -4
- package/dist/components/Form/Form/FormGenerator.js +4 -4
- package/dist/components/Form/FormItem/FormItem.js +3 -3
- package/dist/components/Form/FormItemGroup/FormItemGroup.js +3 -3
- package/dist/components/Form/InputField/FileUpload.js +3 -3
- package/dist/components/Form/InputField/InputField.js +3 -3
- package/dist/components/Form/InputLabel/InputLabel.js +3 -3
- package/dist/components/Form/ListBox/ListBox.js +17 -17
- package/dist/components/Form/PinInputField/PinInputField.js +4 -4
- package/dist/components/Form/RadioButton/RadioButton.js +4 -4
- package/dist/components/Form/RadioButton/RadioGroup.js +5 -5
- package/dist/components/Form/RadioButton/RadioTabGroup.js +5 -5
- package/dist/components/Form/Range/Range.js +3 -3
- package/dist/components/Form/Select/Select.js +6 -6
- package/dist/components/Form/TextArea/TextArea.js +3 -3
- package/dist/components/Meter/Meter.js +10 -10
- package/dist/components/Modal/Modal.js +6 -6
- package/dist/components/Notification/NotificationItem/NotificationItem.js +6 -6
- package/dist/components/Notification/NotificationsWrapper/NotificationsWrapper.js +4 -4
- package/dist/components/OptionCard/OptionCard.js +4 -4
- package/dist/components/Pagination/Pagination.js +14 -14
- package/dist/components/Portion/Portion.js +3 -3
- package/dist/components/ProgressBar/ProgressBar.js +6 -6
- package/dist/components/Row/Row.js +3 -3
- package/dist/components/Sidebar/ContentWrapper/ContentWrapper.js +3 -3
- package/dist/components/Sidebar/SidebarFooter/SidebarFooter.js +3 -3
- package/dist/components/Sidebar/SidebarHeader/SidebarHeader.js +3 -3
- package/dist/components/Sidebar/SidebarItem/SidebarItem.js +4 -4
- package/dist/components/Sidebar/SidebarWrapper/SidebarWrapper.js +3 -3
- package/dist/components/Skeleton/Skeleton.js +6 -6
- package/dist/components/Spinner/Spinner.js +3 -3
- package/dist/components/Table/Table.js +9 -9
- package/dist/components/Table/index.js +1 -3
- package/dist/components/Tabs/Tabs.js +6 -6
- package/dist/components/ThemeProvider/ThemeProvider.js +6 -6
- package/dist/components/Toast/ToastItem/ToastItem.js +3 -3
- package/dist/components/Toast/ToastsWrapper/ToastsWrapper.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +146 -0
- package/dist/components/Tooltip/index.js +6 -0
- package/dist/components/Typography/Heading.js +9 -9
- package/dist/components/Typography/Text.js +3 -3
- package/dist/components/index.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/components/Table/TablePagination/TablePagination.js +0 -31
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
4
4
|
import { Div } from "../../Element/Tags.js";
|
|
5
5
|
import { InputField } from "../InputField/InputField.js";
|
|
6
6
|
import { Badge } from "../../Badge/Badge.js";
|
|
@@ -8,7 +8,7 @@ import { Text } from "../../Typography/Text.js";
|
|
|
8
8
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
9
9
|
import { u as useClickOutside } from "../../../UseClickOutside-CJ5IQE6n.js";
|
|
10
10
|
import { searchOptions } from "./listBoxUtils.js";
|
|
11
|
-
const ListBox =
|
|
11
|
+
const ListBox = React.forwardRef(
|
|
12
12
|
({
|
|
13
13
|
options,
|
|
14
14
|
label,
|
|
@@ -167,7 +167,7 @@ const ListBox = React__default.forwardRef(
|
|
|
167
167
|
activeOption == null ? void 0 : activeOption.scrollIntoView({ block: "nearest" });
|
|
168
168
|
}
|
|
169
169
|
}, [activeIndex]);
|
|
170
|
-
return /* @__PURE__ */
|
|
170
|
+
return /* @__PURE__ */ React.createElement(
|
|
171
171
|
BaseInputComponent,
|
|
172
172
|
{
|
|
173
173
|
"data-list-box": true,
|
|
@@ -176,7 +176,7 @@ const ListBox = React__default.forwardRef(
|
|
|
176
176
|
ref: effectiveRef,
|
|
177
177
|
...props
|
|
178
178
|
},
|
|
179
|
-
label && /* @__PURE__ */
|
|
179
|
+
label && /* @__PURE__ */ React.createElement(
|
|
180
180
|
"label",
|
|
181
181
|
{
|
|
182
182
|
id: `${listboxId}-label`,
|
|
@@ -185,7 +185,7 @@ const ListBox = React__default.forwardRef(
|
|
|
185
185
|
},
|
|
186
186
|
label
|
|
187
187
|
),
|
|
188
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ React.createElement(
|
|
189
189
|
Div,
|
|
190
190
|
{
|
|
191
191
|
className: "list-box-input-wrapper",
|
|
@@ -199,7 +199,7 @@ const ListBox = React__default.forwardRef(
|
|
|
199
199
|
"aria-owns": `${listboxId}-listbox`,
|
|
200
200
|
tabIndex: disabled ? -1 : 0
|
|
201
201
|
},
|
|
202
|
-
allowMultiSelect ? /* @__PURE__ */
|
|
202
|
+
allowMultiSelect ? /* @__PURE__ */ React.createElement(React.Fragment, null, selectedOptions.length > 0 ? /* @__PURE__ */ React.createElement(Div, { className: "options-wrapper" }, /* @__PURE__ */ React.createElement(Div, { className: "options-list" }, selectedOptions.map((option) => /* @__PURE__ */ React.createElement(
|
|
203
203
|
Badge,
|
|
204
204
|
{
|
|
205
205
|
key: option.value,
|
|
@@ -211,7 +211,7 @@ const ListBox = React__default.forwardRef(
|
|
|
211
211
|
textColour: badgeTextColour || badgeTextColor
|
|
212
212
|
},
|
|
213
213
|
option.label
|
|
214
|
-
))), selectionLimit && selectedOptions.length >= selectionLimit && /* @__PURE__ */
|
|
214
|
+
))), selectionLimit && selectedOptions.length >= selectionLimit && /* @__PURE__ */ React.createElement(
|
|
215
215
|
Text,
|
|
216
216
|
{
|
|
217
217
|
className: "options-limit-warning",
|
|
@@ -223,7 +223,7 @@ const ListBox = React__default.forwardRef(
|
|
|
223
223
|
selectionLimit,
|
|
224
224
|
" option",
|
|
225
225
|
selectionLimit === 1 ? "" : "s"
|
|
226
|
-
)) : /* @__PURE__ */
|
|
226
|
+
)) : /* @__PURE__ */ React.createElement("span", { className: "placeholder" }, placeholder), selectedOptions.length > 0 && /* @__PURE__ */ React.createElement(
|
|
227
227
|
Div,
|
|
228
228
|
{
|
|
229
229
|
className: "icon-wrapper clear-all",
|
|
@@ -233,21 +233,21 @@ const ListBox = React__default.forwardRef(
|
|
|
233
233
|
tabIndex: 0,
|
|
234
234
|
"aria-label": "Clear all selected options"
|
|
235
235
|
},
|
|
236
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24", "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("line", { x1: "5", y1: "5", x2: "19", y2: "19" }), /* @__PURE__ */ React.createElement("line", { x1: "5", y1: "19", x2: "19", y2: "5" }))
|
|
237
237
|
)) : (
|
|
238
238
|
// FOR PLAIN TEXT SINGLE-SELECT OPTION =========================================================
|
|
239
|
-
selectedOption ? /* @__PURE__ */
|
|
239
|
+
selectedOption ? /* @__PURE__ */ React.createElement(Text, { className: "selected-option" }, selectedOption.label) : /* @__PURE__ */ React.createElement("span", { className: "placeholder" }, placeholder)
|
|
240
240
|
),
|
|
241
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ React.createElement(Div, { className: "icon-wrapper chevrons" }, /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24", "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("polyline", { points: "6 9 12 4 18 9" }), /* @__PURE__ */ React.createElement("polyline", { points: "6 15 12 20 18 15" })))
|
|
242
242
|
),
|
|
243
|
-
isOpen && !disabled && /* @__PURE__ */
|
|
243
|
+
isOpen && !disabled && /* @__PURE__ */ React.createElement(
|
|
244
244
|
Div,
|
|
245
245
|
{
|
|
246
246
|
className: "list-box-dropdown",
|
|
247
247
|
role: "dialog",
|
|
248
248
|
"aria-label": `${label || "Options"} dropdown`
|
|
249
249
|
},
|
|
250
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ React.createElement(Div, { className: "list-box-search-wrapper" }, /* @__PURE__ */ React.createElement(
|
|
251
251
|
InputField,
|
|
252
252
|
{
|
|
253
253
|
type: "text",
|
|
@@ -262,7 +262,7 @@ const ListBox = React__default.forwardRef(
|
|
|
262
262
|
"aria-controls": `${listboxId}-listbox`,
|
|
263
263
|
"aria-label": "Search options"
|
|
264
264
|
}
|
|
265
|
-
), allowCustomEntries && searchValue.trim() && !selectedOptions.some((opt) => opt.label.toLowerCase() === searchValue.trim().toLowerCase()) && /* @__PURE__ */
|
|
265
|
+
), allowCustomEntries && searchValue.trim() && !selectedOptions.some((opt) => opt.label.toLowerCase() === searchValue.trim().toLowerCase()) && /* @__PURE__ */ React.createElement(
|
|
266
266
|
"kbd",
|
|
267
267
|
{
|
|
268
268
|
className: "list-box-enter-key",
|
|
@@ -270,7 +270,7 @@ const ListBox = React__default.forwardRef(
|
|
|
270
270
|
},
|
|
271
271
|
"↵"
|
|
272
272
|
)),
|
|
273
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ React.createElement(
|
|
274
274
|
"ul",
|
|
275
275
|
{
|
|
276
276
|
id: `${listboxId}-listbox`,
|
|
@@ -281,7 +281,7 @@ const ListBox = React__default.forwardRef(
|
|
|
281
281
|
"aria-busy": props.isLoading,
|
|
282
282
|
tabIndex: -1
|
|
283
283
|
},
|
|
284
|
-
filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */
|
|
284
|
+
filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ React.createElement(
|
|
285
285
|
"li",
|
|
286
286
|
{
|
|
287
287
|
key: option.value,
|
|
@@ -295,7 +295,7 @@ const ListBox = React__default.forwardRef(
|
|
|
295
295
|
tabIndex: -1
|
|
296
296
|
},
|
|
297
297
|
option.customLabel || option.label
|
|
298
|
-
)) : /* @__PURE__ */
|
|
298
|
+
)) : /* @__PURE__ */ React.createElement(
|
|
299
299
|
"li",
|
|
300
300
|
{
|
|
301
301
|
className: "list-box-option disabled",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React, { useRef, useState, useCallback, useEffect, createRef, useImperativeHandle } from "react";
|
|
4
4
|
import { InputField } from "../InputField/InputField.js";
|
|
5
5
|
import { Div } from "../../Element/Tags.js";
|
|
6
6
|
function validate(value, type) {
|
|
@@ -9,7 +9,7 @@ function validate(value, type) {
|
|
|
9
9
|
const regex = type === "alphanumeric" ? ALPHA_NUMERIC_REGEX : NUMERIC_REGEX;
|
|
10
10
|
return regex.test(value);
|
|
11
11
|
}
|
|
12
|
-
const PinInputField =
|
|
12
|
+
const PinInputField = React.forwardRef(
|
|
13
13
|
({
|
|
14
14
|
numberOfFields: length,
|
|
15
15
|
onChange,
|
|
@@ -174,7 +174,7 @@ const PinInputField = React__default.forwardRef(
|
|
|
174
174
|
if (isFullWidth) {
|
|
175
175
|
classNames.push("full-width");
|
|
176
176
|
}
|
|
177
|
-
return /* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ React.createElement(
|
|
178
178
|
Div,
|
|
179
179
|
{
|
|
180
180
|
"data-pin-input-field": true,
|
|
@@ -185,7 +185,7 @@ const PinInputField = React__default.forwardRef(
|
|
|
185
185
|
"aria-required": props.required,
|
|
186
186
|
...props
|
|
187
187
|
},
|
|
188
|
-
[...Array(length)].map((_, i) => /* @__PURE__ */
|
|
188
|
+
[...Array(length)].map((_, i) => /* @__PURE__ */ React.createElement(
|
|
189
189
|
InputField,
|
|
190
190
|
{
|
|
191
191
|
key: i,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
5
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
6
|
-
const RadioButton =
|
|
6
|
+
const RadioButton = React.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
onClick,
|
|
9
9
|
...props
|
|
10
10
|
}, ref) => {
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ React.createElement(
|
|
12
12
|
Element,
|
|
13
13
|
{
|
|
14
14
|
as: "div",
|
|
@@ -19,7 +19,7 @@ const RadioButton = React__default.forwardRef(
|
|
|
19
19
|
"aria-checked": props.checked,
|
|
20
20
|
"aria-disabled": props.disabled
|
|
21
21
|
},
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ React.createElement(
|
|
23
23
|
BaseInputComponent,
|
|
24
24
|
{
|
|
25
25
|
as: "input",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { RadioButton } from "./RadioButton.js";
|
|
5
5
|
import { Element } from "../../Element/Element.js";
|
|
6
6
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
7
7
|
const RadioGroupOptions = ({ options, defaultValue, required, ...props }) => {
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ React.createElement(Element, { as: "div", required }, options.map((option, index) => {
|
|
9
|
+
return /* @__PURE__ */ React.createElement(RadioButton, { key: index, ...props, ...option });
|
|
10
10
|
}));
|
|
11
11
|
};
|
|
12
|
-
const RadioGroup =
|
|
13
|
-
return /* @__PURE__ */
|
|
12
|
+
const RadioGroup = React.forwardRef((props, ref) => {
|
|
13
|
+
return /* @__PURE__ */ React.createElement(BaseInputComponent, { as: RadioGroupOptions, ref, ...props });
|
|
14
14
|
});
|
|
15
15
|
export {
|
|
16
16
|
RadioGroup
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { Div } from "../../Element/Tags.js";
|
|
5
5
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
6
6
|
const RadioTabGroupOptions = ({ options, defaultValue, value, required, ...props }) => {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ React.createElement(Div, { "data-radio-tab-group": true, name: props.name, required }, options.map((option) => /* @__PURE__ */ React.createElement(React.Fragment, { key: option.id }, /* @__PURE__ */ React.createElement(
|
|
8
8
|
"input",
|
|
9
9
|
{
|
|
10
10
|
type: "radio",
|
|
@@ -12,15 +12,15 @@ const RadioTabGroupOptions = ({ options, defaultValue, value, required, ...props
|
|
|
12
12
|
...option,
|
|
13
13
|
checked: value === option.value
|
|
14
14
|
}
|
|
15
|
-
), /* @__PURE__ */
|
|
15
|
+
), /* @__PURE__ */ React.createElement("label", { htmlFor: option.id }, option.label))));
|
|
16
16
|
};
|
|
17
|
-
const RadioTabGroup =
|
|
17
|
+
const RadioTabGroup = React.forwardRef(
|
|
18
18
|
({ size = "medium", ...props }, ref) => {
|
|
19
19
|
let classNames = [];
|
|
20
20
|
if (size) {
|
|
21
21
|
classNames.push(`size-${size}`);
|
|
22
22
|
}
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ React.createElement(
|
|
24
24
|
BaseInputComponent,
|
|
25
25
|
{
|
|
26
26
|
as: RadioTabGroupOptions,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
5
|
import { Div } from "../../Element/Tags.js";
|
|
6
6
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
7
7
|
import { InputLabel } from "../InputLabel/InputLabel.js";
|
|
8
8
|
import { Text } from "../../Typography/Text.js";
|
|
9
|
-
const Range =
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
const Range = React.forwardRef(({ label, value, suffix, ...props }, ref) => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement(Element, { "data-range": true, ref }, label && /* @__PURE__ */ React.createElement(Div, { "data-range-meta": true }, /* @__PURE__ */ React.createElement(InputLabel, { className: "range-label", label, htmlFor: props.id }), /* @__PURE__ */ React.createElement(Text, { className: "range-value" }, value, suffix && suffix)), /* @__PURE__ */ React.createElement(
|
|
11
11
|
BaseInputComponent,
|
|
12
12
|
{
|
|
13
13
|
as: "input",
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
5
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
6
6
|
import { Div } from "../../Element/Tags.js";
|
|
7
7
|
const SelectWithOptions = ({ options, className, ...props }) => {
|
|
8
|
-
const renderOption = (option) => /* @__PURE__ */
|
|
9
|
-
const renderOptGroup = (group) => /* @__PURE__ */
|
|
10
|
-
return /* @__PURE__ */
|
|
8
|
+
const renderOption = (option) => /* @__PURE__ */ React.createElement(Element, { as: "option", key: option.value, value: option.value, disabled: option.disabled }, option.label);
|
|
9
|
+
const renderOptGroup = (group) => /* @__PURE__ */ React.createElement(Element, { as: "optgroup", key: group.label, label: group.label }, group.options.map(renderOption));
|
|
10
|
+
return /* @__PURE__ */ React.createElement(Div, { "data-select": true, className, disabled: props.disabled }, /* @__PURE__ */ React.createElement(Element, { as: "select", ...props }, options.map(
|
|
11
11
|
(option) => (
|
|
12
12
|
// @ts-ignore
|
|
13
13
|
"options" in option ? renderOptGroup(option) : renderOption(option)
|
|
14
14
|
)
|
|
15
15
|
)));
|
|
16
16
|
};
|
|
17
|
-
const Select =
|
|
18
|
-
return /* @__PURE__ */
|
|
17
|
+
const Select = React.forwardRef((props, ref) => {
|
|
18
|
+
return /* @__PURE__ */ React.createElement(BaseInputComponent, { as: SelectWithOptions, ref, ...props });
|
|
19
19
|
});
|
|
20
20
|
export {
|
|
21
21
|
Select
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
5
|
-
const TextArea =
|
|
6
|
-
return /* @__PURE__ */
|
|
5
|
+
const TextArea = React.forwardRef((props, ref) => {
|
|
6
|
+
return /* @__PURE__ */ React.createElement(BaseInputComponent, { as: "textarea", "data-textarea": true, ref, placeholder: " ", ...props });
|
|
7
7
|
});
|
|
8
8
|
export {
|
|
9
9
|
TextArea
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { Element } from "../Element/Element.js";
|
|
5
5
|
import { Text } from "../Typography/Text.js";
|
|
6
|
-
const Meter =
|
|
6
|
+
const Meter = React.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
label,
|
|
9
9
|
value,
|
|
@@ -32,29 +32,29 @@ const Meter = React__default.forwardRef(
|
|
|
32
32
|
}
|
|
33
33
|
return `Current value is ${value}${suffix || ""} (${percentage.toFixed(1)}%). Status: ${status}`;
|
|
34
34
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ React.createElement(
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
38
|
role: "region",
|
|
39
39
|
"aria-label": ariaLabel || "Meter indicator"
|
|
40
40
|
},
|
|
41
|
-
label && /* @__PURE__ */
|
|
41
|
+
label && /* @__PURE__ */ React.createElement(
|
|
42
42
|
Element,
|
|
43
43
|
{
|
|
44
44
|
as: "div",
|
|
45
45
|
"data-meter-meta": true,
|
|
46
46
|
id: `meter-label-${label.toLowerCase().replace(/\s+/g, "-")}`
|
|
47
47
|
},
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ React.createElement(Text, null, label),
|
|
49
|
+
/* @__PURE__ */ React.createElement(Text, null, value, suffix && suffix)
|
|
50
50
|
),
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ React.createElement(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
54
|
className: "meter-wrapper",
|
|
55
55
|
role: "presentation"
|
|
56
56
|
},
|
|
57
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ React.createElement(
|
|
58
58
|
Element,
|
|
59
59
|
{
|
|
60
60
|
as: "meter",
|
|
@@ -76,7 +76,7 @@ const Meter = React__default.forwardRef(
|
|
|
76
76
|
"aria-describedby": description ? `meter-description-${label == null ? void 0 : label.toLowerCase().replace(/\s+/g, "-")}` : void 0
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
|
-
showOptimumMarker && optimum && /* @__PURE__ */
|
|
79
|
+
showOptimumMarker && optimum && /* @__PURE__ */ React.createElement(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: "optimum-marker",
|
|
@@ -87,7 +87,7 @@ const Meter = React__default.forwardRef(
|
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
),
|
|
90
|
-
description && /* @__PURE__ */
|
|
90
|
+
description && /* @__PURE__ */ React.createElement(
|
|
91
91
|
"div",
|
|
92
92
|
{
|
|
93
93
|
id: `meter-description-${label == null ? void 0 : label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React, { useEffect } from "react";
|
|
4
4
|
import { Element } from "../Element/Element.js";
|
|
5
5
|
import { Text } from "../Typography/Text.js";
|
|
6
|
-
const Modal =
|
|
6
|
+
const Modal = React.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
id,
|
|
9
9
|
children,
|
|
@@ -32,7 +32,7 @@ const Modal = React__default.forwardRef(
|
|
|
32
32
|
document.addEventListener("keydown", handleEscape);
|
|
33
33
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
34
34
|
}, [id, isDismissible]);
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ React.createElement(
|
|
36
36
|
Element,
|
|
37
37
|
{
|
|
38
38
|
as: "dialog",
|
|
@@ -47,7 +47,7 @@ const Modal = React__default.forwardRef(
|
|
|
47
47
|
"aria-describedby": descriptionId,
|
|
48
48
|
...props
|
|
49
49
|
},
|
|
50
|
-
isDismissible && /* @__PURE__ */
|
|
50
|
+
isDismissible && /* @__PURE__ */ React.createElement(
|
|
51
51
|
Text,
|
|
52
52
|
{
|
|
53
53
|
className: "dismiss-button",
|
|
@@ -57,8 +57,8 @@ const Modal = React__default.forwardRef(
|
|
|
57
57
|
},
|
|
58
58
|
"×"
|
|
59
59
|
),
|
|
60
|
-
description && /* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
60
|
+
description && /* @__PURE__ */ React.createElement("div", { id: descriptionId, className: "sr-only" }, description),
|
|
61
|
+
/* @__PURE__ */ React.createElement("div", { role: "document" }, children)
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React, { useState, useEffect } from "react";
|
|
4
4
|
import { Div } from "../../Element/Tags.js";
|
|
5
5
|
import { Element } from "../../Element/Element.js";
|
|
6
|
-
const NotificationItem =
|
|
6
|
+
const NotificationItem = React.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
showWhen,
|
|
9
9
|
closeWhen,
|
|
@@ -53,7 +53,7 @@ const NotificationItem = React__default.forwardRef(
|
|
|
53
53
|
error: "alert",
|
|
54
54
|
success: "status"
|
|
55
55
|
};
|
|
56
|
-
return isVisible && /* @__PURE__ */
|
|
56
|
+
return isVisible && /* @__PURE__ */ React.createElement(
|
|
57
57
|
Element,
|
|
58
58
|
{
|
|
59
59
|
as: "div",
|
|
@@ -67,8 +67,8 @@ const NotificationItem = React__default.forwardRef(
|
|
|
67
67
|
"aria-label": title,
|
|
68
68
|
...props
|
|
69
69
|
},
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
isDismissible && /* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ React.createElement("div", { id: `notification-content-${props.id}` }, children, description && /* @__PURE__ */ React.createElement("span", { className: "sr-only" }, description)),
|
|
71
|
+
isDismissible && /* @__PURE__ */ React.createElement(
|
|
72
72
|
Div,
|
|
73
73
|
{
|
|
74
74
|
className: "dismiss-button",
|
|
@@ -77,7 +77,7 @@ const NotificationItem = React__default.forwardRef(
|
|
|
77
77
|
"aria-label": "Dismiss notification",
|
|
78
78
|
tabIndex: 0
|
|
79
79
|
},
|
|
80
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ React.createElement("span", { className: "sr-only" }, "Close notification")
|
|
81
81
|
)
|
|
82
82
|
);
|
|
83
83
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
|
-
const NotificationsWrapper =
|
|
5
|
+
const NotificationsWrapper = React.forwardRef(
|
|
6
6
|
({
|
|
7
7
|
position = "right",
|
|
8
8
|
anchor = "top",
|
|
@@ -15,9 +15,9 @@ const NotificationsWrapper = React__default.forwardRef(
|
|
|
15
15
|
if (position) classNames.push(position);
|
|
16
16
|
if (anchor) classNames.push(anchor);
|
|
17
17
|
if (order) classNames.push(order);
|
|
18
|
-
const childrenCount =
|
|
18
|
+
const childrenCount = React.Children.count(children);
|
|
19
19
|
if (childrenCount === 0) return null;
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ React.createElement(
|
|
21
21
|
Element,
|
|
22
22
|
{
|
|
23
23
|
as: "section",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React, { createContext, useState, useCallback, useContext } from "react";
|
|
4
4
|
import { Element } from "../Element/Element.js";
|
|
5
5
|
import { Card } from "../Card/Card.js";
|
|
6
6
|
const OptionCardsContext = createContext({
|
|
@@ -43,7 +43,7 @@ const OptionCardsGroup = ({
|
|
|
43
43
|
const isSelected = useCallback((id) => {
|
|
44
44
|
return selectedIds.has(id);
|
|
45
45
|
}, [selectedIds]);
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ React.createElement(OptionCardsContext.Provider, { value: { isSelected, toggleSelection, showTickIcon, tickPosition } }, /* @__PURE__ */ React.createElement("div", { "data-option-cards-group": true, className: `tick-${tickPosition}` }, children));
|
|
47
47
|
};
|
|
48
48
|
const useOptionCard = (id) => {
|
|
49
49
|
const context = useContext(OptionCardsContext);
|
|
@@ -93,7 +93,7 @@ const OptionCard = ({ id, children, disabled = false, ...props }) => {
|
|
|
93
93
|
toggleSelection();
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ React.createElement(
|
|
97
97
|
Element,
|
|
98
98
|
{
|
|
99
99
|
as: Card,
|
|
@@ -109,7 +109,7 @@ const OptionCard = ({ id, children, disabled = false, ...props }) => {
|
|
|
109
109
|
onMouseLeave: handleMouseLeave,
|
|
110
110
|
...props
|
|
111
111
|
},
|
|
112
|
-
showTickIcon && /* @__PURE__ */
|
|
112
|
+
showTickIcon && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24", className: "tick-icon" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "11" }), /* @__PURE__ */ React.createElement("path", { d: "M8 13 L11 15 L16 9" })), /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24", className: "deselect-icon" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "11" }), /* @__PURE__ */ React.createElement("path", { d: "M8 8 L16 16 M16 8 L8 16" }))),
|
|
113
113
|
children
|
|
114
114
|
);
|
|
115
115
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import
|
|
3
|
+
import React from "react";
|
|
4
4
|
import { Element } from "../Element/Element.js";
|
|
5
5
|
import { Div } from "../Element/Tags.js";
|
|
6
6
|
import { Text } from "../Typography/Text.js";
|
|
@@ -17,7 +17,7 @@ const defaultRenderItem = ({
|
|
|
17
17
|
...props
|
|
18
18
|
}) => {
|
|
19
19
|
if (type === "ellipsis") {
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ React.createElement(Text, { className: "pagination-ellipsis" }, "...");
|
|
21
21
|
}
|
|
22
22
|
const paginationItemProps = {
|
|
23
23
|
type: "button",
|
|
@@ -29,21 +29,21 @@ const defaultRenderItem = ({
|
|
|
29
29
|
let content;
|
|
30
30
|
switch (type) {
|
|
31
31
|
case "first":
|
|
32
|
-
content = content = /* @__PURE__ */
|
|
32
|
+
content = content = /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24" }, /* @__PURE__ */ React.createElement("line", { x1: "5", y1: "18", x2: "5", y2: "6" }), /* @__PURE__ */ React.createElement("polyline", { points: "14 18 9 12 14 6" }), /* @__PURE__ */ React.createElement("line", { x1: "10", y1: "12", x2: "19", y2: "12" }));
|
|
33
33
|
break;
|
|
34
34
|
case "previous":
|
|
35
|
-
content = /* @__PURE__ */
|
|
35
|
+
content = /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24" }, /* @__PURE__ */ React.createElement("polyline", { points: "12 18 7 12 12 6" }), /* @__PURE__ */ React.createElement("line", { x1: "8", y1: "12", x2: "17", y2: "12" }));
|
|
36
36
|
break;
|
|
37
37
|
case "next":
|
|
38
|
-
content = content = /* @__PURE__ */
|
|
38
|
+
content = content = /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24" }, /* @__PURE__ */ React.createElement("polyline", { points: "12 6 17 12 12 18" }), /* @__PURE__ */ React.createElement("line", { x1: "16", y1: "12", x2: "7", y2: "12" }));
|
|
39
39
|
break;
|
|
40
40
|
case "last":
|
|
41
|
-
content = content = /* @__PURE__ */
|
|
41
|
+
content = content = /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 24 24" }, /* @__PURE__ */ React.createElement("polyline", { points: "10 6 15 12 10 18" }), /* @__PURE__ */ React.createElement("line", { x1: "19", y1: "6", x2: "19", y2: "18" }), /* @__PURE__ */ React.createElement("line", { x1: "14", y1: "12", x2: "5", y2: "12" }));
|
|
42
42
|
break;
|
|
43
43
|
default:
|
|
44
44
|
content = page;
|
|
45
45
|
}
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ React.createElement(
|
|
47
47
|
Button,
|
|
48
48
|
{
|
|
49
49
|
kind: "custom",
|
|
@@ -52,7 +52,7 @@ const defaultRenderItem = ({
|
|
|
52
52
|
content
|
|
53
53
|
);
|
|
54
54
|
};
|
|
55
|
-
const Pagination =
|
|
55
|
+
const Pagination = React.forwardRef(
|
|
56
56
|
({
|
|
57
57
|
totalItems,
|
|
58
58
|
currentPage,
|
|
@@ -85,7 +85,7 @@ const Pagination = React__default.forwardRef(
|
|
|
85
85
|
currentPage,
|
|
86
86
|
itemsToShowEachSide
|
|
87
87
|
});
|
|
88
|
-
const [goToPage, setGoToPage] =
|
|
88
|
+
const [goToPage, setGoToPage] = React.useState("");
|
|
89
89
|
const handlePageInputChange = (e) => {
|
|
90
90
|
setGoToPage(e.target.value);
|
|
91
91
|
};
|
|
@@ -99,7 +99,7 @@ const Pagination = React__default.forwardRef(
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
if (totalItems === 0) {
|
|
102
|
-
return /* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ React.createElement(Text, { className: "pagination-empty" }, emptyText || "No items to display");
|
|
103
103
|
}
|
|
104
104
|
let classNames = ["pagination"];
|
|
105
105
|
if (kind) {
|
|
@@ -111,7 +111,7 @@ const Pagination = React__default.forwardRef(
|
|
|
111
111
|
if (isLoading) {
|
|
112
112
|
classNames.push("loading");
|
|
113
113
|
}
|
|
114
|
-
return /* @__PURE__ */
|
|
114
|
+
return /* @__PURE__ */ React.createElement(
|
|
115
115
|
Element,
|
|
116
116
|
{
|
|
117
117
|
as: "nav",
|
|
@@ -122,7 +122,7 @@ const Pagination = React__default.forwardRef(
|
|
|
122
122
|
"aria-label": "pagination",
|
|
123
123
|
...props
|
|
124
124
|
},
|
|
125
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ React.createElement(Div, { className: "pagination-controls" }, showGoToFirstItemButton && (!hideDisabledButtons || hasPrevPage) && renderItem({
|
|
126
126
|
type: "first",
|
|
127
127
|
disabled: !hasPrevPage || disabled,
|
|
128
128
|
selected: false,
|
|
@@ -158,8 +158,8 @@ const Pagination = React__default.forwardRef(
|
|
|
158
158
|
disabled: !hasNextPage || disabled,
|
|
159
159
|
selected: false,
|
|
160
160
|
onClick: () => onPageChange(totalPages)
|
|
161
|
-
}), isLoading && /* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
161
|
+
}), isLoading && /* @__PURE__ */ React.createElement(Div, { className: "pagination-loading" }, /* @__PURE__ */ React.createElement(Spinner, null), loadingText && /* @__PURE__ */ React.createElement(Text, { size: "small" }, loadingText))),
|
|
162
|
+
/* @__PURE__ */ React.createElement(Div, { className: "pagination-info" }, /* @__PURE__ */ React.createElement(Text, { size: "small" }, "Showing ", itemDisplayText, " ", rangeStart, " of ", totalItems), showGoToInput && /* @__PURE__ */ React.createElement(Div, { className: "pagination-go-to" }, /* @__PURE__ */ React.createElement(
|
|
163
163
|
"input",
|
|
164
164
|
{
|
|
165
165
|
type: "number",
|