@agility/plenum-ui 1.3.14 → 1.3.17
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/lib/components/Button/Button.d.ts +4 -6
- package/lib/index.esm.js +13 -5
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +12 -4
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { IconName } from "../../util/DynamicIcons";
|
|
3
3
|
import "../../tailwind.css";
|
|
4
4
|
export interface ButtonProps {
|
|
@@ -13,7 +13,7 @@ export interface ButtonProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* Button contents
|
|
15
15
|
*/
|
|
16
|
-
label
|
|
16
|
+
label?: string;
|
|
17
17
|
/**
|
|
18
18
|
* An optional icon
|
|
19
19
|
*/
|
|
@@ -40,7 +40,5 @@ export interface ButtonProps {
|
|
|
40
40
|
*/
|
|
41
41
|
className?: string;
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*/
|
|
46
|
-
export declare const Button: FC<ButtonProps>;
|
|
43
|
+
declare const _Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
44
|
+
export { _Button as Button };
|
package/lib/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useLayoutEffect, useEffect, useRef, useState,
|
|
2
|
+
import React__default, { forwardRef, useLayoutEffect, useEffect, useRef, useState, Fragment, isValidElement, cloneElement, createElement, useContext, createContext, useMemo, useReducer, createRef, useCallback, memo, useImperativeHandle } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
var classnames = {exports: {}};
|
|
@@ -7065,8 +7065,10 @@ var Button = function (_a, ref) {
|
|
|
7065
7065
|
: function () {
|
|
7066
7066
|
} },
|
|
7067
7067
|
icon ? (isLoading ? (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default.createElement(DynamicIcons, { icon: icon, className: iconStyles, outline: false }))) : (isLoading && React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })),
|
|
7068
|
-
|
|
7069
|
-
|
|
7068
|
+
label &&
|
|
7069
|
+
React__default.createElement("span", null, label)));
|
|
7070
|
+
};
|
|
7071
|
+
var _Button = forwardRef(Button);
|
|
7070
7072
|
|
|
7071
7073
|
let t$2=typeof window!="undefined"?useLayoutEffect:useEffect;
|
|
7072
7074
|
|
|
@@ -7303,7 +7305,7 @@ function __spreadArray$1(to, from, pack) {
|
|
|
7303
7305
|
var ButtonDropDown = function (_a) {
|
|
7304
7306
|
var button = _a.button, dropDown = _a.dropDown;
|
|
7305
7307
|
return (React__default.createElement("div", { className: "flex items-stretch" },
|
|
7306
|
-
React__default.createElement(
|
|
7308
|
+
React__default.createElement(_Button, __assign$1({}, button, { className: "!rounded-r-none !border-r-0 hover:!border-r-0 " })),
|
|
7307
7309
|
React__default.createElement("div", { className: cn("w-[1px]", button.type === "primary" ? "bg-purple-700" : "", button.type === "secondary" ? "bg-purple-200" : "", button.type === "alternative" ? "bg-gray-300" : "") }),
|
|
7308
7310
|
React__default.createElement(Dropdown, __assign$1({}, dropDown, { className: cn("h-[calc(100%)] !rounded-l-none border !border-l-0 px-2 transition-all hover:!border-l-0", button.type === "primary"
|
|
7309
7311
|
? "border-purple-600 bg-purple-600 !text-white hover:border-purple-700 hover:bg-purple-700 active:!border-purple-800 active:!bg-purple-800"
|
|
@@ -12442,6 +12444,12 @@ var TextInput = function (_a, ref) {
|
|
|
12442
12444
|
var _d = useState(false); _d[0]; var setIsActive = _d[1];
|
|
12443
12445
|
var _e = useState(externalValue || defaultValue || ""), value = _e[0], setValue = _e[1];
|
|
12444
12446
|
var inputRef = useRef(null);
|
|
12447
|
+
useEffect(function () {
|
|
12448
|
+
//if the external value is updated by the parent component, reset the value in here...
|
|
12449
|
+
if (externalValue !== undefined && externalValue !== null) {
|
|
12450
|
+
setValue(externalValue);
|
|
12451
|
+
}
|
|
12452
|
+
}, [externalValue]);
|
|
12445
12453
|
// set force focus
|
|
12446
12454
|
useEffect(function () {
|
|
12447
12455
|
var input = inputRef.current;
|
|
@@ -12773,5 +12781,5 @@ var Checkbox = function (_a) {
|
|
|
12773
12781
|
message && (React__default.createElement("p", { id: "".concat(id, "-description"), className: "text-gray-500" }, message)))));
|
|
12774
12782
|
};
|
|
12775
12783
|
|
|
12776
|
-
export { Avatar, Button, ButtonDropDown, Checkbox, Combobox, Dropdown, Placeholder, Radio, Select, Switch, _TextInput as TextInput, _TextInputAddon as TextInputAddon, TextInputSelect, _Textarea as Textarea, _TreeView as TreeView };
|
|
12784
|
+
export { Avatar, _Button as Button, ButtonDropDown, Checkbox, Combobox, Dropdown, Placeholder, Radio, Select, Switch, _TextInput as TextInput, _TextInputAddon as TextInputAddon, TextInputSelect, _Textarea as Textarea, _TreeView as TreeView };
|
|
12777
12785
|
//# sourceMappingURL=index.esm.js.map
|