@oppulence/design-system 1.0.11 → 1.0.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oppulence/design-system",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Design system for Oppulence - shadcn-style components with Tailwind CSS v4",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -16,7 +16,10 @@ type AnimatedSizeContainerProps = PropsWithChildren<{
16
16
  width?: boolean;
17
17
  height?: boolean;
18
18
  }> &
19
- Omit<ComponentPropsWithoutRef<typeof motion.div>, "animate" | "children" | "className">;
19
+ Omit<
20
+ ComponentPropsWithoutRef<typeof motion.div>,
21
+ "animate" | "children" | "className"
22
+ >;
20
23
 
21
24
  /**
22
25
  * A container with animated width and height (each optional) based on children dimensions.
@@ -26,7 +29,9 @@ const AnimatedSizeContainer = forwardRef<
26
29
  AnimatedSizeContainerProps
27
30
  >(({ width = false, height = false, transition, children, ...rest }, ref) => {
28
31
  const containerRef = useRef<HTMLDivElement>(null);
29
- const resizeObserverEntry = useResizeObserver(containerRef as RefObject<Element>);
32
+ const resizeObserverEntry = useResizeObserver(
33
+ containerRef as RefObject<Element>,
34
+ );
30
35
 
31
36
  return (
32
37
  <motion.div
@@ -1,7 +1,13 @@
1
1
  import { ArchiveIcon } from "@radix-ui/react-icons";
2
2
  import { FiGithub } from "react-icons/fi";
3
3
  import type { IconType as BaseIconType } from "react-icons/lib";
4
- import type { ComponentType, FC, ReactNode, SVGAttributes, SVGProps } from "react";
4
+ import type {
5
+ ComponentType,
6
+ FC,
7
+ ReactNode,
8
+ SVGAttributes,
9
+ SVGProps,
10
+ } from "react";
5
11
  import {
6
12
  MdArrowBack,
7
13
  MdArrowDownward,
@@ -131,9 +137,7 @@ type RadixIconProps = Omit<SVGAttributes<SVGElement>, "children"> & {
131
137
 
132
138
  const createReactIcon =
133
139
  (Icon: BaseIconType) =>
134
- ({ size = 20, color }: IconProps) => (
135
- <Icon size={size} color={color} />
136
- );
140
+ ({ size = 20, color }: IconProps) => <Icon size={size} color={color} />;
137
141
 
138
142
  const createRadixIcon =
139
143
  (Icon: ComponentType<RadixIconProps>) =>
@@ -573,10 +577,7 @@ export const Icons = {
573
577
  <path d="M480-80 200-360l56-57 184 184v-287h80v287l184-183 56 56L480-80Zm-40-520v-120h80v120h-80Zm0-200v-80h80v80h-80Z" />
574
578
  </svg>
575
579
  ),
576
- Delete: ({
577
- size = 24,
578
- ...props
579
- }: SvgProps) => (
580
+ Delete: ({ size = 24, ...props }: SvgProps) => (
580
581
  <svg
581
582
  xmlns="http://www.w3.org/2000/svg"
582
583
  width={size}
@@ -730,7 +731,13 @@ export const Icons = {
730
731
  Instagram: (props: SVGIconProps) => (
731
732
  <SVGIcon {...props} viewBox="0 0 24 24">
732
733
  <defs>
733
- <linearGradient id="instagram-gradient" x1="0%" y1="100%" x2="100%" y2="0%">
734
+ <linearGradient
735
+ id="instagram-gradient"
736
+ x1="0%"
737
+ y1="100%"
738
+ x2="100%"
739
+ y2="0%"
740
+ >
734
741
  <stop offset="0%" stopColor="#FEDA77" />
735
742
  <stop offset="25%" stopColor="#FA7E1E" />
736
743
  <stop offset="50%" stopColor="#D62976" />
@@ -749,7 +756,14 @@ export const Icons = {
749
756
  strokeWidth="2"
750
757
  fill="none"
751
758
  />
752
- <circle cx="12" cy="12" r="3.5" stroke="#fff" strokeWidth="2" fill="none" />
759
+ <circle
760
+ cx="12"
761
+ cy="12"
762
+ r="3.5"
763
+ stroke="#fff"
764
+ strokeWidth="2"
765
+ fill="none"
766
+ />
753
767
  <circle cx="17" cy="7" r="1.5" fill="#fff" />
754
768
  </SVGIcon>
755
769
  ),
@@ -6,12 +6,7 @@ export type ImageProps = GeneratedImage &
6
6
  alt?: string;
7
7
  };
8
8
 
9
- export function Image({
10
- base64,
11
- mediaType,
12
- alt,
13
- ...props
14
- }: ImageProps) {
9
+ export function Image({ base64, mediaType, alt, ...props }: ImageProps) {
15
10
  return (
16
11
  <img
17
12
  {...props}
@@ -5,8 +5,7 @@ type SubmitButtonProps = {
5
5
  children: ReactNode;
6
6
  isSubmitting: boolean;
7
7
  disabled?: boolean;
8
- } &
9
- Omit<ButtonProps, "loading">;
8
+ } & Omit<ButtonProps, "loading">;
10
9
 
11
10
  export function SubmitButton({
12
11
  children,
@@ -206,10 +206,10 @@ export const TextEffect = ({
206
206
 
207
207
  const baseContainer = preset
208
208
  ? presetVariants[preset].container
209
- : variants?.container ?? defaultContainerVariants;
209
+ : (variants?.container ?? defaultContainerVariants);
210
210
  const baseItem = preset
211
211
  ? presetVariants[preset].item
212
- : variants?.item ?? defaultItemVariants;
212
+ : (variants?.item ?? defaultItemVariants);
213
213
 
214
214
  const staggerChildren = speedSegment ?? defaultStaggerTimes[per];
215
215
 
@@ -37,7 +37,9 @@ export const Action = ({
37
37
  return (
38
38
  <Tooltip>
39
39
  <TooltipTrigger
40
- render={<Button size={size} type="button" variant={variant} {...props} />}
40
+ render={
41
+ <Button size={size} type="button" variant={variant} {...props} />
42
+ }
41
43
  >
42
44
  {children}
43
45
  <span className="sr-only">{label || tooltip}</span>
@@ -75,7 +75,10 @@ export const Branch = ({
75
75
  );
76
76
  };
77
77
 
78
- export type BranchMessagesProps = Omit<HTMLAttributes<HTMLDivElement>, "className">;
78
+ export type BranchMessagesProps = Omit<
79
+ HTMLAttributes<HTMLDivElement>,
80
+ "className"
81
+ >;
79
82
 
80
83
  export const BranchMessages = ({ children, ...props }: BranchMessagesProps) => {
81
84
  const { currentBranch, setBranches, branches } = useBranch();
@@ -101,7 +104,10 @@ export const BranchMessages = ({ children, ...props }: BranchMessagesProps) => {
101
104
  ));
102
105
  };
103
106
 
104
- export type BranchSelectorProps = Omit<HTMLAttributes<HTMLDivElement>, "className"> & {
107
+ export type BranchSelectorProps = Omit<
108
+ HTMLAttributes<HTMLDivElement>,
109
+ "className"
110
+ > & {
105
111
  from: ChatRole;
106
112
  };
107
113
 
@@ -20,7 +20,10 @@ const CodeBlockContext = createContext<CodeBlockContextType>({
20
20
  code: "",
21
21
  });
22
22
 
23
- export type CodeBlockProps = Omit<HTMLAttributes<HTMLDivElement>, "className"> & {
23
+ export type CodeBlockProps = Omit<
24
+ HTMLAttributes<HTMLDivElement>,
25
+ "className"
26
+ > & {
24
27
  code: string;
25
28
  language: string;
26
29
  showLineNumbers?: boolean;
@@ -20,19 +20,13 @@ import {
20
20
  } from "../organisms/carousel";
21
21
  import { HoverCard, HoverCardContent, HoverCardTrigger } from "./hover-card";
22
22
 
23
- export type InlineCitationProps = Omit<
24
- ComponentProps<"span">,
25
- "className"
26
- >;
23
+ export type InlineCitationProps = Omit<ComponentProps<"span">, "className">;
27
24
 
28
25
  export const InlineCitation = ({ ...props }: InlineCitationProps) => (
29
26
  <span className="group inline items-center gap-1" {...props} />
30
27
  );
31
28
 
32
- export type InlineCitationTextProps = Omit<
33
- ComponentProps<"span">,
34
- "className"
35
- >;
29
+ export type InlineCitationTextProps = Omit<ComponentProps<"span">, "className">;
36
30
 
37
31
  export const InlineCitationText = ({ ...props }: InlineCitationTextProps) => (
38
32
  <span className="transition-colors group-hover:bg-accent" {...props} />
@@ -44,10 +38,12 @@ export const InlineCitationCard = (props: InlineCitationCardProps) => (
44
38
  <HoverCard {...props} />
45
39
  );
46
40
 
47
- export type InlineCitationCardTriggerProps =
48
- Omit<ComponentProps<"span">, "className"> & {
49
- sources: string[];
50
- };
41
+ export type InlineCitationCardTriggerProps = Omit<
42
+ ComponentProps<"span">,
43
+ "className"
44
+ > & {
45
+ sources: string[];
46
+ };
51
47
 
52
48
  export const InlineCitationCardTrigger = ({
53
49
  sources,
@@ -68,7 +64,8 @@ export const InlineCitationCardTrigger = ({
68
64
  >
69
65
  {sources.length ? (
70
66
  <>
71
- {new URL(sources[0]!).hostname} {sources.length > 1 && `+${sources.length - 1}`}
67
+ {new URL(sources[0]!).hostname}{" "}
68
+ {sources.length > 1 && `+${sources.length - 1}`}
72
69
  </>
73
70
  ) : (
74
71
  "unknown"
@@ -24,10 +24,7 @@ export type MessageContentProps = Omit<
24
24
  "className"
25
25
  >;
26
26
 
27
- export const MessageContent = ({
28
- children,
29
- ...props
30
- }: MessageContentProps) => (
27
+ export const MessageContent = ({ children, ...props }: MessageContentProps) => (
31
28
  <div
32
29
  className={cn(
33
30
  "flex flex-col gap-2 overflow-hidden rounded-lg px-4 py-3 text-foreground text-sm",
@@ -57,8 +54,6 @@ export const MessageAvatar = ({
57
54
  }: MessageAvatarProps) => (
58
55
  <Avatar size={size} {...props}>
59
56
  <AvatarImage alt="" src={src} />
60
- <AvatarFallback>
61
- {name?.slice(0, 1) || "M"}
62
- </AvatarFallback>
57
+ <AvatarFallback>{name?.slice(0, 1) || "M"}</AvatarFallback>
63
58
  </Avatar>
64
59
  );
@@ -10,7 +10,10 @@ import {
10
10
  CollapsibleTrigger,
11
11
  } from "./collapsible";
12
12
 
13
- export type SourcesProps = Omit<ComponentProps<typeof Collapsible>, "className">;
13
+ export type SourcesProps = Omit<
14
+ ComponentProps<typeof Collapsible>,
15
+ "className"
16
+ >;
14
17
 
15
18
  export const Sources = ({ ...props }: SourcesProps) => (
16
19
  <Collapsible className="not-prose mb-4 text-primary text-xs" {...props} />
@@ -9,9 +9,7 @@ export type SuggestionsProps = Omit<ComponentProps<"div">, "className">;
9
9
 
10
10
  export const Suggestions = ({ children, ...props }: SuggestionsProps) => (
11
11
  <div className="w-full overflow-x-auto whitespace-nowrap" {...props}>
12
- <div className="flex w-max flex-nowrap items-center gap-2">
13
- {children}
14
- </div>
12
+ <div className="flex w-max flex-nowrap items-center gap-2">{children}</div>
15
13
  </div>
16
14
  );
17
15
 
@@ -45,7 +45,11 @@ export type TaskTriggerProps = Omit<
45
45
  title: string;
46
46
  };
47
47
 
48
- export const TaskTrigger = ({ children, title, ...props }: TaskTriggerProps) => (
48
+ export const TaskTrigger = ({
49
+ children,
50
+ title,
51
+ ...props
52
+ }: TaskTriggerProps) => (
49
53
  <CollapsibleTrigger className="group" {...props}>
50
54
  {children ?? (
51
55
  <div className="flex cursor-pointer items-center gap-2 text-muted-foreground hover:text-foreground">
@@ -33,7 +33,12 @@ export function ToolCallIndicator({ toolName }: ToolCallIndicatorProps) {
33
33
  <div className="flex items-center justify-center size-3.5">
34
34
  <config.icon size={14} />
35
35
  </div>
36
- <TextShimmer size="xs" baseColor="#707070" gradientColor="#111111" duration={1}>
36
+ <TextShimmer
37
+ size="xs"
38
+ baseColor="#707070"
39
+ gradientColor="#111111"
40
+ duration={1}
41
+ >
37
42
  {config.displayText}
38
43
  </TextShimmer>
39
44
  </div>
@@ -47,7 +47,12 @@ const getStatusBadge = (status: ToolUIPart["state"]) => {
47
47
  } as const;
48
48
 
49
49
  return (
50
- <span className={cn(badgeVariants({ variant: "secondary" }), "gap-1.5 rounded-full text-xs")}>
50
+ <span
51
+ className={cn(
52
+ badgeVariants({ variant: "secondary" }),
53
+ "gap-1.5 rounded-full text-xs",
54
+ )}
55
+ >
51
56
  {icons[status]}
52
57
  {labels[status]}
53
58
  </span>
@@ -4,7 +4,13 @@ import { Check, ChevronsUpDown } from "lucide-react";
4
4
  import * as React from "react";
5
5
 
6
6
  import { Command } from "./command";
7
- import { CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "./command";
7
+ import {
8
+ CommandEmpty,
9
+ CommandGroup,
10
+ CommandInput,
11
+ CommandItem,
12
+ CommandList,
13
+ } from "./command";
8
14
  import { Button } from "../atoms/button";
9
15
  import { Popover, PopoverContent, PopoverTrigger } from "../molecules/popover";
10
16
 
@@ -22,7 +28,10 @@ type Props<T> = {
22
28
  selectedItem?: T;
23
29
  renderSelectedItem?: (selectedItem: T) => React.ReactNode;
24
30
  renderOnCreate?: (value: string) => React.ReactNode;
25
- renderListItem?: (listItem: { isChecked: boolean; item: T }) => React.ReactNode;
31
+ renderListItem?: (listItem: {
32
+ isChecked: boolean;
33
+ item: T;
34
+ }) => React.ReactNode;
26
35
  emptyResults?: React.ReactNode;
27
36
  popoverProps?: Omit<React.ComponentProps<typeof PopoverContent>, "className">;
28
37
  disabled?: boolean;
@@ -97,7 +106,9 @@ export function ComboboxDropdown<T extends ComboboxItem>({
97
106
  <>
98
107
  <Check
99
108
  className={
100
- isChecked ? "mr-2 h-4 w-4 opacity-100" : "mr-2 h-4 w-4 opacity-0"
109
+ isChecked
110
+ ? "mr-2 h-4 w-4 opacity-100"
111
+ : "mr-2 h-4 w-4 opacity-0"
101
112
  }
102
113
  />
103
114
  {item.label}
@@ -150,7 +161,7 @@ export function ComboboxDropdown<T extends ComboboxItem>({
150
161
  : selectedItem.label}
151
162
  </span>
152
163
  ) : (
153
- placeholder ?? "Select item..."
164
+ (placeholder ?? "Select item...")
154
165
  )}
155
166
  </span>
156
167
  <ChevronsUpDown className="size-4 opacity-50" />
@@ -10,7 +10,11 @@ import {
10
10
  } from "react-icons/md";
11
11
  import { cn } from "../../../../../../lib/utils";
12
12
  import { buttonVariants } from "../../../../atoms/button";
13
- import { Popover, PopoverContent, PopoverTrigger } from "../../../../molecules/popover";
13
+ import {
14
+ Popover,
15
+ PopoverContent,
16
+ PopoverTrigger,
17
+ } from "../../../../molecules/popover";
14
18
  import { formatUrlWithProtocol } from "../../utils";
15
19
  import { BubbleMenuButton } from "./bubble-menu-button";
16
20
 
@@ -44,7 +48,9 @@ export function LinkItem({ editor, open, setOpen }: LinkItemProps) {
44
48
  return (
45
49
  <Popover modal={false} open={open} onOpenChange={setOpen}>
46
50
  <PopoverTrigger
47
- render={<BubbleMenuButton isActive={isActive} action={() => setOpen(true)} />}
51
+ render={
52
+ <BubbleMenuButton isActive={isActive} action={() => setOpen(true)} />
53
+ }
48
54
  >
49
55
  {linkValue ? (
50
56
  <MdOutlineLinkOff className="size-4" />
@@ -463,13 +463,10 @@ const MultipleSelector = React.forwardRef<
463
463
  filter={commandFilter()}
464
464
  >
465
465
  <div
466
- className={cn(
467
- "min-h-10 border-b border-border text-sm",
468
- {
469
- "py-1": selected.length !== 0,
470
- "cursor-text": !disabled && selected.length !== 0,
471
- },
472
- )}
466
+ className={cn("min-h-10 border-b border-border text-sm", {
467
+ "py-1": selected.length !== 0,
468
+ "cursor-text": !disabled && selected.length !== 0,
469
+ })}
473
470
  onClick={() => {
474
471
  if (disabled) return;
475
472
  inputRef?.current?.focus();
@@ -78,11 +78,7 @@ export function PromptInputAttachment({
78
78
  const attachments = usePromptInputAttachments();
79
79
 
80
80
  return (
81
- <div
82
- className="group relative h-14 w-14 border"
83
- key={data.id}
84
- {...props}
85
- >
81
+ <div className="group relative h-14 w-14 border" key={data.id} {...props}>
86
82
  {data.mediaType?.startsWith("image/") && data.url ? (
87
83
  <img
88
84
  alt={data.filename || "attachment"}
@@ -100,13 +100,7 @@ export const Response = memo(
100
100
  ),
101
101
  a: (componentProps) => {
102
102
  if (isExternalUrl(componentProps.href)) {
103
- return (
104
- <a
105
- {...componentProps}
106
- rel="noreferrer"
107
- target="_blank"
108
- />
109
- );
103
+ return <a {...componentProps} rel="noreferrer" target="_blank" />;
110
104
  }
111
105
 
112
106
  return <a {...componentProps} />;
@@ -62,7 +62,9 @@ export function ToastToaster() {
62
62
  </div>
63
63
  </div>
64
64
 
65
- {props.variant === "progress" && <Progress value={progress} />}
65
+ {props.variant === "progress" && (
66
+ <Progress value={progress} />
67
+ )}
66
68
 
67
69
  {description && (
68
70
  <ToastDescription>{description}</ToastDescription>
@@ -7,7 +7,10 @@ const ToastProvider = ToastPrimitives.Provider;
7
7
 
8
8
  const ToastViewport = React.forwardRef<
9
9
  React.ElementRef<typeof ToastPrimitives.Viewport>,
10
- Omit<React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>, "className">
10
+ Omit<
11
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>,
12
+ "className"
13
+ >
11
14
  >((props, ref) => (
12
15
  <ToastPrimitives.Viewport
13
16
  ref={ref}
@@ -40,7 +43,10 @@ const toastVariants = cva(
40
43
 
41
44
  const Toast = React.forwardRef<
42
45
  React.ElementRef<typeof ToastPrimitives.Root>,
43
- Omit<React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root>, "className"> &
46
+ Omit<
47
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root>,
48
+ "className"
49
+ > &
44
50
  VariantProps<typeof toastVariants>
45
51
  >(({ variant, ...props }, ref) => {
46
52
  return (
@@ -55,7 +61,10 @@ Toast.displayName = ToastPrimitives.Root.displayName;
55
61
 
56
62
  const ToastAction = React.forwardRef<
57
63
  React.ElementRef<typeof ToastPrimitives.Action>,
58
- Omit<React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>, "className">
64
+ Omit<
65
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>,
66
+ "className"
67
+ >
59
68
  >((props, ref) => (
60
69
  <ToastPrimitives.Action
61
70
  ref={ref}
@@ -67,7 +76,10 @@ ToastAction.displayName = ToastPrimitives.Action.displayName;
67
76
 
68
77
  const ToastClose = React.forwardRef<
69
78
  React.ElementRef<typeof ToastPrimitives.Close>,
70
- Omit<React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>, "className">
79
+ Omit<
80
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>,
81
+ "className"
82
+ >
71
83
  >((props, ref) => (
72
84
  <ToastPrimitives.Close
73
85
  ref={ref}
@@ -82,13 +94,12 @@ ToastClose.displayName = ToastPrimitives.Close.displayName;
82
94
 
83
95
  const ToastTitle = React.forwardRef<
84
96
  React.ElementRef<typeof ToastPrimitives.Title>,
85
- Omit<React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>, "className">
97
+ Omit<
98
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>,
99
+ "className"
100
+ >
86
101
  >((props, ref) => (
87
- <ToastPrimitives.Title
88
- ref={ref}
89
- className="text-sm"
90
- {...props}
91
- />
102
+ <ToastPrimitives.Title ref={ref} className="text-sm" {...props} />
92
103
  ));
93
104
  ToastTitle.displayName = ToastPrimitives.Title.displayName;
94
105