@bubo-squared/ui-framework 0.1.92 → 0.1.93

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
@@ -14,8 +14,8 @@ declare const buttonVariants: (props?: ({
14
14
  } & class_variance_authority_types.ClassProp) | undefined) => string;
15
15
  interface ButtonProps$1 extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
16
16
  asChild?: boolean;
17
- suffixIcon?: React$1.ReactNode;
18
- prefixIcon?: React$1.ReactNode;
17
+ trailingIcon?: React$1.ReactNode;
18
+ leadingIcon?: React$1.ReactNode;
19
19
  }
20
20
  declare const Button: React$1.ForwardRefExoticComponent<ButtonProps$1 & React$1.RefAttributes<HTMLButtonElement>>;
21
21
 
@@ -55,8 +55,8 @@ declare const linkButtonVariants: (props?: ({
55
55
  } & class_variance_authority_types.ClassProp) | undefined) => string;
56
56
  interface LinkButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof linkButtonVariants> {
57
57
  asChild?: boolean;
58
- suffixIcon?: React$1.ReactNode;
59
- prefixIcon?: React$1.ReactNode;
58
+ trailingIcon?: React$1.ReactNode;
59
+ leadingIcon?: React$1.ReactNode;
60
60
  }
61
61
  declare const LinkButton: React$1.ForwardRefExoticComponent<LinkButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
62
62
 
@@ -337,6 +337,7 @@ interface SearchInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputEle
337
337
  placeholder?: string;
338
338
  leadingIcon?: React$1.ReactNode;
339
339
  showLeadingIcon?: boolean;
340
+ trailingIcon?: React$1.ReactNode | null;
340
341
  size?: SearchInputSize;
341
342
  disabled?: boolean;
342
343
  }
@@ -412,12 +413,12 @@ interface ToggleProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>
412
413
  }
413
414
  declare const Toggle: React$1.FC<ToggleProps>;
414
415
 
415
- type WebsiteInputHierarchy = "prefix" | "suffix";
416
+ type WebsiteInputHierarchy = "leading" | "trailing";
416
417
  interface WebsiteInputProps extends Omit<TextInputProps, "leadingIcon" | "trailingIcon"> {
417
418
  /**
418
419
  * Position of the protocol add-on (label + icon).
419
- * - "prefix": add-on on the left side of the field
420
- * - "suffix": add-on on the right side of the field
420
+ * - "leading": add-on on the left side of the field
421
+ * - "trailing": add-on on the right side of the field
421
422
  */
422
423
  hierarchy?: WebsiteInputHierarchy;
423
424
  /**
package/dist/index.d.ts CHANGED
@@ -14,8 +14,8 @@ declare const buttonVariants: (props?: ({
14
14
  } & class_variance_authority_types.ClassProp) | undefined) => string;
15
15
  interface ButtonProps$1 extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
16
16
  asChild?: boolean;
17
- suffixIcon?: React$1.ReactNode;
18
- prefixIcon?: React$1.ReactNode;
17
+ trailingIcon?: React$1.ReactNode;
18
+ leadingIcon?: React$1.ReactNode;
19
19
  }
20
20
  declare const Button: React$1.ForwardRefExoticComponent<ButtonProps$1 & React$1.RefAttributes<HTMLButtonElement>>;
21
21
 
@@ -55,8 +55,8 @@ declare const linkButtonVariants: (props?: ({
55
55
  } & class_variance_authority_types.ClassProp) | undefined) => string;
56
56
  interface LinkButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof linkButtonVariants> {
57
57
  asChild?: boolean;
58
- suffixIcon?: React$1.ReactNode;
59
- prefixIcon?: React$1.ReactNode;
58
+ trailingIcon?: React$1.ReactNode;
59
+ leadingIcon?: React$1.ReactNode;
60
60
  }
61
61
  declare const LinkButton: React$1.ForwardRefExoticComponent<LinkButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
62
62
 
@@ -337,6 +337,7 @@ interface SearchInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputEle
337
337
  placeholder?: string;
338
338
  leadingIcon?: React$1.ReactNode;
339
339
  showLeadingIcon?: boolean;
340
+ trailingIcon?: React$1.ReactNode | null;
340
341
  size?: SearchInputSize;
341
342
  disabled?: boolean;
342
343
  }
@@ -412,12 +413,12 @@ interface ToggleProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>
412
413
  }
413
414
  declare const Toggle: React$1.FC<ToggleProps>;
414
415
 
415
- type WebsiteInputHierarchy = "prefix" | "suffix";
416
+ type WebsiteInputHierarchy = "leading" | "trailing";
416
417
  interface WebsiteInputProps extends Omit<TextInputProps, "leadingIcon" | "trailingIcon"> {
417
418
  /**
418
419
  * Position of the protocol add-on (label + icon).
419
- * - "prefix": add-on on the left side of the field
420
- * - "suffix": add-on on the right side of the field
420
+ * - "leading": add-on on the left side of the field
421
+ * - "trailing": add-on on the right side of the field
421
422
  */
422
423
  hierarchy?: WebsiteInputHierarchy;
423
424
  /**
package/dist/index.js CHANGED
@@ -76,8 +76,8 @@ var Button = React.forwardRef(
76
76
  size = "md",
77
77
  asChild = false,
78
78
  children,
79
- suffixIcon,
80
- prefixIcon,
79
+ trailingIcon,
80
+ leadingIcon,
81
81
  ...rest
82
82
  } = props;
83
83
  const Comp = asChild ? Slot : "button";
@@ -88,9 +88,9 @@ var Button = React.forwardRef(
88
88
  ref,
89
89
  ...rest,
90
90
  children: [
91
- prefixIcon && /* @__PURE__ */ jsx2("div", { className: cn(buttonIconVariants({ size })), children: prefixIcon }),
91
+ leadingIcon && /* @__PURE__ */ jsx2("div", { className: cn(buttonIconVariants({ size })), children: leadingIcon }),
92
92
  /* @__PURE__ */ jsx2("div", { className: cn(buttonTextVariants({ size })), children }),
93
- suffixIcon && /* @__PURE__ */ jsx2("div", { className: cn(buttonIconVariants({ size })), children: suffixIcon })
93
+ trailingIcon && /* @__PURE__ */ jsx2("div", { className: cn(buttonIconVariants({ size })), children: trailingIcon })
94
94
  ]
95
95
  }
96
96
  );
@@ -294,8 +294,8 @@ var LinkButton = React4.forwardRef(
294
294
  size = "sm",
295
295
  asChild = false,
296
296
  children,
297
- suffixIcon,
298
- prefixIcon,
297
+ trailingIcon,
298
+ leadingIcon,
299
299
  ...rest
300
300
  } = props;
301
301
  const Comp = asChild ? Slot3 : "button";
@@ -306,9 +306,9 @@ var LinkButton = React4.forwardRef(
306
306
  ref,
307
307
  ...rest,
308
308
  children: [
309
- prefixIcon && /* @__PURE__ */ jsx6("div", { className: cn(linkButtonIconVariants({ size })), children: prefixIcon }),
309
+ leadingIcon && /* @__PURE__ */ jsx6("div", { className: cn(linkButtonIconVariants({ size })), children: leadingIcon }),
310
310
  /* @__PURE__ */ jsx6("div", { className: cn(linkButtonTextVariants({ size })), children }),
311
- suffixIcon && /* @__PURE__ */ jsx6("div", { className: cn(linkButtonIconVariants({ size })), children: suffixIcon })
311
+ trailingIcon && /* @__PURE__ */ jsx6("div", { className: cn(linkButtonIconVariants({ size })), children: trailingIcon })
312
312
  ]
313
313
  }
314
314
  );
@@ -2084,6 +2084,7 @@ var SearchInput = (props) => {
2084
2084
  className,
2085
2085
  leadingIcon,
2086
2086
  showLeadingIcon = true,
2087
+ trailingIcon,
2087
2088
  ...inputProps
2088
2089
  } = props;
2089
2090
  const inputRef = React28.useRef(null);
@@ -2091,6 +2092,7 @@ var SearchInput = (props) => {
2091
2092
  if (disabled) return;
2092
2093
  inputRef.current?.focus();
2093
2094
  };
2095
+ const showTrailingIcon = !!trailingIcon;
2094
2096
  return /* @__PURE__ */ jsx30("div", { className: "flex flex-col gap-2 items-start min-w-[343px]", children: /* @__PURE__ */ jsx30("div", { className: "relative w-full", children: /* @__PURE__ */ jsxs20(
2095
2097
  InputShell,
2096
2098
  {
@@ -2115,7 +2117,8 @@ var SearchInput = (props) => {
2115
2117
  style: { marginBottom: 0 },
2116
2118
  ...inputProps
2117
2119
  }
2118
- )
2120
+ ),
2121
+ showTrailingIcon && /* @__PURE__ */ jsx30("span", { className: cn("cursor-pointer", iconWrapperVariants2({ size, disabled: !!disabled })), children: trailingIcon })
2119
2122
  ]
2120
2123
  }
2121
2124
  ) }) });
@@ -2903,7 +2906,7 @@ import "react";
2903
2906
  import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
2904
2907
  var WebsiteInput = (props) => {
2905
2908
  const {
2906
- hierarchy = "prefix",
2909
+ hierarchy = "leading",
2907
2910
  protocolLabel = "http://",
2908
2911
  icon,
2909
2912
  size = "large",
@@ -2911,7 +2914,7 @@ var WebsiteInput = (props) => {
2911
2914
  className,
2912
2915
  ...rest
2913
2916
  } = props;
2914
- const isPrefix = hierarchy === "prefix";
2917
+ const isLeading = hierarchy === "leading";
2915
2918
  const baseClass = cn(
2916
2919
  "[&>span]:w-[unset] hover:bg-[unset]",
2917
2920
  !disabled && "[&:not(:focus-within):hover]:shadow-[0_0_0_var(--focus-ring-spread)_var(--background-secondary-hover)]",
@@ -2929,18 +2932,18 @@ var WebsiteInput = (props) => {
2929
2932
  "border-(--border-secondary)",
2930
2933
  // divider color
2931
2934
  disabled && "border-(--border-secondary-disabled) hover:border-(--border-secondary-disabled)",
2932
- isPrefix ? "border-r" : "border-l"
2935
+ isLeading ? "border-r" : "border-l"
2933
2936
  );
2934
2937
  const iconWrapperClass = cn(
2935
2938
  "flex items-center justify-center shrink-0",
2936
2939
  size === "extra-large" ? "[&>svg]:w-6 [&>svg]:h-6" : "[&>svg]:w-5 [&>svg]:h-5",
2937
2940
  disabled ? "text-(--icon-primary-disabled)" : "text-(--icon-primary) group-hover:text-(--icon-primary-hover) group-focus-within:text-(--icon-primary-focus)"
2938
2941
  );
2939
- const prefixAddon = /* @__PURE__ */ jsxs25("div", { className: baseAddonClass, children: [
2942
+ const leadingAddon = /* @__PURE__ */ jsxs25("div", { className: baseAddonClass, children: [
2940
2943
  /* @__PURE__ */ jsx35("div", { className: addonTextClass, children: protocolLabel }),
2941
2944
  icon != null && /* @__PURE__ */ jsx35("span", { className: iconWrapperClass, children: icon })
2942
2945
  ] });
2943
- const suffixAddon = /* @__PURE__ */ jsxs25("div", { className: baseAddonClass, children: [
2946
+ const trailingAddon = /* @__PURE__ */ jsxs25("div", { className: baseAddonClass, children: [
2944
2947
  icon != null && /* @__PURE__ */ jsx35("span", { className: iconWrapperClass, children: icon }),
2945
2948
  /* @__PURE__ */ jsx35("div", { className: addonTextClass, children: protocolLabel })
2946
2949
  ] });
@@ -2951,8 +2954,8 @@ var WebsiteInput = (props) => {
2951
2954
  size,
2952
2955
  disabled,
2953
2956
  className: cn(baseClass, className),
2954
- leadingIcon: isPrefix ? prefixAddon : void 0,
2955
- trailingIcon: !isPrefix ? suffixAddon : void 0
2957
+ leadingIcon: isLeading ? leadingAddon : void 0,
2958
+ trailingIcon: !isLeading ? trailingAddon : void 0
2956
2959
  }
2957
2960
  );
2958
2961
  };