@synerise/ds-divider 1.1.1 → 1.1.3

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-divider@1.1.2...@synerise/ds-divider@1.1.3) (2025-09-30)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-divider
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.1.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-divider@1.1.1...@synerise/ds-divider@1.1.2) (2025-09-30)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **divider:** fix style ([7a1db45](https://github.com/Synerise/synerise-design/commit/7a1db453d85eb52f887486f74575de17bb3f8ee0))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [1.1.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-divider@1.1.0...@synerise/ds-divider@1.1.1) (2025-09-26)
7
26
 
8
27
 
@@ -0,0 +1,6 @@
1
+ import { type SVGAttributes } from 'react';
2
+ import { type DividerType } from '../Divider.types';
3
+ export declare const SVG_PROPS: Record<DividerType, {
4
+ svgAttributes: SVGAttributes<SVGElement>;
5
+ lineAttributes: SVGAttributes<SVGLineElement>;
6
+ }>;
@@ -0,0 +1,26 @@
1
+ export var SVG_PROPS = {
2
+ horizontal: {
3
+ svgAttributes: {
4
+ viewBox: '0 0 1 1',
5
+ width: '100%'
6
+ },
7
+ lineAttributes: {
8
+ x1: '0',
9
+ y1: '0',
10
+ x2: '1',
11
+ y2: '0'
12
+ }
13
+ },
14
+ vertical: {
15
+ svgAttributes: {
16
+ viewBox: '0 0 1 1',
17
+ height: '100%'
18
+ },
19
+ lineAttributes: {
20
+ x1: '0',
21
+ y1: '0',
22
+ x2: '0',
23
+ y2: '1'
24
+ }
25
+ }
26
+ };
@@ -2,6 +2,7 @@ var _excluded = ["marginBottom", "marginTop", "type", "dashed", "className"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
4
  import React from 'react';
5
+ import { SVG_PROPS } from './Line.const';
5
6
  import * as S from './Line.styles';
6
7
  export var Line = function Line(_ref) {
7
8
  var marginBottom = _ref.marginBottom,
@@ -11,6 +12,7 @@ export var Line = function Line(_ref) {
11
12
  dashed = _ref.dashed,
12
13
  className = _ref.className,
13
14
  htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
15
+ var svgProps = SVG_PROPS[type];
14
16
  return /*#__PURE__*/React.createElement(S.Line, _extends({
15
17
  className: "ds-divider-line ds-divider-" + type + " ds-divider-" + (dashed ? 'dashed' : 'solid') + " " + className,
16
18
  role: "separator",
@@ -18,5 +20,12 @@ export var Line = function Line(_ref) {
18
20
  marginBottom: marginBottom,
19
21
  type: type,
20
22
  dashed: dashed
21
- }, htmlAttributes));
23
+ }, htmlAttributes), /*#__PURE__*/React.createElement("svg", _extends({}, svgProps.svgAttributes, {
24
+ preserveAspectRatio: "none"
25
+ }), /*#__PURE__*/React.createElement("line", _extends({}, svgProps.lineAttributes, {
26
+ strokeWidth: 2,
27
+ vectorEffect: "non-scaling-stroke",
28
+ stroke: "currentColor",
29
+ "stroke-dasharray": "" + (dashed ? '1 2' : '')
30
+ }))));
22
31
  };
@@ -1,14 +1,8 @@
1
1
  import styled from 'styled-components';
2
- var getDashed = function getDashed(dashed, theme) {
3
- if (dashed) {
4
- return "1px dashed " + theme.palette['grey-400'] + ";";
5
- }
6
- return "1px solid " + theme.palette['grey-300'];
7
- };
8
2
  export var Line = styled.div.withConfig({
9
3
  displayName: "Linestyles__Line",
10
4
  componentId: "sc-1fokvnj-0"
11
- })(["display:", ";vertical-align:", ";margin:", ";margin-bottom:", "px;margin-top:", "px;width:", ";height:", ";", ";", ";"], function (props) {
5
+ })(["display:", ";vertical-align:", ";margin:", ";margin-bottom:", "px;margin-top:", "px;width:", ";height:", ";color:", ";"], function (props) {
12
6
  return props.type === 'vertical' ? 'inline-block' : 'flex';
13
7
  }, function (props) {
14
8
  return props.type === 'vertical' ? 'middle' : undefined;
@@ -19,11 +13,9 @@ export var Line = styled.div.withConfig({
19
13
  }, function (props) {
20
14
  return props.marginTop;
21
15
  }, function (props) {
22
- return props.type === 'horizontal' ? '100%' : '0';
16
+ return props.type === 'horizontal' ? '100%' : '1px';
23
17
  }, function (props) {
24
- return props.type === 'vertical' ? '0.9em' : '0';
18
+ return props.type === 'vertical' ? '0.9em' : '1px';
25
19
  }, function (props) {
26
- return props.type === 'horizontal' && "border-bottom: " + getDashed(props.dashed, props.theme);
27
- }, function (props) {
28
- return props.type === 'vertical' && "border-left: " + getDashed(props.dashed, props.theme);
20
+ return props.dashed ? props.theme.palette['grey-400'] : props.theme.palette['grey-300'];
29
21
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-divider",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Divider UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -35,12 +35,13 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-typography": "^1.0.21"
38
+ "@synerise/ds-typography": "^1.0.21",
39
+ "@synerise/ds-utils": "^1.4.2"
39
40
  },
40
41
  "peerDependencies": {
41
42
  "@synerise/ds-core": "*",
42
43
  "react": ">=16.9.0 <= 18.3.1",
43
44
  "styled-components": "^5.3.3"
44
45
  },
45
- "gitHead": "25221abb694880c2416ceb5f7598a5c7329f3379"
46
+ "gitHead": "a89d4a4d780cd537376fbc58a58ed572fdad925b"
46
47
  }