hisd3-ui-kit 4.1.0 → 4.2.1
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 +20 -4
- package/dist/index.cjs.js +134 -62
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +142 -70
- package/dist/index.js.map +1 -1
- package/package.json +7 -8
package/README.md
CHANGED
|
@@ -110,15 +110,15 @@ const menuItems = [
|
|
|
110
110
|
| Component | What it is |
|
|
111
111
|
| --- | --- |
|
|
112
112
|
| `HISD3Provider` | Root theme provider (see above). |
|
|
113
|
-
| `HISD3Sidebar` | App shell: brand block, grouped menu with accent bar on the active route, account dropdown (Settings / Logout with confirm), collapsible, optional top-nav mode (`layoutTop`). `menuItems` accept `{ key, path, name, icon, children, group, hideInMenu, disabled }`. `renderMenuLink` lets you plug in react-router's `<Link>`. Props `bareContent` + `hideHeaderBar` hand the header over to `HISD3PageHeader`. |
|
|
114
|
-
| `HISD3PageHeader` / `HISD3PageBody` |
|
|
113
|
+
| `HISD3Sidebar` | App shell (see *Scrolling* below): brand block, grouped menu with accent bar on the active route, account dropdown (Settings / Logout with confirm), collapsible, optional top-nav mode (`layoutTop`). `menuItems` accept `{ key, path, name, icon, children, group, hideInMenu, disabled }`. `renderMenuLink` lets you plug in react-router's `<Link>`. Props `bareContent` + `hideHeaderBar` hand the header over to `HISD3PageHeader`. `collapseTrigger` places the collapse control: `"edge"` (default) floats a round chevron on the sidebar's right edge, level with the top bar — it works even when the top bar is hidden, and `collapseTriggerOffset` moves it down — `"header"` puts a square button in the shell's own top bar, `"none"` renders neither. |
|
|
114
|
+
| `HISD3PageHeader` / `HISD3PageBody` | Top bar (breadcrumb left, actions right) that stays pinned while the page scrolls, plus a large title + subtitle that scrolls away; `HISD3PageBody` is the matching padded content area. |
|
|
115
115
|
| `HISD3Table<T>` | antd `Table` restyled (uppercase muted headers, 2px row rules) with the HISD3 pagination bar: "Total N items", square page buttons, page-size toggle. Pass `pagination={{ current, pageSize, total, onChange, pageSizeOptions?, hidePageSize? }}` or `false`. Optional `footer` strip. Cell helper classes: `hisd3-cell-primary`, `hisd3-cell-link`, `hisd3-cell-muted`. |
|
|
116
116
|
| `HISD3Tabs` | Underlined filter tabs; each item may carry a `count`. |
|
|
117
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`. |
|
|
118
118
|
| `HISD3Button` | `variant`: `primary` (filled), `secondary` (default, dark 2px outline), `ghost`, `danger`. Accepts all antd `Button` props (`icon`, `size`, `loading`, …). |
|
|
119
119
|
| `HISD3Input` / `HISD3SearchInput` | 2px-bordered input; the search variant is the grey filled hero field with a leading icon (`compact` for a 48px version). |
|
|
120
120
|
| `HISD3HeaderActions` | Spacing wrapper for the top-right controls; `divided` inserts a rule before the last child. |
|
|
121
|
-
| `HISD3NotificationButton` | Soft-grey circular bell
|
|
121
|
+
| `HISD3NotificationButton` | Soft-grey circular button with a solid bell glyph and a count pill on its top-right edge; tints to the primary color while its panel is open. Pass `icon` to swap the glyph. Props: `items` (`{ id, title, description, time, unread, avatarSrc, icon, onClick }`), `count` (defaults to the unread tally), `loading`, `size` (default 40), `icon`, `onMarkAllRead`, `onSeeAll`, `emptyText`. |
|
|
122
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
123
|
| `UserMenu` | The sidebar-footer account card, on its own. |
|
|
124
124
|
|
|
@@ -130,6 +130,20 @@ Theme utilities: `createHisd3Theme`, `hisd3AntdTheme` (red default),
|
|
|
130
130
|
Modal, …) inherit the same tokens automatically, so use them freely alongside
|
|
131
131
|
the kit.
|
|
132
132
|
|
|
133
|
+
### Scrolling
|
|
134
|
+
|
|
135
|
+
The shell fills exactly one viewport and the content column scrolls inside it,
|
|
136
|
+
so the page header stays pinned and the document never rubber-bands ("bounces")
|
|
137
|
+
past the top or bottom — the behaviour you expect from a desktop app. Nothing to
|
|
138
|
+
configure; pass `scrollContent={false}` to `HISD3Sidebar` if you need the window
|
|
139
|
+
to be the scroller instead (infinite scroll bound to `window`, browser scroll
|
|
140
|
+
restoration, and similar).
|
|
141
|
+
|
|
142
|
+
Because the scroller is the content column rather than the window, code that
|
|
143
|
+
listens for `window` scroll events or calls `window.scrollTo` inside a page
|
|
144
|
+
needs to target that element instead — for example
|
|
145
|
+
`document.querySelector(".ant-layout-has-sider > .ant-layout")`.
|
|
146
|
+
|
|
133
147
|
Typography: Archivo throughout, loaded from Google Fonts by the kit — body 400,
|
|
134
148
|
headings 800. The kit defines `--font-body`, `--font-heading` and
|
|
135
149
|
`--font-weight-heading` on `:root`, so your own CSS can use them, and native
|
|
@@ -141,7 +155,7 @@ Inside styled-components or CSS you can rely on antd's variables:
|
|
|
141
155
|
`var(--ant-color-text)`, `var(--ant-color-text-tertiary)`,
|
|
142
156
|
`var(--ant-color-bg-layout)`. The header controls additionally read
|
|
143
157
|
`--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
|
|
158
|
+
`--hisd3-popup-radius`, `--hisd3-bell-stretch` (how wide the bell glyph is drawn, default `1.12`), `--hisd3-edge-trigger-bg` / `--hisd3-edge-trigger-color` (the sidebar collapse chevron, primary-filled by default), so you can retune them per app without forking the
|
|
145
159
|
components.
|
|
146
160
|
|
|
147
161
|
## Migrating
|
|
@@ -150,6 +164,8 @@ components.
|
|
|
150
164
|
|
|
151
165
|
- Wrap the app in `HISD3Provider` (the sidebar still works standalone with the red default, but the provider is what lets you pick a primary).
|
|
152
166
|
- The default look changed from teal/rounded to the red/square Backoffice style. To keep teal: `<HISD3Provider primary="teal">`.
|
|
167
|
+
- The collapse control now defaults to a round chevron on the sidebar edge (`collapseTrigger="edge"`). Pass `collapseTrigger="header"` for the old top-bar button, or `"none"` if your app renders its own.
|
|
168
|
+
- The shell now scrolls its content column instead of the window (pinned header, no rubber-banding). Pass `scrollContent={false}` to `HISD3Sidebar` to restore window scrolling.
|
|
153
169
|
- Borders are now hairline by default; pass `borders="bold"` to `HISD3Provider` to keep the 2px near-black look.
|
|
154
170
|
- New `hideAccountCard` prop on `HISD3Sidebar` for apps that put the account in the header via `HISD3AvatarMenu`.
|
|
155
171
|
- `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`.
|