@agility/plenum-ui 1.1.6 → 1.1.7
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/coverage/agility-component-lib-react/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Button/Button.tsx.html +23 -17
- package/coverage/agility-component-lib-react/src/components/Button/index.html +5 -5
- package/coverage/agility-component-lib-react/src/components/Forms/BaseField/BaseField.tsx.html +18 -6
- package/coverage/agility-component-lib-react/src/components/Forms/BaseField/index.html +11 -11
- package/coverage/agility-component-lib-react/src/components/Forms/Checkbox/Checkbox.tsx.html +63 -12
- package/coverage/agility-component-lib-react/src/components/Forms/Checkbox/index.html +19 -19
- package/coverage/agility-component-lib-react/src/components/Forms/InputCounter/InputCounter.tsx.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/InputCounter/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/InputLabel/InputLabel.tsx.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/InputLabel/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/InputLabel/index.ts.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/Radio/Radio.tsx.html +90 -12
- package/coverage/agility-component-lib-react/src/components/Forms/Radio/index.html +21 -21
- package/coverage/agility-component-lib-react/src/components/Forms/Select/Select.tsx.html +6 -6
- package/coverage/agility-component-lib-react/src/components/Forms/Select/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/TextInputAddon/InputCta/InputCta.tsx.html +4 -4
- package/coverage/agility-component-lib-react/src/components/Forms/TextInputAddon/InputCta/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/TextInputSelect/InputSelect/InputSelect.tsx.html +2 -2
- package/coverage/agility-component-lib-react/src/components/Forms/TextInputSelect/InputSelect/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Switch/Switch.tsx.html +37 -10
- package/coverage/agility-component-lib-react/src/components/Switch/index.html +9 -9
- package/coverage/agility-component-lib-react/src/util/DynamicIcons.tsx.html +5 -5
- package/coverage/agility-component-lib-react/src/util/Loader.tsx.html +1 -1
- package/coverage/agility-component-lib-react/src/util/index.html +1 -1
- package/coverage/agility-component-lib-react/styleMock.js.html +1 -1
- package/coverage/coverage-final.json +12 -2
- package/coverage/index.html +147 -12
- package/lib/components/Forms/TextInput/TextInput.d.ts +3 -3
- package/lib/components/Forms/TextInputAddon/TextInputAddon.d.ts +3 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.esm.js +66 -9
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +68 -10
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -12227,6 +12227,61 @@ var TreeView = function (_a, ref) {
|
|
|
12227
12227
|
};
|
|
12228
12228
|
var _TreeView = React.forwardRef(TreeView);
|
|
12229
12229
|
|
|
12230
|
+
/**
|
|
12231
|
+
* Avatar component that shows profile image or name initials of the user
|
|
12232
|
+
*/
|
|
12233
|
+
var Avatar = function (_a) {
|
|
12234
|
+
var src = _a.src, status = _a.status, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.alt, alt = _c === void 0 ? 'Avatar image' : _c, initials = _a.initials;
|
|
12235
|
+
var imageStyles = cn$1('rounded-full', {
|
|
12236
|
+
'h-6 w-6': size === 'xxs',
|
|
12237
|
+
'h-8 w-8': size === 'xs',
|
|
12238
|
+
'h-10 w-10': size === 'sm',
|
|
12239
|
+
'h-12 w-12': size === 'md',
|
|
12240
|
+
'h-14 w-14': size === 'lg',
|
|
12241
|
+
'h-16 w-16': size === 'xl'
|
|
12242
|
+
});
|
|
12243
|
+
var initialsStyles = cn$1('inline-flex items-center justify-center rounded-full bg-gray-500', {
|
|
12244
|
+
'h-6 w-6': size === 'xxs',
|
|
12245
|
+
'h-8 w-8': size === 'xs',
|
|
12246
|
+
'h-10 w-10': size === 'sm',
|
|
12247
|
+
'h-12 w-12': size === 'md',
|
|
12248
|
+
'h-14 w-14': size === 'lg',
|
|
12249
|
+
'h-16 w-16': size === 'xl'
|
|
12250
|
+
});
|
|
12251
|
+
var fontStyles = cn$1('font-medium leading-none text-white uppercase', {
|
|
12252
|
+
'text-xs': size === 'xxs' || size === 'xs',
|
|
12253
|
+
'text-sm': size === 'sm',
|
|
12254
|
+
'text-base': size === 'md',
|
|
12255
|
+
'text-lg': size === 'lg',
|
|
12256
|
+
'text-xl': size === 'xl'
|
|
12257
|
+
});
|
|
12258
|
+
var defaultAvatarStyles = cn$1('inline-block rounded-full overflow-hidden bg-gray-100', {
|
|
12259
|
+
'h-6 w-6': size === 'xxs',
|
|
12260
|
+
'h-8 w-8': size === 'xs',
|
|
12261
|
+
'h-10 w-10': size === 'sm',
|
|
12262
|
+
'h-12 w-12': size === 'md',
|
|
12263
|
+
'h-14 w-14': size === 'lg',
|
|
12264
|
+
'h-16 w-16': size === 'xl'
|
|
12265
|
+
});
|
|
12266
|
+
var statusStyles = cn$1('absolute top-0 right-0 block rounded-full ring-2 ring-white', {
|
|
12267
|
+
'h-1.5 w-1.5': size === 'xxs',
|
|
12268
|
+
'h-2 w-2': size === 'xs',
|
|
12269
|
+
'h-2.5 w-2.5': size === 'sm',
|
|
12270
|
+
'h-3 w-3': size === 'md',
|
|
12271
|
+
'h-3.5 w-3.5': size === 'lg',
|
|
12272
|
+
'h-4 w-4': size === 'xl',
|
|
12273
|
+
'bg-gray-300': status === 'offline',
|
|
12274
|
+
'bg-red-400': status === 'busy',
|
|
12275
|
+
'bg-green-400': status === 'online'
|
|
12276
|
+
});
|
|
12277
|
+
return (React__default["default"].createElement("span", { className: "inline-block relative" },
|
|
12278
|
+
src ? (React__default["default"].createElement("img", { className: imageStyles, src: src, alt: alt })) : initials ? (React__default["default"].createElement("span", { className: initialsStyles },
|
|
12279
|
+
React__default["default"].createElement("span", { className: fontStyles }, initials))) : (React__default["default"].createElement("span", { className: defaultAvatarStyles },
|
|
12280
|
+
React__default["default"].createElement("svg", { className: "h-full w-full text-gray-300", fill: "currentColor", viewBox: "0 0 24 24" },
|
|
12281
|
+
React__default["default"].createElement("path", { d: "M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z" })))),
|
|
12282
|
+
status && React__default["default"].createElement("span", { className: statusStyles })));
|
|
12283
|
+
};
|
|
12284
|
+
|
|
12230
12285
|
/** Primary UI component for user interaction */
|
|
12231
12286
|
var InputCounter = function (_a) {
|
|
12232
12287
|
var _b = _a.current, current = _b === void 0 ? 0 : _b, limit = _a.limit;
|
|
@@ -12266,10 +12321,10 @@ var BaseField = function (_a, ref) {
|
|
|
12266
12321
|
};
|
|
12267
12322
|
var _BaseField = React.forwardRef(BaseField);
|
|
12268
12323
|
|
|
12269
|
-
var TextInput = function (_a) {
|
|
12324
|
+
var TextInput = function (_a, ref) {
|
|
12270
12325
|
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, onChange = _a.onChange;
|
|
12271
12326
|
var _c = React.useState(Boolean(isFocused)), isFocus = _c[0], setIsFocus = _c[1];
|
|
12272
|
-
var _d = React.useState(false)
|
|
12327
|
+
var _d = React.useState(false); _d[0]; var setIsActive = _d[1];
|
|
12273
12328
|
var _e = React.useState(defaultValue), value = _e[0], setValue = _e[1];
|
|
12274
12329
|
var inputRef = React.useRef(null);
|
|
12275
12330
|
// set force focus
|
|
@@ -12304,14 +12359,15 @@ var TextInput = function (_a) {
|
|
|
12304
12359
|
var inputStyles = cn$1('border py-2 px-3 rounded-md text-sm leading-5 font-normal w-full', { 'border-gray-300 shadow-sm': !isFocus && !isError }, { 'focus:ring-purple-500 border-purple-500 outline-purple-500 shadow-none': isFocus && !isError }, { 'focus:ring-red-500 !border-red-500 shadow-none': isError });
|
|
12305
12360
|
var discriptionStyles = cn$1('text-sm mt-1 block', { 'text-gray-500': !isError }, { 'text-red-500': isError });
|
|
12306
12361
|
return (React__default["default"].createElement("div", null,
|
|
12307
|
-
React__default["default"].createElement(InputLabel, { isPlaceholder: true, label: label, isRequired: isRequired, id: id, isError: isError, isActive:
|
|
12362
|
+
React__default["default"].createElement(InputLabel, { isPlaceholder: true, label: label, isRequired: isRequired, id: id, isError: isError, isActive: true, isDisabled: isDisabled }),
|
|
12308
12363
|
React__default["default"].createElement("div", null,
|
|
12309
|
-
React__default["default"].createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref:
|
|
12364
|
+
React__default["default"].createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref: ref, type: type, name: name, id: id, inputStyles: inputStyles, isDisabled: isDisabled, defaultValue: defaultValue, maxLength: maxLength }),
|
|
12310
12365
|
React__default["default"].createElement("div", { className: "flex flex-row space-x-3" },
|
|
12311
12366
|
React__default["default"].createElement("div", { className: "grow" }, message && React__default["default"].createElement("span", { className: discriptionStyles }, message)),
|
|
12312
12367
|
isShowCounter && (React__default["default"].createElement("div", { className: "shrink-0" },
|
|
12313
12368
|
React__default["default"].createElement(InputCounter, { current: Number(value === null || value === void 0 ? void 0 : value.length), limit: maxLength })))))));
|
|
12314
|
-
};
|
|
12369
|
+
};
|
|
12370
|
+
var _TextInput = React.forwardRef(TextInput);
|
|
12315
12371
|
|
|
12316
12372
|
/** Comment */
|
|
12317
12373
|
var InputCta = function (_a) {
|
|
@@ -12341,7 +12397,7 @@ var InputCta = function (_a) {
|
|
|
12341
12397
|
ctaLabel && React__default["default"].createElement("span", null, ctaLabel)));
|
|
12342
12398
|
};
|
|
12343
12399
|
|
|
12344
|
-
var TextInputAddon = function (_a) {
|
|
12400
|
+
var TextInputAddon = function (_a, ref) {
|
|
12345
12401
|
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;
|
|
12346
12402
|
var _d = React.useState(Boolean(isFocused)), isFocus = _d[0], setIsFocus = _d[1];
|
|
12347
12403
|
var _e = React.useState(defaultValue), value = _e[0], setValue = _e[1];
|
|
@@ -12381,13 +12437,14 @@ var TextInputAddon = function (_a) {
|
|
|
12381
12437
|
React__default["default"].createElement("div", { className: "flex-grow focus-within:z-20 relative" },
|
|
12382
12438
|
inlineIcon && (React__default["default"].createElement("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none" },
|
|
12383
12439
|
React__default["default"].createElement(DynamicIcons, { icon: inlineIcon, className: "h-5 w-5 text-gray-400", outline: false }))),
|
|
12384
|
-
React__default["default"].createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref:
|
|
12440
|
+
React__default["default"].createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref: ref, type: type, name: name, id: id, inputStyles: inputStyles, isDisabled: isDisabled, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder })),
|
|
12385
12441
|
(trailIcon || trailLabel) && (React__default["default"].createElement(InputCta, { icon: trailIcon, ctaLabel: trailLabel, align: "right", isClear: clearCta === 'right' || clearCta === 'both', onClickHandler: onCtaClick }))),
|
|
12386
12442
|
React__default["default"].createElement("div", { className: "flex flex-row space-x-3" },
|
|
12387
12443
|
React__default["default"].createElement("div", { className: "grow" }, message && React__default["default"].createElement("span", { className: discriptionStyles }, message)),
|
|
12388
12444
|
isShowCounter && (React__default["default"].createElement("div", { className: "shrink-0" },
|
|
12389
12445
|
React__default["default"].createElement(InputCounter, { current: Number(value === null || value === void 0 ? void 0 : value.length), limit: maxLength }))))));
|
|
12390
|
-
};
|
|
12446
|
+
};
|
|
12447
|
+
var _TextInputAddon = React.forwardRef(TextInputAddon);
|
|
12391
12448
|
|
|
12392
12449
|
/** Comment */
|
|
12393
12450
|
var InputSelect = function (_a) {
|
|
@@ -12548,6 +12605,7 @@ var Checkbox = function (_a) {
|
|
|
12548
12605
|
message && (React__default["default"].createElement("p", { id: "".concat(id, "-description"), className: "text-gray-500" }, message)))));
|
|
12549
12606
|
};
|
|
12550
12607
|
|
|
12608
|
+
exports.Avatar = Avatar;
|
|
12551
12609
|
exports.Button = Button;
|
|
12552
12610
|
exports.Checkbox = Checkbox;
|
|
12553
12611
|
exports.Combobox = Combobox;
|
|
@@ -12556,8 +12614,8 @@ exports.Placeholder = Placeholder;
|
|
|
12556
12614
|
exports.Radio = Radio;
|
|
12557
12615
|
exports.Select = Select;
|
|
12558
12616
|
exports.Switch = Switch;
|
|
12559
|
-
exports.TextInput =
|
|
12560
|
-
exports.TextInputAddon =
|
|
12617
|
+
exports.TextInput = _TextInput;
|
|
12618
|
+
exports.TextInputAddon = _TextInputAddon;
|
|
12561
12619
|
exports.TextInputSelect = TextInputSelect;
|
|
12562
12620
|
exports.Textarea = _Textarea;
|
|
12563
12621
|
exports.TreeView = _TreeView;
|