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.
package/dist/index.modern.js
CHANGED
|
@@ -122,9 +122,11 @@ var ESewaAlertCard = function ESewaAlertCard(_ref) {
|
|
|
122
122
|
className: 'alert-card--description--icon'
|
|
123
123
|
}, typeof descriptionIcon === 'string' ? React__default.createElement("i", {
|
|
124
124
|
className: descriptionIcon
|
|
125
|
-
}) : descriptionIcon), description && React__default.createElement("p", {
|
|
125
|
+
}) : descriptionIcon), description && (typeof description === 'string' ? React__default.createElement("p", {
|
|
126
126
|
className: 'card-text body2'
|
|
127
|
-
}, description)
|
|
127
|
+
}, description) : React__default.createElement("div", {
|
|
128
|
+
className: 'card-text body2'
|
|
129
|
+
}, description))), showCardFooter && React__default.createElement("div", {
|
|
128
130
|
className: 'alert-card--footer'
|
|
129
131
|
}, React__default.createElement(ESewaButton, {
|
|
130
132
|
className: 'border-radius-8',
|
|
@@ -7005,7 +7007,7 @@ var ESewaCarousel = function ESewaCarousel(_ref) {
|
|
|
7005
7007
|
|
|
7006
7008
|
var _templateObject$k, _templateObject2;
|
|
7007
7009
|
var ChipContainer = styled.div(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n padding: 8px;\n"])));
|
|
7008
|
-
var Chip = styled.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) {
|
|
7010
|
+
var Chip = styled.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) {
|
|
7009
7011
|
var selected = _ref.selected;
|
|
7010
7012
|
return selected ? 'var(--primary-500)' : 'var(--secondary-bg-light)';
|
|
7011
7013
|
}, function (_ref2) {
|
|
@@ -7029,6 +7031,16 @@ var ESewaChipGroup = function ESewaChipGroup(_ref3) {
|
|
|
7029
7031
|
var _useState = useState(initialSelectedChips),
|
|
7030
7032
|
selectedChips = _useState[0],
|
|
7031
7033
|
setSelectedChips = _useState[1];
|
|
7034
|
+
useEffect(function () {
|
|
7035
|
+
var newSelected = function () {
|
|
7036
|
+
if (defaultValue === undefined) return [];
|
|
7037
|
+
if (selection === 'single') {
|
|
7038
|
+
return typeof defaultValue === 'number' ? [defaultValue] : [];
|
|
7039
|
+
}
|
|
7040
|
+
return Array.isArray(defaultValue) ? defaultValue : [];
|
|
7041
|
+
}();
|
|
7042
|
+
setSelectedChips(newSelected);
|
|
7043
|
+
}, [defaultValue, selection]);
|
|
7032
7044
|
var handleSelectChip = function handleSelectChip(id) {
|
|
7033
7045
|
if (selection === 'single') {
|
|
7034
7046
|
setSelectedChips([id]);
|
|
@@ -7061,7 +7073,7 @@ var ESewaChipGroup = function ESewaChipGroup(_ref3) {
|
|
|
7061
7073
|
return handleSelectChip(chip.id);
|
|
7062
7074
|
}
|
|
7063
7075
|
}, chip.showIcon && chip.icon && React__default.createElement("span", {
|
|
7064
|
-
className:
|
|
7076
|
+
className: 'chip__icon'
|
|
7065
7077
|
}, typeof chip.icon === 'string' ? React__default.createElement("i", {
|
|
7066
7078
|
className: chip.icon
|
|
7067
7079
|
}) : chip.icon), chip.text);
|