myshell-react-lib 0.2.1 → 0.2.2

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.cjs CHANGED
@@ -6876,6 +6876,7 @@ var DropdownMenuCheckboxItem = React13.forwardRef(function(_param, ref) {
6876
6876
  checked: checked
6877
6877
  }, props), {
6878
6878
  children: [
6879
+ children,
6879
6880
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", {
6880
6881
  className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
6881
6882
  children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuPrimitive.ItemIndicator, {
@@ -6883,8 +6884,7 @@ var DropdownMenuCheckboxItem = React13.forwardRef(function(_param, ref) {
6883
6884
  className: "h-4 w-4"
6884
6885
  })
6885
6886
  })
6886
- }),
6887
- children
6887
+ })
6888
6888
  ]
6889
6889
  }));
6890
6890
  });
@@ -11667,12 +11667,14 @@ var import_lucide_react12 = require("lucide-react");
11667
11667
  var React33 = __toESM(require("react"), 1);
11668
11668
  var import_jsx_runtime45 = require("react/jsx-runtime");
11669
11669
  var Select = React33.forwardRef(function(_param, ref) {
11670
- var children = _param.children, placeholder = _param.placeholder, options = _param.options, triggerClassName = _param.triggerClassName, side = _param.side, props = _object_without_properties(_param, [
11670
+ 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, [
11671
11671
  "children",
11672
11672
  "placeholder",
11673
11673
  "options",
11674
11674
  "triggerClassName",
11675
- "side"
11675
+ "contentClassName",
11676
+ "side",
11677
+ "variant"
11676
11678
  ]);
11677
11679
  var _options_find;
11678
11680
  var icon = options === null || options === void 0 ? void 0 : (_options_find = options.find(function(item) {
@@ -11682,9 +11684,10 @@ var Select = React33.forwardRef(function(_param, ref) {
11682
11684
  children: Array.isArray(options) && options.length ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, {
11683
11685
  children: [
11684
11686
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectTrigger, {
11685
- className: cn(triggerClassName),
11687
+ className: triggerClassName,
11688
+ isButtonVariant: variant === "button",
11686
11689
  children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", {
11687
- className: "flex items-center space-x-1.5",
11690
+ className: "flex items-center space-x-2",
11688
11691
  children: [
11689
11692
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectIcon, {
11690
11693
  icon: icon
@@ -11697,11 +11700,16 @@ var Select = React33.forwardRef(function(_param, ref) {
11697
11700
  }),
11698
11701
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectContent, {
11699
11702
  side: side,
11703
+ sideOffset: variant === "button" ? 4 : 0,
11704
+ align: "center",
11700
11705
  noPortal: true,
11706
+ className: contentClassName,
11701
11707
  children: options.map(function(item, i) {
11702
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectItem, _object_spread_props(_object_spread({}, item), {
11703
- children: item.label
11704
- }), "".concat(item.value, "_").concat(i));
11708
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, {
11709
+ children: item.label ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectItem, _object_spread_props(_object_spread({}, item), {
11710
+ children: item.label
11711
+ }), "".concat(item.value, "_").concat(i)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectSeparator, {}, "".concat(item.value, "_").concat(i))
11712
+ });
11705
11713
  })
11706
11714
  })
11707
11715
  ]
@@ -11711,13 +11719,17 @@ var Select = React33.forwardRef(function(_param, ref) {
11711
11719
  var SelectGroup = SelectPrimitive.Group;
11712
11720
  var SelectValue = SelectPrimitive.Value;
11713
11721
  var SelectTrigger = React33.forwardRef(function(_param, ref) {
11714
- var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
11722
+ var className = _param.className, children = _param.children, isButtonVariant = _param.isButtonVariant, props = _object_without_properties(_param, [
11715
11723
  "className",
11716
- "children"
11724
+ "children",
11725
+ "isButtonVariant"
11717
11726
  ]);
11718
11727
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(SelectPrimitive.Trigger, _object_spread_props(_object_spread({
11719
11728
  ref: ref,
11720
- 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)
11729
+ 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({
11730
+ variant: "solid",
11731
+ size: "lg"
11732
+ }), isButtonVariant && "w-auto min-w-max inline-flex", className)
11721
11733
  }, props), {
11722
11734
  children: [
11723
11735
  children,
@@ -11802,17 +11814,17 @@ function SelectIcon(props) {
11802
11814
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectPrimitive.Icon, {
11803
11815
  children: typeof icon === "string" ? // 如果是字符串URL,作为背景图片显示
11804
11816
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", {
11805
- 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"),
11817
+ 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"),
11806
11818
  style: {
11807
11819
  backgroundImage: "url('".concat(icon, "')")
11808
11820
  }
11809
11821
  }) : React33.isValidElement(icon) ? // 如果是React元素,直接渲染
11810
11822
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", {
11811
- className: cn("mr-1.5 w-5 h-5 text-Colors-Foreground-Default", critical && "text-Colors-Foreground-Critical-Default"),
11823
+ className: cn("w-5 h-5 text-Colors-Foreground-Default flex items-center justify-center", critical && "text-Colors-Foreground-Critical-Default"),
11812
11824
  children: icon
11813
11825
  }) : // 如果是组件类型,创建元素
11814
11826
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", {
11815
- className: cn("mr-1.5 w-5 h-5 text-Colors-Foreground-Default", critical && "text-Colors-Foreground-Critical-Default"),
11827
+ className: cn("w-5 h-5 text-Colors-Foreground-Default flex items-center justify-center", critical && "text-Colors-Foreground-Critical-Default"),
11816
11828
  children: React33.createElement(icon, {
11817
11829
  className: cn("w-5 h-5 text-Colors-Foreground-Default", critical && "text-Colors-Foreground-Critical-Default")
11818
11830
  })
@@ -11833,7 +11845,7 @@ var SelectItem = React33.forwardRef(function(_param, ref) {
11833
11845
  }, props), {
11834
11846
  children: [
11835
11847
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", {
11836
- className: "flex items-center grow",
11848
+ className: "flex items-center grow space-x-1.5",
11837
11849
  children: [
11838
11850
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectIcon, {
11839
11851
  icon: icon,
@@ -11862,7 +11874,7 @@ var SelectSeparator = React33.forwardRef(function(_param, ref) {
11862
11874
  ]);
11863
11875
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectPrimitive.Separator, _object_spread({
11864
11876
  ref: ref,
11865
- className: cn("-mx-1 my-1 h-px bg-border-default", className)
11877
+ className: cn("mx-1.5 my-1 h-px bg-[var(--Colors-Border-Default)]", className)
11866
11878
  }, props));
11867
11879
  });
11868
11880
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;