@onesy/ui-react 1.0.151 → 1.0.153

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.
@@ -544,9 +544,6 @@ const CalendarMonth = /*#__PURE__*/_react.default.forwardRef((props__, ref) => {
544
544
  });
545
545
  }
546
546
  }
547
- const colorTheme = _react.default.useMemo(() => {
548
- return theme.palette.color[color] || theme.methods.color(color);
549
- }, [color, theme]);
550
547
  const colorSelectedTheme = _react.default.useMemo(() => {
551
548
  return theme.palette.color[colorSelected] || theme.methods.color(colorSelected);
552
549
  }, [colorSelected, theme]);
@@ -612,7 +609,7 @@ const CalendarMonth = /*#__PURE__*/_react.default.forwardRef((props__, ref) => {
612
609
  // between
613
610
  day.is.between && !day.is.same && [!day.is.end && day.dayWeek !== 0 && !day.is.monthEnd && classes.dayStartSelection, !day.is.start && day.dayWeek !== 1 && !day.is.monthStart && classes.dayEndSelection]]),
614
611
  style: {
615
- '--onesy-color': day.is.fromSelected ? colorSelectedTheme.main : colorTheme.main
612
+ '--onesy-color': day.is.fromSelected ? colorSelectedTheme === null || colorSelectedTheme === void 0 ? void 0 : colorSelectedTheme.main : palette === null || palette === void 0 ? void 0 : palette.main
616
613
  }
617
614
  }, (0, _utils.is)('function', renderDay) ? renderDay(day.onesyDate, propsDay, day, outside) : /*#__PURE__*/_react.default.createElement(PaginationItem, (0, _extends2.default)({
618
615
  tonal: tonal,
@@ -631,7 +628,7 @@ const CalendarMonth = /*#__PURE__*/_react.default.forwardRef((props__, ref) => {
631
628
  }, PaginationItemProps, {
632
629
  className: (0, _styleReact.classNames)([(0, _utils2.staticClassName)('CalendarMonth', theme) && ['onesy-CalendarMonth-day-value', day.in && 'onesy-CalendarMonth-day-in', day.dayWeek && 'onesy-CalendarMonth-day-day-week', day.weekend && 'onesy-CalendarMonth-day-weekend', day.today && 'onesy-CalendarMonth-day-today', day.is.between && 'onesy-CalendarMonth-day-between', day.is.selected && 'onesy-CalendarMonth-day-selected', day.is.start && 'onesy-CalendarMonth-day-start', day.is.end && 'onesy-CalendarMonth-day-end'], PaginationItemProps === null || PaginationItemProps === void 0 ? void 0 : PaginationItemProps.className, classes.dayValue, day.is.selected && classes.daySelected, classes[`day_size_${size}`]]),
633
630
  style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, day.today ? {
634
- boxShadow: `inset 0px 0px 0px 1px ${colorTheme[40]}`
631
+ boxShadow: `inset 0px 0px 0px 1px ${palette[40]}`
635
632
  } : undefined), day.is.selected && day.is.between && {
636
633
  color: `hsl(from var(--onesy-color) h s ${theme.palette.light ? 10 : 98})`,
637
634
  backgroundColor: `hsl(from var(--onesy-color) h s ${theme.palette.light ? propsDay.disabled ? 90 : 85 : propsDay.disabled ? 20 : 25})`
@@ -195,9 +195,6 @@ const Transition = props_ => {
195
195
  const add = async status_ => {
196
196
  if (!add_ || refs.status.current !== status_) return;
197
197
  updateStatus('add');
198
-
199
- // Reflow
200
- (0, _utils2.reflow)(refs.root.current);
201
198
  await delay('add');
202
199
 
203
200
  // Prevent update batches
@@ -212,9 +209,6 @@ const Transition = props_ => {
212
209
  var _refs$status$current;
213
210
  if (!enter_ || status_ !== 'appended' && (refs.status.current !== status_ || !refs.inProp.current)) return;
214
211
  updateStatus('enter');
215
-
216
- // Reflow
217
- (0, _utils2.reflow)(refs.root.current);
218
212
  await delay('enter');
219
213
 
220
214
  // Prevent update batches
@@ -227,9 +221,6 @@ const Transition = props_ => {
227
221
  var _refs$status$current2;
228
222
  if (!exit_ || refs.status.current !== status_ || refs.inProp.current) return;
229
223
  updateStatus('exit');
230
-
231
- // Reflow
232
- (0, _utils2.reflow)(refs.root.current);
233
224
  await delay('exit');
234
225
 
235
226
  // Prevent update batches
@@ -309,6 +300,9 @@ const Transition = props_ => {
309
300
  className_ = className_.replace(/ +/g, ' ').trim();
310
301
  if ((_refs$root$current$cl2 = refs.root.current.className) !== null && _refs$root$current$cl2 !== void 0 && _refs$root$current$cl2.baseVal) refs.root.current.className.baseVal = className_;else refs.root.current.className = className_;
311
302
  }
303
+
304
+ // reflow
305
+ (0, _utils2.reflow)(refs.root.current);
312
306
  };
313
307
  if (status === 'removed') return null;
314
308
  const value_ = {
@@ -43,9 +43,6 @@ const Transitions = props_ => {
43
43
  };
44
44
  refs.element.current = element;
45
45
  refs.status.current = status;
46
-
47
- // No transition controll
48
- // bug solve in nextjs
49
46
  _react.default.useEffect(() => {
50
47
  if (id !== undefined) {
51
48
  if (id !== refs.id.current) {
@@ -515,9 +515,6 @@ const CalendarMonth = /*#__PURE__*/React.forwardRef((props__, ref) => {
515
515
  });
516
516
  }
517
517
  }
518
- const colorTheme = React.useMemo(() => {
519
- return theme.palette.color[color] || theme.methods.color(color);
520
- }, [color, theme]);
521
518
  const colorSelectedTheme = React.useMemo(() => {
522
519
  return theme.palette.color[colorSelected] || theme.methods.color(colorSelected);
523
520
  }, [colorSelected, theme]);
@@ -582,7 +579,7 @@ const CalendarMonth = /*#__PURE__*/React.forwardRef((props__, ref) => {
582
579
  // between
583
580
  day.is.between && !day.is.same && [!day.is.end && day.dayWeek !== 0 && !day.is.monthEnd && classes.dayStartSelection, !day.is.start && day.dayWeek !== 1 && !day.is.monthStart && classes.dayEndSelection]]),
584
581
  style: {
585
- '--onesy-color': day.is.fromSelected ? colorSelectedTheme.main : colorTheme.main
582
+ '--onesy-color': day.is.fromSelected ? colorSelectedTheme?.main : palette?.main
586
583
  }
587
584
  }, is('function', renderDay) ? renderDay(day.onesyDate, propsDay, day, outside) : /*#__PURE__*/React.createElement(PaginationItem, _extends({
588
585
  tonal: tonal,
@@ -601,7 +598,7 @@ const CalendarMonth = /*#__PURE__*/React.forwardRef((props__, ref) => {
601
598
  }, PaginationItemProps, {
602
599
  className: classNames([staticClassName('CalendarMonth', theme) && ['onesy-CalendarMonth-day-value', day.in && 'onesy-CalendarMonth-day-in', day.dayWeek && 'onesy-CalendarMonth-day-day-week', day.weekend && 'onesy-CalendarMonth-day-weekend', day.today && 'onesy-CalendarMonth-day-today', day.is.between && 'onesy-CalendarMonth-day-between', day.is.selected && 'onesy-CalendarMonth-day-selected', day.is.start && 'onesy-CalendarMonth-day-start', day.is.end && 'onesy-CalendarMonth-day-end'], PaginationItemProps?.className, classes.dayValue, day.is.selected && classes.daySelected, classes[`day_size_${size}`]]),
603
600
  style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, day.today ? {
604
- boxShadow: `inset 0px 0px 0px 1px ${colorTheme[40]}`
601
+ boxShadow: `inset 0px 0px 0px 1px ${palette[40]}`
605
602
  } : undefined), day.is.selected && day.is.between && {
606
603
  color: `hsl(from var(--onesy-color) h s ${theme.palette.light ? 10 : 98})`,
607
604
  backgroundColor: `hsl(from var(--onesy-color) h s ${theme.palette.light ? propsDay.disabled ? 90 : 85 : propsDay.disabled ? 20 : 25})`
@@ -184,9 +184,6 @@ const Transition = props_ => {
184
184
  const add = async status_ => {
185
185
  if (!add_ || refs.status.current !== status_) return;
186
186
  updateStatus('add');
187
-
188
- // Reflow
189
- reflow(refs.root.current);
190
187
  await delay('add');
191
188
 
192
189
  // Prevent update batches
@@ -200,9 +197,6 @@ const Transition = props_ => {
200
197
  const enter = async status_ => {
201
198
  if (!enter_ || status_ !== 'appended' && (refs.status.current !== status_ || !refs.inProp.current)) return;
202
199
  updateStatus('enter');
203
-
204
- // Reflow
205
- reflow(refs.root.current);
206
200
  await delay('enter');
207
201
 
208
202
  // Prevent update batches
@@ -214,9 +208,6 @@ const Transition = props_ => {
214
208
  const exit = async status_ => {
215
209
  if (!exit_ || refs.status.current !== status_ || refs.inProp.current) return;
216
210
  updateStatus('exit');
217
-
218
- // Reflow
219
- reflow(refs.root.current);
220
211
  await delay('exit');
221
212
 
222
213
  // Prevent update batches
@@ -295,6 +286,9 @@ const Transition = props_ => {
295
286
  className_ = className_.replace(/ +/g, ' ').trim();
296
287
  if (refs.root.current.className?.baseVal) refs.root.current.className.baseVal = className_;else refs.root.current.className = className_;
297
288
  }
289
+
290
+ // reflow
291
+ reflow(refs.root.current);
298
292
  };
299
293
  if (status === 'removed') return null;
300
294
  const value_ = {
@@ -33,9 +33,6 @@ const Transitions = props_ => {
33
33
  };
34
34
  refs.element.current = element;
35
35
  refs.status.current = status;
36
-
37
- // No transition controll
38
- // bug solve in nextjs
39
36
  React.useEffect(() => {
40
37
  if (id !== undefined) {
41
38
  if (id !== refs.id.current) {
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.150
1
+ /** @license UiReact v1.0.152
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/esm/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { is, canvasFilterBrightness, canvasFilterContrast, canvasFilterSaturation, canvasFilterFade, canvasFilterInvert, canvasFilterOldPhoto, download, clamp, isEnvironment } from '@onesy/utils';
2
2
  export function reflow(element) {
3
- element?.offsetHeight;
3
+ return element?.offsetHeight;
4
4
  }
5
5
  export const staticClassName = (name, theme) => {
6
6
  return theme?.ui?.elements?.[`onesy-${name}`]?.className?.static !== undefined ? theme?.ui?.elements?.[`onesy-${name}`]?.className?.static : theme?.ui?.className.static;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.150
1
+ /** @license UiReact v1.0.152
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.151",
3
+ "version": "1.0.153",
4
4
  "description": "UI for React",
5
5
  "repository": "https://github.com/onesy-me/onesy.git",
6
6
  "author": "Lazar Erić <lazareric1@proton.me>",
package/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IPoint } from './types';
2
- export declare function reflow(element: HTMLElement): void;
2
+ export declare function reflow(element: HTMLElement): number;
3
3
  export declare const staticClassName: (name: string, theme: any) => any;
4
4
  export declare const iconSizeToFontSize: (value: string | number) => any;
5
5
  export declare const valueBreakpoints: (item: any, value: any, breakpoints: any, theme: any) => any;
package/utils.js CHANGED
@@ -8,7 +8,7 @@ exports.reflow = reflow;
8
8
  exports.valueBreakpoints = exports.toNumber = exports.staticClassName = exports.save = exports.sanitize = exports.replace = void 0;
9
9
  var _utils = require("@onesy/utils");
10
10
  function reflow(element) {
11
- element === null || element === void 0 || element.offsetHeight;
11
+ return element === null || element === void 0 ? void 0 : element.offsetHeight;
12
12
  }
13
13
  const staticClassName = (name, theme) => {
14
14
  var _theme$ui, _theme$ui2, _theme$ui3;