@onesy/ui-react 1.0.59 → 1.0.60

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.
Files changed (114) hide show
  1. package/AudioPlayer/AudioPlayer.js +6 -23
  2. package/AudioRecorder/AudioRecorder.js +2 -1
  3. package/AutoComplete/AutoComplete.js +5 -4
  4. package/AutoCompleteCountry/AutoCompleteCountry.js +2 -1
  5. package/AutoCompleteCurrency/AutoCompleteCurrency.js +2 -1
  6. package/Breadcrumbs/Breadcrumbs.js +3 -2
  7. package/BubbleChart/BubbleChart.js +3 -2
  8. package/Calendar/Calendar.js +7 -6
  9. package/CalendarAvailability/CalendarAvailability.d.ts +4 -1
  10. package/CalendarAvailability/CalendarAvailability.js +23 -18
  11. package/CalendarMenu/CalendarMenu.js +6 -5
  12. package/CalendarMonth/CalendarMonth.js +8 -7
  13. package/CalendarViews/CalendarViews.d.ts +4 -1
  14. package/CalendarViews/CalendarViews.js +17 -12
  15. package/Chart/Chart.js +1 -0
  16. package/ColorTextField/ColorTextField.js +2 -1
  17. package/Confirm/Confirm.js +4 -3
  18. package/CookieBanner/CookieBanner.js +3 -2
  19. package/Countdown/Countdown.js +5 -4
  20. package/DatePicker/DatePicker.js +10 -9
  21. package/DateTimePicker/DateTimePicker.js +5 -4
  22. package/Drawing/Drawing.js +9 -8
  23. package/DropZone/DropZone.d.ts +1 -0
  24. package/DropZone/DropZone.js +3 -2
  25. package/Emojis/Emojis.js +46 -43
  26. package/Frame/Frame.js +6 -5
  27. package/ImageEdit/ImageEdit.js +21 -20
  28. package/Info/Info.js +2 -1
  29. package/Links/Links.d.ts +2 -0
  30. package/Links/Links.js +7 -6
  31. package/Medias/Medias.js +2 -1
  32. package/MenuDesktop/MenuDesktop.js +1 -3
  33. package/NavigationItem/NavigationItem.js +1 -1
  34. package/NotFound/NotFound.d.ts +1 -0
  35. package/NotFound/NotFound.js +3 -2
  36. package/Page/Page.js +2 -1
  37. package/PieChart/PieChart.js +4 -3
  38. package/RichTextEditor/RichTextEditor.js +57 -56
  39. package/ScreenCapture/ScreenCapture.js +2 -1
  40. package/SectionAction/SectionAction.js +2 -1
  41. package/SectionBoxes/SectionBoxes.js +2 -1
  42. package/SectionCards/SectionCards.js +2 -1
  43. package/SectionCarousel/SectionCarousel.js +2 -1
  44. package/SectionMedia/SectionMedia.js +2 -1
  45. package/SectionTextMedia/SectionTextMedia.js +2 -1
  46. package/Select/Select.js +2 -1
  47. package/Share/Share.js +15 -14
  48. package/SmartTextField/SmartTextField.js +13 -12
  49. package/SpeechToText/SpeechToText.js +3 -2
  50. package/SpeedDial/SpeedDial.js +1 -1
  51. package/SpeedDialItem/SpeedDialItem.js +1 -1
  52. package/TableCell/TableCell.js +2 -1
  53. package/TablePagination/TablePagination.js +2 -1
  54. package/TextField/TextField.d.ts +1 -0
  55. package/TextToSpeech/TextToSpeech.js +4 -3
  56. package/TimePicker/TimePicker.js +9 -8
  57. package/Timer/Timer.js +3 -2
  58. package/VideoPlayer/VideoPlayer.js +5 -4
  59. package/Widgets/Widgets.js +3 -2
  60. package/esm/AudioPlayer/AudioPlayer.js +7 -30
  61. package/esm/AudioRecorder/AudioRecorder.js +8 -7
  62. package/esm/AutoComplete/AutoComplete.js +5 -4
  63. package/esm/AutoCompleteCountry/AutoCompleteCountry.js +2 -0
  64. package/esm/AutoCompleteCurrency/AutoCompleteCurrency.js +2 -1
  65. package/esm/Breadcrumbs/Breadcrumbs.js +3 -2
  66. package/esm/BubbleChart/BubbleChart.js +3 -2
  67. package/esm/Calendar/Calendar.js +9 -8
  68. package/esm/CalendarAvailability/CalendarAvailability.js +31 -21
  69. package/esm/CalendarMenu/CalendarMenu.js +7 -6
  70. package/esm/CalendarMonth/CalendarMonth.js +8 -7
  71. package/esm/CalendarViews/CalendarViews.js +25 -15
  72. package/esm/Chart/Chart.js +1 -0
  73. package/esm/ColorTextField/ColorTextField.js +2 -1
  74. package/esm/Confirm/Confirm.js +7 -6
  75. package/esm/CookieBanner/CookieBanner.js +4 -3
  76. package/esm/Countdown/Countdown.js +10 -9
  77. package/esm/DatePicker/DatePicker.js +22 -21
  78. package/esm/DateTimePicker/DateTimePicker.js +11 -10
  79. package/esm/Drawing/Drawing.js +11 -10
  80. package/esm/DropZone/DropZone.js +4 -2
  81. package/esm/Emojis/Emojis.js +37 -34
  82. package/esm/Frame/Frame.js +6 -5
  83. package/esm/ImageEdit/ImageEdit.js +25 -24
  84. package/esm/Info/Info.js +2 -1
  85. package/esm/Links/Links.js +9 -6
  86. package/esm/Medias/Medias.js +2 -1
  87. package/esm/MenuDesktop/MenuDesktop.js +1 -2
  88. package/esm/NavigationItem/NavigationItem.js +1 -1
  89. package/esm/NotFound/NotFound.js +5 -3
  90. package/esm/Page/Page.js +3 -2
  91. package/esm/PieChart/PieChart.js +4 -4
  92. package/esm/RichTextEditor/RichTextEditor.js +76 -75
  93. package/esm/ScreenCapture/ScreenCapture.js +4 -3
  94. package/esm/SectionAction/SectionAction.js +2 -1
  95. package/esm/SectionBoxes/SectionBoxes.js +2 -1
  96. package/esm/SectionCards/SectionCards.js +2 -1
  97. package/esm/SectionCarousel/SectionCarousel.js +2 -1
  98. package/esm/SectionMedia/SectionMedia.js +2 -1
  99. package/esm/SectionTextMedia/SectionTextMedia.js +2 -1
  100. package/esm/Select/Select.js +2 -1
  101. package/esm/Share/Share.js +16 -15
  102. package/esm/SmartTextField/SmartTextField.js +15 -14
  103. package/esm/SpeechToText/SpeechToText.js +3 -2
  104. package/esm/SpeedDial/SpeedDial.js +1 -1
  105. package/esm/SpeedDialItem/SpeedDialItem.js +1 -1
  106. package/esm/TableCell/TableCell.js +2 -1
  107. package/esm/TablePagination/TablePagination.js +2 -1
  108. package/esm/TextToSpeech/TextToSpeech.js +4 -3
  109. package/esm/TimePicker/TimePicker.js +19 -18
  110. package/esm/Timer/Timer.js +7 -6
  111. package/esm/VideoPlayer/VideoPlayer.js +7 -6
  112. package/esm/Widgets/Widgets.js +3 -2
  113. package/esm/index.js +1 -1
  114. package/package.json +2 -2
@@ -63,6 +63,7 @@ const useStyle = styleMethod(theme => ({
63
63
  });
64
64
  const AudioRecorder = /*#__PURE__*/React.forwardRef((props_, ref) => {
65
65
  const theme = useOnesyTheme();
66
+ const l = theme.l;
66
67
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyAudioRecorder?.props?.default), props_), [props_]);
67
68
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
68
69
  const Fade = React.useMemo(() => theme?.elements?.Fade || FadeElement, [theme]);
@@ -299,7 +300,7 @@ const AudioRecorder = /*#__PURE__*/React.forwardRef((props_, ref) => {
299
300
  onStart,
300
301
  supported
301
302
  }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, _extends({
302
- label: "Voice record"
303
+ name: l('Voice record')
303
304
  }, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
304
305
  onClick: onStart,
305
306
  disabled: !supported
@@ -307,30 +308,30 @@ const AudioRecorder = /*#__PURE__*/React.forwardRef((props_, ref) => {
307
308
  in: true,
308
309
  add: true
309
310
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Tooltip, _extends({
310
- label: "Cancel"
311
+ name: l('Cancel')
311
312
  }, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
312
313
  onClick: onStop
313
314
  }, iconButtonProps), /*#__PURE__*/React.createElement(IconStop, iconProps))), pause && /*#__PURE__*/React.createElement(Tooltip, _extends({
314
- label: "Pause"
315
+ name: l('Pause')
315
316
  }, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
316
317
  onClick: onPause
317
318
  }, iconButtonProps), /*#__PURE__*/React.createElement(IconPause, iconProps))), /*#__PURE__*/React.createElement(Tooltip, _extends({
318
- label: "Confirm"
319
+ name: l('Confirm')
319
320
  }, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
320
321
  onClick: onConfirm
321
322
  }, iconButtonProps), /*#__PURE__*/React.createElement(IconConfirm, iconProps))))), status === 'paused' && /*#__PURE__*/React.createElement(Fade, {
322
323
  in: true,
323
324
  add: true
324
325
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Tooltip, _extends({
325
- label: "Cancel"
326
+ name: l('Cancel')
326
327
  }, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
327
328
  onClick: onStop
328
329
  }, iconButtonProps), /*#__PURE__*/React.createElement(IconStop, iconProps))), /*#__PURE__*/React.createElement(Tooltip, _extends({
329
- label: "Resume"
330
+ name: l('Resume')
330
331
  }, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
331
332
  onClick: onResume
332
333
  }, iconButtonProps), /*#__PURE__*/React.createElement(IconStart, iconProps))), /*#__PURE__*/React.createElement(Tooltip, _extends({
333
- label: "Confirm"
334
+ name: l('Confirm')
334
335
  }, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
335
336
  onClick: onConfirm
336
337
  }, iconButtonProps), /*#__PURE__*/React.createElement(IconConfirm, iconProps))))));
@@ -102,6 +102,7 @@ const getText = value => {
102
102
  const getValue = value => value?.value !== undefined ? value.value : value;
103
103
  const AutoComplete = /*#__PURE__*/React.forwardRef((props_, ref) => {
104
104
  const theme = useOnesyTheme();
105
+ const l = theme.l;
105
106
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyAutoComplete?.props?.default), props_), [props_]);
106
107
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
107
108
  const Menu = React.useMemo(() => theme?.elements?.Menu || MenuElement, [theme]);
@@ -257,12 +258,12 @@ const AutoComplete = /*#__PURE__*/React.forwardRef((props_, ref) => {
257
258
  // reset
258
259
  setFree(false);
259
260
  if (loading) optionsValue = [{
260
- label: 'Loading...',
261
+ label: l('Loading...'),
261
262
  version: 'text'
262
263
  }];else if (newOptions) optionsValue = newOptions;else optionsValue = is('function', filter) ? filter(valueInputNew, refs.optionsProps.current) : refs.optionsProps.current.filter(option => isEqualToInput(valueInputNew, option));
263
264
  if (!optionsValue.length) {
264
265
  if (noOptions) optionsValue.push(noOptionsObject !== undefined ? noOptionsObject : {
265
- primary: 'No options',
266
+ primary: l('No options'),
266
267
  version: 'text',
267
268
  noOptions: true
268
269
  });else {
@@ -466,7 +467,7 @@ const AutoComplete = /*#__PURE__*/React.forwardRef((props_, ref) => {
466
467
  const groups = {};
467
468
  if (is('function', groupBy)) {
468
469
  optionsToUse.forEach(option => {
469
- const valueForGroupBy = groupBy(option) || 'Other';
470
+ const valueForGroupBy = groupBy(option) || l('Other');
470
471
  if (!groups[valueForGroupBy]) groups[valueForGroupBy] = [];
471
472
  groups[valueForGroupBy].push(option);
472
473
  });
@@ -547,7 +548,7 @@ const AutoComplete = /*#__PURE__*/React.forwardRef((props_, ref) => {
547
548
  onClick: onClear,
548
549
  size: "small",
549
550
  fontSize: iconFontSize,
550
- "aria-label": "Input clear"
551
+ "aria-label": l('Input clear')
551
552
  }, IconButtonProps), /*#__PURE__*/React.createElement(IconClear, IconProps))] : []), /*#__PURE__*/React.createElement(IconButton, _extends({
552
553
  key: 3,
553
554
  onClick: onClickArrowDown,
@@ -18,6 +18,7 @@ const useStyle = styleMethod(theme => ({
18
18
  });
19
19
  const AutoCompleteCountry = /*#__PURE__*/React.forwardRef((props_, ref) => {
20
20
  const theme = useOnesyTheme();
21
+ const l = theme.l;
21
22
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyAutoCompleteCountry?.props?.default), props_), [props_]);
22
23
  const AutoComplete = React.useMemo(() => theme?.elements?.AutoComplete || AutoCompleteElement, [theme]);
23
24
  const ListItem = React.useMemo(() => theme?.elements?.ListItem || ListItemElement, [theme]);
@@ -48,6 +49,7 @@ const AutoCompleteCountry = /*#__PURE__*/React.forwardRef((props_, ref) => {
48
49
  // }
49
50
  const options = React.useMemo(() => {
50
51
  return countries.map(item => _objectSpread(_objectSpread({}, item), {}, {
52
+ name: l(item.name),
51
53
  value: item['alpha-2']
52
54
  }));
53
55
  }, [countries]);
@@ -15,6 +15,7 @@ const useStyle = styleMethod(theme => ({
15
15
  });
16
16
  const AutoCompleteCurrency = /*#__PURE__*/React.forwardRef((props_, ref) => {
17
17
  const theme = useOnesyTheme();
18
+ const l = theme.l;
18
19
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyAutoCompleteCurrency?.props?.default), props_), [props_]);
19
20
  const AutoComplete = React.useMemo(() => theme?.elements?.AutoComplete || AutoCompleteElement, [theme]);
20
21
  const {
@@ -39,7 +40,7 @@ const AutoCompleteCurrency = /*#__PURE__*/React.forwardRef((props_, ref) => {
39
40
  // }
40
41
  const options = React.useMemo(() => {
41
42
  return [{
42
- name: 'No currency',
43
+ name: l('No currency'),
43
44
  value: ''
44
45
  }, ...currencies.map(item => ({
45
46
  name: `${item.code} ${item.name} (${item.symbol})`,
@@ -32,6 +32,7 @@ const useStyle = styleMethod(theme => ({
32
32
  });
33
33
  const Breadcrumbs = /*#__PURE__*/React.forwardRef((props_, ref) => {
34
34
  const theme = useOnesyTheme();
35
+ const l = theme.l;
35
36
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyBreadcrumbs?.props?.default), props_), [props_]);
36
37
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
37
38
  const Type = React.useMemo(() => theme?.elements?.Type || TypeElement, [theme]);
@@ -91,7 +92,7 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef((props_, ref) => {
91
92
  color: "default",
92
93
  size: "small",
93
94
  onClick: onExpandMore,
94
- "aria-label": "Expand more path"
95
+ "aria-label": l('Expand more path')
95
96
  }, MoreProps, {
96
97
  className: classNames([staticClassName('Breadcrumbs', theme) && ['onesy-Breadcrumbs-expand-more'], MoreProps?.className, classes.expandMore])
97
98
  }), /*#__PURE__*/React.createElement(IconMore, {
@@ -127,7 +128,7 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef((props_, ref) => {
127
128
  direction: "row",
128
129
  align: "center",
129
130
  wrap: "wrap",
130
- "aria-label": "Breadcrumb",
131
+ "aria-label": l('Breadcrumb'),
131
132
  Component: Component
132
133
  }, other, {
133
134
  className: classNames([staticClassName('Breadcrumbs', theme) && ['onesy-Breadcrumbs-root'], className, classes.root])
@@ -50,6 +50,7 @@ const useStyle = styleMethod(theme => ({
50
50
  });
51
51
  const BubbleChart = /*#__PURE__*/React.forwardRef((props_, ref) => {
52
52
  const theme = useOnesyTheme();
53
+ const l = theme.l;
53
54
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyBubbleChart?.props?.default), props_), [props_]);
54
55
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
55
56
  const Chart = React.useMemo(() => theme?.elements?.Chart || ChartElement, [theme]);
@@ -153,7 +154,7 @@ const BubbleChart = /*#__PURE__*/React.forwardRef((props_, ref) => {
153
154
  style: {
154
155
  fontWeight: 600
155
156
  }
156
- }, "Label"), /*#__PURE__*/React.createElement(Type, {
157
+ }, l('Label')), /*#__PURE__*/React.createElement(Type, {
157
158
  version: "b3",
158
159
  style: {
159
160
  fontWeight: 600
@@ -168,7 +169,7 @@ const BubbleChart = /*#__PURE__*/React.forwardRef((props_, ref) => {
168
169
  style: {
169
170
  fontWeight: 600
170
171
  }
171
- }, names?.size || 'Size')), /*#__PURE__*/React.createElement(Line, {
172
+ }, names?.size || l('Size'))), /*#__PURE__*/React.createElement(Line, {
172
173
  gap: 1,
173
174
  direction: "column"
174
175
  }, groupsSorted.map((group, index) => /*#__PURE__*/React.createElement(Line, {
@@ -137,6 +137,7 @@ const useStyle = style(theme => ({
137
137
  });
138
138
  const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
139
139
  const theme = useOnesyTheme();
140
+ const l = theme.l;
140
141
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendar?.props?.default), props__), [props__]);
141
142
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
142
143
  const Surface = React.useMemo(() => theme?.elements?.Surface || SurfaceElement, [theme]);
@@ -446,7 +447,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
446
447
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
447
448
  onClick: () => move(false),
448
449
  size: size,
449
- "aria-label": "Previous month",
450
+ "aria-label": l('Previous month'),
450
451
  disabled: open || +year <= 1970 && month === 'Jan'
451
452
  }, optionButtonProps), /*#__PURE__*/React.createElement(IconPrevious, {
452
453
  size: size
@@ -461,7 +462,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
461
462
  size: size,
462
463
  className: classNames([staticClassName('Calendar', theme) && ['onesy-Calendar-arrow'], classes.arrow, open === 'month' && classes.arrow_open])
463
464
  })),
464
- "aria-label": `Select month, current ${month}`
465
+ "aria-label": `${l('Select month')}, ${l('current')} ${month}`
465
466
  }, optionButtonProps, {
466
467
  className: classNames([staticClassName('Calendar', theme) && ['onesy-Calendar-option'], optionButtonProps?.className, classes.option, open === 'year' && classes.option_secondary])
467
468
  }), month), /*#__PURE__*/React.createElement(Fade, {
@@ -469,7 +470,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
469
470
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
470
471
  onClick: () => move(),
471
472
  size: size,
472
- "aria-label": "Next month",
473
+ "aria-label": l('Next month'),
473
474
  disabled: open || +year === 2099 && month === 'Dec'
474
475
  }, optionButtonProps), /*#__PURE__*/React.createElement(IconNext, {
475
476
  size: size
@@ -482,7 +483,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
482
483
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
483
484
  onClick: () => move(false, 'year'),
484
485
  size: size,
485
- "aria-label": "Previous year",
486
+ "aria-label": l('Previous year'),
486
487
  disabled: open || +year <= 1970
487
488
  }, optionButtonProps), /*#__PURE__*/React.createElement(IconPrevious, {
488
489
  size: size
@@ -497,7 +498,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
497
498
  size: size,
498
499
  className: classNames([staticClassName('Calendar', theme) && ['onesy-Calendar-arrow'], classes.arrow, open === 'year' && classes.arrow_open])
499
500
  })),
500
- "aria-label": `Select year, current ${year}`
501
+ "aria-label": `${l('Select year')}, ${l('current')} ${year}`
501
502
  }, optionButtonProps, {
502
503
  className: classNames([staticClassName('Calendar', theme) && ['onesy-Calendar-option'], optionButtonProps?.className, classes.option, open === 'month' && classes.option_secondary])
503
504
  }), year), /*#__PURE__*/React.createElement(Fade, {
@@ -505,7 +506,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
505
506
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
506
507
  onClick: () => move(true, 'year'),
507
508
  size: size,
508
- "aria-label": "Next year",
509
+ "aria-label": l('Next year'),
509
510
  disabled: open || +year === 2099
510
511
  }, optionButtonProps), /*#__PURE__*/React.createElement(IconNext, {
511
512
  size: size
@@ -533,7 +534,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
533
534
  color: "inherit",
534
535
  size: size,
535
536
  onClick: () => move(false, menu_month_previous_unit || 'month'),
536
- "aria-label": "Previous month",
537
+ "aria-label": l('Previous month'),
537
538
  disabled: !!(open || +year === 1970 && month === 'Jan')
538
539
  }, /*#__PURE__*/React.createElement(IconPrevious, {
539
540
  size: size
@@ -544,7 +545,7 @@ const Calendar = /*#__PURE__*/React.forwardRef((props__, ref) => {
544
545
  color: "inherit",
545
546
  size: size,
546
547
  onClick: () => move(true, menu_month_next_unit || 'month'),
547
- "aria-label": "Next month",
548
+ "aria-label": l('Next month'),
548
549
  disabled: !!(open || +year === 2099 && month === 'Dec')
549
550
  }, /*#__PURE__*/React.createElement(IconNext, {
550
551
  size: size
@@ -112,6 +112,7 @@ const useStyle = styleMethod(theme => ({
112
112
  });
113
113
  const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
114
114
  const theme = useOnesyTheme();
115
+ const l = theme.l;
115
116
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendarAvailability?.props?.default), props_), [props_]);
116
117
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
117
118
  const Type = React.useMemo(() => theme?.elements?.Type || TypeElement, [theme]);
@@ -133,7 +134,16 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
133
134
  times: timesProps,
134
135
  events,
135
136
  meta,
136
- views: viewsProps = ['week', 'day', 'simple'],
137
+ views: viewsProps = [{
138
+ name: l('Week'),
139
+ value: 'week'
140
+ }, {
141
+ name: l('Day'),
142
+ value: 'day'
143
+ }, {
144
+ name: l('Simple'),
145
+ value: 'simple'
146
+ }],
137
147
  onUpdate,
138
148
  onRemove,
139
149
  onChangeDate: onChangeDateProps,
@@ -232,25 +242,25 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
232
242
  }, []);
233
243
  const optionsStatus = React.useMemo(() => {
234
244
  return [{
235
- name: 'Working',
245
+ name: l('Working'),
236
246
  value: 'working'
237
247
  }, {
238
- name: 'Not working',
248
+ name: l('Not working'),
239
249
  value: 'not-working'
240
250
  }, {
241
- name: 'On a break',
251
+ name: l('On a break'),
242
252
  value: 'break'
243
253
  }, {
244
- name: 'Scheduled',
254
+ name: l('Scheduled'),
245
255
  value: 'pending'
246
256
  }, {
247
- name: 'Rescheduled',
257
+ name: l('Rescheduled'),
248
258
  value: 'rescheduled'
249
259
  }, {
250
- name: 'Cancelled',
260
+ name: l('Cancelled'),
251
261
  value: 'canceled'
252
262
  }, {
253
- name: 'Other',
263
+ name: l('Other'),
254
264
  value: 'other'
255
265
  }];
256
266
  }, []);
@@ -320,8 +330,8 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
320
330
  }, []);
321
331
  const viewOptions = React.useMemo(() => {
322
332
  return viewsProps?.map(item => ({
323
- name: capitalize(item),
324
- value: item
333
+ name: capitalize(item?.name),
334
+ value: item?.value
325
335
  }));
326
336
  }, [viewsProps]);
327
337
  const days = React.useMemo(() => {
@@ -393,14 +403,14 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
393
403
  }));
394
404
  }) : /*#__PURE__*/React.createElement(Type, {
395
405
  version: "b2"
396
- }, "No information for this day")));
406
+ }, l('No information for this day'))));
397
407
  }));
398
408
  };
399
409
  const simpleExceptionsUI = () => {
400
410
  const items = times.flatMap(item => getDatesWeek(item));
401
411
  if (!items.length) return /*#__PURE__*/React.createElement(Type, {
402
412
  version: "b1"
403
- }, "No exceptions this week");
413
+ }, l('No exceptions this week'));
404
414
  return /*#__PURE__*/React.createElement(React.Fragment, null, items.map((itemValue, index) => {
405
415
  const day = set(index + 1, 'dayWeek');
406
416
  const itemValueFrom = new OnesyDate(itemValue.from);
@@ -496,18 +506,18 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
496
506
  size: "small",
497
507
  onClick: onToday,
498
508
  selected: now.days === date.days
499
- }, "Today"), /*#__PURE__*/React.createElement(Line, {
509
+ }, l('Today')), /*#__PURE__*/React.createElement(Line, {
500
510
  gap: 0,
501
511
  direction: "row",
502
512
  align: "center"
503
513
  }, /*#__PURE__*/React.createElement(Tooltip, {
504
- name: `Previous ${view}`
514
+ name: `${l('Previous')} ${view}`
505
515
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
506
516
  onClick: onPrevious
507
517
  }, IconButtonProps), /*#__PURE__*/React.createElement(IconPrevious, {
508
518
  size: "regular"
509
519
  }))), /*#__PURE__*/React.createElement(Tooltip, {
510
- name: `Next ${view}`
520
+ name: `${l('Next')} ${view}`
511
521
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
512
522
  onClick: onNext
513
523
  }, IconButtonProps), /*#__PURE__*/React.createElement(IconNext, {
@@ -525,8 +535,8 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
525
535
  }, startRight, ['week', 'day'].includes(view) && /*#__PURE__*/React.createElement(Label, {
526
536
  checked: displayTime,
527
537
  onChange: onChangeDisplayTime
528
- }, /*#__PURE__*/React.createElement(Switch, null), "Display time"), /*#__PURE__*/React.createElement(Select, {
529
- name: "View",
538
+ }, /*#__PURE__*/React.createElement(Switch, null), l('Display time')), /*#__PURE__*/React.createElement(Select, {
539
+ name: l('View'),
530
540
  value: view,
531
541
  onChange: onChangeView,
532
542
  options: viewOptions,
@@ -562,7 +572,7 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
562
572
  gap: 1.5
563
573
  }, /*#__PURE__*/React.createElement(Type, {
564
574
  version: "t2"
565
- }, "Exceptions this week"), /*#__PURE__*/React.createElement(Line, {
575
+ }, l('Exceptions this week')), /*#__PURE__*/React.createElement(Line, {
566
576
  gap: 1
567
577
  }, simpleExceptionsUI())))), ['week', 'day'].includes(view) && /*#__PURE__*/React.createElement(CalendarWeek, _extends({
568
578
  onOpen: onOpen,
@@ -603,21 +613,21 @@ const CalendarAvailability = /*#__PURE__*/React.forwardRef((props_, ref) => {
603
613
  direction: "row",
604
614
  align: "center"
605
615
  }, startRightModal, onUpdate && /*#__PURE__*/React.createElement(Tooltip, {
606
- name: "Update"
616
+ name: l('Update')
607
617
  }, /*#__PURE__*/React.createElement(IconButton, {
608
618
  onClick: () => {
609
619
  onUpdate(modal?.object);
610
620
  onClose();
611
621
  }
612
622
  }, /*#__PURE__*/React.createElement(IconEdit, IconProps))), onRemove && /*#__PURE__*/React.createElement(Tooltip, {
613
- name: "Remove"
623
+ name: l('Remove')
614
624
  }, /*#__PURE__*/React.createElement(IconButton, {
615
625
  onClick: () => {
616
626
  onRemove(modal?.object);
617
627
  onClose();
618
628
  }
619
629
  }, /*#__PURE__*/React.createElement(IconRemove, IconProps))), /*#__PURE__*/React.createElement(Tooltip, {
620
- name: "Close"
630
+ name: l('Close')
621
631
  }, /*#__PURE__*/React.createElement(IconButton, {
622
632
  onClick: onClose
623
633
  }, /*#__PURE__*/React.createElement(IconClose, IconProps))), endRightModal)), /*#__PURE__*/React.createElement(ModalMain, {
@@ -100,6 +100,7 @@ const useStyle = style(theme => ({
100
100
  });
101
101
  const CalendarMenu = /*#__PURE__*/React.forwardRef((props_, ref) => {
102
102
  const theme = useOnesyTheme();
103
+ const l = theme.l;
103
104
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendarAvailability?.props?.default), props_), [props_]);
104
105
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
105
106
  const Menu = React.useMemo(() => theme?.elements?.Menu || MenuElement, [theme]);
@@ -185,19 +186,19 @@ const CalendarMenu = /*#__PURE__*/React.forwardRef((props_, ref) => {
185
186
  size: 'regular'
186
187
  };
187
188
  const shortcuts = [{
188
- name: 'Today',
189
+ name: l('Today'),
189
190
  onClick: () => onChangeDate(new OnesyDate()),
190
191
  icon: /*#__PURE__*/React.createElement(IconMaterialWbSunnyRounded, iconProps)
191
192
  }, {
192
- name: 'Tomorrow',
193
+ name: l('Tomorrow'),
193
194
  onClick: () => onChangeDate(add(1, 'day')),
194
195
  icon: /*#__PURE__*/React.createElement(IconMaterialWbTwilightRounded, iconProps)
195
196
  }, {
196
- name: '7 days',
197
+ name: l('7 days'),
197
198
  onClick: () => onChangeDate(add(7, 'day')),
198
199
  icon: /*#__PURE__*/React.createElement(IconMaterialCounter7Rounded, iconProps)
199
200
  }, {
200
- name: '1 month',
201
+ name: l('1 month'),
201
202
  onClick: () => onChangeDate(add(1, 'month')),
202
203
  icon: /*#__PURE__*/React.createElement(IconMaterialCalendarMonthRounded, iconProps)
203
204
  }];
@@ -344,8 +345,8 @@ const CalendarMenu = /*#__PURE__*/React.forwardRef((props_, ref) => {
344
345
  version: "text",
345
346
  size: "small",
346
347
  disabled: !value?.[dateProperty]
347
- }, "Clear"), !noRemove && /*#__PURE__*/React.createElement(Tooltip, {
348
- name: "Remove"
348
+ }, l('Clear')), !noRemove && /*#__PURE__*/React.createElement(Tooltip, {
349
+ name: l('Remove')
349
350
  }, /*#__PURE__*/React.createElement(IconButton, {
350
351
  size: "small",
351
352
  onClick: onRemove
@@ -178,6 +178,7 @@ const useStyle = style(theme => ({
178
178
  });
179
179
  const CalendarMonth = /*#__PURE__*/React.forwardRef((props__, ref) => {
180
180
  const theme = useOnesyTheme();
181
+ const l = theme.l;
181
182
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendarMonth?.props?.default), props__), [props__]);
182
183
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
183
184
  const Surface = React.useMemo(() => theme?.elements?.Surface || SurfaceElement, [theme]);
@@ -310,13 +311,13 @@ const CalendarMonth = /*#__PURE__*/React.forwardRef((props__, ref) => {
310
311
  if (weekStartDay === 'Monday') dayNames.push(7);else dayNames.unshift(7);
311
312
  const renderDayNameMethod = is('function', renderDayName) ? renderDayName : order_ => {
312
313
  const values = {
313
- 1: dayNamesFull ? 'Monday' : 'M',
314
- 2: dayNamesFull ? 'Tuesday' : 'T',
315
- 3: dayNamesFull ? 'Wednesday' : 'W',
316
- 4: dayNamesFull ? 'Thursday' : 'T',
317
- 5: dayNamesFull ? 'Friday' : 'F',
318
- 6: dayNamesFull ? 'Saturday' : 'S',
319
- 7: dayNamesFull ? 'Sunday' : 'S'
314
+ 1: dayNamesFull ? l('Monday') : l('Mo'),
315
+ 2: dayNamesFull ? l('Tuesday') : l('Tu'),
316
+ 3: dayNamesFull ? l('Wednesday') : l('We'),
317
+ 4: dayNamesFull ? l('Thursday') : l('Th'),
318
+ 5: dayNamesFull ? l('Friday') : l('Fr'),
319
+ 6: dayNamesFull ? l('Saturday') : l('Sa'),
320
+ 7: dayNamesFull ? l('Sunday') : l('Su')
320
321
  };
321
322
  return values[order_];
322
323
  };
@@ -5,7 +5,7 @@ const _excluded = ["viewDefault", "dateDefault", "times", "events", "views", "re
5
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  import React from 'react';
8
- import { capitalize, is } from '@onesy/utils';
8
+ import { is } from '@onesy/utils';
9
9
  import { classNames, style as styleMethod, useOnesyTheme } from '@onesy/style-react';
10
10
  import { add, OnesyDate, endOf, format, remove, startOf } from '@onesy/date';
11
11
  import IconMaterialArrowBackIosNew from '@onesy/icons-material-rounded-react/IconMaterialArrowBackIosNewW100';
@@ -105,6 +105,7 @@ const useStyle = styleMethod(theme => ({
105
105
  });
106
106
  const CalendarViews = /*#__PURE__*/React.forwardRef((props_, ref) => {
107
107
  const theme = useOnesyTheme();
108
+ const l = theme.l;
108
109
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyCalendarViews?.props?.default), props_), [props_]);
109
110
  const CalendarMonth = React.useMemo(() => theme?.elements?.CalendarMonth || CalendarMonthElement, [theme]);
110
111
  const IconButton = React.useMemo(() => theme?.elements?.IconButton || IconButtonElement, [theme]);
@@ -119,7 +120,16 @@ const CalendarViews = /*#__PURE__*/React.forwardRef((props_, ref) => {
119
120
  dateDefault,
120
121
  times: timesProps,
121
122
  events,
122
- views: viewsProps = ['month', 'week', 'day'],
123
+ views: viewsProps = [{
124
+ name: l('Month'),
125
+ value: 'month'
126
+ }, {
127
+ name: l('Week'),
128
+ value: 'week'
129
+ }, {
130
+ name: l('Day'),
131
+ value: 'day'
132
+ }],
123
133
  render,
124
134
  onTimeClick,
125
135
  onChangeView: onChangeViewProps,
@@ -170,8 +180,8 @@ const CalendarViews = /*#__PURE__*/React.forwardRef((props_, ref) => {
170
180
  }, [events, timesProps]);
171
181
  const viewOptions = React.useMemo(() => {
172
182
  return viewsProps?.map(item => ({
173
- name: capitalize(item),
174
- value: item
183
+ name: item?.name,
184
+ value: item?.value
175
185
  }));
176
186
  }, [viewsProps]);
177
187
  const formattedDate = React.useMemo(() => {
@@ -229,13 +239,13 @@ const CalendarViews = /*#__PURE__*/React.forwardRef((props_, ref) => {
229
239
  }, [render, view]);
230
240
  const renderDayName = React.useCallback(order => {
231
241
  const values = {
232
- 1: 'Mon',
233
- 2: 'Tue',
234
- 3: 'Wed',
235
- 4: 'Thu',
236
- 5: 'Fri',
237
- 6: 'Sat',
238
- 7: 'Sun'
242
+ 1: l('Mo'),
243
+ 2: l('Tu'),
244
+ 3: l('We'),
245
+ 4: l('Th'),
246
+ 5: l('Fr'),
247
+ 6: l('Sa'),
248
+ 7: l('Su')
239
249
  };
240
250
  return values[order];
241
251
  }, []);
@@ -308,16 +318,16 @@ const CalendarViews = /*#__PURE__*/React.forwardRef((props_, ref) => {
308
318
  size: "small",
309
319
  onClick: onToday,
310
320
  selected: now.days === date.days
311
- }, "Today"), /*#__PURE__*/React.createElement(Line, {
321
+ }, l('Today')), /*#__PURE__*/React.createElement(Line, {
312
322
  gap: 0,
313
323
  direction: "row",
314
324
  align: "center"
315
325
  }, /*#__PURE__*/React.createElement(Tooltip, {
316
- name: `Previous ${view}`
326
+ name: `${l('Previous')} ${view}`
317
327
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
318
328
  onClick: onPrevious
319
329
  }, iconButtonProps), /*#__PURE__*/React.createElement(IconPrevious, iconProps))), /*#__PURE__*/React.createElement(Tooltip, {
320
- name: `Next ${view}`
330
+ name: `${l('Next')} ${view}`
321
331
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
322
332
  onClick: onNext
323
333
  }, iconButtonProps), /*#__PURE__*/React.createElement(IconNext, iconProps)))), /*#__PURE__*/React.createElement(Type, {
@@ -331,7 +341,7 @@ const CalendarViews = /*#__PURE__*/React.forwardRef((props_, ref) => {
331
341
  flexNo: true,
332
342
  className: classNames([classes.aside, classes.overflowX])
333
343
  }, startRight, !noViews && /*#__PURE__*/React.createElement(Select, {
334
- name: "View",
344
+ name: l('View'),
335
345
  value: view,
336
346
  onChange: onChangeView,
337
347
  options: viewOptions,
@@ -272,6 +272,7 @@ const useStyle = styleMethod(theme => ({
272
272
  });
273
273
  const Chart = /*#__PURE__*/React.forwardRef((props_, ref) => {
274
274
  const theme = useOnesyTheme();
275
+ const l = theme.l;
275
276
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyChart?.props?.default), props_), [props_]);
276
277
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
277
278
  const Surface = React.useMemo(() => theme?.elements?.Surface || SurfaceElement, [theme]);
@@ -99,6 +99,7 @@ const useStyle = styleMethod(theme => ({
99
99
  });
100
100
  const ColorTextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
101
101
  const theme = useOnesyTheme();
102
+ const l = theme.l;
102
103
  const props = React.useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, theme?.ui?.elements?.all?.props?.default), theme?.ui?.elements?.onesyColorTextField?.props?.default), props_), [props_]);
103
104
  const Line = React.useMemo(() => theme?.elements?.Line || LineElement, [theme]);
104
105
  const TextField = React.useMemo(() => theme?.elements?.TextField || TextFieldElement, [theme]);
@@ -201,7 +202,7 @@ const ColorTextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
201
202
  fullWidth: true,
202
203
  className: classNames([className, classes.root])
203
204
  }, other), root, /*#__PURE__*/React.createElement(SliderInput, {
204
- name: "Opacity",
205
+ name: l('Opacity'),
205
206
  value: valueOpacity,
206
207
  onChange: onChangeOpacity,
207
208
  min: 0,