@grandbazar/ui-baza 1.5.2 → 1.5.4
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/index.cjs +269 -147
- package/dist/index.d.ts +31 -13
- package/dist/index.js +270 -148
- package/dist/style.css +89 -19
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -622,9 +622,21 @@ export declare function Switch({ className, label, indeterminate, ...props }: TS
|
|
|
622
622
|
* Table renders; it does not manage. Sorting, selection and incremental loading are owned
|
|
623
623
|
* by the consumer — the component only reflects the state it is given.
|
|
624
624
|
*
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
*
|
|
625
|
+
* In the `stacked` layout the same markup renders as a list of cards instead of a table, so a
|
|
626
|
+
* narrow screen shows every value without scrolling sideways. Deciding when that happens is the
|
|
627
|
+
* consumer's job: the library never measures the screen and ships no media or container query.
|
|
628
|
+
*
|
|
629
|
+
* Props that describe columns do nothing in `stacked` and are not forwarded to the DOM there:
|
|
630
|
+
* `align` and `colSpan`. `Table.Header` and `Table.HeaderCell` render nothing, and `Table.Body`
|
|
631
|
+
* becomes mandatory. `mode`, `isCurrent` and `Table.Row`'s `mode` keep working.
|
|
632
|
+
*
|
|
633
|
+
* @param className - Additional CSS classes; applied to the table in `table` and to the list
|
|
634
|
+
* wrapper in `stacked`, so a selector written against `td` or `tr` is silently dead in `stacked`
|
|
635
|
+
* @param mode - Surface of the container: `default` draws a self-contained card, `bare` draws
|
|
636
|
+
* nothing and expects the consumer's own surface around the table. In `stacked` the surface moves
|
|
637
|
+
* to the cards — one box per row instead of one box around the list
|
|
638
|
+
* @param layout - Shape of the rendered tree: `table` renders a real table, `stacked` renders a
|
|
639
|
+
* list of cards for a narrow screen (default: `table`)
|
|
628
640
|
*
|
|
629
641
|
* @example
|
|
630
642
|
* <Table>
|
|
@@ -653,6 +665,8 @@ export declare namespace Table {
|
|
|
653
665
|
|
|
654
666
|
declare const TABLE_CELL_ALIGNS: readonly ["left", "center", "right"];
|
|
655
667
|
|
|
668
|
+
declare const TABLE_LAYOUTS: readonly ["table", "stacked"];
|
|
669
|
+
|
|
656
670
|
declare const TABLE_MODES: readonly ["default", "bare"];
|
|
657
671
|
|
|
658
672
|
declare const TABLE_ROW_MODES: readonly ["default", "group"];
|
|
@@ -661,13 +675,13 @@ declare function TableBody({ className, children, ...props }: TTableBodyProps):
|
|
|
661
675
|
|
|
662
676
|
declare function TableCaption({ className, children, ...props }: TTableCaptionProps): JSX.Element;
|
|
663
677
|
|
|
664
|
-
declare function TableCell({ className, children, align, ...props }: TTableCellProps): JSX.Element;
|
|
678
|
+
declare function TableCell({ className, children, align, colSpan, columnLabel, ...props }: TTableCellProps): JSX.Element;
|
|
665
679
|
|
|
666
|
-
declare function TableHeader({ className, children, ...props }: TTableHeaderProps): JSX.Element;
|
|
680
|
+
declare function TableHeader({ className, children, ...props }: TTableHeaderProps): JSX.Element | null;
|
|
667
681
|
|
|
668
|
-
declare function TableHeaderCell({ className, children, align, scope, ...props }: TTableHeaderCellProps): JSX.Element;
|
|
682
|
+
declare function TableHeaderCell({ className, children, align, scope, ...props }: TTableHeaderCellProps): JSX.Element | null;
|
|
669
683
|
|
|
670
|
-
declare function TableRoot({ className, children, mode, ...props }: TTableRootProps): JSX.Element;
|
|
684
|
+
declare function TableRoot({ className, children, mode, layout, ...props }: TTableRootProps): JSX.Element;
|
|
671
685
|
|
|
672
686
|
declare function TableRow({ className, children, mode, isCurrent, ...props }: TTableRowProps): JSX.Element;
|
|
673
687
|
|
|
@@ -1034,33 +1048,37 @@ declare type TSwitchProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
|
1034
1048
|
ref?: React.RefObject<HTMLInputElement | null>;
|
|
1035
1049
|
};
|
|
1036
1050
|
|
|
1037
|
-
declare type TTableBodyProps = React.HTMLAttributes<
|
|
1051
|
+
declare type TTableBodyProps = React.HTMLAttributes<HTMLElement>;
|
|
1038
1052
|
|
|
1039
|
-
declare type TTableCaptionProps = React.HTMLAttributes<
|
|
1053
|
+
declare type TTableCaptionProps = React.HTMLAttributes<HTMLElement>;
|
|
1040
1054
|
|
|
1041
1055
|
declare type TTableCellAlign = TArrayElement<typeof TABLE_CELL_ALIGNS>;
|
|
1042
1056
|
|
|
1043
|
-
declare type TTableCellProps = Omit<React.TdHTMLAttributes<
|
|
1057
|
+
declare type TTableCellProps = Omit<React.TdHTMLAttributes<HTMLElement>, 'align'> & {
|
|
1044
1058
|
align?: TTableCellAlign;
|
|
1059
|
+
columnLabel?: React.ReactNode;
|
|
1045
1060
|
};
|
|
1046
1061
|
|
|
1047
1062
|
declare type TTableHeaderCellProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> & {
|
|
1048
1063
|
align?: TTableCellAlign;
|
|
1049
1064
|
};
|
|
1050
1065
|
|
|
1051
|
-
declare type TTableHeaderProps = React.HTMLAttributes<
|
|
1066
|
+
declare type TTableHeaderProps = React.HTMLAttributes<HTMLElement>;
|
|
1067
|
+
|
|
1068
|
+
declare type TTableLayout = TArrayElement<typeof TABLE_LAYOUTS>;
|
|
1052
1069
|
|
|
1053
1070
|
declare type TTableMode = TArrayElement<typeof TABLE_MODES>;
|
|
1054
1071
|
|
|
1055
1072
|
declare type TTableProps = React.ComponentProps<typeof TableRoot>;
|
|
1056
1073
|
|
|
1057
|
-
declare type TTableRootProps = React.TableHTMLAttributes<
|
|
1074
|
+
declare type TTableRootProps = React.TableHTMLAttributes<HTMLElement> & {
|
|
1058
1075
|
mode?: TTableMode;
|
|
1076
|
+
layout?: TTableLayout;
|
|
1059
1077
|
};
|
|
1060
1078
|
|
|
1061
1079
|
declare type TTableRowMode = TArrayElement<typeof TABLE_ROW_MODES>;
|
|
1062
1080
|
|
|
1063
|
-
declare type TTableRowProps = React.HTMLAttributes<
|
|
1081
|
+
declare type TTableRowProps = React.HTMLAttributes<HTMLElement> & {
|
|
1064
1082
|
mode?: TTableRowMode;
|
|
1065
1083
|
isCurrent?: boolean;
|
|
1066
1084
|
};
|