haze-ui 1.31.0 → 1.32.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 +32 -0
- package/dist/components/Button/Button.js +33 -15
- package/dist/components/Button/ButtonLink.js +12 -21
- package/dist/components/Button/styles.js +2 -2
- package/dist/components/Cascader/Cascader.js +11 -11
- package/dist/components/ColorPicker/ColorPicker.js +4 -4
- package/dist/components/Combobox/Combobox.js +128 -119
- package/dist/components/Command/Command.js +9 -9
- package/dist/components/ConfigProvider/ConfigContext.js +16 -0
- package/dist/components/ConfirmDialog/confirm.js +41 -0
- package/dist/components/ConfirmDialog/index.js +2 -1
- package/dist/components/DataTable/DataTable.js +24 -24
- package/dist/components/DateTimePicker/DateTimePicker.js +25 -0
- package/dist/components/DateTimePicker/index.js +3 -0
- package/dist/components/Datepicker/Datepicker.js +8 -7
- package/dist/components/Datepicker/DatepickerCore.js +60 -59
- package/dist/components/Drawer/Drawer.js +45 -40
- package/dist/components/Fieldset/Fieldset.js +25 -0
- package/dist/components/Fieldset/index.js +2 -0
- package/dist/components/Highlight/Highlight.js +19 -0
- package/dist/components/Highlight/index.js +2 -0
- package/dist/components/Indicator/Indicator.js +37 -0
- package/dist/components/Indicator/index.js +2 -0
- package/dist/components/InlineCompletion/InlineCompletion.js +4 -4
- package/dist/components/Input/Input.js +9 -7
- package/dist/components/Input/InputCore.js +32 -13
- package/dist/components/LoadingOverlay/LoadingOverlay.js +30 -0
- package/dist/components/LoadingOverlay/index.js +3 -0
- package/dist/components/LocaleProvider/ar-sa.js +4 -0
- package/dist/components/LocaleProvider/de-de.js +4 -0
- package/dist/components/LocaleProvider/es-es.js +4 -0
- package/dist/components/LocaleProvider/fr-fr.js +4 -0
- package/dist/components/LocaleProvider/it-it.js +4 -0
- package/dist/components/LocaleProvider/ja-jp.js +4 -0
- package/dist/components/LocaleProvider/ko-kr.js +4 -0
- package/dist/components/LocaleProvider/locale.js +4 -0
- package/dist/components/LocaleProvider/pt-br.js +4 -0
- package/dist/components/LocaleProvider/ru-ru.js +4 -0
- package/dist/components/LocaleProvider/zh-cn.js +4 -0
- package/dist/components/Mark/Mark.js +20 -0
- package/dist/components/Mark/index.js +2 -0
- package/dist/components/Mentions/MentionsCore.js +3 -3
- package/dist/components/Menu/MenuItem.js +6 -4
- package/dist/components/NumberFormatter/NumberFormatter.js +16 -0
- package/dist/components/NumberFormatter/index.js +2 -0
- package/dist/components/OTPInput/OTPInputCore.js +6 -6
- package/dist/components/PasswordInput/PasswordInputCore.js +27 -26
- package/dist/components/Rating/RatingCore.js +18 -18
- package/dist/components/Select/Select.js +28 -23
- package/dist/components/Select/SelectCore.js +26 -23
- package/dist/components/Select/SelectFloating.js +157 -153
- package/dist/components/Spoiler/Spoiler.js +36 -0
- package/dist/components/Spoiler/index.js +3 -0
- package/dist/components/TagGroup/SortableTagGroup.js +32 -20
- package/dist/components/TagGroup/TagGroup.js +23 -9
- package/dist/components/TagGroup/TagGroupItem.js +21 -15
- package/dist/components/TagInput/TagInputCore.js +10 -10
- package/dist/components/TimePicker/TimePickerPanel.js +3 -3
- package/dist/components/Toast/ToastContainer.js +4 -4
- package/dist/components/TreeSelect/TreeSelect.js +6 -6
- package/dist/components/VisuallyHidden/VisuallyHidden.js +15 -0
- package/dist/components/VisuallyHidden/index.js +2 -0
- package/dist/css/accordion.css +2 -0
- package/dist/css/activity-rail.css +2 -0
- package/dist/css/affix.css +2 -0
- package/dist/css/alert.css +2 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/app-shell.css +2 -0
- package/dist/css/approval-card.css +2 -0
- package/dist/css/aspect-ratio.css +2 -0
- package/dist/css/async-section.css +2 -0
- package/dist/css/avatar-group.css +2 -0
- package/dist/css/avatar.css +2 -0
- package/dist/css/back-to-top.css +2 -0
- package/dist/css/badge.css +2 -0
- package/dist/css/banner.css +2 -0
- package/dist/css/bottom-sheet.css +2 -0
- package/dist/css/breadcrumb.css +2 -0
- package/dist/css/button.css +3 -2
- package/dist/css/calendar.css +2 -0
- package/dist/css/card.css +2 -0
- package/dist/css/carousel.css +2 -0
- package/dist/css/cascader.css +2 -0
- package/dist/css/chart.css +2 -0
- package/dist/css/chat-container.css +2 -0
- package/dist/css/chat-input.css +2 -0
- package/dist/css/chat-message.css +2 -0
- package/dist/css/checkbox.css +2 -0
- package/dist/css/chip.css +2 -0
- package/dist/css/code-block.css +2 -0
- package/dist/css/collapsible.css +2 -0
- package/dist/css/color-picker.css +2 -0
- package/dist/css/combobox.css +2 -0
- package/dist/css/command.css +2 -0
- package/dist/css/confirm-dialog.css +2 -0
- package/dist/css/container.css +2 -0
- package/dist/css/context-menu.css +2 -0
- package/dist/css/conversation-list.css +2 -0
- package/dist/css/count-up.css +2 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/date-range-picker.css +2 -0
- package/dist/css/datepicker.css +2 -0
- package/dist/css/descriptions.css +2 -0
- package/dist/css/dialog.css +2 -0
- package/dist/css/diff-viewer.css +2 -0
- package/dist/css/disclosure.css +2 -0
- package/dist/css/divider.css +2 -0
- package/dist/css/drawer.css +2 -0
- package/dist/css/dropdown-menu.css +2 -0
- package/dist/css/ellipsis.css +2 -0
- package/dist/css/empty.css +2 -0
- package/dist/css/fieldset.css +4 -0
- package/dist/css/file-input.css +2 -0
- package/dist/css/file-preview.css +2 -0
- package/dist/css/flex.css +2 -0
- package/dist/css/float-button.css +2 -0
- package/dist/css/form.css +2 -0
- package/dist/css/grid.css +2 -0
- package/dist/css/hover-card.css +2 -0
- package/dist/css/icon.css +2 -0
- package/dist/css/image.css +2 -0
- package/dist/css/indicator.css +4 -0
- package/dist/css/inline-completion.css +2 -0
- package/dist/css/inline-edit.css +2 -0
- package/dist/css/input.css +3 -1
- package/dist/css/json-view.css +2 -0
- package/dist/css/kbd.css +2 -0
- package/dist/css/list.css +2 -0
- package/dist/css/loading-overlay.css +4 -0
- package/dist/css/log-viewer.css +2 -0
- package/dist/css/mark.css +4 -0
- package/dist/css/markdown-renderer.css +2 -0
- package/dist/css/masonry.css +2 -0
- package/dist/css/mentions.css +2 -0
- package/dist/css/menu.css +3 -1
- package/dist/css/model-picker.css +2 -0
- package/dist/css/navigation-bar.css +2 -0
- package/dist/css/number-input.css +2 -0
- package/dist/css/otp-input.css +2 -0
- package/dist/css/pagination.css +2 -0
- package/dist/css/password-input.css +3 -1
- package/dist/css/popover.css +2 -0
- package/dist/css/progress.css +2 -0
- package/dist/css/prompt-input.css +2 -0
- package/dist/css/qr-code.css +2 -0
- package/dist/css/radio.css +2 -0
- package/dist/css/rating.css +2 -0
- package/dist/css/resizable.css +2 -0
- package/dist/css/result.css +2 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/segmented.css +2 -0
- package/dist/css/select.css +2 -0
- package/dist/css/sidebar.css +2 -0
- package/dist/css/signature.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +2 -0
- package/dist/css/sources.css +2 -0
- package/dist/css/sparkline.css +2 -0
- package/dist/css/spinner.css +2 -0
- package/dist/css/spoiler.css +4 -0
- package/dist/css/stat.css +2 -0
- package/dist/css/status-bar.css +2 -0
- package/dist/css/step-timeline.css +2 -0
- package/dist/css/stepper.css +2 -0
- package/dist/css/streaming-text.css +2 -0
- package/dist/css/swipe-action.css +2 -0
- package/dist/css/switch.css +2 -0
- package/dist/css/tab-bar.css +2 -0
- package/dist/css/table.css +2 -0
- package/dist/css/tabs.css +2 -0
- package/dist/css/tag-group.css +2 -0
- package/dist/css/tag-input.css +2 -0
- package/dist/css/tag.css +2 -0
- package/dist/css/textarea.css +2 -0
- package/dist/css/thinking-indicator.css +2 -0
- package/dist/css/time-picker.css +2 -0
- package/dist/css/timeline.css +2 -0
- package/dist/css/toast.css +2 -0
- package/dist/css/toggle.css +2 -0
- package/dist/css/token-counter.css +2 -0
- package/dist/css/tokens.css +2 -0
- package/dist/css/tool-call-card.css +2 -0
- package/dist/css/toolbar.css +2 -0
- package/dist/css/tooltip.css +2 -0
- package/dist/css/tour.css +2 -0
- package/dist/css/transfer.css +2 -0
- package/dist/css/tree-select.css +2 -0
- package/dist/css/tree.css +2 -0
- package/dist/css/typography.css +2 -0
- package/dist/css/upload.css +2 -0
- package/dist/css/virtual-list.css +2 -0
- package/dist/css/visually-hidden.css +4 -0
- package/dist/css/watermark.css +2 -0
- package/dist/css/workbench.css +2 -0
- package/dist/css-manifest.json +186 -1
- package/dist/haze-ui.css +405 -5
- package/dist/headless/index.js +18 -17
- package/dist/hooks/useBusyPressable.js +10 -0
- package/dist/index.js +112 -102
- package/dist/mcp-docs.json +498 -3
- package/dist/registry.json +142 -10
- package/dist/types/components/Button/Button.d.ts +50 -5
- package/dist/types/components/Button/ButtonLink.d.ts +27 -15
- package/dist/types/components/Button/styles.d.ts +34 -0
- package/dist/types/components/Combobox/Combobox.d.ts +20 -2
- package/dist/types/components/Combobox/index.d.ts +1 -1
- package/dist/types/components/ConfigProvider/ConfigContext.d.ts +20 -0
- package/dist/types/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/dist/types/components/ConfirmDialog/confirm.d.ts +33 -0
- package/dist/types/components/ConfirmDialog/index.d.ts +2 -0
- package/dist/types/components/DateTimePicker/DateTimePicker.d.ts +36 -0
- package/dist/types/components/DateTimePicker/index.d.ts +2 -0
- package/dist/types/components/Datepicker/Datepicker.d.ts +3 -3
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +3 -3
- package/dist/types/components/Drawer/Drawer.d.ts +15 -2
- package/dist/types/components/Drawer/index.d.ts +1 -1
- package/dist/types/components/Fieldset/Fieldset.d.ts +16 -0
- package/dist/types/components/Fieldset/index.d.ts +2 -0
- package/dist/types/components/Highlight/Highlight.d.ts +27 -0
- package/dist/types/components/Highlight/index.d.ts +2 -0
- package/dist/types/components/Indicator/Indicator.d.ts +24 -0
- package/dist/types/components/Indicator/index.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +8 -2
- package/dist/types/components/Input/InputCore.d.ts +11 -2
- package/dist/types/components/LoadingOverlay/LoadingOverlay.d.ts +25 -0
- package/dist/types/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +4 -0
- package/dist/types/components/Mark/Mark.d.ts +12 -0
- package/dist/types/components/Mark/index.d.ts +2 -0
- package/dist/types/components/Menu/MenuItem.d.ts +15 -4
- package/dist/types/components/NumberFormatter/NumberFormatter.d.ts +23 -0
- package/dist/types/components/NumberFormatter/index.d.ts +2 -0
- package/dist/types/components/Select/Select.d.ts +23 -2
- package/dist/types/components/Select/SelectCore.d.ts +4 -1
- package/dist/types/components/Select/SelectFloating.d.ts +6 -1
- package/dist/types/components/Select/index.d.ts +1 -1
- package/dist/types/components/Spoiler/Spoiler.d.ts +20 -0
- package/dist/types/components/Spoiler/index.d.ts +2 -0
- package/dist/types/components/TagGroup/SortableTagGroup.d.ts +5 -1
- package/dist/types/components/TagGroup/TagGroup.d.ts +24 -2
- package/dist/types/components/TagGroup/index.d.ts +1 -1
- package/dist/types/components/VisuallyHidden/VisuallyHidden.d.ts +4 -0
- package/dist/types/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/types/headless/index.d.ts +9 -0
- package/dist/types/hooks/index.d.ts +13 -0
- package/dist/types/hooks/useBusyPressable.d.ts +33 -0
- package/dist/types/hooks/useElementSize.d.ts +38 -0
- package/dist/types/hooks/useIdle.d.ts +45 -0
- package/dist/types/hooks/useMutationObserver.d.ts +35 -0
- package/dist/types/hooks/useNetwork.d.ts +31 -0
- package/dist/types/hooks/useOrientation.d.ts +23 -0
- package/dist/types/hooks/useResizeObserver.d.ts +48 -0
- package/dist/types/index.d.ts +24 -6
- package/package.json +5 -5
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ConfirmDialogProps } from './ConfirmDialog';
|
|
3
|
+
/**
|
|
4
|
+
* Options for the imperative confirm — {@link ConfirmDialogProps} minus
|
|
5
|
+
* the wired callbacks (the promise carries the answer, so `onClose`/
|
|
6
|
+
* `onConfirm`/`onCancel` are derived paths, not inputs).
|
|
7
|
+
*/
|
|
8
|
+
type ConfirmOptions = Omit<ConfirmDialogProps, 'onClose' | 'onConfirm' | 'onCancel' | 'open' | 'children'> & {
|
|
9
|
+
/** Dialog body copy. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** Fired when the user confirms (before the promise resolves). */
|
|
12
|
+
onConfirm?: () => void;
|
|
13
|
+
/** Fired when the user cancels or dismisses (before rejection). */
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Imperative promise-based confirm dialog, the AntD `Modal.confirm`
|
|
18
|
+
* shape: mounts a fresh ConfirmDialog into `document.body`, resolves
|
|
19
|
+
* with `true` on confirm, `false` on cancel/dismiss, and unmounts on
|
|
20
|
+
* settle. Safe to call outside React render (event handlers, async
|
|
21
|
+
* flows); not safe during SSR (no-op `false`, no mount).
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* const ok = await confirm({ title: 'Discard draft?', children: '…', variant: 'danger' });
|
|
25
|
+
* if (ok) discard();
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* Each call owns its own React root — multiple confirms stack (they
|
|
29
|
+
* open as sibling dialogs; the top layer negotiates them).
|
|
30
|
+
*/
|
|
31
|
+
declare function confirm(options: ConfirmOptions): Promise<boolean>;
|
|
32
|
+
export { confirm };
|
|
33
|
+
export type { ConfirmOptions };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
2
|
+
import type { DatepickerPreset } from '../Datepicker/DatepickerCore';
|
|
3
|
+
import type { CalendarCellRender } from '../Calendar/Calendar';
|
|
4
|
+
import type { Ref } from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Date+time picker (the Mantine DateTimePicker niche): a date calendar
|
|
7
|
+
* with a time field below it in one popover. This is a thin sugar over
|
|
8
|
+
* Datepicker — `picker` is fixed to `date` (date+time values are apples
|
|
9
|
+
* and day-granularity oranges for week/month/quarter/year modes) and
|
|
10
|
+
* `showTime` defaults to `true`; {@link showSeconds} flips it to the
|
|
11
|
+
* seconds-resolution form.
|
|
12
|
+
*
|
|
13
|
+
* Value serializes as `"YYYY-MM-DD HH:mm"` (or `"YYYY-MM-DD HH:mm:ss"`
|
|
14
|
+
* with `showSeconds`), matching Datepicker's showTime contract.
|
|
15
|
+
*/
|
|
16
|
+
type DateTimePickerProps = {
|
|
17
|
+
value?: ControlOrValue<string>;
|
|
18
|
+
open?: ControlOrValue<boolean>;
|
|
19
|
+
min?: string;
|
|
20
|
+
max?: string;
|
|
21
|
+
/** Disables individual dates on the calendar panel (day granularity). */
|
|
22
|
+
disabledDate?: (date: Date) => boolean;
|
|
23
|
+
/** Shortcut rows at the top of the panel. */
|
|
24
|
+
presets?: DatepickerPreset[];
|
|
25
|
+
/** Include seconds in the time field (value gains a `:ss` part). */
|
|
26
|
+
showSeconds?: boolean;
|
|
27
|
+
locale?: string;
|
|
28
|
+
weekStartsOn?: 0 | 1;
|
|
29
|
+
cellRender?: CalendarCellRender;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
/** Forwarded to the trigger `<input>`. */
|
|
33
|
+
ref?: Ref<HTMLInputElement>;
|
|
34
|
+
};
|
|
35
|
+
export default function DateTimePicker({ value: valueControl, open: openControl, min, max, disabledDate, presets, showSeconds, locale, weekStartsOn, cellRender, placeholder, className, ref, }: DateTimePickerProps): import("react").JSX.Element;
|
|
36
|
+
export type { DateTimePickerProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
import type { CalendarCellRender, CalendarPickerMode } from '../Calendar/Calendar';
|
|
4
4
|
import type { DatepickerPreset } from './DatepickerCore';
|
|
@@ -41,6 +41,6 @@ type DatepickerProps = {
|
|
|
41
41
|
/** Forwarded to the trigger `<input>` (not the wrapper div) — the
|
|
42
42
|
* element form bridges and `ref.current.focus()` reach. */
|
|
43
43
|
ref?: Ref<HTMLInputElement>;
|
|
44
|
-
}
|
|
45
|
-
export default function Datepicker({ value: valueControl, open: openControl, picker, min, max, disabledDate, presets, showTime, format, parse, locale, weekStartsOn, cellRender, placeholder, className, ref, }: DatepickerProps): import("react").JSX.Element;
|
|
44
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'onChange' | 'children'>;
|
|
45
|
+
export default function Datepicker({ value: valueControl, open: openControl, picker, min, max, disabledDate, presets, showTime, format, parse, locale, weekStartsOn, cellRender, placeholder, className, ref, ...rest }: DatepickerProps): import("react").JSX.Element;
|
|
46
46
|
export type { DatepickerProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
2
|
import type { CalendarCellRender, CalendarPickerMode } from '../Calendar/Calendar';
|
|
3
3
|
/** One shortcut row at the top of the dropdown panel: clicking applies
|
|
4
4
|
* `value` (serialized per `picker`) and closes the panel. */
|
|
@@ -66,6 +66,6 @@ type DatepickerCoreProps = {
|
|
|
66
66
|
cellRender?: CalendarCellRender;
|
|
67
67
|
/** Forwarded to the trigger `<input>` (not the wrapper div). */
|
|
68
68
|
ref?: Ref<HTMLInputElement>;
|
|
69
|
-
}
|
|
70
|
-
export default function DatepickerCore({ value, onChange, open, onOpenChange, picker, min, max, disabledDate, presets, showTime, format, parse, locale, weekStartsOn, cellRender, placeholder, className, ref, }: DatepickerCoreProps): import("react").JSX.Element;
|
|
69
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'onChange' | 'children'>;
|
|
70
|
+
export default function DatepickerCore({ value, onChange, open, onOpenChange, picker, min, max, disabledDate, presets, showTime, format, parse, locale, weekStartsOn, cellRender, placeholder, className, ref, ...rest }: DatepickerCoreProps): import("react").JSX.Element;
|
|
71
71
|
export type { DatepickerCoreProps, DatepickerPreset };
|
|
@@ -18,6 +18,17 @@ type DrawerHandle = {
|
|
|
18
18
|
/** Focus the element that held focus when the drawer last opened. */
|
|
19
19
|
focusTrigger: () => void;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Semantic slot classes (AntD v6 `classNames` shape): keys land classes
|
|
23
|
+
* on Drawer's structural parts. Drawer renders a single `<dialog>` —
|
|
24
|
+
* `content` is that element's part (the placement class and any
|
|
25
|
+
* `className` land on the same node). A `classNames` prop set via
|
|
26
|
+
* ConfigProvider merges under the prop's keys.
|
|
27
|
+
*/
|
|
28
|
+
type DrawerClassNames = {
|
|
29
|
+
/** The `<dialog>` panel itself (data-slot='content'). */
|
|
30
|
+
content?: string;
|
|
31
|
+
};
|
|
21
32
|
type DrawerProps = {
|
|
22
33
|
open?: ControlOrValue<boolean>;
|
|
23
34
|
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
@@ -34,8 +45,10 @@ type DrawerProps = {
|
|
|
34
45
|
*/
|
|
35
46
|
viewTransition?: boolean;
|
|
36
47
|
className?: string;
|
|
48
|
+
/** Slot classes (see {@link DrawerClassNames}). */
|
|
49
|
+
classNames?: DrawerClassNames;
|
|
37
50
|
children: ReactNode;
|
|
38
51
|
ref?: Ref<DrawerHandle>;
|
|
39
52
|
};
|
|
40
|
-
export default function Drawer({ open: openControl, placement, onClose, viewTransition, className, children, ref, }: DrawerProps): import("react").JSX.Element;
|
|
41
|
-
export type { DrawerProps, DrawerHandle };
|
|
53
|
+
export default function Drawer({ open: openControl, placement, onClose, viewTransition, className, classNames, children, ref, }: DrawerProps): import("react").JSX.Element;
|
|
54
|
+
export type { DrawerClassNames, DrawerProps, DrawerHandle };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Drawer } from './Drawer';
|
|
2
|
-
export type { DrawerProps, DrawerHandle } from './Drawer';
|
|
2
|
+
export type { DrawerClassNames, DrawerProps, DrawerHandle } from './Drawer';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A semantic `<fieldset>` + `<legend>` grouping for form sections —
|
|
4
|
+
* the native grouping HTML was made for, skinned. Screen readers name
|
|
5
|
+
* the group from the legend on focus entry into any control inside,
|
|
6
|
+
* which is the whole point over a bare div+heading.
|
|
7
|
+
*/
|
|
8
|
+
type FieldsetProps = {
|
|
9
|
+
/** The group's legend text/content — rendered inside `<legend>` so
|
|
10
|
+
* assistive tech names the whole group from it. */
|
|
11
|
+
legend?: ReactNode;
|
|
12
|
+
/** Disables every form control inside (native fieldset semantics). */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
} & Omit<ComponentPropsWithoutRef<'fieldset'>, 'disabled'>;
|
|
15
|
+
export default function Fieldset({ legend: legendContent, disabled, className, children, ...rest }: FieldsetProps): import("react").JSX.Element;
|
|
16
|
+
export type { FieldsetProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type HighlightProps = {
|
|
3
|
+
/** The text to scan. Rendering stays text-level: only matched
|
|
4
|
+
* substrings become `<mark>` children, everything else stays text
|
|
5
|
+
* nodes — no innerHTML, no injection surface. */
|
|
6
|
+
children: string;
|
|
7
|
+
/** One or more substrings to mark (empty strings are ignored). */
|
|
8
|
+
highlight: string | string[];
|
|
9
|
+
/**
|
|
10
|
+
* Case sensitivity of the match. Default `false` (the search-box
|
|
11
|
+
* convention: queries match regardless of letter case).
|
|
12
|
+
*/
|
|
13
|
+
caseSensitive?: boolean;
|
|
14
|
+
/** Mark tone applied to every matched run. */
|
|
15
|
+
color?: 'warning' | 'primary' | 'success' | 'danger';
|
|
16
|
+
} & Omit<ComponentPropsWithoutRef<'mark'>, 'children' | 'color'>;
|
|
17
|
+
/**
|
|
18
|
+
* Highlights matching substrings inside a text run by wrapping them in
|
|
19
|
+
* {@link Mark} elements — the search-results affordance. Pure text in,
|
|
20
|
+
* text + marks out; non-string children are rejected by the type.
|
|
21
|
+
*
|
|
22
|
+
* Renders plain text (no wrapper DOM of its own): the outer container
|
|
23
|
+
* is a fragment and each match is a `<Mark data-slot="mark">`, so the
|
|
24
|
+
* data-slot namespace stays the shared `mark` slot.
|
|
25
|
+
*/
|
|
26
|
+
export default function Highlight({ children, highlight, caseSensitive, color, ...rest }: HighlightProps): import("react").JSX.Element;
|
|
27
|
+
export type { HighlightProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Corner badge attached to a host element (avatar, icon button, tab) —
|
|
4
|
+
* the notification-dot affordance. Render without `label` for a plain
|
|
5
|
+
* dot; pass `label` for a count badge.
|
|
6
|
+
*/
|
|
7
|
+
type IndicatorProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Badge content. Omitted (undefined / null, or render-empty values
|
|
10
|
+
* like false / '') renders a dot (a bare status marker); a value
|
|
11
|
+
* renders a count badge. Strings longer than `max`-formatted are the
|
|
12
|
+
* caller's concern (e.g. pass "99+").
|
|
13
|
+
*/
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
/** Zero/out semantics: number 0 shows by default in badge mode. */
|
|
16
|
+
showZero?: boolean;
|
|
17
|
+
/** Badge tone. */
|
|
18
|
+
color?: 'primary' | 'danger' | 'success' | 'warning';
|
|
19
|
+
/** Corner placement of the badge. */
|
|
20
|
+
position?: 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
} & Omit<ComponentPropsWithoutRef<'span'>, 'color' | 'content'>;
|
|
23
|
+
export default function Indicator({ label, showZero, color, position, className, children, ...rest }: IndicatorProps): import("react").JSX.Element;
|
|
24
|
+
export type { IndicatorProps };
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
type InputProps = {
|
|
4
4
|
value?: ControlOrValue<string>;
|
|
5
5
|
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
/** Content rendered inside the field at the leading edge (icon,
|
|
7
|
+
* currency glyph, …). See InputCore for the layout contract. */
|
|
8
|
+
leftSection?: ReactNode;
|
|
9
|
+
/** Same as `leftSection`, at the trailing edge — the conventional
|
|
10
|
+
* home of clear buttons and visibility toggles. */
|
|
11
|
+
rightSection?: ReactNode;
|
|
6
12
|
/** Forwarded to the underlying `<input>` — the element form bridges
|
|
7
13
|
* (react-f0rm `focusRef`), tests and `ref.current.focus()` reach. */
|
|
8
14
|
ref?: Ref<HTMLInputElement>;
|
|
9
15
|
} & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'size'>;
|
|
10
|
-
export default function Input({ value: valueControl, size, className, onChange, ref, ...rest }: InputProps): import("react").JSX.Element;
|
|
16
|
+
export default function Input({ value: valueControl, size, className, leftSection, rightSection, onChange, ref, ...rest }: InputProps): import("react").JSX.Element;
|
|
11
17
|
export type { InputProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
2
|
type InputCoreProps = {
|
|
3
3
|
value: string;
|
|
4
4
|
onChange: (value: string) => void;
|
|
@@ -8,8 +8,17 @@ type InputCoreProps = {
|
|
|
8
8
|
onNativeChange?: ComponentPropsWithoutRef<'input'>['onChange'];
|
|
9
9
|
size?: 'sm' | 'md' | 'lg';
|
|
10
10
|
className?: string;
|
|
11
|
+
/** Content rendered inside the field, before the text — an icon, a
|
|
12
|
+
* currency glyph, a search marker. Layout sits in a flex row with the
|
|
13
|
+
* input; the field keeps its border and focus ring (the box stays
|
|
14
|
+
* one visual unit). Interactive children must re-enable pointer
|
|
15
|
+
* events themselves (see PasswordInput's visibility toggle). */
|
|
16
|
+
leftSection?: ReactNode;
|
|
17
|
+
/** Same as {@link InputCoreProps.leftSection}, at the trailing edge —
|
|
18
|
+
* the conventional home of clear buttons and visibility toggles. */
|
|
19
|
+
rightSection?: ReactNode;
|
|
11
20
|
/** Forwarded to the `<input>` element. */
|
|
12
21
|
ref?: Ref<HTMLInputElement>;
|
|
13
22
|
} & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'size'>;
|
|
14
|
-
export default function InputCore({ value, onChange, onNativeChange, size, className, ref, ...rest }: InputCoreProps): import("react").JSX.Element;
|
|
23
|
+
export default function InputCore({ value, onChange, onNativeChange, size, className, leftSection, rightSection, ref, ...rest }: InputCoreProps): import("react").JSX.Element;
|
|
15
24
|
export type { InputCoreProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Container-level loading state: dims the wrapped content and centers a
|
|
4
|
+
* spinner above it. The content stays in the tree and keeps its place
|
|
5
|
+
* in the focus order — deliberately, so focus survives the overlay
|
|
6
|
+
* (`aria-busy` on the wrapper is the AT channel, same as the Mantine
|
|
7
|
+
* equivalent). The veil blocks pointer and selection, but nothing here
|
|
8
|
+
* is modal: keyboard users can still reach the content. Consumers that
|
|
9
|
+
* need a full lock gate their own handlers on the same `visible` prop
|
|
10
|
+
* (or host the content in an `inert` subtree).
|
|
11
|
+
*/
|
|
12
|
+
type LoadingOverlayProps = {
|
|
13
|
+
/** Whether the overlay is shown. */
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
/** Optional announcement text rendered inside a visually-paired label
|
|
16
|
+
* under the spinner for sighted context. */
|
|
17
|
+
label?: ReactNode;
|
|
18
|
+
/** Swap the default Spinner. */
|
|
19
|
+
loader?: ReactNode;
|
|
20
|
+
/** Spinner size (when the default loader is used). */
|
|
21
|
+
spinnerSize?: 'sm' | 'md' | 'lg';
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
24
|
+
export default function LoadingOverlay({ visible, label, loader, spinnerSize, className, children, ...rest }: LoadingOverlayProps): import("react").JSX.Element;
|
|
25
|
+
export type { LoadingOverlayProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type MarkProps = {
|
|
3
|
+
/** Highlight tone — maps to the semantic status tokens. */
|
|
4
|
+
color?: 'warning' | 'primary' | 'success' | 'danger';
|
|
5
|
+
} & Omit<ComponentPropsWithoutRef<'mark'>, 'color'>;
|
|
6
|
+
/**
|
|
7
|
+
* Text-level highlight — the semantic `<mark>` skinned with the status
|
|
8
|
+
* tokens. For search-result highlighting of arbitrary substrings use
|
|
9
|
+
* Highlight, which composes this element.
|
|
10
|
+
*/
|
|
11
|
+
export default function Mark({ color, className, ...rest }: MarkProps): import("react").JSX.Element;
|
|
12
|
+
export type { MarkProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
type
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
2
|
+
type MenuItemOwnProps = {
|
|
3
3
|
onSelect?: () => void;
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
/** Danger skin for destructive actions: danger-colored text and interaction states. */
|
|
@@ -11,5 +11,16 @@ type MenuItemProps = {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Polymorphic like Button's `as`: the item skin and the menuitem wiring
|
|
16
|
+
* (role, roving tabIndex, disabled/aria handling) always land on the
|
|
17
|
+
* rendered element; the target's own props flow through. `as='a'`
|
|
18
|
+
* renders a navigation menuitem with link semantics (href).
|
|
19
|
+
*/
|
|
20
|
+
type MenuItemProps<T extends ElementType = 'button'> = MenuItemOwnProps & {
|
|
21
|
+
/** Render element — 'button' (default) or 'a' (or a router Link
|
|
22
|
+
* component forwarding props to an anchor). */
|
|
23
|
+
as?: T;
|
|
24
|
+
} & Omit<ComponentPropsWithRef<T>, keyof MenuItemOwnProps | 'as'>;
|
|
25
|
+
export default function MenuItem<T extends ElementType = 'button'>({ onSelect, disabled, danger, icon, kbdLabel, className, children, as, ...rest }: MenuItemProps<T>): import("react").JSX.Element;
|
|
26
|
+
export type { MenuItemOwnProps, MenuItemProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type NumberFormatterProps = {
|
|
3
|
+
/** The numeric value to render. */
|
|
4
|
+
value: number;
|
|
5
|
+
/** Intl.NumberFormat options minus locale. */
|
|
6
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
7
|
+
/** Explicit locale. Defaults to the runtime default (SSR-stable).
|
|
8
|
+
*
|
|
9
|
+
* Note: this formatter is RSC-safe (no hooks) and therefore does NOT
|
|
10
|
+
* read the LocaleProvider chain — pass `locale` explicitly inside a
|
|
11
|
+
* localized tree. */
|
|
12
|
+
locale?: string;
|
|
13
|
+
/** Text prepended/appended outside the formatted number. */
|
|
14
|
+
prefix?: string;
|
|
15
|
+
suffix?: string;
|
|
16
|
+
} & Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'prefix'>;
|
|
17
|
+
/**
|
|
18
|
+
* Presentational number formatting — a thin, token-free numeric text
|
|
19
|
+
* node driven by Intl. Stat's display value is the styled display
|
|
20
|
+
* surface; this is the formatter for inline text ("共 12,345 条").
|
|
21
|
+
*/
|
|
22
|
+
export default function NumberFormatter({ value, formatOptions, locale, prefix, suffix, ...rest }: NumberFormatterProps): import("react").JSX.Element;
|
|
23
|
+
export type { NumberFormatterProps };
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
3
|
import type { SelectVirtualizedConfig } from './SelectFloating';
|
|
4
|
+
/**
|
|
5
|
+
* Semantic slot classes (AntD v6 `classNames` shape), following the
|
|
6
|
+
* data-slot names: `trigger` is the focusable control (native `<select>`
|
|
7
|
+
* in plain mode, trigger `<button>` in floating modes); `content` is the
|
|
8
|
+
* floating panel; `option`, `clearButton`, `item`, `searchInput` cover
|
|
9
|
+
* the rest. Slots not rendered by the current mode are ignored. A
|
|
10
|
+
* ConfigProvider `Select.classNames` section merges under the prop.
|
|
11
|
+
*/
|
|
12
|
+
type SelectClassNames = {
|
|
13
|
+
trigger?: string;
|
|
14
|
+
content?: string;
|
|
15
|
+
option?: string;
|
|
16
|
+
clearButton?: string;
|
|
17
|
+
/** Selected-value chip in multiple mode (data-slot='item'). */
|
|
18
|
+
item?: string;
|
|
19
|
+
/** Panel-top filter input in searchable mode (data-slot='input'). */
|
|
20
|
+
searchInput?: string;
|
|
21
|
+
};
|
|
4
22
|
type SelectProps = {
|
|
5
23
|
/** `string` in single mode, `string[]` when `multiple` is set. */
|
|
6
24
|
value?: ControlOrValue<string | string[]>;
|
|
@@ -70,6 +88,9 @@ type SelectProps = {
|
|
|
70
88
|
*/
|
|
71
89
|
placeholder?: string;
|
|
72
90
|
size?: 'sm' | 'md' | 'lg';
|
|
91
|
+
/** Slot classes (see {@link SelectClassNames}); merged over any
|
|
92
|
+
* ConfigProvider `Select.classNames` section, per key. */
|
|
93
|
+
classNames?: SelectClassNames;
|
|
73
94
|
/**
|
|
74
95
|
* Forwarded to the focusable element — the native `<select>` in plain
|
|
75
96
|
* and clearable single mode, the trigger `<button>` when `multiple`
|
|
@@ -79,5 +100,5 @@ type SelectProps = {
|
|
|
79
100
|
ref?: Ref<HTMLSelectElement | HTMLButtonElement>;
|
|
80
101
|
children: ReactNode;
|
|
81
102
|
} & Omit<ComponentPropsWithoutRef<'select'>, 'value' | 'size' | 'multiple'>;
|
|
82
|
-
export default function Select({ value: valueControl, multiple, searchable, clearable, loading, onSearch, maxTagCount, virtualized, size, className, children, onChange, onValuesChange, placeholder, ref, ...rest }: SelectProps): import("react").JSX.Element;
|
|
83
|
-
export type { SelectProps };
|
|
103
|
+
export default function Select({ value: valueControl, multiple, searchable, clearable, loading, onSearch, maxTagCount, virtualized, size, className, classNames, children, onChange, onValuesChange, placeholder, ref, ...rest }: SelectProps): import("react").JSX.Element;
|
|
104
|
+
export type { SelectClassNames, SelectProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
2
|
import type { SelectVirtualizedConfig } from './SelectFloating';
|
|
3
|
+
import type { SelectClassNames } from './Select';
|
|
3
4
|
type SelectCoreProps = {
|
|
4
5
|
/** `string` in single mode, `string[]` when `multiple` is set. */
|
|
5
6
|
value: string | string[];
|
|
@@ -75,6 +76,8 @@ type SelectCoreProps = {
|
|
|
75
76
|
virtualized?: boolean | SelectVirtualizedConfig;
|
|
76
77
|
children: ReactNode;
|
|
77
78
|
className?: string;
|
|
79
|
+
/** Slot classes (see SelectProps.classNames in ./Select). */
|
|
80
|
+
classNames?: SelectClassNames;
|
|
78
81
|
/**
|
|
79
82
|
* Forwarded to the focusable element — the native `<select>` in plain
|
|
80
83
|
* and clearable single mode, the trigger `<button>` when `multiple`
|
|
@@ -82,5 +85,5 @@ type SelectCoreProps = {
|
|
|
82
85
|
*/
|
|
83
86
|
ref?: Ref<HTMLSelectElement | HTMLButtonElement>;
|
|
84
87
|
} & Omit<ComponentPropsWithoutRef<'select'>, 'value' | 'onChange' | 'size' | 'multiple'>;
|
|
85
|
-
export default function SelectCore({ value, onChange, onNativeChange, multiple, searchable, clearable, loading, onSearch, maxTagCount, size, virtualized, className, placeholder, children, ref, ...rest }: SelectCoreProps): import("react").JSX.Element;
|
|
88
|
+
export default function SelectCore({ value, onChange, onNativeChange, multiple, searchable, clearable, loading, onSearch, maxTagCount, size, virtualized, className, classNames, placeholder, children, ref, ...rest }: SelectCoreProps): import("react").JSX.Element;
|
|
86
89
|
export type { SelectCoreProps };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
|
+
import type { SelectClassNames } from './Select';
|
|
2
3
|
import type { SelectEntryData } from './select-options';
|
|
3
4
|
/** Metrics override for the `virtualized` option list of the floating
|
|
4
5
|
* Select paths (multiple, or single with `searchable`). */
|
|
@@ -37,6 +38,10 @@ type SelectFloatingProps = {
|
|
|
37
38
|
/** Falls back to the `select.placeholder` locale string. */
|
|
38
39
|
placeholder?: string;
|
|
39
40
|
size?: 'sm' | 'md' | 'lg';
|
|
41
|
+
/** Slot classes, following data-slot names (see SelectProps.classNames
|
|
42
|
+
* in ./Select; the Select wrapper merges its ConfigProvider section
|
|
43
|
+
* under this prop already). */
|
|
44
|
+
classNames?: SelectClassNames;
|
|
40
45
|
/**
|
|
41
46
|
* Render a search input at the top of the panel that filters the
|
|
42
47
|
* options (case-insensitive substring over the label text). Typing
|
|
@@ -90,5 +95,5 @@ type SelectFloatingProps = {
|
|
|
90
95
|
/** Forwarded to the trigger `<button>` element. */
|
|
91
96
|
ref?: Ref<HTMLButtonElement>;
|
|
92
97
|
} & Omit<ComponentPropsWithoutRef<'button'>, 'value' | 'onChange' | 'size' | 'type' | 'children'>;
|
|
93
|
-
export default function SelectFloating({ value, onChange, entries, multiple, placeholder, searchable, clearable, loading, onSearch, maxTagCount, size, virtualized, className, ref, ...rest }: SelectFloatingProps): import("react").JSX.Element;
|
|
98
|
+
export default function SelectFloating({ value, onChange, entries, multiple, placeholder, searchable, clearable, loading, onSearch, maxTagCount, size, virtualized, className, classNames, ref, ...rest }: SelectFloatingProps): import("react").JSX.Element;
|
|
94
99
|
export type { SelectFloatingProps, SelectVirtualizedConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Select } from './Select';
|
|
2
|
-
export type { SelectProps } from './Select';
|
|
2
|
+
export type { SelectClassNames, SelectProps } from './Select';
|
|
3
3
|
export { default as SelectCore } from './SelectCore';
|
|
4
4
|
export type { SelectCoreProps } from './SelectCore';
|
|
5
5
|
export { default as Option } from './Option';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
/**
|
|
4
|
+
* Collapsed-long-content gate ("show more / less"). The content box is
|
|
5
|
+
* height-capped while collapsed with a fade at the cut edge; the toggle
|
|
6
|
+
* button flips the state. Controllable via ControlOrValue<boolean>.
|
|
7
|
+
*/
|
|
8
|
+
type SpoilerProps = {
|
|
9
|
+
/** Collapsed/expanded state — see useControl (initial boolean). */
|
|
10
|
+
expanded?: ControlOrValue<boolean>;
|
|
11
|
+
/** Max height in px of the collapsed content preview. */
|
|
12
|
+
maxHeight?: number;
|
|
13
|
+
/** Toggle copy override (defaults to the spoiler locale strings). */
|
|
14
|
+
showLabel?: string;
|
|
15
|
+
hideLabel?: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
19
|
+
export default function Spoiler({ expanded: expandedControl, maxHeight, showLabel, hideLabel, className, children, ...rest }: SpoilerProps): import("react").JSX.Element;
|
|
20
|
+
export type { SpoilerProps };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import { type TagGroupClassNames } from './TagGroup';
|
|
2
3
|
/**
|
|
3
4
|
* Drag-and-drop reorderable variant of TagGroup — built on @dnd-kit
|
|
4
5
|
* (a haze-ui dependency), so this module statically imports the dnd
|
|
@@ -10,6 +11,9 @@ import type { ReactNode } from 'react';
|
|
|
10
11
|
type SortableTagGroupProps = {
|
|
11
12
|
children: ReactNode;
|
|
12
13
|
className?: string;
|
|
14
|
+
/** Slot classes — same contract as TagGroup's `classNames`; item-level
|
|
15
|
+
* keys are inherited by the TagGroupItem children. */
|
|
16
|
+
classNames?: TagGroupClassNames;
|
|
13
17
|
/**
|
|
14
18
|
* Receives `nextOrder` — the new sequence of original child indices —
|
|
15
19
|
* after a completed drag. Reorder the children you pass accordingly;
|
|
@@ -17,5 +21,5 @@ type SortableTagGroupProps = {
|
|
|
17
21
|
*/
|
|
18
22
|
onReorder?: (nextOrder: number[]) => void;
|
|
19
23
|
};
|
|
20
|
-
export default function SortableTagGroup({ children, className, onReorder, }: SortableTagGroupProps): import("react").JSX.Element;
|
|
24
|
+
export default function SortableTagGroup({ children, className, classNames, onReorder, }: SortableTagGroupProps): import("react").JSX.Element;
|
|
21
25
|
export type { SortableTagGroupProps };
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
/** Item-level slot classes flow group → item without prop drilling.
|
|
3
|
+
* Default `undefined` — the same as no slot classes set anywhere. */
|
|
4
|
+
declare const TagGroupItemClassNamesContext: import("react").Context<TagGroupClassNames | undefined>;
|
|
5
|
+
/**
|
|
6
|
+
* Semantic slot classes for TagGroup (AntD v6 `classNames` shape; keys
|
|
7
|
+
* follow the data-slot names). `item`/`removeButton` forward onto every
|
|
8
|
+
* TagGroupItem child through context, so row-level skins are set once
|
|
9
|
+
* on the group. A ConfigProvider `TagGroup.classNames` section merges
|
|
10
|
+
* under the prop, per key.
|
|
11
|
+
*/
|
|
12
|
+
type TagGroupClassNames = {
|
|
13
|
+
/** The group wrapper (data-slot='tag-group'). */
|
|
14
|
+
root?: string;
|
|
15
|
+
/** Every item's chip span (data-slot='tag-group-item'). */
|
|
16
|
+
item?: string;
|
|
17
|
+
/** Every item's remove button (data-slot='remove-button'). */
|
|
18
|
+
removeButton?: string;
|
|
19
|
+
};
|
|
2
20
|
type TagGroupProps = {
|
|
3
21
|
children: ReactNode;
|
|
4
22
|
className?: string;
|
|
23
|
+
/** Slot classes (see {@link TagGroupClassNames}); item-level keys are
|
|
24
|
+
* inherited by the TagGroupItem children. */
|
|
25
|
+
classNames?: TagGroupClassNames;
|
|
5
26
|
};
|
|
6
27
|
/** Plain non-draggable tag row. For drag-and-drop reordering use
|
|
7
28
|
* SortableTagGroup (which statically imports the @dnd-kit runtime);
|
|
8
29
|
* this base component stays free of the dnd runtime. */
|
|
9
|
-
export default function TagGroup({ children, className }: TagGroupProps): import("react").JSX.Element;
|
|
10
|
-
export
|
|
30
|
+
export default function TagGroup({ children, className, classNames }: TagGroupProps): import("react").JSX.Element;
|
|
31
|
+
export { TagGroupItemClassNamesContext };
|
|
32
|
+
export type { TagGroupClassNames, TagGroupProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as TagGroup } from './TagGroup';
|
|
2
2
|
export { default as TagGroupItem } from './TagGroupItem';
|
|
3
3
|
export { default as SortableTagGroup } from './SortableTagGroup';
|
|
4
|
-
export type { TagGroupProps } from './TagGroup';
|
|
4
|
+
export type { TagGroupClassNames, TagGroupProps } from './TagGroup';
|
|
5
5
|
export type { TagGroupItemProps } from './TagGroupItem';
|
|
6
6
|
export type { SortableTagGroupProps } from './SortableTagGroup';
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* major version. The primitives still evolve alongside the library's
|
|
18
18
|
* own components, within that contract.
|
|
19
19
|
*/
|
|
20
|
+
import { useBusyPressable } from '../hooks/useBusyPressable';
|
|
20
21
|
import { useClickOutside } from '../hooks/useClickOutside';
|
|
21
22
|
import { hotkey, useHotkeys } from '../hooks/useHotkeys';
|
|
22
23
|
import { useInView } from '../hooks/useInView';
|
|
@@ -378,6 +379,14 @@ export type { UseInViewOptions } from '../hooks/useInView';
|
|
|
378
379
|
* get a stable `false` instead of a throw.
|
|
379
380
|
*/
|
|
380
381
|
export { useMediaQuery };
|
|
382
|
+
/**
|
|
383
|
+
* Props bag for a pressable that can enter a busy/loading state —
|
|
384
|
+
* `disabled` forced while busy, `aria-busy` mirrored. The behavior
|
|
385
|
+
* half of `Button`'s/`ButtonLink`'s `loading` prop, for consumers
|
|
386
|
+
* composing their own trigger. Anchors translate `disabled` to
|
|
387
|
+
* `aria-disabled` (see ButtonLink).
|
|
388
|
+
*/
|
|
389
|
+
export { useBusyPressable };
|
|
381
390
|
/**
|
|
382
391
|
* The value from the previous render; `undefined` on the first.
|
|
383
392
|
* Compared by identity per render — no deep equality.
|