@gamecrafters/base-ui 0.0.21 → 0.0.23

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.
@@ -3,8 +3,20 @@ import type { ResponsiveValue } from "../../hooks/useResponsive";
3
3
  import type { PolymorphicProps } from "../../utilities/polymorphic";
4
4
  export type AvatarSize = number | ResponsiveValue<number>;
5
5
  export type AvatarShape = "circle" | "square";
6
+ export type AvatarLoadingStatus = "idle" | "loading" | "loaded" | "error";
6
7
  export type AvatarProps<As extends React.ElementType = "img"> = PolymorphicProps<As, "img", {
7
8
  size?: AvatarSize;
8
9
  shape?: AvatarShape;
9
10
  className?: string;
10
11
  }>;
12
+ export type AvatarImageProps = React.ComponentPropsWithoutRef<"img"> & {
13
+ className?: string;
14
+ };
15
+ export type AvatarFallbackProps = Omit<React.ComponentPropsWithoutRef<"span">, "children"> & {
16
+ name: string;
17
+ className?: string;
18
+ };
19
+ export type AvatarContextValue = {
20
+ status?: AvatarLoadingStatus;
21
+ setStatus?: (status: AvatarLoadingStatus) => void;
22
+ };
@@ -0,0 +1,2 @@
1
+ import type { AvatarContextValue } from "./Avatar.types";
2
+ export declare const AvatarContext: import("react").Context<AvatarContextValue>;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "children"> & {
3
+ name: string;
4
+ className?: string;
5
+ } & React.RefAttributes<any>) => React.ReactNode;
6
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ declare const _default: (props: Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref"> & {
3
+ className?: string;
4
+ } & React.RefAttributes<any>) => React.ReactNode;
5
+ export default _default;
@@ -1,2 +1,21 @@
1
- export { default as Avatar, DEFAULT_AVATAR_SIZE } from "./Avatar";
1
+ import { DEFAULT_AVATAR_SIZE } from "./Avatar";
2
+ import AvatarFallback from "./AvatarFallback";
3
+ import AvatarImage from "./AvatarImage";
4
+ export declare const Avatar: (<As extends React.ElementType = "img">(props: import("../../utilities/polymorphic").DistributiveOmit<import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "img" : As> & {
5
+ size?: import("./Avatar.types").AvatarSize;
6
+ shape?: import("./Avatar.types").AvatarShape;
7
+ className?: string;
8
+ }, "as"> & {
9
+ as?: As | undefined;
10
+ } & import("react").RefAttributes<any>) => React.ReactNode) & {
11
+ Image: (props: Omit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref"> & {
12
+ className?: string;
13
+ } & import("react").RefAttributes<any>) => React.ReactNode;
14
+ Fallback: (props: Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "children"> & {
15
+ name: string;
16
+ className?: string;
17
+ } & import("react").RefAttributes<any>) => React.ReactNode;
18
+ };
19
+ export { AvatarImage, AvatarFallback, DEFAULT_AVATAR_SIZE };
20
+ export { AvatarContext } from "./AvatarContext";
2
21
  export * from "./Avatar.types";
@@ -1,11 +1,11 @@
1
1
  import * as React from "react";
2
2
  import type { AvatarShape, AvatarSize } from "../avatar/Avatar.types";
3
- import type { AvatarStackVariant } from "./AvatarStack.types";
3
+ import type { AvatarStackAlign, AvatarStackVariant } from "./AvatarStack.types";
4
4
  declare const _default: <As extends React.ElementType = "span">(props: import("../../utilities/polymorphic").DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "span" : As> & {
5
5
  variant?: AvatarStackVariant;
6
6
  shape?: AvatarShape;
7
7
  size?: AvatarSize;
8
- alignRight?: boolean;
8
+ align?: AvatarStackAlign;
9
9
  disableExpand?: boolean;
10
10
  className?: string;
11
11
  }, "as"> & {
@@ -2,11 +2,12 @@ import type * as React from "react";
2
2
  import type { AvatarShape, AvatarSize } from "../avatar/Avatar.types";
3
3
  import type { PolymorphicProps } from "../../utilities/polymorphic";
4
4
  export type AvatarStackVariant = "cascade" | "stack";
5
+ export type AvatarStackAlign = "left" | "right";
5
6
  export type AvatarStackProps<As extends React.ElementType = "span"> = PolymorphicProps<As, "span", {
6
7
  variant?: AvatarStackVariant;
7
8
  shape?: AvatarShape;
8
9
  size?: AvatarSize;
9
- alignRight?: boolean;
10
+ align?: AvatarStackAlign;
10
11
  disableExpand?: boolean;
11
12
  className?: string;
12
13
  }>;
@@ -68,6 +68,7 @@ export * from "./markdown";
68
68
  export * from "./marquee";
69
69
  export * from "./message";
70
70
  export * from "./meter";
71
+ export * from "./native-select";
71
72
  export * from "./navigation-list";
72
73
  export * from "./navigation-menu";
73
74
  export * from "./number-input";
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import type { NativeSelectSize, NativeSelectValidationStatus } from "./NativeSelect.types";
3
+ declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "size" | "multiple"> & {
4
+ size?: NativeSelectSize;
5
+ block?: boolean;
6
+ validationStatus?: NativeSelectValidationStatus;
7
+ placeholder?: string;
8
+ className?: string;
9
+ } & React.RefAttributes<any>) => React.ReactNode;
10
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import type * as React from "react";
2
+ export type NativeSelectSize = "small" | "medium" | "large";
3
+ export type NativeSelectValidationStatus = "error" | "success";
4
+ export type NativeSelectProps = Omit<React.ComponentPropsWithoutRef<"select">, "size" | "multiple"> & {
5
+ size?: NativeSelectSize;
6
+ block?: boolean;
7
+ validationStatus?: NativeSelectValidationStatus;
8
+ placeholder?: string;
9
+ className?: string;
10
+ };
11
+ export type NativeSelectOptionProps = React.ComponentPropsWithoutRef<"option"> & {
12
+ value: string;
13
+ className?: string;
14
+ };
15
+ export type NativeSelectOptGroupProps = React.ComponentPropsWithoutRef<"optgroup"> & {
16
+ className?: string;
17
+ };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ declare const _default: (props: Omit<React.DetailedHTMLProps<React.OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>, "ref"> & {
3
+ className?: string;
4
+ } & React.RefAttributes<any>) => React.ReactNode;
5
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare const _default: (props: Omit<React.DetailedHTMLProps<React.OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>, "ref"> & {
3
+ value: string;
4
+ className?: string;
5
+ } & React.RefAttributes<any>) => React.ReactNode;
6
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import NativeSelectOptGroup from "./NativeSelectOptGroup";
2
+ import NativeSelectOption from "./NativeSelectOption";
3
+ export declare const NativeSelect: ((props: Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "size" | "multiple"> & {
4
+ size?: import("./NativeSelect.types").NativeSelectSize;
5
+ block?: boolean;
6
+ validationStatus?: import("./NativeSelect.types").NativeSelectValidationStatus;
7
+ placeholder?: string;
8
+ className?: string;
9
+ } & import("react").RefAttributes<any>) => React.ReactNode) & {
10
+ Option: (props: Omit<import("react").DetailedHTMLProps<import("react").OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>, "ref"> & {
11
+ value: string;
12
+ className?: string;
13
+ } & import("react").RefAttributes<any>) => React.ReactNode;
14
+ OptGroup: (props: Omit<import("react").DetailedHTMLProps<import("react").OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>, "ref"> & {
15
+ className?: string;
16
+ } & import("react").RefAttributes<any>) => React.ReactNode;
17
+ };
18
+ export { NativeSelectOption, NativeSelectOptGroup };
19
+ export * from "./NativeSelect.types";
@@ -1,10 +1,20 @@
1
1
  import * as React from "react";
2
2
  import type { SelectSize, SelectValidationStatus } from "./Select.types";
3
- declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "size" | "multiple"> & {
3
+ declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "size" | "onChange" | "value" | "defaultValue" | "type"> & {
4
4
  size?: SelectSize;
5
5
  block?: boolean;
6
6
  validationStatus?: SelectValidationStatus;
7
7
  placeholder?: string;
8
+ value?: string;
9
+ defaultValue?: string;
10
+ onChange?: (value: string) => void;
11
+ name?: string;
12
+ required?: boolean;
13
+ open?: boolean;
14
+ defaultOpen?: boolean;
15
+ onOpenChange?: (open: boolean) => void;
16
+ side?: import("..").AnchorSide;
17
+ align?: import("..").AnchorAlignment;
8
18
  className?: string;
9
19
  } & React.RefAttributes<any>) => React.ReactNode;
10
20
  export default _default;
@@ -1,17 +1,48 @@
1
1
  import type * as React from "react";
2
+ import type { AnchorAlignment, AnchorSide } from "../tooltip/anchoredPosition";
2
3
  export type SelectSize = "small" | "medium" | "large";
3
4
  export type SelectValidationStatus = "error" | "success";
4
- export type SelectProps = Omit<React.ComponentPropsWithoutRef<"select">, "size" | "multiple"> & {
5
+ export type SelectOptionEntry = {
6
+ value: string;
7
+ label: React.ReactNode;
8
+ text: string;
9
+ disabled: boolean;
10
+ };
11
+ export type SelectProps = Omit<React.ComponentPropsWithoutRef<"button">, "size" | "value" | "defaultValue" | "onChange" | "type"> & {
5
12
  size?: SelectSize;
6
13
  block?: boolean;
7
14
  validationStatus?: SelectValidationStatus;
8
15
  placeholder?: string;
16
+ value?: string;
17
+ defaultValue?: string;
18
+ onChange?: (value: string) => void;
19
+ name?: string;
20
+ required?: boolean;
21
+ open?: boolean;
22
+ defaultOpen?: boolean;
23
+ onOpenChange?: (open: boolean) => void;
24
+ side?: AnchorSide;
25
+ align?: AnchorAlignment;
9
26
  className?: string;
10
27
  };
11
- export type SelectOptionProps = React.ComponentPropsWithoutRef<"option"> & {
28
+ export type SelectOptionProps = React.ComponentPropsWithoutRef<"div"> & {
12
29
  value: string;
30
+ disabled?: boolean;
13
31
  className?: string;
14
32
  };
15
- export type SelectOptGroupProps = React.ComponentPropsWithoutRef<"optgroup"> & {
33
+ export type SelectOptGroupProps = React.ComponentPropsWithoutRef<"div"> & {
34
+ label: string;
35
+ disabled?: boolean;
16
36
  className?: string;
17
37
  };
38
+ export type SelectOptGroupContextValue = {
39
+ disabled?: boolean;
40
+ };
41
+ export type SelectContextValue = {
42
+ size?: SelectSize;
43
+ value?: string;
44
+ onSelect?: (value: string) => void;
45
+ activeValue?: string;
46
+ setActiveValue?: (value: string) => void;
47
+ getOptionId?: (value: string) => string | undefined;
48
+ };
@@ -0,0 +1,2 @@
1
+ import type { SelectContextValue } from "./Select.types";
2
+ export declare const SelectContext: import("react").Context<SelectContextValue>;
@@ -1,5 +1,7 @@
1
1
  import * as React from "react";
2
- declare const _default: (props: Omit<React.DetailedHTMLProps<React.OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>, "ref"> & {
2
+ declare const _default: (props: Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ label: string;
4
+ disabled?: boolean;
3
5
  className?: string;
4
6
  } & React.RefAttributes<any>) => React.ReactNode;
5
7
  export default _default;
@@ -0,0 +1,2 @@
1
+ import type { SelectOptGroupContextValue } from "./Select.types";
2
+ export declare const SelectOptGroupContext: import("react").Context<SelectOptGroupContextValue>;
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
- declare const _default: (props: Omit<React.DetailedHTMLProps<React.OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>, "ref"> & {
2
+ declare const _default: (props: Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
3
  value: string;
4
+ disabled?: boolean;
4
5
  className?: string;
5
6
  } & React.RefAttributes<any>) => React.ReactNode;
6
7
  export default _default;
@@ -1,19 +1,34 @@
1
1
  import SelectOptGroup from "./SelectOptGroup";
2
2
  import SelectOption from "./SelectOption";
3
- export declare const Select: ((props: Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref">, "size" | "multiple"> & {
3
+ export declare const Select: ((props: Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "size" | "onChange" | "value" | "defaultValue" | "type"> & {
4
4
  size?: import("./Select.types").SelectSize;
5
5
  block?: boolean;
6
6
  validationStatus?: import("./Select.types").SelectValidationStatus;
7
7
  placeholder?: string;
8
+ value?: string;
9
+ defaultValue?: string;
10
+ onChange?: (value: string) => void;
11
+ name?: string;
12
+ required?: boolean;
13
+ open?: boolean;
14
+ defaultOpen?: boolean;
15
+ onOpenChange?: (open: boolean) => void;
16
+ side?: import("..").AnchorSide;
17
+ align?: import("..").AnchorAlignment;
8
18
  className?: string;
9
19
  } & import("react").RefAttributes<any>) => React.ReactNode) & {
10
- Option: (props: Omit<import("react").DetailedHTMLProps<import("react").OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>, "ref"> & {
20
+ Option: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
11
21
  value: string;
22
+ disabled?: boolean;
12
23
  className?: string;
13
24
  } & import("react").RefAttributes<any>) => React.ReactNode;
14
- OptGroup: (props: Omit<import("react").DetailedHTMLProps<import("react").OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>, "ref"> & {
25
+ OptGroup: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
26
+ label: string;
27
+ disabled?: boolean;
15
28
  className?: string;
16
29
  } & import("react").RefAttributes<any>) => React.ReactNode;
17
30
  };
18
31
  export { SelectOption, SelectOptGroup };
32
+ export { SelectContext } from "./SelectContext";
33
+ export { SelectOptGroupContext } from "./SelectOptGroupContext";
19
34
  export * from "./Select.types";