@onesy/ui-react 1.0.30 → 1.0.32

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.
@@ -36,8 +36,7 @@ const useStyle = (0, style_react_1.style)(theme => ({
36
36
  width: '100%',
37
37
  flex: 'unset',
38
38
  '& .onesy-TextField-input': {
39
- flex: '1 1 auto',
40
- width: 'auto'
39
+ flex: '1 1 auto'
41
40
  }
42
41
  },
43
42
  wrapper: {
package/Slider/Slider.js CHANGED
@@ -335,6 +335,10 @@ const useStyle = (0, style_react_1.style)(theme => {
335
335
  }
336
336
  }
337
337
  },
338
+ tooltipLabelText: {
339
+ minWidth: '40px',
340
+ textAlign: 'center'
341
+ },
338
342
  disabled: {
339
343
  cursor: 'default',
340
344
  pointerEvents: 'none',
@@ -826,6 +830,8 @@ const Slider = react_1.default.forwardRef((props_, ref) => {
826
830
  classes[`tooltip_orientation_${orientation}`]
827
831
  ]), classNameSwitch: classes[`tooltip_switch_orientation_${orientation}_${theme.direction}`] }, ((tooltip === 'always') || (tooltip !== undefined && mouseDownButton === index) ? { open: true } : tooltip === undefined ? { open: false } : {}), { label: labelMethod(value__), position: orientation === 'horizontal' ? 'top' : theme.direction === 'ltr' ? 'left' : 'right', alignment: 'center', TransitionComponent: Zoom, transformOrigin: orientation === 'horizontal' ? 'center bottom' : 'center right', transformOriginSwitch: orientation === 'horizontal' ? 'center top' : 'center left', transformOriginRtl: orientation === 'horizontal' ? 'center bottom' : 'center left', transformOriginRtlSwitch: orientation === 'horizontal' ? 'center top' : 'center right', noMargin: true, LabelProps: {
828
832
  style: styles.label
833
+ }, LabelTextProps: {
834
+ className: classes.tooltipLabelText
829
835
  } }, TooltipProps, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ ref: item => refs.iconButtons.current.push(item), size: size, tonal: tonal, color: color, onBlur: onBlur, onFocus: () => {
830
836
  onFocus();
831
837
  onFocusButton(index);
@@ -41,6 +41,7 @@ export interface ITooltip extends Omit<IModal, 'maxWidth'> {
41
41
  AppendProps?: IPropsAny;
42
42
  ModalProps?: IPropsAny;
43
43
  LabelProps?: IPropsAny;
44
+ LabelTextProps?: IPropsAny;
44
45
  }
45
46
  declare const Tooltip: React.FC<ITooltip>;
46
47
  export default Tooltip;
@@ -152,9 +152,9 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
152
152
  const Append = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Append) || Append_1.default; }, [theme]);
153
153
  const Modal = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Modal) || Modal_1.default; }, [theme]);
154
154
  const Surface = react_1.default.useMemo(() => { var _a; return ((_a = theme === null || theme === void 0 ? void 0 : theme.elements) === null || _a === void 0 ? void 0 : _a.Surface) || Surface_1.default; }, [theme]);
155
- const { tonal = true, color = 'inverted', open: open_, openDefault, name, label: label_, parent, position = 'bottom', switch: switch_ = true, alignment = 'center', portal = true, fullWidth, maxWidth = 'unset', arrow, anchor: anchor_, anchorElement, noMargin, classNameSwitch, transformOrigin, transformOriginSwitch, transformOriginRtl, transformOriginRtlSwitch, click, touch: touch_, longPress: longPress_ = false, hover: hover_ = true, focus: focus_ = false, inset, nowrap, follow, interactive, onOpen: onOpen_, onClose: onClose_, onExited, TransitionComponent = Grow, TransitionComponentProps, AppendProps, ModalProps, LabelProps,
155
+ const { tonal = true, color = 'inverted', open: open_, openDefault, name, label: label_, parent, position = 'bottom', switch: switch_ = true, alignment = 'center', portal = true, fullWidth, maxWidth = 'unset', arrow, anchor: anchor_, anchorElement, noMargin, classNameSwitch, transformOrigin, transformOriginSwitch, transformOriginRtl, transformOriginRtlSwitch, click, touch: touch_, longPress: longPress_ = false, hover: hover_ = true, focus: focus_ = false, inset, nowrap, follow, interactive, onOpen: onOpen_, onClose: onClose_, onExited, TransitionComponent = Grow, TransitionComponentProps, AppendProps, ModalProps, LabelProps, LabelTextProps,
156
156
  // other
157
- elevation, className, style, children } = props, other = __rest(props, ["tonal", "color", "open", "openDefault", "name", "label", "parent", "position", "switch", "alignment", "portal", "fullWidth", "maxWidth", "arrow", "anchor", "anchorElement", "noMargin", "classNameSwitch", "transformOrigin", "transformOriginSwitch", "transformOriginRtl", "transformOriginRtlSwitch", "click", "touch", "longPress", "hover", "focus", "inset", "nowrap", "follow", "interactive", "onOpen", "onClose", "onExited", "TransitionComponent", "TransitionComponentProps", "AppendProps", "ModalProps", "LabelProps", "elevation", "className", "style", "children"]);
157
+ elevation, className, style, children } = props, other = __rest(props, ["tonal", "color", "open", "openDefault", "name", "label", "parent", "position", "switch", "alignment", "portal", "fullWidth", "maxWidth", "arrow", "anchor", "anchorElement", "noMargin", "classNameSwitch", "transformOrigin", "transformOriginSwitch", "transformOriginRtl", "transformOriginRtlSwitch", "click", "touch", "longPress", "hover", "focus", "inset", "nowrap", "follow", "interactive", "onOpen", "onClose", "onExited", "TransitionComponent", "TransitionComponentProps", "AppendProps", "ModalProps", "LabelProps", "LabelTextProps", "elevation", "className", "style", "children"]);
158
158
  const [init, setInit] = react_1.default.useState(false);
159
159
  const [open, setOpen] = react_1.default.useState(openDefault !== undefined ? openDefault : open_);
160
160
  const [hover, setHover] = react_1.default.useState(false);
@@ -416,10 +416,11 @@ const Tooltip = react_1.default.forwardRef((props_, ref) => {
416
416
  classes.arrow,
417
417
  classes[`arrow_position_${position}_alignment_${alignment}`]
418
418
  ]
419
- ]), style: Object.assign(Object.assign({}, styles.name), LabelProps === null || LabelProps === void 0 ? void 0 : LabelProps.style) }, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({ className: (0, style_react_1.classNames)([
419
+ ]), style: Object.assign(Object.assign({}, styles.name), LabelProps === null || LabelProps === void 0 ? void 0 : LabelProps.style) }, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({}, LabelTextProps, { className: (0, style_react_1.classNames)([
420
420
  (0, utils_2.staticClassName)('Tooltip', theme) && [
421
421
  'onesy-Tooltip-name-text'
422
422
  ],
423
+ LabelTextProps === null || LabelTextProps === void 0 ? void 0 : LabelTextProps.className
423
424
  ]) }, { children: label })) })) :
424
425
  react_1.default.cloneElement(label, {
425
426
  className: (0, style_react_1.classNames)([
@@ -25,8 +25,7 @@ const useStyle = styleMethod(theme => ({
25
25
  width: '100%',
26
26
  flex: 'unset',
27
27
  '& .onesy-TextField-input': {
28
- flex: '1 1 auto',
29
- width: 'auto'
28
+ flex: '1 1 auto'
30
29
  }
31
30
  },
32
31
  wrapper: {
@@ -412,6 +412,10 @@ const useStyle = styleMethod(theme => {
412
412
  }
413
413
  }
414
414
  },
415
+ tooltipLabelText: {
416
+ minWidth: '40px',
417
+ textAlign: 'center'
418
+ },
415
419
  disabled: {
416
420
  cursor: 'default',
417
421
  pointerEvents: 'none',
@@ -884,6 +888,9 @@ const Slider = /*#__PURE__*/React.forwardRef((props_, ref) => {
884
888
  noMargin: true,
885
889
  LabelProps: {
886
890
  style: styles.label
891
+ },
892
+ LabelTextProps: {
893
+ className: classes.tooltipLabelText
887
894
  }
888
895
  }, TooltipProps), /*#__PURE__*/React.createElement(IconButton, _extends({
889
896
  ref: item => refs.iconButtons.current.push(item),
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- const _excluded = ["tonal", "color", "open", "openDefault", "name", "label", "parent", "position", "switch", "alignment", "portal", "fullWidth", "maxWidth", "arrow", "anchor", "anchorElement", "noMargin", "classNameSwitch", "transformOrigin", "transformOriginSwitch", "transformOriginRtl", "transformOriginRtlSwitch", "click", "touch", "longPress", "hover", "focus", "inset", "nowrap", "follow", "interactive", "onOpen", "onClose", "onExited", "TransitionComponent", "TransitionComponentProps", "AppendProps", "ModalProps", "LabelProps", "elevation", "className", "style", "children"];
4
+ const _excluded = ["tonal", "color", "open", "openDefault", "name", "label", "parent", "position", "switch", "alignment", "portal", "fullWidth", "maxWidth", "arrow", "anchor", "anchorElement", "noMargin", "classNameSwitch", "transformOrigin", "transformOriginSwitch", "transformOriginRtl", "transformOriginRtlSwitch", "click", "touch", "longPress", "hover", "focus", "inset", "nowrap", "follow", "interactive", "onOpen", "onClose", "onExited", "TransitionComponent", "TransitionComponentProps", "AppendProps", "ModalProps", "LabelProps", "LabelTextProps", "elevation", "className", "style", "children"];
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';
@@ -215,6 +215,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
215
215
  AppendProps,
216
216
  ModalProps,
217
217
  LabelProps,
218
+ LabelTextProps,
218
219
  // other
219
220
  elevation,
220
221
  className,
@@ -435,9 +436,9 @@ const Tooltip = /*#__PURE__*/React.forwardRef((props_, ref) => {
435
436
  }, LabelProps, {
436
437
  className: classNames([staticClassName('Tooltip', theme) && ['onesy-Tooltip-name'], LabelProps?.className, classes.name, arrow && [classes.arrow, classes[`arrow_position_${position}_alignment_${alignment}`]]]),
437
438
  style: _objectSpread(_objectSpread({}, styles.name), LabelProps?.style)
438
- }), /*#__PURE__*/React.createElement("span", {
439
- className: classNames([staticClassName('Tooltip', theme) && ['onesy-Tooltip-name-text']])
440
- }, label)) : /*#__PURE__*/React.cloneElement(label, {
439
+ }), /*#__PURE__*/React.createElement("span", _extends({}, LabelTextProps, {
440
+ className: classNames([staticClassName('Tooltip', theme) && ['onesy-Tooltip-name-text'], LabelTextProps?.className])
441
+ }), label)) : /*#__PURE__*/React.cloneElement(label, {
441
442
  className: classNames([label?.props?.className, arrow && [classes.arrow, classes[`arrow_position_${position}_alignment_${alignment}`]]])
442
443
  }))));
443
444
  }
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.30
1
+ /** @license UiReact v1.0.32
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.30",
3
+ "version": "1.0.32",
4
4
  "description": "UI for React",
5
5
  "repository": "https://github.com/onesy-me/onesy.git",
6
6
  "author": "Lazar <lazareric2@gmail.com>",