@onesy/ui-react 1.0.8 → 1.0.10

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.
@@ -162,7 +162,7 @@ const Divider = react_1.default.forwardRef((props_, ref) => {
162
162
  padding && classes[`orientation_${orientation}_padding`],
163
163
  color === 'inherit' && classes.color_inherit,
164
164
  tonal && classes.divider_tonal
165
- ]), style: Object.assign(Object.assign({}, style), styles.root) }, other, { children: children && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Surface, { version: 'filled', tonal: tonal, color: color, className: (0, style_react_1.classNames)([
165
+ ]), style: Object.assign(Object.assign({ opacity }, style), styles.root) }, other, { children: children && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Surface, { version: 'filled', tonal: tonal, color: color, className: (0, style_react_1.classNames)([
166
166
  (0, utils_1.staticClassName)('Divider', theme) && [
167
167
  'onesy-Divider-divider'
168
168
  ],
@@ -26,16 +26,13 @@ const Rating_1 = __importDefault(require("../Rating"));
26
26
  const utils_2 = require("../utils");
27
27
  const useStyle = (0, style_react_1.style)(theme => ({
28
28
  root: {
29
- overflow: 'hidden'
30
- },
31
- reviews: {
32
- overflowX: 'auto',
33
- padding: '0px 4px 12px',
34
- maxWidth: '100%'
29
+ overflow: 'auto hidden',
30
+ padding: '0px 16px 24px',
35
31
  },
32
+ reviews: {},
36
33
  review: {
37
- flex: '0 0 auto',
38
- background: theme.palette.background.primary.secondary
34
+ background: theme.palette.background.primary.secondary,
35
+ boxShadow: '0px 4px 32px 0px rgba(0, 0, 0, 0.024)'
39
36
  },
40
37
  review_size_small: {
41
38
  width: '240px',
@@ -74,14 +71,14 @@ const Element = react_1.default.forwardRef((props_, ref) => {
74
71
  ref.current = item;
75
72
  }
76
73
  refs.root.current = item;
77
- }, align: 'center', className: (0, style_react_1.classNames)([
74
+ }, align: 'flex-start', fullWidth: true, className: (0, style_react_1.classNames)([
78
75
  (0, utils_2.staticClassName)('SectionReviews', theme) && [
79
76
  'onesy-SectionReviews-root',
80
77
  `onesy-SectionReviews-size-${size}`
81
78
  ],
82
79
  className,
83
80
  classes.root
84
- ]) }, other, { children: (0, jsx_runtime_1.jsx)(Line, Object.assign({ gap: 2, direction: 'row', align: 'flex-start', fullWidth: true }, ReviewsProps, { className: (0, style_react_1.classNames)([
81
+ ]) }, other, { children: (0, jsx_runtime_1.jsx)(Line, Object.assign({ gap: 2, direction: 'row', justify: 'center', align: 'flex-start' }, ReviewsProps, { className: (0, style_react_1.classNames)([
85
82
  (0, utils_2.staticClassName)('SectionReviews', theme) && [
86
83
  'onesy-SectionReviews-reviews'
87
84
  ],
@@ -89,7 +86,7 @@ const Element = react_1.default.forwardRef((props_, ref) => {
89
86
  classes.reviews
90
87
  ]) }, { children: values.filter(Boolean).map((item, index) => {
91
88
  var _a, _b, _c;
92
- return ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.4, direction: 'column' }, ReviewProps, { className: (0, style_react_1.classNames)([
89
+ return ((0, jsx_runtime_1.jsxs)(Line, Object.assign({ gap: 1.4, direction: 'column', flexNo: true }, ReviewProps, { className: (0, style_react_1.classNames)([
93
90
  (0, utils_2.staticClassName)('SectionReviews', theme) && [
94
91
  'onesy-SectionReviews-review'
95
92
  ],
@@ -16,7 +16,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  const jsx_runtime_1 = require("react/jsx-runtime");
18
18
  const react_1 = __importDefault(require("react"));
19
- const react_router_dom_1 = require("react-router-dom");
20
19
  const utils_1 = require("@onesy/utils");
21
20
  const style_react_1 = require("@onesy/style-react");
22
21
  const Text_1 = __importDefault(require("../Text"));
@@ -58,7 +57,6 @@ const SectionTextMedia = react_1.default.forwardRef((props_, ref) => {
58
57
  let mediaElement;
59
58
  const mediaProps = Object.assign({ size, themed: true, color: 'primary' }, MediaProps);
60
59
  const mime = (media === null || media === void 0 ? void 0 : media.mime) || '';
61
- const navigate = (0, utils_1.isEnvironment)('browser') && (0, react_router_dom_1.useNavigate)();
62
60
  if (mime.includes('image')) {
63
61
  mediaElement = ((0, jsx_runtime_1.jsx)(Image, Object.assign({ src: (media === null || media === void 0 ? void 0 : media.url) || (media === null || media === void 0 ? void 0 : media.urlSmall) || ((0, utils_1.is)('string', media) ? media : '') }, mediaProps, MediaProps, ImageProps, { className: (0, style_react_1.classNames)([
64
62
  (0, utils_2.staticClassName)('SectionTextMedia', theme) && [
@@ -111,7 +109,7 @@ const SectionTextMedia = react_1.default.forwardRef((props_, ref) => {
111
109
  'onesy-SectionTextMedia-description'
112
110
  ],
113
111
  DescriptionProps === null || DescriptionProps === void 0 ? void 0 : DescriptionProps.className
114
- ]) })))] })), button && ((0, jsx_runtime_1.jsx)(Button, Object.assign({ tonal: true, version: 'filled', color: 'primary', size: size, onClick: (button.to || button.link) ? () => button.to ? navigate(button.to) : window.open(button.link, 'blank') : undefined }, button.props, { className: (0, style_react_1.classNames)([
112
+ ]) })))] })), button && ((0, jsx_runtime_1.jsx)(Button, Object.assign({ tonal: true, version: 'filled', color: 'primary', size: size, onClick: (button.to || button.link) && window.open(button.to || button.link, 'blank') }, button.props, { className: (0, style_react_1.classNames)([
115
113
  (0, utils_2.staticClassName)('SectionAction', theme) && [
116
114
  'onesy-SectionTextMedia-button'
117
115
  ],
@@ -161,7 +161,9 @@ const Divider = /*#__PURE__*/React.forwardRef((props_, ref) => {
161
161
  color: color,
162
162
  Component: Component,
163
163
  className: classNames([staticClassName('Divider', theme) && ['onesy-Divider-root'], className, classes[children ? 'rootWithChildren' : 'root'], classes[`${children ? 'rootWithChildren_' : ''}orientation_${orientation}`], flex && classes[`flex_orientation_${orientation}`], inset && classes.inset, middle && classes[`${children ? `rootWithChildren_` : ''}orientation_${orientation}_middle`], padding && classes[`orientation_${orientation}_padding`], color === 'inherit' && classes.color_inherit, tonal && classes.divider_tonal]),
164
- style: _objectSpread(_objectSpread({}, style), styles.root)
164
+ style: _objectSpread(_objectSpread({
165
+ opacity
166
+ }, style), styles.root)
165
167
  }, other), children && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Surface, {
166
168
  version: "filled",
167
169
  tonal: tonal,
@@ -15,16 +15,13 @@ import RatingElement from '../Rating';
15
15
  import { staticClassName } from '../utils';
16
16
  const useStyle = styleMethod(theme => ({
17
17
  root: {
18
- overflow: 'hidden'
19
- },
20
- reviews: {
21
- overflowX: 'auto',
22
- padding: '0px 4px 12px',
23
- maxWidth: '100%'
18
+ overflow: 'auto hidden',
19
+ padding: '0px 16px 24px'
24
20
  },
21
+ reviews: {},
25
22
  review: {
26
- flex: '0 0 auto',
27
- background: theme.palette.background.primary.secondary
23
+ background: theme.palette.background.primary.secondary,
24
+ boxShadow: '0px 4px 32px 0px rgba(0, 0, 0, 0.024)'
28
25
  },
29
26
  review_size_small: {
30
27
  width: '240px',
@@ -79,19 +76,21 @@ const Element = /*#__PURE__*/React.forwardRef((props_, ref) => {
79
76
  }
80
77
  refs.root.current = item;
81
78
  },
82
- align: "center",
79
+ align: "flex-start",
80
+ fullWidth: true,
83
81
  className: classNames([staticClassName('SectionReviews', theme) && ['onesy-SectionReviews-root', `onesy-SectionReviews-size-${size}`], className, classes.root])
84
82
  }, other), /*#__PURE__*/React.createElement(Line, _extends({
85
83
  gap: 2,
86
84
  direction: "row",
87
- align: "flex-start",
88
- fullWidth: true
85
+ justify: "center",
86
+ align: "flex-start"
89
87
  }, ReviewsProps, {
90
88
  className: classNames([staticClassName('SectionReviews', theme) && ['onesy-SectionReviews-reviews'], ReviewsProps?.className, classes.reviews])
91
89
  }), values.filter(Boolean).map((item, index) => /*#__PURE__*/React.createElement(Line, _extends({
92
90
  key: index,
93
91
  gap: 1.4,
94
- direction: "column"
92
+ direction: "column",
93
+ flexNo: true
95
94
  }, ReviewProps, {
96
95
  className: classNames([staticClassName('SectionReviews', theme) && ['onesy-SectionReviews-review'], ReviewProps?.className, classes.review, classes[`review_size_${size}`]])
97
96
  }), /*#__PURE__*/React.createElement(Line, {
@@ -5,8 +5,7 @@ const _excluded = ["size", "title", "description", "button", "mediaPosition", "m
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 { useNavigate } from 'react-router-dom';
9
- import { is, isEnvironment, textToInnerHTML } from '@onesy/utils';
8
+ import { is, textToInnerHTML } from '@onesy/utils';
10
9
  import { classNames, style as styleMethod, useOnesyTheme } from '@onesy/style-react';
11
10
  import TextElement from '../Text';
12
11
  import ImageElement from '../Image';
@@ -74,7 +73,6 @@ const SectionTextMedia = /*#__PURE__*/React.forwardRef((props_, ref) => {
74
73
  color: 'primary'
75
74
  }, MediaProps);
76
75
  const mime = media?.mime || '';
77
- const navigate = isEnvironment('browser') && useNavigate();
78
76
  if (mime.includes('image')) {
79
77
  mediaElement = /*#__PURE__*/React.createElement(Image, _extends({
80
78
  src: media?.url || media?.urlSmall || (is('string', media) ? media : '')
@@ -128,7 +126,7 @@ const SectionTextMedia = /*#__PURE__*/React.forwardRef((props_, ref) => {
128
126
  version: "filled",
129
127
  color: "primary",
130
128
  size: size,
131
- onClick: button.to || button.link ? () => button.to ? navigate(button.to) : window.open(button.link, 'blank') : undefined
129
+ onClick: (button.to || button.link) && window.open(button.to || button.link, 'blank')
132
130
  }, button.props, {
133
131
  className: classNames([staticClassName('SectionAction', theme) && ['onesy-SectionTextMedia-button'], button.props?.className, classes.button])
134
132
  }), button.text || 'Click here'));
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license UiReact v1.0.8
1
+ /** @license UiReact v1.0.10
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.8",
3
+ "version": "1.0.10",
4
4
  "description": "UI for React",
5
5
  "repository": "https://github.com/onesy-org/onesy.git",
6
6
  "author": "Lazar <lazareric2@gmail.com>",