@bearmenu/ui 0.8.25 → 0.8.26
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/{chunk-VEGFQSZA.js → chunk-F3XK34DV.js} +8 -0
- package/dist/chunk-L3CDXVEP.js +56 -0
- package/dist/{chunk-CZK2MRS2.js → chunk-VEFKZIK6.js} +13 -3
- package/dist/components/banner.d.ts +36 -0
- package/dist/components/banner.js +29 -0
- package/dist/components/checkbox.d.ts +9 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/currency-input.js +1 -1
- package/dist/components/date-input.js +1 -1
- package/dist/components/event-detail-panel.js +1 -1
- package/dist/components/event-index-row.js +1 -1
- package/dist/components/event-list-row-wide.js +1 -1
- package/dist/components/event-list-row.js +1 -1
- package/dist/components/field.d.ts +15 -1
- package/dist/components/field.js +62 -21
- package/dist/components/input.d.ts +1 -0
- package/dist/components/input.js +1 -1
- package/dist/components/kitchen-dossier.js +1 -1
- package/dist/components/multi-select-combobox.js +1 -1
- package/dist/components/multi-select-menu.js +1 -1
- package/dist/components/place-card.js +1 -1
- package/dist/components/textarea.d.ts +10 -3
- package/dist/components/textarea.js +21 -6
- package/dist/components/toggle-group.js +5 -5
- package/dist/components/toggle.js +1 -1
- package/package.json +207 -23
- package/src/components/banner.stories.tsx +36 -0
- package/src/components/banner.tsx +58 -0
- package/src/components/booking-details-primitives.test.tsx +75 -0
- package/src/components/checkbox.tsx +49 -23
- package/src/components/field.stories.tsx +51 -1
- package/src/components/field.tsx +68 -9
- package/src/components/input.tsx +13 -2
- package/src/components/textarea.tsx +25 -7
- package/src/components/toggle-group.tsx +4 -4
- package/src/components/toggle.tsx +8 -0
- package/dist/chunk-NMEVJT5Q.js +0 -26
|
@@ -41,6 +41,14 @@ var toggleVariants = cva(
|
|
|
41
41
|
lg: "h-10 px-2.5 min-w-10"
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
+
// Chips and tabs size to their type. Restated here, after the size
|
|
45
|
+
// variants, so the default size's `h-9 px-2 min-w-9` never wins the
|
|
46
|
+
// merge — for a `Toggle`, a `ToggleGroupItem` or a bare `toggleVariants`
|
|
47
|
+
// call on another element alike.
|
|
48
|
+
compoundVariants: [
|
|
49
|
+
{ variant: "chip", class: "h-auto min-w-0 px-[13px]" },
|
|
50
|
+
{ variant: "tab", class: "h-auto min-w-0 px-3" }
|
|
51
|
+
],
|
|
44
52
|
defaultVariants: {
|
|
45
53
|
variant: "default",
|
|
46
54
|
size: "default"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn } from './chunk-FEK5XGZW.js';
|
|
2
|
+
import { __objRest, __spreadProps, __spreadValues } from './chunk-MMUBH76A.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { Minus, Check } from 'lucide-react';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var checkboxVariants = cva(
|
|
10
|
+
"peer size-5 shrink-0 rounded-md border border-border bg-background transition-all duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary hover:border-primary/50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/40",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
/**
|
|
14
|
+
* The booking flow's opt-in ("Save these details for next time",
|
|
15
|
+
* booking flow.html): a 17px box with a 5px radius, a hairline on the
|
|
16
|
+
* soft ground when off, the brand gradient with an 11px white check
|
|
17
|
+
* when on.
|
|
18
|
+
*/
|
|
19
|
+
appearance: {
|
|
20
|
+
default: "",
|
|
21
|
+
booking: "size-[17px] rounded-[5px] bg-surface-2 data-[state=checked]:border-transparent data-[state=checked]:bg-[image:var(--gradient-primary)] data-[state=checked]:text-white [&_svg]:size-[11px]"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: { appearance: "default" }
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
var Checkbox = React.forwardRef(
|
|
28
|
+
(_a, ref) => {
|
|
29
|
+
var _b = _a, { className, appearance } = _b, props = __objRest(_b, ["className", "appearance"]);
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
CheckboxPrimitive.Root,
|
|
32
|
+
__spreadProps(__spreadValues({
|
|
33
|
+
ref,
|
|
34
|
+
"data-slot": "checkbox",
|
|
35
|
+
className: cn(checkboxVariants({ appearance }), className)
|
|
36
|
+
}, props), {
|
|
37
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: props.checked === "indeterminate" ? /* @__PURE__ */ jsx(
|
|
38
|
+
Minus,
|
|
39
|
+
{
|
|
40
|
+
className: "size-3.5 animate-in fade-in-0 zoom-in-50 duration-200 ease-out",
|
|
41
|
+
strokeWidth: 3
|
|
42
|
+
}
|
|
43
|
+
) : /* @__PURE__ */ jsx(
|
|
44
|
+
Check,
|
|
45
|
+
{
|
|
46
|
+
className: "size-3.5 animate-in fade-in-0 zoom-in-50 duration-200 ease-out",
|
|
47
|
+
strokeWidth: 3
|
|
48
|
+
}
|
|
49
|
+
) })
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
55
|
+
|
|
56
|
+
export { Checkbox, checkboxVariants };
|
|
@@ -16,23 +16,33 @@ var inputVariants = cva(
|
|
|
16
16
|
shape: {
|
|
17
17
|
rounded: "rounded-xl focus-visible:ring-ring",
|
|
18
18
|
pill: "rounded-full bg-background shadow-[var(--shadow-card)] focus-visible:ring-accent/30"
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* The booking flow's field (booking flow.html, `.in`): 46px on the card
|
|
22
|
+
* ground rather than the input wash, an 11px radius, 13px inset, 14px
|
|
23
|
+
* type. Last, so it wins over the size and shape it restates.
|
|
24
|
+
*/
|
|
25
|
+
appearance: {
|
|
26
|
+
default: "",
|
|
27
|
+
booking: "h-[46px] rounded-[11px] bg-card px-[13px] py-0 text-[14px] leading-[1.2] focus-visible:bg-card focus-visible:ring-ring aria-invalid:border-[oklch(0.52_0.16_25)] dark:aria-invalid:border-destructive"
|
|
19
28
|
}
|
|
20
29
|
},
|
|
21
30
|
defaultVariants: {
|
|
22
31
|
size: "default",
|
|
23
|
-
shape: "rounded"
|
|
32
|
+
shape: "rounded",
|
|
33
|
+
appearance: "default"
|
|
24
34
|
}
|
|
25
35
|
}
|
|
26
36
|
);
|
|
27
37
|
var Input = React.forwardRef(
|
|
28
38
|
(_a, ref) => {
|
|
29
|
-
var _b = _a, { className, type, size, shape } = _b, props = __objRest(_b, ["className", "type", "size", "shape"]);
|
|
39
|
+
var _b = _a, { className, type, size, shape, appearance } = _b, props = __objRest(_b, ["className", "type", "size", "shape", "appearance"]);
|
|
30
40
|
return /* @__PURE__ */ jsx(
|
|
31
41
|
"input",
|
|
32
42
|
__spreadValues({
|
|
33
43
|
type,
|
|
34
44
|
"data-slot": "input",
|
|
35
|
-
className: cn(inputVariants({ size, shape }), className),
|
|
45
|
+
className: cn(inputVariants({ size, shape, appearance }), className),
|
|
36
46
|
ref
|
|
37
47
|
}, props)
|
|
38
48
|
);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Banner — a short inline note inside a flow, not a page-level alert: the
|
|
8
|
+
* booking flow's "19:30 just went" when a time is taken mid-form, "No table
|
|
9
|
+
* was booked" when a confirm fails, "This venue does not take bookings"
|
|
10
|
+
* (booking flow.html, `.bnr`).
|
|
11
|
+
*
|
|
12
|
+
* Not `Alert`: that one is a bordered card for page-level status with a
|
|
13
|
+
* pinned icon column. This is borderless, sits in the flow of a form, and
|
|
14
|
+
* reads as part of the screen — a soft ground, an optional 16px icon, an
|
|
15
|
+
* optional bold title over the body.
|
|
16
|
+
*
|
|
17
|
+
* Measured from the design: 12px radius, 12px × 14px inset, 10px between
|
|
18
|
+
* icon and text; the title at 13px bold, the body at 12.5px (90% in the
|
|
19
|
+
* warning tone), both at 1.5 leading.
|
|
20
|
+
* - `info`: the soft surface and the secondary ink.
|
|
21
|
+
* - `warning`: a 16% amber wash with the design's amber ink — darker than
|
|
22
|
+
* the solid `--warning`, which falls short of AA on its own wash at this
|
|
23
|
+
* size; dark mode uses the lifted token.
|
|
24
|
+
*/
|
|
25
|
+
declare const bannerVariants: (props?: ({
|
|
26
|
+
tone?: "warning" | "info" | null | undefined;
|
|
27
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
28
|
+
type BannerProps = Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & VariantProps<typeof bannerVariants> & {
|
|
29
|
+
/** A lucide icon, drawn at 16px beside the text. */
|
|
30
|
+
icon?: React.ReactNode;
|
|
31
|
+
/** The bold first line — "19:30 just went". */
|
|
32
|
+
title?: React.ReactNode;
|
|
33
|
+
};
|
|
34
|
+
declare function Banner({ tone, icon, title, className, children, ...props }: BannerProps): react_jsx_runtime.JSX.Element;
|
|
35
|
+
|
|
36
|
+
export { Banner, type BannerProps, bannerVariants };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
+
import { __objRest, __spreadProps, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var bannerVariants = cva(
|
|
7
|
+
"flex gap-2.5 rounded-xl px-3.5 py-3 text-[12.5px] leading-normal [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
tone: {
|
|
11
|
+
info: "bg-surface-2 text-ink-secondary",
|
|
12
|
+
warning: "bg-[oklch(0.62_0.15_70/0.16)] text-[oklch(0.42_0.1_70)] dark:bg-warning/15 dark:text-warning"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: { tone: "info" }
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
function Banner(_a) {
|
|
19
|
+
var _b = _a, { tone, icon, title, className, children } = _b, props = __objRest(_b, ["tone", "icon", "title", "className", "children"]);
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({ "data-slot": "banner", className: cn(bannerVariants({ tone }), className) }, props), { children: [
|
|
21
|
+
icon,
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
23
|
+
title ? /* @__PURE__ */ jsx("b", { className: "block text-[13px] font-bold", children: title }) : null,
|
|
24
|
+
/* @__PURE__ */ jsx("div", { className: cn(tone === "warning" && title ? "opacity-90" : void 0), children })
|
|
25
|
+
] })
|
|
26
|
+
] }));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Banner, bannerVariants };
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
5
|
|
|
4
|
-
declare const
|
|
6
|
+
declare const checkboxVariants: (props?: ({
|
|
7
|
+
appearance?: "default" | "booking" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
10
|
+
appearance?: "default" | "booking" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
12
|
|
|
6
|
-
export { Checkbox };
|
|
13
|
+
export { Checkbox, checkboxVariants };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveEventEntryFee } from '../chunk-DNSXMHYX.js';
|
|
2
|
-
import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
|
|
3
2
|
import { Separator } from '../chunk-NWZGSLPU.js';
|
|
3
|
+
import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
|
|
4
4
|
import { Skeleton } from '../chunk-XBBEX4SF.js';
|
|
5
5
|
import { Button } from '../chunk-5HHRVJOT.js';
|
|
6
6
|
import '../chunk-RIH2IS7X.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TagGroup } from '../chunk-PX6RICS5.js';
|
|
2
2
|
import { Tag } from '../chunk-MWB7S54O.js';
|
|
3
|
-
import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
|
|
4
3
|
import { Separator } from '../chunk-NWZGSLPU.js';
|
|
4
|
+
import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
|
|
5
5
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
6
6
|
import { __objRest, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
7
7
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveEventEntryFee } from '../chunk-DNSXMHYX.js';
|
|
2
2
|
import { Tag } from '../chunk-MWB7S54O.js';
|
|
3
|
-
import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
|
|
4
3
|
import { Separator } from '../chunk-NWZGSLPU.js';
|
|
4
|
+
import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
|
|
5
5
|
import { Skeleton } from '../chunk-XBBEX4SF.js';
|
|
6
6
|
import { buttonVariants } from '../chunk-5HHRVJOT.js';
|
|
7
7
|
import '../chunk-RIH2IS7X.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TagGroup } from '../chunk-PX6RICS5.js';
|
|
2
2
|
import { resolveEventEntryFee } from '../chunk-DNSXMHYX.js';
|
|
3
3
|
import { Tag } from '../chunk-MWB7S54O.js';
|
|
4
|
-
import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
|
|
5
4
|
import { Separator } from '../chunk-NWZGSLPU.js';
|
|
5
|
+
import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
|
|
6
6
|
import { Skeleton } from '../chunk-XBBEX4SF.js';
|
|
7
7
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
8
8
|
import { __objRest, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
import * as class_variance_authority from 'class-variance-authority';
|
|
3
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
5
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* `booking` — the booking flow's fields (booking flow.html, `.fld`): the
|
|
10
|
+
* label a 10.5px uppercase caption in the muted ink that stays muted when
|
|
11
|
+
* the field is invalid (the hairline and the line under it carry the error),
|
|
12
|
+
* the error at 11.5px, 5px between label, control and error.
|
|
13
|
+
*/
|
|
14
|
+
type FieldAppearance = "default" | "booking";
|
|
7
15
|
declare const Field: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
16
|
/** Field id. Auto-generated if omitted. */
|
|
9
17
|
id?: string;
|
|
@@ -11,12 +19,18 @@ declare const Field: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDi
|
|
|
11
19
|
invalid?: boolean;
|
|
12
20
|
/** Lay out content horizontally instead of stacked. */
|
|
13
21
|
orientation?: "vertical" | "horizontal";
|
|
22
|
+
appearance?: FieldAppearance;
|
|
14
23
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
24
|
declare const FieldLabel: React.ForwardRefExoticComponent<Omit<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & class_variance_authority.VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
25
|
+
/**
|
|
26
|
+
* "(optional)" after a label's text — sentence case, regular weight, a
|
|
27
|
+
* shade quieter than the label (booking flow.html's EMAIL (optional)).
|
|
28
|
+
*/
|
|
29
|
+
declare function FieldOptional({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
|
|
16
30
|
declare const FieldControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
17
31
|
declare const FieldDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
18
32
|
declare const FieldError: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
33
|
declare const FieldSet: React.ForwardRefExoticComponent<React.FieldsetHTMLAttributes<HTMLFieldSetElement> & React.RefAttributes<HTMLFieldSetElement>>;
|
|
20
34
|
declare const FieldLegend: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLLegendElement> & React.RefAttributes<HTMLLegendElement>>;
|
|
21
35
|
|
|
22
|
-
export { Field, FieldControl, FieldDescription, FieldError, FieldLabel, FieldLegend, FieldSet };
|
|
36
|
+
export { Field, FieldControl, FieldDescription, FieldError, FieldLabel, FieldLegend, FieldOptional, FieldSet };
|
package/dist/components/field.js
CHANGED
|
@@ -5,46 +5,80 @@ import * as React from 'react';
|
|
|
5
5
|
import { Slot } from '@radix-ui/react-slot';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
var FieldContext = React.createContext({ id: "", descriptionId: "", errorId: "", hasError: false });
|
|
8
|
+
var FieldContext = React.createContext({ id: "", descriptionId: "", errorId: "", hasError: false, appearance: "default" });
|
|
9
9
|
var Field = React.forwardRef(
|
|
10
10
|
(_a, ref) => {
|
|
11
|
-
var _b = _a, {
|
|
11
|
+
var _b = _a, {
|
|
12
|
+
id: providedId,
|
|
13
|
+
invalid,
|
|
14
|
+
orientation = "vertical",
|
|
15
|
+
appearance = "default",
|
|
16
|
+
className,
|
|
17
|
+
children
|
|
18
|
+
} = _b, props = __objRest(_b, [
|
|
19
|
+
"id",
|
|
20
|
+
"invalid",
|
|
21
|
+
"orientation",
|
|
22
|
+
"appearance",
|
|
23
|
+
"className",
|
|
24
|
+
"children"
|
|
25
|
+
]);
|
|
12
26
|
const generatedId = React.useId();
|
|
13
27
|
const id = providedId != null ? providedId : generatedId;
|
|
14
28
|
const descriptionId = `${id}-description`;
|
|
15
29
|
const errorId = `${id}-error`;
|
|
16
|
-
return /* @__PURE__ */ jsx(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
FieldContext.Provider,
|
|
32
|
+
{
|
|
33
|
+
value: { id, descriptionId, errorId, hasError: !!invalid, appearance },
|
|
34
|
+
children: /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
__spreadProps(__spreadValues({
|
|
37
|
+
ref,
|
|
38
|
+
"data-slot": "field",
|
|
39
|
+
"data-invalid": invalid || void 0,
|
|
40
|
+
className: cn(
|
|
41
|
+
"flex",
|
|
42
|
+
appearance === "booking" ? "gap-[5px]" : "gap-2",
|
|
43
|
+
orientation === "vertical" ? "flex-col" : "flex-row items-center",
|
|
44
|
+
className
|
|
45
|
+
)
|
|
46
|
+
}, props), {
|
|
47
|
+
children
|
|
48
|
+
})
|
|
26
49
|
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
})
|
|
30
|
-
) });
|
|
50
|
+
}
|
|
51
|
+
);
|
|
31
52
|
}
|
|
32
53
|
);
|
|
33
54
|
Field.displayName = "Field";
|
|
34
55
|
var FieldLabel = React.forwardRef((_a, ref) => {
|
|
35
56
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
36
|
-
const { id, hasError } = React.useContext(FieldContext);
|
|
57
|
+
const { id, hasError, appearance } = React.useContext(FieldContext);
|
|
37
58
|
return /* @__PURE__ */ jsx(
|
|
38
59
|
Label,
|
|
39
60
|
__spreadValues({
|
|
40
61
|
ref,
|
|
41
62
|
"data-slot": "field-label",
|
|
42
63
|
htmlFor: id,
|
|
43
|
-
className: cn(
|
|
64
|
+
className: cn(
|
|
65
|
+
appearance === "booking" ? "text-[10.5px] leading-[1.2] font-semibold tracking-[0.04em] text-muted-foreground uppercase" : hasError && "text-destructive",
|
|
66
|
+
className
|
|
67
|
+
)
|
|
44
68
|
}, props)
|
|
45
69
|
);
|
|
46
70
|
});
|
|
47
71
|
FieldLabel.displayName = "FieldLabel";
|
|
72
|
+
function FieldOptional(_a) {
|
|
73
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
74
|
+
return /* @__PURE__ */ jsx(
|
|
75
|
+
"span",
|
|
76
|
+
__spreadValues({
|
|
77
|
+
"data-slot": "field-optional",
|
|
78
|
+
className: cn("font-normal normal-case opacity-70", className)
|
|
79
|
+
}, props)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
48
82
|
var FieldControl = React.forwardRef(
|
|
49
83
|
(_a, ref) => {
|
|
50
84
|
var props = __objRest(_a, []);
|
|
@@ -81,7 +115,7 @@ FieldDescription.displayName = "FieldDescription";
|
|
|
81
115
|
var FieldError = React.forwardRef(
|
|
82
116
|
(_a, ref) => {
|
|
83
117
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
84
|
-
const { errorId, hasError } = React.useContext(FieldContext);
|
|
118
|
+
const { errorId, hasError, appearance } = React.useContext(FieldContext);
|
|
85
119
|
if (!hasError || !children) return null;
|
|
86
120
|
return /* @__PURE__ */ jsx(
|
|
87
121
|
"p",
|
|
@@ -90,7 +124,14 @@ var FieldError = React.forwardRef(
|
|
|
90
124
|
id: errorId,
|
|
91
125
|
role: "alert",
|
|
92
126
|
"data-slot": "field-error",
|
|
93
|
-
className: cn(
|
|
127
|
+
className: cn(
|
|
128
|
+
appearance === "booking" ? (
|
|
129
|
+
// The design's error ink: the solid token is too bright for AA
|
|
130
|
+
// at 11.5px on white; dark mode's lifted token already clears it.
|
|
131
|
+
"m-0 text-[11.5px] leading-[1.2] text-[oklch(0.52_0.16_25)] dark:text-destructive"
|
|
132
|
+
) : "text-sm text-destructive",
|
|
133
|
+
className
|
|
134
|
+
)
|
|
94
135
|
}, props), {
|
|
95
136
|
children
|
|
96
137
|
})
|
|
@@ -127,4 +168,4 @@ var FieldLegend = React.forwardRef(
|
|
|
127
168
|
);
|
|
128
169
|
FieldLegend.displayName = "FieldLegend";
|
|
129
170
|
|
|
130
|
-
export { Field, FieldControl, FieldDescription, FieldError, FieldLabel, FieldLegend, FieldSet };
|
|
171
|
+
export { Field, FieldControl, FieldDescription, FieldError, FieldLabel, FieldLegend, FieldOptional, FieldSet };
|
|
@@ -5,6 +5,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
declare const inputVariants: (props?: ({
|
|
6
6
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
7
|
shape?: "pill" | "rounded" | null | undefined;
|
|
8
|
+
appearance?: "default" | "booking" | null | undefined;
|
|
8
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
10
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof inputVariants> {
|
|
10
11
|
}
|
package/dist/components/input.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VenueQuotes } from '../chunk-43RC7MHY.js';
|
|
2
1
|
import { DIMENSION_ORDER, VenueGradeDimensions } from '../chunk-ZQ53AGML.js';
|
|
2
|
+
import { VenueQuotes } from '../chunk-43RC7MHY.js';
|
|
3
3
|
import { StoryProvider, StorySegments, StoryPanel } from '../chunk-F6FMZJDG.js';
|
|
4
4
|
import { GlassGround } from '../chunk-ICOU5QHT.js';
|
|
5
5
|
import { Separator } from '../chunk-NWZGSLPU.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Checkbox } from '../chunk-L3CDXVEP.js';
|
|
1
2
|
import { Popover, PopoverTrigger, PopoverContent } from '../chunk-2ADCZXZJ.js';
|
|
2
3
|
import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from '../chunk-MCOHLWRS.js';
|
|
3
4
|
import '../chunk-PDTPO6NG.js';
|
|
4
|
-
import { Checkbox } from '../chunk-NMEVJT5Q.js';
|
|
5
5
|
import { Button } from '../chunk-5HHRVJOT.js';
|
|
6
6
|
import '../chunk-RIH2IS7X.js';
|
|
7
7
|
import '../chunk-5YNIQ2BL.js';
|
|
@@ -3,8 +3,8 @@ import { HOVER_IMAGE_MOTION, HOVER_IMAGE_WRAPPER, HOVER_MOTION, HOVER_LIFT_GRID_
|
|
|
3
3
|
import { NEUTRAL_ICON_FILTER } from '../chunk-LQWGZIYA.js';
|
|
4
4
|
import { GradeAtom } from '../chunk-YE4ZQUTI.js';
|
|
5
5
|
import { showsGradeAtom } from '../chunk-I5V446BX.js';
|
|
6
|
-
import { springSnappy } from '../chunk-OIV7B44M.js';
|
|
7
6
|
import { Separator } from '../chunk-NWZGSLPU.js';
|
|
7
|
+
import { springSnappy } from '../chunk-OIV7B44M.js';
|
|
8
8
|
import { Skeleton } from '../chunk-XBBEX4SF.js';
|
|
9
9
|
import { Badge } from '../chunk-IEIJP73R.js';
|
|
10
10
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
1
2
|
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
declare const textareaVariants: (props?: ({
|
|
6
|
+
appearance?: "default" | "booking" | null | undefined;
|
|
7
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
|
+
type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & VariantProps<typeof textareaVariants>;
|
|
9
|
+
declare const Textarea: React.ForwardRefExoticComponent<React.TextareaHTMLAttributes<HTMLTextAreaElement> & VariantProps<(props?: ({
|
|
10
|
+
appearance?: "default" | "booking" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
5
12
|
|
|
6
|
-
export { Textarea, type TextareaProps };
|
|
13
|
+
export { Textarea, type TextareaProps, textareaVariants };
|
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
2
|
import { __objRest, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
4
5
|
import { jsx } from 'react/jsx-runtime';
|
|
5
6
|
|
|
7
|
+
var textareaVariants = cva(
|
|
8
|
+
"flex min-h-20 w-full rounded-xl border border-border bg-input/50 px-4 py-3 text-base transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:bg-input disabled:cursor-not-allowed disabled:opacity-50 resize-y aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/40",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
/**
|
|
12
|
+
* The booking flow's note field (booking flow.html, `.in.ta`): the
|
|
13
|
+
* `Input` booking appearance's ground, radius and type, 66px tall with
|
|
14
|
+
* a 12px × 13px inset.
|
|
15
|
+
*/
|
|
16
|
+
appearance: {
|
|
17
|
+
default: "",
|
|
18
|
+
booking: "min-h-[66px] rounded-[11px] bg-card px-[13px] py-3 text-[14px] leading-[1.4] focus-visible:bg-card aria-invalid:border-[oklch(0.52_0.16_25)] dark:aria-invalid:border-destructive"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: { appearance: "default" }
|
|
22
|
+
}
|
|
23
|
+
);
|
|
6
24
|
var Textarea = React.forwardRef(
|
|
7
25
|
(_a, ref) => {
|
|
8
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
26
|
+
var _b = _a, { className, appearance } = _b, props = __objRest(_b, ["className", "appearance"]);
|
|
9
27
|
return /* @__PURE__ */ jsx(
|
|
10
28
|
"textarea",
|
|
11
29
|
__spreadValues({
|
|
12
30
|
"data-slot": "textarea",
|
|
13
|
-
className: cn(
|
|
14
|
-
"flex min-h-20 w-full rounded-xl border border-border bg-input/50 px-4 py-3 text-base transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:bg-input disabled:cursor-not-allowed disabled:opacity-50 resize-y aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/40",
|
|
15
|
-
className
|
|
16
|
-
),
|
|
31
|
+
className: cn(textareaVariants({ appearance }), className),
|
|
17
32
|
ref
|
|
18
33
|
}, props)
|
|
19
34
|
);
|
|
@@ -21,4 +36,4 @@ var Textarea = React.forwardRef(
|
|
|
21
36
|
);
|
|
22
37
|
Textarea.displayName = "Textarea";
|
|
23
38
|
|
|
24
|
-
export { Textarea };
|
|
39
|
+
export { Textarea, textareaVariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toggleVariants } from '../chunk-
|
|
1
|
+
import { toggleVariants } from '../chunk-F3XK34DV.js';
|
|
2
2
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
3
3
|
import { __objRest, __spreadProps, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -72,11 +72,11 @@ function ToggleGroupItem(_a) {
|
|
|
72
72
|
}),
|
|
73
73
|
"min-w-0 flex-1 shrink-0 shadow-none focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
|
|
74
74
|
resolved === "segmented" ? "rounded-full px-0 data-[state=on]:shadow-[var(--shadow-card)]" : (
|
|
75
|
-
// Tabs and chips size
|
|
76
|
-
//
|
|
77
|
-
resolved === "tab" ? "
|
|
75
|
+
// Tabs and chips size themselves (`toggleVariants`' compounds);
|
|
76
|
+
// the item's own rounding must not square them off.
|
|
77
|
+
resolved === "tab" ? "rounded-full" : resolved === "chip" ? (
|
|
78
78
|
// A chip keeps its own width, so the row can wrap.
|
|
79
|
-
"
|
|
79
|
+
"flex-none rounded-full"
|
|
80
80
|
) : "rounded-none first:rounded-l-md last:rounded-r-md"
|
|
81
81
|
),
|
|
82
82
|
className
|