@stll/ui 0.0.1-placeholder.0 → 0.3.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/README.md +84 -0
- package/dist/components/accordion.d.ts +8 -0
- package/dist/components/accordion.js +38 -0
- package/dist/components/alert-dialog.d.ts +32 -0
- package/dist/components/alert-dialog.js +75 -0
- package/dist/components/avatar.d.ts +7 -0
- package/dist/components/avatar.js +22 -0
- package/dist/components/bidi-text.d.ts +24 -0
- package/dist/components/bidi-text.js +38 -0
- package/dist/components/brand-icons.d.ts +7 -0
- package/dist/components/brand-icons.js +18 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +61 -0
- package/dist/components/button-variants.d.ts +17 -0
- package/dist/components/button-variants.js +43 -0
- package/dist/components/button.d.ts +20 -0
- package/dist/components/button.js +53 -0
- package/dist/components/checkbox.d.ts +5 -0
- package/dist/components/checkbox.js +44 -0
- package/dist/components/color-picker.d.ts +47 -0
- package/dist/components/color-picker.js +249 -0
- package/dist/components/combobox.d.ts +40 -0
- package/dist/components/combobox.js +208 -0
- package/dist/components/command.d.ts +34 -0
- package/dist/components/command.js +100 -0
- package/dist/components/date-picker-popover.d.ts +29 -0
- package/dist/components/date-picker-popover.js +548 -0
- package/dist/components/date-picker-popover.logic.d.ts +14 -0
- package/dist/components/date-picker-popover.logic.js +26 -0
- package/dist/components/destructive-action-confirmation.d.ts +21 -0
- package/dist/components/destructive-action-confirmation.js +60 -0
- package/dist/components/destructive-confirm-dialog.d.ts +17 -0
- package/dist/components/destructive-confirm-dialog.js +49 -0
- package/dist/components/dialog.d.ts +37 -0
- package/dist/components/dialog.js +92 -0
- package/dist/components/directional-icon.d.ts +30 -0
- package/dist/components/directional-icon.js +12 -0
- package/dist/components/field.d.ts +11 -0
- package/dist/components/field.js +34 -0
- package/dist/components/form.d.ts +5 -0
- package/dist/components/form.js +12 -0
- package/dist/components/frame.d.ts +10 -0
- package/dist/components/frame.js +35 -0
- package/dist/components/hex-color-picker.d.ts +11 -0
- package/dist/components/hex-color-picker.js +366 -0
- package/dist/components/input-group.d.ts +15 -0
- package/dist/components/input-group.js +53 -0
- package/dist/components/input-otp.d.ts +13 -0
- package/dist/components/input-otp.js +39 -0
- package/dist/components/input.d.ts +12 -0
- package/dist/components/input.js +46 -0
- package/dist/components/label.d.ts +5 -0
- package/dist/components/label.js +18 -0
- package/dist/components/menu.d.ts +44 -0
- package/dist/components/menu.js +152 -0
- package/dist/components/outline-rail.d.ts +43 -0
- package/dist/components/outline-rail.js +416 -0
- package/dist/components/pagination.d.ts +17 -0
- package/dist/components/pagination.js +78 -0
- package/dist/components/popover.d.ts +34 -0
- package/dist/components/popover.js +67 -0
- package/dist/components/preview-card.d.ts +12 -0
- package/dist/components/preview-card.js +25 -0
- package/dist/components/preview-pane.d.ts +23 -0
- package/dist/components/preview-pane.js +33 -0
- package/dist/components/scroll-area.d.ts +19 -0
- package/dist/components/scroll-area.js +38 -0
- package/dist/components/scroll-to-top.d.ts +12 -0
- package/dist/components/scroll-to-top.js +43 -0
- package/dist/components/secret-input.d.ts +9 -0
- package/dist/components/secret-input.js +38 -0
- package/dist/components/segmented-icon-toggle.d.ts +22 -0
- package/dist/components/segmented-icon-toggle.js +30 -0
- package/dist/components/select.d.ts +25 -0
- package/dist/components/select.js +196 -0
- package/dist/components/separator.d.ts +16 -0
- package/dist/components/separator.js +26 -0
- package/dist/components/sheet.d.ts +29 -0
- package/dist/components/sheet.js +87 -0
- package/dist/components/skeleton.d.ts +4 -0
- package/dist/components/skeleton.js +10 -0
- package/dist/components/stella-mark.d.ts +5 -0
- package/dist/components/stella-mark.js +12 -0
- package/dist/components/stella-wordmark.d.ts +5 -0
- package/dist/components/stella-wordmark.js +21 -0
- package/dist/components/table.d.ts +20 -0
- package/dist/components/table.js +80 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +46 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +31 -0
- package/dist/components/toast.d.ts +60 -0
- package/dist/components/toast.js +261 -0
- package/dist/components/tooltip-trigger-helper.d.ts +11 -0
- package/dist/components/tooltip-trigger-helper.js +14 -0
- package/dist/components/tooltip.d.ts +15 -0
- package/dist/components/tooltip.js +32 -0
- package/dist/data-table/index.d.ts +2 -0
- package/dist/data-table/index.js +2 -0
- package/dist/data-table/schema.d.ts +70 -0
- package/dist/data-table/schema.js +40 -0
- package/dist/hooks/use-contained-handler.d.ts +55 -0
- package/dist/hooks/use-contained-handler.js +54 -0
- package/dist/hooks/use-content-dir.d.ts +48 -0
- package/dist/hooks/use-content-dir.js +45 -0
- package/dist/hooks/use-mobile.d.ts +4 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-viewport-width.d.ts +5 -0
- package/dist/hooks/use-viewport-width.js +14 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +65 -0
- package/dist/inspector/chrome.d.ts +72 -0
- package/dist/inspector/chrome.js +153 -0
- package/dist/inspector/dock.d.ts +48 -0
- package/dist/inspector/dock.js +36 -0
- package/dist/inspector/index.d.ts +6 -0
- package/dist/inspector/index.js +6 -0
- package/dist/inspector/layout-tokens.d.ts +28 -0
- package/dist/inspector/layout-tokens.js +28 -0
- package/dist/inspector/pane-width.d.ts +64 -0
- package/dist/inspector/pane-width.js +53 -0
- package/dist/inspector/use-pane-width.d.ts +99 -0
- package/dist/inspector/use-pane-width.js +149 -0
- package/dist/kanban/card-properties.d.ts +27 -0
- package/dist/kanban/card-properties.js +19 -0
- package/dist/kanban/card-shell.d.ts +32 -0
- package/dist/kanban/card-shell.js +46 -0
- package/dist/kanban/column-header.d.ts +23 -0
- package/dist/kanban/column-header.js +24 -0
- package/dist/kanban/grouping.d.ts +84 -0
- package/dist/kanban/grouping.js +76 -0
- package/dist/kanban/index.d.ts +5 -0
- package/dist/kanban/index.js +5 -0
- package/dist/lib/button-disposition.d.ts +63 -0
- package/dist/lib/button-disposition.js +52 -0
- package/dist/lib/option-color.d.ts +28 -0
- package/dist/lib/option-color.js +59 -0
- package/dist/lib/overlay-layer.d.ts +22 -0
- package/dist/lib/overlay-layer.js +21 -0
- package/dist/lib/tab-order.d.ts +15 -0
- package/dist/lib/tab-order.js +15 -0
- package/dist/lib/tooltip-content.d.ts +13 -0
- package/dist/lib/tooltip-content.js +12 -0
- package/dist/lib/utils.d.ts +20 -0
- package/dist/lib/utils.js +41 -0
- package/dist/lib/week.d.ts +25 -0
- package/dist/lib/week.js +40 -0
- package/dist/styles/theme.css +1209 -0
- package/package.json +518 -2
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# @stll/ui
|
|
2
|
+
|
|
3
|
+
Stella's design system: the React primitives the product surfaces are built
|
|
4
|
+
from, the dockable inspector pane, and the Tailwind v4 theme they are styled
|
|
5
|
+
with.
|
|
6
|
+
|
|
7
|
+
The package is self-contained by construction. It imports no application
|
|
8
|
+
module, no path alias, and no other workspace package, so every component can
|
|
9
|
+
be rendered and tested without a surrounding application — and a change to one
|
|
10
|
+
cannot reach into product code by accident. Lint enforces that boundary; the
|
|
11
|
+
export map below is what "part of the design system" means.
|
|
12
|
+
|
|
13
|
+
Peer dependencies: `react`, `react-dom`, `@base-ui/react`, `tailwindcss` (v4).
|
|
14
|
+
|
|
15
|
+
## Import
|
|
16
|
+
|
|
17
|
+
Every module has its own subpath, and the package declares `sideEffects: false`,
|
|
18
|
+
so a bundler keeps only what is imported:
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { Button } from "@stll/ui/button";
|
|
22
|
+
import { Dialog, DialogPopup } from "@stll/ui/dialog";
|
|
23
|
+
import { Inspector, InspectorDock } from "@stll/ui/inspector";
|
|
24
|
+
import { cn } from "@stll/ui/utils";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
One flat subpath per module: `@stll/ui/<name>` for components, hooks, and
|
|
28
|
+
helpers alike. `@stll/ui` re-exports all of them under one specifier for
|
|
29
|
+
convenience; the subpaths are the real surface, and in-repo code uses those.
|
|
30
|
+
|
|
31
|
+
### Deprecated grouped subpaths
|
|
32
|
+
|
|
33
|
+
`@stll/ui/components/<name>`, `@stll/ui/hooks/<name>`, and
|
|
34
|
+
`@stll/ui/lib/<name>` still resolve to the same modules and are kept for one
|
|
35
|
+
minor. They will be removed after that; the export guard checks that both
|
|
36
|
+
spellings land on the same module for as long as they both exist.
|
|
37
|
+
|
|
38
|
+
## Styles
|
|
39
|
+
|
|
40
|
+
No compiled CSS ships. The components carry Tailwind class names, so the
|
|
41
|
+
Tailwind build stays with the application that uses them:
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
@import "tailwindcss";
|
|
45
|
+
@import "@stll/ui/theme.css";
|
|
46
|
+
@source "../node_modules/@stll/ui/dist";
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`theme.css` carries the `@theme` token map, the palettes, the base layer, and
|
|
50
|
+
the custom utilities. The `@source` line is what makes Tailwind scan the
|
|
51
|
+
shipped components for the utilities they use — node_modules is outside its
|
|
52
|
+
default source detection.
|
|
53
|
+
|
|
54
|
+
`theme.css` is the only stylesheet the package exports. Each application owns
|
|
55
|
+
its own Tailwind entry (`apps/web/src/styles/app.css`,
|
|
56
|
+
`apps/desktop/src/mainview/index.css`, `apps/playground/src/styles.css`), which
|
|
57
|
+
is where the source globs for that application belong.
|
|
58
|
+
|
|
59
|
+
## Layout direction
|
|
60
|
+
|
|
61
|
+
The components are bidirectional. Use logical properties (`ms-*`, `pe-*`,
|
|
62
|
+
`start-*`) rather than physical ones, and let the slots that render
|
|
63
|
+
caller-supplied values (names, identifiers, filenames) keep their `dir="auto"`
|
|
64
|
+
and bidi isolation.
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
bun run build # tsdown, one output module per source module, with .d.ts
|
|
70
|
+
bun run test # bun test src
|
|
71
|
+
bun run typecheck
|
|
72
|
+
bun run lint
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`bun scripts/check-published-exports.ts packages/ui` (from the repository root)
|
|
76
|
+
runs the publish path end to end: build, `prepare-publish`, `bun pm pack`, then
|
|
77
|
+
resolves and imports every declared subpath from the built `dist`.
|
|
78
|
+
|
|
79
|
+
This package is published, so a change here needs a changeset:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
bun changeset # anything a consumer of the package can observe
|
|
83
|
+
bun changeset --empty # internal refactor, no change to the public surface
|
|
84
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
2
|
+
//#region src/components/accordion.d.ts
|
|
3
|
+
declare const Accordion: <Value = unknown>(props: Accordion$1.Root.Props<Value>) => import("react").JSX.Element;
|
|
4
|
+
declare const AccordionItem: ({ className, ...props }: Accordion$1.Item.Props) => import("react").JSX.Element;
|
|
5
|
+
declare const AccordionTrigger: ({ className, children, ...props }: Accordion$1.Trigger.Props) => import("react").JSX.Element;
|
|
6
|
+
declare const AccordionPanel: ({ className, children, ...props }: Accordion$1.Panel.Props) => import("react").JSX.Element;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
4
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/accordion.tsx
|
|
7
|
+
const Accordion = (props) => /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
8
|
+
"data-slot": "accordion",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
const AccordionItem = ({ className, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
12
|
+
className: cn("border-b last:border-b-0", className),
|
|
13
|
+
"data-slot": "accordion-item",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
const AccordionTrigger = ({ className, children, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Header, {
|
|
17
|
+
className: "flex",
|
|
18
|
+
children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
|
|
19
|
+
className: cn("focus-visible:ring-ring flex flex-1 cursor-pointer items-start justify-between gap-4 rounded-md py-4 text-start text-sm font-medium outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-64 data-panel-open:*:data-[slot=accordion-indicator]:rotate-180", className),
|
|
20
|
+
"data-slot": "accordion-trigger",
|
|
21
|
+
...props,
|
|
22
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
23
|
+
className: "pointer-events-none size-4 shrink-0 translate-y-0.5 opacity-80 transition-transform duration-200 ease-in-out",
|
|
24
|
+
"data-slot": "accordion-indicator"
|
|
25
|
+
})]
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
const AccordionPanel = ({ className, children, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Panel, {
|
|
29
|
+
className: "text-muted-foreground h-(--accordion-panel-height) overflow-hidden text-sm transition-[height] duration-200 ease-in-out data-ending-style:h-0 data-starting-style:h-0",
|
|
30
|
+
"data-slot": "accordion-panel",
|
|
31
|
+
...props,
|
|
32
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: cn("pt-0 pb-4", className),
|
|
34
|
+
children
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { OverlayLayer } from "../lib/overlay-layer.js";
|
|
2
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
//#region src/components/alert-dialog.d.ts
|
|
5
|
+
declare const AlertDialogCreateHandle: typeof AlertDialog$1.createHandle;
|
|
6
|
+
declare const AlertDialog: typeof AlertDialog$1.Root;
|
|
7
|
+
declare const AlertDialogPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare function AlertDialogTrigger({ tooltip, ...props }: AlertDialog$1.Trigger.Props & {
|
|
9
|
+
tooltip?: React$1.ReactNode;
|
|
10
|
+
}): React$1.JSX.Element;
|
|
11
|
+
declare const AlertDialogBackdrop: ({ className, layer, ...props }: AlertDialog$1.Backdrop.Props & {
|
|
12
|
+
layer?: OverlayLayer;
|
|
13
|
+
}) => React$1.JSX.Element;
|
|
14
|
+
declare const AlertDialogViewport: ({ className, layer, ...props }: AlertDialog$1.Viewport.Props & {
|
|
15
|
+
layer?: OverlayLayer;
|
|
16
|
+
}) => React$1.JSX.Element;
|
|
17
|
+
declare const AlertDialogPopup: ({ className, bottomStickOnMobile, layer, ...props }: AlertDialog$1.Popup.Props & {
|
|
18
|
+
bottomStickOnMobile?: boolean;
|
|
19
|
+
layer?: OverlayLayer;
|
|
20
|
+
}) => React$1.JSX.Element;
|
|
21
|
+
declare const AlertDialogHeader: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
22
|
+
declare const AlertDialogFooter: ({ className, variant, ...props }: React$1.ComponentProps<"div"> & {
|
|
23
|
+
variant?: "default" | "bare";
|
|
24
|
+
}) => React$1.JSX.Element;
|
|
25
|
+
declare const AlertDialogPanel: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
26
|
+
declare const AlertDialogTitle: ({ className, ...props }: AlertDialog$1.Title.Props) => React$1.JSX.Element;
|
|
27
|
+
declare const AlertDialogDescription: ({ className, ...props }: AlertDialog$1.Description.Props) => React$1.JSX.Element;
|
|
28
|
+
declare function AlertDialogClose({ tooltip, ...props }: AlertDialog$1.Close.Props & {
|
|
29
|
+
tooltip?: React$1.ReactNode;
|
|
30
|
+
}): React$1.JSX.Element;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { OVERLAY_LAYER_CLASS_NAMES } from "../lib/overlay-layer.js";
|
|
4
|
+
import { renderTooltipTrigger } from "./tooltip-trigger-helper.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
7
|
+
//#region src/components/alert-dialog.tsx
|
|
8
|
+
const AlertDialogCreateHandle = AlertDialog$1.createHandle;
|
|
9
|
+
const AlertDialog = AlertDialog$1.Root;
|
|
10
|
+
const AlertDialogPortal = AlertDialog$1.Portal;
|
|
11
|
+
function AlertDialogTrigger({ tooltip, ...props }) {
|
|
12
|
+
return renderTooltipTrigger({
|
|
13
|
+
tooltip: tooltip ?? props["aria-label"] ?? props.title,
|
|
14
|
+
trigger: /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
|
|
15
|
+
"data-slot": "alert-dialog-trigger",
|
|
16
|
+
nativeButton: false,
|
|
17
|
+
...props
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const AlertDialogBackdrop = ({ className, layer = "default", ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Backdrop, {
|
|
22
|
+
className: cn("fixed inset-0 bg-black/32 backdrop-blur-sm transition-opacity duration-200 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0", OVERLAY_LAYER_CLASS_NAMES[layer], className),
|
|
23
|
+
"data-slot": "alert-dialog-backdrop",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
const AlertDialogViewport = ({ className, layer = "default", ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Viewport, {
|
|
27
|
+
className: cn("fixed inset-0 grid grid-rows-[1fr_auto_3fr] justify-items-center p-4", OVERLAY_LAYER_CLASS_NAMES[layer], className),
|
|
28
|
+
"data-slot": "alert-dialog-viewport",
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
const AlertDialogPopup = ({ className, bottomStickOnMobile = true, layer = "default", ...props }) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogBackdrop, { layer }), /* @__PURE__ */ jsx(AlertDialogViewport, {
|
|
32
|
+
className: cn(bottomStickOnMobile && "max-sm:grid-rows-[1fr_auto] max-sm:p-0 max-sm:pt-12"),
|
|
33
|
+
layer,
|
|
34
|
+
children: /* @__PURE__ */ jsx(AlertDialog$1.Popup, {
|
|
35
|
+
className: cn("bg-popover text-popover-foreground relative row-start-2 flex max-h-full min-h-0 w-full max-w-lg min-w-0 -translate-y-[calc(1.25rem*var(--nested-dialogs))] scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg/5 transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-ending-style:opacity-0 data-nested:data-ending-style:translate-y-8 data-nested-dialog-open:origin-top data-starting-style:scale-98 data-starting-style:opacity-0 data-nested:data-starting-style:translate-y-8 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", bottomStickOnMobile && "max-sm:max-w-none max-sm:rounded-none max-sm:border-x-0 max-sm:border-t max-sm:border-b-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:before:hidden max-sm:before:rounded-none max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4", className),
|
|
36
|
+
"data-slot": "alert-dialog-popup",
|
|
37
|
+
...props
|
|
38
|
+
})
|
|
39
|
+
})] });
|
|
40
|
+
const AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
41
|
+
className: cn("flex flex-col gap-2 p-6 text-center in-[[data-slot=alert-dialog-popup]:has([data-slot=alert-dialog-panel])]:pb-3 max-sm:pb-4 sm:text-start", className),
|
|
42
|
+
"data-slot": "alert-dialog-header",
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
const AlertDialogFooter = ({ className, variant = "default", ...props }) => /* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: cn("flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]", variant === "default" && "bg-muted/72 border-t py-4", variant === "bare" && "pb-6", className),
|
|
47
|
+
"data-slot": "alert-dialog-footer",
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
const AlertDialogPanel = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: cn("px-6 pt-1 pb-6 in-[[data-slot=alert-dialog-popup]:has([data-slot=alert-dialog-footer])]:pb-4", className),
|
|
52
|
+
"data-slot": "alert-dialog-panel",
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
const AlertDialogTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Title, {
|
|
56
|
+
className: cn("font-heading text-xl leading-none font-semibold", className),
|
|
57
|
+
"data-slot": "alert-dialog-title",
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
const AlertDialogDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(AlertDialog$1.Description, {
|
|
61
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
62
|
+
"data-slot": "alert-dialog-description",
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
function AlertDialogClose({ tooltip, ...props }) {
|
|
66
|
+
return renderTooltipTrigger({
|
|
67
|
+
tooltip: tooltip ?? props["aria-label"] ?? props.title,
|
|
68
|
+
trigger: /* @__PURE__ */ jsx(AlertDialog$1.Close, {
|
|
69
|
+
"data-slot": "alert-dialog-close",
|
|
70
|
+
...props
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
2
|
+
//#region src/components/avatar.d.ts
|
|
3
|
+
declare const Avatar: ({ className, ...props }: Avatar$1.Root.Props) => import("react").JSX.Element;
|
|
4
|
+
declare const AvatarImage: ({ className, ...props }: Avatar$1.Image.Props) => import("react").JSX.Element;
|
|
5
|
+
declare const AvatarFallback: ({ className, ...props }: Avatar$1.Fallback.Props) => import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
5
|
+
//#region src/components/avatar.tsx
|
|
6
|
+
const Avatar = ({ className, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
7
|
+
className: cn("bg-background inline-flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full align-middle text-xs font-medium select-none", className),
|
|
8
|
+
"data-slot": "avatar",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
const AvatarImage = ({ className, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Image, {
|
|
12
|
+
className: cn("size-full object-cover", className),
|
|
13
|
+
"data-slot": "avatar-image",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
const AvatarFallback = ({ className, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Fallback, {
|
|
17
|
+
className: cn("bg-muted flex size-full items-center justify-center rounded-full", className),
|
|
18
|
+
"data-slot": "avatar-fallback",
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/bidi-text.d.ts
|
|
3
|
+
declare const BidiText: (props: BidiTextProps) => React$1.JSX.Element;
|
|
4
|
+
declare const UserText: (props: BidiTextProps) => React$1.JSX.Element;
|
|
5
|
+
type BidiDirection = "auto" | "ltr" | "rtl";
|
|
6
|
+
type BdiElementProps = Omit<React$1.ComponentPropsWithoutRef<"bdi">, "dir"> & {
|
|
7
|
+
as?: "bdi";
|
|
8
|
+
direction?: BidiDirection;
|
|
9
|
+
};
|
|
10
|
+
type SpanTextProps = Omit<React$1.ComponentPropsWithoutRef<"span">, "dir"> & {
|
|
11
|
+
as: "span";
|
|
12
|
+
direction?: BidiDirection;
|
|
13
|
+
};
|
|
14
|
+
type DivTextProps = Omit<React$1.ComponentPropsWithoutRef<"div">, "dir"> & {
|
|
15
|
+
as: "div";
|
|
16
|
+
direction?: BidiDirection;
|
|
17
|
+
};
|
|
18
|
+
type ParagraphTextProps = Omit<React$1.ComponentPropsWithoutRef<"p">, "dir"> & {
|
|
19
|
+
as: "p";
|
|
20
|
+
direction?: BidiDirection;
|
|
21
|
+
};
|
|
22
|
+
type BidiTextProps = BdiElementProps | SpanTextProps | DivTextProps | ParagraphTextProps;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { type BidiDirection, BidiText, type BidiTextProps, UserText };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/bidi-text.tsx
|
|
5
|
+
const BidiText = (props) => {
|
|
6
|
+
if (props.as === "span") {
|
|
7
|
+
const { as: _as, className, direction = "auto", ...rest } = props;
|
|
8
|
+
return /* @__PURE__ */ jsx("span", {
|
|
9
|
+
className: cn("[unicode-bidi:isolate]", className),
|
|
10
|
+
dir: direction,
|
|
11
|
+
...rest
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
if (props.as === "div") {
|
|
15
|
+
const { as: _as, className, direction = "auto", ...rest } = props;
|
|
16
|
+
return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: cn("[unicode-bidi:isolate]", className),
|
|
18
|
+
dir: direction,
|
|
19
|
+
...rest
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (props.as === "p") {
|
|
23
|
+
const { as: _as, className, direction = "auto", ...rest } = props;
|
|
24
|
+
return /* @__PURE__ */ jsx("p", {
|
|
25
|
+
className: cn("[unicode-bidi:isolate]", className),
|
|
26
|
+
dir: direction,
|
|
27
|
+
...rest
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const { as: _as, direction = "auto", ...rest } = props;
|
|
31
|
+
return /* @__PURE__ */ jsx("bdi", {
|
|
32
|
+
dir: direction,
|
|
33
|
+
...rest
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const UserText = BidiText;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { BidiText, UserText };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/brand-icons.d.ts
|
|
3
|
+
type BrandIconProps = React$1.ComponentProps<"svg">;
|
|
4
|
+
declare const DiscordLogoIcon: (props: BrandIconProps) => React$1.JSX.Element;
|
|
5
|
+
declare const GitHubLogoIcon: (props: BrandIconProps) => React$1.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { DiscordLogoIcon, GitHubLogoIcon };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/brand-icons.tsx
|
|
3
|
+
const DiscordLogoIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
4
|
+
"aria-hidden": "true",
|
|
5
|
+
fill: "currentColor",
|
|
6
|
+
viewBox: "0 0 126.644 96",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", { d: "M81.15,0c-1.2376,2.1973-2.3489,4.4704-3.3591,6.794-9.5975-1.4396-19.3718-1.4396-28.9945,0-.985-2.3236-2.1216-4.5967-3.3591-6.794-9.0166,1.5407-17.8059,4.2431-26.1405,8.0568C2.779,32.5304-1.6914,56.3725.5312,79.8863c9.6732,7.1476,20.5083,12.603,32.0505,16.0884,2.6014-3.4854,4.8998-7.1981,6.8698-11.0623-3.738-1.3891-7.3497-3.1318-10.8098-5.1523.9092-.6567,1.7932-1.3386,2.6519-1.9953,20.281,9.547,43.7696,9.547,64.0758,0,.8587.7072,1.7427,1.3891,2.6519,1.9953-3.4601,2.0457-7.0718,3.7632-10.835,5.1776,1.97,3.8642,4.2683,7.5769,6.8698,11.0623,11.5419-3.4854,22.3769-8.9156,32.0509-16.0631,2.626-27.2771-4.496-50.9172-18.817-71.8548C98.9811,4.2684,90.1918,1.5659,81.1752.0505l-.0252-.0505ZM42.2802,65.4144c-6.2383,0-11.4159-5.6575-11.4159-12.6535s4.9755-12.6788,11.3907-12.6788,11.5169,5.708,11.4159,12.6788c-.101,6.9708-5.026,12.6535-11.3907,12.6535ZM84.3576,65.4144c-6.2637,0-11.3907-5.6575-11.3907-12.6535s4.9755-12.6788,11.3907-12.6788,11.4917,5.708,11.3906,12.6788c-.101,6.9708-5.026,12.6535-11.3906,12.6535Z" })
|
|
9
|
+
});
|
|
10
|
+
const GitHubLogoIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
viewBox: "0 0 16 16",
|
|
14
|
+
...props,
|
|
15
|
+
children: /* @__PURE__ */ jsx("path", { d: "M6.766 11.328c-2.063-.25-3.516-1.734-3.516-3.656 0-.781.281-1.625.75-2.188-.203-.515-.172-1.609.063-2.062.625-.078 1.468.25 1.968.703.594-.187 1.219-.281 1.985-.281.765 0 1.39.094 1.953.265.484-.437 1.344-.765 1.969-.687.218.422.25 1.515.046 2.047.5.593.766 1.39.766 2.203 0 1.922-1.453 3.375-3.547 3.64.531.344.89 1.094.89 1.954v1.625c0 .468.391.734.86.547C13.781 14.359 16 11.53 16 8.03 16 3.61 12.406 0 7.984 0 3.563 0 0 3.61 0 8.031a7.88 7.88 0 0 0 5.172 7.422c.422.156.828-.125.828-.547v-1.25c-.219.094-.5.156-.75.156-1.031 0-1.64-.562-2.078-1.609-.172-.422-.36-.672-.719-.719-.187-.015-.25-.093-.25-.187 0-.188.313-.328.625-.328.453 0 .844.281 1.25.86.313.452.64.655 1.031.655s.641-.14 1-.5c.266-.265.47-.5.657-.656" })
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DiscordLogoIcon, GitHubLogoIcon };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
//#region src/components/breadcrumb.d.ts
|
|
4
|
+
declare const Breadcrumb: ({ ...props }: React$1.ComponentProps<"nav">) => React$1.JSX.Element;
|
|
5
|
+
declare const BreadcrumbList: ({ className, ...props }: React$1.ComponentProps<"ol">) => React$1.JSX.Element;
|
|
6
|
+
declare const BreadcrumbItem: ({ className, ...props }: React$1.ComponentProps<"li">) => React$1.JSX.Element;
|
|
7
|
+
declare function BreadcrumbLink({ className, render, ...props }: useRender.ComponentProps<"a">): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
8
|
+
declare const BreadcrumbPage: ({ className, ...props }: React$1.ComponentProps<"span">) => React$1.JSX.Element;
|
|
9
|
+
declare const BreadcrumbSeparator: ({ children, className, ...props }: React$1.ComponentProps<"li">) => React$1.JSX.Element;
|
|
10
|
+
declare const BreadcrumbEllipsis: ({ className, ...props }: React$1.ComponentProps<"span">) => React$1.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { DirectionalIcon } from "./directional-icon.js";
|
|
4
|
+
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
//#region src/components/breadcrumb.tsx
|
|
9
|
+
const Breadcrumb = ({ ...props }) => /* @__PURE__ */ jsx("nav", {
|
|
10
|
+
"aria-label": "Breadcrumb",
|
|
11
|
+
"data-slot": "breadcrumb",
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
const BreadcrumbList = ({ className, ...props }) => /* @__PURE__ */ jsx("ol", {
|
|
15
|
+
className: cn("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm wrap-break-word sm:gap-2.5", className),
|
|
16
|
+
"data-slot": "breadcrumb-list",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
const BreadcrumbItem = ({ className, ...props }) => /* @__PURE__ */ jsx("li", {
|
|
20
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
21
|
+
"data-slot": "breadcrumb-item",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
function BreadcrumbLink({ className, render, ...props }) {
|
|
25
|
+
const defaultProps = {
|
|
26
|
+
className: cn("hover:text-foreground transition-colors", className),
|
|
27
|
+
"data-slot": "breadcrumb-link"
|
|
28
|
+
};
|
|
29
|
+
return useRender({
|
|
30
|
+
defaultTagName: "a",
|
|
31
|
+
props: mergeProps(defaultProps, props),
|
|
32
|
+
render
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const BreadcrumbPage = ({ className, ...props }) => /* @__PURE__ */ jsx("span", {
|
|
36
|
+
"aria-current": "page",
|
|
37
|
+
className: cn("text-foreground font-normal", className),
|
|
38
|
+
"data-slot": "breadcrumb-page",
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
const BreadcrumbSeparator = ({ children, className, ...props }) => /* @__PURE__ */ jsx("li", {
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
className: cn("opacity-80 [&>svg]:size-4", className),
|
|
44
|
+
"data-slot": "breadcrumb-separator",
|
|
45
|
+
role: "presentation",
|
|
46
|
+
...props,
|
|
47
|
+
children: children ?? /* @__PURE__ */ jsx(DirectionalIcon, { icon: ChevronRight })
|
|
48
|
+
});
|
|
49
|
+
const BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs("span", {
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
className,
|
|
52
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
53
|
+
role: "presentation",
|
|
54
|
+
...props,
|
|
55
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: "sr-only",
|
|
57
|
+
children: "More"
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|
|
61
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/components/button-variants.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Disabled styling for a button that is only `aria-disabled`.
|
|
4
|
+
*
|
|
5
|
+
* The `disabled:` utilities below are CSS `:disabled`, which cannot match an
|
|
6
|
+
* element that carries no native `disabled` attribute, and `pointer-events-none`
|
|
7
|
+
* is deliberately not repeated: that rule is the reason a disabled button's
|
|
8
|
+
* tooltip can never open. Matches the treatment `disabled:opacity-64` gives, and
|
|
9
|
+
* swaps the cursor so the control still reads as unavailable on hover.
|
|
10
|
+
*/
|
|
11
|
+
declare const buttonAccessibleDisabledClass = "cursor-not-allowed opacity-64";
|
|
12
|
+
declare const buttonVariants: (props?: ({
|
|
13
|
+
size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xl" | "icon-xs" | "lg" | "sm" | "xl" | "xs" | null | undefined;
|
|
14
|
+
variant?: "link" | "default" | "destructive" | "destructive-outline" | "ghost" | "outline" | "secondary" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { buttonAccessibleDisabledClass, buttonVariants };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
//#region src/components/button-variants.tsx
|
|
3
|
+
/**
|
|
4
|
+
* Disabled styling for a button that is only `aria-disabled`.
|
|
5
|
+
*
|
|
6
|
+
* The `disabled:` utilities below are CSS `:disabled`, which cannot match an
|
|
7
|
+
* element that carries no native `disabled` attribute, and `pointer-events-none`
|
|
8
|
+
* is deliberately not repeated: that rule is the reason a disabled button's
|
|
9
|
+
* tooltip can never open. Matches the treatment `disabled:opacity-64` gives, and
|
|
10
|
+
* swaps the cursor so the control still reads as unavailable on hover.
|
|
11
|
+
*/
|
|
12
|
+
const buttonAccessibleDisabledClass = "cursor-not-allowed opacity-64";
|
|
13
|
+
const buttonVariants = cva("focus-visible:ring-ring focus-visible:ring-offset-background relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-lg border text-base font-medium whitespace-nowrap transition-shadow outline-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-64 sm:text-sm pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4", {
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
size: "default",
|
|
16
|
+
variant: "default"
|
|
17
|
+
},
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-9 px-[calc(--spacing(3)-1px)] sm:h-8",
|
|
21
|
+
icon: "size-9 sm:size-8",
|
|
22
|
+
"icon-lg": "size-10 sm:size-9",
|
|
23
|
+
"icon-sm": "size-8 sm:size-7",
|
|
24
|
+
"icon-xl": "size-11 sm:size-10 [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5",
|
|
25
|
+
"icon-xs": "size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-3.5",
|
|
26
|
+
lg: "h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9",
|
|
27
|
+
sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7",
|
|
28
|
+
xl: "h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5",
|
|
29
|
+
xs: "h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5"
|
|
30
|
+
},
|
|
31
|
+
variant: {
|
|
32
|
+
default: "border-primary bg-primary text-primary-foreground shadow-primary/24 [:hover,[data-pressed]]:bg-primary/90 shadow-xs not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
33
|
+
destructive: "border-destructive/32 bg-destructive/10 text-destructive-foreground shadow-destructive/8 [:hover,[data-pressed]]:border-destructive/40 [:hover,[data-pressed]]:bg-destructive/14 [:active,[data-pressed]]:bg-destructive/18 shadow-xs not-dark:bg-clip-padding not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
34
|
+
"destructive-outline": "border-input bg-popover text-destructive-foreground dark:bg-input/32 [:hover,[data-pressed]]:border-destructive/32 [:hover,[data-pressed]]:bg-destructive/4 shadow-xs/5 not-dark:bg-clip-padding not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
35
|
+
ghost: "text-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent border-transparent",
|
|
36
|
+
link: "border-transparent underline-offset-4 [:hover,[data-pressed]]:underline",
|
|
37
|
+
outline: "border-input bg-popover text-foreground dark:bg-input/32 [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64 shadow-xs/5 not-dark:bg-clip-padding not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
38
|
+
secondary: "bg-secondary text-secondary-foreground [:active,[data-pressed]]:bg-secondary/80 [:hover,[data-pressed]]:bg-secondary/90 border-transparent"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
export { buttonAccessibleDisabledClass, buttonVariants };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OverlayLayer } from "../lib/overlay-layer.js";
|
|
2
|
+
import { buttonVariants } from "./button-variants.js";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
//#region src/components/button.d.ts
|
|
7
|
+
type ButtonProps = {
|
|
8
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
9
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
tooltip?: React$1.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Overlay band for the tooltip popup. Needed when the button sits in floating
|
|
14
|
+
* chrome whose own band would otherwise paint over the popup.
|
|
15
|
+
*/
|
|
16
|
+
tooltipLayer?: OverlayLayer | undefined;
|
|
17
|
+
} & useRender.ComponentProps<"button">;
|
|
18
|
+
declare function Button({ className, variant, size, render, loading, children, disabled, tooltip, tooltipLayer, ...props }: ButtonProps): React$1.JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Button };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { renderTooltipTrigger } from "./tooltip-trigger-helper.js";
|
|
4
|
+
import { BUTTON_DISPOSITION, blockDisabledActivation, blockDisabledKeyActivation, resolveButtonDisposition } from "../lib/button-disposition.js";
|
|
5
|
+
import { buttonVariants } from "./button-variants.js";
|
|
6
|
+
import { LoaderIcon } from "lucide-react";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
9
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
10
|
+
//#region src/components/button.tsx
|
|
11
|
+
function Button({ className, variant, size, render, loading, children, disabled, tooltip, tooltipLayer, ...props }) {
|
|
12
|
+
const typeValue = render ? void 0 : "button";
|
|
13
|
+
const tooltipContent = tooltip ?? props["aria-label"] ?? props.title;
|
|
14
|
+
const disposition = resolveButtonDisposition({
|
|
15
|
+
disabled,
|
|
16
|
+
loading,
|
|
17
|
+
tooltip: tooltipContent
|
|
18
|
+
});
|
|
19
|
+
const isAccessibleDisabled = disposition === BUTTON_DISPOSITION.accessibleDisabled;
|
|
20
|
+
const defaultProps = {
|
|
21
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(LoaderIcon, { className: "animate-spin" }), children] }) : children,
|
|
22
|
+
className: cn(buttonVariants({
|
|
23
|
+
className,
|
|
24
|
+
size,
|
|
25
|
+
variant
|
|
26
|
+
}), isAccessibleDisabled && "cursor-not-allowed opacity-64"),
|
|
27
|
+
"data-slot": "button",
|
|
28
|
+
...isAccessibleDisabled ? {
|
|
29
|
+
"aria-disabled": true,
|
|
30
|
+
"data-disabled": "",
|
|
31
|
+
tabIndex: 0
|
|
32
|
+
} : { disabled: disposition === BUTTON_DISPOSITION.nativeDisabled },
|
|
33
|
+
type: typeValue
|
|
34
|
+
};
|
|
35
|
+
const button = useRender({
|
|
36
|
+
defaultTagName: "button",
|
|
37
|
+
props: isAccessibleDisabled ? mergeProps(defaultProps, props, {
|
|
38
|
+
onClick: blockDisabledActivation,
|
|
39
|
+
onKeyDown: blockDisabledKeyActivation,
|
|
40
|
+
onKeyUp: blockDisabledKeyActivation,
|
|
41
|
+
onMouseDown: blockDisabledActivation,
|
|
42
|
+
onPointerDown: blockDisabledActivation
|
|
43
|
+
}) : mergeProps(defaultProps, props),
|
|
44
|
+
render
|
|
45
|
+
});
|
|
46
|
+
return renderTooltipTrigger({
|
|
47
|
+
tooltip: tooltipContent,
|
|
48
|
+
trigger: button,
|
|
49
|
+
...tooltipLayer === void 0 ? {} : { layer: tooltipLayer }
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { Button };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
5
|
+
//#region src/components/checkbox.tsx
|
|
6
|
+
const Checkbox = ({ className, ...props }) => /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
7
|
+
className: cn("border-input bg-background ring-ring focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[4px] border shadow-xs/5 transition-shadow outline-none not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 data-disabled:opacity-64 sm:size-4 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none", className),
|
|
8
|
+
"data-slot": "checkbox",
|
|
9
|
+
...props,
|
|
10
|
+
children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
|
|
11
|
+
className: "text-primary-foreground data-checked:bg-primary data-indeterminate:text-foreground absolute -inset-px flex items-center justify-center rounded-[4px] data-unchecked:hidden",
|
|
12
|
+
"data-slot": "checkbox-indicator",
|
|
13
|
+
render: (indicatorProps, state) => /* @__PURE__ */ jsx("span", {
|
|
14
|
+
...indicatorProps,
|
|
15
|
+
children: state.indeterminate ? /* @__PURE__ */ jsxs("svg", {
|
|
16
|
+
className: "size-3.5 sm:size-3",
|
|
17
|
+
fill: "none",
|
|
18
|
+
height: "24",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeLinejoin: "round",
|
|
22
|
+
strokeWidth: "3",
|
|
23
|
+
viewBox: "0 0 24 24",
|
|
24
|
+
width: "24",
|
|
25
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
26
|
+
children: [/* @__PURE__ */ jsx("title", { children: "Indeterminate" }), /* @__PURE__ */ jsx("path", { d: "M5.252 12h13.496" })]
|
|
27
|
+
}) : /* @__PURE__ */ jsxs("svg", {
|
|
28
|
+
className: "size-3.5 sm:size-3",
|
|
29
|
+
fill: "none",
|
|
30
|
+
height: "24",
|
|
31
|
+
stroke: "currentColor",
|
|
32
|
+
strokeLinecap: "round",
|
|
33
|
+
strokeLinejoin: "round",
|
|
34
|
+
strokeWidth: "3",
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
width: "24",
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
+
children: [/* @__PURE__ */ jsx("title", { children: "Checked" }), /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })]
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Checkbox };
|