@brycks/core-front 0.10.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.
Files changed (46) hide show
  1. package/dist/components/data/VirtualList/VirtualList.js +1 -1
  2. package/dist/components/data.cjs +1 -1
  3. package/dist/components/data.js +26 -26
  4. package/dist/components/feedback/Toast/ToastContext.js +3 -3
  5. package/dist/components/feedback.cjs +1 -1
  6. package/dist/components/feedback.js +21 -21
  7. package/dist/components/form/DropZone/DropZone.cjs.map +1 -1
  8. package/dist/components/form/DropZone/DropZone.js.map +1 -1
  9. package/dist/components/form/FileInput/FileInput.cjs.map +1 -1
  10. package/dist/components/form/FileInput/FileInput.js.map +1 -1
  11. package/dist/components/form/FileUpload/FileUpload.cjs +2 -0
  12. package/dist/components/form/FileUpload/FileUpload.cjs.map +1 -0
  13. package/dist/components/form/FileUpload/FileUpload.js +223 -0
  14. package/dist/components/form/FileUpload/FileUpload.js.map +1 -0
  15. package/dist/components/form/FileUpload/fileUpload.utils.cjs +2 -0
  16. package/dist/components/form/FileUpload/fileUpload.utils.cjs.map +1 -0
  17. package/dist/components/form/FileUpload/fileUpload.utils.js +43 -0
  18. package/dist/components/form/FileUpload/fileUpload.utils.js.map +1 -0
  19. package/dist/components/form/FormGroup/FormGroup.cjs +1 -1
  20. package/dist/components/form/FormGroup/FormGroup.js +1 -1
  21. package/dist/components/form/Slider/Slider.cjs +1 -1
  22. package/dist/components/form/Slider/Slider.js +2 -2
  23. package/dist/components/form/TagInput/TagInput.cjs +1 -1
  24. package/dist/components/form/TagInput/TagInput.js +8 -8
  25. package/dist/components/form.cjs +1 -1
  26. package/dist/components/form.js +51 -45
  27. package/dist/components/form.js.map +1 -1
  28. package/dist/components/layout.cjs +1 -1
  29. package/dist/components/layout.js +30 -30
  30. package/dist/components/navigation/ContextMenu/ContextMenu.cjs +1 -1
  31. package/dist/components/navigation/ContextMenu/ContextMenu.js +5 -5
  32. package/dist/components/navigation/Stepper/Stepper.js +4 -4
  33. package/dist/components/navigation/Tabs/Tabs.js +4 -4
  34. package/dist/components/navigation.cjs +1 -1
  35. package/dist/components/navigation.js +22 -22
  36. package/dist/components/typography/Text/Text.cjs +1 -1
  37. package/dist/components/typography/Text/Text.js +1 -1
  38. package/dist/components/utility.cjs +1 -1
  39. package/dist/components/utility.js +28 -28
  40. package/dist/form.d.ts +117 -0
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.d.ts +94 -1
  43. package/dist/index.js +279 -275
  44. package/dist/index.js.map +1 -1
  45. package/dist/styles.css +1 -1
  46. package/package.json +115 -115
package/dist/index.d.ts CHANGED
@@ -573,7 +573,13 @@ export declare interface ButtonOwnProps {
573
573
  leftIcon?: ReactNode;
574
574
  /** Right icon/element */
575
575
  rightIcon?: ReactNode;
576
- /** Icon-only button (square, no text) */
576
+ /**
577
+ * Icon-only button (square, no text). Requires `aria-label`.
578
+ *
579
+ * With `variant="soft"` the tinted box is deferred to hover / open-menu:
580
+ * at rest the icon stands free, so a column of row-level icons doesn't read
581
+ * as a column of chips. Other variants are unaffected.
582
+ */
577
583
  isIconOnly?: boolean;
578
584
  /** Custom class name */
579
585
  className?: string;
@@ -1541,6 +1547,84 @@ export declare type FileInputSize = 'sm' | 'md' | 'lg';
1541
1547
 
1542
1548
  export declare type FileInputVariant = 'default' | 'dropzone';
1543
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
+
1544
1628
  export declare const Flex: ForwardRefExoticComponent<FlexProps & RefAttributes<HTMLDivElement>>;
1545
1629
 
1546
1630
  declare type FlexAlign = 'start' | 'end' | 'center' | 'baseline' | 'stretch';
@@ -1771,6 +1855,15 @@ export declare interface FooterProps extends SemanticProps {
1771
1855
 
1772
1856
  export declare const Form: ForwardRefExoticComponent<FormProps & RefAttributes<HTMLFormElement>>;
1773
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
+
1774
1867
  export declare const FormCard: ForwardRefExoticComponent<FormCardProps & RefAttributes<HTMLDivElement>>;
1775
1868
 
1776
1869
  export declare type FormCardIntent = 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info';