@okshaun/components 0.3.3 → 0.3.4
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.js +53 -8
- package/dist/index.js.map +1 -1
- package/dist/preset.js +14 -7
- package/dist/preset.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2035,9 +2035,7 @@ const Icon = ({
|
|
|
2035
2035
|
fill = "current",
|
|
2036
2036
|
...props
|
|
2037
2037
|
}) => {
|
|
2038
|
-
const [
|
|
2039
|
-
const { css: cssProp, ...styleProps } = cssProps;
|
|
2040
|
-
const className = css(cssProp, styleProps);
|
|
2038
|
+
const [className, otherProps] = splitProps(props);
|
|
2041
2039
|
useEffect(() => {
|
|
2042
2040
|
injectSprite();
|
|
2043
2041
|
}, []);
|
|
@@ -2351,10 +2349,26 @@ const IconNames = {
|
|
|
2351
2349
|
"zoom-out": "zoom-out"
|
|
2352
2350
|
};
|
|
2353
2351
|
const Button = React.forwardRef(
|
|
2354
|
-
({
|
|
2352
|
+
({
|
|
2353
|
+
appearance,
|
|
2354
|
+
size,
|
|
2355
|
+
href,
|
|
2356
|
+
className,
|
|
2357
|
+
children,
|
|
2358
|
+
loading,
|
|
2359
|
+
disabled,
|
|
2360
|
+
iconBefore,
|
|
2361
|
+
iconAfter,
|
|
2362
|
+
...props
|
|
2363
|
+
}, ref) => {
|
|
2355
2364
|
const trulyDisabled = loading || disabled;
|
|
2356
2365
|
const asComponent = href ? "a" : "button";
|
|
2357
|
-
const classes = button({
|
|
2366
|
+
const classes = button({
|
|
2367
|
+
appearance,
|
|
2368
|
+
size,
|
|
2369
|
+
iconBefore: Boolean(iconBefore),
|
|
2370
|
+
iconAfter: Boolean(iconAfter)
|
|
2371
|
+
});
|
|
2358
2372
|
return (
|
|
2359
2373
|
// @ts-expect-error - Polymorphic type inference issue
|
|
2360
2374
|
/* @__PURE__ */ jsx(
|
|
@@ -2374,7 +2388,18 @@ const Button = React.forwardRef(
|
|
|
2374
2388
|
children,
|
|
2375
2389
|
iconAfter && /* @__PURE__ */ jsx(Icon, { name: iconAfter, className: classes.icon })
|
|
2376
2390
|
] }),
|
|
2377
|
-
loading && /* @__PURE__ */ jsx(
|
|
2391
|
+
loading && /* @__PURE__ */ jsx(
|
|
2392
|
+
Grid,
|
|
2393
|
+
{
|
|
2394
|
+
position: "absolute",
|
|
2395
|
+
top: "0",
|
|
2396
|
+
left: "0",
|
|
2397
|
+
right: "0",
|
|
2398
|
+
bottom: "0",
|
|
2399
|
+
placeItems: "center",
|
|
2400
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
2401
|
+
}
|
|
2402
|
+
)
|
|
2378
2403
|
] })
|
|
2379
2404
|
}
|
|
2380
2405
|
)
|
|
@@ -2399,7 +2424,16 @@ const Badge = React.forwardRef(
|
|
|
2399
2424
|
}
|
|
2400
2425
|
);
|
|
2401
2426
|
const IconButton = React.forwardRef(
|
|
2402
|
-
({
|
|
2427
|
+
({
|
|
2428
|
+
appearance,
|
|
2429
|
+
size,
|
|
2430
|
+
href,
|
|
2431
|
+
className,
|
|
2432
|
+
loading,
|
|
2433
|
+
disabled,
|
|
2434
|
+
iconName,
|
|
2435
|
+
...props
|
|
2436
|
+
}, ref) => {
|
|
2403
2437
|
const trulyDisabled = loading || disabled;
|
|
2404
2438
|
const asComponent = href ? "a" : "button";
|
|
2405
2439
|
const classes = iconButton({ appearance, size });
|
|
@@ -2418,7 +2452,18 @@ const IconButton = React.forwardRef(
|
|
|
2418
2452
|
...props,
|
|
2419
2453
|
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2420
2454
|
/* @__PURE__ */ jsx(HStack, { gap: "2", opacity: loading ? 0 : 1, children: /* @__PURE__ */ jsx(Icon, { name: iconName || "menu", className: classes.icon }) }),
|
|
2421
|
-
loading && /* @__PURE__ */ jsx(
|
|
2455
|
+
loading && /* @__PURE__ */ jsx(
|
|
2456
|
+
Grid,
|
|
2457
|
+
{
|
|
2458
|
+
position: "absolute",
|
|
2459
|
+
top: "0",
|
|
2460
|
+
left: "0",
|
|
2461
|
+
right: "0",
|
|
2462
|
+
bottom: "0",
|
|
2463
|
+
placeItems: "center",
|
|
2464
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
2465
|
+
}
|
|
2466
|
+
)
|
|
2422
2467
|
] })
|
|
2423
2468
|
}
|
|
2424
2469
|
)
|