@staffbase/design 19.0.1 → 20.0.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/dist/main.d.ts CHANGED
@@ -8,6 +8,7 @@ import { AutocompleteGroupProps } from '@base-ui/react';
8
8
  import { AutocompleteInputProps } from '@base-ui/react';
9
9
  import { AutocompleteListProps } from '@base-ui/react';
10
10
  import { AutocompleteStatusProps } from '@base-ui/react';
11
+ import { Avatar as Avatar_2 } from '@base-ui/react/avatar';
11
12
  import { ButtonHTMLAttributes } from 'react';
12
13
  import { ChangeEvent } from 'react';
13
14
  import { ClassAttributes } from 'react';
@@ -129,6 +130,11 @@ export declare const ActionMenuTrigger: default_2.ForwardRefExoticComponent<{
129
130
  children: ReactNode;
130
131
  } & default_2.RefAttributes<HTMLElement>>;
131
132
 
133
+ declare interface ActionProps extends ComponentProps<'button'> {
134
+ color?: Extract<ComponentProps<typeof Button>['color'], 'primary' | 'critical'>;
135
+ children: ReactNode;
136
+ }
137
+
132
138
  export declare const AddCircleIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
133
139
 
134
140
  export declare const AddIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
@@ -144,7 +150,7 @@ export declare const AlertDialog: {
144
150
  Trigger: (props: TriggerProps) => JSX.Element;
145
151
  Popup: ForwardRefExoticComponent<Omit<PopupProps, "ref"> & RefAttributes<HTMLDivElement>>;
146
152
  Cancel: ForwardRefExoticComponent<Omit<Omit< ButtonProps, "ref"> & RefAttributes<HTMLButtonElement>, "ref"> & RefAttributes<HTMLButtonElement>>;
147
- Action: ForwardRefExoticComponent<Omit<Omit< ButtonProps, "ref"> & RefAttributes<HTMLButtonElement>, "ref"> & RefAttributes<HTMLButtonElement>>;
153
+ Action: ForwardRefExoticComponent<Omit<ActionProps, "ref"> & RefAttributes<HTMLButtonElement>>;
148
154
  Title: ForwardRefExoticComponent<Omit< AlertDialogTitleProps, "ref"> & RefAttributes<HTMLHeadingElement>>;
149
155
  Description: ForwardRefExoticComponent<Omit< AlertDialogDescriptionProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
150
156
  Icon: ForwardRefExoticComponent<Omit< ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
@@ -170,15 +176,26 @@ export declare const ArtboardIcon: default_2.NamedExoticComponent<default_2.SVGA
170
176
 
171
177
  export declare const AttachmentIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
172
178
 
173
- export declare function Avatar(props: AvatarProps): ReactElement;
179
+ export declare const Avatar: {
180
+ Root: ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & RefAttributes<HTMLSpanElement>>;
181
+ Fallback: ForwardRefExoticComponent<Omit<FallbackProps, "ref"> & RefAttributes<HTMLSpanElement>>;
182
+ Group: ForwardRefExoticComponent<Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
183
+ GroupCount: ForwardRefExoticComponent<Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
184
+ Image: ForwardRefExoticComponent<Omit<ImageProps, "ref"> & RefAttributes<HTMLImageElement>>;
185
+ };
186
+
187
+ /** @deprecated Use `Avatar` from `@staffbase/design` instead */
188
+ declare type AvatarColor = 'cyan' | 'pink' | 'purple' | 'teal';
189
+
190
+ /** @deprecated Use `Avatar` from `@staffbase/design` instead */
191
+ export declare function AvatarDeprecated(props: AvatarDeprecatedProps): ReactElement;
174
192
 
175
- export declare namespace Avatar {
193
+ export declare namespace AvatarDeprecated {
176
194
  var displayName: string;
177
195
  }
178
196
 
179
- declare type AvatarColor = 'cyan' | 'pink' | 'purple' | 'teal';
180
-
181
- export declare interface AvatarProps {
197
+ /** @deprecated Use `Avatar` from `@staffbase/design` instead */
198
+ export declare interface AvatarDeprecatedProps {
182
199
  /**
183
200
  * The `alt` attribute for the rendered `img` element
184
201
  */
@@ -207,10 +224,15 @@ export declare interface AvatarProps {
207
224
  className?: string;
208
225
  }
209
226
 
227
+ declare interface AvatarProps extends Avatar_2.Root.Props {
228
+ size?: 48 | 40 | 32 | 24 | 16;
229
+ }
230
+
210
231
  declare interface AvatarProps_2 extends Omit<ComponentProps<'div'>, 'children'> {
211
232
  size?: 48 | 40 | 32 | 24 | 16;
212
233
  }
213
234
 
235
+ /** @deprecated Use `Avatar` from `@staffbase/design` instead */
214
236
  declare type AvatarSize = '48' | '40' | '32' | '24' | '16';
215
237
 
216
238
  declare interface BackProps extends ComponentProps<'button'> {
@@ -255,7 +277,7 @@ export declare interface BadgeProps {
255
277
  declare type BadgeVariant = 'primary' | 'secondary' | 'critical' | 'gamification';
256
278
 
257
279
  export declare const Banner: ForwardRefExoticComponent<BannerProps & RefAttributes<HTMLDivElement>> & {
258
- CloseButton: ForwardRefExoticComponent<CloseButtonProps & RefAttributes<HTMLButtonElement>>;
280
+ Close: ForwardRefExoticComponent<Omit<CloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
259
281
  };
260
282
 
261
283
  export declare interface BannerProps extends HTMLAttributes<HTMLDivElement> {
@@ -371,7 +393,7 @@ export declare const BottomSheet: {
371
393
  Root: typeof Drawer.Root;
372
394
  Popup: ForwardRefExoticComponent<Omit<PopupProps_2, "ref"> & RefAttributes<HTMLDivElement>>;
373
395
  Trigger: (props: TriggerProps_2) => JSX.Element;
374
- Close: ForwardRefExoticComponent<Omit<CloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
396
+ Close: ForwardRefExoticComponent<Omit<CloseProps_2, "ref"> & RefAttributes<HTMLButtonElement>>;
375
397
  Back: ForwardRefExoticComponent<Omit<BackProps, "ref"> & RefAttributes<HTMLButtonElement>>;
376
398
  Description: ForwardRefExoticComponent<Omit< DrawerDescriptionProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
377
399
  Title: ForwardRefExoticComponent<Omit< DrawerTitleProps, "ref"> & RefAttributes<HTMLHeadingElement>>;
@@ -389,6 +411,8 @@ export declare const BurgerIcon: default_2.NamedExoticComponent<default_2.SVGAtt
389
411
 
390
412
  export declare const Button: ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & RefAttributes<HTMLButtonElement>>;
391
413
 
414
+ declare type ButtonBaseProps = Omit<ComponentProps<'button'>, 'color'>;
415
+
392
416
  /** @deprecated Use Button instead */
393
417
  export declare const ButtonDeprecated: ForwardRefExoticComponent<ButtonDeprecatedProps & RefAttributes<HTMLButtonElement>>;
394
418
 
@@ -410,10 +434,7 @@ export declare interface ButtonDeprecatedProps extends BaseButtonProps {
410
434
 
411
435
  declare type ButtonIconPosition = 'leading' | 'trailing';
412
436
 
413
- export declare interface ButtonProps extends ComponentProps<'button'> {
414
- variant?: 'solid' | 'outline' | 'ghost';
415
- color?: 'primary' | 'neutral' | 'critical';
416
- iconOnly?: boolean;
437
+ export declare interface ButtonProps extends ButtonBaseProps, ButtonStyleProps {
417
438
  children: ReactNode;
418
439
  }
419
440
 
@@ -430,8 +451,22 @@ export declare interface ButtonSingleSelectProps<TOption extends BaseOption> ext
430
451
  ariaLabelledBy?: string;
431
452
  }
432
453
 
454
+ declare interface ButtonStyleProps {
455
+ variant?: 'solid' | 'outline' | 'ghost';
456
+ color?: 'primary' | 'neutral' | 'critical';
457
+ iconOnly?: boolean;
458
+ className?: string;
459
+ }
460
+
433
461
  declare type ButtonVariant = 'primary' | 'secondary' | 'critical';
434
462
 
463
+ export declare function buttonVariants({ variant, color, iconOnly, className }?: ButtonStyleProps): {
464
+ className: string;
465
+ 'data-variant': "solid" | "outline" | "ghost";
466
+ 'data-color': "critical" | "primary" | "neutral";
467
+ 'data-icon-only': boolean | undefined;
468
+ };
469
+
435
470
  export declare const CalendarIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
436
471
 
437
472
  export declare const CameraIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
@@ -502,20 +537,19 @@ export declare const ClickIcon: default_2.NamedExoticComponent<default_2.SVGAttr
502
537
 
503
538
  export declare const ClockIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
504
539
 
505
- export declare interface CloseButtonProps extends HTMLAttributes<HTMLButtonElement> {
506
- className?: string;
507
- 'aria-label': string;
508
- }
509
-
510
540
  export declare const CloseCircleIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
511
541
 
512
542
  export declare const CloseIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
513
543
 
514
- declare interface CloseProps extends Drawer.Close.Props {
544
+ declare interface CloseProps extends ComponentProps<'button'> {
545
+ 'aria-label': string;
546
+ }
547
+
548
+ declare interface CloseProps_2 extends Drawer.Close.Props {
515
549
  'aria-label': string;
516
550
  }
517
551
 
518
- declare interface CloseProps_2 extends Omit<Dialog_2.Close.Props, 'children'> {
552
+ declare interface CloseProps_3 extends Omit<Dialog_2.Close.Props, 'children'> {
519
553
  children: Dialog_2.Close.Props['render'];
520
554
  }
521
555
 
@@ -547,7 +581,7 @@ export declare const Dialog: {
547
581
  Root: typeof Dialog_2.Root;
548
582
  Popup: ForwardRefExoticComponent<Omit<PopupProps_3, "ref"> & RefAttributes<HTMLDivElement>>;
549
583
  Trigger: (props: TriggerProps_3) => JSX.Element;
550
- Close: ForwardRefExoticComponent<Omit<CloseProps_2, "ref"> & RefAttributes<HTMLButtonElement>>;
584
+ Close: ForwardRefExoticComponent<Omit<CloseProps_3, "ref"> & RefAttributes<HTMLButtonElement>>;
551
585
  Description: ForwardRefExoticComponent<Omit< AlertDialogDescriptionProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
552
586
  Title: ForwardRefExoticComponent<Omit< AlertDialogTitleProps, "ref"> & RefAttributes<HTMLHeadingElement>>;
553
587
  Header: ForwardRefExoticComponent<Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
@@ -597,12 +631,30 @@ export declare const EmailOpenIcon: default_2.NamedExoticComponent<default_2.SVG
597
631
 
598
632
  export declare const EmailTeamsIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
599
633
 
634
+ export declare const Empty: {
635
+ Root: ForwardRefExoticComponent<Omit< ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
636
+ children: ReactNode;
637
+ }, "ref"> & RefAttributes<HTMLDivElement>>;
638
+ Media: ForwardRefExoticComponent<Omit<EmptyMediaProps, "ref"> & RefAttributes<HTMLDivElement>>;
639
+ Title: ForwardRefExoticComponent<Omit<EmptyTitleProps, "ref"> & RefAttributes<HTMLHeadingElement>>;
640
+ Description: ForwardRefExoticComponent<Omit< ClassAttributes<HTMLParagraphElement> & HTMLAttributes<HTMLParagraphElement> & {
641
+ children: ReactNode;
642
+ }, "ref"> & RefAttributes<HTMLParagraphElement>>;
643
+ };
644
+
645
+ declare interface EmptyMediaProps extends ComponentProps<'div'> {
646
+ children: ReactNode;
647
+ size?: 'xs' | 'md' | 'lg';
648
+ }
649
+
650
+ /** @deprecated Use Empty instead */
600
651
  export declare function EmptyState(props: EmptyStateProps): ReactElement;
601
652
 
602
653
  export declare namespace EmptyState {
603
654
  var displayName: string;
604
655
  }
605
656
 
657
+ /** @deprecated Use Empty instead */
606
658
  export declare interface EmptyStateProps {
607
659
  /**
608
660
  * Defines the title of the component
@@ -627,12 +679,22 @@ export declare interface EmptyStateProps {
627
679
  className?: string;
628
680
  }
629
681
 
682
+ declare interface EmptyTitleProps extends ComponentProps<'h2'> {
683
+ children: ReactNode;
684
+ as: 'h2' | 'h3' | 'h4' | 'p';
685
+ }
686
+
630
687
  export declare const ExpandHorizontalIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
631
688
 
632
689
  export declare const ExpandIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
633
690
 
634
691
  export declare const ExpandVerticalIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
635
692
 
693
+ declare interface FallbackProps extends Avatar_2.Fallback.Props {
694
+ name?: string;
695
+ children: ReactNode;
696
+ }
697
+
636
698
  export declare const FeatureAnalyticsIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
637
699
 
638
700
  export declare const FeatureCampaignsIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
@@ -1008,6 +1070,7 @@ declare const iconList: {
1008
1070
  readonly 'lock-alt': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1009
1071
  readonly login: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1010
1072
  readonly logout: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1073
+ readonly 'long-text': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1011
1074
  readonly 'magic-wand': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1012
1075
  readonly 'map-pin': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1013
1076
  readonly 'merge-left': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
@@ -1093,9 +1156,11 @@ declare const iconList: {
1093
1156
  readonly settings: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1094
1157
  readonly 'share-android': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1095
1158
  readonly 'share-ios': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1159
+ readonly 'short-text': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1096
1160
  readonly shrink: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1097
1161
  readonly 'sidebar-left': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1098
1162
  readonly 'sidebar-right': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1163
+ readonly 'single-choice-question': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1099
1164
  readonly 'slider-question': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1100
1165
  readonly snowflake: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
1101
1166
  readonly sort: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
@@ -1162,6 +1227,11 @@ declare type IconSize = '40px' | '96px';
1162
1227
 
1163
1228
  export declare const ImageIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1164
1229
 
1230
+ declare interface ImageProps extends Avatar_2.Image.Props {
1231
+ src: string;
1232
+ alt: string;
1233
+ }
1234
+
1165
1235
  export declare const ImageUploadIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1166
1236
 
1167
1237
  export declare const InfoIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
@@ -1213,6 +1283,8 @@ export declare const LoginIcon: default_2.NamedExoticComponent<default_2.SVGAttr
1213
1283
 
1214
1284
  export declare const LogoutIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1215
1285
 
1286
+ export declare const LongTextIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1287
+
1216
1288
  export declare const MagicWandIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1217
1289
 
1218
1290
  export declare const MapPinIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
@@ -1808,12 +1880,16 @@ export declare const ShareAndroidIcon: default_2.NamedExoticComponent<default_2.
1808
1880
 
1809
1881
  export declare const ShareIosIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1810
1882
 
1883
+ export declare const ShortTextIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1884
+
1811
1885
  export declare const ShrinkIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1812
1886
 
1813
1887
  export declare const SidebarLeftIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1814
1888
 
1815
1889
  export declare const SidebarRightIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1816
1890
 
1891
+ export declare const SingleChoiceQuestionIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
1892
+
1817
1893
  /** @deprecated use Select or SearchableSingleSelect components instead */
1818
1894
  export declare function SingleSelect<TOption extends BaseOption>(props: SingleSelectProps<TOption>): JSX.Element;
1819
1895