@justanarthur/modo-ui 0.0.0-stage → 0.2.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 +31 -0
- package/dist/components/badge/index.d.ts +59 -0
- package/dist/components/badge/index.js +16 -0
- package/dist/components/button/index.d.ts +59 -0
- package/dist/components/button/index.js +14 -0
- package/dist/components/card/index.d.ts +141 -0
- package/dist/components/card/index.js +42 -0
- package/dist/components/inputs/checkbox-group/index.d.ts +50 -0
- package/dist/components/inputs/checkbox-group/index.js +21 -0
- package/dist/components/inputs/color-picker/index.d.ts +137 -0
- package/dist/components/inputs/color-picker/index.js +35 -0
- package/dist/components/inputs/combobox/index.d.ts +161 -0
- package/dist/components/inputs/combobox/index.js +38 -0
- package/dist/components/inputs/date-time/calendar/index.d.ts +45 -0
- package/dist/components/inputs/date-time/calendar/index.js +18 -0
- package/dist/components/inputs/date-time/date-picker/index.d.ts +82 -0
- package/dist/components/inputs/date-time/date-picker/index.js +32 -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 +31 -0
- package/dist/components/inputs/date-time/duration-picker/index.d.ts +57 -0
- package/dist/components/inputs/date-time/duration-picker/index.js +31 -0
- package/dist/components/inputs/date-time/month-picker/index.d.ts +57 -0
- package/dist/components/inputs/date-time/month-picker/index.js +30 -0
- package/dist/components/inputs/date-time/time-picker/index.d.ts +59 -0
- package/dist/components/inputs/date-time/time-picker/index.js +31 -0
- package/dist/components/inputs/input/index.d.ts +84 -0
- package/dist/components/inputs/input/index.js +19 -0
- package/dist/components/inputs/input-copy/index.d.ts +44 -0
- package/dist/components/inputs/input-copy/index.js +16 -0
- package/dist/components/inputs/input-message/index.d.ts +125 -0
- package/dist/components/inputs/input-message/index.js +25 -0
- package/dist/components/inputs/radio-group/index.d.ts +58 -0
- package/dist/components/inputs/radio-group/index.js +20 -0
- package/dist/components/inputs/search/index.d.ts +83 -0
- package/dist/components/inputs/search/index.js +25 -0
- package/dist/components/inputs/select/index.d.ts +105 -0
- package/dist/components/inputs/select/index.js +34 -0
- package/dist/components/inputs/slider/index.d.ts +108 -0
- package/dist/components/inputs/slider/index.js +14 -0
- package/dist/components/inputs/switch/index.d.ts +43 -0
- package/dist/components/inputs/switch/index.js +14 -0
- package/dist/components/navigation/accordion/index.d.ts +117 -0
- package/dist/components/navigation/accordion/index.js +28 -0
- package/dist/components/navigation/sidebar/index.d.ts +388 -0
- package/dist/components/navigation/sidebar/index.js +99 -0
- package/dist/components/navigation/tabs/index.d.ts +70 -0
- package/dist/components/navigation/tabs/index.js +23 -0
- package/dist/components/navigation/tabs-subtle/index.d.ts +73 -0
- package/dist/components/navigation/tabs-subtle/index.js +21 -0
- package/dist/components/overlays/alert-dialog/index.d.ts +67 -0
- package/dist/components/overlays/alert-dialog/index.js +22 -0
- package/dist/components/overlays/command/index.d.ts +121 -0
- package/dist/components/overlays/command/index.js +36 -0
- package/dist/components/overlays/context-menu/index.d.ts +97 -0
- package/dist/components/overlays/context-menu/index.js +29 -0
- package/dist/components/overlays/dialog/index.d.ts +130 -0
- package/dist/components/overlays/dialog/index.js +37 -0
- package/dist/components/overlays/dropdown/index.d.ts +222 -0
- package/dist/components/overlays/dropdown/index.js +44 -0
- package/dist/components/overlays/popover/index.d.ts +87 -0
- package/dist/components/overlays/popover/index.js +26 -0
- package/dist/components/overlays/preview-card/index.d.ts +75 -0
- package/dist/components/overlays/preview-card/index.js +19 -0
- package/dist/components/overlays/sheet/index.d.ts +67 -0
- package/dist/components/overlays/sheet/index.js +24 -0
- package/dist/components/overlays/toast/index.d.ts +107 -0
- package/dist/components/overlays/toast/index.js +21 -0
- package/dist/components/overlays/tooltip/index.d.ts +75 -0
- package/dist/components/overlays/tooltip/index.js +17 -0
- package/dist/components/table/index.d.ts +44 -0
- package/dist/components/table/index.js +26 -0
- package/dist/components/thinking-indicator/index.d.ts +32 -0
- package/dist/components/thinking-indicator/index.js +13 -0
- package/dist/index.d.ts +3926 -0
- package/dist/index.js +511 -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 +11 -0
- package/dist/primitives/craft/index.d.ts +31 -0
- package/dist/primitives/craft/index.js +11 -0
- package/dist/primitives/fluid-hover/index.d.ts +233 -0
- package/dist/primitives/fluid-hover/index.js +25 -0
- package/dist/primitives/morph/index.d.ts +127 -0
- package/dist/primitives/morph/index.js +19 -0
- package/dist/primitives/motion/index.d.ts +115 -0
- package/dist/primitives/motion/index.js +19 -0
- package/dist/primitives/scroll-area/index.d.ts +41 -0
- package/dist/primitives/scroll-area/index.js +12 -0
- package/dist/primitives/sizes/index.d.ts +128 -0
- package/dist/primitives/sizes/index.js +21 -0
- package/dist/primitives/surface/index.d.ts +69 -0
- package/dist/primitives/surface/index.js +17 -0
- package/dist/shared/components-0ke6xada.js +123 -0
- package/dist/shared/components-0q0sqfh4.js +146 -0
- package/dist/shared/components-0sn7ypjw.js +61 -0
- package/dist/shared/components-1j9791sn.js +345 -0
- package/dist/shared/components-1rfwbyyc.js +361 -0
- package/dist/shared/components-1v7rxytx.js +30 -0
- package/dist/shared/components-1xekx2hx.js +215 -0
- package/dist/shared/components-39jq9va1.js +86 -0
- package/dist/shared/components-3gae8nta.js +719 -0
- package/dist/shared/components-3k8xpnpq.js +1759 -0
- package/dist/shared/components-3ky44908.js +9 -0
- package/dist/shared/components-3mkepka5.js +111 -0
- package/dist/shared/components-3wk0w46f.js +667 -0
- package/dist/shared/components-4cnjmgex.js +124 -0
- package/dist/shared/components-59efxjd9.js +298 -0
- package/dist/shared/components-5xc2j8jz.js +159 -0
- package/dist/shared/components-62ybc7t2.js +496 -0
- package/dist/shared/components-66mv71kx.js +262 -0
- package/dist/shared/components-7ans7ce5.js +120 -0
- package/dist/shared/components-7btqt08d.js +270 -0
- package/dist/shared/components-7r3etddy.js +171 -0
- package/dist/shared/components-7x9kawxv.js +152 -0
- package/dist/shared/components-8fpr3s4p.js +292 -0
- package/dist/shared/components-9jvzzvt1.js +198 -0
- package/dist/shared/components-apdwtweq.js +484 -0
- package/dist/shared/components-asr5pg50.js +191 -0
- package/dist/shared/components-b2wyq2cq.js +232 -0
- package/dist/shared/components-c6s6b43g.js +15 -0
- package/dist/shared/components-ca2c898n.js +1828 -0
- package/dist/shared/components-cbxjn9p8.js +141 -0
- package/dist/shared/components-chacnk61.js +216 -0
- package/dist/shared/components-cv16mryv.js +62 -0
- package/dist/shared/components-ez65vtbq.js +110 -0
- package/dist/shared/components-ezxhrmer.js +17 -0
- package/dist/shared/components-gc5vtq2f.js +149 -0
- package/dist/shared/components-gf5s6ap9.js +42 -0
- package/dist/shared/components-gvr9w41t.js +193 -0
- package/dist/shared/components-h2dpcwgc.js +137 -0
- package/dist/shared/components-hawvy2qz.js +105 -0
- package/dist/shared/components-hqeq3w9q.js +375 -0
- package/dist/shared/components-jjw69c4c.js +28 -0
- package/dist/shared/components-jwst3vtj.js +346 -0
- package/dist/shared/components-kvr7f9hy.js +45 -0
- package/dist/shared/components-men63rwj.js +9 -0
- package/dist/shared/components-mhd39z7x.js +22 -0
- package/dist/shared/components-n7mjr357.js +26 -0
- package/dist/shared/components-ng72k97e.js +128 -0
- package/dist/shared/components-nh8tma1n.js +986 -0
- package/dist/shared/components-njzgqdwy.js +445 -0
- package/dist/shared/components-ny774h8p.js +293 -0
- package/dist/shared/components-q4daerx0.js +58 -0
- package/dist/shared/components-q5xj5c16.js +79 -0
- package/dist/shared/components-rr7a6ja9.js +160 -0
- package/dist/shared/components-s2bz1xpk.js +63 -0
- package/dist/shared/components-tqvarbfv.js +288 -0
- package/dist/shared/components-v6xp325t.js +304 -0
- package/dist/shared/components-v7wtz8hk.js +144 -0
- package/dist/shared/components-vc7vq5nz.js +32 -0
- package/dist/shared/components-vfbhxf5r.js +58 -0
- package/dist/shared/components-vynjtrk6.js +19 -0
- package/dist/shared/components-wvp1m52g.js +1200 -0
- package/dist/shared/components-yh3kwdhr.js +981 -0
- package/dist/shared/components-ytb2tefr.js +291 -0
- package/dist/shared/components-zfnmn5d4.js +220 -0
- package/dist/shared/components-zrkzcayz.js +141 -0
- package/dist/shared/components-zx6b6yby.js +42 -0
- package/dist/styles.css +1949 -0
- package/dist/tailwind.css +219 -0
- package/dist/tokens.css +345 -0
- package/package.json +103 -4
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MonthPicker2,
|
|
3
|
+
month_picker_default
|
|
4
|
+
} from "../../../../shared/components-4cnjmgex.js";
|
|
5
|
+
import"../../../../shared/components-7btqt08d.js";
|
|
6
|
+
import"../../../../shared/components-gvr9w41t.js";
|
|
7
|
+
import"../../../../shared/components-9jvzzvt1.js";
|
|
8
|
+
import"../../../../shared/components-c6s6b43g.js";
|
|
9
|
+
import"../../../../shared/components-mhd39z7x.js";
|
|
10
|
+
import"../../../../shared/components-rr7a6ja9.js";
|
|
11
|
+
import"../../../../shared/components-zfnmn5d4.js";
|
|
12
|
+
import"../../../../shared/components-3ky44908.js";
|
|
13
|
+
import"../../../../shared/components-zrkzcayz.js";
|
|
14
|
+
import"../../../../shared/components-0q0sqfh4.js";
|
|
15
|
+
import"../../../../shared/components-kvr7f9hy.js";
|
|
16
|
+
import"../../../../shared/components-59efxjd9.js";
|
|
17
|
+
import"../../../../shared/components-chacnk61.js";
|
|
18
|
+
import"../../../../shared/components-hqeq3w9q.js";
|
|
19
|
+
import"../../../../shared/components-jjw69c4c.js";
|
|
20
|
+
import"../../../../shared/components-b2wyq2cq.js";
|
|
21
|
+
import"../../../../shared/components-n7mjr357.js";
|
|
22
|
+
import"../../../../shared/components-men63rwj.js";
|
|
23
|
+
import"../../../../shared/components-0sn7ypjw.js";
|
|
24
|
+
import"../../../../shared/components-cv16mryv.js";
|
|
25
|
+
import"../../../../shared/components-zx6b6yby.js";
|
|
26
|
+
import"../../../../shared/components-ezxhrmer.js";
|
|
27
|
+
export {
|
|
28
|
+
MonthPicker2 as MonthPicker,
|
|
29
|
+
month_picker_default as default
|
|
30
|
+
};
|
|
@@ -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, TimePickerProps, TimePicker as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TimePicker2,
|
|
3
|
+
time_picker_default
|
|
4
|
+
} from "../../../../shared/components-ez65vtbq.js";
|
|
5
|
+
import"../../../../shared/components-q4daerx0.js";
|
|
6
|
+
import"../../../../shared/components-7btqt08d.js";
|
|
7
|
+
import"../../../../shared/components-gvr9w41t.js";
|
|
8
|
+
import"../../../../shared/components-9jvzzvt1.js";
|
|
9
|
+
import"../../../../shared/components-c6s6b43g.js";
|
|
10
|
+
import"../../../../shared/components-mhd39z7x.js";
|
|
11
|
+
import"../../../../shared/components-rr7a6ja9.js";
|
|
12
|
+
import"../../../../shared/components-zfnmn5d4.js";
|
|
13
|
+
import"../../../../shared/components-3ky44908.js";
|
|
14
|
+
import"../../../../shared/components-zrkzcayz.js";
|
|
15
|
+
import"../../../../shared/components-0q0sqfh4.js";
|
|
16
|
+
import"../../../../shared/components-kvr7f9hy.js";
|
|
17
|
+
import"../../../../shared/components-59efxjd9.js";
|
|
18
|
+
import"../../../../shared/components-chacnk61.js";
|
|
19
|
+
import"../../../../shared/components-hqeq3w9q.js";
|
|
20
|
+
import"../../../../shared/components-jjw69c4c.js";
|
|
21
|
+
import"../../../../shared/components-b2wyq2cq.js";
|
|
22
|
+
import"../../../../shared/components-n7mjr357.js";
|
|
23
|
+
import"../../../../shared/components-men63rwj.js";
|
|
24
|
+
import"../../../../shared/components-0sn7ypjw.js";
|
|
25
|
+
import"../../../../shared/components-cv16mryv.js";
|
|
26
|
+
import"../../../../shared/components-zx6b6yby.js";
|
|
27
|
+
import"../../../../shared/components-ezxhrmer.js";
|
|
28
|
+
export {
|
|
29
|
+
TimePicker2 as TimePicker,
|
|
30
|
+
time_picker_default as default
|
|
31
|
+
};
|
|
@@ -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, InputFieldProps, InputGroup, InputGroupProps, InputProps, Label, LabelProps, Input as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Input2,
|
|
3
|
+
Label2,
|
|
4
|
+
InputGroup2,
|
|
5
|
+
input_default
|
|
6
|
+
} from "../../../shared/components-gvr9w41t.js";
|
|
7
|
+
import"../../../shared/components-mhd39z7x.js";
|
|
8
|
+
import"../../../shared/components-59efxjd9.js";
|
|
9
|
+
import"../../../shared/components-jjw69c4c.js";
|
|
10
|
+
import"../../../shared/components-n7mjr357.js";
|
|
11
|
+
import"../../../shared/components-0sn7ypjw.js";
|
|
12
|
+
import"../../../shared/components-cv16mryv.js";
|
|
13
|
+
import"../../../shared/components-ezxhrmer.js";
|
|
14
|
+
export {
|
|
15
|
+
Input2 as Input,
|
|
16
|
+
InputGroup2 as InputGroup,
|
|
17
|
+
Label2 as Label,
|
|
18
|
+
input_default as default
|
|
19
|
+
};
|
|
@@ -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, InputCopyAlign, InputCopyProps, InputCopyVariant, InputCopy as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InputCopy2,
|
|
3
|
+
input_copy_default
|
|
4
|
+
} from "../../../shared/components-1j9791sn.js";
|
|
5
|
+
import"../../../shared/components-ng72k97e.js";
|
|
6
|
+
import"../../../shared/components-zrkzcayz.js";
|
|
7
|
+
import"../../../shared/components-0q0sqfh4.js";
|
|
8
|
+
import"../../../shared/components-hqeq3w9q.js";
|
|
9
|
+
import"../../../shared/components-men63rwj.js";
|
|
10
|
+
import"../../../shared/components-0sn7ypjw.js";
|
|
11
|
+
import"../../../shared/components-cv16mryv.js";
|
|
12
|
+
import"../../../shared/components-ezxhrmer.js";
|
|
13
|
+
export {
|
|
14
|
+
InputCopy2 as InputCopy,
|
|
15
|
+
input_copy_default as default
|
|
16
|
+
};
|
|
@@ -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 { FileThumbnail, InputMessage, InputMessageProps, InputMessageSlotContext, InputMessageStatus, QueuedMessage, InputMessage as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FileThumbnail2,
|
|
3
|
+
InputMessage2,
|
|
4
|
+
input_message_default
|
|
5
|
+
} from "../../../shared/components-yh3kwdhr.js";
|
|
6
|
+
import"../../../shared/components-ng72k97e.js";
|
|
7
|
+
import"../../../shared/components-zrkzcayz.js";
|
|
8
|
+
import"../../../shared/components-0q0sqfh4.js";
|
|
9
|
+
import"../../../shared/components-kvr7f9hy.js";
|
|
10
|
+
import"../../../shared/components-59efxjd9.js";
|
|
11
|
+
import"../../../shared/components-chacnk61.js";
|
|
12
|
+
import"../../../shared/components-hqeq3w9q.js";
|
|
13
|
+
import"../../../shared/components-jjw69c4c.js";
|
|
14
|
+
import"../../../shared/components-b2wyq2cq.js";
|
|
15
|
+
import"../../../shared/components-n7mjr357.js";
|
|
16
|
+
import"../../../shared/components-men63rwj.js";
|
|
17
|
+
import"../../../shared/components-0sn7ypjw.js";
|
|
18
|
+
import"../../../shared/components-cv16mryv.js";
|
|
19
|
+
import"../../../shared/components-zx6b6yby.js";
|
|
20
|
+
import"../../../shared/components-ezxhrmer.js";
|
|
21
|
+
export {
|
|
22
|
+
FileThumbnail2 as FileThumbnail,
|
|
23
|
+
InputMessage2 as InputMessage,
|
|
24
|
+
input_message_default as default
|
|
25
|
+
};
|
|
@@ -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, RadioGroupProps, RadioItem, RadioItemProps, RadioGroup as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RadioGroup2,
|
|
3
|
+
RadioItem2,
|
|
4
|
+
radio_group_default
|
|
5
|
+
} from "../../../shared/components-ny774h8p.js";
|
|
6
|
+
import"../../../shared/components-kvr7f9hy.js";
|
|
7
|
+
import"../../../shared/components-59efxjd9.js";
|
|
8
|
+
import"../../../shared/components-chacnk61.js";
|
|
9
|
+
import"../../../shared/components-hqeq3w9q.js";
|
|
10
|
+
import"../../../shared/components-jjw69c4c.js";
|
|
11
|
+
import"../../../shared/components-n7mjr357.js";
|
|
12
|
+
import"../../../shared/components-men63rwj.js";
|
|
13
|
+
import"../../../shared/components-0sn7ypjw.js";
|
|
14
|
+
import"../../../shared/components-cv16mryv.js";
|
|
15
|
+
import"../../../shared/components-ezxhrmer.js";
|
|
16
|
+
export {
|
|
17
|
+
RadioGroup2 as RadioGroup,
|
|
18
|
+
RadioItem2 as RadioItem,
|
|
19
|
+
radio_group_default as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
interface IconComponentProps {
|
|
3
|
+
size?: number | string;
|
|
4
|
+
strokeWidth?: number | string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
type IconComponent = ComponentType<IconComponentProps>;
|
|
8
|
+
/** One command: the label the query matches, plus what the row shows and does. */
|
|
9
|
+
interface CommandItem {
|
|
10
|
+
label: string;
|
|
11
|
+
icon?: IconComponent;
|
|
12
|
+
/** Shown at the end of the row; display only, nothing binds it. */
|
|
13
|
+
shortcut?: string;
|
|
14
|
+
/** More words the query matches. */
|
|
15
|
+
keywords?: string[];
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onSelect?: () => void;
|
|
18
|
+
}
|
|
19
|
+
import { JSX as JSX_1kxb3 } from "react";
|
|
20
|
+
interface SearchProps {
|
|
21
|
+
/** How it rests: a pill showing the placeholder (and the shortcut), or a lone search icon. Defaults to `'pill'`. */
|
|
22
|
+
variant?: "pill" | "icon";
|
|
23
|
+
/** The field's placeholder, the pill's label and the accessible name of both. Defaults to `'Search'`. */
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/** Suggestions offered below the field and filtered as you type: strings, or Command items (`{ label, icon, keywords }`). Leave out for a plain search field. */
|
|
26
|
+
items?: (string | CommandItem)[];
|
|
27
|
+
/** Controlled query. */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** Initial query, for an uncontrolled field. Defaults to `''`. */
|
|
30
|
+
defaultValue?: string;
|
|
31
|
+
/** Called on every change of the query. */
|
|
32
|
+
onValueChange?: (value: string) => void;
|
|
33
|
+
/** Called with the query on Enter, and with a suggestion's label when one is picked. */
|
|
34
|
+
onSubmit?: (query: string) => void;
|
|
35
|
+
/** Controlled expanded state. */
|
|
36
|
+
expanded?: boolean;
|
|
37
|
+
/** Initial expanded state, for an uncontrolled field. Defaults to `false`. */
|
|
38
|
+
defaultExpanded?: boolean;
|
|
39
|
+
/** Called when the field expands or collapses. */
|
|
40
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
41
|
+
/** Width of the expanded field, in px. Defaults to `288`. */
|
|
42
|
+
width?: number;
|
|
43
|
+
/** The edge that stays put: the field grows from it toward the other one, over its neighbors. Defaults to `'start'`. */
|
|
44
|
+
align?: "start" | "end";
|
|
45
|
+
/** A key that expands the field from anywhere on the page outside another field, shown on the pill. */
|
|
46
|
+
shortcut?: string;
|
|
47
|
+
/** Shown in the suggestions when none matches. Defaults to `'No results found.'`. */
|
|
48
|
+
emptyMessage?: string;
|
|
49
|
+
/** How the suggestions grow out of the field (see Morph): with the liquid goo neck, a plain morph, a slide or a fade. Defaults to `'goo'`. */
|
|
50
|
+
effect?: "goo" | "morph" | "slide" | "fade";
|
|
51
|
+
/** Spring tier of the suggestions' plain morph, slide or fade; goo runs on its own `spring.goo`. Defaults to `'moderate'`. */
|
|
52
|
+
tier?: "moderate" | "slow";
|
|
53
|
+
/** Classes for the root, the box the resting button keeps in the layout. */
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
type Element_12xgc3 = JSX_1kxb3["Element"];
|
|
57
|
+
/**
|
|
58
|
+
* A search button that grows into the field in place, with suggestions that
|
|
59
|
+
* ooze out below it.
|
|
60
|
+
*
|
|
61
|
+
* At rest it is a pill showing the placeholder, or a lone search icon. A
|
|
62
|
+
* press (or its `shortcut` key) springs it to `width` and focuses the
|
|
63
|
+
* field. It grows over its neighbors rather than pushing them: the resting
|
|
64
|
+
* box stays in the layout, so nothing around it moves, and `align="end"`
|
|
65
|
+
* grows it leftward, for a toolbar's far end. The search icon never moves.
|
|
66
|
+
* Typing opens the suggestions, which melt out of the field through the
|
|
67
|
+
* goo neck (see Morph) once it has finished growing; the arrows move one
|
|
68
|
+
* fluid highlight through them, and Enter or a press picks one. Escape
|
|
69
|
+
* closes the suggestions, then clears the query, then collapses the field
|
|
70
|
+
* and hands focus back to the button; leaving an empty field collapses it
|
|
71
|
+
* too. The field lifts 2 surface levels while open, the same level as its
|
|
72
|
+
* suggestions, so the two read as one liquid.
|
|
73
|
+
*
|
|
74
|
+
* With `items` the field is a combobox over a listbox of suggestions,
|
|
75
|
+
* built on Base UI's Autocomplete (filtering by label and keywords, the
|
|
76
|
+
* input keeps focus while the highlight moves); without, it is a plain
|
|
77
|
+
* search box. Either way it sits in a `<search>` landmark around a form,
|
|
78
|
+
* and Enter reports the query to `onSubmit`.
|
|
79
|
+
*
|
|
80
|
+
* @example {@include ./examples.mdx}
|
|
81
|
+
*/
|
|
82
|
+
declare function Search({ variant, placeholder, items, value, defaultValue, onValueChange, onSubmit, expanded, defaultExpanded, onExpandedChange, width, align, shortcut, emptyMessage, effect, tier, className }: SearchProps): Element_12xgc3;
|
|
83
|
+
export { Search, SearchProps, Search as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Search2,
|
|
3
|
+
search_default
|
|
4
|
+
} from "../../../shared/components-66mv71kx.js";
|
|
5
|
+
import"../../../shared/components-8fpr3s4p.js";
|
|
6
|
+
import"../../../shared/components-zfnmn5d4.js";
|
|
7
|
+
import"../../../shared/components-3ky44908.js";
|
|
8
|
+
import"../../../shared/components-zrkzcayz.js";
|
|
9
|
+
import"../../../shared/components-0q0sqfh4.js";
|
|
10
|
+
import"../../../shared/components-kvr7f9hy.js";
|
|
11
|
+
import"../../../shared/components-59efxjd9.js";
|
|
12
|
+
import"../../../shared/components-chacnk61.js";
|
|
13
|
+
import"../../../shared/components-hqeq3w9q.js";
|
|
14
|
+
import"../../../shared/components-b2wyq2cq.js";
|
|
15
|
+
import"../../../shared/components-n7mjr357.js";
|
|
16
|
+
import"../../../shared/components-men63rwj.js";
|
|
17
|
+
import"../../../shared/components-0sn7ypjw.js";
|
|
18
|
+
import"../../../shared/components-hawvy2qz.js";
|
|
19
|
+
import"../../../shared/components-cv16mryv.js";
|
|
20
|
+
import"../../../shared/components-zx6b6yby.js";
|
|
21
|
+
import"../../../shared/components-ezxhrmer.js";
|
|
22
|
+
export {
|
|
23
|
+
Search2 as Search,
|
|
24
|
+
search_default as default
|
|
25
|
+
};
|