@nadicodeai/ui 0.4.0 → 0.4.1
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/AGENTS.md +2 -1
- package/README.md +4 -2
- package/dist/components/accordion.d.ts +15 -5
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +34 -9
- package/dist/components/ai-elements/chain-of-thought.js +1 -1
- package/dist/components/ai-elements/mic-selector.js +1 -1
- package/dist/components/ai-elements/plan.d.ts +3 -2
- package/dist/components/ai-elements/plan.d.ts.map +1 -1
- package/dist/components/ai-elements/reasoning.js +1 -1
- package/dist/components/ai-elements/stack-trace.js +1 -1
- package/dist/components/ai-elements/transcription.js +1 -1
- package/dist/components/ai-elements/voice-selector.d.ts +2 -1
- package/dist/components/ai-elements/voice-selector.d.ts.map +1 -1
- package/dist/components/ai-elements/voice-selector.js +1 -1
- package/dist/components/alert-dialog.d.ts +10 -9
- package/dist/components/alert-dialog.d.ts.map +1 -1
- package/dist/components/alert-dialog.js +16 -13
- package/dist/components/aspect-ratio.d.ts +3 -2
- package/dist/components/aspect-ratio.d.ts.map +1 -1
- package/dist/components/aspect-ratio.js +6 -3
- package/dist/components/avatar.d.ts +5 -5
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +5 -5
- package/dist/components/badge.js +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.d.ts +4 -2
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +21 -17
- package/dist/components/checkbox.d.ts +2 -3
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/collapsible.d.ts +8 -4
- package/dist/components/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible.js +16 -6
- package/dist/components/command.d.ts +4 -3
- package/dist/components/command.d.ts.map +1 -1
- package/dist/components/command.js +13 -12
- package/dist/components/context-menu.d.ts +24 -15
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +38 -28
- package/dist/components/dialog.d.ts +10 -9
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +11 -10
- package/dist/components/direction.d.ts +6 -5
- package/dist/components/direction.d.ts.map +1 -1
- package/dist/components/direction.js +3 -4
- package/dist/components/drawer.d.ts +22 -10
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +70 -12
- package/dist/components/dropdown-menu.d.ts +25 -16
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +40 -30
- package/dist/components/form.d.ts +3 -3
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/hover-card.d.ts +8 -4
- package/dist/components/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card.js +12 -7
- package/dist/components/item.js +1 -1
- package/dist/components/label.d.ts +1 -2
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +1 -2
- package/dist/components/menubar.d.ts +21 -18
- package/dist/components/menubar.d.ts.map +1 -1
- package/dist/components/menubar.js +25 -23
- package/dist/components/navigation-menu.d.ts +16 -12
- package/dist/components/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu.js +16 -13
- package/dist/components/popover.d.ts +11 -8
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +33 -12
- package/dist/components/progress.d.ts +7 -4
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +17 -5
- package/dist/components/radio-group.d.ts +4 -4
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +4 -4
- package/dist/components/scroll-area.d.ts +3 -3
- package/dist/components/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area.js +2 -4
- package/dist/components/select.d.ts +11 -11
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +14 -18
- package/dist/components/separator.d.ts +2 -3
- package/dist/components/separator.d.ts.map +1 -1
- package/dist/components/separator.js +3 -3
- package/dist/components/sheet.d.ts +8 -7
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +10 -12
- package/dist/components/sidebar.js +1 -1
- package/dist/components/slider.d.ts +2 -3
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +10 -7
- package/dist/components/switch.d.ts +3 -4
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +2 -2
- package/dist/components/tabs.d.ts +5 -6
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +5 -5
- package/dist/components/theme-mode-switcher.js +1 -1
- package/dist/components/toggle-group.d.ts +12 -4
- package/dist/components/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group.js +29 -7
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.d.ts.map +1 -1
- package/dist/components/toggle.js +9 -8
- package/dist/components/tooltip.d.ts +8 -6
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +7 -6
- package/dist/hooks/use-controllable-state.d.ts +9 -0
- package/dist/hooks/use-controllable-state.d.ts.map +1 -0
- package/dist/hooks/use-controllable-state.js +25 -0
- package/dist/lib/base-render.d.ts +14 -0
- package/dist/lib/base-render.d.ts.map +1 -0
- package/dist/lib/base-render.js +16 -0
- package/dist/lib/slot.d.ts +8 -0
- package/dist/lib/slot.d.ts.map +1 -0
- package/dist/lib/slot.js +17 -0
- package/docs/agents/nadicodeai-ui.md +1 -1
- package/docs/migration/base-ui-migration.md +49 -0
- package/llms.txt +2 -2
- package/package.json +3 -6
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @nadicodeai/ui - Agent Rules
|
|
2
2
|
|
|
3
|
-
The `@nadicodeai/ui` npm workspace: the shared NadicodeAI React UI package on brand tokens (Tailwind v4, semantic light/dark roles), per ADR 0007. It ships shadcn primitives, AI Elements, React adapters over the design-system grammar, reusable marketing/section compositions, and plan-approved product components once their source/export/tests/docs exist. It is source-authored in `src/` and published from built `dist` JavaScript, declarations, and CSS. Read this file before working in the component library. For website page assembly, also read **`../website/AGENTS.md`**; for portal screens, read **`../portal/AGENTS.md`**.
|
|
3
|
+
The `@nadicodeai/ui` npm workspace: the shared NadicodeAI React UI package on brand tokens (Tailwind v4, semantic light/dark roles), per ADR 0007. It ships shadcn primitives backed by Base UI, AI Elements, React adapters over the design-system grammar, reusable marketing/section compositions, and plan-approved product components once their source/export/tests/docs exist. It is source-authored in `src/` and published from built `dist` JavaScript, declarations, and CSS. Read this file before working in the component library. For website page assembly, also read **`../website/AGENTS.md`**; for portal screens, read **`../portal/AGENTS.md`**.
|
|
4
4
|
|
|
5
5
|
When this file is read from an installed package, use it as the consumer agent
|
|
6
6
|
contract: import `@nadicodeai/ui/globals.css` and
|
|
@@ -22,6 +22,7 @@ skills.
|
|
|
22
22
|
- **Source-authored, built package.** Components are authored as shadcn-style source in this workspace, then emitted to `dist/` for consumption by other apps. Package exports must point at built JS/declarations/CSS, not raw `src/*.tsx`, and `npm pack --dry-run` must include only intentional consumer artifacts.
|
|
23
23
|
- **Public surface changes require a release decision.** Any change to exported components, `src/index.ts`, `src/ai-elements.ts`, package `exports`, `globals.css`, UI-local semantic aliases, theme behavior, package docs, package skills, or design-system token/CSS/theme output consumed by this package must end with an explicit npm release decision before handoff. If the change should reach external consumers, bump the relevant package version(s), run `npm pack --dry-run -w @nadicodeai/ui`, and follow `../docs/agents/npm-publishing.md`. When the UI change depends on modified `@nadicodeai/design-system` output, bump/publish `@nadicodeai/design-system` first, then update `@nadicodeai/ui`'s dependency and publish UI. Never claim a UI package change is shipped to npm until `npm view @nadicodeai/ui version` reports the intended published version.
|
|
24
24
|
- **shadcn and AI Elements are package surface.** The installed shadcn source components under `src/components/` and all 48 Vercel AI Elements under `src/components/ai-elements/` are intentional ready-to-use exports. Keep `src/index.ts`, `src/ai-elements.ts`, package `exports`, README/agent docs, and `website/app/ui-check/elements` synchronized whenever this surface changes.
|
|
25
|
+
- **Base UI is the active primitive base.** `components.json` must resolve through a Base style, currently `base-nova`, and `npx shadcn@latest info --json` must report `base: "base"`. Do not reintroduce `radix-ui`, `@radix-ui/*`, or `vaul` to package source/dependencies or app optimizer configuration; `cmdk` stays because shadcn's stock base-nova `command` ships on it and the package uses that stock registry item. The package keeps `asChild` compatibility through local adapters while using Base UI `render` internally.
|
|
25
26
|
- **Named shadcn blocks stay named.** When a user, plan, or issue selects a shadcn block/example such as `login-02`, `signup-02`, `dashboard-01`, or `sidebar-*`, use that registry item as the source of truth through shadcn CLI/MCP. Do not replace it with a package-authored abstraction unless the plan explicitly records the substitution, the reason, and the true consumer route that proves it.
|
|
26
27
|
- **Package surface is source-backed.** `src/components/` is intentionally flat shadcn-style source. Do not document folders or package namespaces that do not exist. Do not add top-level exports for recipes, blocks, agent, or terminal groupings unless a later package API decision adds concrete source, built files, docs, and tests in the same change.
|
|
27
28
|
- **Auth routes are consumer-owned shadcn block work.** Login, signup, OTP, two-factor, magic-link, and provider-button flows start from the selected shadcn block/example in the consuming app, with app-owned Better Auth behavior. Do not ship generic auth, signup, OTP, federated-login, or provider abstractions from this package unless a later explicit boundary decision replaces the selected shadcn block.
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ when their source, public subpath export, docs, and tests exist.
|
|
|
14
14
|
|
|
15
15
|
The package ships:
|
|
16
16
|
|
|
17
|
-
- shadcn source components under `@nadicodeai/ui/components
|
|
17
|
+
- shadcn source components under `@nadicodeai/ui/components/*`, backed by Base UI primitives where a headless primitive is needed
|
|
18
18
|
- all 48 Vercel AI Elements under `@nadicodeai/ui/components/ai-elements/*`
|
|
19
19
|
- an AI Elements barrel at `@nadicodeai/ui/ai-elements`
|
|
20
20
|
- React adapters over the design-system grammar and assets
|
|
@@ -196,7 +196,9 @@ npx shadcn@latest add @ai-elements/message --dry-run
|
|
|
196
196
|
|
|
197
197
|
`info --json` is the project-aware source of truth for aliases, Tailwind version,
|
|
198
198
|
base primitive library, icon library, resolved source paths, and configured
|
|
199
|
-
registries.
|
|
199
|
+
registries. The active primitive base is Base UI; do not add Radix or vaul to
|
|
200
|
+
package source or dependencies (`cmdk` is the one allowed carrier — shadcn's
|
|
201
|
+
stock base-nova `command` ships on it). Use `search`, `docs`, and `view` to inspect current registry items
|
|
200
202
|
before adding or refreshing source. Review `add --dry-run` or `add --diff`
|
|
201
203
|
output before changing files, and do not use `--overwrite` unless the maintainer
|
|
202
204
|
explicitly asks for an upstream refresh.
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Accordion as AccordionPrimitive } from "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
3
|
+
import { type WithAsChild } from "../lib/base-render";
|
|
4
|
+
type AccordionCompatibilityValue = string | string[];
|
|
5
|
+
type AccordionCompatibilityProps = Omit<AccordionPrimitive.Root.Props<string>, "defaultValue" | "multiple" | "onValueChange" | "value"> & {
|
|
6
|
+
collapsible?: boolean;
|
|
7
|
+
defaultValue?: AccordionCompatibilityValue;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
onValueChange?: (value: AccordionCompatibilityValue, eventDetails: AccordionPrimitive.Root.ChangeEventDetails) => void;
|
|
10
|
+
type?: "single" | "multiple";
|
|
11
|
+
value?: AccordionCompatibilityValue;
|
|
12
|
+
};
|
|
13
|
+
declare function Accordion({ className, collapsible, defaultValue, multiple, onValueChange, type, value, ...props }: AccordionCompatibilityProps): React.JSX.Element;
|
|
14
|
+
declare function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props): React.JSX.Element;
|
|
15
|
+
declare function AccordionTrigger({ className, children, asChild, ...props }: WithAsChild<AccordionPrimitive.Trigger.Props>): React.JSX.Element;
|
|
16
|
+
declare function AccordionContent({ className, children, ...props }: AccordionPrimitive.Panel.Props): React.JSX.Element;
|
|
7
17
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
8
18
|
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE1E,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAIvE,KAAK,2BAA2B,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;AAEpD,KAAK,2BAA2B,GAAG,IAAI,CACrC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EACrC,cAAc,GAAG,UAAU,GAAG,eAAe,GAAG,OAAO,CACxD,GAAG;IACF,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,2BAA2B,CAAA;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,2BAA2B,EAClC,YAAY,EAAE,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,KACrD,IAAI,CAAA;IACT,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC5B,KAAK,CAAC,EAAE,2BAA2B,CAAA;CACpC,CAAA;AAcD,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,KAAK,EACL,GAAG,KAAK,EACT,EAAE,2BAA2B,qBAwC7B;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,qBAQ5E;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,GAAG,KAAK,EACT,EAAE,WAAW,CAAC,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,qBAqB/C;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,CAAC,KAAK,CAAC,KAAK,qBAiBhC;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { Accordion as AccordionPrimitive } from "
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
5
|
+
import { withAsChildRender } from "../lib/base-render.js";
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
8
|
+
function toBaseValue(value) {
|
|
9
|
+
if (value === undefined) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
if (Array.isArray(value)) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
return value === "" ? [] : [value];
|
|
16
|
+
}
|
|
17
|
+
function Accordion({ className, collapsible = false, defaultValue, multiple, onValueChange, type, value, ...props }) {
|
|
18
|
+
const isMultiple = multiple ?? type === "multiple";
|
|
19
|
+
const baseValue = React.useMemo(() => toBaseValue(value), [value]);
|
|
20
|
+
const defaultBaseValue = React.useMemo(() => toBaseValue(defaultValue), [defaultValue]);
|
|
21
|
+
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultBaseValue);
|
|
22
|
+
const resolvedValue = value === undefined ? uncontrolledValue : baseValue;
|
|
23
|
+
const handleValueChange = React.useCallback((nextValue, eventDetails) => {
|
|
24
|
+
if (!isMultiple && !collapsible && nextValue.length === 0) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (value === undefined) {
|
|
28
|
+
setUncontrolledValue(nextValue);
|
|
29
|
+
}
|
|
30
|
+
onValueChange?.(isMultiple ? nextValue : (nextValue[0] ?? ""), eventDetails);
|
|
31
|
+
}, [collapsible, isMultiple, onValueChange, value]);
|
|
32
|
+
return (_jsx(AccordionPrimitive.Root, { "data-slot": "accordion", className: cn("flex w-full flex-col", className), multiple: isMultiple, onValueChange: handleValueChange, value: resolvedValue, ...props }));
|
|
8
33
|
}
|
|
9
34
|
function AccordionItem({ className, ...props }) {
|
|
10
|
-
return (_jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn("
|
|
35
|
+
return (_jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn("not-last:border-b", className), ...props }));
|
|
11
36
|
}
|
|
12
|
-
function AccordionTrigger({ className, children, ...props }) {
|
|
13
|
-
return (_jsx(AccordionPrimitive.Header, { className: "flex", children:
|
|
37
|
+
function AccordionTrigger({ className, children, asChild, ...props }) {
|
|
38
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsx(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground", className), ...withAsChildRender({ asChild, children, ...props }), children: !asChild && (_jsxs(_Fragment, { children: [children, _jsx(ChevronDownIcon, { "data-slot": "accordion-trigger-icon", className: "pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" }), _jsx(ChevronUpIcon, { "data-slot": "accordion-trigger-icon", className: "pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" })] })) }) }));
|
|
14
39
|
}
|
|
15
40
|
function AccordionContent({ className, children, ...props }) {
|
|
16
|
-
return (_jsx(AccordionPrimitive.
|
|
41
|
+
return (_jsx(AccordionPrimitive.Panel, { "data-slot": "accordion-content", className: "overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up", ...props, children: _jsx("div", { className: cn("h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4", className), children: children }) }));
|
|
17
42
|
}
|
|
18
43
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useControllableState } from "
|
|
3
|
+
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
4
4
|
import { Badge } from "../badge.js";
|
|
5
5
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../collapsible.js";
|
|
6
6
|
import { cn } from "../../lib/utils.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useControllableState } from "
|
|
3
|
+
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
4
4
|
import { Button } from "../button.js";
|
|
5
5
|
import { Command, CommandEmpty, CommandInput, CommandItem, CommandList, } from "../command.js";
|
|
6
6
|
import { Popover, PopoverContent, PopoverTrigger, } from "../popover.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Button } from "../button";
|
|
1
2
|
import { CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../card";
|
|
2
|
-
import { Collapsible
|
|
3
|
+
import { Collapsible } from "../collapsible";
|
|
3
4
|
import type { ComponentProps } from "react";
|
|
4
5
|
export type PlanProps = ComponentProps<typeof Collapsible> & {
|
|
5
6
|
isStreaming?: boolean;
|
|
@@ -21,6 +22,6 @@ export type PlanContentProps = ComponentProps<typeof CardContent>;
|
|
|
21
22
|
export declare const PlanContent: (props: PlanContentProps) => import("react").JSX.Element;
|
|
22
23
|
export type PlanFooterProps = ComponentProps<"div">;
|
|
23
24
|
export declare const PlanFooter: (props: PlanFooterProps) => import("react").JSX.Element;
|
|
24
|
-
export type PlanTriggerProps = ComponentProps<typeof
|
|
25
|
+
export type PlanTriggerProps = Omit<ComponentProps<typeof Button>, "children" | "size" | "variant">;
|
|
25
26
|
export declare const PlanTrigger: ({ className, ...props }: PlanTriggerProps) => import("react").JSX.Element;
|
|
26
27
|
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/components/ai-elements/plan.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/components/ai-elements/plan.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAEL,UAAU,EACV,WAAW,EACX,eAAe,EAEf,UAAU,EACV,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,WAAW,EAGZ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAmB5C,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,GAAG;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,gDAKlB,SAAS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
|
|
3
|
+
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
4
4
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../collapsible.js";
|
|
5
5
|
import { cn } from "../../lib/utils.js";
|
|
6
6
|
import { cjk } from "@streamdown/cjk";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useControllableState } from "
|
|
3
|
+
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
4
4
|
import { Button } from "../button.js";
|
|
5
5
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../collapsible.js";
|
|
6
6
|
import { cn } from "../../lib/utils.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useControllableState } from "
|
|
3
|
+
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
5
|
import { createContext, useCallback, useContext, useMemo } from "react";
|
|
6
6
|
const TranscriptionContext = createContext(null);
|
|
@@ -8,9 +8,10 @@ interface VoiceSelectorContextValue {
|
|
|
8
8
|
setOpen: (open: boolean) => void;
|
|
9
9
|
}
|
|
10
10
|
export declare const useVoiceSelector: () => VoiceSelectorContextValue;
|
|
11
|
-
export type VoiceSelectorProps = ComponentProps<typeof Dialog> & {
|
|
11
|
+
export type VoiceSelectorProps = Omit<ComponentProps<typeof Dialog>, "onOpenChange"> & {
|
|
12
12
|
value?: string;
|
|
13
13
|
defaultValue?: string;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
15
|
onValueChange?: (value: string | undefined) => void;
|
|
15
16
|
};
|
|
16
17
|
export declare const VoiceSelector: ({ value: valueProp, defaultValue, onValueChange, open: openProp, defaultOpen, onOpenChange, children, ...props }: VoiceSelectorProps) => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice-selector.d.ts","sourceRoot":"","sources":["../../../src/components/ai-elements/voice-selector.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,MAAM,EACN,aAAa,EAEb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAc7B,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,UAAU,yBAAyB;IACjC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC9C,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC;AAMD,eAAO,MAAM,gBAAgB,iCAQ5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"voice-selector.d.ts","sourceRoot":"","sources":["../../../src/components/ai-elements/voice-selector.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,MAAM,EACN,aAAa,EAEb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAc7B,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,UAAU,yBAAyB;IACjC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,K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
|
|
3
|
+
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
4
4
|
import { Button } from "../button.js";
|
|
5
5
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "../command.js";
|
|
6
6
|
import { Dialog, DialogContent, DialogTitle, DialogTrigger, } from "../dialog.js";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { AlertDialog as AlertDialogPrimitive } from "
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
3
|
+
import { type WithAsChild } from "../lib/base-render";
|
|
3
4
|
import { Button } from "./button";
|
|
4
|
-
declare function AlertDialog({ ...props }:
|
|
5
|
-
declare function AlertDialogTrigger({ ...props }:
|
|
6
|
-
declare function AlertDialogPortal({ ...props }:
|
|
7
|
-
declare function AlertDialogOverlay({ className, ...props }:
|
|
8
|
-
declare function AlertDialogContent({ className, size, ...props }:
|
|
5
|
+
declare function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props): React.JSX.Element;
|
|
6
|
+
declare function AlertDialogTrigger({ ...props }: WithAsChild<AlertDialogPrimitive.Trigger.Props>): React.JSX.Element;
|
|
7
|
+
declare function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props): React.JSX.Element;
|
|
8
|
+
declare function AlertDialogOverlay({ className, ...props }: AlertDialogPrimitive.Backdrop.Props): React.JSX.Element;
|
|
9
|
+
declare function AlertDialogContent({ className, size, ...props }: AlertDialogPrimitive.Popup.Props & {
|
|
9
10
|
size?: "default" | "sm";
|
|
10
11
|
}): React.JSX.Element;
|
|
11
12
|
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
13
|
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
|
+
declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
15
|
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
14
16
|
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
15
|
-
declare function
|
|
16
|
-
declare function
|
|
17
|
-
declare function AlertDialogCancel({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
|
|
17
|
+
declare function AlertDialogAction({ className, variant, size, ...props }: AlertDialogPrimitive.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
|
|
18
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialogPrimitive.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
|
|
18
19
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
|
|
19
20
|
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../src/components/alert-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../src/components/alert-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAEjF,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEvE,OAAO,EAAE,MAAM,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S,iBAAiB,CAAC,EACzB,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,GACjC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,qBAS9D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,GACjC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,qBAS9D;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,CAAA"}
|
|
@@ -1,42 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { AlertDialog as AlertDialogPrimitive } from "
|
|
3
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
4
|
+
import { withAsChildRender } from "../lib/base-render.js";
|
|
4
5
|
import { cn } from "../lib/utils.js";
|
|
5
6
|
import { Button } from "./button.js";
|
|
6
7
|
function AlertDialog({ ...props }) {
|
|
7
8
|
return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
|
|
8
9
|
}
|
|
9
10
|
function AlertDialogTrigger({ ...props }) {
|
|
10
|
-
return (_jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props }));
|
|
11
|
+
return (_jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...withAsChildRender(props) }));
|
|
11
12
|
}
|
|
12
13
|
function AlertDialogPortal({ ...props }) {
|
|
13
14
|
return (_jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props }));
|
|
14
15
|
}
|
|
15
16
|
function AlertDialogOverlay({ className, ...props }) {
|
|
16
|
-
return (_jsx(AlertDialogPrimitive.
|
|
17
|
+
return (_jsx(AlertDialogPrimitive.Backdrop, { "data-slot": "alert-dialog-overlay", className: cn("fixed inset-0 isolate z-50 bg-foreground/50 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
|
|
17
18
|
}
|
|
18
19
|
function AlertDialogContent({ className, size = "default", ...props }) {
|
|
19
|
-
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.
|
|
20
|
+
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Popup, { "data-slot": "alert-dialog-content", "data-size": size, className: cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props })] }));
|
|
20
21
|
}
|
|
21
22
|
function AlertDialogHeader({ className, ...props }) {
|
|
22
|
-
return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-
|
|
23
|
+
return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className), ...props }));
|
|
23
24
|
}
|
|
24
25
|
function AlertDialogFooter({ className, ...props }) {
|
|
25
|
-
return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
26
|
+
return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
function AlertDialogMedia({ className, ...props }) {
|
|
29
|
+
return (_jsx("div", { "data-slot": "alert-dialog-media", className: cn("mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className), ...props }));
|
|
26
30
|
}
|
|
27
31
|
function AlertDialogTitle({ className, ...props }) {
|
|
28
|
-
return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn("text-
|
|
32
|
+
return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className), ...props }));
|
|
29
33
|
}
|
|
30
34
|
function AlertDialogDescription({ className, ...props }) {
|
|
31
|
-
return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
32
|
-
}
|
|
33
|
-
function AlertDialogMedia({ className, ...props }) {
|
|
34
|
-
return (_jsx("div", { "data-slot": "alert-dialog-media", className: cn("mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8", className), ...props }));
|
|
35
|
+
return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
|
|
35
36
|
}
|
|
37
|
+
// Deviates from stock base-nova (bare Button): Action stays a Close so it
|
|
38
|
+
// auto-closes on click, preserving the Radix-era Action contract consumers rely on.
|
|
36
39
|
function AlertDialogAction({ className, variant = "default", size = "default", ...props }) {
|
|
37
|
-
return (_jsx(
|
|
40
|
+
return (_jsx(AlertDialogPrimitive.Close, { "data-slot": "alert-dialog-action", className: cn(className), render: _jsx(Button, { variant: variant, size: size }), ...props }));
|
|
38
41
|
}
|
|
39
42
|
function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
|
|
40
|
-
return (_jsx(
|
|
43
|
+
return (_jsx(AlertDialogPrimitive.Close, { "data-slot": "alert-dialog-cancel", className: cn(className), render: _jsx(Button, { variant: variant, size: size }), ...props }));
|
|
41
44
|
}
|
|
42
45
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function AspectRatio({ ratio, className, style, ...props }: React.ComponentProps<"div"> & {
|
|
2
|
+
ratio: number;
|
|
3
|
+
}): import("react").JSX.Element;
|
|
3
4
|
export { AspectRatio };
|
|
4
5
|
//# sourceMappingURL=aspect-ratio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect-ratio.d.ts","sourceRoot":"","sources":["../../src/components/aspect-ratio.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aspect-ratio.d.ts","sourceRoot":"","sources":["../../src/components/aspect-ratio.tsx"],"names":[],"mappings":"AAIA,iBAAS,WAAW,CAAC,EACnB,KAAK,EACL,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,+BAcjD;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
function AspectRatio({ ...props }) {
|
|
5
|
-
return _jsx(
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
function AspectRatio({ ratio, className, style, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "aspect-ratio", style: {
|
|
6
|
+
...style,
|
|
7
|
+
"--ratio": ratio,
|
|
8
|
+
}, className: cn("relative aspect-(--ratio)", className), ...props }));
|
|
6
9
|
}
|
|
7
10
|
export { AspectRatio };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Avatar as AvatarPrimitive } from "
|
|
3
|
-
declare function Avatar({ className, size, ...props }:
|
|
2
|
+
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
3
|
+
declare function Avatar({ className, size, ...props }: AvatarPrimitive.Root.Props & {
|
|
4
4
|
size?: "default" | "sm" | "lg";
|
|
5
5
|
}): React.JSX.Element;
|
|
6
|
-
declare function AvatarImage({ className, ...props }:
|
|
7
|
-
declare function AvatarFallback({ className, ...props }:
|
|
6
|
+
declare function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props): React.JSX.Element;
|
|
7
|
+
declare function AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props): React.JSX.Element;
|
|
8
8
|
declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
9
9
|
declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
10
|
declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
-
export { Avatar, AvatarImage, AvatarFallback,
|
|
11
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
|
|
12
12
|
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/components/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/components/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAIjE,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,GAAG;IAC9B,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;CAC/B,qBAYA;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAWxE;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,qBAWhC;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAczE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWxE;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAW7B;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,WAAW,GACZ,CAAA"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Avatar as AvatarPrimitive } from "
|
|
3
|
+
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
5
|
function Avatar({ className, size = "default", ...props }) {
|
|
6
|
-
return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex size-8 shrink-0
|
|
6
|
+
return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6", className), ...props }));
|
|
7
7
|
}
|
|
8
8
|
function AvatarImage({ className, ...props }) {
|
|
9
|
-
return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn("aspect-square size-full", className), ...props }));
|
|
9
|
+
return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn("aspect-square size-full rounded-full object-cover", className), ...props }));
|
|
10
10
|
}
|
|
11
11
|
function AvatarFallback({ className, ...props }) {
|
|
12
12
|
return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className), ...props }));
|
|
13
13
|
}
|
|
14
14
|
function AvatarBadge({ className, ...props }) {
|
|
15
|
-
return (_jsx("span", { "data-slot": "avatar-badge", className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className), ...props }));
|
|
15
|
+
return (_jsx("span", { "data-slot": "avatar-badge", className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className), ...props }));
|
|
16
16
|
}
|
|
17
17
|
function AvatarGroup({ className, ...props }) {
|
|
18
18
|
return (_jsx("div", { "data-slot": "avatar-group", className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className), ...props }));
|
|
@@ -20,4 +20,4 @@ function AvatarGroup({ className, ...props }) {
|
|
|
20
20
|
function AvatarGroupCount({ className, ...props }) {
|
|
21
21
|
return (_jsx("div", { "data-slot": "avatar-group-count", className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className), ...props }));
|
|
22
22
|
}
|
|
23
|
-
export { Avatar, AvatarImage, AvatarFallback,
|
|
23
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
|
package/dist/components/badge.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { Slot } from "
|
|
4
|
+
import { Slot } from "../lib/slot.js";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
6
|
const badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3", {
|
|
7
7
|
variants: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
4
|
-
import { Slot } from "
|
|
4
|
+
import { Slot } from "../lib/slot.js";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
6
|
function Breadcrumb({ ...props }) {
|
|
7
7
|
return _jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { Slot } from "
|
|
4
|
+
import { Slot } from "../lib/slot.js";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
6
|
import { Separator } from "./separator.js";
|
|
7
7
|
const buttonGroupVariants = cva("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
2
3
|
import { type VariantProps } from "class-variance-authority";
|
|
3
4
|
declare const buttonVariants: (props?: ({
|
|
4
5
|
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
5
6
|
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
|
|
8
|
+
type ButtonProps = Omit<ButtonPrimitive.Props, keyof React.ComponentProps<"button">> & React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
9
|
asChild?: boolean;
|
|
9
|
-
}
|
|
10
|
+
};
|
|
11
|
+
declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): React.JSX.Element;
|
|
10
12
|
export { Button, buttonVariants };
|
|
11
13
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,cAAc;;;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,cAAc;;;8EAmCnB,CAAA;AAED,KAAK,WAAW,GAAG,IAAI,CACrB,eAAe,CAAC,KAAK,EACrB,MAAM,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CACrC,GACC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC9B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAEH,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,qBAwBb;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
3
4
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { Slot } from "
|
|
5
|
+
import { Slot } from "../lib/slot.js";
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
|
-
const buttonVariants = cva("inline-flex shrink-0 items-center justify-center
|
|
7
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
8
|
variants: {
|
|
8
9
|
variant: {
|
|
9
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
11
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
13
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
14
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20",
|
|
14
15
|
link: "text-primary underline-offset-4 hover:underline",
|
|
15
16
|
},
|
|
16
17
|
size: {
|
|
17
|
-
default: "h-
|
|
18
|
-
xs: "h-6 gap-1 rounded-
|
|
19
|
-
sm: "h-
|
|
20
|
-
lg: "h-
|
|
21
|
-
icon: "size-
|
|
22
|
-
"icon-xs": "size-6 rounded-
|
|
23
|
-
"icon-sm": "size-
|
|
24
|
-
"icon-lg": "size-
|
|
18
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
19
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
20
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
21
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
22
|
+
icon: "size-8",
|
|
23
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
24
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
25
|
+
"icon-lg": "size-9",
|
|
25
26
|
},
|
|
26
27
|
},
|
|
27
28
|
defaultVariants: {
|
|
@@ -30,7 +31,10 @@ const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap
|
|
|
30
31
|
},
|
|
31
32
|
});
|
|
32
33
|
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
33
|
-
const
|
|
34
|
-
|
|
34
|
+
const buttonClassName = cn(buttonVariants({ variant, size, className }));
|
|
35
|
+
if (asChild) {
|
|
36
|
+
return (_jsx(Slot.Root, { "data-slot": "button", "data-variant": variant, "data-size": size, className: buttonClassName, ...props }));
|
|
37
|
+
}
|
|
38
|
+
return (_jsx(ButtonPrimitive, { "data-slot": "button", "data-variant": variant, "data-size": size, className: buttonClassName, ...props }));
|
|
35
39
|
}
|
|
36
40
|
export { Button, buttonVariants };
|