@commercetools/nimbus 0.0.7-rc15 → 0.0.7-rc16

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
@@ -11,10 +11,15 @@ import { AriaLinkOptions } from 'react-aria';
11
11
  import { AriaNumberFieldProps } from 'react-aria';
12
12
  import { AriaToggleButtonGroupProps } from 'react-aria';
13
13
  import { AriaToggleButtonProps } from 'react-aria';
14
+ import { AutocompleteProps } from 'react-aria-components';
14
15
  import { CardContentProps } from './card.slots';
15
16
  import { CardHeaderProps } from './card.slots';
16
17
  import { CardProps as CardProps_2 } from './card.types';
17
18
  import { Code } from '@chakra-ui/react';
19
+ import { ComboBoxOptionGroupProps as ComboBoxOptionGroupProps_2 } from './combobox.types';
20
+ import { ComboBoxOptionProps as ComboBoxOptionProps_2 } from './combobox.types';
21
+ import { ComboBoxProps } from 'react-aria-components';
22
+ import { ComboBoxRootProps as ComboBoxRootProps_2 } from './combobox.types';
18
23
  import { ComponentProps } from 'react';
19
24
  import { default as default_2 } from 'react';
20
25
  import { DetailedHTMLProps } from 'react';
@@ -58,6 +63,7 @@ import { RecipeDefinition } from '@chakra-ui/react';
58
63
  import { RecipeProps } from '@chakra-ui/react';
59
64
  import { RecipeVariantProps } from '@chakra-ui/react';
60
65
  import { RecipeVariantRecord } from '@chakra-ui/react';
66
+ import { Ref } from 'react';
61
67
  import { RefAttributes } from 'react';
62
68
  import { RefObject } from 'react';
63
69
  import { SelectOptionGroupProps as SelectOptionGroupProps_2 } from './select.types';
@@ -561,6 +567,7 @@ colorPalette: "neutral";
561
567
  }>;
562
568
 
563
569
  export declare interface ButtonProps extends FunctionalButtonProps {
570
+ slot?: string | null | undefined;
564
571
  ref?: React.Ref<HTMLButtonElement>;
565
572
  }
566
573
 
@@ -576,7 +583,8 @@ declare interface ButtonRecipeProps extends RecipeProps<"button">, UnstyledProp
576
583
  * This creates a complete set of props for the root element, combining
577
584
  * HTML attributes, Chakra's styling system, and our custom recipe props.
578
585
  */
579
- declare type ButtonRootProps = HTMLChakraProps<"button", ButtonRecipeProps>;
586
+ declare interface ButtonRootProps extends HTMLChakraProps<"button", ButtonRecipeProps> {
587
+ }
580
588
 
581
589
  export declare const Card: {
582
590
  Root: {
@@ -772,6 +780,252 @@ export { Code }
772
780
  declare interface ColorModeProviderProps extends ThemeProviderProps {
773
781
  }
774
782
 
783
+ export declare const ComboBox: {
784
+ Root: {
785
+ <T extends object>({ children, ref, ...props }: ComboBoxRootProps_2<T>): JSX.Element;
786
+ displayName: string;
787
+ };
788
+ OptionGroup: {
789
+ <T extends object>({ children, label, items, ref, ...props }: ComboBoxOptionGroupProps_2<T> & RefAttributes<HTMLDivElement>): JSX.Element;
790
+ displayName: string;
791
+ };
792
+ Option: {
793
+ <T extends object>({ children, ref, ...props }: ComboBoxOptionProps_2<T>): JSX.Element;
794
+ displayName: string;
795
+ };
796
+ };
797
+
798
+ /** component prop interface */
799
+ export declare type ComboBoxButtonGroupProps = {
800
+ selectedKeys?: ComboBoxMultiSelectRootProps<{}>["selectedKeys"];
801
+ onSelectionChange?: ComboBoxMultiSelectRootProps<{}>["onSelectionChange"];
802
+ onInputChange?: ComboBoxMultiSelectRootProps<{}>["onInputChange"];
803
+ onOpenChange?: ComboBoxSingleSelectRootProps<{}>["onOpenChange"];
804
+ containerRef?: RefObject<HTMLDivElement | null>;
805
+ isOpen?: boolean;
806
+ isLoading?: boolean;
807
+ isDisabled?: boolean;
808
+ isReadOnly?: boolean;
809
+ };
810
+
811
+ /** The slot is a wrapper for multiple components,
812
+ * and therefore not combined with the component props
813
+ * because it is not used to style the component directly using asChild */
814
+ export declare interface ComboBoxButtonGroupSlotProps extends HTMLChakraProps<"div", RecipeProps<"buttonGroup">> {
815
+ }
816
+
817
+ /** MultiSelect combobox */
818
+ export declare interface ComboBoxMultiSelect<T extends object> extends Omit<AutocompleteProps, "children" | "filter" | "slot">, Omit<ListBoxProps<T>, "filter" | "autoFocus" | "style" | "slot"> {
819
+ defaultFilter?: (textValue: string, inputValue: string) => boolean;
820
+ defaultInputValue?: ComboBoxProps<T>["defaultInputValue"];
821
+ defaultItems?: ComboBoxProps<T>["defaultItems"];
822
+ validate?: ComboBoxProps<T>["validate"];
823
+ allowsCustomValue?: boolean;
824
+ onSubmitCustomValue?: (value: string) => void;
825
+ onOpenChange?: ComboBoxProps<T>["onOpenChange"];
826
+ autoFocus?: boolean;
827
+ isLoading?: boolean;
828
+ isDisabled?: boolean;
829
+ isReadOnly?: boolean;
830
+ isRequired?: boolean;
831
+ isInvalid?: boolean;
832
+ itemId?: string;
833
+ itemValue?: string;
834
+ placeholder?: string;
835
+ ref?: Ref<HTMLDivElement>;
836
+ size?: RecipeVariantProps<typeof comboBoxSlotRecipe>["size"];
837
+ }
838
+
839
+ export declare interface ComboBoxMultiSelectInputSlotProps extends HTMLChakraProps<"input", RecipeProps<"multiSelectInput">> {
840
+ }
841
+
842
+ /** Combined props for the multi select root element (Chakra styles + Aria behavior + Recipe variants). */
843
+ export declare interface ComboBoxMultiSelectRootProps<T extends object> extends Omit<ComboBoxMultiSelectRootSlotProps<T>, "selectionMode">, ComboBoxMultiSelect<T> {
844
+ ref?: Ref<HTMLDivElement>;
845
+ }
846
+
847
+ /** Base Chakra styling props for the root `div` slot when multi select*/
848
+ export declare interface ComboBoxMultiSelectRootSlotProps<T extends object> extends HTMLChakraProps<"div", RecipeVariantProps<typeof comboBoxSlotRecipe> & ComboBoxMultiSelect<T>> {
849
+ }
850
+
851
+ /** component prop interface */
852
+ export declare type ComboBoxMultiSelectValueProps<T extends object> = {
853
+ items: ComboBoxMultiSelectRootProps<T>["items"];
854
+ itemId: ComboBoxMultiSelectRootProps<T>["itemId"];
855
+ itemValue: ComboBoxMultiSelectRootProps<T>["itemValue"];
856
+ selectedKeys: ComboBoxMultiSelectRootProps<T>["selectedKeys"];
857
+ onSelectionChange: ComboBoxMultiSelectRootProps<T>["onSelectionChange"];
858
+ placeholder?: string;
859
+ isDisabled?: boolean;
860
+ isReadOnly?: boolean;
861
+ ref?: Ref<HTMLDivElement>;
862
+ containerRef?: RefObject<HTMLDivElement | null>;
863
+ size?: RecipeVariantProps<typeof comboBoxSlotRecipe>["size"];
864
+ };
865
+
866
+ export declare const _ComboBoxOption: {
867
+ <T extends object>({ children, ref, ...props }: ComboBoxOptionProps<T>): JSX.Element;
868
+ displayName: string;
869
+ };
870
+
871
+ export declare type ComboBoxOptionContentSlotProps = HTMLChakraProps<"span", RecipeProps<"span">>;
872
+
873
+ export declare const _ComboBoxOptionGroup: {
874
+ <T extends object>({ children, label, items, ref, ...props }: ComboBoxOptionGroupProps<T> & RefAttributes<HTMLDivElement>): JSX.Element;
875
+ displayName: string;
876
+ };
877
+
878
+ /** Combined props for the OptionGroup element (Chakra styles + Aria behavior + Recipe variants). */
879
+ export declare interface ComboBoxOptionGroupProps<T extends object> extends ListBoxSectionProps<T>, Omit<ComboBoxOptionGroupSlotProps, keyof ListBoxSectionProps<T>> {
880
+ label?: ReactNode;
881
+ }
882
+
883
+ /** Base Chakra styling props for the root `div` slot. */
884
+ declare type ComboBoxOptionGroupSlotProps = HTMLChakraProps<"div", RecipeProps<"div">>;
885
+
886
+ export declare type ComboBoxOptionIndicatorSlotProps = HTMLChakraProps<"span", RecipeProps<"span">>;
887
+
888
+ /** Combined props for the ListBoxItem element (Chakra styles + Aria behavior + Recipe variants). */
889
+ export declare interface ComboBoxOptionProps<T extends object> extends ListBoxItemProps<T>, Omit<ComboBoxOptionSlotProps, keyof ListBoxItemProps<T>> {
890
+ ref?: Ref<HTMLDivElement>;
891
+ }
892
+
893
+ /** Base Chakra styling props for the root `div` slot. */
894
+ declare type ComboBoxOptionSlotProps = HTMLChakraProps<"div", RecipeProps<"div">>;
895
+
896
+ /** Combined props for the ListBox element used in Single Select (Chakra styles + Aria behavior + Recipe variants) */
897
+ export declare interface ComboBoxOptionsProps<T extends object> extends ListBoxProps<T>, Omit<ComboBoxOptionsSlotProps, keyof ListBoxProps<T>> {
898
+ ref?: Ref<HTMLDivElement>;
899
+ }
900
+
901
+ /** Base Chakra styling props for the root `div` slot. */
902
+ export declare interface ComboBoxOptionsSlotProps extends HTMLChakraProps<"div", RecipeProps<"options">> {
903
+ }
904
+
905
+ export declare interface ComboBoxPopoverSlotProps extends HTMLChakraProps<"div", RecipeProps<"popover">> {
906
+ }
907
+
908
+ export declare const _ComboBoxRoot: {
909
+ <T extends object>({ children, ref, ...props }: ComboBoxRootProps<T>): JSX.Element;
910
+ displayName: string;
911
+ };
912
+
913
+ /** Root element can either be single or multi select */
914
+ export declare type ComboBoxRootProps<T extends object> = ComboBoxSingleSelectRootProps<T> | ComboBoxMultiSelectRootProps<T>;
915
+
916
+ /** Combined props for the single select root element (Chakra styles + Aria behavior + Recipe variants). */
917
+ export declare interface ComboBoxSingleSelectRootProps<T extends object> extends ComboBoxSingleSelectRootSlotProps<T>, ComboBoxWithCustomChildren<T> {
918
+ ref?: Ref<HTMLDivElement>;
919
+ }
920
+
921
+ /** Base Chakra styling props for the root `div` slot when single select*/
922
+ export declare interface ComboBoxSingleSelectRootSlotProps<T extends object> extends HTMLChakraProps<"div", RecipeVariantProps<typeof comboBoxSlotRecipe> & ComboBoxWithCustomChildren<T>> {
923
+ }
924
+
925
+ /**
926
+ * Recipe configuration for the Combobox component.
927
+ * Defines the styling variants and base styles using Chakra UI's recipe system.
928
+ */
929
+ declare const comboBoxSlotRecipe: SlotRecipeDefinition<"option" | "popover" | "value" | "root" | "options" | "optionGroup" | "buttonGroup" | "multiSelectInput" | "optionIndicator" | "optionContent", {
930
+ size: {
931
+ sm: {
932
+ value: {
933
+ minH: "800";
934
+ textStyle: "sm";
935
+ };
936
+ };
937
+ md: {
938
+ value: {
939
+ minH: "1000";
940
+ textStyle: "md";
941
+ };
942
+ };
943
+ };
944
+ variant: {
945
+ solid: {
946
+ root: {
947
+ width: "7200";
948
+ bg: "primary.1";
949
+ };
950
+ value: {
951
+ width: "100%";
952
+ "--border-width"?: "sizes.25" | undefined;
953
+ "--border-color"?: "colors.neutral.7" | undefined;
954
+ };
955
+ };
956
+ ghost: {
957
+ root: {
958
+ maxW: "7200";
959
+ bg?: "transparent" | undefined;
960
+ "&:hover"?: {
961
+ bg: "primaryAlpha.2";
962
+ } | undefined;
963
+ };
964
+ value: {
965
+ bg: "transparent";
966
+ "--border-width"?: "sizes.25" | undefined;
967
+ "--border-color"?: "transparent" | undefined;
968
+ };
969
+ };
970
+ };
971
+ selectionMode: {
972
+ multiple: {
973
+ options: {
974
+ boxShadow: "none";
975
+ px: "200";
976
+ my: "200";
977
+ minW: "unset";
978
+ "& section:first-of-type > header": {
979
+ mt: number;
980
+ };
981
+ };
982
+ option: {
983
+ colorPalette: "primary";
984
+ display: "flex";
985
+ alignItems: "flex-start";
986
+ justifyContent: "center";
987
+ position: "relative";
988
+ cursor: "pointer";
989
+ gap: "200";
990
+ mb: "var(--focus-ring-width)";
991
+ "&:last-of-type": {
992
+ mb: number;
993
+ };
994
+ '&[aria-selected="true"]': {
995
+ bg: "unset";
996
+ };
997
+ '&[data-focused="true"]': {
998
+ outlineWidth: "var(--focus-ring-width)";
999
+ outlineColor: "var(--focus-ring-color)";
1000
+ outlineStyle: "var(--focus-ring-style)";
1001
+ bg: "unset";
1002
+ };
1003
+ _hover: {
1004
+ bg: "primary.2";
1005
+ };
1006
+ };
1007
+ };
1008
+ single: {};
1009
+ none: {};
1010
+ };
1011
+ }>;
1012
+
1013
+ /** The slot is a wrapper for multiple components,
1014
+ * and therefore not combined with the component props
1015
+ * because it is not used to style the component directly using asChild */
1016
+ export declare interface ComboBoxValueSlotProps extends HTMLChakraProps<"div", RecipeProps<"value">> {
1017
+ }
1018
+
1019
+ /** ComboBox with overridden children prop based on expected dom structure. */
1020
+ declare type ComboBoxWithCustomChildren<T extends object> = Omit<ComboBoxProps<T>, "children"> & {
1021
+ onSubmitCustomValue?: (value: string) => void;
1022
+ renderEmptyState?: ListBoxProps<T>["renderEmptyState"];
1023
+ placeholder?: string;
1024
+ isLoading?: boolean;
1025
+ children: ReactNode | ((item: T) => default_2.ReactNode);
1026
+ ref?: Ref<HTMLDivElement>;
1027
+ };
1028
+
775
1029
  /**
776
1030
  * Properties from TimeFieldStateOptions that would conflict with similarly named
777
1031
  * properties in TimeInputRootProps. We use this to prevent TypeScript interface
@@ -974,7 +1228,7 @@ declare interface FormFieldRootSlotProps extends HTMLChakraProps<"div", RecipeVa
974
1228
  declare type FunctionalAvatarProps = AvatarRootProps & AvatarComponentProps;
975
1229
 
976
1230
  /** combine chakra-button props with aria-button props */
977
- declare type FunctionalButtonProps = AriaButtonProps & Omit<ButtonRootProps, keyof AriaButtonProps> & {
1231
+ declare type FunctionalButtonProps = AriaButtonProps & Omit<ButtonRootProps, keyof AriaButtonProps | "slot"> & {
978
1232
  [key: `data-${string}`]: unknown;
979
1233
  };
980
1234
 
@@ -1731,6 +1985,15 @@ export declare interface SimpleGridProps extends SimpleGridProps_2 {
1731
1985
  ref?: React.Ref<HTMLDivElement>;
1732
1986
  }
1733
1987
 
1988
+ export declare interface SingleSelectInputProps {
1989
+ placeholder?: string;
1990
+ inputValue?: string;
1991
+ allowsCustomValue?: boolean;
1992
+ onSubmitCustomValue?: (value: string) => void;
1993
+ onInputChange?: (value: string) => void;
1994
+ ref?: default_2.Ref<HTMLInputElement>;
1995
+ }
1996
+
1734
1997
  export declare const Stack: {
1735
1998
  (props: StackProps): JSX.Element;
1736
1999
  displayName: string;