@nubitio/ui 0.6.5 → 0.6.9

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
@@ -1,4 +1,4 @@
1
- import React$1, { ButtonHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactNode, SelectHTMLAttributes, TextareaHTMLAttributes } from "react";
1
+ import React$1, { ButtonHTMLAttributes, FormHTMLAttributes, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactNode, SelectHTMLAttributes, TextareaHTMLAttributes } from "react";
2
2
 
3
3
  //#region packages/ui/Avatar.d.ts
4
4
  type AvatarShape = 'circle' | 'square';
@@ -166,13 +166,19 @@ declare const IconButton: ({
166
166
  }: IconButtonProps) => import("react").JSX.Element;
167
167
  //#endregion
168
168
  //#region packages/ui/Card.d.ts
169
+ type CardVariant = 'auth' | 'panel';
169
170
  interface CardProps {
170
171
  title?: string;
171
172
  description?: string;
173
+ /** auth: centered narrow card (login). panel: full-width admin surface. */
174
+ variant?: CardVariant;
175
+ className?: string;
172
176
  }
173
177
  declare const Card: ({
174
178
  title,
175
179
  description,
180
+ variant,
181
+ className,
176
182
  children
177
183
  }: React$1.PropsWithChildren<CardProps>) => React$1.JSX.Element;
178
184
  //#endregion
@@ -600,6 +606,7 @@ interface ContextMenuProps {
600
606
  * - Custom trigger slot
601
607
  * - Left/right alignment
602
608
  * - Click-outside + Escape to close
609
+ * - Portalled dropdown (avoids clip inside scrollable tables)
603
610
  */
604
611
  declare const ContextMenu: ({
605
612
  items,
@@ -1094,6 +1101,14 @@ interface UiStrings {
1094
1101
  previousYears: string;
1095
1102
  /** DatePicker years view: next 12-year range. */
1096
1103
  nextYears: string;
1104
+ /** RowActions / table overflow menu trigger. */
1105
+ rowActions: string;
1106
+ /** Generic view action. */
1107
+ view: string;
1108
+ /** Pagination nav aria-label. */
1109
+ pages: string;
1110
+ previousPage: string;
1111
+ nextPage: string;
1097
1112
  }
1098
1113
  declare const EN_UI_STRINGS: UiStrings;
1099
1114
  declare const ES_UI_STRINGS: UiStrings;
@@ -1105,4 +1120,338 @@ interface UiStringsProviderProps {
1105
1120
  declare const UiStringsProvider: React$1.FC<UiStringsProviderProps>;
1106
1121
  declare const useUiStrings: () => UiStrings;
1107
1122
  //#endregion
1108
- export { ACCENT_PRESETS, type AccentPreset, AppDialog, type AppDialogProps, AppDropdown, type AppDropdownOption, type AppDropdownProps, type AppDropdownVariant, AppToolbar, type AppToolbarProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, Chip, type ChipProps, CollapsibleSection, type CollapsibleSectionProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, type ContextMenuItem, type ContextMenuProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type Density, DensityContext, type DensityContextValue, DensityProvider, Drawer, type DrawerProps, type DrawerSide, EN_UI_STRINGS, ES_UI_STRINGS, EmptyState, type EmptyStateProps, FeatureGate, type FeatureGateProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, type FileDropzoneValue, FilterPanel, type FilterPanelCategorySection, type FilterPanelChipOption, type FilterPanelDensity, type FilterPanelLayout, type FilterPanelProps, type FilterPanelStatusSection, FormField, type FormFieldProps, HubPanel, type HubPanelProps, type HubPanelVariant, IconButton, type IconButtonProps, type KpiMetricDensity, type KpiMetricItem, type KpiMetricLayout, KpiMetricRow, type KpiMetricRowProps, type KpiMetricTone, type OperationCardAccent, OperationCardGrid, type OperationCardGridProps, type OperationCardItem, Popover, type PopoverAlign, type PopoverProps, type ScopeTabOption, ScopeTabs, type ScopeTabsDensity, type ScopeTabsProps, SearchableAppDropdown, type SearchableAppDropdownProps, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, SelectField, type SelectFieldProps, SettingsPanel, type SettingsPanelProps, Skeleton, type SkeletonProps, StatCard, type StatCardProps, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldProps, type Theme, ThemeContext, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeSwitcher, type ThemeSwitcherProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineItemStatus, type TimelineItemTone, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toggle, type ToggleProps, type UiStrings, UiStringsProvider, type UiStringsProviderProps, type UseFloatingPanelOptions, type UseFloatingPanelResult, getAvatarHue, getAvatarInitials, useAccentColor, useDensity, useFloatingPanel, useTheme, useUiStrings };
1123
+ //#region packages/ui/layoutUtils.d.ts
1124
+ type SpaceScale = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
1125
+ type ColSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
1126
+ type FlexAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
1127
+ type FlexJustify = 'start' | 'center' | 'end' | 'between' | 'around';
1128
+ //#endregion
1129
+ //#region packages/ui/Page.d.ts
1130
+ interface PageProps extends HTMLAttributes<HTMLDivElement> {
1131
+ children: ReactNode;
1132
+ /** Stretch to fill the admin shell content area (flex column). */
1133
+ fill?: boolean;
1134
+ /** Remove max-width cap for wide data views. */
1135
+ wide?: boolean;
1136
+ /** Cap width for narrow forms. */
1137
+ narrow?: boolean;
1138
+ gap?: SpaceScale;
1139
+ }
1140
+ declare function Page({
1141
+ children,
1142
+ fill,
1143
+ wide,
1144
+ narrow,
1145
+ gap,
1146
+ className,
1147
+ ...props
1148
+ }: PageProps): import("react").JSX.Element;
1149
+ //#endregion
1150
+ //#region packages/ui/PageHeader.d.ts
1151
+ interface PageHeaderBreadcrumb {
1152
+ label: string;
1153
+ href: string;
1154
+ }
1155
+ interface PageHeaderBadge {
1156
+ label: string;
1157
+ variant?: BadgeVariant;
1158
+ }
1159
+ interface PageHeaderProps {
1160
+ title: string;
1161
+ subtitle?: string;
1162
+ breadcrumb?: PageHeaderBreadcrumb;
1163
+ /** Custom breadcrumb node (e.g. react-router Link). Takes precedence over breadcrumb. */
1164
+ breadcrumbSlot?: ReactNode;
1165
+ badge?: PageHeaderBadge;
1166
+ actions?: ReactNode;
1167
+ className?: string;
1168
+ }
1169
+ declare function PageHeader({
1170
+ title,
1171
+ subtitle,
1172
+ breadcrumb,
1173
+ breadcrumbSlot,
1174
+ badge,
1175
+ actions,
1176
+ className
1177
+ }: PageHeaderProps): import("react").JSX.Element;
1178
+ //#endregion
1179
+ //#region packages/ui/Stack.d.ts
1180
+ interface StackProps extends HTMLAttributes<HTMLDivElement> {
1181
+ children: ReactNode;
1182
+ gap?: SpaceScale;
1183
+ align?: FlexAlign;
1184
+ justify?: FlexJustify;
1185
+ fill?: boolean;
1186
+ }
1187
+ declare function Stack({
1188
+ children,
1189
+ gap,
1190
+ align,
1191
+ justify,
1192
+ fill,
1193
+ className,
1194
+ ...props
1195
+ }: StackProps): import("react").JSX.Element;
1196
+ //#endregion
1197
+ //#region packages/ui/Row.d.ts
1198
+ interface RowProps extends HTMLAttributes<HTMLDivElement> {
1199
+ children: ReactNode;
1200
+ gap?: SpaceScale;
1201
+ align?: FlexAlign;
1202
+ justify?: FlexJustify;
1203
+ wrap?: boolean;
1204
+ fill?: boolean;
1205
+ }
1206
+ declare function Row({
1207
+ children,
1208
+ gap,
1209
+ align,
1210
+ justify,
1211
+ wrap,
1212
+ fill,
1213
+ className,
1214
+ ...props
1215
+ }: RowProps): import("react").JSX.Element;
1216
+ //#endregion
1217
+ //#region packages/ui/Cluster.d.ts
1218
+ interface ClusterProps extends HTMLAttributes<HTMLDivElement> {
1219
+ children: ReactNode;
1220
+ gap?: SpaceScale;
1221
+ }
1222
+ /** Inline flex row that wraps — ideal for button groups and filter actions. */
1223
+ declare function Cluster({
1224
+ children,
1225
+ gap,
1226
+ className,
1227
+ ...props
1228
+ }: ClusterProps): import("react").JSX.Element;
1229
+ //#endregion
1230
+ //#region packages/ui/Grid.d.ts
1231
+ type GridCols = 12 | 'auto' | 1 | 2 | 3 | 4;
1232
+ interface GridProps extends HTMLAttributes<HTMLDivElement> {
1233
+ children: ReactNode;
1234
+ /** 12-column grid or auto-fit equal columns. */
1235
+ cols?: GridCols;
1236
+ gap?: SpaceScale;
1237
+ /** Minimum column width when cols="auto". */
1238
+ minColWidth?: string;
1239
+ fill?: boolean;
1240
+ }
1241
+ declare function Grid({
1242
+ children,
1243
+ cols,
1244
+ gap,
1245
+ minColWidth,
1246
+ fill,
1247
+ className,
1248
+ style,
1249
+ ...props
1250
+ }: GridProps): import("react").JSX.Element;
1251
+ //#endregion
1252
+ //#region packages/ui/Col.d.ts
1253
+ interface ColProps extends HTMLAttributes<HTMLDivElement> {
1254
+ children: ReactNode;
1255
+ /** Span at all breakpoints (overrides the mobile full-width default). */
1256
+ span?: ColSpan;
1257
+ spanSm?: ColSpan;
1258
+ spanMd?: ColSpan;
1259
+ spanLg?: ColSpan;
1260
+ /** Span all columns in the current row. */
1261
+ fullWidth?: boolean;
1262
+ }
1263
+ declare function Col({
1264
+ children,
1265
+ span,
1266
+ spanSm,
1267
+ spanMd,
1268
+ spanLg,
1269
+ fullWidth,
1270
+ className,
1271
+ ...props
1272
+ }: ColProps): import("react").JSX.Element;
1273
+ //#endregion
1274
+ //#region packages/ui/Section.d.ts
1275
+ interface SectionProps {
1276
+ title: string;
1277
+ children: ReactNode;
1278
+ className?: string;
1279
+ }
1280
+ declare function Section({
1281
+ title,
1282
+ children,
1283
+ className
1284
+ }: SectionProps): import("react").JSX.Element;
1285
+ //#endregion
1286
+ //#region packages/ui/FormLayout.d.ts
1287
+ type FormLayoutVariant = 'stack' | 'grid' | 'inline' | 'filter';
1288
+ interface FormLayoutProps extends FormHTMLAttributes<HTMLFormElement> {
1289
+ children: ReactNode;
1290
+ variant?: FormLayoutVariant;
1291
+ /** Minimum column width for grid and filter variants. */
1292
+ minColWidth?: string;
1293
+ }
1294
+ declare function FormLayout({
1295
+ children,
1296
+ variant,
1297
+ minColWidth,
1298
+ className,
1299
+ style,
1300
+ ...props
1301
+ }: FormLayoutProps): import("react").JSX.Element;
1302
+ //#endregion
1303
+ //#region packages/ui/FormActions.d.ts
1304
+ interface FormActionsProps {
1305
+ children: ReactNode;
1306
+ className?: string;
1307
+ }
1308
+ declare function FormActions({
1309
+ children,
1310
+ className
1311
+ }: FormActionsProps): import("react").JSX.Element;
1312
+ //#endregion
1313
+ //#region packages/ui/Alert.d.ts
1314
+ type AlertTone = 'danger' | 'warning' | 'info';
1315
+ interface AlertProps {
1316
+ tone?: AlertTone;
1317
+ children: ReactNode;
1318
+ className?: string;
1319
+ }
1320
+ declare function Alert({
1321
+ tone,
1322
+ children,
1323
+ className
1324
+ }: AlertProps): import("react").JSX.Element;
1325
+ //#endregion
1326
+ //#region packages/ui/DescriptionList.d.ts
1327
+ interface DescriptionListItem {
1328
+ term: string;
1329
+ value: ReactNode;
1330
+ }
1331
+ interface DescriptionListProps {
1332
+ items: DescriptionListItem[];
1333
+ className?: string;
1334
+ }
1335
+ declare function DescriptionList({
1336
+ items,
1337
+ className
1338
+ }: DescriptionListProps): import("react").JSX.Element;
1339
+ //#endregion
1340
+ //#region packages/ui/Code.d.ts
1341
+ interface CodeProps {
1342
+ children: ReactNode;
1343
+ className?: string;
1344
+ }
1345
+ declare function Code({
1346
+ children,
1347
+ className
1348
+ }: CodeProps): import("react").JSX.Element;
1349
+ //#endregion
1350
+ //#region packages/ui/Text.d.ts
1351
+ type TextTone = 'default' | 'muted';
1352
+ interface TextProps extends HTMLAttributes<HTMLSpanElement> {
1353
+ children: ReactNode;
1354
+ tone?: TextTone;
1355
+ as?: 'span' | 'p';
1356
+ }
1357
+ declare function Text({
1358
+ children,
1359
+ tone,
1360
+ as: Tag,
1361
+ className,
1362
+ ...props
1363
+ }: TextProps): import("react").JSX.Element;
1364
+ //#endregion
1365
+ //#region packages/ui/Pagination.d.ts
1366
+ interface PaginationProps {
1367
+ page: number;
1368
+ totalPages: number;
1369
+ onPageChange: (page: number) => void;
1370
+ ariaLabel?: string;
1371
+ /** Maximum page buttons shown (default 7). */
1372
+ maxVisible?: number;
1373
+ className?: string;
1374
+ }
1375
+ declare function Pagination({
1376
+ page,
1377
+ totalPages,
1378
+ onPageChange,
1379
+ ariaLabel,
1380
+ maxVisible,
1381
+ className
1382
+ }: PaginationProps): import("react").JSX.Element | null;
1383
+ //#endregion
1384
+ //#region packages/ui/DataTable.d.ts
1385
+ type DataTableColumnAlign = 'left' | 'right' | 'center';
1386
+ interface DataTableColumn<T> {
1387
+ id: string;
1388
+ header: ReactNode;
1389
+ align?: DataTableColumnAlign;
1390
+ nowrap?: boolean;
1391
+ muted?: boolean;
1392
+ render?: (row: T, index: number) => ReactNode;
1393
+ accessor?: (row: T) => ReactNode;
1394
+ }
1395
+ type DataTableVariant = 'default' | 'flush';
1396
+ interface DataTableProps<T> {
1397
+ columns: Array<DataTableColumn<T>>;
1398
+ rows: T[];
1399
+ getRowKey: (row: T) => string | number;
1400
+ emptyMessage?: ReactNode;
1401
+ fill?: boolean;
1402
+ /** flush drops outer chrome — use inside panel Cards. */
1403
+ variant?: DataTableVariant;
1404
+ className?: string;
1405
+ wrapClassName?: string;
1406
+ testId?: string;
1407
+ rowActions?: (row: T) => ContextMenuItem[];
1408
+ rowActionsLabel?: string;
1409
+ renderActions?: (row: T) => ReactNode;
1410
+ pagination?: PaginationProps;
1411
+ }
1412
+ declare function DataTable<T>({
1413
+ columns,
1414
+ rows,
1415
+ getRowKey,
1416
+ emptyMessage,
1417
+ fill,
1418
+ variant,
1419
+ className,
1420
+ wrapClassName,
1421
+ testId,
1422
+ rowActions,
1423
+ rowActionsLabel,
1424
+ renderActions,
1425
+ pagination
1426
+ }: DataTableProps<T>): import("react").JSX.Element | null;
1427
+ //#endregion
1428
+ //#region packages/ui/RowActions.d.ts
1429
+ interface RowActionsProps {
1430
+ items: ContextMenuItem[];
1431
+ triggerLabel?: string;
1432
+ align?: ContextMenuProps['align'];
1433
+ className?: string;
1434
+ }
1435
+ /** Context menu preset for table row overflow actions. */
1436
+ declare function RowActions({
1437
+ items,
1438
+ triggerLabel,
1439
+ align,
1440
+ className
1441
+ }: RowActionsProps): import("react").JSX.Element | null;
1442
+ //#endregion
1443
+ //#region packages/ui/useConfirm.d.ts
1444
+ type ConfirmRequest = {
1445
+ title: string;
1446
+ message: string;
1447
+ variant?: 'danger' | 'warning' | 'info';
1448
+ confirmLabel?: string;
1449
+ onConfirm: () => void;
1450
+ };
1451
+ declare function useConfirm(): {
1452
+ ask: (request: ConfirmRequest) => void;
1453
+ dismiss: () => void;
1454
+ ConfirmHost: () => import("react").JSX.Element;
1455
+ };
1456
+ //#endregion
1457
+ export { ACCENT_PRESETS, type AccentPreset, Alert, type AlertProps, type AlertTone, AppDialog, type AppDialogProps, AppDropdown, type AppDropdownOption, type AppDropdownProps, type AppDropdownVariant, AppToolbar, type AppToolbarProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Chip, type ChipProps, Cluster, type ClusterProps, Code, type CodeProps, Col, type ColProps, type ColSpan, CollapsibleSection, type CollapsibleSectionProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmRequest, ContextMenu, type ContextMenuItem, type ContextMenuProps, DataTable, type DataTableColumn, type DataTableColumnAlign, type DataTableProps, type DataTableVariant, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type Density, DensityContext, type DensityContextValue, DensityProvider, DescriptionList, type DescriptionListItem, type DescriptionListProps, Drawer, type DrawerProps, type DrawerSide, EN_UI_STRINGS, ES_UI_STRINGS, EmptyState, type EmptyStateProps, FeatureGate, type FeatureGateProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, type FileDropzoneValue, FilterPanel, type FilterPanelCategorySection, type FilterPanelChipOption, type FilterPanelDensity, type FilterPanelLayout, type FilterPanelProps, type FilterPanelStatusSection, type FlexAlign, type FlexJustify, FormActions, type FormActionsProps, FormField, type FormFieldProps, FormLayout, type FormLayoutProps, type FormLayoutVariant, Grid, type GridCols, type GridProps, HubPanel, type HubPanelProps, type HubPanelVariant, IconButton, type IconButtonProps, type KpiMetricDensity, type KpiMetricItem, type KpiMetricLayout, KpiMetricRow, type KpiMetricRowProps, type KpiMetricTone, type OperationCardAccent, OperationCardGrid, type OperationCardGridProps, type OperationCardItem, Page, PageHeader, type PageHeaderBadge, type PageHeaderBreadcrumb, type PageHeaderProps, type PageProps, Pagination, type PaginationProps, Popover, type PopoverAlign, type PopoverProps, Row, RowActions, type RowActionsProps, type RowProps, type ScopeTabOption, ScopeTabs, type ScopeTabsDensity, type ScopeTabsProps, SearchableAppDropdown, type SearchableAppDropdownProps, Section, type SectionProps, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, SelectField, type SelectFieldProps, SettingsPanel, type SettingsPanelProps, Skeleton, type SkeletonProps, type SpaceScale, Stack, type StackProps, StatCard, type StatCardProps, Text, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldProps, type TextProps, type TextTone, type Theme, ThemeContext, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeSwitcher, type ThemeSwitcherProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineItemStatus, type TimelineItemTone, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toggle, type ToggleProps, type UiStrings, UiStringsProvider, type UiStringsProviderProps, type UseFloatingPanelOptions, type UseFloatingPanelResult, getAvatarHue, getAvatarInitials, useAccentColor, useConfirm, useDensity, useFloatingPanel, useTheme, useUiStrings };