@bubo-squared/ui-framework 0.2.13 → 0.2.15

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/index.d.cts CHANGED
@@ -2,7 +2,9 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
2
2
  import * as React$1 from 'react';
3
3
  import { FC } from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
5
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
6
8
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
7
9
  import * as RPNInput from 'react-phone-number-input';
8
10
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
@@ -71,6 +73,14 @@ type MessageButtonProps = Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>,
71
73
  };
72
74
  declare const MessageButton: React$1.FC<MessageButtonProps>;
73
75
 
76
+ declare const Accordion: React$1.ForwardRefExoticComponent<Omit<Omit<AccordionPrimitive.AccordionSingleProps & React$1.RefAttributes<HTMLDivElement>, "ref">, "children" | "type" | "title" | "collapsible"> & {
77
+ title: React$1.ReactNode;
78
+ expandIcon?: React$1.ReactNode;
79
+ defaultOpen?: boolean;
80
+ children: React$1.ReactNode;
81
+ bordered?: boolean;
82
+ } & React$1.RefAttributes<HTMLDivElement>>;
83
+
74
84
  type AvatarVariant = "initial" | "icon" | "image";
75
85
  declare const avatarVariants: (props?: ({
76
86
  size?: "20" | "24" | "32" | "40" | "48" | "56" | "64" | null | undefined;
@@ -265,37 +275,141 @@ interface TagProps extends VariantProps<typeof tagVariants> {
265
275
  }
266
276
  declare const Tag: React$1.ForwardRefExoticComponent<TagProps & React$1.RefAttributes<HTMLDivElement>>;
267
277
 
278
+ type DropdownSize = "sm" | "md" | "lg" | "xl";
279
+
280
+ declare function DropdownMenuPortal({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Portal>): react_jsx_runtime.JSX.Element;
281
+ declare function DropdownMenuGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Group>): react_jsx_runtime.JSX.Element;
282
+ declare function DropdownMenuItem({ className, inset, size, variant, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
283
+ inset?: boolean;
284
+ size?: DropdownSize;
285
+ variant?: "default" | "destructive";
286
+ }): react_jsx_runtime.JSX.Element;
287
+ declare function DropdownMenuLabel({ className, inset, size, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
288
+ inset?: boolean;
289
+ size?: DropdownSize;
290
+ }): react_jsx_runtime.JSX.Element;
291
+ declare function DropdownMenuSeparator({ className, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Separator>): react_jsx_runtime.JSX.Element;
292
+ declare function DropdownMenuShortcut({ className, ...props }: React$1.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
293
+ declare function DropdownMenuSub({ ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Sub>): react_jsx_runtime.JSX.Element;
294
+ declare function DropdownMenuSubTrigger({ className, inset, size, children, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
295
+ inset?: boolean;
296
+ size?: DropdownSize;
297
+ }): react_jsx_runtime.JSX.Element;
298
+ declare function DropdownMenuSubContent({ className, size, ...props }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubContent> & {
299
+ size?: DropdownSize;
300
+ }): react_jsx_runtime.JSX.Element;
301
+
302
+ interface MenuProps {
303
+ trigger: React$1.ReactElement;
304
+ children: React$1.ReactNode;
305
+ size?: DropdownSize;
306
+ align?: DropdownMenuPrimitive.DropdownMenuContentProps["align"];
307
+ side?: DropdownMenuPrimitive.DropdownMenuContentProps["side"];
308
+ offset?: number;
309
+ className?: string;
310
+ open?: boolean;
311
+ onOpenChange?: (open: boolean) => void;
312
+ modal?: boolean;
313
+ }
314
+ declare const Menu: React$1.FC<MenuProps>;
315
+ declare const MenuGroup: typeof DropdownMenuGroup;
316
+ declare const MenuItem: typeof DropdownMenuItem;
317
+ declare const MenuLabel: typeof DropdownMenuLabel;
318
+ declare const MenuPortal: typeof DropdownMenuPortal;
319
+ declare const MenuSeparator: typeof DropdownMenuSeparator;
320
+ declare const MenuShortcut: typeof DropdownMenuShortcut;
321
+ declare const MenuSub: typeof DropdownMenuSub;
322
+ declare const MenuSubContent: typeof DropdownMenuSubContent;
323
+ declare const MenuSubTrigger: typeof DropdownMenuSubTrigger;
324
+
268
325
  interface CheckboxProps extends React$1.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
326
+ /** Only needed when the component is a part of a native form. */
327
+ name?: string;
269
328
  label?: string;
270
329
  }
271
330
  declare function Checkbox({ label, className, ...props }: CheckboxProps): react_jsx_runtime.JSX.Element;
272
331
 
273
- type DropdownStatus = "default" | "success" | "error";
274
- interface DropdownOption {
332
+ type TextInputSize = "sm" | "md" | "lg" | "xl";
333
+ type TextInputStatus = "default" | "success" | "error";
334
+ interface TextInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled"> {
335
+ label?: string;
336
+ hint?: string;
337
+ /**
338
+ * If true, the hint will not be rendered even if provided.
339
+ */
340
+ hideHint?: boolean;
341
+ /**
342
+ * Only needed when the component is a part of a native form.
343
+ * Provide this to include the value in native form submission / FormData.
344
+ */
345
+ name?: string;
346
+ placeholder?: string;
347
+ status?: TextInputStatus;
348
+ size?: TextInputSize;
349
+ disabled?: boolean;
350
+ leadingIcon?: React$1.ReactNode | null;
351
+ trailingIcon?: React$1.ReactNode | null;
352
+ }
353
+ declare const TextInput: React$1.FC<TextInputProps>;
354
+
355
+ interface AutocompleteProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled" | "value" | "defaultValue" | "onChange"> {
356
+ label?: string;
357
+ hint?: string;
358
+ /** If true, the hint will not be rendered even if provided. */
359
+ hideHint?: boolean;
360
+ status?: TextInputStatus;
361
+ size?: TextInputSize;
362
+ disabled?: boolean;
363
+ leadingIcon?: React$1.ReactNode | null;
364
+ trailingIcon?: React$1.ReactNode | null;
365
+ /** Options to render (assumed already server-filtered). */
366
+ options: string[];
367
+ loading?: boolean;
368
+ loadingText?: React$1.ReactNode;
369
+ noOptionsText?: React$1.ReactNode;
370
+ /** Committed value (e.g. selected option). */
371
+ value?: string;
372
+ defaultValue?: string;
373
+ onChange?: (value: string) => void;
374
+ /** Current input text (used as query). */
375
+ inputValue?: string;
376
+ defaultInputValue?: string;
377
+ onInputChange?: (value: string) => void;
378
+ }
379
+ declare const Autocomplete: React$1.FC<AutocompleteProps>;
380
+
381
+ type SelectStatus = "default" | "success" | "error";
382
+ interface SelectOption {
275
383
  label: string;
276
384
  value: string;
277
385
  }
278
- declare const dropdownTriggerVariants: (props?: ({
386
+ declare const selectTriggerVariants: (props?: ({
279
387
  size?: "sm" | "md" | "lg" | "xl" | null | undefined;
280
388
  status?: "success" | "error" | "default" | null | undefined;
281
389
  } & class_variance_authority_types.ClassProp) | undefined) => string;
282
- interface DropdownProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "onChange">, VariantProps<typeof dropdownTriggerVariants> {
390
+ interface SelectProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "onChange">, VariantProps<typeof selectTriggerVariants> {
283
391
  label?: string;
284
392
  hint?: string;
285
393
  /**
286
394
  * If true, the hint will not be rendered even if provided.
287
395
  */
288
396
  hideHint?: boolean;
397
+ /**
398
+ * Only needed when the component is a part of a native form.
399
+ * Provide this to include the value in native form submission / FormData.
400
+ */
401
+ name?: string;
289
402
  placeholder?: string;
290
- status?: DropdownStatus;
291
- options: DropdownOption[];
403
+ status?: SelectStatus;
404
+ options: SelectOption[];
292
405
  value?: string;
293
406
  defaultValue?: string;
407
+ required?: boolean;
294
408
  onChange?: (value: string) => void;
295
409
  /** Force the menu open (used mainly for docs/Storybook states). */
296
410
  showMenu?: boolean;
297
411
  }
298
- declare const Dropdown: React$1.FC<DropdownProps>;
412
+ declare const Select: React$1.FC<SelectProps>;
299
413
 
300
414
  type FieldStatus = "default" | "success" | "error";
301
415
  interface FieldProps {
@@ -323,6 +437,11 @@ interface PasswordInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputE
323
437
  * If true, the hint will not be rendered even if provided.
324
438
  */
325
439
  hideHint?: boolean;
440
+ /**
441
+ * Only needed when the component is a part of a native form.
442
+ * Provide this to include the value in native form submission / FormData.
443
+ */
444
+ name?: string;
326
445
  placeholder?: string;
327
446
  status?: PasswordInputStatus;
328
447
  size?: PasswordInputSize;
@@ -332,25 +451,7 @@ interface PasswordInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputE
332
451
  }
333
452
  declare const PasswordInput: React$1.FC<PasswordInputProps>;
334
453
 
335
- type TextInputSize = "sm" | "md" | "lg" | "xl";
336
- type TextInputStatus = "default" | "success" | "error";
337
- interface TextInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled"> {
338
- label?: string;
339
- hint?: string;
340
- /**
341
- * If true, the hint will not be rendered even if provided.
342
- */
343
- hideHint?: boolean;
344
- placeholder?: string;
345
- status?: TextInputStatus;
346
- size?: TextInputSize;
347
- disabled?: boolean;
348
- leadingIcon?: React$1.ReactNode | null;
349
- trailingIcon?: React$1.ReactNode | null;
350
- }
351
- declare const TextInput: React$1.FC<TextInputProps>;
352
-
353
- type PhoneInputProps = Omit<React$1.ComponentProps<"input">, "onChange" | "value" | "ref"> & Omit<RPNInput.Props<typeof RPNInput.default>, "onChange"> & {
454
+ type PhoneInputProps = Omit<React$1.ComponentProps<"input">, "onChange" | "value" | "ref" | "size"> & Omit<RPNInput.Props<typeof RPNInput.default>, "onChange"> & {
354
455
  onChange?: (value: RPNInput.Value) => void;
355
456
  } & {
356
457
  className?: string;
@@ -360,6 +461,11 @@ type PhoneInputProps = Omit<React$1.ComponentProps<"input">, "onChange" | "value
360
461
  * If true, the hint will not be rendered even if provided.
361
462
  */
362
463
  hideHint?: boolean;
464
+ /**
465
+ * Only needed when the component is a part of a native form.
466
+ * Provide this to include the value in native form submission / FormData.
467
+ */
468
+ name?: string;
363
469
  placeholder?: string;
364
470
  disabled?: boolean;
365
471
  status?: TextInputStatus;
@@ -376,6 +482,10 @@ interface RadioGroupOption {
376
482
  interface RadioGroupProps extends Omit<RadioGroupPrimitive.RadioGroupProps, "children" | "orientation" | "onValueChange"> {
377
483
  label?: string;
378
484
  hint?: string;
485
+ /** Only needed when the component is a part of a native form. */
486
+ name?: string;
487
+ /** Only needed when the component is a part of a native form. */
488
+ required?: boolean;
379
489
  /**
380
490
  * If true, the hint will not be rendered even if provided.
381
491
  */
@@ -389,6 +499,11 @@ declare const RadioGroup: React$1.FC<RadioGroupProps>;
389
499
 
390
500
  type SearchInputSize = "sm" | "md" | "lg" | "xl";
391
501
  interface SearchInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled"> {
502
+ /**
503
+ * Only needed when the component is a part of a native form.
504
+ * Provide this to include the value in native form submission / FormData.
505
+ */
506
+ name?: string;
392
507
  placeholder?: string;
393
508
  leadingIcon?: React$1.ReactNode;
394
509
  showLeadingIcon?: boolean;
@@ -401,6 +516,13 @@ declare const SearchInput: React$1.FC<SearchInputProps>;
401
516
  type SliderDisplay = "flat" | "numeric" | "tooltip";
402
517
  type SliderTooltipPlacement = "top" | "bottom";
403
518
  type SliderBaseProps = {
519
+ /**
520
+ * Only needed when the component is a part of a native form.
521
+ * Provide this to include the value in native form submission / FormData.
522
+ *
523
+ * Note: range sliders submit two values under the same name.
524
+ */
525
+ name?: string;
404
526
  display?: SliderDisplay;
405
527
  tooltipPlacement?: SliderTooltipPlacement;
406
528
  /**
@@ -442,6 +564,11 @@ interface TextAreaProps extends Omit<React$1.TextareaHTMLAttributes<HTMLTextArea
442
564
  * If true, the hint will not be rendered even if provided.
443
565
  */
444
566
  hideHint?: boolean;
567
+ /**
568
+ * Only needed when the component is a part of a native form.
569
+ * Provide this to include the value in native form submission / FormData.
570
+ */
571
+ name?: string;
445
572
  status?: TextInputStatus;
446
573
  /**
447
574
  * Visual/behavioural variant.
@@ -463,6 +590,11 @@ interface TextAreaProps extends Omit<React$1.TextareaHTMLAttributes<HTMLTextArea
463
590
  declare const TextArea: React$1.FC<TextAreaProps>;
464
591
 
465
592
  interface ToggleProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type"> {
593
+ /**
594
+ * Only needed when the component is a part of a native form.
595
+ * Provide this to include the checked value in native form submission / FormData.
596
+ */
597
+ name?: string;
466
598
  label?: string;
467
599
  }
468
600
  declare const Toggle: React$1.FC<ToggleProps>;
@@ -512,19 +644,46 @@ interface PopoverProps {
512
644
  }
513
645
  declare const Popover: React$1.FC<PopoverProps>;
514
646
 
515
- interface BreadcrumbProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
516
- variant?: "flat" | "colored";
517
- asChild?: boolean;
518
- /** Label text shown in the breadcrumb item. */
519
- label?: string;
520
- /** Whether to render the leading chevron icon. */
521
- showIcon?: boolean;
522
- /** Optional custom icon to use instead of the default chevron. */
523
- icon?: React$1.ReactNode;
524
- /** Whether to render the label text. */
525
- showText?: boolean;
647
+ type TooltipPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom";
648
+ interface TooltipProps {
649
+ children: React$1.ReactNode;
650
+ strapline?: string;
651
+ title: string;
652
+ description?: string;
653
+ showArrow?: boolean;
654
+ className?: string;
655
+ placement?: TooltipPlacement;
656
+ offset?: number;
657
+ disableHoverableContent?: boolean;
658
+ open?: boolean;
659
+ defaultOpen?: boolean;
660
+ onOpenChange?: (open: boolean) => void;
661
+ }
662
+ declare const Tooltip: React$1.FC<TooltipProps>;
663
+
664
+ interface TooltipProviderProps {
665
+ children: React$1.ReactNode;
666
+ delayDuration?: number;
667
+ skipDelayDuration?: number;
668
+ disableHoverableContent?: boolean;
669
+ }
670
+ declare const TooltipProvider: React$1.FC<TooltipProviderProps>;
671
+
672
+ declare function Breadcrumb({ ...props }: React$1.ComponentProps<"nav">): react_jsx_runtime.JSX.Element;
673
+
674
+ interface BreadcrumbsProps extends React$1.ComponentProps<typeof Breadcrumb> {
675
+ separator?: React$1.ReactNode;
676
+ /**
677
+ * When true and there are >= 5 breadcrumb items, replaces all items except
678
+ * the first one and the last two with an ellipsis dropdown menu.
679
+ */
680
+ ellipsis?: boolean;
681
+ children: React$1.ReactNode;
682
+ separatorClassName?: string;
683
+ breadcrumbItemClassName?: string;
684
+ breadcrumbPageClassName?: string;
526
685
  }
527
- declare const Breadcrumb: React$1.ForwardRefExoticComponent<BreadcrumbProps & React$1.RefAttributes<HTMLButtonElement>>;
686
+ declare const Breadcrumbs: React$1.ForwardRefExoticComponent<Omit<BreadcrumbsProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
528
687
 
529
688
  interface LogoBaseProps {
530
689
  className?: string;
@@ -548,4 +707,4 @@ declare const Logo: FC<LogoProps>;
548
707
 
549
708
  declare function cn(...inputs: ClassValue[]): string;
550
709
 
551
- export { Avatar, Badge, BadgeDigit, BadgeDot, BadgeStatus, Breadcrumb, Button, ButtonGroup, Checkbox, Divider, Dropdown, Field, IconButton, IconButtonGroup, LinkButton, Logo, LogoIcon, MessageButton, PasswordInput, PhoneInput, Popover, Progress, RadioGroup, SearchInput, Slider, StatusAvatar, Tag, TextArea, TextInput, Toggle, Typography, WebsiteInput, cn };
710
+ export { Accordion, Autocomplete, Avatar, Badge, BadgeDigit, BadgeDot, BadgeStatus, Breadcrumbs, Button, ButtonGroup, Checkbox, Divider, Field, IconButton, IconButtonGroup, LinkButton, Logo, LogoIcon, Menu, MenuGroup, MenuItem, MenuLabel, MenuPortal, MenuSeparator, MenuShortcut, MenuSub, MenuSubContent, MenuSubTrigger, MessageButton, PasswordInput, PhoneInput, Popover, Progress, RadioGroup, SearchInput, Select, Slider, StatusAvatar, Tag, TextArea, TextInput, Toggle, Tooltip, TooltipProvider, Typography, WebsiteInput, cn };