@grandbazar/ui-baza 1.5.3 → 1.6.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.
package/dist/index.d.ts CHANGED
@@ -10,17 +10,20 @@ import { SetStateAction } from 'react';
10
10
  * Badge displays a label or indicator with customizable color and size.
11
11
  * Supports multiple color schemes and display modes for different contexts.
12
12
  *
13
- * @param size - Size of the badge (lg, md)
14
- * @param color - Color scheme (accent, violet, pink, red, orange, green, neutral)
15
- * @param mode - Display mode (primary, secondary)
13
+ * @param size - Size of the badge (lg, md, sm)
14
+ * @param color - Color scheme (accent, violet, pink, red, orange, green, neutral); ignored in glass mode
15
+ * @param mode - Display mode (primary, secondary, glass); glass is a translucent white badge for colored backgrounds
16
+ * @param shape - Corner shape (default, pill); pill rounds the corners fully without changing paddings
16
17
  */
17
- export declare function Badge({ children, className, size, color, mode, ...props }: TBadgeProps): JSX.Element;
18
+ export declare function Badge({ children, className, size, color, mode, shape, ...props }: TBadgeProps): JSX.Element;
18
19
 
19
20
  declare const BADGE_COLORS: readonly ["accent", "violet", "pink", "red", "orange", "green", "neutral"];
20
21
 
21
- declare const BADGE_MODES: readonly ["primary", "secondary"];
22
+ declare const BADGE_MODES: readonly ["primary", "secondary", "glass"];
22
23
 
23
- declare const BADGE_SIZES: readonly ["lg", "md"];
24
+ declare const BADGE_SHAPES: readonly ["default", "pill"];
25
+
26
+ declare const BADGE_SIZES: readonly ["lg", "md", "sm"];
24
27
 
25
28
  declare const BADGE_TABS_ITEM_MODES: readonly ["primary", "secondary"];
26
29
 
@@ -74,25 +77,31 @@ export declare namespace Breadcrumbs {
74
77
  * Button renders a clickable button element with various styles.
75
78
  * Supports the asChild pattern for polymorphic rendering via Slot.
76
79
  *
77
- * @param color - Color variant of the button (accent, neutral)
78
- * @param size - Size of the button (lg, md, sm)
80
+ * @param color - Color variant of the button (accent, neutral, white); white is an inverted variant for colored backgrounds
81
+ * @param size - Size of the button (lg, md, sm, md-sm); md-sm is 40px high
79
82
  * @param mode - Visual mode of the button (primary, secondary, tertiary, line)
83
+ * @param shape - Corner shape (default, pill, circle, square); circle and square render a square icon button as wide as the size is high
84
+ * @param elevated - Whether to cast a floating shadow, e.g. for a button over an image
80
85
  * @param asChild - When true, merges props onto the child element instead of rendering a button
81
86
  * @param children - Content to display inside the button
82
87
  */
83
- export declare function Button({ children, className, color, size, mode, asChild, ...props }: TButtonPropsWithAsChild): JSX.Element;
88
+ export declare function Button({ children, className, color, size, mode, shape, elevated, asChild, ...props }: TButtonPropsWithAsChild): JSX.Element;
84
89
 
85
90
  export declare namespace Button {
86
91
  var Function: typeof ButtonFunction;
87
92
  }
88
93
 
89
- declare const BUTTON_COLORS: readonly ["accent", "neutral"];
94
+ declare const BUTTON_COLORS: readonly ["accent", "neutral", "white"];
95
+
96
+ declare const BUTTON_FUNCTION_COLORS: readonly ["accent", "neutral"];
90
97
 
91
98
  declare const BUTTON_FUNCTION_SIZES: readonly ["lg", "md"];
92
99
 
93
100
  declare const BUTTON_MODES: readonly ["primary", "secondary", "line", "tertiary"];
94
101
 
95
- declare const BUTTON_SIZES: readonly ["lg", "md", "sm"];
102
+ declare const BUTTON_SHAPES: readonly ["default", "pill", "circle", "square"];
103
+
104
+ declare const BUTTON_SIZES: readonly ["lg", "md", "sm", "md-sm"];
96
105
 
97
106
  declare function ButtonFunction({ children, className, color, size, asChild, ...props }: TButtonFunctionProps): JSX.Element;
98
107
 
@@ -111,13 +120,22 @@ export declare function Checkbox({ className, label, indeterminate, ...props }:
111
120
  /**
112
121
  * Chip renders a compact, selectable tag element.
113
122
  * Supports selected and disabled states for interactive filtering and selection.
123
+ * Supports the asChild pattern for polymorphic rendering via Slot, e.g. to render the chip as a link.
114
124
  *
115
125
  * @param isSelected - Whether the chip is in selected state
116
126
  * @param disabled - Whether the chip is disabled
127
+ * @param icon - Leading icon; inherits the text color, accent while the chip is not selected
128
+ * @param shape - Corner shape (default, pill)
129
+ * @param mode - Visual mode (default, glass); glass is a translucent white chip for colored backgrounds
130
+ * @param asChild - When true, merges props onto the child element instead of rendering a div
117
131
  * @param className - Additional CSS classes
118
132
  * @param children - Content to display inside the chip
119
133
  */
120
- export declare function Chip({ isSelected, children, className, disabled, ...props }: TChipProps): JSX.Element;
134
+ export declare function Chip({ isSelected, children, className, disabled, icon, shape, mode, asChild, ...props }: TChipProps): JSX.Element;
135
+
136
+ declare const CHIP_MODES: readonly ["default", "glass"];
137
+
138
+ declare const CHIP_SHAPES: readonly ["default", "pill"];
121
139
 
122
140
  export declare function Counter({ className, size, color, ...props }: TCounterProps): JSX.Element;
123
141
 
@@ -476,13 +494,16 @@ declare function PaginationItem({ className, children, size, isCurrent, ...props
476
494
 
477
495
  declare function PaginationRoot({ totalPages, currentPage, size, maxVisiblePages, showArrows, className, onPageChange, renderItem: PaginationItem, renderIconChevron: IconChevron, renderEllipsis: Ellipsis, ...props }: TPaginationRootProps): JSX.Element;
478
496
 
479
- declare const PROGRESS_BAR_SIZES: readonly ["sm", "md"];
497
+ declare const PROGRESS_BAR_COLORS: readonly ["accent", "green"];
498
+
499
+ declare const PROGRESS_BAR_SIZES: readonly ["sm", "md", "xs"];
480
500
 
481
501
  /**
482
502
  * ProgressBar is a compound component for displaying progress indicators.
483
503
  * Provides flexible building blocks for linear and step-based progress visualization.
484
504
  *
485
- * @param size - Size variant of the progress bar (sm, md)
505
+ * @param size - Size variant of the progress bar (sm, md, xs)
506
+ * @param color - Fill color (accent, green); the track stays the same
486
507
  * @param percent - Progress percentage (0-100)
487
508
  * @param showFillOnZero - Whether to render the fill segment at 0%
488
509
  * @param className - Additional CSS classes
@@ -498,9 +519,9 @@ export declare namespace ProgressBar {
498
519
  var Steps: typeof ProgressBarSteps;
499
520
  }
500
521
 
501
- declare function ProgressBarLinear({ className, size, percent, showFillOnZero, ...props }: TProgressBarLinearProps): JSX.Element;
522
+ declare function ProgressBarLinear({ className, size, color, percent, showFillOnZero, ...props }: TProgressBarLinearProps): JSX.Element;
502
523
 
503
- declare function ProgressBarSteps({ className, size, currentStep, totalSteps, ...props }: TProgressBarStepsProps): JSX.Element;
524
+ declare function ProgressBarSteps({ className, size, color, currentStep, totalSteps, ...props }: TProgressBarStepsProps): JSX.Element;
504
525
 
505
526
  /**
506
527
  * RadioButton renders a radio input with label and visual indicator.
@@ -622,9 +643,21 @@ export declare function Switch({ className, label, indeterminate, ...props }: TS
622
643
  * Table renders; it does not manage. Sorting, selection and incremental loading are owned
623
644
  * by the consumer — the component only reflects the state it is given.
624
645
  *
625
- * @param className - Additional CSS classes applied to the table element
626
- * @param mode - Surface of the scroll container: `default` draws a self-contained card,
627
- * `bare` draws nothing and expects the consumer's own surface around the table
646
+ * In the `stacked` layout the same markup renders as a list of cards instead of a table, so a
647
+ * narrow screen shows every value without scrolling sideways. Deciding when that happens is the
648
+ * consumer's job: the library never measures the screen and ships no media or container query.
649
+ *
650
+ * Props that describe columns do nothing in `stacked` and are not forwarded to the DOM there:
651
+ * `align` and `colSpan`. `Table.Header` and `Table.HeaderCell` render nothing, and `Table.Body`
652
+ * becomes mandatory. `mode`, `isCurrent` and `Table.Row`'s `mode` keep working.
653
+ *
654
+ * @param className - Additional CSS classes; applied to the table in `table` and to the list
655
+ * wrapper in `stacked`, so a selector written against `td` or `tr` is silently dead in `stacked`
656
+ * @param mode - Surface of the container: `default` draws a self-contained card, `bare` draws
657
+ * nothing and expects the consumer's own surface around the table. In `stacked` the surface moves
658
+ * to the cards — one box per row instead of one box around the list
659
+ * @param layout - Shape of the rendered tree: `table` renders a real table, `stacked` renders a
660
+ * list of cards for a narrow screen (default: `table`)
628
661
  *
629
662
  * @example
630
663
  * <Table>
@@ -653,6 +686,8 @@ export declare namespace Table {
653
686
 
654
687
  declare const TABLE_CELL_ALIGNS: readonly ["left", "center", "right"];
655
688
 
689
+ declare const TABLE_LAYOUTS: readonly ["table", "stacked"];
690
+
656
691
  declare const TABLE_MODES: readonly ["default", "bare"];
657
692
 
658
693
  declare const TABLE_ROW_MODES: readonly ["default", "group"];
@@ -661,13 +696,13 @@ declare function TableBody({ className, children, ...props }: TTableBodyProps):
661
696
 
662
697
  declare function TableCaption({ className, children, ...props }: TTableCaptionProps): JSX.Element;
663
698
 
664
- declare function TableCell({ className, children, align, ...props }: TTableCellProps): JSX.Element;
699
+ declare function TableCell({ className, children, align, colSpan, columnLabel, ...props }: TTableCellProps): JSX.Element;
665
700
 
666
- declare function TableHeader({ className, children, ...props }: TTableHeaderProps): JSX.Element;
701
+ declare function TableHeader({ className, children, ...props }: TTableHeaderProps): JSX.Element | null;
667
702
 
668
- declare function TableHeaderCell({ className, children, align, scope, ...props }: TTableHeaderCellProps): JSX.Element;
703
+ declare function TableHeaderCell({ className, children, align, scope, ...props }: TTableHeaderCellProps): JSX.Element | null;
669
704
 
670
- declare function TableRoot({ className, children, mode, ...props }: TTableRootProps): JSX.Element;
705
+ declare function TableRoot({ className, children, mode, layout, ...props }: TTableRootProps): JSX.Element;
671
706
 
672
707
  declare function TableRow({ className, children, mode, isCurrent, ...props }: TTableRowProps): JSX.Element;
673
708
 
@@ -721,6 +756,7 @@ declare type TBadgeProps = React.HTMLAttributes<HTMLDivElement> & {
721
756
  size?: TArrayElement<typeof BADGE_SIZES>;
722
757
  color?: TArrayElement<typeof BADGE_COLORS>;
723
758
  mode?: TArrayElement<typeof BADGE_MODES>;
759
+ shape?: TArrayElement<typeof BADGE_SHAPES>;
724
760
  };
725
761
 
726
762
  declare type TBadgeTabsItemProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
@@ -749,11 +785,13 @@ declare type TButtonCommonProps = {
749
785
  color?: TArrayElement<typeof BUTTON_COLORS>;
750
786
  size?: TArrayElement<typeof BUTTON_SIZES>;
751
787
  mode?: TArrayElement<typeof BUTTON_MODES>;
788
+ shape?: TArrayElement<typeof BUTTON_SHAPES>;
789
+ elevated?: boolean;
752
790
  className?: string;
753
791
  };
754
792
 
755
793
  declare type TButtonFunctionProps = TAsChildProps<React.ButtonHTMLAttributes<HTMLButtonElement>> & {
756
- color?: TArrayElement<typeof BUTTON_COLORS>;
794
+ color?: TArrayElement<typeof BUTTON_FUNCTION_COLORS>;
757
795
  size?: TArrayElement<typeof BUTTON_FUNCTION_SIZES>;
758
796
  className?: string;
759
797
  disabled?: boolean;
@@ -778,9 +816,13 @@ declare type TCheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
778
816
  ref?: React.RefObject<HTMLInputElement | null>;
779
817
  };
780
818
 
781
- declare type TChipProps = React.HTMLAttributes<HTMLDivElement> & {
819
+ declare type TChipProps = TAsChildProps<React.HTMLAttributes<HTMLDivElement>> & {
782
820
  isSelected?: boolean;
783
821
  disabled?: boolean;
822
+ icon?: React.ReactNode;
823
+ shape?: TArrayElement<typeof CHIP_SHAPES>;
824
+ mode?: TArrayElement<typeof CHIP_MODES>;
825
+ className?: string;
784
826
  };
785
827
 
786
828
  declare type TCounterProps = React.HTMLAttributes<HTMLDivElement> & {
@@ -943,12 +985,14 @@ declare type TPortalPlacement = {
943
985
 
944
986
  declare type TProgressBarLinearProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
945
987
  size?: TArrayElement<typeof PROGRESS_BAR_SIZES>;
988
+ color?: TArrayElement<typeof PROGRESS_BAR_COLORS>;
946
989
  percent: number;
947
990
  showFillOnZero?: boolean;
948
991
  };
949
992
 
950
993
  declare type TProgressBarStepsProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
951
994
  size?: TArrayElement<typeof PROGRESS_BAR_SIZES>;
995
+ color?: TArrayElement<typeof PROGRESS_BAR_COLORS>;
952
996
  currentStep: number;
953
997
  totalSteps: number;
954
998
  };
@@ -1034,33 +1078,37 @@ declare type TSwitchProps = React.InputHTMLAttributes<HTMLInputElement> & {
1034
1078
  ref?: React.RefObject<HTMLInputElement | null>;
1035
1079
  };
1036
1080
 
1037
- declare type TTableBodyProps = React.HTMLAttributes<HTMLTableSectionElement>;
1081
+ declare type TTableBodyProps = React.HTMLAttributes<HTMLElement>;
1038
1082
 
1039
- declare type TTableCaptionProps = React.HTMLAttributes<HTMLTableCaptionElement>;
1083
+ declare type TTableCaptionProps = React.HTMLAttributes<HTMLElement>;
1040
1084
 
1041
1085
  declare type TTableCellAlign = TArrayElement<typeof TABLE_CELL_ALIGNS>;
1042
1086
 
1043
- declare type TTableCellProps = Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> & {
1087
+ declare type TTableCellProps = Omit<React.TdHTMLAttributes<HTMLElement>, 'align'> & {
1044
1088
  align?: TTableCellAlign;
1089
+ columnLabel?: React.ReactNode;
1045
1090
  };
1046
1091
 
1047
1092
  declare type TTableHeaderCellProps = Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> & {
1048
1093
  align?: TTableCellAlign;
1049
1094
  };
1050
1095
 
1051
- declare type TTableHeaderProps = React.HTMLAttributes<HTMLTableSectionElement>;
1096
+ declare type TTableHeaderProps = React.HTMLAttributes<HTMLElement>;
1097
+
1098
+ declare type TTableLayout = TArrayElement<typeof TABLE_LAYOUTS>;
1052
1099
 
1053
1100
  declare type TTableMode = TArrayElement<typeof TABLE_MODES>;
1054
1101
 
1055
1102
  declare type TTableProps = React.ComponentProps<typeof TableRoot>;
1056
1103
 
1057
- declare type TTableRootProps = React.TableHTMLAttributes<HTMLTableElement> & {
1104
+ declare type TTableRootProps = React.TableHTMLAttributes<HTMLElement> & {
1058
1105
  mode?: TTableMode;
1106
+ layout?: TTableLayout;
1059
1107
  };
1060
1108
 
1061
1109
  declare type TTableRowMode = TArrayElement<typeof TABLE_ROW_MODES>;
1062
1110
 
1063
- declare type TTableRowProps = React.HTMLAttributes<HTMLTableRowElement> & {
1111
+ declare type TTableRowProps = React.HTMLAttributes<HTMLElement> & {
1064
1112
  mode?: TTableRowMode;
1065
1113
  isCurrent?: boolean;
1066
1114
  };