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/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ThemeConfig, MenuProps, TableProps, TabsProps, ButtonProps, InputProps } from 'antd';
|
|
1
|
+
import { ThemeConfig, MenuProps, TableProps, TabsProps, ButtonProps, InputProps, FormItemProps, GetProps, Skeleton, Input, InputNumberProps, GetRef, InputNumber, SelectProps, RadioGroupProps, CheckboxProps, Checkbox, SwitchProps, DatePickerProps, DatePicker, TimePickerProps, TimePicker, TimeRangePickerProps, AutoCompleteProps, AutoComplete, MentionsProps, MentionsRef, CascaderAutoProps, Cascader, TreeSelectProps, TreeSelect, SegmentedProps, TransferProps, Transfer, Slider, RateProps, Rate, ColorPickerProps, UploadProps, UploadFile } from 'antd';
|
|
2
2
|
import React, { ReactNode, ComponentType } from 'react';
|
|
3
3
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
4
4
|
import * as styled_components from 'styled-components';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { AnyObject } from 'antd/es/_util/type';
|
|
7
|
+
import * as antd_es_input_TextArea from 'antd/es/input/TextArea';
|
|
7
8
|
|
|
8
9
|
/** Named primary-color presets. Any hex string is also accepted. */
|
|
9
10
|
declare const HISD3_PRESETS: {
|
|
@@ -1048,7 +1049,7 @@ declare const HISD3Button: React.FC<HISD3ButtonProps>;
|
|
|
1048
1049
|
|
|
1049
1050
|
type HISD3InputProps = InputProps;
|
|
1050
1051
|
/** Plain text input with the HISD3 2px border. */
|
|
1051
|
-
declare const HISD3Input: React.
|
|
1052
|
+
declare const HISD3Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<InputRef>>;
|
|
1052
1053
|
interface HISD3SearchInputProps extends Omit<InputProps, "size"> {
|
|
1053
1054
|
/**
|
|
1054
1055
|
* "small" 32px, "middle" 40px (default, matches buttons), "large" 56px for a
|
|
@@ -1059,7 +1060,146 @@ interface HISD3SearchInputProps extends Omit<InputProps, "size"> {
|
|
|
1059
1060
|
compact?: boolean;
|
|
1060
1061
|
}
|
|
1061
1062
|
/** Grey filled search field with leading icon (the page-level search bar). */
|
|
1062
|
-
declare const HISD3SearchInput: React.
|
|
1063
|
+
declare const HISD3SearchInput: React.ForwardRefExoticComponent<Omit<HISD3SearchInputProps, "ref"> & React.RefAttributes<InputRef>>;
|
|
1064
|
+
|
|
1065
|
+
type HISD3SkeletonInputProps = GetProps<typeof Skeleton.Input>;
|
|
1066
|
+
type ControlSize = HISD3SkeletonInputProps["size"];
|
|
1067
|
+
interface HISD3FormFieldBaseProps extends Omit<FormItemProps, "children"> {
|
|
1068
|
+
/** Show a skeleton in place of the control (e.g. while the record loads). */
|
|
1069
|
+
loading?: boolean;
|
|
1070
|
+
/** Props for the default skeleton (`Skeleton.Input`). */
|
|
1071
|
+
loadingProps?: HISD3SkeletonInputProps;
|
|
1072
|
+
/** Label above the control instead of beside it. Shortcut for `layout="vertical"`. */
|
|
1073
|
+
vertical?: boolean;
|
|
1074
|
+
/** Semi-bold (600) label. Only the label changes — the control text does not. */
|
|
1075
|
+
bolderLabel?: boolean;
|
|
1076
|
+
}
|
|
1077
|
+
/** Every wrapped field takes the Form.Item props plus `fieldProps` for the control. */
|
|
1078
|
+
type HISD3FormFieldProps<P> = HISD3FormFieldBaseProps & {
|
|
1079
|
+
/** Props passed straight to the wrapped antd control. */
|
|
1080
|
+
fieldProps?: P;
|
|
1081
|
+
};
|
|
1082
|
+
interface HISD3FormFieldShellProps extends HISD3FormFieldBaseProps {
|
|
1083
|
+
/** Control size — used to size the default skeleton. */
|
|
1084
|
+
controlSize?: ControlSize;
|
|
1085
|
+
/** Replace the default skeleton (e.g. a small one for a switch). */
|
|
1086
|
+
skeleton?: React.ReactNode;
|
|
1087
|
+
children?: React.ReactNode;
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* The Form.Item wrapper every HISD3Form* field uses. Use it directly to give a
|
|
1091
|
+
* custom control the same label, spacing and loading behaviour.
|
|
1092
|
+
*/
|
|
1093
|
+
declare const HISD3FormField: React.FC<HISD3FormFieldShellProps>;
|
|
1094
|
+
/** A wrapped field: its props plus a ref to the underlying antd control. */
|
|
1095
|
+
type HISD3FormFieldComponent<P, R> = React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<R>>;
|
|
1096
|
+
type HISD3InputNumberRef = GetRef<typeof InputNumber>;
|
|
1097
|
+
type HISD3PickerRef = GetRef<typeof DatePicker>;
|
|
1098
|
+
type HISD3RangePickerRef = GetRef<typeof DatePicker.RangePicker>;
|
|
1099
|
+
type HISD3TimePickerRef = GetRef<typeof TimePicker>;
|
|
1100
|
+
interface HISD3FormInputProps extends HISD3FormFieldProps<InputProps> {
|
|
1101
|
+
/** @deprecated use `fieldProps` — kept so existing call sites keep working. */
|
|
1102
|
+
propsinput?: InputProps;
|
|
1103
|
+
}
|
|
1104
|
+
/** Text input inside a Form.Item. */
|
|
1105
|
+
declare const HISD3FormInput: React.ForwardRefExoticComponent<Omit<HISD3FormInputProps, "ref"> & React.RefAttributes<InputRef>>;
|
|
1106
|
+
type HISD3FormPasswordProps = HISD3FormFieldProps<GetProps<typeof Input.Password>>;
|
|
1107
|
+
/** Password input with the show / hide toggle. */
|
|
1108
|
+
declare const HISD3FormPassword: React.ForwardRefExoticComponent<Omit<HISD3FormPasswordProps, "ref"> & React.RefAttributes<InputRef>>;
|
|
1109
|
+
type HISD3FormTextAreaProps = HISD3FormFieldProps<GetProps<typeof Input.TextArea>>;
|
|
1110
|
+
/** Multi-line text. The skeleton grows with `fieldProps.rows`. */
|
|
1111
|
+
declare const HISD3FormTextArea: React.ForwardRefExoticComponent<Omit<HISD3FormTextAreaProps, "ref"> & React.RefAttributes<antd_es_input_TextArea.TextAreaRef>>;
|
|
1112
|
+
type HISD3FormInputNumberProps = HISD3FormFieldProps<InputNumberProps>;
|
|
1113
|
+
/** Numeric input, full width of its column. */
|
|
1114
|
+
declare const HISD3FormInputNumber: HISD3FormFieldComponent<HISD3FormInputNumberProps, HISD3InputNumberRef>;
|
|
1115
|
+
type HISD3FormSelectProps = HISD3FormFieldProps<SelectProps>;
|
|
1116
|
+
/** Select / multi-select. */
|
|
1117
|
+
declare const HISD3FormSelect: React.ForwardRefExoticComponent<Omit<HISD3FormSelectProps, "ref"> & React.RefAttributes<RefSelectProps>>;
|
|
1118
|
+
type HISD3FormRadioGroupProps = HISD3FormFieldProps<RadioGroupProps>;
|
|
1119
|
+
/** Radio group — pass `fieldProps.options`. */
|
|
1120
|
+
declare const HISD3FormRadioGroup: React.ForwardRefExoticComponent<Omit<HISD3FormRadioGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1121
|
+
interface HISD3FormCheckboxProps extends HISD3FormFieldProps<CheckboxProps> {
|
|
1122
|
+
/** Text beside the box. Shortcut for `fieldProps.children`. */
|
|
1123
|
+
text?: React.ReactNode;
|
|
1124
|
+
}
|
|
1125
|
+
/** Single boolean checkbox; the form value is `true` / `false`. */
|
|
1126
|
+
declare const HISD3FormCheckbox: React.ForwardRefExoticComponent<Omit<HISD3FormCheckboxProps, "ref"> & React.RefAttributes<CheckboxRef>>;
|
|
1127
|
+
type HISD3FormCheckboxGroupProps = HISD3FormFieldProps<GetProps<typeof Checkbox.Group>>;
|
|
1128
|
+
/** Checkbox group — pass `fieldProps.options`; the form value is an array. */
|
|
1129
|
+
declare const HISD3FormCheckboxGroup: React.ForwardRefExoticComponent<Omit<HISD3FormCheckboxGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1130
|
+
type HISD3FormSwitchProps = HISD3FormFieldProps<SwitchProps>;
|
|
1131
|
+
/** On / off switch; the form value is `true` / `false`. */
|
|
1132
|
+
declare const HISD3FormSwitch: React.ForwardRefExoticComponent<Omit<HISD3FormSwitchProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1133
|
+
type HISD3FormDatePickerProps = HISD3FormFieldProps<DatePickerProps>;
|
|
1134
|
+
/** Date picker, full width of its column. The form value is a Dayjs. */
|
|
1135
|
+
declare const HISD3FormDatePicker: HISD3FormFieldComponent<HISD3FormDatePickerProps, HISD3PickerRef>;
|
|
1136
|
+
type HISD3FormRangePickerProps = HISD3FormFieldProps<GetProps<typeof DatePicker.RangePicker>>;
|
|
1137
|
+
/** Start / end date range. The form value is `[Dayjs, Dayjs]`. */
|
|
1138
|
+
declare const HISD3FormRangePicker: HISD3FormFieldComponent<HISD3FormRangePickerProps, HISD3RangePickerRef>;
|
|
1139
|
+
type HISD3FormTimePickerProps = HISD3FormFieldProps<TimePickerProps>;
|
|
1140
|
+
/** Time picker, full width of its column. */
|
|
1141
|
+
declare const HISD3FormTimePicker: HISD3FormFieldComponent<HISD3FormTimePickerProps, HISD3TimePickerRef>;
|
|
1142
|
+
type HISD3TimeRangePickerRef = GetRef<typeof TimePicker.RangePicker>;
|
|
1143
|
+
type HISD3FormTimeRangePickerProps = HISD3FormFieldProps<TimeRangePickerProps>;
|
|
1144
|
+
/** Start / end time range. The form value is `[Dayjs, Dayjs]`. */
|
|
1145
|
+
declare const HISD3FormTimeRangePicker: HISD3FormFieldComponent<HISD3FormTimeRangePickerProps, HISD3TimeRangePickerRef>;
|
|
1146
|
+
type HISD3FormSearchProps = HISD3FormFieldProps<GetProps<typeof Input.Search>>;
|
|
1147
|
+
/** Input with a search button (`fieldProps.onSearch`). */
|
|
1148
|
+
declare const HISD3FormSearch: React.ForwardRefExoticComponent<Omit<HISD3FormSearchProps, "ref"> & React.RefAttributes<InputRef>>;
|
|
1149
|
+
type HISD3OTPRef = GetRef<typeof Input.OTP>;
|
|
1150
|
+
type HISD3FormOTPProps = HISD3FormFieldProps<GetProps<typeof Input.OTP>>;
|
|
1151
|
+
/** One-time code boxes (`fieldProps.length`, default 6). The form value is a string. */
|
|
1152
|
+
declare const HISD3FormOTP: HISD3FormFieldComponent<HISD3FormOTPProps, HISD3OTPRef>;
|
|
1153
|
+
type HISD3AutoCompleteRef = GetRef<typeof AutoComplete>;
|
|
1154
|
+
type HISD3FormAutoCompleteProps = HISD3FormFieldProps<AutoCompleteProps>;
|
|
1155
|
+
/** Free text with suggestions (`fieldProps.options`). */
|
|
1156
|
+
declare const HISD3FormAutoComplete: HISD3FormFieldComponent<HISD3FormAutoCompleteProps, HISD3AutoCompleteRef>;
|
|
1157
|
+
type HISD3FormMentionsProps = HISD3FormFieldProps<MentionsProps>;
|
|
1158
|
+
/** Text area with `@` mentions (`fieldProps.options`). */
|
|
1159
|
+
declare const HISD3FormMentions: React.ForwardRefExoticComponent<Omit<HISD3FormMentionsProps, "ref"> & React.RefAttributes<MentionsRef>>;
|
|
1160
|
+
type HISD3CascaderRef = GetRef<typeof Cascader>;
|
|
1161
|
+
type HISD3FormCascaderProps = HISD3FormFieldProps<CascaderAutoProps>;
|
|
1162
|
+
/** Hierarchical select (e.g. region → province → city). The value is the path array. */
|
|
1163
|
+
declare const HISD3FormCascader: HISD3FormFieldComponent<HISD3FormCascaderProps, HISD3CascaderRef>;
|
|
1164
|
+
type HISD3TreeSelectRef = GetRef<typeof TreeSelect>;
|
|
1165
|
+
type HISD3FormTreeSelectProps = HISD3FormFieldProps<TreeSelectProps>;
|
|
1166
|
+
/** Select from a tree (`fieldProps.treeData`). */
|
|
1167
|
+
declare const HISD3FormTreeSelect: HISD3FormFieldComponent<HISD3FormTreeSelectProps, HISD3TreeSelectRef>;
|
|
1168
|
+
type HISD3FormSegmentedProps = HISD3FormFieldProps<SegmentedProps>;
|
|
1169
|
+
/** Segmented control (`fieldProps.options`); a compact alternative to radios. */
|
|
1170
|
+
declare const HISD3FormSegmented: React.ForwardRefExoticComponent<Omit<HISD3FormSegmentedProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1171
|
+
type HISD3TransferRef = GetRef<typeof Transfer>;
|
|
1172
|
+
type HISD3FormTransferProps = HISD3FormFieldProps<TransferProps>;
|
|
1173
|
+
/**
|
|
1174
|
+
* Two-list picker. The form value is the right-hand keys (`targetKeys`);
|
|
1175
|
+
* pass the full list as `fieldProps.dataSource`.
|
|
1176
|
+
*/
|
|
1177
|
+
declare const HISD3FormTransfer: HISD3FormFieldComponent<HISD3FormTransferProps, HISD3TransferRef>;
|
|
1178
|
+
type HISD3SliderRef = GetRef<typeof Slider>;
|
|
1179
|
+
type HISD3FormSliderProps = HISD3FormFieldProps<GetProps<typeof Slider>>;
|
|
1180
|
+
/** Slider; `fieldProps.range` makes the value `[min, max]`. */
|
|
1181
|
+
declare const HISD3FormSlider: HISD3FormFieldComponent<HISD3FormSliderProps, HISD3SliderRef>;
|
|
1182
|
+
type HISD3RateRef = GetRef<typeof Rate>;
|
|
1183
|
+
type HISD3FormRateProps = HISD3FormFieldProps<RateProps>;
|
|
1184
|
+
/** Star rating. */
|
|
1185
|
+
declare const HISD3FormRate: HISD3FormFieldComponent<HISD3FormRateProps, HISD3RateRef>;
|
|
1186
|
+
type HISD3FormColorPickerProps = HISD3FormFieldProps<ColorPickerProps>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Colour picker. The form value is the colour as a string in
|
|
1189
|
+
* `fieldProps.format` (hex by default, e.g. "#1677ff"), not antd's Color
|
|
1190
|
+
* object. Pass your own `getValueFromEvent` to keep the object instead.
|
|
1191
|
+
*/
|
|
1192
|
+
declare const HISD3FormColorPicker: React.FC<HISD3FormColorPickerProps>;
|
|
1193
|
+
/** Maps Upload's onChange event to its file list, so the form value is `UploadFile[]`. */
|
|
1194
|
+
declare const normalizeUploadFileList: (e: unknown) => UploadFile[];
|
|
1195
|
+
interface HISD3FormUploadProps extends HISD3FormFieldProps<UploadProps> {
|
|
1196
|
+
/** The trigger, e.g. a "Select file" button. */
|
|
1197
|
+
children?: React.ReactNode;
|
|
1198
|
+
}
|
|
1199
|
+
/** File upload. The form value is the `UploadFile[]` list. */
|
|
1200
|
+
declare const HISD3FormUpload: React.FC<HISD3FormUploadProps>;
|
|
1201
|
+
/** Drag-and-drop upload area. The form value is the `UploadFile[]` list. */
|
|
1202
|
+
declare const HISD3FormUploadDragger: React.FC<HISD3FormUploadProps>;
|
|
1063
1203
|
|
|
1064
1204
|
/**
|
|
1065
1205
|
* Open a drawer or modal from anywhere, without the page holding its state.
|
|
@@ -1119,5 +1259,5 @@ declare const HISD3_LAYOUT: {
|
|
|
1119
1259
|
readonly pageGutter: 28;
|
|
1120
1260
|
};
|
|
1121
1261
|
|
|
1122
|
-
export { AppAnimateGroups, AppAnimates, AppMotionAnimate, AuthType, DialogProvider, Fonts, FooterType, HISD3AvatarMenu, HISD3Button, HISD3HeaderActions, HISD3Input, HISD3LoginPage, HISD3NotificationButton, HISD3PageBody, HISD3PageHeader, HISD3Provider, HISD3SearchInput, 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, resolvePrimary, shade, tint, useDialog, useInsideHISD3Provider };
|
|
1123
|
-
export type { DialogOwnProps, DialogProps, DialogResult, HISD3AvatarMenuProps, HISD3Borders, HISD3BreadcrumbItem, HISD3ButtonProps, HISD3ButtonVariant, HISD3HeaderActionsProps, HISD3InputProps, HISD3LoginPageProps, HISD3LoginValues, HISD3MenuItem, HISD3Notification, HISD3NotificationButtonProps, HISD3PageHeaderProps, HISD3Preset, HISD3ProviderProps, HISD3SearchInputProps, HISD3SidebarProps, HISD3TabItem, HISD3TablePagination, HISD3TableProps, HISD3TabsProps, HISD3TagProps, HISD3TagTone, HISD3TagVariant, HISD3ThemeOptions, IUserEmployee, LoginSide, LoginVariant, StyledTheme, UserMenuProps };
|
|
1262
|
+
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, 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 };
|
|
1263
|
+
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, HISD3SidebarProps, HISD3SkeletonInputProps, HISD3SliderRef, HISD3TabItem, HISD3TablePagination, HISD3TableProps, HISD3TabsProps, HISD3TagProps, HISD3TagTone, HISD3TagVariant, HISD3ThemeOptions, HISD3TimePickerRef, HISD3TimeRangePickerRef, HISD3TransferRef, HISD3TreeSelectRef, IUserEmployee, LoginSide, LoginVariant, StyledTheme, UserMenuProps };
|