@ciridae/ui 0.3.6 → 0.3.7
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/ciridae.css +2 -1
- package/dist/components/blocks/feedback-detail-sheet.js +2 -2
- package/dist/components/blocks/feedback-user-detail.js +2 -2
- package/dist/components/blocks/feedback-user-list.js +2 -2
- package/dist/components/ui/combobox.d.ts +2 -1
- package/dist/components/ui/combobox.js +2 -2
- package/dist/components/ui/file-upload-field-parts.js +2 -2
- package/dist/components/ui/item.d.ts +3 -2
- package/dist/components/ui/item.js +6 -3
- package/dist/styles.css +2 -1
- package/package.json +11 -1
package/dist/ciridae.css
CHANGED
|
@@ -7,7 +7,7 @@ import { getFeedbackInitials } from "./feedback-tracking-types";
|
|
|
7
7
|
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
|
|
8
8
|
import { Button } from "../ui/button";
|
|
9
9
|
import { Card } from "../ui/card";
|
|
10
|
-
import { Item, ItemContent, ItemGroup, ItemMedia, ItemTitle } from "../ui/item";
|
|
10
|
+
import { Item, ItemContent, ItemGroup, ItemGroupItem, ItemMedia, ItemTitle } from "../ui/item";
|
|
11
11
|
import { PropertyList, PropertyListItem, PropertyListLabel, PropertyListValue, } from "../ui/property-list";
|
|
12
12
|
import { Sheet, SheetBody, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, } from "../ui/sheet";
|
|
13
13
|
function FeedbackDetailSheet({ feedback, onOpenChange, open }) {
|
|
@@ -33,7 +33,7 @@ function FeedbackDetailAttachments({ feedback }) {
|
|
|
33
33
|
const attachments = feedback.attachments ?? [];
|
|
34
34
|
if (attachments.length === 0)
|
|
35
35
|
return null;
|
|
36
|
-
return (_jsxs("section", { className: "grid gap-2", children: [_jsx("div", { className: "text-meta text-muted-foreground", children: "Attachments" }), _jsx(ItemGroup, { children: attachments.map((attachment, index) => (_jsxs(Item, { size: "sm", variant: "outline", children: [_jsx(ItemMedia, { variant: "icon", children: _jsx(PaperclipIcon, {}) }), _jsx(ItemContent, { children: _jsx(ItemTitle, { children: attachment.url ? (_jsx("a", { className: "underline-offset-4 hover:underline", href: attachment.url, children: attachment.name })) : (attachment.name) }) })] }, getAttachmentKey(attachment, index)))) })] }));
|
|
36
|
+
return (_jsxs("section", { className: "grid gap-2", children: [_jsx("div", { className: "text-meta text-muted-foreground", children: "Attachments" }), _jsx(ItemGroup, { children: attachments.map((attachment, index) => (_jsx(ItemGroupItem, { children: _jsxs(Item, { size: "sm", variant: "outline", children: [_jsx(ItemMedia, { variant: "icon", children: _jsx(PaperclipIcon, {}) }), _jsx(ItemContent, { children: _jsx(ItemTitle, { children: attachment.url ? (_jsx("a", { className: "underline-offset-4 hover:underline", href: attachment.url, children: attachment.name })) : (attachment.name) }) })] }) }, getAttachmentKey(attachment, index)))) })] }));
|
|
37
37
|
}
|
|
38
38
|
function getAttachmentKey(attachment, index) {
|
|
39
39
|
return `${attachment.url ?? attachment.name}-${index}`;
|
|
@@ -6,7 +6,7 @@ import { FeedbackTypeBadge } from "./feedback-type-badge";
|
|
|
6
6
|
import { Button } from "../ui/button";
|
|
7
7
|
import { Card } from "../ui/card";
|
|
8
8
|
import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "../ui/empty";
|
|
9
|
-
import { Item, ItemContent, ItemGroup, ItemMedia, ItemTitle } from "../ui/item";
|
|
9
|
+
import { Item, ItemContent, ItemGroup, ItemGroupItem, ItemMedia, ItemTitle } from "../ui/item";
|
|
10
10
|
import { PropertyList, PropertyListItem, PropertyListLabel, PropertyListValue, } from "../ui/property-list";
|
|
11
11
|
function FeedbackUserDetail({ activityLabel = "Activity", activitySlot, feedback, onBack, }) {
|
|
12
12
|
if (!feedback)
|
|
@@ -38,7 +38,7 @@ function FeedbackUserAttachments({ feedback }) {
|
|
|
38
38
|
const attachments = feedback.attachments ?? [];
|
|
39
39
|
if (attachments.length === 0)
|
|
40
40
|
return null;
|
|
41
|
-
return (_jsxs("section", { className: "grid gap-2", children: [_jsx("div", { className: "text-meta text-muted-foreground", children: "Attachments" }), _jsx(ItemGroup, { children: attachments.map((attachment, index) => (_jsxs(Item, { size: "sm", variant: "outline", children: [_jsx(ItemMedia, { variant: "icon", children: _jsx(PaperclipIcon, {}) }), _jsx(ItemContent, { children: _jsx(ItemTitle, { children: getAttachmentTitle(attachment) }) })] }, getAttachmentKey(attachment, index)))) })] }));
|
|
41
|
+
return (_jsxs("section", { className: "grid gap-2", children: [_jsx("div", { className: "text-meta text-muted-foreground", children: "Attachments" }), _jsx(ItemGroup, { children: attachments.map((attachment, index) => (_jsx(ItemGroupItem, { children: _jsxs(Item, { size: "sm", variant: "outline", children: [_jsx(ItemMedia, { variant: "icon", children: _jsx(PaperclipIcon, {}) }), _jsx(ItemContent, { children: _jsx(ItemTitle, { children: getAttachmentTitle(attachment) }) })] }) }, getAttachmentKey(attachment, index)))) })] }));
|
|
42
42
|
}
|
|
43
43
|
function getAttachmentKey(attachment, index) {
|
|
44
44
|
return `${attachment.url ?? attachment.name}-${index}`;
|
|
@@ -4,7 +4,7 @@ import { formatFeedbackTimestamp } from "./feedback-date-format";
|
|
|
4
4
|
import { FeedbackStatusBadge } from "./feedback-status-badge";
|
|
5
5
|
import { FeedbackTypeBadge } from "./feedback-type-badge";
|
|
6
6
|
import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "../ui/empty";
|
|
7
|
-
import { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemTitle, } from "../ui/item";
|
|
7
|
+
import { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemGroupItem, ItemTitle, } from "../ui/item";
|
|
8
8
|
import { Skeleton } from "../ui/skeleton";
|
|
9
9
|
import { cn } from "../../lib/utils";
|
|
10
10
|
function FeedbackUserList({ isLoading = false, items, onSelectFeedback, selectedId, }) {
|
|
@@ -15,7 +15,7 @@ function FeedbackUserList({ isLoading = false, items, onSelectFeedback, selected
|
|
|
15
15
|
return (_jsx(ItemGroup, { className: "gap-2", children: items.map((item) => (_jsx(FeedbackUserListItem, { item: item, onSelectFeedback: onSelectFeedback, selected: item.id === selectedId }, item.id))) }));
|
|
16
16
|
}
|
|
17
17
|
function FeedbackUserListItem({ item, onSelectFeedback, selected, }) {
|
|
18
|
-
return (_jsx(Item, { "aria-current": selected ? "true" : undefined, asChild: true, className: cn("w-full cursor-pointer text-left", selected && "border-foreground/30 bg-muted/50"), size: "sm", variant: "outline", children: _jsx("button", { onClick: () => onSelectFeedback?.(item), type: "button", children: _jsx(FeedbackUserListItemContent, { item: item }) }) }));
|
|
18
|
+
return (_jsx(ItemGroupItem, { children: _jsx(Item, { "aria-current": selected ? "true" : undefined, asChild: true, className: cn("w-full cursor-pointer text-left", selected && "border-foreground/30 bg-muted/50"), size: "sm", variant: "outline", children: _jsx("button", { onClick: () => onSelectFeedback?.(item), type: "button", children: _jsx(FeedbackUserListItemContent, { item: item }) }) }) }));
|
|
19
19
|
}
|
|
20
20
|
function FeedbackUserListItemContent({ item }) {
|
|
21
21
|
return (_jsxs(_Fragment, { children: [_jsxs(ItemContent, { className: "min-w-0", children: [_jsx(ItemTitle, { className: "max-w-full truncate", children: item.subject }), _jsx(ItemDescription, { className: "line-clamp-1", children: item.description })] }), _jsxs(ItemActions, { className: "shrink-0", children: [_jsx(FeedbackTypeBadge, { type: item.type }), _jsx(FeedbackStatusBadge, { status: item.status })] }), _jsxs(ItemFooter, { children: [_jsx(FeedbackListDate, { label: "Submitted", value: item.submittedAt }), item.updatedAt ? _jsx(FeedbackListDate, { label: "Updated", value: item.updatedAt }) : null] })] }));
|
|
@@ -3,9 +3,10 @@ import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
|
3
3
|
declare const Combobox: typeof ComboboxPrimitive.Root;
|
|
4
4
|
declare function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props): React.JSX.Element;
|
|
5
5
|
declare function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
|
-
declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: ComboboxPrimitive.Input.Props & {
|
|
6
|
+
declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, triggerAriaLabel, ...props }: ComboboxPrimitive.Input.Props & {
|
|
7
7
|
showTrigger?: boolean;
|
|
8
8
|
showClear?: boolean;
|
|
9
|
+
triggerAriaLabel?: string;
|
|
9
10
|
}): React.JSX.Element;
|
|
10
11
|
declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: ComboboxPrimitive.Popup.Props & Pick<ComboboxPrimitive.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor">): React.JSX.Element;
|
|
11
12
|
declare function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props): React.JSX.Element;
|
|
@@ -15,8 +15,8 @@ function ComboboxTrigger({ className, children, ...props }) {
|
|
|
15
15
|
function ComboboxClear({ className, ...props }) {
|
|
16
16
|
return (_jsx(ComboboxPrimitive.Clear, { "data-slot": "combobox-clear", render: _jsx(InputGroupButton, { variant: "ghost", size: "icon-xs" }), className: cn(className), ...props, children: _jsx(XIcon, { className: "pointer-events-none" }) }));
|
|
17
17
|
}
|
|
18
|
-
function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
|
|
19
|
-
return (_jsxs(InputGroup, { className: cn("w-auto", className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, { disabled: disabled }), ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", asChild: true, "data-slot": "input-group-button", className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent", disabled: disabled, children: _jsx(ComboboxTrigger, {}) })), showClear && _jsx(ComboboxClear, { disabled: disabled })] }), children] }));
|
|
18
|
+
function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, triggerAriaLabel = "Toggle options", ...props }) {
|
|
19
|
+
return (_jsxs(InputGroup, { className: cn("w-auto", className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, { disabled: disabled }), ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", asChild: true, "data-slot": "input-group-button", className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent", disabled: disabled, children: _jsx(ComboboxTrigger, { "aria-label": triggerAriaLabel }) })), showClear && _jsx(ComboboxClear, { disabled: disabled })] }), children] }));
|
|
20
20
|
}
|
|
21
21
|
function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
|
|
22
22
|
return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": !!anchor, className: cn("group/combobox-content relative max-h-96 w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-(--control-height-sm) *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none", className), ...props }) }) }));
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { FileIcon, PaperclipIcon, UploadCloudIcon, XIcon } from "lucide-react";
|
|
3
3
|
import { cn } from "../../lib/utils";
|
|
4
4
|
import { Button } from "./button";
|
|
5
|
-
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle, } from "./item";
|
|
5
|
+
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemGroupItem, ItemMedia, ItemTitle, } from "./item";
|
|
6
6
|
function FileUploadCompactControl({ acceptedFileTypes, disabled, dragActive, error, files, inputId, inputRef, maxAttachments, onAddFiles, onDragActiveChange, }) {
|
|
7
7
|
const isAtLimit = files.length >= maxAttachments;
|
|
8
8
|
return (_jsxs("div", { "data-drag-active": dragActive, className: cn("flex items-center gap-3 rounded-md border bg-card px-3 py-2 transition-colors", "data-[drag-active=true]:border-ring data-[drag-active=true]:bg-muted/50", disabled && "cursor-not-allowed opacity-60"), onDragEnter: (event) => handleDragEnter(event, disabled, onDragActiveChange), onDragLeave: (event) => handleDragLeave(event, onDragActiveChange), onDragOver: (event) => event.preventDefault(), onDrop: (event) => handleDrop(event, { disabled, onAddFiles, onDragActiveChange }), children: [_jsx("input", { accept: acceptedFileTypes, "aria-describedby": error ? `${inputId}-error` : undefined, className: "sr-only", disabled: disabled || isAtLimit, id: inputId, multiple: true, onChange: (event) => handleFileInputChange(event, onAddFiles), ref: inputRef, type: "file" }), _jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx(PaperclipIcon, { className: "size-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-sm font-medium", children: files.length > 0 ? `${files.length} attached` : "Attach files" }), _jsx("div", { className: "truncate text-xs text-muted-foreground", children: "Files stay in the browser until submit." })] })] }), _jsx(Button, { disabled: disabled || isAtLimit, onClick: () => inputRef.current?.click(), size: "sm", type: "button", variant: "outline", children: "Attach" })] }));
|
|
@@ -18,7 +18,7 @@ function FileUploadDropZoneContent({ disabled, files, inputRef, maxAttachments,
|
|
|
18
18
|
function FileUploadList({ disabled, files, onRemoveFile, }) {
|
|
19
19
|
if (files.length === 0)
|
|
20
20
|
return null;
|
|
21
|
-
return (_jsx(ItemGroup, { className: "gap-2", children: files.map((file, index) => (_jsxs(Item, { size: "sm", variant: "outline", children: [_jsx(ItemMedia, { variant: "icon", children: _jsx(FileIcon, { className: "size-4 text-muted-foreground" }) }), _jsxs(ItemContent, { children: [_jsx(ItemTitle, { className: "max-w-full break-all", children: file.name }), _jsx(ItemDescription, { className: "font-mono tabular-nums", children: formatFileSize(file.size) })] }), _jsx(ItemActions, { children: _jsx(Button, { "aria-label": `Remove ${file.name}`, disabled: disabled, onClick: () => onRemoveFile(index), size: "icon-sm", type: "button", variant: "ghost", children: _jsx(XIcon, {}) }) })] }, `${file.name}-${file.size}-${index}`))) }));
|
|
21
|
+
return (_jsx(ItemGroup, { className: "gap-2", children: files.map((file, index) => (_jsx(ItemGroupItem, { children: _jsxs(Item, { size: "sm", variant: "outline", children: [_jsx(ItemMedia, { variant: "icon", children: _jsx(FileIcon, { className: "size-4 text-muted-foreground" }) }), _jsxs(ItemContent, { children: [_jsx(ItemTitle, { className: "max-w-full break-all", children: file.name }), _jsx(ItemDescription, { className: "font-mono tabular-nums", children: formatFileSize(file.size) })] }), _jsx(ItemActions, { children: _jsx(Button, { "aria-label": `Remove ${file.name}`, disabled: disabled, onClick: () => onRemoveFile(index), size: "icon-sm", type: "button", variant: "ghost", children: _jsx(XIcon, {}) }) })] }) }, `${file.name}-${file.size}-${index}`))) }));
|
|
22
22
|
}
|
|
23
23
|
function handleDragEnter(event, disabled, onDragActiveChange) {
|
|
24
24
|
event.preventDefault();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
import { Separator } from "./separator";
|
|
4
|
-
declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function ItemGroup({ className, role, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function ItemGroupItem({ role, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
6
|
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
6
7
|
declare const itemVariants: (props?: ({
|
|
7
8
|
variant?: "default" | "muted" | "outline" | null | undefined;
|
|
@@ -20,4 +21,4 @@ declare function ItemDescription({ className, ...props }: React.ComponentProps<"
|
|
|
20
21
|
declare function ItemActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
21
22
|
declare function ItemHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
22
23
|
declare function ItemFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
23
|
-
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
|
24
|
+
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemGroupItem, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
|
@@ -3,8 +3,11 @@ import { cva } from "class-variance-authority";
|
|
|
3
3
|
import { Slot } from "radix-ui";
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
5
5
|
import { Separator } from "./separator";
|
|
6
|
-
function ItemGroup({ className, ...props }) {
|
|
7
|
-
return (_jsx("div", {
|
|
6
|
+
function ItemGroup({ className, role = "list", ...props }) {
|
|
7
|
+
return (_jsx("div", { "data-slot": "item-group", role: role, className: cn("group/item-group flex flex-col", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function ItemGroupItem({ role = "listitem", ...props }) {
|
|
10
|
+
return _jsx("div", { "data-slot": "item-group-item", role: role, ...props });
|
|
8
11
|
}
|
|
9
12
|
function ItemSeparator({ className, ...props }) {
|
|
10
13
|
return (_jsx(Separator, { "data-slot": "item-separator", orientation: "horizontal", className: cn("my-0", className), ...props }));
|
|
@@ -63,4 +66,4 @@ function ItemHeader({ className, ...props }) {
|
|
|
63
66
|
function ItemFooter({ className, ...props }) {
|
|
64
67
|
return (_jsx("div", { "data-slot": "item-footer", className: cn("flex basis-full items-center justify-between gap-2", className), ...props }));
|
|
65
68
|
}
|
|
66
|
-
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
|
69
|
+
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemGroupItem, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ciridae/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -59,9 +59,19 @@
|
|
|
59
59
|
"README.md"
|
|
60
60
|
],
|
|
61
61
|
"peerDependencies": {
|
|
62
|
+
"@types/react": ">=18",
|
|
63
|
+
"@types/react-dom": ">=18",
|
|
62
64
|
"react": ">=18",
|
|
63
65
|
"react-dom": ">=18"
|
|
64
66
|
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"@types/react": {
|
|
69
|
+
"optional": true
|
|
70
|
+
},
|
|
71
|
+
"@types/react-dom": {
|
|
72
|
+
"optional": true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
65
75
|
"dependencies": {
|
|
66
76
|
"@base-ui/react": "^1.6.0",
|
|
67
77
|
"@dnd-kit/core": "6.3.1",
|