@stll/ui 0.71.0 → 0.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/primitives.d.ts +7 -7
- package/dist/components/alert-dialog.d.ts +15 -15
- package/dist/components/animated-preview.d.ts +9 -9
- package/dist/components/animated-preview.js +3 -3
- package/dist/components/application-rail.d.ts +8 -8
- package/dist/components/bidi-text.d.ts +7 -7
- package/dist/components/brand-icons.d.ts +5 -5
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/color-picker.d.ts +4 -4
- package/dist/components/combobox.d.ts +23 -23
- package/dist/components/combobox.js +6 -6
- package/dist/components/command.d.ts +19 -19
- package/dist/components/destructive-action-confirmation.d.ts +5 -5
- package/dist/components/destructive-action-confirmation.js +2 -2
- package/dist/components/destructive-confirm-dialog.d.ts +7 -7
- package/dist/components/details-grid.d.ts +6 -6
- package/dist/components/dialog.d.ts +19 -19
- package/dist/components/frame.d.ts +7 -7
- package/dist/components/hex-color-picker.d.ts +16 -2
- package/dist/components/input-group.d.ts +6 -6
- package/dist/components/input-otp.d.ts +7 -7
- package/dist/components/input-otp.js +2 -2
- package/dist/components/input.d.ts +5 -5
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/list.d.ts +20 -20
- package/dist/components/menu.d.ts +20 -20
- package/dist/components/outline-rail.d.ts +12 -0
- package/dist/components/pagination.d.ts +9 -9
- package/dist/components/popover.d.ts +8 -8
- package/dist/components/preview-pane.d.ts +6 -6
- package/dist/components/prose.d.ts +2 -2
- package/dist/components/scroll-to-top.d.ts +5 -0
- package/dist/components/search-field.d.ts +3 -3
- package/dist/components/select.d.ts +9 -9
- package/dist/components/select.js +11 -11
- package/dist/components/sheet.d.ts +16 -16
- package/dist/components/steps.d.ts +6 -6
- package/dist/components/switch.d.ts +5 -5
- package/dist/components/switch.native.d.ts +3 -3
- package/dist/components/table.d.ts +16 -16
- package/dist/components/textarea.d.ts +3 -3
- package/dist/components/time-field.d.ts +3 -3
- package/dist/components/toast.d.ts +20 -20
- package/dist/components/toast.js +3 -3
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/tooltip-trigger-helper.d.ts +4 -4
- package/dist/components/truncated-text.d.ts +4 -4
- package/dist/components/truncated-text.js +3 -3
- package/dist/data-table/index.d.ts +7 -0
- package/dist/hooks/use-contained-handler.d.ts +2 -2
- package/dist/hooks/use-mobile.js +2 -2
- package/dist/hooks/use-viewport-width.js +2 -2
- package/dist/icons.d.ts +27 -0
- package/dist/index.d.ts +7 -0
- package/dist/inspector/chrome.d.ts +22 -22
- package/dist/inspector/index.d.ts +9 -0
- package/dist/kanban/grouping.d.ts +10 -0
- package/dist/kanban/index.d.ts +9 -0
- package/dist/kanban/sortable-interactions.d.ts +8 -8
- package/dist/kanban/sortable-interactions.js +11 -11
- package/dist/lib/button-disposition.d.ts +2 -2
- package/dist/lib/tooltip-content.d.ts +2 -2
- package/dist/lib/utils.d.ts +2 -2
- package/package.json +9 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React
|
|
2
|
-
declare const Frame: ({ className, ...props }: React
|
|
3
|
-
declare const FramePanel: ({ className, ...props }: React
|
|
4
|
-
declare const FrameHeader: ({ className, ...props }: React
|
|
5
|
-
declare const FrameTitle: ({ className, ...props }: React
|
|
6
|
-
declare const FrameDescription: ({ className, ...props }: React
|
|
7
|
-
declare const FrameFooter: ({ className, ...props }: React
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Frame: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
3
|
+
declare const FramePanel: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
4
|
+
declare const FrameHeader: ({ className, ...props }: React.ComponentProps<"header">) => React.JSX.Element;
|
|
5
|
+
declare const FrameTitle: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
6
|
+
declare const FrameDescription: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
7
|
+
declare const FrameFooter: ({ className, ...props }: React.ComponentProps<"footer">) => React.JSX.Element;
|
|
8
8
|
export { Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle };
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Hex color picker — saturation/brightness square + hue strip.
|
|
3
|
+
*
|
|
4
|
+
* Adapted from react-colorful (MIT, Copyright 2020 Vlad Shilov).
|
|
5
|
+
* https://github.com/omgovich/react-colorful
|
|
6
|
+
*
|
|
7
|
+
* Changes from upstream:
|
|
8
|
+
* - Trimmed to hex-only (no RGB/HSL/alpha variants)
|
|
9
|
+
* - Dropped React.memo, useMemo, useCallback (React Compiler handles this)
|
|
10
|
+
* - Converted CSS classes to Tailwind
|
|
11
|
+
* - Merged small utility files into one module
|
|
12
|
+
* - Strict TypeScript (no `any`, no enums)
|
|
13
|
+
* - Arrow functions per project conventions
|
|
14
|
+
*/
|
|
15
|
+
import * as React from "react";
|
|
2
16
|
type HexColorPickerProps = {
|
|
3
17
|
/** Hex color with or without # (e.g. "#ff0000" or "FF0000") */
|
|
4
18
|
color?: string | undefined;
|
|
5
19
|
onChange?: (hex: string) => void;
|
|
6
20
|
className?: string;
|
|
7
21
|
};
|
|
8
|
-
declare const HexColorPicker: ({ color, onChange, className }: HexColorPickerProps) => React
|
|
22
|
+
declare const HexColorPicker: ({ color, onChange, className }: HexColorPickerProps) => React.JSX.Element;
|
|
9
23
|
export { HexColorPicker, type HexColorPickerProps };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { InputProps } from "./input.js";
|
|
3
3
|
import { TextareaProps } from "./textarea.js";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
|
-
declare const InputGroup: ({ className, ...props }: React
|
|
5
|
+
declare const InputGroup: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
6
6
|
declare const inputGroupAddonVariants: (props?: ({
|
|
7
7
|
align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
-
declare const InputGroupAddon: ({ className, align, ...props }: React
|
|
10
|
-
declare const InputGroupText: ({ className, ...props }: React
|
|
11
|
-
declare const InputGroupInput: ({ className, ...props }: InputProps) => React
|
|
12
|
-
declare const InputGroupTextarea: ({ className, ...props }: TextareaProps) => React
|
|
9
|
+
declare const InputGroupAddon: ({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) => React.JSX.Element;
|
|
10
|
+
declare const InputGroupText: ({ className, ...props }: React.ComponentProps<"span">) => React.JSX.Element;
|
|
11
|
+
declare const InputGroupInput: ({ className, ...props }: InputProps) => React.JSX.Element;
|
|
12
|
+
declare const InputGroupTextarea: ({ className, ...props }: TextareaProps) => React.JSX.Element;
|
|
13
13
|
export { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { OTPInput } from "input-otp";
|
|
3
|
-
declare const InputOTP: ({ className, containerClassName, ...props }: React
|
|
3
|
+
declare const InputOTP: ({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
|
|
4
4
|
containerClassName?: string;
|
|
5
|
-
}) => React
|
|
6
|
-
declare const InputOTPGroup: ({ className, ...props }: React
|
|
7
|
-
declare const InputOTPSlot: ({ index, className, ...props }: React
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
declare const InputOTPGroup: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
7
|
+
declare const InputOTPSlot: ({ index, className, ...props }: React.ComponentProps<"div"> & {
|
|
8
8
|
index: number;
|
|
9
|
-
}) => React
|
|
10
|
-
declare const InputOTPSeparator: ({ ...props }: React
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
declare const InputOTPSeparator: ({ ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
11
11
|
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { MinusIcon } from "../icons.js";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import * as React
|
|
5
|
+
import * as React from "react";
|
|
6
6
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
7
7
|
// src/components/input-otp.tsx
|
|
8
8
|
const InputOTP = ({ className, containerClassName, ...props }) => /* @__PURE__ */ jsx(OTPInput, {
|
|
@@ -17,7 +17,7 @@ const InputOTPGroup = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
|
17
17
|
...props
|
|
18
18
|
});
|
|
19
19
|
const InputOTPSlot = ({ index, className, ...props }) => {
|
|
20
|
-
const { char, hasFakeCaret, isActive } = React
|
|
20
|
+
const { char, hasFakeCaret, isActive } = React.use(OTPInputContext).slots[index] ?? {};
|
|
21
21
|
return /* @__PURE__ */ jsxs("div", {
|
|
22
22
|
className: cn("border-input aria-invalid:border-destructive data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40 relative flex h-9 w-9 items-center justify-center border-y border-e text-sm shadow-xs outline-none first:rounded-s-md first:border-s last:rounded-e-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", className),
|
|
23
23
|
"data-active": isActive,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { ControlSize } from "../lib/control-size.js";
|
|
3
3
|
import { Input as Input$1 } from "@base-ui/react/input";
|
|
4
|
-
type InputProps = Omit<Input$1.Props & React
|
|
5
|
-
type?: Exclude<React
|
|
4
|
+
type InputProps = Omit<Input$1.Props & React.RefAttributes<HTMLInputElement>, "size" | "style" | "type"> & {
|
|
5
|
+
type?: Exclude<React.HTMLInputTypeAttribute, "file"> | undefined;
|
|
6
6
|
size?: ControlSize | number;
|
|
7
|
-
style?: React
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
8
|
unstyled?: boolean;
|
|
9
9
|
/**
|
|
10
10
|
* A borderless field in a line of text: it edits a value where it is read,
|
|
@@ -14,5 +14,5 @@ type InputProps = Omit<Input$1.Props & React$1.RefAttributes<HTMLInputElement>,
|
|
|
14
14
|
inline?: boolean;
|
|
15
15
|
nativeInput?: boolean;
|
|
16
16
|
};
|
|
17
|
-
declare const Input: ({ className, size, unstyled, inline, nativeInput, dir, onChange, ...props }: InputProps) => React
|
|
17
|
+
declare const Input: ({ className, size, unstyled, inline, nativeInput, dir, onChange, ...props }: InputProps) => React.JSX.Element;
|
|
18
18
|
export { Input, type InputProps };
|
package/dist/components/kbd.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
/**
|
|
3
3
|
* A key or a key combination, drawn as key caps.
|
|
4
4
|
*
|
|
@@ -11,7 +11,7 @@ import * as React$1 from "react";
|
|
|
11
11
|
* `MenuShortcut` and `TooltipPopup`'s `shortcut` render through it, so a
|
|
12
12
|
* shortcut reads the same in a menu, a tooltip and a hint.
|
|
13
13
|
*/
|
|
14
|
-
declare const Kbd: ({ className, children, keys, variant, ...props }: KbdProps) => React
|
|
14
|
+
declare const Kbd: ({ className, children, keys, variant, ...props }: KbdProps) => React.JSX.Element;
|
|
15
15
|
/** A modifier or named key `Kbd` spells per platform; anything else as is. */
|
|
16
16
|
type KbdNamedKey = "mod" | "ctrl" | "alt" | "shift" | "enter" | "escape" | "backspace" | "delete" | "tab" | "up" | "down" | "left" | "right";
|
|
17
17
|
/**
|
|
@@ -32,7 +32,7 @@ type KbdPlatform = "apple" | "other";
|
|
|
32
32
|
* labels (a menu item), where caps would crowd it.
|
|
33
33
|
*/
|
|
34
34
|
type KbdVariant = "cap" | "plain";
|
|
35
|
-
type KbdProps = React
|
|
35
|
+
type KbdProps = React.ComponentProps<"kbd"> & {
|
|
36
36
|
keys?: KbdKeys | undefined;
|
|
37
37
|
variant?: KbdVariant | undefined;
|
|
38
38
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { TruncatedTextLines } from "./truncated-text.js";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import { useRender } from "@base-ui/react/use-render";
|
|
@@ -10,40 +10,40 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
10
10
|
* truncates and the trailing column keeps its width, so actions stay on
|
|
11
11
|
* screen at any viewport.
|
|
12
12
|
*/
|
|
13
|
-
declare const ListGroup: ({ className, ...props }: React
|
|
14
|
-
declare const ListGroupHeader: ({ className, ...props }: React
|
|
13
|
+
declare const ListGroup: ({ className, ...props }: React.ComponentProps<"section">) => React.JSX.Element;
|
|
14
|
+
declare const ListGroupHeader: ({ className, ...props }: React.ComponentProps<"header">) => React.JSX.Element;
|
|
15
15
|
/** Title and description stack; takes the space the header action leaves. */
|
|
16
|
-
declare const ListGroupHeading: ({ className, ...props }: React
|
|
17
|
-
declare const ListGroupTitle: ({ className, children, ...props }: React
|
|
16
|
+
declare const ListGroupHeading: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
17
|
+
declare const ListGroupTitle: ({ className, children, ...props }: React.ComponentProps<"h2">) => React.JSX.Element;
|
|
18
18
|
/**
|
|
19
19
|
* Quiet item count after the title; shows matches while a search filters,
|
|
20
20
|
* and a changed digit fades in rather than snapping. `count` arrives
|
|
21
21
|
* formatted in the caller's locale.
|
|
22
22
|
*/
|
|
23
|
-
declare const ListGroupCount: ({ className, count, ...props }: Omit<React
|
|
23
|
+
declare const ListGroupCount: ({ className, count, ...props }: Omit<React.ComponentProps<"span">, "children"> & {
|
|
24
24
|
count: string;
|
|
25
|
-
}) => React
|
|
26
|
-
declare const ListGroupDescription: ({ className, ...props }: React
|
|
25
|
+
}) => React.JSX.Element;
|
|
26
|
+
declare const ListGroupDescription: ({ className, ...props }: React.ComponentProps<"p">) => React.JSX.Element;
|
|
27
27
|
/** Quiet trailing affordance on the header row (a link or ghost button). */
|
|
28
|
-
declare const ListGroupAction: ({ className, ...props }: React
|
|
28
|
+
declare const ListGroupAction: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
29
29
|
/** The surface. Depth comes from a ring plus a soft shadow, not a frame. */
|
|
30
|
-
declare const List: ({ className, ...props }: React
|
|
30
|
+
declare const List: ({ className, ...props }: React.ComponentProps<"ul">) => React.JSX.Element;
|
|
31
31
|
/**
|
|
32
32
|
* One row. Pass `render` (a link or button element) to make the whole row the
|
|
33
33
|
* target; then keep other interactive elements out of it. Rows with their own
|
|
34
34
|
* trailing buttons stay a plain `li` and put the actions in `ListItemActions`.
|
|
35
35
|
*/
|
|
36
|
-
declare const ListItem: ({ className, render, children, ...props }: useRender.ComponentProps<"div">) => React
|
|
36
|
+
declare const ListItem: ({ className, render, children, ...props }: useRender.ComponentProps<"div">) => React.JSX.Element;
|
|
37
37
|
declare const listItemMediaVariants: (props?: ({
|
|
38
38
|
variant?: "icon" | "initial" | null | undefined;
|
|
39
39
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
40
40
|
/** Fixed 32px tile for an icon, logo or initial. */
|
|
41
|
-
declare const ListItemMedia: ({ className, variant, ...props }: React
|
|
42
|
-
declare const ListItemContent: ({ className, ...props }: React
|
|
41
|
+
declare const ListItemMedia: ({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof listItemMediaVariants>) => React.JSX.Element;
|
|
42
|
+
declare const ListItemContent: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
43
43
|
declare const listItemTitleVariants: (props?: ({
|
|
44
44
|
variant?: "name" | "statement" | null | undefined;
|
|
45
45
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
46
|
-
declare const ListItemTitle: ({ className, variant, ...props }: React
|
|
46
|
+
declare const ListItemTitle: ({ className, variant, ...props }: React.ComponentProps<"span"> & VariantProps<typeof listItemTitleVariants>) => React.JSX.Element;
|
|
47
47
|
declare const listItemDescriptionVariants: (props?: ({
|
|
48
48
|
variant?: "code" | "paragraph" | "text" | null | undefined;
|
|
49
49
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -51,18 +51,18 @@ declare const listItemDescriptionVariants: (props?: ({
|
|
|
51
51
|
* Secondary line, one line by default. Use the `paragraph` variant (two
|
|
52
52
|
* lines) or `lines` when more is genuinely needed; never `whitespace-nowrap`.
|
|
53
53
|
*/
|
|
54
|
-
declare const ListItemDescription: ({ className, variant, lines, ...props }: React
|
|
54
|
+
declare const ListItemDescription: ({ className, variant, lines, ...props }: React.ComponentProps<"span"> & VariantProps<typeof listItemDescriptionVariants> & {
|
|
55
55
|
lines?: TruncatedTextLines;
|
|
56
|
-
}) => React
|
|
57
|
-
declare const ListItemActions: ({ className, ...props }: React
|
|
56
|
+
}) => React.JSX.Element;
|
|
57
|
+
declare const ListItemActions: ({ className, ...props }: React.ComponentProps<"div">) => React.JSX.Element;
|
|
58
58
|
/** Single-line empty row inside a `List`. Phrase it as the next action. */
|
|
59
|
-
declare const ListEmpty: ({ className, ...props }: React
|
|
59
|
+
declare const ListEmpty: ({ className, ...props }: React.ComponentProps<"li">) => React.JSX.Element;
|
|
60
60
|
type StatusTone = "neutral" | "success" | "warning" | "destructive";
|
|
61
61
|
/**
|
|
62
62
|
* Dot + label status. The label always carries the meaning; the dot only
|
|
63
63
|
* reinforces it, so colour is never the sole signal.
|
|
64
64
|
*/
|
|
65
|
-
declare const ListItemStatus: ({ tone, className, children, ...props }: React
|
|
65
|
+
declare const ListItemStatus: ({ tone, className, children, ...props }: React.ComponentProps<"span"> & {
|
|
66
66
|
tone?: StatusTone;
|
|
67
|
-
}) => React
|
|
67
|
+
}) => React.JSX.Element;
|
|
68
68
|
export { List, ListEmpty, ListGroup, ListGroupAction, ListGroupCount, ListGroupDescription, ListGroupHeader, ListGroupHeading, ListGroupTitle, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemMedia, ListItemStatus, ListItemTitle, type StatusTone };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { Kbd } from "./kbd.js";
|
|
3
3
|
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
4
4
|
declare const MenuCreateHandle: typeof Menu$1.createHandle;
|
|
5
5
|
declare const Menu: typeof Menu$1.Root;
|
|
6
|
-
declare const MenuPortal: React
|
|
6
|
+
declare const MenuPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").MenuPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
declare function MenuTrigger({ tooltip, ...props }: Menu$1.Trigger.Props & {
|
|
8
|
-
tooltip?: React
|
|
9
|
-
}): React
|
|
10
|
-
declare const MenuAnchor: () => React
|
|
8
|
+
tooltip?: React.ReactNode;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare const MenuAnchor: () => React.JSX.Element;
|
|
11
11
|
declare const MenuPopup: ({ children, className, sideOffset, align, alignOffset, side, anchor, collisionAvoidance, header, viewportClassName, ...props }: Menu$1.Popup.Props & {
|
|
12
12
|
/** Content pinned above the scrolling list, such as a search field. It sits
|
|
13
13
|
* outside the list, so a row scrolled into view can never hide under it. */
|
|
14
|
-
header?: React
|
|
14
|
+
header?: React.ReactNode;
|
|
15
15
|
/** Classes for the scrolling list inside the popup, e.g. a lower height
|
|
16
16
|
* cap for a long searchable list. */
|
|
17
17
|
viewportClassName?: string;
|
|
@@ -21,12 +21,12 @@ declare const MenuPopup: ({ children, className, sideOffset, align, alignOffset,
|
|
|
21
21
|
side?: Menu$1.Positioner.Props["side"];
|
|
22
22
|
anchor?: Menu$1.Positioner.Props["anchor"];
|
|
23
23
|
collisionAvoidance?: Menu$1.Positioner.Props["collisionAvoidance"];
|
|
24
|
-
}) => React
|
|
25
|
-
declare const MenuGroup: (props: Menu$1.Group.Props) => React
|
|
24
|
+
}) => React.JSX.Element;
|
|
25
|
+
declare const MenuGroup: (props: Menu$1.Group.Props) => React.JSX.Element;
|
|
26
26
|
declare const MenuItem: ({ className, inset, variant, ...props }: Menu$1.Item.Props & {
|
|
27
27
|
inset?: boolean;
|
|
28
28
|
variant?: "default" | "destructive";
|
|
29
|
-
}) => React
|
|
29
|
+
}) => React.JSX.Element;
|
|
30
30
|
/**
|
|
31
31
|
* A menu row that navigates: an `<a>` with the item's look, so it opens in a
|
|
32
32
|
* new tab on a modified click, shows its URL on hover and is announced as a
|
|
@@ -36,33 +36,33 @@ declare const MenuItem: ({ className, inset, variant, ...props }: Menu$1.Item.Pr
|
|
|
36
36
|
*/
|
|
37
37
|
declare const MenuLinkItem: ({ className, inset, ...props }: Menu$1.LinkItem.Props & {
|
|
38
38
|
inset?: boolean;
|
|
39
|
-
}) => React
|
|
39
|
+
}) => React.JSX.Element;
|
|
40
40
|
declare const MenuCheckboxItem: ({ className, children, checked, variant, ...props }: Menu$1.CheckboxItem.Props & {
|
|
41
41
|
variant?: "default" | "switch";
|
|
42
|
-
}) => React
|
|
43
|
-
declare const MenuRadioGroup: (props: Menu$1.RadioGroup.Props) => React
|
|
42
|
+
}) => React.JSX.Element;
|
|
43
|
+
declare const MenuRadioGroup: (props: Menu$1.RadioGroup.Props) => React.JSX.Element;
|
|
44
44
|
declare const MenuRadioItem: ({ className, children, indicator, ...props }: Menu$1.RadioItem.Props & {
|
|
45
45
|
indicator?: "check" | "none";
|
|
46
|
-
}) => React
|
|
46
|
+
}) => React.JSX.Element;
|
|
47
47
|
declare const MenuGroupLabel: ({ className, inset, ...props }: Menu$1.GroupLabel.Props & {
|
|
48
48
|
inset?: boolean;
|
|
49
|
-
}) => React
|
|
50
|
-
declare const MenuSeparator: ({ className, ...props }: Menu$1.Separator.Props) => React
|
|
49
|
+
}) => React.JSX.Element;
|
|
50
|
+
declare const MenuSeparator: ({ className, ...props }: Menu$1.Separator.Props) => React.JSX.Element;
|
|
51
51
|
/**
|
|
52
52
|
* The shortcut at the end of a menu row. Pass `keys` (`["mod", "K"]`) to have
|
|
53
53
|
* it spelled for the reader's platform; see `Kbd`. It is the `plain` `Kbd`,
|
|
54
54
|
* with no key-cap box, which would crowd a row of labels.
|
|
55
55
|
*/
|
|
56
|
-
declare const MenuShortcut: ({ className, ...props }: Omit<React
|
|
57
|
-
declare const MenuSub: (props: Menu$1.SubmenuRoot.Props) => React
|
|
56
|
+
declare const MenuShortcut: ({ className, ...props }: Omit<React.ComponentProps<typeof Kbd>, "variant">) => React.JSX.Element;
|
|
57
|
+
declare const MenuSub: (props: Menu$1.SubmenuRoot.Props) => React.JSX.Element;
|
|
58
58
|
declare const MenuSubTrigger: ({ className, inset, children, ...props }: Menu$1.SubmenuTrigger.Props & {
|
|
59
59
|
inset?: boolean;
|
|
60
|
-
}) => React
|
|
60
|
+
}) => React.JSX.Element;
|
|
61
61
|
declare const MenuSubPopup: ({ className, sideOffset, alignOffset, align, ...props }: Menu$1.Popup.Props & {
|
|
62
|
-
header?: React
|
|
62
|
+
header?: React.ReactNode;
|
|
63
63
|
viewportClassName?: string;
|
|
64
64
|
align?: Menu$1.Positioner.Props["align"];
|
|
65
65
|
sideOffset?: Menu$1.Positioner.Props["sideOffset"];
|
|
66
66
|
alignOffset?: Menu$1.Positioner.Props["alignOffset"];
|
|
67
|
-
}) => React
|
|
67
|
+
}) => React.JSX.Element;
|
|
68
68
|
export { Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuLinkItem as DropdownMenuLinkItem, MenuLinkItem, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger, MenuAnchor };
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outline navigation: an embedded panel, a host-owned rail, or a disclosure.
|
|
3
|
+
*
|
|
4
|
+
* Embedded presentations fill their host track. The standalone disclosure
|
|
5
|
+
* owns a thin column of ticks; hovering, focusing, or tapping the column
|
|
6
|
+
* reveals the collapsible tree. Click a tick or a row to jump.
|
|
7
|
+
*
|
|
8
|
+
* Generic over the position source: callers supply `resolvePct` (vertical % for
|
|
9
|
+
* a tick) and `onJump`. Active tracking is derived from `resolvePct` by default,
|
|
10
|
+
* or driven externally via the controlled `activeId` prop (e.g. a virtualised
|
|
11
|
+
* editor that measures rendered anchors itself).
|
|
12
|
+
*/
|
|
1
13
|
import { ReactNode, RefObject } from "react";
|
|
2
14
|
/**
|
|
3
15
|
* How prominently an entry reads next to the entries around it. A caller
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { Button } from "./button.js";
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
declare const Pagination: ({ className, ...props }: React
|
|
5
|
-
declare const PaginationContent: ({ className, ...props }: React
|
|
6
|
-
declare const PaginationItem: ({ ...props }: React
|
|
4
|
+
declare const Pagination: ({ className, ...props }: React.ComponentProps<"nav">) => React.JSX.Element;
|
|
5
|
+
declare const PaginationContent: ({ className, ...props }: React.ComponentProps<"ul">) => React.JSX.Element;
|
|
6
|
+
declare const PaginationItem: ({ ...props }: React.ComponentProps<"li">) => React.JSX.Element;
|
|
7
7
|
type PaginationLinkProps = {
|
|
8
8
|
isActive?: boolean;
|
|
9
|
-
size?: React
|
|
9
|
+
size?: React.ComponentProps<typeof Button>["size"];
|
|
10
10
|
} & useRender.ComponentProps<"a">;
|
|
11
|
-
declare function PaginationLink({ className, isActive, size, render, ...props }: PaginationLinkProps): React
|
|
12
|
-
declare const PaginationPrevious: ({ className, ...props }: React
|
|
13
|
-
declare const PaginationNext: ({ className, ...props }: React
|
|
14
|
-
declare const PaginationEllipsis: ({ className, ...props }: React
|
|
11
|
+
declare function PaginationLink({ className, isActive, size, render, ...props }: PaginationLinkProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
12
|
+
declare const PaginationPrevious: ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => React.JSX.Element;
|
|
13
|
+
declare const PaginationNext: ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => React.JSX.Element;
|
|
14
|
+
declare const PaginationEllipsis: ({ className, ...props }: React.ComponentProps<"span">) => React.JSX.Element;
|
|
15
15
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
import { OverlayLayer } from "../lib/overlay-layer.js";
|
|
4
4
|
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
5
5
|
declare const PopoverCreateHandle: typeof Popover$1.createHandle;
|
|
6
6
|
declare const Popover: typeof Popover$1.Root;
|
|
7
7
|
declare function PopoverTrigger({ tooltip, ...props }: Popover$1.Trigger.Props & {
|
|
8
|
-
tooltip?: React
|
|
9
|
-
}): React
|
|
8
|
+
tooltip?: React.ReactNode;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
10
|
/**
|
|
11
11
|
* Viewport padding. The inline value also feeds the page-width calculation of
|
|
12
12
|
* the viewport, so both axes change together.
|
|
@@ -28,7 +28,7 @@ declare const PopoverPopup: ({ children, className, side, align, sideOffset, ali
|
|
|
28
28
|
anchor?: Popover$1.Positioner.Props["anchor"];
|
|
29
29
|
layer?: OverlayLayer;
|
|
30
30
|
tooltipStyle?: boolean;
|
|
31
|
-
}) => React
|
|
31
|
+
}) => React.JSX.Element;
|
|
32
32
|
/**
|
|
33
33
|
* Popover surface with the content layout baked in: children stack in a vertical
|
|
34
34
|
* flex container. coss renders popup children inside a separate inner Viewport,
|
|
@@ -38,8 +38,8 @@ declare const PopoverPopup: ({ children, className, side, align, sideOffset, ali
|
|
|
38
38
|
*/
|
|
39
39
|
declare const PopoverPanel: ({ children, contentClassName, ...props }: ComponentProps<typeof PopoverPopup> & {
|
|
40
40
|
contentClassName?: string;
|
|
41
|
-
}) => React
|
|
42
|
-
declare const PopoverClose: ({ ...props }: Popover$1.Close.Props) => React
|
|
43
|
-
declare const PopoverTitle: ({ className, ...props }: Popover$1.Title.Props) => React
|
|
44
|
-
declare const PopoverDescription: ({ className, ...props }: Popover$1.Description.Props) => React
|
|
41
|
+
}) => React.JSX.Element;
|
|
42
|
+
declare const PopoverClose: ({ ...props }: Popover$1.Close.Props) => React.JSX.Element;
|
|
43
|
+
declare const PopoverTitle: ({ className, ...props }: Popover$1.Title.Props) => React.JSX.Element;
|
|
44
|
+
declare const PopoverDescription: ({ className, ...props }: Popover$1.Description.Props) => React.JSX.Element;
|
|
45
45
|
export { Popover, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverPanel, PopoverTitle, PopoverTrigger };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Side-pane preview pattern: a list of options (menu items, rows) with a
|
|
4
4
|
* fixed-width pane beside it that previews the highlighted option. The pane
|
|
@@ -6,8 +6,8 @@ import * as React$1 from "react";
|
|
|
6
6
|
* from `onMouseEnter`/`onFocus` on the options and render `PreviewPane`
|
|
7
7
|
* empty (no children) while nothing is highlighted.
|
|
8
8
|
*/
|
|
9
|
-
type MenuPreviewLayoutProps = React
|
|
10
|
-
preview: React
|
|
9
|
+
type MenuPreviewLayoutProps = React.PropsWithChildren<{
|
|
10
|
+
preview: React.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
12
|
/**
|
|
13
13
|
* `fixed` sizes the menu around a fixed-width pane. `remaining` is for a
|
|
@@ -17,7 +17,7 @@ type MenuPreviewLayoutProps = React$1.PropsWithChildren<{
|
|
|
17
17
|
*/
|
|
18
18
|
previewWidth?: "fixed" | "remaining";
|
|
19
19
|
}>;
|
|
20
|
-
declare const MenuPreviewLayout: ({ children, preview, className, previewWidth }: MenuPreviewLayoutProps) => React
|
|
20
|
+
declare const MenuPreviewLayout: ({ children, preview, className, previewWidth }: MenuPreviewLayoutProps) => React.JSX.Element;
|
|
21
21
|
/**
|
|
22
22
|
* What the pane does with content taller than its box. `clip` is for a
|
|
23
23
|
* depiction (a sketch, a scaled glimpse of a page) that only has to show its
|
|
@@ -29,7 +29,7 @@ declare const MenuPreviewLayout: ({ children, preview, className, previewWidth }
|
|
|
29
29
|
* assistive technology.
|
|
30
30
|
*/
|
|
31
31
|
type PreviewPaneOverflow = "clip" | "scroll";
|
|
32
|
-
type PreviewPaneProps = React
|
|
32
|
+
type PreviewPaneProps = React.ComponentProps<"div"> & {
|
|
33
33
|
overflow?: PreviewPaneOverflow;
|
|
34
34
|
/**
|
|
35
35
|
* `default` is the side pane described above. `thumbnail` is the same pane
|
|
@@ -37,5 +37,5 @@ type PreviewPaneProps = React$1.ComponentProps<"div"> & {
|
|
|
37
37
|
*/
|
|
38
38
|
size?: "default" | "thumbnail";
|
|
39
39
|
};
|
|
40
|
-
declare const PreviewPane: ({ children, className, overflow, size, ...props }: PreviewPaneProps) => React
|
|
40
|
+
declare const PreviewPane: ({ children, className, overflow, size, ...props }: PreviewPaneProps) => React.JSX.Element;
|
|
41
41
|
export { MenuPreviewLayout, PreviewPane };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
/** Preserve source word breaks while allowing oversized tokens to fit narrow panes. */
|
|
4
4
|
export declare const LEGAL_TEXT_CLASS_NAME = "hyphens-manual wrap-anywhere";
|
|
@@ -7,5 +7,5 @@ declare const proseVariants: (props?: ({
|
|
|
7
7
|
tone?: "default" | "muted" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
/** A readable measure for narrative copy; task-shaped text should not use it. */
|
|
10
|
-
export declare const Prose: ({ className, size, tone, ...props }: React
|
|
10
|
+
export declare const Prose: ({ className, size, tone, ...props }: React.ComponentProps<"p"> & VariantProps<typeof proseVariants>) => React.JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll-to-top affordance — a subtle floating button that fades in once a
|
|
3
|
+
* scroll container is scrolled past a threshold and jumps back to the top
|
|
4
|
+
* (instant, not animated, so it stays snappy on very long documents).
|
|
5
|
+
*/
|
|
1
6
|
import { RefObject } from "react";
|
|
2
7
|
export type ScrollToTopProps = {
|
|
3
8
|
scrollContainerRef: RefObject<HTMLElement | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { InputGroupInput } from "./input-group.js";
|
|
3
|
-
type SearchFieldProps = Omit<React
|
|
3
|
+
type SearchFieldProps = Omit<React.ComponentProps<typeof InputGroupInput>, "onChange" | "type" | "value"> & {
|
|
4
4
|
value: string;
|
|
5
5
|
onValueChange: (value: string) => void;
|
|
6
6
|
/** Accessible name of the clear button; the package ships no copy. */
|
|
@@ -14,5 +14,5 @@ type SearchFieldProps = Omit<React$1.ComponentProps<typeof InputGroupInput>, "on
|
|
|
14
14
|
* and the matching; keep matching local and instant for lists under a few
|
|
15
15
|
* hundred rows.
|
|
16
16
|
*/
|
|
17
|
-
declare const SearchField: ({ value, onValueChange, clearLabel, groupClassName, className, onKeyDown, ...props }: SearchFieldProps) => React
|
|
17
|
+
declare const SearchField: ({ value, onValueChange, clearLabel, groupClassName, className, onKeyDown, ...props }: SearchFieldProps) => React.JSX.Element;
|
|
18
18
|
export { SearchField, type SearchFieldProps };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import * as React
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { ControlSize } from "../lib/control-size.js";
|
|
3
3
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
4
4
|
type SelectItemProps = Select$1.Item.Props & {
|
|
5
5
|
label?: string;
|
|
6
6
|
};
|
|
7
|
-
declare const Select: <Value, Multiple extends boolean | undefined = false>({ children, isItemEqualToValue, itemToStringLabel, itemToStringValue, ...props }: Select$1.Root.Props<Value, Multiple>) => React
|
|
7
|
+
declare const Select: <Value, Multiple extends boolean | undefined = false>({ children, isItemEqualToValue, itemToStringLabel, itemToStringValue, ...props }: Select$1.Root.Props<Value, Multiple>) => React.JSX.Element;
|
|
8
8
|
declare const SelectTrigger: ({ className, align, size, children, ...props }: Select$1.Trigger.Props & {
|
|
9
9
|
size?: ControlSize;
|
|
10
10
|
align?: "start" | "center";
|
|
11
|
-
}) => React
|
|
12
|
-
declare const SelectValue: ({ className, children, placeholder, ...props }: Select$1.Value.Props) => React
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
|
+
declare const SelectValue: ({ className, children, placeholder, ...props }: Select$1.Value.Props) => React.JSX.Element;
|
|
13
13
|
declare const SelectPopup: ({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, ...props }: Select$1.Popup.Props & {
|
|
14
14
|
side?: Select$1.Positioner.Props["side"];
|
|
15
15
|
sideOffset?: Select$1.Positioner.Props["sideOffset"];
|
|
16
16
|
align?: Select$1.Positioner.Props["align"];
|
|
17
17
|
alignOffset?: Select$1.Positioner.Props["alignOffset"];
|
|
18
18
|
alignItemWithTrigger?: Select$1.Positioner.Props["alignItemWithTrigger"];
|
|
19
|
-
}) => React
|
|
20
|
-
declare const SelectItem: ({ className, children, label: _label, ...props }: SelectItemProps) => React
|
|
21
|
-
declare const SelectSeparator: ({ className, ...props }: Select$1.Separator.Props) => React
|
|
22
|
-
declare const SelectGroup: (props: Select$1.Group.Props) => React
|
|
23
|
-
declare const SelectGroupLabel: (props: Select$1.GroupLabel.Props) => React
|
|
19
|
+
}) => React.JSX.Element;
|
|
20
|
+
declare const SelectItem: ({ className, children, label: _label, ...props }: SelectItemProps) => React.JSX.Element;
|
|
21
|
+
declare const SelectSeparator: ({ className, ...props }: Select$1.Separator.Props) => React.JSX.Element;
|
|
22
|
+
declare const SelectGroup: (props: Select$1.Group.Props) => React.JSX.Element;
|
|
23
|
+
declare const SelectGroupLabel: (props: Select$1.GroupLabel.Props) => React.JSX.Element;
|
|
24
24
|
export { Select, SelectPopup as SelectContent, SelectPopup, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -6,10 +6,10 @@ import { FIELD_TRIGGER_CLASS_NAME } from "../lib/field-trigger.js";
|
|
|
6
6
|
import { OVERLAY_LAYER_CLASS_NAMES } from "../lib/overlay-layer.js";
|
|
7
7
|
import { cn } from "../lib/utils.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import * as React
|
|
9
|
+
import * as React from "react";
|
|
10
10
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
11
11
|
// src/components/select.tsx
|
|
12
|
-
const SelectItemDisplaysContext = React
|
|
12
|
+
const SelectItemDisplaysContext = React.createContext(/* @__PURE__ */ new Map());
|
|
13
13
|
const renderSelectedDisplay = (displays, placeholder) => (value) => {
|
|
14
14
|
if (!displays.has(value)) return placeholder ?? null;
|
|
15
15
|
return displays.get(value) ?? null;
|
|
@@ -18,7 +18,7 @@ const Select = ({ children, isItemEqualToValue, itemToStringLabel, itemToStringV
|
|
|
18
18
|
const itemLabels = collectSelectItemLabels(children);
|
|
19
19
|
const itemDisplays = collectSelectItemDisplays(children);
|
|
20
20
|
const itemLabelsRef = useLatest(itemLabels);
|
|
21
|
-
const resolveItemLabel = React
|
|
21
|
+
const resolveItemLabel = React.useCallback((value) => itemLabelsRef.current.get(value) ?? String(value), [itemLabelsRef]);
|
|
22
22
|
const root = /* @__PURE__ */ jsx(Select$1.Root, {
|
|
23
23
|
...props,
|
|
24
24
|
isItemEqualToValue,
|
|
@@ -46,7 +46,7 @@ const SELECT_TRIGGER_SIZE_CLASS_NAMES = {
|
|
|
46
46
|
[CONTROL_SIZE.lg]: "min-h-10 sm:min-h-9"
|
|
47
47
|
};
|
|
48
48
|
const SelectValue = ({ className, children, placeholder, ...props }) => {
|
|
49
|
-
const displays = React
|
|
49
|
+
const displays = React.use(SelectItemDisplaysContext);
|
|
50
50
|
if (children !== void 0 || displays.size === 0) return /* @__PURE__ */ jsx(Select$1.Value, {
|
|
51
51
|
className: cn("data-placeholder:text-muted-foreground flex-1 truncate", className),
|
|
52
52
|
"data-slot": "select-value",
|
|
@@ -121,14 +121,14 @@ const SelectItem = ({ className, children, label: _label, ...props }) => /* @__P
|
|
|
121
121
|
});
|
|
122
122
|
function collectSelectItemLabels(children) {
|
|
123
123
|
const labels = /* @__PURE__ */ new Map();
|
|
124
|
-
React
|
|
124
|
+
React.Children.forEach(children, (child) => {
|
|
125
125
|
collectSelectItemLabel(child, labels);
|
|
126
126
|
});
|
|
127
127
|
return labels;
|
|
128
128
|
}
|
|
129
129
|
function collectSelectItemDisplays(children) {
|
|
130
130
|
const displays = /* @__PURE__ */ new Map();
|
|
131
|
-
React
|
|
131
|
+
React.Children.forEach(children, (child) => {
|
|
132
132
|
collectSelectItemDisplay(child, displays);
|
|
133
133
|
});
|
|
134
134
|
return displays;
|
|
@@ -140,7 +140,7 @@ function collectSelectItemDisplay(child, displays) {
|
|
|
140
140
|
displays.set(value, child.props.children);
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
React
|
|
143
|
+
React.Children.forEach(child.props.children, (nestedChild) => {
|
|
144
144
|
collectSelectItemDisplay(nestedChild, displays);
|
|
145
145
|
});
|
|
146
146
|
}
|
|
@@ -151,15 +151,15 @@ function collectSelectItemLabel(child, labels) {
|
|
|
151
151
|
const label = child.props.label ?? getTextLabel(child.props.children);
|
|
152
152
|
if (label) labels.set(value, label);
|
|
153
153
|
}
|
|
154
|
-
React
|
|
154
|
+
React.Children.forEach(child.props.children, (nestedChild) => {
|
|
155
155
|
collectSelectItemLabel(nestedChild, labels);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
function isElementWithChildren(node) {
|
|
159
|
-
return React
|
|
159
|
+
return React.isValidElement(node);
|
|
160
160
|
}
|
|
161
161
|
function isSelectItemElement(node) {
|
|
162
|
-
return React
|
|
162
|
+
return React.isValidElement(node) && node.type === SelectItem;
|
|
163
163
|
}
|
|
164
164
|
function isReactNodeArray(node) {
|
|
165
165
|
return Array.isArray(node);
|
|
@@ -168,7 +168,7 @@ function getTextLabel(node) {
|
|
|
168
168
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
169
169
|
if (isReactNodeArray(node)) {
|
|
170
170
|
const parts = [];
|
|
171
|
-
React
|
|
171
|
+
React.Children.forEach(node, (child) => {
|
|
172
172
|
const text = getTextLabel(child);
|
|
173
173
|
if (text) parts.push(text);
|
|
174
174
|
});
|