hisd3-ui-kit 4.7.1 → 5.0.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 +83 -0
- package/dist/index.cjs.js +75 -55
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +145 -5
- package/dist/index.js +131 -111
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,6 +117,7 @@ const menuItems = [
|
|
|
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
|
+
| `HISD3Form*` fields | Every antd data-entry control pre-wrapped in `Form.Item`, with `loading` skeletons. See *Form fields* below. |
|
|
120
121
|
| `HISD3HeaderActions` | Spacing wrapper for the top-right controls; `divided` inserts a rule before the last child. |
|
|
121
122
|
| `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
123
|
| `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`. |
|
|
@@ -201,6 +202,88 @@ logo is used. `HISD3_LOGO_SRC` is exported if you need the mark elsewhere.
|
|
|
201
202
|
`primary` accepts the brand presets `"brand"` (the logo's gear, `#E5533B`) and
|
|
202
203
|
`"brandBlue"` (its cloud, `#1B6FE0`), any other preset, or a hex value.
|
|
203
204
|
|
|
205
|
+
## Form fields
|
|
206
|
+
|
|
207
|
+
Each `HISD3Form*` field is an antd control inside a `Form.Item`. It takes every
|
|
208
|
+
`Form.Item` prop (`name`, `label`, `rules`, `tooltip`, `extra`, …) plus:
|
|
209
|
+
|
|
210
|
+
| Prop | |
|
|
211
|
+
| --- | --- |
|
|
212
|
+
| `fieldProps` | Props for the wrapped control (`placeholder`, `options`, `size`, `format`, …). |
|
|
213
|
+
| `loading` | Shows a skeleton in place of the control. The form value is kept. |
|
|
214
|
+
| `loadingProps` | Props for the default `Skeleton.Input`. |
|
|
215
|
+
| `vertical` | Label above the control (`layout="vertical"` for this item). |
|
|
216
|
+
| `bolderLabel` | Semi-bold label; the control text is unchanged. |
|
|
217
|
+
|
|
218
|
+
| Field | Wraps | Form value |
|
|
219
|
+
| --- | --- | --- |
|
|
220
|
+
| `HISD3FormInput` | `HISD3Input` | string |
|
|
221
|
+
| `HISD3FormPassword` | `Input.Password` | string |
|
|
222
|
+
| `HISD3FormSearch` | `Input.Search` | string |
|
|
223
|
+
| `HISD3FormTextArea` | `Input.TextArea` | string |
|
|
224
|
+
| `HISD3FormOTP` | `Input.OTP` | string |
|
|
225
|
+
| `HISD3FormInputNumber` | `InputNumber` | number |
|
|
226
|
+
| `HISD3FormAutoComplete` | `AutoComplete` | string |
|
|
227
|
+
| `HISD3FormMentions` | `Mentions` | string |
|
|
228
|
+
| `HISD3FormSelect` | `Select` | value / value[] |
|
|
229
|
+
| `HISD3FormTreeSelect` | `TreeSelect` | value / value[] |
|
|
230
|
+
| `HISD3FormCascader` | `Cascader` | path array |
|
|
231
|
+
| `HISD3FormRadioGroup` | `Radio.Group` | value |
|
|
232
|
+
| `HISD3FormSegmented` | `Segmented` | value |
|
|
233
|
+
| `HISD3FormCheckbox` | `Checkbox` | boolean (`valuePropName="checked"`) |
|
|
234
|
+
| `HISD3FormCheckboxGroup` | `Checkbox.Group` | value[] |
|
|
235
|
+
| `HISD3FormSwitch` | `Switch` | boolean (`valuePropName="checked"`) |
|
|
236
|
+
| `HISD3FormTransfer` | `Transfer` | right-hand keys (`valuePropName="targetKeys"`) |
|
|
237
|
+
| `HISD3FormSlider` | `Slider` | number, or `[min, max]` with `range` |
|
|
238
|
+
| `HISD3FormRate` | `Rate` | number |
|
|
239
|
+
| `HISD3FormColorPicker` | `ColorPicker` | string in `fieldProps.format` (hex by default) |
|
|
240
|
+
| `HISD3FormDatePicker` | `DatePicker` | Dayjs |
|
|
241
|
+
| `HISD3FormRangePicker` | `DatePicker.RangePicker` | `[Dayjs, Dayjs]` |
|
|
242
|
+
| `HISD3FormTimePicker` | `TimePicker` | Dayjs |
|
|
243
|
+
| `HISD3FormTimeRangePicker` | `TimePicker.RangePicker` | `[Dayjs, Dayjs]` |
|
|
244
|
+
| `HISD3FormUpload` | `Upload` | `UploadFile[]` (`valuePropName="fileList"`) |
|
|
245
|
+
| `HISD3FormUploadDragger` | `Upload.Dragger` | `UploadFile[]` |
|
|
246
|
+
|
|
247
|
+
Upload fields take the trigger as children
|
|
248
|
+
(`<HISD3FormUpload name="files"><HISD3Button>Select file</HISD3Button></HISD3FormUpload>`)
|
|
249
|
+
and use the exported `normalizeUploadFileList` as `getValueFromEvent`. Any
|
|
250
|
+
`Form.Item` prop you pass (`valuePropName`, `getValueFromEvent`, …) overrides
|
|
251
|
+
the field's default.
|
|
252
|
+
|
|
253
|
+
`ref` goes to the control itself, so `ref.current?.focus()` works.
|
|
254
|
+
Pickers and number inputs fill their column.
|
|
255
|
+
|
|
256
|
+
```tsx
|
|
257
|
+
<Form form={form} layout="vertical" onFinish={save}>
|
|
258
|
+
<HISD3FormInput
|
|
259
|
+
name="lastName"
|
|
260
|
+
label="Last name"
|
|
261
|
+
bolderLabel
|
|
262
|
+
loading={loadingPatient}
|
|
263
|
+
rules={[{ required: true, message: "Last name is required" }]}
|
|
264
|
+
fieldProps={{ placeholder: "Dela Cruz", maxLength: 80 }}
|
|
265
|
+
/>
|
|
266
|
+
<HISD3FormSelect
|
|
267
|
+
name="gender"
|
|
268
|
+
label="Gender"
|
|
269
|
+
fieldProps={{ options: [{ value: "M", label: "Male" }, { value: "F", label: "Female" }] }}
|
|
270
|
+
/>
|
|
271
|
+
<HISD3FormDatePicker name="birthDate" label="Birth date" fieldProps={{ format: "MM/DD/YYYY" }} />
|
|
272
|
+
<HISD3FormSwitch name="active" label="Active" />
|
|
273
|
+
</Form>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Wrap a control the kit does not cover with `HISD3FormField` to get the same
|
|
277
|
+
label, spacing and loading behaviour:
|
|
278
|
+
|
|
279
|
+
```tsx
|
|
280
|
+
<HISD3FormField name="doctor" label="Attending" loading={loading}>
|
|
281
|
+
<DoctorPicker />
|
|
282
|
+
</HISD3FormField>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
`propsinput` on `HISD3FormInput` still works but is deprecated; use `fieldProps`.
|
|
286
|
+
|
|
204
287
|
## Drawers and modals — `useDialog`
|
|
205
288
|
|
|
206
289
|
Open a drawer or modal from anywhere, without the page holding its state. Put
|