@danxbot/ui 7.3.0 → 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 +8122 -8017
- package/dist/index.js.map +1 -1
- package/dist/types/components/DateCalendar.d.ts +11 -0
- package/dist/types/components/TriStateSwitch.d.ts +69 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3,6 +3,17 @@ export type DateRange = {
|
|
|
3
3
|
from: Date | null;
|
|
4
4
|
to: Date | null;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* The popover a calendar opens in — ONE size for every control that opens one (`DatePicker`,
|
|
8
|
+
* `DateField`), so they cannot drift apart.
|
|
9
|
+
*
|
|
10
|
+
* A touch day is floored to 44px (`dx-tap`), so seven of them need 308px, and a popover is capped
|
|
11
|
+
* at 90vw. With the old fixed 20.5rem frame plus 12px padding a 375px phone clipped the Sunday
|
|
12
|
+
* column, the next-month arrow and Clear (SG-906, measured). So on a coarse pointer the padding
|
|
13
|
+
* drops to 8px and the calendar fills the popover instead of fixing its own width: 308px of days +
|
|
14
|
+
* 16px of padding = 324px, which is 90vw of a 360px phone. On a mouse nothing changes size.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CALENDAR_POPOVER_CLASS = "w-[19rem] p-3 pointer-coarse:w-[22rem] pointer-coarse:p-2";
|
|
6
17
|
export interface DateCalendarProps {
|
|
7
18
|
/** A single date, or a range when `range` is set. */
|
|
8
19
|
value?: Date | DateRange | null;
|
|
@@ -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";
|