@zedtech/zedkit-ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -9
- package/dist/alert.d.ts +9 -0
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +27 -0
- package/dist/alert.js.map +1 -0
- package/dist/app-shell.d.ts +9 -0
- package/dist/app-shell.d.ts.map +1 -0
- package/dist/app-shell.js +6 -0
- package/dist/app-shell.js.map +1 -0
- package/dist/badge.d.ts +10 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +19 -0
- package/dist/badge.js.map +1 -0
- package/dist/button.d.ts +12 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +32 -0
- package/dist/button.js.map +1 -0
- package/dist/card.d.ts +9 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +18 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.d.ts +5 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +11 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/checkmark.d.ts +11 -0
- package/dist/checkmark.d.ts.map +1 -0
- package/dist/checkmark.js +12 -0
- package/dist/checkmark.js.map +1 -0
- package/dist/confirm-dialog.d.ts +17 -0
- package/dist/confirm-dialog.d.ts.map +1 -0
- package/dist/confirm-dialog.js +18 -0
- package/dist/confirm-dialog.js.map +1 -0
- package/dist/data-table.d.ts +33 -0
- package/dist/data-table.d.ts.map +1 -0
- package/dist/data-table.js +40 -0
- package/dist/data-table.js.map +1 -0
- package/dist/detail-panel.d.ts +11 -0
- package/dist/detail-panel.d.ts.map +1 -0
- package/dist/detail-panel.js +6 -0
- package/dist/detail-panel.js.map +1 -0
- package/dist/dialog.d.ts +14 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +27 -0
- package/dist/dialog.js.map +1 -0
- package/dist/drawer.d.ts +30 -0
- package/dist/drawer.d.ts.map +1 -0
- package/dist/drawer.js +35 -0
- package/dist/drawer.js.map +1 -0
- package/dist/field.d.ts +26 -0
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +75 -0
- package/dist/field.js.map +1 -0
- package/dist/form-submit.d.ts +16 -0
- package/dist/form-submit.d.ts.map +1 -0
- package/dist/form-submit.js +15 -0
- package/dist/form-submit.js.map +1 -0
- package/dist/form.d.ts +26 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +66 -0
- package/dist/form.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/input.d.ts +4 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +10 -0
- package/dist/input.js.map +1 -0
- package/dist/label.d.ts +6 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +12 -0
- package/dist/label.js.map +1 -0
- package/dist/layout.d.ts +22 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +36 -0
- package/dist/layout.js.map +1 -0
- package/dist/live-pulse.d.ts +7 -0
- package/dist/live-pulse.d.ts.map +1 -0
- package/dist/live-pulse.js +7 -0
- package/dist/live-pulse.js.map +1 -0
- package/dist/option-cards.d.ts +15 -0
- package/dist/option-cards.d.ts.map +1 -0
- package/dist/option-cards.js +9 -0
- package/dist/option-cards.js.map +1 -0
- package/dist/page-header.d.ts +9 -0
- package/dist/page-header.d.ts.map +1 -0
- package/dist/page-header.js +6 -0
- package/dist/page-header.js.map +1 -0
- package/dist/progress-bar.d.ts +16 -0
- package/dist/progress-bar.d.ts.map +1 -0
- package/dist/progress-bar.js +16 -0
- package/dist/progress-bar.js.map +1 -0
- package/dist/secret-field.d.ts +22 -0
- package/dist/secret-field.d.ts.map +1 -0
- package/dist/secret-field.js +26 -0
- package/dist/secret-field.js.map +1 -0
- package/dist/select.d.ts +14 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +31 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.d.ts +5 -0
- package/dist/separator.d.ts.map +1 -0
- package/dist/separator.js +10 -0
- package/dist/separator.js.map +1 -0
- package/dist/skeleton.d.ts +3 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +8 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/sonner.d.ts +8 -0
- package/dist/sonner.d.ts.map +1 -0
- package/dist/sonner.js +20 -0
- package/dist/sonner.js.map +1 -0
- package/dist/status-dot.d.ts +13 -0
- package/dist/status-dot.d.ts.map +1 -0
- package/dist/status-dot.js +20 -0
- package/dist/status-dot.js.map +1 -0
- package/dist/switch.d.ts +5 -0
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.js +10 -0
- package/dist/switch.js.map +1 -0
- package/dist/table.d.ts +11 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +28 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.d.ts +8 -0
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +15 -0
- package/dist/tabs.js.map +1 -0
- package/dist/textarea.d.ts +4 -0
- package/dist/textarea.d.ts.map +1 -0
- package/dist/textarea.js +10 -0
- package/dist/textarea.js.map +1 -0
- package/dist/typography.d.ts +22 -0
- package/dist/typography.d.ts.map +1 -0
- package/dist/typography.js +39 -0
- package/dist/typography.js.map +1 -0
- package/dist/use-validated-form.d.ts +10 -0
- package/dist/use-validated-form.d.ts.map +1 -0
- package/dist/use-validated-form.js +20 -0
- package/dist/use-validated-form.js.map +1 -0
- package/dist/utils.d.ts +8 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +12 -0
- package/dist/utils.js.map +1 -0
- package/dist/wizard-steps.d.ts +8 -0
- package/dist/wizard-steps.d.ts.map +1 -0
- package/dist/wizard-steps.js +7 -0
- package/dist/wizard-steps.js.map +1 -0
- package/package.json +23 -3
- package/src/alert.tsx +1 -0
- package/src/badge.tsx +1 -0
- package/src/button.tsx +1 -0
- package/src/card.tsx +1 -0
- package/src/checkbox.tsx +1 -0
- package/src/checkmark.tsx +34 -0
- package/src/dialog.tsx +1 -0
- package/src/drawer.tsx +140 -0
- package/src/field.tsx +1 -0
- package/src/form.tsx +1 -0
- package/src/index.ts +16 -0
- package/src/input.tsx +1 -0
- package/src/label.tsx +1 -0
- package/src/live-pulse.tsx +2 -8
- package/src/progress-bar.tsx +45 -0
- package/src/select.tsx +1 -0
- package/src/separator.tsx +1 -0
- package/src/skeleton.tsx +1 -0
- package/src/sonner.tsx +1 -0
- package/src/status-dot.tsx +42 -0
- package/src/styles.css +15 -0
- package/src/switch.tsx +1 -0
- package/src/table.tsx +1 -0
- package/src/tabs.tsx +1 -0
- package/src/textarea.tsx +1 -0
- package/src/utils.ts +1 -0
package/dist/drawer.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3
|
+
declare const Drawer: typeof import("vaul").Root;
|
|
4
|
+
declare const DrawerTrigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DrawerClose: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const DrawerPortal: typeof import("vaul").Portal;
|
|
7
|
+
declare function DrawerOverlay({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay> & {
|
|
8
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function DrawerContent({ className, children, ref, modal, ...props }: React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {
|
|
11
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
12
|
+
/**
|
|
13
|
+
* Mirror of the `Drawer` root `modal` prop: `false` renders no
|
|
14
|
+
* overlay so the background stays interactive. Defaults to `true`.
|
|
15
|
+
*/
|
|
16
|
+
modal?: boolean;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function DrawerHandle({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Handle> & {
|
|
19
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
20
|
+
}): React.JSX.Element;
|
|
21
|
+
declare function DrawerHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
22
|
+
declare function DrawerFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
23
|
+
declare function DrawerTitle({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title> & {
|
|
24
|
+
ref?: React.Ref<HTMLHeadingElement>;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
declare function DrawerDescription({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description> & {
|
|
27
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
28
|
+
}): React.JSX.Element;
|
|
29
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, };
|
|
30
|
+
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../src/drawer.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAC;AAGjD,QAAA,MAAM,MAAM,4BAAuB,CAAC;AACpC,QAAA,MAAM,aAAa,+HAA0B,CAAC;AAC9C,QAAA,MAAM,WAAW,6HAAwB,CAAC;AAC1C,QAAA,MAAM,YAAY,8BAAyB,CAAC;AAE5C,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,K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,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;CACvC,qBAQA;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
|
package/dist/drawer.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Derived from shadcn/ui (drawer) — see Provenance in packages/ui/README.md. Adapted: direction-aware
|
|
2
|
+
// positioning via data variants (vaul sets data-vaul-drawer-direction on the content), drag handle and
|
|
3
|
+
// close left to the consumer to compose, ref-as-prop (React 19). Vaul injects its own base CSS
|
|
4
|
+
// (drag transitions, open/close keyframes) at import; the kit adds no drawer CSS.
|
|
5
|
+
"use client";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
8
|
+
import { cn } from "./utils.js";
|
|
9
|
+
const Drawer = DrawerPrimitive.Root;
|
|
10
|
+
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
11
|
+
const DrawerClose = DrawerPrimitive.Close;
|
|
12
|
+
const DrawerPortal = DrawerPrimitive.Portal;
|
|
13
|
+
function DrawerOverlay({ className, ref, ...props }) {
|
|
14
|
+
return (_jsx(DrawerPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-overlay/80", className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function DrawerContent({ className, children, ref, modal = true, ...props }) {
|
|
17
|
+
return (_jsxs(DrawerPortal, { children: [modal ? _jsx(DrawerOverlay, {}) : null, _jsx(DrawerPrimitive.Content, { ref: ref, className: cn("fixed z-50 flex flex-col border bg-background", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:max-h-[96dvh] data-[vaul-drawer-direction=bottom]:rounded-t-xl", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:max-h-[96dvh] data-[vaul-drawer-direction=top]:rounded-b-xl", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-full data-[vaul-drawer-direction=right]:sm:max-w-md", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-full data-[vaul-drawer-direction=left]:sm:max-w-md", className), ...props, children: children })] }));
|
|
18
|
+
}
|
|
19
|
+
function DrawerHandle({ className, ref, ...props }) {
|
|
20
|
+
return (_jsx(DrawerPrimitive.Handle, { ref: ref, className: cn("mx-auto mt-4 h-1.5 w-12 shrink-0 rounded-full bg-muted", className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function DrawerHeader({ className, ...props }) {
|
|
23
|
+
return (_jsx("div", { className: cn("flex flex-col gap-1.5 p-4 text-center sm:text-left", className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function DrawerFooter({ className, ...props }) {
|
|
26
|
+
return _jsx("div", { className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props });
|
|
27
|
+
}
|
|
28
|
+
function DrawerTitle({ className, ref, ...props }) {
|
|
29
|
+
return (_jsx(DrawerPrimitive.Title, { ref: ref, className: cn("text-lg leading-none font-semibold tracking-tight", className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
function DrawerDescription({ className, ref, ...props }) {
|
|
32
|
+
return (_jsx(DrawerPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, };
|
|
35
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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GAAG,EACR,SAAS,EAAE,EAAE,CAAC,wDAAwD,EAAE,SAAS,CAAC,KAC9E,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwC;IACjF,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CAAC,oDAAoD,EAAE,SAAS,CAAC,KAC1E,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwC;IACjF,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACzF,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EAGT;IACC,OAAO,CACL,KAAC,eAAe,CAAC,KAAK,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,mDAAmD,EAAE,SAAS,CAAC,KACzE,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EAGT;IACC,OAAO,CACL,KAAC,eAAe,CAAC,WAAW,IAC1B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
|
package/dist/field.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Label } from "./label.js";
|
|
4
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): React.JSX.Element;
|
|
5
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
|
|
6
|
+
variant?: "legend" | "label";
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare const fieldVariants: (props?: ({
|
|
10
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): React.JSX.Element;
|
|
13
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): React.JSX.Element;
|
|
15
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
17
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
|
|
21
|
+
errors?: Array<{
|
|
22
|
+
message?: string;
|
|
23
|
+
} | undefined>;
|
|
24
|
+
}): React.JSX.Element | null;
|
|
25
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
26
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../src/field.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0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;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,qBAmBA;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,CAAC;CAClD,4BAmCA;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,UAAU,GACX,CAAC"}
|
package/dist/field.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Derived from shadcn/ui (field) — see Provenance in packages/ui/README.md. Tolerated exception: migrated to custom code only when customization needs it.
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { cn } from "./utils.js";
|
|
7
|
+
import { Label } from "./label.js";
|
|
8
|
+
import { Separator } from "./separator.js";
|
|
9
|
+
function FieldSet({ className, ...props }) {
|
|
10
|
+
return (_jsx("fieldset", { "data-slot": "field-set", className: cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
13
|
+
return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
function FieldGroup({ className, ...props }) {
|
|
16
|
+
return (_jsx("div", { "data-slot": "field-group", className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
19
|
+
variants: {
|
|
20
|
+
orientation: {
|
|
21
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
22
|
+
horizontal: [
|
|
23
|
+
"flex-row items-center",
|
|
24
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
25
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
26
|
+
],
|
|
27
|
+
responsive: [
|
|
28
|
+
"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
|
|
29
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
30
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
orientation: "vertical",
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
39
|
+
return (_jsx("div", { role: "group", "data-slot": "field", "data-orientation": orientation, className: cn(fieldVariants({ orientation }), className), ...props }));
|
|
40
|
+
}
|
|
41
|
+
function FieldContent({ className, ...props }) {
|
|
42
|
+
return (_jsx("div", { "data-slot": "field-content", className: cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className), ...props }));
|
|
43
|
+
}
|
|
44
|
+
function FieldLabel({ className, ...props }) {
|
|
45
|
+
return (_jsx(Label, { "data-slot": "field-label", className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4", "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10", className), ...props }));
|
|
46
|
+
}
|
|
47
|
+
function FieldTitle({ className, ...props }) {
|
|
48
|
+
return (_jsx("div", { "data-slot": "field-label", className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className), ...props }));
|
|
49
|
+
}
|
|
50
|
+
function FieldDescription({ className, ...props }) {
|
|
51
|
+
return (_jsx("p", { "data-slot": "field-description", className: cn("text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className), ...props }));
|
|
52
|
+
}
|
|
53
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
54
|
+
return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className), ...props, children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground", "data-slot": "field-separator-content", children: children }))] }));
|
|
55
|
+
}
|
|
56
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
57
|
+
const content = useMemo(() => {
|
|
58
|
+
if (children) {
|
|
59
|
+
return children;
|
|
60
|
+
}
|
|
61
|
+
if (!errors) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (errors?.length === 1 && errors[0]?.message) {
|
|
65
|
+
return errors[0].message;
|
|
66
|
+
}
|
|
67
|
+
return (_jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map((error, index) => error?.message && _jsx("li", { children: error.message }, index)) }));
|
|
68
|
+
}, [children, errors]);
|
|
69
|
+
if (!content) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn("text-sm font-normal text-destructive", className), ...props, children: content }));
|
|
73
|
+
}
|
|
74
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
75
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../src/field.tsx"],"names":[],"mappings":"AAAA,2JAA2J;AAC3J,YAAY,CAAC;;AAGb,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoC;IACzE,OAAO,CACL,gCACY,WAAW,EACrB,SAAS,EAAE,EAAE,CACX,qBAAqB,EACrB,8EAA8E,EAC9E,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,GAAG,QAAQ,EAClB,GAAG,KAAK,EAC0D;IAClE,OAAO,CACL,8BACY,cAAc,kBACV,OAAO,EACrB,SAAS,EAAE,EAAE,CACX,kBAAkB,EAClB,iCAAiC,EACjC,8BAA8B,EAC9B,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACtE,OAAO,CACL,2BACY,aAAa,EACvB,SAAS,EAAE,EAAE,CACX,wIAAwI,EACxI,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AC;IACJ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAEvB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,cACE,IAAI,EAAC,OAAO,eACF,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC,KAC5D,KAAK,YAER,OAAO,GACJ,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,UAAU,GACX,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { type ButtonProps } from "./button.js";
|
|
3
|
+
export type FormSubmitProps = Omit<ButtonProps, "type"> & {
|
|
4
|
+
/**
|
|
5
|
+
* Label shown while the form submits. Defaults to `children`.
|
|
6
|
+
* Both come from the caller (message catalog), never hard-coded.
|
|
7
|
+
*/
|
|
8
|
+
pendingLabel?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Submit button wired to the enclosing form: disabled while the
|
|
12
|
+
* submission is in flight, with an optional pending label.
|
|
13
|
+
* Must render inside `<Form>` (uses the form context).
|
|
14
|
+
*/
|
|
15
|
+
export declare function FormSubmit({ pendingLabel, children, disabled, ...props }: FormSubmitProps): React.JSX.Element;
|
|
16
|
+
//# sourceMappingURL=form-submit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-submit.d.ts","sourceRoot":"","sources":["../src/form-submit.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG;IACxD;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,qBAQzF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useFormContext } from "react-hook-form";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
/**
|
|
6
|
+
* Submit button wired to the enclosing form: disabled while the
|
|
7
|
+
* submission is in flight, with an optional pending label.
|
|
8
|
+
* Must render inside `<Form>` (uses the form context).
|
|
9
|
+
*/
|
|
10
|
+
export function FormSubmit({ pendingLabel, children, disabled, ...props }) {
|
|
11
|
+
const { formState } = useFormContext();
|
|
12
|
+
const pending = formState.isSubmitting;
|
|
13
|
+
return (_jsx(Button, { type: "submit", disabled: disabled === true || pending, ...props, children: pending && pendingLabel !== undefined ? pendingLabel : children }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=form-submit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-submit.js","sourceRoot":"","sources":["../src/form-submit.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAoB,MAAM,aAAa,CAAC;AAUvD;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IACxF,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,OAAO,GAAG,SAAS,CAAC,YAAY,CAAC;IACvC,OAAO,CACL,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,IAAI,OAAO,KAAM,KAAK,YACpE,OAAO,IAAI,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,GACzD,CACV,CAAC;AACJ,CAAC"}
|
package/dist/form.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
|
|
4
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getErrors, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
5
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
|
|
6
|
+
declare const useFormField: () => {
|
|
7
|
+
invalid: boolean;
|
|
8
|
+
isDirty: boolean;
|
|
9
|
+
isTouched: boolean;
|
|
10
|
+
isValidating: boolean;
|
|
11
|
+
error?: import("react-hook-form").FieldError;
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
formItemId: string;
|
|
15
|
+
formDescriptionId: string;
|
|
16
|
+
formMessageId: string;
|
|
17
|
+
};
|
|
18
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
20
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement> & {
|
|
21
|
+
children?: React.ReactNode | undefined;
|
|
22
|
+
} & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
23
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
24
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
25
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };
|
|
26
|
+
//# sourceMappingURL=form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../src/form.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAKzB,QAAA,MAAM,IAAI,yaAAe,CAAC;AAW1B,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,sBAMtC,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;;;;;CAyBjB,CAAC;AAQF,QAAA,MAAM,QAAQ,6GAUb,CAAC;AAGF,QAAA,MAAM,SAAS,yJAcb,CAAC;AAGH,QAAA,MAAM,WAAW;;gFAef,CAAC;AAGH,QAAA,MAAM,eAAe,yHAQpB,CAAC;AAGF,QAAA,MAAM,WAAW,yHAoBhB,CAAC;AAGF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/form.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Derived from shadcn/ui (form) — see Provenance in packages/ui/README.md. Tolerated exception: migrated to custom code only when customization needs it.
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
import { Controller, FormProvider, useFormContext, } from "react-hook-form";
|
|
7
|
+
import { cn } from "./utils.js";
|
|
8
|
+
import { Label } from "./label.js";
|
|
9
|
+
const Form = FormProvider;
|
|
10
|
+
const FormFieldContext = React.createContext(null);
|
|
11
|
+
const FormField = ({ ...props }) => {
|
|
12
|
+
return (_jsx(FormFieldContext.Provider, { value: { name: props.name }, children: _jsx(Controller, { ...props }) }));
|
|
13
|
+
};
|
|
14
|
+
const useFormField = () => {
|
|
15
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
16
|
+
const itemContext = React.useContext(FormItemContext);
|
|
17
|
+
const { getFieldState, formState } = useFormContext();
|
|
18
|
+
if (!fieldContext) {
|
|
19
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
20
|
+
}
|
|
21
|
+
if (!itemContext) {
|
|
22
|
+
throw new Error("useFormField should be used within <FormItem>");
|
|
23
|
+
}
|
|
24
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
25
|
+
const { id } = itemContext;
|
|
26
|
+
return {
|
|
27
|
+
id,
|
|
28
|
+
name: fieldContext.name,
|
|
29
|
+
formItemId: `${id}-form-item`,
|
|
30
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
31
|
+
formMessageId: `${id}-form-item-message`,
|
|
32
|
+
...fieldState,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const FormItemContext = React.createContext(null);
|
|
36
|
+
const FormItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
37
|
+
const id = React.useId();
|
|
38
|
+
return (_jsx(FormItemContext.Provider, { value: { id }, children: _jsx("div", { ref: ref, className: cn("space-y-2", className), ...props }) }));
|
|
39
|
+
});
|
|
40
|
+
FormItem.displayName = "FormItem";
|
|
41
|
+
const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
42
|
+
const { error, formItemId } = useFormField();
|
|
43
|
+
return (_jsx(Label, { ref: ref, className: cn(error && "text-destructive", className), htmlFor: formItemId, ...props }));
|
|
44
|
+
});
|
|
45
|
+
FormLabel.displayName = "FormLabel";
|
|
46
|
+
const FormControl = React.forwardRef(({ ...props }, ref) => {
|
|
47
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
48
|
+
return (_jsx(Slot, { ref: ref, id: formItemId, "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`, "aria-invalid": !!error, ...props }));
|
|
49
|
+
});
|
|
50
|
+
FormControl.displayName = "FormControl";
|
|
51
|
+
const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
|
|
52
|
+
const { formDescriptionId } = useFormField();
|
|
53
|
+
return (_jsx("p", { ref: ref, id: formDescriptionId, className: cn("text-[0.8rem] text-muted-foreground", className), ...props }));
|
|
54
|
+
});
|
|
55
|
+
FormDescription.displayName = "FormDescription";
|
|
56
|
+
const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
57
|
+
const { error, formMessageId } = useFormField();
|
|
58
|
+
const body = error ? String(error?.message ?? "") : children;
|
|
59
|
+
if (!body) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return (_jsx("p", { ref: ref, id: formMessageId, className: cn("text-[0.8rem] font-medium text-destructive", className), ...props, children: body }));
|
|
63
|
+
});
|
|
64
|
+
FormMessage.displayName = "FormMessage";
|
|
65
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };
|
|
66
|
+
//# sourceMappingURL=form.js.map
|
package/dist/form.js.map
ADDED
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AAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,YACE,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,aAAa,EACjB,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAClE,KAAK,YAER,IAAI,GACH,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AACF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { Alert, AlertDescription, AlertTitle } from "./alert.js";
|
|
2
|
+
export { AppShell, type AppShellProps } from "./app-shell.js";
|
|
3
|
+
export { Badge, badgeVariants } from "./badge.js";
|
|
4
|
+
export { Button, buttonVariants, type ButtonProps } from "./button.js";
|
|
5
|
+
export { ConfirmDialog, type ConfirmDialogProps } from "./confirm-dialog.js";
|
|
6
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.js";
|
|
7
|
+
export { Checkbox } from "./checkbox.js";
|
|
8
|
+
export { DataTable, createDataTableColumns, type DataTableColumn, type DataTableProps, } from "./data-table.js";
|
|
9
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./dialog.js";
|
|
10
|
+
export { DetailPanel, type DetailItem, type DetailPanelProps } from "./detail-panel.js";
|
|
11
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, } from "./drawer.js";
|
|
12
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, } from "./field.js";
|
|
13
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField, } from "./form.js";
|
|
14
|
+
export { FormSubmit, type FormSubmitProps } from "./form-submit.js";
|
|
15
|
+
export { useValidatedForm } from "./use-validated-form.js";
|
|
16
|
+
export { Input } from "./input.js";
|
|
17
|
+
export { Label } from "./label.js";
|
|
18
|
+
export { Section, Stack, stackVariants, type SectionProps, type StackProps } from "./layout.js";
|
|
19
|
+
export { LivePulse, type LivePulseProps } from "./live-pulse.js";
|
|
20
|
+
export { StatusDot, type StatusDotProps, type StatusDotTone } from "./status-dot.js";
|
|
21
|
+
export { ProgressBar, type ProgressBarProps } from "./progress-bar.js";
|
|
22
|
+
export { Checkmark, type CheckmarkProps } from "./checkmark.js";
|
|
23
|
+
export { OptionCards, type OptionCard, type OptionCardsProps } from "./option-cards.js";
|
|
24
|
+
export { PageHeader, type PageHeaderProps } from "./page-header.js";
|
|
25
|
+
export { SecretField, type SecretFieldProps } from "./secret-field.js";
|
|
26
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from "./select.js";
|
|
27
|
+
export { Separator } from "./separator.js";
|
|
28
|
+
export { Skeleton } from "./skeleton.js";
|
|
29
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from "./table.js";
|
|
30
|
+
export { WizardSteps, type WizardStepsProps } from "./wizard-steps.js";
|
|
31
|
+
export { Switch } from "./switch.js";
|
|
32
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
|
|
33
|
+
export { Textarea } from "./textarea.js";
|
|
34
|
+
export { Toaster } from "./sonner.js";
|
|
35
|
+
export { Heading, headingVariants, Text, textVariants, type HeadingProps, type TextProps, } from "./typography.js";
|
|
36
|
+
export { cn } from "./utils.js";
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,OAAO,EACP,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { Alert, AlertDescription, AlertTitle } from "./alert.js";
|
|
2
|
+
export { AppShell } from "./app-shell.js";
|
|
3
|
+
export { Badge, badgeVariants } from "./badge.js";
|
|
4
|
+
export { Button, buttonVariants } from "./button.js";
|
|
5
|
+
export { ConfirmDialog } from "./confirm-dialog.js";
|
|
6
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.js";
|
|
7
|
+
export { Checkbox } from "./checkbox.js";
|
|
8
|
+
export { DataTable, createDataTableColumns, } from "./data-table.js";
|
|
9
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./dialog.js";
|
|
10
|
+
export { DetailPanel } from "./detail-panel.js";
|
|
11
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, } from "./drawer.js";
|
|
12
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, } from "./field.js";
|
|
13
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField, } from "./form.js";
|
|
14
|
+
export { FormSubmit } from "./form-submit.js";
|
|
15
|
+
export { useValidatedForm } from "./use-validated-form.js";
|
|
16
|
+
export { Input } from "./input.js";
|
|
17
|
+
export { Label } from "./label.js";
|
|
18
|
+
export { Section, Stack, stackVariants } from "./layout.js";
|
|
19
|
+
export { LivePulse } from "./live-pulse.js";
|
|
20
|
+
export { StatusDot } from "./status-dot.js";
|
|
21
|
+
export { ProgressBar } from "./progress-bar.js";
|
|
22
|
+
export { Checkmark } from "./checkmark.js";
|
|
23
|
+
export { OptionCards } from "./option-cards.js";
|
|
24
|
+
export { PageHeader } from "./page-header.js";
|
|
25
|
+
export { SecretField } from "./secret-field.js";
|
|
26
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from "./select.js";
|
|
27
|
+
export { Separator } from "./separator.js";
|
|
28
|
+
export { Skeleton } from "./skeleton.js";
|
|
29
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from "./table.js";
|
|
30
|
+
export { WizardSteps } from "./wizard-steps.js";
|
|
31
|
+
export { Switch } from "./switch.js";
|
|
32
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
|
|
33
|
+
export { Textarea } from "./textarea.js";
|
|
34
|
+
export { Toaster } from "./sonner.js";
|
|
35
|
+
export { Heading, headingVariants, Text, textVariants, } from "./typography.js";
|
|
36
|
+
export { cn } from "./utils.js";
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"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Aa,CAAC;AACtC,OAAO,EACL,OAAO,EACP,eAAe,EACf,IAAI,EACJ,YAAY,GAGb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/input.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../src/input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,KAAK,sHAcV,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/input.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Derived from shadcn/ui (input) — see Provenance in packages/ui/README.md. Tolerated exception: migrated to custom code only when customization needs it.
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "./utils.js";
|
|
5
|
+
const Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
6
|
+
return (_jsx("input", { type: type, className: cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", className), ref: ref, ...props }));
|
|
7
|
+
});
|
|
8
|
+
Input.displayName = "Input";
|
|
9
|
+
export { Input };
|
|
10
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../src/input.tsx"],"names":[],"mappings":";AAAA,2JAA2J;AAC3J,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrC,OAAO,CACL,gBACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX,4VAA4V,EAC5V,SAAS,CACV,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/label.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export { Label };
|
|
6
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../src/label.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAOlE,QAAA,MAAM,KAAK,4PAKT,CAAC;AAGH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/label.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Derived from shadcn/ui (label) — see Provenance in packages/ui/README.md. Tolerated exception: migrated to custom code only when customization needs it.
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
import { cn } from "./utils.js";
|
|
8
|
+
const labelVariants = cva("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
9
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (_jsx(LabelPrimitive.Root, { ref: ref, className: cn(labelVariants(), className), ...props })));
|
|
10
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
11
|
+
export { Label };
|
|
12
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../src/label.tsx"],"names":[],"mappings":"AAAA,2JAA2J;AAC3J,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,MAAM,aAAa,GAAG,GAAG,CACvB,4FAA4F,CAC7F,CAAC;AAEF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAG5B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,cAAc,CAAC,IAAI,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACxF,CAAC,CAAC;AACH,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const stackVariants: (props?: ({
|
|
4
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
|
5
|
+
gap?: 1 | 2 | 3 | 4 | 6 | 8 | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export type StackProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof stackVariants> & {
|
|
8
|
+
direction?: "vertical" | "horizontal";
|
|
9
|
+
gap?: 1 | 2 | 3 | 4 | 6 | 8;
|
|
10
|
+
};
|
|
11
|
+
declare function Stack({ direction, gap, className, ...props }: StackProps): React.JSX.Element;
|
|
12
|
+
export type SectionProps = React.HTMLAttributes<HTMLElement> & {
|
|
13
|
+
/** Section title, rendered as a level-2 heading. */
|
|
14
|
+
title?: React.ReactNode;
|
|
15
|
+
/** Muted description under the title. */
|
|
16
|
+
description?: React.ReactNode;
|
|
17
|
+
/** Actions row, right-aligned next to the title. */
|
|
18
|
+
actions?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
declare function Section({ title, description, actions, children, className, ...props }: SectionProps): React.JSX.Element;
|
|
21
|
+
export { Stack, stackVariants, Section };
|
|
22
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAUlE,QAAA,MAAM,aAAa;;;8EAmBjB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAC3D,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IACnC,SAAS,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACtC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC7B,CAAC;AAEJ,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,qBAEjE;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG;IAC7D,oDAAoD;IACpD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,yCAAyC;IACzC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,oDAAoD;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,iBAAS,OAAO,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,qBAe5F;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "./utils.js";
|
|
4
|
+
import { Heading } from "./typography.js";
|
|
5
|
+
import { Text } from "./typography.js";
|
|
6
|
+
// No shadcn source exists for layout stacks/sections, so these two
|
|
7
|
+
// thin wrappers carry the documented spacing patterns. They exist so
|
|
8
|
+
// consumers can replace raw <section>/<div> stacks entirely.
|
|
9
|
+
const stackVariants = cva("flex", {
|
|
10
|
+
variants: {
|
|
11
|
+
direction: {
|
|
12
|
+
vertical: "flex-col",
|
|
13
|
+
horizontal: "flex-row items-center",
|
|
14
|
+
},
|
|
15
|
+
gap: {
|
|
16
|
+
1: "gap-1",
|
|
17
|
+
2: "gap-2",
|
|
18
|
+
3: "gap-3",
|
|
19
|
+
4: "gap-4",
|
|
20
|
+
6: "gap-6",
|
|
21
|
+
8: "gap-8",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
direction: "vertical",
|
|
26
|
+
gap: 4,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
function Stack({ direction, gap, className, ...props }) {
|
|
30
|
+
return _jsx("div", { className: cn(stackVariants({ direction, gap }), className), ...props });
|
|
31
|
+
}
|
|
32
|
+
function Section({ title, description, actions, children, className, ...props }) {
|
|
33
|
+
return (_jsxs("section", { className: cn("space-y-4", className), ...props, children: [(title || actions) && (_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { children: [title && _jsx(Heading, { level: 2, children: title }), description && _jsx(Text, { variant: "muted", children: description })] }), actions] })), children] }));
|
|
34
|
+
}
|
|
35
|
+
export { Stack, stackVariants, Section };
|
|
36
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,mEAAmE;AACnE,qEAAqE;AACrE,6DAA6D;AAE7D,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE;IAChC,QAAQ,EAAE;QACR,SAAS,EAAE;YACT,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,uBAAuB;SACpC;QACD,GAAG,EAAE;YACH,CAAC,EAAE,OAAO;YACV,CAAC,EAAE,OAAO;YACV,CAAC,EAAE,OAAO;YACV,CAAC,EAAE,OAAO;YACV,CAAC,EAAE,OAAO;YACV,CAAC,EAAE,OAAO;SACX;KACF;IACD,eAAe,EAAE;QACf,SAAS,EAAE,UAAU;QACrB,GAAG,EAAE,CAAC;KACP;CACF,CAAC,CAAC;AAQH,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,EAAc;IAChE,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACzF,CAAC;AAWD,SAAS,OAAO,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB;IAC3F,OAAO,CACL,mBAAS,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,KAAK,aACtD,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CACrB,eAAK,SAAS,EAAC,wCAAwC,aACrD,0BACG,KAAK,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,YAAG,KAAK,GAAW,EAC7C,WAAW,IAAI,KAAC,IAAI,IAAC,OAAO,EAAC,OAAO,YAAE,WAAW,GAAQ,IACtD,EACL,OAAO,IACJ,CACP,EACA,QAAQ,IACD,CACX,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-pulse.d.ts","sourceRoot":"","sources":["../src/live-pulse.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,SAAS,CAAC,EAAE,MAAa,EAAE,KAAc,EAAE,SAAS,EAAE,EAAE,cAAc,+BAWrF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StatusDot } from "./status-dot.js";
|
|
3
|
+
import { cn } from "./utils.js";
|
|
4
|
+
export function LivePulse({ active = true, label = "Live", className }) {
|
|
5
|
+
return (_jsxs("span", { role: "status", "aria-label": active ? label : "Idle", className: cn("inline-flex items-center gap-1.5 text-xs text-muted-foreground", className), children: [_jsx(StatusDot, { tone: active ? "success" : "idle", pulse: active }), active ? label : "Idle"] }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=live-pulse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-pulse.js","sourceRoot":"","sources":["../src/live-pulse.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAQhC,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,GAAG,MAAM,EAAE,SAAS,EAAkB;IACpF,OAAO,CACL,gBACE,IAAI,EAAC,QAAQ,gBACD,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EACnC,SAAS,EAAE,EAAE,CAAC,gEAAgE,EAAE,SAAS,CAAC,aAE1F,KAAC,SAAS,IAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAI,EAC9D,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,IACnB,CACR,CAAC;AACJ,CAAC"}
|