@synerise/ds-empty-states 1.0.47 → 1.0.49

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/CLAUDE.md +108 -0
  3. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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.0.49](https://github.com/Synerise/synerise-design/compare/@synerise/ds-empty-states@1.0.48...@synerise/ds-empty-states@1.0.49) (2026-07-23)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-empty-states
9
+
10
+ ## [1.0.48](https://github.com/Synerise/synerise-design/compare/@synerise/ds-empty-states@1.0.47...@synerise/ds-empty-states@1.0.48) (2026-06-17)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-empty-states
13
+
6
14
  ## [1.0.47](https://github.com/Synerise/synerise-design/compare/@synerise/ds-empty-states@1.0.46...@synerise/ds-empty-states@1.0.47) (2026-06-11)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-empty-states
package/CLAUDE.md ADDED
@@ -0,0 +1,108 @@
1
+ # EmptyStates (`@synerise/ds-empty-states`)
2
+
3
+ > Presentational component for empty-state UI: displays an optional icon, header text, label text, and action button in configurable layout orientations.
4
+
5
+ ## Package structure
6
+
7
+ ```
8
+ src/
9
+ EmptyStates.tsx — main component
10
+ EmptyStates.types.ts — EmptyStatesProps, EmptyStatesSize enum, IconSize/FontSize constants
11
+ EmptyStates.styles.tsx — styled-components
12
+ index.ts — public exports
13
+ __specs__/
14
+ EmptyStates.spec.tsx — Vitest tests
15
+ ```
16
+
17
+ ## Public exports
18
+
19
+ ### `EmptyStates` (default export)
20
+
21
+ | Prop | Type | Default | Description |
22
+ |------|------|---------|-------------|
23
+ | `size` | `EmptyStatesSize` | `EmptyStatesSize.SMALL` | Icon size — `'small'` = 48px, `'medium'` = 96px |
24
+ | `fontSize` | `EmptyStatesSize` | `undefined` | Header font size — `'small'` = 14px, `'medium'` = 18px. Falls back to 14px when omitted |
25
+ | `text` | `ReactNode` | `undefined` | Header / primary text |
26
+ | `label` | `ReactNode` | `undefined` | Secondary label text below the header |
27
+ | `button` | `ReactNode` | `undefined` | Action button rendered below label |
28
+ | `customIcon` | `ReactElement` | `undefined` | Icon element (passed to `@synerise/ds-icon` `Icon`) |
29
+ | `iconPosition` | `'top' \| 'left' \| 'right'` | `'top'` | Position of icon relative to content |
30
+ | `textAlign` | `'left' \| 'center' \| 'right' \| 'justify'` | `'center'` | Text alignment of content area |
31
+ | `mode` | `'absolute'` | `undefined` | When `'absolute'`, positions wrapper at `top:50%; left:50%` (see implementation notes) |
32
+ | `className` | `string` | `undefined` | Extra CSS class; merged with `'ds-empty-states'` |
33
+ | `labelPosition` | `'bottom' \| 'right'` | `undefined` | **@deprecated** — accepted but has no effect on rendering |
34
+
35
+ ### `EmptyStatesSize` (enum)
36
+
37
+ ```ts
38
+ enum EmptyStatesSize {
39
+ SMALL = 'small',
40
+ MEDIUM = 'medium',
41
+ }
42
+ ```
43
+
44
+ ### `IconSize` (constant)
45
+
46
+ ```ts
47
+ { small: 48, medium: 96 }
48
+ ```
49
+
50
+ Maps `EmptyStatesSize` to icon pixel sizes. Re-export of the same values used internally.
51
+
52
+ ### `FontSize` (constant)
53
+
54
+ ```ts
55
+ { small: 14, medium: 18 }
56
+ ```
57
+
58
+ Maps `EmptyStatesSize` to header font sizes in px.
59
+
60
+ ## Usage patterns
61
+
62
+ ```tsx
63
+ import EmptyStates, { EmptyStatesSize } from '@synerise/ds-empty-states';
64
+ import { NoResultsM } from '@synerise/ds-icon';
65
+
66
+ // Minimal
67
+ <EmptyStates text="No results found" />
68
+
69
+ // With icon, label and button
70
+ <EmptyStates
71
+ size={EmptyStatesSize.MEDIUM}
72
+ customIcon={<NoResultsM />}
73
+ text="No results"
74
+ label="Try adjusting your search filters."
75
+ button={<Button>Clear filters</Button>}
76
+ />
77
+
78
+ // Side-by-side layout
79
+ <EmptyStates
80
+ iconPosition="left"
81
+ customIcon={<NoResultsM />}
82
+ text="Nothing here yet"
83
+ textAlign="left"
84
+ />
85
+ ```
86
+
87
+ ## Styling
88
+
89
+ Styles in `EmptyStates.styles.tsx`. Uses `props.theme.palette['grey-800']` for header text colour (from `@synerise/ds-core`). No hardcoded hex values.
90
+
91
+ Layout is driven by `iconPosition`:
92
+ - `'top'` → `flex-direction: column; align-items: center`
93
+ - `'left'` → `flex-direction: row; gap: 16px; align-items: flex-start`
94
+ - `'right'` → `flex-direction: row-reverse; gap: 16px; align-items: flex-start`
95
+
96
+ `textAlign: 'justify'` maps `justify-content` to `'center'` (not `'justify'`) — this is a known inconsistency.
97
+
98
+ ## Key dependencies
99
+
100
+ - `@synerise/ds-icon` — wraps `customIcon` in an `<Icon size={px}>` element
101
+
102
+ ## Implementation notes
103
+
104
+ - `mode='absolute'` sets `position: absolute; top: 50%; left: 50%` but does **not** apply `transform: translate(-50%, -50%)` — the component will not be visually centred without additional CSS on the parent.
105
+ - `labelPosition` prop is fully ignored in the component render — it was deprecated and the layout logic was removed, but the prop is still accepted to avoid breaking changes.
106
+ - `mapSizeToPx` inside `EmptyStates.tsx` duplicates the exported `IconSize` constant — they are kept in sync manually.
107
+ - Tests use **Jest** (`jest.config.js`), not Vitest — not yet migrated.
108
+ - The header margin-top (`12px`) only applies when both `customIcon` is present **and** `size === EmptyStatesSize.SMALL`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-empty-states",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "EmptyStates 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,7 +42,7 @@
41
42
  ],
42
43
  "types": "dist/index.d.ts",
43
44
  "dependencies": {
44
- "@synerise/ds-icon": "^1.18.3"
45
+ "@synerise/ds-icon": "^1.18.5"
45
46
  },
46
47
  "peerDependencies": {
47
48
  "@synerise/ds-core": "*",
@@ -49,5 +50,5 @@
49
50
  "styled-components": "^5.3.3",
50
51
  "vitest": "4"
51
52
  },
52
- "gitHead": "fe3379f50afdce6d8c61a2222ebbf03324107c95"
53
+ "gitHead": "d0a43cc43d8528a36f105aceea52ab470edb71d9"
53
54
  }