@widergy/energy-ui 3.163.0 → 3.165.0
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/CHANGELOG.md +23 -4
- package/dist/components/UTAlert/README.md +100 -0
- package/dist/components/UTAlert/stories/UTAlert.stories.js +239 -0
- package/dist/components/UTAlert/stories/storiesConstants.js +107 -0
- package/dist/components/UTBanner/index.js +11 -5
- package/dist/components/UTBanner/stories/UTBanner.stories.js +8 -0
- package/dist/components/UTBaseInputField/UTBaseInputField.stories.js +393 -0
- package/dist/components/UTDatePicker/versions/V0/index.js +3 -0
- package/dist/components/UTDatePicker/versions/V1/index.js +5 -8
- package/dist/components/UTSnackbar/README.md +105 -0
- package/dist/components/UTSnackbar/constants.js +128 -0
- package/dist/components/UTSnackbar/index.js +136 -0
- package/dist/components/UTSnackbar/stories/UTSnackbar.stories.js +316 -0
- package/dist/components/UTSnackbar/stories/storiesConstants.js +168 -0
- package/dist/components/UTSnackbar/styles.module.scss +82 -0
- package/dist/components/UTSnackbar/theme.js +57 -0
- package/dist/components/UTSnackbar/types.js +20 -0
- package/dist/components/UTTextArea/UTTextArea.stories.js +342 -0
- package/dist/components/UTTextInput/UTTextInput.stories.js +439 -0
- package/dist/components/UTTextInput/versions/V0/index.js +1 -0
- package/dist/constants/testIds.js +10 -4
- package/dist/esm/components/UTAlert/README.md +100 -0
- package/dist/esm/components/UTAlert/stories/UTAlert.stories.js +231 -0
- package/dist/esm/components/UTAlert/stories/storiesConstants.js +101 -0
- package/dist/esm/components/UTBanner/index.js +11 -5
- package/dist/esm/components/UTBanner/stories/UTBanner.stories.js +8 -0
- package/dist/esm/components/UTBaseInputField/UTBaseInputField.stories.js +385 -0
- package/dist/esm/components/UTDatePicker/versions/V0/index.js +3 -0
- package/dist/esm/components/UTDatePicker/versions/V1/index.js +5 -8
- package/dist/esm/components/UTSnackbar/README.md +105 -0
- package/dist/esm/components/UTSnackbar/constants.js +122 -0
- package/dist/esm/components/UTSnackbar/index.js +129 -0
- package/dist/esm/components/UTSnackbar/stories/UTSnackbar.stories.js +308 -0
- package/dist/esm/components/UTSnackbar/stories/storiesConstants.js +162 -0
- package/dist/esm/components/UTSnackbar/styles.module.scss +82 -0
- package/dist/esm/components/UTSnackbar/theme.js +50 -0
- package/dist/esm/components/UTSnackbar/types.js +14 -0
- package/dist/esm/components/UTTextArea/UTTextArea.stories.js +334 -0
- package/dist/esm/components/UTTextInput/UTTextInput.stories.js +431 -0
- package/dist/esm/components/UTTextInput/versions/V0/index.js +1 -0
- package/dist/esm/constants/testIds.js +10 -4
- package/dist/esm/index.js +2 -1
- package/dist/esm/utils/hooks/useCSSVariables/constants.js +9 -0
- package/dist/index.js +7 -0
- package/dist/utils/hooks/useCSSVariables/constants.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VARIANT_CLASS_MAP = exports.VARIANTS = exports.LABEL_COLOR_MAP = exports.ICON_NAME_MAP = exports.DEFAULT_PROPS = exports.COLOR_THEMES = exports.ACTION_BUTTON_CONFIG_MAP = void 0;
|
|
7
|
+
var _Palette = require("../../constants/Palette");
|
|
8
|
+
const COLOR_THEMES = exports.COLOR_THEMES = {
|
|
9
|
+
error: 'error',
|
|
10
|
+
info: 'info',
|
|
11
|
+
success: 'success',
|
|
12
|
+
warning: 'warning',
|
|
13
|
+
white: 'white'
|
|
14
|
+
};
|
|
15
|
+
const VARIANTS = exports.VARIANTS = {
|
|
16
|
+
dark: 'dark',
|
|
17
|
+
light: 'light'
|
|
18
|
+
};
|
|
19
|
+
const DEFAULT_PROPS = exports.DEFAULT_PROPS = {
|
|
20
|
+
colorTheme: COLOR_THEMES.success,
|
|
21
|
+
open: false,
|
|
22
|
+
topRight: false,
|
|
23
|
+
variant: VARIANTS.dark
|
|
24
|
+
};
|
|
25
|
+
const VARIANT_CLASS_MAP = exports.VARIANT_CLASS_MAP = {
|
|
26
|
+
["".concat(COLOR_THEMES.success, "-").concat(VARIANTS.dark)]: 'successDark',
|
|
27
|
+
["".concat(COLOR_THEMES.error, "-").concat(VARIANTS.dark)]: 'errorDark',
|
|
28
|
+
["".concat(COLOR_THEMES.warning, "-").concat(VARIANTS.dark)]: 'warningDark',
|
|
29
|
+
["".concat(COLOR_THEMES.info, "-").concat(VARIANTS.dark)]: 'infoDark',
|
|
30
|
+
["".concat(COLOR_THEMES.success, "-").concat(VARIANTS.light)]: 'successLight',
|
|
31
|
+
["".concat(COLOR_THEMES.error, "-").concat(VARIANTS.light)]: 'errorLight',
|
|
32
|
+
["".concat(COLOR_THEMES.warning, "-").concat(VARIANTS.light)]: 'warningLight',
|
|
33
|
+
["".concat(COLOR_THEMES.info, "-").concat(VARIANTS.light)]: 'infoLight',
|
|
34
|
+
["".concat(COLOR_THEMES.white, "-").concat(VARIANTS.light)]: 'whiteLight',
|
|
35
|
+
["".concat(COLOR_THEMES.white, "-").concat(VARIANTS.dark)]: 'whiteDark'
|
|
36
|
+
};
|
|
37
|
+
const LABEL_COLOR_MAP = exports.LABEL_COLOR_MAP = {
|
|
38
|
+
successDark: {
|
|
39
|
+
colorTheme: _Palette.COLOR_THEMES.light,
|
|
40
|
+
shade: _Palette.COLOR_SHADES.shade01
|
|
41
|
+
},
|
|
42
|
+
errorDark: {
|
|
43
|
+
colorTheme: _Palette.COLOR_THEMES.light,
|
|
44
|
+
shade: _Palette.COLOR_SHADES.shade01
|
|
45
|
+
},
|
|
46
|
+
warningDark: {
|
|
47
|
+
colorTheme: _Palette.COLOR_THEMES.light,
|
|
48
|
+
shade: _Palette.COLOR_SHADES.shade01
|
|
49
|
+
},
|
|
50
|
+
infoDark: {
|
|
51
|
+
colorTheme: _Palette.COLOR_THEMES.light,
|
|
52
|
+
shade: _Palette.COLOR_SHADES.shade01
|
|
53
|
+
},
|
|
54
|
+
successLight: {
|
|
55
|
+
colorTheme: _Palette.COLOR_THEMES.success,
|
|
56
|
+
shade: _Palette.COLOR_SHADES.shade05
|
|
57
|
+
},
|
|
58
|
+
errorLight: {
|
|
59
|
+
colorTheme: _Palette.COLOR_THEMES.error,
|
|
60
|
+
shade: _Palette.COLOR_SHADES.shade05
|
|
61
|
+
},
|
|
62
|
+
warningLight: {
|
|
63
|
+
colorTheme: _Palette.COLOR_THEMES.warning,
|
|
64
|
+
shade: _Palette.COLOR_SHADES.shade05
|
|
65
|
+
},
|
|
66
|
+
infoLight: {
|
|
67
|
+
colorTheme: _Palette.COLOR_THEMES.information,
|
|
68
|
+
shade: _Palette.COLOR_SHADES.shade05
|
|
69
|
+
},
|
|
70
|
+
whiteLight: {
|
|
71
|
+
colorTheme: _Palette.COLOR_THEMES.dark,
|
|
72
|
+
shade: _Palette.COLOR_SHADES.shade05
|
|
73
|
+
},
|
|
74
|
+
whiteDark: {
|
|
75
|
+
colorTheme: _Palette.COLOR_THEMES.light,
|
|
76
|
+
shade: _Palette.COLOR_SHADES.shade01
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const ACTION_BUTTON_CONFIG_MAP = exports.ACTION_BUTTON_CONFIG_MAP = {
|
|
80
|
+
successDark: {
|
|
81
|
+
colorTheme: _Palette.COLOR_THEMES.negative,
|
|
82
|
+
variant: 'text'
|
|
83
|
+
},
|
|
84
|
+
errorDark: {
|
|
85
|
+
colorTheme: _Palette.COLOR_THEMES.negative,
|
|
86
|
+
variant: 'text'
|
|
87
|
+
},
|
|
88
|
+
warningDark: {
|
|
89
|
+
colorTheme: _Palette.COLOR_THEMES.negative,
|
|
90
|
+
variant: 'text'
|
|
91
|
+
},
|
|
92
|
+
infoDark: {
|
|
93
|
+
colorTheme: _Palette.COLOR_THEMES.negative,
|
|
94
|
+
variant: 'text'
|
|
95
|
+
},
|
|
96
|
+
successLight: {
|
|
97
|
+
colorTheme: _Palette.COLOR_THEMES.success,
|
|
98
|
+
variant: 'text'
|
|
99
|
+
},
|
|
100
|
+
errorLight: {
|
|
101
|
+
colorTheme: _Palette.COLOR_THEMES.error,
|
|
102
|
+
variant: 'text'
|
|
103
|
+
},
|
|
104
|
+
warningLight: {
|
|
105
|
+
colorTheme: _Palette.COLOR_THEMES.warning,
|
|
106
|
+
variant: 'text'
|
|
107
|
+
},
|
|
108
|
+
infoLight: {
|
|
109
|
+
colorTheme: _Palette.COLOR_THEMES.information,
|
|
110
|
+
variant: 'text'
|
|
111
|
+
},
|
|
112
|
+
whiteLight: {
|
|
113
|
+
colorTheme: _Palette.COLOR_THEMES.primary,
|
|
114
|
+
closeColorTheme: _Palette.COLOR_THEMES.neutral,
|
|
115
|
+
variant: 'text'
|
|
116
|
+
},
|
|
117
|
+
whiteDark: {
|
|
118
|
+
colorTheme: _Palette.COLOR_THEMES.negative,
|
|
119
|
+
variant: 'text'
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const ICON_NAME_MAP = exports.ICON_NAME_MAP = {
|
|
123
|
+
[COLOR_THEMES.error]: 'IconCircleX',
|
|
124
|
+
[COLOR_THEMES.info]: 'IconInfoCircle',
|
|
125
|
+
[COLOR_THEMES.success]: 'IconCircleCheck',
|
|
126
|
+
[COLOR_THEMES.warning]: 'IconAlertTriangle',
|
|
127
|
+
[COLOR_THEMES.white]: 'IconInfoCircle'
|
|
128
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _Slide = _interopRequireDefault(require("@material-ui/core/Slide"));
|
|
10
|
+
var _Snackbar = _interopRequireDefault(require("@material-ui/core/Snackbar"));
|
|
11
|
+
var _UTButton = _interopRequireDefault(require("../UTButton"));
|
|
12
|
+
var _UTIcon = _interopRequireDefault(require("../UTIcon"));
|
|
13
|
+
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
14
|
+
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
15
|
+
var _testIds = require("../../constants/testIds");
|
|
16
|
+
var _constants = require("./constants");
|
|
17
|
+
var _theme = require("./theme");
|
|
18
|
+
var _types = require("./types");
|
|
19
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
22
|
+
const UTSnackbar = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
button,
|
|
25
|
+
colorTheme = _constants.DEFAULT_PROPS.colorTheme,
|
|
26
|
+
dataTestId,
|
|
27
|
+
description,
|
|
28
|
+
icon,
|
|
29
|
+
message,
|
|
30
|
+
onClose,
|
|
31
|
+
open = _constants.DEFAULT_PROPS.open,
|
|
32
|
+
secondaryButton,
|
|
33
|
+
timeDuration,
|
|
34
|
+
topRight = _constants.DEFAULT_PROPS.topRight,
|
|
35
|
+
variant = _constants.DEFAULT_PROPS.variant,
|
|
36
|
+
withoutIcon
|
|
37
|
+
} = _ref;
|
|
38
|
+
const handleClose = (_, reason) => {
|
|
39
|
+
if (reason === 'clickaway') return;
|
|
40
|
+
onClose === null || onClose === void 0 || onClose();
|
|
41
|
+
};
|
|
42
|
+
const variantKey = "".concat(colorTheme, "-").concat(variant);
|
|
43
|
+
const variantClassKey = _constants.VARIANT_CLASS_MAP[variantKey];
|
|
44
|
+
const variantClass = _stylesModule.default[variantClassKey] || '';
|
|
45
|
+
const labelColorConfig = _constants.LABEL_COLOR_MAP[variantClassKey] || _constants.LABEL_COLOR_MAP.successDark;
|
|
46
|
+
const actionButtonConfig = _constants.ACTION_BUTTON_CONFIG_MAP[variantClassKey];
|
|
47
|
+
const iconName = withoutIcon ? null : icon || _constants.ICON_NAME_MAP[colorTheme];
|
|
48
|
+
const anchor = {
|
|
49
|
+
horizontal: topRight ? 'right' : 'left',
|
|
50
|
+
vertical: topRight ? 'top' : 'bottom'
|
|
51
|
+
};
|
|
52
|
+
const transition = {
|
|
53
|
+
direction: topRight ? 'left' : 'up'
|
|
54
|
+
};
|
|
55
|
+
const testIds = {
|
|
56
|
+
close: dataTestId ? "".concat(dataTestId, ".close") : undefined,
|
|
57
|
+
description: dataTestId ? "".concat(dataTestId, ".").concat(_testIds.ID_CONSTANTS.DESCRIPTION, ".").concat(_testIds.ID_CONSTANTS.LABEL) : undefined,
|
|
58
|
+
icon: dataTestId ? "".concat(dataTestId, ".").concat(_testIds.ID_CONSTANTS.ICON) : undefined,
|
|
59
|
+
label: dataTestId ? "".concat(dataTestId, ".").concat(_testIds.ID_CONSTANTS.LABEL) : undefined,
|
|
60
|
+
primaryButton: dataTestId ? "".concat(dataTestId, ".button.").concat(_testIds.ID_CONSTANTS.SECONDARY_ACTION) : undefined,
|
|
61
|
+
secondaryButton: dataTestId ? "".concat(dataTestId, ".secondaryButton.").concat(_testIds.ID_CONSTANTS.TERTIARY_ACTION) : undefined
|
|
62
|
+
};
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_Snackbar.default, {
|
|
64
|
+
action: [!!secondaryButton && /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
65
|
+
key: "secondary",
|
|
66
|
+
colorTheme: actionButtonConfig.colorTheme
|
|
67
|
+
}, secondaryButton, {
|
|
68
|
+
dataTestId: testIds.secondaryButton
|
|
69
|
+
}), secondaryButton.title), !!button && /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
70
|
+
key: "primary",
|
|
71
|
+
colorTheme: actionButtonConfig.colorTheme
|
|
72
|
+
}, button, {
|
|
73
|
+
dataTestId: testIds.primaryButton
|
|
74
|
+
}), button.title), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
75
|
+
key: "close",
|
|
76
|
+
colorTheme: actionButtonConfig.closeColorTheme || actionButtonConfig.colorTheme,
|
|
77
|
+
dataTestId: testIds.close,
|
|
78
|
+
Icon: "IconX",
|
|
79
|
+
onClick: handleClose,
|
|
80
|
+
variant: actionButtonConfig.variant
|
|
81
|
+
})],
|
|
82
|
+
anchorOrigin: anchor,
|
|
83
|
+
autoHideDuration: timeDuration,
|
|
84
|
+
ContentProps: {
|
|
85
|
+
className: "".concat(_stylesModule.default.snackbarContent, " ").concat(variantClass),
|
|
86
|
+
classes: {
|
|
87
|
+
action: _stylesModule.default.action,
|
|
88
|
+
message: _stylesModule.default.message
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
message: /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
+
className: _stylesModule.default.messageContent
|
|
93
|
+
}, iconName && /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
|
|
94
|
+
className: _stylesModule.default.icon,
|
|
95
|
+
colorTheme: labelColorConfig.colorTheme,
|
|
96
|
+
dataTestId: testIds.icon,
|
|
97
|
+
name: iconName,
|
|
98
|
+
shade: labelColorConfig.shade,
|
|
99
|
+
size: 20
|
|
100
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
+
className: _stylesModule.default.textContent
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
103
|
+
colorTheme: labelColorConfig.colorTheme,
|
|
104
|
+
dataTestId: testIds.label,
|
|
105
|
+
shade: labelColorConfig.shade,
|
|
106
|
+
variant: "body",
|
|
107
|
+
weight: "medium",
|
|
108
|
+
withMarkdown: true
|
|
109
|
+
}, message), description && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
110
|
+
colorTheme: labelColorConfig.colorTheme,
|
|
111
|
+
dataTestId: testIds.description,
|
|
112
|
+
shade: labelColorConfig.shade,
|
|
113
|
+
variant: "small"
|
|
114
|
+
}, description))),
|
|
115
|
+
onClose: handleClose,
|
|
116
|
+
open: open,
|
|
117
|
+
TransitionComponent: _Slide.default,
|
|
118
|
+
TransitionProps: transition
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
UTSnackbar.propTypes = {
|
|
122
|
+
button: _types.buttonType,
|
|
123
|
+
colorTheme: (0, _propTypes.oneOf)(Object.values(_constants.COLOR_THEMES)),
|
|
124
|
+
dataTestId: _propTypes.string,
|
|
125
|
+
description: _propTypes.string,
|
|
126
|
+
icon: _propTypes.string,
|
|
127
|
+
message: _propTypes.string,
|
|
128
|
+
onClose: _propTypes.func,
|
|
129
|
+
open: _propTypes.bool,
|
|
130
|
+
secondaryButton: _types.buttonType,
|
|
131
|
+
timeDuration: _propTypes.number,
|
|
132
|
+
topRight: _propTypes.bool,
|
|
133
|
+
variant: (0, _propTypes.oneOf)(Object.values(_constants.VARIANTS)),
|
|
134
|
+
withoutIcon: _propTypes.bool
|
|
135
|
+
};
|
|
136
|
+
var _default = exports.default = (0, _WithTheme.default)(undefined, _theme.retrieveMuiTheme)(UTSnackbar);
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WhiteVariants = exports.TopRight = exports.Test = exports.SinIcono = exports.SemanticLight = exports.SemanticDark = exports.Playground = exports.ConMarkdown = exports.ConDescripcion = exports.ConAcciones = exports.ConAccionPrimaria = exports.AllVariants = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _UTButton = _interopRequireDefault(require("../../UTButton"));
|
|
9
|
+
var _ = _interopRequireDefault(require(".."));
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
var _storiesConstants = require("./storiesConstants");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
+
const SEMANTIC_COLOR_THEMES = [_constants.COLOR_THEMES.success, _constants.COLOR_THEMES.error, _constants.COLOR_THEMES.warning, _constants.COLOR_THEMES.info];
|
|
16
|
+
const AllTypesDemo = () => {
|
|
17
|
+
const [snackState, setSnackState] = (0, _react.useState)({
|
|
18
|
+
open: false
|
|
19
|
+
});
|
|
20
|
+
const show = function (colorTheme) {
|
|
21
|
+
let variant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _constants.VARIANTS.dark;
|
|
22
|
+
return setSnackState({
|
|
23
|
+
colorTheme,
|
|
24
|
+
message: "Alerta de tipo: ".concat(colorTheme),
|
|
25
|
+
open: true,
|
|
26
|
+
variant
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const handleClose = () => setSnackState(prev => ({
|
|
30
|
+
...prev,
|
|
31
|
+
open: false
|
|
32
|
+
}));
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
style: {
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
gap: '8px',
|
|
38
|
+
maxWidth: '400px'
|
|
39
|
+
}
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
41
|
+
style: {
|
|
42
|
+
fontSize: '12px',
|
|
43
|
+
fontWeight: 600,
|
|
44
|
+
margin: '0 0 4px'
|
|
45
|
+
}
|
|
46
|
+
}, "Dark"), /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
+
style: {
|
|
48
|
+
display: 'flex',
|
|
49
|
+
gap: '8px',
|
|
50
|
+
flexWrap: 'wrap'
|
|
51
|
+
}
|
|
52
|
+
}, SEMANTIC_COLOR_THEMES.map(colorTheme => /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
53
|
+
key: colorTheme,
|
|
54
|
+
onClick: () => show(colorTheme),
|
|
55
|
+
size: "small",
|
|
56
|
+
variant: "outlined"
|
|
57
|
+
}, colorTheme)), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
58
|
+
onClick: () => show(_constants.COLOR_THEMES.white),
|
|
59
|
+
size: "small",
|
|
60
|
+
variant: "outlined"
|
|
61
|
+
}, "white")), /*#__PURE__*/_react.default.createElement("p", {
|
|
62
|
+
style: {
|
|
63
|
+
fontSize: '12px',
|
|
64
|
+
fontWeight: 600,
|
|
65
|
+
margin: '8px 0 4px'
|
|
66
|
+
}
|
|
67
|
+
}, "Light"), /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
+
style: {
|
|
69
|
+
display: 'flex',
|
|
70
|
+
gap: '8px',
|
|
71
|
+
flexWrap: 'wrap'
|
|
72
|
+
}
|
|
73
|
+
}, SEMANTIC_COLOR_THEMES.map(colorTheme => /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
74
|
+
key: colorTheme,
|
|
75
|
+
onClick: () => show(colorTheme, _constants.VARIANTS.light),
|
|
76
|
+
size: "small",
|
|
77
|
+
variant: "outlined"
|
|
78
|
+
}, colorTheme, " light")), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
79
|
+
onClick: () => show(_constants.COLOR_THEMES.white, _constants.VARIANTS.light),
|
|
80
|
+
size: "small",
|
|
81
|
+
variant: "outlined"
|
|
82
|
+
}, "white light")), /*#__PURE__*/_react.default.createElement(_.default, _extends({}, snackState, {
|
|
83
|
+
onClose: handleClose
|
|
84
|
+
})));
|
|
85
|
+
};
|
|
86
|
+
var _default = exports.default = {
|
|
87
|
+
args: {
|
|
88
|
+
message: 'Operación realizada exitosamente.',
|
|
89
|
+
open: true,
|
|
90
|
+
colorTheme: _constants.DEFAULT_PROPS.colorTheme,
|
|
91
|
+
variant: _constants.DEFAULT_PROPS.variant,
|
|
92
|
+
topRight: _constants.DEFAULT_PROPS.topRight,
|
|
93
|
+
withoutIcon: false,
|
|
94
|
+
icon: undefined,
|
|
95
|
+
timeDuration: undefined,
|
|
96
|
+
button: undefined,
|
|
97
|
+
secondaryButton: undefined,
|
|
98
|
+
description: undefined
|
|
99
|
+
},
|
|
100
|
+
argTypes: _storiesConstants.ARG_TYPES,
|
|
101
|
+
component: _.default,
|
|
102
|
+
parameters: {
|
|
103
|
+
controls: {
|
|
104
|
+
exclude: ['dataTestId', 'onClose']
|
|
105
|
+
},
|
|
106
|
+
docs: {
|
|
107
|
+
description: {
|
|
108
|
+
component: 'Componente de notificación tipo Snackbar. Soporta cinco `colorTheme`: los cuatro semánticos (`success`, `error`, `warning`, `info`) y `white` para notificaciones neutras. La prop `variant` controla si el fondo es oscuro o claro.'
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
title: 'Energy-UI/UTSnackbar'
|
|
113
|
+
};
|
|
114
|
+
const Playground = exports.Playground = {
|
|
115
|
+
name: 'Playground'
|
|
116
|
+
};
|
|
117
|
+
const AllVariants = exports.AllVariants = {
|
|
118
|
+
name: 'Todas las Variantes',
|
|
119
|
+
parameters: {
|
|
120
|
+
docs: {
|
|
121
|
+
description: {
|
|
122
|
+
story: 'Hacé clic en cada botón para ver la variante correspondiente.'
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
render: () => /*#__PURE__*/_react.default.createElement(AllTypesDemo, null)
|
|
127
|
+
};
|
|
128
|
+
const SemanticDark = exports.SemanticDark = {
|
|
129
|
+
args: {
|
|
130
|
+
message: 'El archivo fue guardado correctamente.',
|
|
131
|
+
open: true,
|
|
132
|
+
colorTheme: _constants.COLOR_THEMES.success,
|
|
133
|
+
variant: _constants.VARIANTS.dark
|
|
134
|
+
},
|
|
135
|
+
name: 'Semántico / Dark',
|
|
136
|
+
parameters: {
|
|
137
|
+
docs: {
|
|
138
|
+
description: {
|
|
139
|
+
story: 'Fondo con el color semántico saturado y texto blanco. Cambiá `colorTheme` en el panel de controls para ver los cuatro tipos semánticos.'
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const SemanticLight = exports.SemanticLight = {
|
|
145
|
+
args: {
|
|
146
|
+
message: 'El archivo fue guardado correctamente.',
|
|
147
|
+
open: true,
|
|
148
|
+
colorTheme: _constants.COLOR_THEMES.success,
|
|
149
|
+
variant: _constants.VARIANTS.light
|
|
150
|
+
},
|
|
151
|
+
name: 'Semántico / Light',
|
|
152
|
+
parameters: {
|
|
153
|
+
docs: {
|
|
154
|
+
description: {
|
|
155
|
+
story: 'Fondo claro con texto oscuro accesible. Cambiá `colorTheme` para ver los cuatro tipos semánticos.'
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const WhiteVariants = exports.WhiteVariants = {
|
|
161
|
+
args: {
|
|
162
|
+
message: 'Notificación sin semántica asociada.',
|
|
163
|
+
open: true,
|
|
164
|
+
colorTheme: _constants.COLOR_THEMES.white,
|
|
165
|
+
variant: _constants.VARIANTS.light
|
|
166
|
+
},
|
|
167
|
+
name: 'White',
|
|
168
|
+
parameters: {
|
|
169
|
+
docs: {
|
|
170
|
+
description: {
|
|
171
|
+
story: 'Variante neutra sin semántica de color. Con `variant="light"` el fondo es blanco; con `variant="dark"` el fondo es oscuro.'
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
const ConAccionPrimaria = exports.ConAccionPrimaria = {
|
|
177
|
+
args: {
|
|
178
|
+
button: {
|
|
179
|
+
title: 'Deshacer'
|
|
180
|
+
},
|
|
181
|
+
message: 'Se eliminaron 3 elementos.',
|
|
182
|
+
open: true,
|
|
183
|
+
colorTheme: _constants.COLOR_THEMES.error,
|
|
184
|
+
variant: _constants.VARIANTS.dark
|
|
185
|
+
},
|
|
186
|
+
name: 'Con Acción Primaria',
|
|
187
|
+
parameters: {
|
|
188
|
+
docs: {
|
|
189
|
+
description: {
|
|
190
|
+
story: 'La prop `button` agrega un botón de texto a la derecha del mensaje. Pasar `onClick` dentro del objeto para manejar el evento.'
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
const ConAcciones = exports.ConAcciones = {
|
|
196
|
+
args: {
|
|
197
|
+
button: {
|
|
198
|
+
title: 'Confirmar'
|
|
199
|
+
},
|
|
200
|
+
secondaryButton: {
|
|
201
|
+
title: 'Cancelar'
|
|
202
|
+
},
|
|
203
|
+
message: 'Se eliminaron 3 elementos.',
|
|
204
|
+
open: true,
|
|
205
|
+
colorTheme: _constants.COLOR_THEMES.error,
|
|
206
|
+
variant: _constants.VARIANTS.dark
|
|
207
|
+
},
|
|
208
|
+
name: 'Con Acciones Primaria y Secundaria',
|
|
209
|
+
parameters: {
|
|
210
|
+
docs: {
|
|
211
|
+
description: {
|
|
212
|
+
story: 'Con `button` y `secondaryButton` se muestran dos botones de acción. Cualquier prop de `UTButton` puede pasarse dentro del objeto para personalizar su comportamiento.'
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const ConDescripcion = exports.ConDescripcion = {
|
|
218
|
+
args: {
|
|
219
|
+
message: 'El archivo fue guardado correctamente.',
|
|
220
|
+
description: 'Los cambios se aplicarán en la próxima sesión.',
|
|
221
|
+
open: true,
|
|
222
|
+
colorTheme: _constants.COLOR_THEMES.success,
|
|
223
|
+
variant: _constants.VARIANTS.light
|
|
224
|
+
},
|
|
225
|
+
name: 'Con Descripción',
|
|
226
|
+
parameters: {
|
|
227
|
+
docs: {
|
|
228
|
+
description: {
|
|
229
|
+
story: 'La prop `description` agrega un texto secundario debajo del mensaje principal con tipografía `small`.'
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const ConMarkdown = exports.ConMarkdown = {
|
|
235
|
+
args: {
|
|
236
|
+
message: 'El archivo **reporte_enero.pdf** fue generado *exitosamente*.',
|
|
237
|
+
open: true,
|
|
238
|
+
colorTheme: _constants.COLOR_THEMES.success,
|
|
239
|
+
variant: _constants.VARIANTS.light
|
|
240
|
+
},
|
|
241
|
+
name: 'Con Markdown',
|
|
242
|
+
parameters: {
|
|
243
|
+
docs: {
|
|
244
|
+
description: {
|
|
245
|
+
story: 'El campo `message` soporta sintaxis markdown a través de `UTLabel`.'
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
const TopRight = exports.TopRight = {
|
|
251
|
+
args: {
|
|
252
|
+
message: 'Esta notificación aparece en la esquina superior derecha.',
|
|
253
|
+
open: true,
|
|
254
|
+
colorTheme: _constants.COLOR_THEMES.info,
|
|
255
|
+
variant: _constants.VARIANTS.dark,
|
|
256
|
+
topRight: true
|
|
257
|
+
},
|
|
258
|
+
name: 'Posición Superior Derecha',
|
|
259
|
+
parameters: {
|
|
260
|
+
docs: {
|
|
261
|
+
description: {
|
|
262
|
+
story: 'Con `topRight: true` el snackbar aparece en la esquina superior derecha con slide desde la derecha.'
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
const SinIcono = exports.SinIcono = {
|
|
268
|
+
args: {
|
|
269
|
+
message: 'Notificación sin ícono.',
|
|
270
|
+
open: true,
|
|
271
|
+
colorTheme: _constants.COLOR_THEMES.warning,
|
|
272
|
+
variant: _constants.VARIANTS.dark,
|
|
273
|
+
withoutIcon: true
|
|
274
|
+
},
|
|
275
|
+
name: 'Sin Ícono',
|
|
276
|
+
parameters: {
|
|
277
|
+
docs: {
|
|
278
|
+
description: {
|
|
279
|
+
story: 'Con `withoutIcon: true` se oculta el ícono.'
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
const Test = exports.Test = {
|
|
285
|
+
name: 'Test',
|
|
286
|
+
parameters: {
|
|
287
|
+
docs: {
|
|
288
|
+
description: {
|
|
289
|
+
story: 'Story para el Storybook Test Runner. Renderiza variantes simultáneas para verificar el correcto renderizado.'
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
render: () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_.default, {
|
|
294
|
+
colorTheme: _constants.COLOR_THEMES.success,
|
|
295
|
+
message: "success dark",
|
|
296
|
+
open: true
|
|
297
|
+
}), /*#__PURE__*/_react.default.createElement(_.default, {
|
|
298
|
+
colorTheme: _constants.COLOR_THEMES.error,
|
|
299
|
+
message: "error light",
|
|
300
|
+
open: true,
|
|
301
|
+
variant: _constants.VARIANTS.light
|
|
302
|
+
}), /*#__PURE__*/_react.default.createElement(_.default, {
|
|
303
|
+
colorTheme: _constants.COLOR_THEMES.white,
|
|
304
|
+
message: "white dark",
|
|
305
|
+
open: true,
|
|
306
|
+
variant: _constants.VARIANTS.dark
|
|
307
|
+
}), /*#__PURE__*/_react.default.createElement(_.default, {
|
|
308
|
+
button: {
|
|
309
|
+
title: 'Acción'
|
|
310
|
+
},
|
|
311
|
+
colorTheme: _constants.COLOR_THEMES.info,
|
|
312
|
+
description: "Texto secundario de descripci\xF3n",
|
|
313
|
+
message: "Con descripci\xF3n",
|
|
314
|
+
open: true
|
|
315
|
+
}))
|
|
316
|
+
};
|