@loczer/storefront-sdk 0.153.0 → 0.155.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/components/BookingPeriodSelector/index.d.ts +1 -1
- package/dist/components/BookingPeriodSelector/index.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +25 -4
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +344 -192
- package/dist/components/Footer/businessHoursUtils.d.ts.map +1 -1
- package/dist/components/Footer/businessHoursUtils.js +16 -16
- package/dist/components/StorefrontCartPanel/index.d.ts +2 -1
- package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
- package/dist/components/StorefrontCartPanel/index.js +68 -63
- package/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +1 -0
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +1 -0
- package/dist/index.d.ts +78 -35
- package/dist/index.js +103 -100
- package/dist/lib/checkoutVerifyCoupon.d.ts +1 -0
- package/dist/lib/checkoutVerifyCoupon.d.ts.map +1 -1
- package/dist/lib/checkoutVerifyCoupon.js +1 -0
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +56 -51
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +2 -2
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.js +16 -14
- package/dist/storefront.css +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +17 -17
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +8 -11
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +52 -86
- package/dist/ui/radio-group.d.ts +10 -7
- package/dist/ui/radio-group.d.ts.map +1 -1
- package/dist/ui/radio-group.js +63 -45
- package/dist/ui/select.d.ts +29 -15
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +158 -232
- package/dist/ui/slot.d.ts +3 -7
- package/dist/ui/slot.d.ts.map +1 -1
- package/dist/ui/slot.js +47 -27
- package/dist/ui/theme.d.ts +9 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +24 -0
- package/dist/ui/tooltip.d.ts +30 -13
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +89 -60
- package/package.json +1 -1
package/dist/ui/button.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "link" | "secondary" | "outline" | "destructive" | "ghost" | null | undefined;
|
|
5
|
-
size?: "default" | "
|
|
5
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
asChild?: boolean;
|
package/dist/ui/button.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { cva as s } from "class-variance-authority";
|
|
4
|
+
import { cn as d } from "@rpcbase/ui";
|
|
5
5
|
import { Slot as u } from "./slot.js";
|
|
6
|
-
const
|
|
7
|
-
"inline-flex
|
|
6
|
+
const v = s(
|
|
7
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
12
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
13
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
14
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
16
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
11
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/90",
|
|
12
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 active:bg-destructive/90",
|
|
13
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground active:bg-accent active:text-accent-foreground",
|
|
14
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 active:bg-secondary/80",
|
|
15
|
+
ghost: "hover:bg-accent hover:text-accent-foreground active:bg-accent active:text-accent-foreground",
|
|
16
|
+
link: "text-primary underline-offset-4 hover:underline active:underline"
|
|
17
17
|
},
|
|
18
18
|
size: {
|
|
19
19
|
default: "h-10 px-4 py-2",
|
|
20
20
|
sm: "h-9 rounded-md px-3",
|
|
21
|
-
lg: "h-11 rounded-md px-8",
|
|
21
|
+
lg: "h-11 rounded-md px-8 transition active:scale-[0.98]",
|
|
22
22
|
icon: "h-10 w-10"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
@@ -27,11 +27,11 @@ const f = d(
|
|
|
27
27
|
size: "default"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
), g =
|
|
31
|
-
({ className: e, variant:
|
|
30
|
+
), g = c.forwardRef(
|
|
31
|
+
({ className: e, variant: t, size: r, asChild: o = !1, ...n }, i) => /* @__PURE__ */ a(
|
|
32
32
|
o ? u : "button",
|
|
33
33
|
{
|
|
34
|
-
className:
|
|
34
|
+
className: d(v({ variant: t, size: r, className: e })),
|
|
35
35
|
ref: i,
|
|
36
36
|
...n
|
|
37
37
|
}
|
|
@@ -40,5 +40,5 @@ const f = d(
|
|
|
40
40
|
g.displayName = "Button";
|
|
41
41
|
export {
|
|
42
42
|
g as Button,
|
|
43
|
-
|
|
43
|
+
v as buttonVariants
|
|
44
44
|
};
|
package/dist/ui/card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWjE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQtE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ5E;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQxE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWjE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQtE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ5E;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQxE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQvE;AAED,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,GACZ,CAAA"}
|
package/dist/ui/card.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cn as o } from "@rpcbase/ui";
|
|
3
|
-
function
|
|
3
|
+
function n({ className: t, ...r }) {
|
|
4
4
|
return /* @__PURE__ */ a(
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
7
|
"data-slot": "card",
|
|
8
8
|
className: o(
|
|
9
|
-
"bg-card text-card-foreground flex flex-col rounded-xl border
|
|
9
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
10
10
|
t
|
|
11
11
|
),
|
|
12
12
|
...r
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function s({ className: t, ...r }) {
|
|
17
17
|
return /* @__PURE__ */ a(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
20
|
"data-slot": "card-header",
|
|
21
21
|
className: o(
|
|
22
|
-
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5
|
|
22
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
23
23
|
t
|
|
24
24
|
),
|
|
25
25
|
...r
|
|
@@ -64,7 +64,7 @@ function u({ className: t, ...r }) {
|
|
|
64
64
|
"div",
|
|
65
65
|
{
|
|
66
66
|
"data-slot": "card-content",
|
|
67
|
-
className: o("
|
|
67
|
+
className: o("px-6", t),
|
|
68
68
|
...r
|
|
69
69
|
}
|
|
70
70
|
);
|
|
@@ -74,20 +74,17 @@ function f({ className: t, ...r }) {
|
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
76
|
"data-slot": "card-footer",
|
|
77
|
-
className: o(
|
|
78
|
-
"flex items-center p-6 pt-0 first:pt-6 [.border-t]:pt-6",
|
|
79
|
-
t
|
|
80
|
-
),
|
|
77
|
+
className: o("flex items-center px-6 [.border-t]:pt-6", t),
|
|
81
78
|
...r
|
|
82
79
|
}
|
|
83
80
|
);
|
|
84
81
|
}
|
|
85
82
|
export {
|
|
86
|
-
|
|
83
|
+
n as Card,
|
|
87
84
|
l as CardAction,
|
|
88
85
|
u as CardContent,
|
|
89
86
|
i as CardDescription,
|
|
90
87
|
f as CardFooter,
|
|
91
|
-
|
|
88
|
+
s as CardHeader,
|
|
92
89
|
c as CardTitle
|
|
93
90
|
};
|
package/dist/ui/form.d.ts
CHANGED
|
@@ -20,6 +20,6 @@ declare function FormItem({ className, ...props }: React.ComponentProps<"div">):
|
|
|
20
20
|
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
declare function FormMessage({ className,
|
|
23
|
+
declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element | null;
|
|
24
24
|
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
25
25
|
//# sourceMappingURL=form.d.ts.map
|
package/dist/ui/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/ui/form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAG7B,QAAA,MAAM,IAAI,0YAAe,CAAA;AAazB,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEG,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMxC,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;CAqBjB,CAAA;AAUD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/ui/form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAG7B,QAAA,MAAM,IAAI,0YAAe,CAAA;AAazB,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEG,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMxC,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;CAqBjB,CAAA;AAUD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAYrE;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,2CAYpC;AAED,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,2CAgBnE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAW1E;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,kDAkBtE;AAED,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAA"}
|
package/dist/ui/form.js
CHANGED
|
@@ -1,135 +1,101 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { FormProvider as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Label as
|
|
6
|
-
import { Slot as
|
|
7
|
-
const
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { FormProvider as f, Controller as u, useFormContext as F, useFormState as x } from "@rpcbase/form";
|
|
4
|
+
import { cn as a } from "@rpcbase/ui";
|
|
5
|
+
import { Label as I } from "./label.js";
|
|
6
|
+
import { Slot as g } from "./slot.js";
|
|
7
|
+
const S = f, c = s.createContext(
|
|
8
8
|
{}
|
|
9
|
-
),
|
|
9
|
+
), $ = ({
|
|
10
10
|
...e
|
|
11
|
-
}) => /* @__PURE__ */ m(
|
|
12
|
-
const e =
|
|
11
|
+
}) => /* @__PURE__ */ m(c.Provider, { value: { name: e.name }, children: /* @__PURE__ */ m(u, { ...e }) }), d = () => {
|
|
12
|
+
const e = s.useContext(c), t = s.useContext(l), { getFieldState: r } = F(), o = x({ name: e.name }), n = r(e.name, o);
|
|
13
13
|
if (!e)
|
|
14
14
|
throw new Error("useFormField should be used within <FormField>");
|
|
15
|
-
const { id:
|
|
15
|
+
const { id: i } = t;
|
|
16
16
|
return {
|
|
17
|
-
id:
|
|
17
|
+
id: i,
|
|
18
18
|
name: e.name,
|
|
19
|
-
formItemId: `${
|
|
20
|
-
formDescriptionId: `${
|
|
21
|
-
formMessageId: `${
|
|
22
|
-
...
|
|
19
|
+
formItemId: `${i}-form-item`,
|
|
20
|
+
formDescriptionId: `${i}-form-item-description`,
|
|
21
|
+
formMessageId: `${i}-form-item-message`,
|
|
22
|
+
...n
|
|
23
23
|
};
|
|
24
|
-
},
|
|
24
|
+
}, l = s.createContext(
|
|
25
25
|
{}
|
|
26
26
|
);
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
const o = n.current;
|
|
31
|
-
if (!o) return;
|
|
32
|
-
let r = 0;
|
|
33
|
-
const s = () => {
|
|
34
|
-
r && window.cancelAnimationFrame(r), r = window.requestAnimationFrame(() => {
|
|
35
|
-
const c = o.querySelector("[data-slot='form-control']");
|
|
36
|
-
if (!c) {
|
|
37
|
-
o.style.removeProperty("--form-message-top");
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
o.style.setProperty("--form-message-top", `${c.offsetTop + c.offsetHeight}px`);
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
s();
|
|
44
|
-
const a = typeof ResizeObserver > "u" ? null : new ResizeObserver(s);
|
|
45
|
-
a?.observe(o);
|
|
46
|
-
const l = typeof MutationObserver > "u" ? null : new MutationObserver(s);
|
|
47
|
-
return l?.observe(o, { childList: !0, subtree: !0 }), window.addEventListener("resize", s), () => {
|
|
48
|
-
r && window.cancelAnimationFrame(r), a?.disconnect(), l?.disconnect(), window.removeEventListener("resize", s);
|
|
49
|
-
};
|
|
50
|
-
}, []), /* @__PURE__ */ m(v.Provider, { value: { id: i }, children: /* @__PURE__ */ m(
|
|
27
|
+
function D({ className: e, ...t }) {
|
|
28
|
+
const r = s.useId();
|
|
29
|
+
return /* @__PURE__ */ m(l.Provider, { value: { id: r }, children: /* @__PURE__ */ m(
|
|
51
30
|
"div",
|
|
52
31
|
{
|
|
53
32
|
"data-slot": "form-item",
|
|
54
|
-
className:
|
|
55
|
-
...t
|
|
56
|
-
ref: n
|
|
33
|
+
className: a("grid gap-2", e),
|
|
34
|
+
...t
|
|
57
35
|
}
|
|
58
36
|
) });
|
|
59
37
|
}
|
|
60
|
-
function
|
|
38
|
+
function M({
|
|
61
39
|
className: e,
|
|
62
40
|
...t
|
|
63
41
|
}) {
|
|
64
|
-
const { error:
|
|
42
|
+
const { error: r, formItemId: o } = d();
|
|
65
43
|
return /* @__PURE__ */ m(
|
|
66
|
-
|
|
44
|
+
I,
|
|
67
45
|
{
|
|
68
46
|
"data-slot": "form-label",
|
|
69
|
-
"data-error": !!
|
|
70
|
-
className:
|
|
71
|
-
htmlFor:
|
|
47
|
+
"data-error": !!r,
|
|
48
|
+
className: a("data-[error=true]:text-destructive", e),
|
|
49
|
+
htmlFor: o,
|
|
72
50
|
...t
|
|
73
51
|
}
|
|
74
52
|
);
|
|
75
53
|
}
|
|
76
|
-
function
|
|
77
|
-
const { error: t, formItemId:
|
|
54
|
+
function N({ ...e }) {
|
|
55
|
+
const { error: t, formItemId: r, formDescriptionId: o, formMessageId: n } = d();
|
|
78
56
|
return /* @__PURE__ */ m(
|
|
79
|
-
|
|
57
|
+
g,
|
|
80
58
|
{
|
|
81
59
|
"data-slot": "form-control",
|
|
82
|
-
id:
|
|
83
|
-
"aria-describedby": t ? `${
|
|
60
|
+
id: r,
|
|
61
|
+
"aria-describedby": t ? `${o} ${n}` : `${o}`,
|
|
84
62
|
"aria-invalid": !!t,
|
|
85
63
|
...e
|
|
86
64
|
}
|
|
87
65
|
);
|
|
88
66
|
}
|
|
89
|
-
function
|
|
90
|
-
const { formDescriptionId:
|
|
67
|
+
function w({ className: e, ...t }) {
|
|
68
|
+
const { formDescriptionId: r } = d();
|
|
91
69
|
return /* @__PURE__ */ m(
|
|
92
70
|
"p",
|
|
93
71
|
{
|
|
94
72
|
"data-slot": "form-description",
|
|
95
|
-
id:
|
|
96
|
-
className:
|
|
73
|
+
id: r,
|
|
74
|
+
className: a("text-muted-foreground text-sm", e),
|
|
97
75
|
...t
|
|
98
76
|
}
|
|
99
77
|
);
|
|
100
78
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
style: i,
|
|
105
|
-
...n
|
|
106
|
-
}) {
|
|
107
|
-
const { error: o, formMessageId: r } = u(), s = o?.message ?? t, a = s != null && !(typeof s == "string" && s.trim().length === 0), l = e?.split(/\s+/).some((c) => c === "static" || c === "sr-only");
|
|
108
|
-
return /* @__PURE__ */ m(
|
|
79
|
+
function P({ className: e, ...t }) {
|
|
80
|
+
const { error: r, formMessageId: o } = d(), n = r ? String(r?.message ?? "") : t.children;
|
|
81
|
+
return n ? /* @__PURE__ */ m(
|
|
109
82
|
"p",
|
|
110
83
|
{
|
|
111
84
|
"data-slot": "form-message",
|
|
112
|
-
id:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
a && !l && "invisible translate-y-1 opacity-0 transition-[opacity,transform,visibility] duration-150 group-hover/form-item:visible group-hover/form-item:translate-y-0 group-hover/form-item:opacity-100 group-focus-within/form-item:visible group-focus-within/form-item:translate-y-0 group-focus-within/form-item:opacity-100",
|
|
117
|
-
!a && "invisible opacity-0",
|
|
118
|
-
e
|
|
119
|
-
),
|
|
120
|
-
style: { top: "var(--form-message-top, 100%)", ...i },
|
|
121
|
-
...n,
|
|
122
|
-
children: a ? s : null
|
|
85
|
+
id: o,
|
|
86
|
+
className: a("text-destructive text-sm", e),
|
|
87
|
+
...t,
|
|
88
|
+
children: n
|
|
123
89
|
}
|
|
124
|
-
);
|
|
90
|
+
) : null;
|
|
125
91
|
}
|
|
126
92
|
export {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
93
|
+
S as Form,
|
|
94
|
+
N as FormControl,
|
|
95
|
+
w as FormDescription,
|
|
96
|
+
$ as FormField,
|
|
97
|
+
D as FormItem,
|
|
98
|
+
M as FormLabel,
|
|
99
|
+
P as FormMessage,
|
|
100
|
+
d as useFormField
|
|
135
101
|
};
|
package/dist/ui/radio-group.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
2
|
-
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
3
1
|
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> & {
|
|
3
|
+
value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
name?: string;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "value" | "onChange"> & {
|
|
10
|
+
value: string;
|
|
11
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
9
12
|
export { RadioGroup, RadioGroupItem };
|
|
10
13
|
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../src/ui/radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../src/ui/radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAsB9B,QAAA,MAAM,UAAU;YAPN,MAAM;mBACC,MAAM;oBACL,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;eAC5B,OAAO;WACX,MAAM;wCAwDb,CAAA;AASF,QAAA,MAAM,cAAc;WAHX,MAAM;2CA4Cb,CAAA;AAEF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
|
package/dist/ui/radio-group.js
CHANGED
|
@@ -1,55 +1,73 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { CircleIcon as w } from "lucide-react";
|
|
4
|
+
import { cn as g } from "@rpcbase/ui";
|
|
5
|
+
const v = r.createContext(null), I = r.forwardRef(function({
|
|
6
|
+
className: d,
|
|
7
|
+
value: e,
|
|
8
|
+
defaultValue: c = "",
|
|
9
|
+
onValueChange: l,
|
|
10
|
+
disabled: u,
|
|
11
|
+
name: p,
|
|
12
|
+
children: o,
|
|
13
|
+
...t
|
|
14
|
+
}, a) {
|
|
15
|
+
const n = r.useId(), [R, x] = r.useState(c), b = e !== void 0, f = b ? e : R, m = r.useRef(f);
|
|
16
|
+
m.current = f;
|
|
17
|
+
const k = (s) => {
|
|
18
|
+
s !== m.current && (m.current = s, b || x(s), l?.(s));
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ i(
|
|
21
|
+
v.Provider,
|
|
13
22
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
value: {
|
|
24
|
+
value: f,
|
|
25
|
+
setValue: k,
|
|
26
|
+
name: p ?? n,
|
|
27
|
+
disabled: u
|
|
28
|
+
},
|
|
29
|
+
children: /* @__PURE__ */ i(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
ref: a,
|
|
33
|
+
role: "radiogroup",
|
|
34
|
+
"data-slot": "radio-group",
|
|
35
|
+
className: g("grid gap-3", d),
|
|
36
|
+
...t,
|
|
37
|
+
children: o
|
|
38
|
+
}
|
|
39
|
+
)
|
|
18
40
|
}
|
|
19
41
|
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
42
|
+
}), N = r.forwardRef(function({ className: d, value: e, disabled: c, onClick: l, ...u }, p) {
|
|
43
|
+
const o = r.useContext(v);
|
|
44
|
+
if (!o)
|
|
45
|
+
throw new Error("RadioGroupItem must be used within <RadioGroup>");
|
|
46
|
+
const t = o.value === e, a = c || o.disabled;
|
|
47
|
+
return /* @__PURE__ */ i(
|
|
48
|
+
"button",
|
|
27
49
|
{
|
|
50
|
+
ref: p,
|
|
51
|
+
type: "button",
|
|
52
|
+
role: "radio",
|
|
53
|
+
"aria-checked": t,
|
|
54
|
+
disabled: a,
|
|
28
55
|
"data-slot": "radio-group-item",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
56
|
+
"data-state": t ? "checked" : "unchecked",
|
|
57
|
+
value: e,
|
|
58
|
+
className: g(
|
|
59
|
+
"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
60
|
+
d
|
|
32
61
|
),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
...e,
|
|
41
|
-
children: /* @__PURE__ */ r(
|
|
42
|
-
t.Indicator,
|
|
43
|
-
{
|
|
44
|
-
"data-slot": "radio-group-indicator",
|
|
45
|
-
className: "absolute inset-0 flex items-center justify-center",
|
|
46
|
-
children: /* @__PURE__ */ r(s, { className: "size-2 fill-primary" })
|
|
47
|
-
}
|
|
48
|
-
)
|
|
62
|
+
onClick: (n) => {
|
|
63
|
+
l?.(n), !n.defaultPrevented && !a && o.setValue(e);
|
|
64
|
+
},
|
|
65
|
+
...u,
|
|
66
|
+
children: t ? /* @__PURE__ */ i("span", { "data-slot": "radio-group-indicator", className: "relative flex items-center justify-center", children: /* @__PURE__ */ i(w, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" }) }) : null
|
|
49
67
|
}
|
|
50
68
|
);
|
|
51
|
-
}
|
|
69
|
+
});
|
|
52
70
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
71
|
+
I as RadioGroup,
|
|
72
|
+
N as RadioGroupItem
|
|
55
73
|
};
|
package/dist/ui/select.d.ts
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
|
-
import { Select as SelectPrimitive } from '@base-ui/react/select';
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
type SelectProps
|
|
4
|
-
|
|
2
|
+
type SelectProps = {
|
|
3
|
+
value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
|
+
children?: React.ReactNode;
|
|
5
10
|
};
|
|
6
|
-
declare function Select
|
|
7
|
-
declare const SelectGroup: React.ForwardRefExoticComponent<
|
|
8
|
-
declare const SelectValue: React.ForwardRefExoticComponent<
|
|
9
|
-
|
|
11
|
+
declare function Select({ value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, children, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const SelectValue: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & {
|
|
14
|
+
placeholder?: React.ReactNode;
|
|
15
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
16
|
+
type SelectTriggerProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
17
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
18
|
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
11
19
|
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
declare const SelectContent: React.ForwardRefExoticComponent<
|
|
13
|
-
position?: "
|
|
20
|
+
declare const SelectContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
21
|
+
position?: "popper" | "item-aligned";
|
|
14
22
|
autoScroll?: "firstEnabled" | "firstEnabledWithContext";
|
|
15
|
-
footer?: React.ReactNode;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
23
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
-
declare const SelectLabel: React.ForwardRefExoticComponent<
|
|
19
|
-
declare const SelectItem: React.ForwardRefExoticComponent<
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const SelectItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
26
|
+
value: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const SelectItemText: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
declare const SelectItemIndicator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
31
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
declare const SelectIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
33
|
+
asChild?: boolean;
|
|
34
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
35
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectItemText, SelectItemIndicator, SelectSeparator, SelectIcon, SelectScrollUpButton, SelectScrollDownButton, };
|
|
22
36
|
//# sourceMappingURL=select.d.ts.map
|
package/dist/ui/select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/ui/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/ui/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAgB9B,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,WAAmB,EACnB,YAAY,EACZ,QAAQ,GACT,EAAE,WAAW,2CAab;AAED,QAAA,MAAM,WAAW,6GAEhB,CAAA;AAOD,QAAA,MAAM,WAAW;kBAHD,KAAK,CAAC,SAAS;yCAS9B,CAAA;AAGD,KAAK,kBAAkB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;AAEvE,QAAA,MAAM,aAAa,8FAgBlB,CAAA;AAGD,QAAA,MAAM,oBAAoB,6GAcxB,CAAA;AAGF,QAAA,MAAM,sBAAsB,6GAc1B,CAAA;AAQF,QAAA,MAAM,aAAa;eAJN,QAAQ,GAAG,cAAc;iBACvB,cAAc,GAAG,yBAAyB;wCAuCxD,CAAA;AAGD,QAAA,MAAM,WAAW,6GASf,CAAA;AAQF,QAAA,MAAM,UAAU;WAJP,MAAM;eACF,OAAO;wCAuBnB,CAAA;AAGD,QAAA,MAAM,cAAc,6GAGkD,CAAA;AAGtE,QAAA,MAAM,mBAAmB,+GAGkD,CAAA;AAG3E,QAAA,MAAM,eAAe,6GASnB,CAAA;AAGF,QAAA,MAAM,UAAU;cAEkC,OAAO;qCAIvD,CAAA;AAGF,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,sBAAsB,GACvB,CAAA"}
|