@widergy/energy-ui 3.123.1 → 3.125.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 +14 -0
- package/dist/components/UTActionCard/components/Header/index.js +1 -1
- package/dist/components/UTCalendar/components/Day/index.js +37 -0
- package/dist/components/UTCalendar/components/Day/styles.module.scss +36 -0
- package/dist/components/UTCalendar/components/TimeInput/index.js +39 -0
- package/dist/components/UTCalendar/components/TimeInput/styles.module.scss +12 -0
- package/dist/components/UTCalendar/constants.js +15 -0
- package/dist/components/UTCalendar/index.js +119 -0
- package/dist/components/UTCalendar/styles.module.scss +122 -0
- package/dist/components/UTLabel/README.md +7 -2
- package/dist/components/UTLabel/UTLabel.stories.js +13 -0
- package/dist/components/UTLabel/components/Markdown/components/BlockQuote/index.js +48 -0
- package/dist/components/UTLabel/components/Markdown/components/BlockQuote/styles.module.scss +16 -0
- package/dist/components/UTLabel/components/Markdown/components/Citation/index.js +28 -0
- package/dist/components/UTLabel/components/Markdown/components/CitationGroup/index.js +25 -0
- package/dist/components/UTLabel/components/Markdown/components/CitationGroup/styles.module.scss +22 -0
- package/dist/components/UTLabel/components/Markdown/components/Links/constants.js +8 -0
- package/dist/components/UTLabel/components/Markdown/components/Links/index.js +46 -0
- package/dist/components/UTLabel/components/Markdown/components/Links/styles.module.scss +3 -0
- package/dist/components/UTLabel/components/Markdown/components/ListItem/index.js +53 -0
- package/dist/components/UTLabel/components/Markdown/components/ListItem/styles.module.scss +22 -0
- package/dist/components/UTLabel/components/Markdown/components/Section/index.js +59 -0
- package/dist/components/UTLabel/components/Markdown/components/Section/styles.module.scss +13 -0
- package/dist/components/UTLabel/components/Markdown/components/WithCustomHandler/index.js +25 -0
- package/dist/components/UTLabel/components/Markdown/constants.js +66 -0
- package/dist/components/UTLabel/components/Markdown/customPlugins/remarkCitations.js +189 -0
- package/dist/components/UTLabel/components/Markdown/customPlugins/remarkDeflist.js +94 -0
- package/dist/components/UTLabel/components/Markdown/index.js +41 -0
- package/dist/components/UTLabel/components/Markdown/utils.js +39 -0
- package/dist/components/UTLabel/constants.js +3 -17
- package/dist/components/UTLabel/index.js +10 -15
- package/dist/components/UTLabel/theme.js +153 -3
- package/dist/components/UTRadioGroup/versions/V1/components/Radio/theme.js +1 -5
- package/dist/index.js +7 -0
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [3.125.0](https://github.com/widergy/energy-ui/compare/v3.124.0...v3.125.0) (2025-12-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [PROMI] calendar ([#736](https://github.com/widergy/energy-ui/issues/736)) ([32cc5c2](https://github.com/widergy/energy-ui/commit/32cc5c2e7816acbbb3ba760f521695d7fb687a7b))
|
|
7
|
+
|
|
8
|
+
# [3.124.0](https://github.com/widergy/energy-ui/compare/v3.123.1...v3.124.0) (2025-12-09)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* [PDI-501] UTLabel markdown plugins ([#727](https://github.com/widergy/energy-ui/issues/727)) ([2aa6e9a](https://github.com/widergy/energy-ui/commit/2aa6e9af166284ee63469b1766cdc88eb53b5c10))
|
|
14
|
+
|
|
1
15
|
## [3.123.1](https://github.com/widergy/energy-ui/compare/v3.123.0...v3.123.1) (2025-12-09)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -82,7 +82,7 @@ Header.propTypes = {
|
|
|
82
82
|
}),
|
|
83
83
|
variant: (0, _propTypes.oneOf)([_constants.HEADER_ACTIONS_VARIANTS.DEFAULT, _constants.HEADER_ACTIONS_VARIANTS.BUTTON_GROUP])
|
|
84
84
|
}),
|
|
85
|
-
setMainActionHoverVisible: _propTypes.
|
|
85
|
+
setMainActionHoverVisible: _propTypes.func,
|
|
86
86
|
size: (0, _propTypes.oneOf)([_constants.SIZES.MEDIUM, _constants.SIZES.SMALL]),
|
|
87
87
|
status: _propTypes.string,
|
|
88
88
|
statusAlignment: (0, _propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER, _constants.PLACE_SELF_TYPES.END, _constants.PLACE_SELF_TYPES.START]),
|
|
@@ -0,0 +1,37 @@
|
|
|
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 _dayjs = _interopRequireDefault(require("dayjs"));
|
|
10
|
+
var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../../../UTTouchableWithoutFeedback"));
|
|
11
|
+
var _constants = require("../../constants");
|
|
12
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const GenericRenderDay = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
date,
|
|
17
|
+
bookingOptions,
|
|
18
|
+
selectedDayIndex,
|
|
19
|
+
setSelectedDayIndex,
|
|
20
|
+
dayInCurrentMonth
|
|
21
|
+
} = _ref;
|
|
22
|
+
const index = bookingOptions.findIndex(item => (0, _dayjs.default)(item.value).isSame((0, _dayjs.default)(date), 'day'));
|
|
23
|
+
const available = dayInCurrentMonth && index !== -1;
|
|
24
|
+
const isSelected = index === selectedDayIndex;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
26
|
+
className: "".concat(_stylesModule.default.daysRender, " ").concat(!available && _stylesModule.default.disabledButton, " ").concat(isSelected && _stylesModule.default.selectedDay, " ").concat(!dayInCurrentMonth && _stylesModule.default.notInCurrentMonth),
|
|
27
|
+
onClick: available ? () => setSelectedDayIndex(index) : undefined
|
|
28
|
+
}, dayInCurrentMonth ? (0, _dayjs.default)(date).format(_constants.DAY_FORMAT) : '');
|
|
29
|
+
};
|
|
30
|
+
GenericRenderDay.propTypes = {
|
|
31
|
+
date: _propTypes.object,
|
|
32
|
+
bookingOptions: _propTypes.object,
|
|
33
|
+
selectedDayIndex: _propTypes.number,
|
|
34
|
+
setSelectedDayIndex: _propTypes.func,
|
|
35
|
+
dayInCurrentMonth: _propTypes.bool
|
|
36
|
+
};
|
|
37
|
+
var _default = exports.default = GenericRenderDay;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.dateContainer {
|
|
2
|
+
grid-gap: 16px;
|
|
3
|
+
padding: 16px;
|
|
4
|
+
|
|
5
|
+
& > * {
|
|
6
|
+
padding: 0;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.daysRender {
|
|
11
|
+
background-color: var(--light01);
|
|
12
|
+
color: var(--gray04);
|
|
13
|
+
place-content: center;
|
|
14
|
+
flex-grow: 1;
|
|
15
|
+
height: 40px;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
cursor: default;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.disabledButton {
|
|
24
|
+
background-color: var(--semanticError01);
|
|
25
|
+
color: var(--semanticError05);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.selectedDay {
|
|
29
|
+
background-color: var(--actionAccent04);
|
|
30
|
+
color: var(--light01);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.notInCurrentMonth {
|
|
34
|
+
background-color: var(--light013);
|
|
35
|
+
}
|
|
36
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
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 _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
10
|
+
var _UTRadioGroup = _interopRequireDefault(require("../../../UTRadioGroup"));
|
|
11
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const TimeInput = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
availableTimeSlots,
|
|
16
|
+
selectedTime,
|
|
17
|
+
setSelectedTime
|
|
18
|
+
} = _ref;
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
+
className: _stylesModule.default.timeInputContainer
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
className: _stylesModule.default.timeInputHeader
|
|
23
|
+
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
24
|
+
variant: "subtitle1"
|
|
25
|
+
}, "Seleccione el horario"), /*#__PURE__*/_react.default.createElement(_UTLabel.default, null, "Debe seleccionar un horario para continuar")), /*#__PURE__*/_react.default.createElement(_UTRadioGroup.default, {
|
|
26
|
+
options: availableTimeSlots,
|
|
27
|
+
value: selectedTime,
|
|
28
|
+
onChange: setSelectedTime,
|
|
29
|
+
version: "V1",
|
|
30
|
+
verticalSpacing: "small",
|
|
31
|
+
variant: "card"
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
TimeInput.propTypes = {
|
|
35
|
+
availableTimeSlots: _propTypes.array,
|
|
36
|
+
selectedTime: _propTypes.string,
|
|
37
|
+
setSelectedTime: _propTypes.func
|
|
38
|
+
};
|
|
39
|
+
var _default = exports.default = TimeInput;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ONLY_ONE_WORK_SCHEDULE = exports.INPUT_VALUE_DEFAULT = exports.ICON_SIZE_DEFAULT = exports.FORMAT_DATE = exports.FIELD_KEYS = exports.DAY_FORMAT = void 0;
|
|
7
|
+
const INPUT_VALUE_DEFAULT = exports.INPUT_VALUE_DEFAULT = '00:00';
|
|
8
|
+
const ONLY_ONE_WORK_SCHEDULE = exports.ONLY_ONE_WORK_SCHEDULE = 0;
|
|
9
|
+
const DAY_FORMAT = exports.DAY_FORMAT = 'DD';
|
|
10
|
+
const FORMAT_DATE = exports.FORMAT_DATE = 'YYYY-MM-DD';
|
|
11
|
+
const ICON_SIZE_DEFAULT = exports.ICON_SIZE_DEFAULT = 32;
|
|
12
|
+
const FIELD_KEYS = exports.FIELD_KEYS = {
|
|
13
|
+
DATE: 'date',
|
|
14
|
+
TIME: 'time'
|
|
15
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _pickers = require("@material-ui/pickers");
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _dateFns = _interopRequireDefault(require("@date-io/date-fns"));
|
|
11
|
+
var _es = _interopRequireDefault(require("date-fns/locale/es"));
|
|
12
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
13
|
+
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
14
|
+
var _UTIcon = _interopRequireDefault(require("../UTIcon"));
|
|
15
|
+
var _UTFieldLabel = _interopRequireDefault(require("../UTFieldLabel"));
|
|
16
|
+
var _utils = require("../UTValidation/utils");
|
|
17
|
+
var _UTValidation = _interopRequireDefault(require("../UTValidation"));
|
|
18
|
+
var _constants = require("./constants");
|
|
19
|
+
var _TimeInput = _interopRequireDefault(require("./components/TimeInput"));
|
|
20
|
+
var _Day = _interopRequireDefault(require("./components/Day"));
|
|
21
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
22
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
+
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); }
|
|
24
|
+
const Calendar = _ref => {
|
|
25
|
+
var _options$selectedDayI, _options$selectedDayI2;
|
|
26
|
+
let {
|
|
27
|
+
dataTestId,
|
|
28
|
+
actions,
|
|
29
|
+
error,
|
|
30
|
+
onChange,
|
|
31
|
+
options,
|
|
32
|
+
required,
|
|
33
|
+
showLegend,
|
|
34
|
+
timeSelection,
|
|
35
|
+
title,
|
|
36
|
+
value
|
|
37
|
+
} = _ref;
|
|
38
|
+
const [selectedDayIndex, setSelectedDayIndex] = (0, _react.useState)(value === null || value === void 0 ? void 0 : value[_constants.FIELD_KEYS.DATE]);
|
|
39
|
+
const [selectedTime, setSelectedTime] = (0, _react.useState)(value === null || value === void 0 ? void 0 : value[_constants.FIELD_KEYS.TIME]);
|
|
40
|
+
const selectedDay = (_options$selectedDayI = options[selectedDayIndex]) === null || _options$selectedDayI === void 0 ? void 0 : _options$selectedDayI.value;
|
|
41
|
+
const validationData = (0, _react.useMemo)(() => error && (0, _utils.formatErrorToValidation)(error), [error]);
|
|
42
|
+
(0, _react.useEffect)(() => {
|
|
43
|
+
setSelectedTime(null);
|
|
44
|
+
onChange({
|
|
45
|
+
[_constants.FIELD_KEYS.DATE]: selectedDay
|
|
46
|
+
});
|
|
47
|
+
}, [selectedDayIndex]);
|
|
48
|
+
(0, _react.useEffect)(() => {
|
|
49
|
+
onChange(currentValue => ({
|
|
50
|
+
...currentValue,
|
|
51
|
+
[_constants.FIELD_KEYS.TIME]: selectedTime
|
|
52
|
+
}));
|
|
53
|
+
}, [selectedTime]);
|
|
54
|
+
const availableTimeSlots = options === null || options === void 0 || (_options$selectedDayI2 = options[selectedDayIndex]) === null || _options$selectedDayI2 === void 0 ? void 0 : _options$selectedDayI2.configuration.times;
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
className: _stylesModule.default.container,
|
|
57
|
+
"data-testid": dataTestId
|
|
58
|
+
}, title && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
59
|
+
actions: actions,
|
|
60
|
+
required: required
|
|
61
|
+
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
+
className: _stylesModule.default.container
|
|
63
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
className: _stylesModule.default.calendarContainer
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_pickers.MuiPickersUtilsProvider, {
|
|
66
|
+
utils: _dateFns.default,
|
|
67
|
+
locale: _es.default
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(_pickers.DatePicker, {
|
|
69
|
+
disableToolbar: true,
|
|
70
|
+
variant: "static",
|
|
71
|
+
value: selectedDay,
|
|
72
|
+
onChange: () => null,
|
|
73
|
+
renderDay: (date, _, dayInCurrentMonth) => /*#__PURE__*/_react.default.createElement(_Day.default, {
|
|
74
|
+
date: date,
|
|
75
|
+
bookingOptions: options,
|
|
76
|
+
selectedDayIndex: selectedDayIndex,
|
|
77
|
+
setSelectedDayIndex: setSelectedDayIndex,
|
|
78
|
+
dayInCurrentMonth: dayInCurrentMonth,
|
|
79
|
+
setSelectedDay: setSelectedDayIndex
|
|
80
|
+
}),
|
|
81
|
+
minDate: new Date()
|
|
82
|
+
})), showLegend && /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
+
className: _stylesModule.default.bottomReference
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
className: _stylesModule.default.legendReference
|
|
86
|
+
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
87
|
+
colorTheme: "gray",
|
|
88
|
+
className: _stylesModule.default.legendLabel
|
|
89
|
+
}, "Sin horarios disponibles"))), timeSelection && /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
+
className: "".concat(_stylesModule.default.timeRankContainer, " ").concat((0, _isEmpty.default)(availableTimeSlots) && _stylesModule.default.emptyTimeRankContainer)
|
|
91
|
+
}, !(0, _isEmpty.default)(availableTimeSlots) ? /*#__PURE__*/_react.default.createElement(_TimeInput.default, {
|
|
92
|
+
availableTimeSlots: availableTimeSlots,
|
|
93
|
+
selectedTime: selectedTime,
|
|
94
|
+
setSelectedTime: setSelectedTime
|
|
95
|
+
}) : /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
+
className: _stylesModule.default.calendarIconWrapper
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
|
|
98
|
+
name: "IconCalendarEvent",
|
|
99
|
+
colorTheme: "gray",
|
|
100
|
+
size: _constants.ICON_SIZE_DEFAULT
|
|
101
|
+
})), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
102
|
+
colorTheme: "gray"
|
|
103
|
+
}, selectedDay ? 'No hay horarios disponibles' : 'Debe seleccionar una fecha primero')))), validationData && /*#__PURE__*/_react.default.createElement(_UTValidation.default, {
|
|
104
|
+
validationData: validationData
|
|
105
|
+
}));
|
|
106
|
+
};
|
|
107
|
+
Calendar.propTypes = {
|
|
108
|
+
actions: _propTypes.array,
|
|
109
|
+
dataTestId: _propTypes.string,
|
|
110
|
+
error: _propTypes.string,
|
|
111
|
+
onChange: _propTypes.func,
|
|
112
|
+
options: _propTypes.array,
|
|
113
|
+
required: _propTypes.bool,
|
|
114
|
+
showLegend: _propTypes.bool,
|
|
115
|
+
timeSelection: _propTypes.bool,
|
|
116
|
+
title: _propTypes.string,
|
|
117
|
+
value: _propTypes.object
|
|
118
|
+
};
|
|
119
|
+
var _default = exports.default = Calendar;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
@use '../../scss/variables/mediaQueries.module.scss' as *;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
$default-shadow-gray-bottom-1: 0px 3px 6px rgba(24, 44, 73, 0.1);
|
|
5
|
+
|
|
6
|
+
.container {
|
|
7
|
+
display: flex;
|
|
8
|
+
grid-gap: 32px;
|
|
9
|
+
height: 100%;
|
|
10
|
+
max-width: 1200px;
|
|
11
|
+
|
|
12
|
+
width: 100%;
|
|
13
|
+
|
|
14
|
+
@media #{$tablet-mobile} {
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
%containers {
|
|
20
|
+
background-color: var(--light01);
|
|
21
|
+
border-radius: 8px;
|
|
22
|
+
box-shadow: var(--shadowGrayBottom1, $default-shadow-gray-bottom-1);
|
|
23
|
+
display: flex;
|
|
24
|
+
padding:24px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.calendarContainer {
|
|
28
|
+
@extend %containers;
|
|
29
|
+
padding: 16px;
|
|
30
|
+
flex-grow: 1;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
:global(.MuiPickersStaticWrapper-staticWrapperRoot) {
|
|
34
|
+
flex-grow: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:global(.MuiPickersBasePicker-pickerView) {
|
|
38
|
+
justify-content: unset;
|
|
39
|
+
max-width: inherit;
|
|
40
|
+
height: 336px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:global(.MuiPickersSlideTransition-transitionContainer) {
|
|
44
|
+
text-transform: capitalize;
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:global(.MuiPickersCalendar-week) {
|
|
49
|
+
background: var(--light03);
|
|
50
|
+
justify-content: flex-start;
|
|
51
|
+
|
|
52
|
+
> div {
|
|
53
|
+
border: 1px solid var(--light04);
|
|
54
|
+
min-width: 40px;
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:global(.MuiPickersCalendarHeader-daysHeader) {
|
|
60
|
+
|
|
61
|
+
> span {
|
|
62
|
+
color: var(--gray03);
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:global(.MuiPickersCalendarHeader-dayLabel) {
|
|
68
|
+
text-transform: uppercase;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.timeRankContainer {
|
|
73
|
+
@extend %containers;
|
|
74
|
+
flex-grow: 1;
|
|
75
|
+
|
|
76
|
+
@media #{$tablet-mobile} {
|
|
77
|
+
width: unset;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.emptyTimeRankContainer {
|
|
82
|
+
align-items: center;
|
|
83
|
+
background-color: var(--light03);
|
|
84
|
+
border: 2px solid var(--light04);
|
|
85
|
+
box-shadow: none;
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
grid-gap: 16px;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.calendarIconWrapper {
|
|
93
|
+
background-color: var(--light04);
|
|
94
|
+
border-radius: 100px;
|
|
95
|
+
display: flex;
|
|
96
|
+
padding: 14px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.legendLabel {
|
|
100
|
+
text-align: end;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.bottomReference {
|
|
104
|
+
align-items: center;
|
|
105
|
+
display: flex;
|
|
106
|
+
grid-gap: 12px;
|
|
107
|
+
justify-content: flex-end;
|
|
108
|
+
padding: 16px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.legendReference {
|
|
112
|
+
background: var(--semanticError01);
|
|
113
|
+
border-radius: 2px;
|
|
114
|
+
height: 16px;
|
|
115
|
+
width: 16px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.container {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
grid-gap: 16px;
|
|
122
|
+
}
|
|
@@ -11,10 +11,11 @@ Component used for displaying text values and markdown.
|
|
|
11
11
|
| className | string | | Additional classes. |
|
|
12
12
|
| classes | string | | Classes returned by UTLabel's own[theme](./theme.js#L40) `retrieveStyle`. |
|
|
13
13
|
| colorTheme | string | 'primary' | Color theme to style the UTLabel. Has to be defined in the proyect theme.[Example](#colortheme). |
|
|
14
|
+
| markdownExtended | bool | false | ⚠️ Requires`withMarkdown` to be set to `true` <br />Activates all markdown plugins for extended markdown support. |
|
|
14
15
|
| markdownRenderers | object | [MARKDOWN_RENDERERS](./constants.js#L36) | ⚠️ Requires`withMarkdown` to be set to `true` <br />Object mapping tag names to React components. The keys in components are HTML equivalents for the things you write with markdown [List of tags](#markdown-renderers). |
|
|
15
16
|
| title | string | | [Title global attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title). |
|
|
16
|
-
| variant | string | 'body' | Defines html component to use. For a list of available variants, check[here](#variants). Font sizes can be overwritten (⚠️ for the entire proyect) through the proyect's theme. |
|
|
17
|
-
| weight | string | 'regular' | Defines font-weight to be used. For a list of available options, check[here](#font-weights). |
|
|
17
|
+
| variant | string | 'body' | Defines html component to use. For a list of available variants, check [here](#variants). Font sizes can be overwritten (⚠️ for the entire proyect) through the proyect's theme. |
|
|
18
|
+
| weight | string | 'regular' | Defines font-weight to be used. For a list of available options, check [here](#font-weights). |
|
|
18
19
|
| withMarkdown | bool | false | Tells the component whether or not to render text inside as markdown. |
|
|
19
20
|
|
|
20
21
|
## Examples
|
|
@@ -80,6 +81,10 @@ const markdownRenderers = {
|
|
|
80
81
|
|
|
81
82
|
<details>
|
|
82
83
|
<summary>Show list of props for each component</summary>
|
|
84
|
+
|
|
85
|
+
**Custom Handler Behavior:**
|
|
86
|
+
If an element already has internal handling within UTLabel (such as `a`, `blockquote`, `h2`, etc.) and you pass a `customHandler` that returns `null`, the component will use its default internal behavior. This allows you to selectively override rendering for specific cases while falling back to the built-in logic when needed.
|
|
87
|
+
|
|
83
88
|
The keys in components are HTML equivalents for the things you write with
|
|
84
89
|
markdown (such as `h1` for `# heading`)**†**
|
|
85
90
|
|
|
@@ -52,6 +52,18 @@ var _default = exports.default = {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
+
markdownExtended: {
|
|
56
|
+
control: 'boolean',
|
|
57
|
+
description: 'Habilita todos los plugins de markdown',
|
|
58
|
+
table: {
|
|
59
|
+
defaultValue: {
|
|
60
|
+
summary: _constants.DEFAULT_PROPS.markdownExtended
|
|
61
|
+
},
|
|
62
|
+
type: {
|
|
63
|
+
summary: 'bool'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
55
67
|
markdownRenderers: {
|
|
56
68
|
control: false,
|
|
57
69
|
description: 'Mapper de componentes HTML a componentes react. Para más detalles revisar la sección Markdown Renderers',
|
|
@@ -132,6 +144,7 @@ var _default = exports.default = {
|
|
|
132
144
|
const Default = exports.Default = {
|
|
133
145
|
args: {
|
|
134
146
|
colorTheme: _constants.DEFAULT_PROPS.colorTheme,
|
|
147
|
+
markdownExtended: _constants.DEFAULT_PROPS.markdownExtended,
|
|
135
148
|
variant: _constants.DEFAULT_PROPS.variant,
|
|
136
149
|
weight: _constants.DEFAULT_PROPS.weight,
|
|
137
150
|
withMarkdown: _constants.DEFAULT_PROPS.withMarkdown,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _WithCustomHandler = _interopRequireDefault(require("../WithCustomHandler"));
|
|
10
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
const BlockQuote = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
children,
|
|
16
|
+
classes
|
|
17
|
+
} = _ref;
|
|
18
|
+
const lines = [];
|
|
19
|
+
if (Array.isArray(children)) {
|
|
20
|
+
children.forEach(child => {
|
|
21
|
+
var _child$props;
|
|
22
|
+
if (typeof child === 'string') {
|
|
23
|
+
const parts = child.split('\n').filter(line => line.trim());
|
|
24
|
+
lines.push(...parts);
|
|
25
|
+
} else if ((child === null || child === void 0 ? void 0 : child.type) === 'p' && child !== null && child !== void 0 && (_child$props = child.props) !== null && _child$props !== void 0 && _child$props.children) {
|
|
26
|
+
const pChildren = child.props.children;
|
|
27
|
+
if (Array.isArray(pChildren)) {
|
|
28
|
+
pChildren.forEach(pChild => {
|
|
29
|
+
if (typeof pChild === 'string' && pChild.trim()) {
|
|
30
|
+
lines.push(pChild.trim());
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
} else if (typeof pChildren === 'string' && pChildren.trim()) {
|
|
34
|
+
lines.push(pChildren.trim());
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
+
className: "".concat(_stylesModule.default.blockquote, " ").concat(classes === null || classes === void 0 ? void 0 : classes.blockquote)
|
|
41
|
+
}, lines.map(line => /*#__PURE__*/_react.default.createElement("div", {
|
|
42
|
+
key: line
|
|
43
|
+
}, line)));
|
|
44
|
+
};
|
|
45
|
+
BlockQuote.propTypes = {
|
|
46
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
47
|
+
};
|
|
48
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)((0, _WithCustomHandler.default)(BlockQuote));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.blockquote {
|
|
2
|
+
margin: 0 0 24px 0;
|
|
3
|
+
padding-left: 12px;
|
|
4
|
+
position: relative;
|
|
5
|
+
white-space: pre-line;
|
|
6
|
+
|
|
7
|
+
&:before {
|
|
8
|
+
border-radius: 3;
|
|
9
|
+
content: '';
|
|
10
|
+
display: block;
|
|
11
|
+
height: 100%;
|
|
12
|
+
left: 0;
|
|
13
|
+
position: absolute;
|
|
14
|
+
width: 2px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _UTButton = _interopRequireDefault(require("../../../../../UTButton"));
|
|
10
|
+
var _WithCustomHandler = _interopRequireDefault(require("../WithCustomHandler"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
const Citation = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
label,
|
|
16
|
+
url
|
|
17
|
+
} = _ref;
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
19
|
+
colorTheme: "secondary",
|
|
20
|
+
onClick: () => window.open(url, '_blank', 'noopener,noreferrer'),
|
|
21
|
+
size: "small"
|
|
22
|
+
}, label);
|
|
23
|
+
};
|
|
24
|
+
Citation.propTypes = {
|
|
25
|
+
label: _propTypes.string,
|
|
26
|
+
url: _propTypes.string
|
|
27
|
+
};
|
|
28
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)((0, _WithCustomHandler.default)(Citation));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _WithCustomHandler = _interopRequireDefault(require("../WithCustomHandler"));
|
|
10
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
const CitationGroup = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
children,
|
|
16
|
+
classes
|
|
17
|
+
} = _ref;
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
|
+
className: "".concat(_stylesModule.default.citationGroup, " ").concat(classes.citationGroup)
|
|
20
|
+
}, children);
|
|
21
|
+
};
|
|
22
|
+
CitationGroup.propTypes = {
|
|
23
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
24
|
+
};
|
|
25
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)((0, _WithCustomHandler.default)(CitationGroup));
|
package/dist/components/UTLabel/components/Markdown/components/CitationGroup/styles.module.scss
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.citationGroup {
|
|
2
|
+
-webkit-overflow-scrolling: touch;
|
|
3
|
+
display: flex;
|
|
4
|
+
grid-gap: 8px;
|
|
5
|
+
overflow-x: auto;
|
|
6
|
+
overflow-y: hidden;
|
|
7
|
+
padding-bottom: 4px;
|
|
8
|
+
scroll-behavior: smooth;
|
|
9
|
+
scroll-snap-type: x mandatory;
|
|
10
|
+
|
|
11
|
+
button {
|
|
12
|
+
flex: 0 0 auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&::-webkit-scrollbar {
|
|
16
|
+
height: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&::-webkit-scrollbar * {
|
|
20
|
+
background-color: transparent;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DATA_FOOTNOTE_REF = exports.DATA_FOOTNOTE_BACKREF = void 0;
|
|
7
|
+
const DATA_FOOTNOTE_REF = exports.DATA_FOOTNOTE_REF = 'data-footnote-ref';
|
|
8
|
+
const DATA_FOOTNOTE_BACKREF = exports.DATA_FOOTNOTE_BACKREF = 'data-footnote-backref';
|