@canlooks/can-ui 0.0.9 → 0.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.
@@ -5,16 +5,12 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const divider_style_1 = require("./divider.style");
7
7
  const utils_1 = require("../../utils");
8
- const app_1 = require("../app");
9
8
  exports.Divider = (0, react_1.memo)((0, react_1.forwardRef)(({ textAlign = 'center', alignMargin = 36, orientation = 'horizontal', margin, ...props }, ref) => {
10
- const { spacing } = (0, app_1.useTheme)();
11
- margin ??= orientation === 'horizontal' ? spacing[5] : spacing[4];
12
- if (typeof margin === 'number') {
13
- margin += 'px';
14
- }
15
9
  const styleProp = orientation === 'horizontal' ? 'width' : 'height';
16
10
  return ((0, jsx_runtime_1.jsxs)("div", { ...props, ref: ref, css: divider_style_1.style, className: (0, utils_1.classnames)(divider_style_1.classes.root, props.className), style: {
17
- margin: orientation === 'horizontal' ? `${margin} 0` : `0 ${margin}`,
11
+ margin: typeof margin === 'number'
12
+ ? orientation === 'horizontal' ? `${margin}px 0` : `0 ${margin}px`
13
+ : margin,
18
14
  ...props.style
19
15
  }, "data-orientation": orientation, children: [(0, jsx_runtime_1.jsx)("div", { className: `${divider_style_1.classes.line} ${divider_style_1.classes.beforeLine}`, style: {
20
16
  flex: !props.children || textAlign !== 'start' ? 1 : void 0,
@@ -2,16 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  import { forwardRef, memo } from 'react';
3
3
  import { classes, style } from './divider.style';
4
4
  import { classnames } from '../../utils';
5
- import { useTheme } from '../app';
6
5
  export const Divider = memo(forwardRef(({ textAlign = 'center', alignMargin = 36, orientation = 'horizontal', margin, ...props }, ref) => {
7
- const { spacing } = useTheme();
8
- margin ??= orientation === 'horizontal' ? spacing[5] : spacing[4];
9
- if (typeof margin === 'number') {
10
- margin += 'px';
11
- }
12
6
  const styleProp = orientation === 'horizontal' ? 'width' : 'height';
13
7
  return (_jsxs("div", { ...props, ref: ref, css: style, className: classnames(classes.root, props.className), style: {
14
- margin: orientation === 'horizontal' ? `${margin} 0` : `0 ${margin}`,
8
+ margin: typeof margin === 'number'
9
+ ? orientation === 'horizontal' ? `${margin}px 0` : `0 ${margin}px`
10
+ : margin,
15
11
  ...props.style
16
12
  }, "data-orientation": orientation, children: [_jsx("div", { className: `${classes.line} ${classes.beforeLine}`, style: {
17
13
  flex: !props.children || textAlign !== 'start' ? 1 : void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canlooks/can-ui",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "author": "C.CanLiang <canlooks@gmail.com>",
5
5
  "description": "My ui framework",
6
6
  "license": "MIT",