@martinsura/ui 0.1.3 → 0.1.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.d.ts CHANGED
@@ -51,7 +51,7 @@ type IconProps = {
51
51
  className?: string;
52
52
  };
53
53
  declare const buttonVariants: (props?: ({
54
- variant?: "link" | "default" | "primary" | "danger" | "success" | "ghost" | null | undefined;
54
+ variant?: "link" | "text" | "default" | "primary" | "danger" | "success" | "subtle" | "ghost" | null | undefined;
55
55
  size?: "small" | "middle" | "large" | null | undefined;
56
56
  block?: boolean | null | undefined;
57
57
  shape?: "circle" | "default" | "round" | null | undefined;
@@ -71,17 +71,33 @@ type ButtonProps = {
71
71
  iconType?: UiIconType;
72
72
  iconPosition?: "left" | "right";
73
73
  block?: boolean;
74
+ fullWidthOnMobile?: boolean;
74
75
  size?: ButtonSize;
75
76
  iconSize?: number;
76
77
  confirm?: ConfirmOptions;
77
78
  shape?: "default" | "circle" | "round";
79
+ iconOnly?: boolean;
78
80
  classNames?: {
79
81
  icon?: string;
80
82
  content?: string;
81
83
  spinner?: string;
82
84
  };
83
85
  };
84
- declare const Button: ({ variant, size, shape, block, iconPosition, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
86
+ declare const Button: ({ variant, size, shape, block, fullWidthOnMobile, iconPosition, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
87
+
88
+ type ConfirmButtonProps = {
89
+ text?: string;
90
+ children?: ReactNode;
91
+ onClick?: () => void;
92
+ disabled?: boolean;
93
+ loading?: boolean;
94
+ variant?: ButtonVariant;
95
+ size?: ButtonSize;
96
+ icon?: ComponentType<IconProps>;
97
+ className?: string;
98
+ confirm: ConfirmOptions;
99
+ };
100
+ declare const ConfirmButton: (props: ConfirmButtonProps) => react_jsx_runtime.JSX.Element;
85
101
 
86
102
  type InputFieldProps = {
87
103
  children: ReactNode;
@@ -141,6 +157,22 @@ type TextInputProps = {
141
157
  };
142
158
  declare const TextInput: react.ForwardRefExoticComponent<TextInputProps & react.RefAttributes<HTMLInputElement>>;
143
159
 
160
+ type TextareaProps = {
161
+ label?: string;
162
+ placeholder?: string;
163
+ value?: string | null;
164
+ onChange?: (value: string) => void;
165
+ rows?: number;
166
+ required?: boolean;
167
+ disabled?: boolean;
168
+ className?: string;
169
+ error?: ReactNode;
170
+ customError?: ReactNode;
171
+ errorName?: string;
172
+ noMargin?: boolean;
173
+ };
174
+ declare const Textarea: ({ rows, ...props }: TextareaProps) => react_jsx_runtime.JSX.Element;
175
+
144
176
  type NumberInputProps = {
145
177
  label?: string;
146
178
  placeholder?: string;
@@ -185,6 +217,28 @@ type CheckboxInputProps = {
185
217
  };
186
218
  declare const CheckboxInput: ({ value, ...props }: CheckboxInputProps) => react_jsx_runtime.JSX.Element;
187
219
 
220
+ type RadioOption<T extends string = string> = {
221
+ label: ReactNode;
222
+ value: T;
223
+ description?: ReactNode;
224
+ disabled?: boolean;
225
+ };
226
+ type RadioGroupProps<T extends string = string> = {
227
+ label?: string;
228
+ value?: T | null;
229
+ onChange?: (value: T) => void;
230
+ options: RadioOption<T>[];
231
+ direction?: "row" | "column";
232
+ required?: boolean;
233
+ disabled?: boolean;
234
+ error?: ReactNode;
235
+ customError?: ReactNode;
236
+ errorName?: string;
237
+ className?: string;
238
+ noMargin?: boolean;
239
+ };
240
+ declare const RadioGroup: <T extends string = string>({ direction, ...props }: RadioGroupProps<T>) => react_jsx_runtime.JSX.Element;
241
+
188
242
  type SwitchInputProps = {
189
243
  label?: string;
190
244
  value?: boolean | null;
@@ -247,6 +301,30 @@ type ColorInputProps = {
247
301
  };
248
302
  declare const ColorInput: ({ size, placeholder, presets, allowClear, variant, showAlpha, ...props }: ColorInputProps) => react_jsx_runtime.JSX.Element;
249
303
 
304
+ type SearchInputProps = {
305
+ label?: string;
306
+ value?: string | null;
307
+ onChange?: (value: string) => void;
308
+ onClear?: () => void;
309
+ placeholder?: string;
310
+ className?: string;
311
+ error?: ReactNode;
312
+ customError?: ReactNode;
313
+ errorName?: string;
314
+ noMargin?: boolean;
315
+ };
316
+ declare const SearchInput: ({ ...props }: SearchInputProps) => react_jsx_runtime.JSX.Element;
317
+
318
+ type InlineEditProps = {
319
+ label?: ReactNode;
320
+ value?: string | null;
321
+ placeholder?: string;
322
+ multiline?: boolean;
323
+ onSave?: (value: string) => void;
324
+ className?: string;
325
+ };
326
+ declare const InlineEdit: ({ value, placeholder, multiline, onSave, label, className }: InlineEditProps) => react_jsx_runtime.JSX.Element;
327
+
250
328
  type TableSize = "small" | "middle" | "large";
251
329
  type ColumnType = "date" | "datetime" | "yes/no" | "boolean" | "dot";
252
330
  type TableColumn<T> = {
@@ -333,6 +411,7 @@ type GridProps<T, TSortField = never, TFilter extends object = Record<string, ne
333
411
  selection?: GridSelection<T>;
334
412
  onRowClick?: (item: T) => void;
335
413
  verticalBorders?: boolean;
414
+ attachedTop?: boolean;
336
415
  showPageNumberChanger?: boolean;
337
416
  showPageSizeChanger?: boolean;
338
417
  className?: string;
@@ -582,24 +661,95 @@ type PanelProps = {
582
661
  };
583
662
  declare const Panel: ({ variant, inner, ...props }: PanelProps) => react_jsx_runtime.JSX.Element;
584
663
 
664
+ type ToolbarProps = {
665
+ children?: ReactNode;
666
+ start?: ReactNode;
667
+ end?: ReactNode;
668
+ wrapped?: boolean;
669
+ inset?: boolean;
670
+ className?: string;
671
+ classNames?: {
672
+ start?: string;
673
+ end?: string;
674
+ };
675
+ };
676
+ declare const Toolbar: ({ children, start, end, wrapped, inset, className, classNames }: ToolbarProps) => react_jsx_runtime.JSX.Element;
677
+ declare const ActionBar: ({ children, start, end, wrapped, inset, className, classNames }: ToolbarProps) => react_jsx_runtime.JSX.Element;
678
+
679
+ type SectionHeaderProps = {
680
+ title: ReactNode;
681
+ subtitle?: ReactNode;
682
+ actions?: ReactNode;
683
+ className?: string;
684
+ };
685
+ declare const SectionHeader: ({ title, subtitle, actions, className }: SectionHeaderProps) => react_jsx_runtime.JSX.Element;
686
+
687
+ type PageHeaderProps = {
688
+ title: ReactNode;
689
+ subtitle?: ReactNode;
690
+ breadcrumbs?: ReactNode;
691
+ actions?: ReactNode;
692
+ extra?: ReactNode;
693
+ className?: string;
694
+ };
695
+ declare const PageHeader: ({ title, subtitle, breadcrumbs, actions, extra, className }: PageHeaderProps) => react_jsx_runtime.JSX.Element;
696
+
697
+ type EntityHeaderProps = {
698
+ title: ReactNode;
699
+ subtitle?: ReactNode;
700
+ avatarName?: string;
701
+ icon?: ComponentType<IconProps>;
702
+ meta?: ReactNode;
703
+ tags?: ReactNode;
704
+ actions?: ReactNode;
705
+ className?: string;
706
+ };
707
+ declare const EntityHeader: ({ title, subtitle, avatarName, icon: Icon, meta, tags, actions, className }: EntityHeaderProps) => react_jsx_runtime.JSX.Element;
708
+
709
+ type FormActionsProps = {
710
+ children: ReactNode;
711
+ align?: "left" | "center" | "right" | "between";
712
+ className?: string;
713
+ };
714
+ declare const FormActions: ({ children, align, className }: FormActionsProps) => react_jsx_runtime.JSX.Element;
715
+
716
+ type FormSectionProps = {
717
+ title: ReactNode;
718
+ description?: ReactNode;
719
+ actions?: ReactNode;
720
+ children: ReactNode;
721
+ className?: string;
722
+ };
723
+ declare const FormSection: ({ title, description, actions, children, className }: FormSectionProps) => react_jsx_runtime.JSX.Element;
724
+ declare const Fieldset: ({ title, description, actions, children, className }: FormSectionProps) => react_jsx_runtime.JSX.Element;
725
+
585
726
  type TabOption<T extends string = string> = {
586
727
  label: React.ReactNode;
587
728
  value: T;
729
+ icon?: React.ReactNode;
730
+ badge?: React.ReactNode;
731
+ disabled?: boolean;
588
732
  };
733
+ type TabsVariant = "segmented" | "underline" | "cards";
734
+ type TabsSize = "small" | "middle" | "large";
589
735
  type TabsProps<T extends string = string> = {
590
736
  options: TabOption<T>[];
591
737
  value: T;
592
738
  onChange: (value: T) => void;
593
739
  block?: boolean;
740
+ variant?: TabsVariant;
741
+ size?: TabsSize;
594
742
  className?: string;
595
743
  classNames?: {
596
744
  list?: string;
597
745
  tab?: string;
598
746
  activeTab?: string;
599
747
  inactiveTab?: string;
748
+ icon?: string;
749
+ badge?: string;
600
750
  };
601
751
  };
602
- declare const Tabs: <T extends string = string>({ block, ...props }: TabsProps<T>) => react_jsx_runtime.JSX.Element;
752
+ declare const Tabs: <T extends string = string>({ block, variant, size, ...props }: TabsProps<T>) => react_jsx_runtime.JSX.Element;
603
753
 
604
754
  type TagColor = "geekblue" | "blue" | "green" | "cyan" | "red" | "volcano" | "orange" | "gold" | "purple" | "magenta" | "gray" | "default";
605
755
  type TagVariant = "outlined" | "filled";
@@ -907,7 +1057,7 @@ declare const useNotification: () => {
907
1057
  type EmptyProps = {
908
1058
  text?: string;
909
1059
  description?: string;
910
- icon?: React.FC<{
1060
+ icon?: ComponentType<{
911
1061
  size?: number | string;
912
1062
  strokeWidth?: number;
913
1063
  className?: string;
@@ -917,6 +1067,58 @@ type EmptyProps = {
917
1067
  };
918
1068
  declare const Empty: ({ text, description, icon: Icon, className, size, }: EmptyProps) => react_jsx_runtime.JSX.Element;
919
1069
 
1070
+ type EmptyStateProps = {
1071
+ text?: string;
1072
+ description?: string;
1073
+ icon?: EmptyProps["icon"];
1074
+ size?: "default" | "compact";
1075
+ primaryActionText?: string;
1076
+ onPrimaryAction?: () => void;
1077
+ secondaryActionText?: string;
1078
+ onSecondaryAction?: () => void;
1079
+ extra?: ReactNode;
1080
+ className?: string;
1081
+ classNames?: {
1082
+ actions?: string;
1083
+ extra?: string;
1084
+ };
1085
+ };
1086
+ declare const EmptyState: ({ primaryActionText, onPrimaryAction, secondaryActionText, onSecondaryAction, extra, className, classNames, ...props }: EmptyStateProps) => react_jsx_runtime.JSX.Element;
1087
+
1088
+ type StatTrendDirection = "up" | "down" | "neutral";
1089
+ type StatCardProps = {
1090
+ label: string;
1091
+ value: ReactNode;
1092
+ description?: ReactNode;
1093
+ icon?: ComponentType<IconProps>;
1094
+ trend?: {
1095
+ value: ReactNode;
1096
+ direction?: StatTrendDirection;
1097
+ label?: string;
1098
+ };
1099
+ footer?: ReactNode;
1100
+ className?: string;
1101
+ };
1102
+ declare const StatCard: ({ label, value, description, icon: Icon, trend, footer, className }: StatCardProps) => react_jsx_runtime.JSX.Element;
1103
+
1104
+ type DescriptionItem = {
1105
+ label: ReactNode;
1106
+ value: ReactNode;
1107
+ span?: 1 | 2 | 3;
1108
+ };
1109
+ type DescriptionListProps = {
1110
+ items: DescriptionItem[];
1111
+ columns?: 1 | 2 | 3;
1112
+ className?: string;
1113
+ };
1114
+ declare const DescriptionList: ({ items, columns, className }: DescriptionListProps) => react_jsx_runtime.JSX.Element;
1115
+ type KeyValueProps = {
1116
+ label: ReactNode;
1117
+ value: ReactNode;
1118
+ className?: string;
1119
+ };
1120
+ declare const KeyValue: ({ label, value, className }: KeyValueProps) => react_jsx_runtime.JSX.Element;
1121
+
920
1122
  type PrettyProps = {
921
1123
  data: unknown;
922
1124
  className?: string;
@@ -933,6 +1135,13 @@ type SkeletonProps = {
933
1135
  };
934
1136
  declare const Skeleton: ({ active, title, paragraph, className, }: SkeletonProps) => react_jsx_runtime.JSX.Element;
935
1137
 
1138
+ type SkeletonTableProps = {
1139
+ rows?: number;
1140
+ columns?: number;
1141
+ className?: string;
1142
+ };
1143
+ declare const SkeletonTable: ({ rows, columns, className }: SkeletonTableProps) => react_jsx_runtime.JSX.Element;
1144
+
936
1145
  type DropdownDivider = {
937
1146
  divider: true;
938
1147
  visible?: boolean;
@@ -996,6 +1205,29 @@ type TooltipProps = {
996
1205
  };
997
1206
  declare const Tooltip: ({ title, children, placement, open: controlledOpen, onOpenChange, maxWidth, className, contentClassName, arrow, classNames, }: TooltipProps) => react_jsx_runtime.JSX.Element;
998
1207
 
1208
+ type StepperItem = {
1209
+ title: ReactNode;
1210
+ description?: ReactNode;
1211
+ status?: "complete" | "current" | "upcoming";
1212
+ };
1213
+ type StepperProps = {
1214
+ items: StepperItem[];
1215
+ className?: string;
1216
+ };
1217
+ declare const Stepper: ({ items, className }: StepperProps) => react_jsx_runtime.JSX.Element;
1218
+
1219
+ type TimelineItem = {
1220
+ title: ReactNode;
1221
+ description?: ReactNode;
1222
+ time?: ReactNode;
1223
+ color?: "primary" | "success" | "danger" | "warning" | "neutral";
1224
+ };
1225
+ type TimelineProps = {
1226
+ items: TimelineItem[];
1227
+ className?: string;
1228
+ };
1229
+ declare const Timeline: ({ items, className }: TimelineProps) => react_jsx_runtime.JSX.Element;
1230
+
999
1231
  declare const uiTheme: {
1000
1232
  colors: {
1001
1233
  primary: {
@@ -1249,4 +1481,4 @@ type UiThemeConfig = {
1249
1481
  };
1250
1482
  declare function initUI(config?: UiThemeConfig): void;
1251
1483
 
1252
- export { ActiveTag, type ActiveTagProps, Alert, type AlertProps, type AlertType, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, Button, type ButtonSize, type ButtonVariant, CheckboxInput, type CheckboxInputProps, ColorInput, type ColorInputProps, type ColumnType, type ConfirmOptions, DateInput, type DateInputProps, Drawer, DrawerContent, DrawerFooter, type DrawerPlacement, type DrawerProps, DrawerTitle, Dropdown, type DropdownOption, type DropdownPlacement, type DropdownProps, Empty, type EmptyProps, ErrorProvider, FilterCheckboxInput, FilterDateInput, type FilterDateRangeGroup, FilterDateRangePopover, type FilterDescriptor, FilterNumberInput, type FilterSelectGroupItem, FilterSelectGroupPopover, FilterSelectInput, FilterTextInput, FlagTag, type FlagTagProps, Grid, type GridApiQuery, type GridColumn, GridFilters, type GridHandle, type GridProps, type GridState, HtmlInput, type HtmlInputProps, type IconProps, InputError, InputField, InputLabel, Modal, ModalContent, ModalFooter, type ModalPlacement, type ModalProps, type ModalSize, ModalTitle, MultiSelectInput, type MultiSelectInputProps, type NotificationOptions, NotificationProvider, type NotificationType, NumberInput, type NumberInputProps, Panel, type PanelProps, Popconfirm, type PopconfirmProps, Pretty, type PrettyProps, SelectInput, type SelectInputProps, ServerError, type ServerErrorValue, Skeleton, type SkeletonProps, SortDirection, Spinner, type SpinnerColor, type SpinnerProps, SwitchInput, type SwitchInputProps, type TabOption, Table, type TableColumn, type TableProps, type TableSize, Tabs, type TabsProps, Tag, type TagProps, TextInput, type TextInputProps, Tooltip, type TooltipPlacement, type TooltipProps, type UiColor, type UiDefaultIconType, type UiIconType, type UiSize, type UiThemeConfig, type UploadConfig, UploadInput, type UploadInputProps, type UploadItem, UploadProvider, type UploadStatus, getIcon, initUI, notification, registerIcons, uiTheme, useDrawer, useGrid, useModal, useNotification, useUploadConfig };
1484
+ export { ActionBar, ActiveTag, type ActiveTagProps, Alert, type AlertProps, type AlertType, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, Button, type ButtonSize, type ButtonVariant, CheckboxInput, type CheckboxInputProps, ColorInput, type ColorInputProps, type ColumnType, ConfirmButton, type ConfirmButtonProps, type ConfirmOptions, DateInput, type DateInputProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Drawer, DrawerContent, DrawerFooter, type DrawerPlacement, type DrawerProps, DrawerTitle, Dropdown, type DropdownOption, type DropdownPlacement, type DropdownProps, Empty, type EmptyProps, EmptyState, type EmptyStateProps, EntityHeader, type EntityHeaderProps, ErrorProvider, Fieldset, FilterCheckboxInput, FilterDateInput, type FilterDateRangeGroup, FilterDateRangePopover, type FilterDescriptor, FilterNumberInput, type FilterSelectGroupItem, FilterSelectGroupPopover, FilterSelectInput, FilterTextInput, FlagTag, type FlagTagProps, FormActions, type FormActionsProps, FormSection, type FormSectionProps, Grid, type GridApiQuery, type GridColumn, GridFilters, type GridHandle, type GridProps, type GridState, HtmlInput, type HtmlInputProps, type IconProps, InlineEdit, type InlineEditProps, InputError, InputField, InputLabel, KeyValue, type KeyValueProps, Modal, ModalContent, ModalFooter, type ModalPlacement, type ModalProps, type ModalSize, ModalTitle, MultiSelectInput, type MultiSelectInputProps, type NotificationOptions, NotificationProvider, type NotificationType, NumberInput, type NumberInputProps, PageHeader, type PageHeaderProps, Panel, type PanelProps, Popconfirm, type PopconfirmProps, Pretty, type PrettyProps, RadioGroup, type RadioGroupProps, type RadioOption, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, SelectInput, type SelectInputProps, ServerError, type ServerErrorValue, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, SortDirection, Spinner, type SpinnerColor, type SpinnerProps, StatCard, type StatCardProps, type StatTrendDirection, Stepper, type StepperItem, type StepperProps, SwitchInput, type SwitchInputProps, type TabOption, Table, type TableColumn, type TableProps, type TableSize, Tabs, type TabsProps, type TabsSize, type TabsVariant, Tag, type TagProps, TextInput, type TextInputProps, Textarea, type TextareaProps, Timeline, type TimelineItem, type TimelineProps, Toolbar, type ToolbarProps, Tooltip, type TooltipPlacement, type TooltipProps, type UiColor, type UiDefaultIconType, type UiIconType, type UiSize, type UiThemeConfig, type UploadConfig, UploadInput, type UploadInputProps, type UploadItem, UploadProvider, type UploadStatus, getIcon, initUI, notification, registerIcons, uiTheme, useDrawer, useGrid, useModal, useNotification, useUploadConfig };