@bcrumbs.net/bc-ui 0.0.9 → 0.0.11
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/index.esm.js +32172 -31471
- package/package.json +3 -2
- package/src/index.d.ts +3 -0
- package/src/lib/baseComponents/button.d.ts +2 -0
- package/src/lib/charts/HorizontalStatisticCard/HorizontalStatisticCard.d.ts +12 -0
- package/src/lib/charts/NewPieChart/NewPieChart.d.ts +13 -0
- package/src/lib/constants/Color.d.ts +7 -0
- package/src/lib/dropList/bcdrop-list.d.ts +4 -3
- package/src/lib/dropList/style.d.ts +81 -0
- package/src/lib/icon/bcicon.d.ts +72 -1
- package/src/lib/newComponents/BCNewTable/types.d.ts +3 -0
- package/src/lib/turnstile/BCTurnstile.d.ts +47 -0
- package/src/lib/turnstile/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcrumbs.net/bc-ui",
|
|
3
3
|
"description": "The UI components of Bread Crumbs portals",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.11",
|
|
5
5
|
"keyword": [
|
|
6
6
|
"bcrumbs",
|
|
7
7
|
"bc-ui"
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"@emotion/react": "11.5.0",
|
|
12
12
|
"@emotion/styled": "11.3.0",
|
|
13
13
|
"@radix-ui/themes": "^3.1.5",
|
|
14
|
-
"@radix-ui/react-icons": "^1.3.2"
|
|
14
|
+
"@radix-ui/react-icons": "^1.3.2",
|
|
15
|
+
"@marsidev/react-turnstile": "^1.1.0"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"react-date-range": "^2.0.1",
|
package/src/index.d.ts
CHANGED
|
@@ -31,7 +31,9 @@ export * from './lib/inputTags';
|
|
|
31
31
|
export * from './lib/utils';
|
|
32
32
|
export * from './lib/radioButton';
|
|
33
33
|
export * from './lib/charts/pieChart';
|
|
34
|
+
export * from './lib/charts/NewPieChart/NewPieChart';
|
|
34
35
|
export * from './lib/charts/barLineChart';
|
|
36
|
+
export * from './lib/charts/HorizontalStatisticCard/HorizontalStatisticCard';
|
|
35
37
|
export * from './lib/dateRangePicker';
|
|
36
38
|
export * from './lib/InputWithSuggestions';
|
|
37
39
|
export * from './lib/textArea';
|
|
@@ -52,6 +54,7 @@ export * from './lib/newComponents/BCRadioGroupItem/types';
|
|
|
52
54
|
export * from './lib/baseComponents/radio-group';
|
|
53
55
|
export * from './lib/baseComponents/checkbox';
|
|
54
56
|
export * from './lib/newComponents/BCNewCheckBox/BCNewCheckBox';
|
|
57
|
+
export * from './lib/turnstile';
|
|
55
58
|
export * from './lib/button/bcbutton';
|
|
56
59
|
export * from './lib/button/types';
|
|
57
60
|
export * from './lib/block/bcblock';
|
|
@@ -5,6 +5,8 @@ interface ButtonStyleProps {
|
|
|
5
5
|
}
|
|
6
6
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonStyleProps {
|
|
7
7
|
asChild?: boolean;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
loadingPosition?: 'left' | 'right';
|
|
8
10
|
}
|
|
9
11
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
12
|
export { Button };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface HorizontalStatisticCardProps {
|
|
3
|
+
title: string;
|
|
4
|
+
value: string | number;
|
|
5
|
+
Icon: React.ReactNode;
|
|
6
|
+
width?: string;
|
|
7
|
+
gradientStart?: string;
|
|
8
|
+
gradientEnd?: string;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const HorizontalStatisticCard: ({ title, value, Icon, width, gradientStart, gradientEnd, loading, }: HorizontalStatisticCardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface NewPieChartProps {
|
|
2
|
+
data: {
|
|
3
|
+
name: string;
|
|
4
|
+
value: number;
|
|
5
|
+
color: string;
|
|
6
|
+
}[];
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
value?: number;
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const NewPieChart: ({ data, value, label, width, height }: NewPieChartProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -13,6 +13,7 @@ export declare enum NewColors {
|
|
|
13
13
|
PRIMARY_DARKER = "var(--bc-primary-darker)",
|
|
14
14
|
PRIMARY_DARKER_2 = "var(--bc-primary-darker-2)",
|
|
15
15
|
PRIMARY_PARAGRAPH = "var(--bc-primary-paragraph)",
|
|
16
|
+
PRIMARY_PARAGRAPH_DARKER = "var(--bc-primary-paragraph-darker)",
|
|
16
17
|
INBOX_BACKGROUND = "var(--bc-inbox-background)",
|
|
17
18
|
BACKGROUND_DARKER = "var(--bc-background-darker)",
|
|
18
19
|
INFO_COLOR = "var(--bc-info)",
|
|
@@ -67,6 +68,12 @@ export declare enum NewColors {
|
|
|
67
68
|
GREY_LIGHT_BORDER = "#e4e4e4",
|
|
68
69
|
WARNING_DOWNLOAD = "rgba(255, 153, 0, 0.1)",
|
|
69
70
|
GREY_WHITE = "#f0f1f5",
|
|
71
|
+
LIGHT_GRAY = "var(--bc-light-gray)",
|
|
72
|
+
CHARTS_SUCCESS = "var(--bc-charts-success)",
|
|
73
|
+
CHARTS_WARNING = "var(--bc-charts-warning)",
|
|
74
|
+
CHARTS_DANGER = "var(--bc-charts-danger)",
|
|
75
|
+
CHARTS_LABEL = "var(--bc-charts-label)",
|
|
76
|
+
CHARTS_LEGEND_LABEL = "var(--bc-charts-legend-label)",
|
|
70
77
|
SECONDARY80 = "rgb(106, 107, 131, 0.8)",
|
|
71
78
|
SECONDARY70 = "rgb(106, 107, 131, 0.7)",
|
|
72
79
|
SECONDARY50 = "rgb(106, 107, 131, 0.5)",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ButtonSize, BCDropListOptionsType } from '../constants';
|
|
3
3
|
import { SerializedStyles } from '@emotion/react';
|
|
4
|
+
export declare const DropListButtonStyle: SerializedStyles;
|
|
5
|
+
export declare const DropListMenuStyle: SerializedStyles;
|
|
4
6
|
export interface BCDropListProps {
|
|
5
7
|
className?: string;
|
|
6
8
|
selected?: string;
|
|
@@ -25,8 +27,7 @@ export interface BCDropListProps {
|
|
|
25
27
|
id?: string;
|
|
26
28
|
searchable?: boolean;
|
|
27
29
|
searchPlaceholder?: string;
|
|
30
|
+
usePortal?: boolean;
|
|
28
31
|
}
|
|
29
|
-
export declare
|
|
30
|
-
export declare const DropListMenuStyle: SerializedStyles;
|
|
31
|
-
export declare const BCDropList: ({ className, selected, options, onSelectOption, noEmpty, placeholder, emptyText, buttonSize, rtl, icon, containerCss, buttonCss, dropDownContentCss, loading, disabled, allowCreate, onCreateNew, createPlaceholder, addText, createText, id, searchable, searchPlaceholder, }: BCDropListProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function BCDropList({ className, selected, options, onSelectOption, noEmpty, placeholder, emptyText, buttonSize, rtl, icon, containerCss, buttonCss, dropDownContentCss, loading, disabled, allowCreate, onCreateNew, createPlaceholder, addText, createText, id, searchable, searchPlaceholder, usePortal, }: BCDropListProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
32
33
|
export default BCDropList;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SerializedStyles } from '@emotion/react';
|
|
3
|
+
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
+
} & {
|
|
7
|
+
rtl?: boolean | undefined;
|
|
8
|
+
containerCss?: SerializedStyles | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const DropButtonNote: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
+
} & {
|
|
14
|
+
rtl?: boolean | undefined;
|
|
15
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
16
|
+
export declare const DropDownItemNote: import("@emotion/styled").StyledComponent<{
|
|
17
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
19
|
+
} & {
|
|
20
|
+
rtl?: boolean | undefined;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
22
|
+
export declare const Icon: import("@emotion/styled").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
25
|
+
} & {
|
|
26
|
+
rtl?: boolean | undefined;
|
|
27
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
28
|
+
export declare const LoadingSpinner: import("@emotion/styled").StyledComponent<{
|
|
29
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
30
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
31
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
32
|
+
export declare const CreateInputContainer: import("@emotion/styled").StyledComponent<{
|
|
33
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
34
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
35
|
+
} & {
|
|
36
|
+
rtl?: boolean | undefined;
|
|
37
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
38
|
+
export declare const CreateInput: import("@emotion/styled").StyledComponent<{
|
|
39
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
40
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
rtl?: boolean | undefined;
|
|
43
|
+
}, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
|
|
44
|
+
export declare const CreateButton: import("@emotion/styled").StyledComponent<import("../baseComponents/button").ButtonProps & import("react").RefAttributes<HTMLButtonElement> & {
|
|
45
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
46
|
+
}, {}, {}>;
|
|
47
|
+
export declare const SearchInputContainer: import("@emotion/styled").StyledComponent<{
|
|
48
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
49
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
50
|
+
} & {
|
|
51
|
+
rtl?: boolean | undefined;
|
|
52
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
53
|
+
export declare const SearchInput: import("@emotion/styled").StyledComponent<{
|
|
54
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
55
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
56
|
+
} & {
|
|
57
|
+
rtl?: boolean | undefined;
|
|
58
|
+
}, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
|
|
59
|
+
export declare const SearchIcon: import("@emotion/styled").StyledComponent<{
|
|
60
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
61
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
62
|
+
} & {
|
|
63
|
+
rtl?: boolean | undefined;
|
|
64
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
65
|
+
export declare const NoResultsMessage: import("@emotion/styled").StyledComponent<{
|
|
66
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
67
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
68
|
+
} & {
|
|
69
|
+
rtl?: boolean | undefined;
|
|
70
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
71
|
+
export declare const DropDownContent: import("@emotion/styled").StyledComponent<{
|
|
72
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
73
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
74
|
+
} & {
|
|
75
|
+
rtl?: boolean | undefined;
|
|
76
|
+
openUpward?: boolean | undefined;
|
|
77
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
78
|
+
export declare const PortalWrapper: import("@emotion/styled").StyledComponent<{
|
|
79
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
80
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
81
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
package/src/lib/icon/bcicon.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface BCIconsProps {
|
|
|
22
22
|
}
|
|
23
23
|
export declare const BCIcons: {
|
|
24
24
|
WhatsApp: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
25
|
+
Instagram: ({ width, height }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
25
26
|
Facebook: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
26
27
|
Google: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
27
28
|
Broadcast: ({ width, height, fill }: BCIconsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -294,7 +295,7 @@ export declare const BCIcons: {
|
|
|
294
295
|
height?: number | undefined;
|
|
295
296
|
fill?: string | undefined;
|
|
296
297
|
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
297
|
-
|
|
298
|
+
DoubleHollowChecks: ({ width, height, fill }: {
|
|
298
299
|
width?: number | undefined;
|
|
299
300
|
height?: number | undefined;
|
|
300
301
|
fill?: string | undefined;
|
|
@@ -309,6 +310,16 @@ export declare const BCIcons: {
|
|
|
309
310
|
height?: number | undefined;
|
|
310
311
|
fill?: string | undefined;
|
|
311
312
|
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
313
|
+
ArchivedClient: ({ width, height, fill }: {
|
|
314
|
+
width?: number | undefined;
|
|
315
|
+
height?: number | undefined;
|
|
316
|
+
fill?: string | undefined;
|
|
317
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
318
|
+
ActiveCient: ({ width, height, fill }: {
|
|
319
|
+
width?: number | undefined;
|
|
320
|
+
height?: number | undefined;
|
|
321
|
+
fill?: string | undefined;
|
|
322
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
312
323
|
CancelDialogIcon: ({ width, height, fill }: {
|
|
313
324
|
width?: number | undefined;
|
|
314
325
|
height?: number | undefined;
|
|
@@ -324,4 +335,64 @@ export declare const BCIcons: {
|
|
|
324
335
|
height?: number | undefined;
|
|
325
336
|
fill?: string | undefined;
|
|
326
337
|
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
338
|
+
DoubleSolidChecks: ({ width, height, fill }: {
|
|
339
|
+
width?: number | undefined;
|
|
340
|
+
height?: number | undefined;
|
|
341
|
+
fill?: string | undefined;
|
|
342
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
343
|
+
DoubleDollarSigns: ({ width, height, fill }: {
|
|
344
|
+
width?: number | undefined;
|
|
345
|
+
height?: number | undefined;
|
|
346
|
+
fill?: string | undefined;
|
|
347
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
348
|
+
DoubleChats: ({ width, height, fill }: {
|
|
349
|
+
width?: number | undefined;
|
|
350
|
+
height?: number | undefined;
|
|
351
|
+
fill?: string | undefined;
|
|
352
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
353
|
+
SingleCheck: ({ width, height, fill }: {
|
|
354
|
+
width?: number | undefined;
|
|
355
|
+
height?: number | undefined;
|
|
356
|
+
fill?: string | undefined;
|
|
357
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
358
|
+
CircledCross: ({ width, height, fill }: {
|
|
359
|
+
width?: number | undefined;
|
|
360
|
+
height?: number | undefined;
|
|
361
|
+
fill?: string | undefined;
|
|
362
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
363
|
+
Clock: ({ width, height, fill }: {
|
|
364
|
+
width?: number | undefined;
|
|
365
|
+
height?: number | undefined;
|
|
366
|
+
fill?: string | undefined;
|
|
367
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
368
|
+
WhatsappBackArrow: ({ width, height, fill }: {
|
|
369
|
+
width?: number | undefined;
|
|
370
|
+
height?: number | undefined;
|
|
371
|
+
fill?: string | undefined;
|
|
372
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
373
|
+
WhatsappCall: ({ width, height, fill }: {
|
|
374
|
+
width?: number | undefined;
|
|
375
|
+
height?: number | undefined;
|
|
376
|
+
fill?: string | undefined;
|
|
377
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
378
|
+
WhatsappVideoCall: ({ width, height, fill }: {
|
|
379
|
+
width?: number | undefined;
|
|
380
|
+
height?: number | undefined;
|
|
381
|
+
fill?: string | undefined;
|
|
382
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
383
|
+
BCrumbsSlug: ({ width, height, fill }: {
|
|
384
|
+
width?: number | undefined;
|
|
385
|
+
height?: number | undefined;
|
|
386
|
+
fill?: string | undefined;
|
|
387
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
388
|
+
MultiplicationSign: ({ width, height, fill }: {
|
|
389
|
+
width?: number | undefined;
|
|
390
|
+
height?: number | undefined;
|
|
391
|
+
fill?: string | undefined;
|
|
392
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
393
|
+
InfoCircle: ({ width, height, fill }: {
|
|
394
|
+
width?: number | undefined;
|
|
395
|
+
height?: number | undefined;
|
|
396
|
+
fill?: string | undefined;
|
|
397
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
327
398
|
};
|
|
@@ -60,7 +60,10 @@ export type TableAction = {
|
|
|
60
60
|
confirm?: string;
|
|
61
61
|
loading?: boolean;
|
|
62
62
|
confirmAction?: (info: any) => void;
|
|
63
|
+
confirmCssStyle?: SerializedStyles;
|
|
63
64
|
disabled?: boolean;
|
|
64
65
|
headerItemsPosition?: string;
|
|
65
66
|
inDialog?: boolean;
|
|
67
|
+
dialogIcon?: React.ReactNode;
|
|
68
|
+
dialogIconBackgroundColor?: string;
|
|
66
69
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type TurnstileTheme = 'light' | 'dark' | 'auto';
|
|
3
|
+
export type TurnstileSize = 'normal' | 'compact';
|
|
4
|
+
export interface BCTurnstileProps {
|
|
5
|
+
/** Cloudflare Turnstile site key */
|
|
6
|
+
siteKey: string;
|
|
7
|
+
/** Callback when verification succeeds */
|
|
8
|
+
onSuccess?: (token: string) => void;
|
|
9
|
+
/** Callback when verification fails */
|
|
10
|
+
onError?: (error?: string) => void;
|
|
11
|
+
/** Callback when token expires */
|
|
12
|
+
onExpire?: () => void;
|
|
13
|
+
/** Widget theme */
|
|
14
|
+
theme?: TurnstileTheme;
|
|
15
|
+
/** Widget size */
|
|
16
|
+
size?: TurnstileSize;
|
|
17
|
+
/** Additional class name */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Action identifier for analytics */
|
|
20
|
+
action?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface BCTurnstileRef {
|
|
23
|
+
/** Reset the widget */
|
|
24
|
+
reset: () => void;
|
|
25
|
+
/** Get the current response token */
|
|
26
|
+
getResponse: () => string | undefined;
|
|
27
|
+
/** Execute the challenge (for invisible mode) */
|
|
28
|
+
execute: () => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* BCTurnstile - Cloudflare Turnstile CAPTCHA component
|
|
32
|
+
*
|
|
33
|
+
* Usage:
|
|
34
|
+
* ```tsx
|
|
35
|
+
* const turnstileRef = useRef<BCTurnstileRef>(null);
|
|
36
|
+
* const [token, setToken] = useState<string | null>(null);
|
|
37
|
+
*
|
|
38
|
+
* <BCTurnstile
|
|
39
|
+
* ref={turnstileRef}
|
|
40
|
+
* siteKey="your-site-key"
|
|
41
|
+
* onSuccess={(token) => setToken(token)}
|
|
42
|
+
* onError={() => setToken(null)}
|
|
43
|
+
* />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const BCTurnstile: import("react").ForwardRefExoticComponent<BCTurnstileProps & import("react").RefAttributes<BCTurnstileRef>>;
|
|
47
|
+
export default BCTurnstile;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BCTurnstile';
|