atlas-react-kit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPONENTS.md +80 -0
- package/DESIGN_RULES.md +40 -0
- package/LICENSE +21 -0
- package/NOTICE +24 -0
- package/README.md +83 -0
- package/dist/badge.d.ts +10 -0
- package/dist/badge.js +57 -0
- package/dist/button.d.ts +10 -0
- package/dist/button.js +36 -0
- package/dist/calendar.d.ts +10 -0
- package/dist/calendar.js +76 -0
- package/dist/card.d.ts +19 -0
- package/dist/card.js +32 -0
- package/dist/checkbox.d.ts +4 -0
- package/dist/checkbox.js +10 -0
- package/dist/dialog.d.ts +15 -0
- package/dist/dialog.js +38 -0
- package/dist/empty-panel.d.ts +10 -0
- package/dist/empty-panel.js +6 -0
- package/dist/field.d.ts +24 -0
- package/dist/field.js +68 -0
- package/dist/form/feedback-field.d.ts +4 -0
- package/dist/form/feedback-field.js +7 -0
- package/dist/form/field-error.d.ts +12 -0
- package/dist/form/field-error.js +13 -0
- package/dist/form/select-field.d.ts +13 -0
- package/dist/form/select-field.js +12 -0
- package/dist/form/text-field.d.ts +27 -0
- package/dist/form/text-field.js +25 -0
- package/dist/input.d.ts +3 -0
- package/dist/input.js +7 -0
- package/dist/internal/tabs-styles.d.ts +5 -0
- package/dist/internal/tabs-styles.js +19 -0
- package/dist/label.d.ts +4 -0
- package/dist/label.js +9 -0
- package/dist/next/tabs-nav-link.d.ts +6 -0
- package/dist/next/tabs-nav-link.js +9 -0
- package/dist/popover.d.ts +10 -0
- package/dist/popover.js +27 -0
- package/dist/select.d.ts +15 -0
- package/dist/select.js +38 -0
- package/dist/separator.d.ts +4 -0
- package/dist/separator.js +9 -0
- package/dist/skeleton.d.ts +2 -0
- package/dist/skeleton.js +6 -0
- package/dist/sonner.d.ts +4 -0
- package/dist/sonner.js +15 -0
- package/dist/table-body-skeleton.d.ts +7 -0
- package/dist/table-body-skeleton.js +7 -0
- package/dist/table.d.ts +10 -0
- package/dist/table.js +29 -0
- package/dist/tabs.d.ts +17 -0
- package/dist/tabs.js +28 -0
- package/dist/textarea.d.ts +3 -0
- package/dist/textarea.js +7 -0
- package/dist/toggle-group.d.ts +10 -0
- package/dist/toggle-group.js +24 -0
- package/dist/toggle.d.ts +9 -0
- package/dist/toggle.js +27 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +11 -0
- package/package.json +181 -0
- package/theme.css +184 -0
package/COMPONENTS.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Component guide
|
|
2
|
+
|
|
3
|
+
Import each module from `atlas-react-kit/<subpath>`. Primitives preserve the
|
|
4
|
+
underlying element or Radix props, including `className`, alongside their options.
|
|
5
|
+
Form helpers and `TableBodySkeleton` accept only their documented props. There is
|
|
6
|
+
no root component barrel.
|
|
7
|
+
|
|
8
|
+
| Subpath | Main exports and options |
|
|
9
|
+
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
10
|
+
| `button` | `Button`, `buttonVariants`; `variant`, `size`, `asChild` |
|
|
11
|
+
| `badge` | `Badge`, `badgeVariants`; `variant`, `tone`, `asChild` |
|
|
12
|
+
| `calendar` | `Calendar`, `CalendarDayButton`; React Day Picker props and `buttonVariant` |
|
|
13
|
+
| `card` | `Card`, `CardHeader`, `CardTitle`, `CardDescription`, `CardAction`, `CardContent`, `CardFooter`; `Card` supports `flush` |
|
|
14
|
+
| `checkbox` | `Checkbox` |
|
|
15
|
+
| `dialog` | `Dialog`, trigger, portal, overlay, content, close, header, footer, title, description; `DialogContent` supports `showCloseButton` |
|
|
16
|
+
| `empty-panel` | `EmptyPanel`; required `children`; optional `size`, `muted`, `className` |
|
|
17
|
+
| `field` | Field, label, legend, description, group, set, title, content, separator, error; `Field` supports `orientation` |
|
|
18
|
+
| `input`, `textarea`, `label` | `Input`, `Textarea`, `Label` |
|
|
19
|
+
| `popover` | `Popover`, trigger, anchor, content, header, title, description |
|
|
20
|
+
| `select` | Select, trigger, value, content, group, label, item, separator, scroll buttons; trigger `size` |
|
|
21
|
+
| `separator`, `skeleton` | `Separator`, `Skeleton` |
|
|
22
|
+
| `sonner` | `Toaster`; Sonner props, with `next-themes` theme defaults |
|
|
23
|
+
| `table` | Table, header, body, footer, row, head, cell, caption |
|
|
24
|
+
| `table-body-skeleton` | `TableBodySkeleton`; `columns`, optional `rows` (default 5) |
|
|
25
|
+
| `tabs` | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent`, `TabsNav`, `tabsListVariants`; list `variant` is `default` or `line` |
|
|
26
|
+
| `toggle` | `Toggle`, `toggleVariants`; `variant`, `size` |
|
|
27
|
+
| `toggle-group` | `ToggleGroup`, `ToggleGroupItem`; `variant`, `size` |
|
|
28
|
+
| `form/text-field` | `FormTextField`, type `TextFieldApi`; controlled field, label, multiline, description, input constraints |
|
|
29
|
+
| `form/select-field` | `FormSelectField`; `value`, `onValueChange`, `label`, optional `meta` and placeholder; select item children |
|
|
30
|
+
| `form/field-error` | `FieldError`, `getFieldErrorMessage`; types `FieldErrorMessage`, `FieldMetaState` |
|
|
31
|
+
| `form/feedback-field` | `FormFeedbackField`; nullable `message` |
|
|
32
|
+
| `next/tabs-nav-link` | `TabsNavLink`; Next Link props and required `active` boolean; requires Next.js 16 |
|
|
33
|
+
| `utils` | `cn`, `onInputChange` |
|
|
34
|
+
| `theme.css` | Tailwind 4 theme; installation in [README](./README.md) |
|
|
35
|
+
|
|
36
|
+
## Forms
|
|
37
|
+
|
|
38
|
+
`TextFieldApi` is a structural interface, with no form library dependency:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
type TextFieldApi = {
|
|
42
|
+
name: string
|
|
43
|
+
state: {
|
|
44
|
+
value: string
|
|
45
|
+
meta: { errors: (string | { message?: string } | undefined)[] }
|
|
46
|
+
}
|
|
47
|
+
handleChange: (value: string) => void
|
|
48
|
+
handleBlur: () => void
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`FormTextField` accepts `field` and `label`; use `multiline` and `rows` for a
|
|
53
|
+
textarea, `inputType` for a specific input, and `showError={false}` to suppress
|
|
54
|
+
error text and invalid styling. `FormSelectField` accepts the same error meta
|
|
55
|
+
shape. `FieldError` accepts either `message` or pre-resolved `text`.
|
|
56
|
+
|
|
57
|
+
## URL navigation in Next.js
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { TabsNav } from "atlas-react-kit/tabs"
|
|
61
|
+
import { TabsNavLink } from "atlas-react-kit/next/tabs-nav-link"
|
|
62
|
+
|
|
63
|
+
export function ViewSwitcher({ view }: { view: string }) {
|
|
64
|
+
return (
|
|
65
|
+
<TabsNav aria-label="Items view">
|
|
66
|
+
<TabsNavLink href="?view=list" active={view === "list"}>
|
|
67
|
+
List
|
|
68
|
+
</TabsNavLink>
|
|
69
|
+
<TabsNavLink href="?view=board" active={view === "board"}>
|
|
70
|
+
Board
|
|
71
|
+
</TabsNavLink>
|
|
72
|
+
</TabsNav>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Outside Next, compose `TabsNav` with your own links and active-page semantics.
|
|
78
|
+
Hook-driven controls and form handlers declare their client boundary; presentational
|
|
79
|
+
modules such as `button`, `badge`, `card`, and `skeleton` can be composed from
|
|
80
|
+
React Server Components. Pass interactive callbacks from client components.
|
package/DESIGN_RULES.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Design rules
|
|
2
|
+
|
|
3
|
+
Atlas owns these shared rules, its theme, and component implementations. Change
|
|
4
|
+
them here and release a package version. Build application-specific UI by composing
|
|
5
|
+
the shipped components.
|
|
6
|
+
|
|
7
|
+
## Tokens
|
|
8
|
+
|
|
9
|
+
Use semantic colors, radii, and fonts: `bg-primary`, `text-muted-foreground`,
|
|
10
|
+
`border-border`, and `font-heading`. Avoid raw palette classes and separate
|
|
11
|
+
light/dark color pairs; tokens already switch with the theme.
|
|
12
|
+
|
|
13
|
+
Selected or active navigation, tabs, toggles, chips, rows, and labels use
|
|
14
|
+
`bg-selected text-selected-foreground`. Hover stays neutral with `hover:bg-muted`
|
|
15
|
+
or `hover:bg-accent`. The shipped controls apply this distinction.
|
|
16
|
+
|
|
17
|
+
Use `success`, `warning`, and `destructive` for good, caution, and bad states.
|
|
18
|
+
For tinted status chips, use `Badge variant="soft" tone="success"` or
|
|
19
|
+
`tone="warning"`. The destructive tone has a known contrast limitation on its
|
|
20
|
+
own light-mode tint; prefer plain `text-destructive` or a solid fill. Status
|
|
21
|
+
tones have no paired foreground token; avoid placing text on solid status fills.
|
|
22
|
+
Application-specific identity colors belong to the application.
|
|
23
|
+
|
|
24
|
+
## Shape and composition
|
|
25
|
+
|
|
26
|
+
Primitives have square corners. Reserve `rounded-full` for dots, avatars, and
|
|
27
|
+
other circles. Card and dialog titles already use uppercase, tracked
|
|
28
|
+
`font-heading` styling.
|
|
29
|
+
|
|
30
|
+
Use `EmptyPanel` for empty states, `TableBodySkeleton` for loading table bodies,
|
|
31
|
+
and `<Card flush>` for an edge-to-edge list or table. `Dialog` already scrolls
|
|
32
|
+
inside the viewport on small screens; avoid additional height limits.
|
|
33
|
+
|
|
34
|
+
Use `Tabs` with actual `TabsContent` panels. For URL view switches, use a labelled
|
|
35
|
+
`TabsNav` with links and `aria-current="page"` on the active link. The optional
|
|
36
|
+
Next adapter provides `TabsNavLink` with this behavior.
|
|
37
|
+
|
|
38
|
+
Use `FormTextField`, `FormSelectField`, and `FormFeedbackField` for portable form
|
|
39
|
+
controls, and `FieldError` for field messages. More specialized controls belong
|
|
40
|
+
to the application.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kerubi-5
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Atlas includes component and custom CSS variant implementations derived from
|
|
2
|
+
shadcn/ui, available at https://github.com/shadcn-ui/ui.
|
|
3
|
+
|
|
4
|
+
MIT License
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2023 shadcn
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Atlas React Kit
|
|
2
|
+
|
|
3
|
+
Shared React components and a Tailwind theme with square corners, semantic
|
|
4
|
+
colors, and distinct selected states. React 19 and Tailwind 4 are required.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npm install --save-exact atlas-react-kit@0.1.0
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Import components by subpath:
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { Button } from "atlas-react-kit/button"
|
|
14
|
+
import { Card, CardContent } from "atlas-react-kit/card"
|
|
15
|
+
|
|
16
|
+
export function Example() {
|
|
17
|
+
return (
|
|
18
|
+
<Card>
|
|
19
|
+
<CardContent>
|
|
20
|
+
<Button>Save</Button>
|
|
21
|
+
</CardContent>
|
|
22
|
+
</Card>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
In your global stylesheet, import the theme after Tailwind and register the
|
|
28
|
+
installed JavaScript directory. Paths in `@source` are relative to that stylesheet;
|
|
29
|
+
this example assumes it is one directory below the project root.
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
@import "tailwindcss";
|
|
33
|
+
@import "atlas-react-kit/theme.css";
|
|
34
|
+
@source "../node_modules/atlas-react-kit/dist";
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The theme includes animations and shared light/dark tokens. Set the `dark` class
|
|
38
|
+
on an ancestor to activate dark colors. Supply your own font configuration;
|
|
39
|
+
`font-heading` uses the configured sans font. Application-specific tokens stay
|
|
40
|
+
with the application.
|
|
41
|
+
|
|
42
|
+
See [design rules](./DESIGN_RULES.md) for shared styling decisions and the
|
|
43
|
+
[component guide](./COMPONENTS.md) for exports and composition examples. Both
|
|
44
|
+
files ship in the npm package. Shared component changes belong in this repository;
|
|
45
|
+
applications compose their feature UI around the package and upgrade deliberately.
|
|
46
|
+
|
|
47
|
+
## Development and releases
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
npm ci
|
|
51
|
+
npm run check
|
|
52
|
+
npm test
|
|
53
|
+
npm pack
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`tsc` emits individual ESM files and TypeScript declarations. CSS is shipped
|
|
57
|
+
without compilation and processed by the consuming application's Tailwind build.
|
|
58
|
+
The optional Next.js 16 adapter requires Next only when imported. The package
|
|
59
|
+
does not bundle React.
|
|
60
|
+
|
|
61
|
+
For the first release, create and validate a packed artifact:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
mkdir -p release-artifacts
|
|
65
|
+
npm pack --pack-destination release-artifacts
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Install that tarball in consumer fixtures and complete their checks. The package
|
|
69
|
+
owner then publishes that exact validated artifact, without rebuilding it:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
npm publish ./release-artifacts/atlas-react-kit-0.1.0.tgz --access public
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The owner then configures npm trusted publishing for this repository's
|
|
76
|
+
`release.yml` workflow on a GitHub-hosted runner.
|
|
77
|
+
Later releases use explicit `v<version>` tags matching `package.json`; CI runs
|
|
78
|
+
checks before publishing through npm OIDC. Pushing to `main` runs validation only.
|
|
79
|
+
Do not push a release tag for the initial manual publication.
|
|
80
|
+
|
|
81
|
+
Pin an exact package version in consuming applications. Roll back an upgrade by
|
|
82
|
+
restoring the previous version and lockfile. License: MIT; upstream notices are
|
|
83
|
+
preserved in [NOTICE](./NOTICE).
|
package/dist/badge.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | "soft" | null | undefined;
|
|
5
|
+
tone?: "destructive" | "neutral" | "success" | "warning" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Badge({ className, variant, tone, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Badge, badgeVariants };
|
package/dist/badge.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { Slot } from "radix-ui";
|
|
5
|
+
import { cn } from "./utils.js";
|
|
6
|
+
const badgeVariants = cva("group/badge inline-flex w-fit shrink-0 items-center justify-center gap-1.5 overflow-hidden rounded-none border-0 bg-transparent px-0 py-0 text-[0.625rem] font-semibold tracking-widest whitespace-nowrap uppercase transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-0 has-data-[icon=inline-start]:pl-0 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "text-foreground [a]:hover:text-foreground/70",
|
|
10
|
+
secondary: "text-muted-foreground [a]:hover:text-foreground",
|
|
11
|
+
destructive: "text-destructive focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:text-destructive/70",
|
|
12
|
+
outline: "text-foreground [a]:hover:text-foreground/70",
|
|
13
|
+
ghost: "text-muted-foreground hover:text-foreground",
|
|
14
|
+
link: "text-foreground underline-offset-4 hover:underline",
|
|
15
|
+
/** Tinted chip; pick its color with `tone`. */
|
|
16
|
+
soft: "px-2 py-0.5 text-xs font-medium tracking-normal normal-case",
|
|
17
|
+
},
|
|
18
|
+
/** Only `soft` reads this. */
|
|
19
|
+
tone: {
|
|
20
|
+
neutral: "",
|
|
21
|
+
success: "",
|
|
22
|
+
warning: "",
|
|
23
|
+
destructive: "",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
compoundVariants: [
|
|
27
|
+
{
|
|
28
|
+
variant: "soft",
|
|
29
|
+
tone: "neutral",
|
|
30
|
+
className: "border border-border/60 bg-muted/50 text-foreground",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
variant: "soft",
|
|
34
|
+
tone: "success",
|
|
35
|
+
className: "bg-success/15 text-success",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
variant: "soft",
|
|
39
|
+
tone: "warning",
|
|
40
|
+
className: "bg-warning/15 text-warning",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
variant: "soft",
|
|
44
|
+
tone: "destructive",
|
|
45
|
+
className: "bg-destructive/15 text-destructive",
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
defaultVariants: {
|
|
49
|
+
variant: "default",
|
|
50
|
+
tone: "neutral",
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
function Badge({ className, variant = "default", tone, asChild = false, ...props }) {
|
|
54
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
55
|
+
return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant, tone }), className), ...props }));
|
|
56
|
+
}
|
|
57
|
+
export { Badge, badgeVariants };
|
package/dist/button.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { Slot } from "radix-ui";
|
|
5
|
+
import { cn } from "./utils.js";
|
|
6
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-none border border-transparent bg-clip-padding text-xs font-semibold tracking-widest whitespace-nowrap uppercase transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
10
|
+
outline: "border-border bg-transparent hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-input/30",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
12
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
13
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
14
|
+
link: "text-primary underline underline-offset-4 hover:underline",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-10 gap-1.5 px-6 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4",
|
|
18
|
+
xs: "h-7 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
19
|
+
sm: "h-9 gap-1 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
|
|
20
|
+
lg: "h-11 gap-1.5 px-8 has-data-[icon=inline-end]:pr-5 has-data-[icon=inline-start]:pl-5",
|
|
21
|
+
icon: "size-10",
|
|
22
|
+
"icon-xs": "size-7 [&_svg:not([class*='size-'])]:size-3",
|
|
23
|
+
"icon-sm": "size-9",
|
|
24
|
+
"icon-lg": "size-11",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: "default",
|
|
29
|
+
size: "default",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
33
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
34
|
+
return (_jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
35
|
+
}
|
|
36
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DayPicker, type DayButton, type Locale } from "react-day-picker";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
|
5
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function CalendarDayButton({ className, day, modifiers, locale, ...props }: React.ComponentProps<typeof DayButton> & {
|
|
8
|
+
locale?: Partial<Locale>;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Calendar, CalendarDayButton };
|
package/dist/calendar.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { DayPicker, getDefaultClassNames, } from "react-day-picker";
|
|
5
|
+
import { cn } from "./utils.js";
|
|
6
|
+
import { Button, buttonVariants } from "./button.js";
|
|
7
|
+
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, } from "lucide-react";
|
|
8
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
|
|
9
|
+
const defaultClassNames = getDefaultClassNames();
|
|
10
|
+
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn("group/calendar bg-background p-3 [--cell-radius:0] [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent", String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, locale: locale, formatters: {
|
|
11
|
+
formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
|
|
12
|
+
...formatters,
|
|
13
|
+
}, classNames: {
|
|
14
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
15
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
16
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
17
|
+
nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
18
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
19
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
20
|
+
month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
21
|
+
dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
22
|
+
dropdown_root: cn("relative rounded-(--cell-radius)", defaultClassNames.dropdown_root),
|
|
23
|
+
dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
24
|
+
caption_label: cn("font-medium select-none", captionLayout === "label"
|
|
25
|
+
? "text-sm"
|
|
26
|
+
: "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
|
|
27
|
+
month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
|
|
28
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
29
|
+
weekday: cn("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
|
|
30
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
31
|
+
week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
32
|
+
week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
|
|
33
|
+
day: cn("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", props.showWeekNumber
|
|
34
|
+
? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)"
|
|
35
|
+
: "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", defaultClassNames.day),
|
|
36
|
+
range_start: cn("relative isolate z-0 rounded-l-(--cell-radius) bg-selected after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-selected", defaultClassNames.range_start),
|
|
37
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
38
|
+
range_end: cn("relative isolate z-0 rounded-r-(--cell-radius) bg-selected after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-selected", defaultClassNames.range_end),
|
|
39
|
+
today: cn("rounded-(--cell-radius) bg-selected text-selected-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
40
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
41
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
42
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
43
|
+
...classNames,
|
|
44
|
+
}, components: {
|
|
45
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
46
|
+
return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props }));
|
|
47
|
+
},
|
|
48
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
49
|
+
if (orientation === "left") {
|
|
50
|
+
return (_jsx(ChevronLeftIcon, { className: cn("size-4", className), ...props }));
|
|
51
|
+
}
|
|
52
|
+
if (orientation === "right") {
|
|
53
|
+
return (_jsx(ChevronRightIcon, { className: cn("size-4", className), ...props }));
|
|
54
|
+
}
|
|
55
|
+
return (_jsx(ChevronDownIcon, { className: cn("size-4", className), ...props }));
|
|
56
|
+
},
|
|
57
|
+
DayButton: ({ ...props }) => (_jsx(CalendarDayButton, { locale: locale, ...props })),
|
|
58
|
+
WeekNumber: ({ children, ...props }) => {
|
|
59
|
+
return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
|
|
60
|
+
},
|
|
61
|
+
...components,
|
|
62
|
+
}, ...props }));
|
|
63
|
+
}
|
|
64
|
+
function CalendarDayButton({ className, day, modifiers, locale, ...props }) {
|
|
65
|
+
const defaultClassNames = getDefaultClassNames();
|
|
66
|
+
const ref = React.useRef(null);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
if (modifiers.focused)
|
|
69
|
+
ref.current?.focus();
|
|
70
|
+
}, [modifiers.focused]);
|
|
71
|
+
return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(locale?.code), "data-selected-single": modifiers.selected &&
|
|
72
|
+
!modifiers.range_start &&
|
|
73
|
+
!modifiers.range_end &&
|
|
74
|
+
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-selected data-[range-middle=true]:text-selected-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className), ...props }));
|
|
75
|
+
}
|
|
76
|
+
export { Calendar, CalendarDayButton };
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Padding lives in `--card-p` (set here, read by the sections) so plain
|
|
4
|
+
* `py-*` / `px-*` classes on Card or its sections override it normally.
|
|
5
|
+
* `flush` drops all padding so a list or table runs edge to edge.
|
|
6
|
+
*/
|
|
7
|
+
declare function Card({ className, size, flush, ...props }: React.ComponentProps<"div"> & {
|
|
8
|
+
size?: "default" | "sm";
|
|
9
|
+
flush?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function CardTitle({ as: Component, className, ...props }: React.ComponentProps<"div"> & {
|
|
13
|
+
as?: "div" | "h1";
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
17
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
18
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "./utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* Padding lives in `--card-p` (set here, read by the sections) so plain
|
|
6
|
+
* `py-*` / `px-*` classes on Card or its sections override it normally.
|
|
7
|
+
* `flush` drops all padding so a list or table runs edge to edge.
|
|
8
|
+
*/
|
|
9
|
+
function Card({ className, size = "default", flush = false, ...props }) {
|
|
10
|
+
return (_jsx("div", { "data-slot": "card", "data-size": size, className: cn("group/card flex flex-col overflow-hidden bg-card py-(--card-p) text-sm text-card-foreground shadow-sm ring-1 ring-foreground/5 has-[>img:first-child]:pt-0 *:[img:first-child]:rounded-none *:[img:last-child]:rounded-none", size === "sm"
|
|
11
|
+
? "gap-5 [--card-p:--spacing(5)]"
|
|
12
|
+
: "gap-8 [--card-p:--spacing(8)]", flush && "[--card-p:0px]", className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
function CardHeader({ className, ...props }) {
|
|
15
|
+
return (_jsx("div", { "data-slot": "card-header", className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1.5 rounded-none px-(--card-p) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-p)", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
function CardTitle({ as: Component = "div", className, ...props }) {
|
|
18
|
+
return (_jsx(Component, { "data-slot": "card-title", className: cn("font-heading text-base font-semibold tracking-wider uppercase", className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
function CardDescription({ className, ...props }) {
|
|
21
|
+
return (_jsx("div", { "data-slot": "card-description", className: cn("text-sm leading-relaxed text-muted-foreground", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function CardAction({ className, ...props }) {
|
|
24
|
+
return (_jsx("div", { "data-slot": "card-action", className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
function CardContent({ className, ...props }) {
|
|
27
|
+
return (_jsx("div", { "data-slot": "card-content", className: cn("px-(--card-p)", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function CardFooter({ className, ...props }) {
|
|
30
|
+
return (_jsx("div", { "data-slot": "card-footer", className: cn("flex items-center px-(--card-p) [.border-t]:pt-(--card-p)", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "./utils.js";
|
|
6
|
+
import { CheckIcon } from "lucide-react";
|
|
7
|
+
function Checkbox({ className, ...props }) {
|
|
8
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer relative flex size-4.5 shrink-0 items-center justify-center rounded-none border border-input bg-transparent transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none [&>svg]:size-3.5", children: _jsx(CheckIcon, {}) }) }));
|
|
9
|
+
}
|
|
10
|
+
export { Checkbox };
|
package/dist/dialog.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, children, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
package/dist/dialog.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "./utils.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { XIcon } from "lucide-react";
|
|
8
|
+
function Dialog({ ...props }) {
|
|
9
|
+
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
10
|
+
}
|
|
11
|
+
function DialogTrigger({ ...props }) {
|
|
12
|
+
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
13
|
+
}
|
|
14
|
+
function DialogPortal({ ...props }) {
|
|
15
|
+
return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
16
|
+
}
|
|
17
|
+
function DialogClose({ ...props }) {
|
|
18
|
+
return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
19
|
+
}
|
|
20
|
+
function DialogOverlay({ className, ...props }) {
|
|
21
|
+
return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn("fixed inset-0 isolate z-50 bg-black/20 duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 supports-backdrop-filter:backdrop-blur-sm", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
24
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn("fixed top-1/2 left-1/2 z-50 grid max-h-[90dvh] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 overflow-y-auto rounded-none bg-popover p-6 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-md", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", asChild: true, children: _jsxs(Button, { variant: "ghost", size: "icon-sm", className: "absolute top-4 right-4 text-muted-foreground hover:text-foreground", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }) }))] })] }));
|
|
25
|
+
}
|
|
26
|
+
function DialogHeader({ className, ...props }) {
|
|
27
|
+
return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function DialogFooter({ className, children, ...props }) {
|
|
30
|
+
return (_jsx("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props, children: children }));
|
|
31
|
+
}
|
|
32
|
+
function DialogTitle({ className, ...props }) {
|
|
33
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("font-heading text-lg leading-none font-semibold tracking-wider uppercase", className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
function DialogDescription({ className, ...props }) {
|
|
36
|
+
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("mt-0.5 text-sm leading-relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
|
|
37
|
+
}
|
|
38
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
/** Tighter padding for compact widgets; default is standard form empty states. */
|
|
4
|
+
size?: "sm" | "md" | "lg";
|
|
5
|
+
muted?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
/** Dashed empty-state panel for lists, widgets, and form sections. */
|
|
9
|
+
export declare function EmptyPanel({ children, size, muted, className, }: Props): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "./utils.js";
|
|
3
|
+
/** Dashed empty-state panel for lists, widgets, and form sections. */
|
|
4
|
+
export function EmptyPanel({ children, size = "md", muted = true, className, }) {
|
|
5
|
+
return (_jsx("div", { className: cn("rounded-none border border-dashed text-center text-sm text-muted-foreground", muted && "bg-muted/30", size === "sm" && "px-3 py-4", size === "md" && "px-4 py-6", size === "lg" && "px-4 py-8", className), children: children }));
|
|
6
|
+
}
|