@recursica/mantine-adapter 0.40.0 → 0.42.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/CHANGELOG.md +30 -0
- package/dist/index.d.ts +146 -7
- package/dist/mantine-adapter.cjs +2 -2
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.css +1 -1
- package/dist/mantine-adapter.js +2988 -2417
- package/dist/mantine-adapter.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Checkbox/CheckboxGroup.tsx +32 -10
- package/src/components/FileInput/FILEINPUT_IMPLEMENTATION_NOTES.md +148 -0
- package/src/components/FileInput/FileInput.module.css +269 -47
- package/src/components/FileInput/FileInput.stories.tsx +296 -4
- package/src/components/FileInput/FileInput.tsx +414 -5
- package/src/components/FileInput/USAGE.md +112 -4
- package/src/components/Slider/IMPLEMENTATION_NOTES.md +1 -0
- package/src/components/Slider/Slider.module.css +34 -0
- package/src/components/Slider/Slider.stories.tsx +1 -1
- package/src/components/TextArea/TextArea.tsx +2 -6
- package/src/components/TransferList/TRANSFERLIST_IMPLEMENTATION_NOTES.md +111 -0
- package/src/components/TransferList/TransferList.module.css +180 -39
- package/src/components/TransferList/TransferList.stories.tsx +110 -6
- package/src/components/TransferList/TransferList.tsx +417 -7
- package/src/components/TransferList/USAGE.md +37 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @recursica/mantine-adapter
|
|
2
2
|
|
|
3
|
+
## 0.42.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e0f5643: Implement `TransferList` (dual listbox) in both adapters, replacing the "coming soon" stub. Composes `FormControlWrapper`, `TextField`, `Checkbox`/`CheckboxGroup`, `Badge`, and `Button` — supports controlled/uncontrolled `data`, per-item grouping, per-pane search, and `stacked`/`side-by-side` form layout.
|
|
8
|
+
- 2fb7069: Fix `Slider`'s `Disabled` story (was passing `disabled: false` in both adapters). In `mui-adapter`, also fix the disabled track showing red instead of grey, make the thumb focus ring keyboard-only (no glow on click/drag) to match Mantine, render assistive text as a `<span>`, and align mark label color/position with Mantine (which now applies its own mark label color token too).
|
|
9
|
+
- 2fb7069: Fix `TextArea`: error state border now uses the recursica error color (was never triggering in either adapter). MUI disabled background/border, focus ring color, and default height now match Mantine instead of MUI's own defaults.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 1616144: Fix `FileInput`'s clear-all button: pressing Enter or Space while it was focused opened the native file picker instead of clearing the selection (a regression from switching the control to the shared `Button` component, which dropped the keydown handler the previous bespoke element had).
|
|
14
|
+
- 3ff5821: Fix `TransferList` checkboxes not toggling/showing checked state in either adapter (grouping-for-layout was silently overriding item selection). Add `readOnly` support and a `ReadOnly` story.
|
|
15
|
+
- Updated dependencies [e0f5643]
|
|
16
|
+
- Updated dependencies [1616144]
|
|
17
|
+
- Updated dependencies [3ff5821]
|
|
18
|
+
- @recursica/adapter-common@0.18.0
|
|
19
|
+
|
|
20
|
+
## 0.41.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 3d75770: Implement the `FileInput` component (single-line, `TextField`-shaped file picker with a native drag-and-drop drop target, single- and multiple-file modes, and a trailing clear icon) in `mantine-adapter` and `mui-adapter`, replacing the "coming soon" stub, with a shared `RecursicaFileInputProps` contract in `adapter-common` reusing `FileUpload`'s `RecursicaFileUploadItem`/validation interface (`accept`/`maxSize`/`maxFiles`/`readOnly`). Also adds `FileInput` to `RECURSICA_COMPONENTS` and moves `mui-adapter`'s export of it into the standard `wrapComponent` set (it was previously exported unwrapped, alongside the polymorphic layout primitives, as a leftover from its stub form).
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- b86ca2b: `FileInput` now renders every selected file as a removable `Chip` in a horizontally scrollable row, in both single- and multiple-file mode (previously single-file mode showed plain filename text with no remove affordance). The trailing clear-all control is now a real shared `Button` (icon-only, "text" variant) instead of a bespoke `<span role="button">`.
|
|
29
|
+
- Updated dependencies [3d75770]
|
|
30
|
+
- Updated dependencies [b86ca2b]
|
|
31
|
+
- @recursica/adapter-common@0.17.0
|
|
32
|
+
|
|
3
33
|
## 0.40.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -371,9 +371,22 @@ export declare interface EmptyValueRendererProps {
|
|
|
371
371
|
|
|
372
372
|
export declare const FileInput: typeof rawComponents.FileInput;
|
|
373
373
|
|
|
374
|
-
|
|
374
|
+
/**
|
|
375
|
+
* A single-line, `TextField`-shaped control for choosing one or more files, sharing
|
|
376
|
+
* `FileUpload`'s selection/validation interface (`accept`/`maxSize`/`maxFiles`, `readOnly`)
|
|
377
|
+
* behind a different presentation.
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* <FileInput
|
|
381
|
+
* label="Resume"
|
|
382
|
+
* files={files}
|
|
383
|
+
* onFilesAdded={(added) => setFiles(added.map((file) => ({ file })))}
|
|
384
|
+
* onFileRemove={() => setFiles([])}
|
|
385
|
+
* />
|
|
386
|
+
*/
|
|
387
|
+
declare const FileInput_2: default_2.ForwardRefExoticComponent<FileInputProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
375
388
|
|
|
376
|
-
declare type FileInputProps =
|
|
389
|
+
declare type FileInputProps = RecursicaOverStyled<RecursicaFileInputProps_2>;
|
|
377
390
|
|
|
378
391
|
/**
|
|
379
392
|
* Mirrors the semantics of the native HTML `accept` attribute (comma-separated file extensions,
|
|
@@ -1348,9 +1361,10 @@ declare namespace rawComponents {
|
|
|
1348
1361
|
RecursicaDropdownProps,
|
|
1349
1362
|
DropdownProps,
|
|
1350
1363
|
Dropdown_2 as Dropdown,
|
|
1364
|
+
RecursicaFileUploadItem,
|
|
1365
|
+
RecursicaFileInputProps_2 as RecursicaFileInputProps,
|
|
1351
1366
|
FileInputProps,
|
|
1352
1367
|
FileInput_2 as FileInput,
|
|
1353
|
-
RecursicaFileUploadItem,
|
|
1354
1368
|
RecursicaFileUploadProps_2 as RecursicaFileUploadProps,
|
|
1355
1369
|
FileUploadProps,
|
|
1356
1370
|
FileUpload_2 as FileUpload,
|
|
@@ -1508,6 +1522,9 @@ declare namespace rawComponents {
|
|
|
1508
1522
|
TooltipFloatingProps,
|
|
1509
1523
|
TooltipFloating,
|
|
1510
1524
|
Tooltip_2 as Tooltip,
|
|
1525
|
+
RecursicaTransferListItem,
|
|
1526
|
+
RecursicaTransferListData,
|
|
1527
|
+
RecursicaTransferListProps_2 as RecursicaTransferListProps,
|
|
1511
1528
|
TransferListProps,
|
|
1512
1529
|
TransferList_2 as TransferList,
|
|
1513
1530
|
TreeProps,
|
|
@@ -1561,7 +1578,7 @@ declare type ReadOnlyTextFieldProps = RecursicaOverStyled<RecursicaReadOnlyTextF
|
|
|
1561
1578
|
/**
|
|
1562
1579
|
* Official list of all components in Recursica.
|
|
1563
1580
|
*/
|
|
1564
|
-
export declare const RECURSICA_COMPONENTS: readonly ["Accordion", "AssistiveElement", "Autocomplete", "Avatar", "Badge", "Breadcrumb", "Button", "Card", "Checkbox", "Chip", "Container", "DatePicker", "Dropdown", "EmptyValueRenderer", "Flex", "FormControlLayout", "FormControlWrapper", "Grid", "Group", "HoverCard", "Label", "Layer", "Link", "Loader", "Menu", "Modal", "NumberInput", "Pagination", "Panel", "Popover", "Radio", "ReadOnlyField", "SegmentedControl", "Slider", "Stack", "Stepper", "Switch", "Table", "Tabs", "Text", "TextArea", "TextField", "TimePicker", "Timeline", "Title", "Toast", "Tooltip", "TransferList"];
|
|
1581
|
+
export declare const RECURSICA_COMPONENTS: readonly ["Accordion", "AssistiveElement", "Autocomplete", "Avatar", "Badge", "Box", "Breadcrumb", "Button", "Card", "Checkbox", "CheckboxGroup", "Chip", "Container", "DatePicker", "Dropdown", "EmptyValueRenderer", "FileInput", "FileUpload", "Flex", "FormControlLayout", "FormControlWrapper", "Grid", "Group", "HoverCard", "Label", "Layer", "Link", "Loader", "Menu", "Modal", "NumberInput", "Pagination", "Panel", "Popover", "Radio", "ReadOnlyField", "SegmentedControl", "Slider", "Stack", "Stepper", "Switch", "Table", "Tabs", "Text", "TextArea", "TextField", "TimePicker", "Timeline", "Title", "Toast", "Tooltip", "TransferList", "Tree", "Typography"];
|
|
1565
1582
|
|
|
1566
1583
|
/**
|
|
1567
1584
|
* Props for the Recursica Accordion Control component.
|
|
@@ -1844,10 +1861,93 @@ declare interface RecursicaDropdownProps_2 {
|
|
|
1844
1861
|
placeholder?: string;
|
|
1845
1862
|
}
|
|
1846
1863
|
|
|
1864
|
+
/**
|
|
1865
|
+
* Props for the Recursica FileInput component.
|
|
1866
|
+
*
|
|
1867
|
+
* `FileInput` is presented as a single-line, `TextField`-shaped control rather than
|
|
1868
|
+
* `FileUpload`'s dropzone, but shares the same file-selection interface and validation
|
|
1869
|
+
* behavior (`accept`/`maxSize`/`maxFiles`, `onFilesRejected`, `readOnly`) so integrators can
|
|
1870
|
+
* move between them without relearning the contract.
|
|
1871
|
+
*/
|
|
1872
|
+
export declare interface RecursicaFileInputProps {
|
|
1873
|
+
/**
|
|
1874
|
+
* Files currently selected. This is a controlled list — `onFilesAdded`/`onFileRemove`
|
|
1875
|
+
* report changes, but `FileInput` never mutates this array itself; merge the reported
|
|
1876
|
+
* changes into your own state and pass the updated list back in.
|
|
1877
|
+
*/
|
|
1878
|
+
files?: RecursicaFileUploadItem[];
|
|
1879
|
+
/**
|
|
1880
|
+
* Called with the files the user just picked via the native file dialog or dropped onto
|
|
1881
|
+
* the control. Only the newly added files are passed — merge them into `files` yourself.
|
|
1882
|
+
*/
|
|
1883
|
+
onFilesAdded?: (files: File[]) => void;
|
|
1884
|
+
/**
|
|
1885
|
+
* Called when a file's remove affordance is activated, identified by its `id` (or
|
|
1886
|
+
* `file.name` when no `id` was given for that entry). In single-file mode this is also
|
|
1887
|
+
* called when the trailing clear icon removes the one selected file.
|
|
1888
|
+
*/
|
|
1889
|
+
onFileRemove?: (id: string) => void;
|
|
1890
|
+
/**
|
|
1891
|
+
* Native `accept` attribute for the underlying file input (e.g. `".pdf,.png"` or
|
|
1892
|
+
* `"image/*"`) — constrains the native file-picker dialog. Also enforced against files
|
|
1893
|
+
* dropped onto the control, the same way `FileUpload` enforces it.
|
|
1894
|
+
*/
|
|
1895
|
+
accept?: string;
|
|
1896
|
+
/** Whether more than one file can be selected/dropped at once. Defaults to `false`. */
|
|
1897
|
+
multiple?: boolean;
|
|
1898
|
+
/**
|
|
1899
|
+
* Maximum size per file, in bytes. Files exceeding this are passed to
|
|
1900
|
+
* `onFilesRejected` instead of `onFilesAdded`.
|
|
1901
|
+
*/
|
|
1902
|
+
maxSize?: number;
|
|
1903
|
+
/**
|
|
1904
|
+
* Maximum total number of files allowed in `files`. Only meaningful when `multiple` is
|
|
1905
|
+
* `true` — Once reached, further dropped/picked files are passed to `onFilesRejected`
|
|
1906
|
+
* instead of `onFilesAdded`.
|
|
1907
|
+
*/
|
|
1908
|
+
maxFiles?: number;
|
|
1909
|
+
/**
|
|
1910
|
+
* Called with any files rejected for exceeding `maxSize`/`maxFiles` or not matching
|
|
1911
|
+
* `accept`.
|
|
1912
|
+
*/
|
|
1913
|
+
onFilesRejected?: (files: File[]) => void;
|
|
1914
|
+
/**
|
|
1915
|
+
* Error message shown (via the standard assistive-text error slot) when a dropped/picked
|
|
1916
|
+
* file's extension or MIME type doesn't match `accept`. Defaults to
|
|
1917
|
+
* `"File type not accepted"`.
|
|
1918
|
+
*/
|
|
1919
|
+
invalidFileTypeMessage?: default_2.ReactNode;
|
|
1920
|
+
/**
|
|
1921
|
+
* Error message shown (via the standard assistive-text error slot) when a dropped/picked
|
|
1922
|
+
* file would exceed `maxFiles`. Defaults to `"Maximum of {maxFiles} files allowed"`.
|
|
1923
|
+
*/
|
|
1924
|
+
maxFilesMessage?: default_2.ReactNode;
|
|
1925
|
+
/** Leading icon shown inside the control. Defaults to the built-in upload icon. */
|
|
1926
|
+
icon?: default_2.ReactNode;
|
|
1927
|
+
/** Text shown when no file is selected. Defaults to `"Select a file..."`. */
|
|
1928
|
+
placeholder?: default_2.ReactNode;
|
|
1929
|
+
/** Screen-reader label for the control itself. Defaults to `"Choose file"`. */
|
|
1930
|
+
browseLabel?: string;
|
|
1931
|
+
/** Screen-reader label for a file chip's remove button. Defaults to `"Remove"`. */
|
|
1932
|
+
removeFileLabel?: string;
|
|
1933
|
+
/** Screen-reader label for the trailing clear-all icon. Defaults to `"Clear"`. */
|
|
1934
|
+
clearLabel?: string;
|
|
1935
|
+
/** Disables the control and its remove/clear icons. */
|
|
1936
|
+
disabled?: boolean;
|
|
1937
|
+
/**
|
|
1938
|
+
* Renders `files` as a static, non-interactive display with no clear/remove icons, and
|
|
1939
|
+
* disables picking or dropping new files.
|
|
1940
|
+
*/
|
|
1941
|
+
readOnly?: boolean;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
declare interface RecursicaFileInputProps_2 extends Omit<default_2.HTMLAttributes<HTMLDivElement>, "children" | "onDrop" | "onChange">, Pick<InputWrapperProps, "label" | "error" | "required" | "withAsterisk" | "id">, Omit<RecursicaFormControlWrapperProps, "controlMaxWidth" | "controlMinWidth">, RecursicaFileInputProps {
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1847
1947
|
/**
|
|
1848
1948
|
* A single file entry rendered as a removable chip in the FileUpload's file list.
|
|
1849
1949
|
*/
|
|
1850
|
-
|
|
1950
|
+
declare interface RecursicaFileUploadItem {
|
|
1851
1951
|
/** The underlying browser File object. */
|
|
1852
1952
|
file: File;
|
|
1853
1953
|
/**
|
|
@@ -1856,6 +1956,8 @@ export declare interface RecursicaFileUploadItem {
|
|
|
1856
1956
|
*/
|
|
1857
1957
|
id?: string;
|
|
1858
1958
|
}
|
|
1959
|
+
export { RecursicaFileUploadItem as RecursicaFileInputItem }
|
|
1960
|
+
export { RecursicaFileUploadItem }
|
|
1859
1961
|
|
|
1860
1962
|
/**
|
|
1861
1963
|
* Props for the Recursica FileUpload component.
|
|
@@ -2542,10 +2644,47 @@ export declare interface RecursicaTooltipProps {
|
|
|
2542
2644
|
withBeak?: boolean;
|
|
2543
2645
|
}
|
|
2544
2646
|
|
|
2647
|
+
/** Controlled/uncontrolled data shape: [sourceItems, targetItems] */
|
|
2648
|
+
export declare type RecursicaTransferListData = [
|
|
2649
|
+
RecursicaTransferListItem[],
|
|
2650
|
+
RecursicaTransferListItem[]
|
|
2651
|
+
];
|
|
2652
|
+
|
|
2653
|
+
/**
|
|
2654
|
+
* A single transferable item.
|
|
2655
|
+
*/
|
|
2656
|
+
export declare interface RecursicaTransferListItem {
|
|
2657
|
+
/** Unique identifier used for selection and transfer */
|
|
2658
|
+
value: string;
|
|
2659
|
+
/** Display text */
|
|
2660
|
+
label: string;
|
|
2661
|
+
/** Optional group name — items sharing a group render under a CheckboxGroup */
|
|
2662
|
+
group?: string;
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2545
2665
|
/**
|
|
2546
2666
|
* Props for the Recursica TransferList component.
|
|
2547
2667
|
*/
|
|
2548
2668
|
export declare interface RecursicaTransferListProps {
|
|
2669
|
+
/** Controlled data: [sourceItems, targetItems] */
|
|
2670
|
+
data?: RecursicaTransferListData;
|
|
2671
|
+
/** Uncontrolled initial data: [sourceItems, targetItems] */
|
|
2672
|
+
defaultData?: RecursicaTransferListData;
|
|
2673
|
+
/** Called with the new [sourceItems, targetItems] whenever items are transferred */
|
|
2674
|
+
onChange?: (data: RecursicaTransferListData) => void;
|
|
2675
|
+
/** Label for the source (left) list */
|
|
2676
|
+
sourceLabel?: string;
|
|
2677
|
+
/** Label for the target (right) list */
|
|
2678
|
+
targetLabel?: string;
|
|
2679
|
+
/** Enable per-pane search filtering. Defaults to true */
|
|
2680
|
+
searchable?: boolean;
|
|
2681
|
+
/** Placeholder text for the search fields */
|
|
2682
|
+
searchPlaceholder?: string;
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
declare interface RecursicaTransferListProps_2 extends Omit<FormControlWrapperProps, "children" | "overStyled" | "controlMaxWidth" | "controlMinWidth" | "onChange">, ReadOnlyControlProps, RecursicaTransferListProps {
|
|
2686
|
+
/** Disables the whole control */
|
|
2687
|
+
disabled?: boolean;
|
|
2549
2688
|
}
|
|
2550
2689
|
|
|
2551
2690
|
/**
|
|
@@ -2982,9 +3121,9 @@ declare type TooltipProps = RecursicaOverStyled<TooltipProps_2 & RecursicaToolti
|
|
|
2982
3121
|
|
|
2983
3122
|
export declare const TransferList: typeof rawComponents.TransferList;
|
|
2984
3123
|
|
|
2985
|
-
declare const TransferList_2:
|
|
3124
|
+
declare const TransferList_2: ForwardRefExoticComponent<TransferListProps & RefAttributes<HTMLDivElement>>;
|
|
2986
3125
|
|
|
2987
|
-
declare type TransferListProps =
|
|
3126
|
+
declare type TransferListProps = RecursicaOverStyled<RecursicaTransferListProps_2>;
|
|
2988
3127
|
|
|
2989
3128
|
export declare const Tree: typeof rawComponents.Tree;
|
|
2990
3129
|
|