tembro 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/display/index.cjs +1 -1
- package/dist/components/display/index.d.ts +0 -5
- package/dist/components/display/index.js +22 -27
- package/dist/components/form/demo.cjs +1 -1
- package/dist/components/form/demo.js +1 -2
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.d.ts +0 -1
- package/dist/components/form/index.js +8 -9
- package/dist/components/form/public.cjs +1 -1
- package/dist/components/form/public.d.ts +0 -1
- package/dist/components/form/public.js +8 -9
- package/dist/components/inputs/index.cjs +1 -1
- package/dist/components/inputs/index.d.ts +0 -2
- package/dist/components/inputs/index.js +3 -5
- package/dist/components/inputs/public.cjs +1 -1
- package/dist/components/inputs/public.d.ts +0 -2
- package/dist/components/inputs/public.js +3 -5
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.d.ts +0 -1
- package/dist/components/layout/index.js +4 -5
- package/dist/components/layout/public.cjs +1 -1
- package/dist/components/layout/public.d.ts +0 -1
- package/dist/components/layout/public.js +2 -3
- package/dist/components/modern/index.cjs +1 -1
- package/dist/components/modern/index.d.ts +0 -4
- package/dist/components/modern/index.js +12 -16
- package/dist/index.cjs +1 -1
- package/dist/index.js +117 -130
- package/dist/public-component-surface.cjs +1 -1
- package/dist/public-component-surface.js +0 -65
- package/dist/showcase/fallback.cjs +3 -3
- package/dist/showcase/fallback.js +140 -314
- package/dist/showcase/premium/index.cjs +1 -1
- package/dist/showcase/premium/index.js +431 -497
- package/dist/showcase/registry-quality.cjs +1 -1
- package/dist/showcase/registry-quality.js +0 -1
- package/dist/showcase/tembro-registry.json.cjs +1 -1
- package/dist/showcase/tembro-registry.json.js +3 -11
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +2 -2
- package/packages/cli/vendor/src/components/display/index.ts +0 -5
- package/packages/cli/vendor/src/components/form/demo.tsx +0 -1
- package/packages/cli/vendor/src/components/form/index.ts +0 -1
- package/packages/cli/vendor/src/components/form/public.ts +0 -2
- package/packages/cli/vendor/src/components/inputs/index.ts +0 -2
- package/packages/cli/vendor/src/components/inputs/public.ts +0 -2
- package/packages/cli/vendor/src/components/layout/index.ts +0 -1
- package/packages/cli/vendor/src/components/layout/public.ts +0 -1
- package/packages/cli/vendor/src/components/modern/index.ts +1 -5
- package/packages/cli/vendor/src/public-component-surface.ts +0 -13
- package/packages/cli/vendor/src/showcase/fallback.tsx +3 -164
- package/packages/cli/vendor/src/showcase/premium/index.ts +0 -22
- package/packages/cli/vendor/src/showcase/registry-quality.ts +0 -2
- package/packages/cli/vendor/src/showcase/tembro-registry.json +224 -251
- package/registry.json +296 -324
- package/dist/components/display/aspect-ratio.cjs +0 -1
- package/dist/components/display/aspect-ratio.d.ts +0 -6
- package/dist/components/display/aspect-ratio.js +0 -21
- package/dist/components/display/float-button.cjs +0 -1
- package/dist/components/display/float-button.d.ts +0 -6
- package/dist/components/display/float-button.js +0 -20
- package/dist/components/display/key-value-card.cjs +0 -1
- package/dist/components/display/key-value-card.d.ts +0 -16
- package/dist/components/display/key-value-card.js +0 -35
- package/dist/components/display/keyboard-shortcut.cjs +0 -1
- package/dist/components/display/keyboard-shortcut.d.ts +0 -7
- package/dist/components/display/keyboard-shortcut.js +0 -18
- package/dist/components/display/skeleton-form.cjs +0 -1
- package/dist/components/display/skeleton-form.d.ts +0 -9
- package/dist/components/display/skeleton-form.js +0 -31
- package/dist/components/display/skeleton-table.cjs +0 -1
- package/dist/components/display/skeleton-table.d.ts +0 -9
- package/dist/components/display/skeleton-table.js +0 -42
- package/dist/components/display/tag-list.cjs +0 -1
- package/dist/components/display/tag-list.d.ts +0 -17
- package/dist/components/display/tag-list.js +0 -30
- package/dist/components/display/watermark.cjs +0 -1
- package/dist/components/display/watermark.d.ts +0 -6
- package/dist/components/display/watermark.js +0 -23
- package/dist/components/form/repeater-field.cjs +0 -1
- package/dist/components/form/repeater-field.d.ts +0 -16
- package/dist/components/form/repeater-field.js +0 -48
- package/dist/components/inputs/cascader.cjs +0 -1
- package/dist/components/inputs/cascader.d.ts +0 -13
- package/dist/components/inputs/cascader.js +0 -58
- package/dist/components/inputs/mention-input.cjs +0 -1
- package/dist/components/inputs/mention-input.d.ts +0 -18
- package/dist/components/inputs/mention-input.js +0 -96
- package/dist/components/layout/stack.cjs +0 -1
- package/dist/components/layout/stack.d.ts +0 -23
- package/dist/components/layout/stack.js +0 -57
- package/dist/components/modern/affix.cjs +0 -1
- package/dist/components/modern/affix.d.ts +0 -7
- package/dist/components/modern/affix.js +0 -18
- package/dist/showcase/premium/affix/index.cjs +0 -1
- package/dist/showcase/premium/affix/index.d.ts +0 -2
- package/dist/showcase/premium/affix/index.js +0 -3
- package/dist/showcase/premium/affix/mock.cjs +0 -12
- package/dist/showcase/premium/affix/mock.d.ts +0 -2
- package/dist/showcase/premium/affix/mock.js +0 -15
- package/dist/showcase/premium/affix/showcase.cjs +0 -1
- package/dist/showcase/premium/affix/showcase.d.ts +0 -2
- package/dist/showcase/premium/affix/showcase.js +0 -64
- package/dist/showcase/premium/aspect-ratio/index.cjs +0 -1
- package/dist/showcase/premium/aspect-ratio/index.d.ts +0 -2
- package/dist/showcase/premium/aspect-ratio/index.js +0 -3
- package/dist/showcase/premium/aspect-ratio/mock.cjs +0 -11
- package/dist/showcase/premium/aspect-ratio/mock.d.ts +0 -2
- package/dist/showcase/premium/aspect-ratio/mock.js +0 -26
- package/dist/showcase/premium/aspect-ratio/showcase.cjs +0 -1
- package/dist/showcase/premium/aspect-ratio/showcase.d.ts +0 -2
- package/dist/showcase/premium/aspect-ratio/showcase.js +0 -53
- package/dist/showcase/premium/cascader/index.cjs +0 -1
- package/dist/showcase/premium/cascader/index.d.ts +0 -2
- package/dist/showcase/premium/cascader/index.js +0 -3
- package/dist/showcase/premium/cascader/mock.cjs +0 -9
- package/dist/showcase/premium/cascader/mock.d.ts +0 -2
- package/dist/showcase/premium/cascader/mock.js +0 -19
- package/dist/showcase/premium/cascader/showcase.cjs +0 -1
- package/dist/showcase/premium/cascader/showcase.d.ts +0 -2
- package/dist/showcase/premium/cascader/showcase.js +0 -43
- package/dist/showcase/premium/float-button/index.cjs +0 -1
- package/dist/showcase/premium/float-button/index.d.ts +0 -2
- package/dist/showcase/premium/float-button/index.js +0 -3
- package/dist/showcase/premium/float-button/mock.cjs +0 -10
- package/dist/showcase/premium/float-button/mock.d.ts +0 -2
- package/dist/showcase/premium/float-button/mock.js +0 -15
- package/dist/showcase/premium/float-button/showcase.cjs +0 -1
- package/dist/showcase/premium/float-button/showcase.d.ts +0 -2
- package/dist/showcase/premium/float-button/showcase.js +0 -28
- package/dist/showcase/premium/keyboard-shortcut/index.cjs +0 -1
- package/dist/showcase/premium/keyboard-shortcut/index.d.ts +0 -2
- package/dist/showcase/premium/keyboard-shortcut/index.js +0 -3
- package/dist/showcase/premium/keyboard-shortcut/mock.cjs +0 -5
- package/dist/showcase/premium/keyboard-shortcut/mock.d.ts +0 -2
- package/dist/showcase/premium/keyboard-shortcut/mock.js +0 -26
- package/dist/showcase/premium/keyboard-shortcut/showcase.cjs +0 -1
- package/dist/showcase/premium/keyboard-shortcut/showcase.d.ts +0 -1
- package/dist/showcase/premium/keyboard-shortcut/showcase.js +0 -64
- package/dist/showcase/premium/mention-input/index.cjs +0 -1
- package/dist/showcase/premium/mention-input/index.d.ts +0 -2
- package/dist/showcase/premium/mention-input/index.js +0 -3
- package/dist/showcase/premium/mention-input/mock.cjs +0 -11
- package/dist/showcase/premium/mention-input/mock.d.ts +0 -2
- package/dist/showcase/premium/mention-input/mock.js +0 -19
- package/dist/showcase/premium/mention-input/showcase.cjs +0 -1
- package/dist/showcase/premium/mention-input/showcase.d.ts +0 -2
- package/dist/showcase/premium/mention-input/showcase.js +0 -35
- package/dist/showcase/premium/skeleton-form/index.cjs +0 -1
- package/dist/showcase/premium/skeleton-form/index.d.ts +0 -2
- package/dist/showcase/premium/skeleton-form/index.js +0 -3
- package/dist/showcase/premium/skeleton-form/mock.cjs +0 -5
- package/dist/showcase/premium/skeleton-form/mock.d.ts +0 -2
- package/dist/showcase/premium/skeleton-form/mock.js +0 -19
- package/dist/showcase/premium/skeleton-form/showcase.cjs +0 -1
- package/dist/showcase/premium/skeleton-form/showcase.d.ts +0 -2
- package/dist/showcase/premium/skeleton-form/showcase.js +0 -52
- package/dist/showcase/premium/skeleton-table/index.cjs +0 -1
- package/dist/showcase/premium/skeleton-table/index.d.ts +0 -2
- package/dist/showcase/premium/skeleton-table/index.js +0 -3
- package/dist/showcase/premium/skeleton-table/mock.cjs +0 -5
- package/dist/showcase/premium/skeleton-table/mock.d.ts +0 -2
- package/dist/showcase/premium/skeleton-table/mock.js +0 -19
- package/dist/showcase/premium/skeleton-table/showcase.cjs +0 -1
- package/dist/showcase/premium/skeleton-table/showcase.d.ts +0 -2
- package/dist/showcase/premium/skeleton-table/showcase.js +0 -59
- package/dist/showcase/premium/stack/index.cjs +0 -1
- package/dist/showcase/premium/stack/index.d.ts +0 -2
- package/dist/showcase/premium/stack/index.js +0 -3
- package/dist/showcase/premium/stack/mock.cjs +0 -10
- package/dist/showcase/premium/stack/mock.d.ts +0 -2
- package/dist/showcase/premium/stack/mock.js +0 -26
- package/dist/showcase/premium/stack/showcase.cjs +0 -1
- package/dist/showcase/premium/stack/showcase.d.ts +0 -1
- package/dist/showcase/premium/stack/showcase.js +0 -47
- package/dist/showcase/premium/tag-list/index.cjs +0 -1
- package/dist/showcase/premium/tag-list/index.d.ts +0 -2
- package/dist/showcase/premium/tag-list/index.js +0 -3
- package/dist/showcase/premium/tag-list/mock.cjs +0 -12
- package/dist/showcase/premium/tag-list/mock.d.ts +0 -2
- package/dist/showcase/premium/tag-list/mock.js +0 -26
- package/dist/showcase/premium/tag-list/showcase.cjs +0 -1
- package/dist/showcase/premium/tag-list/showcase.d.ts +0 -2
- package/dist/showcase/premium/tag-list/showcase.js +0 -83
- package/dist/showcase/premium/watermark/index.cjs +0 -1
- package/dist/showcase/premium/watermark/index.d.ts +0 -2
- package/dist/showcase/premium/watermark/index.js +0 -3
- package/dist/showcase/premium/watermark/mock.cjs +0 -11
- package/dist/showcase/premium/watermark/mock.d.ts +0 -2
- package/dist/showcase/premium/watermark/mock.js +0 -26
- package/dist/showcase/premium/watermark/showcase.cjs +0 -1
- package/dist/showcase/premium/watermark/showcase.d.ts +0 -2
- package/dist/showcase/premium/watermark/showcase.js +0 -34
- package/packages/cli/vendor/src/components/display/aspect-ratio.tsx +0 -22
- package/packages/cli/vendor/src/components/display/float-button.tsx +0 -27
- package/packages/cli/vendor/src/components/display/key-value-card.tsx +0 -50
- package/packages/cli/vendor/src/components/display/keyboard-shortcut.tsx +0 -31
- package/packages/cli/vendor/src/components/display/skeleton-form.tsx +0 -51
- package/packages/cli/vendor/src/components/display/skeleton-table.tsx +0 -59
- package/packages/cli/vendor/src/components/display/tag-list.tsx +0 -52
- package/packages/cli/vendor/src/components/display/watermark.tsx +0 -20
- package/packages/cli/vendor/src/components/form/repeater-field.tsx +0 -93
- package/packages/cli/vendor/src/components/inputs/cascader.tsx +0 -41
- package/packages/cli/vendor/src/components/inputs/mention-input.tsx +0 -162
- package/packages/cli/vendor/src/components/layout/stack.tsx +0 -106
- package/packages/cli/vendor/src/components/modern/affix.tsx +0 -21
- package/packages/cli/vendor/src/showcase/premium/affix/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/affix/mock.ts +0 -26
- package/packages/cli/vendor/src/showcase/premium/affix/showcase.tsx +0 -37
- package/packages/cli/vendor/src/showcase/premium/aspect-ratio/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/aspect-ratio/mock.ts +0 -26
- package/packages/cli/vendor/src/showcase/premium/aspect-ratio/showcase.tsx +0 -37
- package/packages/cli/vendor/src/showcase/premium/cascader/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/cascader/mock.ts +0 -24
- package/packages/cli/vendor/src/showcase/premium/cascader/showcase.tsx +0 -20
- package/packages/cli/vendor/src/showcase/premium/float-button/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/float-button/mock.ts +0 -24
- package/packages/cli/vendor/src/showcase/premium/float-button/showcase.tsx +0 -21
- package/packages/cli/vendor/src/showcase/premium/keyboard-shortcut/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/keyboard-shortcut/mock.ts +0 -20
- package/packages/cli/vendor/src/showcase/premium/keyboard-shortcut/showcase.tsx +0 -42
- package/packages/cli/vendor/src/showcase/premium/mention-input/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/mention-input/mock.ts +0 -26
- package/packages/cli/vendor/src/showcase/premium/mention-input/showcase.tsx +0 -27
- package/packages/cli/vendor/src/showcase/premium/skeleton-form/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/skeleton-form/mock.ts +0 -20
- package/packages/cli/vendor/src/showcase/premium/skeleton-form/showcase.tsx +0 -34
- package/packages/cli/vendor/src/showcase/premium/skeleton-table/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/skeleton-table/mock.ts +0 -20
- package/packages/cli/vendor/src/showcase/premium/skeleton-table/showcase.tsx +0 -37
- package/packages/cli/vendor/src/showcase/premium/stack/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/stack/mock.ts +0 -25
- package/packages/cli/vendor/src/showcase/premium/stack/showcase.tsx +0 -22
- package/packages/cli/vendor/src/showcase/premium/tag-list/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/tag-list/mock.ts +0 -27
- package/packages/cli/vendor/src/showcase/premium/tag-list/showcase.tsx +0 -55
- package/packages/cli/vendor/src/showcase/premium/watermark/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/watermark/mock.ts +0 -26
- package/packages/cli/vendor/src/showcase/premium/watermark/showcase.tsx +0 -26
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/display/aspect-ratio.tsx
|
|
5
|
-
function n({ ratio: n = 16 / 9, className: r, style: i, children: a, ...o }) {
|
|
6
|
-
return /* @__PURE__ */ t("div", {
|
|
7
|
-
"data-slot": "aspect-ratio",
|
|
8
|
-
className: e("relative w-full overflow-hidden", r),
|
|
9
|
-
style: {
|
|
10
|
-
aspectRatio: String(n),
|
|
11
|
-
...i
|
|
12
|
-
},
|
|
13
|
-
...o,
|
|
14
|
-
children: /* @__PURE__ */ t("div", {
|
|
15
|
-
className: "absolute inset-0",
|
|
16
|
-
children: a
|
|
17
|
-
})
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { n as AspectRatio };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var i={"bottom-right":`bottom-6 right-6`,"bottom-left":`bottom-6 left-6`,"top-right":`right-6 top-6`,"top-left":`left-6 top-6`};function a({placement:e=`bottom-right`,className:n,...a}){return(0,r.jsx)(`button`,{type:`button`,"data-slot":`float-button`,className:t.cn(`fixed z-50 inline-flex size-12 items-center justify-center rounded-full border bg-primary text-primary-foreground shadow-lg transition hover:opacity-90`,i[e],n),...a})}exports.FloatButton=a;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type FloatButtonProps = React.ComponentProps<"button"> & {
|
|
3
|
-
placement?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
4
|
-
};
|
|
5
|
-
declare function FloatButton({ placement, className, ...props }: FloatButtonProps): React.JSX.Element;
|
|
6
|
-
export { FloatButton };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/display/float-button.tsx
|
|
5
|
-
var n = {
|
|
6
|
-
"bottom-right": "bottom-6 right-6",
|
|
7
|
-
"bottom-left": "bottom-6 left-6",
|
|
8
|
-
"top-right": "right-6 top-6",
|
|
9
|
-
"top-left": "left-6 top-6"
|
|
10
|
-
};
|
|
11
|
-
function r({ placement: r = "bottom-right", className: i, ...a }) {
|
|
12
|
-
return /* @__PURE__ */ t("button", {
|
|
13
|
-
type: "button",
|
|
14
|
-
"data-slot": "float-button",
|
|
15
|
-
className: e("fixed z-50 inline-flex size-12 items-center justify-center rounded-full border bg-primary text-primary-foreground shadow-lg transition hover:opacity-90", n[r], i),
|
|
16
|
-
...a
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
export { r as FloatButton };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");function a({title:e,description:r,items:a,columns:o=1,className:s,...c}){return(0,i.jsxs)(n.Card,{"data-slot":`key-value-card`,className:s,...c,children:[(e||r)&&(0,i.jsxs)(n.CardHeader,{children:[e&&(0,i.jsx)(n.CardTitle,{children:e}),r&&(0,i.jsx)(n.CardDescription,{children:r})]}),(0,i.jsx)(n.CardContent,{children:(0,i.jsx)(`dl`,{className:t.cn(`grid gap-3`,o===1&&`grid-cols-1`,o===2&&`grid-cols-1 sm:grid-cols-2`),children:a.map(e=>(0,i.jsxs)(`div`,{"data-slot":`key-value-card-item`,className:`min-w-0 rounded-lg border bg-muted/25 p-3`,children:[(0,i.jsx)(`dt`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:e.label}),(0,i.jsx)(`dd`,{className:`mt-1 break-words text-sm font-semibold text-foreground`,children:e.value}),e.description&&(0,i.jsx)(`dd`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:e.description})]},e.key))})})]})}exports.KeyValueCard=a;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { type CardProps } from "@/components/ui/card";
|
|
3
|
-
export type KeyValueCardItem = {
|
|
4
|
-
key: string;
|
|
5
|
-
label: React.ReactNode;
|
|
6
|
-
value: React.ReactNode;
|
|
7
|
-
description?: React.ReactNode;
|
|
8
|
-
};
|
|
9
|
-
export type KeyValueCardProps = Omit<CardProps, "children"> & {
|
|
10
|
-
title?: React.ReactNode;
|
|
11
|
-
description?: React.ReactNode;
|
|
12
|
-
items: KeyValueCardItem[];
|
|
13
|
-
columns?: 1 | 2;
|
|
14
|
-
};
|
|
15
|
-
declare function KeyValueCard({ title, description, items, columns, className, ...props }: KeyValueCardProps): React.JSX.Element;
|
|
16
|
-
export { KeyValueCard };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { Card as t, CardContent as n, CardDescription as r, CardHeader as i, CardTitle as a } from "../ui/card/index.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/display/key-value-card.tsx
|
|
6
|
-
function c({ title: c, description: l, items: u, columns: d = 1, className: f, ...p }) {
|
|
7
|
-
return /* @__PURE__ */ s(t, {
|
|
8
|
-
"data-slot": "key-value-card",
|
|
9
|
-
className: f,
|
|
10
|
-
...p,
|
|
11
|
-
children: [(c || l) && /* @__PURE__ */ s(i, { children: [c && /* @__PURE__ */ o(a, { children: c }), l && /* @__PURE__ */ o(r, { children: l })] }), /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o("dl", {
|
|
12
|
-
className: e("grid gap-3", d === 1 && "grid-cols-1", d === 2 && "grid-cols-1 sm:grid-cols-2"),
|
|
13
|
-
children: u.map((e) => /* @__PURE__ */ s("div", {
|
|
14
|
-
"data-slot": "key-value-card-item",
|
|
15
|
-
className: "min-w-0 rounded-lg border bg-muted/25 p-3",
|
|
16
|
-
children: [
|
|
17
|
-
/* @__PURE__ */ o("dt", {
|
|
18
|
-
className: "text-xs font-medium uppercase tracking-wide text-muted-foreground",
|
|
19
|
-
children: e.label
|
|
20
|
-
}),
|
|
21
|
-
/* @__PURE__ */ o("dd", {
|
|
22
|
-
className: "mt-1 break-words text-sm font-semibold text-foreground",
|
|
23
|
-
children: e.value
|
|
24
|
-
}),
|
|
25
|
-
e.description && /* @__PURE__ */ o("dd", {
|
|
26
|
-
className: "mt-1 text-xs leading-5 text-muted-foreground",
|
|
27
|
-
children: e.description
|
|
28
|
-
})
|
|
29
|
-
]
|
|
30
|
-
}, e.key))
|
|
31
|
-
}) })]
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { c as KeyValueCard };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({keys:e,separator:i=`+`,className:a,children:o,...s}){let c=e?.length?e.map((e,t)=>(0,r.jsxs)(n.Fragment,{children:[t>0&&(0,r.jsx)(`span`,{className:`text-muted-foreground`,children:i}),(0,r.jsx)(`span`,{children:e})]},t)):o;return(0,r.jsx)(`kbd`,{"data-slot":`keyboard-shortcut`,className:t.cn(`inline-flex items-center gap-1 rounded border bg-muted px-1.5 py-0.5 font-mono text-[11px] font-medium text-muted-foreground`,a),...s,children:c})}exports.KeyboardShortcut=i;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type KeyboardShortcutProps = React.ComponentProps<"kbd"> & {
|
|
3
|
-
keys?: React.ReactNode[];
|
|
4
|
-
separator?: React.ReactNode;
|
|
5
|
-
};
|
|
6
|
-
declare function KeyboardShortcut({ keys, separator, className, children, ...props }: KeyboardShortcutProps): React.JSX.Element;
|
|
7
|
-
export { KeyboardShortcut };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import * as t from "react";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/display/keyboard-shortcut.tsx
|
|
5
|
-
function i({ keys: i, separator: a = "+", className: o, children: s, ...c }) {
|
|
6
|
-
let l = i?.length ? i.map((e, i) => /* @__PURE__ */ r(t.Fragment, { children: [i > 0 && /* @__PURE__ */ n("span", {
|
|
7
|
-
className: "text-muted-foreground",
|
|
8
|
-
children: a
|
|
9
|
-
}), /* @__PURE__ */ n("span", { children: e })] }, i)) : s;
|
|
10
|
-
return /* @__PURE__ */ n("kbd", {
|
|
11
|
-
"data-slot": "keyboard-shortcut",
|
|
12
|
-
className: e("inline-flex items-center gap-1 rounded border bg-muted px-1.5 py-0.5 font-mono text-[11px] font-medium text-muted-foreground", o),
|
|
13
|
-
...c,
|
|
14
|
-
children: l
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { i as KeyboardShortcut };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/skeleton/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");function a({fields:e=4,showTitle:r=!0,showActions:a=!0,columns:o=1,className:s,...c}){return(0,i.jsxs)(`div`,{"data-slot":`skeleton-form`,className:t.cn(`w-full space-y-6`,s),...c,children:[r&&(0,i.jsxs)(`div`,{className:`space-y-2 border-b pb-4`,children:[(0,i.jsx)(n.Skeleton,{className:`h-6 w-1/3`}),(0,i.jsx)(n.Skeleton,{className:`h-4 w-1/2`})]}),(0,i.jsx)(`div`,{className:t.cn(`grid gap-6`,o===2&&`sm:grid-cols-2`),children:Array.from({length:e}).map((e,t)=>(0,i.jsxs)(`div`,{className:`space-y-2`,children:[(0,i.jsx)(n.Skeleton,{className:`h-4 w-20`}),(0,i.jsx)(n.Skeleton,{className:`h-10 w-full`})]},t))}),a&&(0,i.jsxs)(`div`,{className:`flex justify-end gap-2 pt-4`,children:[(0,i.jsx)(n.Skeleton,{className:`h-10 w-24`}),(0,i.jsx)(n.Skeleton,{className:`h-10 w-24`})]})]})}exports.SkeletonForm=a;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type SkeletonFormProps = React.ComponentProps<"div"> & {
|
|
3
|
-
fields?: number;
|
|
4
|
-
showTitle?: boolean;
|
|
5
|
-
showActions?: boolean;
|
|
6
|
-
columns?: 1 | 2;
|
|
7
|
-
};
|
|
8
|
-
declare function SkeletonForm({ fields, showTitle, showActions, columns, className, ...props }: SkeletonFormProps): React.JSX.Element;
|
|
9
|
-
export { SkeletonForm };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { Skeleton as t } from "../ui/skeleton/index.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/display/skeleton-form.tsx
|
|
6
|
-
function i({ fields: i = 4, showTitle: a = !0, showActions: o = !0, columns: s = 1, className: c, ...l }) {
|
|
7
|
-
return /* @__PURE__ */ r("div", {
|
|
8
|
-
"data-slot": "skeleton-form",
|
|
9
|
-
className: e("w-full space-y-6", c),
|
|
10
|
-
...l,
|
|
11
|
-
children: [
|
|
12
|
-
a && /* @__PURE__ */ r("div", {
|
|
13
|
-
className: "space-y-2 border-b pb-4",
|
|
14
|
-
children: [/* @__PURE__ */ n(t, { className: "h-6 w-1/3" }), /* @__PURE__ */ n(t, { className: "h-4 w-1/2" })]
|
|
15
|
-
}),
|
|
16
|
-
/* @__PURE__ */ n("div", {
|
|
17
|
-
className: e("grid gap-6", s === 2 && "sm:grid-cols-2"),
|
|
18
|
-
children: Array.from({ length: i }).map((e, i) => /* @__PURE__ */ r("div", {
|
|
19
|
-
className: "space-y-2",
|
|
20
|
-
children: [/* @__PURE__ */ n(t, { className: "h-4 w-20" }), /* @__PURE__ */ n(t, { className: "h-10 w-full" })]
|
|
21
|
-
}, i))
|
|
22
|
-
}),
|
|
23
|
-
o && /* @__PURE__ */ r("div", {
|
|
24
|
-
className: "flex justify-end gap-2 pt-4",
|
|
25
|
-
children: [/* @__PURE__ */ n(t, { className: "h-10 w-24" }), /* @__PURE__ */ n(t, { className: "h-10 w-24" })]
|
|
26
|
-
})
|
|
27
|
-
]
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
export { i as SkeletonForm };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/skeleton/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");function a({rows:e=5,columns:r=4,showHeader:a=!0,showToolbar:o=!1,className:s,...c}){return(0,i.jsxs)(`div`,{"data-slot":`skeleton-table`,className:t.cn(`w-full space-y-4`,s),...c,children:[o&&(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsx)(n.Skeleton,{className:`h-8 w-[250px]`}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(n.Skeleton,{className:`h-8 w-[100px]`}),(0,i.jsx)(n.Skeleton,{className:`h-8 w-[80px]`})]})]}),(0,i.jsxs)(`div`,{className:`rounded-md border`,children:[a&&(0,i.jsx)(`div`,{className:`border-b bg-muted/50`,children:(0,i.jsx)(`div`,{className:`flex px-4 py-3`,children:Array.from({length:r}).map((e,t)=>(0,i.jsx)(`div`,{className:`flex-1 pr-4`,children:(0,i.jsx)(n.Skeleton,{className:`h-4 w-24`})},t))})}),(0,i.jsx)(`div`,{className:`divide-y`,children:Array.from({length:e}).map((e,a)=>(0,i.jsx)(`div`,{className:`flex px-4 py-3`,children:Array.from({length:r}).map((e,r)=>(0,i.jsx)(`div`,{className:`flex-1 pr-4`,children:(0,i.jsx)(n.Skeleton,{className:t.cn(`h-4`,r===0?`w-full max-w-[200px]`:`w-1/2`)})},r))},a))})]})]})}exports.SkeletonTable=a;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type SkeletonTableProps = React.ComponentProps<"div"> & {
|
|
3
|
-
rows?: number;
|
|
4
|
-
columns?: number;
|
|
5
|
-
showHeader?: boolean;
|
|
6
|
-
showToolbar?: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare function SkeletonTable({ rows, columns, showHeader, showToolbar, className, ...props }: SkeletonTableProps): React.JSX.Element;
|
|
9
|
-
export { SkeletonTable };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { Skeleton as t } from "../ui/skeleton/index.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/display/skeleton-table.tsx
|
|
6
|
-
function i({ rows: i = 5, columns: a = 4, showHeader: o = !0, showToolbar: s = !1, className: c, ...l }) {
|
|
7
|
-
return /* @__PURE__ */ r("div", {
|
|
8
|
-
"data-slot": "skeleton-table",
|
|
9
|
-
className: e("w-full space-y-4", c),
|
|
10
|
-
...l,
|
|
11
|
-
children: [s && /* @__PURE__ */ r("div", {
|
|
12
|
-
className: "flex items-center justify-between",
|
|
13
|
-
children: [/* @__PURE__ */ n(t, { className: "h-8 w-[250px]" }), /* @__PURE__ */ r("div", {
|
|
14
|
-
className: "flex items-center gap-2",
|
|
15
|
-
children: [/* @__PURE__ */ n(t, { className: "h-8 w-[100px]" }), /* @__PURE__ */ n(t, { className: "h-8 w-[80px]" })]
|
|
16
|
-
})]
|
|
17
|
-
}), /* @__PURE__ */ r("div", {
|
|
18
|
-
className: "rounded-md border",
|
|
19
|
-
children: [o && /* @__PURE__ */ n("div", {
|
|
20
|
-
className: "border-b bg-muted/50",
|
|
21
|
-
children: /* @__PURE__ */ n("div", {
|
|
22
|
-
className: "flex px-4 py-3",
|
|
23
|
-
children: Array.from({ length: a }).map((e, r) => /* @__PURE__ */ n("div", {
|
|
24
|
-
className: "flex-1 pr-4",
|
|
25
|
-
children: /* @__PURE__ */ n(t, { className: "h-4 w-24" })
|
|
26
|
-
}, r))
|
|
27
|
-
})
|
|
28
|
-
}), /* @__PURE__ */ n("div", {
|
|
29
|
-
className: "divide-y",
|
|
30
|
-
children: Array.from({ length: i }).map((r, i) => /* @__PURE__ */ n("div", {
|
|
31
|
-
className: "flex px-4 py-3",
|
|
32
|
-
children: Array.from({ length: a }).map((r, i) => /* @__PURE__ */ n("div", {
|
|
33
|
-
className: "flex-1 pr-4",
|
|
34
|
-
children: /* @__PURE__ */ n(t, { className: e("h-4", i === 0 ? "w-full max-w-[200px]" : "w-1/2") })
|
|
35
|
-
}, i))
|
|
36
|
-
}, i))
|
|
37
|
-
})]
|
|
38
|
-
})]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { i as SkeletonTable };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/badge/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");function o({items:e,max:r,removable:o=!1,onRemove:s,overflowLabel:c=e=>`+${e}`,className:l,...u}){let d=typeof r==`number`?e.slice(0,r):e,f=typeof r==`number`?Math.max(e.length-r,0):0;return(0,a.jsxs)(`div`,{"data-slot":`tag-list`,className:t.cn(`flex flex-wrap items-center gap-1.5`,l),...u,children:[d.map(e=>(0,a.jsxs)(n.Badge,{variant:e.variant,className:t.cn(`gap-1`,e.disabled&&`opacity-55`),children:[(0,a.jsx)(`span`,{children:e.label}),o&&!e.disabled&&(0,a.jsx)(`button`,{type:`button`,"aria-label":`Remove tag`,className:`rounded-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>s?.(e),children:(0,a.jsx)(i.XIcon,{className:`size-3`})})]},e.key)),f>0&&(0,a.jsx)(n.Badge,{variant:`outline`,children:c(f)})]})}exports.TagList=o;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Badge } from "@/components/ui/badge";
|
|
3
|
-
export type TagListItem = {
|
|
4
|
-
key: string;
|
|
5
|
-
label: React.ReactNode;
|
|
6
|
-
variant?: React.ComponentProps<typeof Badge>["variant"];
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type TagListProps = React.ComponentProps<"div"> & {
|
|
10
|
-
items: TagListItem[];
|
|
11
|
-
max?: number;
|
|
12
|
-
removable?: boolean;
|
|
13
|
-
onRemove?: (item: TagListItem) => void;
|
|
14
|
-
overflowLabel?: (count: number) => React.ReactNode;
|
|
15
|
-
};
|
|
16
|
-
declare function TagList({ items, max, removable, onRemove, overflowLabel, className, ...props }: TagListProps): React.JSX.Element;
|
|
17
|
-
export { TagList };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { Badge as t } from "../ui/badge/index.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { XIcon as n } from "lucide-react";
|
|
5
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/display/tag-list.tsx
|
|
7
|
-
function a({ items: a, max: o, removable: s = !1, onRemove: c, overflowLabel: l = (e) => `+${e}`, className: u, ...d }) {
|
|
8
|
-
let f = typeof o == "number" ? a.slice(0, o) : a, p = typeof o == "number" ? Math.max(a.length - o, 0) : 0;
|
|
9
|
-
return /* @__PURE__ */ i("div", {
|
|
10
|
-
"data-slot": "tag-list",
|
|
11
|
-
className: e("flex flex-wrap items-center gap-1.5", u),
|
|
12
|
-
...d,
|
|
13
|
-
children: [f.map((a) => /* @__PURE__ */ i(t, {
|
|
14
|
-
variant: a.variant,
|
|
15
|
-
className: e("gap-1", a.disabled && "opacity-55"),
|
|
16
|
-
children: [/* @__PURE__ */ r("span", { children: a.label }), s && !a.disabled && /* @__PURE__ */ r("button", {
|
|
17
|
-
type: "button",
|
|
18
|
-
"aria-label": "Remove tag",
|
|
19
|
-
className: "rounded-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
20
|
-
onClick: () => c?.(a),
|
|
21
|
-
children: /* @__PURE__ */ r(n, { className: "size-3" })
|
|
22
|
-
})]
|
|
23
|
-
}, a.key)), p > 0 && /* @__PURE__ */ r(t, {
|
|
24
|
-
variant: "outline",
|
|
25
|
-
children: l(p)
|
|
26
|
-
})]
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { a as TagList };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({text:e=`Azamat UI`,className:n,children:i,...a}){return(0,r.jsxs)(`div`,{"data-slot":`watermark`,className:t.cn(`relative overflow-hidden`,n),...a,children:[(0,r.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-0 grid place-items-center opacity-10`,children:(0,r.jsx)(`span`,{className:`rotate-[-24deg] select-none text-4xl font-bold tracking-widest text-muted-foreground`,children:e})}),(0,r.jsx)(`div`,{className:`relative z-10`,children:i})]})}exports.Watermark=i;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/display/watermark.tsx
|
|
5
|
-
function r({ text: r = "Azamat UI", className: i, children: a, ...o }) {
|
|
6
|
-
return /* @__PURE__ */ n("div", {
|
|
7
|
-
"data-slot": "watermark",
|
|
8
|
-
className: e("relative overflow-hidden", i),
|
|
9
|
-
...o,
|
|
10
|
-
children: [/* @__PURE__ */ t("div", {
|
|
11
|
-
className: "pointer-events-none absolute inset-0 z-0 grid place-items-center opacity-10",
|
|
12
|
-
children: /* @__PURE__ */ t("span", {
|
|
13
|
-
className: "rotate-[-24deg] select-none text-4xl font-bold tracking-widest text-muted-foreground",
|
|
14
|
-
children: r
|
|
15
|
-
})
|
|
16
|
-
}), /* @__PURE__ */ t("div", {
|
|
17
|
-
className: "relative z-10",
|
|
18
|
-
children: a
|
|
19
|
-
})]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { r as Watermark };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");function o({value:e,onValueChange:r,renderItem:o,createItem:s,addLabel:c=`Add item`,max:l=1/0,min:u=0,disabled:d=!1,className:f,...p}){let m=()=>{e.length<l&&r([...e,s()])},h=t=>{e.length>u&&r(e.filter((e,n)=>n!==t))},g=(t,n)=>{let i=[...e];i[t]=n,r(i)},_=e.length<l&&!d,v=e.length>u&&!d;return(0,a.jsxs)(`div`,{"data-slot":`repeater-field`,className:t.cn(`flex flex-col gap-4`,f),...p,children:[e.map((e,t)=>(0,a.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,a.jsx)(`div`,{className:`flex-1 min-w-0`,children:o(e,t,{remove:()=>h(t),update:e=>g(t,e)})}),v&&(0,a.jsx)(n.Button,{type:`button`,variant:`outline`,size:`icon`,className:`shrink-0 text-muted-foreground hover:text-destructive`,onClick:()=>h(t),"aria-label":`Remove item`,children:(0,a.jsx)(i.Trash2Icon,{className:`size-4`})})]},t)),_&&(0,a.jsx)(`div`,{children:(0,a.jsxs)(n.Button,{type:`button`,variant:`outline`,size:`sm`,onClick:m,className:`w-full sm:w-auto`,children:[(0,a.jsx)(i.PlusIcon,{className:`mr-2 size-4`}),c]})})]})}exports.RepeaterField=o;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type RepeaterFieldProps<T> = Omit<React.ComponentProps<"div">, "value" | "onChange"> & {
|
|
3
|
-
value: T[];
|
|
4
|
-
onValueChange: (value: T[]) => void;
|
|
5
|
-
renderItem: (item: T, index: number, helpers: {
|
|
6
|
-
remove: () => void;
|
|
7
|
-
update: (item: T) => void;
|
|
8
|
-
}) => React.ReactNode;
|
|
9
|
-
createItem: () => T;
|
|
10
|
-
addLabel?: React.ReactNode;
|
|
11
|
-
max?: number;
|
|
12
|
-
min?: number;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
};
|
|
15
|
-
declare function RepeaterField<T>({ value, onValueChange, renderItem, createItem, addLabel, max, min, disabled, className, ...props }: RepeaterFieldProps<T>): React.JSX.Element;
|
|
16
|
-
export { RepeaterField };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { Button as t } from "../ui/button/index.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { PlusIcon as n, Trash2Icon as r } from "lucide-react";
|
|
5
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/form/repeater-field.tsx
|
|
7
|
-
function o({ value: o, onValueChange: s, renderItem: c, createItem: l, addLabel: u = "Add item", max: d = Infinity, min: f = 0, disabled: p = !1, className: m, ...h }) {
|
|
8
|
-
let g = () => {
|
|
9
|
-
o.length < d && s([...o, l()]);
|
|
10
|
-
}, _ = (e) => {
|
|
11
|
-
o.length > f && s(o.filter((t, n) => n !== e));
|
|
12
|
-
}, v = (e, t) => {
|
|
13
|
-
let n = [...o];
|
|
14
|
-
n[e] = t, s(n);
|
|
15
|
-
}, y = o.length < d && !p, b = o.length > f && !p;
|
|
16
|
-
return /* @__PURE__ */ a("div", {
|
|
17
|
-
"data-slot": "repeater-field",
|
|
18
|
-
className: e("flex flex-col gap-4", m),
|
|
19
|
-
...h,
|
|
20
|
-
children: [o.map((e, n) => /* @__PURE__ */ a("div", {
|
|
21
|
-
className: "flex items-start gap-2",
|
|
22
|
-
children: [/* @__PURE__ */ i("div", {
|
|
23
|
-
className: "flex-1 min-w-0",
|
|
24
|
-
children: c(e, n, {
|
|
25
|
-
remove: () => _(n),
|
|
26
|
-
update: (e) => v(n, e)
|
|
27
|
-
})
|
|
28
|
-
}), b && /* @__PURE__ */ i(t, {
|
|
29
|
-
type: "button",
|
|
30
|
-
variant: "outline",
|
|
31
|
-
size: "icon",
|
|
32
|
-
className: "shrink-0 text-muted-foreground hover:text-destructive",
|
|
33
|
-
onClick: () => _(n),
|
|
34
|
-
"aria-label": "Remove item",
|
|
35
|
-
children: /* @__PURE__ */ i(r, { className: "size-4" })
|
|
36
|
-
})]
|
|
37
|
-
}, n)), y && /* @__PURE__ */ i("div", { children: /* @__PURE__ */ a(t, {
|
|
38
|
-
type: "button",
|
|
39
|
-
variant: "outline",
|
|
40
|
-
size: "sm",
|
|
41
|
-
onClick: g,
|
|
42
|
-
className: "w-full sm:w-auto",
|
|
43
|
-
children: [/* @__PURE__ */ i(n, { className: "mr-2 size-4" }), u]
|
|
44
|
-
}) })]
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
export { o as RepeaterField };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({options:e,value:n=[],onValueChange:i,className:a,...o}){let s=n[0]??``,c=e.find(e=>e.value===s)?.children??[],l=n[1]??``,u=c.find(e=>e.value===l)?.children??[];return(0,r.jsxs)(`div`,{"data-slot":`cascader`,className:t.cn(`grid gap-2 sm:grid-cols-3`,a),...o,children:[(0,r.jsxs)(`select`,{className:`h-10 rounded-md border bg-background px-3 text-sm`,value:s,onChange:e=>i?.([e.target.value]),children:[(0,r.jsx)(`option`,{value:``,children:`Select`}),e.map(e=>(0,r.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),(0,r.jsxs)(`select`,{className:`h-10 rounded-md border bg-background px-3 text-sm`,value:l,disabled:!c.length,onChange:e=>i?.([s,e.target.value]),children:[(0,r.jsx)(`option`,{value:``,children:`Select`}),c.map(e=>(0,r.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),(0,r.jsxs)(`select`,{className:`h-10 rounded-md border bg-background px-3 text-sm`,value:n[2]??``,disabled:!u.length,onChange:e=>i?.([s,l,e.target.value]),children:[(0,r.jsx)(`option`,{value:``,children:`Select`}),u.map(e=>(0,r.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]})}exports.Cascader=i;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type CascaderOption = {
|
|
3
|
-
label: React.ReactNode;
|
|
4
|
-
value: string;
|
|
5
|
-
children?: CascaderOption[];
|
|
6
|
-
};
|
|
7
|
-
export type CascaderProps = React.ComponentProps<"div"> & {
|
|
8
|
-
options: CascaderOption[];
|
|
9
|
-
value?: string[];
|
|
10
|
-
onValueChange?: (value: string[]) => void;
|
|
11
|
-
};
|
|
12
|
-
declare function Cascader({ options, value, onValueChange, className, ...props }: CascaderProps): React.JSX.Element;
|
|
13
|
-
export { Cascader };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/inputs/cascader.tsx
|
|
5
|
-
function r({ options: r, value: i = [], onValueChange: a, className: o, ...s }) {
|
|
6
|
-
let c = i[0] ?? "", l = r.find((e) => e.value === c)?.children ?? [], u = i[1] ?? "", d = l.find((e) => e.value === u)?.children ?? [];
|
|
7
|
-
return /* @__PURE__ */ n("div", {
|
|
8
|
-
"data-slot": "cascader",
|
|
9
|
-
className: e("grid gap-2 sm:grid-cols-3", o),
|
|
10
|
-
...s,
|
|
11
|
-
children: [
|
|
12
|
-
/* @__PURE__ */ n("select", {
|
|
13
|
-
className: "h-10 rounded-md border bg-background px-3 text-sm",
|
|
14
|
-
value: c,
|
|
15
|
-
onChange: (e) => a?.([e.target.value]),
|
|
16
|
-
children: [/* @__PURE__ */ t("option", {
|
|
17
|
-
value: "",
|
|
18
|
-
children: "Select"
|
|
19
|
-
}), r.map((e) => /* @__PURE__ */ t("option", {
|
|
20
|
-
value: e.value,
|
|
21
|
-
children: e.label
|
|
22
|
-
}, e.value))]
|
|
23
|
-
}),
|
|
24
|
-
/* @__PURE__ */ n("select", {
|
|
25
|
-
className: "h-10 rounded-md border bg-background px-3 text-sm",
|
|
26
|
-
value: u,
|
|
27
|
-
disabled: !l.length,
|
|
28
|
-
onChange: (e) => a?.([c, e.target.value]),
|
|
29
|
-
children: [/* @__PURE__ */ t("option", {
|
|
30
|
-
value: "",
|
|
31
|
-
children: "Select"
|
|
32
|
-
}), l.map((e) => /* @__PURE__ */ t("option", {
|
|
33
|
-
value: e.value,
|
|
34
|
-
children: e.label
|
|
35
|
-
}, e.value))]
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ n("select", {
|
|
38
|
-
className: "h-10 rounded-md border bg-background px-3 text-sm",
|
|
39
|
-
value: i[2] ?? "",
|
|
40
|
-
disabled: !d.length,
|
|
41
|
-
onChange: (e) => a?.([
|
|
42
|
-
c,
|
|
43
|
-
u,
|
|
44
|
-
e.target.value
|
|
45
|
-
]),
|
|
46
|
-
children: [/* @__PURE__ */ t("option", {
|
|
47
|
-
value: "",
|
|
48
|
-
children: "Select"
|
|
49
|
-
}), d.map((e) => /* @__PURE__ */ t("option", {
|
|
50
|
-
value: e.value,
|
|
51
|
-
children: e.label
|
|
52
|
-
}, e.value))]
|
|
53
|
-
})
|
|
54
|
-
]
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
export { r as Cascader };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i(e,t,n){let r=e.slice(0,t),i=r.lastIndexOf(n);if(i<0)return null;let a=r[i-1];if(a&&/\S/.test(a))return null;let o=r.slice(i+n.length);return/\s/.test(o)?null:{triggerIndex:i,query:o}}function a({value:e,defaultValue:a=``,options:o=[],onMentionSelect:s,onValueChange:c,className:l,trigger:u=`@`,maxSuggestions:d=6,onChange:f,onKeyDown:p,...m}){let h=n.useRef(null),[g,_]=n.useState(a),[v,y]=n.useState(0),[b,x]=n.useState(0),S=e??g,C=i(S,v,u),w=n.useMemo(()=>{if(!C)return[];let e=C.query.trim().toLowerCase();return o.filter(t=>{if(!e)return!0;let n=typeof t.label==`string`?t.label:t.value;return`${t.value} ${t.searchText??``} ${n}`.toLowerCase().includes(e)}).slice(0,d)},[d,o,C]),T=w.length>0&&C!==null;n.useEffect(()=>{T||x(0)},[T]);function E(t,n){e===void 0&&_(t),c?.(t),n&&f?.(n)}function D(t){if(!C)return;let n=t.insertValue??t.value,r=`${S.slice(0,C.triggerIndex)}${u}${n} ${S.slice(v)}`,i=C.triggerIndex+u.length+n.length+1;e===void 0&&_(r),c?.(r),s?.(t.value),requestAnimationFrame(()=>{h.current?.focus(),h.current?.setSelectionRange(i,i),y(i)})}return(0,r.jsxs)(`div`,{"data-slot":`mention-input`,className:`grid gap-2`,children:[(0,r.jsx)(`textarea`,{ref:h,value:S,className:t.cn(`min-h-24 rounded-md border bg-background p-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring`,l),onChange:e=>{E(e.target.value,e),y(e.target.selectionStart??e.target.value.length)},onClick:e=>y(e.currentTarget.selectionStart??0),onKeyUp:e=>y(e.currentTarget.selectionStart??0),onKeyDown:e=>{if(T){if(e.key===`ArrowDown`){e.preventDefault(),x(e=>(e+1)%w.length);return}if(e.key===`ArrowUp`){e.preventDefault(),x(e=>(e-1+w.length)%w.length);return}if(e.key===`Enter`||e.key===`Tab`){e.preventDefault(),D(w[b]??w[0]);return}if(e.key===`Escape`){e.preventDefault(),y(S.length);return}}p?.(e)},...m}),T?(0,r.jsx)(`div`,{className:`grid gap-1 rounded-xl border bg-card p-2 shadow-sm`,children:w.map((e,n)=>(0,r.jsxs)(`button`,{type:`button`,className:t.cn(`flex items-center justify-between rounded-lg px-3 py-2 text-left text-sm transition-colors hover:bg-muted`,n===b&&`bg-muted`),onMouseDown:e=>e.preventDefault(),onClick:()=>D(e),children:[(0,r.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,r.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[u,e.insertValue??e.value]})]},e.value))}):null]})}exports.MentionInput=a;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type MentionOption = {
|
|
3
|
-
label: React.ReactNode;
|
|
4
|
-
value: string;
|
|
5
|
-
searchText?: string;
|
|
6
|
-
insertValue?: string;
|
|
7
|
-
};
|
|
8
|
-
export type MentionInputProps = Omit<React.ComponentProps<"textarea">, "value" | "defaultValue"> & {
|
|
9
|
-
value?: string;
|
|
10
|
-
defaultValue?: string;
|
|
11
|
-
options?: MentionOption[];
|
|
12
|
-
onMentionSelect?: (value: string) => void;
|
|
13
|
-
onValueChange?: (value: string) => void;
|
|
14
|
-
trigger?: string;
|
|
15
|
-
maxSuggestions?: number;
|
|
16
|
-
};
|
|
17
|
-
declare function MentionInput({ value, defaultValue, options, onMentionSelect, onValueChange, className, trigger, maxSuggestions, onChange, onKeyDown, ...props }: MentionInputProps): React.JSX.Element;
|
|
18
|
-
export { MentionInput };
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import * as t from "react";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/inputs/mention-input.tsx
|
|
5
|
-
function i(e, t, n) {
|
|
6
|
-
let r = e.slice(0, t), i = r.lastIndexOf(n);
|
|
7
|
-
if (i < 0) return null;
|
|
8
|
-
let a = r[i - 1];
|
|
9
|
-
if (a && /\S/.test(a)) return null;
|
|
10
|
-
let o = r.slice(i + n.length);
|
|
11
|
-
return /\s/.test(o) ? null : {
|
|
12
|
-
triggerIndex: i,
|
|
13
|
-
query: o
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function a({ value: a, defaultValue: o = "", options: s = [], onMentionSelect: c, onValueChange: l, className: u, trigger: d = "@", maxSuggestions: f = 6, onChange: p, onKeyDown: m, ...h }) {
|
|
17
|
-
let g = t.useRef(null), [_, v] = t.useState(o), [y, b] = t.useState(0), [x, S] = t.useState(0), C = a ?? _, w = i(C, y, d), T = t.useMemo(() => {
|
|
18
|
-
if (!w) return [];
|
|
19
|
-
let e = w.query.trim().toLowerCase();
|
|
20
|
-
return s.filter((t) => {
|
|
21
|
-
if (!e) return !0;
|
|
22
|
-
let n = typeof t.label == "string" ? t.label : t.value;
|
|
23
|
-
return `${t.value} ${t.searchText ?? ""} ${n}`.toLowerCase().includes(e);
|
|
24
|
-
}).slice(0, f);
|
|
25
|
-
}, [
|
|
26
|
-
f,
|
|
27
|
-
s,
|
|
28
|
-
w
|
|
29
|
-
]), E = T.length > 0 && w !== null;
|
|
30
|
-
t.useEffect(() => {
|
|
31
|
-
E || S(0);
|
|
32
|
-
}, [E]);
|
|
33
|
-
function D(e, t) {
|
|
34
|
-
a === void 0 && v(e), l?.(e), t && p?.(t);
|
|
35
|
-
}
|
|
36
|
-
function O(e) {
|
|
37
|
-
if (!w) return;
|
|
38
|
-
let t = e.insertValue ?? e.value, n = `${C.slice(0, w.triggerIndex)}${d}${t} ${C.slice(y)}`, r = w.triggerIndex + d.length + t.length + 1;
|
|
39
|
-
a === void 0 && v(n), l?.(n), c?.(e.value), requestAnimationFrame(() => {
|
|
40
|
-
g.current?.focus(), g.current?.setSelectionRange(r, r), b(r);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return /* @__PURE__ */ r("div", {
|
|
44
|
-
"data-slot": "mention-input",
|
|
45
|
-
className: "grid gap-2",
|
|
46
|
-
children: [/* @__PURE__ */ n("textarea", {
|
|
47
|
-
ref: g,
|
|
48
|
-
value: C,
|
|
49
|
-
className: e("min-h-24 rounded-md border bg-background p-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring", u),
|
|
50
|
-
onChange: (e) => {
|
|
51
|
-
D(e.target.value, e), b(e.target.selectionStart ?? e.target.value.length);
|
|
52
|
-
},
|
|
53
|
-
onClick: (e) => b(e.currentTarget.selectionStart ?? 0),
|
|
54
|
-
onKeyUp: (e) => b(e.currentTarget.selectionStart ?? 0),
|
|
55
|
-
onKeyDown: (e) => {
|
|
56
|
-
if (E) {
|
|
57
|
-
if (e.key === "ArrowDown") {
|
|
58
|
-
e.preventDefault(), S((e) => (e + 1) % T.length);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (e.key === "ArrowUp") {
|
|
62
|
-
e.preventDefault(), S((e) => (e - 1 + T.length) % T.length);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (e.key === "Enter" || e.key === "Tab") {
|
|
66
|
-
e.preventDefault(), O(T[x] ?? T[0]);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (e.key === "Escape") {
|
|
70
|
-
e.preventDefault(), b(C.length);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
m?.(e);
|
|
75
|
-
},
|
|
76
|
-
...h
|
|
77
|
-
}), E ? /* @__PURE__ */ n("div", {
|
|
78
|
-
className: "grid gap-1 rounded-xl border bg-card p-2 shadow-sm",
|
|
79
|
-
children: T.map((t, i) => /* @__PURE__ */ r("button", {
|
|
80
|
-
type: "button",
|
|
81
|
-
className: e("flex items-center justify-between rounded-lg px-3 py-2 text-left text-sm transition-colors hover:bg-muted", i === x && "bg-muted"),
|
|
82
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
83
|
-
onClick: () => O(t),
|
|
84
|
-
children: [/* @__PURE__ */ n("span", {
|
|
85
|
-
className: "font-medium",
|
|
86
|
-
children: t.label
|
|
87
|
-
}), /* @__PURE__ */ r("span", {
|
|
88
|
-
className: "text-xs text-muted-foreground",
|
|
89
|
-
children: [d, t.insertValue ?? t.value]
|
|
90
|
-
})]
|
|
91
|
-
}, t.value))
|
|
92
|
-
}) : null]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
//#endregion
|
|
96
|
-
export { a as MentionInput };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var i={xs:`gap-2`,sm:`gap-3`,md:`gap-4`,lg:`gap-6`,xl:`gap-8`},a={start:`items-start`,center:`items-center`,end:`items-end`,stretch:`items-stretch`},o={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`},s={1:`grid-cols-1`,2:`grid-cols-2`,3:`grid-cols-3`,4:`grid-cols-4`,5:`grid-cols-5`,6:`grid-cols-6`};function c({gap:e=`md`,splitAfter:n,className:a,children:o,...s}){return(0,r.jsxs)(`div`,{"data-slot":`stack`,className:t.cn(`flex min-w-0 flex-col`,i[e],a),...s,children:[o,n?(0,r.jsx)(`div`,{"data-slot":`stack-split-after`,children:n}):null]})}function l({gap:e=`md`,align:n=`center`,justify:s=`start`,wrap:c=!0,className:l,children:u,...d}){return(0,r.jsx)(`div`,{"data-slot":`inline`,className:t.cn(`flex min-w-0`,i[e],a[n],o[s],c?`flex-wrap`:`flex-nowrap`,l),...d,children:u})}function u({gap:e=`md`,columns:n=2,className:a,children:o,...c}){return(0,r.jsx)(`div`,{"data-slot":`grid`,className:t.cn(`grid min-w-0`,i[e],s[n],a),...c,children:o})}exports.Grid=u,exports.Inline=l,exports.Stack=c;
|