@danxbot/ui 7.3.1 → 7.4.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/index.js +8121 -8016
- package/dist/index.js.map +1 -1
- package/dist/types/components/TriStateSwitch.d.ts +69 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
declare const track: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
size: {
|
|
4
|
+
sm: "h-(--tri-h) w-(--tri-w) [--tri-h:calc(1.25rem*var(--ui-scale))] [--tri-w:calc(3.125rem*var(--ui-scale))]";
|
|
5
|
+
md: "h-(--tri-h) w-(--tri-w) [--tri-h:calc(1.5rem*var(--ui-scale))] [--tri-w:calc(3.75rem*var(--ui-scale))]";
|
|
6
|
+
lg: "h-(--tri-h) w-(--tri-w) [--tri-h:calc(1.75rem*var(--ui-scale))] [--tri-w:calc(4.375rem*var(--ui-scale))]";
|
|
7
|
+
};
|
|
8
|
+
state: {
|
|
9
|
+
no: "border-border bg-switch-track-off";
|
|
10
|
+
unset: "border-dashed border-border-strong bg-transparent";
|
|
11
|
+
yes: "border-accent bg-accent";
|
|
12
|
+
};
|
|
13
|
+
disabled: {
|
|
14
|
+
true: "cursor-not-allowed opacity-45";
|
|
15
|
+
false: "";
|
|
16
|
+
};
|
|
17
|
+
}, undefined, string[], {
|
|
18
|
+
size: {
|
|
19
|
+
sm: "h-(--tri-h) w-(--tri-w) [--tri-h:calc(1.25rem*var(--ui-scale))] [--tri-w:calc(3.125rem*var(--ui-scale))]";
|
|
20
|
+
md: "h-(--tri-h) w-(--tri-w) [--tri-h:calc(1.5rem*var(--ui-scale))] [--tri-w:calc(3.75rem*var(--ui-scale))]";
|
|
21
|
+
lg: "h-(--tri-h) w-(--tri-w) [--tri-h:calc(1.75rem*var(--ui-scale))] [--tri-w:calc(4.375rem*var(--ui-scale))]";
|
|
22
|
+
};
|
|
23
|
+
state: {
|
|
24
|
+
no: "border-border bg-switch-track-off";
|
|
25
|
+
unset: "border-dashed border-border-strong bg-transparent";
|
|
26
|
+
yes: "border-accent bg-accent";
|
|
27
|
+
};
|
|
28
|
+
disabled: {
|
|
29
|
+
true: "cursor-not-allowed opacity-45";
|
|
30
|
+
false: "";
|
|
31
|
+
};
|
|
32
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
33
|
+
size: {
|
|
34
|
+
sm: "h-(--tri-h) w-(--tri-w) [--tri-h:calc(1.25rem*var(--ui-scale))] [--tri-w:calc(3.125rem*var(--ui-scale))]";
|
|
35
|
+
md: "h-(--tri-h) w-(--tri-w) [--tri-h:calc(1.5rem*var(--ui-scale))] [--tri-w:calc(3.75rem*var(--ui-scale))]";
|
|
36
|
+
lg: "h-(--tri-h) w-(--tri-w) [--tri-h:calc(1.75rem*var(--ui-scale))] [--tri-w:calc(4.375rem*var(--ui-scale))]";
|
|
37
|
+
};
|
|
38
|
+
state: {
|
|
39
|
+
no: "border-border bg-switch-track-off";
|
|
40
|
+
unset: "border-dashed border-border-strong bg-transparent";
|
|
41
|
+
yes: "border-accent bg-accent";
|
|
42
|
+
};
|
|
43
|
+
disabled: {
|
|
44
|
+
true: "cursor-not-allowed opacity-45";
|
|
45
|
+
false: "";
|
|
46
|
+
};
|
|
47
|
+
}, undefined>>;
|
|
48
|
+
export type TriStateSwitchSize = NonNullable<VariantProps<typeof track>["size"]>;
|
|
49
|
+
export interface TriStateSwitchProps {
|
|
50
|
+
/** `true` Yes, `false` No, `null` not answered. */
|
|
51
|
+
value: boolean | null;
|
|
52
|
+
onValueChange: (value: boolean | null) => void;
|
|
53
|
+
/** The question being answered — the group's accessible name. Required. */
|
|
54
|
+
"aria-label": string;
|
|
55
|
+
/** The words for each stop, read aloud and shown in the caption. */
|
|
56
|
+
labels?: {
|
|
57
|
+
yes?: string;
|
|
58
|
+
no?: string;
|
|
59
|
+
unset?: string;
|
|
60
|
+
};
|
|
61
|
+
/** Shows the current state's word beside the track. @default true */
|
|
62
|
+
showCaption?: boolean;
|
|
63
|
+
disabled?: boolean;
|
|
64
|
+
/** @default "md" */
|
|
65
|
+
size?: TriStateSwitchSize;
|
|
66
|
+
className?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare function TriStateSwitch({ value, onValueChange, "aria-label": ariaLabel, labels, showCaption, disabled, size, className, }: TriStateSwitchProps): import("react").JSX.Element;
|
|
69
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { SettingRow, SettingGroup, type SettingRowProps, type SettingGroupProps,
|
|
|
27
27
|
export { DescriptionList, DescriptionListItem, type DescriptionListProps, type DescriptionListItemProps, type DescriptionListEntry, } from "./components/DescriptionList";
|
|
28
28
|
export { ConnectionCard, type ConnectionCardProps, type ConnectionHealth, } from "./components/ConnectionCard";
|
|
29
29
|
export { Checkbox, Switch, Radio, RadioGroup, CheckboxField, SwitchField, RadioField, RadioCard, type CheckboxProps, type SwitchProps, type RadioProps, type RadioGroupProps, type CheckboxFieldProps, type SwitchFieldProps, type RadioFieldProps, type RadioCardProps, } from "./components/Choice";
|
|
30
|
+
export { TriStateSwitch, type TriStateSwitchProps, type TriStateSwitchSize, } from "./components/TriStateSwitch";
|
|
30
31
|
export { Dialog, DialogClose, AlertDialog, type DialogProps, type AlertDialogProps, } from "./components/Dialog";
|
|
31
32
|
export { Popover, PopoverClose, Tooltip, TooltipProvider, type PopoverProps, type TooltipProps, } from "./components/Popover";
|
|
32
33
|
export { Toaster, ToastProvider, useToast, type ToasterProps, type ToastProviderProps, type ToastOptions, type ToastTone, } from "./components/Toast";
|