@fabrika/ui 0.9.0-dev.39 → 0.9.0-dev.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabrika/ui",
3
- "version": "0.9.0-dev.39",
3
+ "version": "0.9.0-dev.40",
4
4
  "type": "module",
5
5
  "description": "React component kit for the paved road: accessible admin components styled through CSS custom properties.",
6
6
  "license": "MIT",
package/src/DataTable.tsx CHANGED
@@ -12,7 +12,7 @@ export interface Column<Row> {
12
12
  readonly grow?: boolean
13
13
  /** A width of the column scale (`--fui-column-width-<size>`), on its head and its cells. */
14
14
  readonly width?: ColumnWidth
15
- /** Its cells wrap their text instead of keeping it on one line. */
15
+ /** Its cells wrap their text, a long token anywhere; the column keeps at least its `width`, else `md` (`lg` with `grow`). */
16
16
  readonly wrap?: boolean
17
17
  }
18
18
 
@@ -827,6 +827,13 @@
827
827
  .fui-table__cell--wrap {
828
828
  white-space: normal;
829
829
  overflow-wrap: anywhere;
830
+ /* `anywhere` lowers the min-content width to one letter: without a floor, columns that keep their text on one line squeeze it. */
831
+ min-width: var(--fui-column-width-md);
832
+ }
833
+
834
+ /* The growing column carries the table's main text. */
835
+ .fui-table__cell--wrap.fui-table__cell--grow {
836
+ min-width: var(--fui-column-width-lg);
830
837
  }
831
838
 
832
839
  .fui-table__cell--width-xs {
@@ -849,6 +856,27 @@
849
856
  width: var(--fui-column-width-xl);
850
857
  }
851
858
 
859
+ /* A wrapped column's own width replaces its floor. */
860
+ .fui-table__cell--wrap.fui-table__cell--width-xs {
861
+ min-width: var(--fui-column-width-xs);
862
+ }
863
+
864
+ .fui-table__cell--wrap.fui-table__cell--width-sm {
865
+ min-width: var(--fui-column-width-sm);
866
+ }
867
+
868
+ .fui-table__cell--wrap.fui-table__cell--width-md {
869
+ min-width: var(--fui-column-width-md);
870
+ }
871
+
872
+ .fui-table__cell--wrap.fui-table__cell--width-lg {
873
+ min-width: var(--fui-column-width-lg);
874
+ }
875
+
876
+ .fui-table__cell--wrap.fui-table__cell--width-xl {
877
+ min-width: var(--fui-column-width-xl);
878
+ }
879
+
852
880
  .fui-table__select {
853
881
  width: 1px;
854
882
  padding-right: 0;
@@ -8,7 +8,7 @@ export interface Column<Row> {
8
8
  readonly grow?: boolean;
9
9
  /** A width of the column scale (`--fui-column-width-<size>`), on its head and its cells. */
10
10
  readonly width?: ColumnWidth;
11
- /** Its cells wrap their text instead of keeping it on one line. */
11
+ /** Its cells wrap their text, a long token anywhere; the column keeps at least its `width`, else `md` (`lg` with `grow`). */
12
12
  readonly wrap?: boolean;
13
13
  }
14
14
  export type ColumnWidth = 'xs' | 'sm' | 'md' | 'lg' | 'xl';