@still-forest/canopy 0.58.4 → 0.59.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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Accordion as Accordion_3 } from '@base-ui/react/accordion';
2
2
  import { Button as Button_4 } from '@base-ui/react/button';
3
- import { Checkbox as Checkbox_2 } from '@base-ui/react/checkbox';
3
+ import { Checkbox as Checkbox_3 } from '@base-ui/react/checkbox';
4
4
  import { ClassProp } from 'class-variance-authority/types';
5
5
  import { ClassValue } from 'clsx';
6
6
  import { Collapsible as Collapsible_3 } from '@base-ui/react/collapsible';
@@ -9,10 +9,12 @@ import { default as default_2 } from 'react';
9
9
  import { Dialog as Dialog_3 } from '@base-ui/react/dialog';
10
10
  import { FC } from 'react';
11
11
  import { JSX } from 'react/jsx-runtime';
12
- import { Popover as Popover_3 } from '@base-ui/react/popover';
12
+ import { Menu } from '@base-ui/react/menu';
13
+ import { Popover as Popover_2 } from '@base-ui/react/popover';
13
14
  import * as React_2 from 'react';
14
15
  import { ReactElement } from 'react';
15
16
  import { ReactNode } from 'react';
17
+ import { Select as Select_2 } from '@base-ui/react/select';
16
18
  import { Slider as Slider_2 } from '@base-ui/react/slider';
17
19
  import { Switch as Switch_2 } from '@base-ui/react/switch';
18
20
  import { Tabs as Tabs_2 } from '@base-ui/react/tabs';
@@ -81,7 +83,7 @@ export declare interface BadgeProps {
81
83
 
82
84
  export declare type BadgeSize = ButtonSize;
83
85
 
84
- export declare type BadgeVariant = ButtonVariant;
86
+ export declare type BadgeVariant = "primary" | "secondary" | "muted" | "ghost" | "info" | "success" | "warning" | "danger";
85
87
 
86
88
  export declare type BaseButtonProps = {
87
89
  className?: string;
@@ -170,7 +172,7 @@ declare interface ButtonRadioFieldProps extends Omit<ButtonGroupProps, "children
170
172
 
171
173
  export declare type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl";
172
174
 
173
- export declare type ButtonVariant = "primary" | "secondary" | "muted" | "ghost" | "link" | "info" | "success" | "warning" | "danger";
175
+ export declare type ButtonVariant = "primary" | "secondary" | "muted" | "ghost" | "link" | "input" | "info" | "success" | "warning" | "danger";
174
176
 
175
177
  declare const buttonVariants: (props?: ({
176
178
  variant?: "secondary" | "info" | "success" | "warning" | "destructive" | "default" | "ghost" | "link" | "outline" | "unstyled" | "error" | null | undefined;
@@ -218,11 +220,13 @@ declare function CardTitle({ className, ...props }: React_2.ComponentProps<"div"
218
220
 
219
221
  declare type CardTitleProps = React.ComponentProps<typeof CardTitle>;
220
222
 
221
- declare function Checkbox({ className, ...props }: Checkbox_2.Root.Props): JSX.Element;
223
+ export declare const Checkbox: ({ children, className, onCheckedChange, name, id, ...props }: CheckboxProps) => JSX.Element;
224
+
225
+ declare function Checkbox_2({ className, ...props }: Checkbox_3.Root.Props): JSX.Element;
222
226
 
223
227
  export declare const CheckboxField: ({ label, name, value, checked, onCheckedChange, note, error, labelClassName, hint, ...props }: CheckboxFieldProps) => JSX.Element;
224
228
 
225
- export declare interface CheckboxFieldProps extends React.ComponentProps<typeof Checkbox> {
229
+ export declare interface CheckboxFieldProps extends React.ComponentProps<typeof Checkbox_2> {
226
230
  label: string;
227
231
  labelClassName?: string;
228
232
  name: string;
@@ -234,6 +238,10 @@ export declare interface CheckboxFieldProps extends React.ComponentProps<typeof
234
238
  error?: string;
235
239
  }
236
240
 
241
+ export declare interface CheckboxProps extends Omit<ComponentProps<"input">, "onChange"> {
242
+ onCheckedChange: (checked: boolean) => void;
243
+ }
244
+
237
245
  export declare function cn(...inputs: ClassValue[]): string;
238
246
 
239
247
  export declare const Code: ({ children, ...props }: TextProps) => JSX.Element;
@@ -305,6 +313,19 @@ declare interface DeleteButtonProps extends BaseButtonProps {
305
313
  handleDelete: () => void;
306
314
  }
307
315
 
316
+ export declare const DesktopSelectPicker: ({ selectedLabel, open, setOpen, children, id, triggerClassName, dropdownClassName, triggerProps, }: DesktopSelectPickerProps) => JSX.Element;
317
+
318
+ declare interface DesktopSelectPickerProps {
319
+ selectedLabel: string | ReactNode;
320
+ open: boolean;
321
+ setOpen: (open: boolean) => void;
322
+ children: ReactNode;
323
+ id?: string;
324
+ triggerClassName?: string;
325
+ dropdownClassName?: string;
326
+ triggerProps?: Partial<ButtonProps>;
327
+ }
328
+
308
329
  export declare const Dialog: {
309
330
  (props: ComponentProps<typeof Dialog_2>): JSX.Element;
310
331
  Close: typeof DialogClose;
@@ -344,6 +365,33 @@ export declare type Display = (typeof DISPLAYS)[number];
344
365
 
345
366
  export declare const DISPLAYS: readonly ["block", "flex", "grid", "inline", "inline-block", "inline-flex", "inline-grid", "inline-table", "list-item", "flow-root", "contents", "table", "table-header-group", "table-footer-group", "table-column-group", "table-column", "table-row-group", "table-row", "table-cell", "table-caption", "hidden", "sr-only", "not-sr-only"];
346
367
 
368
+ export declare const DropdownMenu: {
369
+ ({ ...props }: Menu.Root.Props): JSX.Element;
370
+ Portal: ({ ...props }: Menu.Portal.Props) => JSX.Element;
371
+ Trigger: ({ className, ...props }: Menu.Trigger.Props) => JSX.Element;
372
+ Content: ({ align, alignOffset, side, sideOffset, className, ...props }: Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">) => JSX.Element;
373
+ Group: ({ ...props }: Menu.Group.Props) => JSX.Element;
374
+ Label: ({ className, inset, ...props }: Menu.GroupLabel.Props & {
375
+ inset?: boolean;
376
+ }) => JSX.Element;
377
+ Item: ({ className, inset, variant, ...props }: Menu.Item.Props & {
378
+ inset?: boolean;
379
+ variant?: "default" | "destructive";
380
+ }) => JSX.Element;
381
+ CheckboxItem: ({ className, children, checked, ...props }: Menu.CheckboxItem.Props) => JSX.Element;
382
+ RadioGroup: ({ ...props }: Menu.RadioGroup.Props) => JSX.Element;
383
+ RadioItem: ({ className, children, ...props }: Menu.RadioItem.Props) => JSX.Element;
384
+ Separator: ({ className, ...props }: Menu.Separator.Props) => JSX.Element;
385
+ Shortcut: ({ className, ...props }: React_2.ComponentProps<"span">) => JSX.Element;
386
+ Sub: ({ ...props }: Menu.SubmenuRoot.Props) => JSX.Element;
387
+ SubTrigger: ({ className, inset, children, ...props }: Menu.SubmenuTrigger.Props & {
388
+ inset?: boolean;
389
+ }) => JSX.Element;
390
+ SubContent: ({ align, alignOffset, side, sideOffset, className, ...props }: React_2.ComponentProps<typeof DropdownMenuContent>) => JSX.Element;
391
+ };
392
+
393
+ declare const DropdownMenuContent: ({ align, alignOffset, side, sideOffset, className, ...props }: Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">) => JSX.Element;
394
+
347
395
  export declare const ErrorPage: ({ headline, message, children, ...props }: ErrorPageProps) => JSX.Element;
348
396
 
349
397
  export declare interface ErrorPageProps extends InterstitialProps {
@@ -450,6 +498,11 @@ export declare type GridCols = (typeof GRID_COLS)[number];
450
498
 
451
499
  export declare type GridFlow = (typeof GRID_FLOWS)[number];
452
500
 
501
+ export declare const GridLayout: {
502
+ ({ children, className, ...props }: ComponentProps<"div">): JSX.Element;
503
+ Item: ({ children, className, span, sm, md, lg, style, ...props }: ItemProps) => JSX.Element;
504
+ };
505
+
453
506
  export declare interface GridProps extends default_2.HTMLAttributes<HTMLDivElement> {
454
507
  as?: default_2.ElementType;
455
508
  cols?: GridCols;
@@ -462,6 +515,16 @@ export declare interface GridProps extends default_2.HTMLAttributes<HTMLDivEleme
462
515
 
463
516
  export declare type GridRows = (typeof GRID_ROWS)[number];
464
517
 
518
+ export declare const GroupedOptionList: ({ optionGroups, placeholder, noSearch, ...props }: GroupedOptionListProps) => JSX.Element;
519
+
520
+ declare interface GroupedOptionListProps {
521
+ optionGroups: SelectPickerOptionGroup[];
522
+ placeholder: string;
523
+ selectedValue?: SelectPickerOptionValue | null;
524
+ onSelect: (value: SelectPickerOptionValue) => void;
525
+ noSearch?: boolean;
526
+ }
527
+
465
528
  export declare const Header: ({ children, sticky, className, ...props }: HeaderProps) => JSX.Element;
466
529
 
467
530
  declare interface HeaderProps extends ContainerProps {
@@ -549,7 +612,7 @@ declare function ItemActions({ className, ...props }: React_2.ComponentProps<"di
549
612
 
550
613
  declare type ItemActionsProps = React.ComponentProps<typeof ItemActions>;
551
614
 
552
- declare type ItemComponent = React.FC<ItemProps> & {
615
+ declare type ItemComponent = React.FC<ItemProps_2> & {
553
616
  Actions: React.FC<ItemActionsProps>;
554
617
  Content: React.FC<ItemContentProps>;
555
618
  Description: React.FC<ItemDescriptionProps>;
@@ -585,7 +648,14 @@ declare const itemMediaVariants: (props?: ({
585
648
  variant?: "default" | "image" | "icon" | null | undefined;
586
649
  } & ClassProp) | undefined) => string;
587
650
 
588
- declare type ItemProps = React.ComponentProps<typeof Item_2> & {
651
+ export declare interface ItemProps extends ComponentProps<"div"> {
652
+ span: Span;
653
+ sm?: Span;
654
+ md?: Span;
655
+ lg?: Span;
656
+ }
657
+
658
+ declare type ItemProps_2 = React.ComponentProps<typeof Item_2> & {
589
659
  children: ReactNode;
590
660
  };
591
661
 
@@ -732,19 +802,15 @@ declare interface PlaceholderProps {
732
802
  compact?: boolean;
733
803
  }
734
804
 
735
- export declare const Popover: PopoverComponent;
736
-
737
- declare function Popover_2({ ...props }: Popover_3.Root.Props): JSX.Element;
738
-
739
- declare type PopoverComponent = default_2.FC<default_2.ComponentProps<typeof Popover_2>> & {
740
- Trigger: typeof PopoverTrigger;
741
- Content: typeof PopoverContent;
805
+ export declare const Popover: {
806
+ ({ ...props }: Popover_2.Root.Props): JSX.Element;
807
+ Trigger: ({ ...props }: Popover_2.Trigger.Props) => JSX.Element;
808
+ Content: ({ className, align, alignOffset, side, sideOffset, ...props }: Popover_2.Popup.Props & Pick<Popover_2.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">) => JSX.Element;
809
+ Header: ({ className, ...props }: React_2.ComponentProps<"div">) => JSX.Element;
810
+ Title: ({ className, ...props }: Popover_2.Title.Props) => JSX.Element;
811
+ Description: ({ className, ...props }: Popover_2.Description.Props) => JSX.Element;
742
812
  };
743
813
 
744
- declare function PopoverContent({ className, align, alignOffset, side, sideOffset, ...props }: Popover_3.Popup.Props & Pick<Popover_3.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): JSX.Element;
745
-
746
- declare function PopoverTrigger({ ...props }: Popover_3.Trigger.Props): JSX.Element;
747
-
748
814
  export declare type Position = (typeof POSITIONS)[number];
749
815
 
750
816
  export declare const POSITIONS: readonly ["static", "fixed", "absolute", "relative", "sticky"];
@@ -800,18 +866,32 @@ export declare const ROUNDED_SIZES: readonly ["none", "xs", "sm", "md", "lg", "x
800
866
 
801
867
  export declare type RoundedSize = (typeof ROUNDED_SIZES)[number];
802
868
 
803
- export declare const SelectPickerField: ({ options, value, placeholder, onChange, name, renderSelected, dropdownClassName, }: SelectPickerFieldProps) => JSX.Element;
869
+ declare const Select: typeof Select_2.Root;
804
870
 
805
- export declare interface SelectPickerFieldProps {
871
+ export declare const SelectInput: ({ options, placeholder, className, onChange, id, name, value, ...props }: SelectInputProps) => JSX.Element;
872
+
873
+ export declare interface SelectInputProps extends Omit<React.ComponentProps<typeof Select>, "onValueChange" | "onChange" | "error" | "label"> {
874
+ options: SelectOptionGroup[] | SelectOption[];
875
+ placeholder?: string;
876
+ id?: string;
806
877
  name: string;
807
878
  value?: string | null;
808
- onChange: (value: string) => void;
809
- options: SelectPickerOption[] | SelectPickerOptionGroup[];
810
- placeholder?: string;
811
- renderSelected?: (selected: SelectPickerOption) => React.ReactNode;
812
- dropdownClassName?: string;
879
+ className?: string;
880
+ onChange: (value?: string | null) => void;
881
+ }
882
+
883
+ export declare interface SelectOption {
884
+ label: string;
885
+ value: string;
886
+ }
887
+
888
+ export declare interface SelectOptionGroup {
889
+ label: string | null;
890
+ options: SelectOption[];
813
891
  }
814
892
 
893
+ export declare const SelectPicker: ({ options, value, placeholder, onChange, name, renderSelected, }: SelectPickerProps) => JSX.Element;
894
+
815
895
  export declare interface SelectPickerOption {
816
896
  icon?: string;
817
897
  label: string;
@@ -826,6 +906,15 @@ export declare interface SelectPickerOptionGroup {
826
906
 
827
907
  export declare type SelectPickerOptionValue = string;
828
908
 
909
+ export declare interface SelectPickerProps {
910
+ name: string;
911
+ value?: string | null;
912
+ onChange: (value: string) => void;
913
+ options: SelectPickerOption[] | SelectPickerOptionGroup[];
914
+ placeholder?: string;
915
+ renderSelected?: (selected: SelectPickerOption) => React.ReactNode;
916
+ }
917
+
829
918
  export declare const Separator: ({ className, orientation, gap, ...props }: SeparatorProps) => JSX.Element;
830
919
 
831
920
  declare interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
@@ -833,6 +922,23 @@ declare interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
833
922
  gap?: Gap;
834
923
  }
835
924
 
925
+ export declare const Sheet: {
926
+ ({ ...props }: Dialog_3.Root.Props): JSX.Element;
927
+ Trigger: ({ ...props }: Dialog_3.Trigger.Props) => JSX.Element;
928
+ Close: ({ ...props }: Dialog_3.Close.Props) => JSX.Element;
929
+ Content: ({ className, children, side, showCloseButton, showOverlay, ...props }: Dialog_3.Popup.Props & {
930
+ side?: "top" | "right" | "bottom" | "left";
931
+ showCloseButton?: boolean;
932
+ showOverlay?: boolean;
933
+ }) => JSX.Element;
934
+ Overlay: ({ className, ...props }: Dialog_3.Backdrop.Props) => JSX.Element;
935
+ Header: ({ className, ...props }: ComponentProps<"div">) => JSX.Element;
936
+ Body: ({ className, ...props }: ComponentProps<"div">) => JSX.Element;
937
+ Footer: ({ className, ...props }: ComponentProps<"div">) => JSX.Element;
938
+ Title: ({ className, ...props }: Dialog_3.Title.Props) => JSX.Element;
939
+ Description: ({ className, ...props }: Dialog_3.Description.Props) => JSX.Element;
940
+ };
941
+
836
942
  export declare const Sidebar: ({ brandContent, brandOnClick, activeSlug, itemSets, bottomItemSets, theme, setTheme, ...props }: SidebarProps) => JSX.Element;
837
943
 
838
944
  declare function Sidebar_2({ side, variant, collapsible, className, children, dir, ...props }: React_2.ComponentProps<"div"> & {
@@ -905,6 +1011,8 @@ declare interface SliderProps extends Slider_2.Root.Props {
905
1011
  trackClassName?: string;
906
1012
  }
907
1013
 
1014
+ declare type Span = number | [col: number, row: number];
1015
+
908
1016
  export declare const SubmitButton: ({ variant, disabled, submitting, label, icon, children, ...props }: SubmitButtonProps) => JSX.Element;
909
1017
 
910
1018
  export declare interface SubmitButtonProps extends Omit<ButtonProps, "type"> {
@@ -915,29 +1023,17 @@ declare function Switch({ className, size, ...props }: Switch_2.Root.Props & {
915
1023
  size?: "xs" | "sm" | "md" | "lg" | "xl";
916
1024
  }): JSX.Element;
917
1025
 
918
- export declare const Table: TableComponent;
919
-
920
- export declare function TableBody({ className, ...props }: React_2.ComponentProps<"tbody">): JSX.Element;
921
-
922
- export declare function TableCaption({ className, ...props }: React_2.ComponentProps<"caption">): JSX.Element;
923
-
924
- export declare function TableCell({ className, ...props }: React_2.ComponentProps<"td">): JSX.Element;
925
-
926
- declare type TableComponent = React_2.FC<React_2.ComponentProps<"table">> & {
927
- Body: typeof TableBody;
928
- Caption: typeof TableCaption;
929
- Cell: typeof TableCell;
930
- Head: typeof TableHead;
931
- Header: typeof TableHeader;
932
- Row: typeof TableRow;
1026
+ export declare const Table: {
1027
+ ({ className, ...props }: ComponentProps<"table">): JSX.Element;
1028
+ Header: (props: ComponentProps<"thead">) => JSX.Element;
1029
+ Body: (props: ComponentProps<"tbody">) => JSX.Element;
1030
+ Footer: (props: ComponentProps<"tfoot">) => JSX.Element;
1031
+ Head: (props: ComponentProps<"th">) => JSX.Element;
1032
+ Row: (props: ComponentProps<"tr">) => JSX.Element;
1033
+ Cell: (props: ComponentProps<"td">) => JSX.Element;
1034
+ Caption: (props: ComponentProps<"caption">) => JSX.Element;
933
1035
  };
934
1036
 
935
- export declare function TableHead({ className, ...props }: React_2.ComponentProps<"th">): JSX.Element;
936
-
937
- export declare function TableHeader({ className, ...props }: React_2.ComponentProps<"thead">): JSX.Element;
938
-
939
- export declare function TableRow({ className, ...props }: React_2.ComponentProps<"tr">): JSX.Element;
940
-
941
1037
  export declare function Tabs({ className, orientation, ...props }: Tabs_2.Root.Props): JSX.Element;
942
1038
 
943
1039
  export declare function TabsContent({ className, ...props }: Tabs_2.Panel.Props): JSX.Element;
@@ -1029,13 +1125,12 @@ declare type TextListComponent = React.FC<TextListProps> & {
1029
1125
  };
1030
1126
 
1031
1127
  declare type TextListItemProps = React.ComponentProps<"li"> & {
1032
- asChild?: boolean;
1033
1128
  children: ReactNode;
1034
1129
  };
1035
1130
 
1036
1131
  declare type TextListProps = React.ComponentProps<"ul"> & {
1037
- position?: "inside" | "outside";
1038
1132
  variant?: "ordered" | "unordered" | "none";
1133
+ position?: "inside" | "outside";
1039
1134
  children: ReactNode;
1040
1135
  };
1041
1136