@apliteni/apliteni-ui 0.131.0 → 0.133.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.
@@ -6,13 +6,13 @@
6
6
 
7
7
  **Rule:** At rest, a file drop is one row: the button that opens the picker and the accepted types beside it.
8
8
 
9
- **Why:** A tall box holds the page's best space open for a file that arrives once a month.
9
+ **Why:** A tall box holds the page's best space for a file that arrives once a month.
10
10
 
11
11
  **Do:** Put an Upload button and “PDF or CSV, up to 10 MB” on one line above the list they feed.
12
12
 
13
13
  **Don't:** Draw a tall dashed box with a glyph, an invitation and a button stacked inside it.
14
14
 
15
- **Except:** A page whose whole purpose is receiving one file may use the field-sized picker, which carries a label of its own.
15
+ **Except:** A page that exists to receive one file may use the field-sized picker, which has its own label. An empty page may show a dashed drop area until the first file arrives. See #458 for this exception.
16
16
 
17
17
  ## Paint the target only while a file is over it
18
18
 
@@ -26,15 +26,17 @@
26
26
 
27
27
  **Don't:** Cover the whole window when one panel accepts the file.
28
28
 
29
+ **Except:** A page that takes files anywhere may cover the whole page, slightly transparent and blurred over a table. See #458 for this exception.
30
+
29
31
  ## Keep the file in the row it arrived in
30
32
 
31
33
  <!-- rule: in-the-row -->
32
34
 
33
35
  **Rule:** After the drop, the file's name, size and progress take the place the button was in, with remove on the name's line.
34
36
 
35
- **Why:** A row that changes in place keeps the page still while the file uploads.
37
+ **Why:** A row that changes in place keeps the page still during the upload.
36
38
 
37
- **Do:** Give the name a line with remove at its end, put the size under it, and run the progress track the full width below both.
39
+ **Do:** Put remove at the end of the name's line, the size under it, and the progress track below both.
38
40
 
39
41
  **Don't:** Push the list down with a progress card, or open a dialog over the page.
40
42
 
@@ -44,7 +46,7 @@
44
46
 
45
47
  **Rule:** A refused file keeps its place, says what it did wrong under its name, and offers Retry beside Remove.
46
48
 
47
- **Why:** A row that drops the file sends the reader back to choosing one. The reason is the one string here that has to be read in full, so it gets a line rather than a share of one.
49
+ **Why:** A row that drops the file sends the reader back to choosing one.
48
50
 
49
51
  **Do:** Keep the name on its line and say “Larger than 10 MB” under it, with Retry.
50
52
 
@@ -80,8 +82,8 @@
80
82
 
81
83
  **Rule:** Use a row where the file joins a list on the page, a region when one panel owns the file, and a dialog only when the upload needs answers of its own.
82
84
 
83
- **Why:** A dialog that asks nothing is one more thing to dismiss. The rule picks between three containers, so a drawing would show one of them and not the choice.
85
+ **Why:** A dialog that asks nothing is one more thing to dismiss. A drawing would show one container, not the choice.
84
86
 
85
- **Do:** Take a statement into the row under the statements it joins, and a replacement logo into the panel that shows it.
87
+ **Do:** Take a statement into the row under the statements it joins.
86
88
 
87
89
  **Don't:** Open a dialog for one file that the row behind it could have taken.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.131.0",
3
+ "version": "0.133.0",
4
4
 
5
5
  "workspaces": [
6
6
  "react"
@@ -847,6 +847,43 @@
847
847
  .ui-drop.is-disabled .ui-drop__name {
848
848
  color: var(--disabled-ink);
849
849
  }
850
+ .ui-drop--area {
851
+ border: 1px dashed var(--border-strong);
852
+ border-radius: var(--radius-lg);
853
+ padding: var(--space-4);
854
+ }
855
+ .ui-drop--area.is-dragging {
856
+ border-color: var(--accent);
857
+ }
858
+ @media (max-width: 560px) {
859
+ .ui-drop--area {
860
+ padding: var(--space-3);
861
+ }
862
+ }
863
+ .ui-drop--page {
864
+ position: fixed;
865
+ inset: calc(var(--ui-app-band, 0px) + var(--ui-app-top, 0px) + var(--space-4)) var(--space-4) var(--space-4);
866
+ z-index: var(--z-overlay);
867
+ display: flex;
868
+ align-items: center;
869
+ justify-content: center;
870
+ pointer-events: none;
871
+ background: var(--bg);
872
+ }
873
+ @supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
874
+ .ui-drop--page {
875
+ background: color-mix(in srgb, var(--bg) 80%, transparent);
876
+ -webkit-backdrop-filter: blur(var(--space-2));
877
+ backdrop-filter: blur(var(--space-2));
878
+ }
879
+ }
880
+ @media (prefers-reduced-transparency: reduce) {
881
+ .ui-drop--page {
882
+ background: var(--bg);
883
+ -webkit-backdrop-filter: none;
884
+ backdrop-filter: none;
885
+ }
886
+ }
850
887
 
851
888
  /* src/Toast.css */
852
889
  .rx-toast-stack {
@@ -907,6 +944,9 @@
907
944
  gap: var(--space-1);
908
945
  padding-inline: var(--space-2);
909
946
  }
947
+ .ui-react-app .ui-app__bar:not(:has(> .ui-app__menu:first-child)) {
948
+ padding-inline-start: var(--space-4);
949
+ }
910
950
  .ui-react-app .ui-app__bar-gap {
911
951
  display: none;
912
952
  }
@@ -759,6 +759,12 @@ type FileDropProps = {
759
759
  label?: string;
760
760
  /** The accepted types and the size limit, stated once beside the button. */
761
761
  note?: string;
762
+ /** Makes the drop an empty page's area: a dashed box around a first-run block with this title,
763
+ * the note and the button. The block stands in for the row and `children`, and the page
764
+ * leaves the area when the first file arrives, so it never shows a file in hand. */
765
+ title?: string;
766
+ /** Lets the picker take several files. */
767
+ multiple?: boolean;
762
768
  /** Filters the system picker only; the consumer still validates the file. */
763
769
  accept?: string;
764
770
  /** The words on the drop target. */
@@ -771,14 +777,17 @@ type FileDropProps = {
771
777
  /** Drives the target from a parent that owns the drag region. */
772
778
  dragging?: boolean;
773
779
  disabled?: boolean;
780
+ /** The first file chosen or dropped. */
774
781
  onFile?: (file: File) => void;
782
+ /** Every file chosen or dropped, together. A consumer may pass both props. */
783
+ onFiles?: (files: File[]) => void;
775
784
  onRemove?: () => void;
776
785
  onRetry?: () => void;
777
786
  /** What the region accepts the file for; the target covers it while dragging. */
778
787
  children?: ReactNode;
779
788
  className?: string;
780
789
  };
781
- declare function FileDrop({ label, note, accept, dropLabel, removeLabel, retryLabel, file, dragging, disabled, onFile, onRemove, onRetry, children, className, }: FileDropProps): react.JSX.Element;
790
+ declare function FileDrop({ label, note, title, multiple, accept, dropLabel, removeLabel, retryLabel, file, dragging, disabled, onFile, onFiles, onRemove, onRetry, children, className, }: FileDropProps): react.JSX.Element;
782
791
 
783
792
  type SearchFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'aria-label'> & {
784
793
  /** The control's name. A toolbar search box shows no label, so this is the