esewa-ui-library 1.10.2 → 1.10.4
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.
|
@@ -3,7 +3,7 @@ interface AlertCardProps {
|
|
|
3
3
|
alertCardClass?: string;
|
|
4
4
|
variant?: 'primary' | 'warning' | 'danger' | 'info';
|
|
5
5
|
title?: string;
|
|
6
|
-
description?: string;
|
|
6
|
+
description?: string | React.ReactNode;
|
|
7
7
|
descriptionIcon?: string | React.ReactNode;
|
|
8
8
|
showDescriptionIcon?: boolean;
|
|
9
9
|
titleIcon?: string | React.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -125,9 +125,11 @@ var ESewaAlertCard = function ESewaAlertCard(_ref) {
|
|
|
125
125
|
className: 'alert-card--description--icon'
|
|
126
126
|
}, typeof descriptionIcon === 'string' ? React__default.createElement("i", {
|
|
127
127
|
className: descriptionIcon
|
|
128
|
-
}) : descriptionIcon), description && React__default.createElement("p", {
|
|
128
|
+
}) : descriptionIcon), description && (typeof description === 'string' ? React__default.createElement("p", {
|
|
129
129
|
className: 'card-text body2'
|
|
130
|
-
}, description)
|
|
130
|
+
}, description) : React__default.createElement("div", {
|
|
131
|
+
className: 'card-text body2'
|
|
132
|
+
}, description))), showCardFooter && React__default.createElement("div", {
|
|
131
133
|
className: 'alert-card--footer'
|
|
132
134
|
}, React__default.createElement(ESewaButton, {
|
|
133
135
|
className: 'border-radius-8',
|
|
@@ -6994,7 +6996,7 @@ var ESewaCarousel = function ESewaCarousel(_ref) {
|
|
|
6994
6996
|
|
|
6995
6997
|
var _templateObject$k, _templateObject2;
|
|
6996
6998
|
var ChipContainer = styled__default.div(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n padding: 8px;\n"])));
|
|
6997
|
-
var Chip = styled__default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px 12px;\n border-radius: 16px;\n cursor: pointer;\n font-size: 14px;\n background-color: ", ";\n color: ", ";\n &.border-radius-0 {\n border-radius: var(--values-value-0);\n }\n &.border-radius-2 {\n border-radius: var(--values-value-2);\n }\n &.border-radius-4 {\n border-radius: var(--values-value-4);\n }\n &.border-radius-8 {\n border-radius: var(--values-value-8);\n }\n &.border-radius-16 {\n border-radius: var(--values-value-16);\n }\n i{\n font-size: var(--values-value-12);\n }\n .chip__icon {\n display: flex;\n align-items: center;\n font-size: var(--values-value-12);\n }\n"])), function (_ref) {
|
|
6999
|
+
var Chip = styled__default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px 12px;\n border-radius: 16px;\n cursor: pointer;\n font-size: 14px;\n background-color: ", ";\n color: ", ";\n &.border-radius-0 {\n border-radius: var(--values-value-0);\n }\n &.border-radius-2 {\n border-radius: var(--values-value-2);\n }\n &.border-radius-4 {\n border-radius: var(--values-value-4);\n }\n &.border-radius-8 {\n border-radius: var(--values-value-8);\n }\n &.border-radius-16 {\n border-radius: var(--values-value-16);\n }\n i {\n font-size: var(--values-value-12);\n }\n .chip__icon {\n display: flex;\n align-items: center;\n font-size: var(--values-value-12);\n }\n"])), function (_ref) {
|
|
6998
7000
|
var selected = _ref.selected;
|
|
6999
7001
|
return selected ? 'var(--primary-500)' : 'var(--secondary-bg-light)';
|
|
7000
7002
|
}, function (_ref2) {
|
|
@@ -7018,6 +7020,16 @@ var ESewaChipGroup = function ESewaChipGroup(_ref3) {
|
|
|
7018
7020
|
var _useState = React.useState(initialSelectedChips),
|
|
7019
7021
|
selectedChips = _useState[0],
|
|
7020
7022
|
setSelectedChips = _useState[1];
|
|
7023
|
+
React.useEffect(function () {
|
|
7024
|
+
var newSelected = function () {
|
|
7025
|
+
if (defaultValue === undefined) return [];
|
|
7026
|
+
if (selection === 'single') {
|
|
7027
|
+
return typeof defaultValue === 'number' ? [defaultValue] : [];
|
|
7028
|
+
}
|
|
7029
|
+
return Array.isArray(defaultValue) ? defaultValue : [];
|
|
7030
|
+
}();
|
|
7031
|
+
setSelectedChips(newSelected);
|
|
7032
|
+
}, [defaultValue, selection]);
|
|
7021
7033
|
var handleSelectChip = function handleSelectChip(id) {
|
|
7022
7034
|
if (selection === 'single') {
|
|
7023
7035
|
setSelectedChips([id]);
|
|
@@ -7050,7 +7062,7 @@ var ESewaChipGroup = function ESewaChipGroup(_ref3) {
|
|
|
7050
7062
|
return handleSelectChip(chip.id);
|
|
7051
7063
|
}
|
|
7052
7064
|
}, chip.showIcon && chip.icon && React__default.createElement("span", {
|
|
7053
|
-
className:
|
|
7065
|
+
className: 'chip__icon'
|
|
7054
7066
|
}, typeof chip.icon === 'string' ? React__default.createElement("i", {
|
|
7055
7067
|
className: chip.icon
|
|
7056
7068
|
}) : chip.icon), chip.text);
|