@smworks-cz/ui-kit 1.3.0 → 1.3.1

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.mts CHANGED
@@ -1310,6 +1310,89 @@ interface DataGridProps {
1310
1310
  */
1311
1311
  declare const DataGrid: React.FC<DataGridProps>;
1312
1312
 
1313
+ interface MobileDataCardColumn {
1314
+ /** Klíč dat v řádkovém objektu. */
1315
+ key: string;
1316
+ /** Zobrazovaný popisek. */
1317
+ header: string;
1318
+ /** Vlastní renderování hodnoty — stejný podpis jako Table/DataGrid. */
1319
+ render?: (value: any, row: any, index: number) => React.ReactNode;
1320
+ /** Skrýt tento sloupec z karty. */
1321
+ hidden?: boolean;
1322
+ /** Zobrazit toto pole jako titulek karty. */
1323
+ primary?: boolean;
1324
+ /** Povolit řazení podle tohoto sloupce. */
1325
+ sortable?: boolean;
1326
+ }
1327
+ interface MobileDataCardProps {
1328
+ /** Definice sloupců — stejný tvar jako Table/DataGrid. */
1329
+ columns: MobileDataCardColumn[];
1330
+ /** Pole dat. */
1331
+ data: any[];
1332
+ /** Klíč v řádkovém objektu pro titulek karty. Alternativa k `primary` na sloupci. */
1333
+ primaryKey?: string;
1334
+ /** Klíč identifikátoru řádku. @default 'id' */
1335
+ rowKey?: string;
1336
+ /** Povolit výběr karet. @default false */
1337
+ selectable?: boolean;
1338
+ /** Řízené vybrané ID. */
1339
+ selectedIds?: string[];
1340
+ /** Callback při změně výběru. */
1341
+ onSelectionChange?: (ids: string[]) => void;
1342
+ /** Callback při kliknutí na kartu. */
1343
+ onCardClick?: (row: any) => void;
1344
+ /** Callback při řazení. */
1345
+ onSort?: (key: string, direction: 'asc' | 'desc') => void;
1346
+ /** Aktuální klíč řazení. */
1347
+ sortKey?: string;
1348
+ /** Aktuální směr řazení. */
1349
+ sortDirection?: 'asc' | 'desc';
1350
+ /** Zobrazit skeleton karty. @default false */
1351
+ loading?: boolean;
1352
+ /** Počet skeleton karet. @default 3 */
1353
+ skeletonCount?: number;
1354
+ /** Text prázdného stavu. @default 'Žádná data' */
1355
+ emptyText?: string;
1356
+ /** Vlastní obsah prázdného stavu. */
1357
+ emptyContent?: React.ReactNode;
1358
+ /** Mezera mezi kartami v px. @default 12 */
1359
+ gap?: number;
1360
+ /** Vykreslení akčních tlačítek v patičce karty. */
1361
+ cardActions?: (row: any, index: number) => React.ReactNode;
1362
+ /** Další inline styly. */
1363
+ style?: React.CSSProperties;
1364
+ /** Dodatečná CSS třída. */
1365
+ className?: string;
1366
+ }
1367
+ /**
1368
+ * Mobilní zobrazení dat ve formě karet.
1369
+ *
1370
+ * Každý datový řádek se zobrazí jako karta s páry popisek-hodnota.
1371
+ * Kombinuje funkce Table (řazení, custom render) a DataGrid
1372
+ * (výběr, kliknutí na řádek, skeleton).
1373
+ *
1374
+ * @example
1375
+ * ```tsx
1376
+ * <MobileDataCard
1377
+ * columns={[
1378
+ * { key: 'name', header: 'Jméno', primary: true },
1379
+ * { key: 'email', header: 'Email' },
1380
+ * { key: 'role', header: 'Role' },
1381
+ * ]}
1382
+ * data={users}
1383
+ * selectable
1384
+ * onCardClick={(row) => openDetail(row)}
1385
+ * cardActions={(row) => (
1386
+ * <>
1387
+ * <Button size="sm" variant="outline" onClick={() => edit(row)}>Upravit</Button>
1388
+ * <Button size="sm" variant="destructive" onClick={() => del(row)}>Smazat</Button>
1389
+ * </>
1390
+ * )}
1391
+ * />
1392
+ * ```
1393
+ */
1394
+ declare const MobileDataCard: React.FC<MobileDataCardProps>;
1395
+
1313
1396
  interface CardProps {
1314
1397
  /** Titulek karty. */
1315
1398
  title?: string;
@@ -3343,4 +3426,4 @@ type Theme = 'light' | 'dark';
3343
3426
  */
3344
3427
  declare const useTheme: () => Theme;
3345
3428
 
3346
- export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, Alert, type AlertProps, type AlertVariant, AppSidebar, type AppSidebarProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonAsAnchorProps, type ButtonAsButtonProps, type ButtonIconPosition, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarEvent, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize, ColorPicker, type ColorPickerProps, Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize, type CommandGroup, type CommandItem, CommandMenu, type CommandMenuProps, ConfirmDialog, type ConfirmDialogProps, Container, type ContainerMaxWidth, type ContainerProps, CopyButton, type CopyButtonProps, DataGrid, type DataGridColumn, type DataGridProps, DataList, type DataListItem, type DataListProps, DatePicker, DatePickerGroup, type DatePickerGroupProps, type DatePickerProps, type DatePickerSize, Divider, type DividerOrientation, type DividerProps, type DragHandleProps, DragList, type DragListItem, type DragListProps, Drawer, type DrawerProps, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, EmptyState, type EmptyStateProps, FileUpload, type FileUploadProps, Input, InputGroup, type InputGroupProps, type InputProps, type InputSize, Link, type LinkProps, type LinkVariant, Modal, type ModalProps, Navbar, type NavbarProps, Notification, type NotificationProps, type NotificationVariant, NumberInput, type NumberInputProps, type NumberInputSize, type NumberInputVariant, OTPInput, type OTPInputProps, Pagination, type PaginationProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressCircle, type ProgressCircleProps, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, type RadioSize, Rating, type RatingProps, type RatingSize, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, type SegmentedControlSize, Select, SelectGroup, type SelectGroupProps, type SelectOption, type SelectProps, Sheet, type SheetProps, SidebarItem, type SidebarItemProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderSize, Spinner, type SpinnerProps, type SpinnerSize, Spotlight, type SpotlightItem, type SpotlightProps, Stack, type StackAlign, type StackDirection, type StackJustify, type StackProps, Stat, type StatProps, StatusBadge, type StatusBadgeProps, type StatusBadgeStatus, type StepItem, Stepper, type StepperProps, Switch, type SwitchProps, type SwitchSize, Tab, TabPanel, type TabPanelProps, type TabProps, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Tag, TagItem, type TagItemProps, type TagProps, Textarea, type TextareaProps, type TextareaResize, type TextareaSize, type Theme, Timeline, type TimelineItem, type TimelineProps, Toast, type ToastContextValue, type ToastOptions, type ToastPosition, type ToastProps, type ToastVariant, ToasterProvider, type ToasterProviderProps, Tooltip, type TooltipProps, Tree, type TreeNode, type TreeProps, type UploadedFile, useTheme, useToast };
3429
+ export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, Alert, type AlertProps, type AlertVariant, AppSidebar, type AppSidebarProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonAsAnchorProps, type ButtonAsButtonProps, type ButtonIconPosition, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarEvent, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize, ColorPicker, type ColorPickerProps, Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize, type CommandGroup, type CommandItem, CommandMenu, type CommandMenuProps, ConfirmDialog, type ConfirmDialogProps, Container, type ContainerMaxWidth, type ContainerProps, CopyButton, type CopyButtonProps, DataGrid, type DataGridColumn, type DataGridProps, DataList, type DataListItem, type DataListProps, DatePicker, DatePickerGroup, type DatePickerGroupProps, type DatePickerProps, type DatePickerSize, Divider, type DividerOrientation, type DividerProps, type DragHandleProps, DragList, type DragListItem, type DragListProps, Drawer, type DrawerProps, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, EmptyState, type EmptyStateProps, FileUpload, type FileUploadProps, Input, InputGroup, type InputGroupProps, type InputProps, type InputSize, Link, type LinkProps, type LinkVariant, MobileDataCard, type MobileDataCardColumn, type MobileDataCardProps, Modal, type ModalProps, Navbar, type NavbarProps, Notification, type NotificationProps, type NotificationVariant, NumberInput, type NumberInputProps, type NumberInputSize, type NumberInputVariant, OTPInput, type OTPInputProps, Pagination, type PaginationProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressCircle, type ProgressCircleProps, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, type RadioSize, Rating, type RatingProps, type RatingSize, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, type SegmentedControlSize, Select, SelectGroup, type SelectGroupProps, type SelectOption, type SelectProps, Sheet, type SheetProps, SidebarItem, type SidebarItemProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderSize, Spinner, type SpinnerProps, type SpinnerSize, Spotlight, type SpotlightItem, type SpotlightProps, Stack, type StackAlign, type StackDirection, type StackJustify, type StackProps, Stat, type StatProps, StatusBadge, type StatusBadgeProps, type StatusBadgeStatus, type StepItem, Stepper, type StepperProps, Switch, type SwitchProps, type SwitchSize, Tab, TabPanel, type TabPanelProps, type TabProps, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Tag, TagItem, type TagItemProps, type TagProps, Textarea, type TextareaProps, type TextareaResize, type TextareaSize, type Theme, Timeline, type TimelineItem, type TimelineProps, Toast, type ToastContextValue, type ToastOptions, type ToastPosition, type ToastProps, type ToastVariant, ToasterProvider, type ToasterProviderProps, Tooltip, type TooltipProps, Tree, type TreeNode, type TreeProps, type UploadedFile, useTheme, useToast };
package/dist/index.d.ts CHANGED
@@ -1310,6 +1310,89 @@ interface DataGridProps {
1310
1310
  */
1311
1311
  declare const DataGrid: React.FC<DataGridProps>;
1312
1312
 
1313
+ interface MobileDataCardColumn {
1314
+ /** Klíč dat v řádkovém objektu. */
1315
+ key: string;
1316
+ /** Zobrazovaný popisek. */
1317
+ header: string;
1318
+ /** Vlastní renderování hodnoty — stejný podpis jako Table/DataGrid. */
1319
+ render?: (value: any, row: any, index: number) => React.ReactNode;
1320
+ /** Skrýt tento sloupec z karty. */
1321
+ hidden?: boolean;
1322
+ /** Zobrazit toto pole jako titulek karty. */
1323
+ primary?: boolean;
1324
+ /** Povolit řazení podle tohoto sloupce. */
1325
+ sortable?: boolean;
1326
+ }
1327
+ interface MobileDataCardProps {
1328
+ /** Definice sloupců — stejný tvar jako Table/DataGrid. */
1329
+ columns: MobileDataCardColumn[];
1330
+ /** Pole dat. */
1331
+ data: any[];
1332
+ /** Klíč v řádkovém objektu pro titulek karty. Alternativa k `primary` na sloupci. */
1333
+ primaryKey?: string;
1334
+ /** Klíč identifikátoru řádku. @default 'id' */
1335
+ rowKey?: string;
1336
+ /** Povolit výběr karet. @default false */
1337
+ selectable?: boolean;
1338
+ /** Řízené vybrané ID. */
1339
+ selectedIds?: string[];
1340
+ /** Callback při změně výběru. */
1341
+ onSelectionChange?: (ids: string[]) => void;
1342
+ /** Callback při kliknutí na kartu. */
1343
+ onCardClick?: (row: any) => void;
1344
+ /** Callback při řazení. */
1345
+ onSort?: (key: string, direction: 'asc' | 'desc') => void;
1346
+ /** Aktuální klíč řazení. */
1347
+ sortKey?: string;
1348
+ /** Aktuální směr řazení. */
1349
+ sortDirection?: 'asc' | 'desc';
1350
+ /** Zobrazit skeleton karty. @default false */
1351
+ loading?: boolean;
1352
+ /** Počet skeleton karet. @default 3 */
1353
+ skeletonCount?: number;
1354
+ /** Text prázdného stavu. @default 'Žádná data' */
1355
+ emptyText?: string;
1356
+ /** Vlastní obsah prázdného stavu. */
1357
+ emptyContent?: React.ReactNode;
1358
+ /** Mezera mezi kartami v px. @default 12 */
1359
+ gap?: number;
1360
+ /** Vykreslení akčních tlačítek v patičce karty. */
1361
+ cardActions?: (row: any, index: number) => React.ReactNode;
1362
+ /** Další inline styly. */
1363
+ style?: React.CSSProperties;
1364
+ /** Dodatečná CSS třída. */
1365
+ className?: string;
1366
+ }
1367
+ /**
1368
+ * Mobilní zobrazení dat ve formě karet.
1369
+ *
1370
+ * Každý datový řádek se zobrazí jako karta s páry popisek-hodnota.
1371
+ * Kombinuje funkce Table (řazení, custom render) a DataGrid
1372
+ * (výběr, kliknutí na řádek, skeleton).
1373
+ *
1374
+ * @example
1375
+ * ```tsx
1376
+ * <MobileDataCard
1377
+ * columns={[
1378
+ * { key: 'name', header: 'Jméno', primary: true },
1379
+ * { key: 'email', header: 'Email' },
1380
+ * { key: 'role', header: 'Role' },
1381
+ * ]}
1382
+ * data={users}
1383
+ * selectable
1384
+ * onCardClick={(row) => openDetail(row)}
1385
+ * cardActions={(row) => (
1386
+ * <>
1387
+ * <Button size="sm" variant="outline" onClick={() => edit(row)}>Upravit</Button>
1388
+ * <Button size="sm" variant="destructive" onClick={() => del(row)}>Smazat</Button>
1389
+ * </>
1390
+ * )}
1391
+ * />
1392
+ * ```
1393
+ */
1394
+ declare const MobileDataCard: React.FC<MobileDataCardProps>;
1395
+
1313
1396
  interface CardProps {
1314
1397
  /** Titulek karty. */
1315
1398
  title?: string;
@@ -3343,4 +3426,4 @@ type Theme = 'light' | 'dark';
3343
3426
  */
3344
3427
  declare const useTheme: () => Theme;
3345
3428
 
3346
- export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, Alert, type AlertProps, type AlertVariant, AppSidebar, type AppSidebarProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonAsAnchorProps, type ButtonAsButtonProps, type ButtonIconPosition, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarEvent, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize, ColorPicker, type ColorPickerProps, Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize, type CommandGroup, type CommandItem, CommandMenu, type CommandMenuProps, ConfirmDialog, type ConfirmDialogProps, Container, type ContainerMaxWidth, type ContainerProps, CopyButton, type CopyButtonProps, DataGrid, type DataGridColumn, type DataGridProps, DataList, type DataListItem, type DataListProps, DatePicker, DatePickerGroup, type DatePickerGroupProps, type DatePickerProps, type DatePickerSize, Divider, type DividerOrientation, type DividerProps, type DragHandleProps, DragList, type DragListItem, type DragListProps, Drawer, type DrawerProps, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, EmptyState, type EmptyStateProps, FileUpload, type FileUploadProps, Input, InputGroup, type InputGroupProps, type InputProps, type InputSize, Link, type LinkProps, type LinkVariant, Modal, type ModalProps, Navbar, type NavbarProps, Notification, type NotificationProps, type NotificationVariant, NumberInput, type NumberInputProps, type NumberInputSize, type NumberInputVariant, OTPInput, type OTPInputProps, Pagination, type PaginationProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressCircle, type ProgressCircleProps, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, type RadioSize, Rating, type RatingProps, type RatingSize, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, type SegmentedControlSize, Select, SelectGroup, type SelectGroupProps, type SelectOption, type SelectProps, Sheet, type SheetProps, SidebarItem, type SidebarItemProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderSize, Spinner, type SpinnerProps, type SpinnerSize, Spotlight, type SpotlightItem, type SpotlightProps, Stack, type StackAlign, type StackDirection, type StackJustify, type StackProps, Stat, type StatProps, StatusBadge, type StatusBadgeProps, type StatusBadgeStatus, type StepItem, Stepper, type StepperProps, Switch, type SwitchProps, type SwitchSize, Tab, TabPanel, type TabPanelProps, type TabProps, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Tag, TagItem, type TagItemProps, type TagProps, Textarea, type TextareaProps, type TextareaResize, type TextareaSize, type Theme, Timeline, type TimelineItem, type TimelineProps, Toast, type ToastContextValue, type ToastOptions, type ToastPosition, type ToastProps, type ToastVariant, ToasterProvider, type ToasterProviderProps, Tooltip, type TooltipProps, Tree, type TreeNode, type TreeProps, type UploadedFile, useTheme, useToast };
3429
+ export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, Alert, type AlertProps, type AlertVariant, AppSidebar, type AppSidebarProps, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonAsAnchorProps, type ButtonAsButtonProps, type ButtonIconPosition, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarEvent, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize, ColorPicker, type ColorPickerProps, Combobox, type ComboboxOption, type ComboboxProps, type ComboboxSize, type CommandGroup, type CommandItem, CommandMenu, type CommandMenuProps, ConfirmDialog, type ConfirmDialogProps, Container, type ContainerMaxWidth, type ContainerProps, CopyButton, type CopyButtonProps, DataGrid, type DataGridColumn, type DataGridProps, DataList, type DataListItem, type DataListProps, DatePicker, DatePickerGroup, type DatePickerGroupProps, type DatePickerProps, type DatePickerSize, Divider, type DividerOrientation, type DividerProps, type DragHandleProps, DragList, type DragListItem, type DragListProps, Drawer, type DrawerProps, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, EmptyState, type EmptyStateProps, FileUpload, type FileUploadProps, Input, InputGroup, type InputGroupProps, type InputProps, type InputSize, Link, type LinkProps, type LinkVariant, MobileDataCard, type MobileDataCardColumn, type MobileDataCardProps, Modal, type ModalProps, Navbar, type NavbarProps, Notification, type NotificationProps, type NotificationVariant, NumberInput, type NumberInputProps, type NumberInputSize, type NumberInputVariant, OTPInput, type OTPInputProps, Pagination, type PaginationProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressCircle, type ProgressCircleProps, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, type RadioSize, Rating, type RatingProps, type RatingSize, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, type SegmentedControlSize, Select, SelectGroup, type SelectGroupProps, type SelectOption, type SelectProps, Sheet, type SheetProps, SidebarItem, type SidebarItemProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderSize, Spinner, type SpinnerProps, type SpinnerSize, Spotlight, type SpotlightItem, type SpotlightProps, Stack, type StackAlign, type StackDirection, type StackJustify, type StackProps, Stat, type StatProps, StatusBadge, type StatusBadgeProps, type StatusBadgeStatus, type StepItem, Stepper, type StepperProps, Switch, type SwitchProps, type SwitchSize, Tab, TabPanel, type TabPanelProps, type TabProps, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Tag, TagItem, type TagItemProps, type TagProps, Textarea, type TextareaProps, type TextareaResize, type TextareaSize, type Theme, Timeline, type TimelineItem, type TimelineProps, Toast, type ToastContextValue, type ToastOptions, type ToastPosition, type ToastProps, type ToastVariant, ToasterProvider, type ToasterProviderProps, Tooltip, type TooltipProps, Tree, type TreeNode, type TreeProps, type UploadedFile, useTheme, useToast };