@bigstack-oss/cube-ui 0.1.0 → 0.3.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.cts CHANGED
@@ -1,7 +1,11 @@
1
1
  import * as react from 'react';
2
- import { ForwardRefExoticComponent, SVGProps, RefAttributes, ReactElement, JSX, ButtonHTMLAttributes, InputHTMLAttributes, RefObject, PropsWithChildren, AnchorHTMLAttributes, MouseEvent, ReactNode, DetailedHTMLProps, TextareaHTMLAttributes } from 'react';
3
- import { BorderColorClass } from './theme.cjs';
4
- export { BackgroundColorClass, CubeThemeName, CubeThemeProvider, CubeThemeProviderProps, FillColorClass, StrokeColorClass, TextColorClass, Typography, TypographyClassName, cubePreset, cubeTheme, getTypography } from './theme.cjs';
2
+ import { ForwardRefExoticComponent, SVGProps, RefAttributes, ReactElement, AnchorHTMLAttributes, MouseEvent, PropsWithChildren, ReactNode, ComponentType, ComponentProps, JSX, ButtonHTMLAttributes, InputHTMLAttributes, RefObject, MouseEventHandler, Ref, FocusEvent, DetailedHTMLProps, TextareaHTMLAttributes } from 'react';
3
+ import { ClassNameValue } from 'tailwind-merge';
4
+ import * as class_variance_authority_types from 'class-variance-authority/types';
5
+ import { TooltipCallbacks, ChartData } from 'chart.js';
6
+ import { FillColorClass, StrokeColorClass, BackgroundColorClass, BorderColorClass } from './theme.cjs';
7
+ export { CubeThemeName, CubeThemeProvider, CubeThemeProviderProps, TextColorClass, Typography, TypographyClassName, cubePreset, cubeTheme, getTypography } from './theme.cjs';
8
+ import { Dayjs } from 'dayjs';
5
9
  import { useTranslation } from 'react-i18next';
6
10
  import 'tailwindcss/types/config';
7
11
 
@@ -19,6 +23,266 @@ type CubeIconFrameProps = {
19
23
  children: SvgElement;
20
24
  };
21
25
 
26
+ type PropsWithClassName = {
27
+ className?: string | undefined;
28
+ };
29
+
30
+ declare const cubeHyperlinkColors: readonly ["primary", "secondary"];
31
+ declare const cubeHyperlinkVariants: readonly ["text-only", "text-inline", "icon-left", "icon-right"];
32
+ declare const cubeHyperlinkSizes: readonly ["sm", "md"];
33
+ type CubeHyperlinkColor = (typeof cubeHyperlinkColors)[number];
34
+ type CubeHyperlinkVariant = (typeof cubeHyperlinkVariants)[number];
35
+ type CubeHyperlinkSize = (typeof cubeHyperlinkSizes)[number];
36
+ type BaseHyperlinkProps = {
37
+ /**
38
+ * @default "primary"
39
+ */
40
+ color?: CubeHyperlinkColor;
41
+ /**
42
+ * @default "md"
43
+ */
44
+ size?: CubeHyperlinkSize;
45
+ /**
46
+ * @default false
47
+ */
48
+ disabled?: boolean;
49
+ children: string;
50
+ href?: string;
51
+ target?: AnchorHTMLAttributes<HTMLAnchorElement>['target'];
52
+ onClick?: (e: MouseEvent<HTMLElement>) => void;
53
+ };
54
+ type CubeHyperlinkProps = PropsWithClassName & BaseHyperlinkProps & ({
55
+ variant: Extract<CubeHyperlinkVariant, 'icon-left' | 'icon-right'>;
56
+ Icon: SvgComponent;
57
+ } | {
58
+ variant: Extract<CubeHyperlinkVariant, 'text-only' | 'text-inline'>;
59
+ Icon?: never;
60
+ });
61
+
62
+ type CubeBackButtonBackLinkProps<ContainerProps extends PropsWithChildren> = {
63
+ /**
64
+ * Where the back button goes. Renders an `<a>` around the button.
65
+ */
66
+ href?: string;
67
+ onClick?: (e: MouseEvent<HTMLElement>) => void;
68
+ /**
69
+ * Renders the back button inside a custom component (e.g. a router link)
70
+ * instead of the default `<a>`.
71
+ */
72
+ backButtonContainer?: {
73
+ Component: ComponentType<ContainerProps>;
74
+ props: ContainerProps;
75
+ };
76
+ };
77
+ type CubeBackButtonProps<ContainerProps extends PropsWithChildren = PropsWithChildren> = {
78
+ /**
79
+ * Title.
80
+ */
81
+ children: string;
82
+ /**
83
+ * Shows skeletons for the back button, title and members.
84
+ * @default false
85
+ */
86
+ isLoading?: boolean;
87
+ /**
88
+ * Content on the right of the title, such as `.Details`, `.Divider` and `.Link`.
89
+ */
90
+ titleRightContent?: ReactNode;
91
+ /**
92
+ * Content below the title, such as `.BarChart` and `.Divider`.
93
+ */
94
+ titleBottomContent?: ReactNode;
95
+ } & CubeBackButtonBackLinkProps<ContainerProps>;
96
+ type CubeBackButtonBarChartProps = {
97
+ label: string;
98
+ /**
99
+ * Usage in percent (0-100).
100
+ */
101
+ progress: number;
102
+ };
103
+ type CubeBackButtonDetailsProps = {
104
+ children: string;
105
+ };
106
+ type CubeBackButtonLinkProps = Pick<CubeHyperlinkProps, 'children' | 'href' | 'target' | 'onClick'>;
107
+
108
+ declare const CubeBackButton: {
109
+ <ContainerProps extends PropsWithChildren = {
110
+ children?: react.ReactNode | undefined;
111
+ }>(props: CubeBackButtonProps<ContainerProps>): react.JSX.Element;
112
+ BarChart: (props: CubeBackButtonBarChartProps) => react.JSX.Element;
113
+ Details: (props: CubeBackButtonDetailsProps) => react.JSX.Element;
114
+ Divider: () => react.JSX.Element;
115
+ Link: (props: CubeBackButtonLinkProps) => react.JSX.Element;
116
+ };
117
+
118
+ type CubeTableSubRowProps<ParentRow extends CubeTableRow> = {
119
+ className?: RowClassNameProp<ParentRow>;
120
+ children: ReactNode;
121
+ isVisible: (parentRow: ParentRow) => boolean;
122
+ };
123
+ declare const CubeTableSubRow: {
124
+ <ParentRow extends CubeTableRow>(_props: CubeTableSubRowProps<ParentRow>): undefined;
125
+ [CUBE_TABLE_SUB_ROW_SYMBOL$1]: boolean;
126
+ };
127
+
128
+ type CubeTableRow = {
129
+ id: string;
130
+ };
131
+ declare const CUBE_TABLE_COLUMN_SYMBOL$1: unique symbol;
132
+ declare const CUBE_TABLE_SUB_ROW_SYMBOL$1: unique symbol;
133
+ type RowClassNameProp<Row extends CubeTableRow> = ClassNameValue | ((row: Row) => ClassNameValue);
134
+ type ColumnEmphasizeProp<Row extends CubeTableRow> = boolean | ((row: Row) => boolean);
135
+
136
+ type SortingState<Row extends CubeTableRow> = {
137
+ property: keyof Row;
138
+ direction: SortDirection;
139
+ };
140
+ type SortDirection = 'ascending' | 'descending' | undefined;
141
+ type ColumnCompareFnMap<T> = Record<NonNullable<SortDirection>, CompareFn<T>>;
142
+ /**
143
+ * Determines whether the two elements are sorted.
144
+ */
145
+ type CompareFn<T> = (preceding: T, following: T) => boolean;
146
+
147
+ type CubeTableColumnSkeletonVariant = 'regular' | 'subtext-vertical' | 'subtext-horizontal' | 'icon-left' | 'icon-right' | 'icon-vertical' | 'icon-only' | 'with-barchart' | 'status';
148
+ type CubeTableColumnProps<Row extends CubeTableRow, Property extends keyof Row | never> = {
149
+ label?: ReactNode;
150
+ property?: Property;
151
+ emphasize?: ColumnEmphasizeProp<Row>;
152
+ fitContent?: boolean;
153
+ isSortable?: boolean;
154
+ /**
155
+ * Function that determines whether the two elements are sorted.
156
+ */
157
+ sortingCompareFnMap?: Property extends keyof Row ? ColumnCompareFnMap<Row[Property]> : never;
158
+ children?: ReactNode | ((propertyValue: Property extends keyof Row ? Row[Property] : undefined, row: Row, rowIndex: number) => ReactNode);
159
+ /**
160
+ * @default 'regular'
161
+ */
162
+ skeletonVariant?: CubeTableColumnSkeletonVariant;
163
+ /**
164
+ * @default undefined
165
+ */
166
+ colSpan?: number;
167
+ };
168
+ declare const CreateCubeTableColumn: <Row extends CubeTableRow>() => {
169
+ <Property extends keyof Row | never = never>(_props: CubeTableColumnProps<Row, Property>): undefined;
170
+ [CUBE_TABLE_COLUMN_SYMBOL$1]: boolean;
171
+ };
172
+
173
+ type CubeTableTdSkeletonProps = {
174
+ variant: CubeTableColumnSkeletonVariant;
175
+ };
176
+ declare const CubeTableTdSkeleton: (props: CubeTableTdSkeletonProps) => react.JSX.Element;
177
+
178
+ type CubeBasicTableProps<Row extends CubeTableRow> = PropsWithChildren<{
179
+ rows: Row[];
180
+ defaultSortingState?: SortingState<Row>;
181
+ isLoading?: boolean;
182
+ /**
183
+ * @default 5
184
+ */
185
+ skeletonRowCount?: number;
186
+ rowClassName?: RowClassNameProp<Row>;
187
+ onRowClick?: (row: Row) => void;
188
+ }>;
189
+ declare const CubeBasicTable: {
190
+ <Row extends CubeTableRow>(props: CubeBasicTableProps<Row>): react.JSX.Element;
191
+ Column: {
192
+ <Property extends "id" = never>(_props: CubeTableColumnProps<CubeTableRow, Property>): undefined;
193
+ [CUBE_TABLE_COLUMN_SYMBOL]: boolean;
194
+ };
195
+ SubRow: {
196
+ <ParentRow extends CubeTableRow>(_props: CubeTableSubRowProps<ParentRow>): undefined;
197
+ [CUBE_TABLE_SUB_ROW_SYMBOL]: boolean;
198
+ };
199
+ TdSkeleton: (props: CubeTableTdSkeletonProps) => react.JSX.Element;
200
+ };
201
+ type CubeBasicTableWithColumn<Row extends CubeTableRow> = ComponentType<ComponentProps<typeof CubeBasicTable<Row>>> & {
202
+ Column: ReturnType<typeof CreateCubeTableColumn<Row>>;
203
+ SubRow: typeof CubeTableSubRow<Row>;
204
+ TdSkeleton: typeof CubeTableTdSkeleton;
205
+ };
206
+ declare const GetCubeBasicTable: <Row extends CubeTableRow>() => CubeBasicTableWithColumn<Row>;
207
+
208
+ /**
209
+ * The table styles grouped for hand-built tables that should look like
210
+ * `CubeBasicTable`, e.g. `<td className={cubeTableStyles.td()}>`.
211
+ */
212
+ declare const cubeTableStyles: {
213
+ table: (props?: class_variance_authority_types.ClassProp | undefined) => string;
214
+ th: (props?: ({
215
+ isTableEmpty?: boolean | null | undefined;
216
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
217
+ td: (props?: ({
218
+ emphasize?: boolean | null | undefined;
219
+ fitContent?: boolean | null | undefined;
220
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
221
+ bodyTr: (props?: ({
222
+ isHoverable?: boolean | null | undefined;
223
+ roundedBottom?: boolean | "last-of-type" | null | undefined;
224
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
225
+ };
226
+
227
+ type CubeBatchActionTableRow = CubeTableRow & {
228
+ checked?: boolean;
229
+ disabled?: boolean;
230
+ };
231
+ type CubeBatchActionTableProps<Row extends CubeBatchActionTableRow> = CubeBasicTableProps<Row> & {
232
+ selectedRowIds: string[];
233
+ disabledRowIds?: string[];
234
+ onCheckChange: (rowId: string, checked: boolean) => void;
235
+ } & ({
236
+ showHeaderCheckbox: true;
237
+ onAllCheckChange: (checked: boolean) => void;
238
+ } | {
239
+ showHeaderCheckbox: false;
240
+ });
241
+
242
+ declare const CubeBatchActionTable: {
243
+ <Row extends CubeBatchActionTableRow>(props: CubeBatchActionTableProps<Row>): react.JSX.Element;
244
+ Column: {
245
+ <Property extends "id" = never>(_props: CubeTableColumnProps<CubeTableRow, Property>): undefined;
246
+ [CUBE_TABLE_COLUMN_SYMBOL]: boolean;
247
+ };
248
+ };
249
+ type CubeBatchActionTableWithColumn<Row extends CubeBatchActionTableRow> = typeof CubeBatchActionTable<Row> & {
250
+ Column: ReturnType<typeof CreateCubeTableColumn<Row>>;
251
+ };
252
+ declare const GetCubeBatchActionTable: <Row extends CubeBatchActionTableRow>() => CubeBatchActionTableWithColumn<Row>;
253
+
254
+ declare const CubeBreadcrumbItem: <ContainerProps extends PropsWithChildren>(props: CubeBreadcrumbItemProps<ContainerProps>) => react.JSX.Element;
255
+
256
+ type CubeBreadcrumbProps = PropsWithClassName & {
257
+ isLoading?: boolean;
258
+ children: ReactElement<typeof CubeBreadcrumbItem>[] | ReactElement<typeof CubeBreadcrumbItem>;
259
+ };
260
+ type CubeBreadcrumbItemProps<ContainerProps extends PropsWithChildren = PropsWithChildren> = {
261
+ label: string;
262
+ href?: string;
263
+ onClick?: (e: MouseEvent<HTMLElement>) => void;
264
+ /**
265
+ * Wraps the item's link in a custom component, e.g. a router link.
266
+ */
267
+ itemContainer?: {
268
+ Component: ComponentType<ContainerProps>;
269
+ props: ContainerProps;
270
+ };
271
+ };
272
+
273
+ type CubeBreadcrumbSkeletonProps = {
274
+ /**
275
+ * @default 5
276
+ */
277
+ length?: number;
278
+ };
279
+
280
+ declare const CubeBreadcrumb: {
281
+ (props: CubeBreadcrumbProps): react.JSX.Element;
282
+ Item: <ContainerProps extends react.PropsWithChildren>(props: CubeBreadcrumbItemProps<ContainerProps>) => react.JSX.Element;
283
+ Skeleton: (props: CubeBreadcrumbSkeletonProps) => react.JSX.Element;
284
+ };
285
+
22
286
  declare const cubeButtonTypes: readonly ["primary", "secondary", "ghost", "warning", "light"];
23
287
  declare const cubeButtonSizes: readonly ["sm", "md", "lg"];
24
288
  declare const cubeButtonUsages: readonly ["text-only", "icon-only", "icon-left", "icon-right"];
@@ -41,201 +305,1179 @@ type CubeButtonProps = Omit<JSX.IntrinsicElements['button'], 'type' | 'children'
41
305
  /**
42
306
  * @default false
43
307
  */
44
- disabled?: boolean;
308
+ disabled?: boolean;
309
+ /**
310
+ * @default false
311
+ */
312
+ loading?: boolean;
313
+ } & ({
314
+ usage?: never;
315
+ children: string;
316
+ } | {
317
+ usage: Extract<CubeButtonUsage, 'text-only'>;
318
+ children: string;
319
+ } | {
320
+ usage: Extract<CubeButtonUsage, 'icon-only'>;
321
+ Icon: SvgComponent;
322
+ } | {
323
+ usage: Extract<CubeButtonUsage, 'icon-left' | 'icon-right'>;
324
+ children: string;
325
+ Icon: SvgComponent;
326
+ });
327
+
328
+ type CubeButtonSkeletonProps = {
329
+ /**
330
+ * @default 'md
331
+ */
332
+ size?: CubeButtonSize;
333
+ /**
334
+ * @default 'text-only'
335
+ */
336
+ usage?: CubeButtonUsage;
337
+ };
338
+
339
+ declare const CubeButton: {
340
+ (props: CubeButtonProps): react.JSX.Element;
341
+ Skeleton: (props: CubeButtonSkeletonProps) => react.JSX.Element;
342
+ };
343
+
344
+ declare const cubeCheckboxColors: readonly ["primary", "primary-dark", "secondary", "secondary-dark"];
345
+ declare const cubeCheckboxLabelSizes: readonly ["md", "sm", "xs"];
346
+ declare const cubeCheckboxGridDirections: readonly ["vertical", "wrap"];
347
+ type CubeCheckboxColor = (typeof cubeCheckboxColors)[number];
348
+ type CubeCheckboxLabelSize = (typeof cubeCheckboxLabelSizes)[number];
349
+ type CubeCheckboxGridDirection = (typeof cubeCheckboxGridDirections)[number];
350
+ type CubeCheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'defaultChecked'> & {
351
+ containerClassName?: string;
352
+ /**
353
+ * @default "primary"
354
+ */
355
+ color?: CubeCheckboxColor;
356
+ label?: string;
357
+ /**
358
+ * @default "md"
359
+ */
360
+ labelSize?: CubeCheckboxLabelSize;
361
+ labelClassName?: string;
362
+ /**
363
+ * Use `null` for indeterminate state.
364
+ */
365
+ checked?: boolean | null;
366
+ /**
367
+ * Use `null` for indeterminate state.
368
+ */
369
+ defaultChecked?: boolean | null;
370
+ /**
371
+ * @default false
372
+ */
373
+ isLoading?: boolean;
374
+ ref?: RefObject<HTMLInputElement | null>;
375
+ };
376
+
377
+ type CubeCheckboxGridProps = PropsWithChildren<{
378
+ className?: string;
379
+ direction: CubeCheckboxGridDirection;
380
+ }>;
381
+
382
+ declare const CubeCheckbox: {
383
+ (props: CubeCheckboxProps): react.JSX.Element;
384
+ Skeleton: () => react.JSX.Element;
385
+ Grid: (props: CubeCheckboxGridProps) => react.JSX.Element;
386
+ };
387
+
388
+ type CubeGeneralPanelContainerProps = PropsWithChildren & PropsWithClassName;
389
+ type CubeGeneralPanelTitleBarProps = {
390
+ title?: string;
391
+ hyperLinkProps?: Pick<CubeHyperlinkProps, 'href' | 'disabled' | 'target' | 'onClick' | 'children'>;
392
+ time?: string;
393
+ /**
394
+ * @default false
395
+ */
396
+ isTimeLoading?: boolean;
397
+ dropdown?: ReactNode;
398
+ };
399
+ type CubeGeneralPanelProps = PropsWithChildren & PropsWithClassName & {
400
+ containerClassName?: string;
401
+ topic?: string;
402
+ leftSlot?: ReactNode;
403
+ rightSlot?: ReactNode;
404
+ subtext?: string;
405
+ titleBarProps?: CubeGeneralPanelTitleBarProps;
406
+ };
407
+
408
+ type CubeCollapsiblePanelLayoutLeftPanelProps = Pick<CubeGeneralPanelProps, 'children' | 'topic' | 'leftSlot' | 'rightSlot'> & {
409
+ customToggleButton?: ReactElement<{
410
+ onClick?: MouseEventHandler;
411
+ }>;
412
+ };
413
+ type CubeCollapsiblePanelLayoutRightPanelProps = PropsWithClassName & Pick<CubeGeneralPanelProps, 'children' | 'topic' | 'leftSlot' | 'rightSlot'>;
414
+ type CubeCollapsiblePanelLayoutProps = {
415
+ /**
416
+ * Whether the right panel is open by default
417
+ * @default true
418
+ */
419
+ defaultPanelOpen?: boolean;
420
+ /**
421
+ * If provided, this prop controls whether the right panel is open.
422
+ * The component becomes controlled and will always reflect the value of `isRightPanelOpen`.
423
+ *
424
+ * Use `onRightPanelOpenChange` to respond to user interactions
425
+ * and update the state in the parent.
426
+ *
427
+ * If omitted, the component manages its own open/close state internally
428
+ * starting from `defaultRightPanelOpen`.
429
+ */
430
+ isControlledPanelOpen?: boolean;
431
+ /**
432
+ * Useful only when `isRightPanelOpen` is controlled.
433
+ */
434
+ onControlledPanelOpenChange?: (open: boolean) => void;
435
+ /**
436
+ * Width of the right panel as a percentage of the container (0-100)
437
+ * @default 50
438
+ */
439
+ rightPanelWidthPercentage?: number;
440
+ children: [
441
+ ReactElement<CubeCollapsiblePanelLayoutLeftPanelProps>,
442
+ ReactElement<CubeCollapsiblePanelLayoutRightPanelProps>
443
+ ];
444
+ };
445
+
446
+ declare const CubeCollapsiblePanelLayout: {
447
+ (props: CubeCollapsiblePanelLayoutProps): react.JSX.Element;
448
+ LeftPanel: (props: CubeCollapsiblePanelLayoutLeftPanelProps) => react.JSX.Element;
449
+ RightPanel: (props: CubeCollapsiblePanelLayoutRightPanelProps) => react.JSX.Element;
450
+ };
451
+
452
+ type CubeColumnChartBaseData = {
453
+ id: string;
454
+ label: string;
455
+ value: number;
456
+ };
457
+ type CubeColumnChartData<T extends CubeColumnChartBaseData> = T & {
458
+ barColor: string;
459
+ labelColor: string;
460
+ };
461
+ type CubeColumnChartReturnData<T extends CubeColumnChartBaseData> = ChartData<'bar', number[], string> & {
462
+ items: CubeColumnChartData<T>[];
463
+ };
464
+ type CubeColumnChartProps<T extends CubeColumnChartBaseData> = {
465
+ /**
466
+ * @default false
467
+ */
468
+ isLoading?: boolean;
469
+ /**
470
+ * One bar per item. An empty array shows "No Data".
471
+ */
472
+ data: T[];
473
+ yAxisTitle: string;
474
+ /**
475
+ * Returns Chart.js tooltip callbacks, for example a custom title or label.
476
+ */
477
+ tooltipCallbackFn?: () => TooltipCallbacks<'bar'>;
478
+ onBarClick?: (bar: T) => void;
479
+ /**
480
+ * Called on every pointer move over a bar; the other bars are dimmed.
481
+ */
482
+ onBarHover?: (data: T) => void;
483
+ /**
484
+ * Called on every pointer move outside the bars.
485
+ */
486
+ onEmptyHover?: () => void;
487
+ };
488
+
489
+ declare const CubeColumnChart: <T extends CubeColumnChartBaseData>(props: CubeColumnChartProps<T>) => react.JSX.Element;
490
+
491
+ declare const cubeContentSwitcherVariants: readonly ["default", "radius"];
492
+ declare const cubeContentSwitcherSizes: readonly ["sm", "md"];
493
+ type CubeContentSwitcherVariant = (typeof cubeContentSwitcherVariants)[number];
494
+ type CubeContentSwitcherSize = (typeof cubeContentSwitcherSizes)[number];
495
+ type CubeContentSwitcherProps = PropsWithClassName & {
496
+ /**
497
+ * @default 'default'
498
+ */
499
+ variant: CubeContentSwitcherVariant;
500
+ children: ReactNode;
501
+ } & ({
502
+ variant: 'default';
503
+ /**
504
+ * @default 'md'
505
+ */
506
+ size?: CubeContentSwitcherSize;
507
+ } | {
508
+ variant: 'radius';
509
+ });
510
+ type CubeContentSwitcherItemProps = {
511
+ isActive: boolean;
512
+ disabled?: boolean;
513
+ children: string;
514
+ onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
515
+ };
516
+
517
+ declare const CubeContentSwitcher: {
518
+ (props: CubeContentSwitcherProps): react.JSX.Element;
519
+ Item: (props: CubeContentSwitcherItemProps) => react.JSX.Element;
520
+ Skeleton: () => react.JSX.Element;
521
+ };
522
+
523
+ type CubeCountSegmentedChartCountInfo = {
524
+ name: string;
525
+ count: number;
526
+ /**
527
+ * The segment and dot color, a Tailwind fill class such as `fill-chart-2`.
528
+ */
529
+ color: FillColorClass;
530
+ };
531
+ type CubeCountSegmentedChartOverview = Pick<CubeCountSegmentedChartCountInfo, 'name' | 'count'>;
532
+ type CubeCountSegmentedChartProps = {
533
+ title?: string;
534
+ subtext?: string;
535
+ /**
536
+ * A total shown first, without a color dot.
537
+ */
538
+ overview?: CubeCountSegmentedChartOverview;
539
+ countInfos: CubeCountSegmentedChartCountInfo[];
540
+ /**
541
+ * @default false
542
+ */
543
+ isLoading?: boolean;
544
+ /**
545
+ * Number of count placeholders while loading.
546
+ * @default 5
547
+ */
548
+ skeletonCount?: number;
549
+ };
550
+
551
+ declare const CubeCountSegmentedChart: (props: CubeCountSegmentedChartProps) => react.JSX.Element;
552
+
553
+ type CubeDashboardPanelHeaderProps = {
554
+ title: string;
555
+ errorCount?: number;
556
+ time?: string | null;
557
+ /**
558
+ * @default false
559
+ */
560
+ isTimeLoading?: boolean;
561
+ } & ({
562
+ hyperLinkProps?: never;
563
+ HyperLinkContainer?: never;
564
+ } | {
565
+ hyperLinkProps: Pick<CubeHyperlinkProps, 'href' | 'disabled' | 'target' | 'onClick'>;
566
+ HyperLinkContainer?: ReactElement<PropsWithChildren>;
567
+ });
568
+ type CubeDashboardPanelProps = PropsWithChildren & PropsWithClassName & CubeDashboardPanelHeaderProps & {
569
+ /**
570
+ * @default true
571
+ */
572
+ useContentWrapper?: boolean;
573
+ };
574
+ type CubeDashboardPanelRowProps = PropsWithChildren & PropsWithClassName;
575
+ type CubeDashboardPanelColProps = PropsWithChildren & PropsWithClassName;
576
+ type CubeDashboardPanelItemProps = PropsWithChildren & PropsWithClassName & {
577
+ topic?: string;
578
+ subtext?: string;
579
+ /**
580
+ * @default false
581
+ */
582
+ isSubtextLoading?: boolean;
583
+ /**
584
+ * The panel overrides the button size and type for UI consistency.
585
+ */
586
+ button?: ReactElement<CubeButtonProps>;
587
+ children: ReactNode;
588
+ };
589
+
590
+ declare const CubeDashboardPanel: {
591
+ (props: CubeDashboardPanelProps): react.JSX.Element;
592
+ Col: (props: CubeDashboardPanelColProps) => react.JSX.Element;
593
+ Row: (props: CubeDashboardPanelRowProps) => react.JSX.Element;
594
+ Item: (props: CubeDashboardPanelItemProps) => react.JSX.Element;
595
+ };
596
+
597
+ declare const cubeDatePickerDateStatuses: readonly ["unselected", "unselected-today", "selected-single", "selected-range-start", "selected-range-between", "selected-range-end"];
598
+ type CubeDatePickerDateStatus = (typeof cubeDatePickerDateStatuses)[number];
599
+ type CubeDatePickerDates = {
600
+ start: Dayjs | undefined;
601
+ end: Dayjs | undefined;
602
+ };
603
+ type CubeDatePickerProps = {
604
+ /**
605
+ * @default false
606
+ */
607
+ disabled?: boolean;
608
+ /**
609
+ * @default false
610
+ */
611
+ isLoading?: boolean;
612
+ /**
613
+ * The range shown in the trigger and the calendar; manage it with
614
+ * `useCubeDatePickerDisplayDates`.
615
+ */
616
+ displayDates: CubeDatePickerDates;
617
+ /**
618
+ * Called with the clicked day.
619
+ */
620
+ onChange: (date: Dayjs) => void;
621
+ /**
622
+ * Called when the calendar closes without applying (a click outside it).
623
+ */
624
+ onCancel: () => void;
625
+ /**
626
+ * Called by Apply, only when both dates are set; the calendar then closes.
627
+ */
628
+ onApply: () => void;
629
+ onReset: () => void;
630
+ };
631
+ type UseCubeDatePickerDisplayDatesOptions = {
632
+ initialStartDate?: Dayjs | undefined;
633
+ initialEndDate?: Dayjs | undefined;
634
+ };
635
+ type UseCubeDatePickerDisplayDates = {
636
+ displayDates: CubeDatePickerDates;
637
+ onChange: (date: Dayjs) => void;
638
+ onCancel: () => void;
639
+ onReset: () => void;
640
+ };
641
+
642
+ declare const CubeDatePicker: (props: CubeDatePickerProps) => react.JSX.Element;
643
+
644
+ /**
645
+ * The UTC offset (for example `"+08:00"`) that date components such as
646
+ * `CubeDatePicker` use for "today". Without a provider they use local time.
647
+ */
648
+ declare const CubeTimeZoneContext: react.Context<string | undefined>;
649
+
650
+ /**
651
+ * Keeps the range shown while picking. Pass the last applied dates as the
652
+ * initial dates on every render: cancelling goes back to them.
653
+ */
654
+ declare const useCubeDatePickerDisplayDates: (options: UseCubeDatePickerDisplayDatesOptions) => UseCubeDatePickerDisplayDates;
655
+
656
+ type CubeDetailsTableRowProps = {
657
+ title: string;
658
+ children: string;
659
+ };
660
+
661
+ type CubeDetailsTableProps = {
662
+ header: string;
663
+ children: ReactNode;
664
+ };
665
+ declare const CubeDetailsTable: {
666
+ (props: CubeDetailsTableProps): react.JSX.Element;
667
+ Row: (props: CubeDetailsTableRowProps) => react.JSX.Element;
668
+ };
669
+
670
+ declare const cubeDropdownSizes: readonly ["sm", "md"];
671
+ declare const cubeDropdownTypes: readonly ["radio", "checkbox"];
672
+ declare const cubeDropdownVariants: readonly ["regular", "withFilter"];
673
+ type CubeDropdownSize = (typeof cubeDropdownSizes)[number];
674
+ type CubeDropdownType = (typeof cubeDropdownTypes)[number];
675
+ type CubeDropdownVariant = (typeof cubeDropdownVariants)[number];
676
+ type OnAllCheckChange = (checked: boolean) => void;
677
+ type OnClearSelection = () => void;
678
+ type CubeDropdownBaseProps<Item> = {
679
+ /**
680
+ * @default 'md'
681
+ */
682
+ size?: CubeDropdownSize;
683
+ type: CubeDropdownType;
684
+ /**
685
+ * @default "regular"
686
+ */
687
+ variant?: CubeDropdownVariant;
688
+ selectedItems: Item[];
689
+ /**
690
+ * @default false
691
+ */
692
+ isLoading?: boolean;
693
+ /**
694
+ * @default false
695
+ */
696
+ disabled?: boolean;
697
+ label?: string;
698
+ skeletonClassName?: string;
699
+ children: ReactNode;
700
+ };
701
+ type CheckboxPropsWithFilter<Item> = CubeDropdownBaseProps<Item> & {
702
+ type: 'checkbox';
703
+ variant: 'withFilter';
704
+ onAllCheckChange: OnAllCheckChange;
705
+ onClearSelection: OnClearSelection;
706
+ };
707
+ type CheckboxPropsRegular<Item> = CubeDropdownBaseProps<Item> & {
708
+ type: 'checkbox';
709
+ variant?: Exclude<CubeDropdownVariant, 'withFilter'>;
710
+ onAllCheckChange: OnAllCheckChange;
711
+ onClearSelection?: never;
712
+ };
713
+ type RadioProps<Item> = CubeDropdownBaseProps<Item> & {
714
+ type: 'radio';
715
+ variant?: CubeDropdownVariant;
716
+ onAllCheckChange?: never;
717
+ onClearSelection?: never;
718
+ };
719
+ type CubeDropdownProps<Item> = CheckboxPropsWithFilter<Item> | CheckboxPropsRegular<Item> | RadioProps<Item>;
720
+
721
+ type CubeDropdownItemProps<Item> = {
722
+ children: string;
723
+ item: Item;
724
+ /**
725
+ * @default false
726
+ */
727
+ disabled?: boolean;
728
+ onClick: () => void;
729
+ };
730
+
731
+ type CubeDropdownMenuProps = {
732
+ children: ReactNode;
733
+ className?: string;
734
+ };
735
+
736
+ type CubeDropdownTriggerProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'> & {
737
+ children?: string;
738
+ placeholder?: string;
739
+ };
740
+
741
+ declare const CubeDropdown: {
742
+ <Item>(props: CubeDropdownProps<Item>): react.JSX.Element;
743
+ Trigger: (props: CubeDropdownTriggerProps) => react.JSX.Element;
744
+ Menu: (props: CubeDropdownMenuProps) => react.ReactPortal;
745
+ Item: <Item>(props: CubeDropdownItemProps<Item>) => react.JSX.Element;
746
+ };
747
+
748
+ declare const CubeGeneralPanel: {
749
+ (props: CubeGeneralPanelProps): react.JSX.Element;
750
+ Container: (props: CubeGeneralPanelContainerProps) => react.JSX.Element;
751
+ TitleBar: (props: CubeGeneralPanelTitleBarProps) => react.JSX.Element;
752
+ };
753
+
754
+ type CubeHeaderQuickAccess = {
755
+ Icon: SvgComponent;
756
+ /**
757
+ * Opened in a new tab.
758
+ */
759
+ href: string;
760
+ /**
761
+ * Tooltip text, also the link's accessible name.
762
+ */
763
+ hoverMessage: string;
764
+ };
765
+ type CubeHeaderFunctionBarItem<ContainerProps extends PropsWithChildren = PropsWithChildren> = {
766
+ Icon: SvgComponent;
767
+ /**
768
+ * Tooltip text, also the button's accessible name.
769
+ */
770
+ hoverMessage?: string;
771
+ onClick?: () => void;
772
+ /**
773
+ * Wraps the button in a custom component, for example a router link.
774
+ */
775
+ container?: {
776
+ Component: ComponentType<ContainerProps>;
777
+ props: ContainerProps;
778
+ };
779
+ /**
780
+ * Rendered inside `container` after the button, for example a badge.
781
+ */
782
+ additionalElements?: ReactNode[];
783
+ };
784
+ type CubeHeaderLanguageOption = {
785
+ label: string;
786
+ value: string;
787
+ onClick: (value: string) => void;
788
+ };
789
+ type CubeHeaderProps = {
790
+ /**
791
+ * Shows skeletons for the quick accesses.
792
+ * @default false
793
+ */
794
+ isLoading?: boolean;
795
+ quickAccesses: CubeHeaderQuickAccess[];
796
+ functionBarItems: CubeHeaderFunctionBarItem[];
797
+ /**
798
+ * The `value` of the selected language option.
799
+ */
800
+ currentLanguage: string;
801
+ languageOptions: CubeHeaderLanguageOption[];
802
+ };
803
+
804
+ declare const CubeHeader: (props: CubeHeaderProps) => react.JSX.Element;
805
+
806
+ declare const CubeHyperlink: (props: CubeHyperlinkProps) => react.DetailedReactHTMLElement<{
807
+ className: string;
808
+ href: string | undefined;
809
+ target: react.HTMLAttributeAnchorTarget | undefined;
810
+ onClick: (e: MouseEvent<HTMLElement>) => void;
811
+ }, HTMLElement>;
812
+
813
+ declare const CubeIconFrame: (props: CubeIconFrameProps) => react.JSX.Element;
814
+
815
+ declare const cubeIconTextTypes: readonly ["primary", "warning", "error", "functional", "secondary", "positive", "primary-outline"];
816
+ type CubeIconTextType = (typeof cubeIconTextTypes)[number];
817
+ type CubeIconTextProps = PropsWithClassName & {
818
+ type: CubeIconTextType;
819
+ children: string;
820
+ };
821
+
822
+ declare const CubeIconText: (props: CubeIconTextProps) => react.JSX.Element;
823
+
824
+ type CubeInformationProps = PropsWithChildren<{
825
+ /**
826
+ * @default false
827
+ */
828
+ showIcon?: boolean;
829
+ }>;
830
+ declare const CubeInformation: (props: CubeInformationProps) => react.JSX.Element;
831
+
832
+ type InputSkeletonType = 'input' | 'label' | 'footer';
833
+ type CubeInputSkeletonProps = {
834
+ type: InputSkeletonType;
835
+ };
836
+
837
+ type CubeInputProps = InputHTMLAttributes<HTMLInputElement> & {
838
+ /**
839
+ * @default false
840
+ */
841
+ isLoading?: boolean;
842
+ label?: string;
843
+ tooltip?: React.ReactNode;
844
+ helpMessage?: string;
845
+ errorMessage?: string | boolean;
846
+ trailingIcon?: SvgElement;
847
+ };
848
+ declare const CubeInput: react.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
849
+ /**
850
+ * @default false
851
+ */
852
+ isLoading?: boolean;
853
+ label?: string;
854
+ tooltip?: React.ReactNode;
855
+ helpMessage?: string;
856
+ errorMessage?: string | boolean;
857
+ trailingIcon?: SvgElement;
858
+ } & react.RefAttributes<HTMLInputElement>> & {
859
+ Skeleton: (props: CubeInputSkeletonProps) => react.JSX.Element;
860
+ };
861
+
862
+ declare const cubeLoadingSpinnerVariants: readonly ["dot45", "dot120", "cube"];
863
+ type CubeLoadingSpinnerVariant = (typeof cubeLoadingSpinnerVariants)[number];
864
+ type CubeLoadingSpinnerProps = PropsWithClassName & {
865
+ variant: CubeLoadingSpinnerVariant;
866
+ };
867
+
868
+ declare const CubeLoadingSpinner: (props: CubeLoadingSpinnerProps) => react.JSX.Element;
869
+
870
+ type CubeLogConsoleProps = PropsWithClassName & {
871
+ title?: {
872
+ label: string;
873
+ href?: string;
874
+ };
875
+ copyTooltip?: string;
876
+ logWrapperClassName?: string;
877
+ children: string;
878
+ };
879
+ declare const CubeLogConsole: (props: CubeLogConsoleProps) => react.JSX.Element;
880
+
881
+ type CubeMessageProps = {
882
+ label?: string;
883
+ time?: string;
884
+ tag?: string;
885
+ title: string;
886
+ children: string;
887
+ };
888
+ declare const CubeMessage: (props: CubeMessageProps) => react.JSX.Element;
889
+
890
+ declare const cubeModalSizes: readonly ["sm", "md"];
891
+ type CubeModalSize = (typeof cubeModalSizes)[number];
892
+ type CubeModalProps = {
893
+ children: ReactNode;
894
+ /**
895
+ * @default 'md'
896
+ */
897
+ size?: CubeModalSize;
898
+ isOpen: boolean;
899
+ title: string;
900
+ footerMessage?: ReactNode;
901
+ /**
902
+ * @default true
903
+ */
904
+ isActionButtonVisible?: boolean;
905
+ /**
906
+ * @default 'Action'
907
+ */
908
+ actionText?: string;
909
+ actionButtonProps?: Pick<CubeButtonProps, 'loading' | 'disabled'>;
910
+ /**
911
+ * @default true
912
+ */
913
+ isCancelButtonVisible?: boolean;
914
+ cancelButtonProps?: Pick<CubeButtonProps, 'disabled'>;
915
+ bodyRef?: RefObject<HTMLDivElement | null>;
916
+ onActionClick?: () => void;
917
+ onCloseClick: () => void;
918
+ } & PropsWithClassName;
919
+
920
+ declare const CubeModal: (props: CubeModalProps) => react.ReactPortal;
921
+
922
+ declare const cubeNaggingTypes: readonly ["error", "warning"];
923
+ declare const cubeNaggingVariants: readonly ["sidebar", "top"];
924
+ type CubeNaggingType = (typeof cubeNaggingTypes)[number];
925
+ type CubeNaggingVariant = (typeof cubeNaggingVariants)[number];
926
+ type CubeNaggingLink = Pick<CubeHyperlinkProps, 'href' | 'onClick'> & {
927
+ text: CubeHyperlinkProps['children'];
928
+ };
929
+ type CubeNaggingProps = PropsWithClassName & {
930
+ type: CubeNaggingType;
931
+ title: string;
932
+ titleClassName?: string;
933
+ description?: string | string[];
934
+ link?: CubeNaggingLink;
935
+ } & ({
936
+ variant: Extract<CubeNaggingVariant, 'sidebar'>;
937
+ } | {
938
+ variant: Extract<CubeNaggingVariant, 'top'>;
939
+ onClose?: () => void;
940
+ });
941
+
942
+ declare const CubeNagging: (props: CubeNaggingProps) => react.JSX.Element;
943
+
944
+ declare const cubeNotificationTypes: readonly ["neutral", "positive", "warning", "error"];
945
+ type CubeNotificationType = (typeof cubeNotificationTypes)[number];
946
+ type CubeNotificationLink = Pick<CubeHyperlinkProps, 'className' | 'href' | 'onClick'> & {
947
+ /**
948
+ * Wraps the link, e.g. a router link. The link becomes its `children`.
949
+ */
950
+ Container?: ReactElement<PropsWithChildren>;
951
+ text: string;
952
+ };
953
+ type CubeNotificationBaseProps = {
954
+ /**
955
+ * @default 'neutral'
956
+ */
957
+ type?: CubeNotificationType;
958
+ title?: string;
959
+ link?: CubeNotificationLink;
960
+ onClose?: () => void;
961
+ };
962
+
963
+ type CubeInlineNotificationSkeletonProps = PropsWithClassName & {
964
+ hasIcon?: boolean;
965
+ hasTitle?: boolean;
966
+ hasSubtitle?: boolean;
967
+ hasLink?: boolean;
968
+ };
969
+
970
+ type CubeInlineNotificationProps = PropsWithChildren<PropsWithClassName & CubeNotificationBaseProps & {
971
+ isLoading?: boolean;
972
+ skeletonClassName?: string;
973
+ /**
974
+ * @default true
975
+ */
976
+ isClosable?: boolean;
977
+ }>;
978
+ declare const CubeInlineNotification: {
979
+ (props: CubeInlineNotificationProps): react.JSX.Element;
980
+ Skeleton: (props: CubeInlineNotificationSkeletonProps) => react.JSX.Element;
981
+ };
982
+
983
+ declare const MAX_VISIBLE_TOASTS_AMOUNT = 4;
984
+ type CubeToastType = Omit<CubeNotificationBaseProps, 'onClose'> & {
985
+ id: string;
986
+ message: string;
987
+ time: string;
988
+ };
989
+
990
+ type CubeToastContextValue = {
991
+ addToast: (toast: CubeToastType) => void;
992
+ removeToast: (id: string) => void;
993
+ };
994
+
995
+ declare const renderLink: (link?: CubeNotificationBaseProps["link"]) => react.JSX.Element | null;
996
+
997
+ declare const CubeToastProvider: (props: PropsWithChildren) => react.JSX.Element;
998
+
999
+ declare const useCubeToast: () => CubeToastContextValue;
1000
+
1001
+ type CubeToggleProps = PropsWithClassName & {
1002
+ /**
1003
+ * Whether the toggle is on. Always controlled by the caller —
1004
+ * pair with `onCheckedChange` to update this value when the user toggles.
1005
+ */
1006
+ checked: boolean;
1007
+ /**
1008
+ * Called with the next on/off value when the user toggles. Required so the
1009
+ * caller can update `checked`.
1010
+ */
1011
+ onCheckedChange: (checked: boolean) => void;
1012
+ /**
1013
+ * Visible text shown next to the toggle. Also provides the accessible name
1014
+ * via `aria-labelledby` / `<label htmlFor>`.
1015
+ */
1016
+ label?: string;
1017
+ /**
1018
+ * Accessible name when no visible `label` is rendered. Prefer `label` when
1019
+ * the name should also appear on screen.
1020
+ */
1021
+ 'aria-label'?: string;
1022
+ /**
1023
+ * When true, the toggle cannot be interacted with.
1024
+ * @default false
1025
+ */
1026
+ disabled?: boolean;
1027
+ };
1028
+ declare const CubeToggle: (props: CubeToggleProps) => react.JSX.Element;
1029
+
1030
+ declare const cubeOverflowMenuItemTypes: readonly ["plain", "menu-icon", "check-mark", "toggle", "trailing-icon", "custom-leading-element"];
1031
+ type CubeOverflowMenuItemType = (typeof cubeOverflowMenuItemTypes)[number];
1032
+ type CubeOverflowMenuTriggerProps = {
1033
+ ref?: Ref<HTMLElement>;
1034
+ onClick?: (e: MouseEvent<HTMLElement>) => void;
1035
+ };
1036
+ type CubeOverflowMenuProps = {
1037
+ /**
1038
+ * The element that toggles the menu. It receives a `ref` and an `onClick`;
1039
+ * its own `ref` and `onClick` are still called.
1040
+ */
1041
+ triggerElement: ReactElement<CubeOverflowMenuTriggerProps>;
1042
+ children: ReactNode;
1043
+ };
1044
+ type ClickableItemProps = {
1045
+ /**
1046
+ * @default false
1047
+ */
1048
+ disabled?: boolean;
1049
+ onClick?: () => void;
1050
+ };
1051
+ type PlainItem = {
1052
+ type: 'plain';
1053
+ } & ClickableItemProps;
1054
+ type ItemWithMenuIcon = {
1055
+ type: 'menu-icon';
1056
+ MenuIcon: SvgComponent;
1057
+ } & ClickableItemProps;
1058
+ type ItemWithCheckMark = {
1059
+ type: 'check-mark';
1060
+ isChecked: boolean;
1061
+ } & ClickableItemProps;
1062
+ type ItemWithToggle = {
1063
+ type: 'toggle';
1064
+ } & Pick<CubeToggleProps, 'checked'> & Partial<Pick<CubeToggleProps, 'onCheckedChange'>> & ClickableItemProps;
1065
+ type ItemWithTrailingIcon = {
1066
+ type: 'trailing-icon';
1067
+ TrailingIcon: SvgComponent;
1068
+ } & ClickableItemProps;
1069
+ type ItemWithCustomLeadingElement = {
1070
+ type: 'custom-leading-element';
1071
+ element: ReactNode;
1072
+ } & ClickableItemProps;
1073
+ type CubeOverflowMenuItemProps = {
1074
+ title: string;
1075
+ /**
1076
+ * @default false
1077
+ */
1078
+ boldTitle?: boolean;
1079
+ subText?: string;
1080
+ } & (PlainItem | ItemWithMenuIcon | ItemWithCheckMark | ItemWithToggle | ItemWithTrailingIcon | ItemWithCustomLeadingElement);
1081
+ type CubeOverflowMenuTitleProps = {
1082
+ children: string;
1083
+ };
1084
+
1085
+ declare const CubeOverflowMenu: {
1086
+ (props: CubeOverflowMenuProps): react.JSX.Element;
1087
+ Item: (props: CubeOverflowMenuItemProps) => react.JSX.Element;
1088
+ Divider: () => react.JSX.Element;
1089
+ Title: (props: CubeOverflowMenuTitleProps) => react.JSX.Element;
1090
+ };
1091
+
1092
+ declare const itemsPerPageOptions: readonly [25, 50, 75, 100, 200];
1093
+ type ItemsPerPage = (typeof itemsPerPageOptions)[number];
1094
+ declare const DEFAULT_ITEMS_PER_PAGE: ItemsPerPage;
1095
+
1096
+ type CubePaginationProps = {
1097
+ isLoading?: boolean;
1098
+ /**
1099
+ * The total number of items
1100
+ */
1101
+ totalItems: number;
1102
+ /**
1103
+ * The current page is 1-indexed
1104
+ * i.e., the first page is 1, not 0
1105
+ */
1106
+ currentPage: number;
1107
+ /**
1108
+ * @default 10
1109
+ */
1110
+ itemsPerPage: ItemsPerPage;
1111
+ onPageChange?: (page: number) => void;
1112
+ onItemsPerPageChange?: (itemsPerPage: ItemsPerPage) => void;
1113
+ };
1114
+ declare const CubePagination: (props: CubePaginationProps) => react.JSX.Element;
1115
+
1116
+ type CubePasswordInputProps = Omit<CubeInputProps, 'trailingIcon' | 'type'> & {
1117
+ /**
1118
+ * @default false
1119
+ */
1120
+ initialShowPassword?: boolean;
1121
+ };
1122
+ declare const CubePasswordInput: (props: CubePasswordInputProps) => react.JSX.Element;
1123
+
1124
+ type CubePercentagePieChartProps = {
1125
+ title: string;
1126
+ unit: string;
1127
+ total: number;
1128
+ used: number;
1129
+ /**
1130
+ * If not provided, the percentage will be calculated based on used and total.
1131
+ */
1132
+ percentage?: number;
1133
+ /**
1134
+ * The percentage that fills the ring; anything above it is drawn as an
1135
+ * over-limit ring.
1136
+ * @default 100
1137
+ */
1138
+ thresholdPercentage?: number;
1139
+ /**
1140
+ * If not provided, the color will be determined based on the percentage.
1141
+ */
1142
+ color?: StrokeColorClass;
1143
+ percentageFormatter?: (value: number) => string;
1144
+ /**
1145
+ * Shown below the total when over the threshold.
1146
+ * @default "Over Limit" (translated)
1147
+ */
1148
+ overThresholdText?: string;
1149
+ /**
1150
+ * @default false
1151
+ */
1152
+ isLoading?: boolean;
1153
+ };
1154
+
1155
+ declare const CubePercentagePieChart: (props: CubePercentagePieChartProps) => react.JSX.Element;
1156
+
1157
+ type CubeProgressBarRef = {
1158
+ barWidth: number;
1159
+ };
1160
+ type CubeProgressBarProps = {
1161
+ ref?: Ref<CubeProgressBarRef>;
1162
+ /**
1163
+ * An integer between 0 and 100 indicating the progress (percentage).
1164
+ */
1165
+ progress: number;
1166
+ color: BackgroundColorClass;
1167
+ } & PropsWithClassName & PropsWithChildren;
1168
+ type CubeResourceUsageBarProps = Pick<CubeProgressBarProps, 'className' | 'progress'>;
1169
+
1170
+ type CubeProgressBarSkeletonProps = PropsWithClassName;
1171
+
1172
+ declare const CubeProgressBar: {
1173
+ (props: CubeProgressBarProps): react.JSX.Element;
1174
+ Skeleton: (props: CubeProgressBarSkeletonProps) => react.JSX.Element;
1175
+ };
1176
+
1177
+ declare const CubeResourceUsageBar: {
1178
+ (props: CubeResourceUsageBarProps): react.JSX.Element;
1179
+ Skeleton: (props: CubeProgressBarSkeletonProps) => react.JSX.Element;
1180
+ };
1181
+
1182
+ type CubeProgressBarChartProps = {
1183
+ title: string;
1184
+ subtext?: string;
1185
+ /**
1186
+ * @default false
1187
+ */
1188
+ isLoading?: boolean;
1189
+ skeletonClassName?: string;
1190
+ } & Pick<CubeProgressBarProps, 'progress' | 'className'>;
1191
+ declare const CubeProgressBarChart: (props: CubeProgressBarChartProps) => react.JSX.Element;
1192
+
1193
+ type CubeRadioButtonGridDirection = 'vertical' | 'wrap';
1194
+ type CubeRadioButtonGridProps = PropsWithChildren<{
1195
+ className?: string;
1196
+ direction: CubeRadioButtonGridDirection;
1197
+ }>;
1198
+
1199
+ type CubeRadioButtonProps = InputHTMLAttributes<HTMLInputElement> & {
1200
+ label: string;
1201
+ /**
1202
+ * @default false
1203
+ */
1204
+ isLoading?: boolean;
1205
+ ref?: RefObject<HTMLInputElement | null>;
1206
+ };
1207
+ declare const CubeRadioButton: {
1208
+ (props: CubeRadioButtonProps): react.JSX.Element;
1209
+ Skeleton: () => react.JSX.Element;
1210
+ Grid: (props: CubeRadioButtonGridProps) => react.JSX.Element;
1211
+ };
1212
+
1213
+ type CubeSearchBarFilterItemProps = {
1214
+ children: ReactNode;
1215
+ onClick?: () => void;
1216
+ };
1217
+ type CubeSearchBarFilterProps = ComponentProps<'input'> & {
1218
+ /**
1219
+ * @default false
1220
+ */
1221
+ isLoading?: boolean;
1222
+ onInputClear?: () => void;
45
1223
  /**
46
- * @default false
1224
+ * Menu items shown below the input while it has a value; use
1225
+ * `CubeSearchBarFilter.Item`.
47
1226
  */
48
- loading?: boolean;
49
- } & ({
50
- usage?: never;
51
- children: string;
52
- } | {
53
- usage: Extract<CubeButtonUsage, 'text-only'>;
1227
+ children?: ReactElement<CubeSearchBarFilterItemProps> | ReactElement<CubeSearchBarFilterItemProps>[];
1228
+ };
1229
+ type CubeSearchBarGlobalItemType = 'suggestion' | 'recentSuggestion';
1230
+ type CubeSearchBarGlobalItemProps = {
54
1231
  children: string;
1232
+ onClick: () => void;
1233
+ } & ({
1234
+ type: Extract<CubeSearchBarGlobalItemType, 'suggestion'>;
55
1235
  } | {
56
- usage: Extract<CubeButtonUsage, 'icon-only'>;
57
- Icon: SvgComponent;
58
- } | {
59
- usage: Extract<CubeButtonUsage, 'icon-left' | 'icon-right'>;
60
- children: string;
61
- Icon: SvgComponent;
1236
+ type: Extract<CubeSearchBarGlobalItemType, 'recentSuggestion'>;
1237
+ /**
1238
+ * Called when the item's clear (×) icon is clicked.
1239
+ */
1240
+ onSuggestionClear: () => void;
62
1241
  });
63
-
64
- type CubeButtonSkeletonProps = {
1242
+ type CubeSearchBarGlobalVariant = 'regular' | 'category';
1243
+ type BaseSearchBarGlobalProps = ComponentProps<'input'> & {
65
1244
  /**
66
- * @default 'md
1245
+ * @default false
67
1246
  */
68
- size?: CubeButtonSize;
1247
+ isLoading?: boolean;
69
1248
  /**
70
- * @default 'text-only'
1249
+ * Suggestions shown below the input while it has a value; use
1250
+ * `CubeSearchBarGlobal.Item`.
71
1251
  */
72
- usage?: CubeButtonUsage;
1252
+ children?: ReactElement<CubeSearchBarGlobalItemProps> | ReactElement<CubeSearchBarGlobalItemProps>[];
1253
+ onInputClear: () => void;
73
1254
  };
1255
+ type CubeSearchBarGlobalCategoryProps = {
1256
+ categories: string[];
1257
+ selectedCategory: string | undefined;
1258
+ onCategoryClick: (category: string) => void;
1259
+ };
1260
+ type CubeSearchBarGlobalProps = BaseSearchBarGlobalProps & ({
1261
+ variant: Extract<CubeSearchBarGlobalVariant, 'regular'>;
1262
+ } | ({
1263
+ variant: Extract<CubeSearchBarGlobalVariant, 'category'>;
1264
+ } & CubeSearchBarGlobalCategoryProps));
74
1265
 
75
- declare const CubeButton: {
76
- (props: CubeButtonProps): react.JSX.Element;
77
- Skeleton: (props: CubeButtonSkeletonProps) => react.JSX.Element;
1266
+ declare const CubeSearchBarFilter: {
1267
+ (props: CubeSearchBarFilterProps): react.JSX.Element;
1268
+ Item: (props: CubeSearchBarFilterItemProps) => react.JSX.Element;
78
1269
  };
79
1270
 
80
- declare const cubeCheckboxColors: readonly ["primary", "primary-dark", "secondary", "secondary-dark"];
81
- declare const cubeCheckboxLabelSizes: readonly ["md", "sm", "xs"];
82
- declare const cubeCheckboxGridDirections: readonly ["vertical", "wrap"];
83
- type CubeCheckboxColor = (typeof cubeCheckboxColors)[number];
84
- type CubeCheckboxLabelSize = (typeof cubeCheckboxLabelSizes)[number];
85
- type CubeCheckboxGridDirection = (typeof cubeCheckboxGridDirections)[number];
86
- type CubeCheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'defaultChecked'> & {
87
- containerClassName?: string;
1271
+ declare const CubeSearchBarGlobal: {
1272
+ (props: CubeSearchBarGlobalProps): react.JSX.Element;
1273
+ Item: (props: CubeSearchBarGlobalItemProps) => react.JSX.Element;
1274
+ };
1275
+
1276
+ declare const cubeTooltipPlacements: readonly ["top-left", "top-center", "top-right", "top-follow-cursor", "bottom-left", "bottom-center", "bottom-right", "bottom-follow-cursor"];
1277
+ type CubeTooltipPlacement = (typeof cubeTooltipPlacements)[number];
1278
+ type CubeTooltipInteractiveElementProps = {
1279
+ ref?: Ref<HTMLElement>;
1280
+ onMouseEnter?: (e: MouseEvent<HTMLElement>) => void;
1281
+ onMouseMove?: (e: MouseEvent<HTMLElement>) => void;
1282
+ onMouseLeave?: (e: MouseEvent<HTMLElement>) => void;
1283
+ onClick?: (e: MouseEvent<HTMLElement>) => void;
1284
+ onFocus?: (e: FocusEvent<HTMLElement>) => void;
1285
+ onBlur?: (e: FocusEvent<HTMLElement>) => void;
1286
+ 'aria-describedby'?: string;
1287
+ };
1288
+ type CubeTooltipInformation = {
1289
+ title?: string;
1290
+ subtext?: string;
1291
+ message: string;
1292
+ };
1293
+ type CubeTooltipProps = {
88
1294
  /**
89
- * @default "primary"
1295
+ * @default 'top-center'
90
1296
  */
91
- color?: CubeCheckboxColor;
92
- label?: string;
1297
+ placement?: CubeTooltipPlacement;
1298
+ hoverContent?: CubeTooltipInformation;
1299
+ clickContent?: CubeTooltipInformation;
93
1300
  /**
94
- * @default "md"
1301
+ * The toggle (anchor) element. Hover content is also shown while it has
1302
+ * keyboard focus, so pass a focusable element (e.g. a `<button>`) to make
1303
+ * the tooltip reachable by keyboard.
95
1304
  */
96
- labelSize?: CubeCheckboxLabelSize;
97
- labelClassName?: string;
1305
+ children: ReactElement<CubeTooltipInteractiveElementProps>;
1306
+ };
1307
+
1308
+ type Segment = {
1309
+ color: FillColorClass;
1310
+ colCount: number;
1311
+ hoverContent?: CubeTooltipInformation;
1312
+ };
1313
+ type ChildrenDimensions = {
1314
+ height: number;
98
1315
  /**
99
- * Use `null` for indeterminate state.
1316
+ * @default 0
100
1317
  */
101
- checked?: boolean | null;
1318
+ marginTop?: number;
1319
+ };
1320
+
1321
+ type CubeSegmentedBarProps = PropsWithClassName & {
102
1322
  /**
103
- * Use `null` for indeterminate state.
1323
+ * By default, the bar matches its parent's width.
1324
+ * Use this prop to set a fixed width if the parent's width is unknown
1325
+ * (e.g., in a table cell) or a specific width is needed.
104
1326
  */
105
- defaultChecked?: boolean | null;
1327
+ width?: number;
1328
+ /**
1329
+ * The start and end x-ticks may be cut-off,
1330
+ * so we have to add padding to ensure they are fully visible.
1331
+ */
1332
+ paddingX?: number;
1333
+ barMarginTop?: number;
106
1334
  /**
107
1335
  * @default false
108
1336
  */
109
- isLoading?: boolean;
110
- ref?: RefObject<HTMLInputElement | null>;
1337
+ rounded?: boolean;
1338
+ segments: Segment[];
1339
+ onMouseEnterSegment?: (index: number, e: MouseEvent<SVGRectElement>) => void;
1340
+ onMouseLeaveSegment?: (index: number, e: MouseEvent<SVGRectElement>) => void;
1341
+ overlay?: (barWidth: number, svgHeight: number) => ReactNode;
1342
+ } & WithChildrenProps;
1343
+ type WithChildrenProps = {
1344
+ childrenDimensions?: never;
1345
+ children?: never;
1346
+ } | {
1347
+ childrenDimensions: ChildrenDimensions;
1348
+ children: (barWidth: number) => ReactNode;
111
1349
  };
112
-
113
- type CubeCheckboxGridProps = PropsWithChildren<{
114
- className?: string;
115
- direction: CubeCheckboxGridDirection;
116
- }>;
117
-
118
- declare const CubeCheckbox: {
119
- (props: CubeCheckboxProps): react.JSX.Element;
1350
+ declare const CubeSegmentedBar: {
1351
+ (props: CubeSegmentedBarProps): react.JSX.Element;
120
1352
  Skeleton: () => react.JSX.Element;
121
- Grid: (props: CubeCheckboxGridProps) => react.JSX.Element;
122
- };
123
-
124
- type PropsWithClassName = {
125
- className?: string | undefined;
126
1353
  };
127
1354
 
128
- declare const cubeHyperlinkColors: readonly ["primary", "secondary"];
129
- declare const cubeHyperlinkVariants: readonly ["text-only", "text-inline", "icon-left", "icon-right"];
130
- declare const cubeHyperlinkSizes: readonly ["sm", "md"];
131
- type CubeHyperlinkColor = (typeof cubeHyperlinkColors)[number];
132
- type CubeHyperlinkVariant = (typeof cubeHyperlinkVariants)[number];
133
- type CubeHyperlinkSize = (typeof cubeHyperlinkSizes)[number];
134
- type BaseHyperlinkProps = {
1355
+ type CubeSideBarComboboxOptionProps = {
1356
+ label: string;
1357
+ Icon: SvgComponent;
135
1358
  /**
136
- * @default "primary"
1359
+ * @default false
137
1360
  */
138
- color?: CubeHyperlinkColor;
1361
+ isSelected?: boolean;
139
1362
  /**
140
- * @default "md"
1363
+ * Shown as a badge when not 0; above 99 it shows "N".
1364
+ * @default 0
141
1365
  */
142
- size?: CubeHyperlinkSize;
1366
+ notificationCount?: number;
1367
+ onClick: () => void;
1368
+ };
1369
+ type CubeSideBarBottomLinkProps = {
1370
+ text: string;
143
1371
  /**
144
- * @default false
1372
+ * Opened in a new tab.
145
1373
  */
146
- disabled?: boolean;
147
- children: string;
148
- href?: string;
149
- target?: AnchorHTMLAttributes<HTMLAnchorElement>['target'];
150
- onClick?: (e: MouseEvent<HTMLElement>) => void;
1374
+ href: string;
151
1375
  };
152
- type CubeHyperlinkProps = PropsWithClassName & BaseHyperlinkProps & ({
153
- variant: Extract<CubeHyperlinkVariant, 'icon-left' | 'icon-right'>;
154
- Icon: SvgComponent;
155
- } | {
156
- variant: Extract<CubeHyperlinkVariant, 'text-only' | 'text-inline'>;
157
- Icon?: never;
158
- });
159
-
160
- declare const CubeHyperlink: (props: CubeHyperlinkProps) => react.DetailedReactHTMLElement<{
161
- className: string;
162
- href: string | undefined;
163
- target: react.HTMLAttributeAnchorTarget | undefined;
164
- onClick: (e: MouseEvent<HTMLElement>) => void;
165
- }, HTMLElement>;
166
-
167
- declare const CubeIconFrame: (props: CubeIconFrameProps) => react.JSX.Element;
168
-
169
- type InputSkeletonType = 'input' | 'label' | 'footer';
170
- type CubeInputSkeletonProps = {
171
- type: InputSkeletonType;
1376
+ type CubeSideBarDataCenter = {
1377
+ name: string;
1378
+ version: string;
172
1379
  };
173
-
174
- type CubeInputProps = InputHTMLAttributes<HTMLInputElement> & {
1380
+ type CubeSideBarProps = {
175
1381
  /**
176
- * @default false
1382
+ * An element (for example a router link) the logo is placed in.
177
1383
  */
178
- isLoading?: boolean;
179
- label?: string;
180
- tooltip?: React.ReactNode;
181
- helpMessage?: string;
182
- errorMessage?: string | boolean;
183
- trailingIcon?: SvgElement;
184
- };
185
- declare const CubeInput: react.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
1384
+ LogoContainer?: ReactElement<PropsWithChildren>;
186
1385
  /**
1386
+ * Shows skeletons for the user info and the data center time.
187
1387
  * @default false
188
1388
  */
189
1389
  isLoading?: boolean;
190
- label?: string;
191
- tooltip?: React.ReactNode;
192
- helpMessage?: string;
193
- errorMessage?: string | boolean;
194
- trailingIcon?: SvgElement;
195
- } & react.RefAttributes<HTMLInputElement>> & {
196
- Skeleton: (props: CubeInputSkeletonProps) => react.JSX.Element;
1390
+ dataCenter: CubeSideBarDataCenter | undefined;
1391
+ username: string | undefined;
1392
+ /**
1393
+ * Shows a `CubeNagging` (sidebar variant) below the user info.
1394
+ */
1395
+ naggingProps?: Omit<Extract<CubeNaggingProps, {
1396
+ variant: 'sidebar';
1397
+ }>, 'variant'>;
1398
+ options: CubeSideBarComboboxOptionProps[];
1399
+ /**
1400
+ * The data center's UTC offset, for example `"+08:00"`.
1401
+ */
1402
+ utcTimeZone: string | undefined;
1403
+ links?: CubeSideBarBottomLinkProps[];
197
1404
  };
198
1405
 
199
- declare const cubeLoadingSpinnerVariants: readonly ["dot45", "dot120", "cube"];
200
- type CubeLoadingSpinnerVariant = (typeof cubeLoadingSpinnerVariants)[number];
201
- type CubeLoadingSpinnerProps = PropsWithClassName & {
202
- variant: CubeLoadingSpinnerVariant;
1406
+ declare const CubeSideBar: (props: CubeSideBarProps) => react.JSX.Element;
1407
+
1408
+ type CubeSkeletonProps = PropsWithClassName & {
1409
+ style?: React.CSSProperties;
203
1410
  };
1411
+ declare const CubeSkeleton: (props: CubeSkeletonProps) => react.JSX.Element;
204
1412
 
205
- declare const CubeLoadingSpinner: (props: CubeLoadingSpinnerProps) => react.JSX.Element;
1413
+ type CubeStackCardProps = PropsWithChildren<{
1414
+ title: string;
1415
+ subtext?: string;
1416
+ }>;
206
1417
 
207
- type CubePasswordInputProps = Omit<CubeInputProps, 'trailingIcon' | 'type'> & {
1418
+ declare const CubeStackCard: (props: CubeStackCardProps) => react.JSX.Element;
1419
+
1420
+ declare const cubeStatusKnownValues: readonly ["neutral", "in-use", "finished", "ok", "success", "active", "available", "powering on", "warning", "error", "fail", "failed", "stopped", "powering off"];
1421
+ declare const cubeStatusTypes: readonly ["neutral", "success", "warning", "others"];
1422
+ type CubeStatusKnownValue = (typeof cubeStatusKnownValues)[number];
1423
+ type CubeStatusValue = (string & {}) | CubeStatusKnownValue;
1424
+ type CubeStatusType = (typeof cubeStatusTypes)[number];
1425
+ type CubeStatusProps = {
1426
+ status: CubeStatusValue;
208
1427
  /**
209
- * @default false
1428
+ * Custom display text for the status text.
1429
+ * If not specified, the text will be automatically generated
1430
+ * based on the built-in logic and i18n translations.
210
1431
  */
211
- initialShowPassword?: boolean;
1432
+ message?: string;
212
1433
  };
213
- declare const CubePasswordInput: (props: CubePasswordInputProps) => react.JSX.Element;
214
1434
 
215
- type CubeRadioButtonGridDirection = 'vertical' | 'wrap';
216
- type CubeRadioButtonGridProps = PropsWithChildren<{
217
- className?: string;
218
- direction: CubeRadioButtonGridDirection;
219
- }>;
1435
+ declare const CubeStatus: {
1436
+ (props: CubeStatusProps): react.JSX.Element;
1437
+ Skeleton: () => react.JSX.Element;
1438
+ };
220
1439
 
221
- type CubeRadioButtonProps = InputHTMLAttributes<HTMLInputElement> & {
222
- label: string;
1440
+ declare const cubeStatusReactionStatuses: readonly ["neutral", "success", "available", "done", "error", "duplicate", "failed"];
1441
+ declare const cubeStatusReactionTypes: readonly ["neutral", "success", "warning"];
1442
+ type CubeStatusReactionStatus = (typeof cubeStatusReactionStatuses)[number];
1443
+ type CubeStatusReactionType = (typeof cubeStatusReactionTypes)[number];
1444
+ type CubeStatusReactionProps = {
1445
+ status: CubeStatusReactionStatus;
1446
+ message?: string;
1447
+ };
1448
+
1449
+ declare const CubeStatusReaction: {
1450
+ (props: CubeStatusReactionProps): react.JSX.Element;
1451
+ Skeleton: () => react.JSX.Element;
1452
+ };
1453
+
1454
+ declare const CubeStepProcessItem: (props: CubeStepProcessItemProps) => react.JSX.Element;
1455
+
1456
+ type CubeStepProcessProps = PropsWithClassName & {
1457
+ isLoading?: boolean;
1458
+ children?: ReactElement<typeof CubeStepProcessItem>[] | ReactElement<typeof CubeStepProcessItem>;
1459
+ };
1460
+ type CubeStepProcessItemProps = {
223
1461
  /**
224
- * @default false
1462
+ * The step serial number (1-based) that represents this step in the process.
225
1463
  */
226
- isLoading?: boolean;
227
- ref?: RefObject<HTMLInputElement | null>;
1464
+ stepNumber: number;
1465
+ label: string;
1466
+ isActive: boolean;
228
1467
  };
229
- declare const CubeRadioButton: {
230
- (props: CubeRadioButtonProps): react.JSX.Element;
231
- Skeleton: () => react.JSX.Element;
232
- Grid: (props: CubeRadioButtonGridProps) => react.JSX.Element;
1468
+
1469
+ type CubeStepProcessSkeletonProps = {
1470
+ /**
1471
+ * @default 5
1472
+ */
1473
+ length?: number;
233
1474
  };
234
1475
 
235
- type CubeSkeletonProps = PropsWithClassName & {
236
- style?: React.CSSProperties;
1476
+ declare const CubeStepProcess: {
1477
+ (props: CubeStepProcessProps): react.JSX.Element;
1478
+ Item: (props: CubeStepProcessItemProps) => react.JSX.Element;
1479
+ Skeleton: (props: CubeStepProcessSkeletonProps) => react.JSX.Element;
237
1480
  };
238
- declare const CubeSkeleton: (props: CubeSkeletonProps) => react.JSX.Element;
239
1481
 
240
1482
  declare const cubeStrokeTypes: readonly ["regular", "dot"];
241
1483
  type CubeStrokeType = (typeof cubeStrokeTypes)[number];
@@ -249,6 +1491,25 @@ type CubeStrokeProps = PropsWithClassName & {
249
1491
 
250
1492
  declare const CubeStroke: (props: CubeStrokeProps) => react.JSX.Element;
251
1493
 
1494
+ type CubeTableInputProps = InputHTMLAttributes<HTMLInputElement> & {
1495
+ isLoading?: boolean;
1496
+ errorMessage?: string | boolean;
1497
+ /**
1498
+ * @default false
1499
+ */
1500
+ hideErrorIcon?: boolean;
1501
+ };
1502
+ declare const CubeTableInput: react.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
1503
+ isLoading?: boolean;
1504
+ errorMessage?: string | boolean;
1505
+ /**
1506
+ * @default false
1507
+ */
1508
+ hideErrorIcon?: boolean;
1509
+ } & react.RefAttributes<HTMLInputElement>> & {
1510
+ Skeleton: () => react.JSX.Element;
1511
+ };
1512
+
252
1513
  type CubeTabsProps = {
253
1514
  children: ReactNode;
254
1515
  };
@@ -329,38 +1590,186 @@ declare const CubeTextarea: {
329
1590
  Skeleton: () => react.JSX.Element;
330
1591
  };
331
1592
 
332
- type CubeToggleProps = PropsWithClassName & {
1593
+ declare const CubeTooltip: (props: CubeTooltipProps) => react.JSX.Element;
1594
+
1595
+ type CubeUploadProps = PropsWithClassName & {
1596
+ buttonText: string;
333
1597
  /**
334
- * Whether the toggle is on. Always controlled by the caller —
335
- * pair with `onCheckedChange` to update this value when the user toggles.
1598
+ * `id` of the hidden file input.
336
1599
  */
337
- checked: boolean;
1600
+ inputId?: string;
338
1601
  /**
339
- * Called with the next on/off value when the user toggles. Required so the
340
- * caller can update `checked`.
1602
+ * Accepted file types, as in `<input type="file" accept>`.
341
1603
  */
342
- onCheckedChange: (checked: boolean) => void;
1604
+ accept?: string;
343
1605
  /**
344
- * Visible text shown next to the toggle. Also provides the accessible name
345
- * via `aria-labelledby` / `<label htmlFor>`.
1606
+ * Content next to the upload button.
346
1607
  */
347
- label?: string;
1608
+ leftSlot?: ReactNode;
348
1609
  /**
349
- * Accessible name when no visible `label` is rendered. Prefer `label` when
350
- * the name should also appear on screen.
1610
+ * Content on the right of the button row.
351
1611
  */
352
- 'aria-label'?: string;
1612
+ rightSlot?: ReactNode;
1613
+ /**
1614
+ * Shows the button as loading and blocks picking a file.
1615
+ * @default false
1616
+ */
1617
+ isUploading?: boolean;
353
1618
  /**
354
- * When true, the toggle cannot be interacted with.
355
1619
  * @default false
356
1620
  */
357
1621
  disabled?: boolean;
1622
+ /**
1623
+ * Shown below the button row, such as `CubeUpload.ProgressBar`,
1624
+ * `CubeUpload.File` or `CubeUpload.Error`.
1625
+ */
1626
+ children?: ReactNode;
1627
+ /**
1628
+ * Called with the picked file (`null` if none). The same file can be
1629
+ * picked again.
1630
+ */
1631
+ onFileChange?: (file: File | null) => void | Promise<void>;
358
1632
  };
359
- declare const CubeToggle: (props: CubeToggleProps) => react.JSX.Element;
1633
+ type CubeUploadFileProps = {
1634
+ /**
1635
+ * Greys out the file and blocks `onCancel`.
1636
+ * @default false
1637
+ */
1638
+ disabled?: boolean;
1639
+ /**
1640
+ * The file name.
1641
+ */
1642
+ children: string;
1643
+ onCancel: () => void;
1644
+ };
1645
+ type CubeUploadProgressBarProps = {
1646
+ fileName: string;
1647
+ /**
1648
+ * An integer between 0 and 100.
1649
+ */
1650
+ progress: number;
1651
+ onAbortClick: () => void;
1652
+ };
1653
+ type CubeUploadErrorProps = {
1654
+ message: string;
1655
+ onClose?: () => void;
1656
+ };
1657
+
1658
+ declare const CubeUpload: {
1659
+ (props: CubeUploadProps): react.JSX.Element;
1660
+ File: (props: CubeUploadFileProps) => react.JSX.Element;
1661
+ ProgressBar: (props: CubeUploadProgressBarProps) => react.JSX.Element;
1662
+ Error: (props: CubeUploadErrorProps) => react.JSX.Element;
1663
+ };
1664
+
1665
+ type CubeViewDetailsTableDetailItem = {
1666
+ title: string;
1667
+ value: string | number;
1668
+ };
1669
+ type CubeViewDetailsTableProps<ParentRow extends CubeTableRow> = Omit<CubeBasicTableProps<ParentRow> & {
1670
+ expandedRowIdSet: Set<string>;
1671
+ onExpandChange: (parentRowId: string, value: boolean) => void;
1672
+ detailTitle?: string | ((parentRow: ParentRow) => string);
1673
+ getDetailItems?: (parentRow: ParentRow) => CubeViewDetailsTableDetailItem[];
1674
+ getCustomizedDetailCell?: (parentRow: ParentRow) => ReactNode;
1675
+ beforeExpandButton?: (parentRow: ParentRow) => ReactNode;
1676
+ isRowExpandDisabled?: (row: ParentRow) => boolean;
1677
+ }, 'rowClassName'>;
1678
+
1679
+ type UseExpandedRowIdSet = {
1680
+ expandedRowIdSet: Set<string>;
1681
+ onExpandChange: (parentRowId: string, value: boolean) => void;
1682
+ resetExpandedRowIdSet: () => void;
1683
+ };
1684
+ declare const useExpandedRowIdSet: () => UseExpandedRowIdSet;
1685
+
1686
+ declare const CubeViewDetailsTable: {
1687
+ <ParentRow extends CubeTableRow>(props: CubeViewDetailsTableProps<ParentRow>): react.JSX.Element;
1688
+ Column: {
1689
+ <Property extends "id" = never>(_props: CubeTableColumnProps<CubeTableRow, Property>): undefined;
1690
+ [CUBE_TABLE_COLUMN_SYMBOL]: boolean;
1691
+ };
1692
+ };
1693
+ type CubeViewDetailsTableWithColumn<ParentRow extends CubeTableRow> = typeof CubeViewDetailsTable<ParentRow> & {
1694
+ Column: ReturnType<typeof CreateCubeTableColumn<ParentRow>>;
1695
+ };
1696
+ declare const GetCubeViewDetailsTable: <ParentRow extends CubeTableRow>() => CubeViewDetailsTableWithColumn<ParentRow>;
360
1697
 
361
1698
  var enUS = {
1699
+ "component.backButton.back": "Back",
1700
+ "component.collapsiblePanelLayout.closePanel": "Close Panel",
1701
+ "component.collapsiblePanelLayout.togglePanel": "Show or Hide Panel",
362
1702
  "component.common.loading": "Loading",
363
- "component.common.noData": "No Data"
1703
+ "component.common.noData": "No Data",
1704
+ "component.datePicker.apply": "Apply",
1705
+ "component.datePicker.chooseEnd": "Choose End",
1706
+ "component.datePicker.chooseStart": "Choose Start",
1707
+ "component.datePicker.end": "End",
1708
+ "component.datePicker.reset": "Reset",
1709
+ "component.datePicker.start": "Start",
1710
+ "component.datePicker.time": "Time",
1711
+ "component.datePicker.weekdays.friday": "F",
1712
+ "component.datePicker.weekdays.monday": "M",
1713
+ "component.datePicker.weekdays.saturday": "S",
1714
+ "component.datePicker.weekdays.sunday": "S",
1715
+ "component.datePicker.weekdays.thursday": "T",
1716
+ "component.datePicker.weekdays.tuesday": "T",
1717
+ "component.datePicker.weekdays.wednesday": "W",
1718
+ "component.dropdown.choose": "Choose",
1719
+ "component.dropdown.all": "All",
1720
+ "component.dropdown.search": "Search",
1721
+ "component.logConsole.copy": "Copy",
1722
+ "component.logConsole.copied": "Copied!",
1723
+ "component.logConsole.copyDetails": "Click to copy details",
1724
+ "component.modal.action": "Action",
1725
+ "component.modal.cancel": "Cancel",
1726
+ "component.modal.close": "Close",
1727
+ "component.panel.viewAll": "View All",
1728
+ "component.panel.error": "error",
1729
+ "component.panel.error_other": "errors",
1730
+ "component.pagination.amount.short": "Amt: ",
1731
+ "component.pagination.amount.long": "Amount: ",
1732
+ "component.pagination.goTo": "Go to",
1733
+ "component.pagination.page": "Page",
1734
+ "component.pagination.view": "View",
1735
+ "component.pagination.firstPage": "First page",
1736
+ "component.pagination.previousPage": "Previous page",
1737
+ "component.pagination.nextPage": "Next page",
1738
+ "component.pagination.lastPage": "Last page",
1739
+ "component.pagination.pageNumber": "Page {{page}}",
1740
+ "component.percentagePieChart.overThreshold": "Over Limit",
1741
+ "component.percentagePieChart.used": "Used",
1742
+ "component.searchBar.filter.search": "Search",
1743
+ "component.searchBar.global.category": "Category",
1744
+ "component.searchBar.global.noCategory": "No Category",
1745
+ "component.searchBar.global.search": "Search",
1746
+ "component.sideBar.dataCenterTime": "Data Center Time:",
1747
+ "component.table.noResult": "No Result",
1748
+ "component.table.rowDetails": "Row Details",
1749
+ "component.table.selectAllRows": "Select All Rows",
1750
+ "component.table.selectRow": "Select Row",
1751
+ "component.status.host.neutral": "Neutral",
1752
+ "component.status.host.inUse": "In-Use",
1753
+ "component.status.host.finished": "Finished",
1754
+ "component.status.host.ok": "Ok",
1755
+ "component.status.host.success": "Success",
1756
+ "component.status.host.active": "Active",
1757
+ "component.status.host.available": "Available",
1758
+ "component.status.host.poweringOn": "Powering-On",
1759
+ "component.status.host.warning": "Warning",
1760
+ "component.status.host.error": "Error",
1761
+ "component.status.host.fail": "Fail",
1762
+ "component.status.host.failed": "Failed",
1763
+ "component.status.host.stopped": "Stopped",
1764
+ "component.status.host.poweringOff": "Powering-Off",
1765
+ "component.status.reaction.neutral": "Neutral",
1766
+ "component.status.reaction.success": "Success",
1767
+ "component.status.reaction.available": "Available",
1768
+ "component.status.reaction.done": "Done",
1769
+ "component.status.reaction.error": "Error",
1770
+ "component.status.reaction.duplicate": "Duplicate",
1771
+ "component.status.reaction.failed": "Failed",
1772
+ "component.upload.closeError": "Close Error"
364
1773
  };
365
1774
 
366
1775
  /**
@@ -412,4 +1821,4 @@ declare const CubeUiLocaleProvider: (props: CubeUiLocaleProviderProps) => react.
412
1821
  */
413
1822
  declare const useCubeUiTranslation: typeof useTranslation;
414
1823
 
415
- export { BorderColorClass, CubeButton, type CubeButtonProps, type CubeButtonSize, type CubeButtonSkeletonProps, type CubeButtonType, type CubeButtonUsage, CubeCheckbox, type CubeCheckboxColor, type CubeCheckboxGridDirection, type CubeCheckboxGridProps, type CubeCheckboxLabelSize, type CubeCheckboxProps, CubeHyperlink, type CubeHyperlinkColor, type CubeHyperlinkProps, type CubeHyperlinkSize, type CubeHyperlinkVariant, CubeIconFrame, type CubeIconFrameProps, type CubeIconSize, CubeInput, type CubeInputProps, type CubeInputSkeletonProps, CubeLoadingSpinner, type CubeLoadingSpinnerProps, type CubeLoadingSpinnerVariant, CubePasswordInput, type CubePasswordInputProps, CubeRadioButton, type CubeRadioButtonGridDirection, type CubeRadioButtonGridProps, type CubeRadioButtonProps, CubeSkeleton, type CubeSkeletonProps, CubeStroke, type CubeStrokeProps, type CubeStrokeType, type CubeTabProps, CubeTabs, type CubeTabsProps, CubeTag, type CubeTagColor, type CubeTagProps, type CubeTagSkeletonProps, type CubeTagVariant, CubeTextarea, type CubeTextareaProps, CubeToggle, type CubeToggleProps, type CubeUiLocale, CubeUiLocaleProvider, type CubeUiLocaleProviderProps, type CubeUiTranslationResource, type SvgComponent, type SvgElement, addCubeUiTranslations, useCubeUiTranslation };
1824
+ export { BackgroundColorClass, BorderColorClass, type ChildrenDimensions, type ColumnCompareFnMap, type CompareFn, CubeBackButton, type CubeBackButtonBackLinkProps, type CubeBackButtonBarChartProps, type CubeBackButtonDetailsProps, type CubeBackButtonLinkProps, type CubeBackButtonProps, CubeBasicTable, type CubeBasicTableProps, CubeBatchActionTable, type CubeBatchActionTableProps, type CubeBatchActionTableRow, CubeBreadcrumb, type CubeBreadcrumbItemProps, type CubeBreadcrumbProps, type CubeBreadcrumbSkeletonProps, CubeButton, type CubeButtonProps, type CubeButtonSize, type CubeButtonSkeletonProps, type CubeButtonType, type CubeButtonUsage, CubeCheckbox, type CubeCheckboxColor, type CubeCheckboxGridDirection, type CubeCheckboxGridProps, type CubeCheckboxLabelSize, type CubeCheckboxProps, CubeCollapsiblePanelLayout, type CubeCollapsiblePanelLayoutLeftPanelProps, type CubeCollapsiblePanelLayoutProps, type CubeCollapsiblePanelLayoutRightPanelProps, CubeColumnChart, type CubeColumnChartBaseData, type CubeColumnChartData, type CubeColumnChartProps, type CubeColumnChartReturnData, CubeContentSwitcher, type CubeContentSwitcherItemProps, type CubeContentSwitcherProps, type CubeContentSwitcherSize, type CubeContentSwitcherVariant, CubeCountSegmentedChart, type CubeCountSegmentedChartCountInfo, type CubeCountSegmentedChartOverview, type CubeCountSegmentedChartProps, CubeDashboardPanel, type CubeDashboardPanelColProps, type CubeDashboardPanelHeaderProps, type CubeDashboardPanelItemProps, type CubeDashboardPanelProps, type CubeDashboardPanelRowProps, CubeDatePicker, type CubeDatePickerDateStatus, type CubeDatePickerDates, type CubeDatePickerProps, CubeDetailsTable, type CubeDetailsTableProps, type CubeDetailsTableRowProps, CubeDropdown, type CubeDropdownItemProps, type CubeDropdownMenuProps, type CubeDropdownProps, type CubeDropdownSize, type CubeDropdownTriggerProps, type CubeDropdownType, type CubeDropdownVariant, CubeGeneralPanel, type CubeGeneralPanelContainerProps, type CubeGeneralPanelProps, type CubeGeneralPanelTitleBarProps, CubeHeader, type CubeHeaderFunctionBarItem, type CubeHeaderLanguageOption, type CubeHeaderProps, type CubeHeaderQuickAccess, CubeHyperlink, type CubeHyperlinkColor, type CubeHyperlinkProps, type CubeHyperlinkSize, type CubeHyperlinkVariant, CubeIconFrame, type CubeIconFrameProps, type CubeIconSize, CubeIconText, type CubeIconTextProps, type CubeIconTextType, CubeInformation, type CubeInformationProps, CubeInlineNotification, type CubeInlineNotificationProps, type CubeInlineNotificationSkeletonProps, CubeInput, type CubeInputProps, type CubeInputSkeletonProps, CubeLoadingSpinner, type CubeLoadingSpinnerProps, type CubeLoadingSpinnerVariant, CubeLogConsole, type CubeLogConsoleProps, CubeMessage, type CubeMessageProps, CubeModal, type CubeModalProps, type CubeModalSize, CubeNagging, type CubeNaggingLink, type CubeNaggingProps, type CubeNaggingType, type CubeNaggingVariant, type CubeNotificationBaseProps, type CubeNotificationLink, type CubeNotificationType, CubeOverflowMenu, type CubeOverflowMenuItemProps, type CubeOverflowMenuItemType, type CubeOverflowMenuProps, type CubeOverflowMenuTitleProps, type CubeOverflowMenuTriggerProps, CubePagination, type CubePaginationProps, CubePasswordInput, type CubePasswordInputProps, CubePercentagePieChart, type CubePercentagePieChartProps, CubeProgressBar, CubeProgressBarChart, type CubeProgressBarChartProps, type CubeProgressBarProps, type CubeProgressBarRef, type CubeProgressBarSkeletonProps, CubeRadioButton, type CubeRadioButtonGridDirection, type CubeRadioButtonGridProps, type CubeRadioButtonProps, CubeResourceUsageBar, type CubeResourceUsageBarProps, CubeSearchBarFilter, type CubeSearchBarFilterItemProps, type CubeSearchBarFilterProps, CubeSearchBarGlobal, type CubeSearchBarGlobalCategoryProps, type CubeSearchBarGlobalItemProps, type CubeSearchBarGlobalItemType, type CubeSearchBarGlobalProps, type CubeSearchBarGlobalVariant, CubeSegmentedBar, type CubeSegmentedBarProps, CubeSideBar, type CubeSideBarBottomLinkProps, type CubeSideBarComboboxOptionProps, type CubeSideBarDataCenter, type CubeSideBarProps, CubeSkeleton, type CubeSkeletonProps, CubeStackCard, type CubeStackCardProps, CubeStatus, type CubeStatusKnownValue, type CubeStatusProps, CubeStatusReaction, type CubeStatusReactionProps, type CubeStatusReactionStatus, type CubeStatusReactionType, type CubeStatusType, type CubeStatusValue, CubeStepProcess, type CubeStepProcessItemProps, type CubeStepProcessProps, type CubeStepProcessSkeletonProps, CubeStroke, type CubeStrokeProps, type CubeStrokeType, type CubeTabProps, type CubeTableColumnProps, type CubeTableColumnSkeletonVariant, CubeTableInput, type CubeTableInputProps, type CubeTableRow, type CubeTableSubRowProps, CubeTabs, type CubeTabsProps, CubeTag, type CubeTagColor, type CubeTagProps, type CubeTagSkeletonProps, type CubeTagVariant, CubeTextarea, type CubeTextareaProps, CubeTimeZoneContext, type CubeToastContextValue, CubeToastProvider, type CubeToastType, CubeToggle, type CubeToggleProps, CubeTooltip, type CubeTooltipInformation, type CubeTooltipInteractiveElementProps, type CubeTooltipPlacement, type CubeTooltipProps, type CubeUiLocale, CubeUiLocaleProvider, type CubeUiLocaleProviderProps, type CubeUiTranslationResource, CubeUpload, type CubeUploadErrorProps, type CubeUploadFileProps, type CubeUploadProgressBarProps, type CubeUploadProps, CubeViewDetailsTable, type CubeViewDetailsTableDetailItem, type CubeViewDetailsTableProps, DEFAULT_ITEMS_PER_PAGE, FillColorClass, GetCubeBasicTable, GetCubeBatchActionTable, GetCubeViewDetailsTable, type ItemsPerPage, MAX_VISIBLE_TOASTS_AMOUNT, type OnAllCheckChange, type OnClearSelection, type Segment, type SortDirection, type SortingState, StrokeColorClass, type SvgComponent, type SvgElement, type UseCubeDatePickerDisplayDates, type UseCubeDatePickerDisplayDatesOptions, type UseExpandedRowIdSet, addCubeUiTranslations, cubeTableStyles, renderLink as renderCubeNotificationLink, useCubeDatePickerDisplayDates, useCubeToast, useCubeUiTranslation, useExpandedRowIdSet };