@onesy/ui-react 1.0.80 → 1.0.82
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.
@@ -199,6 +199,17 @@ const CalendarWeek = react_1.default.forwardRef((props_, ref) => {
|
|
199
199
|
return item;
|
200
200
|
});
|
201
201
|
}, [times]);
|
202
|
+
const optionsStatus = react_1.default.useMemo(() => {
|
203
|
+
return [
|
204
|
+
{ name: l('Working'), value: 'working' },
|
205
|
+
{ name: l('Not working'), value: 'not-working' },
|
206
|
+
{ name: l('On a break'), value: 'break' },
|
207
|
+
{ name: l('Scheduled'), value: 'pending' },
|
208
|
+
{ name: l('Rescheduled'), value: 'rescheduled' },
|
209
|
+
{ name: l('Cancelled'), value: 'canceled' },
|
210
|
+
{ name: l('Other'), value: 'other' }
|
211
|
+
];
|
212
|
+
}, []);
|
202
213
|
const getColor = react_1.default.useCallback((item) => {
|
203
214
|
let palette = theme.palette.color.neutral;
|
204
215
|
if ((item === null || item === void 0 ? void 0 : item.status) === 'working')
|
@@ -220,11 +231,12 @@ const CalendarWeek = react_1.default.forwardRef((props_, ref) => {
|
|
220
231
|
return palette[rangeShade];
|
221
232
|
}, [rangeShade, style_react_1.colors, theme]);
|
222
233
|
const itemToText = react_1.default.useCallback((item) => {
|
234
|
+
var _a, _b;
|
223
235
|
if (item === 'pending')
|
224
236
|
return l('Scheduled');
|
225
237
|
if (item === 'not-count-workout-session')
|
226
238
|
return l(`Don't count workout session`);
|
227
|
-
return l(item);
|
239
|
+
return (_b = (_a = optionsStatus === null || optionsStatus === void 0 ? void 0 : optionsStatus.find(itemStatus => itemStatus.value === item)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : l(item);
|
228
240
|
}, []);
|
229
241
|
const renderTimes = (day, valuesAll, weekly = true, itemDay) => {
|
230
242
|
if (itemDay !== undefined && !(itemDay === null || itemDay === void 0 ? void 0 : itemDay.active))
|
package/TextField/TextField.js
CHANGED
@@ -187,7 +187,7 @@ const useStyle = (0, style_react_1.style)(theme => {
|
|
187
187
|
insetInlineStart: '15px',
|
188
188
|
transform: 'translate(0, 6px) scale(0.667)'
|
189
189
|
},
|
190
|
-
background: Object.assign(Object.assign({}, other), { background: 'currentColor', borderRadius: `${theme.shape.radius.unit}px ${theme.shape.radius.unit}px 0 0`, opacity: theme.palette.light ? theme.palette.visual_contrast.default.opacity.hover : theme.palette.visual_contrast.default.opacity.selected, transition: theme.methods.transitions.make(['opacity']) }),
|
190
|
+
background: Object.assign(Object.assign({}, other), { background: 'currentColor', borderRadius: `${theme.shape.radius.unit}px ${theme.shape.radius.unit}px 0 0`, opacity: theme.palette.light ? theme.palette.visual_contrast.default.opacity.hover : theme.palette.visual_contrast.default.opacity.selected, zIndex: '-1', transition: theme.methods.transitions.make(['opacity']) }),
|
191
191
|
background_hover: {
|
192
192
|
opacity: theme.palette.visual_contrast.default.opacity.focus
|
193
193
|
},
|
@@ -199,6 +199,30 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
199
199
|
return item;
|
200
200
|
});
|
201
201
|
}, [times]);
|
202
|
+
const optionsStatus = React.useMemo(() => {
|
203
|
+
return [{
|
204
|
+
name: l('Working'),
|
205
|
+
value: 'working'
|
206
|
+
}, {
|
207
|
+
name: l('Not working'),
|
208
|
+
value: 'not-working'
|
209
|
+
}, {
|
210
|
+
name: l('On a break'),
|
211
|
+
value: 'break'
|
212
|
+
}, {
|
213
|
+
name: l('Scheduled'),
|
214
|
+
value: 'pending'
|
215
|
+
}, {
|
216
|
+
name: l('Rescheduled'),
|
217
|
+
value: 'rescheduled'
|
218
|
+
}, {
|
219
|
+
name: l('Cancelled'),
|
220
|
+
value: 'canceled'
|
221
|
+
}, {
|
222
|
+
name: l('Other'),
|
223
|
+
value: 'other'
|
224
|
+
}];
|
225
|
+
}, []);
|
202
226
|
const getColor = React.useCallback(item => {
|
203
227
|
let palette = theme.palette.color.neutral;
|
204
228
|
if (item?.status === 'working') palette = theme.palette.color.success;
|
@@ -214,7 +238,7 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
214
238
|
const itemToText = React.useCallback(item => {
|
215
239
|
if (item === 'pending') return l('Scheduled');
|
216
240
|
if (item === 'not-count-workout-session') return l(`Don't count workout session`);
|
217
|
-
return l(item);
|
241
|
+
return optionsStatus?.find(itemStatus => itemStatus.value === item)?.name ?? l(item);
|
218
242
|
}, []);
|
219
243
|
const renderTimes = function (day, valuesAll) {
|
220
244
|
let weekly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
@@ -233,6 +233,7 @@ const useStyle = styleMethod(theme => {
|
|
233
233
|
background: 'currentColor',
|
234
234
|
borderRadius: `${theme.shape.radius.unit}px ${theme.shape.radius.unit}px 0 0`,
|
235
235
|
opacity: theme.palette.light ? theme.palette.visual_contrast.default.opacity.hover : theme.palette.visual_contrast.default.opacity.selected,
|
236
|
+
zIndex: '-1',
|
236
237
|
transition: theme.methods.transitions.make(['opacity'])
|
237
238
|
}),
|
238
239
|
background_hover: {
|
package/esm/index.js
CHANGED