@radui/ui 0.0.10 → 0.0.12
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/Accordion/shards/AccordionContent.d.ts +10 -0
- package/dist/components/Accordion/shards/AccordionContent.d.ts.map +1 -0
- package/dist/components/Accordion/shards/AccordionHeader.d.ts +8 -0
- package/dist/components/Accordion/shards/AccordionHeader.d.ts.map +1 -0
- package/dist/components/Accordion/shards/AccordionItem.d.ts +9 -0
- package/dist/components/Accordion/shards/AccordionItem.d.ts.map +1 -0
- package/dist/components/Accordion/shards/AccordionRoot.d.ts +8 -0
- package/dist/components/Accordion/shards/AccordionRoot.d.ts.map +1 -0
- package/dist/components/Accordion/shards/AccordionTrigger.d.ts +11 -0
- package/dist/components/Accordion/shards/AccordionTrigger.d.ts.map +1 -0
- package/dist/components/Accordion.js +1 -81
- package/dist/components/Avatar/shards/AvatarFallback.d.ts.map +1 -0
- package/dist/components/Avatar/shards/AvatarImage.d.ts.map +1 -0
- package/dist/components/Avatar/shards/AvatarRoot.d.ts.map +1 -0
- package/dist/components/Avatar.js +1 -165
- package/dist/components/Badge.js +1 -80
- package/dist/components/BlockQuote.js +1 -75
- package/dist/components/Button.js +1 -69
- package/dist/components/Callout.js +1 -95
- package/dist/components/Code.js +1 -11
- package/dist/components/Dropdown.js +1 -1809
- package/dist/components/Em.js +1 -75
- package/dist/components/Heading.js +1 -80
- package/dist/components/Kbd.js +1 -74
- package/dist/components/Link.js +1 -81
- package/dist/components/Quote.js +1 -75
- package/dist/components/Separator.js +1 -33
- package/dist/components/Strong.js +1 -7
- package/dist/components/Tabs.js +1 -231
- package/dist/components/Text.js +1 -80
- package/dist/components/TextArea.js +1 -9
- package/dist/components/Tooltip.js +1 -58
- package/package.json +14 -3
- package/dist/components/AvatarFallback.d.ts.map +0 -1
- package/dist/components/AvatarImage.d.ts.map +0 -1
- package/dist/components/AvatarRoot.d.ts.map +0 -1
- /package/dist/components/{AvatarFallback.d.ts → Avatar/shards/AvatarFallback.d.ts} +0 -0
- /package/dist/components/{AvatarImage.d.ts → Avatar/shards/AvatarImage.d.ts} +0 -0
- /package/dist/components/{AvatarRoot.d.ts → Avatar/shards/AvatarRoot.d.ts} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AccordionContentProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
index: number;
|
|
5
|
+
activeIndex: number;
|
|
6
|
+
customRootClass: string;
|
|
7
|
+
};
|
|
8
|
+
declare const AccordionContent: React.FC<AccordionContentProps>;
|
|
9
|
+
export default AccordionContent;
|
|
10
|
+
//# sourceMappingURL=AccordionContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionContent.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Accordion/shards/AccordionContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACtB,eAAe,EAAC,MAAM,CAAA;CACvB,CAAC;AAEF,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAerD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface AccordionHeaderProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
customHeaderClass?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const AccordionHeader: React.FC<AccordionHeaderProps>;
|
|
7
|
+
export default AccordionHeader;
|
|
8
|
+
//# sourceMappingURL=AccordionHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionHeader.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Accordion/shards/AccordionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,oBAAoB;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAOnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface AccordionItemProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
customItemClass?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
declare const AccordionItem: React.FC<AccordionItemProps>;
|
|
8
|
+
export default AccordionItem;
|
|
9
|
+
//# sourceMappingURL=AccordionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Accordion/shards/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,kBAAkB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAO/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionRoot.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Accordion/shards/AccordionRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,kBAAkB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAO/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AccordionTriggerProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
customRootClass: string;
|
|
5
|
+
index: number;
|
|
6
|
+
activeIndex: number;
|
|
7
|
+
handleClick: (index: number) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const AccordionTrigger: React.FC<AccordionTriggerProps>;
|
|
10
|
+
export default AccordionTrigger;
|
|
11
|
+
//# sourceMappingURL=AccordionTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Accordion/shards/AccordionTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,EAAC,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC,CAAC;AAEF,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAerD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,81 +1 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
|
|
4
|
-
function _iterableToArrayLimit(r, l) {
|
|
5
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
6
|
-
if (null != t) {
|
|
7
|
-
var e,
|
|
8
|
-
n,
|
|
9
|
-
i,
|
|
10
|
-
u,
|
|
11
|
-
a = [],
|
|
12
|
-
f = !0,
|
|
13
|
-
o = !1;
|
|
14
|
-
try {
|
|
15
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
16
|
-
if (Object(t) !== t) return;
|
|
17
|
-
f = !1;
|
|
18
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
19
|
-
} catch (r) {
|
|
20
|
-
o = !0, n = r;
|
|
21
|
-
} finally {
|
|
22
|
-
try {
|
|
23
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
24
|
-
} finally {
|
|
25
|
-
if (o) throw n;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return a;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function _slicedToArray(arr, i) {
|
|
32
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
33
|
-
}
|
|
34
|
-
function _arrayWithHoles(arr) {
|
|
35
|
-
if (Array.isArray(arr)) return arr;
|
|
36
|
-
}
|
|
37
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
38
|
-
if (!o) return;
|
|
39
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
40
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
41
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
42
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
43
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
44
|
-
}
|
|
45
|
-
function _arrayLikeToArray(arr, len) {
|
|
46
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
47
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
48
|
-
return arr2;
|
|
49
|
-
}
|
|
50
|
-
function _nonIterableRest() {
|
|
51
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var Accordion = function Accordion(_ref) {
|
|
55
|
-
var items = _ref.items;
|
|
56
|
-
var _useState = useState(null),
|
|
57
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
-
activeIndex = _useState2[0],
|
|
59
|
-
setActiveIndex = _useState2[1];
|
|
60
|
-
var handleClick = function handleClick(index) {
|
|
61
|
-
setActiveIndex(activeIndex === index ? null : index);
|
|
62
|
-
};
|
|
63
|
-
return /*#__PURE__*/React.createElement("div", null, items.map(function (item, index) {
|
|
64
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
65
|
-
key: index
|
|
66
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
67
|
-
onClick: function onClick() {
|
|
68
|
-
return handleClick(index);
|
|
69
|
-
},
|
|
70
|
-
"aria-expanded": activeIndex === index,
|
|
71
|
-
"aria-controls": "content-".concat(index)
|
|
72
|
-
}, item.title), /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
id: "content-".concat(index),
|
|
74
|
-
role: "region",
|
|
75
|
-
"aria-labelledby": "section-".concat(index),
|
|
76
|
-
hidden: activeIndex !== index
|
|
77
|
-
}, /*#__PURE__*/React.createElement("p", null, item.content)));
|
|
78
|
-
}));
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export { Accordion as default };
|
|
1
|
+
'use client';import e,{useState as t}from"react";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,c,o,i=[],l=!0,u=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=c.call(n)).done)&&(i.push(r.value),i.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?"".concat("rad-ui","-").concat(n):"")},c=function(t){var n=t.children,r=t.customRootClass,c=a(void 0===r?"":r,"Accordion");return e.createElement("span",{className:"".concat(c,"-root")},n)},o=function(t){var n=t.children;t.value;var r=t.customItemClass,c=a(void 0===r?"":r,"Accordion");return e.createElement("div",{className:"".concat(c,"-item")},n)},i=function(t){var n=t.children,r=t.customHeaderClass,c=a(void 0===r?"":r,"Accordion");return e.createElement("div",{className:"".concat(c,"-header")},n)},l=function(t){var n=t.children,r=t.handleClick,c=t.index,o=t.activeIndex,i=t.customRootClass,l=a(void 0===i?"":i,"Accordion");return e.createElement("span",{className:"".concat(l,"-trigger")},e.createElement("button",{onClick:function(){return r(c)},"aria-expanded":o===c,"aria-controls":"content-".concat(c)},n))},u=function(t){var n=t.children,r=t.index,c=t.activeIndex,o=t.customRootClass,i=a(void 0===o?"":o,"Accordion");return e.createElement("span",{className:"".concat(i,"-content")},e.createElement("div",{id:"content-".concat(r),role:"region","aria-labelledby":"section-".concat(r),hidden:c!==r},n))},d=function(r){var a=r.items,d=n(t(null),2),s=d[0],m=d[1],f=function(e){m(s===e?null:e)};return e.createElement(c,null,a.map((function(t,n){return e.createElement(o,{value:n},e.createElement(i,null,e.createElement(l,{handleClick:f,index:n,activeIndex:s},"Item ",n+1)),e.createElement(u,{index:n,activeIndex:s},t.content))})))};d.Root=c;export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarFallback.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Avatar/shards/AvatarFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,mBAAmB,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAOjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarImage.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Avatar/shards/AvatarImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,KAAK,gBAAgB,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAyB3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarRoot.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Avatar/shards/AvatarRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,EAAC,MAAM,CAAA;CACvB,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAOnC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,165 +1 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React, { useState, useEffect } from 'react';
|
|
3
|
-
|
|
4
|
-
function _extends() {
|
|
5
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
6
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
7
|
-
var source = arguments[i];
|
|
8
|
-
for (var key in source) {
|
|
9
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10
|
-
target[key] = source[key];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
return _extends.apply(this, arguments);
|
|
17
|
-
}
|
|
18
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
19
|
-
if (source == null) return {};
|
|
20
|
-
var target = {};
|
|
21
|
-
var sourceKeys = Object.keys(source);
|
|
22
|
-
var key, i;
|
|
23
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
24
|
-
key = sourceKeys[i];
|
|
25
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
26
|
-
target[key] = source[key];
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
}
|
|
30
|
-
function _objectWithoutProperties(source, excluded) {
|
|
31
|
-
if (source == null) return {};
|
|
32
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
33
|
-
var key, i;
|
|
34
|
-
if (Object.getOwnPropertySymbols) {
|
|
35
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
36
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
37
|
-
key = sourceSymbolKeys[i];
|
|
38
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
39
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
40
|
-
target[key] = source[key];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return target;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var RAD_UI_CLASS_PREFIX = 'rad-ui';
|
|
47
|
-
var customClassSwitcher = function customClassSwitcher(customRootClass) {
|
|
48
|
-
var componentName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
49
|
-
// applies a custom root class the user provides, else applies the default rad-ui classes to the component
|
|
50
|
-
// rad ui's classes are based on this logic
|
|
51
|
-
|
|
52
|
-
// add dashes between capitalized words
|
|
53
|
-
var componentClassName = componentName.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
54
|
-
if (customRootClass) return customRootClass;
|
|
55
|
-
if (componentName) return "".concat(RAD_UI_CLASS_PREFIX, "-").concat(componentClassName);
|
|
56
|
-
return '';
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
var Root = function (_a) {
|
|
60
|
-
var children = _a.children, _b = _a.customRootClass, customRootClass = _b === void 0 ? '' : _b;
|
|
61
|
-
var rootClass = customClassSwitcher(customRootClass, 'Avatar');
|
|
62
|
-
return (React.createElement("span", { className: "".concat(rootClass, "-root") }, children));
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/******************************************************************************
|
|
66
|
-
Copyright (c) Microsoft Corporation.
|
|
67
|
-
|
|
68
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
69
|
-
purpose with or without fee is hereby granted.
|
|
70
|
-
|
|
71
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
72
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
73
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
74
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
75
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
76
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
77
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
78
|
-
***************************************************************************** */
|
|
79
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var __assign = function() {
|
|
83
|
-
__assign = Object.assign || function __assign(t) {
|
|
84
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
85
|
-
s = arguments[i];
|
|
86
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
87
|
-
}
|
|
88
|
-
return t;
|
|
89
|
-
};
|
|
90
|
-
return __assign.apply(this, arguments);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
function __rest(s, e) {
|
|
94
|
-
var t = {};
|
|
95
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
96
|
-
t[p] = s[p];
|
|
97
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
98
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
99
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
100
|
-
t[p[i]] = s[p[i]];
|
|
101
|
-
}
|
|
102
|
-
return t;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
106
|
-
var e = new Error(message);
|
|
107
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
var AvatarImage = function (_a) {
|
|
111
|
-
var _b = _a.src, src = _b === void 0 ? 'src' : _b, _c = _a.alt, alt = _c === void 0 ? '' : _c, _d = _a.customRootClass, customRootClass = _d === void 0 ? '' : _d, _e = _a.className, className = _e === void 0 ? '' : _e, props = __rest(_a, ["src", "alt", "customRootClass", "className"]);
|
|
112
|
-
var rootClass = customClassSwitcher(customRootClass, 'Avatar');
|
|
113
|
-
var _f = useState(false), isBrokenImage = _f[0], setIsBrokenImage = _f[1];
|
|
114
|
-
var handleImageLoaded = function () {
|
|
115
|
-
setIsBrokenImage(false);
|
|
116
|
-
};
|
|
117
|
-
var handleImageError = function () {
|
|
118
|
-
setIsBrokenImage(true);
|
|
119
|
-
};
|
|
120
|
-
useEffect(function () {
|
|
121
|
-
}, [isBrokenImage]);
|
|
122
|
-
if (isBrokenImage) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
return (React.createElement("img", __assign({ src: src, alt: alt, onError: handleImageError, onLoad: handleImageLoaded, className: "".concat(rootClass, " ").concat(className) }, props)));
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
var AvatarFallback = function (_a) {
|
|
129
|
-
var _b = _a.fallback, fallback = _b === void 0 ? '' : _b, _c = _a.customRootClass, customRootClass = _c === void 0 ? '' : _c, props = __rest(_a, ["fallback", "customRootClass"]);
|
|
130
|
-
var rootClass = customClassSwitcher(customRootClass, 'Avatar');
|
|
131
|
-
return (React.createElement("span", __assign({ className: "".concat(rootClass, "-fallback") }, props), fallback));
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
var _excluded = ["children", "customRootClass", "fallback", "className", "src", "alt"];
|
|
135
|
-
var COMPONENT_NAME = 'Avatar';
|
|
136
|
-
var Avatar = function Avatar(_ref) {
|
|
137
|
-
_ref.children;
|
|
138
|
-
var _ref$customRootClass = _ref.customRootClass,
|
|
139
|
-
customRootClass = _ref$customRootClass === void 0 ? '' : _ref$customRootClass,
|
|
140
|
-
_ref$fallback = _ref.fallback,
|
|
141
|
-
fallback = _ref$fallback === void 0 ? '' : _ref$fallback,
|
|
142
|
-
_ref$className = _ref.className,
|
|
143
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
144
|
-
_ref$src = _ref.src,
|
|
145
|
-
src = _ref$src === void 0 ? '' : _ref$src,
|
|
146
|
-
alt = _ref.alt,
|
|
147
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
148
|
-
return /*#__PURE__*/React.createElement(Root, {
|
|
149
|
-
customRootClass: customRootClass
|
|
150
|
-
}, /*#__PURE__*/React.createElement(AvatarImage, _extends({
|
|
151
|
-
src: src,
|
|
152
|
-
alt: alt,
|
|
153
|
-
className: className,
|
|
154
|
-
customRootClass: customRootClass
|
|
155
|
-
}, props)), /*#__PURE__*/React.createElement(AvatarFallback, {
|
|
156
|
-
customRootClass: customRootClass,
|
|
157
|
-
fallback: fallback
|
|
158
|
-
}));
|
|
159
|
-
};
|
|
160
|
-
Avatar.displayName = COMPONENT_NAME;
|
|
161
|
-
Avatar.Root = Root;
|
|
162
|
-
Avatar.Image = AvatarImage;
|
|
163
|
-
Avatar.Fallback = AvatarFallback;
|
|
164
|
-
|
|
165
|
-
export { Avatar as default };
|
|
1
|
+
'use client';import t,{useState as o,useEffect as e}from"react";function r(){return r=Object.assign?Object.assign.bind():function(t){for(var o=1;o<arguments.length;o++){var e=arguments[o];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},r.apply(this,arguments)}function a(t,o){if(null==t)return{};var e,r,a=function(t,o){if(null==t)return{};var e,r,a={},n=Object.keys(t);for(r=0;r<n.length;r++)e=n[r],o.indexOf(e)>=0||(a[e]=t[e]);return a}(t,o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)e=n[r],o.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(a[e]=t[e])}return a}var n=function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(o?"".concat("rad-ui","-").concat(e):"")},c=function(o){var e=o.children,r=o.customRootClass,a=n(void 0===r?"":r,"Avatar");return t.createElement("span",{className:"".concat(a,"-root")},e)},l=function(){return l=Object.assign||function(t){for(var o,e=1,r=arguments.length;e<r;e++)for(var a in o=arguments[e])Object.prototype.hasOwnProperty.call(o,a)&&(t[a]=o[a]);return t},l.apply(this,arguments)};function s(t,o){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&o.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(t);a<r.length;a++)o.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(e[r[a]]=t[r[a]])}return e}"function"==typeof SuppressedError&&SuppressedError;var i=function(r){var a=r.src,c=void 0===a?"":a,i=r.alt,u=void 0===i?"":i,f=r.customRootClass,m=void 0===f?"":f,p=r.className,v=void 0===p?"":p,b=s(r,["src","alt","customRootClass","className"]),d=n(m,"Avatar"),y=o(!1),O=y[0],g=y[1];return e((function(){}),[O]),O||!c||0===c.length?(console.log("not rendering"),t.createElement(t.Fragment,null)):(console.log(Boolean(c),c),t.createElement("img",l({src:c,alt:u,onError:function(){g(!0)},onLoad:function(){g(!1)},className:"".concat(d," ").concat(v)},b)))},u=function(o){var e=o.fallback,r=void 0===e?"":e,a=o.customRootClass,c=void 0===a?"":a,i=s(o,["fallback","customRootClass"]),u=n(c,"Avatar");return t.createElement("span",l({className:"".concat(u,"-fallback")},i),r)},f=["children","customRootClass","fallback","className","src","alt"],m=function(o){o.children;var e=o.customRootClass,n=void 0===e?"":e,l=o.fallback,s=void 0===l?"":l,m=o.className,p=void 0===m?"":m,v=o.src,b=void 0===v?"":v,d=o.alt,y=a(o,f);return t.createElement(c,{customRootClass:n},t.createElement(i,r({src:b,alt:d,className:p,customRootClass:n},y)),t.createElement(u,{customRootClass:n,fallback:s}))};m.displayName="Avatar",m.Root=c,m.Image=i,m.Fallback=u;export{m as default};
|
package/dist/components/Badge.js
CHANGED
|
@@ -1,80 +1 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
function _extends() {
|
|
5
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
6
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
7
|
-
var source = arguments[i];
|
|
8
|
-
for (var key in source) {
|
|
9
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10
|
-
target[key] = source[key];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
return _extends.apply(this, arguments);
|
|
17
|
-
}
|
|
18
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
19
|
-
if (source == null) return {};
|
|
20
|
-
var target = {};
|
|
21
|
-
var sourceKeys = Object.keys(source);
|
|
22
|
-
var key, i;
|
|
23
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
24
|
-
key = sourceKeys[i];
|
|
25
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
26
|
-
target[key] = source[key];
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
}
|
|
30
|
-
function _objectWithoutProperties(source, excluded) {
|
|
31
|
-
if (source == null) return {};
|
|
32
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
33
|
-
var key, i;
|
|
34
|
-
if (Object.getOwnPropertySymbols) {
|
|
35
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
36
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
37
|
-
key = sourceSymbolKeys[i];
|
|
38
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
39
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
40
|
-
target[key] = source[key];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return target;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var RAD_UI_CLASS_PREFIX = 'rad-ui';
|
|
47
|
-
var customClassSwitcher = function customClassSwitcher(customRootClass) {
|
|
48
|
-
var componentName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
49
|
-
// applies a custom root class the user provides, else applies the default rad-ui classes to the component
|
|
50
|
-
// rad ui's classes are based on this logic
|
|
51
|
-
|
|
52
|
-
// add dashes between capitalized words
|
|
53
|
-
var componentClassName = componentName.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
54
|
-
if (customRootClass) return customRootClass;
|
|
55
|
-
if (componentName) return "".concat(RAD_UI_CLASS_PREFIX, "-").concat(componentClassName);
|
|
56
|
-
return '';
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
var _excluded = ["children", "customRootClass", "className", "color"];
|
|
60
|
-
var COMPONENT_NAME = 'Badge';
|
|
61
|
-
var Badge = function Badge(_ref) {
|
|
62
|
-
var children = _ref.children,
|
|
63
|
-
_ref$customRootClass = _ref.customRootClass,
|
|
64
|
-
customRootClass = _ref$customRootClass === void 0 ? '' : _ref$customRootClass,
|
|
65
|
-
_ref$className = _ref.className,
|
|
66
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
67
|
-
_ref$color = _ref.color,
|
|
68
|
-
color = _ref$color === void 0 ? undefined : _ref$color,
|
|
69
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
70
|
-
var rootClass = customClassSwitcher(customRootClass, COMPONENT_NAME);
|
|
71
|
-
if (color) {
|
|
72
|
-
props['data-accent-color'] = color;
|
|
73
|
-
}
|
|
74
|
-
return /*#__PURE__*/React.createElement("span", _extends({
|
|
75
|
-
className: "".concat(rootClass, " ").concat(className)
|
|
76
|
-
}, props), children);
|
|
77
|
-
};
|
|
78
|
-
Badge.displayName = COMPONENT_NAME;
|
|
79
|
-
|
|
80
|
-
export { Badge as default };
|
|
1
|
+
'use client';import r from"react";function t(){return t=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},t.apply(this,arguments)}function e(r,t){if(null==r)return{};var e,o,n=function(r,t){if(null==r)return{};var e,o,n={},a=Object.keys(r);for(o=0;o<a.length;o++)e=a[o],t.indexOf(e)>=0||(n[e]=r[e]);return n}(r,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(o=0;o<a.length;o++)e=a[o],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(r,e)&&(n[e]=r[e])}return n}var o=["children","customRootClass","className","color"],n="Badge",a=function(a){var c=a.children,l=a.customRootClass,i=void 0===l?"":l,s=a.className,u=void 0===s?"":s,f=a.color,p=void 0===f?void 0:f,d=e(a,o),v=function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r||(t?"".concat("rad-ui","-").concat(e):"")}(i,n);return p&&(d["data-accent-color"]=p),r.createElement("span",t({className:"".concat(v," ").concat(u)},d),c)};a.displayName=n;export{a as default};
|
|
@@ -1,75 +1 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
function _extends() {
|
|
5
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
6
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
7
|
-
var source = arguments[i];
|
|
8
|
-
for (var key in source) {
|
|
9
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10
|
-
target[key] = source[key];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
return _extends.apply(this, arguments);
|
|
17
|
-
}
|
|
18
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
19
|
-
if (source == null) return {};
|
|
20
|
-
var target = {};
|
|
21
|
-
var sourceKeys = Object.keys(source);
|
|
22
|
-
var key, i;
|
|
23
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
24
|
-
key = sourceKeys[i];
|
|
25
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
26
|
-
target[key] = source[key];
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
}
|
|
30
|
-
function _objectWithoutProperties(source, excluded) {
|
|
31
|
-
if (source == null) return {};
|
|
32
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
33
|
-
var key, i;
|
|
34
|
-
if (Object.getOwnPropertySymbols) {
|
|
35
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
36
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
37
|
-
key = sourceSymbolKeys[i];
|
|
38
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
39
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
40
|
-
target[key] = source[key];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return target;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var RAD_UI_CLASS_PREFIX = 'rad-ui';
|
|
47
|
-
var customClassSwitcher = function customClassSwitcher(customRootClass) {
|
|
48
|
-
var componentName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
49
|
-
// applies a custom root class the user provides, else applies the default rad-ui classes to the component
|
|
50
|
-
// rad ui's classes are based on this logic
|
|
51
|
-
|
|
52
|
-
// add dashes between capitalized words
|
|
53
|
-
var componentClassName = componentName.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
54
|
-
if (customRootClass) return customRootClass;
|
|
55
|
-
if (componentName) return "".concat(RAD_UI_CLASS_PREFIX, "-").concat(componentClassName);
|
|
56
|
-
return '';
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
var _excluded = ["children", "customRootClass", "className"];
|
|
60
|
-
var COMPONENT_NAME = 'BlockQuote';
|
|
61
|
-
var BlockQuote = function BlockQuote(_ref) {
|
|
62
|
-
var children = _ref.children,
|
|
63
|
-
_ref$customRootClass = _ref.customRootClass,
|
|
64
|
-
customRootClass = _ref$customRootClass === void 0 ? '' : _ref$customRootClass,
|
|
65
|
-
_ref$className = _ref.className,
|
|
66
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
67
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
68
|
-
var rootClass = customClassSwitcher(customRootClass, COMPONENT_NAME);
|
|
69
|
-
return /*#__PURE__*/React.createElement("blockquote", _extends({
|
|
70
|
-
className: "".concat(rootClass, " ").concat(className)
|
|
71
|
-
}, props), children);
|
|
72
|
-
};
|
|
73
|
-
BlockQuote.displayName = COMPONENT_NAME;
|
|
74
|
-
|
|
75
|
-
export { BlockQuote as default };
|
|
1
|
+
'use client';import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},e.apply(this,arguments)}function r(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var n=["children","customRootClass","className"],o="BlockQuote",a=function(a){var c=a.children,l=a.customRootClass,s=void 0===l?"":l,i=a.className,u=void 0===i?"":i,f=r(a,n),p=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?"".concat("rad-ui","-").concat(r):"")}(s,o);return t.createElement("blockquote",e({className:"".concat(p," ").concat(u)},f),c)};a.displayName=o;export{a as default};
|
|
@@ -1,69 +1 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
function _extends() {
|
|
5
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
6
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
7
|
-
var source = arguments[i];
|
|
8
|
-
for (var key in source) {
|
|
9
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10
|
-
target[key] = source[key];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
return _extends.apply(this, arguments);
|
|
17
|
-
}
|
|
18
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
19
|
-
if (source == null) return {};
|
|
20
|
-
var target = {};
|
|
21
|
-
var sourceKeys = Object.keys(source);
|
|
22
|
-
var key, i;
|
|
23
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
24
|
-
key = sourceKeys[i];
|
|
25
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
26
|
-
target[key] = source[key];
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
}
|
|
30
|
-
function _objectWithoutProperties(source, excluded) {
|
|
31
|
-
if (source == null) return {};
|
|
32
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
33
|
-
var key, i;
|
|
34
|
-
if (Object.getOwnPropertySymbols) {
|
|
35
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
36
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
37
|
-
key = sourceSymbolKeys[i];
|
|
38
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
39
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
40
|
-
target[key] = source[key];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return target;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var _excluded = ["children", "type", "color", "className", "variant"];
|
|
47
|
-
// make the color prop default accent color
|
|
48
|
-
var Button = function Button(_ref) {
|
|
49
|
-
var children = _ref.children;
|
|
50
|
-
_ref.type;
|
|
51
|
-
var _ref$color = _ref.color,
|
|
52
|
-
color = _ref$color === void 0 ? undefined : _ref$color,
|
|
53
|
-
_ref$className = _ref.className,
|
|
54
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
55
|
-
_ref$variant = _ref.variant,
|
|
56
|
-
variant = _ref$variant === void 0 ? 'solid' : _ref$variant,
|
|
57
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
58
|
-
// apply data attribute for accent color
|
|
59
|
-
// apply attribute only if color is present
|
|
60
|
-
if (color) {
|
|
61
|
-
props['data-accent-color'] = color;
|
|
62
|
-
}
|
|
63
|
-
return /*#__PURE__*/React.createElement("button", _extends({
|
|
64
|
-
type: "button",
|
|
65
|
-
className: "rad-ui-button button-".concat(variant, " ").concat(className)
|
|
66
|
-
}, props), children);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export { Button as default };
|
|
1
|
+
'use client';import t from"react";function r(){return r=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},r.apply(this,arguments)}function e(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)e=a[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)e=a[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}var n=["children","type","color","className","variant"],o=function(o){var a=o.children;o.type;var c=o.color,i=void 0===c?void 0:c,l=o.className,u=void 0===l?"":l,s=o.variant,f=void 0===s?"solid":s,p=e(o,n);return i&&(p["data-accent-color"]=i),t.createElement("button",r({type:"button",className:"rad-ui-button button-".concat(f," ").concat(u)},p),a)};export{o as default};
|