@robzepdev/trama 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +44 -3
- package/dist/AGENTS.md +19 -0
- package/dist/components/button.d.mts +30 -0
- package/dist/components/button.mjs +32 -0
- package/dist/components/card.d.mts +19 -0
- package/dist/components/card.mjs +77 -0
- package/dist/components/checkbox.d.mts +13 -0
- package/dist/components/checkbox.mjs +33 -0
- package/dist/components/dialog.d.mts +25 -0
- package/dist/components/dialog.mjs +97 -0
- package/dist/components/field.d.mts +18 -0
- package/dist/components/field.mjs +41 -0
- package/dist/components/input.d.mts +4 -0
- package/dist/components/input.mjs +14 -0
- package/dist/components/menu.d.mts +22 -0
- package/dist/components/menu.mjs +89 -0
- package/dist/components/select.d.mts +25 -0
- package/dist/components/select.mjs +127 -0
- package/dist/components/stack.d.mts +48 -0
- package/dist/components/stack.mjs +196 -0
- package/dist/components/text.d.mts +25 -0
- package/dist/components/text.mjs +81 -0
- package/dist/components/toast.d.mts +15 -0
- package/dist/components/toast.mjs +49 -0
- package/dist/docs/button.md +84 -0
- package/dist/docs/card-content.md +41 -0
- package/dist/docs/card-description.md +41 -0
- package/dist/docs/card-footer.md +41 -0
- package/dist/docs/card-header.md +41 -0
- package/dist/docs/card-title.md +41 -0
- package/dist/docs/card.md +41 -0
- package/dist/docs/checkbox.md +142 -0
- package/dist/docs/dialog-close.md +53 -0
- package/dist/docs/dialog-content.md +70 -0
- package/dist/docs/dialog-description.md +46 -0
- package/dist/docs/dialog-footer.md +28 -0
- package/dist/docs/dialog-header.md +28 -0
- package/dist/docs/dialog-title.md +46 -0
- package/dist/docs/dialog-trigger.md +70 -0
- package/dist/docs/dialog.md +100 -0
- package/dist/docs/field-description.md +69 -0
- package/dist/docs/field-error.md +77 -0
- package/dist/docs/field-label.md +77 -0
- package/dist/docs/field.md +128 -0
- package/dist/docs/index.md +41 -0
- package/dist/docs/input.md +46 -0
- package/dist/docs/menu-content.md +95 -0
- package/dist/docs/menu-group.md +51 -0
- package/dist/docs/menu-item.md +79 -0
- package/dist/docs/menu-label.md +46 -0
- package/dist/docs/menu-separator.md +51 -0
- package/dist/docs/menu-trigger.md +93 -0
- package/dist/docs/menu.md +135 -0
- package/dist/docs/select-content.md +91 -0
- package/dist/docs/select-group.md +46 -0
- package/dist/docs/select-item.md +75 -0
- package/dist/docs/select-label.md +46 -0
- package/dist/docs/select-separator.md +51 -0
- package/dist/docs/select-trigger.md +63 -0
- package/dist/docs/select-value.md +59 -0
- package/dist/docs/select.md +164 -0
- package/dist/docs/stack.md +58 -0
- package/dist/docs/text.md +60 -0
- package/dist/docs/toast-provider.md +34 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +12 -0
- package/dist/lib/cn.mjs +9 -0
- package/dist/lib/responsive.d.mts +4 -0
- package/dist/lib/responsive.mjs +17 -0
- package/package.json +67 -3
- package/styles.css +67 -0
- package/themes/brutalista.css +36 -0
- package/themes/neon.css +37 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# trama
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 34cdb6b: Ship docs for agents in the package: one Markdown page per component and an index under `dist/docs/`, plus `dist/AGENTS.md` with the rules for people using trama. `Button` now documents `disabled`.
|
|
8
|
+
- 1f521e5: Add `Card`, `CardHeader`, `CardTitle`, `CardDescription`, `CardContent` and `CardFooter`. Surface, text, shadow and radius come from the theme tokens.
|
|
9
|
+
- e89aa05: Add `Checkbox`, built on Base UI. It works controlled (`checked`, `onCheckedChange`) and uncontrolled (`defaultChecked`), and supports `indeterminate`. Put it inside Base UI's `Field` to get a label.
|
|
10
|
+
- 86eb711: Add `Dialog`, `DialogTrigger`, `DialogContent`, `DialogHeader`, `DialogTitle`, `DialogDescription`, `DialogFooter` and `DialogClose`. Focus is trapped while open, Escape closes it and returns focus to the trigger, and the portaled popup takes the theme and scheme of the subtree it opens from.
|
|
11
|
+
- 4eacb43: Add `Field`, `FieldLabel`, `FieldDescription`, `FieldError` and `Input`, built on Base UI. Inside `Field`, the input is linked to its label, description and error (`aria-describedby`, `aria-invalid`).
|
|
12
|
+
- fb69436: Add `Menu`, `MenuTrigger`, `MenuContent`, `MenuItem`, `MenuGroup`, `MenuLabel` and `MenuSeparator`. Arrow keys move between items, Enter activates one, Escape closes the menu and returns focus to the trigger, and the portaled popup takes the theme and scheme of the subtree it opens from.
|
|
13
|
+
- a515dd8: Add `Select` with trigger, value, content, item, group, label and separator parts. The popup opens in a portal and takes the theme and scheme of the subtree it was opened from.
|
|
14
|
+
- 806c566: Add `Stack`, a flex layout component. `direction`, `gap`, `align`, `justify` and `wrap` take a single value or a mobile-first responsive object like `{ initial: "2", md: "4" }`.
|
|
15
|
+
- 4fa99e4: Add `Text`, a layout component for text. `size` follows the theme's type scale and takes a single value or a responsive object like `{ initial: "base", md: "xl" }`. `tone` is `normal`, `muted` or `destructive`. `render` changes the element, e.g. `render={<h1 />}`.
|
|
16
|
+
- 7eb9416: Add `ToastProvider` and `toast()`. Mount the provider once; call `toast({ title, description })` from anywhere in the app. Toasts are announced in a live region, can be closed from the keyboard, and their motion is disabled under `prefers-reduced-motion`.
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# ui-library
|
|
2
|
+
|
|
3
|
+
## Using trama with an AI agent
|
|
4
|
+
|
|
5
|
+
Paste this block into the `AGENTS.md` (or `CLAUDE.md`) of the project that installs `@robzepdev/trama`. The last line makes the agent load the docs shipped in the package, so they always match the installed version.
|
|
6
|
+
|
|
7
|
+
<!-- trama:agents:start v0.0.0 -->
|
|
8
|
+
|
|
9
|
+
````md
|
|
10
|
+
## trama (v0.0.0)
|
|
11
|
+
|
|
12
|
+
UI components on Base UI with the shadcn/ui API, styled through Tailwind v4 theme tokens.
|
|
13
|
+
|
|
14
|
+
- Import the CSS once, after Tailwind, in your global stylesheet:
|
|
15
|
+
`@import "@robzepdev/trama/styles.css";` and one theme, `@import "@robzepdev/trama/themes/brutalista.css";` or `@import "@robzepdev/trama/themes/neon.css";`.
|
|
16
|
+
- Switch theme and scheme with `data-theme` and `data-scheme` on `<html>`.
|
|
17
|
+
- Polymorphism goes through `render`, never `asChild` or `as`.
|
|
18
|
+
- No `dark:` classes: colors come from tokens such as `bg-primary` and `text-foreground`.
|
|
19
|
+
- Use only the `variant` and `size` values listed on the component's page.
|
|
20
|
+
- Self-check before you finish: `grep -rE "asChild|dark:" src` finds nothing in the code that uses trama.
|
|
21
|
+
|
|
22
|
+
Docs for each component, with props, values and examples:
|
|
23
|
+
@node_modules/@robzepdev/trama/dist/AGENTS.md
|
|
24
|
+
````
|
|
25
|
+
|
|
26
|
+
<!-- trama:agents:end -->
|
|
27
|
+
|
|
28
|
+
The version in the markers and in the heading is bumped by hand when `package.json` changes version.
|
|
29
|
+
|
|
30
|
+
## For maintainers
|
|
31
|
+
|
|
32
|
+
Releases are driven by Changesets through `.github/workflows/release.yml`. On every push to `main` the workflow keeps a "Version packages" PR open; merging it publishes to npm, tags the commit and creates the GitHub Release.
|
|
33
|
+
|
|
34
|
+
### Repo secret
|
|
35
|
+
|
|
36
|
+
- `RELEASE_PAT`: fine-grained personal access token for this repo with `Contents: read and write` and `Pull requests: read and write`. A PAT is used instead of `GITHUB_TOKEN` so that checks run on the "Version packages" PR.
|
|
37
|
+
|
|
38
|
+
There is no `NPM_TOKEN`.
|
|
39
|
+
|
|
40
|
+
### npm configuration
|
|
41
|
+
|
|
42
|
+
- Publish the first version by hand (`pnpm publish --access public`): a trusted publisher can only be configured on a package that already exists.
|
|
43
|
+
- On npmjs.com, package `@robzepdev/trama` → Settings → Trusted Publisher → GitHub Actions: organization/user `RobertoZeppilli`, repository `ui-library`, workflow `release.yml`.
|
|
44
|
+
- `package.json` must keep `repository` pointing at `https://github.com/RobertoZeppilli/ui-library`, or npm rejects the publish with provenance.
|
package/dist/AGENTS.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# trama
|
|
2
|
+
|
|
3
|
+
React components on Base UI with the shadcn/ui API, styled with Tailwind v4 through theme tokens.
|
|
4
|
+
|
|
5
|
+
## Docs
|
|
6
|
+
|
|
7
|
+
One page per component (props, `variant`/`size` values, examples): [docs/index.md](./docs/index.md). Read the page before you use a component. Breaking changes: [CHANGELOG.md](../CHANGELOG.md).
|
|
8
|
+
|
|
9
|
+
## Rules
|
|
10
|
+
|
|
11
|
+
- Polymorphism goes through `render`, never `asChild` or `as`: `<Button render={<a href="/x" />}>Go</Button>`.
|
|
12
|
+
- No `dark:` classes. Colors come from tokens (`bg-primary`, `text-foreground`, `border-border`); the theme and the scheme switch them with `data-theme` and `data-scheme` on `<html>`.
|
|
13
|
+
- Import the CSS once, after Tailwind: `@import "@robzepdev/trama/styles.css";` and one `@import "@robzepdev/trama/themes/<name>.css";` per theme (`brutalista`, `neon`).
|
|
14
|
+
- `className` is merged with the internal classes and wins on conflicts. Do not restyle a component with a global stylesheet.
|
|
15
|
+
- Use only the documented `variant` and `size` values. Do not invent new ones.
|
|
16
|
+
|
|
17
|
+
## Self-check
|
|
18
|
+
|
|
19
|
+
Before you finish: no `asChild`, no `dark:`, and every `variant`/`size` you wrote appears on the component's page.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Button as Button$1 } from "@base-ui/react/button";
|
|
2
|
+
declare const variants: {
|
|
3
|
+
readonly default: "bg-primary text-primary-foreground hover:bg-primary/90";
|
|
4
|
+
readonly outline: "border-ui border-border bg-background text-foreground hover:bg-muted";
|
|
5
|
+
readonly secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80";
|
|
6
|
+
readonly ghost: "text-foreground hover:bg-muted";
|
|
7
|
+
readonly destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90";
|
|
8
|
+
readonly link: "text-primary underline-offset-4 hover:underline";
|
|
9
|
+
};
|
|
10
|
+
declare const sizes: {
|
|
11
|
+
readonly default: "h-8 gap-1.5 px-2.5";
|
|
12
|
+
readonly xs: "h-6 gap-1 px-2 text-xs";
|
|
13
|
+
readonly sm: "h-7 gap-1 px-2.5 text-xs";
|
|
14
|
+
readonly lg: "h-9 gap-1.5 px-3";
|
|
15
|
+
readonly icon: "size-8";
|
|
16
|
+
readonly "icon-xs": "size-6";
|
|
17
|
+
readonly "icon-sm": "size-7";
|
|
18
|
+
readonly "icon-lg": "size-9";
|
|
19
|
+
};
|
|
20
|
+
export interface ButtonProps extends Button$1.Props {
|
|
21
|
+
/** Whether the button should ignore user interaction. */
|
|
22
|
+
disabled?: boolean | undefined;
|
|
23
|
+
/** Visual emphasis. Same values as shadcn/ui. @default "default" */
|
|
24
|
+
variant?: keyof typeof variants;
|
|
25
|
+
/** Height and padding. Same values as shadcn/ui. @default "default" */
|
|
26
|
+
size?: keyof typeof sizes;
|
|
27
|
+
}
|
|
28
|
+
/** Button with the shadcn/ui API on top of Base UI. Polymorphism goes through `render`, not `asChild` or `as`. */
|
|
29
|
+
export declare function Button({ className, variant, size, ...props }: ButtonProps): import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button as Button$1 } from "@base-ui/react/button";
|
|
3
|
+
import { cn } from "../lib/cn.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/button.tsx
|
|
6
|
+
const variants = {
|
|
7
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
8
|
+
outline: "border-ui border-border bg-background text-foreground hover:bg-muted",
|
|
9
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
10
|
+
ghost: "text-foreground hover:bg-muted",
|
|
11
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
12
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
13
|
+
};
|
|
14
|
+
const sizes = {
|
|
15
|
+
default: "h-8 gap-1.5 px-2.5",
|
|
16
|
+
xs: "h-6 gap-1 px-2 text-xs",
|
|
17
|
+
sm: "h-7 gap-1 px-2.5 text-xs",
|
|
18
|
+
lg: "h-9 gap-1.5 px-3",
|
|
19
|
+
icon: "size-8",
|
|
20
|
+
"icon-xs": "size-6",
|
|
21
|
+
"icon-sm": "size-7",
|
|
22
|
+
"icon-lg": "size-9"
|
|
23
|
+
};
|
|
24
|
+
/** Button with the shadcn/ui API on top of Base UI. Polymorphism goes through `render`, not `asChild` or `as`. */
|
|
25
|
+
function Button({ className, variant = "default", size = "default", ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Button$1, {
|
|
27
|
+
"data-slot": "button",
|
|
28
|
+
...props,
|
|
29
|
+
className: (state) => cn("inline-flex shrink-0 items-center justify-center rounded-md text-sm font-medium whitespace-nowrap select-none", "outline-hidden focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", "disabled:pointer-events-none disabled:opacity-50", variants[variant], sizes[size], typeof className === "function" ? className(state) : className)
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export { Button };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
export interface CardProps extends useRender.ComponentProps<"div"> {}
|
|
3
|
+
/** Surface that groups related content. Colors, shadow and radius come from the theme. */
|
|
4
|
+
export declare function Card({ className, render, ...props }: CardProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
5
|
+
export interface CardHeaderProps extends useRender.ComponentProps<"div"> {}
|
|
6
|
+
/** Top of the card: holds `CardTitle` and `CardDescription`. */
|
|
7
|
+
export declare function CardHeader({ className, render, ...props }: CardHeaderProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
8
|
+
export interface CardTitleProps extends useRender.ComponentProps<"h3"> {}
|
|
9
|
+
/** Title of the card. Change the heading level through `render`, e.g. `render={<h2 />}`. */
|
|
10
|
+
export declare function CardTitle({ className, render, ...props }: CardTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
11
|
+
export interface CardDescriptionProps extends useRender.ComponentProps<"p"> {}
|
|
12
|
+
/** Supporting text under the title. */
|
|
13
|
+
export declare function CardDescription({ className, render, ...props }: CardDescriptionProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
14
|
+
export interface CardContentProps extends useRender.ComponentProps<"div"> {}
|
|
15
|
+
/** Main body of the card. */
|
|
16
|
+
export declare function CardContent({ className, render, ...props }: CardContentProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
17
|
+
export interface CardFooterProps extends useRender.ComponentProps<"div"> {}
|
|
18
|
+
/** Bottom of the card, usually actions. */
|
|
19
|
+
export declare function CardFooter({ className, render, ...props }: CardFooterProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { cn } from "../lib/cn.mjs";
|
|
4
|
+
// src/components/card.tsx
|
|
5
|
+
/** Surface that groups related content. Colors, shadow and radius come from the theme. */
|
|
6
|
+
function Card({ className, render, ...props }) {
|
|
7
|
+
return useRender({
|
|
8
|
+
render,
|
|
9
|
+
defaultTagName: "div",
|
|
10
|
+
props: {
|
|
11
|
+
"data-slot": "card",
|
|
12
|
+
...props,
|
|
13
|
+
className: cn("flex flex-col gap-4 rounded-lg border-ui border-border bg-card py-5 text-card-foreground shadow-sm", className)
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** Top of the card: holds `CardTitle` and `CardDescription`. */
|
|
18
|
+
function CardHeader({ className, render, ...props }) {
|
|
19
|
+
return useRender({
|
|
20
|
+
render,
|
|
21
|
+
defaultTagName: "div",
|
|
22
|
+
props: {
|
|
23
|
+
"data-slot": "card-header",
|
|
24
|
+
...props,
|
|
25
|
+
className: cn("flex flex-col gap-1 px-5", className)
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/** Title of the card. Change the heading level through `render`, e.g. `render={<h2 />}`. */
|
|
30
|
+
function CardTitle({ className, render, ...props }) {
|
|
31
|
+
return useRender({
|
|
32
|
+
render,
|
|
33
|
+
defaultTagName: "h3",
|
|
34
|
+
props: {
|
|
35
|
+
"data-slot": "card-title",
|
|
36
|
+
...props,
|
|
37
|
+
className: cn("text-base font-heading font-(weight:--font-weight-heading) leading-[1.15]", className)
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** Supporting text under the title. */
|
|
42
|
+
function CardDescription({ className, render, ...props }) {
|
|
43
|
+
return useRender({
|
|
44
|
+
render,
|
|
45
|
+
defaultTagName: "p",
|
|
46
|
+
props: {
|
|
47
|
+
"data-slot": "card-description",
|
|
48
|
+
...props,
|
|
49
|
+
className: cn("text-sm text-muted-foreground", className)
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** Main body of the card. */
|
|
54
|
+
function CardContent({ className, render, ...props }) {
|
|
55
|
+
return useRender({
|
|
56
|
+
render,
|
|
57
|
+
defaultTagName: "div",
|
|
58
|
+
props: {
|
|
59
|
+
"data-slot": "card-content",
|
|
60
|
+
...props,
|
|
61
|
+
className: cn("px-5", className)
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/** Bottom of the card, usually actions. */
|
|
66
|
+
function CardFooter({ className, render, ...props }) {
|
|
67
|
+
return useRender({
|
|
68
|
+
render,
|
|
69
|
+
defaultTagName: "div",
|
|
70
|
+
props: {
|
|
71
|
+
"data-slot": "card-footer",
|
|
72
|
+
...props,
|
|
73
|
+
className: cn("flex items-center gap-2 px-5", className)
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
2
|
+
export interface CheckboxProps extends Checkbox$1.Root.Props {
|
|
3
|
+
/** Whether the checkbox is checked (controlled). */
|
|
4
|
+
checked?: boolean | undefined;
|
|
5
|
+
/** Whether the checkbox is initially checked (uncontrolled). */
|
|
6
|
+
defaultChecked?: boolean | undefined;
|
|
7
|
+
/** Whether the checkbox is in a mixed state, neither checked nor unchecked. */
|
|
8
|
+
indeterminate?: boolean | undefined;
|
|
9
|
+
/** Whether the checkbox should ignore user interaction. */
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** Checkbox with the shadcn/ui API on top of Base UI. Use it inside `Field` from Base UI for a label. */
|
|
13
|
+
export declare function Checkbox({ className, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
3
|
+
import { cn } from "../lib/cn.mjs";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/components/checkbox.tsx
|
|
6
|
+
/** Checkbox with the shadcn/ui API on top of Base UI. Use it inside `Field` from Base UI for a label. */
|
|
7
|
+
function Checkbox({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
9
|
+
"data-slot": "checkbox",
|
|
10
|
+
...props,
|
|
11
|
+
className: (state) => cn("inline-flex size-4.5 shrink-0 items-center justify-center rounded-xs border-ui border-input bg-background text-primary-foreground", "outline-hidden focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", "data-checked:border-primary data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary", "aria-invalid:border-destructive data-invalid:border-destructive", "data-disabled:cursor-not-allowed data-disabled:opacity-50", typeof className === "function" ? className(state) : className),
|
|
12
|
+
children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
|
|
13
|
+
"data-slot": "checkbox-indicator",
|
|
14
|
+
className: "group flex items-center justify-center",
|
|
15
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
16
|
+
viewBox: "0 0 16 16",
|
|
17
|
+
className: "size-3.5",
|
|
18
|
+
fill: "none",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
strokeWidth: "2",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
23
|
+
className: "group-data-indeterminate:hidden",
|
|
24
|
+
d: "M3.5 8.5l3 3 6-7"
|
|
25
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
26
|
+
className: "hidden group-data-indeterminate:block",
|
|
27
|
+
d: "M4 8h8"
|
|
28
|
+
})]
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { Checkbox };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
2
|
+
export interface DialogProps extends Dialog$1.Root.Props {}
|
|
3
|
+
/** Groups all parts of the dialog. Doesn't render an element. */
|
|
4
|
+
export declare function Dialog(props: DialogProps): import("react").JSX.Element;
|
|
5
|
+
export interface DialogTriggerProps extends Dialog$1.Trigger.Props {}
|
|
6
|
+
/** Button that opens the dialog. */
|
|
7
|
+
export declare function DialogTrigger({ ref, ...props }: DialogTriggerProps): import("react").JSX.Element;
|
|
8
|
+
export interface DialogContentProps extends Dialog$1.Popup.Props {}
|
|
9
|
+
/** Popup with its backdrop, in a portal. It takes the theme and scheme of the subtree the trigger is in. */
|
|
10
|
+
export declare function DialogContent({ className, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
11
|
+
export interface DialogHeaderProps extends React.ComponentProps<"div"> {}
|
|
12
|
+
/** Groups the title and description. */
|
|
13
|
+
export declare function DialogHeader({ className, ...props }: DialogHeaderProps): import("react").JSX.Element;
|
|
14
|
+
export interface DialogFooterProps extends React.ComponentProps<"div"> {}
|
|
15
|
+
/** Holds the actions, usually `DialogClose` buttons. */
|
|
16
|
+
export declare function DialogFooter({ className, ...props }: DialogFooterProps): import("react").JSX.Element;
|
|
17
|
+
export interface DialogTitleProps extends Dialog$1.Title.Props {}
|
|
18
|
+
/** Accessible name of the dialog. */
|
|
19
|
+
export declare function DialogTitle({ className, ...props }: DialogTitleProps): import("react").JSX.Element;
|
|
20
|
+
export interface DialogDescriptionProps extends Dialog$1.Description.Props {}
|
|
21
|
+
/** Accessible description of the dialog. */
|
|
22
|
+
export declare function DialogDescription({ className, ...props }: DialogDescriptionProps): import("react").JSX.Element;
|
|
23
|
+
export interface DialogCloseProps extends Dialog$1.Close.Props {}
|
|
24
|
+
/** Button that closes the dialog. */
|
|
25
|
+
export declare function DialogClose(props: DialogCloseProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
3
|
+
import { createContext, useContext, useState } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.mjs";
|
|
5
|
+
import { Button } from "./button.mjs";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/components/dialog.tsx
|
|
8
|
+
function merge(base, className) {
|
|
9
|
+
return (state) => cn(base, typeof className === "function" ? className(state) : className);
|
|
10
|
+
}
|
|
11
|
+
const TriggerContext = createContext([null, () => {}]);
|
|
12
|
+
/** Groups all parts of the dialog. Doesn't render an element. */
|
|
13
|
+
function Dialog(props) {
|
|
14
|
+
const trigger = useState(null);
|
|
15
|
+
return /* @__PURE__ */ jsx(TriggerContext, {
|
|
16
|
+
value: trigger,
|
|
17
|
+
children: /* @__PURE__ */ jsx(Dialog$1.Root, { ...props })
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** Button that opens the dialog. */
|
|
21
|
+
function DialogTrigger({ ref, ...props }) {
|
|
22
|
+
const [, setTrigger] = useContext(TriggerContext);
|
|
23
|
+
return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
|
|
24
|
+
"data-slot": "dialog-trigger",
|
|
25
|
+
render: /* @__PURE__ */ jsx(Button, {}),
|
|
26
|
+
...props,
|
|
27
|
+
ref: (node) => {
|
|
28
|
+
setTrigger(node);
|
|
29
|
+
if (typeof ref === "function") ref(node);
|
|
30
|
+
else if (ref) ref.current = node;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** Popup with its backdrop, in a portal. It takes the theme and scheme of the subtree the trigger is in. */
|
|
35
|
+
function DialogContent({ className, ...props }) {
|
|
36
|
+
const [trigger] = useContext(TriggerContext);
|
|
37
|
+
return /* @__PURE__ */ jsxs(Dialog$1.Portal, {
|
|
38
|
+
ref: (node) => {
|
|
39
|
+
if (!node || !trigger) return;
|
|
40
|
+
for (const key of ["theme", "scheme"]) {
|
|
41
|
+
const owner = trigger.closest(`[data-${key}]`);
|
|
42
|
+
const value = owner?.dataset[key];
|
|
43
|
+
if (value === void 0 || owner === document.documentElement) delete node.dataset[key];
|
|
44
|
+
else node.dataset[key] = value;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
children: [/* @__PURE__ */ jsx(Dialog$1.Backdrop, {
|
|
48
|
+
"data-slot": "dialog-backdrop",
|
|
49
|
+
className: "fixed inset-0 z-50 bg-foreground/50"
|
|
50
|
+
}), /* @__PURE__ */ jsx(Dialog$1.Popup, {
|
|
51
|
+
"data-slot": "dialog-content",
|
|
52
|
+
...props,
|
|
53
|
+
className: merge("fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-var(--spacing)*8)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border-ui border-border bg-popover p-6 font-sans text-popover-foreground shadow-md outline-hidden", className)
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/** Groups the title and description. */
|
|
58
|
+
function DialogHeader({ className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx("div", {
|
|
60
|
+
"data-slot": "dialog-header",
|
|
61
|
+
...props,
|
|
62
|
+
className: cn("flex flex-col gap-1.5", className)
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/** Holds the actions, usually `DialogClose` buttons. */
|
|
66
|
+
function DialogFooter({ className, ...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsx("div", {
|
|
68
|
+
"data-slot": "dialog-footer",
|
|
69
|
+
...props,
|
|
70
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** Accessible name of the dialog. */
|
|
74
|
+
function DialogTitle({ className, ...props }) {
|
|
75
|
+
return /* @__PURE__ */ jsx(Dialog$1.Title, {
|
|
76
|
+
"data-slot": "dialog-title",
|
|
77
|
+
...props,
|
|
78
|
+
className: merge("text-lg leading-none font-semibold", className)
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** Accessible description of the dialog. */
|
|
82
|
+
function DialogDescription({ className, ...props }) {
|
|
83
|
+
return /* @__PURE__ */ jsx(Dialog$1.Description, {
|
|
84
|
+
"data-slot": "dialog-description",
|
|
85
|
+
...props,
|
|
86
|
+
className: merge("text-sm text-muted-foreground", className)
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/** Button that closes the dialog. */
|
|
90
|
+
function DialogClose(props) {
|
|
91
|
+
return /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
92
|
+
"data-slot": "dialog-close",
|
|
93
|
+
render: /* @__PURE__ */ jsx(Button, { variant: "outline" }),
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Field as Field$1 } from "@base-ui/react/field";
|
|
2
|
+
export interface FieldProps extends Field$1.Root.Props {
|
|
3
|
+
/** Whether the field is invalid. Marks the input `aria-invalid` and lets `FieldError` render. */
|
|
4
|
+
invalid?: boolean | undefined;
|
|
5
|
+
/** Whether the field and its input should ignore user interaction. */
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** Groups a label, an input, a description and an error, and links them for assistive technology. */
|
|
9
|
+
export declare function Field({ className, ...props }: FieldProps): import("react").JSX.Element;
|
|
10
|
+
export interface FieldLabelProps extends Field$1.Label.Props {}
|
|
11
|
+
/** Accessible name of the input in the same `Field`. */
|
|
12
|
+
export declare function FieldLabel({ className, ...props }: FieldLabelProps): import("react").JSX.Element;
|
|
13
|
+
export interface FieldDescriptionProps extends Field$1.Description.Props {}
|
|
14
|
+
/** Helper text, announced through `aria-describedby` on the input. */
|
|
15
|
+
export declare function FieldDescription({ className, ...props }: FieldDescriptionProps): import("react").JSX.Element;
|
|
16
|
+
export interface FieldErrorProps extends Field$1.Error.Props {}
|
|
17
|
+
/** Error message, announced through `aria-describedby` on the input. Set `match` to show it regardless of the validity state. */
|
|
18
|
+
export declare function FieldError({ className, ...props }: FieldErrorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Field as Field$1 } from "@base-ui/react/field";
|
|
3
|
+
import { cn } from "../lib/cn.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/field.tsx
|
|
6
|
+
function merge(base, className) {
|
|
7
|
+
return (state) => cn(base, typeof className === "function" ? className(state) : className);
|
|
8
|
+
}
|
|
9
|
+
/** Groups a label, an input, a description and an error, and links them for assistive technology. */
|
|
10
|
+
function Field({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Field$1.Root, {
|
|
12
|
+
"data-slot": "field",
|
|
13
|
+
...props,
|
|
14
|
+
className: merge("flex flex-col gap-2", className)
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** Accessible name of the input in the same `Field`. */
|
|
18
|
+
function FieldLabel({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Field$1.Label, {
|
|
20
|
+
"data-slot": "field-label",
|
|
21
|
+
...props,
|
|
22
|
+
className: merge("text-sm font-semibold text-foreground data-disabled:opacity-50", className)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** Helper text, announced through `aria-describedby` on the input. */
|
|
26
|
+
function FieldDescription({ className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(Field$1.Description, {
|
|
28
|
+
"data-slot": "field-description",
|
|
29
|
+
...props,
|
|
30
|
+
className: merge("text-sm text-muted-foreground", className)
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Error message, announced through `aria-describedby` on the input. Set `match` to show it regardless of the validity state. */
|
|
34
|
+
function FieldError({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Field$1.Error, {
|
|
36
|
+
"data-slot": "field-error",
|
|
37
|
+
...props,
|
|
38
|
+
className: merge("text-sm font-semibold text-destructive", className)
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export { Field, FieldDescription, FieldError, FieldLabel };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Input as Input$1 } from "@base-ui/react/input";
|
|
2
|
+
export interface InputProps extends Input$1.Props {}
|
|
3
|
+
/** Text input with the shadcn/ui API on top of Base UI. Inside `Field` it is linked to the label, description and error. */
|
|
4
|
+
export declare function Input({ className, ...props }: InputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Input as Input$1 } from "@base-ui/react/input";
|
|
3
|
+
import { cn } from "../lib/cn.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/input.tsx
|
|
6
|
+
/** Text input with the shadcn/ui API on top of Base UI. Inside `Field` it is linked to the label, description and error. */
|
|
7
|
+
function Input({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Input$1, {
|
|
9
|
+
"data-slot": "input",
|
|
10
|
+
...props,
|
|
11
|
+
className: (state) => cn("w-full rounded-md border-ui border-input bg-background px-3 py-2 text-base text-foreground placeholder:text-muted-foreground", "outline-hidden focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", "aria-invalid:border-destructive data-invalid:border-destructive", "disabled:cursor-not-allowed disabled:opacity-50", typeof className === "function" ? className(state) : className)
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Input };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
2
|
+
export interface MenuProps extends Menu$1.Root.Props {}
|
|
3
|
+
/** Groups all parts of the menu. Doesn't render an element. */
|
|
4
|
+
export declare function Menu(props: MenuProps): import("react").JSX.Element;
|
|
5
|
+
export interface MenuTriggerProps extends Menu$1.Trigger.Props {}
|
|
6
|
+
/** Button that opens the menu. */
|
|
7
|
+
export declare function MenuTrigger({ ref, ...props }: MenuTriggerProps): import("react").JSX.Element;
|
|
8
|
+
export interface MenuContentProps extends Menu$1.Popup.Props, Pick<Menu$1.Positioner.Props, "side" | "align" | "sideOffset"> {}
|
|
9
|
+
/** Popup with the list of items, in a portal. It takes the theme and scheme of the subtree the trigger is in. */
|
|
10
|
+
export declare function MenuContent({ className, side, align, sideOffset, ...props }: MenuContentProps): import("react").JSX.Element;
|
|
11
|
+
export interface MenuItemProps extends Menu$1.Item.Props {}
|
|
12
|
+
/** One action. `onClick` runs when it is activated; the menu then closes. */
|
|
13
|
+
export declare function MenuItem({ className, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
14
|
+
export interface MenuGroupProps extends Menu$1.Group.Props {}
|
|
15
|
+
/** Groups items under a `MenuLabel`. */
|
|
16
|
+
export declare function MenuGroup(props: MenuGroupProps): import("react").JSX.Element;
|
|
17
|
+
export interface MenuLabelProps extends Menu$1.GroupLabel.Props {}
|
|
18
|
+
/** Label of a `MenuGroup`. */
|
|
19
|
+
export declare function MenuLabel({ className, ...props }: MenuLabelProps): import("react").JSX.Element;
|
|
20
|
+
export interface MenuSeparatorProps extends Menu$1.Separator.Props {}
|
|
21
|
+
/** Line between items or groups. */
|
|
22
|
+
export declare function MenuSeparator({ className, ...props }: MenuSeparatorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
3
|
+
import { createContext, useContext, useState } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.mjs";
|
|
5
|
+
import { Button } from "./button.mjs";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
// src/components/menu.tsx
|
|
8
|
+
function merge(base, className) {
|
|
9
|
+
return (state) => cn(base, typeof className === "function" ? className(state) : className);
|
|
10
|
+
}
|
|
11
|
+
const TriggerContext = createContext([null, () => {}]);
|
|
12
|
+
/** Groups all parts of the menu. Doesn't render an element. */
|
|
13
|
+
function Menu(props) {
|
|
14
|
+
const trigger = useState(null);
|
|
15
|
+
return /* @__PURE__ */ jsx(TriggerContext, {
|
|
16
|
+
value: trigger,
|
|
17
|
+
children: /* @__PURE__ */ jsx(Menu$1.Root, { ...props })
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** Button that opens the menu. */
|
|
21
|
+
function MenuTrigger({ ref, ...props }) {
|
|
22
|
+
const [, setTrigger] = useContext(TriggerContext);
|
|
23
|
+
return /* @__PURE__ */ jsx(Menu$1.Trigger, {
|
|
24
|
+
"data-slot": "menu-trigger",
|
|
25
|
+
render: /* @__PURE__ */ jsx(Button, { variant: "outline" }),
|
|
26
|
+
...props,
|
|
27
|
+
ref: (node) => {
|
|
28
|
+
setTrigger(node);
|
|
29
|
+
if (typeof ref === "function") ref(node);
|
|
30
|
+
else if (ref) ref.current = node;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** Popup with the list of items, in a portal. It takes the theme and scheme of the subtree the trigger is in. */
|
|
35
|
+
function MenuContent({ className, side, align, sideOffset = 4, ...props }) {
|
|
36
|
+
const [trigger] = useContext(TriggerContext);
|
|
37
|
+
return /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
|
|
38
|
+
ref: (node) => {
|
|
39
|
+
if (!node || !trigger) return;
|
|
40
|
+
for (const key of ["theme", "scheme"]) {
|
|
41
|
+
const owner = trigger.closest(`[data-${key}]`);
|
|
42
|
+
const value = owner?.dataset[key];
|
|
43
|
+
if (value === void 0 || owner === document.documentElement) delete node.dataset[key];
|
|
44
|
+
else node.dataset[key] = value;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
side,
|
|
48
|
+
align,
|
|
49
|
+
sideOffset,
|
|
50
|
+
className: "z-50",
|
|
51
|
+
children: /* @__PURE__ */ jsx(Menu$1.Popup, {
|
|
52
|
+
"data-slot": "menu-content",
|
|
53
|
+
...props,
|
|
54
|
+
className: merge("min-w-40 overflow-y-auto rounded-lg border-ui border-border bg-popover p-1 font-sans text-popover-foreground shadow-md outline-hidden", className)
|
|
55
|
+
})
|
|
56
|
+
}) });
|
|
57
|
+
}
|
|
58
|
+
/** One action. `onClick` runs when it is activated; the menu then closes. */
|
|
59
|
+
function MenuItem({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(Menu$1.Item, {
|
|
61
|
+
"data-slot": "menu-item",
|
|
62
|
+
...props,
|
|
63
|
+
className: merge("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", className)
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** Groups items under a `MenuLabel`. */
|
|
67
|
+
function MenuGroup(props) {
|
|
68
|
+
return /* @__PURE__ */ jsx(Menu$1.Group, {
|
|
69
|
+
"data-slot": "menu-group",
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** Label of a `MenuGroup`. */
|
|
74
|
+
function MenuLabel({ className, ...props }) {
|
|
75
|
+
return /* @__PURE__ */ jsx(Menu$1.GroupLabel, {
|
|
76
|
+
"data-slot": "menu-label",
|
|
77
|
+
...props,
|
|
78
|
+
className: merge("px-2 py-1.5 text-xs text-muted-foreground", className)
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** Line between items or groups. */
|
|
82
|
+
function MenuSeparator({ className, ...props }) {
|
|
83
|
+
return /* @__PURE__ */ jsx(Menu$1.Separator, {
|
|
84
|
+
"data-slot": "menu-separator",
|
|
85
|
+
...props,
|
|
86
|
+
className: merge("-mx-1 my-1 h-(--ui-border-width) bg-border", className)
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
export { Menu, MenuContent, MenuGroup, MenuItem, MenuLabel, MenuSeparator, MenuTrigger };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Select as Select$1 } from "@base-ui/react/select";
|
|
2
|
+
export interface SelectProps<Value, Multiple extends boolean | undefined = false> extends Select$1.Root.Props<Value, Multiple> {}
|
|
3
|
+
/** Groups all parts of the select. Doesn't render an element. */
|
|
4
|
+
export declare function Select<Value, Multiple extends boolean | undefined = false>(props: SelectProps<Value, Multiple>): import("react").JSX.Element;
|
|
5
|
+
export interface SelectTriggerProps extends Select$1.Trigger.Props {}
|
|
6
|
+
/** Button that opens the popup. Put `SelectValue` inside it. */
|
|
7
|
+
export declare function SelectTrigger({ className, children, ref, ...props }: SelectTriggerProps): import("react").JSX.Element;
|
|
8
|
+
export interface SelectValueProps extends Select$1.Value.Props {}
|
|
9
|
+
/** Shows the label of the selected item, or `placeholder` when nothing is selected. */
|
|
10
|
+
export declare function SelectValue({ className, ...props }: SelectValueProps): import("react").JSX.Element;
|
|
11
|
+
export interface SelectContentProps extends Select$1.Popup.Props, Pick<Select$1.Positioner.Props, "side" | "align" | "sideOffset" | "alignItemWithTrigger"> {}
|
|
12
|
+
/** Popup with the list of items, in a portal. It takes the theme and scheme of the subtree the trigger is in. */
|
|
13
|
+
export declare function SelectContent({ className, children, side, align, sideOffset, alignItemWithTrigger, ...props }: SelectContentProps): import("react").JSX.Element;
|
|
14
|
+
export interface SelectItemProps extends Select$1.Item.Props {}
|
|
15
|
+
/** One choice. `value` is what `onValueChange` receives. */
|
|
16
|
+
export declare function SelectItem({ className, children, ...props }: SelectItemProps): import("react").JSX.Element;
|
|
17
|
+
export interface SelectGroupProps extends Select$1.Group.Props {}
|
|
18
|
+
/** Groups items under a `SelectLabel`. */
|
|
19
|
+
export declare function SelectGroup(props: SelectGroupProps): import("react").JSX.Element;
|
|
20
|
+
export interface SelectLabelProps extends Select$1.GroupLabel.Props {}
|
|
21
|
+
/** Label of a `SelectGroup`. */
|
|
22
|
+
export declare function SelectLabel({ className, ...props }: SelectLabelProps): import("react").JSX.Element;
|
|
23
|
+
export interface SelectSeparatorProps extends Select$1.Separator.Props {}
|
|
24
|
+
/** Line between items or groups. */
|
|
25
|
+
export declare function SelectSeparator({ className, ...props }: SelectSeparatorProps): import("react").JSX.Element;
|