@arcfusionz/arc-primitive-ui 0.2.5 → 0.2.7
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/Divider/Divider.d.ts +56 -0
- package/dist/components/Divider/Divider.js +66 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Divider/index.js +2 -0
- package/dist/components/Meter/Meter.d.ts +91 -0
- package/dist/components/Meter/Meter.js +77 -0
- package/dist/components/Meter/index.d.ts +2 -0
- package/dist/components/Meter/index.js +2 -0
- package/dist/components/Toggle/Toggle.d.ts +92 -0
- package/dist/components/Toggle/Toggle.js +96 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Toggle/index.js +2 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { Separator } from "@base-ui/react/separator";
|
|
3
|
+
//#region src/components/Divider/Divider.d.ts
|
|
4
|
+
type DividerOrientation = "horizontal" | "vertical";
|
|
5
|
+
type DividerVariant = "solid" | "dashed" | "dotted";
|
|
6
|
+
type DividerLabelPosition = "start" | "center" | "end";
|
|
7
|
+
interface DividerVariantsOptions {
|
|
8
|
+
orientation?: DividerOrientation;
|
|
9
|
+
variant?: DividerVariant;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Class list for an element styled as a plain (label-free) divider rule.
|
|
14
|
+
*
|
|
15
|
+
* Use it where the element must stay native, e.g. an `<hr>` inside rendered
|
|
16
|
+
* prose — labeled rules need the component:
|
|
17
|
+
*
|
|
18
|
+
* <hr className={dividerVariants()} />
|
|
19
|
+
*/
|
|
20
|
+
declare function dividerVariants({ orientation, variant, className }?: DividerVariantsOptions): string;
|
|
21
|
+
interface DividerBaseProps extends Omit<ComponentPropsWithoutRef<typeof Separator>, "className" | "orientation" | "children"> {
|
|
22
|
+
/**
|
|
23
|
+
* Direction of the rule. Vertical dividers stretch to the row height in
|
|
24
|
+
* flex layouts; give them an explicit height (`h-*`) elsewhere.
|
|
25
|
+
*/
|
|
26
|
+
orientation?: DividerOrientation;
|
|
27
|
+
/** Line style of the rule. */
|
|
28
|
+
variant?: DividerVariant;
|
|
29
|
+
/**
|
|
30
|
+
* Optional label rendered mid-rule: text, or icon + text (icons are sized
|
|
31
|
+
* by the standard slot). Horizontal only — vertical dividers reject a label
|
|
32
|
+
* at the type level, since a label reads along the rule.
|
|
33
|
+
*/
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
/** Where the label sits along the rule. `start`/`end` drop the outer segment so the label is flush with the edge. */
|
|
36
|
+
labelPosition?: DividerLabelPosition;
|
|
37
|
+
/**
|
|
38
|
+
* Render as a purely visual rule (`role="presentation"`) that conveys no
|
|
39
|
+
* content boundary to assistive technology — e.g. the hairline between a
|
|
40
|
+
* card header and its body. A label stays readable either way.
|
|
41
|
+
*/
|
|
42
|
+
decorative?: boolean;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/** A label reads along the rule, so it exists only on horizontal dividers. */
|
|
46
|
+
type DividerOrientationConstraint = {
|
|
47
|
+
orientation?: "horizontal";
|
|
48
|
+
} | {
|
|
49
|
+
orientation: "vertical";
|
|
50
|
+
children?: never;
|
|
51
|
+
labelPosition?: never;
|
|
52
|
+
};
|
|
53
|
+
type DividerProps = DividerBaseProps & DividerOrientationConstraint;
|
|
54
|
+
declare const Divider: import("react").ForwardRefExoticComponent<DividerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Divider, DividerLabelPosition, DividerOrientation, DividerProps, DividerVariant, DividerVariantsOptions, dividerVariants };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Separator } from "@base-ui/react/separator";
|
|
5
|
+
//#region src/components/Divider/Divider.tsx
|
|
6
|
+
const lineBaseClasses = "shrink-0 border-border";
|
|
7
|
+
const lineOrientationClasses = {
|
|
8
|
+
horizontal: "border-t",
|
|
9
|
+
vertical: "self-stretch border-l"
|
|
10
|
+
};
|
|
11
|
+
const lineVariantClasses = {
|
|
12
|
+
solid: "border-solid",
|
|
13
|
+
dashed: "border-dashed",
|
|
14
|
+
dotted: "border-dotted"
|
|
15
|
+
};
|
|
16
|
+
const labeledBaseClasses = "flex items-center gap-3 border-border before:h-0 before:flex-1 before:border-t before:border-inherit before:content-[''] after:h-0 after:flex-1 after:border-t after:border-inherit after:content-['']";
|
|
17
|
+
const labeledVariantClasses = {
|
|
18
|
+
solid: "before:border-solid after:border-solid",
|
|
19
|
+
dashed: "before:border-dashed after:border-dashed",
|
|
20
|
+
dotted: "before:border-dotted after:border-dotted"
|
|
21
|
+
};
|
|
22
|
+
const labelPositionClasses = {
|
|
23
|
+
start: "before:hidden",
|
|
24
|
+
center: "",
|
|
25
|
+
end: "after:hidden"
|
|
26
|
+
};
|
|
27
|
+
const labelClasses = "inline-flex items-center gap-1.5 font-sans text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
|
|
28
|
+
/**
|
|
29
|
+
* Class list for an element styled as a plain (label-free) divider rule.
|
|
30
|
+
*
|
|
31
|
+
* Use it where the element must stay native, e.g. an `<hr>` inside rendered
|
|
32
|
+
* prose — labeled rules need the component:
|
|
33
|
+
*
|
|
34
|
+
* <hr className={dividerVariants()} />
|
|
35
|
+
*/
|
|
36
|
+
function dividerVariants({ orientation = "horizontal", variant = "solid", className } = {}) {
|
|
37
|
+
return cn(lineBaseClasses, lineOrientationClasses[orientation], lineVariantClasses[variant], className);
|
|
38
|
+
}
|
|
39
|
+
const decorativeProps = {
|
|
40
|
+
role: "presentation",
|
|
41
|
+
"aria-orientation": void 0
|
|
42
|
+
};
|
|
43
|
+
const Divider = forwardRef(({ orientation = "horizontal", variant = "solid", labelPosition = "center", decorative = false, className, children, ...rest }, ref) => {
|
|
44
|
+
const hasLabel = children != null && orientation === "horizontal";
|
|
45
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
46
|
+
ref,
|
|
47
|
+
orientation,
|
|
48
|
+
...decorative ? decorativeProps : void 0,
|
|
49
|
+
className: cn(hasLabel ? [
|
|
50
|
+
labeledBaseClasses,
|
|
51
|
+
labeledVariantClasses[variant],
|
|
52
|
+
labelPositionClasses[labelPosition]
|
|
53
|
+
] : dividerVariants({
|
|
54
|
+
orientation,
|
|
55
|
+
variant
|
|
56
|
+
}), className),
|
|
57
|
+
...rest,
|
|
58
|
+
children: hasLabel ? /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: labelClasses,
|
|
60
|
+
children
|
|
61
|
+
}) : null
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
Divider.displayName = "Divider";
|
|
65
|
+
//#endregion
|
|
66
|
+
export { Divider, dividerVariants };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Divider, DividerLabelPosition, DividerOrientation, DividerProps, DividerVariant, DividerVariantsOptions, dividerVariants } from "./Divider.js";
|
|
2
|
+
export { Divider, type DividerLabelPosition, type DividerOrientation, type DividerProps, type DividerVariant, type DividerVariantsOptions, dividerVariants };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { Meter } from "@base-ui/react/meter";
|
|
3
|
+
//#region src/components/Meter/Meter.d.ts
|
|
4
|
+
type MeterSize = "sm" | "md" | "lg";
|
|
5
|
+
type MeterVariant = "primary" | "success" | "warning" | "destructive";
|
|
6
|
+
interface MeterTrackVariantsOptions {
|
|
7
|
+
size?: MeterSize;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Class list for an element styled as a Meter track.
|
|
12
|
+
*
|
|
13
|
+
* Pair with `meterIndicatorVariants()` to build gauges the flattened
|
|
14
|
+
* component doesn't cover — e.g. a segmented password-strength meter. Such a
|
|
15
|
+
* composite is one image to assistive technology, so name the whole thing:
|
|
16
|
+
*
|
|
17
|
+
* <div role="img" aria-label="Password strength: 3 of 4, strong"
|
|
18
|
+
* className={meterTrackVariants({ className: "bg-transparent" })}>
|
|
19
|
+
* <div className="flex h-full gap-1">
|
|
20
|
+
* {[0, 1, 2, 3].map((segment) => (
|
|
21
|
+
* <div key={segment} className={meterIndicatorVariants({
|
|
22
|
+
* variant: "success",
|
|
23
|
+
* className: cn("flex-1", segment >= 3 && "bg-muted"),
|
|
24
|
+
* })} />
|
|
25
|
+
* ))}
|
|
26
|
+
* </div>
|
|
27
|
+
* </div>
|
|
28
|
+
*/
|
|
29
|
+
declare function meterTrackVariants({ size, className }?: MeterTrackVariantsOptions): string;
|
|
30
|
+
interface MeterIndicatorVariantsOptions {
|
|
31
|
+
variant?: MeterVariant;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/** Class list for an element styled as a Meter fill — see `meterTrackVariants`. */
|
|
35
|
+
declare function meterIndicatorVariants({ variant, className }?: MeterIndicatorVariantsOptions): string;
|
|
36
|
+
interface MeterBaseProps extends Omit<ComponentPropsWithoutRef<typeof Meter.Root>, "className" | "value" | "children"> {
|
|
37
|
+
/**
|
|
38
|
+
* The current measurement within `[min, max]` (0–100 by default). Required —
|
|
39
|
+
* a meter always has a value; for task completion or unknown-duration waits
|
|
40
|
+
* use Progress instead, which announces as a progressbar and supports an
|
|
41
|
+
* indeterminate state.
|
|
42
|
+
*/
|
|
43
|
+
value: number;
|
|
44
|
+
/** Track thickness: `sm` 4px · `md` 8px · `lg` 12px. Text and spacing are unaffected. */
|
|
45
|
+
size?: MeterSize;
|
|
46
|
+
/**
|
|
47
|
+
* Semantic fill color. For neutral/informational readings use `primary` —
|
|
48
|
+
* the palette's `info` alias shares the primary ramp. Every fill clears the
|
|
49
|
+
* WCAG 1.4.11 3:1 non-text contrast floor against the track. The fill never
|
|
50
|
+
* changes by itself; switch it as the value crosses your own thresholds,
|
|
51
|
+
* e.g. `variant={pct > 90 ? "destructive" : pct > 75 ? "warning" : "primary"}`.
|
|
52
|
+
*/
|
|
53
|
+
variant?: MeterVariant;
|
|
54
|
+
/**
|
|
55
|
+
* Visible name of the measurement (Base UI's Label part), rendered above
|
|
56
|
+
* the track and wired up as the accessible name. Without it, `aria-label`
|
|
57
|
+
* or `aria-labelledby` is required — enforced at the type level.
|
|
58
|
+
*/
|
|
59
|
+
label?: ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Show the formatted value (Base UI's Value part) at the trailing edge of
|
|
62
|
+
* the header row — a percentage of the range by default; setting `format`
|
|
63
|
+
* switches it to the raw value formatted by `Intl.NumberFormat`.
|
|
64
|
+
*/
|
|
65
|
+
showValue?: boolean;
|
|
66
|
+
className?: string;
|
|
67
|
+
}
|
|
68
|
+
/** A meter must expose an accessible name: a visible label or an aria attribute. */
|
|
69
|
+
type MeterLabellingProps = {
|
|
70
|
+
label: ReactNode;
|
|
71
|
+
} | {
|
|
72
|
+
label?: never;
|
|
73
|
+
"aria-label": string;
|
|
74
|
+
} | {
|
|
75
|
+
label?: never;
|
|
76
|
+
"aria-labelledby": string;
|
|
77
|
+
};
|
|
78
|
+
type MeterProps = MeterBaseProps & MeterLabellingProps;
|
|
79
|
+
/**
|
|
80
|
+
* Graphical display of a numeric measurement within a known range — storage
|
|
81
|
+
* used, quota consumed, battery level, a strength score — built on Base UI's
|
|
82
|
+
* Meter (`role="meter"`). Not for task progress: a meter reads as a snapshot
|
|
83
|
+
* measurement, so `value` is required and there is no indeterminate state —
|
|
84
|
+
* use Progress for loading and long-running work. `min`, `max`, `format`,
|
|
85
|
+
* `locale`, `aria-valuetext`, and `getAriaValueText` pass through to Base
|
|
86
|
+
* UI's Root; value changes animate with a motion-safe width transition so
|
|
87
|
+
* live readings don't snap.
|
|
88
|
+
*/
|
|
89
|
+
declare const Meter$1: import("react").ForwardRefExoticComponent<MeterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
90
|
+
//#endregion
|
|
91
|
+
export { Meter$1 as Meter, MeterIndicatorVariantsOptions, MeterProps, MeterSize, MeterTrackVariantsOptions, MeterVariant, meterIndicatorVariants, meterTrackVariants };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Meter } from "@base-ui/react/meter";
|
|
5
|
+
//#region src/components/Meter/Meter.tsx
|
|
6
|
+
const rootClasses = "flex w-full flex-col gap-1.5";
|
|
7
|
+
const headerClasses = "flex items-baseline gap-2";
|
|
8
|
+
const labelClasses = "font-sans text-sm font-medium text-foreground";
|
|
9
|
+
const valueClasses = "ms-auto font-sans text-sm text-muted-foreground tabular-nums";
|
|
10
|
+
const trackClasses = "relative w-full overflow-hidden rounded-full bg-muted";
|
|
11
|
+
const trackSizeClasses = {
|
|
12
|
+
sm: "h-1",
|
|
13
|
+
md: "h-2",
|
|
14
|
+
lg: "h-3"
|
|
15
|
+
};
|
|
16
|
+
const indicatorClasses = "h-full rounded-full motion-safe:transition-[width] motion-safe:duration-500";
|
|
17
|
+
const indicatorVariantClasses = {
|
|
18
|
+
primary: "bg-primary",
|
|
19
|
+
success: "bg-success",
|
|
20
|
+
warning: "bg-warning-700",
|
|
21
|
+
destructive: "bg-destructive"
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Class list for an element styled as a Meter track.
|
|
25
|
+
*
|
|
26
|
+
* Pair with `meterIndicatorVariants()` to build gauges the flattened
|
|
27
|
+
* component doesn't cover — e.g. a segmented password-strength meter. Such a
|
|
28
|
+
* composite is one image to assistive technology, so name the whole thing:
|
|
29
|
+
*
|
|
30
|
+
* <div role="img" aria-label="Password strength: 3 of 4, strong"
|
|
31
|
+
* className={meterTrackVariants({ className: "bg-transparent" })}>
|
|
32
|
+
* <div className="flex h-full gap-1">
|
|
33
|
+
* {[0, 1, 2, 3].map((segment) => (
|
|
34
|
+
* <div key={segment} className={meterIndicatorVariants({
|
|
35
|
+
* variant: "success",
|
|
36
|
+
* className: cn("flex-1", segment >= 3 && "bg-muted"),
|
|
37
|
+
* })} />
|
|
38
|
+
* ))}
|
|
39
|
+
* </div>
|
|
40
|
+
* </div>
|
|
41
|
+
*/
|
|
42
|
+
function meterTrackVariants({ size = "md", className } = {}) {
|
|
43
|
+
return cn(trackClasses, trackSizeClasses[size], className);
|
|
44
|
+
}
|
|
45
|
+
/** Class list for an element styled as a Meter fill — see `meterTrackVariants`. */
|
|
46
|
+
function meterIndicatorVariants({ variant = "primary", className } = {}) {
|
|
47
|
+
return cn(indicatorClasses, indicatorVariantClasses[variant], className);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Graphical display of a numeric measurement within a known range — storage
|
|
51
|
+
* used, quota consumed, battery level, a strength score — built on Base UI's
|
|
52
|
+
* Meter (`role="meter"`). Not for task progress: a meter reads as a snapshot
|
|
53
|
+
* measurement, so `value` is required and there is no indeterminate state —
|
|
54
|
+
* use Progress for loading and long-running work. `min`, `max`, `format`,
|
|
55
|
+
* `locale`, `aria-valuetext`, and `getAriaValueText` pass through to Base
|
|
56
|
+
* UI's Root; value changes animate with a motion-safe width transition so
|
|
57
|
+
* live readings don't snap.
|
|
58
|
+
*/
|
|
59
|
+
const Meter$1 = forwardRef(({ value, size = "md", variant = "primary", label, showValue = false, className, ...rest }, ref) => /* @__PURE__ */ jsxs(Meter.Root, {
|
|
60
|
+
ref,
|
|
61
|
+
value,
|
|
62
|
+
className: cn(rootClasses, className),
|
|
63
|
+
...rest,
|
|
64
|
+
children: [(label != null || showValue) && /* @__PURE__ */ jsxs("div", {
|
|
65
|
+
className: headerClasses,
|
|
66
|
+
children: [label != null && /* @__PURE__ */ jsx(Meter.Label, {
|
|
67
|
+
className: labelClasses,
|
|
68
|
+
children: label
|
|
69
|
+
}), showValue && /* @__PURE__ */ jsx(Meter.Value, { className: valueClasses })]
|
|
70
|
+
}), /* @__PURE__ */ jsx(Meter.Track, {
|
|
71
|
+
className: meterTrackVariants({ size }),
|
|
72
|
+
children: /* @__PURE__ */ jsx(Meter.Indicator, { className: meterIndicatorVariants({ variant }) })
|
|
73
|
+
})]
|
|
74
|
+
}));
|
|
75
|
+
Meter$1.displayName = "Meter";
|
|
76
|
+
//#endregion
|
|
77
|
+
export { Meter$1 as Meter, meterIndicatorVariants, meterTrackVariants };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Meter, MeterIndicatorVariantsOptions, MeterProps, MeterSize, MeterTrackVariantsOptions, MeterVariant, meterIndicatorVariants, meterTrackVariants } from "./Meter.js";
|
|
2
|
+
export { Meter, type MeterIndicatorVariantsOptions, type MeterProps, type MeterSize, type MeterTrackVariantsOptions, type MeterVariant, meterIndicatorVariants, meterTrackVariants };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
3
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
4
|
+
//#region src/components/Toggle/Toggle.d.ts
|
|
5
|
+
type ToggleVariant = "ghost" | "outline";
|
|
6
|
+
type ToggleSize = "sm" | "md" | "lg";
|
|
7
|
+
type ToggleGroupOrientation = NonNullable<ComponentPropsWithoutRef<typeof ToggleGroup>["orientation"]>;
|
|
8
|
+
interface ToggleVariantsOptions {
|
|
9
|
+
variant?: ToggleVariant;
|
|
10
|
+
size?: ToggleSize;
|
|
11
|
+
iconOnly?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Style as pressed unconditionally — the static replacement for Base UI's
|
|
14
|
+
* `data-pressed` on plain elements. The consumer owns `aria-pressed`.
|
|
15
|
+
*/
|
|
16
|
+
pressed?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Class list for an element styled as a Toggle.
|
|
21
|
+
*
|
|
22
|
+
* Use it when the pressed styling is managed outside Base UI, e.g. a plain
|
|
23
|
+
* `<button>` whose `aria-pressed` you control yourself:
|
|
24
|
+
*
|
|
25
|
+
* <button type="button" aria-pressed={muted} className={toggleVariants({ pressed: muted })}>
|
|
26
|
+
* Mute
|
|
27
|
+
* </button>
|
|
28
|
+
*/
|
|
29
|
+
declare function toggleVariants({ variant, size, iconOnly, pressed, className }?: ToggleVariantsOptions): string;
|
|
30
|
+
interface ToggleBaseProps extends Omit<ComponentPropsWithoutRef<typeof Toggle>, "className"> {
|
|
31
|
+
/**
|
|
32
|
+
* Visual style: `ghost` (default) is the transparent toolbar treatment;
|
|
33
|
+
* `outline` adds a border for standalone use on busy surfaces. Both mark
|
|
34
|
+
* the pressed state with a primary wash. Inside a `ToggleGroup` the
|
|
35
|
+
* group's `variant` applies and this prop is ignored.
|
|
36
|
+
*/
|
|
37
|
+
variant?: ToggleVariant;
|
|
38
|
+
/**
|
|
39
|
+
* Control size. `sm` (32px) clears the WCAG 2.5.8 AA 24px target-size
|
|
40
|
+
* floor; prefer `md`/`lg` for touch-first surfaces. Inside a `ToggleGroup`
|
|
41
|
+
* the group's `size` applies and this prop is ignored.
|
|
42
|
+
*/
|
|
43
|
+
size?: ToggleSize;
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Icon-only toggles have no visible label, so an accessible name is required. */
|
|
47
|
+
type ToggleIconOnlyProps = {
|
|
48
|
+
iconOnly: true;
|
|
49
|
+
"aria-label": string;
|
|
50
|
+
} | {
|
|
51
|
+
iconOnly: true;
|
|
52
|
+
"aria-labelledby": string;
|
|
53
|
+
} | {
|
|
54
|
+
iconOnly?: false;
|
|
55
|
+
};
|
|
56
|
+
type ToggleProps = ToggleBaseProps & ToggleIconOnlyProps;
|
|
57
|
+
/**
|
|
58
|
+
* Two-state pressed/unpressed button (`aria-pressed`) built on Base UI's
|
|
59
|
+
* Toggle — favorite, mute, bold. State is announced by the attribute, so the
|
|
60
|
+
* label must not change with it. Uncontrolled via `defaultPressed`,
|
|
61
|
+
* controlled via `pressed` + `onPressedChange`. Inside a `ToggleGroup`,
|
|
62
|
+
* `value` identifies the item and the group holds the state instead.
|
|
63
|
+
*/
|
|
64
|
+
declare const Toggle$1: import("react").ForwardRefExoticComponent<ToggleProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
65
|
+
interface ToggleGroupProps extends Omit<ComponentPropsWithoutRef<typeof ToggleGroup>, "className"> {
|
|
66
|
+
/**
|
|
67
|
+
* Visual style shared by every toggle inside: `ghost` (default) lays them
|
|
68
|
+
* out as a toolbar cluster with a small gap; `outline` fuses them into a
|
|
69
|
+
* joined segmented control with shared borders.
|
|
70
|
+
*/
|
|
71
|
+
variant?: ToggleVariant;
|
|
72
|
+
/** Control size shared by every toggle inside (see `Toggle`'s `size`). */
|
|
73
|
+
size?: ToggleSize;
|
|
74
|
+
/**
|
|
75
|
+
* Layout axis. `vertical` stacks the items and arrow-key focus follows
|
|
76
|
+
* Up/Down; joined `outline` seams and corners follow the axis.
|
|
77
|
+
*/
|
|
78
|
+
orientation?: ToggleGroupOrientation;
|
|
79
|
+
className?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Holds the pressed state (`value`/`defaultValue`/`onValueChange`, as an
|
|
83
|
+
* array of the pressed toggles' `value`s) for the Toggles inside it. One
|
|
84
|
+
* toggle at a time by default — set `multiple` for independent toggles
|
|
85
|
+
* (formatting bold/italic). Pressing the pressed item clears it; to keep one
|
|
86
|
+
* always selected, control `value` and ignore updates that would empty it.
|
|
87
|
+
* Arrow keys move focus between items (`loopFocus` wraps). Give the group an
|
|
88
|
+
* accessible name: `aria-label` or `aria-labelledby`.
|
|
89
|
+
*/
|
|
90
|
+
declare const ToggleGroup$1: import("react").ForwardRefExoticComponent<ToggleGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { Toggle$1 as Toggle, ToggleGroup$1 as ToggleGroup, ToggleGroupProps, ToggleProps, ToggleSize, ToggleVariant, ToggleVariantsOptions, toggleVariants };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { createContext, forwardRef, useContext, useMemo } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
5
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
6
|
+
//#region src/components/Toggle/Toggle.tsx
|
|
7
|
+
const ToggleGroupStyleContext = createContext(null);
|
|
8
|
+
const baseClasses = "inline-flex items-center justify-center whitespace-nowrap select-none rounded-md font-sans font-medium text-slate-600 transition-colors duration-150 cursor-pointer hover:bg-muted hover:text-foreground active:bg-slate-200 data-pressed:bg-primary-100 data-pressed:text-primary-700 hover:data-pressed:bg-primary-200 active:data-pressed:bg-primary-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50";
|
|
9
|
+
const variantClasses = {
|
|
10
|
+
ghost: "bg-transparent",
|
|
11
|
+
outline: "border border-border bg-transparent data-pressed:border-primary-300"
|
|
12
|
+
};
|
|
13
|
+
const sizeClasses = {
|
|
14
|
+
sm: "h-8 min-w-8 gap-1.5 px-2 text-sm",
|
|
15
|
+
md: "h-10 min-w-10 gap-2 px-2.5 text-sm",
|
|
16
|
+
lg: "h-12 min-w-12 gap-2 px-3 text-base [&_svg:not([class*='size-'])]:size-5"
|
|
17
|
+
};
|
|
18
|
+
const iconOnlySizeClasses = {
|
|
19
|
+
sm: "w-8 px-0",
|
|
20
|
+
md: "w-10 px-0",
|
|
21
|
+
lg: "w-12 px-0"
|
|
22
|
+
};
|
|
23
|
+
const pressedStaticClasses = {
|
|
24
|
+
ghost: "bg-primary-100 text-primary-700 hover:bg-primary-200 hover:text-primary-700 active:bg-primary-200",
|
|
25
|
+
outline: "border-primary-300 bg-primary-100 text-primary-700 hover:bg-primary-200 hover:text-primary-700 active:bg-primary-200"
|
|
26
|
+
};
|
|
27
|
+
const joinedClasses = {
|
|
28
|
+
horizontal: "flex-1 rounded-none first:rounded-s-md last:rounded-e-md border-s-0 first:border-s focus-visible:relative focus-visible:z-1",
|
|
29
|
+
vertical: "rounded-none first:rounded-t-md last:rounded-b-md border-t-0 first:border-t focus-visible:relative focus-visible:z-1"
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Class list for an element styled as a Toggle.
|
|
33
|
+
*
|
|
34
|
+
* Use it when the pressed styling is managed outside Base UI, e.g. a plain
|
|
35
|
+
* `<button>` whose `aria-pressed` you control yourself:
|
|
36
|
+
*
|
|
37
|
+
* <button type="button" aria-pressed={muted} className={toggleVariants({ pressed: muted })}>
|
|
38
|
+
* Mute
|
|
39
|
+
* </button>
|
|
40
|
+
*/
|
|
41
|
+
function toggleVariants({ variant = "ghost", size = "md", iconOnly = false, pressed = false, className } = {}) {
|
|
42
|
+
return cn(baseClasses, variantClasses[variant], sizeClasses[size], iconOnly && iconOnlySizeClasses[size], pressed && pressedStaticClasses[variant], className);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Two-state pressed/unpressed button (`aria-pressed`) built on Base UI's
|
|
46
|
+
* Toggle — favorite, mute, bold. State is announced by the attribute, so the
|
|
47
|
+
* label must not change with it. Uncontrolled via `defaultPressed`,
|
|
48
|
+
* controlled via `pressed` + `onPressedChange`. Inside a `ToggleGroup`,
|
|
49
|
+
* `value` identifies the item and the group holds the state instead.
|
|
50
|
+
*/
|
|
51
|
+
const Toggle$1 = forwardRef(({ variant, size, iconOnly = false, className, ...rest }, ref) => {
|
|
52
|
+
const group = useContext(ToggleGroupStyleContext);
|
|
53
|
+
const resolvedVariant = group?.variant ?? variant ?? "ghost";
|
|
54
|
+
return /* @__PURE__ */ jsx(Toggle, {
|
|
55
|
+
ref,
|
|
56
|
+
className: cn(toggleVariants({
|
|
57
|
+
variant: resolvedVariant,
|
|
58
|
+
size: group?.size ?? size ?? "md",
|
|
59
|
+
iconOnly
|
|
60
|
+
}), group !== null && resolvedVariant === "outline" && joinedClasses[group.orientation], className),
|
|
61
|
+
...rest
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
Toggle$1.displayName = "Toggle";
|
|
65
|
+
/**
|
|
66
|
+
* Holds the pressed state (`value`/`defaultValue`/`onValueChange`, as an
|
|
67
|
+
* array of the pressed toggles' `value`s) for the Toggles inside it. One
|
|
68
|
+
* toggle at a time by default — set `multiple` for independent toggles
|
|
69
|
+
* (formatting bold/italic). Pressing the pressed item clears it; to keep one
|
|
70
|
+
* always selected, control `value` and ignore updates that would empty it.
|
|
71
|
+
* Arrow keys move focus between items (`loopFocus` wraps). Give the group an
|
|
72
|
+
* accessible name: `aria-label` or `aria-labelledby`.
|
|
73
|
+
*/
|
|
74
|
+
const ToggleGroup$1 = forwardRef(({ variant = "ghost", size = "md", orientation = "horizontal", className, ...rest }, ref) => {
|
|
75
|
+
const styleContext = useMemo(() => ({
|
|
76
|
+
variant,
|
|
77
|
+
size,
|
|
78
|
+
orientation
|
|
79
|
+
}), [
|
|
80
|
+
variant,
|
|
81
|
+
size,
|
|
82
|
+
orientation
|
|
83
|
+
]);
|
|
84
|
+
return /* @__PURE__ */ jsx(ToggleGroupStyleContext.Provider, {
|
|
85
|
+
value: styleContext,
|
|
86
|
+
children: /* @__PURE__ */ jsx(ToggleGroup, {
|
|
87
|
+
ref,
|
|
88
|
+
orientation,
|
|
89
|
+
className: cn("inline-flex w-fit items-stretch data-[orientation=vertical]:flex-col", variant === "ghost" && "gap-1", className),
|
|
90
|
+
...rest
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
ToggleGroup$1.displayName = "ToggleGroup";
|
|
95
|
+
//#endregion
|
|
96
|
+
export { Toggle$1 as Toggle, ToggleGroup$1 as ToggleGroup, toggleVariants };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Toggle, ToggleGroup, ToggleGroupProps, ToggleProps, ToggleSize, ToggleVariant, ToggleVariantsOptions, toggleVariants } from "./Toggle.js";
|
|
2
|
+
export { Toggle, ToggleGroup, type ToggleGroupProps, type ToggleProps, type ToggleSize, type ToggleVariant, type ToggleVariantsOptions, toggleVariants };
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ import { DateRangePicker, DateRangePickerCalendarProps, DateRangePickerPopupProp
|
|
|
31
31
|
import "./components/DateRangePicker/index.js";
|
|
32
32
|
import { Dialog, DialogClose, DialogCloseProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogPopup, DialogPopupProps, DialogPopupVariantsOptions, DialogProps, DialogScrollBehavior, DialogSize, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps, dialogPopupVariants } from "./components/Dialog/Dialog.js";
|
|
33
33
|
import "./components/Dialog/index.js";
|
|
34
|
+
import { Divider, DividerLabelPosition, DividerOrientation, DividerProps, DividerVariant, DividerVariantsOptions, dividerVariants } from "./components/Divider/Divider.js";
|
|
35
|
+
import "./components/Divider/index.js";
|
|
34
36
|
import { Drawer, DrawerClose, DrawerCloseProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerIndent, DrawerIndentBackground, DrawerIndentBackgroundProps, DrawerIndentProps, DrawerPopup, DrawerPopupProps, DrawerPopupVariantsOptions, DrawerProps, DrawerProvider, DrawerSide, DrawerSize, DrawerSwipeArea, DrawerSwipeAreaProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps, DrawerVirtualKeyboardProvider, createDrawerHandle, drawerPopupVariants } from "./components/Drawer/Drawer.js";
|
|
35
37
|
import "./components/Drawer/index.js";
|
|
36
38
|
import { Field, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldItem, FieldItemProps, FieldLabel, FieldLabelProps, FieldLabelVariantsOptions, FieldOrientation, FieldProps, FieldValidity, FieldValidityProps, fieldLabelVariants } from "./components/Field/Field.js";
|
|
@@ -43,6 +45,8 @@ import "./components/Form/index.js";
|
|
|
43
45
|
import { Input, InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupProps, InputProps, InputSize, InputVariantsOptions, inputVariants } from "./components/Input/Input.js";
|
|
44
46
|
import "./components/Input/index.js";
|
|
45
47
|
import "./components/Menu/index.js";
|
|
48
|
+
import { Meter, MeterIndicatorVariantsOptions, MeterProps, MeterSize, MeterTrackVariantsOptions, MeterVariant, meterIndicatorVariants, meterTrackVariants } from "./components/Meter/Meter.js";
|
|
49
|
+
import "./components/Meter/index.js";
|
|
46
50
|
import { Progress, ProgressIndicatorVariantsOptions, ProgressProps, ProgressSize, ProgressTrackVariantsOptions, ProgressVariant, progressIndicatorVariants, progressTrackVariants } from "./components/Progress/Progress.js";
|
|
47
51
|
import "./components/Progress/index.js";
|
|
48
52
|
import { Radio, RadioGroup, RadioGroupProps, RadioProps, RadioSize, RadioVariantsOptions, radioVariants } from "./components/Radio/Radio.js";
|
|
@@ -63,9 +67,11 @@ import { Timeline, TimelineConnector, TimelineConnectorProps, TimelineContent, T
|
|
|
63
67
|
import "./components/Timeline/index.js";
|
|
64
68
|
import { ToastData, ToastManager, ToastObject, ToastOptions, ToastPosition, ToastPromiseOptions, ToastType, ToastUpdateOptions, Toaster, ToasterProps, createToastManager, toast } from "./components/Toast/Toast.js";
|
|
65
69
|
import "./components/Toast/index.js";
|
|
70
|
+
import { Toggle, ToggleGroup, ToggleGroupProps, ToggleProps, ToggleSize, ToggleVariant, ToggleVariantsOptions, toggleVariants } from "./components/Toggle/Toggle.js";
|
|
71
|
+
import "./components/Toggle/index.js";
|
|
66
72
|
import { Tooltip, TooltipAlign, TooltipHandle, TooltipPopup, TooltipPopupProps, TooltipPopupVariantsOptions, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipSide, TooltipTrigger, TooltipTriggerProps, createTooltipHandle, tooltipPopupVariants } from "./components/Tooltip/Tooltip.js";
|
|
67
73
|
import "./components/Tooltip/index.js";
|
|
68
74
|
import { Typography, TypographyProps, TypographyVariant, TypographyVariantsOptions, typographyVariants } from "./components/Typography/Typography.js";
|
|
69
75
|
import "./components/Typography/index.js";
|
|
70
76
|
import { cn } from "./lib/cn.js";
|
|
71
|
-
export { AILoader, type AILoaderProps, type AILoaderRenderState, type AILoaderSize, type AILoaderState, type AILoaderTone, Accordion, type AccordionChevronPosition, AccordionHeader, type AccordionHeaderProps, AccordionItem, type AccordionItemProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, type AccordionSize, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, Alert, type AlertAppearance, type AlertProps, type AlertVariant, type AlertVariantsOptions, Avatar, AvatarBadge, type AvatarBadgeProps, AvatarFallback, type AvatarFallbackProps, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarImageProps, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarVariantsOptions, Badge, type BadgeAppearance, type BadgeProps, type BadgeSize, type BadgeVariant, type BadgeVariantsOptions, Breadcrumb, BreadcrumbEllipsis, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, type BreadcrumbLinkVariantsOptions, BreadcrumbList, type BreadcrumbListProps, BreadcrumbPage, type BreadcrumbPageProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, type ButtonVariantsOptions, Calendar, type CalendarDateRange, type CalendarMode, type CalendarProps, type CalendarState, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize, type CheckboxVariantsOptions, Combobox, type ComboboxAlign, ComboboxChip, type ComboboxChipProps, ComboboxChipRemove, type ComboboxChipRemoveProps, ComboboxChips, type ComboboxChipsProps, ComboboxClear, type ComboboxClearProps, ComboboxCollection, type ComboboxCollectionProps, ComboboxGroup, ComboboxGroupLabel, type ComboboxGroupLabelProps, type ComboboxGroupProps, ComboboxInput, ComboboxInputGroup, type ComboboxInputGroupProps, type ComboboxInputGroupVariantsOptions, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, ComboboxLabel, type ComboboxLabelProps, ComboboxPopup, type ComboboxPopupProps, type ComboboxProps, ComboboxSeparator, type ComboboxSeparatorProps, type ComboboxSize, ComboboxTrigger, type ComboboxTriggerProps, type ComboboxTriggerSize, type ComboboxTriggerVariant, ComboboxValue, type ComboboxValueProps, ContextMenu, type ContextMenuAlign, ContextMenuCheckboxItem, type ContextMenuCheckboxItemProps, ContextMenuGroup, ContextMenuGroupLabel, type ContextMenuGroupLabelProps, type ContextMenuGroupProps, ContextMenuItem, type ContextMenuItemProps, type ContextMenuItemVariant, ContextMenuLinkItem, type ContextMenuLinkItemProps, ContextMenuPopup, type ContextMenuPopupProps, type ContextMenuProps, ContextMenuRadioGroup, type ContextMenuRadioGroupProps, ContextMenuRadioItem, type ContextMenuRadioItemProps, ContextMenuSeparator, type ContextMenuSeparatorProps, ContextMenuShortcut, type ContextMenuShortcutProps, type ContextMenuSide, ContextMenuSubmenuRoot, type ContextMenuSubmenuRootProps, ContextMenuSubmenuTrigger, type ContextMenuSubmenuTriggerProps, ContextMenuTrigger, type ContextMenuTriggerProps, DatePicker, type DatePickerCalendarProps, type DatePickerPopupProps, type DatePickerProps, type DatePickerSize, type DatePickerVariant, type DatePickerVariantsOptions, DateRangePicker, type DateRangePickerCalendarProps, type DateRangePickerPopupProps, type DateRangePickerProps, type DateRangePickerSize, type DateRangePickerVariant, type DateRangePickerVariantsOptions, Dialog, DialogClose, type DialogCloseProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogPopup, type DialogPopupProps, type DialogPopupVariantsOptions, type DialogProps, type DialogScrollBehavior, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Drawer, DrawerClose, type DrawerCloseProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, DrawerIndent, DrawerIndentBackground, type DrawerIndentBackgroundProps, type DrawerIndentProps, DrawerPopup, type DrawerPopupProps, type DrawerPopupVariantsOptions, type DrawerProps, DrawerProvider, type DrawerSide, type DrawerSize, DrawerSwipeArea, type DrawerSwipeAreaProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, DrawerVirtualKeyboardProvider, Field, type FieldControlProps, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorProps, FieldItem, type FieldItemProps, FieldLabel, type FieldLabelProps, type FieldLabelVariantsOptions, type FieldOrientation, type FieldProps, FieldValidity, type FieldValidityProps, Fieldset, FieldsetDescription, type FieldsetDescriptionProps, FieldsetLegend, type FieldsetLegendProps, type FieldsetLegendVariant, type FieldsetProps, Form, type FormProps, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, type InputGroupProps, type InputProps, type InputSize, type InputVariantsOptions, Menu, type MenuAlign, MenuCheckboxItem, type MenuCheckboxItemProps, MenuGroup, MenuGroupLabel, type MenuGroupLabelProps, type MenuGroupProps, type MenuHandle, MenuItem, type MenuItemProps, type MenuItemVariant, type MenuItemVariantsOptions, MenuLinkItem, type MenuLinkItemProps, MenuPopup, type MenuPopupProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuShortcut, type MenuShortcutProps, type MenuSide, MenuSubmenuRoot, type MenuSubmenuRootProps, MenuSubmenuTrigger, type MenuSubmenuTriggerProps, MenuTrigger, type MenuTriggerProps, Popover, type PopoverAlign, PopoverClose, type PopoverCloseProps, PopoverDescription, type PopoverDescriptionProps, type PopoverHandle, PopoverPopup, type PopoverPopupProps, type PopoverPopupVariantsOptions, type PopoverProps, type PopoverSide, PopoverTitle, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerProps, Progress, type ProgressIndicatorVariantsOptions, type ProgressProps, type ProgressSize, type ProgressTrackVariantsOptions, type ProgressVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, type RadioVariantsOptions, Select, type SelectAlign, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectPopup, type SelectPopupProps, type SelectProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, type SelectTriggerSize, type SelectTriggerVariant, type SelectTriggerVariantsOptions, SelectValue, type SelectValueProps, Skeleton, type SkeletonAnimation, type SkeletonProps, type SkeletonRenderState, type SkeletonVariant, type SkeletonVariantsOptions, Stepper, StepperDescription, type StepperDescriptionProps, StepperIndicator, type StepperIndicatorProps, StepperItem, type StepperItemProps, type StepperOrientation, type StepperProps, StepperSeparator, type StepperSeparatorProps, type StepperSize, StepperTitle, type StepperTitleProps, StepperTrigger, type StepperTriggerProps, type StepperTriggerVariantsOptions, Switch, type SwitchLabelPosition, type SwitchProps, type SwitchSize, type SwitchVariantsOptions, SystemState, type SystemStateBackground, type SystemStateProps, type SystemStateRenderState, type SystemStateScope, type SystemStateTitleLevel, type SystemStateVariant, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, type TableCaptionRenderState, type TableCaptionSide, TableCell, type TableCellProps, TableContainer, type TableContainerProps, type TableContainerRenderState, type TableContainerVariant, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableLayout, type TableProps, type TableRenderState, TableRow, type TableRowProps, type TableRowRenderState, type TableSize, Tabs, type TabsIndicatorPosition, TabsList, type TabsListProps, type TabsListVariantsOptions, TabsPanel, type TabsPanelProps, type TabsProps, type TabsSize, TabsTab, type TabsTabProps, type TabsTabVariantsOptions, type TabsVariant, Timeline, TimelineConnector, type TimelineConnectorProps, TimelineContent, type TimelineContentProps, TimelineDescription, type TimelineDescriptionProps, TimelineIndicator, type TimelineIndicatorAppearance, type TimelineIndicatorProps, type TimelineIndicatorVariant, TimelineItem, type TimelineItemProps, type TimelineProps, TimelineSeparator, type TimelineSeparatorProps, type TimelineSeparatorVariant, type TimelineSize, TimelineTime, type TimelineTimeProps, TimelineTitle, type TimelineTitleProps, type ToastData, type ToastManager, type ToastObject, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastType, type ToastUpdateOptions, Toaster, type ToasterProps, Tooltip, type TooltipAlign, type TooltipHandle, TooltipPopup, type TooltipPopupProps, type TooltipPopupVariantsOptions, type TooltipProps, TooltipProvider, type TooltipProviderProps, type TooltipSide, TooltipTrigger, type TooltipTriggerProps, Typography, type TypographyProps, type TypographyVariant, type TypographyVariantsOptions, alertVariants, avatarVariants, badgeVariants, breadcrumbLinkVariants, buttonVariants, checkboxVariants, cn, comboboxInputGroupVariants, createDrawerHandle, createMenuHandle, createPopoverHandle, createToastManager, createTooltipHandle, datePickerVariants, dateRangePickerVariants, dialogPopupVariants, drawerPopupVariants, fieldLabelVariants, inputVariants, menuItemVariants, popoverPopupVariants, progressIndicatorVariants, progressTrackVariants, radioVariants, selectTriggerVariants, skeletonVariants, stepperTriggerVariants, switchVariants, tabsListVariants, tabsTabVariants, toast, tooltipPopupVariants, typographyVariants, useComboboxFilter, useComboboxFilteredItems, useFieldControl };
|
|
77
|
+
export { AILoader, type AILoaderProps, type AILoaderRenderState, type AILoaderSize, type AILoaderState, type AILoaderTone, Accordion, type AccordionChevronPosition, AccordionHeader, type AccordionHeaderProps, AccordionItem, type AccordionItemProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, type AccordionSize, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, Alert, type AlertAppearance, type AlertProps, type AlertVariant, type AlertVariantsOptions, Avatar, AvatarBadge, type AvatarBadgeProps, AvatarFallback, type AvatarFallbackProps, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarImageProps, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarVariantsOptions, Badge, type BadgeAppearance, type BadgeProps, type BadgeSize, type BadgeVariant, type BadgeVariantsOptions, Breadcrumb, BreadcrumbEllipsis, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, type BreadcrumbLinkVariantsOptions, BreadcrumbList, type BreadcrumbListProps, BreadcrumbPage, type BreadcrumbPageProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, type ButtonVariantsOptions, Calendar, type CalendarDateRange, type CalendarMode, type CalendarProps, type CalendarState, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize, type CheckboxVariantsOptions, Combobox, type ComboboxAlign, ComboboxChip, type ComboboxChipProps, ComboboxChipRemove, type ComboboxChipRemoveProps, ComboboxChips, type ComboboxChipsProps, ComboboxClear, type ComboboxClearProps, ComboboxCollection, type ComboboxCollectionProps, ComboboxGroup, ComboboxGroupLabel, type ComboboxGroupLabelProps, type ComboboxGroupProps, ComboboxInput, ComboboxInputGroup, type ComboboxInputGroupProps, type ComboboxInputGroupVariantsOptions, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, ComboboxLabel, type ComboboxLabelProps, ComboboxPopup, type ComboboxPopupProps, type ComboboxProps, ComboboxSeparator, type ComboboxSeparatorProps, type ComboboxSize, ComboboxTrigger, type ComboboxTriggerProps, type ComboboxTriggerSize, type ComboboxTriggerVariant, ComboboxValue, type ComboboxValueProps, ContextMenu, type ContextMenuAlign, ContextMenuCheckboxItem, type ContextMenuCheckboxItemProps, ContextMenuGroup, ContextMenuGroupLabel, type ContextMenuGroupLabelProps, type ContextMenuGroupProps, ContextMenuItem, type ContextMenuItemProps, type ContextMenuItemVariant, ContextMenuLinkItem, type ContextMenuLinkItemProps, ContextMenuPopup, type ContextMenuPopupProps, type ContextMenuProps, ContextMenuRadioGroup, type ContextMenuRadioGroupProps, ContextMenuRadioItem, type ContextMenuRadioItemProps, ContextMenuSeparator, type ContextMenuSeparatorProps, ContextMenuShortcut, type ContextMenuShortcutProps, type ContextMenuSide, ContextMenuSubmenuRoot, type ContextMenuSubmenuRootProps, ContextMenuSubmenuTrigger, type ContextMenuSubmenuTriggerProps, ContextMenuTrigger, type ContextMenuTriggerProps, DatePicker, type DatePickerCalendarProps, type DatePickerPopupProps, type DatePickerProps, type DatePickerSize, type DatePickerVariant, type DatePickerVariantsOptions, DateRangePicker, type DateRangePickerCalendarProps, type DateRangePickerPopupProps, type DateRangePickerProps, type DateRangePickerSize, type DateRangePickerVariant, type DateRangePickerVariantsOptions, Dialog, DialogClose, type DialogCloseProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogPopup, type DialogPopupProps, type DialogPopupVariantsOptions, type DialogProps, type DialogScrollBehavior, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Divider, type DividerLabelPosition, type DividerOrientation, type DividerProps, type DividerVariant, type DividerVariantsOptions, Drawer, DrawerClose, type DrawerCloseProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, DrawerIndent, DrawerIndentBackground, type DrawerIndentBackgroundProps, type DrawerIndentProps, DrawerPopup, type DrawerPopupProps, type DrawerPopupVariantsOptions, type DrawerProps, DrawerProvider, type DrawerSide, type DrawerSize, DrawerSwipeArea, type DrawerSwipeAreaProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, DrawerVirtualKeyboardProvider, Field, type FieldControlProps, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorProps, FieldItem, type FieldItemProps, FieldLabel, type FieldLabelProps, type FieldLabelVariantsOptions, type FieldOrientation, type FieldProps, FieldValidity, type FieldValidityProps, Fieldset, FieldsetDescription, type FieldsetDescriptionProps, FieldsetLegend, type FieldsetLegendProps, type FieldsetLegendVariant, type FieldsetProps, Form, type FormProps, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, type InputGroupProps, type InputProps, type InputSize, type InputVariantsOptions, Menu, type MenuAlign, MenuCheckboxItem, type MenuCheckboxItemProps, MenuGroup, MenuGroupLabel, type MenuGroupLabelProps, type MenuGroupProps, type MenuHandle, MenuItem, type MenuItemProps, type MenuItemVariant, type MenuItemVariantsOptions, MenuLinkItem, type MenuLinkItemProps, MenuPopup, type MenuPopupProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuShortcut, type MenuShortcutProps, type MenuSide, MenuSubmenuRoot, type MenuSubmenuRootProps, MenuSubmenuTrigger, type MenuSubmenuTriggerProps, MenuTrigger, type MenuTriggerProps, Meter, type MeterIndicatorVariantsOptions, type MeterProps, type MeterSize, type MeterTrackVariantsOptions, type MeterVariant, Popover, type PopoverAlign, PopoverClose, type PopoverCloseProps, PopoverDescription, type PopoverDescriptionProps, type PopoverHandle, PopoverPopup, type PopoverPopupProps, type PopoverPopupVariantsOptions, type PopoverProps, type PopoverSide, PopoverTitle, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerProps, Progress, type ProgressIndicatorVariantsOptions, type ProgressProps, type ProgressSize, type ProgressTrackVariantsOptions, type ProgressVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, type RadioVariantsOptions, Select, type SelectAlign, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectPopup, type SelectPopupProps, type SelectProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, type SelectTriggerSize, type SelectTriggerVariant, type SelectTriggerVariantsOptions, SelectValue, type SelectValueProps, Skeleton, type SkeletonAnimation, type SkeletonProps, type SkeletonRenderState, type SkeletonVariant, type SkeletonVariantsOptions, Stepper, StepperDescription, type StepperDescriptionProps, StepperIndicator, type StepperIndicatorProps, StepperItem, type StepperItemProps, type StepperOrientation, type StepperProps, StepperSeparator, type StepperSeparatorProps, type StepperSize, StepperTitle, type StepperTitleProps, StepperTrigger, type StepperTriggerProps, type StepperTriggerVariantsOptions, Switch, type SwitchLabelPosition, type SwitchProps, type SwitchSize, type SwitchVariantsOptions, SystemState, type SystemStateBackground, type SystemStateProps, type SystemStateRenderState, type SystemStateScope, type SystemStateTitleLevel, type SystemStateVariant, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, type TableCaptionRenderState, type TableCaptionSide, TableCell, type TableCellProps, TableContainer, type TableContainerProps, type TableContainerRenderState, type TableContainerVariant, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableLayout, type TableProps, type TableRenderState, TableRow, type TableRowProps, type TableRowRenderState, type TableSize, Tabs, type TabsIndicatorPosition, TabsList, type TabsListProps, type TabsListVariantsOptions, TabsPanel, type TabsPanelProps, type TabsProps, type TabsSize, TabsTab, type TabsTabProps, type TabsTabVariantsOptions, type TabsVariant, Timeline, TimelineConnector, type TimelineConnectorProps, TimelineContent, type TimelineContentProps, TimelineDescription, type TimelineDescriptionProps, TimelineIndicator, type TimelineIndicatorAppearance, type TimelineIndicatorProps, type TimelineIndicatorVariant, TimelineItem, type TimelineItemProps, type TimelineProps, TimelineSeparator, type TimelineSeparatorProps, type TimelineSeparatorVariant, type TimelineSize, TimelineTime, type TimelineTimeProps, TimelineTitle, type TimelineTitleProps, type ToastData, type ToastManager, type ToastObject, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastType, type ToastUpdateOptions, Toaster, type ToasterProps, Toggle, ToggleGroup, type ToggleGroupProps, type ToggleProps, type ToggleSize, type ToggleVariant, type ToggleVariantsOptions, Tooltip, type TooltipAlign, type TooltipHandle, TooltipPopup, type TooltipPopupProps, type TooltipPopupVariantsOptions, type TooltipProps, TooltipProvider, type TooltipProviderProps, type TooltipSide, TooltipTrigger, type TooltipTriggerProps, Typography, type TypographyProps, type TypographyVariant, type TypographyVariantsOptions, alertVariants, avatarVariants, badgeVariants, breadcrumbLinkVariants, buttonVariants, checkboxVariants, cn, comboboxInputGroupVariants, createDrawerHandle, createMenuHandle, createPopoverHandle, createToastManager, createTooltipHandle, datePickerVariants, dateRangePickerVariants, dialogPopupVariants, dividerVariants, drawerPopupVariants, fieldLabelVariants, inputVariants, menuItemVariants, meterIndicatorVariants, meterTrackVariants, popoverPopupVariants, progressIndicatorVariants, progressTrackVariants, radioVariants, selectTriggerVariants, skeletonVariants, stepperTriggerVariants, switchVariants, tabsListVariants, tabsTabVariants, toast, toggleVariants, tooltipPopupVariants, typographyVariants, useComboboxFilter, useComboboxFilteredItems, useFieldControl };
|
package/dist/index.js
CHANGED
|
@@ -18,10 +18,12 @@ import { Popover, PopoverClose, PopoverDescription, PopoverPopup, PopoverTitle,
|
|
|
18
18
|
import { DatePicker, datePickerVariants } from "./components/DatePicker/DatePicker.js";
|
|
19
19
|
import { DateRangePicker, dateRangePickerVariants } from "./components/DateRangePicker/DateRangePicker.js";
|
|
20
20
|
import { Dialog, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogTitle, DialogTrigger, dialogPopupVariants } from "./components/Dialog/Dialog.js";
|
|
21
|
+
import { Divider, dividerVariants } from "./components/Divider/Divider.js";
|
|
21
22
|
import { Drawer, DrawerClose, DrawerDescription, DrawerFooter, DrawerHeader, DrawerIndent, DrawerIndentBackground, DrawerPopup, DrawerProvider, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerVirtualKeyboardProvider, createDrawerHandle, drawerPopupVariants } from "./components/Drawer/Drawer.js";
|
|
22
23
|
import { Field, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity, fieldLabelVariants } from "./components/Field/Field.js";
|
|
23
24
|
import { Fieldset, FieldsetDescription, FieldsetLegend } from "./components/Fieldset/Fieldset.js";
|
|
24
25
|
import { Form } from "./components/Form/Form.js";
|
|
26
|
+
import { Meter, meterIndicatorVariants, meterTrackVariants } from "./components/Meter/Meter.js";
|
|
25
27
|
import { Progress, progressIndicatorVariants, progressTrackVariants } from "./components/Progress/Progress.js";
|
|
26
28
|
import { Radio, RadioGroup, radioVariants } from "./components/Radio/Radio.js";
|
|
27
29
|
import { Skeleton, skeletonVariants } from "./components/Skeleton/Skeleton.js";
|
|
@@ -32,6 +34,7 @@ import { Table, TableBody, TableCaption, TableCell, TableContainer, TableFooter,
|
|
|
32
34
|
import { Tabs, TabsList, TabsPanel, TabsTab, tabsListVariants, tabsTabVariants } from "./components/Tabs/Tabs.js";
|
|
33
35
|
import { Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTime, TimelineTitle } from "./components/Timeline/Timeline.js";
|
|
34
36
|
import { Toaster, createToastManager, toast } from "./components/Toast/Toast.js";
|
|
37
|
+
import { Toggle, ToggleGroup, toggleVariants } from "./components/Toggle/Toggle.js";
|
|
35
38
|
import { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger, createTooltipHandle, tooltipPopupVariants } from "./components/Tooltip/Tooltip.js";
|
|
36
39
|
import { Typography, typographyVariants } from "./components/Typography/Typography.js";
|
|
37
|
-
export { AILoader, Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger, Alert, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Checkbox, CheckboxGroup, Combobox, ComboboxChip, ComboboxChipRemove, ComboboxChips, ComboboxClear, ComboboxCollection, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxInputGroup, ComboboxItem, ComboboxLabel, ComboboxPopup, ComboboxSeparator, ComboboxTrigger, ComboboxValue, ContextMenu, ContextMenuCheckboxItem, ContextMenuGroup, ContextMenuGroupLabel, ContextMenuItem, ContextMenuLinkItem, ContextMenuPopup, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSubmenuRoot, ContextMenuSubmenuTrigger, ContextMenuTrigger, DatePicker, DateRangePicker, Dialog, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerDescription, DrawerFooter, DrawerHeader, DrawerIndent, DrawerIndentBackground, DrawerPopup, DrawerProvider, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerVirtualKeyboardProvider, Field, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity, Fieldset, FieldsetDescription, FieldsetLegend, Form, Input, InputGroup, InputGroupAddon, Menu, MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuLinkItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSubmenuRoot, MenuSubmenuTrigger, MenuTrigger, Popover, PopoverClose, PopoverDescription, PopoverPopup, PopoverTitle, PopoverTrigger, Progress, Radio, RadioGroup, Select, SelectGroup, SelectGroupLabel, SelectItem, SelectLabel, SelectPopup, SelectSeparator, SelectTrigger, SelectValue, Skeleton, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, SystemState, Table, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTime, TimelineTitle, Toaster, Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger, Typography, alertVariants, avatarVariants, badgeVariants, breadcrumbLinkVariants, buttonVariants, checkboxVariants, cn, comboboxInputGroupVariants, createDrawerHandle, createMenuHandle, createPopoverHandle, createToastManager, createTooltipHandle, datePickerVariants, dateRangePickerVariants, dialogPopupVariants, drawerPopupVariants, fieldLabelVariants, inputVariants, menuItemVariants, popoverPopupVariants, progressIndicatorVariants, progressTrackVariants, radioVariants, selectTriggerVariants, skeletonVariants, stepperTriggerVariants, switchVariants, tabsListVariants, tabsTabVariants, toast, tooltipPopupVariants, typographyVariants, useComboboxFilter, useComboboxFilteredItems, useFieldControl };
|
|
40
|
+
export { AILoader, Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger, Alert, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Checkbox, CheckboxGroup, Combobox, ComboboxChip, ComboboxChipRemove, ComboboxChips, ComboboxClear, ComboboxCollection, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxInputGroup, ComboboxItem, ComboboxLabel, ComboboxPopup, ComboboxSeparator, ComboboxTrigger, ComboboxValue, ContextMenu, ContextMenuCheckboxItem, ContextMenuGroup, ContextMenuGroupLabel, ContextMenuItem, ContextMenuLinkItem, ContextMenuPopup, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSubmenuRoot, ContextMenuSubmenuTrigger, ContextMenuTrigger, DatePicker, DateRangePicker, Dialog, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogTitle, DialogTrigger, Divider, Drawer, DrawerClose, DrawerDescription, DrawerFooter, DrawerHeader, DrawerIndent, DrawerIndentBackground, DrawerPopup, DrawerProvider, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerVirtualKeyboardProvider, Field, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity, Fieldset, FieldsetDescription, FieldsetLegend, Form, Input, InputGroup, InputGroupAddon, Menu, MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuLinkItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSubmenuRoot, MenuSubmenuTrigger, MenuTrigger, Meter, Popover, PopoverClose, PopoverDescription, PopoverPopup, PopoverTitle, PopoverTrigger, Progress, Radio, RadioGroup, Select, SelectGroup, SelectGroupLabel, SelectItem, SelectLabel, SelectPopup, SelectSeparator, SelectTrigger, SelectValue, Skeleton, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, Switch, SystemState, Table, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTime, TimelineTitle, Toaster, Toggle, ToggleGroup, Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger, Typography, alertVariants, avatarVariants, badgeVariants, breadcrumbLinkVariants, buttonVariants, checkboxVariants, cn, comboboxInputGroupVariants, createDrawerHandle, createMenuHandle, createPopoverHandle, createToastManager, createTooltipHandle, datePickerVariants, dateRangePickerVariants, dialogPopupVariants, dividerVariants, drawerPopupVariants, fieldLabelVariants, inputVariants, menuItemVariants, meterIndicatorVariants, meterTrackVariants, popoverPopupVariants, progressIndicatorVariants, progressTrackVariants, radioVariants, selectTriggerVariants, skeletonVariants, stepperTriggerVariants, switchVariants, tabsListVariants, tabsTabVariants, toast, toggleVariants, tooltipPopupVariants, typographyVariants, useComboboxFilter, useComboboxFilteredItems, useFieldControl };
|