@synerise/ds-page-header 1.1.5 → 1.1.7

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 +140 -0
  3. package/package.json +8 -7
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.1.7](https://github.com/synerise/synerise-design/compare/@synerise/ds-page-header@1.1.6...@synerise/ds-page-header@1.1.7) (2026-07-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-page-header
9
+
10
+ ## [1.1.6](https://github.com/synerise/synerise-design/compare/@synerise/ds-page-header@1.1.5...@synerise/ds-page-header@1.1.6) (2026-07-23)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-page-header
13
+
6
14
  ## [1.1.5](https://github.com/synerise/synerise-design/compare/@synerise/ds-page-header@1.1.4...@synerise/ds-page-header@1.1.5) (2026-07-16)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-page-header
package/CLAUDE.md ADDED
@@ -0,0 +1,140 @@
1
+ # PageHeader (`@synerise/ds-page-header`)
2
+ > A full-width page-level header component providing title, navigation (back/close), inline editing, tooltip, avatar, tabs, and right-side action slots.
3
+
4
+ ## Package structure
5
+ ```
6
+ src/
7
+ PageHeader.tsx — root component, composes all sub-components
8
+ PageHeader.types.ts — PageHeaderProps type definition
9
+ PageHeader.styles.ts — MainContainer, PageHeaderContainer, and other styled primitives; re-exports sub-component styles for backwards compatibility
10
+ PageHeaderBack/
11
+ PageHeaderBack.tsx — ghost button with ArrowLeftM icon (or custom goBackIcon)
12
+ PageHeaderBack.styles.ts
13
+ index.ts
14
+ PageHeaderClamp/
15
+ PageHeaderClamp.tsx — title area with ellipsis clamping and optional Tooltip + icon
16
+ PageHeaderClamp.styles.ts
17
+ index.ts
18
+ PageHeaderInlineEdit/
19
+ PageHeaderInlineEdit.tsx — wraps @synerise/ds-inline-edit with the inlineEdit config object
20
+ PageHeaderInlineEdit.styles.ts
21
+ index.ts
22
+ PageHeaderRightSide/
23
+ PageHeaderRightSide.tsx — flex right slot for rightSide content + optional close (CloseM) button
24
+ PageHeaderRightSide.styles.ts
25
+ index.ts
26
+ __specs__/
27
+ PageHeader.spec.tsx — Vitest / React Testing Library unit tests
28
+ modules.d.ts — module declaration shim
29
+ index.ts — public exports
30
+ ```
31
+
32
+ ## Public exports
33
+ `index.ts` exports:
34
+ - `default` — `PageHeader` component (default export)
35
+ - `PageHeaderProps` — TypeScript type
36
+
37
+ ### `PageHeader`
38
+ | Prop | Type | Default | Description |
39
+ |------|------|---------|-------------|
40
+ | `className` | `string` | — | Additional CSS class on the root element |
41
+ | `title` | `ReactNode \| string` | — | Header title; rendered inside PageHeaderClamp with ellipsis overflow |
42
+ | `children` | `ReactNode` | — | Replaces `title` inside PageHeaderClamp when provided |
43
+ | `description` | `ReactNode \| string` | — | Secondary text rendered below the main row |
44
+ | `avatar` | `ReactNode` | — | Avatar slot rendered before the inline edit / clamp area |
45
+ | `more` | `ReactNode` | — | Slot rendered after the title clamp area (e.g. a dropdown trigger) |
46
+ | `rightSide` | `ReactNode` | — | Content rendered on the far right, before the optional close button |
47
+ | `tabs` | `ReactNode` | — | Rendered in a padded wrapper below the main row |
48
+ | `bar` | `ReactNode` | — | Rendered in a bordered section at the very bottom of the header |
49
+ | `onGoBack` | `() => void` | — | When provided, shows a back button (ArrowLeftM) at the left edge |
50
+ | `goBackIcon` | `ReactNode` | — | Custom icon component to replace the default ArrowLeftM in the back button |
51
+ | `onClose` | `() => void` | — | When provided, shows a close button (CloseM) at the right edge |
52
+ | `isolated` | `boolean` | — | Adds a `grey-100` bottom border overlay (visually separates content below) |
53
+ | `tooltip` | `TooltipProps` | — | Tooltip props spread onto `<Tooltip>` wrapping the `tooltipIcon` |
54
+ | `tooltipIcon` | `ReactNode` | — | Icon rendered inside the Tooltip; tooltip is only shown when **both** `tooltip` and `tooltipIcon` are provided |
55
+ | `handleTooltipClick` | `() => void` | — | Click handler wired to the tooltip icon |
56
+ | `inlineEdit` | `object` | — | When provided, renders an InlineEdit field; see sub-props below |
57
+
58
+ #### `inlineEdit` object shape
59
+ | Sub-prop | Type | Required | Description |
60
+ |----------|------|----------|-------------|
61
+ | `value` | `string \| number` | yes | Controlled input value |
62
+ | `size` | `'small' \| 'normal'` | yes | InlineEdit size |
63
+ | `handleOnChange` | `(event: ChangeEvent<HTMLInputElement>) => void` | yes | Change handler |
64
+ | `name` | `string` | no | Input name attribute |
65
+ | `maxLength` | `number` | no | Maximum character length |
66
+ | `handleOnBlur` | `FocusEventHandler<HTMLInputElement>` | no | Blur handler |
67
+ | `handleOnEnterPress` | `KeyboardEventHandler<HTMLInputElement>` | no | Enter key handler |
68
+ | `placeholder` | `string` | no | Placeholder text |
69
+ | `error` | `boolean` | no | Error state |
70
+ | `disabled` | `boolean` | no | Disabled state |
71
+ | `hideIcon` | `boolean` | no | Hide the edit icon |
72
+ | `customIcon` | `ReactNode` | no | Replace the default edit icon |
73
+ | `style` | `{ [key: string]: string \| number }` | no | Inline styles on the InlineEdit wrapper |
74
+
75
+ ## Usage patterns
76
+ ```tsx
77
+ import PageHeader from '@synerise/ds-page-header';
78
+
79
+ // Basic
80
+ <PageHeader title="My Page" />
81
+
82
+ // With back and close navigation
83
+ <PageHeader
84
+ title="My Page"
85
+ onGoBack={() => history.back()}
86
+ onClose={() => setOpen(false)}
87
+ />
88
+
89
+ // With inline editable title
90
+ <PageHeader
91
+ avatar={<ObjectAvatar .. />}
92
+ inlineEdit={{
93
+ value: name,
94
+ size: 'normal',
95
+ handleOnChange: (e) => setName(e.target.value),
96
+ placeholder: 'Enter name',
97
+ }}
98
+ rightSide={<Button type="primary">Save</Button>}
99
+ />
100
+
101
+ // With tooltip on title
102
+ <PageHeader
103
+ title="My Page"
104
+ tooltip={{ trigger: 'hover', title: 'Help text' }}
105
+ tooltipIcon={<HelpM />}
106
+ handleTooltipClick={() => {}}
107
+ />
108
+
109
+ // With tabs and bottom bar
110
+ <PageHeader
111
+ title="My Page"
112
+ tabs={<Tabs tabs={tabs} activeTab={0} handleTabClick={() => {}} />}
113
+ bar={<Button type="tertiary">Action</Button>}
114
+ />
115
+ ```
116
+
117
+ ## Styling
118
+ - Uses styled-components with theme tokens (`palette`, `variables`)
119
+ - `MainContainer` has a hardcoded `background-color: #fff` (not a token)
120
+ - Min height of the main row is `80px`; padding is `24px`
121
+ - `PageHeaderBack` renders a vertical divider via `::after` pseudo-element (`grey-300`, 40px tall)
122
+ - `PageHeaderRightSide` is `flex: 1 auto; justify-content: flex-end` — it grows to fill remaining horizontal space
123
+ - `PageHeaderClamp` uses `ds-typography`'s `macro.h600` mixin and truncates title text with `text-overflow: ellipsis`
124
+ - `PageHeader.styles.ts` re-exports styled components from sub-packages under their legacy names for backwards compatibility
125
+
126
+ ## Key dependencies
127
+ - `@synerise/ds-button` — back and close ghost buttons
128
+ - `@synerise/ds-icon` — ArrowLeftM (back), CloseM (close), and tooltip icon rendering
129
+ - `@synerise/ds-inline-edit` — inline editable title field
130
+ - `@synerise/ds-tooltip` — tooltip wrapping the tooltipIcon
131
+ - `@synerise/ds-typography` — `macro.h600` applied to the title clamp area
132
+ - `@synerise/ds-core` — `theme` palette constants used directly in sub-components
133
+
134
+ ## Implementation notes
135
+ - `children` takes precedence over `title` inside PageHeaderClamp — both target the same slot (`children || title`)
136
+ - `onGoBack` is rendered conditionally only when truthy; the back button is not shown at all otherwise
137
+ - The tooltip is **only rendered** when both `tooltip !== undefined` AND `tooltipIcon` is provided — passing only one has no visual effect
138
+ - `PageHeaderRightSide` picks `title`, `tooltipIcon`, and `handleTooltipClick` from `PageHeaderProps` in its type but does not actually use them in the render — they are vestigial in the type
139
+ - `isolated` affects a `::before` pseudo-element on `MainContainer`; it does not change the existing `border-bottom` or `box-shadow`
140
+ - Tests use Jest (not Vitest) — see `jest.config.js`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-page-header",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Page-Header 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,11 +42,11 @@
41
42
  ],
42
43
  "types": "dist/index.d.ts",
43
44
  "dependencies": {
44
- "@synerise/ds-button": "^1.5.34",
45
- "@synerise/ds-icon": "^1.18.4",
46
- "@synerise/ds-inline-edit": "^1.1.47",
47
- "@synerise/ds-tooltip": "^1.5.3",
48
- "@synerise/ds-typography": "^1.1.26"
45
+ "@synerise/ds-button": "^1.5.35",
46
+ "@synerise/ds-icon": "^1.18.5",
47
+ "@synerise/ds-inline-edit": "^1.1.49",
48
+ "@synerise/ds-tooltip": "^1.5.4",
49
+ "@synerise/ds-typography": "^1.1.27"
49
50
  },
50
51
  "peerDependencies": {
51
52
  "@synerise/ds-core": "*",
@@ -54,5 +55,5 @@
54
55
  "styled-components": "^5.3.3",
55
56
  "vitest": "4"
56
57
  },
57
- "gitHead": "a81ab6519d49a3dea9c0cfebcdc9104cbb4f4226"
58
+ "gitHead": "018414e0d7ffd102a07f8aa35fa2e2d3d4ed19e2"
58
59
  }