@synerise/ds-divider 1.3.15 → 1.3.16

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,10 @@
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.3.16](https://github.com/Synerise/synerise-design/compare/@synerise/ds-divider@1.3.15...@synerise/ds-divider@1.3.16) (2026-07-23)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-divider
9
+
6
10
  ## [1.3.15](https://github.com/Synerise/synerise-design/compare/@synerise/ds-divider@1.3.14...@synerise/ds-divider@1.3.15) (2026-06-17)
7
11
 
8
12
  **Note:** Version bump only for package @synerise/ds-divider
package/CLAUDE.md ADDED
@@ -0,0 +1,89 @@
1
+ # Divider (`@synerise/ds-divider`)
2
+
3
+ > A visual separator that renders an SVG-based horizontal or vertical line, with optional uppercase text labels above and/or below it.
4
+
5
+ ## Package structure
6
+
7
+ ```
8
+ src/
9
+ Divider.tsx — main component (renders labels + Line)
10
+ Divider.types.ts — DividerProps interface, DividerType union
11
+ Divider.styles.ts — Label styled component (Title from ds-typography)
12
+ index.ts — public exports
13
+ components/
14
+ Line.tsx — SVG line element with accessibility role
15
+ Line.styles.tsx — styled wrapper with margin/orientation logic
16
+ Line.const.ts — SVG attribute presets for horizontal/vertical types
17
+ __specs__/
18
+ Divider.spec.tsx — render, label, and margin tests
19
+ ```
20
+
21
+ ## Public exports
22
+
23
+ ### `Divider` (default export)
24
+
25
+ Primary component. Accepts all native `HTMLDivElement` attributes via `WithHTMLAttributes` from `@synerise/ds-utils`.
26
+
27
+ | Prop | Type | Default | Description |
28
+ |------|------|---------|-------------|
29
+ | `type` | `'horizontal' \| 'vertical'` | `'horizontal'` | Orientation of the divider line |
30
+ | `dashed` | `boolean` | `false` | Renders line as dashed (`strokeDasharray="1 2"`) instead of solid |
31
+ | `hiddenLine` | `boolean` | `false` | Hides the SVG line; only labels are rendered |
32
+ | `labelAbove` | `ReactNode` | — | Text/node rendered above the line, styled as uppercase grey `Title` level 7 |
33
+ | `labelBelow` | `ReactNode` | — | Text/node rendered below the line, styled as uppercase grey `Title` level 7 |
34
+ | `marginTop` | `number` | `0` | Top margin of the line in px |
35
+ | `marginBottom` | `number` | `0` | Bottom margin of the line in px |
36
+ | `withSideMargin` | `boolean` | — | Adds `12px` left/right margin to horizontal dividers |
37
+ | `className` | `string` | — | Forwarded to the inner `Line` wrapper element |
38
+ | `style` | `React.CSSProperties` | — | Forwarded to the inner `Line` wrapper element |
39
+
40
+ No `forwardRef` — the component does not expose a DOM ref.
41
+
42
+ ### `DividerProps`
43
+
44
+ TypeScript interface re-exported for consumers that need to type props.
45
+
46
+ ## Usage patterns
47
+
48
+ ```tsx
49
+ import Divider from '@synerise/ds-divider';
50
+
51
+ // Horizontal solid line
52
+ <Divider marginTop={16} marginBottom={16} />
53
+
54
+ // Dashed with side margin
55
+ <Divider dashed withSideMargin />
56
+
57
+ // With labels
58
+ <Divider labelAbove="Section title" labelBelow="More info" withSideMargin />
59
+
60
+ // Vertical (inline)
61
+ <span>Left</span>
62
+ <Divider type="vertical" />
63
+ <span>Right</span>
64
+
65
+ // Line hidden — labels only
66
+ <Divider hiddenLine labelAbove="Category" />
67
+ ```
68
+
69
+ ## Styling
70
+
71
+ Styles are split between two files:
72
+ - `Divider.styles.ts` — `Label`: extends `Title` from `@synerise/ds-typography` with uppercase transform, `grey-500` colour, fixed height/margin.
73
+ - `Line.styles.tsx` — `Line` wrapper div: controls `display`, margins, width/height, and line colour (`grey-300` solid / `grey-400` dashed) via `@synerise/ds-core` theme tokens.
74
+
75
+ Vertical dividers switch to `display: inline-block` with `height: 0.9em` (relative to surrounding font size) and a fixed `8px` horizontal margin — these are not configurable via props.
76
+
77
+ ## Key dependencies
78
+
79
+ - `@synerise/ds-typography` — `Title` used for label rendering
80
+ - `@synerise/ds-utils` — `WithHTMLAttributes` utility type
81
+ - `@synerise/ds-core` — theme palette tokens consumed in styled-components
82
+
83
+ ## Implementation notes
84
+
85
+ - The line is rendered as an **SVG** (not `<hr>`). `vectorEffect="non-scaling-stroke"` keeps the stroke at exactly 2px regardless of SVG viewport scaling.
86
+ - CSS class names are added automatically to the line wrapper: `ds-divider-line`, `ds-divider-horizontal`/`ds-divider-vertical`, `ds-divider-solid`/`ds-divider-dashed`. These can be targeted in integration tests or for external overrides.
87
+ - `role="separator"` is applied to the `Line` wrapper for accessibility.
88
+ - `className` and `style` props are forwarded to the inner `Line` element, **not** to the outer React Fragment wrapper — `labelAbove`/`labelBelow` sit outside the classed element.
89
+ - Vertical divider height (`0.9em`) is hardcoded and inherits from the parent font size; there is no `height` prop.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-divider",
3
- "version": "1.3.15",
3
+ "version": "1.3.16",
4
4
  "description": "Divider UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -17,6 +17,7 @@
17
17
  "files": [
18
18
  "/dist",
19
19
  "CHANGELOG.md",
20
+ "CLAUDE.md",
20
21
  "README.md",
21
22
  "package.json",
22
23
  "LICENSE.md"
@@ -41,8 +42,8 @@
41
42
  ],
42
43
  "types": "dist/index.d.ts",
43
44
  "dependencies": {
44
- "@synerise/ds-typography": "^1.1.26",
45
- "@synerise/ds-utils": "^1.10.1"
45
+ "@synerise/ds-typography": "^1.1.27",
46
+ "@synerise/ds-utils": "^1.10.2"
46
47
  },
47
48
  "devDependencies": {
48
49
  "vitest": "4"
@@ -52,5 +53,5 @@
52
53
  "react": ">=16.9.0 <= 18.3.1",
53
54
  "styled-components": "^5.3.3"
54
55
  },
55
- "gitHead": "d8c64070f58f14e3fb1bfbcbf00d1e3b8fd51eb8"
56
+ "gitHead": "d0a43cc43d8528a36f105aceea52ab470edb71d9"
56
57
  }