@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.cjs +19 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -143,8 +143,8 @@ var Button = React.forwardRef(
|
|
|
143
143
|
size = "md",
|
|
144
144
|
asChild = false,
|
|
145
145
|
children,
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
trailingIcon,
|
|
147
|
+
leadingIcon,
|
|
148
148
|
...rest
|
|
149
149
|
} = props;
|
|
150
150
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
@@ -155,9 +155,9 @@ var Button = React.forwardRef(
|
|
|
155
155
|
ref,
|
|
156
156
|
...rest,
|
|
157
157
|
children: [
|
|
158
|
-
|
|
158
|
+
leadingIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn(buttonIconVariants({ size })), children: leadingIcon }),
|
|
159
159
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn(buttonTextVariants({ size })), children }),
|
|
160
|
-
|
|
160
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn(buttonIconVariants({ size })), children: trailingIcon })
|
|
161
161
|
]
|
|
162
162
|
}
|
|
163
163
|
);
|
|
@@ -361,8 +361,8 @@ var LinkButton = React4.forwardRef(
|
|
|
361
361
|
size = "sm",
|
|
362
362
|
asChild = false,
|
|
363
363
|
children,
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
trailingIcon,
|
|
365
|
+
leadingIcon,
|
|
366
366
|
...rest
|
|
367
367
|
} = props;
|
|
368
368
|
const Comp = asChild ? import_react_slot3.Slot : "button";
|
|
@@ -373,9 +373,9 @@ var LinkButton = React4.forwardRef(
|
|
|
373
373
|
ref,
|
|
374
374
|
...rest,
|
|
375
375
|
children: [
|
|
376
|
-
|
|
376
|
+
leadingIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn(linkButtonIconVariants({ size })), children: leadingIcon }),
|
|
377
377
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn(linkButtonTextVariants({ size })), children }),
|
|
378
|
-
|
|
378
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn(linkButtonIconVariants({ size })), children: trailingIcon })
|
|
379
379
|
]
|
|
380
380
|
}
|
|
381
381
|
);
|
|
@@ -2145,6 +2145,7 @@ var SearchInput = (props) => {
|
|
|
2145
2145
|
className,
|
|
2146
2146
|
leadingIcon,
|
|
2147
2147
|
showLeadingIcon = true,
|
|
2148
|
+
trailingIcon,
|
|
2148
2149
|
...inputProps
|
|
2149
2150
|
} = props;
|
|
2150
2151
|
const inputRef = React28.useRef(null);
|
|
@@ -2152,6 +2153,7 @@ var SearchInput = (props) => {
|
|
|
2152
2153
|
if (disabled) return;
|
|
2153
2154
|
inputRef.current?.focus();
|
|
2154
2155
|
};
|
|
2156
|
+
const showTrailingIcon = !!trailingIcon;
|
|
2155
2157
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col gap-2 items-start min-w-[343px]", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "relative w-full", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2156
2158
|
InputShell,
|
|
2157
2159
|
{
|
|
@@ -2176,7 +2178,8 @@ var SearchInput = (props) => {
|
|
|
2176
2178
|
style: { marginBottom: 0 },
|
|
2177
2179
|
...inputProps
|
|
2178
2180
|
}
|
|
2179
|
-
)
|
|
2181
|
+
),
|
|
2182
|
+
showTrailingIcon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: cn("cursor-pointer", iconWrapperVariants2({ size, disabled: !!disabled })), children: trailingIcon })
|
|
2180
2183
|
]
|
|
2181
2184
|
}
|
|
2182
2185
|
) }) });
|
|
@@ -2964,7 +2967,7 @@ var React33 = require("react");
|
|
|
2964
2967
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2965
2968
|
var WebsiteInput = (props) => {
|
|
2966
2969
|
const {
|
|
2967
|
-
hierarchy = "
|
|
2970
|
+
hierarchy = "leading",
|
|
2968
2971
|
protocolLabel = "http://",
|
|
2969
2972
|
icon,
|
|
2970
2973
|
size = "large",
|
|
@@ -2972,7 +2975,7 @@ var WebsiteInput = (props) => {
|
|
|
2972
2975
|
className,
|
|
2973
2976
|
...rest
|
|
2974
2977
|
} = props;
|
|
2975
|
-
const
|
|
2978
|
+
const isLeading = hierarchy === "leading";
|
|
2976
2979
|
const baseClass = cn(
|
|
2977
2980
|
"[&>span]:w-[unset] hover:bg-[unset]",
|
|
2978
2981
|
!disabled && "[&:not(:focus-within):hover]:shadow-[0_0_0_var(--focus-ring-spread)_var(--background-secondary-hover)]",
|
|
@@ -2990,18 +2993,18 @@ var WebsiteInput = (props) => {
|
|
|
2990
2993
|
"border-(--border-secondary)",
|
|
2991
2994
|
// divider color
|
|
2992
2995
|
disabled && "border-(--border-secondary-disabled) hover:border-(--border-secondary-disabled)",
|
|
2993
|
-
|
|
2996
|
+
isLeading ? "border-r" : "border-l"
|
|
2994
2997
|
);
|
|
2995
2998
|
const iconWrapperClass = cn(
|
|
2996
2999
|
"flex items-center justify-center shrink-0",
|
|
2997
3000
|
size === "extra-large" ? "[&>svg]:w-6 [&>svg]:h-6" : "[&>svg]:w-5 [&>svg]:h-5",
|
|
2998
3001
|
disabled ? "text-(--icon-primary-disabled)" : "text-(--icon-primary) group-hover:text-(--icon-primary-hover) group-focus-within:text-(--icon-primary-focus)"
|
|
2999
3002
|
);
|
|
3000
|
-
const
|
|
3003
|
+
const leadingAddon = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: baseAddonClass, children: [
|
|
3001
3004
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: addonTextClass, children: protocolLabel }),
|
|
3002
3005
|
icon != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: iconWrapperClass, children: icon })
|
|
3003
3006
|
] });
|
|
3004
|
-
const
|
|
3007
|
+
const trailingAddon = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: baseAddonClass, children: [
|
|
3005
3008
|
icon != null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: iconWrapperClass, children: icon }),
|
|
3006
3009
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: addonTextClass, children: protocolLabel })
|
|
3007
3010
|
] });
|
|
@@ -3012,8 +3015,8 @@ var WebsiteInput = (props) => {
|
|
|
3012
3015
|
size,
|
|
3013
3016
|
disabled,
|
|
3014
3017
|
className: cn(baseClass, className),
|
|
3015
|
-
leadingIcon:
|
|
3016
|
-
trailingIcon: !
|
|
3018
|
+
leadingIcon: isLeading ? leadingAddon : void 0,
|
|
3019
|
+
trailingIcon: !isLeading ? trailingAddon : void 0
|
|
3017
3020
|
}
|
|
3018
3021
|
);
|
|
3019
3022
|
};
|