@bigstack-oss/cube-ui 0.0.2 → 0.1.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.css +517 -0
- package/dist/index.d.cts +244 -10
- package/dist/index.d.ts +244 -10
- package/dist/index.js +1497 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1492 -41
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.cts +405 -405
- package/dist/theme.d.ts +405 -405
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ForwardRefExoticComponent, SVGProps, RefAttributes, ReactElement, JSX, ButtonHTMLAttributes, InputHTMLAttributes, PropsWithChildren } 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';
|
|
3
5
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
export { BackgroundColorClass, BorderColorClass, CubeThemeName, CubeThemeProvider, CubeThemeProviderProps, FillColorClass, StrokeColorClass, TextColorClass, Typography, TypographyClassName, cubePreset, cubeTheme, getTypography } from './theme.cjs';
|
|
5
6
|
import 'tailwindcss/types/config';
|
|
6
7
|
|
|
7
8
|
declare const cubeIconSizes: readonly ["xs", "sm", "md-sm", "md", "lg", "xl"];
|
|
@@ -60,8 +61,6 @@ type CubeButtonProps = Omit<JSX.IntrinsicElements['button'], 'type' | 'children'
|
|
|
60
61
|
Icon: SvgComponent;
|
|
61
62
|
});
|
|
62
63
|
|
|
63
|
-
declare const CubeButton: (props: CubeButtonProps) => react.JSX.Element;
|
|
64
|
-
|
|
65
64
|
type CubeButtonSkeletonProps = {
|
|
66
65
|
/**
|
|
67
66
|
* @default 'md
|
|
@@ -72,10 +71,106 @@ type CubeButtonSkeletonProps = {
|
|
|
72
71
|
*/
|
|
73
72
|
usage?: CubeButtonUsage;
|
|
74
73
|
};
|
|
75
|
-
|
|
74
|
+
|
|
75
|
+
declare const CubeButton: {
|
|
76
|
+
(props: CubeButtonProps): react.JSX.Element;
|
|
77
|
+
Skeleton: (props: CubeButtonSkeletonProps) => react.JSX.Element;
|
|
78
|
+
};
|
|
79
|
+
|
|
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;
|
|
88
|
+
/**
|
|
89
|
+
* @default "primary"
|
|
90
|
+
*/
|
|
91
|
+
color?: CubeCheckboxColor;
|
|
92
|
+
label?: string;
|
|
93
|
+
/**
|
|
94
|
+
* @default "md"
|
|
95
|
+
*/
|
|
96
|
+
labelSize?: CubeCheckboxLabelSize;
|
|
97
|
+
labelClassName?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Use `null` for indeterminate state.
|
|
100
|
+
*/
|
|
101
|
+
checked?: boolean | null;
|
|
102
|
+
/**
|
|
103
|
+
* Use `null` for indeterminate state.
|
|
104
|
+
*/
|
|
105
|
+
defaultChecked?: boolean | null;
|
|
106
|
+
/**
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
isLoading?: boolean;
|
|
110
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
type CubeCheckboxGridProps = PropsWithChildren<{
|
|
114
|
+
className?: string;
|
|
115
|
+
direction: CubeCheckboxGridDirection;
|
|
116
|
+
}>;
|
|
117
|
+
|
|
118
|
+
declare const CubeCheckbox: {
|
|
119
|
+
(props: CubeCheckboxProps): react.JSX.Element;
|
|
120
|
+
Skeleton: () => react.JSX.Element;
|
|
121
|
+
Grid: (props: CubeCheckboxGridProps) => react.JSX.Element;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
type PropsWithClassName = {
|
|
125
|
+
className?: string | undefined;
|
|
126
|
+
};
|
|
127
|
+
|
|
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 = {
|
|
135
|
+
/**
|
|
136
|
+
* @default "primary"
|
|
137
|
+
*/
|
|
138
|
+
color?: CubeHyperlinkColor;
|
|
139
|
+
/**
|
|
140
|
+
* @default "md"
|
|
141
|
+
*/
|
|
142
|
+
size?: CubeHyperlinkSize;
|
|
143
|
+
/**
|
|
144
|
+
* @default false
|
|
145
|
+
*/
|
|
146
|
+
disabled?: boolean;
|
|
147
|
+
children: string;
|
|
148
|
+
href?: string;
|
|
149
|
+
target?: AnchorHTMLAttributes<HTMLAnchorElement>['target'];
|
|
150
|
+
onClick?: (e: MouseEvent<HTMLElement>) => void;
|
|
151
|
+
};
|
|
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>;
|
|
76
166
|
|
|
77
167
|
declare const CubeIconFrame: (props: CubeIconFrameProps) => react.JSX.Element;
|
|
78
168
|
|
|
169
|
+
type InputSkeletonType = 'input' | 'label' | 'footer';
|
|
170
|
+
type CubeInputSkeletonProps = {
|
|
171
|
+
type: InputSkeletonType;
|
|
172
|
+
};
|
|
173
|
+
|
|
79
174
|
type CubeInputProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
80
175
|
/**
|
|
81
176
|
* @default false
|
|
@@ -97,10 +192,8 @@ declare const CubeInput: react.ForwardRefExoticComponent<InputHTMLAttributes<HTM
|
|
|
97
192
|
helpMessage?: string;
|
|
98
193
|
errorMessage?: string | boolean;
|
|
99
194
|
trailingIcon?: SvgElement;
|
|
100
|
-
} & react.RefAttributes<HTMLInputElement
|
|
101
|
-
|
|
102
|
-
type PropsWithClassName = {
|
|
103
|
-
className?: string | undefined;
|
|
195
|
+
} & react.RefAttributes<HTMLInputElement>> & {
|
|
196
|
+
Skeleton: (props: CubeInputSkeletonProps) => react.JSX.Element;
|
|
104
197
|
};
|
|
105
198
|
|
|
106
199
|
declare const cubeLoadingSpinnerVariants: readonly ["dot45", "dot120", "cube"];
|
|
@@ -119,11 +212,152 @@ type CubePasswordInputProps = Omit<CubeInputProps, 'trailingIcon' | 'type'> & {
|
|
|
119
212
|
};
|
|
120
213
|
declare const CubePasswordInput: (props: CubePasswordInputProps) => react.JSX.Element;
|
|
121
214
|
|
|
215
|
+
type CubeRadioButtonGridDirection = 'vertical' | 'wrap';
|
|
216
|
+
type CubeRadioButtonGridProps = PropsWithChildren<{
|
|
217
|
+
className?: string;
|
|
218
|
+
direction: CubeRadioButtonGridDirection;
|
|
219
|
+
}>;
|
|
220
|
+
|
|
221
|
+
type CubeRadioButtonProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
222
|
+
label: string;
|
|
223
|
+
/**
|
|
224
|
+
* @default false
|
|
225
|
+
*/
|
|
226
|
+
isLoading?: boolean;
|
|
227
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
228
|
+
};
|
|
229
|
+
declare const CubeRadioButton: {
|
|
230
|
+
(props: CubeRadioButtonProps): react.JSX.Element;
|
|
231
|
+
Skeleton: () => react.JSX.Element;
|
|
232
|
+
Grid: (props: CubeRadioButtonGridProps) => react.JSX.Element;
|
|
233
|
+
};
|
|
234
|
+
|
|
122
235
|
type CubeSkeletonProps = PropsWithClassName & {
|
|
123
236
|
style?: React.CSSProperties;
|
|
124
237
|
};
|
|
125
238
|
declare const CubeSkeleton: (props: CubeSkeletonProps) => react.JSX.Element;
|
|
126
239
|
|
|
240
|
+
declare const cubeStrokeTypes: readonly ["regular", "dot"];
|
|
241
|
+
type CubeStrokeType = (typeof cubeStrokeTypes)[number];
|
|
242
|
+
type CubeStrokeProps = PropsWithClassName & {
|
|
243
|
+
/**
|
|
244
|
+
* @default 'regular'
|
|
245
|
+
*/
|
|
246
|
+
type?: CubeStrokeType;
|
|
247
|
+
color?: BorderColorClass;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
declare const CubeStroke: (props: CubeStrokeProps) => react.JSX.Element;
|
|
251
|
+
|
|
252
|
+
type CubeTabsProps = {
|
|
253
|
+
children: ReactNode;
|
|
254
|
+
};
|
|
255
|
+
type CubeTabProps = {
|
|
256
|
+
children: string;
|
|
257
|
+
href?: string;
|
|
258
|
+
isActive: boolean;
|
|
259
|
+
disabled?: boolean;
|
|
260
|
+
onClick?: (e: MouseEvent<HTMLElement>) => void;
|
|
261
|
+
} & ({
|
|
262
|
+
number: number;
|
|
263
|
+
dot?: never;
|
|
264
|
+
} | {
|
|
265
|
+
number?: never;
|
|
266
|
+
dot: true;
|
|
267
|
+
} | {
|
|
268
|
+
number?: never;
|
|
269
|
+
dot?: never;
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
declare const CubeTabs: {
|
|
273
|
+
(props: CubeTabsProps): react.JSX.Element;
|
|
274
|
+
Tab: (props: CubeTabProps) => react.DetailedReactHTMLElement<{
|
|
275
|
+
className: string;
|
|
276
|
+
href: string | undefined;
|
|
277
|
+
onClick: (e: react.MouseEvent<HTMLElement>) => void;
|
|
278
|
+
}, HTMLElement>;
|
|
279
|
+
Skeleton: () => react.JSX.Element;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
declare const cubeTagColors: readonly ["default", "primary-blue", "blue", "cyan", "dark"];
|
|
283
|
+
declare const cubeTagVariants: readonly ["filled", "stroke"];
|
|
284
|
+
type CubeTagColor = (typeof cubeTagColors)[number];
|
|
285
|
+
type CubeTagVariant = (typeof cubeTagVariants)[number];
|
|
286
|
+
type CubeTagProps = PropsWithClassName & {
|
|
287
|
+
children?: string;
|
|
288
|
+
/**
|
|
289
|
+
* @default "default"
|
|
290
|
+
*/
|
|
291
|
+
color?: CubeTagColor;
|
|
292
|
+
variant: CubeTagVariant;
|
|
293
|
+
/**
|
|
294
|
+
* @default false
|
|
295
|
+
*/
|
|
296
|
+
disabled?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* @default false
|
|
299
|
+
*/
|
|
300
|
+
isLoading?: boolean;
|
|
301
|
+
} & (// The props for the close button and icon are both optional.
|
|
302
|
+
NonNullable<unknown> | {
|
|
303
|
+
showCloseButton: boolean;
|
|
304
|
+
onClose?: () => void;
|
|
305
|
+
} | {
|
|
306
|
+
Icon: SvgComponent;
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
type CubeTagSkeletonProps = {
|
|
310
|
+
hasIcon: boolean;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
declare const CubeTag: {
|
|
314
|
+
(props: CubeTagProps): react.JSX.Element;
|
|
315
|
+
Skeleton: (props: CubeTagSkeletonProps) => react.JSX.Element;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
type CubeTextareaProps = DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> & {
|
|
319
|
+
label: string;
|
|
320
|
+
maxLength: number;
|
|
321
|
+
/**
|
|
322
|
+
* @default false
|
|
323
|
+
*/
|
|
324
|
+
isLoading?: boolean;
|
|
325
|
+
errorMessage?: string;
|
|
326
|
+
};
|
|
327
|
+
declare const CubeTextarea: {
|
|
328
|
+
(props: CubeTextareaProps): react.JSX.Element;
|
|
329
|
+
Skeleton: () => react.JSX.Element;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
type CubeToggleProps = PropsWithClassName & {
|
|
333
|
+
/**
|
|
334
|
+
* Whether the toggle is on. Always controlled by the caller —
|
|
335
|
+
* pair with `onCheckedChange` to update this value when the user toggles.
|
|
336
|
+
*/
|
|
337
|
+
checked: boolean;
|
|
338
|
+
/**
|
|
339
|
+
* Called with the next on/off value when the user toggles. Required so the
|
|
340
|
+
* caller can update `checked`.
|
|
341
|
+
*/
|
|
342
|
+
onCheckedChange: (checked: boolean) => void;
|
|
343
|
+
/**
|
|
344
|
+
* Visible text shown next to the toggle. Also provides the accessible name
|
|
345
|
+
* via `aria-labelledby` / `<label htmlFor>`.
|
|
346
|
+
*/
|
|
347
|
+
label?: string;
|
|
348
|
+
/**
|
|
349
|
+
* Accessible name when no visible `label` is rendered. Prefer `label` when
|
|
350
|
+
* the name should also appear on screen.
|
|
351
|
+
*/
|
|
352
|
+
'aria-label'?: string;
|
|
353
|
+
/**
|
|
354
|
+
* When true, the toggle cannot be interacted with.
|
|
355
|
+
* @default false
|
|
356
|
+
*/
|
|
357
|
+
disabled?: boolean;
|
|
358
|
+
};
|
|
359
|
+
declare const CubeToggle: (props: CubeToggleProps) => react.JSX.Element;
|
|
360
|
+
|
|
127
361
|
var enUS = {
|
|
128
362
|
"component.common.loading": "Loading",
|
|
129
363
|
"component.common.noData": "No Data"
|
|
@@ -178,4 +412,4 @@ declare const CubeUiLocaleProvider: (props: CubeUiLocaleProviderProps) => react.
|
|
|
178
412
|
*/
|
|
179
413
|
declare const useCubeUiTranslation: typeof useTranslation;
|
|
180
414
|
|
|
181
|
-
export { CubeButton, type CubeButtonProps, type CubeButtonSize,
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ForwardRefExoticComponent, SVGProps, RefAttributes, ReactElement, JSX, ButtonHTMLAttributes, InputHTMLAttributes, PropsWithChildren } 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.js';
|
|
4
|
+
export { BackgroundColorClass, CubeThemeName, CubeThemeProvider, CubeThemeProviderProps, FillColorClass, StrokeColorClass, TextColorClass, Typography, TypographyClassName, cubePreset, cubeTheme, getTypography } from './theme.js';
|
|
3
5
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
export { BackgroundColorClass, BorderColorClass, CubeThemeName, CubeThemeProvider, CubeThemeProviderProps, FillColorClass, StrokeColorClass, TextColorClass, Typography, TypographyClassName, cubePreset, cubeTheme, getTypography } from './theme.js';
|
|
5
6
|
import 'tailwindcss/types/config';
|
|
6
7
|
|
|
7
8
|
declare const cubeIconSizes: readonly ["xs", "sm", "md-sm", "md", "lg", "xl"];
|
|
@@ -60,8 +61,6 @@ type CubeButtonProps = Omit<JSX.IntrinsicElements['button'], 'type' | 'children'
|
|
|
60
61
|
Icon: SvgComponent;
|
|
61
62
|
});
|
|
62
63
|
|
|
63
|
-
declare const CubeButton: (props: CubeButtonProps) => react.JSX.Element;
|
|
64
|
-
|
|
65
64
|
type CubeButtonSkeletonProps = {
|
|
66
65
|
/**
|
|
67
66
|
* @default 'md
|
|
@@ -72,10 +71,106 @@ type CubeButtonSkeletonProps = {
|
|
|
72
71
|
*/
|
|
73
72
|
usage?: CubeButtonUsage;
|
|
74
73
|
};
|
|
75
|
-
|
|
74
|
+
|
|
75
|
+
declare const CubeButton: {
|
|
76
|
+
(props: CubeButtonProps): react.JSX.Element;
|
|
77
|
+
Skeleton: (props: CubeButtonSkeletonProps) => react.JSX.Element;
|
|
78
|
+
};
|
|
79
|
+
|
|
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;
|
|
88
|
+
/**
|
|
89
|
+
* @default "primary"
|
|
90
|
+
*/
|
|
91
|
+
color?: CubeCheckboxColor;
|
|
92
|
+
label?: string;
|
|
93
|
+
/**
|
|
94
|
+
* @default "md"
|
|
95
|
+
*/
|
|
96
|
+
labelSize?: CubeCheckboxLabelSize;
|
|
97
|
+
labelClassName?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Use `null` for indeterminate state.
|
|
100
|
+
*/
|
|
101
|
+
checked?: boolean | null;
|
|
102
|
+
/**
|
|
103
|
+
* Use `null` for indeterminate state.
|
|
104
|
+
*/
|
|
105
|
+
defaultChecked?: boolean | null;
|
|
106
|
+
/**
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
isLoading?: boolean;
|
|
110
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
type CubeCheckboxGridProps = PropsWithChildren<{
|
|
114
|
+
className?: string;
|
|
115
|
+
direction: CubeCheckboxGridDirection;
|
|
116
|
+
}>;
|
|
117
|
+
|
|
118
|
+
declare const CubeCheckbox: {
|
|
119
|
+
(props: CubeCheckboxProps): react.JSX.Element;
|
|
120
|
+
Skeleton: () => react.JSX.Element;
|
|
121
|
+
Grid: (props: CubeCheckboxGridProps) => react.JSX.Element;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
type PropsWithClassName = {
|
|
125
|
+
className?: string | undefined;
|
|
126
|
+
};
|
|
127
|
+
|
|
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 = {
|
|
135
|
+
/**
|
|
136
|
+
* @default "primary"
|
|
137
|
+
*/
|
|
138
|
+
color?: CubeHyperlinkColor;
|
|
139
|
+
/**
|
|
140
|
+
* @default "md"
|
|
141
|
+
*/
|
|
142
|
+
size?: CubeHyperlinkSize;
|
|
143
|
+
/**
|
|
144
|
+
* @default false
|
|
145
|
+
*/
|
|
146
|
+
disabled?: boolean;
|
|
147
|
+
children: string;
|
|
148
|
+
href?: string;
|
|
149
|
+
target?: AnchorHTMLAttributes<HTMLAnchorElement>['target'];
|
|
150
|
+
onClick?: (e: MouseEvent<HTMLElement>) => void;
|
|
151
|
+
};
|
|
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>;
|
|
76
166
|
|
|
77
167
|
declare const CubeIconFrame: (props: CubeIconFrameProps) => react.JSX.Element;
|
|
78
168
|
|
|
169
|
+
type InputSkeletonType = 'input' | 'label' | 'footer';
|
|
170
|
+
type CubeInputSkeletonProps = {
|
|
171
|
+
type: InputSkeletonType;
|
|
172
|
+
};
|
|
173
|
+
|
|
79
174
|
type CubeInputProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
80
175
|
/**
|
|
81
176
|
* @default false
|
|
@@ -97,10 +192,8 @@ declare const CubeInput: react.ForwardRefExoticComponent<InputHTMLAttributes<HTM
|
|
|
97
192
|
helpMessage?: string;
|
|
98
193
|
errorMessage?: string | boolean;
|
|
99
194
|
trailingIcon?: SvgElement;
|
|
100
|
-
} & react.RefAttributes<HTMLInputElement
|
|
101
|
-
|
|
102
|
-
type PropsWithClassName = {
|
|
103
|
-
className?: string | undefined;
|
|
195
|
+
} & react.RefAttributes<HTMLInputElement>> & {
|
|
196
|
+
Skeleton: (props: CubeInputSkeletonProps) => react.JSX.Element;
|
|
104
197
|
};
|
|
105
198
|
|
|
106
199
|
declare const cubeLoadingSpinnerVariants: readonly ["dot45", "dot120", "cube"];
|
|
@@ -119,11 +212,152 @@ type CubePasswordInputProps = Omit<CubeInputProps, 'trailingIcon' | 'type'> & {
|
|
|
119
212
|
};
|
|
120
213
|
declare const CubePasswordInput: (props: CubePasswordInputProps) => react.JSX.Element;
|
|
121
214
|
|
|
215
|
+
type CubeRadioButtonGridDirection = 'vertical' | 'wrap';
|
|
216
|
+
type CubeRadioButtonGridProps = PropsWithChildren<{
|
|
217
|
+
className?: string;
|
|
218
|
+
direction: CubeRadioButtonGridDirection;
|
|
219
|
+
}>;
|
|
220
|
+
|
|
221
|
+
type CubeRadioButtonProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
222
|
+
label: string;
|
|
223
|
+
/**
|
|
224
|
+
* @default false
|
|
225
|
+
*/
|
|
226
|
+
isLoading?: boolean;
|
|
227
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
228
|
+
};
|
|
229
|
+
declare const CubeRadioButton: {
|
|
230
|
+
(props: CubeRadioButtonProps): react.JSX.Element;
|
|
231
|
+
Skeleton: () => react.JSX.Element;
|
|
232
|
+
Grid: (props: CubeRadioButtonGridProps) => react.JSX.Element;
|
|
233
|
+
};
|
|
234
|
+
|
|
122
235
|
type CubeSkeletonProps = PropsWithClassName & {
|
|
123
236
|
style?: React.CSSProperties;
|
|
124
237
|
};
|
|
125
238
|
declare const CubeSkeleton: (props: CubeSkeletonProps) => react.JSX.Element;
|
|
126
239
|
|
|
240
|
+
declare const cubeStrokeTypes: readonly ["regular", "dot"];
|
|
241
|
+
type CubeStrokeType = (typeof cubeStrokeTypes)[number];
|
|
242
|
+
type CubeStrokeProps = PropsWithClassName & {
|
|
243
|
+
/**
|
|
244
|
+
* @default 'regular'
|
|
245
|
+
*/
|
|
246
|
+
type?: CubeStrokeType;
|
|
247
|
+
color?: BorderColorClass;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
declare const CubeStroke: (props: CubeStrokeProps) => react.JSX.Element;
|
|
251
|
+
|
|
252
|
+
type CubeTabsProps = {
|
|
253
|
+
children: ReactNode;
|
|
254
|
+
};
|
|
255
|
+
type CubeTabProps = {
|
|
256
|
+
children: string;
|
|
257
|
+
href?: string;
|
|
258
|
+
isActive: boolean;
|
|
259
|
+
disabled?: boolean;
|
|
260
|
+
onClick?: (e: MouseEvent<HTMLElement>) => void;
|
|
261
|
+
} & ({
|
|
262
|
+
number: number;
|
|
263
|
+
dot?: never;
|
|
264
|
+
} | {
|
|
265
|
+
number?: never;
|
|
266
|
+
dot: true;
|
|
267
|
+
} | {
|
|
268
|
+
number?: never;
|
|
269
|
+
dot?: never;
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
declare const CubeTabs: {
|
|
273
|
+
(props: CubeTabsProps): react.JSX.Element;
|
|
274
|
+
Tab: (props: CubeTabProps) => react.DetailedReactHTMLElement<{
|
|
275
|
+
className: string;
|
|
276
|
+
href: string | undefined;
|
|
277
|
+
onClick: (e: react.MouseEvent<HTMLElement>) => void;
|
|
278
|
+
}, HTMLElement>;
|
|
279
|
+
Skeleton: () => react.JSX.Element;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
declare const cubeTagColors: readonly ["default", "primary-blue", "blue", "cyan", "dark"];
|
|
283
|
+
declare const cubeTagVariants: readonly ["filled", "stroke"];
|
|
284
|
+
type CubeTagColor = (typeof cubeTagColors)[number];
|
|
285
|
+
type CubeTagVariant = (typeof cubeTagVariants)[number];
|
|
286
|
+
type CubeTagProps = PropsWithClassName & {
|
|
287
|
+
children?: string;
|
|
288
|
+
/**
|
|
289
|
+
* @default "default"
|
|
290
|
+
*/
|
|
291
|
+
color?: CubeTagColor;
|
|
292
|
+
variant: CubeTagVariant;
|
|
293
|
+
/**
|
|
294
|
+
* @default false
|
|
295
|
+
*/
|
|
296
|
+
disabled?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* @default false
|
|
299
|
+
*/
|
|
300
|
+
isLoading?: boolean;
|
|
301
|
+
} & (// The props for the close button and icon are both optional.
|
|
302
|
+
NonNullable<unknown> | {
|
|
303
|
+
showCloseButton: boolean;
|
|
304
|
+
onClose?: () => void;
|
|
305
|
+
} | {
|
|
306
|
+
Icon: SvgComponent;
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
type CubeTagSkeletonProps = {
|
|
310
|
+
hasIcon: boolean;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
declare const CubeTag: {
|
|
314
|
+
(props: CubeTagProps): react.JSX.Element;
|
|
315
|
+
Skeleton: (props: CubeTagSkeletonProps) => react.JSX.Element;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
type CubeTextareaProps = DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> & {
|
|
319
|
+
label: string;
|
|
320
|
+
maxLength: number;
|
|
321
|
+
/**
|
|
322
|
+
* @default false
|
|
323
|
+
*/
|
|
324
|
+
isLoading?: boolean;
|
|
325
|
+
errorMessage?: string;
|
|
326
|
+
};
|
|
327
|
+
declare const CubeTextarea: {
|
|
328
|
+
(props: CubeTextareaProps): react.JSX.Element;
|
|
329
|
+
Skeleton: () => react.JSX.Element;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
type CubeToggleProps = PropsWithClassName & {
|
|
333
|
+
/**
|
|
334
|
+
* Whether the toggle is on. Always controlled by the caller —
|
|
335
|
+
* pair with `onCheckedChange` to update this value when the user toggles.
|
|
336
|
+
*/
|
|
337
|
+
checked: boolean;
|
|
338
|
+
/**
|
|
339
|
+
* Called with the next on/off value when the user toggles. Required so the
|
|
340
|
+
* caller can update `checked`.
|
|
341
|
+
*/
|
|
342
|
+
onCheckedChange: (checked: boolean) => void;
|
|
343
|
+
/**
|
|
344
|
+
* Visible text shown next to the toggle. Also provides the accessible name
|
|
345
|
+
* via `aria-labelledby` / `<label htmlFor>`.
|
|
346
|
+
*/
|
|
347
|
+
label?: string;
|
|
348
|
+
/**
|
|
349
|
+
* Accessible name when no visible `label` is rendered. Prefer `label` when
|
|
350
|
+
* the name should also appear on screen.
|
|
351
|
+
*/
|
|
352
|
+
'aria-label'?: string;
|
|
353
|
+
/**
|
|
354
|
+
* When true, the toggle cannot be interacted with.
|
|
355
|
+
* @default false
|
|
356
|
+
*/
|
|
357
|
+
disabled?: boolean;
|
|
358
|
+
};
|
|
359
|
+
declare const CubeToggle: (props: CubeToggleProps) => react.JSX.Element;
|
|
360
|
+
|
|
127
361
|
var enUS = {
|
|
128
362
|
"component.common.loading": "Loading",
|
|
129
363
|
"component.common.noData": "No Data"
|
|
@@ -178,4 +412,4 @@ declare const CubeUiLocaleProvider: (props: CubeUiLocaleProviderProps) => react.
|
|
|
178
412
|
*/
|
|
179
413
|
declare const useCubeUiTranslation: typeof useTranslation;
|
|
180
414
|
|
|
181
|
-
export { CubeButton, type CubeButtonProps, type CubeButtonSize,
|
|
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 };
|