@agility/plenum-ui 1.3.33 → 1.3.35
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 +9 -1
- package/lib/components/Forms/TextInputAddon/TextInputAddon.d.ts +3 -1
- package/lib/components/Forms/TextInputAddon/TextInputAddon.stories.d.ts +3 -3
- package/lib/index.esm.js +29 -8
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +29 -8
- package/lib/index.js.map +1 -1
- package/lib/tailwind.css +4 -0
- package/package.json +1 -1
- package/setupTests.js +3 -3
- package/tsconfig.json +2 -2
- package/libxxx/common/brandCfg.d.ts +0 -3
- package/libxxx/common/index.d.ts +0 -3
- package/libxxx/common/storyCfg.d.ts +0 -5
- package/libxxx/components/Avatar/Avatar.d.ts +0 -27
- package/libxxx/components/Avatar/Avatar.stories.d.ts +0 -6
- package/libxxx/components/Avatar/Avatar.test.d.ts +0 -1
- package/libxxx/components/Avatar/index.d.ts +0 -1
- package/libxxx/components/Button/Button.d.ts +0 -45
- package/libxxx/components/Button/Button.stories.d.ts +0 -10
- package/libxxx/components/Button/Button.test.d.ts +0 -1
- package/libxxx/components/Button/index.d.ts +0 -1
- package/libxxx/components/ButtonDropdown/ButtonDropdown.d.ts +0 -11
- package/libxxx/components/ButtonDropdown/ButtonDropdown.stories.d.ts +0 -8
- package/libxxx/components/ButtonDropdown/index.d.ts +0 -1
- package/libxxx/components/Combobox/Combobox.d.ts +0 -34
- package/libxxx/components/Combobox/Combobox.stories.d.ts +0 -14
- package/libxxx/components/Combobox/Combobox.test.d.ts +0 -1
- package/libxxx/components/Combobox/index.d.ts +0 -1
- package/libxxx/components/Dropdown/Dropdown.d.ts +0 -25
- package/libxxx/components/Dropdown/Dropdown.stories.d.ts +0 -9
- package/libxxx/components/Dropdown/Dropdown.test.d.ts +0 -1
- package/libxxx/components/Dropdown/data.d.ts +0 -3
- package/libxxx/components/Dropdown/index.d.ts +0 -1
- package/libxxx/components/Forms/BaseField/BaseField.d.ts +0 -34
- package/libxxx/components/Forms/BaseField/BaseField.stories.d.ts +0 -6
- package/libxxx/components/Forms/BaseField/BaseField.test.d.ts +0 -1
- package/libxxx/components/Forms/BaseField/index.d.ts +0 -1
- package/libxxx/components/Forms/Checkbox/Checkbox.d.ts +0 -23
- package/libxxx/components/Forms/Checkbox/Checkbox.stories.d.ts +0 -13
- package/libxxx/components/Forms/Checkbox/Checkbox.test.d.ts +0 -1
- package/libxxx/components/Forms/Checkbox/index.d.ts +0 -1
- package/libxxx/components/Forms/InputCounter/InputCounter.d.ts +0 -9
- package/libxxx/components/Forms/InputCounter/InputCounter.stories.d.ts +0 -6
- package/libxxx/components/Forms/InputCounter/InputCounter.test.d.ts +0 -1
- package/libxxx/components/Forms/InputCounter/index.d.ts +0 -1
- package/libxxx/components/Forms/InputLabel/InputLabel.d.ts +0 -14
- package/libxxx/components/Forms/InputLabel/InputLabel.stories.d.ts +0 -6
- package/libxxx/components/Forms/InputLabel/InputLabel.test.d.ts +0 -1
- package/libxxx/components/Forms/InputLabel/index.d.ts +0 -1
- package/libxxx/components/Forms/Radio/Radio.d.ts +0 -27
- package/libxxx/components/Forms/Radio/Radio.stories.d.ts +0 -12
- package/libxxx/components/Forms/Radio/Radio.test.d.ts +0 -1
- package/libxxx/components/Forms/Radio/index.d.ts +0 -1
- package/libxxx/components/Forms/Select/Select.d.ts +0 -27
- package/libxxx/components/Forms/Select/Select.stories.d.ts +0 -11
- package/libxxx/components/Forms/Select/Select.test.d.ts +0 -1
- package/libxxx/components/Forms/Select/index.d.ts +0 -1
- package/libxxx/components/Forms/TextInput/TextInput.d.ts +0 -37
- package/libxxx/components/Forms/TextInput/TextInput.stories.d.ts +0 -12
- package/libxxx/components/Forms/TextInput/index.d.ts +0 -1
- package/libxxx/components/Forms/TextInputAddon/InputCta/InputCta.d.ts +0 -16
- package/libxxx/components/Forms/TextInputAddon/InputCta/InputCta.stories.d.ts +0 -6
- package/libxxx/components/Forms/TextInputAddon/InputCta/InputCta.test.d.ts +0 -1
- package/libxxx/components/Forms/TextInputAddon/InputCta/index.d.ts +0 -1
- package/libxxx/components/Forms/TextInputAddon/TextInputAddon.d.ts +0 -52
- package/libxxx/components/Forms/TextInputAddon/TextInputAddon.stories.d.ts +0 -12
- package/libxxx/components/Forms/TextInputAddon/index.d.ts +0 -1
- package/libxxx/components/Forms/TextInputSelect/InputSelect/InputSelect.d.ts +0 -13
- package/libxxx/components/Forms/TextInputSelect/InputSelect/InputSelect.stories.d.ts +0 -6
- package/libxxx/components/Forms/TextInputSelect/InputSelect/InputSelect.test.d.ts +0 -1
- package/libxxx/components/Forms/TextInputSelect/InputSelect/index.d.ts +0 -1
- package/libxxx/components/Forms/TextInputSelect/TextInputSelect.d.ts +0 -48
- package/libxxx/components/Forms/TextInputSelect/TextInputSelect.stories.d.ts +0 -8
- package/libxxx/components/Forms/TextInputSelect/index.d.ts +0 -1
- package/libxxx/components/Forms/Textarea/Textarea.d.ts +0 -32
- package/libxxx/components/Forms/Textarea/Textarea.stories.d.ts +0 -12
- package/libxxx/components/Forms/Textarea/Textarea.test.d.ts +0 -1
- package/libxxx/components/Forms/Textarea/index.d.ts +0 -1
- package/libxxx/components/Switch/Switch.d.ts +0 -11
- package/libxxx/components/Switch/Switch.stories.d.ts +0 -9
- package/libxxx/components/Switch/Switch.test.d.ts +0 -1
- package/libxxx/components/Switch/index.d.ts +0 -1
- package/libxxx/components/TreeView/TreeView.d.ts +0 -36
- package/libxxx/components/TreeView/TreeView.stories.d.ts +0 -6
- package/libxxx/components/TreeView/TreeView.test.d.ts +0 -1
- package/libxxx/components/TreeView/index.d.ts +0 -1
- package/libxxx/components/TreeView V1/TreeItem/TreeItem.d.ts +0 -16
- package/libxxx/components/TreeView V1/TreeItem/TreeItem.stories.d.ts +0 -9
- package/libxxx/components/TreeView V1/TreeItem/TreeItem.test.d.ts +0 -1
- package/libxxx/components/TreeView V1/TreeItem/index.d.ts +0 -1
- package/libxxx/components/TreeView V1/TreeView.d.ts +0 -6
- package/libxxx/components/TreeView V1/TreeView.stories.d.ts +0 -6
- package/libxxx/components/TreeView V1/TreeView.test.d.ts +0 -1
- package/libxxx/components/TreeView V1/context.d.ts +0 -9
- package/libxxx/components/TreeView V1/index.d.ts +0 -1
- package/libxxx/components/TreeView V1/sampleData.d.ts +0 -71
- package/libxxx/components/TreeView V1/types/tree.types.d.ts +0 -21
- package/libxxx/index.d.ts +0 -14
- package/libxxx/page/TreeNavigation/CustomNode/CustomNode.d.ts +0 -3
- package/libxxx/page/TreeNavigation/CustomNode/CustomNode.test.d.ts +0 -1
- package/libxxx/page/TreeNavigation/CustomNode/index.d.ts +0 -1
- package/libxxx/page/TreeNavigation/TreeNavigation.d.ts +0 -8
- package/libxxx/page/TreeNavigation/TreeNavigation.stories.d.ts +0 -6
- package/libxxx/page/TreeNavigation/hooks/useFetch.d.ts +0 -14
- package/libxxx/page/TreeNavigation/index.d.ts +0 -1
- package/libxxx/util/DynamicIcons.d.ts +0 -10
- package/libxxx/util/Loader.d.ts +0 -6
- package/libxxx/util/useID.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { HTMLAttributeAnchorTarget } from "react";
|
|
2
2
|
import { IconName } from "../../util/DynamicIcons";
|
|
3
3
|
export interface ButtonProps {
|
|
4
4
|
/**
|
|
@@ -40,6 +40,14 @@ export interface ButtonProps {
|
|
|
40
40
|
className?: string;
|
|
41
41
|
iconObj?: React.ReactNode;
|
|
42
42
|
title?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optionally render as anchor tag
|
|
45
|
+
*/
|
|
46
|
+
asLink?: {
|
|
47
|
+
href: string;
|
|
48
|
+
target: HTMLAttributeAnchorTarget;
|
|
49
|
+
title?: string;
|
|
50
|
+
};
|
|
43
51
|
}
|
|
44
52
|
declare const _Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
45
53
|
export { _Button as Button };
|
|
@@ -34,8 +34,10 @@ export interface TextInputAddonProps {
|
|
|
34
34
|
leadIcon?: IconName;
|
|
35
35
|
/** Trailing icon displayed within the input */
|
|
36
36
|
trailIcon?: IconName;
|
|
37
|
-
/** Icon within the input field
|
|
37
|
+
/** Icon within the input field at the begining of the field*/
|
|
38
38
|
inlineIcon?: IconName;
|
|
39
|
+
/** Icon within the input field at the end of the field*/
|
|
40
|
+
inlineTrailingIcon?: IconName;
|
|
39
41
|
/** Trailing label for the input CTA */
|
|
40
42
|
trailLabel?: string;
|
|
41
43
|
/** Leading label for input CTA */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Meta } from
|
|
2
|
-
import { Story } from
|
|
3
|
-
import { TextInputAddonProps } from
|
|
1
|
+
import { Meta } from "@storybook/react/types-6-0";
|
|
2
|
+
import { Story } from "@storybook/react";
|
|
3
|
+
import { TextInputAddonProps } from "./TextInputAddon";
|
|
4
4
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const AllVariations: Story<TextInputAddonProps>;
|
package/lib/index.esm.js
CHANGED
|
@@ -7020,10 +7020,12 @@ function Loader(_a) {
|
|
|
7020
7020
|
* Primary UI component for user interaction
|
|
7021
7021
|
*/
|
|
7022
7022
|
var Button = function (_a, ref) {
|
|
7023
|
-
var _b = _a.type, type = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "base" : _c, onClick = _a.onClick, label = _a.label, isDisabled = _a.isDisabled, icon = _a.icon, iconObj = _a.iconObj, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d, _e = _a.isSubmit, isSubmit = _e === void 0 ? false : _e, _f = _a.isWidthFull, isWidthFull = _f === void 0 ? false : _f, className = _a.className, title = _a.title;
|
|
7023
|
+
var _b = _a.type, type = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "base" : _c, onClick = _a.onClick, label = _a.label, isDisabled = _a.isDisabled, icon = _a.icon, iconObj = _a.iconObj, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d, _e = _a.isSubmit, isSubmit = _e === void 0 ? false : _e, _f = _a.isWidthFull, isWidthFull = _f === void 0 ? false : _f, className = _a.className, title = _a.title, asLink = _a.asLink;
|
|
7024
7024
|
var iconStyles = cn("h-5 w-5", { "text-white": type === "primary" || type === "danger" }, { "text-purple-700": type === "secondary" }, { "text-gray-700": type === "alternative" });
|
|
7025
|
-
return (React__default.createElement("button", { ref: ref, type: isSubmit ? "submit" : "button", title: title, className: cn("inline-flex items-center justify-center space-x-2 rounded border transition-all", { "w-full": isWidthFull === true }, { "px-4 py-2 text-sm": size === "sm" }, { "px-5 py-2 text-base": size === "base" }, { "px-5 py-2 text-lg": size === "lg" }, {
|
|
7026
|
-
"
|
|
7025
|
+
return !asLink ? (React__default.createElement("button", { ref: ref, type: isSubmit ? "submit" : "button", title: title, className: cn("inline-flex items-center justify-center space-x-2 rounded border transition-all", { "w-full": isWidthFull === true }, { "px-4 py-2 text-sm": size === "sm" }, { "px-5 py-2 text-base": size === "base" }, { "px-5 py-2 text-lg": size === "lg" }, {
|
|
7026
|
+
"cursor-auto opacity-50": isDisabled
|
|
7027
|
+
}, {
|
|
7028
|
+
"active: border-purple-600 bg-purple-600 text-white hover:border-purple-700 hover:bg-purple-700 active:border-purple-800 active:bg-purple-800": type === "primary"
|
|
7027
7029
|
}, {
|
|
7028
7030
|
"border-purple-100 bg-purple-100 text-purple-700 hover:border-purple-200 hover:bg-purple-200 hover:text-purple-700 active:border-purple-300 active:bg-purple-300": type === "secondary"
|
|
7029
7031
|
}, {
|
|
@@ -7033,11 +7035,28 @@ var Button = function (_a, ref) {
|
|
|
7033
7035
|
}, className), onClick: !isDisabled
|
|
7034
7036
|
? onClick
|
|
7035
7037
|
: function () {
|
|
7036
|
-
} },
|
|
7038
|
+
}, disabled: isDisabled, "aria-disabled": isDisabled },
|
|
7039
|
+
iconObj &&
|
|
7040
|
+
(isLoading ? (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default.createElement(React__default.Fragment, null, iconObj))),
|
|
7041
|
+
icon &&
|
|
7042
|
+
(isLoading ? (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default.createElement(DynamicIcons, { icon: icon, className: iconStyles, outline: false }))),
|
|
7043
|
+
!icon && !iconObj && isLoading && (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })),
|
|
7044
|
+
label && React__default.createElement("span", null, label))) : (React__default.createElement("a", { type: isSubmit ? "submit" : "button", title: asLink.title || title, href: asLink.href, className: cn("inline-flex items-center justify-center space-x-2 rounded border transition-all", { "w-full": isWidthFull === true }, { "px-4 py-2 text-sm": size === "sm" }, { "px-5 py-2 text-base": size === "base" }, { "px-5 py-2 text-lg": size === "lg" }, {
|
|
7045
|
+
"cursor-auto opacity-50": isDisabled
|
|
7046
|
+
}, {
|
|
7047
|
+
"active: border-purple-600 bg-purple-600 text-white hover:border-purple-700 hover:bg-purple-700 active:border-purple-800 active:bg-purple-800": type === "primary"
|
|
7048
|
+
}, {
|
|
7049
|
+
"border-purple-100 bg-purple-100 text-purple-700 hover:border-purple-200 hover:bg-purple-200 hover:text-purple-700 active:border-purple-300 active:bg-purple-300": type === "secondary"
|
|
7050
|
+
}, {
|
|
7051
|
+
"border-gray-300 bg-white text-gray-700 hover:bg-gray-50 hover:text-gray-700 active:bg-gray-100": type === "alternative"
|
|
7052
|
+
}, {
|
|
7053
|
+
"border-red-300 bg-red-600 text-white hover:bg-red-700 hover:text-white": type === "danger"
|
|
7054
|
+
}, className), "aria-disabled": isDisabled },
|
|
7037
7055
|
iconObj &&
|
|
7038
7056
|
(isLoading ? (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default.createElement(React__default.Fragment, null, iconObj))),
|
|
7039
|
-
icon &&
|
|
7040
|
-
|
|
7057
|
+
icon &&
|
|
7058
|
+
(isLoading ? (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default.createElement(DynamicIcons, { icon: icon, className: iconStyles, outline: false }))),
|
|
7059
|
+
!icon && !iconObj && isLoading && (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })),
|
|
7041
7060
|
label && React__default.createElement("span", null, label)));
|
|
7042
7061
|
};
|
|
7043
7062
|
var _Button = forwardRef(Button);
|
|
@@ -12500,7 +12519,7 @@ var InputCta = function (_a) {
|
|
|
12500
12519
|
};
|
|
12501
12520
|
|
|
12502
12521
|
var TextInputAddon = function (_a, ref) {
|
|
12503
|
-
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, leadIcon = _a.leadIcon, trailIcon = _a.trailIcon, inlineIcon = _a.inlineIcon, trailLabel = _a.trailLabel, leadLabel = _a.leadLabel, _c = _a.clearCta, clearCta = _c === void 0 ? "none" : _c, onChange = _a.onChange, onCtaClick = _a.onCtaClick, externalValue = _a.value, className = _a.className;
|
|
12522
|
+
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, leadIcon = _a.leadIcon, trailIcon = _a.trailIcon, inlineIcon = _a.inlineIcon, inlineTrailingIcon = _a.inlineTrailingIcon, trailLabel = _a.trailLabel, leadLabel = _a.leadLabel, _c = _a.clearCta, clearCta = _c === void 0 ? "none" : _c, onChange = _a.onChange, onCtaClick = _a.onCtaClick, externalValue = _a.value, className = _a.className;
|
|
12504
12523
|
var _d = useState(Boolean(isFocused)), isFocus = _d[0], setIsFocus = _d[1];
|
|
12505
12524
|
var _e = useState(defaultValue || ""), value = _e[0], setValue = _e[1];
|
|
12506
12525
|
var inputRef = useRef(null);
|
|
@@ -12560,7 +12579,9 @@ var TextInputAddon = function (_a, ref) {
|
|
|
12560
12579
|
}, {
|
|
12561
12580
|
"rounded-none": (trailIcon || trailLabel) &&
|
|
12562
12581
|
(leadIcon || leadLabel)
|
|
12563
|
-
}, className), isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder })
|
|
12582
|
+
}, className), isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder }),
|
|
12583
|
+
inlineTrailingIcon && (React__default.createElement("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3" },
|
|
12584
|
+
React__default.createElement(DynamicIcons, { icon: inlineTrailingIcon, className: "h-5 w-5 bg-white text-gray-400", outline: false })))),
|
|
12564
12585
|
(trailIcon || trailLabel) && (React__default.createElement(InputCta, { icon: trailIcon, ctaLabel: trailLabel, align: "right", isClear: clearCta === "right" || clearCta === "both", onClickHandler: onCtaClick }))),
|
|
12565
12586
|
React__default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
12566
12587
|
React__default.createElement("div", { className: "grow" }, message && (React__default.createElement("span", { className: discriptionStyles }, message))),
|