@lanfermann/ui 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/accordion.js +2 -1
- package/dist/components/anchor-heading/anchor-heading.d.ts +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.js +5 -10
- package/dist/components/button/button.d.ts +3 -0
- package/dist/components/button/button.js +14 -4
- package/dist/components/button-group/button-group-context.js +14 -0
- package/dist/components/button-group/button-group-variants.d.ts +14 -0
- package/dist/components/button-group/button-group-variants.js +93 -0
- package/dist/components/button-group/button-group.d.ts +36 -0
- package/dist/components/button-group/button-group.js +46 -0
- package/dist/components/code-block/code-block-frame.js +22 -6
- package/dist/components/code-block/code-block-live.d.ts +3 -3
- package/dist/components/code-block/code-block-live.js +5 -3
- package/dist/components/code-block/code-block.d.ts +7 -3
- package/dist/components/code-block/code-block.js +9 -3
- package/dist/components/code-block/code-keys.d.ts +24 -0
- package/dist/components/code-block/code-keys.js +107 -0
- package/dist/components/code-block/code-scroll.js +2 -1
- package/dist/components/code-block/code-tabs-frame.js +12 -5
- package/dist/components/code-block/code-tabs.d.ts +9 -4
- package/dist/components/code-block/code-tabs.js +9 -6
- package/dist/components/code-block/lines.js +23 -1
- package/dist/components/copy-page/copy-page.d.ts +46 -0
- package/dist/components/copy-page/copy-page.js +211 -0
- package/dist/components/docs-layout/docs-layout.d.ts +4 -2
- package/dist/components/docs-layout/docs-layout.js +11 -6
- package/dist/components/docs-layout/docs-nav.d.ts +51 -0
- package/dist/components/docs-layout/docs-nav.js +60 -0
- package/dist/components/grow/grow.d.ts +20 -0
- package/dist/components/grow/grow.js +98 -0
- package/dist/components/heading/heading.d.ts +4 -0
- package/dist/components/heading/heading.js +8 -4
- package/dist/components/hover-card/hover-card.d.ts +24 -0
- package/dist/components/hover-card/hover-card.js +51 -0
- package/dist/components/pager/pager.js +19 -24
- package/dist/components/parameter-list/parameter-list.js +2 -1
- package/dist/components/scroll-fade/scroll-fade.d.ts +29 -0
- package/dist/components/scroll-fade/scroll-fade.js +40 -0
- package/dist/components/scroll-fade/use-scroll-edges.d.ts +13 -0
- package/dist/{internal/scroll-edges.js → components/scroll-fade/use-scroll-edges.js} +10 -7
- package/dist/components/section/section.d.ts +2 -1
- package/dist/components/section/section.js +2 -1
- package/dist/components/segmented-control/segmented-control.d.ts +7 -1
- package/dist/components/segmented-control/segmented-control.js +22 -11
- package/dist/components/select/select.d.ts +4 -1
- package/dist/components/select/select.js +15 -3
- package/dist/components/separator/separator.js +2 -2
- package/dist/components/shimmer/shimmer.d.ts +21 -0
- package/dist/components/shimmer/shimmer.js +24 -0
- package/dist/components/side-nav/side-nav.js +11 -20
- package/dist/components/site-header/site-header.d.ts +1 -1
- package/dist/components/site-header/site-header.js +6 -3
- package/dist/components/slider/slider.d.ts +3 -1
- package/dist/components/slider/slider.js +45 -19
- package/dist/components/table/table.d.ts +6 -6
- package/dist/components/table/table.js +24 -17
- package/dist/components/table-of-contents/table-of-contents.js +11 -6
- package/dist/components/tabs/tabs.js +4 -8
- package/dist/components/theme-switch/theme-switch.d.ts +47 -0
- package/dist/components/theme-switch/theme-switch.js +102 -0
- package/dist/components/trace/trace.d.ts +71 -0
- package/dist/components/trace/trace.js +201 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.js +11 -2
- package/dist/internal/render-as.js +24 -0
- package/dist/internal/rule.js +16 -0
- package/dist/lib/merge-refs.js +9 -0
- package/package.json +1 -1
- package/src/styles/button-group.css +57 -0
- package/src/styles/code.css +14 -68
- package/src/styles/copy.css +46 -0
- package/src/styles/marks.css +10 -0
- package/src/styles/motion.css +4 -3
- package/src/styles/scroll-fade.css +58 -0
- package/src/styles/shimmer.css +68 -0
- package/src/styles/slider.css +57 -19
- package/src/styles.css +4 -1
- package/dist/components/page-header/page-header.d.ts +0 -30
- package/dist/components/page-header/page-header.js +0 -48
- package/src/styles/tabs.css +0 -39
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon } from "../icon/icon.js";
|
|
3
|
+
import { Spinner } from "../spinner/spinner.js";
|
|
4
|
+
import { disclosurePanel } from "../../internal/disclosure.js";
|
|
5
|
+
import { ChevronRightGlyph } from "../../internal/glyphs.js";
|
|
6
|
+
import { cn } from "../../lib/cn.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Alert02Icon } from "@hugeicons/core-free-icons";
|
|
9
|
+
import { createContext, useContext, useEffect, useMemo, useState } from "react";
|
|
10
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
11
|
+
// src/components/trace/trace.tsx
|
|
12
|
+
const defaultStatusLabels = {
|
|
13
|
+
pending: "Steht aus",
|
|
14
|
+
running: "Läuft",
|
|
15
|
+
done: "Erledigt",
|
|
16
|
+
error: "Fehlgeschlagen"
|
|
17
|
+
};
|
|
18
|
+
const TraceContext = createContext({
|
|
19
|
+
labels: defaultStatusLabels,
|
|
20
|
+
marks: "dots"
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* What an assistant is doing, step by step: the searches, the files, the tools, in the order
|
|
24
|
+
* they happen. It is read, not operated, so it is flat: a list of lines, each with the system's
|
|
25
|
+
* mark in front, joined by a hairline. An open ring waits, the spinner's arc works (it is the
|
|
26
|
+
* ring before it has closed), and the disc is done; a step that failed carries the danger
|
|
27
|
+
* symbol and says so in words.
|
|
28
|
+
*
|
|
29
|
+
* Put `TraceStep`s inside. A step that joins a list already on screen fades in, and its title
|
|
30
|
+
* is announced; the steps that are there when the list first shows do not move. For one line
|
|
31
|
+
* that stands for the whole of it and opens the steps, wrap the list in a `TraceSummary`.
|
|
32
|
+
*/
|
|
33
|
+
function Trace({ marks = "dots", statusLabels, className, ...props }) {
|
|
34
|
+
const [live, setLive] = useState(false);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const frame = requestAnimationFrame(() => setLive(true));
|
|
37
|
+
return () => cancelAnimationFrame(frame);
|
|
38
|
+
}, []);
|
|
39
|
+
const context = useMemo(() => ({
|
|
40
|
+
labels: {
|
|
41
|
+
...defaultStatusLabels,
|
|
42
|
+
...statusLabels
|
|
43
|
+
},
|
|
44
|
+
marks
|
|
45
|
+
}), [statusLabels, marks]);
|
|
46
|
+
return /* @__PURE__ */ jsx(TraceContext, {
|
|
47
|
+
value: context,
|
|
48
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
49
|
+
"data-slot": "trace",
|
|
50
|
+
"data-live": live ? "" : void 0,
|
|
51
|
+
"aria-live": "polite",
|
|
52
|
+
"aria-relevant": "additions",
|
|
53
|
+
className: cn("flex flex-col text-control", className),
|
|
54
|
+
...props
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** The mark in front of a line: ring, arc, disc, or the danger symbol. */
|
|
59
|
+
function TraceMark({ status, icon }) {
|
|
60
|
+
return /* @__PURE__ */ jsx("span", {
|
|
61
|
+
"aria-hidden": true,
|
|
62
|
+
"data-slot": "trace-mark",
|
|
63
|
+
className: "flex size-4 shrink-0 items-center justify-center",
|
|
64
|
+
children: status === "running" ? /* @__PURE__ */ jsx(Spinner, {
|
|
65
|
+
size: 14,
|
|
66
|
+
className: "text-fg"
|
|
67
|
+
}) : status === "error" ? /* @__PURE__ */ jsx(Icon, {
|
|
68
|
+
icon: Alert02Icon,
|
|
69
|
+
size: 14,
|
|
70
|
+
className: "text-danger"
|
|
71
|
+
}) : icon && status === "done" ? /* @__PURE__ */ jsx(Icon, {
|
|
72
|
+
icon,
|
|
73
|
+
size: 14,
|
|
74
|
+
className: "text-fg-muted transition-opacity spring-settle in-data-live:starting:opacity-0"
|
|
75
|
+
}) : /* @__PURE__ */ jsx("span", { className: cn("mark", status === "done" && "mark-on in-data-live:mark-closes") })
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const titleTone = {
|
|
79
|
+
pending: "text-fg-muted",
|
|
80
|
+
running: "shimmer",
|
|
81
|
+
done: "text-fg-body",
|
|
82
|
+
error: "text-fg"
|
|
83
|
+
};
|
|
84
|
+
/** The line itself: the mark, the title, the quieter fact, and a chevron if it opens. */
|
|
85
|
+
function TraceLine({ status, title, meta, icon, opens }) {
|
|
86
|
+
const { labels, marks } = useContext(TraceContext);
|
|
87
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
+
/* @__PURE__ */ jsx(TraceMark, {
|
|
89
|
+
status,
|
|
90
|
+
icon: marks === "symbols" ? icon : void 0
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ jsxs("span", {
|
|
93
|
+
"data-slot": "trace-title",
|
|
94
|
+
className: cn("min-w-0 truncate", titleTone[status]),
|
|
95
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
96
|
+
className: "sr-only",
|
|
97
|
+
children: [labels[status], ": "]
|
|
98
|
+
}), title]
|
|
99
|
+
}),
|
|
100
|
+
meta !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
101
|
+
"data-slot": "trace-meta",
|
|
102
|
+
className: "shrink-0 text-sm text-fg-muted tabular-nums",
|
|
103
|
+
children: meta
|
|
104
|
+
}),
|
|
105
|
+
opens && /* @__PURE__ */ jsx(ChevronRightGlyph, {
|
|
106
|
+
"data-slot": "trace-chevron",
|
|
107
|
+
width: 10,
|
|
108
|
+
height: 10,
|
|
109
|
+
className: cn("text-fg-muted transition-[rotate,color] spring-seat group-hover:text-fg group-data-disabled:text-on-disabled", "group-data-panel-open:rotate-90")
|
|
110
|
+
})
|
|
111
|
+
] });
|
|
112
|
+
}
|
|
113
|
+
const line = "flex min-h-7 items-center gap-2.5";
|
|
114
|
+
/** A line that opens: the whole of it is the button. */
|
|
115
|
+
const trigger = [
|
|
116
|
+
line,
|
|
117
|
+
"group -mx-1.5 max-w-[calc(100%+0.75rem)] rounded-sm px-1.5 text-left select-none",
|
|
118
|
+
"focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent"
|
|
119
|
+
].join(" ");
|
|
120
|
+
/** What a step or a summary opens: set under the title, a size smaller. */
|
|
121
|
+
function TraceDetail({ children }) {
|
|
122
|
+
return /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
123
|
+
"data-slot": "trace-detail",
|
|
124
|
+
className: cn("h-(--collapsible-panel-height) self-stretch", disclosurePanel),
|
|
125
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
126
|
+
className: "flex flex-col gap-2 pt-1 pr-1 pb-2 pl-[1.625rem] text-sm text-fg-body",
|
|
127
|
+
children
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* One step. With children it opens: the line becomes a button, and what it did stands under it
|
|
133
|
+
* (the command, the result, the sources as `Badge`s, the steps of a helper as a `Trace` of its
|
|
134
|
+
* own). Without children it is a plain line and not a tab stop.
|
|
135
|
+
*/
|
|
136
|
+
function TraceStep({ status = "done", title, meta, icon, open, defaultOpen, onOpenChange, className, children, ...props }) {
|
|
137
|
+
const opens = children !== void 0 && children !== null && children !== false;
|
|
138
|
+
const content = /* @__PURE__ */ jsx(TraceLine, {
|
|
139
|
+
status,
|
|
140
|
+
title,
|
|
141
|
+
meta,
|
|
142
|
+
icon,
|
|
143
|
+
opens
|
|
144
|
+
});
|
|
145
|
+
return /* @__PURE__ */ jsx("li", {
|
|
146
|
+
"data-slot": "trace-step",
|
|
147
|
+
"data-status": status,
|
|
148
|
+
className: cn("relative flex flex-col", "transition-[opacity,translate] spring-settle in-data-live:starting:translate-y-(--motion-enter-offset) in-data-live:starting:opacity-0", "before:absolute before:top-[1.4375rem] before:-bottom-[0.3125rem] before:left-[0.46875rem] before:w-px before:bg-hairline last:before:hidden forced-colors:before:bg-[CanvasText]", className),
|
|
149
|
+
...props,
|
|
150
|
+
children: opens ? /* @__PURE__ */ jsxs(Collapsible.Root, {
|
|
151
|
+
open,
|
|
152
|
+
defaultOpen,
|
|
153
|
+
onOpenChange,
|
|
154
|
+
className: "flex flex-col items-start",
|
|
155
|
+
children: [/* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
156
|
+
"data-slot": "trace-trigger",
|
|
157
|
+
className: trigger,
|
|
158
|
+
children: content
|
|
159
|
+
}), /* @__PURE__ */ jsx(TraceDetail, { children })]
|
|
160
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
161
|
+
className: line,
|
|
162
|
+
children: content
|
|
163
|
+
})
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* One line that stands for a whole piece of work and opens its steps: "Arbeitet …" while it
|
|
168
|
+
* goes on, "In 14 Sekunden erledigt" afterwards, the number of steps as its second fact. It is
|
|
169
|
+
* what a chat shows above an answer.
|
|
170
|
+
*
|
|
171
|
+
* It follows the work: open while the work is running, so the steps can be watched, and closed
|
|
172
|
+
* once it is done, so the answer has the room. From the moment the reader opens or closes it,
|
|
173
|
+
* it stays as they left it. `open` and `defaultOpen` fix it from outside.
|
|
174
|
+
*/
|
|
175
|
+
function TraceSummary({ status = "done", title, meta, open, defaultOpen, onOpenChange, className, children, ...props }) {
|
|
176
|
+
const [chosen, setChosen] = useState(defaultOpen);
|
|
177
|
+
const shown = open ?? chosen ?? status === "running";
|
|
178
|
+
return /* @__PURE__ */ jsxs(Collapsible.Root, {
|
|
179
|
+
"data-slot": "trace-summary",
|
|
180
|
+
"data-status": status,
|
|
181
|
+
"aria-busy": status === "running" || void 0,
|
|
182
|
+
open: shown,
|
|
183
|
+
onOpenChange: (next) => {
|
|
184
|
+
setChosen(next);
|
|
185
|
+
onOpenChange?.(next);
|
|
186
|
+
},
|
|
187
|
+
className: cn("flex flex-col items-start text-control", className),
|
|
188
|
+
...props,
|
|
189
|
+
children: [/* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
190
|
+
"data-slot": "trace-trigger",
|
|
191
|
+
className: trigger,
|
|
192
|
+
children: /* @__PURE__ */ jsx(TraceLine, {
|
|
193
|
+
status,
|
|
194
|
+
title,
|
|
195
|
+
meta,
|
|
196
|
+
opens: true
|
|
197
|
+
})
|
|
198
|
+
}), /* @__PURE__ */ jsx(TraceDetail, { children })]
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
export { Trace, TraceStep, TraceSummary };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { Badge, BadgeProps } from "./components/badge/badge.js";
|
|
|
7
7
|
import { BreadcrumbItem, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbPage, Breadcrumbs, BreadcrumbsProps } from "./components/breadcrumbs/breadcrumbs.js";
|
|
8
8
|
import { Button, ButtonProps } from "./components/button/button.js";
|
|
9
9
|
import { ButtonVariants, buttonVariants } from "./components/button/button-variants.js";
|
|
10
|
+
import { ButtonGroup, ButtonGroupProps } from "./components/button-group/button-group.js";
|
|
10
11
|
import { Calendar, CalendarProps, DateRange } from "./components/calendar/calendar.js";
|
|
11
12
|
import { Callout, CalloutProps, CalloutTone } from "./components/callout/callout.js";
|
|
12
13
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/card/card.js";
|
|
@@ -15,25 +16,30 @@ import { CheckboxGroup, CheckboxGroupItems, CheckboxGroupProps } from "./compone
|
|
|
15
16
|
import { Code } from "./components/code/code.js";
|
|
16
17
|
import { CodeBlock, CodeBlockProps } from "./components/code-block/code-block.js";
|
|
17
18
|
import { CodeBlockLive, CodeBlockLiveProps, CodePiece, CodeRole } from "./components/code-block/code-block-live.js";
|
|
19
|
+
import { CodeKeyOptions } from "./components/code-block/code-keys.js";
|
|
18
20
|
import { CodeTab, CodeTabs, CodeTabsProps } from "./components/code-block/code-tabs.js";
|
|
19
21
|
import { CodeLanguage } from "./components/code-block/highlight.js";
|
|
20
22
|
import { LineSpec } from "./components/code-block/lines.js";
|
|
21
23
|
import { Collapsible, CollapsiblePanel, CollapsiblePanelProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps } from "./components/collapsible/collapsible.js";
|
|
22
24
|
import { Combobox, ComboboxCollection, ComboboxContent, ComboboxContentProps, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxInputProps, ComboboxItem, ComboboxItemProps, ComboboxOption, ComboboxOptionGroup, ComboboxProps, ComboboxSeparator } from "./components/combobox/combobox.js";
|
|
23
25
|
import { Container, ContainerProps, containerVariants } from "./components/container/container.js";
|
|
26
|
+
import { CopyPage, CopyPageProps } from "./components/copy-page/copy-page.js";
|
|
24
27
|
import { CopyPill, CopyPillMark, CopyPillProps } from "./components/copy-pill/copy-pill.js";
|
|
25
28
|
import { Cta, CtaAction, CtaActionProps, CtaActions, CtaMessage, CtaMessageProps, CtaProps, CtaText, CtaTitle, CtaTone } from "./components/cta/cta.js";
|
|
26
29
|
import { DateField, DateFieldProps } from "./components/date-field/date-field.js";
|
|
27
30
|
import { DateRangeField, DateRangeFieldProps } from "./components/date-range-field/date-range-field.js";
|
|
28
31
|
import { Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./components/dialog/dialog.js";
|
|
29
32
|
import { DocsLayout, DocsLayoutAside, DocsLayoutMain, DocsLayoutNav } from "./components/docs-layout/docs-layout.js";
|
|
33
|
+
import { DocsCrumb, DocsGroup, DocsNav, DocsPage, DocsPlace, docsPageState, docsPages, findDocsPage, sameDocsPage } from "./components/docs-layout/docs-nav.js";
|
|
30
34
|
import { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerProps, DrawerSide, DrawerTitle, DrawerTrigger } from "./components/drawer/drawer.js";
|
|
31
35
|
import { Field, FieldDescription, FieldError, FieldLabel } from "./components/field/field.js";
|
|
32
36
|
import { Fieldset, FieldsetLegend } from "./components/fieldset/fieldset.js";
|
|
33
37
|
import { Figure, FigureCaption, FigureFrame } from "./components/figure/figure.js";
|
|
34
38
|
import { Form, FormProps } from "./components/form/form.js";
|
|
35
39
|
import { Ground, GroundName, GroundProps, useGround } from "./components/ground/ground.js";
|
|
40
|
+
import { Grow, GrowProps } from "./components/grow/grow.js";
|
|
36
41
|
import { Heading, HeadingProps } from "./components/heading/heading.js";
|
|
42
|
+
import { HoverCard, HoverCardContent, HoverCardContentProps, HoverCardTrigger, HoverCardTriggerProps } from "./components/hover-card/hover-card.js";
|
|
37
43
|
import { Icon, IconProps, IconSvgElement } from "./components/icon/icon.js";
|
|
38
44
|
import { Input, InputProps } from "./components/input/input.js";
|
|
39
45
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupButtonProps, InputGroupProps } from "./components/input-group/input-group.js";
|
|
@@ -47,7 +53,6 @@ import { Meter, MeterLabel, MeterProps, MeterTrack, MeterValue } from "./compone
|
|
|
47
53
|
import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuLinkDescription, NavigationMenuLinkProps, NavigationMenuLinkTitle, NavigationMenuList, NavigationMenuProps, NavigationMenuTrigger } from "./components/navigation-menu/navigation-menu.js";
|
|
48
54
|
import { NavigationMenuEntryVariants, navigationMenuEntryVariants } from "./components/navigation-menu/navigation-menu-variants.js";
|
|
49
55
|
import { NumberField, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldProps } from "./components/number-field/number-field.js";
|
|
50
|
-
import { PageHeader, PageHeaderActions, PageHeaderLead, PageHeaderProps, PageHeaderTitle, PageHeaderTitleProps } from "./components/page-header/page-header.js";
|
|
51
56
|
import { Pager, PagerLink, PagerLinkProps, PagerProps } from "./components/pager/pager.js";
|
|
52
57
|
import { Parameter, ParameterList, ParameterProps } from "./components/parameter-list/parameter-list.js";
|
|
53
58
|
import { Popover, PopoverClose, PopoverContent, PopoverContentProps, PopoverDescription, PopoverTitle, PopoverTrigger } from "./components/popover/popover.js";
|
|
@@ -56,11 +61,14 @@ import { Prose } from "./components/prose/prose.js";
|
|
|
56
61
|
import { Quote, QuoteProps } from "./components/quote/quote.js";
|
|
57
62
|
import { Radio, RadioGroup, RadioGroupProps, RadioProps } from "./components/radio/radio.js";
|
|
58
63
|
import { ReferenceEntry, ReferenceEntryBody, ReferenceEntryHeader, ReferenceEntryMeta, ReferenceEntryName, ReferenceEntryTitle } from "./components/reference-entry/reference-entry.js";
|
|
64
|
+
import { ScrollFade, ScrollFadeProps } from "./components/scroll-fade/scroll-fade.js";
|
|
65
|
+
import { useScrollEdges } from "./components/scroll-fade/use-scroll-edges.js";
|
|
59
66
|
import { Seam, SeamProps } from "./components/seam/seam.js";
|
|
60
67
|
import { Section, SectionProps } from "./components/section/section.js";
|
|
61
68
|
import { Segment, SegmentProps, SegmentedControl, SegmentedControlProps } from "./components/segmented-control/segmented-control.js";
|
|
62
69
|
import { Select, SelectContent, SelectContentProps, SelectGroup, SelectGroupLabel, SelectItem, SelectItemProps, SelectOption, SelectOptionGroup, SelectProps, SelectSeparator, SelectTrigger, SelectTriggerProps } from "./components/select/select.js";
|
|
63
70
|
import { Separator, SeparatorProps } from "./components/separator/separator.js";
|
|
71
|
+
import { Shimmer, ShimmerProps } from "./components/shimmer/shimmer.js";
|
|
64
72
|
import { SideNav, SideNavGroup, SideNavGroupProps, SideNavLink, SideNavLinkProps, SideNavProps, SideNavSubLink, SideNavSubLinkProps } from "./components/side-nav/side-nav.js";
|
|
65
73
|
import { SiteFooter, SiteFooterBrand, SiteFooterGroup, SiteFooterGroupProps, SiteFooterLegal, SiteFooterLink, SiteFooterMain, SiteFooterNav, siteFooterLinkClass } from "./components/site-footer/site-footer.js";
|
|
66
74
|
import { SiteHeader, SiteHeaderActions, SiteHeaderBrand, SiteHeaderBrandProps, SiteHeaderMenu, SiteHeaderMenuGroup, SiteHeaderMenuGroupProps, SiteHeaderMenuLink, SiteHeaderMenuLinkProps, SiteHeaderMenuProps, SiteHeaderProps } from "./components/site-header/site-header.js";
|
|
@@ -72,9 +80,11 @@ import { TableOfContents, TableOfContentsProps, TocItem } from "./components/tab
|
|
|
72
80
|
import { Tab, Tabs, TabsList, TabsPanel, TabsPanels, TabsPanelsProps, TabsProps } from "./components/tabs/tabs.js";
|
|
73
81
|
import { Text, TextProps } from "./components/text/text.js";
|
|
74
82
|
import { Textarea, TextareaProps } from "./components/textarea/textarea.js";
|
|
83
|
+
import { Theme, ThemeSwitch, ThemeSwitchProps } from "./components/theme-switch/theme-switch.js";
|
|
75
84
|
import { TimeField, TimeFieldProps } from "./components/time-field/time-field.js";
|
|
76
85
|
import { ToastOptions, ToastTone, Toaster, ToasterProps, toast, toastManager } from "./components/toast/toast.js";
|
|
77
86
|
import { Tooltip, TooltipContent, TooltipContentProps, TooltipProvider, TooltipTrigger } from "./components/tooltip/tooltip.js";
|
|
87
|
+
import { Trace, TraceMarks, TraceProps, TraceStatus, TraceStep, TraceStepProps, TraceSummary, TraceSummaryProps } from "./components/trace/trace.js";
|
|
78
88
|
import { cn, mergeClassName } from "./lib/cn.js";
|
|
79
89
|
import { SpringName, springs, transitions } from "./motion/springs.js";
|
|
80
|
-
export { Accordion, AccordionItem, type AccordionItemProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDescription, AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, AnchorHeading, type AnchorHeadingProps, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, BreadcrumbItem, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbPage, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonVariants, Calendar, type CalendarProps, Callout, type CalloutProps, type CalloutTone, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CheckboxGroupItems, type CheckboxGroupProps, type CheckboxProps, Code, CodeBlock, CodeBlockLive, type CodeBlockLiveProps, type CodeBlockProps, type CodeLanguage, type CodePiece, type CodeRole, type CodeTab, CodeTabs, type CodeTabsProps, Collapsible, CollapsiblePanel, type CollapsiblePanelProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Combobox, ComboboxCollection, ComboboxContent, type ComboboxContentProps, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, type ComboboxOption, type ComboboxOptionGroup, type ComboboxProps, ComboboxSeparator, Container, type ContainerProps, CopyPill, CopyPillMark, type CopyPillProps, Cta, CtaAction, type CtaActionProps, CtaActions, CtaMessage, type CtaMessageProps, type CtaProps, CtaText, CtaTitle, type CtaTone, DateField, type DateFieldProps, type DateRange, DateRangeField, type DateRangeFieldProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocsLayout, DocsLayoutAside, DocsLayoutMain, DocsLayoutNav, Drawer, DrawerBody, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, type DrawerProps, type DrawerSide, DrawerTitle, DrawerTrigger, Field, FieldDescription, FieldError, FieldLabel, Fieldset, FieldsetLegend, Figure, FigureCaption, FigureFrame, Form, type FormProps, Ground, type GroundName, type GroundProps, Heading, type HeadingProps, Icon, type IconProps, type IconSvgElement, Input, InputGroup, InputGroupAddon, InputGroupButton, type InputGroupButtonProps, type InputGroupProps, type InputProps, Kbd, type LineSpec, Link, type LinkProps, type LinkVariants, Logomark, type LogomarkProps, Menu, MenuCheckboxItem, MenuContent, type MenuContentProps, MenuGroup, MenuGroupLabel, MenuItem, MenuLinkItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, Meter, MeterLabel, type MeterProps, MeterTrack, MeterValue, NavigationMenu, NavigationMenuContent, type NavigationMenuEntryVariants, NavigationMenuItem, NavigationMenuLink, NavigationMenuLinkDescription, type NavigationMenuLinkProps, NavigationMenuLinkTitle, NavigationMenuList, type NavigationMenuProps, NavigationMenuTrigger, NumberField, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, type NumberFieldProps,
|
|
90
|
+
export { Accordion, AccordionItem, type AccordionItemProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDescription, AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, AnchorHeading, type AnchorHeadingProps, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, BreadcrumbItem, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbPage, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonVariants, Calendar, type CalendarProps, Callout, type CalloutProps, type CalloutTone, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CheckboxGroupItems, type CheckboxGroupProps, type CheckboxProps, Code, CodeBlock, CodeBlockLive, type CodeBlockLiveProps, type CodeBlockProps, type CodeKeyOptions, type CodeLanguage, type CodePiece, type CodeRole, type CodeTab, CodeTabs, type CodeTabsProps, Collapsible, CollapsiblePanel, type CollapsiblePanelProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Combobox, ComboboxCollection, ComboboxContent, type ComboboxContentProps, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, type ComboboxOption, type ComboboxOptionGroup, type ComboboxProps, ComboboxSeparator, Container, type ContainerProps, CopyPage, type CopyPageProps, CopyPill, CopyPillMark, type CopyPillProps, Cta, CtaAction, type CtaActionProps, CtaActions, CtaMessage, type CtaMessageProps, type CtaProps, CtaText, CtaTitle, type CtaTone, DateField, type DateFieldProps, type DateRange, DateRangeField, type DateRangeFieldProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, type DocsCrumb, type DocsGroup, DocsLayout, DocsLayoutAside, DocsLayoutMain, DocsLayoutNav, type DocsNav, type DocsPage, type DocsPlace, Drawer, DrawerBody, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, type DrawerProps, type DrawerSide, DrawerTitle, DrawerTrigger, Field, FieldDescription, FieldError, FieldLabel, Fieldset, FieldsetLegend, Figure, FigureCaption, FigureFrame, Form, type FormProps, Ground, type GroundName, type GroundProps, Grow, type GrowProps, Heading, type HeadingProps, HoverCard, HoverCardContent, type HoverCardContentProps, HoverCardTrigger, type HoverCardTriggerProps, Icon, type IconProps, type IconSvgElement, Input, InputGroup, InputGroupAddon, InputGroupButton, type InputGroupButtonProps, type InputGroupProps, type InputProps, Kbd, type LineSpec, Link, type LinkProps, type LinkVariants, Logomark, type LogomarkProps, Menu, MenuCheckboxItem, MenuContent, type MenuContentProps, MenuGroup, MenuGroupLabel, MenuItem, MenuLinkItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, Meter, MeterLabel, type MeterProps, MeterTrack, MeterValue, NavigationMenu, NavigationMenuContent, type NavigationMenuEntryVariants, NavigationMenuItem, NavigationMenuLink, NavigationMenuLinkDescription, type NavigationMenuLinkProps, NavigationMenuLinkTitle, NavigationMenuList, type NavigationMenuProps, NavigationMenuTrigger, NumberField, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, type NumberFieldProps, Pager, PagerLink, type PagerLinkProps, type PagerProps, Parameter, ParameterList, type ParameterProps, Popover, PopoverClose, PopoverContent, type PopoverContentProps, PopoverDescription, PopoverTitle, PopoverTrigger, Progress, ProgressLabel, type ProgressProps, ProgressTrack, ProgressValue, Prose, Quote, type QuoteProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, ReferenceEntry, ReferenceEntryBody, ReferenceEntryHeader, ReferenceEntryMeta, ReferenceEntryName, ReferenceEntryTitle, ScrollFade, type ScrollFadeProps, Seam, type SeamProps, Section, type SectionProps, Segment, type SegmentProps, SegmentedControl, type SegmentedControlProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectGroupLabel, SelectItem, type SelectItemProps, type SelectOption, type SelectOptionGroup, type SelectProps, SelectSeparator, SelectTrigger, type SelectTriggerProps, Separator, type SeparatorProps, Shimmer, type ShimmerProps, SideNav, SideNavGroup, type SideNavGroupProps, SideNavLink, type SideNavLinkProps, type SideNavProps, SideNavSubLink, type SideNavSubLinkProps, SiteFooter, SiteFooterBrand, SiteFooterGroup, type SiteFooterGroupProps, SiteFooterLegal, SiteFooterLink, SiteFooterMain, SiteFooterNav, SiteHeader, SiteHeaderActions, SiteHeaderBrand, type SiteHeaderBrandProps, SiteHeaderMenu, SiteHeaderMenuGroup, type SiteHeaderMenuGroupProps, SiteHeaderMenuLink, type SiteHeaderMenuLinkProps, type SiteHeaderMenuProps, type SiteHeaderProps, Slider, SliderControl, type SliderControlProps, SliderLabel, type SliderProps, SliderThumb, type SliderThumbProps, SliderValue, Spinner, type SpinnerProps, type SpringName, Switch, type SwitchProps, Tab, Table, TableBody, TableCaption, TableCell, type TableCellProps, TableFooter, TableHead, type TableHeadProps, TableHeader, TableOfContents, type TableOfContentsProps, type TableProps, TableRow, type TableRowProps, TableSortButton, type TableSortButtonProps, Tabs, TabsList, TabsPanel, TabsPanels, type TabsPanelsProps, type TabsProps, Text, type TextProps, Textarea, type TextareaProps, type Theme, ThemeSwitch, type ThemeSwitchProps, TimeField, type TimeFieldProps, type ToastOptions, type ToastTone, Toaster, type ToasterProps, type TocItem, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, Trace, type TraceMarks, type TraceProps, type TraceStatus, TraceStep, type TraceStepProps, TraceSummary, type TraceSummaryProps, Wordmark, type WordmarkProps, buttonVariants, cn, containerVariants, docsPageState, docsPages, findDocsPage, linkVariants, mergeClassName, navigationMenuEntryVariants, sameDocsPage, siteFooterLinkClass, springs, toast, toastManager, transitions, useGround, useScrollEdges };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Badge } from "./components/badge/badge.js";
|
|
|
7
7
|
import { BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, Breadcrumbs } from "./components/breadcrumbs/breadcrumbs.js";
|
|
8
8
|
import { Button } from "./components/button/button.js";
|
|
9
9
|
import { buttonVariants } from "./components/button/button-variants.js";
|
|
10
|
+
import { ButtonGroup } from "./components/button-group/button-group.js";
|
|
10
11
|
import { Calendar } from "./components/calendar/calendar.js";
|
|
11
12
|
import { Callout } from "./components/callout/callout.js";
|
|
12
13
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/card/card.js";
|
|
@@ -19,19 +20,23 @@ import { CodeTabs } from "./components/code-block/code-tabs.js";
|
|
|
19
20
|
import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "./components/collapsible/collapsible.js";
|
|
20
21
|
import { Combobox, ComboboxCollection, ComboboxContent, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxSeparator } from "./components/combobox/combobox.js";
|
|
21
22
|
import { Container, containerVariants } from "./components/container/container.js";
|
|
23
|
+
import { CopyPage } from "./components/copy-page/copy-page.js";
|
|
22
24
|
import { CopyPill, CopyPillMark } from "./components/copy-pill/copy-pill.js";
|
|
23
25
|
import { Cta, CtaAction, CtaActions, CtaMessage, CtaText, CtaTitle } from "./components/cta/cta.js";
|
|
24
26
|
import { DateField } from "./components/date-field/date-field.js";
|
|
25
27
|
import { DateRangeField } from "./components/date-range-field/date-range-field.js";
|
|
26
28
|
import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./components/dialog/dialog.js";
|
|
27
29
|
import { DocsLayout, DocsLayoutAside, DocsLayoutMain, DocsLayoutNav } from "./components/docs-layout/docs-layout.js";
|
|
30
|
+
import { docsPageState, docsPages, findDocsPage, sameDocsPage } from "./components/docs-layout/docs-nav.js";
|
|
28
31
|
import { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "./components/drawer/drawer.js";
|
|
29
32
|
import { Field, FieldDescription, FieldError, FieldLabel } from "./components/field/field.js";
|
|
30
33
|
import { Fieldset, FieldsetLegend } from "./components/fieldset/fieldset.js";
|
|
31
34
|
import { Figure, FigureCaption, FigureFrame } from "./components/figure/figure.js";
|
|
32
35
|
import { Form } from "./components/form/form.js";
|
|
33
36
|
import { Ground, useGround } from "./components/ground/ground.js";
|
|
37
|
+
import { Grow } from "./components/grow/grow.js";
|
|
34
38
|
import { Heading } from "./components/heading/heading.js";
|
|
39
|
+
import { HoverCard, HoverCardContent, HoverCardTrigger } from "./components/hover-card/hover-card.js";
|
|
35
40
|
import { Icon } from "./components/icon/icon.js";
|
|
36
41
|
import { Input } from "./components/input/input.js";
|
|
37
42
|
import { InputGroup, InputGroupAddon, InputGroupButton } from "./components/input-group/input-group.js";
|
|
@@ -45,7 +50,6 @@ import { Meter, MeterLabel, MeterTrack, MeterValue } from "./components/meter/me
|
|
|
45
50
|
import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuLinkDescription, NavigationMenuLinkTitle, NavigationMenuList, NavigationMenuTrigger } from "./components/navigation-menu/navigation-menu.js";
|
|
46
51
|
import { navigationMenuEntryVariants } from "./components/navigation-menu/navigation-menu-variants.js";
|
|
47
52
|
import { NumberField, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput } from "./components/number-field/number-field.js";
|
|
48
|
-
import { PageHeader, PageHeaderActions, PageHeaderLead, PageHeaderTitle } from "./components/page-header/page-header.js";
|
|
49
53
|
import { Pager, PagerLink } from "./components/pager/pager.js";
|
|
50
54
|
import { Parameter, ParameterList } from "./components/parameter-list/parameter-list.js";
|
|
51
55
|
import { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger } from "./components/popover/popover.js";
|
|
@@ -54,11 +58,14 @@ import { Prose } from "./components/prose/prose.js";
|
|
|
54
58
|
import { Quote } from "./components/quote/quote.js";
|
|
55
59
|
import { Radio, RadioGroup } from "./components/radio/radio.js";
|
|
56
60
|
import { ReferenceEntry, ReferenceEntryBody, ReferenceEntryHeader, ReferenceEntryMeta, ReferenceEntryName, ReferenceEntryTitle } from "./components/reference-entry/reference-entry.js";
|
|
61
|
+
import { ScrollFade } from "./components/scroll-fade/scroll-fade.js";
|
|
62
|
+
import { useScrollEdges } from "./components/scroll-fade/use-scroll-edges.js";
|
|
57
63
|
import { Seam } from "./components/seam/seam.js";
|
|
58
64
|
import { Section } from "./components/section/section.js";
|
|
59
65
|
import { Segment, SegmentedControl } from "./components/segmented-control/segmented-control.js";
|
|
60
66
|
import { Select, SelectContent, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger } from "./components/select/select.js";
|
|
61
67
|
import { Separator } from "./components/separator/separator.js";
|
|
68
|
+
import { Shimmer } from "./components/shimmer/shimmer.js";
|
|
62
69
|
import { SideNav, SideNavGroup, SideNavLink, SideNavSubLink } from "./components/side-nav/side-nav.js";
|
|
63
70
|
import { SiteFooter, SiteFooterBrand, SiteFooterGroup, SiteFooterLegal, SiteFooterLink, SiteFooterMain, SiteFooterNav, siteFooterLinkClass } from "./components/site-footer/site-footer.js";
|
|
64
71
|
import { SiteHeader, SiteHeaderActions, SiteHeaderBrand, SiteHeaderMenu, SiteHeaderMenuGroup, SiteHeaderMenuLink } from "./components/site-header/site-header.js";
|
|
@@ -70,9 +77,11 @@ import { TableOfContents } from "./components/table-of-contents/table-of-content
|
|
|
70
77
|
import { Tab, Tabs, TabsList, TabsPanel, TabsPanels } from "./components/tabs/tabs.js";
|
|
71
78
|
import { Text } from "./components/text/text.js";
|
|
72
79
|
import { Textarea } from "./components/textarea/textarea.js";
|
|
80
|
+
import { ThemeSwitch } from "./components/theme-switch/theme-switch.js";
|
|
73
81
|
import { TimeField } from "./components/time-field/time-field.js";
|
|
74
82
|
import { Toaster, toast, toastManager } from "./components/toast/toast.js";
|
|
75
83
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/tooltip/tooltip.js";
|
|
84
|
+
import { Trace, TraceStep, TraceSummary } from "./components/trace/trace.js";
|
|
76
85
|
import { cn, mergeClassName } from "./lib/cn.js";
|
|
77
86
|
import { springs, transitions } from "./motion/springs.js";
|
|
78
|
-
export { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnchorHeading, Avatar, AvatarFallback, AvatarImage, Badge, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, Breadcrumbs, Button, Calendar, Callout, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CheckboxGroupItems, Code, CodeBlock, CodeBlockLive, CodeTabs, Collapsible, CollapsiblePanel, CollapsibleTrigger, Combobox, ComboboxCollection, ComboboxContent, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxSeparator, Container, CopyPill, CopyPillMark, Cta, CtaAction, CtaActions, CtaMessage, CtaText, CtaTitle, DateField, DateRangeField, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocsLayout, DocsLayoutAside, DocsLayoutMain, DocsLayoutNav, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, Field, FieldDescription, FieldError, FieldLabel, Fieldset, FieldsetLegend, Figure, FigureCaption, FigureFrame, Form, Ground, Heading, Icon, Input, InputGroup, InputGroupAddon, InputGroupButton, Kbd, Link, Logomark, Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuLinkItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, Meter, MeterLabel, MeterTrack, MeterValue, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuLinkDescription, NavigationMenuLinkTitle, NavigationMenuList, NavigationMenuTrigger, NumberField, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput,
|
|
87
|
+
export { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnchorHeading, Avatar, AvatarFallback, AvatarImage, Badge, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, Breadcrumbs, Button, ButtonGroup, Calendar, Callout, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CheckboxGroupItems, Code, CodeBlock, CodeBlockLive, CodeTabs, Collapsible, CollapsiblePanel, CollapsibleTrigger, Combobox, ComboboxCollection, ComboboxContent, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxSeparator, Container, CopyPage, CopyPill, CopyPillMark, Cta, CtaAction, CtaActions, CtaMessage, CtaText, CtaTitle, DateField, DateRangeField, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocsLayout, DocsLayoutAside, DocsLayoutMain, DocsLayoutNav, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, Field, FieldDescription, FieldError, FieldLabel, Fieldset, FieldsetLegend, Figure, FigureCaption, FigureFrame, Form, Ground, Grow, Heading, HoverCard, HoverCardContent, HoverCardTrigger, Icon, Input, InputGroup, InputGroupAddon, InputGroupButton, Kbd, Link, Logomark, Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuLinkItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, Meter, MeterLabel, MeterTrack, MeterValue, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuLinkDescription, NavigationMenuLinkTitle, NavigationMenuList, NavigationMenuTrigger, NumberField, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, Pager, PagerLink, Parameter, ParameterList, Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Progress, ProgressLabel, ProgressTrack, ProgressValue, Prose, Quote, Radio, RadioGroup, ReferenceEntry, ReferenceEntryBody, ReferenceEntryHeader, ReferenceEntryMeta, ReferenceEntryName, ReferenceEntryTitle, ScrollFade, Seam, Section, Segment, SegmentedControl, Select, SelectContent, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, Separator, Shimmer, SideNav, SideNavGroup, SideNavLink, SideNavSubLink, SiteFooter, SiteFooterBrand, SiteFooterGroup, SiteFooterLegal, SiteFooterLink, SiteFooterMain, SiteFooterNav, SiteHeader, SiteHeaderActions, SiteHeaderBrand, SiteHeaderMenu, SiteHeaderMenuGroup, SiteHeaderMenuLink, Slider, SliderControl, SliderLabel, SliderThumb, SliderValue, Spinner, Switch, Tab, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, TableSortButton, Tabs, TabsList, TabsPanel, TabsPanels, Text, Textarea, ThemeSwitch, TimeField, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Trace, TraceStep, TraceSummary, Wordmark, buttonVariants, cn, containerVariants, docsPageState, docsPages, findDocsPage, linkVariants, mergeClassName, navigationMenuEntryVariants, sameDocsPage, siteFooterLinkClass, springs, toast, toastManager, transitions, useGround, useScrollEdges };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { mergeRefs } from "../lib/merge-refs.js";
|
|
2
|
+
import { cloneElement, createElement } from "react";
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
// src/internal/render-as.ts
|
|
5
|
+
/**
|
|
6
|
+
* Renders a part as its own element, or as the element its caller hands in as `render`: a
|
|
7
|
+
* router's link in place of an `<a>`. The part's props and the element's own are merged the way
|
|
8
|
+
* Base UI merges them (class names joined, styles and handlers merged, the element's own props
|
|
9
|
+
* winning otherwise).
|
|
10
|
+
*
|
|
11
|
+
* It is what Base UI's `useRender` does, as a plain function. `useRender` is a hook, which makes
|
|
12
|
+
* every part that calls it a client component; a part of plain markup (a link of the `SideNav`,
|
|
13
|
+
* of the `Breadcrumbs`, of the `Pager`) would then travel to the browser for nothing. With this
|
|
14
|
+
* it stays server-safe: no `"use client"`, and no script for a page of documentation.
|
|
15
|
+
*/
|
|
16
|
+
function renderAs(tag, render, props) {
|
|
17
|
+
if (render === void 0) return createElement(tag, props);
|
|
18
|
+
if (typeof render === "function") return render(props, {});
|
|
19
|
+
const own = render.props;
|
|
20
|
+
const merged = mergeProps(props, own);
|
|
21
|
+
if (props.ref && own.ref) merged.ref = mergeRefs(props.ref, own.ref);
|
|
22
|
+
return cloneElement(render, merged);
|
|
23
|
+
}
|
|
24
|
+
export { renderAs };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/internal/rule.ts
|
|
2
|
+
/**
|
|
3
|
+
* The 2px rule that opens a block (`Table`, `Accordion`, `ParameterList`): a straight line with
|
|
4
|
+
* round ends. The box keeps a transparent 2px top border, so it is laid out exactly as with
|
|
5
|
+
* `border-t-2`, and the line is drawn into that border as `::before`. A border cannot round its
|
|
6
|
+
* own ends: with a radius it bends down at the corners instead. Where the rule stands by itself,
|
|
7
|
+
* above a section's title, it is a `Separator` (`variant="rule"`).
|
|
8
|
+
*
|
|
9
|
+
* The box becomes positioned, and must not clip its top edge. Server-safe.
|
|
10
|
+
*/
|
|
11
|
+
const ruleTop = [
|
|
12
|
+
"relative border-t-2 border-t-transparent",
|
|
13
|
+
"before:absolute before:inset-x-0 before:-top-0.5 before:h-0.5 before:rounded-full before:bg-rule",
|
|
14
|
+
"forced-colors:before:bg-[color:CanvasText]"
|
|
15
|
+
].join(" ");
|
|
16
|
+
export { ruleTop };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/lib/merge-refs.ts
|
|
2
|
+
/** One ref callback that fills both a component's own ref and the one its caller passed. */
|
|
3
|
+
function mergeRefs(own, theirs) {
|
|
4
|
+
return (node) => {
|
|
5
|
+
for (const ref of [own, theirs]) if (typeof ref === "function") ref(node);
|
|
6
|
+
else if (ref) ref.current = node;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export { mergeRefs };
|
package/package.json
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The keys of a ButtonGroup: where they meet and how they take the fitting's corners. A group is
|
|
3
|
+
* one fitting (one face, one edge, one shadow, on the group) with several keys in it, so the
|
|
4
|
+
* keys have no edge of their own. What divides two of them is a seam: the fitting's edge drawn
|
|
5
|
+
* once more, in its own colour, from one side of the face to the other.
|
|
6
|
+
*
|
|
7
|
+
* The first and the last key take the fitting's corners, so the wash under the pointer and the
|
|
8
|
+
* shade of a press fill the fitting right up to its edge instead of ending in a square inside
|
|
9
|
+
* it. With the keyboard on it a key rounds all four corners (button-group-variants.ts), so its
|
|
10
|
+
* ring closes around that key alone.
|
|
11
|
+
*
|
|
12
|
+
* A key is whatever carries `data-group-key` (a `Button` or a `SelectTrigger` inside a group),
|
|
13
|
+
* and it must be a child of the fitting: the corners are inherited from it.
|
|
14
|
+
*/
|
|
15
|
+
@layer components {
|
|
16
|
+
[data-group-key] {
|
|
17
|
+
border: 0 solid var(--d-edge, var(--depth-surface-edge));
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* In a row. */
|
|
22
|
+
:not([data-orientation="vertical"]) > [data-group-key] {
|
|
23
|
+
&:is([data-group-key] ~ *) {
|
|
24
|
+
border-inline-start-width: 1px;
|
|
25
|
+
}
|
|
26
|
+
&:not([data-group-key] ~ *) {
|
|
27
|
+
border-start-start-radius: inherit;
|
|
28
|
+
border-end-start-radius: inherit;
|
|
29
|
+
}
|
|
30
|
+
&:not(:has(~ [data-group-key])) {
|
|
31
|
+
border-start-end-radius: inherit;
|
|
32
|
+
border-end-end-radius: inherit;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* One over the other. */
|
|
37
|
+
[data-orientation="vertical"] > [data-group-key] {
|
|
38
|
+
&:is([data-group-key] ~ *) {
|
|
39
|
+
border-block-start-width: 1px;
|
|
40
|
+
}
|
|
41
|
+
&:not([data-group-key] ~ *) {
|
|
42
|
+
border-start-start-radius: inherit;
|
|
43
|
+
border-start-end-radius: inherit;
|
|
44
|
+
}
|
|
45
|
+
&:not(:has(~ [data-group-key])) {
|
|
46
|
+
border-end-start-radius: inherit;
|
|
47
|
+
border-end-end-radius: inherit;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Forced colours drop the face and the washes: the seams stay as lines. */
|
|
52
|
+
@media (forced-colors: active) {
|
|
53
|
+
[data-group-key] {
|
|
54
|
+
border-color: ButtonBorder;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/styles/code.css
CHANGED
|
@@ -109,24 +109,8 @@
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
/*
|
|
112
|
-
* The
|
|
113
|
-
*
|
|
114
|
-
* `data-overflow` (code-block-frame.tsx).
|
|
115
|
-
*/
|
|
116
|
-
@property --code-fade-start {
|
|
117
|
-
syntax: "<length>";
|
|
118
|
-
inherits: false;
|
|
119
|
-
initial-value: 0px;
|
|
120
|
-
}
|
|
121
|
-
@property --code-fade-end {
|
|
122
|
-
syntax: "<length>";
|
|
123
|
-
inherits: false;
|
|
124
|
-
initial-value: 0px;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/*
|
|
128
|
-
* The parts of a block that Tailwind classes cannot say well: counters, generated signs and the
|
|
129
|
-
* mask. Measures come from the block (code-block-frame.tsx):
|
|
112
|
+
* The parts of a block that Tailwind classes cannot say well: counters and generated signs.
|
|
113
|
+
* Measures come from the block (code-block-frame.tsx):
|
|
130
114
|
* --code-pad-x the inset of the code from the block's edge
|
|
131
115
|
* --code-gutter the room before the code: line numbers and the sign of a change
|
|
132
116
|
* --code-digits the width of the widest line number
|
|
@@ -142,11 +126,19 @@
|
|
|
142
126
|
font-variant-ligatures: none;
|
|
143
127
|
tab-size: 2;
|
|
144
128
|
}
|
|
145
|
-
|
|
129
|
+
/* Long lines break: because the code was rendered so, or because the wrap key of the block is on. */
|
|
130
|
+
[data-slot="code-block-code"][data-wrap],
|
|
131
|
+
[data-wrap="on"] [data-slot="code-block-code"] {
|
|
146
132
|
width: auto;
|
|
147
133
|
white-space: pre-wrap;
|
|
148
134
|
overflow-wrap: anywhere;
|
|
149
135
|
}
|
|
136
|
+
/* The key is off: lines run on and scroll, whatever the code was rendered with. */
|
|
137
|
+
[data-wrap="off"] [data-slot="code-block-code"] {
|
|
138
|
+
width: max-content;
|
|
139
|
+
white-space: pre;
|
|
140
|
+
overflow-wrap: normal;
|
|
141
|
+
}
|
|
150
142
|
|
|
151
143
|
[data-slot="code-block-line"] {
|
|
152
144
|
position: relative;
|
|
@@ -195,58 +187,12 @@
|
|
|
195
187
|
color: var(--lf-danger);
|
|
196
188
|
}
|
|
197
189
|
|
|
198
|
-
/* The edges fade where more code waits to the side
|
|
199
|
-
|
|
190
|
+
/* The edges fade where more code waits to the side (scroll-fade.css). The focus outline is
|
|
191
|
+
drawn by the block around it, since the mask would cut it off. */
|
|
200
192
|
[data-slot="code-block-scroll"] {
|
|
201
|
-
mask-image: linear-gradient(
|
|
202
|
-
to right,
|
|
203
|
-
transparent,
|
|
204
|
-
#000 var(--code-fade-start),
|
|
205
|
-
#000 calc(100% - var(--code-fade-end)),
|
|
206
|
-
transparent
|
|
207
|
-
);
|
|
208
|
-
transition:
|
|
209
|
-
--code-fade-start var(--transition-duration-spring-settle) var(--ease-spring-settle),
|
|
210
|
-
--code-fade-end var(--transition-duration-spring-settle) var(--ease-spring-settle);
|
|
211
193
|
scrollbar-width: thin;
|
|
212
194
|
scrollbar-color: var(--lf-line) transparent;
|
|
213
195
|
}
|
|
214
|
-
[data-slot="code-block-scroll"][data-overflow~="start"] {
|
|
215
|
-
--code-fade-start: 2.5rem;
|
|
216
|
-
}
|
|
217
|
-
[data-slot="code-block-scroll"][data-overflow~="end"] {
|
|
218
|
-
--code-fade-end: 2.5rem;
|
|
219
|
-
}
|
|
220
196
|
|
|
221
|
-
/*
|
|
222
|
-
* Copy: the copy symbol shrinks away and a tick is drawn in its place, short leg first, as in
|
|
223
|
-
* a checkbox. When the moment has passed the tick fades where it is (it is not undrawn) and the
|
|
224
|
-
* copy symbol seats back with a little bounce.
|
|
225
|
-
*/
|
|
226
|
-
[data-slot="code-copy-symbol"] {
|
|
227
|
-
transition-property: scale, opacity;
|
|
228
|
-
transition-duration: var(--transition-duration-spring-seat);
|
|
229
|
-
transition-timing-function: var(--ease-spring-seat);
|
|
230
|
-
}
|
|
231
|
-
[data-copied] > [data-slot="code-copy-symbol"] {
|
|
232
|
-
scale: 0.5;
|
|
233
|
-
opacity: 0;
|
|
234
|
-
transition-duration: var(--transition-duration-spring-leave);
|
|
235
|
-
transition-timing-function: var(--ease-spring-leave);
|
|
236
|
-
}
|
|
237
|
-
[data-slot="code-copy-tick"] {
|
|
238
|
-
stroke-dasharray: 1;
|
|
239
|
-
stroke-dashoffset: 1;
|
|
240
|
-
opacity: 0;
|
|
241
|
-
transition:
|
|
242
|
-
opacity var(--transition-duration-spring-leave) var(--ease-spring-leave),
|
|
243
|
-
stroke-dashoffset 0s var(--transition-duration-spring-leave);
|
|
244
|
-
}
|
|
245
|
-
[data-copied] > [data-slot="code-copy-tick"] {
|
|
246
|
-
stroke-dashoffset: 0;
|
|
247
|
-
opacity: 1;
|
|
248
|
-
transition:
|
|
249
|
-
opacity 60ms linear 60ms,
|
|
250
|
-
stroke-dashoffset 220ms cubic-bezier(0.3, 0, 0.2, 1) 60ms;
|
|
251
|
-
}
|
|
197
|
+
/* The copy key's confirmation is shared with every control that copies: see copy.css. */
|
|
252
198
|
}
|