@brycks/core-front 0.11.0 → 0.12.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/dist/components/data/VirtualList/VirtualList.js +1 -1
- package/dist/components/data.cjs +1 -1
- package/dist/components/data.js +26 -26
- package/dist/components/feedback/Toast/ToastContext.js +3 -3
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.js +21 -21
- package/dist/components/form/DropZone/DropZone.cjs.map +1 -1
- package/dist/components/form/DropZone/DropZone.js.map +1 -1
- package/dist/components/form/FileInput/FileInput.cjs.map +1 -1
- package/dist/components/form/FileInput/FileInput.js.map +1 -1
- package/dist/components/form/FileUpload/FileUpload.cjs +2 -0
- package/dist/components/form/FileUpload/FileUpload.cjs.map +1 -0
- package/dist/components/form/FileUpload/FileUpload.js +223 -0
- package/dist/components/form/FileUpload/FileUpload.js.map +1 -0
- package/dist/components/form/FileUpload/fileUpload.utils.cjs +2 -0
- package/dist/components/form/FileUpload/fileUpload.utils.cjs.map +1 -0
- package/dist/components/form/FileUpload/fileUpload.utils.js +43 -0
- package/dist/components/form/FileUpload/fileUpload.utils.js.map +1 -0
- package/dist/components/form/FormGroup/FormGroup.cjs +1 -1
- package/dist/components/form/FormGroup/FormGroup.js +1 -1
- package/dist/components/form/Slider/Slider.cjs +1 -1
- package/dist/components/form/Slider/Slider.js +2 -2
- package/dist/components/form/TagInput/TagInput.cjs +1 -1
- package/dist/components/form/TagInput/TagInput.js +8 -8
- package/dist/components/form.cjs +1 -1
- package/dist/components/form.js +51 -45
- package/dist/components/form.js.map +1 -1
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +30 -30
- package/dist/components/navigation/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/navigation/ContextMenu/ContextMenu.js +5 -5
- package/dist/components/navigation/Stepper/Stepper.js +4 -4
- package/dist/components/navigation/Tabs/Tabs.js +4 -4
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.js +22 -22
- package/dist/components/typography/Text/Text.cjs +1 -1
- package/dist/components/typography/Text/Text.js +1 -1
- package/dist/components/utility.cjs +1 -1
- package/dist/components/utility.js +28 -28
- package/dist/form.d.ts +117 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +87 -0
- package/dist/index.js +279 -275
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +115 -115
package/dist/index.d.ts
CHANGED
|
@@ -1547,6 +1547,84 @@ export declare type FileInputSize = 'sm' | 'md' | 'lg';
|
|
|
1547
1547
|
|
|
1548
1548
|
export declare type FileInputVariant = 'default' | 'dropzone';
|
|
1549
1549
|
|
|
1550
|
+
export declare interface FileRejection {
|
|
1551
|
+
file: File;
|
|
1552
|
+
reason: FileRejectionReason;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
/** Why a file was refused. */
|
|
1556
|
+
export declare type FileRejectionReason = 'type' | 'size';
|
|
1557
|
+
|
|
1558
|
+
export declare const FileUpload: ForwardRefExoticComponent<FileUploadProps & RefAttributes<HTMLInputElement>>;
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* Every user-facing string, so the host app supplies its own translations.
|
|
1562
|
+
* The library ships English defaults and stays i18n-free.
|
|
1563
|
+
*/
|
|
1564
|
+
export declare interface FileUploadLabels {
|
|
1565
|
+
/** Text of the button in the `compact` variant. */
|
|
1566
|
+
trigger?: string;
|
|
1567
|
+
/** Shown next to the trigger while nothing is selected (`compact`). */
|
|
1568
|
+
placeholder?: string;
|
|
1569
|
+
/** Main call to action inside the dropzone. */
|
|
1570
|
+
prompt?: ReactNode;
|
|
1571
|
+
/** Shown while a drag is hovering the dropzone. */
|
|
1572
|
+
dropPrompt?: string;
|
|
1573
|
+
/** Accessible label of the per-file remove button. */
|
|
1574
|
+
remove?: string;
|
|
1575
|
+
/** Error for a file whose type is not accepted. */
|
|
1576
|
+
invalidType?: (fileName: string) => string;
|
|
1577
|
+
/** Error for a file above `maxSize`. */
|
|
1578
|
+
tooLarge?: (fileName: string, maxSizeLabel: string) => string;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
export declare interface FileUploadProps {
|
|
1582
|
+
/** Selected files (controlled). */
|
|
1583
|
+
files: File[];
|
|
1584
|
+
/** Called with the next selection whenever files are added or removed. */
|
|
1585
|
+
onFilesChange: (files: File[]) => void;
|
|
1586
|
+
/** Layout. */
|
|
1587
|
+
variant?: FileUploadVariant;
|
|
1588
|
+
/** Size. */
|
|
1589
|
+
size?: FileUploadSize;
|
|
1590
|
+
/** Accepted types, e.g. `".pfx,.p12"` or `"application/pdf"`. */
|
|
1591
|
+
accept?: string;
|
|
1592
|
+
/** Allow selecting more than one file. */
|
|
1593
|
+
multiple?: boolean;
|
|
1594
|
+
/** Cap on the number of files when `multiple`. */
|
|
1595
|
+
maxFiles?: number;
|
|
1596
|
+
/** Maximum size per file, in bytes. Rejections are reported, never silent. */
|
|
1597
|
+
maxSize?: number;
|
|
1598
|
+
/** Helper text under the prompt (e.g. accepted formats). */
|
|
1599
|
+
hint?: ReactNode;
|
|
1600
|
+
/** Error message from the host app (e.g. a failed upload). */
|
|
1601
|
+
error?: ReactNode;
|
|
1602
|
+
/** Render the field as invalid without a message. */
|
|
1603
|
+
isInvalid?: boolean;
|
|
1604
|
+
/** Disable selection and removal. */
|
|
1605
|
+
disabled?: boolean;
|
|
1606
|
+
/** Icon shown in the dropzone. */
|
|
1607
|
+
icon?: ReactNode;
|
|
1608
|
+
/** Notified when files are refused by `accept`/`maxSize`. */
|
|
1609
|
+
onReject?: (rejections: FileRejection[]) => void;
|
|
1610
|
+
/** Overridable user-facing strings. */
|
|
1611
|
+
labels?: FileUploadLabels;
|
|
1612
|
+
/** Id of the underlying input, to pair with an external label. */
|
|
1613
|
+
id?: string;
|
|
1614
|
+
/** Custom class name. */
|
|
1615
|
+
className?: string;
|
|
1616
|
+
/** Test ID. */
|
|
1617
|
+
testId?: string;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
export declare type FileUploadSize = 'sm' | 'md' | 'lg';
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
* `dropzone` — generous dashed target, best for documents and images.
|
|
1624
|
+
* `compact` — a single row (button + selected file), fits inline in a form.
|
|
1625
|
+
*/
|
|
1626
|
+
export declare type FileUploadVariant = 'dropzone' | 'compact';
|
|
1627
|
+
|
|
1550
1628
|
export declare const Flex: ForwardRefExoticComponent<FlexProps & RefAttributes<HTMLDivElement>>;
|
|
1551
1629
|
|
|
1552
1630
|
declare type FlexAlign = 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
@@ -1777,6 +1855,15 @@ export declare interface FooterProps extends SemanticProps {
|
|
|
1777
1855
|
|
|
1778
1856
|
export declare const Form: ForwardRefExoticComponent<FormProps & RefAttributes<HTMLFormElement>>;
|
|
1779
1857
|
|
|
1858
|
+
/**
|
|
1859
|
+
* FileUpload — pure helpers
|
|
1860
|
+
*
|
|
1861
|
+
* Framework-free selection logic so it can be reasoned about and tested
|
|
1862
|
+
* without rendering anything.
|
|
1863
|
+
*/
|
|
1864
|
+
/** Human-readable file size, e.g. `1.4 MB`. */
|
|
1865
|
+
export declare function formatBytes(bytes: number): string;
|
|
1866
|
+
|
|
1780
1867
|
export declare const FormCard: ForwardRefExoticComponent<FormCardProps & RefAttributes<HTMLDivElement>>;
|
|
1781
1868
|
|
|
1782
1869
|
export declare type FormCardIntent = 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info';
|