fictoan-react 1.9.3 → 1.10.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/components/Accordion/Accordion.js +1 -0
- package/dist/components/Badge/Badge.js +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +76 -0
- package/dist/components/Breadcrumbs/index.js +1 -3
- package/dist/components/Button/Button.js +1 -0
- package/dist/components/Callout/Callout.js +1 -0
- package/dist/components/Card/Card.js +1 -0
- package/dist/components/CodeBlock/CodeBlock.js +1 -0
- package/dist/components/Divider/Divider.js +1 -0
- package/dist/components/Drawer/Drawer.js +2 -1
- package/dist/components/Element/Element.js +1 -3
- package/dist/components/Form/BaseInputComponent/BaseInputComponent.js +5 -4
- package/dist/components/Form/Checkbox/Checkbox.js +1 -0
- package/dist/components/Form/Checkbox/Switch.js +1 -0
- package/dist/components/Form/Form/Form.js +1 -0
- package/dist/components/Form/FormItem/FormItem.js +1 -0
- package/dist/components/Form/FormItemGroup/FormItemGroup.js +1 -0
- package/dist/components/Form/InputField/InputField.js +49 -3
- package/dist/components/Form/ListBox/ListBox.js +2 -1
- package/dist/components/Form/PinInputField/PinInputField.js +1 -0
- package/dist/components/Form/RadioButton/RadioButton.js +1 -0
- package/dist/components/Form/RadioButton/RadioTabGroup.js +1 -0
- package/dist/components/Form/Range/Range.js +1 -0
- package/dist/components/Form/Select/Select.js +1 -0
- package/dist/components/Form/TextArea/TextArea.js +1 -0
- package/dist/components/Meter/Meter.js +1 -0
- package/dist/components/Modal/Modal.js +1 -0
- package/dist/components/Notification/NotificationItem/NotificationItem.js +1 -0
- package/dist/components/Notification/NotificationsWrapper/NotificationsWrapper.js +1 -0
- package/dist/components/OptionCard/OptionCard.js +1 -0
- package/dist/components/Pagination/Pagination.js +1 -0
- package/dist/components/Portion/Portion.js +1 -0
- package/dist/components/ProgressBar/ProgressBar.js +1 -0
- package/dist/components/Row/Row.js +1 -0
- package/dist/components/Sidebar/ContentWrapper/ContentWrapper.js +1 -0
- package/dist/components/Sidebar/SidebarFooter/SidebarFooter.js +1 -0
- package/dist/components/Sidebar/SidebarHeader/SidebarHeader.js +1 -0
- package/dist/components/Sidebar/SidebarItem/SidebarItem.js +1 -0
- package/dist/components/Sidebar/SidebarWrapper/SidebarWrapper.js +2 -1
- package/dist/components/Skeleton/Skeleton.js +1 -0
- package/dist/components/Spinner/Spinner.js +1 -0
- package/dist/components/Table/Table.js +1 -0
- package/dist/components/Tabs/Tabs.js +1 -0
- package/dist/components/Toast/ToastItem/ToastItem.js +1 -0
- package/dist/components/Toast/ToastsWrapper/ToastsWrapper.js +1 -0
- package/dist/components/Tooltip/Tooltip.js +1 -0
- package/dist/components/index.js +1 -3
- package/dist/{UseClickOutside-CJ5IQE6n.js → hooks/UseClickOutside.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +11 -4
- package/dist/types/Accordion.d.ts +99 -0
- package/dist/types/Badge.d.ts +100 -0
- package/dist/types/BaseInputComponent.d.ts +138 -0
- package/dist/types/Breadcrumbs.d.ts +103 -0
- package/dist/types/Button.d.ts +103 -0
- package/dist/types/Callout.d.ts +99 -0
- package/dist/types/Card.d.ts +96 -0
- package/dist/types/Checkbox.d.ts +112 -0
- package/dist/types/CodeBlock.d.ts +103 -0
- package/dist/types/ContentWrapper.d.ts +96 -0
- package/dist/types/Divider.d.ts +98 -0
- package/dist/types/Drawer.d.ts +103 -0
- package/dist/types/Element.d.ts +95 -0
- package/dist/types/FileUpload.d.ts +147 -0
- package/dist/types/Form.d.ts +161 -0
- package/dist/types/FormGenerator.d.ts +150 -0
- package/dist/types/FormItem.d.ts +92 -0
- package/dist/types/FormItemGroup.d.ts +98 -0
- package/dist/types/Heading.d.ts +109 -0
- package/dist/types/InputField.d.ts +130 -0
- package/dist/types/InputLabel.d.ts +98 -0
- package/dist/types/ListBox.d.ts +117 -0
- package/dist/types/Meter.d.ts +114 -0
- package/dist/types/Modal.d.ts +107 -0
- package/dist/types/NotificationItem.d.ts +102 -0
- package/dist/types/NotificationsWrapper.d.ts +99 -0
- package/dist/types/OptionCard.d.ts +121 -0
- package/dist/types/Pagination.d.ts +118 -0
- package/dist/types/PinInputField.d.ts +107 -0
- package/dist/types/Portion.d.ts +103 -0
- package/dist/types/ProgressBar.d.ts +106 -0
- package/dist/types/RadioButton.d.ts +112 -0
- package/dist/types/RadioGroup.d.ts +122 -0
- package/dist/types/RadioTabGroup.d.ts +128 -0
- package/dist/types/Range.d.ts +108 -0
- package/dist/types/Row.d.ts +102 -0
- package/dist/types/Select.d.ts +102 -0
- package/dist/types/SidebarFooter.d.ts +96 -0
- package/dist/types/SidebarHeader.d.ts +96 -0
- package/dist/types/SidebarItem.d.ts +109 -0
- package/dist/types/SidebarWrapper.d.ts +98 -0
- package/dist/types/Skeleton.d.ts +115 -0
- package/dist/types/Spinner.d.ts +97 -0
- package/dist/types/Switch.d.ts +116 -0
- package/dist/types/Table.d.ts +103 -0
- package/dist/types/Tabs.d.ts +107 -0
- package/dist/types/Tags.d.ts +111 -0
- package/dist/types/Text.d.ts +101 -0
- package/dist/types/TextArea.d.ts +110 -0
- package/dist/types/ThemeProvider.d.ts +106 -0
- package/dist/types/ToastItem.d.ts +98 -0
- package/dist/types/ToastsWrapper.d.ts +96 -0
- package/dist/types/Tooltip.d.ts +98 -0
- package/dist/types/components/Accordion/Accordion.d.ts +12 -0
- package/dist/types/components/Accordion/index.d.ts +2 -0
- package/dist/types/components/Badge/Badge.d.ts +14 -0
- package/dist/types/components/Badge/index.d.ts +2 -0
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +16 -0
- package/dist/types/components/Breadcrumbs/index.d.ts +2 -0
- package/dist/types/components/Button/Button.d.ts +15 -0
- package/dist/types/components/Button/index.d.ts +2 -0
- package/dist/types/components/Callout/Callout.d.ts +12 -0
- package/dist/types/components/Callout/index.d.ts +2 -0
- package/dist/types/components/Card/Card.d.ts +10 -0
- package/dist/types/components/Card/index.d.ts +2 -0
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +17 -0
- package/dist/types/components/CodeBlock/index.d.ts +2 -0
- package/dist/types/components/Divider/Divider.d.ts +12 -0
- package/dist/types/components/Divider/index.d.ts +2 -0
- package/dist/types/components/Drawer/Drawer.d.ts +17 -0
- package/dist/types/components/Drawer/index.d.ts +2 -0
- package/dist/types/components/Element/Element.d.ts +7 -0
- package/dist/types/components/Element/Tags.d.ts +14 -0
- package/dist/types/components/Element/constants.d.ts +77 -0
- package/dist/types/components/Element/index.d.ts +4 -0
- package/dist/types/components/Form/BaseInputComponent/BaseInputComponent.d.ts +8 -0
- package/dist/types/components/Form/BaseInputComponent/constants.d.ts +42 -0
- package/dist/types/components/Form/Checkbox/Checkbox.d.ts +7 -0
- package/dist/types/components/Form/Checkbox/Switch.d.ts +10 -0
- package/dist/types/components/Form/Form/Form.d.ts +14 -0
- package/dist/types/components/Form/Form/FormGenerator.d.ts +21 -0
- package/dist/types/components/Form/FormItem/FormItem.d.ts +7 -0
- package/dist/types/components/Form/FormItemGroup/FormItemGroup.d.ts +12 -0
- package/dist/types/components/Form/InputField/FileUpload.d.ts +15 -0
- package/dist/types/components/Form/InputField/InputField.d.ts +9 -0
- package/dist/types/components/Form/InputLabel/InputLabel.d.ts +12 -0
- package/dist/types/components/Form/ListBox/ListBox.d.ts +4 -0
- package/dist/types/components/Form/ListBox/constants.d.ts +33 -0
- package/dist/types/components/Form/ListBox/listBoxUtils.d.ts +7 -0
- package/dist/types/components/Form/PinInputField/PinInputField.d.ts +22 -0
- package/dist/types/components/Form/PinInputField/index.d.ts +2 -0
- package/dist/types/components/Form/RadioButton/RadioButton.d.ts +5 -0
- package/dist/types/components/Form/RadioButton/RadioGroup.d.ts +4 -0
- package/dist/types/components/Form/RadioButton/RadioTabGroup.d.ts +5 -0
- package/dist/types/components/Form/RadioButton/constants.d.ts +19 -0
- package/dist/types/components/Form/Range/Range.d.ts +14 -0
- package/dist/types/components/Form/Range/index.d.ts +2 -0
- package/dist/types/components/Form/Select/Select.d.ts +4 -0
- package/dist/types/components/Form/Select/constants.d.ts +22 -0
- package/dist/types/components/Form/TextArea/TextArea.d.ts +9 -0
- package/dist/types/components/Form/index.d.ts +20 -0
- package/dist/types/components/Meter/Meter.d.ts +26 -0
- package/dist/types/components/Meter/index.d.ts +2 -0
- package/dist/types/components/Modal/Modal.d.ts +18 -0
- package/dist/types/components/Modal/index.d.ts +2 -0
- package/dist/types/components/Notification/NotificationItem/NotificationItem.d.ts +16 -0
- package/dist/types/components/Notification/NotificationsWrapper/NotificationsWrapper.d.ts +13 -0
- package/dist/types/components/Notification/index.d.ts +3 -0
- package/dist/types/components/OptionCard/OptionCard.d.ts +24 -0
- package/dist/types/components/OptionCard/index.d.ts +3 -0
- package/dist/types/components/Pagination/Pagination.d.ts +4 -0
- package/dist/types/components/Pagination/constants.d.ts +34 -0
- package/dist/types/components/Pagination/index.d.ts +3 -0
- package/dist/types/components/Pagination/usePagination.d.ts +16 -0
- package/dist/types/components/Portion/Portion.d.ts +16 -0
- package/dist/types/components/Portion/index.d.ts +2 -0
- package/dist/types/components/Portion/types.d.ts +2 -0
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +18 -0
- package/dist/types/components/ProgressBar/index.d.ts +2 -0
- package/dist/types/components/Row/Row.d.ts +17 -0
- package/dist/types/components/Row/index.d.ts +2 -0
- package/dist/types/components/Sidebar/ContentWrapper/ContentWrapper.d.ts +11 -0
- package/dist/types/components/Sidebar/SidebarFooter/SidebarFooter.d.ts +10 -0
- package/dist/types/components/Sidebar/SidebarHeader/SidebarHeader.d.ts +10 -0
- package/dist/types/components/Sidebar/SidebarItem/SidebarItem.d.ts +22 -0
- package/dist/types/components/Sidebar/SidebarWrapper/SidebarWrapper.d.ts +12 -0
- package/dist/types/components/Sidebar/index.d.ts +6 -0
- package/dist/types/components/Skeleton/Skeleton.d.ts +26 -0
- package/dist/types/components/Skeleton/index.d.ts +2 -0
- package/dist/types/components/Spinner/Spinner.d.ts +11 -0
- package/dist/types/components/Spinner/index.d.ts +2 -0
- package/dist/types/components/Table/Table.d.ts +17 -0
- package/dist/types/components/Table/index.d.ts +2 -0
- package/dist/types/components/Tabs/Tabs.d.ts +21 -0
- package/dist/types/components/Tabs/index.d.ts +2 -0
- package/dist/types/components/ThemeProvider/ThemeProvider.d.ts +12 -0
- package/dist/types/components/ThemeProvider/index.d.ts +2 -0
- package/dist/types/components/ThemeProvider/types.d.ts +8 -0
- package/dist/types/components/Toast/ToastItem/ToastItem.d.ts +12 -0
- package/dist/types/components/Toast/ToastsWrapper/ToastsWrapper.d.ts +10 -0
- package/dist/types/components/Toast/index.d.ts +3 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +12 -0
- package/dist/types/components/Tooltip/index.d.ts +2 -0
- package/dist/types/components/Typography/Heading.d.ts +19 -0
- package/dist/types/components/Typography/Text.d.ts +14 -0
- package/dist/types/components/Typography/index.d.ts +3 -0
- package/dist/types/components/index.d.ts +30 -0
- package/dist/types/constants.d.ts +96 -0
- package/dist/types/index.d.ts +99 -0
- package/dist/types/listBoxUtils.d.ts +18 -0
- package/dist/types/types.d.ts +3 -0
- package/dist/types/usePagination.d.ts +18 -0
- package/dist/utils/classNames.js +8 -0
- package/package.json +14 -4
- package/dist/components/Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js +0 -26
- package/dist/components/Breadcrumbs/Breadcrumbs/Breadcrumbs.js +0 -13
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Element } from "../Element/Element.js";
|
|
5
5
|
import { Text } from "../Typography/Text.js";
|
|
6
|
+
/* empty css */
|
|
6
7
|
const Accordion = React.forwardRef(
|
|
7
8
|
({ summary, children, open = false, ...props }, ref) => {
|
|
8
9
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client;";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Element } from "../Element/Element.js";
|
|
5
|
+
import "../Element/Tags.js";
|
|
6
|
+
import { Text } from "../Typography/Text.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
const BreadcrumbItem = React.forwardRef(
|
|
9
|
+
({ children, current, ...props }, ref) => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement(
|
|
11
|
+
Element,
|
|
12
|
+
{
|
|
13
|
+
as: "li",
|
|
14
|
+
"data-breadcrumb-item": true,
|
|
15
|
+
ref,
|
|
16
|
+
...props,
|
|
17
|
+
"aria-current": current ? "page" : void 0,
|
|
18
|
+
className: current ? "current" : void 0,
|
|
19
|
+
role: "listitem"
|
|
20
|
+
},
|
|
21
|
+
/* @__PURE__ */ React.createElement("span", { className: "breadcrumb-content" }, children)
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
const Separator = ({ separator }) => /* @__PURE__ */ React.createElement(
|
|
26
|
+
Text,
|
|
27
|
+
{
|
|
28
|
+
className: "breadcrumb-separator",
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
role: "presentation",
|
|
31
|
+
margin: "none"
|
|
32
|
+
},
|
|
33
|
+
separator
|
|
34
|
+
);
|
|
35
|
+
const Breadcrumbs = React.forwardRef(
|
|
36
|
+
({ children, separator = "/", spacing, ...props }, ref) => {
|
|
37
|
+
let classNames = [];
|
|
38
|
+
if (spacing) {
|
|
39
|
+
classNames.push(`spacing-${spacing}`);
|
|
40
|
+
}
|
|
41
|
+
const childrenArray = React.Children.toArray(children).filter(Boolean);
|
|
42
|
+
const processedChildren = childrenArray.reduce((acc, child, index) => {
|
|
43
|
+
if (!React.isValidElement(child)) return acc;
|
|
44
|
+
const isLast = index === childrenArray.length - 1;
|
|
45
|
+
let breadcrumbItem;
|
|
46
|
+
if (child.type === BreadcrumbItem) {
|
|
47
|
+
breadcrumbItem = React.cloneElement(child, {
|
|
48
|
+
...child.props,
|
|
49
|
+
current: isLast
|
|
50
|
+
});
|
|
51
|
+
} else {
|
|
52
|
+
breadcrumbItem = /* @__PURE__ */ React.createElement(BreadcrumbItem, { key: `item-${index}`, current: isLast }, child);
|
|
53
|
+
}
|
|
54
|
+
acc.push(breadcrumbItem);
|
|
55
|
+
if (!isLast) {
|
|
56
|
+
acc.push(
|
|
57
|
+
/* @__PURE__ */ React.createElement(Separator, { key: `sep-${index}`, separator })
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return acc;
|
|
61
|
+
}, []);
|
|
62
|
+
return /* @__PURE__ */ React.createElement("nav", { "aria-label": "Breadcrumb", ref, ...props }, /* @__PURE__ */ React.createElement(
|
|
63
|
+
Element,
|
|
64
|
+
{
|
|
65
|
+
as: "ul",
|
|
66
|
+
"data-breadcrumbs-wrapper": true,
|
|
67
|
+
role: "list",
|
|
68
|
+
classNames
|
|
69
|
+
},
|
|
70
|
+
processedChildren
|
|
71
|
+
));
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
export {
|
|
75
|
+
Breadcrumbs
|
|
76
|
+
};
|
|
@@ -4,6 +4,7 @@ import React, { useState, useRef, useEffect, useCallback } from "react";
|
|
|
4
4
|
import { Element } from "../Element/Element.js";
|
|
5
5
|
import { Button } from "../Button/Button.js";
|
|
6
6
|
import { Badge } from "../Badge/Badge.js";
|
|
7
|
+
/* empty css */
|
|
7
8
|
const CodeBlock = React.forwardRef(({
|
|
8
9
|
children,
|
|
9
10
|
source,
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import React, { useState, useRef, useEffect } from "react";
|
|
4
4
|
import { Element } from "../Element/Element.js";
|
|
5
5
|
import { Div } from "../Element/Tags.js";
|
|
6
|
-
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { useClickOutside } from "../../hooks/UseClickOutside.js";
|
|
7
8
|
const Drawer = React.forwardRef(
|
|
8
9
|
({
|
|
9
10
|
children,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
3
|
import React from "react";
|
|
4
|
-
|
|
5
|
-
return classNames.filter((item) => !!item).join(" ");
|
|
6
|
-
};
|
|
4
|
+
import { createClassName } from "../../utils/classNames.js";
|
|
7
5
|
const Element = React.forwardRef(
|
|
8
6
|
({
|
|
9
7
|
as: Component = "div",
|
|
@@ -14,6 +14,7 @@ const BaseInputComponent = React.forwardRef(
|
|
|
14
14
|
errorText,
|
|
15
15
|
validateThis,
|
|
16
16
|
classNames,
|
|
17
|
+
children,
|
|
17
18
|
...inputProps
|
|
18
19
|
}, ref) => /* @__PURE__ */ React.createElement(
|
|
19
20
|
FormItem,
|
|
@@ -21,7 +22,8 @@ const BaseInputComponent = React.forwardRef(
|
|
|
21
22
|
"data-form-item": true,
|
|
22
23
|
required: inputProps.required
|
|
23
24
|
},
|
|
24
|
-
/* @__PURE__ */ React.createElement(
|
|
25
|
+
label && /* @__PURE__ */ React.createElement(InputLabel, { label, htmlFor: inputProps.id }),
|
|
26
|
+
/* @__PURE__ */ React.createElement(Div, { "data-input-wrapper": true }, /* @__PURE__ */ React.createElement(
|
|
25
27
|
Element,
|
|
26
28
|
{
|
|
27
29
|
as: Component,
|
|
@@ -32,9 +34,8 @@ const BaseInputComponent = React.forwardRef(
|
|
|
32
34
|
].concat(classNames || []),
|
|
33
35
|
...inputProps
|
|
34
36
|
}
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
(helpText || errorText) && /* @__PURE__ */ React.createElement(Div, { className: "info-section vertically-center-items", marginTop: "nano" }, helpText && /* @__PURE__ */ React.createElement(Element, { as: "span", className: "help-text" }, helpText), errorText && /* @__PURE__ */ React.createElement(Element, { as: "span", className: "error-text" }, errorText))
|
|
37
|
+
), children),
|
|
38
|
+
(helpText || errorText) && /* @__PURE__ */ React.createElement(Div, { className: "info-section vertically-center-items" }, helpText && /* @__PURE__ */ React.createElement(Element, { as: "span", className: "help-text" }, helpText), errorText && /* @__PURE__ */ React.createElement(Element, { as: "span", className: "error-text" }, errorText))
|
|
38
39
|
)
|
|
39
40
|
);
|
|
40
41
|
export {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
5
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
6
|
+
/* empty css */
|
|
6
7
|
const Checkbox = React.forwardRef(({ ...props }, ref) => {
|
|
7
8
|
return /* @__PURE__ */ React.createElement(Element, { as: "div", "data-checkbox": true, ref }, /* @__PURE__ */ React.createElement(BaseInputComponent, { as: "input", type: "checkbox", ...props }));
|
|
8
9
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
5
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
6
|
+
/* empty css */
|
|
6
7
|
const Switch = React.forwardRef(
|
|
7
8
|
({ size = "medium", ...props }, ref) => {
|
|
8
9
|
return /* @__PURE__ */ React.createElement(Element, { as: "div", "data-switch": true, ref, className: `size-${size}` }, /* @__PURE__ */ React.createElement(BaseInputComponent, { as: "input", type: "checkbox", ...props }));
|
|
@@ -4,6 +4,7 @@ import React from "react";
|
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
5
|
import { Callout } from "../../Callout/Callout.js";
|
|
6
6
|
import { generateFormThroughConfig } from "./FormGenerator.js";
|
|
7
|
+
/* empty css */
|
|
7
8
|
const Form = React.forwardRef(
|
|
8
9
|
({ spacing = "small", fields, onFieldsChange, children, errorText, ...props }, ref) => {
|
|
9
10
|
let classNames = [];
|
|
@@ -2,25 +2,71 @@
|
|
|
2
2
|
"use client;";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
5
|
+
import { Div } from "../../Element/Tags.js";
|
|
6
|
+
/* empty css */
|
|
5
7
|
const InputField = React.forwardRef(
|
|
6
8
|
({
|
|
7
9
|
"aria-label": ariaLabel,
|
|
8
10
|
"aria-invalid": ariaInvalid,
|
|
11
|
+
iconLeft,
|
|
12
|
+
iconRight,
|
|
13
|
+
stringLeft,
|
|
14
|
+
stringRight,
|
|
9
15
|
...props
|
|
10
16
|
}, ref) => {
|
|
11
|
-
|
|
17
|
+
const renderSideElement = (content, position) => {
|
|
18
|
+
if (!content) return null;
|
|
19
|
+
const isText = typeof content === "string";
|
|
20
|
+
const elementRef = React.useRef(null);
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
if (isText && elementRef.current) {
|
|
23
|
+
const width = elementRef.current.getBoundingClientRect().width;
|
|
24
|
+
const propertyName = `--side-element-${position}-width`;
|
|
25
|
+
elementRef.current.closest("[data-form-item]").style.setProperty(
|
|
26
|
+
propertyName,
|
|
27
|
+
`${width}px`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}, [content, isText, position]);
|
|
31
|
+
return /* @__PURE__ */ React.createElement(
|
|
32
|
+
Div,
|
|
33
|
+
{
|
|
34
|
+
ref: elementRef,
|
|
35
|
+
"data-input-side-element": true,
|
|
36
|
+
className: `${position} ${isText ? "is-text" : "is-icon"}`,
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
},
|
|
39
|
+
content
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
const hasLeftElement = Boolean(iconLeft || stringLeft);
|
|
43
|
+
const hasRightElement = Boolean(iconRight || stringRight);
|
|
44
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
12
45
|
BaseInputComponent,
|
|
13
46
|
{
|
|
14
47
|
as: "input",
|
|
15
48
|
"data-input-field": true,
|
|
16
49
|
ref,
|
|
50
|
+
className: [
|
|
51
|
+
hasLeftElement ? "with-left-element" : "",
|
|
52
|
+
hasRightElement ? "with-right-element" : ""
|
|
53
|
+
].filter(Boolean).join(" "),
|
|
17
54
|
"aria-label": ariaLabel || props.label,
|
|
18
55
|
"aria-invalid": ariaInvalid || props.invalid || void 0,
|
|
19
56
|
"aria-required": props.required,
|
|
20
57
|
placeholder: " ",
|
|
21
58
|
...props
|
|
22
|
-
}
|
|
23
|
-
|
|
59
|
+
},
|
|
60
|
+
/* @__PURE__ */ React.createElement(
|
|
61
|
+
Div,
|
|
62
|
+
{
|
|
63
|
+
"data-input-helper": true,
|
|
64
|
+
"aria-hidden": "true"
|
|
65
|
+
},
|
|
66
|
+
renderSideElement(iconLeft || stringLeft, "left"),
|
|
67
|
+
renderSideElement(iconRight || stringRight, "right")
|
|
68
|
+
)
|
|
69
|
+
));
|
|
24
70
|
}
|
|
25
71
|
);
|
|
26
72
|
export {
|
|
@@ -6,7 +6,8 @@ import { InputField } from "../InputField/InputField.js";
|
|
|
6
6
|
import { Badge } from "../../Badge/Badge.js";
|
|
7
7
|
import { Text } from "../../Typography/Text.js";
|
|
8
8
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
9
|
-
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { useClickOutside } from "../../../hooks/UseClickOutside.js";
|
|
10
11
|
import { searchOptions } from "./listBoxUtils.js";
|
|
11
12
|
const ListBox = React.forwardRef(
|
|
12
13
|
({
|
|
@@ -3,6 +3,7 @@
|
|
|
3
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
|
+
/* empty css */
|
|
6
7
|
function validate(value, type) {
|
|
7
8
|
const NUMERIC_REGEX = /^[0-9]+$/;
|
|
8
9
|
const ALPHA_NUMERIC_REGEX = /^[a-zA-Z0-9]+$/i;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Div } from "../../Element/Tags.js";
|
|
5
5
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
6
|
+
/* empty css */
|
|
6
7
|
const RadioTabGroupOptions = ({ options, defaultValue, value, required, ...props }) => {
|
|
7
8
|
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
9
|
"input",
|
|
@@ -6,6 +6,7 @@ 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
|
+
/* empty css */
|
|
9
10
|
const Range = React.forwardRef(({ label, value, suffix, ...props }, ref) => {
|
|
10
11
|
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
12
|
BaseInputComponent,
|
|
@@ -4,6 +4,7 @@ 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
|
+
/* empty css */
|
|
7
8
|
const SelectWithOptions = ({ options, className, ...props }) => {
|
|
8
9
|
const renderOption = (option) => /* @__PURE__ */ React.createElement(Element, { as: "option", key: option.value, value: option.value, disabled: option.disabled }, option.label);
|
|
9
10
|
const renderOptGroup = (group) => /* @__PURE__ */ React.createElement(Element, { as: "optgroup", key: group.label, label: group.label }, group.options.map(renderOption));
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"use client;";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { BaseInputComponent } from "../BaseInputComponent/BaseInputComponent.js";
|
|
5
|
+
/* empty css */
|
|
5
6
|
const TextArea = React.forwardRef((props, ref) => {
|
|
6
7
|
return /* @__PURE__ */ React.createElement(BaseInputComponent, { as: "textarea", "data-textarea": true, ref, placeholder: " ", ...props });
|
|
7
8
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
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
|
+
/* empty css */
|
|
6
7
|
const OptionCardsContext = createContext({
|
|
7
8
|
isSelected: () => false,
|
|
8
9
|
toggleSelection: () => {
|
|
@@ -7,6 +7,7 @@ import { Text } from "../Typography/Text.js";
|
|
|
7
7
|
import { Spinner } from "../Spinner/Spinner.js";
|
|
8
8
|
import { Button } from "../Button/Button.js";
|
|
9
9
|
import { usePagination } from "./usePagination.js";
|
|
10
|
+
/* empty css */
|
|
10
11
|
const defaultRenderItem = ({
|
|
11
12
|
type,
|
|
12
13
|
page,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
5
|
import { Div } from "../../Element/Tags.js";
|
|
6
|
+
/* empty css */
|
|
6
7
|
const SidebarItem = React.forwardRef(
|
|
7
8
|
({ hasAlert, hasEmptyIcon, hasNoIcon, children, ...props }, ref) => {
|
|
8
9
|
let classNames = [];
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"use client;";
|
|
3
3
|
import React, { useRef, useImperativeHandle } from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
|
-
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { useClickOutside } from "../../../hooks/UseClickOutside.js";
|
|
6
7
|
const SidebarWrapper = React.forwardRef(
|
|
7
8
|
({
|
|
8
9
|
collapsed,
|
|
@@ -5,6 +5,7 @@ import { Element } from "../Element/Element.js";
|
|
|
5
5
|
import { Div } from "../Element/Tags.js";
|
|
6
6
|
import { Divider } from "../Divider/Divider.js";
|
|
7
7
|
import { Text } from "../Typography/Text.js";
|
|
8
|
+
/* empty css */
|
|
8
9
|
const Tabs = React.forwardRef(
|
|
9
10
|
({ tabs, additionalNavContentWrapper, defaultActiveTab, align = "left", ...props }, ref) => {
|
|
10
11
|
const index = tabs.findIndex((tab) => tab.key === defaultActiveTab);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"use client;";
|
|
3
3
|
import React, { useState, useEffect } from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
|
+
/* empty css */
|
|
5
6
|
const ToastItem = React.forwardRef(
|
|
6
7
|
({ showWhen, children, secondsToShowFor, closeWhen, ...props }, ref) => {
|
|
7
8
|
let classNames = [];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"use client;";
|
|
3
3
|
import React, { useState, useRef, useEffect } from "react";
|
|
4
4
|
import { Element } from "../Element/Element.js";
|
|
5
|
+
/* empty css */
|
|
5
6
|
const TOOLTIP_OFFSET = 8;
|
|
6
7
|
const SCREEN_PADDING = 16;
|
|
7
8
|
const calculatePosition = (tooltipElement, targetElement, position) => {
|
package/dist/components/index.js
CHANGED
|
@@ -4,8 +4,7 @@ import { Accordion } from "./Accordion/Accordion.js";
|
|
|
4
4
|
import { Badge } from "./Badge/Badge.js";
|
|
5
5
|
import { Drawer } from "./Drawer/Drawer.js";
|
|
6
6
|
import { Button } from "./Button/Button.js";
|
|
7
|
-
import { Breadcrumbs } from "./Breadcrumbs/Breadcrumbs
|
|
8
|
-
import { BreadcrumbItem } from "./Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js";
|
|
7
|
+
import { Breadcrumbs } from "./Breadcrumbs/Breadcrumbs.js";
|
|
9
8
|
import { Callout } from "./Callout/Callout.js";
|
|
10
9
|
import { Card } from "./Card/Card.js";
|
|
11
10
|
import { CodeBlock } from "./CodeBlock/CodeBlock.js";
|
|
@@ -58,7 +57,6 @@ export {
|
|
|
58
57
|
Aside,
|
|
59
58
|
Badge,
|
|
60
59
|
Body,
|
|
61
|
-
BreadcrumbItem,
|
|
62
60
|
Breadcrumbs,
|
|
63
61
|
Button,
|
|
64
62
|
Callout,
|