@krizaka/ui 2.0.0-beta.2 → 2.0.0-beta.3
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 +30 -0
- package/dist/alert.d.ts +2 -0
- package/dist/alert.js.map +1 -1
- package/dist/avatar.d.ts +5 -0
- package/dist/avatar.js.map +1 -1
- package/dist/badge.d.ts +12 -0
- package/dist/badge.js.map +1 -1
- package/dist/{button-G5qY4qSY.d.ts → button-8La7l0V4.d.ts} +15 -0
- package/dist/button.d.ts +19 -0
- package/dist/button.js.map +1 -1
- package/dist/card.d.ts +24 -1
- package/dist/card.js.map +1 -1
- package/dist/chip.d.ts +23 -0
- package/dist/chip.js.map +1 -1
- package/dist/{chunk-5FRYKFTO.js → chunk-3X5MVH54.js} +2 -2
- package/dist/chunk-3X5MVH54.js.map +1 -0
- package/dist/{chunk-QRG5RYEI.js → chunk-ZUD4U22H.js} +1 -1
- package/dist/chunk-ZUD4U22H.js.map +1 -0
- package/dist/command.d.ts +4 -1
- package/dist/command.js +2 -2
- package/dist/command.js.map +1 -1
- package/dist/confirm-button.d.ts +1 -1
- package/dist/confirm-button.js +1 -1
- package/dist/countdown.d.ts +3 -0
- package/dist/countdown.js.map +1 -1
- package/dist/{dialog-DGBY2grk.d.ts → dialog-GQ4Nvuyf.d.ts} +10 -0
- package/dist/dialog.d.ts +9 -1
- package/dist/dialog.js +2 -2
- package/dist/dialog.js.map +1 -1
- package/dist/dropdown-menu.d.ts +1 -0
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/empty-state.d.ts +2 -0
- package/dist/empty-state.js.map +1 -1
- package/dist/kbd.d.ts +7 -1
- package/dist/kbd.js.map +1 -1
- package/dist/page-header.d.ts +2 -0
- package/dist/page-header.js.map +1 -1
- package/dist/progress.d.ts +5 -0
- package/dist/progress.js.map +1 -1
- package/dist/skeleton.d.ts +7 -1
- package/dist/skeleton.js.map +1 -1
- package/dist/slider.d.ts +2 -0
- package/dist/slider.js.map +1 -1
- package/dist/spinner.d.ts +5 -0
- package/dist/spinner.js.map +1 -1
- package/dist/stat.d.ts +2 -0
- package/dist/stat.js.map +1 -1
- package/dist/switch.d.ts +7 -3
- package/dist/switch.js.map +1 -1
- package/dist/tabs.d.ts +4 -1
- package/dist/tabs.js.map +1 -1
- package/dist/theme.d.ts +10 -2
- package/dist/theme.js +4 -2
- package/dist/theme.js.map +1 -1
- package/dist/tooltip.d.ts +3 -0
- package/dist/tooltip.js.map +1 -1
- package/package.json +14 -3
- package/registry/alert.json +59 -0
- package/registry/avatar.json +114 -0
- package/registry/badge.json +59 -0
- package/registry/button.json +115 -0
- package/registry/card.json +154 -0
- package/registry/checkbox.json +46 -0
- package/registry/chip.json +164 -0
- package/registry/cn.json +21 -0
- package/registry/command.json +162 -0
- package/registry/confirm-button.json +104 -0
- package/registry/countdown.json +84 -0
- package/registry/demos/alert.d.ts +5 -0
- package/registry/demos/alert.js +12 -0
- package/registry/demos/alert.tsx +15 -0
- package/registry/demos/avatar.d.ts +5 -0
- package/registry/demos/avatar.js +14 -0
- package/registry/demos/avatar.tsx +13 -0
- package/registry/demos/badge.d.ts +5 -0
- package/registry/demos/badge.js +11 -0
- package/registry/demos/badge.tsx +5 -0
- package/registry/demos/button.d.ts +5 -0
- package/registry/demos/button.js +11 -0
- package/registry/demos/button.tsx +5 -0
- package/registry/demos/card.d.ts +5 -0
- package/registry/demos/card.js +30 -0
- package/registry/demos/card.tsx +37 -0
- package/registry/demos/checkbox.d.ts +5 -0
- package/registry/demos/checkbox.js +11 -0
- package/registry/demos/checkbox.tsx +5 -0
- package/registry/demos/chip.d.ts +5 -0
- package/registry/demos/chip.js +15 -0
- package/registry/demos/chip.tsx +11 -0
- package/registry/demos/cn.d.ts +7 -0
- package/registry/demos/cn.js +17 -0
- package/registry/demos/cn.tsx +9 -0
- package/registry/demos/command.d.ts +5 -0
- package/registry/demos/command.js +32 -0
- package/registry/demos/command.tsx +28 -0
- package/registry/demos/confirm-button.d.ts +5 -0
- package/registry/demos/confirm-button.js +12 -0
- package/registry/demos/confirm-button.tsx +13 -0
- package/registry/demos/countdown.d.ts +5 -0
- package/registry/demos/countdown.js +13 -0
- package/registry/demos/countdown.tsx +10 -0
- package/registry/demos/dialog.d.ts +7 -0
- package/registry/demos/dialog.js +29 -0
- package/registry/demos/dialog.tsx +31 -0
- package/registry/demos/dropdown-menu.d.ts +7 -0
- package/registry/demos/dropdown-menu.js +36 -0
- package/registry/demos/dropdown-menu.tsx +27 -0
- package/registry/demos/empty-state.d.ts +5 -0
- package/registry/demos/empty-state.js +15 -0
- package/registry/demos/empty-state.tsx +12 -0
- package/registry/demos/field.d.ts +5 -0
- package/registry/demos/field.js +15 -0
- package/registry/demos/field.tsx +11 -0
- package/registry/demos/kbd.d.ts +5 -0
- package/registry/demos/kbd.js +11 -0
- package/registry/demos/kbd.tsx +5 -0
- package/registry/demos/page-header.d.ts +5 -0
- package/registry/demos/page-header.js +11 -0
- package/registry/demos/page-header.tsx +5 -0
- package/registry/demos/popover.d.ts +7 -0
- package/registry/demos/popover.js +25 -0
- package/registry/demos/popover.tsx +31 -0
- package/registry/demos/progress.d.ts +5 -0
- package/registry/demos/progress.js +11 -0
- package/registry/demos/progress.tsx +5 -0
- package/registry/demos/radio-group.d.ts +5 -0
- package/registry/demos/radio-group.js +16 -0
- package/registry/demos/radio-group.tsx +14 -0
- package/registry/demos/separator.d.ts +5 -0
- package/registry/demos/separator.js +15 -0
- package/registry/demos/separator.tsx +11 -0
- package/registry/demos/skeleton.d.ts +5 -0
- package/registry/demos/skeleton.js +20 -0
- package/registry/demos/skeleton.tsx +16 -0
- package/registry/demos/slider.d.ts +5 -0
- package/registry/demos/slider.js +11 -0
- package/registry/demos/slider.tsx +5 -0
- package/registry/demos/slot.d.ts +5 -0
- package/registry/demos/slot.js +14 -0
- package/registry/demos/slot.tsx +13 -0
- package/registry/demos/spinner.d.ts +5 -0
- package/registry/demos/spinner.js +11 -0
- package/registry/demos/spinner.tsx +5 -0
- package/registry/demos/stat.d.ts +5 -0
- package/registry/demos/stat.js +11 -0
- package/registry/demos/stat.tsx +5 -0
- package/registry/demos/switch.d.ts +5 -0
- package/registry/demos/switch.js +11 -0
- package/registry/demos/switch.tsx +5 -0
- package/registry/demos/tabs.d.ts +5 -0
- package/registry/demos/tabs.js +22 -0
- package/registry/demos/tabs.tsx +28 -0
- package/registry/demos/theme.d.ts +5 -0
- package/registry/demos/theme.js +11 -0
- package/registry/demos/theme.tsx +9 -0
- package/registry/demos/toast.d.ts +8 -0
- package/registry/demos/toast.js +29 -0
- package/registry/demos/toast.tsx +31 -0
- package/registry/demos/tooltip.d.ts +7 -0
- package/registry/demos/tooltip.js +15 -0
- package/registry/demos/tooltip.tsx +15 -0
- package/registry/dialog.json +218 -0
- package/registry/dropdown-menu.json +63 -0
- package/registry/empty-state.json +59 -0
- package/registry/field.json +66 -0
- package/registry/index.json +320 -0
- package/registry/kbd.json +38 -0
- package/registry/page-header.json +66 -0
- package/registry/popover.json +44 -0
- package/registry/progress.json +80 -0
- package/registry/radio-group.json +64 -0
- package/registry/separator.json +25 -0
- package/registry/skeleton.json +38 -0
- package/registry/slider.json +95 -0
- package/registry/slot.json +31 -0
- package/registry/spinner.json +45 -0
- package/registry/stat.json +66 -0
- package/registry/switch.json +53 -0
- package/registry/tabs.json +44 -0
- package/registry/theme.json +78 -0
- package/registry/toast.json +54 -0
- package/registry/tooltip.json +91 -0
- package/dist/chunk-5FRYKFTO.js.map +0 -1
- package/dist/chunk-QRG5RYEI.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Countdown } from "@krizaka/ui/countdown";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
|
|
6
|
+
export default function CountdownDemo() {
|
|
7
|
+
// One hour, two minutes and three seconds from the first render.
|
|
8
|
+
const [target] = useState(() => Date.now() + 3_723_000);
|
|
9
|
+
return <Countdown target={target} units={{ d: "d", h: "h", m: "m", s: "s" }} label="Ends in" />;
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/dialog.tsx
|
|
4
|
+
import { Button } from "@krizaka/ui/button";
|
|
5
|
+
import { Dialog } from "@krizaka/ui/dialog";
|
|
6
|
+
import { Field, Input } from "@krizaka/ui/field";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function DialogDemo({ defaultOpen = false }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { defaultOpen, children: [
|
|
10
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { children: "Open" }) }),
|
|
11
|
+
/* @__PURE__ */ jsxs(Dialog.Content, { closeLabel: "Close", children: [
|
|
12
|
+
/* @__PURE__ */ jsxs(Dialog.Header, { children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Dialog.Title, { children: "Invite a collaborator" }),
|
|
14
|
+
/* @__PURE__ */ jsx(Dialog.Description, { children: "They get access to the drafts of this channel." })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ jsx(Dialog.Body, { children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Field.Label, { htmlFor: "invite-email", children: "Email" }),
|
|
18
|
+
/* @__PURE__ */ jsx(Input, { id: "invite-email", type: "email", placeholder: "name@example.com" })
|
|
19
|
+
] }) }),
|
|
20
|
+
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
21
|
+
/* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", children: "Cancel" }) }),
|
|
22
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", children: "Send the invitation" })
|
|
23
|
+
] })
|
|
24
|
+
] })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
DialogDemo as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Button } from "@krizaka/ui/button";
|
|
2
|
+
import { Dialog } from "@krizaka/ui/dialog";
|
|
3
|
+
import { Field, Input } from "@krizaka/ui/field";
|
|
4
|
+
|
|
5
|
+
export default function DialogDemo({ defaultOpen = false }: { defaultOpen?: boolean }) {
|
|
6
|
+
return (
|
|
7
|
+
<Dialog.Root defaultOpen={defaultOpen}>
|
|
8
|
+
<Dialog.Trigger asChild>
|
|
9
|
+
<Button>Open</Button>
|
|
10
|
+
</Dialog.Trigger>
|
|
11
|
+
<Dialog.Content closeLabel="Close">
|
|
12
|
+
<Dialog.Header>
|
|
13
|
+
<Dialog.Title>Invite a collaborator</Dialog.Title>
|
|
14
|
+
<Dialog.Description>They get access to the drafts of this channel.</Dialog.Description>
|
|
15
|
+
</Dialog.Header>
|
|
16
|
+
<Dialog.Body>
|
|
17
|
+
<Field.Root>
|
|
18
|
+
<Field.Label htmlFor="invite-email">Email</Field.Label>
|
|
19
|
+
<Input id="invite-email" type="email" placeholder="name@example.com" />
|
|
20
|
+
</Field.Root>
|
|
21
|
+
</Dialog.Body>
|
|
22
|
+
<Dialog.Footer>
|
|
23
|
+
<Dialog.Close asChild>
|
|
24
|
+
<Button variant="ghost">Cancel</Button>
|
|
25
|
+
</Dialog.Close>
|
|
26
|
+
<Button variant="primary">Send the invitation</Button>
|
|
27
|
+
</Dialog.Footer>
|
|
28
|
+
</Dialog.Content>
|
|
29
|
+
</Dialog.Root>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/dropdown-menu.tsx
|
|
4
|
+
import { Button } from "@krizaka/ui/button";
|
|
5
|
+
import { DropdownMenu } from "@krizaka/ui/dropdown-menu";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var icon = (d) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d }) });
|
|
8
|
+
function DropdownMenuDemo({ defaultOpen = false }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs(DropdownMenu.Root, { defaultOpen, modal: false, children: [
|
|
10
|
+
/* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: "Actions" }) }),
|
|
11
|
+
/* @__PURE__ */ jsxs(DropdownMenu.Content, { align: "center", children: [
|
|
12
|
+
/* @__PURE__ */ jsx(DropdownMenu.Label, { children: "Video" }),
|
|
13
|
+
/* @__PURE__ */ jsxs(DropdownMenu.Item, { children: [
|
|
14
|
+
icon("M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"),
|
|
15
|
+
"Edit"
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ jsxs(DropdownMenu.Item, { children: [
|
|
18
|
+
icon("M4 12v8h16v-8M16 6l-4-4-4 4M12 2v13"),
|
|
19
|
+
"Share"
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ jsxs(DropdownMenu.Item, { disabled: true, children: [
|
|
22
|
+
icon("M12 3v12M7 10l5 5 5-5M5 21h14"),
|
|
23
|
+
"Download"
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ jsx(DropdownMenu.CheckboxItem, { checked: true, children: "Pinned to the profile" }),
|
|
26
|
+
/* @__PURE__ */ jsx(DropdownMenu.Separator, {}),
|
|
27
|
+
/* @__PURE__ */ jsxs(DropdownMenu.Item, { tone: "danger", children: [
|
|
28
|
+
icon("M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"),
|
|
29
|
+
"Delete"
|
|
30
|
+
] })
|
|
31
|
+
] })
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
DropdownMenuDemo as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Button } from "@krizaka/ui/button";
|
|
2
|
+
import { DropdownMenu } from "@krizaka/ui/dropdown-menu";
|
|
3
|
+
|
|
4
|
+
const icon = (d: string) => (
|
|
5
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden>
|
|
6
|
+
<path d={d} />
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export default function DropdownMenuDemo({ defaultOpen = false }: { defaultOpen?: boolean }) {
|
|
11
|
+
return (
|
|
12
|
+
<DropdownMenu.Root defaultOpen={defaultOpen} modal={false}>
|
|
13
|
+
<DropdownMenu.Trigger asChild>
|
|
14
|
+
<Button variant="outline">Actions</Button>
|
|
15
|
+
</DropdownMenu.Trigger>
|
|
16
|
+
<DropdownMenu.Content align="center">
|
|
17
|
+
<DropdownMenu.Label>Video</DropdownMenu.Label>
|
|
18
|
+
<DropdownMenu.Item>{icon("M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z")}Edit</DropdownMenu.Item>
|
|
19
|
+
<DropdownMenu.Item>{icon("M4 12v8h16v-8M16 6l-4-4-4 4M12 2v13")}Share</DropdownMenu.Item>
|
|
20
|
+
<DropdownMenu.Item disabled>{icon("M12 3v12M7 10l5 5 5-5M5 21h14")}Download</DropdownMenu.Item>
|
|
21
|
+
<DropdownMenu.CheckboxItem checked>Pinned to the profile</DropdownMenu.CheckboxItem>
|
|
22
|
+
<DropdownMenu.Separator />
|
|
23
|
+
<DropdownMenu.Item tone="danger">{icon("M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6")}Delete</DropdownMenu.Item>
|
|
24
|
+
</DropdownMenu.Content>
|
|
25
|
+
</DropdownMenu.Root>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/empty-state.tsx
|
|
4
|
+
import { EmptyState } from "@krizaka/ui/empty-state";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var ICON = /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
7
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
8
|
+
/* @__PURE__ */ jsx("path", { d: "m10 9 5 3-5 3z" })
|
|
9
|
+
] });
|
|
10
|
+
function EmptyStateDemo() {
|
|
11
|
+
return /* @__PURE__ */ jsx(EmptyState, { icon: ICON, title: "No videos yet", description: "The videos you publish appear here." });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
EmptyStateDemo as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmptyState } from "@krizaka/ui/empty-state";
|
|
2
|
+
|
|
3
|
+
const ICON = (
|
|
4
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
5
|
+
<rect x="3" y="5" width="18" height="14" rx="2" />
|
|
6
|
+
<path d="m10 9 5 3-5 3z" />
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export default function EmptyStateDemo() {
|
|
11
|
+
return <EmptyState icon={ICON} title="No videos yet" description="The videos you publish appear here." />;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/field.tsx
|
|
4
|
+
import { Field, Input } from "@krizaka/ui/field";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function FieldDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
8
|
+
/* @__PURE__ */ jsx(Field.Label, { htmlFor: "email", children: "Email" }),
|
|
9
|
+
/* @__PURE__ */ jsx(Input, { id: "email", type: "email", "aria-describedby": "email-hint", placeholder: "you@example.com" }),
|
|
10
|
+
/* @__PURE__ */ jsx(Field.Hint, { id: "email-hint", children: "We never share it." })
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
FieldDemo as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Field, Input } from "@krizaka/ui/field";
|
|
2
|
+
|
|
3
|
+
export default function FieldDemo() {
|
|
4
|
+
return (
|
|
5
|
+
<Field.Root>
|
|
6
|
+
<Field.Label htmlFor="email">Email</Field.Label>
|
|
7
|
+
<Input id="email" type="email" aria-describedby="email-hint" placeholder="you@example.com" />
|
|
8
|
+
<Field.Hint id="email-hint">We never share it.</Field.Hint>
|
|
9
|
+
</Field.Root>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/page-header.tsx
|
|
4
|
+
import { PageHeader } from "@krizaka/ui/page-header";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function PageHeaderDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsx(PageHeader, { title: "Payouts", description: "Your earnings are paid every Monday to the account on file." });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
PageHeaderDemo as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/popover.tsx
|
|
4
|
+
import { Button } from "@krizaka/ui/button";
|
|
5
|
+
import { Field, Input } from "@krizaka/ui/field";
|
|
6
|
+
import { Popover } from "@krizaka/ui/popover";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function PopoverDemo({ defaultOpen = false }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { defaultOpen, children: [
|
|
10
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: "Set a goal" }) }),
|
|
11
|
+
/* @__PURE__ */ jsx(Popover.Content, { "aria-label": "Set a goal", align: "center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
12
|
+
/* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Field.Label, { htmlFor: "goal-amount", children: "Amount" }),
|
|
14
|
+
/* @__PURE__ */ jsx(Input, { id: "goal-amount", defaultValue: "250" })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Popover.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", children: "Cancel" }) }),
|
|
18
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "primary", children: "Save" })
|
|
19
|
+
] })
|
|
20
|
+
] }) })
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
PopoverDemo as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Button } from "@krizaka/ui/button";
|
|
2
|
+
import { Field, Input } from "@krizaka/ui/field";
|
|
3
|
+
import { Popover } from "@krizaka/ui/popover";
|
|
4
|
+
|
|
5
|
+
export default function PopoverDemo({ defaultOpen = false }: { defaultOpen?: boolean }) {
|
|
6
|
+
return (
|
|
7
|
+
<Popover.Root defaultOpen={defaultOpen}>
|
|
8
|
+
<Popover.Trigger asChild>
|
|
9
|
+
<Button variant="outline">Set a goal</Button>
|
|
10
|
+
</Popover.Trigger>
|
|
11
|
+
<Popover.Content aria-label="Set a goal" align="center">
|
|
12
|
+
<div className="flex flex-col gap-3">
|
|
13
|
+
<Field.Root>
|
|
14
|
+
<Field.Label htmlFor="goal-amount">Amount</Field.Label>
|
|
15
|
+
<Input id="goal-amount" defaultValue="250" />
|
|
16
|
+
</Field.Root>
|
|
17
|
+
<div className="flex justify-end gap-2">
|
|
18
|
+
<Popover.Close asChild>
|
|
19
|
+
<Button size="sm" variant="ghost">
|
|
20
|
+
Cancel
|
|
21
|
+
</Button>
|
|
22
|
+
</Popover.Close>
|
|
23
|
+
<Button size="sm" variant="primary">
|
|
24
|
+
Save
|
|
25
|
+
</Button>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</Popover.Content>
|
|
29
|
+
</Popover.Root>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/progress.tsx
|
|
4
|
+
import { Progress } from "@krizaka/ui/progress";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function ProgressDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsx(Progress, { label: "Upload", value: 64 });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
ProgressDemo as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/radio-group.tsx
|
|
4
|
+
import { RadioGroup } from "@krizaka/ui/radio-group";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function RadioGroupDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsxs(RadioGroup.Root, { label: "Notification frequency", defaultValue: "daily", children: [
|
|
8
|
+
/* @__PURE__ */ jsx(RadioGroup.Item, { value: "instant", children: "Instantly" }),
|
|
9
|
+
/* @__PURE__ */ jsx(RadioGroup.Item, { value: "daily", children: "Once a day" }),
|
|
10
|
+
/* @__PURE__ */ jsx(RadioGroup.Item, { value: "weekly", children: "Once a week" }),
|
|
11
|
+
/* @__PURE__ */ jsx(RadioGroup.Item, { value: "never", disabled: true, children: "Never" })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
RadioGroupDemo as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RadioGroup } from "@krizaka/ui/radio-group";
|
|
2
|
+
|
|
3
|
+
export default function RadioGroupDemo() {
|
|
4
|
+
return (
|
|
5
|
+
<RadioGroup.Root label="Notification frequency" defaultValue="daily">
|
|
6
|
+
<RadioGroup.Item value="instant">Instantly</RadioGroup.Item>
|
|
7
|
+
<RadioGroup.Item value="daily">Once a day</RadioGroup.Item>
|
|
8
|
+
<RadioGroup.Item value="weekly">Once a week</RadioGroup.Item>
|
|
9
|
+
<RadioGroup.Item value="never" disabled>
|
|
10
|
+
Never
|
|
11
|
+
</RadioGroup.Item>
|
|
12
|
+
</RadioGroup.Root>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/separator.tsx
|
|
4
|
+
import { Separator } from "@krizaka/ui/separator";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function SeparatorDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-72 flex-col gap-3 text-sm text-fg", children: [
|
|
8
|
+
/* @__PURE__ */ jsx("p", { children: "Account" }),
|
|
9
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
10
|
+
/* @__PURE__ */ jsx("p", { className: "text-fg-secondary", children: "Notifications" })
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
SeparatorDemo as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Separator } from "@krizaka/ui/separator";
|
|
2
|
+
|
|
3
|
+
export default function SeparatorDemo() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex w-72 flex-col gap-3 text-sm text-fg">
|
|
6
|
+
<p>Account</p>
|
|
7
|
+
<Separator />
|
|
8
|
+
<p className="text-fg-secondary">Notifications</p>
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/skeleton.tsx
|
|
4
|
+
import { Skeleton } from "@krizaka/ui/skeleton";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function SkeletonDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 rounded-xl border border-border-default bg-surface-1 p-4", children: [
|
|
8
|
+
/* @__PURE__ */ jsx(Skeleton, { shape: "rect", className: "h-32" }),
|
|
9
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
10
|
+
/* @__PURE__ */ jsx(Skeleton, { shape: "circle", className: "h-8" }),
|
|
11
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-2", children: [
|
|
12
|
+
/* @__PURE__ */ jsx(Skeleton, {}),
|
|
13
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "w-2/3" })
|
|
14
|
+
] })
|
|
15
|
+
] })
|
|
16
|
+
] });
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
SkeletonDemo as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Skeleton } from "@krizaka/ui/skeleton";
|
|
2
|
+
|
|
3
|
+
export default function SkeletonDemo() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex flex-col gap-3 rounded-xl border border-border-default bg-surface-1 p-4">
|
|
6
|
+
<Skeleton shape="rect" className="h-32" />
|
|
7
|
+
<div className="flex items-center gap-3">
|
|
8
|
+
<Skeleton shape="circle" className="h-8" />
|
|
9
|
+
<div className="flex flex-1 flex-col gap-2">
|
|
10
|
+
<Skeleton />
|
|
11
|
+
<Skeleton className="w-2/3" />
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/slider.tsx
|
|
4
|
+
import { Slider } from "@krizaka/ui/slider";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function SliderDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsx(Slider, { label: "Volume", defaultValue: 60 });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
SliderDemo as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/slot.tsx
|
|
4
|
+
import { Slot, VisuallyHidden } from "@krizaka/ui/slot";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function SlotDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsx(Slot, { className: "text-sm font-semibold text-fg underline underline-offset-4", children: /* @__PURE__ */ jsxs("a", { href: "#docs", children: [
|
|
8
|
+
"Read the docs",
|
|
9
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: " about Slot" })
|
|
10
|
+
] }) });
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
SlotDemo as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Slot, VisuallyHidden } from "@krizaka/ui/slot";
|
|
2
|
+
|
|
3
|
+
export default function SlotDemo() {
|
|
4
|
+
// Slot merges its props and classes into its only child: the link is rendered, styled by the Slot.
|
|
5
|
+
return (
|
|
6
|
+
<Slot className="text-sm font-semibold text-fg underline underline-offset-4">
|
|
7
|
+
<a href="#docs">
|
|
8
|
+
Read the docs
|
|
9
|
+
<VisuallyHidden> about Slot</VisuallyHidden>
|
|
10
|
+
</a>
|
|
11
|
+
</Slot>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/spinner.tsx
|
|
4
|
+
import { Spinner } from "@krizaka/ui/spinner";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function SpinnerDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsx(Spinner, { label: "Loading" });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
SpinnerDemo as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/stat.tsx
|
|
4
|
+
import { Stat } from "@krizaka/ui/stat";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function StatDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsx(Stat, { label: "Revenue", value: "\u20AC4,812", hint: "vs last month", trend: "up", trendLabel: "+12 %" });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
StatDemo as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/demos/switch.tsx
|
|
4
|
+
import { Switch } from "@krizaka/ui/switch";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function SwitchDemo() {
|
|
7
|
+
return /* @__PURE__ */ jsx(Switch, { label: "Autoplay" });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
SwitchDemo as default
|
|
11
|
+
};
|