fictoan-react 1.7.2 → 1.8.2
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/Element/Element.js +0 -1
- package/dist/components/Form/ListBox/ListBox.js +14 -3
- package/dist/components/OptionCard/OptionCard.js +1 -1
- package/dist/components/{ContentWrapper → Sidebar/ContentWrapper}/ContentWrapper.js +1 -1
- package/dist/components/Sidebar/SidebarFooter/SidebarFooter.js +18 -3
- package/dist/components/Sidebar/SidebarHeader/SidebarHeader.js +10 -1
- package/dist/components/Sidebar/SidebarItem/SidebarItem.js +19 -2
- package/dist/components/Sidebar/index.js +2 -4
- package/dist/components/index.js +1 -5
- package/dist/index.css +1 -1
- package/dist/index.js +1 -5
- package/package.json +20 -9
- package/dist/components/ContentWrapper/index.js +0 -6
- package/dist/components/Sidebar/SidebarItemIcon/SidebarItemIcon.js +0 -25
- package/dist/components/Sidebar/SidebarItemText/SidebarItemText.js +0 -29
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import React__default, { useState,
|
|
3
|
+
import React__default, { 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";
|
|
@@ -14,8 +14,9 @@ const ListBox = React__default.forwardRef(
|
|
|
14
14
|
label,
|
|
15
15
|
placeholder = "Select an option",
|
|
16
16
|
id,
|
|
17
|
-
|
|
17
|
+
defaultValue,
|
|
18
18
|
onChange,
|
|
19
|
+
allowMultiSelect = false,
|
|
19
20
|
disabled,
|
|
20
21
|
badgeBgColour,
|
|
21
22
|
badgeBgColor,
|
|
@@ -26,10 +27,20 @@ const ListBox = React__default.forwardRef(
|
|
|
26
27
|
...props
|
|
27
28
|
}, ref) => {
|
|
28
29
|
const [isOpen, setIsOpen] = useState(false);
|
|
29
|
-
const [selectedOption, setSelectedOption] = useState(null);
|
|
30
30
|
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
31
31
|
const [searchValue, setSearchValue] = useState("");
|
|
32
32
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
33
|
+
const [selectedOption, setSelectedOption] = useState(() => {
|
|
34
|
+
if (defaultValue) {
|
|
35
|
+
return options.find((opt) => opt.value === defaultValue) || null;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
});
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (defaultValue && onChange) {
|
|
41
|
+
onChange(defaultValue);
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
33
44
|
const dropdownRef = useRef();
|
|
34
45
|
const searchInputRef = useRef(null);
|
|
35
46
|
const effectiveRef = ref || dropdownRef;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import React__default, { createContext,
|
|
3
|
+
import React__default, { 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({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
3
|
import React__default from "react";
|
|
4
|
-
import { Element } from "
|
|
4
|
+
import { Element } from "../../Element/Element.js";
|
|
5
5
|
const ContentWrapper = React__default.forwardRef(
|
|
6
6
|
({ label, ...props }, ref) => {
|
|
7
7
|
return /* @__PURE__ */ React__default.createElement(
|
|
@@ -2,9 +2,24 @@
|
|
|
2
2
|
"use client;";
|
|
3
3
|
import React__default from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
|
-
const SidebarFooter = React__default.forwardRef(
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const SidebarFooter = React__default.forwardRef(
|
|
6
|
+
({ isSticky, ...props }, ref) => {
|
|
7
|
+
let classNames = [];
|
|
8
|
+
if (isSticky) {
|
|
9
|
+
classNames.push("is-sticky");
|
|
10
|
+
}
|
|
11
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
12
|
+
Element,
|
|
13
|
+
{
|
|
14
|
+
as: "footer",
|
|
15
|
+
"data-sidebar-footer": true,
|
|
16
|
+
ref,
|
|
17
|
+
classNames,
|
|
18
|
+
...props
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
8
23
|
export {
|
|
9
24
|
SidebarFooter
|
|
10
25
|
};
|
|
@@ -8,7 +8,16 @@ const SidebarHeader = React__default.forwardRef(
|
|
|
8
8
|
if (isSticky) {
|
|
9
9
|
classNames.push("is-sticky");
|
|
10
10
|
}
|
|
11
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
11
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
12
|
+
Element,
|
|
13
|
+
{
|
|
14
|
+
as: "header",
|
|
15
|
+
"data-sidebar-header": true,
|
|
16
|
+
ref,
|
|
17
|
+
classNames,
|
|
18
|
+
...props
|
|
19
|
+
}
|
|
20
|
+
);
|
|
12
21
|
}
|
|
13
22
|
);
|
|
14
23
|
export {
|
|
@@ -2,13 +2,30 @@
|
|
|
2
2
|
"use client;";
|
|
3
3
|
import React__default from "react";
|
|
4
4
|
import { Element } from "../../Element/Element.js";
|
|
5
|
+
import { Div } from "../../Element/Tags.js";
|
|
5
6
|
const SidebarItem = React__default.forwardRef(
|
|
6
|
-
({ hasAlert, ...props }, ref) => {
|
|
7
|
+
({ hasAlert, hasEmptyIcon, hasNoIcon, children, ...props }, ref) => {
|
|
7
8
|
let classNames = [];
|
|
8
9
|
if (hasAlert) {
|
|
9
10
|
classNames.push("has-alert");
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
if (hasEmptyIcon) {
|
|
13
|
+
classNames.push("has-empty-icon");
|
|
14
|
+
} else if (hasNoIcon) {
|
|
15
|
+
classNames.push("has-no-icon");
|
|
16
|
+
}
|
|
17
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
18
|
+
Element,
|
|
19
|
+
{
|
|
20
|
+
as: "div",
|
|
21
|
+
"data-sidebar-item": true,
|
|
22
|
+
ref,
|
|
23
|
+
classNames,
|
|
24
|
+
...props
|
|
25
|
+
},
|
|
26
|
+
hasEmptyIcon && /* @__PURE__ */ React__default.createElement(Div, { className: "empty-icon-wrapper" }),
|
|
27
|
+
children
|
|
28
|
+
);
|
|
12
29
|
}
|
|
13
30
|
);
|
|
14
31
|
export {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
3
|
import { SidebarWrapper } from "./SidebarWrapper/SidebarWrapper.js";
|
|
4
|
+
import { ContentWrapper } from "./ContentWrapper/ContentWrapper.js";
|
|
4
5
|
import { SidebarHeader } from "./SidebarHeader/SidebarHeader.js";
|
|
5
6
|
import { SidebarItem } from "./SidebarItem/SidebarItem.js";
|
|
6
|
-
import { SidebarItemIcon } from "./SidebarItemIcon/SidebarItemIcon.js";
|
|
7
|
-
import { SidebarItemText } from "./SidebarItemText/SidebarItemText.js";
|
|
8
7
|
import { SidebarFooter } from "./SidebarFooter/SidebarFooter.js";
|
|
9
8
|
export {
|
|
9
|
+
ContentWrapper,
|
|
10
10
|
SidebarFooter,
|
|
11
11
|
SidebarHeader,
|
|
12
12
|
SidebarItem,
|
|
13
|
-
SidebarItemIcon,
|
|
14
|
-
SidebarItemText,
|
|
15
13
|
SidebarWrapper
|
|
16
14
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -9,7 +9,6 @@ import { BreadcrumbItem } from "./Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js";
|
|
|
9
9
|
import { Callout } from "./Callout/Callout.js";
|
|
10
10
|
import { Card } from "./Card/Card.js";
|
|
11
11
|
import { CodeBlock } from "./CodeBlock/CodeBlock.js";
|
|
12
|
-
import { ContentWrapper } from "./ContentWrapper/ContentWrapper.js";
|
|
13
12
|
import { Divider } from "./Divider/Divider.js";
|
|
14
13
|
import { Element } from "./Element/Element.js";
|
|
15
14
|
import { Article, Aside, Body, Div, Footer, Header, Main, Nav, Section, Span } from "./Element/Tags.js";
|
|
@@ -39,10 +38,9 @@ import { ProgressBar } from "./ProgressBar/ProgressBar.js";
|
|
|
39
38
|
import { Row } from "./Row/Row.js";
|
|
40
39
|
import { OptionCard, OptionCardsGroup, useOptionCard } from "./OptionCard/OptionCard.js";
|
|
41
40
|
import { SidebarWrapper } from "./Sidebar/SidebarWrapper/SidebarWrapper.js";
|
|
41
|
+
import { ContentWrapper } from "./Sidebar/ContentWrapper/ContentWrapper.js";
|
|
42
42
|
import { SidebarHeader } from "./Sidebar/SidebarHeader/SidebarHeader.js";
|
|
43
43
|
import { SidebarItem } from "./Sidebar/SidebarItem/SidebarItem.js";
|
|
44
|
-
import { SidebarItemIcon } from "./Sidebar/SidebarItemIcon/SidebarItemIcon.js";
|
|
45
|
-
import { SidebarItemText } from "./Sidebar/SidebarItemText/SidebarItemText.js";
|
|
46
44
|
import { SidebarFooter } from "./Sidebar/SidebarFooter/SidebarFooter.js";
|
|
47
45
|
import { Skeleton, SkeletonGroup } from "./Skeleton/Skeleton.js";
|
|
48
46
|
import { Spinner } from "./Spinner/Spinner.js";
|
|
@@ -109,8 +107,6 @@ export {
|
|
|
109
107
|
SidebarFooter,
|
|
110
108
|
SidebarHeader,
|
|
111
109
|
SidebarItem,
|
|
112
|
-
SidebarItemIcon,
|
|
113
|
-
SidebarItemText,
|
|
114
110
|
SidebarWrapper,
|
|
115
111
|
Skeleton,
|
|
116
112
|
SkeletonGroup,
|