@onesy/ui-react 1.0.79 → 1.0.80

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.
@@ -288,11 +288,12 @@ const CalendarAvailability = react_1.default.forwardRef((props_, ref) => {
288
288
  return palette[rangeShade];
289
289
  }, [rangeShade, style_react_1.colors, theme]);
290
290
  const itemToText = react_1.default.useCallback((item) => {
291
+ var _a, _b;
291
292
  if (item === 'pending')
292
- return 'scheduled';
293
+ return l('Scheduled');
293
294
  if (item === 'not-count-workout-session')
294
- return `don't count workout session`;
295
- return item;
295
+ return l(`Don't count workout session`);
296
+ 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);
296
297
  }, []);
297
298
  const viewOptions = react_1.default.useMemo(() => {
298
299
  return viewsProps === null || viewsProps === void 0 ? void 0 : viewsProps.map(item => ({
@@ -370,20 +371,12 @@ const CalendarAvailability = react_1.default.forwardRef((props_, ref) => {
370
371
  (0, utils_2.staticClassName)('CalendarAvailability', theme) && [
371
372
  'onesy-CalendarAvailability-header'
372
373
  ]
373
- ]) }, { children: [startHeader, (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 2, direction: 'row', wrap: 'wrap', justify: 'space-between', align: 'center', fullWidth: true }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, direction: 'row', wrap: 'wrap', align: 'center', className: classes.aside }, { children: [startLeft, (0, jsx_runtime_1.jsx)(Button, Object.assign({ color: 'inherit', version: 'outlined', size: 'small', onClick: onToday, selected: now.days === date.days }, { children: l('Today') })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, direction: 'row', align: 'center' }, { children: [(0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: `${l('Previous')} ${view}` }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: onPrevious }, IconButtonProps, { children: (0, jsx_runtime_1.jsx)(IconPrevious, { size: 'regular' }) })) })), (0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: `${l('Next')} ${view}` }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: onNext }, IconButtonProps, { children: (0, jsx_runtime_1.jsx)(IconNext, { size: 'regular' }) })) }))] })), (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'h2', weight: 500, whiteSpace: 'nowrap' }, { children: formattedDate })), endLeft] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, direction: 'row', align: 'center', flexNo: true, className: (0, style_react_1.classNames)([
374
+ ]) }, { children: [startHeader, (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 2, direction: 'row', wrap: 'wrap', justify: 'space-between', align: 'center', fullWidth: true }, { children: [(0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, direction: 'row', wrap: 'wrap', align: 'center', className: classes.aside }, { children: [startLeft, (0, jsx_runtime_1.jsx)(Button, Object.assign({ color: 'inherit', version: 'outlined', size: 'small', onClick: onToday, selected: now.days === date.days }, { children: l('Today') })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 0, direction: 'row', align: 'center' }, { children: [(0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: `${l('Previous')} ${l(view)}` }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: onPrevious }, IconButtonProps, { children: (0, jsx_runtime_1.jsx)(IconPrevious, { size: 'regular' }) })) })), (0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: `${l('Next')} ${l(view)}` }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: onNext }, IconButtonProps, { children: (0, jsx_runtime_1.jsx)(IconNext, { size: 'regular' }) })) }))] })), (0, jsx_runtime_1.jsx)(Type, Object.assign({ version: 'h2', weight: 500, whiteSpace: 'nowrap' }, { children: formattedDate })), endLeft] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.5, direction: 'row', align: 'center', flexNo: true, className: (0, style_react_1.classNames)([
374
375
  classes.aside,
375
376
  classes.overflowX
376
377
  ]) }, { children: [startRight, ['week', 'day'].includes(view) && ((0, jsx_runtime_1.jsxs)(Label, Object.assign({ checked: displayTime, onChange: onChangeDisplayTime }, { children: [(0, jsx_runtime_1.jsx)(Switch, {}), l('Display time')] }))), (0, jsx_runtime_1.jsx)(Select, { name: l('View'), value: view, onChange: onChangeView, options: viewOptions, size: 'small', MenuProps: {
377
378
  portal: true,
378
379
  size: 'regular'
379
- }, WrapperProps: {
380
- style: {
381
- width: 170,
382
- minWidth: 'unset'
383
- }
384
- }, style: {
385
- width: 170,
386
- minWidth: 'unset'
387
380
  } }), endRight] }))] })), endHeader] })), (0, jsx_runtime_1.jsxs)(Line, Object.assign({ ref: refs.calendar, gap: 2, flex: true, fullWidth: true }, { children: [view === 'simple' && ((0, jsx_runtime_1.jsx)(Line, Object.assign({ gap: 1, flex: true, fullWidth: true }, { children: (0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 4, fullWidth: true, className: (0, style_react_1.classNames)([
388
381
  (0, utils_2.staticClassName)('CalendarAvailability', theme) && [
389
382
  'onesy-CalendarAvailability-simple'
@@ -221,10 +221,10 @@ const CalendarWeek = react_1.default.forwardRef((props_, ref) => {
221
221
  }, [rangeShade, style_react_1.colors, theme]);
222
222
  const itemToText = react_1.default.useCallback((item) => {
223
223
  if (item === 'pending')
224
- return 'scheduled';
224
+ return l('Scheduled');
225
225
  if (item === 'not-count-workout-session')
226
- return `don't count workout session`;
227
- return item;
226
+ return l(`Don't count workout session`);
227
+ return l(item);
228
228
  }, []);
229
229
  const renderTimes = (day, valuesAll, weekly = true, itemDay) => {
230
230
  if (itemDay !== undefined && !(itemDay === null || itemDay === void 0 ? void 0 : itemDay.active))
@@ -324,9 +324,9 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
324
324
  return palette[rangeShade];
325
325
  }, [rangeShade, colors, theme]);
326
326
  const itemToText = React.useCallback(item => {
327
- if (item === 'pending') return 'scheduled';
328
- if (item === 'not-count-workout-session') return `don't count workout session`;
329
- return item;
327
+ if (item === 'pending') return l('Scheduled');
328
+ if (item === 'not-count-workout-session') return l(`Don't count workout session`);
329
+ return optionsStatus?.find(itemStatus => itemStatus.value === item)?.name ?? l(item);
330
330
  }, []);
331
331
  const viewOptions = React.useMemo(() => {
332
332
  return viewsProps?.map(item => ({
@@ -531,13 +531,13 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
531
531
  direction: "row",
532
532
  align: "center"
533
533
  }, /*#__PURE__*/React.createElement(Tooltip, {
534
- name: `${l('Previous')} ${view}`
534
+ name: `${l('Previous')} ${l(view)}`
535
535
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
536
536
  onClick: onPrevious
537
537
  }, IconButtonProps), /*#__PURE__*/React.createElement(IconPrevious, {
538
538
  size: "regular"
539
539
  }))), /*#__PURE__*/React.createElement(Tooltip, {
540
- name: `${l('Next')} ${view}`
540
+ name: `${l('Next')} ${l(view)}`
541
541
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
542
542
  onClick: onNext
543
543
  }, IconButtonProps), /*#__PURE__*/React.createElement(IconNext, {
@@ -564,16 +564,6 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
564
564
  MenuProps: {
565
565
  portal: true,
566
566
  size: 'regular'
567
- },
568
- WrapperProps: {
569
- style: {
570
- width: 170,
571
- minWidth: 'unset'
572
- }
573
- },
574
- style: {
575
- width: 170,
576
- minWidth: 'unset'
577
567
  }
578
568
  }), endRight)), endHeader), /*#__PURE__*/React.createElement(Line, {
579
569
  ref: refs.calendar,
@@ -212,9 +212,9 @@ const CalendarWeek = /*#__PURE__*/React.forwardRef((props_, ref) => {
212
212
  return palette[rangeShade];
213
213
  }, [rangeShade, colors, theme]);
214
214
  const itemToText = React.useCallback(item => {
215
- if (item === 'pending') return 'scheduled';
216
- if (item === 'not-count-workout-session') return `don't count workout session`;
217
- return item;
215
+ if (item === 'pending') return l('Scheduled');
216
+ if (item === 'not-count-workout-session') return l(`Don't count workout session`);
217
+ return l(item);
218
218
  }, []);
219
219
  const renderTimes = function (day, valuesAll) {
220
220
  let weekly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.79
1
+ /** @license UiReact v1.0.80
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onesy/ui-react",
3
- "version": "1.0.79",
3
+ "version": "1.0.80",
4
4
  "description": "UI for React",
5
5
  "repository": "https://github.com/onesy-me/onesy.git",
6
6
  "author": "Lazar <lazareric2@gmail.com>",