banhaten-ui 1.0.2 → 1.0.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/components/Button/Button.d.ts +3 -0
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.es.css +2 -2
- package/dist/index.es.css.map +1 -1
- package/dist/index.es.js +109 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +108 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/readme.md +68 -0
package/dist/index.js
CHANGED
|
@@ -1575,6 +1575,109 @@ const cva = (base, config)=>{
|
|
|
1575
1575
|
};
|
|
1576
1576
|
};
|
|
1577
1577
|
|
|
1578
|
+
/**
|
|
1579
|
+
* @license lucide-react v0.453.0 - ISC
|
|
1580
|
+
*
|
|
1581
|
+
* This source code is licensed under the ISC license.
|
|
1582
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1583
|
+
*/
|
|
1584
|
+
|
|
1585
|
+
const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1586
|
+
const mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
1587
|
+
return Boolean(className) && array.indexOf(className) === index;
|
|
1588
|
+
}).join(" ");
|
|
1589
|
+
|
|
1590
|
+
/**
|
|
1591
|
+
* @license lucide-react v0.453.0 - ISC
|
|
1592
|
+
*
|
|
1593
|
+
* This source code is licensed under the ISC license.
|
|
1594
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1595
|
+
*/
|
|
1596
|
+
|
|
1597
|
+
var defaultAttributes = {
|
|
1598
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1599
|
+
width: 24,
|
|
1600
|
+
height: 24,
|
|
1601
|
+
viewBox: "0 0 24 24",
|
|
1602
|
+
fill: "none",
|
|
1603
|
+
stroke: "currentColor",
|
|
1604
|
+
strokeWidth: 2,
|
|
1605
|
+
strokeLinecap: "round",
|
|
1606
|
+
strokeLinejoin: "round"
|
|
1607
|
+
};
|
|
1608
|
+
|
|
1609
|
+
/**
|
|
1610
|
+
* @license lucide-react v0.453.0 - ISC
|
|
1611
|
+
*
|
|
1612
|
+
* This source code is licensed under the ISC license.
|
|
1613
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1614
|
+
*/
|
|
1615
|
+
|
|
1616
|
+
|
|
1617
|
+
const Icon = React.forwardRef(
|
|
1618
|
+
({
|
|
1619
|
+
color = "currentColor",
|
|
1620
|
+
size = 24,
|
|
1621
|
+
strokeWidth = 2,
|
|
1622
|
+
absoluteStrokeWidth,
|
|
1623
|
+
className = "",
|
|
1624
|
+
children,
|
|
1625
|
+
iconNode,
|
|
1626
|
+
...rest
|
|
1627
|
+
}, ref) => {
|
|
1628
|
+
return React.createElement(
|
|
1629
|
+
"svg",
|
|
1630
|
+
{
|
|
1631
|
+
ref,
|
|
1632
|
+
...defaultAttributes,
|
|
1633
|
+
width: size,
|
|
1634
|
+
height: size,
|
|
1635
|
+
stroke: color,
|
|
1636
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
1637
|
+
className: mergeClasses("lucide", className),
|
|
1638
|
+
...rest
|
|
1639
|
+
},
|
|
1640
|
+
[
|
|
1641
|
+
...iconNode.map(([tag, attrs]) => React.createElement(tag, attrs)),
|
|
1642
|
+
...Array.isArray(children) ? children : [children]
|
|
1643
|
+
]
|
|
1644
|
+
);
|
|
1645
|
+
}
|
|
1646
|
+
);
|
|
1647
|
+
|
|
1648
|
+
/**
|
|
1649
|
+
* @license lucide-react v0.453.0 - ISC
|
|
1650
|
+
*
|
|
1651
|
+
* This source code is licensed under the ISC license.
|
|
1652
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1653
|
+
*/
|
|
1654
|
+
|
|
1655
|
+
|
|
1656
|
+
const createLucideIcon = (iconName, iconNode) => {
|
|
1657
|
+
const Component = React.forwardRef(
|
|
1658
|
+
({ className, ...props }, ref) => React.createElement(Icon, {
|
|
1659
|
+
ref,
|
|
1660
|
+
iconNode,
|
|
1661
|
+
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
|
1662
|
+
...props
|
|
1663
|
+
})
|
|
1664
|
+
);
|
|
1665
|
+
Component.displayName = `${iconName}`;
|
|
1666
|
+
return Component;
|
|
1667
|
+
};
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* @license lucide-react v0.453.0 - ISC
|
|
1671
|
+
*
|
|
1672
|
+
* This source code is licensed under the ISC license.
|
|
1673
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1674
|
+
*/
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
const LoaderCircle = createLucideIcon("LoaderCircle", [
|
|
1678
|
+
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
1679
|
+
]);
|
|
1680
|
+
|
|
1578
1681
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
1579
1682
|
|
|
1580
1683
|
const CLASS_PART_SEPARATOR = '-';
|
|
@@ -4093,6 +4196,9 @@ var buttonVariants = cva("inline-flex items-center justify-center whitespace-now
|
|
|
4093
4196
|
lg: "h-11 rounded-md px-8",
|
|
4094
4197
|
icon: "h-10 w-10",
|
|
4095
4198
|
},
|
|
4199
|
+
fullWidth: {
|
|
4200
|
+
true: "w-full",
|
|
4201
|
+
},
|
|
4096
4202
|
},
|
|
4097
4203
|
defaultVariants: {
|
|
4098
4204
|
variant: "default",
|
|
@@ -4100,9 +4206,9 @@ var buttonVariants = cva("inline-flex items-center justify-center whitespace-now
|
|
|
4100
4206
|
},
|
|
4101
4207
|
});
|
|
4102
4208
|
var Button = React__namespace.forwardRef(function (_a, ref) {
|
|
4103
|
-
var className = _a.className, variant = _a.variant, size = _a.size, _b = _a.asChild, asChild = _b === void 0 ? false : _b, props = __rest(_a, ["className", "variant", "size", "asChild"]);
|
|
4209
|
+
var className = _a.className, variant = _a.variant, size = _a.size, fullWidth = _a.fullWidth, _b = _a.asChild, asChild = _b === void 0 ? false : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, icon = _a.icon, children = _a.children, props = __rest(_a, ["className", "variant", "size", "fullWidth", "asChild", "loading", "icon", "children"]);
|
|
4104
4210
|
var Comp = asChild ? Slot : "button";
|
|
4105
|
-
return (jsxRuntimeExports.
|
|
4211
|
+
return (jsxRuntimeExports.jsxs(Comp, __assign({ className: cn(buttonVariants({ variant: variant, size: size, fullWidth: fullWidth, className: className })), ref: ref, disabled: props.disabled || loading }, props, { children: [loading ? (jsxRuntimeExports.jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" })) : icon ? (jsxRuntimeExports.jsx("span", { className: "mr-2", children: icon })) : null, children] })));
|
|
4106
4212
|
});
|
|
4107
4213
|
Button.displayName = "Button";
|
|
4108
4214
|
|