@deckai/deck-ui 0.0.4 → 0.0.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.
@@ -1,48 +1,82 @@
1
1
  import * as React from 'react';
2
- import React__default, { ButtonHTMLAttributes, SVGProps, HTMLAttributes } from 'react';
2
+ import React__default, { SVGProps, ButtonHTMLAttributes, HTMLAttributes } from 'react';
3
3
  import { IconName } from '@deckai/icons';
4
- import { I as IconColors, C as Colors, T as TextColorVariant, P as PrimaryShades, S as SecondaryShades, a as TertiaryShades, b as Typography } from '../tailwind-BOs_0iUp.js';
5
- import { IconName as IconName$1 } from '@deckai/icons/src/types/icon-names';
6
4
  import * as SwitchPrimitive from '@radix-ui/react-switch';
5
+ import { IconName as IconName$1 } from '@deckai/icons/src/types/icon-names';
7
6
 
8
- interface TooltipProps {
9
- content: React.ReactNode;
10
- children: React.ReactNode;
11
- side?: "top" | "right" | "bottom" | "left";
12
- align?: "start" | "center" | "end";
13
- className?: string;
14
- delayDuration?: number;
15
- }
16
- declare const Tooltip: ({ content, children, side, align, className, delayDuration }: TooltipProps) => React.JSX.Element;
17
-
18
- type ProfileCardProps = {
19
- profileImage: string;
7
+ type OptionProps = {
8
+ label: string;
9
+ value: string;
10
+ onChange?: (value: string) => void;
11
+ selected?: boolean;
20
12
  };
21
- declare const ProfileCard: ({ profileImage }: ProfileCardProps) => React__default.JSX.Element;
13
+ declare const Option: ({ value, label, onChange, selected }: OptionProps) => React__default.JSX.Element;
22
14
 
23
- type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;
24
- declare const Pressable: React__default.FC<PressableProps>;
15
+ type ColorShade = "5" | "10" | "15" | "20" | "25" | "30" | "50" | "100" | "200" | "300" | "400" | "500" | "600" | "DEFAULT";
16
+ type TextColorVariant = "primary" | "secondary" | "white" | "primary-blue";
17
+ type BackgroundShades = Pick<Record<ColorShade, string>, "50" | "100">;
18
+ type PrimaryShades = Pick<Record<ColorShade, string>, "50" | "100">;
19
+ type SecondaryShades = Pick<Record<ColorShade, string>, "50" | "100" | "200" | "300" | "400" | "500" | "600">;
20
+ type TertiaryShades = Pick<Record<ColorShade, string>, "5" | "10" | "15" | "20" | "25" | "30">;
21
+ type StrokeShades = Pick<Record<ColorShade, string>, "DEFAULT">;
22
+ type TextShades = Record<TextColorVariant, string>;
23
+ type Colors = {
24
+ background: BackgroundShades;
25
+ primary: PrimaryShades;
26
+ secondary: SecondaryShades;
27
+ tertiary: TertiaryShades;
28
+ stroke: StrokeShades | string;
29
+ text: TextShades;
30
+ overlay: string;
31
+ };
32
+ type HeadingSize = "xl" | "lg" | "md" | "sm" | "xs";
33
+ type BodySize = "lg" | "lg-semibold" | "md" | "default" | "default-medium" | "default-semibold" | "default-bold" | "xs" | "xs-medium" | "xxs" | "xxs-medium" | "xxs-semibold";
34
+ type LabelSize = "default";
35
+ type Typography = {
36
+ heading: Record<HeadingSize, TypographyConfig>;
37
+ body: Record<BodySize, TypographyConfig>;
38
+ label: Record<LabelSize, TypographyConfig>;
39
+ };
40
+ type TypographyConfig = {
41
+ fontSize: string;
42
+ lineHeight?: string;
43
+ letterSpacing?: string;
44
+ fontWeight: string;
45
+ textTransform?: string;
46
+ };
47
+ type IconColors = "primary" | "secondary" | "white" | "primaryBlue";
25
48
 
26
49
  type IconProps = {
27
50
  name: IconName;
28
51
  /** @default 24 */
29
- size?: number | string;
52
+ size?: number | `${Breakpoint$1}:${number}`;
30
53
  /** @default primary */
31
54
  color?: IconColors;
32
55
  title?: string;
33
56
  className?: string;
34
57
  style?: React__default.CSSProperties;
35
58
  } & Omit<SVGProps<SVGSVGElement>, "aria-hidden" | "aria-label">;
36
- declare const Icon: React__default.ForwardRefExoticComponent<Omit<{
37
- name: IconName;
38
- /** @default 24 */
39
- size?: number | string;
40
- /** @default primary */
41
- color?: IconColors;
42
- title?: string;
43
- className?: string;
44
- style?: React__default.CSSProperties;
45
- } & Omit<React__default.SVGProps<SVGSVGElement>, "aria-hidden" | "aria-label"> & Pick<PressableProps, "onClick">, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
59
+ type Breakpoint$1 = "sm" | "md" | "lg" | "xl" | "2xl";
60
+ declare const Icon: React__default.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
61
+
62
+ type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;
63
+ declare const Pressable: React__default.FC<PressableProps>;
64
+
65
+ type NavbarItemProps = {
66
+ iconName: IconName;
67
+ hasNotification?: boolean;
68
+ } & Pick<IconProps, "color" | "title"> & PressableProps;
69
+ declare const NavbarItem: ({ iconName, hasNotification, color, title, ...props }: NavbarItemProps) => React__default.JSX.Element;
70
+
71
+ type NavbarProps = {
72
+ searchOptions: OptionProps[];
73
+ onSearchChange: (value: string) => void;
74
+ navbarItems: NavbarItemProps[];
75
+ onLogoClick?: () => void;
76
+ onProfileClick?: () => void;
77
+ avatarImage: string;
78
+ };
79
+ declare const Navbar: ({ searchOptions, onSearchChange, navbarItems, onLogoClick, onProfileClick, avatarImage }: NavbarProps) => React__default.JSX.Element;
46
80
 
47
81
  type TextElement = "p" | "span" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "strong" | "em" | "blockquote" | "pre" | "code" | "small" | "label" | "a";
48
82
  type HTMLPropsMap = {
@@ -74,38 +108,48 @@ type TypographyKey = {
74
108
  [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;
75
109
  }[TypographyCategory];
76
110
  type Weight = "light" | "regular" | "semibold" | "bold";
111
+ type Breakpoint = "sm" | "md" | "lg" | "xl" | "2xl";
112
+ type ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;
77
113
  type TextProps<T extends TextElement = "p"> = {
78
- variant?: TypographyKey;
114
+ variant?: ResponsiveVariant | ResponsiveVariant[];
79
115
  color?: ColorKey | "inherit";
80
116
  as?: T;
81
117
  className?: string;
82
118
  children: React__default.ReactNode;
83
119
  weight?: Weight;
84
120
  } & HTMLPropsMap[T];
85
- declare const Text: React__default.ForwardRefExoticComponent<TextProps<TextElement> & React__default.RefAttributes<HTMLElement | HTMLSpanElement | HTMLParagraphElement | HTMLHeadingElement | HTMLQuoteElement | HTMLPreElement | HTMLLabelElement | HTMLAnchorElement>>;
121
+ declare const Text: React__default.ForwardRefExoticComponent<TextProps<TextElement> & React__default.RefAttributes<HTMLElement | HTMLParagraphElement | HTMLSpanElement | HTMLHeadingElement | HTMLQuoteElement | HTMLPreElement | HTMLLabelElement | HTMLAnchorElement>>;
86
122
 
87
- type OptionProps = {
88
- label: string;
89
- value: string;
90
- onChange?: (value: string) => void;
91
- };
92
- declare const Option: ({ value, label, onChange }: OptionProps) => React__default.JSX.Element;
123
+ type LinkProps = {
124
+ href: string;
125
+ children: React__default.ReactNode;
126
+ className?: string;
127
+ style?: React__default.CSSProperties;
128
+ } & Pick<TextProps, "variant" | "color"> & React__default.AnchorHTMLAttributes<HTMLAnchorElement>;
129
+ declare const Link: ({ children, color, variant, href, className, ...props }: LinkProps) => React__default.JSX.Element;
93
130
 
94
- type NavbarItemProps = {
95
- iconName: IconName;
131
+ type TabItem = {
132
+ value: string;
96
133
  label: string;
97
- onClick?: () => void;
134
+ content: React__default.ReactNode;
135
+ };
136
+ type TabsProps = {
137
+ items: TabItem[];
138
+ defaultValue?: string;
139
+ className?: string;
140
+ onChange?: (value: string) => void;
98
141
  };
99
- declare const NavbarItem: ({ label, iconName, onClick, ...props }: NavbarItemProps) => React__default.JSX.Element;
142
+ declare const Tabs: React__default.ForwardRefExoticComponent<TabsProps & React__default.RefAttributes<HTMLDivElement>>;
100
143
 
101
- type NavbarProps = {
102
- searchOptions: OptionProps[];
103
- onSearchChange: (value: string) => void;
104
- navbarItems: NavbarItemProps[];
105
- onLogoClick?: () => void;
106
- onProfileClick?: () => void;
144
+ type WorkCardProps = {
145
+ socialIconName: "instagram-filled" | "tiktok-filled" | "youtube-filled";
146
+ tags: string[];
147
+ caption: string;
148
+ /** play count should already be formatted with k or m */
149
+ playCount: string;
150
+ backgroundImage: string;
107
151
  };
108
- declare const Navbar: ({ searchOptions, onSearchChange, navbarItems, onLogoClick, onProfileClick }: NavbarProps) => React__default.JSX.Element;
152
+ declare const WorkCard: ({ socialIconName, tags, caption, playCount, backgroundImage }: WorkCardProps) => React__default.JSX.Element;
109
153
 
110
154
  type BreadcrumbItem = {
111
155
  label: string;
@@ -119,32 +163,15 @@ type BreadcrumbsProps = {
119
163
  };
120
164
  declare const Breadcrumbs: React__default.ForwardRefExoticComponent<BreadcrumbsProps & React__default.RefAttributes<HTMLElement>>;
121
165
 
122
- type ContactItemProps = {
123
- iconName: IconName$1;
124
- children: React__default.ReactNode;
125
- href: string;
126
- } & Omit<HTMLAttributes<HTMLAnchorElement>, "color">;
127
- declare const ContactItem: ({ iconName, children, href, ...linkProps }: ContactItemProps) => React__default.JSX.Element;
128
-
129
- type AboutCardProps = {
130
- interests: string[];
131
- contactItems: ContactItemProps[];
132
- };
133
- declare const AboutCard: ({ interests, contactItems }: AboutCardProps) => React__default.JSX.Element;
134
-
135
- type LinkProps = {
136
- href: string;
137
- children: React__default.ReactNode;
166
+ interface TooltipProps {
167
+ content: React.ReactNode;
168
+ children: React.ReactNode;
169
+ side?: "top" | "right" | "bottom" | "left";
170
+ align?: "start" | "center" | "end";
138
171
  className?: string;
139
- style?: React__default.CSSProperties;
140
- } & Pick<TextProps, "variant" | "color"> & React__default.AnchorHTMLAttributes<HTMLAnchorElement>;
141
- declare const Link: ({ children, color, variant, href, className, ...props }: LinkProps) => React__default.JSX.Element;
142
-
143
- type AvatarProps = {
144
- src: string;
145
- size?: number | string;
146
- } & Pick<React__default.ComponentProps<typeof Pressable>, "onClick">;
147
- declare const Avatar: ({ src, size, onClick, ...props }: AvatarProps) => React__default.JSX.Element;
172
+ delayDuration?: number;
173
+ }
174
+ declare const Tooltip: ({ content, children, side, align, className, delayDuration }: TooltipProps) => React.JSX.Element;
148
175
 
149
176
  type ComboboxProps = {
150
177
  options: OptionProps[];
@@ -158,11 +185,13 @@ declare const Combobox: ({ options, placeholder, value, onChange, end, className
158
185
 
159
186
  type TagProps = {
160
187
  children: React__default.ReactNode;
188
+ padded?: boolean;
189
+ color?: "primary" | "text";
161
190
  } & HTMLAttributes<HTMLDivElement>;
162
- declare const Tag: ({ children, ...props }: TagProps) => React__default.JSX.Element;
191
+ declare const Tag: ({ children, padded, color, ...props }: TagProps) => React__default.JSX.Element;
163
192
 
164
193
  type SocialCardProps = {
165
- icon: IconName$1;
194
+ icon: IconName;
166
195
  followers: string;
167
196
  engagement: string;
168
197
  } & PressableProps;
@@ -177,20 +206,6 @@ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitive.Switc
177
206
  description?: string;
178
207
  } & React.RefAttributes<HTMLButtonElement>>;
179
208
 
180
- type InputProps = {
181
- className?: string;
182
- end?: React.ReactNode;
183
- } & React.InputHTMLAttributes<HTMLInputElement>;
184
- declare const Input: ({ className, end, ...props }: InputProps) => React.JSX.Element;
185
-
186
- type LogoProps = {
187
- /** @default 76 */
188
- width?: number;
189
- /** @default 25 */
190
- height?: number;
191
- };
192
- declare const Logo: ({ width, height }: LogoProps) => React__default.JSX.Element;
193
-
194
209
  type BadgeProps = {
195
210
  variant?: "pink" | "orange" | "green";
196
211
  iconName?: IconName;
@@ -200,6 +215,44 @@ declare const Badge: React.ForwardRefExoticComponent<{
200
215
  iconName?: IconName;
201
216
  } & React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
202
217
 
218
+ type ProfileCardProps = {
219
+ profileImage: string;
220
+ name: string;
221
+ location: string;
222
+ memberSince?: string;
223
+ interests?: string[];
224
+ badges?: BadgeProps[];
225
+ };
226
+ declare const ProfileCard: ({ profileImage, name, location, memberSince, interests, badges }: ProfileCardProps) => React__default.JSX.Element;
227
+
228
+ type ContactItemProps = {
229
+ iconName: IconName$1;
230
+ children: React__default.ReactNode;
231
+ href: string;
232
+ } & Omit<HTMLAttributes<HTMLAnchorElement>, "color">;
233
+ declare const ContactItem: ({ iconName, children, href, ...linkProps }: ContactItemProps) => React__default.JSX.Element;
234
+
235
+ type AboutCardProps = {
236
+ interests: string[];
237
+ contactItems: ContactItemProps[];
238
+ description: string;
239
+ };
240
+ declare const AboutCard: ({ interests, contactItems, description, ...props }: AboutCardProps) => React__default.JSX.Element;
241
+
242
+ type AvatarProps = {
243
+ src: string;
244
+ size?: number | string;
245
+ } & Pick<React__default.ComponentProps<typeof Pressable>, "onClick">;
246
+ declare const Avatar: ({ src, size, onClick, ...props }: AvatarProps) => React__default.JSX.Element;
247
+
248
+ type LogoProps = {
249
+ /** @default 76 */
250
+ width?: number;
251
+ /** @default 25 */
252
+ height?: number;
253
+ };
254
+ declare const Logo: ({ width, height }: LogoProps) => React__default.JSX.Element;
255
+
203
256
  type ButtonProps = {
204
257
  /** @default filled */
205
258
  variant?: "filled" | "outlined";
@@ -225,4 +278,60 @@ declare const Button: React.ForwardRefExoticComponent<{
225
278
  end?: React.ReactNode;
226
279
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
227
280
 
228
- export { AboutCard, type AboutCardProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Combobox, type ComboboxProps, ContactItem, type ContactItemProps, Icon, type IconProps, Input, type InputProps, Link, type LinkProps, Logo, type LogoProps, Navbar, NavbarItem, type NavbarItemProps, type NavbarProps, Option, type OptionProps, Pressable, type PressableProps, ProfileCard, type ProfileCardProps, SocialCard, type SocialCardProps, Switch, type SwitchProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps };
281
+ type InputProps = {
282
+ className?: string;
283
+ end?: React.ReactNode;
284
+ /** renders an icon in the end slot */
285
+ iconName?: IconName;
286
+ } & React.InputHTMLAttributes<HTMLInputElement> & Pick<IconProps, "color" | "size" | "title">;
287
+ declare const Input: ({ className, end, iconName, color, size, title, ...props }: InputProps) => React.JSX.Element;
288
+
289
+ declare const config: {
290
+ content: string[];
291
+ theme: {
292
+ extend: {
293
+ colors: Colors;
294
+ fontSize: {
295
+ [x: string]: [string, object];
296
+ };
297
+ fontFamily: {
298
+ sans: [string, string];
299
+ };
300
+ fontWeight: {
301
+ light: string;
302
+ regular: string;
303
+ normal: string;
304
+ semibold: string;
305
+ bold: string;
306
+ };
307
+ };
308
+ };
309
+ plugins: {
310
+ handler: () => void;
311
+ }[];
312
+ safelist: string[];
313
+ keyframes: {
314
+ "fade-in": {
315
+ from: {
316
+ opacity: string;
317
+ };
318
+ to: {
319
+ opacity: string;
320
+ };
321
+ };
322
+ "fade-out": {
323
+ from: {
324
+ opacity: string;
325
+ };
326
+ to: {
327
+ opacity: string;
328
+ };
329
+ };
330
+ };
331
+ animation: {
332
+ "fade-in": string;
333
+ "fade-out": string;
334
+ };
335
+ };
336
+
337
+ export { AboutCard, type AboutCardProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Combobox, type ComboboxProps, ContactItem, type ContactItemProps, Icon, type IconProps, Input, type InputProps, Link, type LinkProps, Logo, type LogoProps, Navbar, NavbarItem, type NavbarItemProps, type NavbarProps, Option, type OptionProps, Pressable, type PressableProps, ProfileCard, type ProfileCardProps, SocialCard, type SocialCardProps, Switch, type SwitchProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, WorkCard, type WorkCardProps, config as tailwindConfig };