@justanarthur/modo-ui 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/LICENSE.beui +21 -0
- package/LICENSE.fluid-functionalism +21 -0
- package/LICENSE.motion-primitives +21 -0
- package/LICENSE.sileo +21 -0
- package/README.md +608 -2
- package/dist/base.css +994 -0
- package/dist/blocks/sidebar-app/index.d.ts +34 -0
- package/dist/blocks/sidebar-app/index.js +34 -0
- package/dist/components/badge/index.d.ts +59 -0
- package/dist/components/badge/index.js +18 -0
- package/dist/components/button/index.d.ts +59 -0
- package/dist/components/button/index.js +16 -0
- package/dist/components/card/index.d.ts +141 -0
- package/dist/components/card/index.js +44 -0
- package/dist/components/inputs/checkbox-group/index.d.ts +50 -0
- package/dist/components/inputs/checkbox-group/index.js +23 -0
- package/dist/components/inputs/color-picker/index.d.ts +137 -0
- package/dist/components/inputs/color-picker/index.js +37 -0
- package/dist/components/inputs/combobox/index.d.ts +161 -0
- package/dist/components/inputs/combobox/index.js +41 -0
- package/dist/components/inputs/date-time/calendar/index.d.ts +45 -0
- package/dist/components/inputs/date-time/calendar/index.js +20 -0
- package/dist/components/inputs/date-time/date-picker/index.d.ts +82 -0
- package/dist/components/inputs/date-time/date-picker/index.js +34 -0
- package/dist/components/inputs/date-time/date-range-picker/index.d.ts +64 -0
- package/dist/components/inputs/date-time/date-range-picker/index.js +33 -0
- package/dist/components/inputs/date-time/duration-picker/index.d.ts +57 -0
- package/dist/components/inputs/date-time/duration-picker/index.js +33 -0
- package/dist/components/inputs/date-time/month-picker/index.d.ts +57 -0
- package/dist/components/inputs/date-time/month-picker/index.js +32 -0
- package/dist/components/inputs/date-time/time-picker/index.d.ts +59 -0
- package/dist/components/inputs/date-time/time-picker/index.js +33 -0
- package/dist/components/inputs/input/index.d.ts +84 -0
- package/dist/components/inputs/input/index.js +20 -0
- package/dist/components/inputs/input-copy/index.d.ts +44 -0
- package/dist/components/inputs/input-copy/index.js +18 -0
- package/dist/components/inputs/input-message/index.d.ts +125 -0
- package/dist/components/inputs/input-message/index.js +27 -0
- package/dist/components/inputs/radio-group/index.d.ts +58 -0
- package/dist/components/inputs/radio-group/index.js +22 -0
- package/dist/components/inputs/search/index.d.ts +83 -0
- package/dist/components/inputs/search/index.js +28 -0
- package/dist/components/inputs/select/index.d.ts +105 -0
- package/dist/components/inputs/select/index.js +37 -0
- package/dist/components/inputs/slider/index.d.ts +108 -0
- package/dist/components/inputs/slider/index.js +16 -0
- package/dist/components/inputs/switch/index.d.ts +43 -0
- package/dist/components/inputs/switch/index.js +16 -0
- package/dist/components/navigation/accordion/index.d.ts +117 -0
- package/dist/components/navigation/accordion/index.js +30 -0
- package/dist/components/navigation/sidebar/index.d.ts +388 -0
- package/dist/components/navigation/sidebar/index.js +101 -0
- package/dist/components/navigation/tabs/index.d.ts +70 -0
- package/dist/components/navigation/tabs/index.js +25 -0
- package/dist/components/navigation/tabs-subtle/index.d.ts +73 -0
- package/dist/components/navigation/tabs-subtle/index.js +23 -0
- package/dist/components/overlays/alert-dialog/index.d.ts +67 -0
- package/dist/components/overlays/alert-dialog/index.js +24 -0
- package/dist/components/overlays/command/index.d.ts +121 -0
- package/dist/components/overlays/command/index.js +39 -0
- package/dist/components/overlays/context-menu/index.d.ts +97 -0
- package/dist/components/overlays/context-menu/index.js +32 -0
- package/dist/components/overlays/dialog/index.d.ts +130 -0
- package/dist/components/overlays/dialog/index.js +39 -0
- package/dist/components/overlays/dropdown/index.d.ts +222 -0
- package/dist/components/overlays/dropdown/index.js +47 -0
- package/dist/components/overlays/popover/index.d.ts +87 -0
- package/dist/components/overlays/popover/index.js +28 -0
- package/dist/components/overlays/preview-card/index.d.ts +75 -0
- package/dist/components/overlays/preview-card/index.js +21 -0
- package/dist/components/overlays/sheet/index.d.ts +67 -0
- package/dist/components/overlays/sheet/index.js +26 -0
- package/dist/components/overlays/toast/index.d.ts +107 -0
- package/dist/components/overlays/toast/index.js +23 -0
- package/dist/components/overlays/tooltip/index.d.ts +75 -0
- package/dist/components/overlays/tooltip/index.js +19 -0
- package/dist/components/table/index.d.ts +44 -0
- package/dist/components/table/index.js +28 -0
- package/dist/components/thinking-indicator/index.d.ts +32 -0
- package/dist/components/thinking-indicator/index.js +15 -0
- package/dist/index.d.ts +3926 -0
- package/dist/index.js +513 -0
- package/dist/preset.d.ts +104 -0
- package/dist/preset.js +124 -0
- package/dist/primitives/code/index.d.ts +23 -0
- package/dist/primitives/code/index.js +12 -0
- package/dist/primitives/craft/index.d.ts +31 -0
- package/dist/primitives/craft/index.js +13 -0
- package/dist/primitives/fluid-hover/index.d.ts +233 -0
- package/dist/primitives/fluid-hover/index.js +27 -0
- package/dist/primitives/morph/index.d.ts +127 -0
- package/dist/primitives/morph/index.js +21 -0
- package/dist/primitives/motion/index.d.ts +115 -0
- package/dist/primitives/motion/index.js +20 -0
- package/dist/primitives/scroll-area/index.d.ts +41 -0
- package/dist/primitives/scroll-area/index.js +13 -0
- package/dist/primitives/sizes/index.d.ts +128 -0
- package/dist/primitives/sizes/index.js +22 -0
- package/dist/primitives/surface/index.d.ts +69 -0
- package/dist/primitives/surface/index.js +18 -0
- package/dist/shared/components-0f0as45n.js +17 -0
- package/dist/shared/components-40j34hdb.js +986 -0
- package/dist/shared/components-4hh0gm0v.js +292 -0
- package/dist/shared/components-4xxddc44.js +15 -0
- package/dist/shared/components-4xxtggzp.js +110 -0
- package/dist/shared/components-54nf2x99.js +293 -0
- package/dist/shared/components-5pkcfprd.js +232 -0
- package/dist/shared/components-5vxtcp88.js +9 -0
- package/dist/shared/components-5zry9te1.js +152 -0
- package/dist/shared/components-61ckf42z.js +220 -0
- package/dist/shared/components-6hzwfmfd.js +58 -0
- package/dist/shared/components-6phwsry6.js +361 -0
- package/dist/shared/components-6t6nr33r.js +86 -0
- package/dist/shared/components-6y1th6k4.js +111 -0
- package/dist/shared/components-74c20v2f.js +32 -0
- package/dist/shared/components-7cqq1sqy.js +193 -0
- package/dist/shared/components-7gv95yfy.js +496 -0
- package/dist/shared/components-7nww01w4.js +375 -0
- package/dist/shared/components-7zp99w5d.js +62 -0
- package/dist/shared/components-8hk9ve3r.js +1200 -0
- package/dist/shared/components-8hzbsfbd.js +123 -0
- package/dist/shared/components-9p8s8n5q.js +171 -0
- package/dist/shared/components-aaq3yk4f.js +304 -0
- package/dist/shared/components-bf2d9k02.js +484 -0
- package/dist/shared/components-bkvb6nem.js +63 -0
- package/dist/shared/components-brnzrp2t.js +262 -0
- package/dist/shared/components-csxz9f52.js +42 -0
- package/dist/shared/components-de8xsm9y.js +22 -0
- package/dist/shared/components-dg0w8g5p.js +26 -0
- package/dist/shared/components-dphg9gjr.js +42 -0
- package/dist/shared/components-e46kf6cp.js +298 -0
- package/dist/shared/components-ed7cmssr.js +105 -0
- package/dist/shared/components-ess3ch6w.js +137 -0
- package/dist/shared/components-gjfrycb5.js +984 -0
- package/dist/shared/components-gndm6am4.js +128 -0
- package/dist/shared/components-hjkrv00c.js +191 -0
- package/dist/shared/components-hzfp4tjb.js +270 -0
- package/dist/shared/components-j65qt1mq.js +719 -0
- package/dist/shared/components-jw16snbn.js +19 -0
- package/dist/shared/components-jxgznftn.js +146 -0
- package/dist/shared/components-kf2ehztc.js +216 -0
- package/dist/shared/components-kpbcms10.js +9 -0
- package/dist/shared/components-m5br529r.js +141 -0
- package/dist/shared/components-nn6xezy2.js +1828 -0
- package/dist/shared/components-nnnd2xef.js +9 -0
- package/dist/shared/components-p2vmyfe1.js +345 -0
- package/dist/shared/components-peg09pzs.js +79 -0
- package/dist/shared/components-r22vtgqc.js +45 -0
- package/dist/shared/components-r2gke5p6.js +1759 -0
- package/dist/shared/components-r43mqnd6.js +160 -0
- package/dist/shared/components-r4jt6hgd.js +58 -0
- package/dist/shared/components-rc63qsy6.js +159 -0
- package/dist/shared/components-s3yfvfkr.js +149 -0
- package/dist/shared/components-s5pkbjx1.js +445 -0
- package/dist/shared/components-tad5h7ta.js +346 -0
- package/dist/shared/components-taxmgbnh.js +120 -0
- package/dist/shared/components-tm88ghva.js +215 -0
- package/dist/shared/components-v7es8aan.js +144 -0
- package/dist/shared/components-vb033rns.js +28 -0
- package/dist/shared/components-vc1k7yv2.js +30 -0
- package/dist/shared/components-vktws5r6.js +667 -0
- package/dist/shared/components-x2xyckd5.js +198 -0
- package/dist/shared/components-x3rz4cyn.js +61 -0
- package/dist/shared/components-xszag63d.js +141 -0
- package/dist/shared/components-y3cqdrgy.js +291 -0
- package/dist/shared/components-zvb11ker.js +288 -0
- package/dist/shared/components-zx2hr57f.js +124 -0
- package/dist/styles.css +1949 -0
- package/dist/tailwind.css +219 -0
- package/dist/tokens.css +345 -0
- package/package.json +102 -3
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Locale } from "date-fns";
|
|
2
|
+
import { RefObject } from "react";
|
|
3
|
+
type SizeVariant = "default" | "compact";
|
|
4
|
+
import { JSX as JSX_1kxb } from "react";
|
|
5
|
+
interface MonthPickerProps {
|
|
6
|
+
/** The picked month as its first day; `null` when empty. */
|
|
7
|
+
value?: Date | null;
|
|
8
|
+
/** Initial month, for an uncontrolled picker. Defaults to `null`. */
|
|
9
|
+
defaultValue?: Date | null;
|
|
10
|
+
/** Called with the new month's first day, or `null` when the field is cleared. */
|
|
11
|
+
onValueChange?: (value: Date | null) => void;
|
|
12
|
+
/** A react-day-picker / date-fns locale: month names and what typing reads. Defaults to `enUS`. */
|
|
13
|
+
locale?: Locale;
|
|
14
|
+
/** Shown while empty. */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** The first month that can be picked. Defaults to 100 years back. */
|
|
17
|
+
startMonth?: Date;
|
|
18
|
+
/** The last month that can be picked. Defaults to 50 years ahead. */
|
|
19
|
+
endMonth?: Date;
|
|
20
|
+
/** Disables the field. Defaults to `false`. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Marks the field invalid. Defaults to `false`. */
|
|
23
|
+
invalid?: boolean;
|
|
24
|
+
/** Pins the field and its panel to one step of the size ladder. Defaults to the surrounding SizeProvider. */
|
|
25
|
+
size?: SizeVariant;
|
|
26
|
+
/** Controlled open state. */
|
|
27
|
+
open?: boolean;
|
|
28
|
+
/** Initial open state, for an uncontrolled panel. Defaults to `false`. */
|
|
29
|
+
defaultOpen?: boolean;
|
|
30
|
+
/** Called when the panel opens or closes. */
|
|
31
|
+
onOpenChange?: (open: boolean) => void;
|
|
32
|
+
/** Id of the field, for a `Label`'s `htmlFor`. */
|
|
33
|
+
id?: string;
|
|
34
|
+
/** Where the panel grows from (see Morph): the field, the press point, its own center, a viewport edge, or a ref to any element. Defaults to `'trigger'` (the field). */
|
|
35
|
+
from?: "trigger" | "pointer" | "center" | "top" | "right" | "bottom" | "left" | RefObject<HTMLElement | null>;
|
|
36
|
+
/** How the panel grows (see Morph), as Combobox's list does: with the liquid goo neck, a plain morph, a slide or a fade. `'morph'` with `hideSource` opens it in place over the field. Defaults to `'goo'`. */
|
|
37
|
+
effect?: "goo" | "morph" | "slide" | "fade";
|
|
38
|
+
/** Hide the field while open, so it reads as turning into the panel. Defaults to `false`. */
|
|
39
|
+
hideSource?: boolean;
|
|
40
|
+
/** Spring tier of a plain morph, slide or fade; goo runs on its own `spring.goo`. Defaults to `'moderate'`. */
|
|
41
|
+
tier?: "moderate" | "slow";
|
|
42
|
+
/** Classes for the field. */
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
46
|
+
/**
|
|
47
|
+
* A field for a month of a year: a billing period, a card's expiry.
|
|
48
|
+
*
|
|
49
|
+
* The panel has the month as text to type over ("October 2026", "10/2026"),
|
|
50
|
+
* above a month column and a year column; the picked month and year carry a
|
|
51
|
+
* dot. The value is the month's first day, the way react-day-picker names a
|
|
52
|
+
* month.
|
|
53
|
+
*
|
|
54
|
+
* @example {@include ./examples.mdx}
|
|
55
|
+
*/
|
|
56
|
+
declare function MonthPicker({ value: valueProp, defaultValue, onValueChange, locale, placeholder, startMonth, endMonth, disabled, invalid, size, open: openProp, defaultOpen, onOpenChange, id, from, effect, hideSource, tier, className }: MonthPickerProps): Element_12xgc;
|
|
57
|
+
export { MonthPicker as default, MonthPickerProps, MonthPicker };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MonthPicker,
|
|
3
|
+
month_picker_default
|
|
4
|
+
} from "../../../../shared/components-zx2hr57f.js";
|
|
5
|
+
import"../../../../shared/components-hzfp4tjb.js";
|
|
6
|
+
import"../../../../shared/components-x2xyckd5.js";
|
|
7
|
+
import"../../../../shared/components-4xxddc44.js";
|
|
8
|
+
import"../../../../shared/components-r43mqnd6.js";
|
|
9
|
+
import"../../../../shared/components-7cqq1sqy.js";
|
|
10
|
+
import"../../../../shared/components-de8xsm9y.js";
|
|
11
|
+
import"../../../../shared/components-vb033rns.js";
|
|
12
|
+
import"../../../../shared/components-61ckf42z.js";
|
|
13
|
+
import"../../../../shared/components-5vxtcp88.js";
|
|
14
|
+
import"../../../../shared/components-5pkcfprd.js";
|
|
15
|
+
import"../../../../shared/components-m5br529r.js";
|
|
16
|
+
import"../../../../shared/components-csxz9f52.js";
|
|
17
|
+
import"../../../../shared/components-jxgznftn.js";
|
|
18
|
+
import"../../../../shared/components-r22vtgqc.js";
|
|
19
|
+
import"../../../../shared/components-e46kf6cp.js";
|
|
20
|
+
import"../../../../shared/components-7zp99w5d.js";
|
|
21
|
+
import"../../../../shared/components-dg0w8g5p.js";
|
|
22
|
+
import"../../../../shared/components-kf2ehztc.js";
|
|
23
|
+
import"../../../../shared/components-7nww01w4.js";
|
|
24
|
+
import"../../../../shared/components-nnnd2xef.js";
|
|
25
|
+
import"../../../../shared/components-vc1k7yv2.js";
|
|
26
|
+
import"../../../../shared/components-x3rz4cyn.js";
|
|
27
|
+
import"../../../../shared/components-0f0as45n.js";
|
|
28
|
+
import"../../../../shared/components-kpbcms10.js";
|
|
29
|
+
export {
|
|
30
|
+
month_picker_default as default,
|
|
31
|
+
MonthPicker
|
|
32
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Locale as Locale2 } from "date-fns";
|
|
2
|
+
import { RefObject } from "react";
|
|
3
|
+
type HourCycle = "h11" | "h12" | "h23" | "h24";
|
|
4
|
+
type SizeVariant = "default" | "compact";
|
|
5
|
+
import { JSX as JSX_1kxb } from "react";
|
|
6
|
+
interface TimePickerProps {
|
|
7
|
+
/** The picked time as `"HH:mm"` on a 24-hour clock (an `<input type="time">`'s value); `null` when empty. */
|
|
8
|
+
value?: string | null;
|
|
9
|
+
/** Initial time, for an uncontrolled picker. Defaults to `null`. */
|
|
10
|
+
defaultValue?: string | null;
|
|
11
|
+
/** Called with the new `"HH:mm"`, or `null` when the field is cleared. */
|
|
12
|
+
onValueChange?: (value: string | null) => void;
|
|
13
|
+
/** The clock shown: on `'h12'` / `'h11'` the hours read with AM/PM. Defaults to the locale's. */
|
|
14
|
+
hourCycle?: HourCycle;
|
|
15
|
+
/** Steps between the minute column's options. Defaults to `1`. */
|
|
16
|
+
minuteStep?: number;
|
|
17
|
+
/** A react-day-picker / date-fns locale: the time's format and the AM/PM names. Defaults to `enUS`. */
|
|
18
|
+
locale?: Locale2;
|
|
19
|
+
/** Shown while empty. */
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
/** Disables the field. Defaults to `false`. */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Marks the field invalid. Defaults to `false`. */
|
|
24
|
+
invalid?: boolean;
|
|
25
|
+
/** Pins the field and its panel to one step of the size ladder. Defaults to the surrounding SizeProvider. */
|
|
26
|
+
size?: SizeVariant;
|
|
27
|
+
/** Controlled open state. */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
/** Initial open state, for an uncontrolled panel. Defaults to `false`. */
|
|
30
|
+
defaultOpen?: boolean;
|
|
31
|
+
/** Called when the panel opens or closes. */
|
|
32
|
+
onOpenChange?: (open: boolean) => void;
|
|
33
|
+
/** Id of the field, for a `Label`'s `htmlFor`. */
|
|
34
|
+
id?: string;
|
|
35
|
+
/** Where the panel grows from (see Morph): the field, the press point, its own center, a viewport edge, or a ref to any element. Defaults to `'trigger'` (the field). */
|
|
36
|
+
from?: "trigger" | "pointer" | "center" | "top" | "right" | "bottom" | "left" | RefObject<HTMLElement | null>;
|
|
37
|
+
/** How the panel grows (see Morph), as Combobox's list does: with the liquid goo neck, a plain morph, a slide or a fade. `'morph'` with `hideSource` opens it in place over the field. Defaults to `'goo'`. */
|
|
38
|
+
effect?: "goo" | "morph" | "slide" | "fade";
|
|
39
|
+
/** Hide the field while open, so it reads as turning into the panel. Defaults to `false`. */
|
|
40
|
+
hideSource?: boolean;
|
|
41
|
+
/** Spring tier of a plain morph, slide or fade; goo runs on its own `spring.goo`. Defaults to `'moderate'`. */
|
|
42
|
+
tier?: "moderate" | "slow";
|
|
43
|
+
/** Classes for the field. */
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
47
|
+
/**
|
|
48
|
+
* A time-of-day field with scrolling hour and minute columns.
|
|
49
|
+
*
|
|
50
|
+
* The panel opens with the time as text, selected and ready to type over
|
|
51
|
+
* ("15:33", "3:33 PM"), above an hour column and a minute column; on a
|
|
52
|
+
* 12-hour clock the hours read with AM/PM. Each column keeps its pick in the middle and
|
|
53
|
+
* marks it with a dot. The value is `"HH:mm"` on a 24-hour clock whatever the
|
|
54
|
+
* locale shows, the same as a native time input's.
|
|
55
|
+
*
|
|
56
|
+
* @example {@include ./examples.mdx}
|
|
57
|
+
*/
|
|
58
|
+
declare function TimePicker({ value: valueProp, defaultValue, onValueChange, hourCycle, minuteStep, locale, placeholder, disabled, invalid, size, open: openProp, defaultOpen, onOpenChange, id, from, effect, hideSource, tier, className }: TimePickerProps): Element_12xgc;
|
|
59
|
+
export { TimePicker as default, TimePickerProps, TimePicker };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TimePicker,
|
|
3
|
+
time_picker_default
|
|
4
|
+
} from "../../../../shared/components-4xxtggzp.js";
|
|
5
|
+
import"../../../../shared/components-r4jt6hgd.js";
|
|
6
|
+
import"../../../../shared/components-hzfp4tjb.js";
|
|
7
|
+
import"../../../../shared/components-x2xyckd5.js";
|
|
8
|
+
import"../../../../shared/components-4xxddc44.js";
|
|
9
|
+
import"../../../../shared/components-r43mqnd6.js";
|
|
10
|
+
import"../../../../shared/components-7cqq1sqy.js";
|
|
11
|
+
import"../../../../shared/components-de8xsm9y.js";
|
|
12
|
+
import"../../../../shared/components-vb033rns.js";
|
|
13
|
+
import"../../../../shared/components-61ckf42z.js";
|
|
14
|
+
import"../../../../shared/components-5vxtcp88.js";
|
|
15
|
+
import"../../../../shared/components-5pkcfprd.js";
|
|
16
|
+
import"../../../../shared/components-m5br529r.js";
|
|
17
|
+
import"../../../../shared/components-csxz9f52.js";
|
|
18
|
+
import"../../../../shared/components-jxgznftn.js";
|
|
19
|
+
import"../../../../shared/components-r22vtgqc.js";
|
|
20
|
+
import"../../../../shared/components-e46kf6cp.js";
|
|
21
|
+
import"../../../../shared/components-7zp99w5d.js";
|
|
22
|
+
import"../../../../shared/components-dg0w8g5p.js";
|
|
23
|
+
import"../../../../shared/components-kf2ehztc.js";
|
|
24
|
+
import"../../../../shared/components-7nww01w4.js";
|
|
25
|
+
import"../../../../shared/components-nnnd2xef.js";
|
|
26
|
+
import"../../../../shared/components-vc1k7yv2.js";
|
|
27
|
+
import"../../../../shared/components-x3rz4cyn.js";
|
|
28
|
+
import"../../../../shared/components-0f0as45n.js";
|
|
29
|
+
import"../../../../shared/components-kpbcms10.js";
|
|
30
|
+
export {
|
|
31
|
+
time_picker_default as default,
|
|
32
|
+
TimePicker
|
|
33
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactNode as ReactNode2, RefAttributes } from "react";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
|
+
interface IconComponentProps {
|
|
4
|
+
size?: number | string;
|
|
5
|
+
strokeWidth?: number | string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
type IconComponent = ComponentType<IconComponentProps>;
|
|
9
|
+
type SizeVariant = "default" | "compact";
|
|
10
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "defaultValue" | "size"> {
|
|
11
|
+
/** Placeholder text. */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** Leading icon inside the input. */
|
|
14
|
+
icon?: IconComponent;
|
|
15
|
+
/** Controlled input value. */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** Initial value when uncontrolled. Defaults to `''`. */
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
/** Called when the input value changes. */
|
|
20
|
+
onChange?: (value: string) => void;
|
|
21
|
+
/** Marks the value invalid: the field turns destructive and sets `aria-invalid`. Defaults to `false`. */
|
|
22
|
+
invalid?: boolean;
|
|
23
|
+
/** Disables the input. Defaults to `false`. */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Pins the input to one step of the size ladder (default 36px, compact 28px). Defaults to the surrounding SizeProvider. */
|
|
26
|
+
size?: SizeVariant;
|
|
27
|
+
/** Classes for the ringed box around the input. */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Text input with a fluid hover ring.
|
|
32
|
+
*
|
|
33
|
+
* At rest the field is bare text on the page. Hover lifts it onto a muted
|
|
34
|
+
* ground with a hairline ring, focus onto the card ground, and its leading
|
|
35
|
+
* icon thickens. `invalid` turns it destructive. It is uncontrolled with
|
|
36
|
+
* `defaultValue`, or controlled with `value` + `onChange`, and fills the width
|
|
37
|
+
* of its container. Pair it with a `Label` through `htmlFor` / `id`.
|
|
38
|
+
*
|
|
39
|
+
* Also exported from this item:
|
|
40
|
+
* - `Label` — the field label, weight-stable and inset to line up with the
|
|
41
|
+
* input's text: `htmlFor`, `invalid`, `size`.
|
|
42
|
+
* - `InputGroup` — stacks labelled fields and tracks the pointer across them,
|
|
43
|
+
* so the hover glides from field to field: `size` pins every field to one
|
|
44
|
+
* step of the ladder.
|
|
45
|
+
* - `InputGroup.Field` — one labelled Input in a group, wired as a Base UI
|
|
46
|
+
* `Field` (label, control and error message linked for assistive tech):
|
|
47
|
+
* `index` (its position, for the fluid hover), `label`, `labelHidden`,
|
|
48
|
+
* `error` (a message below the input; marks it invalid), plus Input's props.
|
|
49
|
+
*
|
|
50
|
+
* @example {@include ./examples.mdx}
|
|
51
|
+
*/
|
|
52
|
+
declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
53
|
+
interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
54
|
+
/** Label text. */
|
|
55
|
+
children: ReactNode2;
|
|
56
|
+
/** Turns the label destructive, matching an invalid Input. Defaults to `false`. */
|
|
57
|
+
invalid?: boolean;
|
|
58
|
+
/** Pins the label to one step of the size ladder. Defaults to the surrounding SizeProvider. */
|
|
59
|
+
size?: SizeVariant;
|
|
60
|
+
}
|
|
61
|
+
declare const Label: ForwardRefExoticComponent<LabelProps & RefAttributes<HTMLLabelElement>>;
|
|
62
|
+
interface InputGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
63
|
+
/** One or more InputGroup.Field children. */
|
|
64
|
+
children: ReactNode2;
|
|
65
|
+
/** Pins the group's fields to one step of the size ladder (default 36px, compact 28px). Defaults to the surrounding SizeProvider. */
|
|
66
|
+
size?: SizeVariant;
|
|
67
|
+
}
|
|
68
|
+
type InputGroupComponent = ForwardRefExoticComponent<InputGroupProps & RefAttributes<HTMLDivElement>> & {
|
|
69
|
+
Field: typeof InputField;
|
|
70
|
+
};
|
|
71
|
+
declare const InputGroup: InputGroupComponent;
|
|
72
|
+
interface InputFieldProps extends Omit<InputProps, "invalid" | "size" | "className"> {
|
|
73
|
+
/** Label text above the input. */
|
|
74
|
+
label: string;
|
|
75
|
+
/** Keep the label for assistive tech but don't render it — for inline fields (a toolbar search) where the placeholder carries the meaning. Defaults to `false`. */
|
|
76
|
+
labelHidden?: boolean;
|
|
77
|
+
/** Position index within the group (required for fluid hover). */
|
|
78
|
+
index: number;
|
|
79
|
+
/** Error message shown below the input. */
|
|
80
|
+
error?: string;
|
|
81
|
+
className?: string;
|
|
82
|
+
}
|
|
83
|
+
declare const InputField: ForwardRefExoticComponent<InputFieldProps & RefAttributes<HTMLDivElement>>;
|
|
84
|
+
export { Input as default, LabelProps, Label, InputProps, InputGroupProps, InputGroup, InputFieldProps, Input };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Input,
|
|
3
|
+
InputGroup,
|
|
4
|
+
Label,
|
|
5
|
+
input_default
|
|
6
|
+
} from "../../../shared/components-7cqq1sqy.js";
|
|
7
|
+
import"../../../shared/components-de8xsm9y.js";
|
|
8
|
+
import"../../../shared/components-vb033rns.js";
|
|
9
|
+
import"../../../shared/components-e46kf6cp.js";
|
|
10
|
+
import"../../../shared/components-7zp99w5d.js";
|
|
11
|
+
import"../../../shared/components-dg0w8g5p.js";
|
|
12
|
+
import"../../../shared/components-x3rz4cyn.js";
|
|
13
|
+
import"../../../shared/components-0f0as45n.js";
|
|
14
|
+
import"../../../shared/components-kpbcms10.js";
|
|
15
|
+
export {
|
|
16
|
+
input_default as default,
|
|
17
|
+
Label,
|
|
18
|
+
InputGroup,
|
|
19
|
+
Input
|
|
20
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
type SizeVariant = "default" | "compact";
|
|
3
|
+
import { ForwardRefExoticComponent as ForwardRefExoticComponent_tcubfn } from "react";
|
|
4
|
+
import { RefAttributes as RefAttributes_miuf56 } from "react";
|
|
5
|
+
type InputCopyVariant = "icon" | "button";
|
|
6
|
+
type InputCopyAlign = "right" | "left";
|
|
7
|
+
interface InputCopyProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
8
|
+
/** The text value to display and copy to clipboard. */
|
|
9
|
+
value: string;
|
|
10
|
+
/** Optional label displayed above the input. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Callback fired after the value is successfully copied. */
|
|
13
|
+
onCopy?: () => void;
|
|
14
|
+
/** Disables the input and copy button. Defaults to `false`. */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Icon-only with tooltip, or button with visible label. Defaults to `"icon"`. */
|
|
17
|
+
variant?: InputCopyVariant;
|
|
18
|
+
/** Position of the copy action relative to the value. Defaults to `"right"`. */
|
|
19
|
+
align?: InputCopyAlign;
|
|
20
|
+
/** Pins the field to one step of the size ladder (default 36px, compact 28px — see Sizes). Omitted, it follows the surrounding SizeProvider. */
|
|
21
|
+
size?: SizeVariant;
|
|
22
|
+
/** Extra classes for the wrapper around the label and the field. */
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Read-only input with a copy-to-clipboard button and animated check
|
|
27
|
+
* feedback.
|
|
28
|
+
*
|
|
29
|
+
* The whole row is the button: click anywhere on it and the value goes to
|
|
30
|
+
* the clipboard, the copy glyph's two sheets melt into a tinted disc (the
|
|
31
|
+
* goo of Morph) behind a check that draws itself, and the tooltip flips to
|
|
32
|
+
* "Copied" for 2 seconds; then the disc splits back into the glyph. The value is monospaced and
|
|
33
|
+
* highlights on hover so it reads as one selectable token rather than a
|
|
34
|
+
* text field, and the async Clipboard API falls back to an off-screen
|
|
35
|
+
* textarea + `execCommand` where it is unavailable (insecure context,
|
|
36
|
+
* permissions policy) — a failure animates a ✕ and says so. `variant`
|
|
37
|
+
* switches between the icon-only affordance (with a tooltip) and a labelled
|
|
38
|
+
* Copy button, `align` moves that action to the leading edge, and the field
|
|
39
|
+
* follows the surrounding SizeProvider unless `size` pins it.
|
|
40
|
+
*
|
|
41
|
+
* @example {@include ./examples.mdx}
|
|
42
|
+
*/
|
|
43
|
+
declare const InputCopy: ForwardRefExoticComponent_tcubfn<InputCopyProps & RefAttributes_miuf56<HTMLDivElement>>;
|
|
44
|
+
export { InputCopy as default, InputCopyVariant, InputCopyProps, InputCopyAlign, InputCopy };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InputCopy,
|
|
3
|
+
input_copy_default
|
|
4
|
+
} from "../../../shared/components-p2vmyfe1.js";
|
|
5
|
+
import"../../../shared/components-gndm6am4.js";
|
|
6
|
+
import"../../../shared/components-m5br529r.js";
|
|
7
|
+
import"../../../shared/components-jxgznftn.js";
|
|
8
|
+
import"../../../shared/components-7zp99w5d.js";
|
|
9
|
+
import"../../../shared/components-7nww01w4.js";
|
|
10
|
+
import"../../../shared/components-nnnd2xef.js";
|
|
11
|
+
import"../../../shared/components-vc1k7yv2.js";
|
|
12
|
+
import"../../../shared/components-x3rz4cyn.js";
|
|
13
|
+
import"../../../shared/components-0f0as45n.js";
|
|
14
|
+
import"../../../shared/components-kpbcms10.js";
|
|
15
|
+
export {
|
|
16
|
+
input_copy_default as default,
|
|
17
|
+
InputCopy
|
|
18
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, TextareaHTMLAttributes } from "react";
|
|
2
|
+
type SizeVariant = "default" | "compact";
|
|
3
|
+
import { ForwardRefExoticComponent as ForwardRefExoticComponent_tcubfn } from "react";
|
|
4
|
+
import { RefAttributes as RefAttributes_miuf56 } from "react";
|
|
5
|
+
import { JSX as JSX_1kxb } from "react";
|
|
6
|
+
interface FileThumbnailProps {
|
|
7
|
+
file: File;
|
|
8
|
+
/** Side length of the square thumbnail in pixels. */
|
|
9
|
+
size: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
13
|
+
declare function FileThumbnail({ file, size, className }: FileThumbnailProps): Element_12xgc;
|
|
14
|
+
type InputMessageStatus = "idle" | "streaming";
|
|
15
|
+
interface InputMessageSlotContext {
|
|
16
|
+
/** Opens the native file picker via the hidden `<input type="file">`.
|
|
17
|
+
* Pass `acceptOverride` (e.g. `"image/*"`) to scope the picker to a
|
|
18
|
+
* subset of the component's accept types just for this invocation. */
|
|
19
|
+
openFilePicker: (acceptOverride?: string) => void;
|
|
20
|
+
/** Currently-attached files. */
|
|
21
|
+
files: File[];
|
|
22
|
+
}
|
|
23
|
+
type InputMessageSlot = ReactNode | ((ctx: InputMessageSlotContext) => ReactNode);
|
|
24
|
+
/** A message held in the queue while the assistant is responding. Carries the
|
|
25
|
+
* trimmed text plus a snapshot of the files attached when it was queued, so
|
|
26
|
+
* double-click-to-edit can restore both. `id` is a stable key minted on enqueue. */
|
|
27
|
+
interface QueuedMessage {
|
|
28
|
+
id: string;
|
|
29
|
+
text: string;
|
|
30
|
+
files: File[];
|
|
31
|
+
}
|
|
32
|
+
interface InputMessageProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
33
|
+
/** Step on the size ladder (see Sizes). Wins over the surrounding SizeProvider and propagates to the composer's rows, buttons and queued messages. */
|
|
34
|
+
size?: SizeVariant;
|
|
35
|
+
/** Controlled textarea value. Pair with `onValueChange`; omit both for an uncontrolled composer. */
|
|
36
|
+
value?: string;
|
|
37
|
+
/** Initial textarea value for an uncontrolled composer. Defaults to `""`. */
|
|
38
|
+
defaultValue?: string;
|
|
39
|
+
/** Called with the new value on every textarea change. */
|
|
40
|
+
onValueChange?: (value: string) => void;
|
|
41
|
+
/** Fires on Enter (without Shift) or send-button click, and when a queued message auto-dispatches. Receives the trimmed value, the attached files, and — for auto-dispatched queue items — `meta.queuedId`. Skipped when the value is empty and no files are attached. */
|
|
42
|
+
onSend?: (value: string, files: File[], meta?: {
|
|
43
|
+
queuedId?: string;
|
|
44
|
+
}) => void;
|
|
45
|
+
/** Placeholder shown when the value is empty. While a file is dragged over the component (and attachments are enabled) it swaps to "Drop files here to add to chat". Defaults to `"Ask me anything…"`. */
|
|
46
|
+
placeholder?: string;
|
|
47
|
+
/** Content rendered in the bottom-left action area. May be a render-fn that receives `{ openFilePicker, files }` — `openFilePicker(acceptOverride?)` opens the native file picker. */
|
|
48
|
+
leftSlot?: InputMessageSlot;
|
|
49
|
+
/** Content rendered in the bottom-right action area, before the built-in send button. Same render-fn shape as `leftSlot`. */
|
|
50
|
+
rightSlot?: InputMessageSlot;
|
|
51
|
+
/** Disables the textarea, send button, and drag-and-drop. Defaults to `false`. */
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
/** Minimum visible rows before the textarea grows. Defaults to 1. */
|
|
54
|
+
minRows?: number;
|
|
55
|
+
/** Maximum visible rows before the textarea starts to scroll. Defaults to 8. */
|
|
56
|
+
maxRows?: number;
|
|
57
|
+
/** When true, clicking anywhere on the surrounding container (outside of buttons / links / inputs) focuses the textarea. Defaults to `true`. */
|
|
58
|
+
clickToFocus?: boolean;
|
|
59
|
+
/** Accessible label for the send button. Defaults to `"Send"`. */
|
|
60
|
+
sendLabel?: string;
|
|
61
|
+
/** Controlled list of attached files. Pair with `onFilesChange` to enable drag-and-drop and the file-picker slot helper. */
|
|
62
|
+
files?: File[];
|
|
63
|
+
/** Initial attachments for an uncontrolled composer. Providing it (even as `[]`) enables attachment behavior on its own. */
|
|
64
|
+
defaultFiles?: File[];
|
|
65
|
+
/** Called when files are added (drag-drop or picker) or removed via the preview tile's × button. Duplicate drops of the same file (same name + size + lastModified) are silently de-duplicated. */
|
|
66
|
+
onFilesChange?: (files: File[]) => void;
|
|
67
|
+
/** Accepted MIME types as a comma-separated string. Used by both the file picker and the drag-and-drop filter. Defaults to `"image/png,image/jpeg,application/pdf"`. */
|
|
68
|
+
accept?: string;
|
|
69
|
+
/** Maximum number of attached files. Extra files beyond this limit are dropped. */
|
|
70
|
+
maxFiles?: number;
|
|
71
|
+
/** Side length (in pixels) of each preview tile. Images use object-cover; PDFs render the first page via pdfjs; other types fall back to a centered icon. Defaults to 80. */
|
|
72
|
+
filePreviewSize?: number;
|
|
73
|
+
/** Extra props forwarded to the underlying textarea (value, onChange, onKeyDown, disabled and placeholder are controlled by the component). */
|
|
74
|
+
textareaProps?: Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "onChange" | "onKeyDown" | "disabled" | "placeholder">;
|
|
75
|
+
/** Assistant response state. When `"streaming"`, the send button becomes a Stop control (empty draft) or a Queue action (non-empty draft). On the streaming→idle edge the next queued message auto-dispatches via `onSend`. Leave it and `defaultStatus` undefined for the send-immediately behavior. */
|
|
76
|
+
status?: InputMessageStatus;
|
|
77
|
+
/** Initial status for an uncontrolled composer — the component then owns the streaming flag, and Stop flips it to `"idle"` itself. */
|
|
78
|
+
defaultStatus?: InputMessageStatus;
|
|
79
|
+
/** Called whenever the status changes while it is uncontrolled (currently: the Stop control). */
|
|
80
|
+
onStatusChange?: (status: InputMessageStatus) => void;
|
|
81
|
+
/** Fires when the Stop control is pressed (streaming + empty draft). Halt the current response and set status to `"idle"` — that edge immediately dispatches the next queued message. */
|
|
82
|
+
onStop?: () => void;
|
|
83
|
+
/** Controlled queue of pending messages, rendered as reorderable rows above the textarea. Double-click (or Enter/F2) edits a row back into the composer; the × (or Delete) removes it; drag — or Alt+↑/↓ — reorders. Requires a status. */
|
|
84
|
+
queue?: QueuedMessage[];
|
|
85
|
+
/** Initial queue for an uncontrolled composer. Providing it (even as `[]`) enables the queue on its own, alongside `status` or `defaultStatus`. */
|
|
86
|
+
defaultQueue?: QueuedMessage[];
|
|
87
|
+
/** Called whenever the queue changes — enqueue, edit, delete, reorder, or auto-dispatch. Each QueuedMessage is `{ id, text, files }`. */
|
|
88
|
+
onQueueChange?: (queue: QueuedMessage[]) => void;
|
|
89
|
+
/** Render the built-in reorderable queue rows above the textarea. Set to false to suppress them and render the queue yourself — enqueue and auto-dispatch still run. Defaults to `true`. */
|
|
90
|
+
showQueue?: boolean;
|
|
91
|
+
/** Previously-sent messages, oldest first. With the textarea focused, ArrowUp (caret on the first line) recalls the previous message and walks backward; ArrowDown (caret on the last line) walks forward toward the in-progress draft. Editing or sending exits history mode. Defaults to `[]`. */
|
|
92
|
+
history?: string[];
|
|
93
|
+
/** Suggested prompt rendered as the placeholder (with a Tab keycap) while the draft is empty. Pressing Tab fills it into the composer — it doesn't send. Takes precedence over `placeholder`. */
|
|
94
|
+
placeholderSuggestion?: string;
|
|
95
|
+
/** Suggested prompts listed under the action bar while the draft is empty. ArrowDown moves a highlight into the list (focus stays in the textarea), ArrowUp walks back up and out, Enter or click fills the highlighted prompt. Escape drops the highlight; typing collapses the list. */
|
|
96
|
+
suggestions?: string[];
|
|
97
|
+
/** Extra classes for the composer surface. */
|
|
98
|
+
className?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Chat-style message composer with an auto-resizing textarea, flexible
|
|
102
|
+
* left/right action slots, and a built-in send button on a Surface-2
|
|
103
|
+
* substrate.
|
|
104
|
+
*
|
|
105
|
+
* The textarea grows from `minRows` to `maxRows` and then scrolls, Enter
|
|
106
|
+
* sends while Shift+Enter breaks the line, and the whole panel is one
|
|
107
|
+
* hairline ring that recolours in place for hover, focus and drag instead of
|
|
108
|
+
* layering a second border. Attachments drop anywhere on the composer (or
|
|
109
|
+
* come from `openFilePicker` in a slot) and preview as tiles — images
|
|
110
|
+
* object-cover, PDFs render their first page. `suggestions` open a listbox
|
|
111
|
+
* under the action bar that ↓/↑ walk without moving focus, and
|
|
112
|
+
* `placeholderSuggestion` writes a ghost prompt with a Tab keycap. With a
|
|
113
|
+
* `status` the send button morphs into Stop (empty draft) or Queue (draft
|
|
114
|
+
* typed while streaming); queued rows reorder by drag or Alt+↑/↓, edit back
|
|
115
|
+
* into the composer on double-click, and the head auto-dispatches on the
|
|
116
|
+
* streaming→idle edge.
|
|
117
|
+
*
|
|
118
|
+
* Every controlled prop has an uncontrolled twin — `defaultValue`,
|
|
119
|
+
* `defaultFiles`, `defaultQueue`, `defaultStatus` — so a composer can hold
|
|
120
|
+
* its own draft, attachments and queue with no state in the caller.
|
|
121
|
+
*
|
|
122
|
+
* @example {@include ./examples.mdx}
|
|
123
|
+
*/
|
|
124
|
+
declare const InputMessage: ForwardRefExoticComponent_tcubfn<InputMessageProps & RefAttributes_miuf56<HTMLDivElement>>;
|
|
125
|
+
export { InputMessage as default, QueuedMessage, InputMessageStatus, InputMessageSlotContext, InputMessageProps, InputMessage, FileThumbnail };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FileThumbnail,
|
|
3
|
+
InputMessage,
|
|
4
|
+
input_message_default
|
|
5
|
+
} from "../../../shared/components-gjfrycb5.js";
|
|
6
|
+
import"../../../shared/components-gndm6am4.js";
|
|
7
|
+
import"../../../shared/components-vb033rns.js";
|
|
8
|
+
import"../../../shared/components-5pkcfprd.js";
|
|
9
|
+
import"../../../shared/components-m5br529r.js";
|
|
10
|
+
import"../../../shared/components-csxz9f52.js";
|
|
11
|
+
import"../../../shared/components-jxgznftn.js";
|
|
12
|
+
import"../../../shared/components-r22vtgqc.js";
|
|
13
|
+
import"../../../shared/components-e46kf6cp.js";
|
|
14
|
+
import"../../../shared/components-7zp99w5d.js";
|
|
15
|
+
import"../../../shared/components-dg0w8g5p.js";
|
|
16
|
+
import"../../../shared/components-kf2ehztc.js";
|
|
17
|
+
import"../../../shared/components-7nww01w4.js";
|
|
18
|
+
import"../../../shared/components-nnnd2xef.js";
|
|
19
|
+
import"../../../shared/components-vc1k7yv2.js";
|
|
20
|
+
import"../../../shared/components-x3rz4cyn.js";
|
|
21
|
+
import"../../../shared/components-0f0as45n.js";
|
|
22
|
+
import"../../../shared/components-kpbcms10.js";
|
|
23
|
+
export {
|
|
24
|
+
input_message_default as default,
|
|
25
|
+
InputMessage,
|
|
26
|
+
FileThumbnail
|
|
27
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, HTMLAttributes, ReactNode, RefAttributes } from "react";
|
|
2
|
+
type SizeVariant = "default" | "compact";
|
|
3
|
+
interface RadioGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect" | "defaultValue"> {
|
|
4
|
+
/** RadioGroup.Item children. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Index of the currently selected item. Controlled — pair it with `onSelectedIndexChange` (or per-item `onSelect`). */
|
|
7
|
+
selectedIndex?: number;
|
|
8
|
+
/** Selected index on first render when uncontrolled. Defaults to no selection. */
|
|
9
|
+
defaultSelectedIndex?: number;
|
|
10
|
+
/** Called with the new index whenever an item is selected. */
|
|
11
|
+
onSelectedIndexChange?: (index: number) => void;
|
|
12
|
+
/** Selected item `value` (value mode; items then need a `value`). Controlled; wraps the group in Base UI's RadioGroup for form integration. */
|
|
13
|
+
value?: string;
|
|
14
|
+
/** Selected item `value` on first render when uncontrolled (value mode). */
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
/** Called with the selected item's `value` when it changes (value mode). */
|
|
17
|
+
onValueChange?: (value: string) => void;
|
|
18
|
+
/** Pins the group's rows to one step of the size ladder (default 36px, compact 28px). Defaults to the surrounding SizeProvider. */
|
|
19
|
+
size?: SizeVariant;
|
|
20
|
+
}
|
|
21
|
+
type RadioGroupComponent = ForwardRefExoticComponent<RadioGroupProps & RefAttributes<HTMLDivElement>> & {
|
|
22
|
+
Item: typeof RadioItem;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Radio button group with fluid hover and animated selection.
|
|
26
|
+
*
|
|
27
|
+
* Each row is a `RadioGroup.Item` with a stable `index`. The selected
|
|
28
|
+
* background melts to the chosen row, a fluid hover highlight melts between
|
|
29
|
+
* rows (the liquid indicators in Morph), the dot scales in, and the label animates to semibold without shifting
|
|
30
|
+
* its width. Arrow keys, Home and End move focus and select, with a roving
|
|
31
|
+
* tabindex on the selected row. Select by index — uncontrolled with
|
|
32
|
+
* `defaultSelectedIndex`, controlled with `selectedIndex` +
|
|
33
|
+
* `onSelectedIndexChange` — or by item `value` (`defaultValue` / `value` +
|
|
34
|
+
* `onValueChange`), which also renders Base UI radios for form integration.
|
|
35
|
+
* FF's per-item `selected` / `onSelect` still work and override the group for
|
|
36
|
+
* their row.
|
|
37
|
+
*
|
|
38
|
+
* Statics:
|
|
39
|
+
* - `RadioGroup.Item` — one radio row: `label`, `index`, and optional `value`,
|
|
40
|
+
* `selected`, `onSelect`.
|
|
41
|
+
*
|
|
42
|
+
* @example {@include ./examples.mdx}
|
|
43
|
+
*/
|
|
44
|
+
declare const RadioGroup: RadioGroupComponent;
|
|
45
|
+
interface RadioItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
46
|
+
/** Text label for the radio item. */
|
|
47
|
+
label: string;
|
|
48
|
+
/** Position index within the group. */
|
|
49
|
+
index: number;
|
|
50
|
+
/** Whether this item is selected. Defaults to the group's selection. */
|
|
51
|
+
selected?: boolean;
|
|
52
|
+
/** Called when this item is selected (the group's change callbacks fire too). */
|
|
53
|
+
onSelect?: () => void;
|
|
54
|
+
/** Optional value forwarded to the underlying Base UI primitive for form integration. */
|
|
55
|
+
value?: string;
|
|
56
|
+
}
|
|
57
|
+
declare const RadioItem: ForwardRefExoticComponent<RadioItemProps & RefAttributes<HTMLDivElement>>;
|
|
58
|
+
export { RadioGroup as default, RadioItemProps, RadioItem, RadioGroupProps, RadioGroup };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RadioGroup,
|
|
3
|
+
RadioItem,
|
|
4
|
+
radio_group_default
|
|
5
|
+
} from "../../../shared/components-54nf2x99.js";
|
|
6
|
+
import"../../../shared/components-vb033rns.js";
|
|
7
|
+
import"../../../shared/components-r22vtgqc.js";
|
|
8
|
+
import"../../../shared/components-e46kf6cp.js";
|
|
9
|
+
import"../../../shared/components-7zp99w5d.js";
|
|
10
|
+
import"../../../shared/components-dg0w8g5p.js";
|
|
11
|
+
import"../../../shared/components-kf2ehztc.js";
|
|
12
|
+
import"../../../shared/components-7nww01w4.js";
|
|
13
|
+
import"../../../shared/components-nnnd2xef.js";
|
|
14
|
+
import"../../../shared/components-vc1k7yv2.js";
|
|
15
|
+
import"../../../shared/components-x3rz4cyn.js";
|
|
16
|
+
import"../../../shared/components-0f0as45n.js";
|
|
17
|
+
import"../../../shared/components-kpbcms10.js";
|
|
18
|
+
export {
|
|
19
|
+
radio_group_default as default,
|
|
20
|
+
RadioItem,
|
|
21
|
+
RadioGroup
|
|
22
|
+
};
|