@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.esm.js
CHANGED
|
@@ -12201,6 +12201,61 @@ var TreeView = function (_a, ref) {
|
|
|
12201
12201
|
};
|
|
12202
12202
|
var _TreeView = forwardRef(TreeView);
|
|
12203
12203
|
|
|
12204
|
+
/**
|
|
12205
|
+
* Avatar component that shows profile image or name initials of the user
|
|
12206
|
+
*/
|
|
12207
|
+
var Avatar = function (_a) {
|
|
12208
|
+
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;
|
|
12209
|
+
var imageStyles = cn$1('rounded-full', {
|
|
12210
|
+
'h-6 w-6': size === 'xxs',
|
|
12211
|
+
'h-8 w-8': size === 'xs',
|
|
12212
|
+
'h-10 w-10': size === 'sm',
|
|
12213
|
+
'h-12 w-12': size === 'md',
|
|
12214
|
+
'h-14 w-14': size === 'lg',
|
|
12215
|
+
'h-16 w-16': size === 'xl'
|
|
12216
|
+
});
|
|
12217
|
+
var initialsStyles = cn$1('inline-flex items-center justify-center rounded-full bg-gray-500', {
|
|
12218
|
+
'h-6 w-6': size === 'xxs',
|
|
12219
|
+
'h-8 w-8': size === 'xs',
|
|
12220
|
+
'h-10 w-10': size === 'sm',
|
|
12221
|
+
'h-12 w-12': size === 'md',
|
|
12222
|
+
'h-14 w-14': size === 'lg',
|
|
12223
|
+
'h-16 w-16': size === 'xl'
|
|
12224
|
+
});
|
|
12225
|
+
var fontStyles = cn$1('font-medium leading-none text-white uppercase', {
|
|
12226
|
+
'text-xs': size === 'xxs' || size === 'xs',
|
|
12227
|
+
'text-sm': size === 'sm',
|
|
12228
|
+
'text-base': size === 'md',
|
|
12229
|
+
'text-lg': size === 'lg',
|
|
12230
|
+
'text-xl': size === 'xl'
|
|
12231
|
+
});
|
|
12232
|
+
var defaultAvatarStyles = cn$1('inline-block rounded-full overflow-hidden bg-gray-100', {
|
|
12233
|
+
'h-6 w-6': size === 'xxs',
|
|
12234
|
+
'h-8 w-8': size === 'xs',
|
|
12235
|
+
'h-10 w-10': size === 'sm',
|
|
12236
|
+
'h-12 w-12': size === 'md',
|
|
12237
|
+
'h-14 w-14': size === 'lg',
|
|
12238
|
+
'h-16 w-16': size === 'xl'
|
|
12239
|
+
});
|
|
12240
|
+
var statusStyles = cn$1('absolute top-0 right-0 block rounded-full ring-2 ring-white', {
|
|
12241
|
+
'h-1.5 w-1.5': size === 'xxs',
|
|
12242
|
+
'h-2 w-2': size === 'xs',
|
|
12243
|
+
'h-2.5 w-2.5': size === 'sm',
|
|
12244
|
+
'h-3 w-3': size === 'md',
|
|
12245
|
+
'h-3.5 w-3.5': size === 'lg',
|
|
12246
|
+
'h-4 w-4': size === 'xl',
|
|
12247
|
+
'bg-gray-300': status === 'offline',
|
|
12248
|
+
'bg-red-400': status === 'busy',
|
|
12249
|
+
'bg-green-400': status === 'online'
|
|
12250
|
+
});
|
|
12251
|
+
return (React__default.createElement("span", { className: "inline-block relative" },
|
|
12252
|
+
src ? (React__default.createElement("img", { className: imageStyles, src: src, alt: alt })) : initials ? (React__default.createElement("span", { className: initialsStyles },
|
|
12253
|
+
React__default.createElement("span", { className: fontStyles }, initials))) : (React__default.createElement("span", { className: defaultAvatarStyles },
|
|
12254
|
+
React__default.createElement("svg", { className: "h-full w-full text-gray-300", fill: "currentColor", viewBox: "0 0 24 24" },
|
|
12255
|
+
React__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" })))),
|
|
12256
|
+
status && React__default.createElement("span", { className: statusStyles })));
|
|
12257
|
+
};
|
|
12258
|
+
|
|
12204
12259
|
/** Primary UI component for user interaction */
|
|
12205
12260
|
var InputCounter = function (_a) {
|
|
12206
12261
|
var _b = _a.current, current = _b === void 0 ? 0 : _b, limit = _a.limit;
|
|
@@ -12240,10 +12295,10 @@ var BaseField = function (_a, ref) {
|
|
|
12240
12295
|
};
|
|
12241
12296
|
var _BaseField = forwardRef(BaseField);
|
|
12242
12297
|
|
|
12243
|
-
var TextInput = function (_a) {
|
|
12298
|
+
var TextInput = function (_a, ref) {
|
|
12244
12299
|
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;
|
|
12245
12300
|
var _c = useState(Boolean(isFocused)), isFocus = _c[0], setIsFocus = _c[1];
|
|
12246
|
-
var _d = useState(false)
|
|
12301
|
+
var _d = useState(false); _d[0]; var setIsActive = _d[1];
|
|
12247
12302
|
var _e = useState(defaultValue), value = _e[0], setValue = _e[1];
|
|
12248
12303
|
var inputRef = useRef(null);
|
|
12249
12304
|
// set force focus
|
|
@@ -12278,14 +12333,15 @@ var TextInput = function (_a) {
|
|
|
12278
12333
|
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 });
|
|
12279
12334
|
var discriptionStyles = cn$1('text-sm mt-1 block', { 'text-gray-500': !isError }, { 'text-red-500': isError });
|
|
12280
12335
|
return (React__default.createElement("div", null,
|
|
12281
|
-
React__default.createElement(InputLabel, { isPlaceholder: true, label: label, isRequired: isRequired, id: id, isError: isError, isActive:
|
|
12336
|
+
React__default.createElement(InputLabel, { isPlaceholder: true, label: label, isRequired: isRequired, id: id, isError: isError, isActive: true, isDisabled: isDisabled }),
|
|
12282
12337
|
React__default.createElement("div", null,
|
|
12283
|
-
React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref:
|
|
12338
|
+
React__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 }),
|
|
12284
12339
|
React__default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
12285
12340
|
React__default.createElement("div", { className: "grow" }, message && React__default.createElement("span", { className: discriptionStyles }, message)),
|
|
12286
12341
|
isShowCounter && (React__default.createElement("div", { className: "shrink-0" },
|
|
12287
12342
|
React__default.createElement(InputCounter, { current: Number(value === null || value === void 0 ? void 0 : value.length), limit: maxLength })))))));
|
|
12288
|
-
};
|
|
12343
|
+
};
|
|
12344
|
+
var _TextInput = forwardRef(TextInput);
|
|
12289
12345
|
|
|
12290
12346
|
/** Comment */
|
|
12291
12347
|
var InputCta = function (_a) {
|
|
@@ -12315,7 +12371,7 @@ var InputCta = function (_a) {
|
|
|
12315
12371
|
ctaLabel && React__default.createElement("span", null, ctaLabel)));
|
|
12316
12372
|
};
|
|
12317
12373
|
|
|
12318
|
-
var TextInputAddon = function (_a) {
|
|
12374
|
+
var TextInputAddon = function (_a, ref) {
|
|
12319
12375
|
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;
|
|
12320
12376
|
var _d = useState(Boolean(isFocused)), isFocus = _d[0], setIsFocus = _d[1];
|
|
12321
12377
|
var _e = useState(defaultValue), value = _e[0], setValue = _e[1];
|
|
@@ -12355,13 +12411,14 @@ var TextInputAddon = function (_a) {
|
|
|
12355
12411
|
React__default.createElement("div", { className: "flex-grow focus-within:z-20 relative" },
|
|
12356
12412
|
inlineIcon && (React__default.createElement("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none" },
|
|
12357
12413
|
React__default.createElement(DynamicIcons, { icon: inlineIcon, className: "h-5 w-5 text-gray-400", outline: false }))),
|
|
12358
|
-
React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref:
|
|
12414
|
+
React__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 })),
|
|
12359
12415
|
(trailIcon || trailLabel) && (React__default.createElement(InputCta, { icon: trailIcon, ctaLabel: trailLabel, align: "right", isClear: clearCta === 'right' || clearCta === 'both', onClickHandler: onCtaClick }))),
|
|
12360
12416
|
React__default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
12361
12417
|
React__default.createElement("div", { className: "grow" }, message && React__default.createElement("span", { className: discriptionStyles }, message)),
|
|
12362
12418
|
isShowCounter && (React__default.createElement("div", { className: "shrink-0" },
|
|
12363
12419
|
React__default.createElement(InputCounter, { current: Number(value === null || value === void 0 ? void 0 : value.length), limit: maxLength }))))));
|
|
12364
|
-
};
|
|
12420
|
+
};
|
|
12421
|
+
var _TextInputAddon = forwardRef(TextInputAddon);
|
|
12365
12422
|
|
|
12366
12423
|
/** Comment */
|
|
12367
12424
|
var InputSelect = function (_a) {
|
|
@@ -12522,5 +12579,5 @@ var Checkbox = function (_a) {
|
|
|
12522
12579
|
message && (React__default.createElement("p", { id: "".concat(id, "-description"), className: "text-gray-500" }, message)))));
|
|
12523
12580
|
};
|
|
12524
12581
|
|
|
12525
|
-
export { Button, Checkbox, Combobox, Dropdown, Placeholder, Radio, Select, Switch, TextInput, TextInputAddon, TextInputSelect, _Textarea as Textarea, _TreeView as TreeView };
|
|
12582
|
+
export { Avatar, Button, Checkbox, Combobox, Dropdown, Placeholder, Radio, Select, Switch, _TextInput as TextInput, _TextInputAddon as TextInputAddon, TextInputSelect, _Textarea as Textarea, _TreeView as TreeView };
|
|
12526
12583
|
//# sourceMappingURL=index.esm.js.map
|