aplance-ui 1.4.0 → 1.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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/registry/components/primitives/icon/icon.tsx +4 -6
  3. package/registry/components/primitives/modal/modal.module.css +5 -0
  4. package/registry/components/primitives/modal/modal.tsx +32 -34
  5. package/registry/components/primitives/popover/popover.module.css +4 -2
  6. package/registry/components/primitives/popover/popover.tsx +16 -17
  7. package/registry/components/ui/accordion/accordion.module.css +52 -0
  8. package/registry/components/ui/accordion/accordion.tsx +97 -25
  9. package/registry/components/ui/avatar/avatar.tsx +2 -2
  10. package/registry/components/ui/breadcrumbs/breadcrumbs.module.css +9 -9
  11. package/registry/components/ui/button/button.module.css +43 -5
  12. package/registry/components/ui/button/button.tsx +2 -1
  13. package/registry/components/ui/copy-button/copy-button.module.css +2 -0
  14. package/registry/components/ui/data-table/data-table.module.css +68 -25
  15. package/registry/components/ui/data-table/data-table.tsx +1238 -1229
  16. package/registry/components/ui/data-table/filters.tsx +21 -0
  17. package/registry/components/ui/data-table/pagination-bar.tsx +31 -17
  18. package/registry/components/ui/data-table/types.ts +11 -1
  19. package/registry/components/ui/data-table/useDataTable.tsx +1 -2
  20. package/registry/components/ui/data-table/utils.ts +4 -3
  21. package/registry/components/ui/input-fields/common/input-field-common.module.css +8 -2
  22. package/registry/components/ui/input-fields/common/picker-popover-common.module.css +4 -0
  23. package/registry/components/ui/input-fields/custom-select/custom-select.module.css +115 -84
  24. package/registry/components/ui/input-fields/custom-select/custom-select.tsx +63 -11
  25. package/registry/components/ui/input-fields/date-picker/date-picker.tsx +51 -55
  26. package/registry/components/ui/input-fields/input/input.tsx +348 -348
  27. package/registry/components/ui/input-fields/media-input/media-input.tsx +3 -1
  28. package/registry/components/ui/input-fields/media-input/types.ts +8 -2
  29. package/registry/components/ui/input-fields/media-input/useMediaUpload.tsx +5 -5
  30. package/registry/components/ui/input-fields/media-input/utils.ts +18 -5
  31. package/registry/components/ui/scroll-rail/scroll-rail.module.css +104 -0
  32. package/registry/components/ui/scroll-rail/scroll-rail.tsx +159 -0
  33. package/registry/components/ui/tabs/tabs.module.css +8 -12
  34. package/registry/components/ui/tabs/tabs.tsx +75 -44
  35. package/registry/components/ui/tooltip/tooltip.module.css +8 -3
  36. package/registry/components/ui/tooltip/tooltip.tsx +16 -3
  37. package/registry/lib/string.ts +3 -3
  38. package/registry/registry.json +33 -3
@@ -181,6 +181,12 @@
181
181
  scrollbar-gutter: auto;
182
182
  }
183
183
 
184
+ /* The columns fit (`columnsFit` in data-table.tsx): nothing to scroll to
185
+ sideways, so a sub-pixel overhang can't raise a horizontal scrollbar. */
186
+ .table_body_wrap[data-fits="true"] {
187
+ overflow-x: hidden;
188
+ }
189
+
184
190
  /* ─────────────────────────────────────────────
185
191
  Shared <table> - header wrap + body wrap.
186
192
  table-layout:fixed + identical widths = perfect column alignment.
@@ -209,6 +215,16 @@
209
215
  tbody tr {
210
216
  transition: background var(--transition-fast);
211
217
 
218
+ /* The last row's line is a shadow, not a border. A shadow never adds to
219
+ the body's scroll height, and the body clips it at its own edge: with
220
+ space left under the rows it closes them, and where the rows reach the
221
+ body's border it is cut off instead of drawing a second line there.
222
+ Placed before the drop target, which wins on a last row. */
223
+ &:last-child td {
224
+ border-bottom: none;
225
+ box-shadow: 0 var(--border-1) 0 var(--color-border);
226
+ }
227
+
212
228
  &:hover td {
213
229
  background: var(--color-secondary);
214
230
  }
@@ -589,55 +605,59 @@
589
605
  flex-shrink: 0;
590
606
  margin-top: auto;
591
607
  width: 100%;
608
+ min-width: 0;
592
609
  display: flex;
610
+ /* The count and the controls share a row while both fit; past that the
611
+ controls take a row of their own below. Nothing scrolls or clips. */
612
+ flex-wrap: wrap;
593
613
  align-items: center;
594
614
  justify-content: space-between;
595
- gap: var(--spacing-8);
596
- min-width: 0;
597
- /* When the count + controls can't fit, the WHOLE bar scrolls horizontally as
598
- one strip rather than wrapping or clipping. The outlet hides X overflow, so
599
- letting a cluster shrink would just clip the nav buttons - scroll the bar
600
- instead. `space-between` still spreads them when there IS room. The vertical
601
- padding gives the buttons' focus rings room so `overflow-x: auto` (which also
602
- clips the Y axis) doesn't crop them. */
603
- overflow-x: auto;
604
- scrollbar-width: thin;
605
- scrollbar-color: var(--color-border) transparent;
606
- padding-block: var(--spacing-2);
607
-
608
- > * {
609
- flex-shrink: 0;
610
- }
615
+ column-gap: var(--spacing-8);
616
+ row-gap: var(--spacing-4);
611
617
  }
612
618
 
613
619
  @media (--sm) {
614
620
  .pagination_bar {
615
- gap: var(--spacing-5);
621
+ column-gap: var(--spacing-5);
616
622
  }
617
623
  }
618
624
 
619
- .pagination_bar_loading {
620
- flex-wrap: wrap;
621
- row-gap: var(--spacing-4);
622
- }
623
-
624
625
  .loading_select_skeleton {
625
626
  border-radius: var(--radius-sm);
626
627
  flex-shrink: 0;
627
628
  }
628
629
 
630
+ /* The count, then what a page adds beside it, like the actions on ticked
631
+ rows. The block sizes from nothing and never below its count, so the
632
+ controls wrap only once the count alone and they cannot share a row; on
633
+ their row it takes what the controls leave, and its extra scrolls there. */
629
634
  .pagination_left {
630
635
  display: flex;
631
636
  align-items: center;
632
637
  gap: var(--spacing-8);
633
- min-width: 0;
638
+ flex: 1 1 0;
639
+ min-width: min-content;
634
640
  }
635
641
 
636
642
  .pagination_left_loading {
637
643
  overflow: hidden;
638
644
  }
639
645
 
646
+ /* The extra slot, a ScrollRail: it takes what the count leaves on the row
647
+ and scrolls across on its own, with no scrollbar, so the bar never changes
648
+ height. Its items claim no width of the row (inline-size containment):
649
+ however many there are, the controls keep their place beside the count. */
650
+ .pagination_extra {
651
+ flex: 1 1 0;
652
+ contain: inline-size;
653
+ }
654
+
655
+ .pagination_extra_items {
656
+ gap: var(--spacing-4);
657
+ }
658
+
640
659
  .pagination_count {
660
+ flex-shrink: 0;
641
661
  font-size: var(--font-size-sm);
642
662
  color: var(--color-muted-foreground);
643
663
  white-space: nowrap;
@@ -650,14 +670,37 @@
650
670
 
651
671
  .pagination_controls {
652
672
  display: flex;
673
+ flex-wrap: wrap;
653
674
  align-items: center;
654
- gap: var(--spacing-8);
675
+ justify-content: flex-end;
676
+ column-gap: var(--spacing-8);
677
+ row-gap: var(--spacing-4);
655
678
  min-width: 0;
656
679
  }
657
680
 
681
+ /* A phone gives the controls a row of their own: the page size at its start,
682
+ the pages at its end. The size keeps its label for screen readers only, and
683
+ the first/last buttons go: prev/next and the page number say as much. */
658
684
  @media (--sm) {
659
685
  .pagination_controls {
660
- gap: var(--spacing-5);
686
+ flex-basis: 100%;
687
+ column-gap: var(--spacing-5);
688
+ }
689
+
690
+ .page_size_wrap {
691
+ margin-inline-end: auto;
692
+ }
693
+
694
+ .page_size_label {
695
+ position: absolute;
696
+ width: 1px;
697
+ height: 1px;
698
+ overflow: hidden;
699
+ clip-path: inset(50%);
700
+ }
701
+
702
+ .page_nav_edge {
703
+ display: none;
661
704
  }
662
705
  }
663
706