@omer-x/tailwind-ui-kit 1.0.0-alpha.40 → 1.0.0-alpha.42

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.
Files changed (55) hide show
  1. package/README.md +229 -0
  2. package/dist/components/form/BaseAutocomplete.d.ts +1 -1
  3. package/dist/components/form/BaseSelect.d.ts +165 -0
  4. package/dist/components/form/BaseSelect.js +41 -0
  5. package/dist/components/form/BaseSelectGroup.d.ts +8 -0
  6. package/dist/components/form/BaseSelectGroup.js +7 -0
  7. package/dist/components/form/BaseSelectGroupLabel.d.ts +8 -0
  8. package/dist/components/form/BaseSelectGroupLabel.js +7 -0
  9. package/dist/components/form/BaseSelectIcon.d.ts +14 -0
  10. package/dist/components/form/BaseSelectIcon.js +10 -0
  11. package/dist/components/form/BaseSelectItem.d.ts +24 -0
  12. package/dist/components/form/BaseSelectItem.js +14 -0
  13. package/dist/components/form/BaseSelectItemIndicator.d.ts +16 -0
  14. package/dist/components/form/BaseSelectItemIndicator.js +10 -0
  15. package/dist/components/form/BaseSelectItemText.d.ts +8 -0
  16. package/dist/components/form/BaseSelectItemText.js +7 -0
  17. package/dist/components/form/BaseSelectLabel.d.ts +12 -0
  18. package/dist/components/form/BaseSelectLabel.js +10 -0
  19. package/dist/components/form/BaseSelectList.d.ts +8 -0
  20. package/dist/components/form/BaseSelectList.js +11 -0
  21. package/dist/components/form/BaseSelectPopup.d.ts +90 -0
  22. package/dist/components/form/BaseSelectPopup.js +45 -0
  23. package/dist/components/form/BaseSelectScrollDownArrow.d.ts +15 -0
  24. package/dist/components/form/BaseSelectScrollDownArrow.js +17 -0
  25. package/dist/components/form/BaseSelectScrollUpArrow.d.ts +15 -0
  26. package/dist/components/form/BaseSelectScrollUpArrow.js +17 -0
  27. package/dist/components/form/BaseSelectSeparator.d.ts +16 -0
  28. package/dist/components/form/BaseSelectSeparator.js +10 -0
  29. package/dist/components/form/BaseSelectTrigger.d.ts +17 -0
  30. package/dist/components/form/BaseSelectTrigger.js +15 -0
  31. package/dist/components/form/BaseSelectValue.d.ts +21 -0
  32. package/dist/components/form/BaseSelectValue.js +11 -0
  33. package/dist/components/form/index.d.ts +9 -1
  34. package/dist/components/form/index.js +2 -1
  35. package/dist/components/form/selectTypes.d.ts +27 -0
  36. package/dist/components/form/selectTypes.js +1 -0
  37. package/dist/components/overlay/BaseTooltip.d.ts +92 -0
  38. package/dist/components/overlay/BaseTooltip.js +24 -0
  39. package/dist/components/overlay/BaseTooltipArrow.d.ts +20 -0
  40. package/dist/components/overlay/BaseTooltipArrow.js +10 -0
  41. package/dist/components/overlay/BaseTooltipPopup.d.ts +106 -0
  42. package/dist/components/overlay/BaseTooltipPopup.js +38 -0
  43. package/dist/components/overlay/BaseTooltipTrigger.d.ts +31 -0
  44. package/dist/components/overlay/BaseTooltipTrigger.js +14 -0
  45. package/dist/components/overlay/BaseTooltipViewport.d.ts +20 -0
  46. package/dist/components/overlay/BaseTooltipViewport.js +11 -0
  47. package/dist/components/overlay/createTooltipHandle.d.ts +30 -0
  48. package/dist/components/overlay/createTooltipHandle.js +27 -0
  49. package/dist/components/overlay/index.d.ts +7 -0
  50. package/dist/components/overlay/index.js +3 -0
  51. package/dist/components/providers/TooltipProvider.d.ts +19 -0
  52. package/dist/components/providers/TooltipProvider.js +10 -0
  53. package/dist/components/providers/index.d.ts +2 -0
  54. package/dist/components/providers/index.js +1 -0
  55. package/package.json +9 -1
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { Select } from "@base-ui/react/select";
3
+ import { jsx } from "react/jsx-runtime";
4
+ // src/components/form/BaseSelectLabel.tsx
5
+ /**
6
+ * Names the select for assistive technology. Clicking it focuses the trigger. Renders a `<div>`.
7
+ * Not needed inside `BaseFormField`, whose `label` already names it.
8
+ */
9
+ const BaseSelectLabel = (props) => /* @__PURE__ */ jsx(Select.Label, { ...props });
10
+ export { BaseSelectLabel as default };
@@ -0,0 +1,8 @@
1
+ import { RenderProp } from "../../utils/render.js";
2
+ import { ComponentProps } from "react";
3
+ type BaseSelectListProps = ComponentProps<"div"> & {
4
+ render?: RenderProp<"div">;
5
+ };
6
+ /** The scrollable list of items, never taller than the space left in the viewport. Renders a `<div>`. */
7
+ declare const BaseSelectList: ({ className, ...otherProps }: BaseSelectListProps) => import("react").JSX.Element;
8
+ export { BaseSelectList as default };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { Select } from "@base-ui/react/select";
3
+ import { cn } from "cn";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/components/form/BaseSelectList.tsx
6
+ /** The scrollable list of items, never taller than the space left in the viewport. Renders a `<div>`. */
7
+ const BaseSelectList = ({ className, ...otherProps }) => /* @__PURE__ */ jsx(Select.List, {
8
+ ...otherProps,
9
+ className: cn("max-h-(--available-height) overflow-y-auto overscroll-contain outline-none", className)
10
+ });
11
+ export { BaseSelectList as default };
@@ -0,0 +1,90 @@
1
+ import { AutocompleteCollisionAvoidance, AutocompleteFocusTarget, AutocompleteOffsetFunction } from "./BaseAutocompletePopup.js";
2
+ import { SelectAlign, SelectSide } from "./selectTypes.js";
3
+ import { RenderProp } from "../../utils/render.js";
4
+ import { ComponentProps, ReactNode, RefObject } from "react";
5
+ export type SelectPopupState = {
6
+ open: boolean;
7
+ /** `"none"` while the popup is placed over the trigger (`alignItemWithTrigger`). */
8
+ side: SelectSide | "none";
9
+ align: SelectAlign;
10
+ };
11
+ export type SelectPositionerState = SelectPopupState & {
12
+ /** Whether the trigger the popup is placed against is scrolled out of view. */
13
+ anchorHidden: boolean;
14
+ };
15
+ export type SelectArrowState = SelectPopupState & {
16
+ /** Whether the arrow can't point at the center of the trigger. */
17
+ uncentered: boolean;
18
+ };
19
+ export type SelectBackdropState = {
20
+ open: boolean;
21
+ };
22
+ /** The element focused when the popup closes. See `AutocompleteFocusTarget`. */
23
+ export type SelectFocusTarget = AutocompleteFocusTarget;
24
+ /** Computes an offset from the popup's placement and the sizes of the trigger and the popup. */
25
+ export type SelectOffsetFunction = AutocompleteOffsetFunction;
26
+ /** How the popup avoids the edges of `collisionBoundary`. */
27
+ export type SelectCollisionAvoidance = AutocompleteCollisionAvoidance;
28
+ type Rect = {
29
+ x: number;
30
+ y: number;
31
+ width: number;
32
+ height: number;
33
+ };
34
+ type BaseSelectPopupProps = ComponentProps<"div"> & {
35
+ render?: RenderProp<"div", SelectPopupState>;
36
+ /** The element focused when the popup closes. Defaults to the trigger. */
37
+ finalFocus?: SelectFocusTarget;
38
+ /** Where the popup is portaled to. Defaults to `<body>`. */
39
+ container?: HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null;
40
+ /**
41
+ * Places the popup over the trigger, with the selected item on top of the value, like a native `<select>`.
42
+ * The popup then has `data-side="none"`, and `side`, `align` and their offsets don't apply.
43
+ * Touch input and too little space fall back to a regular placement. Set to `false` to always place it beside the trigger.
44
+ * @default true
45
+ */
46
+ alignItemWithTrigger?: boolean;
47
+ /** The element the popup is placed against. Defaults to the trigger. */
48
+ anchor?: Element | RefObject<Element | null> | (() => Element | null) | null;
49
+ /** @default "absolute" */
50
+ positionMethod?: "absolute" | "fixed";
51
+ /** @default "bottom" */
52
+ side?: SelectSide;
53
+ /** Distance from the trigger in pixels. @default 0 */
54
+ sideOffset?: number | SelectOffsetFunction;
55
+ /** @default "center" */
56
+ align?: SelectAlign;
57
+ /** Shift along the side in pixels. @default 0 */
58
+ alignOffset?: number | SelectOffsetFunction;
59
+ /** @default "clipping-ancestors" */
60
+ collisionBoundary?: "clipping-ancestors" | Element | Element[] | Rect;
61
+ /** Space kept from the boundary's edges, in pixels. @default 5 */
62
+ collisionPadding?: number | {
63
+ top?: number;
64
+ right?: number;
65
+ bottom?: number;
66
+ left?: number;
67
+ };
68
+ collisionAvoidance?: SelectCollisionAvoidance;
69
+ /** Keeps the popup in view while the trigger is scrolled out of view. */
70
+ sticky?: boolean;
71
+ /** Minimum distance between the arrow and the popup's corners, in pixels. @default 5 */
72
+ arrowPadding?: number;
73
+ /** Stops following the trigger when it moves (e.g. on scroll). */
74
+ disableAnchorTracking?: boolean;
75
+ /** Replaces the element that positions the popup. Give it e.g. a `z-index`. */
76
+ renderPositioner?: RenderProp<"div", SelectPositionerState>;
77
+ /** Renders a backdrop under the popup. */
78
+ backdrop?: boolean;
79
+ /** A `className` on the element replaces the kit's conflicting classes. */
80
+ renderBackdrop?: RenderProp<"div", SelectBackdropState>;
81
+ /** The arrow's content (e.g. an `<svg>`). The arrow is rendered when this or `renderArrow` is given. */
82
+ arrow?: ReactNode;
83
+ renderArrow?: RenderProp<"div", SelectArrowState>;
84
+ };
85
+ /**
86
+ * The floating container of the list, with its portal, positioner and an optional backdrop and arrow.
87
+ * At least as wide as the trigger. Renders a `<div>`.
88
+ */
89
+ declare const BaseSelectPopup: ({ container, alignItemWithTrigger, anchor, positionMethod, side, sideOffset, align, alignOffset, collisionBoundary, collisionPadding, collisionAvoidance, sticky, arrowPadding, disableAnchorTracking, renderPositioner, backdrop, renderBackdrop, arrow, renderArrow, className, children, ...otherProps }: BaseSelectPopupProps) => import("react").JSX.Element;
90
+ export { BaseSelectPopup as default };
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { Select } from "@base-ui/react/select";
3
+ import { cn } from "cn";
4
+ import { splitClassName } from "../../utils/split-class-name.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ // src/components/form/BaseSelectPopup.tsx
7
+ /**
8
+ * The floating container of the list, with its portal, positioner and an optional backdrop and arrow.
9
+ * At least as wide as the trigger. Renders a `<div>`.
10
+ */
11
+ const BaseSelectPopup = ({ container, alignItemWithTrigger, anchor, positionMethod, side, sideOffset, align, alignOffset, collisionBoundary, collisionPadding, collisionAvoidance, sticky, arrowPadding, disableAnchorTracking, renderPositioner, backdrop = false, renderBackdrop, arrow, renderArrow, className, children, ...otherProps }) => {
12
+ const backdropElement = splitClassName(renderBackdrop);
13
+ return /* @__PURE__ */ jsxs(Select.Portal, {
14
+ container,
15
+ children: [backdrop && /* @__PURE__ */ jsx(Select.Backdrop, {
16
+ render: backdropElement.render,
17
+ className: cn("fixed inset-0", backdropElement.className)
18
+ }), /* @__PURE__ */ jsx(Select.Positioner, {
19
+ alignItemWithTrigger,
20
+ anchor,
21
+ positionMethod,
22
+ side,
23
+ sideOffset,
24
+ align,
25
+ alignOffset,
26
+ collisionBoundary,
27
+ collisionPadding,
28
+ collisionAvoidance,
29
+ sticky,
30
+ arrowPadding,
31
+ disableAnchorTracking,
32
+ render: renderPositioner,
33
+ className: "outline-none select-none",
34
+ children: /* @__PURE__ */ jsxs(Select.Popup, {
35
+ ...otherProps,
36
+ className: cn("relative", "min-w-(--anchor-width)", "max-w-(--available-width)", "origin-(--transform-origin)", "outline-none", "transition-[opacity,scale]", "duration-150", "data-ending-style:scale-95", "data-ending-style:opacity-0", "data-starting-style:scale-95", "data-starting-style:opacity-0", "data-[side=none]:data-starting-style:scale-100", "data-[side=none]:data-starting-style:opacity-100", "data-[side=none]:data-starting-style:transition-none", className),
37
+ children: [(typeof arrow !== "undefined" || renderArrow) && /* @__PURE__ */ jsx(Select.Arrow, {
38
+ render: renderArrow,
39
+ children: arrow
40
+ }), children]
41
+ })
42
+ })]
43
+ });
44
+ };
45
+ export { BaseSelectPopup as default };
@@ -0,0 +1,15 @@
1
+ import { SelectScrollArrowState } from "./selectTypes.js";
2
+ import { RenderProp } from "../../utils/render.js";
3
+ import { ComponentProps } from "react";
4
+ type BaseSelectScrollDownArrowProps = ComponentProps<"div"> & {
5
+ render?: RenderProp<"div", SelectScrollArrowState>;
6
+ /** Keeps the arrow in the DOM while the list can't scroll down. */
7
+ keepMounted?: boolean;
8
+ };
9
+ /**
10
+ * Scrolls the list down while the pointer rests on it. Only rendered while the list can scroll down.
11
+ * Put it in `Popup`, next to `List`. Renders a `<div>` pinned to the popup's bottom edge,
12
+ * hidden from assistive technology. Bring your own icon as children: there's none by default.
13
+ */
14
+ declare const BaseSelectScrollDownArrow: ({ className, children, render, ...otherProps }: BaseSelectScrollDownArrowProps) => import("react").JSX.Element;
15
+ export { BaseSelectScrollDownArrow as default };
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { Select } from "@base-ui/react/select";
3
+ import { cn } from "cn";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/components/form/BaseSelectScrollDownArrow.tsx
6
+ /**
7
+ * Scrolls the list down while the pointer rests on it. Only rendered while the list can scroll down.
8
+ * Put it in `Popup`, next to `List`. Renders a `<div>` pinned to the popup's bottom edge,
9
+ * hidden from assistive technology. Bring your own icon as children: there's none by default.
10
+ */
11
+ const BaseSelectScrollDownArrow = ({ className, children = null, render, ...otherProps }) => /* @__PURE__ */ jsx(Select.ScrollDownArrow, {
12
+ ...otherProps,
13
+ render,
14
+ className: cn("bottom-0 left-0 z-1 flex w-full cursor-default items-center justify-center", className),
15
+ children
16
+ });
17
+ export { BaseSelectScrollDownArrow as default };
@@ -0,0 +1,15 @@
1
+ import { SelectScrollArrowState } from "./selectTypes.js";
2
+ import { RenderProp } from "../../utils/render.js";
3
+ import { ComponentProps } from "react";
4
+ type BaseSelectScrollUpArrowProps = ComponentProps<"div"> & {
5
+ render?: RenderProp<"div", SelectScrollArrowState>;
6
+ /** Keeps the arrow in the DOM while the list can't scroll up. */
7
+ keepMounted?: boolean;
8
+ };
9
+ /**
10
+ * Scrolls the list up while the pointer rests on it. Only rendered while the list can scroll up.
11
+ * Put it in `Popup`, next to `List`. Renders a `<div>` pinned to the popup's top edge,
12
+ * hidden from assistive technology. Bring your own icon as children: there's none by default.
13
+ */
14
+ declare const BaseSelectScrollUpArrow: ({ className, children, render, ...otherProps }: BaseSelectScrollUpArrowProps) => import("react").JSX.Element;
15
+ export { BaseSelectScrollUpArrow as default };
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { Select } from "@base-ui/react/select";
3
+ import { cn } from "cn";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/components/form/BaseSelectScrollUpArrow.tsx
6
+ /**
7
+ * Scrolls the list up while the pointer rests on it. Only rendered while the list can scroll up.
8
+ * Put it in `Popup`, next to `List`. Renders a `<div>` pinned to the popup's top edge,
9
+ * hidden from assistive technology. Bring your own icon as children: there's none by default.
10
+ */
11
+ const BaseSelectScrollUpArrow = ({ className, children = null, render, ...otherProps }) => /* @__PURE__ */ jsx(Select.ScrollUpArrow, {
12
+ ...otherProps,
13
+ render,
14
+ className: cn("top-0 left-0 z-1 flex w-full cursor-default items-center justify-center", className),
15
+ children
16
+ });
17
+ export { BaseSelectScrollUpArrow as default };
@@ -0,0 +1,16 @@
1
+ import { RenderProp } from "../../utils/render.js";
2
+ import { ComponentProps } from "react";
3
+ export type SelectSeparatorState = {
4
+ orientation: "horizontal" | "vertical";
5
+ };
6
+ type BaseSelectSeparatorProps = ComponentProps<"div"> & {
7
+ render?: RenderProp<"div", SelectSeparatorState>;
8
+ /** @default "horizontal" */
9
+ orientation?: "horizontal" | "vertical";
10
+ };
11
+ /**
12
+ * A line between items or groups. Renders a `<div>` with `data-orientation`,
13
+ * and `role="presentation"` (a listbox can't hold separators).
14
+ */
15
+ declare const BaseSelectSeparator: (props: BaseSelectSeparatorProps) => import("react").JSX.Element;
16
+ export { BaseSelectSeparator as default };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { Select } from "@base-ui/react/select";
3
+ import { jsx } from "react/jsx-runtime";
4
+ // src/components/form/BaseSelectSeparator.tsx
5
+ /**
6
+ * A line between items or groups. Renders a `<div>` with `data-orientation`,
7
+ * and `role="presentation"` (a listbox can't hold separators).
8
+ */
9
+ const BaseSelectSeparator = (props) => /* @__PURE__ */ jsx(Select.Separator, { ...props });
10
+ export { BaseSelectSeparator as default };
@@ -0,0 +1,17 @@
1
+ import { InputSize } from "./inputSizes.js";
2
+ import { SelectTriggerState } from "./selectTypes.js";
3
+ import { RenderProp } from "../../utils/render.js";
4
+ import { ComponentProps } from "react";
5
+ type BaseSelectTriggerProps = Omit<ComponentProps<"button">, "value"> & {
6
+ /** The same sizes as `BaseInput`. */
7
+ size?: InputSize;
8
+ render?: RenderProp<"button", SelectTriggerState>;
9
+ /** Set to `false` when `render` doesn't render a `<button>`. */
10
+ nativeButton?: boolean;
11
+ };
12
+ /**
13
+ * The button that shows the value and opens the popup. Renders a `<button>`, sized like `BaseInput`,
14
+ * with `data-popup-open` while the popup is open and `data-placeholder` while nothing is selected.
15
+ */
16
+ declare const BaseSelectTrigger: ({ size, className, ...otherProps }: BaseSelectTriggerProps) => import("react").JSX.Element;
17
+ export { BaseSelectTrigger as default };
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { Select } from "@base-ui/react/select";
3
+ import { cn } from "cn";
4
+ import { inputBaseClasses, inputSizeClasses } from "./inputSizes.js";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/components/form/BaseSelectTrigger.tsx
7
+ /**
8
+ * The button that shows the value and opens the popup. Renders a `<button>`, sized like `BaseInput`,
9
+ * with `data-popup-open` while the popup is open and `data-placeholder` while nothing is selected.
10
+ */
11
+ const BaseSelectTrigger = ({ size = "md", className, ...otherProps }) => /* @__PURE__ */ jsx(Select.Trigger, {
12
+ ...otherProps,
13
+ className: cn("flex cursor-default items-center justify-between gap-2 text-left select-none", inputSizeClasses(size), inputBaseClasses, className)
14
+ });
15
+ export { BaseSelectTrigger as default };
@@ -0,0 +1,21 @@
1
+ import { RenderProp } from "../../utils/render.js";
2
+ import { ComponentProps, ReactNode } from "react";
3
+ export type SelectValueState = {
4
+ /** The selected value (an array with `multiple`), `null` when nothing is selected. */
5
+ value: unknown;
6
+ /** Whether nothing is selected, so the placeholder shows. */
7
+ placeholder: boolean;
8
+ };
9
+ type BaseSelectValueProps<Value> = Omit<ComponentProps<"span">, "children"> & {
10
+ render?: RenderProp<"span", SelectValueState>;
11
+ /** Shown while nothing is selected. */
12
+ placeholder?: ReactNode;
13
+ /**
14
+ * Shown as is, or a function of the selected value.
15
+ * Without children, renders the selected item's label (from `items`, or the item's text).
16
+ */
17
+ children?: ReactNode | ((value: Value) => ReactNode);
18
+ };
19
+ /** The selected value's label, inside the trigger. Renders a `<span>`, with `data-placeholder` while nothing is selected. */
20
+ declare const BaseSelectValue: <Value>({ className, ...otherProps }: BaseSelectValueProps<Value>) => import("react").JSX.Element;
21
+ export { BaseSelectValue as default };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { Select } from "@base-ui/react/select";
3
+ import { cn } from "cn";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/components/form/BaseSelectValue.tsx
6
+ /** The selected value's label, inside the trigger. Renders a `<span>`, with `data-placeholder` while nothing is selected. */
7
+ const BaseSelectValue = ({ className, ...otherProps }) => /* @__PURE__ */ jsx(Select.Value, {
8
+ ...otherProps,
9
+ className: cn("min-w-0 flex-1 truncate", className)
10
+ });
11
+ export { BaseSelectValue as default };
@@ -16,6 +16,14 @@ import { AutocompleteArrowState, AutocompleteBackdropState, AutocompleteCollisio
16
16
  import { AutocompleteSeparatorState } from "./BaseAutocompleteSeparator.js";
17
17
  import { InputSize } from "./inputSizes.js";
18
18
  import BaseFieldset, { FieldsetState } from "./BaseFieldset.js";
19
+ import _default$1, { SelectActions, SelectItemGroup, SelectLabeledItem } from "./BaseSelect.js";
20
+ import { SelectAlign, SelectInteractionType, SelectScrollArrowState, SelectSide, SelectTriggerState } from "./selectTypes.js";
21
+ import { SelectIconState } from "./BaseSelectIcon.js";
22
+ import { SelectItemState } from "./BaseSelectItem.js";
23
+ import { SelectItemIndicatorState } from "./BaseSelectItemIndicator.js";
24
+ import { SelectArrowState, SelectBackdropState, SelectCollisionAvoidance, SelectFocusTarget, SelectOffsetFunction, SelectPopupState, SelectPositionerState } from "./BaseSelectPopup.js";
25
+ import { SelectSeparatorState } from "./BaseSelectSeparator.js";
26
+ import { SelectValueState } from "./BaseSelectValue.js";
19
27
  import BaseRadioGroup, { RadioGroupState } from "./BaseRadioGroup.js";
20
28
  import BaseRadio, { RadioState } from "./BaseRadio.js";
21
- export { type AutocompleteActions, type AutocompleteAlign, type AutocompleteArrowState, type AutocompleteBackdropState, type AutocompleteClearState, type AutocompleteCollisionAvoidance, type AutocompleteFilter, type AutocompleteFocusTarget, type AutocompleteHighlightReason, type AutocompleteInputState, type AutocompleteInteractionType, type AutocompleteItemGroup, type AutocompleteItemState, type AutocompleteListState, type AutocompleteOffsetFunction, type AutocompletePopupState, type AutocompletePositionerState, type AutocompleteSeparatorState, type AutocompleteSide, _default as BaseAutocomplete, BaseCheckbox, BaseCheckboxGroup, BaseFieldset, BaseForm, BaseFormField, BaseInput, BaseRadio, BaseRadioGroup, BaseSwitch, type CheckboxGroupState, type CheckboxState, type DisplayedFormMessage, type FieldConstraints, type FieldState, type FieldsetState, type InputSize, type MessageFormatter, type RadioGroupState, type RadioState, type SwitchState, type UseAutocompleteFilterOptions, useAutocompleteFilter, useFormMessages };
29
+ export { type AutocompleteActions, type AutocompleteAlign, type AutocompleteArrowState, type AutocompleteBackdropState, type AutocompleteClearState, type AutocompleteCollisionAvoidance, type AutocompleteFilter, type AutocompleteFocusTarget, type AutocompleteHighlightReason, type AutocompleteInputState, type AutocompleteInteractionType, type AutocompleteItemGroup, type AutocompleteItemState, type AutocompleteListState, type AutocompleteOffsetFunction, type AutocompletePopupState, type AutocompletePositionerState, type AutocompleteSeparatorState, type AutocompleteSide, _default as BaseAutocomplete, BaseCheckbox, BaseCheckboxGroup, BaseFieldset, BaseForm, BaseFormField, BaseInput, BaseRadio, BaseRadioGroup, _default$1 as BaseSelect, BaseSwitch, type CheckboxGroupState, type CheckboxState, type DisplayedFormMessage, type FieldConstraints, type FieldState, type FieldsetState, type InputSize, type MessageFormatter, type RadioGroupState, type RadioState, type SelectActions, type SelectAlign, type SelectArrowState, type SelectBackdropState, type SelectCollisionAvoidance, type SelectFocusTarget, type SelectIconState, type SelectInteractionType, type SelectItemGroup, type SelectItemIndicatorState, type SelectItemState, type SelectLabeledItem, type SelectOffsetFunction, type SelectPopupState, type SelectPositionerState, type SelectScrollArrowState, type SelectSeparatorState, type SelectSide, type SelectTriggerState, type SelectValueState, type SwitchState, type UseAutocompleteFilterOptions, useAutocompleteFilter, useFormMessages };
@@ -8,6 +8,7 @@ import useFormMessages from "./useFormMessages.js";
8
8
  import BaseAutocomplete_default from "./BaseAutocomplete.js";
9
9
  import useAutocompleteFilter from "./useAutocompleteFilter.js";
10
10
  import BaseFieldset from "./BaseFieldset.js";
11
+ import BaseSelect_default from "./BaseSelect.js";
11
12
  import BaseRadioGroup from "./BaseRadioGroup.js";
12
13
  import BaseRadio from "./BaseRadio.js";
13
- export { BaseAutocomplete_default as BaseAutocomplete, BaseCheckbox, BaseCheckboxGroup, BaseFieldset, BaseForm, BaseFormField, BaseInput, BaseRadio, BaseRadioGroup, BaseSwitch, useAutocompleteFilter, useFormMessages };
14
+ export { BaseAutocomplete_default as BaseAutocomplete, BaseCheckbox, BaseCheckboxGroup, BaseFieldset, BaseForm, BaseFormField, BaseInput, BaseRadio, BaseRadioGroup, BaseSelect_default as BaseSelect, BaseSwitch, useAutocompleteFilter, useFormMessages };
@@ -0,0 +1,27 @@
1
+ import { FieldState } from "./BaseFormField.js";
2
+ import { AutocompleteAlign, AutocompleteInteractionType, AutocompleteSide } from "./autocompleteTypes.js";
3
+ /** The side of the trigger the popup is placed on. */
4
+ export type SelectSide = AutocompleteSide;
5
+ /** How the popup is aligned along its side. */
6
+ export type SelectAlign = AutocompleteAlign;
7
+ /** How the popup was opened or closed. Empty when it's unknown (e.g. opened from code). */
8
+ export type SelectInteractionType = AutocompleteInteractionType;
9
+ /** State of the trigger. */
10
+ export type SelectTriggerState = FieldState & {
11
+ open: boolean;
12
+ readOnly: boolean;
13
+ /** The side the popup is placed on, `null` while it's closed. */
14
+ popupSide: SelectSide | null;
15
+ /** The selected value (an array with `multiple`), `null` when nothing is selected. */
16
+ value: unknown;
17
+ /** Whether nothing is selected, so the placeholder shows. */
18
+ placeholder: boolean;
19
+ };
20
+ /** State of the scroll arrows. */
21
+ export type SelectScrollArrowState = {
22
+ direction: "up" | "down";
23
+ /** Whether the list can scroll in the arrow's direction. */
24
+ visible: boolean;
25
+ /** The side the popup is placed on, `"none"` over the trigger. */
26
+ side: SelectSide | "none";
27
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,92 @@
1
+ import { RenderProp } from "../../utils/render.js";
2
+ import { TooltipTriggerState } from "./BaseTooltipTrigger.js";
3
+ import "../../utils/index.js";
4
+ import { TooltipAlign, TooltipCollisionAvoidance, TooltipOffsetFunction, TooltipPopupState, TooltipPositionerState, TooltipSide } from "./BaseTooltipPopup.js";
5
+ import { TooltipArrowState } from "./BaseTooltipArrow.js";
6
+ import { TooltipViewportState } from "./BaseTooltipViewport.js";
7
+ import { TooltipHandle } from "./createTooltipHandle.js";
8
+ import { ReactNode, RefObject } from "react";
9
+ /** Imperative actions, through `actionsRef`. */
10
+ export type TooltipActions = {
11
+ /** Closes the tooltip. */
12
+ close: () => void;
13
+ };
14
+ type BaseTooltipProps<Payload = unknown> = {
15
+ open?: boolean;
16
+ defaultOpen?: boolean;
17
+ /** Called with the new state and the DOM event that changed it (none when it was changed from code). */
18
+ onOpenChange?: (open: boolean, event: Event | undefined) => void;
19
+ /** Called after the open or close transition ends. */
20
+ onOpenChangeComplete?: (open: boolean) => void;
21
+ /** Closes the tooltip when the pointer leaves the trigger, even onto the popup. @default false */
22
+ disableHoverablePopup?: boolean;
23
+ /** Makes the popup follow the pointer along this axis. @default "none" */
24
+ trackCursorAxis?: "none" | "x" | "y" | "both";
25
+ /** Stops every trigger from opening the tooltip. */
26
+ disabled?: boolean;
27
+ /** Imperative actions, e.g. `actionsRef.current?.close()`. */
28
+ actionsRef?: RefObject<TooltipActions | null>;
29
+ /** Connects triggers placed outside the tooltip, and opens it from code. Create one with `createTooltipHandle()`. */
30
+ handle?: TooltipHandle<Payload>;
31
+ /** The `id` of the trigger the tooltip belongs to, for a controlled tooltip with several triggers. */
32
+ triggerId?: string | null;
33
+ /** The `id` of the trigger an initially open tooltip belongs to. */
34
+ defaultTriggerId?: string | null;
35
+ /** The tooltip's parts, or a function that gets the payload of the trigger that opened it. */
36
+ children?: ReactNode | ((context: {
37
+ payload: Payload | undefined;
38
+ }) => ReactNode);
39
+ };
40
+ declare const _default: (<Payload>({ handle, onOpenChange, ...otherProps }: BaseTooltipProps<Payload>) => import("react").JSX.Element) & {
41
+ Provider: (props: {
42
+ children?: ReactNode;
43
+ delay?: number;
44
+ closeDelay?: number;
45
+ timeout?: number;
46
+ }) => import("react").JSX.Element;
47
+ Trigger: <Payload>({ handle, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "disabled"> & {
48
+ render?: RenderProp<"button", TooltipTriggerState>;
49
+ handle?: TooltipHandle<Payload> | undefined;
50
+ payload?: Payload | undefined;
51
+ delay?: number;
52
+ closeDelay?: number;
53
+ closeOnClick?: boolean;
54
+ disabled?: boolean;
55
+ }) => import("react").JSX.Element;
56
+ Popup: ({ side, align, sideOffset, alignOffset, collisionPadding, collisionBoundary, collisionAvoidance, anchor, disableAnchorTracking, arrowPadding, sticky, positionMethod, positionerClassName, renderPositioner, container, keepMounted, className, ...otherProps }: import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
57
+ render?: RenderProp<"div", TooltipPopupState>;
58
+ side?: TooltipSide;
59
+ align?: TooltipAlign;
60
+ sideOffset?: number | TooltipOffsetFunction;
61
+ alignOffset?: number | TooltipOffsetFunction;
62
+ collisionPadding?: number | {
63
+ top?: number;
64
+ right?: number;
65
+ bottom?: number;
66
+ left?: number;
67
+ };
68
+ collisionBoundary?: "clipping-ancestors" | Element | Element[] | {
69
+ x: number;
70
+ y: number;
71
+ width: number;
72
+ height: number;
73
+ };
74
+ collisionAvoidance?: TooltipCollisionAvoidance;
75
+ anchor?: Element | RefObject<Element | null> | (() => Element | null) | null;
76
+ disableAnchorTracking?: boolean;
77
+ arrowPadding?: number;
78
+ sticky?: boolean;
79
+ positionMethod?: "absolute" | "fixed";
80
+ positionerClassName?: string;
81
+ renderPositioner?: RenderProp<"div", TooltipPositionerState>;
82
+ container?: HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null;
83
+ keepMounted?: boolean;
84
+ }) => import("react").JSX.Element;
85
+ Arrow: (props: import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
86
+ render?: RenderProp<"div", TooltipArrowState>;
87
+ }) => import("react").JSX.Element;
88
+ Viewport: (props: import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
89
+ render?: RenderProp<"div", TooltipViewportState>;
90
+ }) => import("react").JSX.Element;
91
+ };
92
+ export { _default as default };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { Tooltip } from "@base-ui/react/tooltip";
3
+ import TooltipProvider from "../providers/TooltipProvider.js";
4
+ import BaseTooltipArrow from "./BaseTooltipArrow.js";
5
+ import BaseTooltipPopup from "./BaseTooltipPopup.js";
6
+ import BaseTooltipTrigger from "./BaseTooltipTrigger.js";
7
+ import BaseTooltipViewport from "./BaseTooltipViewport.js";
8
+ import { toBaseUIHandle } from "./createTooltipHandle.js";
9
+ import { jsx } from "react/jsx-runtime";
10
+ // src/components/overlay/BaseTooltip.tsx
11
+ /** Groups the parts of a tooltip and holds its open state. Renders no element. */
12
+ const BaseTooltip = ({ handle, onOpenChange, ...otherProps }) => /* @__PURE__ */ jsx(Tooltip.Root, {
13
+ ...otherProps,
14
+ handle: handle && toBaseUIHandle(handle),
15
+ onOpenChange: onOpenChange && ((open, details) => onOpenChange(open, details.event))
16
+ });
17
+ var BaseTooltip_default = Object.assign(BaseTooltip, {
18
+ Provider: TooltipProvider,
19
+ Trigger: BaseTooltipTrigger,
20
+ Popup: BaseTooltipPopup,
21
+ Arrow: BaseTooltipArrow,
22
+ Viewport: BaseTooltipViewport
23
+ });
24
+ export { BaseTooltip_default as default };
@@ -0,0 +1,20 @@
1
+ import { TooltipAlign, TooltipInstant, TooltipSide } from "./BaseTooltipPopup.js";
2
+ import { RenderProp } from "../../utils/render.js";
3
+ import { ComponentProps } from "react";
4
+ export type TooltipArrowState = {
5
+ open: boolean;
6
+ side: TooltipSide;
7
+ align: TooltipAlign;
8
+ /** Whether the arrow can't point at the center of the anchor. */
9
+ uncentered: boolean;
10
+ instant: TooltipInstant;
11
+ };
12
+ type BaseTooltipArrowProps = ComponentProps<"div"> & {
13
+ render?: RenderProp<"div", TooltipArrowState>;
14
+ };
15
+ /**
16
+ * An arrow that points at the trigger. Put it inside `Popup`.
17
+ * Renders a `<div>` with `data-side`, `data-align` and `data-uncentered`. Size and draw it with `className` or `children`.
18
+ */
19
+ declare const BaseTooltipArrow: (props: BaseTooltipArrowProps) => import("react").JSX.Element;
20
+ export { BaseTooltipArrow as default };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { Tooltip } from "@base-ui/react/tooltip";
3
+ import { jsx } from "react/jsx-runtime";
4
+ // src/components/overlay/BaseTooltipArrow.tsx
5
+ /**
6
+ * An arrow that points at the trigger. Put it inside `Popup`.
7
+ * Renders a `<div>` with `data-side`, `data-align` and `data-uncentered`. Size and draw it with `className` or `children`.
8
+ */
9
+ const BaseTooltipArrow = (props) => /* @__PURE__ */ jsx(Tooltip.Arrow, { ...props });
10
+ export { BaseTooltipArrow as default };