hisd3-ui-kit 4.0.0 → 4.1.0

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/README.md CHANGED
@@ -33,9 +33,16 @@ import { HISD3Provider } from "hisd3-ui-kit";
33
33
  `HISD3Provider` sets up antd's `ConfigProvider` (CSS variables on, so every kit
34
34
  component and every plain antd component follows the chosen primary), antd
35
35
  `App` (themed `modal.confirm` / `message`), and the styled-components
36
- `ThemeProvider`. Options: `primary`, `radius` (default 0), `lineWidth`
37
- (default 2), `overrides` (extra antd `ThemeConfig`), or `theme` to bypass the
38
- generator entirely.
36
+ `ThemeProvider`. Options: `primary`, `borders` (`"hairline"` default, or
37
+ `"bold"` for the original 2px near-black rules), `radius` (default 0),
38
+ `lineWidth` (overrides the `borders` preset), `overrides` (extra antd
39
+ `ThemeConfig`), or `theme` to bypass the generator entirely.
40
+
41
+ Borders are hairline by default — 1px warm grey (`#D9D5CE` structural,
42
+ `#E7E4DE` row rules), with near-black kept for type and for control hover
43
+ states. Every kit component follows `--hisd3-rule-width`, so switching
44
+ `borders="bold"` retunes the sidebar, header, table, tabs, pagination, inputs
45
+ and buttons together.
39
46
 
40
47
  Need just the antd theme object (e.g. for Storybook)? `createHisd3Theme({ primary: "teal" })`.
41
48
 
@@ -44,7 +51,7 @@ Need just the antd theme object (e.g. for Storybook)? `createHisd3Theme({ primar
44
51
  ```tsx
45
52
  import {
46
53
  HISD3Sidebar, HISD3PageHeader, HISD3PageBody, HISD3SearchInput, HISD3Tabs,
47
- HISD3Table, HISD3Tag, HISD3Button,
54
+ HISD3Table, HISD3Tag, HISD3Button, HISD3HeaderActions, HISD3NotificationButton, HISD3AvatarMenu,
48
55
  } from "hisd3-ui-kit";
49
56
 
50
57
  const menuItems = [
@@ -66,6 +73,7 @@ const menuItems = [
66
73
  onLogout={logout}
67
74
  bareContent // let HISD3PageHeader own the gutters
68
75
  hideHeaderBar // HISD3PageHeader renders the top bar
76
+ hideAccountCard // account lives in the header instead (HISD3AvatarMenu)
69
77
  >
70
78
  <HISD3PageHeader
71
79
  title="Billing Folios"
@@ -74,6 +82,14 @@ const menuItems = [
74
82
  extra={<>
75
83
  <HISD3Button icon={<ReloadOutlined />}>Refresh</HISD3Button>
76
84
  <HISD3Button variant="primary" icon={<PlusOutlined />}>New folio</HISD3Button>
85
+ <HISD3HeaderActions divided>
86
+ <HISD3NotificationButton
87
+ items={notifications}
88
+ onMarkAllRead={markAllRead}
89
+ onSeeAll={() => router.push("/notifications")}
90
+ />
91
+ <HISD3AvatarMenu account={currentUser} avatarSrc={currentUser.photoUrl} onLogout={logout} />
92
+ </HISD3HeaderActions>
77
93
  </>}
78
94
  />
79
95
  <HISD3PageBody>
@@ -101,10 +117,14 @@ const menuItems = [
101
117
  | `HISD3Tag` | Uppercase status pill. `variant`: `neutral` (grey, e.g. ACTIVE / IN PATIENT), `soft` (primary tint, e.g. ER PATIENT), `outline` (2px primary border, e.g. OUT PATIENT), `solid`. `tone`: `primary` \| `success` \| `warning` \| `danger` \| `default`. |
102
118
  | `HISD3Button` | `variant`: `primary` (filled), `secondary` (default, dark 2px outline), `ghost`, `danger`. Accepts all antd `Button` props (`icon`, `size`, `loading`, …). |
103
119
  | `HISD3Input` / `HISD3SearchInput` | 2px-bordered input; the search variant is the grey filled hero field with a leading icon (`compact` for a 48px version). |
104
- | `UserMenu` | The account dropdown on its own. |
120
+ | `HISD3HeaderActions` | Spacing wrapper for the top-right controls; `divided` inserts a rule before the last child. |
121
+ | `HISD3NotificationButton` | Soft-grey circular bell button (Facebook-style) with an unread badge; tints to the primary color while its panel is open. Props: `items` (`{ id, title, description, time, unread, avatarSrc, icon, onClick }`), `count` (defaults to the unread tally), `loading`, `size` (default 40), `onMarkAllRead`, `onSeeAll`, `emptyText`. |
122
+ | `HISD3AvatarMenu` | Circular avatar button with a small chevron badge (Facebook-style); clicking it opens a menu with the signed-in identity plus Settings and Logout (confirm dialog by default). Falls back to initials on a grey circle when there is no photo. Props: `account`, `avatarSrc`, `settingsUrl` / `onSettings`, `onLogout`, `confirmLogout`, `extraItems`, `shape` (`circle` \| `square`), `size` (default 40), `hideChevron`. |
123
+ | `UserMenu` | The sidebar-footer account card, on its own. |
105
124
 
106
125
  Theme utilities: `createHisd3Theme`, `hisd3AntdTheme` (red default),
107
- `HISD3_PRESETS`, `HISD3_NEUTRALS`, `HISD3_FONT_FAMILY`,
126
+ `HISD3_PRESETS`, `HISD3_NEUTRALS`, `HISD3_BORDER_PRESETS`, `borderVarsCss`,
127
+ `HISD3_FONT_FAMILY`,
108
128
  `HISD3_FONT_WEIGHT_HEADING` (800) / `HISD3_FONT_WEIGHT_BODY` (400), `HISD3_LAYOUT`,
109
129
  `resolvePrimary`, `tint`. Plain antd components (Form, Select, DatePicker,
110
130
  Modal, …) inherit the same tokens automatically, so use them freely alongside
@@ -119,7 +139,10 @@ Inside styled-components or CSS you can rely on antd's variables:
119
139
  `var(--ant-color-primary)`, `var(--ant-color-primary-bg)`,
120
140
  `var(--ant-color-border)`, `var(--ant-color-border-secondary)`,
121
141
  `var(--ant-color-text)`, `var(--ant-color-text-tertiary)`,
122
- `var(--ant-color-bg-layout)`.
142
+ `var(--ant-color-bg-layout)`. The header controls additionally read
143
+ `--hisd3-control-bg` / `--hisd3-control-bg-hover` (the grey circle fill) and
144
+ `--hisd3-popup-radius`, so you can retune them per app without forking the
145
+ components.
123
146
 
124
147
  ## Migrating
125
148
 
@@ -127,6 +150,8 @@ Inside styled-components or CSS you can rely on antd's variables:
127
150
 
128
151
  - Wrap the app in `HISD3Provider` (the sidebar still works standalone with the red default, but the provider is what lets you pick a primary).
129
152
  - The default look changed from teal/rounded to the red/square Backoffice style. To keep teal: `<HISD3Provider primary="teal">`.
153
+ - Borders are now hairline by default; pass `borders="bold"` to `HISD3Provider` to keep the 2px near-black look.
154
+ - New `hideAccountCard` prop on `HISD3Sidebar` for apps that put the account in the header via `HISD3AvatarMenu`.
130
155
  - `HISD3Sidebar`: `logoUrl` and `styledTheme` are now optional; a primary-colored square is shown when there is no logo. `HISD3_COLORS` is deprecated in favour of `HISD3_PRESETS`.
131
156
 
132
157
  ### from 2.x (antd 5 / ProLayout)