@radui/ui 0.0.10 → 0.0.11

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.
@@ -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
+ import t,{useState as e}from"react";function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,l,a,i=[],c=!0,u=!1;try{if(l=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=l.call(r)).done)&&(i.push(n.value),i.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(t,e)||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 n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=function(n){var o=n.items,l=r(e(null),2),a=l[0],i=l[1];return t.createElement("div",null,o.map((function(e,r){return t.createElement("div",{key:r},t.createElement("button",{onClick:function(){return function(t){i(a===t?null:t)}(r)},"aria-expanded":a===r,"aria-controls":"content-".concat(r)},e.title),t.createElement("div",{id:"content-".concat(r),role:"region","aria-labelledby":"section-".concat(r),hidden:a!==r},t.createElement("p",null,e.content)))})))};export{o as default};
@@ -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
+ 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};
@@ -1 +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,CAuB3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
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"}
@@ -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
+ 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
+ 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
+ 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};
@@ -1,95 +1 @@
1
- 'use client';
2
- function _extends() {
3
- _extends = Object.assign ? Object.assign.bind() : function (target) {
4
- for (var i = 1; i < arguments.length; i++) {
5
- var source = arguments[i];
6
- for (var key in source) {
7
- if (Object.prototype.hasOwnProperty.call(source, key)) {
8
- target[key] = source[key];
9
- }
10
- }
11
- }
12
- return target;
13
- };
14
- return _extends.apply(this, arguments);
15
- }
16
- function _objectWithoutPropertiesLoose(source, excluded) {
17
- if (source == null) return {};
18
- var target = {};
19
- var sourceKeys = Object.keys(source);
20
- var key, i;
21
- for (i = 0; i < sourceKeys.length; i++) {
22
- key = sourceKeys[i];
23
- if (excluded.indexOf(key) >= 0) continue;
24
- target[key] = source[key];
25
- }
26
- return target;
27
- }
28
- function _objectWithoutProperties(source, excluded) {
29
- if (source == null) return {};
30
- var target = _objectWithoutPropertiesLoose(source, excluded);
31
- var key, i;
32
- if (Object.getOwnPropertySymbols) {
33
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
34
- for (i = 0; i < sourceSymbolKeys.length; i++) {
35
- key = sourceSymbolKeys[i];
36
- if (excluded.indexOf(key) >= 0) continue;
37
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
38
- target[key] = source[key];
39
- }
40
- }
41
- return target;
42
- }
43
-
44
- var RAD_UI_CLASS_PREFIX = 'rad-ui';
45
- var customClassSwitcher = function customClassSwitcher(customRootClass) {
46
- var componentName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
47
- // applies a custom root class the user provides, else applies the default rad-ui classes to the component
48
- // rad ui's classes are based on this logic
49
-
50
- // add dashes between capitalized words
51
- var componentClassName = componentName.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
52
- if (customRootClass) return customRootClass;
53
- if (componentName) return "".concat(RAD_UI_CLASS_PREFIX, "-").concat(componentClassName);
54
- return '';
55
- };
56
-
57
- var _excluded = ["children", "className", "color", "customRootClass"];
58
- var COMPONENT_NAME = 'Callout';
59
- var InfoIcon = function InfoIcon() {
60
- return /*#__PURE__*/React.createElement("svg", {
61
- width: "18",
62
- height: "18",
63
- viewBox: "0 0 15 15",
64
- fill: "none",
65
- xmlns: "http://www.w3.org/2000/svg"
66
- }, /*#__PURE__*/React.createElement("path", {
67
- d: "M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",
68
- fill: "currentColor",
69
- "fill-rule": "evenodd",
70
- "clip-rule": "evenodd"
71
- }));
72
- };
73
- var Callout = function Callout(_ref) {
74
- var children = _ref.children,
75
- _ref$className = _ref.className,
76
- className = _ref$className === void 0 ? '' : _ref$className,
77
- _ref$color = _ref.color,
78
- color = _ref$color === void 0 ? undefined : _ref$color,
79
- _ref$customRootClass = _ref.customRootClass,
80
- customRootClass = _ref$customRootClass === void 0 ? '' : _ref$customRootClass,
81
- restOfTheProps = _objectWithoutProperties(_ref, _excluded);
82
- var rootClass = customClassSwitcher(customRootClass, COMPONENT_NAME);
83
- if (color) {
84
- restOfTheProps['data-accent-color'] = color;
85
- }
86
-
87
- // TODO: if children is a string then wrap it in a Text component, else return the children as is - need to add this to core logic helpers
88
-
89
- return /*#__PURE__*/React.createElement("div", _extends({
90
- className: "".concat(rootClass, " ").concat(className)
91
- }, restOfTheProps), /*#__PURE__*/React.createElement(InfoIcon, null), " ", children);
92
- };
93
- Callout.displayName = COMPONENT_NAME;
94
-
95
- export { Callout as default };
1
+ function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.apply(this,arguments)}function t(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var r=["children","className","color","customRootClass"],n="Callout",o=function(){return React.createElement("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"}))},a=function(a){var l=a.children,c=a.className,i=void 0===c?"":c,s=a.color,u=void 0===s?void 0:s,d=a.customRootClass,f=void 0===d?"":d,v=t(a,r),C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?"".concat("rad-ui","-").concat(r):"")}(f,n);return u&&(v["data-accent-color"]=u),React.createElement("div",e({className:"".concat(C," ").concat(i)},v),React.createElement(o,null)," ",l)};a.displayName=n;export{a as default};
@@ -1,11 +1 @@
1
- 'use client';
2
- import React from 'react';
3
-
4
- var Code = function Code(_ref) {
5
- var children = _ref.children;
6
- return /*#__PURE__*/React.createElement("code", {
7
- className: "rui-code-root"
8
- }, children);
9
- };
10
-
11
- export { Code as default };
1
+ import e from"react";var r=function(r){var t=r.children;return e.createElement("code",{className:"rui-code-root"},t)};export{r as default};