xiod-ui 1.0.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/LICENSE +73 -0
- package/README.md +167 -0
- package/dist/components/accordion.d.ts +9 -0
- package/dist/components/accordion.js +46 -0
- package/dist/components/agent-steps.d.ts +47 -0
- package/dist/components/agent-steps.js +223 -0
- package/dist/components/alert-dialog.d.ts +21 -0
- package/dist/components/alert-dialog.js +74 -0
- package/dist/components/alert.d.ts +12 -0
- package/dist/components/alert.js +45 -0
- package/dist/components/aspect-ratio.d.ts +9 -0
- package/dist/components/aspect-ratio.js +22 -0
- package/dist/components/autocomplete.d.ts +35 -0
- package/dist/components/autocomplete.js +160 -0
- package/dist/components/avatar.d.ts +17 -0
- package/dist/components/avatar.js +65 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.js +46 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +75 -0
- package/dist/components/button-group.d.ts +14 -0
- package/dist/components/button-group.js +45 -0
- package/dist/components/button-split.d.ts +19 -0
- package/dist/components/button-split.js +73 -0
- package/dist/components/button.d.ts +15 -0
- package/dist/components/button.js +54 -0
- package/dist/components/calendar.d.ts +63 -0
- package/dist/components/calendar.js +425 -0
- package/dist/components/card.d.ts +17 -0
- package/dist/components/card.js +139 -0
- package/dist/components/carousel.d.ts +59 -0
- package/dist/components/carousel.js +503 -0
- package/dist/components/checkbox.d.ts +16 -0
- package/dist/components/checkbox.js +86 -0
- package/dist/components/circular-progress.d.ts +28 -0
- package/dist/components/circular-progress.js +127 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +27 -0
- package/dist/components/color-picker.d.ts +159 -0
- package/dist/components/color-picker.js +1589 -0
- package/dist/components/combobox.d.ts +46 -0
- package/dist/components/combobox.js +237 -0
- package/dist/components/command.d.ts +22 -0
- package/dist/components/command.js +129 -0
- package/dist/components/context-menu.d.ts +38 -0
- package/dist/components/context-menu.js +164 -0
- package/dist/components/copy-to-clipboard.d.ts +32 -0
- package/dist/components/copy-to-clipboard.js +83 -0
- package/dist/components/corner-badge.d.ts +22 -0
- package/dist/components/corner-badge.js +84 -0
- package/dist/components/dashboard-grid.d.ts +83 -0
- package/dist/components/dashboard-grid.js +486 -0
- package/dist/components/date-picker.d.ts +29 -0
- package/dist/components/date-picker.js +261 -0
- package/dist/components/dialog.d.ts +26 -0
- package/dist/components/dialog.js +97 -0
- package/dist/components/dot-matrix.d.ts +32 -0
- package/dist/components/dot-matrix.js +707 -0
- package/dist/components/draggable.d.ts +42 -0
- package/dist/components/draggable.js +346 -0
- package/dist/components/drawer.d.ts +66 -0
- package/dist/components/drawer.js +304 -0
- package/dist/components/empty.d.ts +14 -0
- package/dist/components/empty.js +75 -0
- package/dist/components/field.d.ts +12 -0
- package/dist/components/field.js +44 -0
- package/dist/components/fieldset.d.ts +7 -0
- package/dist/components/fieldset.js +21 -0
- package/dist/components/file-upload.d.ts +61 -0
- package/dist/components/file-upload.js +482 -0
- package/dist/components/form.d.ts +6 -0
- package/dist/components/form.js +14 -0
- package/dist/components/frame.d.ts +10 -0
- package/dist/components/frame.js +47 -0
- package/dist/components/gauge.d.ts +27 -0
- package/dist/components/gauge.js +74 -0
- package/dist/components/grid.d.ts +26 -0
- package/dist/components/grid.js +204 -0
- package/dist/components/group.d.ts +19 -0
- package/dist/components/group.js +45 -0
- package/dist/components/input-group.d.ts +15 -0
- package/dist/components/input-group.js +61 -0
- package/dist/components/input-otp.d.ts +24 -0
- package/dist/components/input-otp.js +50 -0
- package/dist/components/input-payment.d.ts +131 -0
- package/dist/components/input-payment.js +1140 -0
- package/dist/components/input-phone.d.ts +70 -0
- package/dist/components/input-phone.js +657 -0
- package/dist/components/input-sensitive.d.ts +12 -0
- package/dist/components/input-sensitive.js +169 -0
- package/dist/components/input.d.ts +13 -0
- package/dist/components/input.js +26 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +19 -0
- package/dist/components/kinetic-click.d.ts +48 -0
- package/dist/components/kinetic-click.js +1184 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +18 -0
- package/dist/components/list-box.d.ts +20 -0
- package/dist/components/list-box.js +148 -0
- package/dist/components/loader.d.ts +13 -0
- package/dist/components/loader.js +430 -0
- package/dist/components/marker.d.ts +15 -0
- package/dist/components/marker.js +59 -0
- package/dist/components/menu.d.ts +42 -0
- package/dist/components/menu.js +186 -0
- package/dist/components/menubar.d.ts +40 -0
- package/dist/components/menubar.js +107 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +112 -0
- package/dist/components/meter.d.ts +10 -0
- package/dist/components/meter.js +42 -0
- package/dist/components/morphic-toast.d.ts +61 -0
- package/dist/components/morphic-toast.js +916 -0
- package/dist/components/navigation-menu.d.ts +26 -0
- package/dist/components/navigation-menu.js +116 -0
- package/dist/components/number-field.d.ts +15 -0
- package/dist/components/number-field.js +86 -0
- package/dist/components/option-picker.d.ts +18 -0
- package/dist/components/option-picker.js +89 -0
- package/dist/components/orb.d.ts +38 -0
- package/dist/components/orb.js +1413 -0
- package/dist/components/pagination.d.ts +25 -0
- package/dist/components/pagination.js +147 -0
- package/dist/components/popover.d.ts +22 -0
- package/dist/components/popover.js +79 -0
- package/dist/components/preview-card.d.ts +16 -0
- package/dist/components/preview-card.js +60 -0
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.js +139 -0
- package/dist/components/radio.d.ts +16 -0
- package/dist/components/radio.js +68 -0
- package/dist/components/resizable.d.ts +58 -0
- package/dist/components/resizable.js +964 -0
- package/dist/components/ruler-picker.d.ts +27 -0
- package/dist/components/ruler-picker.js +253 -0
- package/dist/components/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area.js +34 -0
- package/dist/components/scroll-bar.d.ts +13 -0
- package/dist/components/scroll-bar.js +47 -0
- package/dist/components/select.d.ts +29 -0
- package/dist/components/select.js +140 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +15 -0
- package/dist/components/sidebar.d.ts +65 -0
- package/dist/components/sidebar.js +408 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +12 -0
- package/dist/components/slider.d.ts +12 -0
- package/dist/components/slider.js +96 -0
- package/dist/components/sortable.d.ts +44 -0
- package/dist/components/sortable.js +327 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.js +63 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +65 -0
- package/dist/components/tabs.d.ts +12 -0
- package/dist/components/tabs.js +39 -0
- package/dist/components/text.d.ts +14 -0
- package/dist/components/text.js +69 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/theme-provider.d.ts +52 -0
- package/dist/components/theme-provider.js +148 -0
- package/dist/components/timeline.d.ts +34 -0
- package/dist/components/timeline.js +147 -0
- package/dist/components/toast.d.ts +17 -0
- package/dist/components/toast.js +161 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +53 -0
- package/dist/components/toggle.d.ts +11 -0
- package/dist/components/toggle.js +36 -0
- package/dist/components/toolbar.d.ts +11 -0
- package/dist/components/toolbar.js +49 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.js +56 -0
- package/dist/components/waveform.d.ts +61 -0
- package/dist/components/waveform.js +500 -0
- package/dist/components/wheel-picker.d.ts +44 -0
- package/dist/components/wheel-picker.js +771 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-to-clipboard.js +36 -0
- package/dist/hooks/use-media-query.d.ts +21 -0
- package/dist/hooks/use-media-query.js +58 -0
- package/dist/styles.css +202 -0
- package/dist/themes/afterglow.css +89 -0
- package/dist/themes/afterglow.scoped.css +90 -0
- package/dist/themes/blacklight.css +89 -0
- package/dist/themes/blacklight.scoped.css +90 -0
- package/dist/themes/cathode.css +89 -0
- package/dist/themes/cathode.scoped.css +90 -0
- package/dist/themes/cel.css +89 -0
- package/dist/themes/cel.scoped.css +90 -0
- package/dist/themes/cinder.css +89 -0
- package/dist/themes/cinder.scoped.css +90 -0
- package/dist/themes/clay.css +89 -0
- package/dist/themes/clay.scoped.css +90 -0
- package/dist/themes/cobalt.css +89 -0
- package/dist/themes/cobalt.scoped.css +90 -0
- package/dist/themes/crimson.css +89 -0
- package/dist/themes/crimson.scoped.css +90 -0
- package/dist/themes/ion.css +89 -0
- package/dist/themes/ion.scoped.css +90 -0
- package/dist/themes/iris.css +89 -0
- package/dist/themes/iris.scoped.css +90 -0
- package/dist/themes/lagoon.css +89 -0
- package/dist/themes/lagoon.scoped.css +90 -0
- package/dist/themes/mochi.css +89 -0
- package/dist/themes/mochi.scoped.css +90 -0
- package/dist/themes/riso.css +89 -0
- package/dist/themes/riso.scoped.css +90 -0
- package/dist/themes/roast.css +89 -0
- package/dist/themes/roast.scoped.css +90 -0
- package/dist/themes/sage.css +89 -0
- package/dist/themes/sage.scoped.css +90 -0
- package/dist/themes/sepia.css +89 -0
- package/dist/themes/sepia.scoped.css +90 -0
- package/dist/themes/sorbet.css +89 -0
- package/dist/themes/sorbet.scoped.css +90 -0
- package/dist/themes/taffy.css +89 -0
- package/dist/themes/taffy.scoped.css +90 -0
- package/dist/themes/toxin.css +89 -0
- package/dist/themes/toxin.scoped.css +90 -0
- package/package.json +140 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/grid.d.ts
|
|
5
|
+
declare const gridVariants: (props?: ({
|
|
6
|
+
columns?: "none" | "subgrid" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | null | undefined;
|
|
7
|
+
rows?: "none" | "subgrid" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | null | undefined;
|
|
8
|
+
flow?: "row" | "col" | "dense" | "row-dense" | "col-dense" | null | undefined;
|
|
9
|
+
align?: "start" | "center" | "end" | "stretch" | "baseline" | null | undefined;
|
|
10
|
+
justify?: "start" | "center" | "end" | "stretch" | "between" | null | undefined;
|
|
11
|
+
gap?: "sm" | "md" | "lg" | "xl" | "none" | "base" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
interface GridProps extends useRender.ComponentProps<"div">, VariantProps<typeof gridVariants> {}
|
|
14
|
+
declare function Grid({ className, render, columns, rows, flow, align, justify, gap, ...props }: GridProps): React$1.ReactElement;
|
|
15
|
+
declare const gridItemVariants: (props?: ({
|
|
16
|
+
colSpan?: "auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "full" | null | undefined;
|
|
17
|
+
rowSpan?: "auto" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "full" | null | undefined;
|
|
18
|
+
colStart?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | null | undefined;
|
|
19
|
+
colEnd?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | null | undefined;
|
|
20
|
+
rowStart?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | null | undefined;
|
|
21
|
+
rowEnd?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | null | undefined;
|
|
22
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
23
|
+
interface GridItemProps extends useRender.ComponentProps<"div">, VariantProps<typeof gridItemVariants> {}
|
|
24
|
+
declare function GridItem({ className, render, colSpan, rowSpan, colStart, colEnd, rowStart, rowEnd, ...props }: GridItemProps): React$1.ReactElement;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Grid, GridItem, type GridItemProps, type GridProps, gridItemVariants, gridVariants };
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
//#region src/components/grid.tsx
|
|
7
|
+
const gridVariants = cva("grid", {
|
|
8
|
+
variants: {
|
|
9
|
+
columns: {
|
|
10
|
+
none: "grid-cols-none",
|
|
11
|
+
1: "grid-cols-1",
|
|
12
|
+
2: "grid-cols-2",
|
|
13
|
+
3: "grid-cols-3",
|
|
14
|
+
4: "grid-cols-4",
|
|
15
|
+
5: "grid-cols-5",
|
|
16
|
+
6: "grid-cols-6",
|
|
17
|
+
7: "grid-cols-7",
|
|
18
|
+
8: "grid-cols-8",
|
|
19
|
+
9: "grid-cols-9",
|
|
20
|
+
10: "grid-cols-10",
|
|
21
|
+
11: "grid-cols-11",
|
|
22
|
+
12: "grid-cols-12",
|
|
23
|
+
subgrid: "grid-cols-subgrid"
|
|
24
|
+
},
|
|
25
|
+
rows: {
|
|
26
|
+
none: "grid-rows-none",
|
|
27
|
+
1: "grid-rows-1",
|
|
28
|
+
2: "grid-rows-2",
|
|
29
|
+
3: "grid-rows-3",
|
|
30
|
+
4: "grid-rows-4",
|
|
31
|
+
5: "grid-rows-5",
|
|
32
|
+
6: "grid-rows-6",
|
|
33
|
+
7: "grid-rows-7",
|
|
34
|
+
8: "grid-rows-8",
|
|
35
|
+
9: "grid-rows-9",
|
|
36
|
+
10: "grid-rows-10",
|
|
37
|
+
11: "grid-rows-11",
|
|
38
|
+
12: "grid-rows-12",
|
|
39
|
+
subgrid: "grid-rows-subgrid"
|
|
40
|
+
},
|
|
41
|
+
flow: {
|
|
42
|
+
row: "grid-flow-row",
|
|
43
|
+
col: "grid-flow-col",
|
|
44
|
+
dense: "grid-flow-dense",
|
|
45
|
+
"row-dense": "grid-flow-row-dense",
|
|
46
|
+
"col-dense": "grid-flow-col-dense"
|
|
47
|
+
},
|
|
48
|
+
align: {
|
|
49
|
+
start: "items-start",
|
|
50
|
+
center: "items-center",
|
|
51
|
+
end: "items-end",
|
|
52
|
+
stretch: "items-stretch",
|
|
53
|
+
baseline: "items-baseline"
|
|
54
|
+
},
|
|
55
|
+
justify: {
|
|
56
|
+
start: "justify-items-start",
|
|
57
|
+
center: "justify-items-center",
|
|
58
|
+
end: "justify-items-end",
|
|
59
|
+
stretch: "justify-items-stretch",
|
|
60
|
+
between: "justify-between"
|
|
61
|
+
},
|
|
62
|
+
gap: {
|
|
63
|
+
none: "gap-0",
|
|
64
|
+
sm: "gap-3",
|
|
65
|
+
base: "gap-4 sm:gap-6",
|
|
66
|
+
md: "gap-6",
|
|
67
|
+
lg: "gap-8",
|
|
68
|
+
xl: "gap-12"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: { gap: "base" }
|
|
72
|
+
});
|
|
73
|
+
function Grid({ className, render, columns, rows, flow, align, justify, gap, ...props }) {
|
|
74
|
+
const defaultProps = {
|
|
75
|
+
className: cn(gridVariants({
|
|
76
|
+
columns,
|
|
77
|
+
rows,
|
|
78
|
+
flow,
|
|
79
|
+
align,
|
|
80
|
+
justify,
|
|
81
|
+
gap
|
|
82
|
+
}), className),
|
|
83
|
+
"data-slot": "grid"
|
|
84
|
+
};
|
|
85
|
+
return useRender({
|
|
86
|
+
defaultTagName: "div",
|
|
87
|
+
props: mergeProps(defaultProps, props),
|
|
88
|
+
render
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const gridItemVariants = cva("", { variants: {
|
|
92
|
+
colSpan: {
|
|
93
|
+
auto: "col-auto",
|
|
94
|
+
full: "col-span-full",
|
|
95
|
+
1: "col-span-1",
|
|
96
|
+
2: "col-span-2",
|
|
97
|
+
3: "col-span-3",
|
|
98
|
+
4: "col-span-4",
|
|
99
|
+
5: "col-span-5",
|
|
100
|
+
6: "col-span-6",
|
|
101
|
+
7: "col-span-7",
|
|
102
|
+
8: "col-span-8",
|
|
103
|
+
9: "col-span-9",
|
|
104
|
+
10: "col-span-10",
|
|
105
|
+
11: "col-span-11",
|
|
106
|
+
12: "col-span-12"
|
|
107
|
+
},
|
|
108
|
+
rowSpan: {
|
|
109
|
+
auto: "row-auto",
|
|
110
|
+
full: "row-span-full",
|
|
111
|
+
1: "row-span-1",
|
|
112
|
+
2: "row-span-2",
|
|
113
|
+
3: "row-span-3",
|
|
114
|
+
4: "row-span-4",
|
|
115
|
+
5: "row-span-5",
|
|
116
|
+
6: "row-span-6",
|
|
117
|
+
7: "row-span-7",
|
|
118
|
+
8: "row-span-8",
|
|
119
|
+
9: "row-span-9",
|
|
120
|
+
10: "row-span-10",
|
|
121
|
+
11: "row-span-11",
|
|
122
|
+
12: "row-span-12"
|
|
123
|
+
},
|
|
124
|
+
colStart: {
|
|
125
|
+
1: "col-start-1",
|
|
126
|
+
2: "col-start-2",
|
|
127
|
+
3: "col-start-3",
|
|
128
|
+
4: "col-start-4",
|
|
129
|
+
5: "col-start-5",
|
|
130
|
+
6: "col-start-6",
|
|
131
|
+
7: "col-start-7",
|
|
132
|
+
8: "col-start-8",
|
|
133
|
+
9: "col-start-9",
|
|
134
|
+
10: "col-start-10",
|
|
135
|
+
11: "col-start-11",
|
|
136
|
+
12: "col-start-12",
|
|
137
|
+
13: "col-start-13"
|
|
138
|
+
},
|
|
139
|
+
colEnd: {
|
|
140
|
+
1: "col-end-1",
|
|
141
|
+
2: "col-end-2",
|
|
142
|
+
3: "col-end-3",
|
|
143
|
+
4: "col-end-4",
|
|
144
|
+
5: "col-end-5",
|
|
145
|
+
6: "col-end-6",
|
|
146
|
+
7: "col-end-7",
|
|
147
|
+
8: "col-end-8",
|
|
148
|
+
9: "col-end-9",
|
|
149
|
+
10: "col-end-10",
|
|
150
|
+
11: "col-end-11",
|
|
151
|
+
12: "col-end-12",
|
|
152
|
+
13: "col-end-13"
|
|
153
|
+
},
|
|
154
|
+
rowStart: {
|
|
155
|
+
1: "row-start-1",
|
|
156
|
+
2: "row-start-2",
|
|
157
|
+
3: "row-start-3",
|
|
158
|
+
4: "row-start-4",
|
|
159
|
+
5: "row-start-5",
|
|
160
|
+
6: "row-start-6",
|
|
161
|
+
7: "row-start-7",
|
|
162
|
+
8: "row-start-8",
|
|
163
|
+
9: "row-start-9",
|
|
164
|
+
10: "row-start-10",
|
|
165
|
+
11: "row-start-11",
|
|
166
|
+
12: "row-start-12",
|
|
167
|
+
13: "row-start-13"
|
|
168
|
+
},
|
|
169
|
+
rowEnd: {
|
|
170
|
+
1: "row-end-1",
|
|
171
|
+
2: "row-end-2",
|
|
172
|
+
3: "row-end-3",
|
|
173
|
+
4: "row-end-4",
|
|
174
|
+
5: "row-end-5",
|
|
175
|
+
6: "row-end-6",
|
|
176
|
+
7: "row-end-7",
|
|
177
|
+
8: "row-end-8",
|
|
178
|
+
9: "row-end-9",
|
|
179
|
+
10: "row-end-10",
|
|
180
|
+
11: "row-end-11",
|
|
181
|
+
12: "row-end-12",
|
|
182
|
+
13: "row-end-13"
|
|
183
|
+
}
|
|
184
|
+
} });
|
|
185
|
+
function GridItem({ className, render, colSpan, rowSpan, colStart, colEnd, rowStart, rowEnd, ...props }) {
|
|
186
|
+
const defaultProps = {
|
|
187
|
+
className: cn(gridItemVariants({
|
|
188
|
+
colSpan,
|
|
189
|
+
rowSpan,
|
|
190
|
+
colStart,
|
|
191
|
+
colEnd,
|
|
192
|
+
rowStart,
|
|
193
|
+
rowEnd
|
|
194
|
+
}), className),
|
|
195
|
+
"data-slot": "grid-item"
|
|
196
|
+
};
|
|
197
|
+
return useRender({
|
|
198
|
+
defaultTagName: "div",
|
|
199
|
+
props: mergeProps(defaultProps, props),
|
|
200
|
+
render
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
export { Grid, GridItem, gridItemVariants, gridVariants };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Separator } from "./separator.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
//#region src/components/group.d.ts
|
|
6
|
+
declare const groupVariants: (props?: ({
|
|
7
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
declare function Group({ className, orientation, children, ...props }: {
|
|
10
|
+
className?: string;
|
|
11
|
+
orientation?: VariantProps<typeof groupVariants>["orientation"];
|
|
12
|
+
children: React$1.ReactNode;
|
|
13
|
+
} & React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
14
|
+
declare function GroupText({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
15
|
+
declare function GroupSeparator({ className, orientation, ...props }: {
|
|
16
|
+
className?: string;
|
|
17
|
+
} & React$1.ComponentProps<typeof Separator>): React$1.JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Group, GroupSeparator, GroupText, groupVariants };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Separator } from "./separator.js";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
//#region src/components/group.tsx
|
|
9
|
+
const groupVariants = cva("flex w-fit *:focus-visible:z-1 has-[>[data-slot=group]]:gap-2 *:has-focus-visible:z-1 dark:*:[[data-slot=button]:hover~[data-slot=separator]:not([data-slot]:hover~[data-slot=separator]~[data-slot=separator]),[data-slot][data-pressed]~[data-slot=separator]:not([data-slot][data-pressed]~[data-slot=separator]~[data-slot=separator])]:before:bg-input/64 dark:*:[[data-slot=separator]:has(~[data-slot=button]:hover):not(:has(~[data-slot=separator]~[data-slot]:hover)),[data-slot=separator]:has(~[data-slot][data-pressed]):not(:has(~[data-slot=separator]~[data-slot][data-pressed]))]:before:bg-input/64", {
|
|
10
|
+
defaultVariants: { orientation: "horizontal" },
|
|
11
|
+
variants: { orientation: {
|
|
12
|
+
horizontal: "*:[[data-slot]~[data-slot]:not([data-slot=separator])]:before:-start-[0.5px] *:data-slot:not-data-[slot=separator]:has-[~[data-slot]]:before:-end-[0.5px] *:pointer-coarse:after:min-w-auto *:data-slot:has-[~[data-slot]]:rounded-e-none *:data-slot:has-[~[data-slot]]:border-e-0 *:data-slot:has-[~[data-slot]]:before:rounded-e-none *:[[data-slot]~[data-slot]]:rounded-s-none *:[[data-slot]~[data-slot]]:border-s-0 *:[[data-slot]~[data-slot]]:before:rounded-s-none",
|
|
13
|
+
vertical: "*:[[data-slot]~[data-slot]:not([data-slot=separator])]:before:-top-[0.5px] *:data-slot:not-data-[slot=separator]:has-[~[data-slot]]:before:-bottom-[0.5px] flex-col *:pointer-coarse:after:min-h-auto *:data-slot:has-[~[data-slot]]:rounded-b-none *:data-slot:has-[~[data-slot]]:border-b-0 *:data-slot:not-data-[slot=separator]:has-[~[data-slot]]:before:hidden *:data-slot:has-[~[data-slot]]:before:rounded-b-none dark:*:last:before:hidden dark:*:first:before:block *:[[data-slot]~[data-slot]]:rounded-t-none *:[[data-slot]~[data-slot]]:border-t-0 *:[[data-slot]~[data-slot]]:before:rounded-t-none"
|
|
14
|
+
} }
|
|
15
|
+
});
|
|
16
|
+
function Group({ className, orientation, children, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: cn(groupVariants({ orientation }), className),
|
|
19
|
+
"data-orientation": orientation,
|
|
20
|
+
"data-slot": "group",
|
|
21
|
+
role: "group",
|
|
22
|
+
...props,
|
|
23
|
+
children
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function GroupText({ className, render, ...props }) {
|
|
27
|
+
const defaultProps = {
|
|
28
|
+
className: cn("relative inline-flex items-center whitespace-nowrap gap-2 rounded-lg border border-input bg-muted not-dark:bg-clip-padding px-[calc(--spacing(3)-1px)] text-muted-foreground text-base sm:text-sm shadow-xs/5 outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/6%)] dark:bg-input/64 dark:before:shadow-[0_-1px_--theme(--color-white/6%)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 [&_svg]:-mx-0.5", className),
|
|
29
|
+
"data-slot": "group-text"
|
|
30
|
+
};
|
|
31
|
+
return useRender({
|
|
32
|
+
defaultTagName: "div",
|
|
33
|
+
props: mergeProps(defaultProps, props),
|
|
34
|
+
render
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function GroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
39
|
+
className: cn("[[data-slot=input-control]:focus-within+&,[data-slot=input-group]:focus-within+&,[data-slot=select-trigger]:focus-visible+*+&,[data-slot=number-field]:focus-within+input+&]:-translate-x-px pointer-events-none relative z-2 bg-input before:absolute before:inset-0 has-[+[data-slot=input-control]:focus-within,+[data-slot=input-group]:focus-within,+[data-slot=select-trigger]:focus-visible+*,+[data-slot=number-field]:focus-within]:translate-x-px has-[+[data-slot=input-control]:focus-within,+[data-slot=input-group]:focus-within,+[data-slot=select-trigger]:focus-visible+*,+[data-slot=number-field]:focus-within]:bg-ring dark:before:bg-input/32 [[data-slot=input-control]:focus-within+&,[data-slot=input-group]:focus-within+&,[data-slot=select-trigger]:focus-visible+*+&,[data-slot=number-field]:focus-within+&,[data-slot=number-field]:focus-within+input+&]:bg-ring", className),
|
|
40
|
+
orientation,
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { Group, GroupSeparator, GroupText, groupVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputProps } from "./input.js";
|
|
2
|
+
import { TextareaProps } from "./textarea.js";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
//#region src/components/input-group.d.ts
|
|
6
|
+
declare function InputGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
7
|
+
export declare const inputGroupAddonVariants: (props?: ({
|
|
8
|
+
align?: "inline-start" | "block-end" | "block-start" | "inline-end" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
declare function InputGroupAddon({ className, align, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React$1.JSX.Element;
|
|
11
|
+
declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
12
|
+
declare function InputGroupInput({ className, ...props }: InputProps): React$1.JSX.Element;
|
|
13
|
+
declare function InputGroupTextarea({ className, ...props }: TextareaProps): React$1.JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Input } from "./input.js";
|
|
3
|
+
import { Textarea } from "./textarea.js";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/components/input-group.tsx
|
|
8
|
+
function InputGroup({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className: cn("relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]", className),
|
|
11
|
+
"data-slot": "input-group",
|
|
12
|
+
role: "group",
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const inputGroupAddonVariants = cva("[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80", {
|
|
17
|
+
defaultVariants: { align: "inline-start" },
|
|
18
|
+
variants: { align: {
|
|
19
|
+
"block-end": "order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
|
|
20
|
+
"block-start": "order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
|
|
21
|
+
"inline-end": "has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]",
|
|
22
|
+
"inline-start": "has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]"
|
|
23
|
+
} }
|
|
24
|
+
});
|
|
25
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
28
|
+
"data-align": align,
|
|
29
|
+
"data-slot": "input-group-addon",
|
|
30
|
+
onMouseDown: (e) => {
|
|
31
|
+
if (e.target.closest("button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']")) return;
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
const parent = e.currentTarget.parentElement;
|
|
34
|
+
const input = parent?.querySelector("input, textarea");
|
|
35
|
+
if (input && !parent?.querySelector("input:focus, textarea:focus")) input.focus();
|
|
36
|
+
},
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function InputGroupText({ className, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: cn("[&_svg]:-mx-0.5 line-clamp-1 flex items-center gap-2 text-muted-foreground leading-none in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className),
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function InputGroupInput({ className, ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
48
|
+
className: cn(className),
|
|
49
|
+
unstyled: true,
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(Textarea, {
|
|
55
|
+
className: cn(className),
|
|
56
|
+
unstyled: true,
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea, inputGroupAddonVariants };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { OTPField as OTPField$1 } from "@base-ui/react/otp-field";
|
|
4
|
+
//#region src/components/input-otp.d.ts
|
|
5
|
+
export interface InputOtpProps extends Omit<OTPField$1.Root.Props, "className"> {
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface InputOtpGroupProps extends useRender.ComponentProps<"div"> {}
|
|
9
|
+
export interface InputOtpInputProps extends Omit<OTPField$1.Input.Props, "className"> {
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface InputOtpSeparatorProps extends Omit<OTPField$1.Separator.Props, "className"> {
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function InputOtp({ className, ...props }: InputOtpProps): React$1.JSX.Element;
|
|
16
|
+
declare function InputOtpGroup({ className, render, ...props }: InputOtpGroupProps): React$1.ReactElement;
|
|
17
|
+
declare function InputOtpInput({ className, ...props }: InputOtpInputProps): React$1.JSX.Element;
|
|
18
|
+
declare function InputOtpSeparator({ className, children, ...props }: InputOtpSeparatorProps): React$1.JSX.Element;
|
|
19
|
+
declare const OTPField: typeof InputOtp;
|
|
20
|
+
declare const OTPFieldGroup: typeof InputOtpGroup;
|
|
21
|
+
declare const OTPFieldInput: typeof InputOtpInput;
|
|
22
|
+
declare const OTPFieldSeparator: typeof InputOtpSeparator;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { InputOtp, InputOtpGroup, InputOtpInput, InputOtpSeparator, OTPField, OTPFieldGroup, OTPFieldInput, OTPFieldSeparator };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
import { MinusSign } from "xiod-icons/icons/MinusSign";
|
|
7
|
+
import { OTPField as OTPField$1 } from "@base-ui/react/otp-field";
|
|
8
|
+
//#region src/components/input-otp.tsx
|
|
9
|
+
function InputOtp({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(OTPField$1.Root, {
|
|
11
|
+
className: cn("flex items-center gap-2 has-disabled:opacity-64", className),
|
|
12
|
+
"data-slot": "input-otp",
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function InputOtpGroup({ className, render, ...props }) {
|
|
17
|
+
const defaultProps = {
|
|
18
|
+
className: cn("flex items-center gap-2", className),
|
|
19
|
+
"data-slot": "input-otp-group"
|
|
20
|
+
};
|
|
21
|
+
return useRender({
|
|
22
|
+
defaultTagName: "div",
|
|
23
|
+
props: mergeProps(defaultProps, props),
|
|
24
|
+
render
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function InputOtpInput({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("span", {
|
|
29
|
+
className: cn("relative flex h-10 w-10 sm:h-9 sm:w-9 shrink-0 box-border items-center justify-center rounded-lg border border-input bg-background not-dark:bg-clip-padding text-center text-base sm:text-sm font-medium text-foreground shadow-xs/5 ring-ring/24 transition-shadow", "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] dark:bg-input/32", "not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", "has-focus-visible:border-ring has-focus-visible:ring-[3px]", "has-aria-invalid:border-destructive/36 has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 dark:has-aria-invalid:ring-destructive/24", "has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none", className),
|
|
30
|
+
"data-slot": "input-otp-input",
|
|
31
|
+
children: /* @__PURE__ */ jsx(OTPField$1.Input, {
|
|
32
|
+
className: "w-full h-full bg-transparent text-center font-inherit text-inherit outline-none caret-foreground placeholder:text-muted-foreground focus-visible:placeholder:text-muted-foreground/0",
|
|
33
|
+
...props
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function InputOtpSeparator({ className, children, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(OTPField$1.Separator, {
|
|
39
|
+
className: cn("flex items-center justify-center text-muted-foreground/64 [&_svg:not([class*='size-'])]:size-5 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
40
|
+
"data-slot": "input-otp-separator",
|
|
41
|
+
...props,
|
|
42
|
+
children: children || /* @__PURE__ */ jsx(MinusSign, { className: "h-5 w-5" })
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const OTPField = InputOtp;
|
|
46
|
+
const OTPFieldGroup = InputOtpGroup;
|
|
47
|
+
const OTPFieldInput = InputOtpInput;
|
|
48
|
+
const OTPFieldSeparator = InputOtpSeparator;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { InputOtp, InputOtpGroup, InputOtpInput, InputOtpSeparator, OTPField, OTPFieldGroup, OTPFieldInput, OTPFieldSeparator };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Tabs } from "./tabs.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import { Input } from "@base-ui/react/input";
|
|
5
|
+
//#region src/components/input-payment.d.ts
|
|
6
|
+
export type CardBrand = "visa" | "mastercard" | "amex" | "rupay" | "unionpay" | "discover" | "dinersclub" | "jcb" | "mir" | "unknown";
|
|
7
|
+
export interface CardCodeConfig {
|
|
8
|
+
name: string;
|
|
9
|
+
length: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CardTypeConfig {
|
|
12
|
+
displayName: string;
|
|
13
|
+
type: CardBrand;
|
|
14
|
+
startPattern: RegExp;
|
|
15
|
+
gaps: number[];
|
|
16
|
+
lengths: number[];
|
|
17
|
+
code: CardCodeConfig;
|
|
18
|
+
}
|
|
19
|
+
export declare const CARD_TYPES: CardTypeConfig[];
|
|
20
|
+
export declare const DEFAULT_CARD_TYPE: CardTypeConfig;
|
|
21
|
+
export declare function getCardTypeByValue(cardNumber: string): CardTypeConfig;
|
|
22
|
+
export declare function detectBrand(cardNumber: string): CardBrand;
|
|
23
|
+
export type PaymentMethod = "card" | "upi";
|
|
24
|
+
export type UpiProvider = "gpay" | "phonepe" | "paytm" | "amazonpay" | "bhim" | "cred" | "whatsapp" | "generic";
|
|
25
|
+
export declare function validateUpiId(vpa: string): boolean;
|
|
26
|
+
export declare function detectUpiProvider(vpa: string): UpiProvider;
|
|
27
|
+
export declare function getUpiError(vpa: string): string | undefined;
|
|
28
|
+
export declare function validateLuhn(cardNumber: string): boolean;
|
|
29
|
+
export declare function formatCardNumber(cardNumber: string, cardTypeConfig?: CardTypeConfig): string;
|
|
30
|
+
export declare function formatExpiry(value: string): string;
|
|
31
|
+
export interface PaymentInputErrors {
|
|
32
|
+
cardNumber?: string;
|
|
33
|
+
expiryDate?: string;
|
|
34
|
+
cvc?: string;
|
|
35
|
+
zip?: string;
|
|
36
|
+
upi?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function getCardNumberError(cardNumber: string): string | undefined;
|
|
39
|
+
export declare function getExpiryDateError(expiryDate: string): string | undefined;
|
|
40
|
+
export declare function getCvcError(cvc: string, cardTypeConfig?: CardTypeConfig): string | undefined;
|
|
41
|
+
export declare function getZipError(zip: string): string | undefined;
|
|
42
|
+
interface InputPaymentContextValue {
|
|
43
|
+
paymentMethod: PaymentMethod;
|
|
44
|
+
setPaymentMethod: (method: PaymentMethod) => void;
|
|
45
|
+
cardNumber: string;
|
|
46
|
+
cardExpiry: string;
|
|
47
|
+
cardCvc: string;
|
|
48
|
+
cardZip: string;
|
|
49
|
+
upiId: string;
|
|
50
|
+
brand: CardBrand;
|
|
51
|
+
cardType: CardTypeConfig;
|
|
52
|
+
upiProvider: UpiProvider;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
readOnly?: boolean;
|
|
55
|
+
isInGroup: boolean;
|
|
56
|
+
autoFocusNext: boolean;
|
|
57
|
+
isLuhnValid: boolean;
|
|
58
|
+
errors: PaymentInputErrors;
|
|
59
|
+
isValid: boolean;
|
|
60
|
+
cardNumberRef: React$1.RefObject<HTMLInputElement | null>;
|
|
61
|
+
expiryRef: React$1.RefObject<HTMLInputElement | null>;
|
|
62
|
+
cvcRef: React$1.RefObject<HTMLInputElement | null>;
|
|
63
|
+
zipRef: React$1.RefObject<HTMLInputElement | null>;
|
|
64
|
+
upiRef: React$1.RefObject<HTMLInputElement | null>;
|
|
65
|
+
setCardNumber: (val: string) => void;
|
|
66
|
+
setCardExpiry: (val: string) => void;
|
|
67
|
+
setCardCvc: (val: string) => void;
|
|
68
|
+
setCardZip: (val: string) => void;
|
|
69
|
+
setUpiId: (val: string) => void;
|
|
70
|
+
}
|
|
71
|
+
declare function useInputPaymentContext(): InputPaymentContextValue;
|
|
72
|
+
export declare const usePaymentInputContext: typeof useInputPaymentContext;
|
|
73
|
+
export declare const useInputPayment: typeof useInputPaymentContext;
|
|
74
|
+
export declare const usePaymentInput: typeof useInputPaymentContext;
|
|
75
|
+
export interface InputPaymentProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
76
|
+
paymentMethod?: PaymentMethod;
|
|
77
|
+
defaultPaymentMethod?: PaymentMethod;
|
|
78
|
+
onPaymentMethodChange?: (method: PaymentMethod) => void;
|
|
79
|
+
cardNumber?: string;
|
|
80
|
+
defaultCardNumber?: string;
|
|
81
|
+
onCardNumberChange?: (val: string) => void;
|
|
82
|
+
cardExpiry?: string;
|
|
83
|
+
defaultCardExpiry?: string;
|
|
84
|
+
onCardExpiryChange?: (val: string) => void;
|
|
85
|
+
cardCvc?: string;
|
|
86
|
+
defaultCardCvc?: string;
|
|
87
|
+
onCardCvcChange?: (val: string) => void;
|
|
88
|
+
cardZip?: string;
|
|
89
|
+
defaultCardZip?: string;
|
|
90
|
+
onCardZipChange?: (val: string) => void;
|
|
91
|
+
upiId?: string;
|
|
92
|
+
defaultUpiId?: string;
|
|
93
|
+
onUpiIdChange?: (val: string) => void;
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
readOnly?: boolean;
|
|
96
|
+
autoFocusNext?: boolean;
|
|
97
|
+
onValidationChange?: (isValid: boolean, errors: PaymentInputErrors) => void;
|
|
98
|
+
children?: React$1.ReactNode;
|
|
99
|
+
}
|
|
100
|
+
export type PaymentInputProps = InputPaymentProps;
|
|
101
|
+
declare function InputPayment({ paymentMethod: paymentMethodProp, defaultPaymentMethod, onPaymentMethodChange, cardNumber: cardNumberProp, defaultCardNumber, onCardNumberChange, cardExpiry: cardExpiryProp, defaultCardExpiry, onCardExpiryChange, cardCvc: cardCvcProp, defaultCardCvc, onCardCvcChange, cardZip: cardZipProp, defaultCardZip, onCardZipChange, upiId: upiIdProp, defaultUpiId, onUpiIdChange, disabled, readOnly, autoFocusNext, onValidationChange, children, ...props }: InputPaymentProps): React$1.JSX.Element;
|
|
102
|
+
declare function InputPaymentMethodSelector({ className, ...props }: React$1.ComponentProps<typeof Tabs>): React$1.JSX.Element;
|
|
103
|
+
declare function InputPaymentGroup({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
104
|
+
declare function InputPaymentUpiGroup({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
105
|
+
interface InputFieldProps extends Omit<React$1.ComponentProps<typeof Input>, "size" | "className" | "style" | "onChange" | "onKeyDown"> {
|
|
106
|
+
size?: "sm" | "default" | "lg" | number;
|
|
107
|
+
className?: string;
|
|
108
|
+
style?: React$1.CSSProperties;
|
|
109
|
+
onChange?: React$1.ChangeEventHandler<HTMLInputElement>;
|
|
110
|
+
onKeyDown?: React$1.KeyboardEventHandler<HTMLInputElement>;
|
|
111
|
+
}
|
|
112
|
+
declare function InputPaymentCardNumber({ className, size, onChange, ref, ...props }: InputFieldProps): React$1.JSX.Element;
|
|
113
|
+
declare function InputPaymentExpiry({ className, size, onChange, onKeyDown, ref, ...props }: InputFieldProps): React$1.JSX.Element;
|
|
114
|
+
declare function InputPaymentCVC({ className, size, onChange, onKeyDown, ref, ...props }: InputFieldProps): React$1.JSX.Element;
|
|
115
|
+
declare function InputPaymentZip({ className, size, onChange, onKeyDown, ref, ...props }: InputFieldProps): React$1.JSX.Element;
|
|
116
|
+
declare function InputPaymentUpiId({ className, size, onChange, ref, ...props }: InputFieldProps): React$1.JSX.Element;
|
|
117
|
+
declare function InputPaymentBrandIcon({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
118
|
+
declare function InputPaymentUpiProviderIcon({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
119
|
+
declare const PaymentInput: typeof InputPayment;
|
|
120
|
+
declare const PaymentInputGroup: typeof InputPaymentGroup;
|
|
121
|
+
declare const PaymentInputCardNumber: typeof InputPaymentCardNumber;
|
|
122
|
+
declare const PaymentInputExpiry: typeof InputPaymentExpiry;
|
|
123
|
+
declare const PaymentInputCVC: typeof InputPaymentCVC;
|
|
124
|
+
declare const PaymentInputZip: typeof InputPaymentZip;
|
|
125
|
+
declare const PaymentInputBrandIcon: typeof InputPaymentBrandIcon;
|
|
126
|
+
declare const PaymentInputUpiGroup: typeof InputPaymentUpiGroup;
|
|
127
|
+
declare const PaymentInputUpiId: typeof InputPaymentUpiId;
|
|
128
|
+
declare const PaymentInputUpiProviderIcon: typeof InputPaymentUpiProviderIcon;
|
|
129
|
+
declare const PaymentInputMethodSelector: typeof InputPaymentMethodSelector;
|
|
130
|
+
//#endregion
|
|
131
|
+
export { InputPayment, InputPaymentBrandIcon, InputPaymentCVC, InputPaymentCardNumber, InputPaymentExpiry, InputPaymentGroup, InputPaymentMethodSelector, InputPaymentUpiGroup, InputPaymentUpiId, InputPaymentUpiProviderIcon, InputPaymentZip, PaymentInput, PaymentInputBrandIcon, PaymentInputCVC, PaymentInputCardNumber, PaymentInputExpiry, PaymentInputGroup, PaymentInputMethodSelector, PaymentInputUpiGroup, PaymentInputUpiId, PaymentInputUpiProviderIcon, PaymentInputZip };
|