hisd3-ui-kit 5.1.0 → 5.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 +67 -8
- package/dist/index.cjs.js +152 -145
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +115 -8
- package/dist/index.js +160 -153
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,24 +21,82 @@ declare const HISD3_PRESETS: {
|
|
|
21
21
|
readonly purple: "#6A3FD6";
|
|
22
22
|
};
|
|
23
23
|
type HISD3Preset = keyof typeof HISD3_PRESETS;
|
|
24
|
-
/**
|
|
24
|
+
/** Light or dark. Each person picks one; a module never forces it. */
|
|
25
|
+
type HISD3ThemeMode = "light" | "dark";
|
|
26
|
+
/** Neutral palette shared by every preset (the "Backoffice" look), light. */
|
|
25
27
|
declare const HISD3_NEUTRALS: {
|
|
26
28
|
readonly bgLayout: "#F3F2F0";
|
|
27
29
|
readonly bgContainer: "#F3F2F0";
|
|
28
30
|
readonly bgElevated: "#FFFFFF";
|
|
29
31
|
readonly bgFilled: "#E6E4E1";
|
|
30
32
|
readonly bgFilledHover: "#DBD8D4";
|
|
33
|
+
/** Inside a text field: lighter than the page, so it never reads as disabled. */
|
|
34
|
+
readonly bgField: "#FAF9F7";
|
|
35
|
+
/** A table row under the pointer: solid, so a fixed column can sit on it. */
|
|
36
|
+
readonly bgRowHover: "#EBEAE8";
|
|
37
|
+
/** A translucent hover wash for menu rows and list items. */
|
|
38
|
+
readonly hover: "rgba(0,0,0,0.04)";
|
|
31
39
|
readonly text: "#171717";
|
|
32
40
|
readonly textSecondary: "#4A4A4A";
|
|
41
|
+
/** Placeholders, captions, the breadcrumb trail. 4.6:1 on the page. */
|
|
33
42
|
readonly textTertiary: "#6E6E6E";
|
|
34
43
|
/** Structural rules: sidebar edge, header bottom, table header. */
|
|
35
44
|
readonly border: "#D9D5CE";
|
|
36
45
|
/** Quieter rules: table rows, dividers inside popups. */
|
|
37
46
|
readonly borderSecondary: "#E7E4DE";
|
|
38
|
-
/** Near-black, used for hover
|
|
47
|
+
/** Near-black, used for hover emphasis on outlined buttons. */
|
|
39
48
|
readonly borderStrong: "#1F1F1F";
|
|
49
|
+
/** The edge of every form field: 3.1:1 on the page, so a field is findable. */
|
|
50
|
+
readonly controlBorder: "#8C8A85";
|
|
51
|
+
readonly controlBorderHover: "#5F5D59";
|
|
52
|
+
/** Behind a drawer or modal. */
|
|
53
|
+
readonly mask: "rgba(23,23,23,0.45)";
|
|
40
54
|
readonly white: "#FFFFFF";
|
|
41
55
|
};
|
|
56
|
+
/** The same roles on a warm near-black. */
|
|
57
|
+
declare const HISD3_NEUTRALS_DARK: {
|
|
58
|
+
readonly bgLayout: "#1A1917";
|
|
59
|
+
readonly bgContainer: "#1A1917";
|
|
60
|
+
/** Popups sit lighter than the page, so they still lift. */
|
|
61
|
+
readonly bgElevated: "#262522";
|
|
62
|
+
readonly bgFilled: "#2E2D2A";
|
|
63
|
+
readonly bgFilledHover: "#393734";
|
|
64
|
+
readonly bgField: "#201F1D";
|
|
65
|
+
readonly bgRowHover: "#22211F";
|
|
66
|
+
readonly hover: "rgba(255,255,255,0.05)";
|
|
67
|
+
readonly text: "#EEEDEA";
|
|
68
|
+
readonly textSecondary: "#C2C0BB";
|
|
69
|
+
readonly textTertiary: "#9C9A94";
|
|
70
|
+
readonly border: "#3A3936";
|
|
71
|
+
readonly borderSecondary: "#2C2B29";
|
|
72
|
+
readonly borderStrong: "#EEEDEA";
|
|
73
|
+
readonly controlBorder: "#77746E";
|
|
74
|
+
readonly controlBorderHover: "#A8A59F";
|
|
75
|
+
readonly mask: "rgba(0,0,0,0.6)";
|
|
76
|
+
readonly white: "#FFFFFF";
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Status colours. Separate from the primary and the same in every module;
|
|
80
|
+
* each text colour reads at 4.5:1 or more on its own tint and on the page.
|
|
81
|
+
*/
|
|
82
|
+
declare const HISD3_STATUS: {
|
|
83
|
+
readonly light: {
|
|
84
|
+
readonly success: "#2E7D32";
|
|
85
|
+
readonly successBg: "#EAF3EA";
|
|
86
|
+
readonly error: "#B42318";
|
|
87
|
+
readonly errorBg: "#FBEAE7";
|
|
88
|
+
readonly warning: "#B54708";
|
|
89
|
+
readonly warningBg: "#FBEFE3";
|
|
90
|
+
};
|
|
91
|
+
readonly dark: {
|
|
92
|
+
readonly success: "#6FBF73";
|
|
93
|
+
readonly successBg: "#283426";
|
|
94
|
+
readonly error: "#FF8A7A";
|
|
95
|
+
readonly errorBg: "#3F2B27";
|
|
96
|
+
readonly warning: "#F0A35E";
|
|
97
|
+
readonly warningBg: "#3C2F22";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
42
100
|
/** Border weights. "hairline" is the default modern look. */
|
|
43
101
|
declare const HISD3_BORDER_PRESETS: {
|
|
44
102
|
readonly hairline: {
|
|
@@ -52,6 +110,19 @@ declare const HISD3_BORDER_PRESETS: {
|
|
|
52
110
|
readonly borderSecondary: "#CFCDC9";
|
|
53
111
|
};
|
|
54
112
|
};
|
|
113
|
+
/** The border presets in dark mode. */
|
|
114
|
+
declare const HISD3_BORDER_PRESETS_DARK: {
|
|
115
|
+
readonly hairline: {
|
|
116
|
+
readonly width: 1;
|
|
117
|
+
readonly border: "#3A3936";
|
|
118
|
+
readonly borderSecondary: "#2C2B29";
|
|
119
|
+
};
|
|
120
|
+
readonly bold: {
|
|
121
|
+
readonly width: 2;
|
|
122
|
+
readonly border: "#C2C0BB";
|
|
123
|
+
readonly borderSecondary: "#3A3936";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
55
126
|
type HISD3Borders = keyof typeof HISD3_BORDER_PRESETS;
|
|
56
127
|
declare const HISD3_FONT_FAMILY = "'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif";
|
|
57
128
|
/** Archivo is used for both body (400) and headings (800). */
|
|
@@ -60,6 +131,8 @@ declare const HISD3_FONT_WEIGHT_BODY = 400;
|
|
|
60
131
|
interface HISD3ThemeOptions {
|
|
61
132
|
/** Preset name or any hex color. Default "red". */
|
|
62
133
|
primary?: HISD3Preset | string;
|
|
134
|
+
/** Light (default) or dark. */
|
|
135
|
+
mode?: HISD3ThemeMode;
|
|
63
136
|
/** Corner radius in px. The Backoffice look is square (0). */
|
|
64
137
|
radius?: number;
|
|
65
138
|
/**
|
|
@@ -83,14 +156,39 @@ declare const resolvePrimary: (primary?: HISD3Preset | string) => string;
|
|
|
83
156
|
declare const shade: (hex: string, amount: number) => string;
|
|
84
157
|
/** Mix a hex color with white: amount 0 → color, 1 → white. */
|
|
85
158
|
declare const tint: (hex: string, amount: number) => string;
|
|
159
|
+
/** Mix two hex colors: amount 0 → `a`, 1 → `b`. */
|
|
160
|
+
declare const mix: (a: string, b: string, amount: number) => string;
|
|
161
|
+
/** WCAG 2 contrast ratio between two hex colours (1 to 21). */
|
|
162
|
+
declare const contrastRatio: (a: string, b: string) => number;
|
|
163
|
+
/** The primary as the kit applies it, and the colours derived from it. */
|
|
164
|
+
interface HISD3PrimaryPalette {
|
|
165
|
+
/** The colour as asked for. Logos and illustrations only. */
|
|
166
|
+
source: string;
|
|
167
|
+
/** Buttons, links, the selected menu item, the active tab. */
|
|
168
|
+
primary: string;
|
|
169
|
+
/** Text and icons on a `primary` fill. */
|
|
170
|
+
onPrimary: string;
|
|
171
|
+
/** The selected menu row, a selected option, a soft primary tag. */
|
|
172
|
+
primaryBg: string;
|
|
173
|
+
primaryBgHover: string;
|
|
174
|
+
primaryBorder: string;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Make any primary readable. In light mode it is darkened until it reads at
|
|
178
|
+
* 4.5:1 on the page, on its own tint and under white text; in dark mode it is
|
|
179
|
+
* lightened until it reads at 4.5:1 on the page and on its own tint, and
|
|
180
|
+
* carries dark text. Teal, Blue, Green and Purple are used as given in light
|
|
181
|
+
* mode; Red, Orange and Brand come out a little darker.
|
|
182
|
+
*/
|
|
183
|
+
declare const resolvePrimaryPalette: (primary?: HISD3Preset | string, mode?: HISD3ThemeMode) => HISD3PrimaryPalette;
|
|
86
184
|
/**
|
|
87
185
|
* Build the HISD3 Ant Design v6 theme.
|
|
88
186
|
*
|
|
89
187
|
* ```ts
|
|
90
|
-
* <ConfigProvider theme={createHisd3Theme({ primary: "teal" })}>
|
|
188
|
+
* <ConfigProvider theme={createHisd3Theme({ primary: "teal", mode: "dark" })}>
|
|
91
189
|
* ```
|
|
92
190
|
*/
|
|
93
|
-
declare const createHisd3Theme: ({ primary, radius, borders, lineWidth, overrides, }?: HISD3ThemeOptions) => ThemeConfig;
|
|
191
|
+
declare const createHisd3Theme: ({ primary, mode, radius, borders, lineWidth, overrides, }?: HISD3ThemeOptions) => ThemeConfig;
|
|
94
192
|
/**
|
|
95
193
|
* CSS emitted by HISD3Provider on `:root`.
|
|
96
194
|
*
|
|
@@ -100,7 +198,13 @@ declare const createHisd3Theme: ({ primary, radius, borders, lineWidth, override
|
|
|
100
198
|
* `:root` so kit components and app CSS work anywhere in the tree. antd's own
|
|
101
199
|
* declarations sit closer to its components, so they still win there.
|
|
102
200
|
*/
|
|
103
|
-
declare const hisd3VarsCss: ({ primary, borders, lineWidth, radius, }?: HISD3ThemeOptions
|
|
201
|
+
declare const hisd3VarsCss: ({ primary, mode, borders, lineWidth, radius, selector, }?: HISD3ThemeOptions & {
|
|
202
|
+
/**
|
|
203
|
+
* Where the variables apply. `:root` (default) for the app; a class to give
|
|
204
|
+
* one region its own mode, such as a printout that stays light in a dark app.
|
|
205
|
+
*/
|
|
206
|
+
selector?: string;
|
|
207
|
+
}) => string;
|
|
104
208
|
/** @deprecated use `hisd3VarsCss` — it emits the colour tokens too. */
|
|
105
209
|
declare const borderVarsCss: (borders?: HISD3Borders, lineWidth?: number) => string;
|
|
106
210
|
/** Default HISD3 theme — the red "Backoffice" look. */
|
|
@@ -673,6 +777,9 @@ interface HISD3ProviderProps extends HISD3ThemeOptions {
|
|
|
673
777
|
* </HISD3Provider>
|
|
674
778
|
* ```
|
|
675
779
|
*
|
|
780
|
+
* `mode="dark"` switches every kit and antd component to the dark palette;
|
|
781
|
+
* the app owns the person's choice (and where it is remembered).
|
|
782
|
+
*
|
|
676
783
|
* It wires the antd `ConfigProvider` (with CSS variables enabled so every
|
|
677
784
|
* kit component follows the chosen primary), antd `App` (for themed
|
|
678
785
|
* `modal.confirm` / `message`), and the styled-components `ThemeProvider`.
|
|
@@ -1028,7 +1135,7 @@ interface HISD3TagProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
1028
1135
|
* neutral → light grey fill, dark text (ACTIVE, IN PATIENT)
|
|
1029
1136
|
* soft → primary tint fill, primary text (ER PATIENT)
|
|
1030
1137
|
* outline → 2px primary border, primary text (OUT PATIENT)
|
|
1031
|
-
* solid →
|
|
1138
|
+
* solid → tone fill, text in the colour that reads on it (white in light mode, dark in dark mode)
|
|
1032
1139
|
*/
|
|
1033
1140
|
variant?: HISD3TagVariant;
|
|
1034
1141
|
tone?: HISD3TagTone;
|
|
@@ -1303,5 +1410,5 @@ declare const HISD3_LAYOUT: {
|
|
|
1303
1410
|
readonly pageGutter: 28;
|
|
1304
1411
|
};
|
|
1305
1412
|
|
|
1306
|
-
export { AppAnimateGroups, AppAnimates, AppMotionAnimate, AuthType, DialogProvider, Fonts, FooterType, HISD3AvatarMenu, HISD3Button, HISD3FormAutoComplete, HISD3FormCascader, HISD3FormCheckbox, HISD3FormCheckboxGroup, HISD3FormColorPicker, HISD3FormDatePicker, HISD3FormField, HISD3FormInput, HISD3FormInputNumber, HISD3FormMentions, HISD3FormOTP, HISD3FormPassword, HISD3FormRadioGroup, HISD3FormRangePicker, HISD3FormRate, HISD3FormSearch, HISD3FormSegmented, HISD3FormSelect, HISD3FormSlider, HISD3FormSwitch, HISD3FormTextArea, HISD3FormTimePicker, HISD3FormTimeRangePicker, HISD3FormTransfer, HISD3FormTreeSelect, HISD3FormUpload, HISD3FormUploadDragger, HISD3HeaderActions, HISD3Input, HISD3LoginPage, HISD3NotificationButton, HISD3PageBody, HISD3PageHeader, HISD3Provider, HISD3SearchInput, HISD3Select, HISD3SelectLabel, HISD3Sidebar, HISD3Table, HISD3Tabs, HISD3Tag, HISD3_BORDER_PRESETS, HISD3_COLORS, HISD3_FONT_FAMILY, HISD3_FONT_WEIGHT_BODY, HISD3_FONT_WEIGHT_HEADING, HISD3_LAYOUT, HISD3_LOGO_SRC, HISD3_NEUTRALS, HISD3_PRESETS, HeaderIconButton, HeaderType, LayoutDirection, LayoutType, MenuStyle, MessageType, NavStyle, RoutePermittedRole, RouteTransition, ThemeMode, ThemeStyle, ThemeStyleRadius, UserMenu, borderVarsCss, createHisd3Theme, getInitials, hisd3AntdTheme, hisd3VarsCss, normalizeUploadFileList, resolvePrimary, shade, tint, useDialog, useInsideHISD3Provider };
|
|
1307
|
-
export type { DialogOwnProps, DialogProps, DialogResult, HISD3AutoCompleteRef, HISD3AvatarMenuProps, HISD3Borders, HISD3BreadcrumbItem, HISD3ButtonProps, HISD3ButtonVariant, HISD3CascaderRef, HISD3FormAutoCompleteProps, HISD3FormCascaderProps, HISD3FormCheckboxGroupProps, HISD3FormCheckboxProps, HISD3FormColorPickerProps, HISD3FormDatePickerProps, HISD3FormFieldBaseProps, HISD3FormFieldComponent, HISD3FormFieldProps, HISD3FormFieldShellProps, HISD3FormInputNumberProps, HISD3FormInputProps, HISD3FormMentionsProps, HISD3FormOTPProps, HISD3FormPasswordProps, HISD3FormRadioGroupProps, HISD3FormRangePickerProps, HISD3FormRateProps, HISD3FormSearchProps, HISD3FormSegmentedProps, HISD3FormSelectProps, HISD3FormSliderProps, HISD3FormSwitchProps, HISD3FormTextAreaProps, HISD3FormTimePickerProps, HISD3FormTimeRangePickerProps, HISD3FormTransferProps, HISD3FormTreeSelectProps, HISD3FormUploadProps, HISD3HeaderActionsProps, HISD3InputNumberRef, HISD3InputProps, HISD3LoginPageProps, HISD3LoginValues, HISD3MenuItem, HISD3Notification, HISD3NotificationButtonProps, HISD3OTPRef, HISD3PageHeaderProps, HISD3PickerRef, HISD3Preset, HISD3ProviderProps, HISD3RangePickerRef, HISD3RateRef, HISD3SearchInputProps, HISD3SelectLabelProps, HISD3SelectOption, HISD3SelectProps, HISD3SidebarProps, HISD3SkeletonInputProps, HISD3SliderRef, HISD3TabItem, HISD3TablePagination, HISD3TableProps, HISD3TabsProps, HISD3TagProps, HISD3TagTone, HISD3TagVariant, HISD3ThemeOptions, HISD3TimePickerRef, HISD3TimeRangePickerRef, HISD3TransferRef, HISD3TreeSelectRef, IUserEmployee, LoginSide, LoginVariant, StyledTheme, UserMenuProps };
|
|
1413
|
+
export { AppAnimateGroups, AppAnimates, AppMotionAnimate, AuthType, DialogProvider, Fonts, FooterType, HISD3AvatarMenu, HISD3Button, HISD3FormAutoComplete, HISD3FormCascader, HISD3FormCheckbox, HISD3FormCheckboxGroup, HISD3FormColorPicker, HISD3FormDatePicker, HISD3FormField, HISD3FormInput, HISD3FormInputNumber, HISD3FormMentions, HISD3FormOTP, HISD3FormPassword, HISD3FormRadioGroup, HISD3FormRangePicker, HISD3FormRate, HISD3FormSearch, HISD3FormSegmented, HISD3FormSelect, HISD3FormSlider, HISD3FormSwitch, HISD3FormTextArea, HISD3FormTimePicker, HISD3FormTimeRangePicker, HISD3FormTransfer, HISD3FormTreeSelect, HISD3FormUpload, HISD3FormUploadDragger, HISD3HeaderActions, HISD3Input, HISD3LoginPage, HISD3NotificationButton, HISD3PageBody, HISD3PageHeader, HISD3Provider, HISD3SearchInput, HISD3Select, HISD3SelectLabel, HISD3Sidebar, HISD3Table, HISD3Tabs, HISD3Tag, HISD3_BORDER_PRESETS, HISD3_BORDER_PRESETS_DARK, HISD3_COLORS, HISD3_FONT_FAMILY, HISD3_FONT_WEIGHT_BODY, HISD3_FONT_WEIGHT_HEADING, HISD3_LAYOUT, HISD3_LOGO_SRC, HISD3_NEUTRALS, HISD3_NEUTRALS_DARK, HISD3_PRESETS, HISD3_STATUS, HeaderIconButton, HeaderType, LayoutDirection, LayoutType, MenuStyle, MessageType, NavStyle, RoutePermittedRole, RouteTransition, ThemeMode, ThemeStyle, ThemeStyleRadius, UserMenu, borderVarsCss, contrastRatio, createHisd3Theme, getInitials, hisd3AntdTheme, hisd3VarsCss, mix, normalizeUploadFileList, resolvePrimary, resolvePrimaryPalette, shade, tint, useDialog, useInsideHISD3Provider };
|
|
1414
|
+
export type { DialogOwnProps, DialogProps, DialogResult, HISD3AutoCompleteRef, HISD3AvatarMenuProps, HISD3Borders, HISD3BreadcrumbItem, HISD3ButtonProps, HISD3ButtonVariant, HISD3CascaderRef, HISD3FormAutoCompleteProps, HISD3FormCascaderProps, HISD3FormCheckboxGroupProps, HISD3FormCheckboxProps, HISD3FormColorPickerProps, HISD3FormDatePickerProps, HISD3FormFieldBaseProps, HISD3FormFieldComponent, HISD3FormFieldProps, HISD3FormFieldShellProps, HISD3FormInputNumberProps, HISD3FormInputProps, HISD3FormMentionsProps, HISD3FormOTPProps, HISD3FormPasswordProps, HISD3FormRadioGroupProps, HISD3FormRangePickerProps, HISD3FormRateProps, HISD3FormSearchProps, HISD3FormSegmentedProps, HISD3FormSelectProps, HISD3FormSliderProps, HISD3FormSwitchProps, HISD3FormTextAreaProps, HISD3FormTimePickerProps, HISD3FormTimeRangePickerProps, HISD3FormTransferProps, HISD3FormTreeSelectProps, HISD3FormUploadProps, HISD3HeaderActionsProps, HISD3InputNumberRef, HISD3InputProps, HISD3LoginPageProps, HISD3LoginValues, HISD3MenuItem, HISD3Notification, HISD3NotificationButtonProps, HISD3OTPRef, HISD3PageHeaderProps, HISD3PickerRef, HISD3Preset, HISD3PrimaryPalette, HISD3ProviderProps, HISD3RangePickerRef, HISD3RateRef, HISD3SearchInputProps, HISD3SelectLabelProps, HISD3SelectOption, HISD3SelectProps, HISD3SidebarProps, HISD3SkeletonInputProps, HISD3SliderRef, HISD3TabItem, HISD3TablePagination, HISD3TableProps, HISD3TabsProps, HISD3TagProps, HISD3TagTone, HISD3TagVariant, HISD3ThemeMode, HISD3ThemeOptions, HISD3TimePickerRef, HISD3TimeRangePickerRef, HISD3TransferRef, HISD3TreeSelectRef, IUserEmployee, LoginSide, LoginVariant, StyledTheme, UserMenuProps };
|