@dfx.swiss/react-components 1.2.0-beta.34 → 1.2.0-beta.35
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/stories/CopyButton.d.ts +3 -1
- package/dist/stories/CopyButton.d.ts.map +1 -1
- package/dist/stories/CopyButton.js +2 -2
- package/dist/stories/CopyButton.js.map +1 -1
- package/dist/stories/StyledTextBox.d.ts +2 -1
- package/dist/stories/StyledTextBox.d.ts.map +1 -1
- package/dist/stories/StyledTextBox.js +4 -3
- package/dist/stories/StyledTextBox.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { IconColor } from './DfxIcon';
|
|
2
3
|
interface CopyButtonProps {
|
|
3
4
|
onCopy: () => void;
|
|
4
5
|
inline?: boolean;
|
|
6
|
+
color?: IconColor;
|
|
5
7
|
}
|
|
6
|
-
export declare function CopyButton({ onCopy, inline }: CopyButtonProps): JSX.Element;
|
|
8
|
+
export declare function CopyButton({ onCopy, inline, color }: CopyButtonProps): JSX.Element;
|
|
7
9
|
export {};
|
|
8
10
|
//# sourceMappingURL=CopyButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../src/stories/CopyButton.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../src/stories/CopyButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAe,MAAM,WAAW,CAAC;AAGnD,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAgBlF"}
|
|
@@ -3,7 +3,7 @@ import { useState } from 'react';
|
|
|
3
3
|
import { IconVariant } from './DfxIcon';
|
|
4
4
|
import StyledIconButton from './StyledIconButton';
|
|
5
5
|
export function CopyButton(_a) {
|
|
6
|
-
var onCopy = _a.onCopy, inline = _a.inline;
|
|
6
|
+
var onCopy = _a.onCopy, inline = _a.inline, color = _a.color;
|
|
7
7
|
var _b = useState(false), showsCheckmark = _b[0], setShowsCheckmark = _b[1];
|
|
8
8
|
return (_jsx(StyledIconButton, { icon: showsCheckmark ? IconVariant.CHECK : IconVariant.COPY, onClick: function () {
|
|
9
9
|
onCopy();
|
|
@@ -11,6 +11,6 @@ export function CopyButton(_a) {
|
|
|
11
11
|
setTimeout(function () {
|
|
12
12
|
setShowsCheckmark(false);
|
|
13
13
|
}, 1000);
|
|
14
|
-
}, inline: inline }));
|
|
14
|
+
}, inline: inline, color: color }));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=CopyButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyButton.js","sourceRoot":"","sources":["../../src/stories/CopyButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"CopyButton.js","sourceRoot":"","sources":["../../src/stories/CopyButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAa,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAQlD,MAAM,UAAU,UAAU,CAAC,EAA0C;QAAxC,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,KAAK,WAAA;IAC1C,IAAA,KAAsC,QAAQ,CAAC,KAAK,CAAC,EAApD,cAAc,QAAA,EAAE,iBAAiB,QAAmB,CAAC;IAC5D,OAAO,CACL,KAAC,gBAAgB,IACf,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAC3D,OAAO,EAAE;YACP,MAAM,EAAE,CAAC;YACT,iBAAiB,CAAC,IAAI,CAAC,CAAC;YACxB,UAAU,CAAC;gBACT,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,EAAE,IAAI,CAAC,CAAC;QACX,CAAC,EACD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -4,7 +4,8 @@ interface StyledTextBoxProps {
|
|
|
4
4
|
text: string;
|
|
5
5
|
label?: string;
|
|
6
6
|
smallLabel?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
7
8
|
}
|
|
8
|
-
declare const StyledTextBox: ({ darkTheme, full, text, label, smallLabel }: StyledTextBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const StyledTextBox: ({ darkTheme, full, text, label, smallLabel, loading, }: StyledTextBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default StyledTextBox;
|
|
10
11
|
//# sourceMappingURL=StyledTextBox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledTextBox.d.ts","sourceRoot":"","sources":["../../src/stories/StyledTextBox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StyledTextBox.d.ts","sourceRoot":"","sources":["../../src/stories/StyledTextBox.tsx"],"names":[],"mappings":"AAGA,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,aAAa,2DAOhB,kBAAkB,4CAqCpB,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -10,16 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import StyledLoadingSpinner from './StyledLoadingSpinner';
|
|
13
14
|
import StyledVerticalStack from './layout-helpers/StyledVerticalStack';
|
|
14
15
|
var StyledTextBox = function (_a) {
|
|
15
|
-
var _b = _a.darkTheme, darkTheme = _b === void 0 ? false : _b, _c = _a.full, full = _c === void 0 ? false : _c, text = _a.text, label = _a.label, smallLabel = _a.smallLabel;
|
|
16
|
+
var _b = _a.darkTheme, darkTheme = _b === void 0 ? false : _b, _c = _a.full, full = _c === void 0 ? false : _c, text = _a.text, label = _a.label, smallLabel = _a.smallLabel, _d = _a.loading, loading = _d === void 0 ? false : _d;
|
|
16
17
|
var textColor = darkTheme ? 'text-white' : 'text-dfxBlue-800';
|
|
17
18
|
var backgroundColor = darkTheme ? 'bg-white bg-opacity-5' : 'bg-white';
|
|
18
19
|
var placeholderColor = darkTheme ? 'placeholder:text-dfxGray-800' : 'placeholder:text-dfxGray-600';
|
|
19
20
|
var borderColor = darkTheme ? 'border-none' : 'border border-dfxGray-500';
|
|
20
21
|
var outlineColor = darkTheme ? 'outline-none' : 'outline-2 outline-dfxBlue-400';
|
|
21
|
-
return (_jsxs(StyledVerticalStack, __assign({ gap: 1, full: full }, { children: [label && (_jsx("label", __assign({ className: "text-start ".concat(smallLabel ? 'text-sm' : 'text-base', " font-semibold pl-3 pl- ") + [textColor].join(' ') }, { children: label }))),
|
|
22
|
-
[textColor, backgroundColor, placeholderColor, borderColor, outlineColor].join(' ') }, { children: _jsx("div", __assign({ className: "p-4 w-full ".concat(textColor) }, { children: _jsx("div", __assign({ className: "flex-1 whitespace-pre" }, { children: text })) })) }))] })));
|
|
22
|
+
return (_jsxs(StyledVerticalStack, __assign({ gap: 1, full: full }, { children: [label && (_jsx("label", __assign({ className: "text-start ".concat(smallLabel ? 'text-sm' : 'text-base', " font-semibold pl-3 pl- ") + [textColor].join(' ') }, { children: label }))), _jsxs("div", __assign({ className: " relative text-base font-normal rounded-md w-full " +
|
|
23
|
+
[textColor, backgroundColor, placeholderColor, borderColor, outlineColor].join(' ') }, { children: [loading && (_jsx("div", __assign({ className: "absolute right-3 h-w-8 flex justify-center items-center h-[3.6rem]" }, { children: _jsx(StyledLoadingSpinner, {}) }))), _jsx("div", __assign({ className: "p-4 w-full ".concat(textColor) }, { children: _jsx("div", __assign({ className: "flex-1 whitespace-pre" }, { children: text })) }))] }))] })));
|
|
23
24
|
};
|
|
24
25
|
export default StyledTextBox;
|
|
25
26
|
//# sourceMappingURL=StyledTextBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledTextBox.js","sourceRoot":"","sources":["../../src/stories/StyledTextBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"StyledTextBox.js","sourceRoot":"","sources":["../../src/stories/StyledTextBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;AAWvE,IAAM,aAAa,GAAG,UAAC,EAOF;QANnB,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA,EACjB,YAAY,EAAZ,IAAI,mBAAG,KAAK,KAAA,EACZ,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;IAEf,IAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAChE,IAAM,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,UAAU,CAAC;IACzE,IAAM,gBAAgB,GAAG,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,8BAA8B,CAAC;IACrG,IAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,2BAA2B,CAAC;IAC5E,IAAM,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,+BAA+B,CAAC;IAElF,OAAO,CACL,MAAC,mBAAmB,aAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,iBACpC,KAAK,IAAI,CACR,yBACE,SAAS,EACP,qBAAc,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,6BAA0B,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAGrG,KAAK,IACA,CACT,EAED,wBACE,SAAS,EACP,oDAAoD;oBACpD,CAAC,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,iBAGpF,OAAO,IAAI,CACV,uBAAK,SAAS,EAAC,oEAAoE,gBACjF,KAAC,oBAAoB,KAAG,IACpB,CACP,EAED,uBAAK,SAAS,EAAE,qBAAc,SAAS,CAAE,gBACvC,uBAAK,SAAS,EAAC,uBAAuB,gBAAE,IAAI,IAAO,IAC/C,KACF,KACc,CACvB,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@dfx.swiss/react-components",
|
|
4
|
-
"version": "1.2.0-beta.
|
|
4
|
+
"version": "1.2.0-beta.35",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"tailwindcss": "^3.2.4",
|
|
89
89
|
"webpack": "^5.75.0"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "edb640f71da8c5c2d413a412850dae99354b20c5"
|
|
92
92
|
}
|