myshell-react-lib 0.2.1 → 0.2.3

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
@@ -132,11 +132,11 @@ interface BadgeProps extends VariantProps<typeof badgeVariants> {
132
132
  declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
133
133
 
134
134
  declare const buttonVariants: (props?: ({
135
- variant?: "link" | "opacity" | "static" | "primary" | "secondary" | "tertiary" | "solid" | "plain" | null | undefined;
135
+ variant?: "link" | "opacity" | "static" | "primary" | "secondary" | "tertiary" | "ghost" | "plain" | null | undefined;
136
136
  color?: "default" | "brand" | "error" | null | undefined;
137
137
  size?: "sm" | "md" | "lg" | null | undefined;
138
138
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
139
- type VariantType$1 = 'primary' | 'secondary' | 'tertiary' | 'link' | 'plain' | 'opacity' | 'solid' | 'static';
139
+ type VariantType$1 = 'primary' | 'secondary' | 'tertiary' | 'link' | 'plain' | 'opacity' | 'ghost' | 'static';
140
140
  type ButtonBaseProps = VariantProps<typeof buttonVariants>;
141
141
  type VariantColorMap$1 = {
142
142
  primary: 'default' | 'brand' | 'error';
@@ -145,7 +145,7 @@ type VariantColorMap$1 = {
145
145
  link: 'default';
146
146
  plain: 'default' | 'brand';
147
147
  opacity: never;
148
- solid: never;
148
+ ghost: never;
149
149
  static: never;
150
150
  };
151
151
  type ButtonProps$1<V extends VariantType$1 = VariantType$1> = Omit<ButtonBaseProps, 'color'> & {
@@ -403,7 +403,7 @@ declare const Icon: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTM
403
403
  } & React$1.RefAttributes<HTMLSpanElement>>;
404
404
  type IconComponent = React$1.ForwardRefExoticComponent<IconProps>;
405
405
 
406
- type VariantType = 'primary' | 'secondary' | 'tertiary' | 'plain' | 'opacity' | 'solid' | 'static';
406
+ type VariantType = 'primary' | 'secondary' | 'tertiary' | 'plain' | 'opacity' | 'ghost' | 'static';
407
407
  type ColorType = 'default' | 'brand' | 'error' | 'gray';
408
408
  type SizeType = 'xs' | 'sm' | 'md' | 'lg';
409
409
  declare const iconButtonVariants: (props?: ({
@@ -419,7 +419,7 @@ type VariantColorMap = {
419
419
  tertiary: 'default';
420
420
  plain: 'default' | 'error' | 'gray';
421
421
  opacity: never;
422
- solid: never;
422
+ ghost: never;
423
423
  static: never;
424
424
  };
425
425
  type IconButtonProps<V extends VariantType = VariantType> = Omit<IconButtonBaseProps, 'color'> & {
@@ -1026,13 +1026,17 @@ interface ISelectProps extends SelectPrimitive.SelectProps {
1026
1026
  }>;
1027
1027
  placeholder?: React$1.ReactNode;
1028
1028
  triggerClassName?: string;
1029
+ contentClassName?: string;
1030
+ variant?: 'input' | 'button';
1029
1031
  noPortal?: boolean;
1030
1032
  side?: SelectPrimitive.SelectContentProps['side'];
1031
1033
  }
1032
1034
  declare const Select: React$1.ForwardRefExoticComponent<ISelectProps & React$1.RefAttributes<never>>;
1033
1035
  declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
1034
1036
  declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
1035
- declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
1037
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
1038
+ isButtonVariant?: boolean;
1039
+ } & React$1.RefAttributes<HTMLButtonElement>>;
1036
1040
  declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1037
1041
  declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1038
1042
  declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
package/dist/index.d.ts CHANGED
@@ -132,11 +132,11 @@ interface BadgeProps extends VariantProps<typeof badgeVariants> {
132
132
  declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
133
133
 
134
134
  declare const buttonVariants: (props?: ({
135
- variant?: "link" | "opacity" | "static" | "primary" | "secondary" | "tertiary" | "solid" | "plain" | null | undefined;
135
+ variant?: "link" | "opacity" | "static" | "primary" | "secondary" | "tertiary" | "ghost" | "plain" | null | undefined;
136
136
  color?: "default" | "brand" | "error" | null | undefined;
137
137
  size?: "sm" | "md" | "lg" | null | undefined;
138
138
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
139
- type VariantType$1 = 'primary' | 'secondary' | 'tertiary' | 'link' | 'plain' | 'opacity' | 'solid' | 'static';
139
+ type VariantType$1 = 'primary' | 'secondary' | 'tertiary' | 'link' | 'plain' | 'opacity' | 'ghost' | 'static';
140
140
  type ButtonBaseProps = VariantProps<typeof buttonVariants>;
141
141
  type VariantColorMap$1 = {
142
142
  primary: 'default' | 'brand' | 'error';
@@ -145,7 +145,7 @@ type VariantColorMap$1 = {
145
145
  link: 'default';
146
146
  plain: 'default' | 'brand';
147
147
  opacity: never;
148
- solid: never;
148
+ ghost: never;
149
149
  static: never;
150
150
  };
151
151
  type ButtonProps$1<V extends VariantType$1 = VariantType$1> = Omit<ButtonBaseProps, 'color'> & {
@@ -403,7 +403,7 @@ declare const Icon: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTM
403
403
  } & React$1.RefAttributes<HTMLSpanElement>>;
404
404
  type IconComponent = React$1.ForwardRefExoticComponent<IconProps>;
405
405
 
406
- type VariantType = 'primary' | 'secondary' | 'tertiary' | 'plain' | 'opacity' | 'solid' | 'static';
406
+ type VariantType = 'primary' | 'secondary' | 'tertiary' | 'plain' | 'opacity' | 'ghost' | 'static';
407
407
  type ColorType = 'default' | 'brand' | 'error' | 'gray';
408
408
  type SizeType = 'xs' | 'sm' | 'md' | 'lg';
409
409
  declare const iconButtonVariants: (props?: ({
@@ -419,7 +419,7 @@ type VariantColorMap = {
419
419
  tertiary: 'default';
420
420
  plain: 'default' | 'error' | 'gray';
421
421
  opacity: never;
422
- solid: never;
422
+ ghost: never;
423
423
  static: never;
424
424
  };
425
425
  type IconButtonProps<V extends VariantType = VariantType> = Omit<IconButtonBaseProps, 'color'> & {
@@ -1026,13 +1026,17 @@ interface ISelectProps extends SelectPrimitive.SelectProps {
1026
1026
  }>;
1027
1027
  placeholder?: React$1.ReactNode;
1028
1028
  triggerClassName?: string;
1029
+ contentClassName?: string;
1030
+ variant?: 'input' | 'button';
1029
1031
  noPortal?: boolean;
1030
1032
  side?: SelectPrimitive.SelectContentProps['side'];
1031
1033
  }
1032
1034
  declare const Select: React$1.ForwardRefExoticComponent<ISelectProps & React$1.RefAttributes<never>>;
1033
1035
  declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
1034
1036
  declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
1035
- declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
1037
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
1038
+ isButtonVariant?: boolean;
1039
+ } & React$1.RefAttributes<HTMLButtonElement>>;
1036
1040
  declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1037
1041
  declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1038
1042
  declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
package/dist/index.js CHANGED
@@ -4740,7 +4740,7 @@ var VARIANT_BASE = {
4740
4740
  link: "",
4741
4741
  plain: "",
4742
4742
  opacity: "backdrop-blur-2xl text-Colors-Text-Static-White bg-Colors-Beta-White-30 border border-Colors-Beta-White-12 shadow-none hover:bg-Colors-Beta-White-40 focus:shadow-cc-Focus-Rings-Brand-default active:bg-Colors-Beta-White-50 disabled:bg-Colors-Beta-White-60 disabled:text-Colors-Beta-White-80",
4743
- solid: "shadow-none text-Colors-Text-Subtle bg-cc-Button-Solid-bg-default border border-cc-Button-Solid-border-default hover:bg-cc-Button-Solid-bg-hover hover:border-cc-Button-Solid-border-alt active:bg-cc-Button-Solid-bg-active disabled:text-cc-Button-Solid-fg-alt"
4743
+ ghost: "shadow-none text-Colors-Text-Subtle bg-cc-Button-Ghost-bg-default border border-cc-Button-Ghost-border-default hover:bg-cc-Button-Ghost-bg-hover hover:border-cc-Button-Ghost-border-alt active:bg-cc-Button-Ghost-bg-active disabled:text-cc-Button-Ghost-fg-alt"
4744
4744
  };
4745
4745
  var SPECIAL_LAYOUTS = {
4746
4746
  link: "h-fit w-fit min-w-auto px-0.5 py-0.5",
@@ -4838,17 +4838,17 @@ var buttonVariants = cva4(BASE_BUTTON, {
4838
4838
  className: SIZE_CLASSES.sm.withPadding
4839
4839
  },
4840
4840
  {
4841
- variant: "solid",
4841
+ variant: "ghost",
4842
4842
  size: "lg",
4843
4843
  className: SIZE_CLASSES.lg.withPadding
4844
4844
  },
4845
4845
  {
4846
- variant: "solid",
4846
+ variant: "ghost",
4847
4847
  size: "md",
4848
4848
  className: SIZE_CLASSES.md.withPadding
4849
4849
  },
4850
4850
  {
4851
- variant: "solid",
4851
+ variant: "ghost",
4852
4852
  size: "sm",
4853
4853
  className: SIZE_CLASSES.sm.withPadding
4854
4854
  },
@@ -4957,7 +4957,7 @@ var iconVariants2 = cva4("relative shrink-0 text-inherit inline-flex items-cente
4957
4957
  link: "font-normal",
4958
4958
  plain: "font-medium",
4959
4959
  static: "",
4960
- solid: "",
4960
+ ghost: "",
4961
4961
  opacity: ""
4962
4962
  },
4963
4963
  size: {
@@ -5653,7 +5653,7 @@ var VARIANT_STYLES = {
5653
5653
  tertiary: "shadow-none",
5654
5654
  plain: "",
5655
5655
  opacity: "backdrop-blur-2xl text-Colors-Text-Static-White bg-Colors-Beta-White-30 border border-Colors-Beta-White-12 shadow-none hover:bg-Colors-Beta-White-40 focus:shadow-cc-Focus-Rings-Brand-default active:bg-Colors-Beta-White-50 disabled:bg-Colors-Beta-White-60 disabled:text-Colors-Beta-White-80",
5656
- solid: "shadow-none text-Colors-Text-Subtle bg-cc-Button-Solid-bg-default border border-cc-Button-Solid-border-default hover:bg-cc-Button-Solid-bg-hover hover:border-cc-Button-Solid-border-alt active:bg-cc-Button-Solid-bg-active disabled:text-cc-Button-Solid-fg-alt",
5656
+ ghost: "shadow-none text-Colors-Text-Subtle bg-cc-Button-Ghost-bg-default border border-cc-Button-Ghost-border-default hover:bg-cc-Button-Ghost-bg-hover hover:border-cc-Button-Ghost-border-alt active:bg-cc-Button-Ghost-bg-active disabled:text-cc-Button-Ghost-fg-alt",
5657
5657
  static: "text-cc-Button-Static-fg-default border-cc-Button-Static-border-default bg-cc-Button-Static-bg-default hover:bg-cc-Button-Static-bg-hover active:bg-cc-Button-Static-bg-active disabled:bg-cc-Button-Static-bg-disabled disabled:text-cc-Button-Static-fg-alt"
5658
5658
  };
5659
5659
  var COLOR_STYLES = {
@@ -6132,6 +6132,7 @@ var DropdownMenuCheckboxItem = React13.forwardRef(function(_param, ref) {
6132
6132
  checked: checked
6133
6133
  }, props), {
6134
6134
  children: [
6135
+ children,
6135
6136
  /* @__PURE__ */ jsx18("span", {
6136
6137
  className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
6137
6138
  children: /* @__PURE__ */ jsx18(DropdownMenuPrimitive.ItemIndicator, {
@@ -6139,8 +6140,7 @@ var DropdownMenuCheckboxItem = React13.forwardRef(function(_param, ref) {
6139
6140
  className: "h-4 w-4"
6140
6141
  })
6141
6142
  })
6142
- }),
6143
- children
6143
+ })
6144
6144
  ]
6145
6145
  }));
6146
6146
  });
@@ -10923,12 +10923,14 @@ import { ChevronDown as ChevronDown2, ChevronUp, CheckIcon as CheckIcon2 } from
10923
10923
  import * as React33 from "react";
10924
10924
  import { Fragment as Fragment8, jsx as jsx45, jsxs as jsxs27 } from "react/jsx-runtime";
10925
10925
  var Select = React33.forwardRef(function(_param, ref) {
10926
- var children = _param.children, placeholder = _param.placeholder, options = _param.options, triggerClassName = _param.triggerClassName, side = _param.side, props = _object_without_properties(_param, [
10926
+ var children = _param.children, placeholder = _param.placeholder, options = _param.options, triggerClassName = _param.triggerClassName, contentClassName = _param.contentClassName, side = _param.side, _param_variant = _param.variant, variant = _param_variant === void 0 ? "input" : _param_variant, props = _object_without_properties(_param, [
10927
10927
  "children",
10928
10928
  "placeholder",
10929
10929
  "options",
10930
10930
  "triggerClassName",
10931
- "side"
10931
+ "contentClassName",
10932
+ "side",
10933
+ "variant"
10932
10934
  ]);
10933
10935
  var _options_find;
10934
10936
  var icon = options === null || options === void 0 ? void 0 : (_options_find = options.find(function(item) {
@@ -10938,9 +10940,10 @@ var Select = React33.forwardRef(function(_param, ref) {
10938
10940
  children: Array.isArray(options) && options.length ? /* @__PURE__ */ jsxs27(Fragment8, {
10939
10941
  children: [
10940
10942
  /* @__PURE__ */ jsx45(SelectTrigger, {
10941
- className: cn(triggerClassName),
10943
+ className: triggerClassName,
10944
+ isButtonVariant: variant === "button",
10942
10945
  children: /* @__PURE__ */ jsxs27("div", {
10943
- className: "flex items-center space-x-1.5",
10946
+ className: "flex items-center space-x-2",
10944
10947
  children: [
10945
10948
  /* @__PURE__ */ jsx45(SelectIcon, {
10946
10949
  icon: icon
@@ -10953,11 +10956,16 @@ var Select = React33.forwardRef(function(_param, ref) {
10953
10956
  }),
10954
10957
  /* @__PURE__ */ jsx45(SelectContent, {
10955
10958
  side: side,
10959
+ sideOffset: variant === "button" ? 4 : 0,
10960
+ align: "center",
10956
10961
  noPortal: true,
10962
+ className: contentClassName,
10957
10963
  children: options.map(function(item, i) {
10958
- return /* @__PURE__ */ jsx45(SelectItem, _object_spread_props(_object_spread({}, item), {
10959
- children: item.label
10960
- }), "".concat(item.value, "_").concat(i));
10964
+ return /* @__PURE__ */ jsx45(Fragment8, {
10965
+ children: item.label ? /* @__PURE__ */ jsx45(SelectItem, _object_spread_props(_object_spread({}, item), {
10966
+ children: item.label
10967
+ }), "".concat(item.value, "_").concat(i)) : /* @__PURE__ */ jsx45(SelectSeparator, {}, "".concat(item.value, "_").concat(i))
10968
+ });
10961
10969
  })
10962
10970
  })
10963
10971
  ]
@@ -10967,13 +10975,17 @@ var Select = React33.forwardRef(function(_param, ref) {
10967
10975
  var SelectGroup = SelectPrimitive.Group;
10968
10976
  var SelectValue = SelectPrimitive.Value;
10969
10977
  var SelectTrigger = React33.forwardRef(function(_param, ref) {
10970
- var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
10978
+ var className = _param.className, children = _param.children, isButtonVariant = _param.isButtonVariant, props = _object_without_properties(_param, [
10971
10979
  "className",
10972
- "children"
10980
+ "children",
10981
+ "isButtonVariant"
10973
10982
  ]);
10974
10983
  return /* @__PURE__ */ jsxs27(SelectPrimitive.Trigger, _object_spread_props(_object_spread({
10975
10984
  ref: ref,
10976
- className: cn("flex h-7 md:h-10 w-full items-center justify-between rounded-sm border border-transparent hover:border-cc-Input-border-default bg-cc-Input-bg-default text-Colors-Text-Default text-sm p-3 focus:shadow-cc-Focus-Rings-Brand-default placeholder:text-Colors-Text-Subtlest focus:outline-none focus:ring-0 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-30 [&>span]:line-clamp-1 [&>.select-chevron]:aria-expanded:rotate-180 space-x-1.5", className)
10985
+ className: cn("flex h-7 md:h-10 w-full items-center justify-between rounded-sm border border-transparent hover:border-cc-Input-border-default bg-cc-Input-bg-default text-Colors-Text-Default text-sm p-3 focus:shadow-cc-Focus-Rings-Brand-default placeholder:text-Colors-Text-Subtlest focus:outline-none focus:ring-0 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-30 [&>span]:line-clamp-1 [&>.select-chevron]:aria-expanded:rotate-180 space-x-1.5", isButtonVariant && buttonVariants({
10986
+ variant: "ghost",
10987
+ size: "lg"
10988
+ }), isButtonVariant && "w-auto min-w-max inline-flex", className)
10977
10989
  }, props), {
10978
10990
  children: [
10979
10991
  children,
@@ -11058,17 +11070,17 @@ function SelectIcon(props) {
11058
11070
  return /* @__PURE__ */ jsx45(SelectPrimitive.Icon, {
11059
11071
  children: typeof icon === "string" ? // 如果是字符串URL,作为背景图片显示
11060
11072
  /* @__PURE__ */ jsx45("div", {
11061
- className: cn("aspect-[20/20] w-5 h-5 relative bg-cover bg-no-repeat rounded-sm overflow-hidden mr-1.5", critical && "text-Colors-Text-Critical-Default"),
11073
+ className: cn("aspect-[20/20] w-5 h-5 relative bg-cover bg-no-repeat rounded-sm overflow-hidden", critical && "text-Colors-Text-Critical-Default"),
11062
11074
  style: {
11063
11075
  backgroundImage: "url('".concat(icon, "')")
11064
11076
  }
11065
11077
  }) : React33.isValidElement(icon) ? // 如果是React元素,直接渲染
11066
11078
  /* @__PURE__ */ jsx45("div", {
11067
- className: cn("mr-1.5 w-5 h-5 text-Colors-Foreground-Default", critical && "text-Colors-Foreground-Critical-Default"),
11079
+ className: cn("w-5 h-5 text-Colors-Foreground-Default flex items-center justify-center", critical && "text-Colors-Foreground-Critical-Default"),
11068
11080
  children: icon
11069
11081
  }) : // 如果是组件类型,创建元素
11070
11082
  /* @__PURE__ */ jsx45("div", {
11071
- className: cn("mr-1.5 w-5 h-5 text-Colors-Foreground-Default", critical && "text-Colors-Foreground-Critical-Default"),
11083
+ className: cn("w-5 h-5 text-Colors-Foreground-Default flex items-center justify-center", critical && "text-Colors-Foreground-Critical-Default"),
11072
11084
  children: React33.createElement(icon, {
11073
11085
  className: cn("w-5 h-5 text-Colors-Foreground-Default", critical && "text-Colors-Foreground-Critical-Default")
11074
11086
  })
@@ -11089,7 +11101,7 @@ var SelectItem = React33.forwardRef(function(_param, ref) {
11089
11101
  }, props), {
11090
11102
  children: [
11091
11103
  /* @__PURE__ */ jsxs27("span", {
11092
- className: "flex items-center grow",
11104
+ className: "flex items-center grow space-x-1.5",
11093
11105
  children: [
11094
11106
  /* @__PURE__ */ jsx45(SelectIcon, {
11095
11107
  icon: icon,
@@ -11118,7 +11130,7 @@ var SelectSeparator = React33.forwardRef(function(_param, ref) {
11118
11130
  ]);
11119
11131
  return /* @__PURE__ */ jsx45(SelectPrimitive.Separator, _object_spread({
11120
11132
  ref: ref,
11121
- className: cn("-mx-1 my-1 h-px bg-border-default", className)
11133
+ className: cn("mx-1.5 my-1 h-px bg-[var(--Colors-Border-Default)]", className)
11122
11134
  }, props));
11123
11135
  });
11124
11136
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;