bianic-ui 1.0.0-beta.25 → 1.0.0-beta.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js
CHANGED
|
@@ -1744,7 +1744,7 @@ var sizeConfig$5 = {
|
|
|
1744
1744
|
|
|
1745
1745
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1746
1746
|
function DefaultDropdownItem(_a) {
|
|
1747
|
-
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, isSelected = _a.isSelected, options = _a.options;
|
|
1747
|
+
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, isSelected = _a.isSelected, options = _a.options, caption = _a.caption;
|
|
1748
1748
|
var _f = React.useState(false), isHovered = _f[0], setisHovered = _f[1];
|
|
1749
1749
|
var _g = React.useState(false), isHoveredSubMenu = _g[0], setIsHoveredSubMenu = _g[1];
|
|
1750
1750
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
@@ -1753,9 +1753,11 @@ function DefaultDropdownItem(_a) {
|
|
|
1753
1753
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
1754
1754
|
var isExistSubDropdown = options.length !== 0;
|
|
1755
1755
|
return (React.createElement("div", { className: "w-full relative focus-visible:outline-bia-blue-light-50 ".concat(containerClass), tabIndex: 0, role: "button", onClick: function (e) { return onClick(e); }, onMouseEnter: function () { return setisHovered(true); }, onMouseLeave: function () { return setisHovered(false); }, onKeyDown: function () { } },
|
|
1756
|
-
React.createElement("div", { className: "hover:bg-bia-blue-light-90 active:bg-bia-blue-light-80 select-none ".concat(itemClass) },
|
|
1757
|
-
|
|
1758
|
-
|
|
1756
|
+
React.createElement("div", { className: "hover:bg-bia-blue-light-90 active:bg-bia-blue-light-80 select-none flex flex-col ".concat(itemClass) },
|
|
1757
|
+
React.createElement("span", null,
|
|
1758
|
+
label,
|
|
1759
|
+
isExistSubDropdown && (React.createElement(TbChevronRight, { className: "float-right text-bia-grey" }))),
|
|
1760
|
+
React.createElement(Text, { variant: "small-text", extended: "text-bia-coolgrey" }, caption)),
|
|
1759
1761
|
isOpenDropdown && options && isExistSubDropdown && (React.createElement("div", { className: "absolute z-50 top-0 right-0 translate-x-full border w-full bg-primary-white border-bia-grey-dark-10 rounded-md shadow-lg", onMouseEnter: function () { return setIsHoveredSubMenu(true); }, onMouseLeave: function () { return setIsHoveredSubMenu(false); } }, options.map(function (option) { return (React.createElement(DefaultDropdownItem, { label: option.label, size: size, options: option.options })); })))));
|
|
1760
1762
|
}
|
|
1761
1763
|
DefaultDropdownItem.defaultProps = {
|
|
@@ -1764,6 +1766,7 @@ DefaultDropdownItem.defaultProps = {
|
|
|
1764
1766
|
size: 'md',
|
|
1765
1767
|
options: [],
|
|
1766
1768
|
isSelected: false,
|
|
1769
|
+
caption: '',
|
|
1767
1770
|
};
|
|
1768
1771
|
|
|
1769
1772
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -1794,7 +1797,7 @@ function SelectInput(_a) {
|
|
|
1794
1797
|
React.createElement("div", { className: "absolute inset-y-0 pl-3 flex items-center pointer-events-none text-bia-coolgrey peer-disabled:text-bia-coolgrey-light-50 ".concat(iconSize) }, isOpen ? (React.createElement(TbChevronUp, { className: "" })) : (React.createElement(TbChevronDown, { className: "" }))),
|
|
1795
1798
|
isOpen && (React.createElement("div", { className: "absolute border w-full bg-primary-white border-bia-grey-dark-10 rounded-b-md shadow-lg z-10" }, options.map(function (option) {
|
|
1796
1799
|
var isSelected = selected && selected.id && option.id === selected.id;
|
|
1797
|
-
return (React.createElement(DefaultDropdownItem, { label: option.label, size: validatedSize, isSelected: isSelected, onClick: function () {
|
|
1800
|
+
return (React.createElement(DefaultDropdownItem, { label: option.label, caption: option.caption, size: validatedSize, isSelected: isSelected, onClick: function () {
|
|
1798
1801
|
setSelected(option);
|
|
1799
1802
|
setIsOpen(false);
|
|
1800
1803
|
} }));
|
|
@@ -1817,27 +1820,33 @@ function SelectInputSimulation(_a) {
|
|
|
1817
1820
|
var _c = React.useState({
|
|
1818
1821
|
id: 1,
|
|
1819
1822
|
label: 'Mohammed Salah',
|
|
1823
|
+
caption: 'Liverpool',
|
|
1820
1824
|
}), selected = _c[0], setSelected = _c[1];
|
|
1821
1825
|
var optionData = [
|
|
1822
1826
|
{
|
|
1823
1827
|
id: 1,
|
|
1824
1828
|
label: 'Mohammed Salah',
|
|
1829
|
+
caption: 'Liverpool',
|
|
1825
1830
|
},
|
|
1826
1831
|
{
|
|
1827
1832
|
id: 2,
|
|
1828
1833
|
label: 'Cristiono Ronaldo',
|
|
1834
|
+
caption: 'Manchester United',
|
|
1829
1835
|
},
|
|
1830
1836
|
{
|
|
1831
1837
|
id: 3,
|
|
1832
1838
|
label: 'Vinicius Junior',
|
|
1839
|
+
caption: 'Real Madrid',
|
|
1833
1840
|
},
|
|
1834
1841
|
{
|
|
1835
1842
|
id: 4,
|
|
1836
1843
|
label: 'Lionel Messi',
|
|
1844
|
+
caption: 'Paris Saint Germain',
|
|
1837
1845
|
},
|
|
1838
1846
|
{
|
|
1839
1847
|
id: 5,
|
|
1840
1848
|
label: 'Ricardo Kaka',
|
|
1849
|
+
caption: 'AC Milan',
|
|
1841
1850
|
},
|
|
1842
1851
|
];
|
|
1843
1852
|
return (React.createElement(SelectInput, { label: "Input Select", descText: "Deskripsi Input Select", options: optionData, selected: selected, setSelected: setSelected, size: size, id: "demo-id" }));
|
|
@@ -6,8 +6,9 @@ interface DefaultDropdownItemProps {
|
|
|
6
6
|
size?: 'md' | 'sm';
|
|
7
7
|
options?: any;
|
|
8
8
|
isSelected?: boolean;
|
|
9
|
+
caption?: string;
|
|
9
10
|
}
|
|
10
|
-
declare function DefaultDropdownItem({ className, label, onClick, size, isSelected, options, }: DefaultDropdownItemProps): React.JSX.Element;
|
|
11
|
+
declare function DefaultDropdownItem({ className, label, onClick, size, isSelected, options, caption, }: DefaultDropdownItemProps): React.JSX.Element;
|
|
11
12
|
declare namespace DefaultDropdownItem {
|
|
12
13
|
var defaultProps: {
|
|
13
14
|
className: string;
|
|
@@ -15,6 +16,7 @@ declare namespace DefaultDropdownItem {
|
|
|
15
16
|
size: string;
|
|
16
17
|
options: never[];
|
|
17
18
|
isSelected: boolean;
|
|
19
|
+
caption: string;
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
export default DefaultDropdownItem;
|
package/dist/esm/index.js
CHANGED
|
@@ -1742,7 +1742,7 @@ var sizeConfig$5 = {
|
|
|
1742
1742
|
|
|
1743
1743
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1744
1744
|
function DefaultDropdownItem(_a) {
|
|
1745
|
-
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, isSelected = _a.isSelected, options = _a.options;
|
|
1745
|
+
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, isSelected = _a.isSelected, options = _a.options, caption = _a.caption;
|
|
1746
1746
|
var _f = useState(false), isHovered = _f[0], setisHovered = _f[1];
|
|
1747
1747
|
var _g = useState(false), isHoveredSubMenu = _g[0], setIsHoveredSubMenu = _g[1];
|
|
1748
1748
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
@@ -1751,9 +1751,11 @@ function DefaultDropdownItem(_a) {
|
|
|
1751
1751
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
1752
1752
|
var isExistSubDropdown = options.length !== 0;
|
|
1753
1753
|
return (React.createElement("div", { className: "w-full relative focus-visible:outline-bia-blue-light-50 ".concat(containerClass), tabIndex: 0, role: "button", onClick: function (e) { return onClick(e); }, onMouseEnter: function () { return setisHovered(true); }, onMouseLeave: function () { return setisHovered(false); }, onKeyDown: function () { } },
|
|
1754
|
-
React.createElement("div", { className: "hover:bg-bia-blue-light-90 active:bg-bia-blue-light-80 select-none ".concat(itemClass) },
|
|
1755
|
-
|
|
1756
|
-
|
|
1754
|
+
React.createElement("div", { className: "hover:bg-bia-blue-light-90 active:bg-bia-blue-light-80 select-none flex flex-col ".concat(itemClass) },
|
|
1755
|
+
React.createElement("span", null,
|
|
1756
|
+
label,
|
|
1757
|
+
isExistSubDropdown && (React.createElement(TbChevronRight, { className: "float-right text-bia-grey" }))),
|
|
1758
|
+
React.createElement(Text, { variant: "small-text", extended: "text-bia-coolgrey" }, caption)),
|
|
1757
1759
|
isOpenDropdown && options && isExistSubDropdown && (React.createElement("div", { className: "absolute z-50 top-0 right-0 translate-x-full border w-full bg-primary-white border-bia-grey-dark-10 rounded-md shadow-lg", onMouseEnter: function () { return setIsHoveredSubMenu(true); }, onMouseLeave: function () { return setIsHoveredSubMenu(false); } }, options.map(function (option) { return (React.createElement(DefaultDropdownItem, { label: option.label, size: size, options: option.options })); })))));
|
|
1758
1760
|
}
|
|
1759
1761
|
DefaultDropdownItem.defaultProps = {
|
|
@@ -1762,6 +1764,7 @@ DefaultDropdownItem.defaultProps = {
|
|
|
1762
1764
|
size: 'md',
|
|
1763
1765
|
options: [],
|
|
1764
1766
|
isSelected: false,
|
|
1767
|
+
caption: '',
|
|
1765
1768
|
};
|
|
1766
1769
|
|
|
1767
1770
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -1792,7 +1795,7 @@ function SelectInput(_a) {
|
|
|
1792
1795
|
React.createElement("div", { className: "absolute inset-y-0 pl-3 flex items-center pointer-events-none text-bia-coolgrey peer-disabled:text-bia-coolgrey-light-50 ".concat(iconSize) }, isOpen ? (React.createElement(TbChevronUp, { className: "" })) : (React.createElement(TbChevronDown, { className: "" }))),
|
|
1793
1796
|
isOpen && (React.createElement("div", { className: "absolute border w-full bg-primary-white border-bia-grey-dark-10 rounded-b-md shadow-lg z-10" }, options.map(function (option) {
|
|
1794
1797
|
var isSelected = selected && selected.id && option.id === selected.id;
|
|
1795
|
-
return (React.createElement(DefaultDropdownItem, { label: option.label, size: validatedSize, isSelected: isSelected, onClick: function () {
|
|
1798
|
+
return (React.createElement(DefaultDropdownItem, { label: option.label, caption: option.caption, size: validatedSize, isSelected: isSelected, onClick: function () {
|
|
1796
1799
|
setSelected(option);
|
|
1797
1800
|
setIsOpen(false);
|
|
1798
1801
|
} }));
|
|
@@ -1815,27 +1818,33 @@ function SelectInputSimulation(_a) {
|
|
|
1815
1818
|
var _c = useState({
|
|
1816
1819
|
id: 1,
|
|
1817
1820
|
label: 'Mohammed Salah',
|
|
1821
|
+
caption: 'Liverpool',
|
|
1818
1822
|
}), selected = _c[0], setSelected = _c[1];
|
|
1819
1823
|
var optionData = [
|
|
1820
1824
|
{
|
|
1821
1825
|
id: 1,
|
|
1822
1826
|
label: 'Mohammed Salah',
|
|
1827
|
+
caption: 'Liverpool',
|
|
1823
1828
|
},
|
|
1824
1829
|
{
|
|
1825
1830
|
id: 2,
|
|
1826
1831
|
label: 'Cristiono Ronaldo',
|
|
1832
|
+
caption: 'Manchester United',
|
|
1827
1833
|
},
|
|
1828
1834
|
{
|
|
1829
1835
|
id: 3,
|
|
1830
1836
|
label: 'Vinicius Junior',
|
|
1837
|
+
caption: 'Real Madrid',
|
|
1831
1838
|
},
|
|
1832
1839
|
{
|
|
1833
1840
|
id: 4,
|
|
1834
1841
|
label: 'Lionel Messi',
|
|
1842
|
+
caption: 'Paris Saint Germain',
|
|
1835
1843
|
},
|
|
1836
1844
|
{
|
|
1837
1845
|
id: 5,
|
|
1838
1846
|
label: 'Ricardo Kaka',
|
|
1847
|
+
caption: 'AC Milan',
|
|
1839
1848
|
},
|
|
1840
1849
|
];
|
|
1841
1850
|
return (React.createElement(SelectInput, { label: "Input Select", descText: "Deskripsi Input Select", options: optionData, selected: selected, setSelected: setSelected, size: size, id: "demo-id" }));
|
|
@@ -6,8 +6,9 @@ interface DefaultDropdownItemProps {
|
|
|
6
6
|
size?: 'md' | 'sm';
|
|
7
7
|
options?: any;
|
|
8
8
|
isSelected?: boolean;
|
|
9
|
+
caption?: string;
|
|
9
10
|
}
|
|
10
|
-
declare function DefaultDropdownItem({ className, label, onClick, size, isSelected, options, }: DefaultDropdownItemProps): React.JSX.Element;
|
|
11
|
+
declare function DefaultDropdownItem({ className, label, onClick, size, isSelected, options, caption, }: DefaultDropdownItemProps): React.JSX.Element;
|
|
11
12
|
declare namespace DefaultDropdownItem {
|
|
12
13
|
var defaultProps: {
|
|
13
14
|
className: string;
|
|
@@ -15,6 +16,7 @@ declare namespace DefaultDropdownItem {
|
|
|
15
16
|
size: string;
|
|
16
17
|
options: never[];
|
|
17
18
|
isSelected: boolean;
|
|
19
|
+
caption: string;
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
export default DefaultDropdownItem;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"@biaenergi:registry": "https://gitlab.com/api/v4/projects/50905269/packages/npm/"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.0.0-beta.
|
|
6
|
+
"version": "1.0.0-beta.27",
|
|
7
7
|
"description": "Design Language System develop by BIAENERGI",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"rollup": "rollup -c",
|