@jfrader/ui 0.3.0 → 0.5.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 +2 -0
- package/dist/{accordion-Bd-j04hW.js → accordion-xCI_u0BV.js} +2 -2
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-B58xempt.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-group-DOQQuV51.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/bottom-sheet-DPJBFkie.js +673 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-Cfw_hgt2.js} +1 -1
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-C92uYFJW.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-B3Svu0X2.js +447 -0
- package/dist/calendar.js +1 -1
- package/dist/carousel-IvPqN-oM.js +472 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-cFquiSdy.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DTQd_M-G.js +289 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-ahnRi-g8.js +292 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-Bhzvu9ma.js +334 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BQ5LleGb.js +384 -0
- package/dist/command-palette.js +1 -1
- package/dist/copy-button-ByiA6D3R.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-5zKSSuFF.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-B5uFWsm-.js +562 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-ciiv9H2b.js} +19 -19
- package/dist/dialog.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-C-qJcZ14.js +340 -0
- package/dist/expandable-card.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-pR4v7owg.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-D5KEKTSe.js +312 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-B-nrCIy2.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-ciuhPtQZ.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +79 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-BcySQfjZ.js +798 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-BcQKX2EJ.js +599 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-xwOOUtWP.js +275 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card-Bh9K4fZs.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-Pce_IYnz.js +590 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-sP5fiuQS.js} +4 -4
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-SeUyyEPD.js +64 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-DmXZ8E85.js} +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/popover-QHcEvf9c.js +119 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-CbOWBUdA.js} +4 -4
- package/dist/progress.js +1 -1
- package/dist/radio-cards-D2QZENI_.js +455 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-E6mMRgo7.js} +4 -4
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-BhjUVXZZ.js +519 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-IxF0IJXm.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-yO1K1nbi.js +326 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-n_H52W1Z.js +292 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-q2SAsrdD.js +640 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-t0B5cecO.js +477 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-tirqlLY2.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-Cb3EHs64.js +268 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-DiZC57-3.js +418 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/{switch-Dr-qjmT4.js → switch-qwv8jQnR.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{tabs-CK_g1RKa.js → tabs-CAVJndX1.js} +2 -2
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-C8TWG-tY.js} +6 -5
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-BrW0XcG_.js} +6 -5
- package/dist/textarea.js +1 -1
- package/dist/theme-root-BbTBuLMQ.js +46 -0
- package/dist/theme-root.js +1 -1
- package/dist/theme-scope-t7nAKc2c.js +27 -0
- package/dist/time-picker-Db8D49cP.js +305 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-k3nURuCP.js +618 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-BHxI32ZA.js +352 -0
- package/dist/toast-stack-DqrAzdg5.js +183 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-fcjzpifI.js} +4 -4
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CkeiW9C1.js +113 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-C2liIxqy.js +360 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +23 -5
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider.d.ts +70 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/theme-root/theme-root.d.ts +9 -3
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +40 -0
- package/dist/types/overlay/overlay-layer.d.ts +33 -0
- package/dist/types/overlay/overlay-portal.d.ts +7 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +11 -1
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme-scope.d.ts +19 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-DvJifLpF.js +31 -0
- package/package.json +175 -3
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DrmjBbo7.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-ClUYBIBh.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-DU60SMdt.js +0 -216
- package/dist/popover-BtN_0ejj.js +0 -113
- package/dist/select-BCS0-LVW.js +0 -286
- package/dist/theme-root-BiXXvQvr.js +0 -42
- package/dist/toast-iqelR-r0.js +0 -282
- package/dist/tooltip-CB-HC1js.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-efeqppiw.js +0 -19
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
export type FileDropzoneSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
export type FileDropzoneUploadStatus = 'idle' | 'uploading' | 'uploaded' | 'failed';
|
|
6
|
+
export interface FileDropzoneItem {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
size: number;
|
|
10
|
+
file?: File;
|
|
11
|
+
preview?: string;
|
|
12
|
+
uploaded?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface FileRejection {
|
|
15
|
+
file: File;
|
|
16
|
+
code: 'type' | 'size' | 'count' | 'custom';
|
|
17
|
+
message: string;
|
|
18
|
+
}
|
|
19
|
+
export type FileDropzoneUpload = (item: FileDropzoneItem, context: {
|
|
20
|
+
signal: AbortSignal;
|
|
21
|
+
onProgress: (percent: number) => void;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
export interface FileDropzoneMessages {
|
|
24
|
+
browse: string;
|
|
25
|
+
files: string;
|
|
26
|
+
remove: (name: string) => string;
|
|
27
|
+
retry: (name: string) => string;
|
|
28
|
+
rejection: (code: Exclude<FileRejection['code'], 'custom'>, file: File) => string;
|
|
29
|
+
status: (status: FileDropzoneUploadStatus, name: string) => string;
|
|
30
|
+
added: (count: number) => string;
|
|
31
|
+
removed: (name: string) => string;
|
|
32
|
+
count: (count: number) => string;
|
|
33
|
+
uploadError: string;
|
|
34
|
+
}
|
|
35
|
+
type Slot<E extends keyof React.JSX.IntrinsicElements> = Omit<ComponentPropsWithRef<E>, 'ref' | 'children'> & {
|
|
36
|
+
css?: Interpolation<Theme>;
|
|
37
|
+
};
|
|
38
|
+
export interface FileDropzoneSlotProps {
|
|
39
|
+
root?: Slot<'div'>;
|
|
40
|
+
input?: Slot<'input'>;
|
|
41
|
+
target?: Slot<'div'>;
|
|
42
|
+
/** The native label: the clickable drop surface that names and opens the input. */
|
|
43
|
+
label?: Slot<'label'>;
|
|
44
|
+
browse?: Slot<'span'>;
|
|
45
|
+
description?: Slot<'div'>;
|
|
46
|
+
note?: Slot<'div'>;
|
|
47
|
+
list?: Slot<'ul'>;
|
|
48
|
+
item?: Slot<'li'>;
|
|
49
|
+
preview?: Slot<'img'>;
|
|
50
|
+
progress?: Slot<'div'>;
|
|
51
|
+
action?: Slot<'button'>;
|
|
52
|
+
error?: Slot<'div'>;
|
|
53
|
+
status?: Slot<'div'>;
|
|
54
|
+
}
|
|
55
|
+
export interface FileDropzoneProps extends Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'onChange' | 'children'>, SxProps {
|
|
56
|
+
value?: FileDropzoneItem[];
|
|
57
|
+
defaultValue?: FileDropzoneItem[];
|
|
58
|
+
onValueChange?: (items: FileDropzoneItem[]) => void;
|
|
59
|
+
onReject?: (rejections: FileRejection[]) => void;
|
|
60
|
+
accept?: string;
|
|
61
|
+
multiple?: boolean;
|
|
62
|
+
maxFiles?: number;
|
|
63
|
+
maxSize?: number;
|
|
64
|
+
validate?: (file: File) => string | null;
|
|
65
|
+
onUpload?: FileDropzoneUpload;
|
|
66
|
+
listPlacement?: 'below' | 'inside';
|
|
67
|
+
compactAt?: number;
|
|
68
|
+
label?: ReactNode;
|
|
69
|
+
description?: ReactNode;
|
|
70
|
+
note?: ReactNode;
|
|
71
|
+
dropLabel?: ReactNode;
|
|
72
|
+
error?: ReactNode;
|
|
73
|
+
messages: FileDropzoneMessages;
|
|
74
|
+
locale?: string;
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
readOnly?: boolean;
|
|
77
|
+
required?: boolean;
|
|
78
|
+
size?: FileDropzoneSize;
|
|
79
|
+
paste?: boolean;
|
|
80
|
+
renderFileIcon?: (item: FileDropzoneItem) => ReactNode;
|
|
81
|
+
name?: string;
|
|
82
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
83
|
+
slotProps?: FileDropzoneSlotProps;
|
|
84
|
+
}
|
|
85
|
+
/** The visible surface is the native label of an operable file input; no custom dropzone role.
|
|
86
|
+
* Submit canonical value items, not input.files: drops and accumulated batches are not
|
|
87
|
+
* reflected in native FormData/required. Client validation is a convenience; validate uploads
|
|
88
|
+
* independently on the server. */
|
|
89
|
+
export declare function FileDropzone({ ref, value, defaultValue, onValueChange, onReject, accept, multiple, maxFiles, maxSize, validate, onUpload, listPlacement, compactAt, label, description, note, dropLabel, error, messages, locale, disabled, readOnly, required, size, paste, renderFileIcon, name, inputRef, slotProps, className, sx, onDragEnter, onDragOver, onDragLeave, onDrop, onPaste, ...rest }: FileDropzoneProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
90
|
+
export declare namespace FileDropzone {
|
|
91
|
+
var displayName: string;
|
|
92
|
+
}
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type MouseEventHandler, type ReactNode } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
import { type ButtonProps } from '../button';
|
|
5
|
+
export interface FilterValue {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
valueLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FilterToolbarMessages {
|
|
12
|
+
remove: (filter: FilterValue) => string;
|
|
13
|
+
clear: string;
|
|
14
|
+
}
|
|
15
|
+
export interface FilterControlsState {
|
|
16
|
+
value: readonly FilterValue[];
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
onValueChange: (next: readonly FilterValue[]) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface FilterToolbarProps extends Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'onChange'>, SxProps {
|
|
21
|
+
value?: readonly FilterValue[];
|
|
22
|
+
defaultValue?: readonly FilterValue[];
|
|
23
|
+
onValueChange?: (filters: readonly FilterValue[]) => void;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
label?: string;
|
|
26
|
+
messages?: Partial<FilterToolbarMessages>;
|
|
27
|
+
}
|
|
28
|
+
export interface FilterToolbarControlsProps extends Omit<ComponentPropsWithRef<'div'>, 'children'>, SxProps {
|
|
29
|
+
children?: ReactNode | ((state: FilterControlsState) => ReactNode);
|
|
30
|
+
}
|
|
31
|
+
type StyleSlot = {
|
|
32
|
+
className?: string;
|
|
33
|
+
css?: Interpolation<Theme>;
|
|
34
|
+
};
|
|
35
|
+
export interface FilterToolbarActiveFiltersSlotProps {
|
|
36
|
+
list?: StyleSlot;
|
|
37
|
+
chip?: StyleSlot;
|
|
38
|
+
label?: StyleSlot;
|
|
39
|
+
remove?: StyleSlot;
|
|
40
|
+
}
|
|
41
|
+
export interface FilterToolbarActiveFiltersProps extends Omit<ComponentPropsWithRef<'div'>, 'children'>, SxProps {
|
|
42
|
+
empty?: ReactNode;
|
|
43
|
+
slotProps?: FilterToolbarActiveFiltersSlotProps;
|
|
44
|
+
}
|
|
45
|
+
export interface FilterToolbarClearProps extends Omit<ButtonProps, 'children' | 'onClick' | 'render'> {
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
48
|
+
}
|
|
49
|
+
export interface FilterToolbarResultCountProps extends Omit<ComponentPropsWithRef<'p'>, 'children'>, SxProps {
|
|
50
|
+
count: number | null;
|
|
51
|
+
locale?: Intl.LocalesArgument;
|
|
52
|
+
formatCount?: (count: number, formatted: string) => string;
|
|
53
|
+
loading?: boolean;
|
|
54
|
+
loadingLabel?: string;
|
|
55
|
+
unknownLabel?: string;
|
|
56
|
+
}
|
|
57
|
+
/** A named group with native Tab order. Enter/Space activate remove and clear buttons;
|
|
58
|
+
* the shell does not intercept editing keys or promise roving toolbar navigation. */
|
|
59
|
+
declare function FilterToolbarRoot({ ref, value: valueProp, defaultValue, onValueChange, disabled, label, messages: messagesProp, className, sx, children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, tabIndex, ...rest }: FilterToolbarProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
60
|
+
declare function Controls({ children, className, sx, ...rest }: FilterToolbarControlsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
61
|
+
declare function ActiveFilters({ empty, slotProps, className, sx, ...rest }: FilterToolbarActiveFiltersProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
62
|
+
declare function Clear({ children, onClick, disabled: disabledProp, css: cssProp, ...rest }: FilterToolbarClearProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
63
|
+
declare function ResultCount({ count, locale, formatCount, loading, loadingLabel, unknownLabel, className, sx, ...rest }: FilterToolbarResultCountProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
64
|
+
export declare const FilterToolbar: typeof FilterToolbarRoot & {
|
|
65
|
+
Controls: typeof Controls;
|
|
66
|
+
ActiveFilters: typeof ActiveFilters;
|
|
67
|
+
Clear: typeof Clear;
|
|
68
|
+
ResultCount: typeof ResultCount;
|
|
69
|
+
};
|
|
70
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FilterToolbar, type FilterValue, type FilterControlsState, type FilterToolbarMessages, type FilterToolbarProps, type FilterToolbarControlsProps, type FilterToolbarActiveFiltersProps, type FilterToolbarActiveFiltersSlotProps, type FilterToolbarClearProps, type FilterToolbarResultCountProps, } from './filter-toolbar';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
export type HoldToConfirmTone = 'neutral' | 'accent' | 'danger';
|
|
5
|
+
export type HoldToConfirmSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
export interface HoldToConfirmPartProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
css?: Interpolation<Theme>;
|
|
9
|
+
}
|
|
10
|
+
export interface HoldToConfirmProps extends Omit<ComponentPropsWithRef<'button'>, 'children' | 'value' | 'defaultValue'>, SxProps {
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
confirmedLabel: ReactNode;
|
|
13
|
+
confirmationAnnouncement: string;
|
|
14
|
+
getHoldDescription: (formattedDuration: string) => string;
|
|
15
|
+
locale?: Intl.LocalesArgument;
|
|
16
|
+
duration?: number;
|
|
17
|
+
value?: boolean;
|
|
18
|
+
defaultValue?: boolean;
|
|
19
|
+
onValueChange?: (confirmed: boolean) => void;
|
|
20
|
+
onConfirm: () => void;
|
|
21
|
+
onHoldChange?: (holding: boolean) => void;
|
|
22
|
+
tone?: HoldToConfirmTone;
|
|
23
|
+
size?: HoldToConfirmSize;
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
confirmedIcon?: ReactNode;
|
|
26
|
+
slotProps?: Partial<Record<'face' | 'icon' | 'label' | 'fill' | 'hint' | 'status', HoldToConfirmPartProps>>;
|
|
27
|
+
}
|
|
28
|
+
/** Native button with timed Space/Enter activation. Provide an untimed Dialog alternative in the application. */
|
|
29
|
+
export declare function HoldToConfirm({ ref, label, confirmedLabel, confirmationAnnouncement, getHoldDescription, locale, duration, value, defaultValue, onValueChange, onConfirm, onHoldChange, tone, size, icon, confirmedIcon, disabled, slotProps, className, sx, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onLostPointerCapture, onKeyDown, onKeyUp, onBlur, onClick, onContextMenu, 'aria-describedby': describedBy, ...rest }: HoldToConfirmProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare namespace HoldToConfirm {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode, type HTMLAttributes, type RefCallback } from 'react';
|
|
2
|
+
import { type Placement } from '@floating-ui/react';
|
|
3
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
4
|
+
import { type SxProps } from '../../styling/sx';
|
|
5
|
+
export interface HoverCardProps {
|
|
6
|
+
/** Standalone only: controlled open state. Not allowed inside `HoverCard.Group`. */
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/** Standalone only: initial open state when uncontrolled. Not allowed inside `HoverCard.Group`. */
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
/** Standalone only: open/close requests. Not allowed inside `HoverCard.Group`. */
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
/** Required inside `HoverCard.Group`: this member's unique id. Ignored when standalone. */
|
|
13
|
+
value?: string;
|
|
14
|
+
placement?: Placement;
|
|
15
|
+
/** Hover delay before opening, in ms. Keyboard focus and activation open immediately. */
|
|
16
|
+
openDelay?: number;
|
|
17
|
+
/** Delay before closing after the pointer leaves trigger and card, in ms. */
|
|
18
|
+
closeDelay?: number;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export interface HoverCardGroupProps {
|
|
22
|
+
/** The open member's `value`, or `null` when none is open. */
|
|
23
|
+
value?: string | null;
|
|
24
|
+
defaultValue?: string | null;
|
|
25
|
+
onValueChange?: (value: string | null) => void;
|
|
26
|
+
/** How long the group stays warm after its last card closes, in ms. */
|
|
27
|
+
skipDelay?: number;
|
|
28
|
+
/** Hover delay before opening while the group is warm, in ms. */
|
|
29
|
+
intentDelay?: number;
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/** Props a Trigger `render` callback spreads onto the element it returns (e.g. a link). */
|
|
33
|
+
export interface HoverCardTriggerRenderProps extends HTMLAttributes<HTMLElement> {
|
|
34
|
+
ref: RefCallback<HTMLElement>;
|
|
35
|
+
'data-ui': string;
|
|
36
|
+
}
|
|
37
|
+
export interface HoverCardTriggerProps extends ComponentPropsWithRef<'button'>, SxProps {
|
|
38
|
+
/**
|
|
39
|
+
* Replaces the default button, e.g. with a profile link. Spread ALL supplied props onto the
|
|
40
|
+
* operative element and attach the supplied ref. The ref refers to the rendered element, which
|
|
41
|
+
* need not be a button; its public type remains HTMLButtonElement for compatibility.
|
|
42
|
+
* Native activation is never prevented: a rendered link still navigates on click, Enter or tap.
|
|
43
|
+
* Compact inline links rely on the WCAG 2.5.8 inline exception for target size.
|
|
44
|
+
*/
|
|
45
|
+
render?: (props: HoverCardTriggerRenderProps) => ReactNode;
|
|
46
|
+
}
|
|
47
|
+
export interface HoverCardContentProps extends Omit<ComponentPropsWithRef<'div'>, 'tabIndex'>, SxProps {
|
|
48
|
+
}
|
|
49
|
+
export interface HoverCardStat {
|
|
50
|
+
/** Stable key for the stat. */
|
|
51
|
+
id: string;
|
|
52
|
+
label: ReactNode;
|
|
53
|
+
/** Numbers are formatted with `Intl.NumberFormat`; strings render as given (preformatted). */
|
|
54
|
+
value: string | number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Native attributes for an internal Profile slot element (e.g. `id`, `aria-describedby`,
|
|
58
|
+
* `title`), plus `css` applied after the slot's own styles.
|
|
59
|
+
*/
|
|
60
|
+
export type HoverCardProfilePartProps<Element extends 'div' | 'dl' | 'span' = 'div'> = Omit<ComponentPropsWithRef<Element>, 'children'> & {
|
|
61
|
+
css?: Interpolation<Theme>;
|
|
62
|
+
};
|
|
63
|
+
export interface HoverCardProfileProps extends Omit<ComponentPropsWithRef<'div'>, 'children'>, SxProps {
|
|
64
|
+
/** Visible full identity; also the avatar's initials source. */
|
|
65
|
+
name: string;
|
|
66
|
+
subtitle?: ReactNode;
|
|
67
|
+
bio?: ReactNode;
|
|
68
|
+
/** Image URL for the default Avatar. */
|
|
69
|
+
src?: string;
|
|
70
|
+
/** Custom decorative avatar; replaces the default Avatar when it renders content. */
|
|
71
|
+
avatar?: ReactNode;
|
|
72
|
+
stats?: readonly HoverCardStat[];
|
|
73
|
+
/** Footer line, e.g. a consumer-formatted join date. */
|
|
74
|
+
meta?: ReactNode;
|
|
75
|
+
/** Locale for numeric stats; defaults to the runtime locale. */
|
|
76
|
+
locale?: Intl.LocalesArgument;
|
|
77
|
+
slotProps?: {
|
|
78
|
+
/** The avatar stays decorative: `aria-hidden` is not configurable. */
|
|
79
|
+
avatar?: Omit<HoverCardProfilePartProps<'span'>, 'aria-hidden'>;
|
|
80
|
+
identity?: HoverCardProfilePartProps;
|
|
81
|
+
bio?: HoverCardProfilePartProps;
|
|
82
|
+
stats?: HoverCardProfilePartProps<'dl'>;
|
|
83
|
+
meta?: HoverCardProfilePartProps;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
declare function HoverCardGroup({ value: valueProp, defaultValue, onValueChange, skipDelay, intentDelay, children, }: HoverCardGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
87
|
+
declare function HoverCardRoot(props: HoverCardProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
88
|
+
declare function HoverCardTrigger({ ref, render, 'aria-describedby': ariaDescribedByProp, className, sx, ...rest }: HoverCardTriggerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
89
|
+
declare function HoverCardContent(props: HoverCardContentProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
90
|
+
declare function HoverCardProfile({ ref, name, subtitle, bio, src, avatar, stats, meta, locale, slotProps, className, sx, ...rest }: HoverCardProfileProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
91
|
+
export declare const HoverCard: typeof HoverCardRoot & {
|
|
92
|
+
Trigger: typeof HoverCardTrigger;
|
|
93
|
+
Content: typeof HoverCardContent;
|
|
94
|
+
Profile: typeof HoverCardProfile;
|
|
95
|
+
Group: typeof HoverCardGroup;
|
|
96
|
+
};
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
import { type ButtonProps } from '../button';
|
|
5
|
+
export type ImageCompareOrientation = 'horizontal' | 'vertical';
|
|
6
|
+
type StyleSlot = {
|
|
7
|
+
css?: Interpolation<Theme>;
|
|
8
|
+
};
|
|
9
|
+
type PartSlot = Omit<ComponentPropsWithRef<'div'>, 'children'> & StyleSlot;
|
|
10
|
+
type CaptionSlot = Omit<ComponentPropsWithRef<'span'>, 'children' | 'id' | 'aria-hidden'> & StyleSlot;
|
|
11
|
+
type HandleSlot = Omit<ComponentPropsWithRef<'div'>, 'children' | 'role' | 'tabIndex' | 'aria-orientation' | 'aria-disabled' | 'aria-valuemin' | 'aria-valuemax' | 'aria-valuenow' | 'aria-valuetext'> & StyleSlot;
|
|
12
|
+
type ButtonSlot = Omit<ButtonProps, 'children' | 'type' | 'disabled' | 'aria-disabled' | 'render' | 'sx'>;
|
|
13
|
+
export interface ImageCompareSlotProps {
|
|
14
|
+
frame?: PartSlot;
|
|
15
|
+
before?: PartSlot;
|
|
16
|
+
after?: PartSlot;
|
|
17
|
+
beforeLabel?: CaptionSlot;
|
|
18
|
+
afterLabel?: CaptionSlot;
|
|
19
|
+
divider?: Omit<PartSlot, 'aria-hidden'>;
|
|
20
|
+
/** The `role="slider"` element. Slider naming and descriptions (`aria-label`, `aria-labelledby`, `aria-describedby`) go here. */
|
|
21
|
+
handle?: HandleSlot;
|
|
22
|
+
resetButton?: ButtonSlot;
|
|
23
|
+
}
|
|
24
|
+
export interface ImageCompareProps extends Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'onChange' | 'children'>, SxProps {
|
|
25
|
+
/** Image shown at inline-start (horizontal) or top (vertical). Give it meaningful alt text. */
|
|
26
|
+
before: ReactNode;
|
|
27
|
+
/** Image shown at inline-end (horizontal) or bottom (vertical). Give it meaningful alt text. */
|
|
28
|
+
after: ReactNode;
|
|
29
|
+
/** Percentage of Before visible (controlled). */
|
|
30
|
+
value?: number;
|
|
31
|
+
defaultValue?: number;
|
|
32
|
+
onValueChange?: (value: number) => void;
|
|
33
|
+
/** Completed interaction: pointer release, key press, tap, reset. Reports the request, not acceptance. */
|
|
34
|
+
onValueCommit?: (value: number) => void;
|
|
35
|
+
orientation?: ImageCompareOrientation;
|
|
36
|
+
step?: number;
|
|
37
|
+
largeStep?: number;
|
|
38
|
+
/** Visible captions for Before and After; `false` hides both. */
|
|
39
|
+
labels?: readonly [string, string] | false;
|
|
40
|
+
/** Accessible name of the slider. */
|
|
41
|
+
label?: string;
|
|
42
|
+
valueText?: (value: number, formattedPercent: string) => string;
|
|
43
|
+
locale?: Intl.LocalesArgument;
|
|
44
|
+
aspectRatio?: CSSProperties['aspectRatio'];
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
showReset?: boolean;
|
|
47
|
+
resetLabel?: string;
|
|
48
|
+
slotProps?: ImageCompareSlotProps;
|
|
49
|
+
}
|
|
50
|
+
export declare function ImageCompare({ ref, before, after, value: valueProp, defaultValue, onValueChange, onValueCommit, orientation, step: stepProp, largeStep: largeStepProp, labels, label, valueText, locale, aspectRatio, disabled, showReset, resetLabel, slotProps, className, sx, onKeyDown, ...rest }: ImageCompareProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare namespace ImageCompare {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImageCompare, type ImageCompareProps, type ImageCompareOrientation, type ImageCompareSlotProps, } from './image-compare';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode, type Ref, type TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
export type InlineEditVariant = 'title' | 'body';
|
|
5
|
+
export type InlineEditSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
export type InlineEditPhase = 'idle' | 'saving' | 'saved' | 'failed';
|
|
7
|
+
type ControlElement = HTMLInputElement | HTMLTextAreaElement;
|
|
8
|
+
export interface InlineEditMessages {
|
|
9
|
+
/**
|
|
10
|
+
* Accessible name of the resting trigger; `value` is the persisted value. While it is empty,
|
|
11
|
+
* the visible placeholder follows this text in the name.
|
|
12
|
+
*/
|
|
13
|
+
edit: (context: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}) => string;
|
|
17
|
+
save: string;
|
|
18
|
+
cancel: string;
|
|
19
|
+
retry: string;
|
|
20
|
+
/** Keyboard instructions read with the editor. */
|
|
21
|
+
instructions: (context: {
|
|
22
|
+
multiline: boolean;
|
|
23
|
+
}) => string;
|
|
24
|
+
saving: string;
|
|
25
|
+
saved: string;
|
|
26
|
+
failed: string;
|
|
27
|
+
}
|
|
28
|
+
export interface InlineEditPartProps {
|
|
29
|
+
className?: string;
|
|
30
|
+
css?: Interpolation<Theme>;
|
|
31
|
+
}
|
|
32
|
+
export interface InlineEditSlotProps {
|
|
33
|
+
root?: InlineEditPartProps;
|
|
34
|
+
trigger?: InlineEditPartProps;
|
|
35
|
+
control?: InlineEditPartProps;
|
|
36
|
+
actions?: InlineEditPartProps;
|
|
37
|
+
save?: InlineEditPartProps;
|
|
38
|
+
cancel?: InlineEditPartProps;
|
|
39
|
+
retry?: InlineEditPartProps;
|
|
40
|
+
description?: InlineEditPartProps;
|
|
41
|
+
error?: InlineEditPartProps;
|
|
42
|
+
status?: InlineEditPartProps;
|
|
43
|
+
}
|
|
44
|
+
/** Native attributes and handlers for the editor; value, editability and placeholder stay owned. */
|
|
45
|
+
export interface InlineEditControlProps extends Omit<TextareaHTMLAttributes<ControlElement>, 'value' | 'defaultValue' | 'children' | 'disabled' | 'readOnly' | 'placeholder' | 'cols' | 'dangerouslySetInnerHTML'> {
|
|
46
|
+
}
|
|
47
|
+
export interface InlineEditProps extends Omit<ComponentPropsWithRef<'div'>, 'children' | 'defaultValue' | 'onChange'>, SxProps {
|
|
48
|
+
/** Persisted value shown by the trigger; never the draft. */
|
|
49
|
+
value?: string;
|
|
50
|
+
defaultValue?: string;
|
|
51
|
+
/** Requested once per resolved save, before the close request. */
|
|
52
|
+
onValueChange?: (value: string) => void;
|
|
53
|
+
/** Editing mode, independent from the value. */
|
|
54
|
+
open?: boolean;
|
|
55
|
+
defaultOpen?: boolean;
|
|
56
|
+
onOpenChange?: (open: boolean) => void;
|
|
57
|
+
/** Persists a changed value; a throw or rejection is a failed save. */
|
|
58
|
+
onSave: (next: string) => void | Promise<unknown>;
|
|
59
|
+
/** Accessible name of the editor and part of the trigger's name. */
|
|
60
|
+
label: string;
|
|
61
|
+
/** Returns a nonempty message to block the save and keep the editor open. */
|
|
62
|
+
validate?: (next: string) => string | null | undefined;
|
|
63
|
+
/** Turns the draft into the saved value. Defaults to the draft as typed. */
|
|
64
|
+
normalize?: (draft: string) => string;
|
|
65
|
+
/** Edits in a textarea; Shift+Enter inserts a newline. */
|
|
66
|
+
multiline?: boolean;
|
|
67
|
+
variant?: InlineEditVariant;
|
|
68
|
+
size?: InlineEditSize;
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
readOnly?: boolean;
|
|
71
|
+
/** Saves when focus leaves the whole widget. */
|
|
72
|
+
saveOnBlur?: boolean;
|
|
73
|
+
/** Resting content while the persisted value is empty. */
|
|
74
|
+
placeholder?: ReactNode;
|
|
75
|
+
/** Native placeholder of the editor. */
|
|
76
|
+
inputPlaceholder?: string;
|
|
77
|
+
description?: ReactNode;
|
|
78
|
+
/** External error; while present it marks the editor invalid and blocks saving. */
|
|
79
|
+
error?: ReactNode;
|
|
80
|
+
controlProps?: InlineEditControlProps;
|
|
81
|
+
/** The mounted editor element, or null while resting. */
|
|
82
|
+
controlRef?: Ref<ControlElement>;
|
|
83
|
+
messages?: Partial<InlineEditMessages>;
|
|
84
|
+
editIcon?: ReactNode;
|
|
85
|
+
saveIcon?: ReactNode;
|
|
86
|
+
cancelIcon?: ReactNode;
|
|
87
|
+
slotProps?: InlineEditSlotProps;
|
|
88
|
+
}
|
|
89
|
+
export declare function InlineEdit({ ref, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, onSave, label, validate, normalize, multiline, variant, size, disabled, readOnly, saveOnBlur, placeholder, inputPlaceholder, description, error, controlProps, controlRef, messages: messagesProp, editIcon, saveIcon, cancelIcon, slotProps, className, sx, onBlur, ...rest }: InlineEditProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
90
|
+
export declare namespace InlineEdit {
|
|
91
|
+
var displayName: string;
|
|
92
|
+
}
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type CSSProperties } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
export type JsonValueType = 'object' | 'array' | 'string' | 'number' | 'boolean' | 'null';
|
|
8
|
+
export interface JsonViewerLabels {
|
|
9
|
+
tree: string;
|
|
10
|
+
search: string;
|
|
11
|
+
expandAll: string;
|
|
12
|
+
collapseAll: string;
|
|
13
|
+
previousMatch: string;
|
|
14
|
+
nextMatch: string;
|
|
15
|
+
copyValue: string;
|
|
16
|
+
copyPath: string;
|
|
17
|
+
copied: string;
|
|
18
|
+
copyFailed: string;
|
|
19
|
+
invalidData: string;
|
|
20
|
+
/** Child count chip; `type` tells objects (keys) from arrays (items). */
|
|
21
|
+
count: (count: number, type: 'object' | 'array') => string;
|
|
22
|
+
match: (current: number, total: number, truncated: boolean) => string;
|
|
23
|
+
showMore: (remaining: number) => string;
|
|
24
|
+
}
|
|
25
|
+
export interface JsonViewerPartProps {
|
|
26
|
+
className?: string;
|
|
27
|
+
css?: Interpolation<Theme>;
|
|
28
|
+
}
|
|
29
|
+
export type JsonViewerSlotProps = Partial<Record<'toolbar' | 'search' | 'tree' | 'row' | 'group' | 'value' | 'pathBar' | 'status' | 'action', JsonViewerPartProps>>;
|
|
30
|
+
export interface JsonViewerProps extends Omit<ComponentPropsWithRef<'div'>, 'onSelect' | 'onCopy' | 'defaultValue' | 'children'>, SxProps {
|
|
31
|
+
data: JsonValue;
|
|
32
|
+
rootName?: string;
|
|
33
|
+
expandedValue?: readonly string[];
|
|
34
|
+
defaultExpandedValue?: readonly string[];
|
|
35
|
+
onExpandedValueChange?: (paths: string[]) => void;
|
|
36
|
+
defaultExpandDepth?: number;
|
|
37
|
+
query?: string;
|
|
38
|
+
defaultQuery?: string;
|
|
39
|
+
onQueryChange?: (query: string) => void;
|
|
40
|
+
value?: string;
|
|
41
|
+
defaultValue?: string;
|
|
42
|
+
onValueChange?: (path: string) => void;
|
|
43
|
+
onNodeActivate?: (detail: {
|
|
44
|
+
path: string;
|
|
45
|
+
value: JsonValue;
|
|
46
|
+
type: JsonValueType;
|
|
47
|
+
}) => void;
|
|
48
|
+
searchable?: boolean;
|
|
49
|
+
copyable?: boolean;
|
|
50
|
+
showPath?: boolean;
|
|
51
|
+
pageSize?: number;
|
|
52
|
+
maxMatches?: number;
|
|
53
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
54
|
+
size?: 'sm' | 'md';
|
|
55
|
+
locale?: Intl.LocalesArgument;
|
|
56
|
+
labels?: Partial<JsonViewerLabels>;
|
|
57
|
+
onCopy?: (detail: {
|
|
58
|
+
kind: 'value' | 'path';
|
|
59
|
+
path: string;
|
|
60
|
+
text: string;
|
|
61
|
+
}) => void;
|
|
62
|
+
onCopyError?: (detail: {
|
|
63
|
+
kind: 'value' | 'path';
|
|
64
|
+
path: string;
|
|
65
|
+
error: unknown;
|
|
66
|
+
}) => void;
|
|
67
|
+
slotProps?: JsonViewerSlotProps;
|
|
68
|
+
}
|
|
69
|
+
/** Read-only JSON tree. Search overlays expansion/pages; clearing restores base state.
|
|
70
|
+
* Each expanded treeitem OWNS its child role=group via aria-owns; the group is a DOM sibling
|
|
71
|
+
* (flattened out of the treeitem) so the author name stays scoped to the label — nesting it in
|
|
72
|
+
* the DOM would fold the whole subtree into the treeitem's visible text and break the
|
|
73
|
+
* label-content-name-mismatch axe gate. Roving DOM focus follows the TreeView
|
|
74
|
+
* navigation contract. Right opens, Left closes/moves to parent even in RTL. Up/Down clamp;
|
|
75
|
+
* Home/End move; Enter/Space activate; 500ms typeahead; / searches; Ctrl/Cmd+C copies JSON
|
|
76
|
+
* (+Shift copies path).
|
|
77
|
+
* Strict JSON only, no getters/cycles/nonfinite numbers. Paged, not virtualized.
|
|
78
|
+
*/
|
|
79
|
+
export declare function JsonViewer({ data, rootName, expandedValue, defaultExpandedValue, onExpandedValueChange, defaultExpandDepth, query: queryProp, defaultQuery, onQueryChange, value: valueProp, defaultValue, onValueChange, onNodeActivate, searchable, copyable, showPath, pageSize: pageSizeProp, maxMatches: maxMatchesProp, maxHeight, size, locale, labels: labelProps, onCopy, onCopyError, slotProps, ref, className, sx, style, onKeyDown, onClick, 'aria-label': ariaLabel, 'aria-labelledby': labelledBy, 'aria-describedby': describedBy, ...rest }: JsonViewerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
80
|
+
export declare namespace JsonViewer {
|
|
81
|
+
var displayName: string;
|
|
82
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import type { SxProps } from '../../styling/sx';
|
|
3
|
+
import { type FieldPartProps } from '../field/field-anatomy';
|
|
4
|
+
export type MentionKind = 'person' | 'channel';
|
|
5
|
+
export interface Mention {
|
|
6
|
+
readonly kind: MentionKind;
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
readonly start: number;
|
|
10
|
+
readonly end: number;
|
|
11
|
+
}
|
|
12
|
+
/** Ranges are immutable UTF-16 half-open offsets, matching native textarea selection. */
|
|
13
|
+
export interface MentionValue {
|
|
14
|
+
readonly text: string;
|
|
15
|
+
readonly mentions: readonly Mention[];
|
|
16
|
+
}
|
|
17
|
+
export interface MentionPerson {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
role?: string;
|
|
21
|
+
avatar?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export interface MentionChannel {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
members?: number;
|
|
28
|
+
}
|
|
29
|
+
export type MentionSuggestion = (MentionPerson & {
|
|
30
|
+
kind: 'person';
|
|
31
|
+
}) | (MentionChannel & {
|
|
32
|
+
kind: 'channel';
|
|
33
|
+
});
|
|
34
|
+
export interface MentionInputActions {
|
|
35
|
+
insert(text: string): void;
|
|
36
|
+
openSuggestions(kind: MentionKind): void;
|
|
37
|
+
clear(): void;
|
|
38
|
+
}
|
|
39
|
+
export interface MentionInputMessages {
|
|
40
|
+
peopleLabel: string;
|
|
41
|
+
channelsLabel: string;
|
|
42
|
+
results(count: number, kind: MentionKind): string;
|
|
43
|
+
empty(kind: MentionKind, query: string): string;
|
|
44
|
+
added(mention: Mention): string;
|
|
45
|
+
removed(mention: Mention): string;
|
|
46
|
+
invalidValue: string;
|
|
47
|
+
}
|
|
48
|
+
type Part = 'root' | 'label' | 'control' | 'input' | 'mirror' | 'token' | 'panel' | 'list' | 'option' | 'empty' | 'description' | 'error' | 'status';
|
|
49
|
+
export interface MentionInputProps extends Omit<ComponentPropsWithRef<'textarea'>, 'value' | 'defaultValue' | 'onSubmit'>, SxProps {
|
|
50
|
+
value?: MentionValue;
|
|
51
|
+
defaultValue?: MentionValue;
|
|
52
|
+
onValueChange?: (value: MentionValue) => void;
|
|
53
|
+
open?: boolean;
|
|
54
|
+
defaultOpen?: boolean;
|
|
55
|
+
onOpenChange?: (open: boolean) => void;
|
|
56
|
+
people?: readonly MentionPerson[];
|
|
57
|
+
channels?: readonly MentionChannel[];
|
|
58
|
+
onMentionAdd?: (mention: Mention) => void;
|
|
59
|
+
onSubmit?: (value: MentionValue) => void;
|
|
60
|
+
submitOnEnter?: boolean;
|
|
61
|
+
label?: ReactNode;
|
|
62
|
+
description?: ReactNode;
|
|
63
|
+
error?: ReactNode;
|
|
64
|
+
size?: 'sm' | 'md' | 'lg';
|
|
65
|
+
minRows?: number;
|
|
66
|
+
maxRows?: number;
|
|
67
|
+
maxSuggestions?: number;
|
|
68
|
+
placement?: 'auto' | 'top' | 'bottom';
|
|
69
|
+
locale?: Intl.LocalesArgument;
|
|
70
|
+
messages?: Partial<MentionInputMessages>;
|
|
71
|
+
renderSuggestion?: (item: MentionSuggestion, query: string) => ReactNode;
|
|
72
|
+
actionsRef?: Ref<MentionInputActions>;
|
|
73
|
+
slotProps?: Partial<Record<Part, FieldPartProps>>;
|
|
74
|
+
}
|
|
75
|
+
export declare function mentionText(kind: MentionKind, label: string): string;
|
|
76
|
+
/** Invalid metadata is omitted; plain text is always preserved. The caller owns storage escaping. */
|
|
77
|
+
export declare function serializeMentions(value: MentionValue, format?: (mention: Mention) => string): string;
|
|
78
|
+
/** Native multiline textbox in a combobox semantic wrapper with virtual focus.
|
|
79
|
+
* Enter/Tab commit; Space edits;
|
|
80
|
+
* Shift+Tab leaves, Home/End edit, Escape dismisses. Pair input/mirror metric overrides.
|
|
81
|
+
* Native text undo is best-effort across engines; stale metadata is deliberately dropped.
|
|
82
|
+
* Intended for message-sized documents, not rich-text editing. */
|
|
83
|
+
export declare function MentionInput({ ref, actionsRef, value: valueProp, defaultValue, onValueChange, open: openProp, defaultOpen, onOpenChange, people, channels, onMentionAdd, onSubmit, submitOnEnter, label, description, error, size, minRows, maxRows, maxSuggestions, placement, locale, messages, renderSuggestion, slotProps, className, sx, id, dir, required, disabled, readOnly, onChange, onInput, onKeyDown, onSelect, onFocus, onBlur, onScroll, onCompositionStart, onCompositionEnd, 'aria-labelledby': labelledBy, 'aria-describedby': describedBy, 'aria-invalid': invalid, ...rest }: MentionInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
84
|
+
export declare namespace MentionInput {
|
|
85
|
+
var displayName: string;
|
|
86
|
+
}
|
|
87
|
+
export {};
|