@dxos/react-ui 0.1.5 → 0.1.6
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/LICENSE +5 -18
- package/dist/src/components/Avatar/Avatar.d.ts +1 -1
- package/dist/src/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/src/components/Avatar/Avatar.stories.d.ts +1 -1
- package/dist/src/components/Button/Button.d.ts +1 -1
- package/dist/src/components/Button/Button.d.ts.map +1 -1
- package/dist/src/components/Button/Button.stories.d.ts +1 -1
- package/dist/src/components/Button/ButtonGroup.d.ts +6 -0
- package/dist/src/components/Button/ButtonGroup.d.ts.map +1 -0
- package/dist/src/components/Button/ButtonGroup.js +16 -0
- package/dist/src/components/Button/ButtonGroup.js.map +1 -0
- package/dist/src/components/Button/index.d.ts +1 -0
- package/dist/src/components/Button/index.d.ts.map +1 -1
- package/dist/src/components/Button/index.js +1 -0
- package/dist/src/components/Button/index.js.map +1 -1
- package/dist/src/components/Heading/Heading.d.ts +0 -3
- package/dist/src/components/Heading/Heading.d.ts.map +1 -1
- package/dist/src/components/Heading/Heading.stories.d.ts +0 -3
- package/dist/src/components/Heading/Heading.stories.d.ts.map +1 -1
- package/dist/src/components/Input/BarePinInput.d.ts +0 -3
- package/dist/src/components/Input/BarePinInput.d.ts.map +1 -1
- package/dist/src/components/Input/BarePinInput.js +1 -1
- package/dist/src/components/Input/BarePinInput.js.map +1 -1
- package/dist/src/components/Input/BareTextInput.d.ts.map +1 -1
- package/dist/src/components/Input/BareTextInput.js +2 -1
- package/dist/src/components/Input/BareTextInput.js.map +1 -1
- package/dist/src/components/Input/BareTextareaInput.d.ts +5 -0
- package/dist/src/components/Input/BareTextareaInput.d.ts.map +1 -0
- package/dist/src/components/Input/BareTextareaInput.js +17 -0
- package/dist/src/components/Input/BareTextareaInput.js.map +1 -0
- package/dist/src/components/Input/Input.d.ts.map +1 -1
- package/dist/src/components/Input/Input.js +4 -2
- package/dist/src/components/Input/Input.js.map +1 -1
- package/dist/src/components/Input/InputProps.d.ts +7 -2
- package/dist/src/components/Input/InputProps.d.ts.map +1 -1
- package/dist/src/components/QrCode/QrCode.d.ts +13 -2
- package/dist/src/components/QrCode/QrCode.d.ts.map +1 -1
- package/dist/src/components/QrCode/QrCode.js +32 -4
- package/dist/src/components/QrCode/QrCode.js.map +1 -1
- package/dist/src/components/QrCode/QrCode.stories.d.ts +4 -3
- package/dist/src/components/QrCode/QrCode.stories.d.ts.map +1 -1
- package/dist/src/components/QrCode/QrCode.stories.js +14 -1
- package/dist/src/components/QrCode/QrCode.stories.js.map +1 -1
- package/dist/src/components/Tooltip/Tooltip.d.ts +2 -1
- package/dist/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/src/components/Tooltip/Tooltip.js +2 -2
- package/dist/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/src/components/Tooltip/Tooltip.stories.d.ts +1 -1
- package/dist/src/hooks/useId.d.ts +1 -0
- package/dist/src/hooks/useId.d.ts.map +1 -1
- package/dist/src/hooks/useId.js +3 -2
- package/dist/src/hooks/useId.js.map +1 -1
- package/dist/src/styles/focus.d.ts +1 -1
- package/dist/src/styles/focus.d.ts.map +1 -1
- package/dist/src/styles/focus.js +1 -1
- package/dist/src/styles/focus.js.map +1 -1
- package/dist/src/styles/group.d.ts +3 -1
- package/dist/src/styles/group.d.ts.map +1 -1
- package/dist/src/styles/group.js +2 -2
- package/dist/src/styles/group.js.map +1 -1
- package/dist/src/styles/hover.d.ts +1 -1
- package/dist/src/styles/hover.d.ts.map +1 -1
- package/dist/src/styles/hover.js +1 -1
- package/dist/src/styles/hover.js.map +1 -1
- package/dist/src/styles/shimmer.d.ts +2 -1
- package/dist/src/styles/shimmer.d.ts.map +1 -1
- package/dist/src/styles/shimmer.js +3 -2
- package/dist/src/styles/shimmer.js.map +1 -1
- package/dist/src/theme.css +3 -0
- package/package.json +4 -3
- package/plugin.d.ts +5 -0
- package/plugin.js +8 -0
- package/src/components/Button/ButtonGroup.tsx +22 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Input/BarePinInput.tsx +1 -1
- package/src/components/Input/BareTextInput.tsx +2 -1
- package/src/components/Input/BareTextareaInput.tsx +29 -0
- package/src/components/Input/Input.tsx +5 -2
- package/src/components/Input/InputProps.ts +10 -2
- package/src/components/QrCode/QrCode.stories.tsx +16 -1
- package/src/components/QrCode/QrCode.tsx +115 -5
- package/src/components/Tooltip/Tooltip.tsx +11 -2
- package/src/hooks/useId.ts +1 -1
- package/src/styles/focus.ts +1 -1
- package/src/styles/group.ts +11 -2
- package/src/styles/hover.ts +1 -1
- package/src/styles/shimmer.ts +4 -1
- package/src/theme.css +3 -0
|
@@ -29,23 +29,51 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.QrCode = void 0;
|
|
32
|
+
exports.QrCode = exports.CompactQrCode = exports.FullQrCode = void 0;
|
|
33
33
|
const classnames_1 = __importDefault(require("classnames"));
|
|
34
|
+
const phosphor_react_1 = require("phosphor-react");
|
|
34
35
|
const qrcode_react_1 = require("qrcode.react");
|
|
35
36
|
const react_1 = __importStar(require("react"));
|
|
36
37
|
const hooks_1 = require("../../hooks");
|
|
37
38
|
const styles_1 = require("../../styles");
|
|
38
39
|
const Button_1 = require("../Button");
|
|
39
40
|
const Tooltip_1 = require("../Tooltip");
|
|
40
|
-
const
|
|
41
|
+
const FullQrCode = ({ value, label, size, side, sideOffset, collisionPadding, buttonCompact = true, ...buttonProps }) => {
|
|
41
42
|
const labelId = (0, hooks_1.useId)('qr-label');
|
|
42
43
|
const copyValue = (0, react_1.useCallback)(() => {
|
|
43
44
|
void navigator.clipboard.writeText(value);
|
|
44
45
|
}, [value]);
|
|
45
46
|
return (react_1.default.createElement(Tooltip_1.Tooltip, { content: label, ...{ side, sideOffset, collisionPadding } },
|
|
46
|
-
react_1.default.createElement(Button_1.Button, { compact:
|
|
47
|
+
react_1.default.createElement(Button_1.Button, { compact: buttonCompact, ...buttonProps, className: (0, classnames_1.default)('overflow-hidden p-0', (0, styles_1.getSize)(size !== null && size !== void 0 ? size : 32), buttonProps.className), onClick: copyValue },
|
|
47
48
|
react_1.default.createElement(qrcode_react_1.QRCodeSVG, { value: value, includeMargin: true, role: 'none', className: 'w-full h-auto' }),
|
|
48
49
|
react_1.default.createElement("div", { id: labelId, className: 'sr-only' }, label))));
|
|
49
50
|
};
|
|
50
|
-
exports.
|
|
51
|
+
exports.FullQrCode = FullQrCode;
|
|
52
|
+
const CompactQrCode = ({ value, displayQrLabel, copyLabel, side, sideOffset, collisionPadding, compact, buttonCompact, ...buttonProps }) => {
|
|
53
|
+
const labelId = (0, hooks_1.useId)('qr-label');
|
|
54
|
+
const copyValue = (0, react_1.useCallback)(() => {
|
|
55
|
+
void navigator.clipboard.writeText(value);
|
|
56
|
+
}, [value]);
|
|
57
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
58
|
+
react_1.default.createElement(Button_1.ButtonGroup, { className: 'inline-flex grow md:hidden' },
|
|
59
|
+
react_1.default.createElement("span", { className: 'sr-only', id: labelId }, displayQrLabel),
|
|
60
|
+
react_1.default.createElement(Tooltip_1.Tooltip, { compact: true, content: react_1.default.createElement("div", { role: 'none', className: 'overflow-hidden rounded-md' },
|
|
61
|
+
react_1.default.createElement(qrcode_react_1.QRCodeSVG, { value: value, includeMargin: true, role: 'none', className: (0, styles_1.getSize)(32) })), ...{ side: side !== null && side !== void 0 ? side : 'left', sideOffset, collisionPadding } },
|
|
62
|
+
react_1.default.createElement(Button_1.Button, { rounding: 'rounded-is-md', compact: buttonCompact, ...buttonProps, className: (0, classnames_1.default)('border-ie-0 grow', buttonProps.className), "aria-labelledby": labelId },
|
|
63
|
+
react_1.default.createElement(phosphor_react_1.QrCode, { className: (0, styles_1.getSize)(5) }))),
|
|
64
|
+
react_1.default.createElement(Tooltip_1.Tooltip, { content: copyLabel, tooltipLabelsTrigger: true, ...{ side, sideOffset, collisionPadding } },
|
|
65
|
+
react_1.default.createElement(Button_1.Button, { rounding: 'rounded-ie-md grow', compact: buttonCompact, ...buttonProps, className: buttonProps.className, onClick: copyValue },
|
|
66
|
+
react_1.default.createElement(phosphor_react_1.CopySimple, { className: (0, styles_1.getSize)(5) })))),
|
|
67
|
+
react_1.default.createElement(Button_1.ButtonGroup, { className: 'hidden md:inline-flex' },
|
|
68
|
+
react_1.default.createElement(Tooltip_1.Tooltip, { compact: true, content: react_1.default.createElement("div", { role: 'none', className: 'overflow-hidden rounded-md' },
|
|
69
|
+
react_1.default.createElement(qrcode_react_1.QRCodeSVG, { value: value, includeMargin: true, role: 'none', className: (0, styles_1.getSize)(32) })), ...{ side: side !== null && side !== void 0 ? side : 'left', sideOffset, collisionPadding } },
|
|
70
|
+
react_1.default.createElement(Button_1.Button, { rounding: 'rounded-is-md', compact: buttonCompact, ...buttonProps, className: (0, classnames_1.default)('border-ie-0 flex gap-1', buttonProps.className) },
|
|
71
|
+
react_1.default.createElement(phosphor_react_1.QrCode, { className: (0, styles_1.getSize)(5) }),
|
|
72
|
+
displayQrLabel)),
|
|
73
|
+
react_1.default.createElement(Button_1.Button, { rounding: 'rounded-ie-md', compact: buttonCompact, ...buttonProps, className: (0, classnames_1.default)('flex gap-1', buttonProps.className), onClick: copyValue },
|
|
74
|
+
react_1.default.createElement(phosphor_react_1.CopySimple, { className: (0, styles_1.getSize)(5) }),
|
|
75
|
+
copyLabel))));
|
|
76
|
+
};
|
|
77
|
+
exports.CompactQrCode = CompactQrCode;
|
|
78
|
+
exports.QrCode = exports.FullQrCode;
|
|
51
79
|
//# sourceMappingURL=QrCode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QrCode.js","sourceRoot":"","sources":["../../../../src/components/QrCode/QrCode.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC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BAAU,IAAC,SAAS,EAAE,IAAA,gBAAO,EAAC,CAAC,CAAC,GAAI;gBACpC,SAAS,CACH,CACG,CACb,CACJ,CAAC;AACJ,CAAC,CAAC;AArFW,QAAA,aAAa,iBAqFxB;AAEW,QAAA,MAAM,GAAG,kBAAU,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import '@dxosTheme';
|
|
2
|
-
import {
|
|
2
|
+
import { CompactQrCodeProps } from './QrCode';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ value, label, size, side, sideOffset, collisionPadding, ...buttonProps }:
|
|
5
|
+
component: ({ value, label, size, side, sideOffset, collisionPadding, buttonCompact, ...buttonProps }: import("./QrCode").FullQrCodeProps) => JSX.Element;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare const Default: import("@storybook/react").Story<
|
|
8
|
+
export declare const Default: import("@storybook/react").Story<import("./QrCode").FullQrCodeProps>;
|
|
9
|
+
export declare const Compact: import("@storybook/react").Story<CompactQrCodeProps>;
|
|
9
10
|
//# sourceMappingURL=QrCode.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QrCode.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/QrCode/QrCode.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAIpB,OAAO,
|
|
1
|
+
{"version":3,"file":"QrCode.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/QrCode/QrCode.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAIpB,OAAO,EAAsC,kBAAkB,EAAE,MAAM,UAAU,CAAC;;;;;AAElF,wBAGE;AAUF,eAAO,MAAM,OAAO,sEAGlB,CAAC;AAMH,eAAO,MAAM,OAAO,sDAIlB,CAAC"}
|
|
@@ -6,7 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Default = void 0;
|
|
9
|
+
exports.Compact = exports.Default = void 0;
|
|
10
10
|
require("@dxosTheme");
|
|
11
11
|
const react_1 = __importDefault(require("react"));
|
|
12
12
|
const testing_1 = require("../../testing");
|
|
@@ -18,6 +18,9 @@ exports.default = {
|
|
|
18
18
|
const Template = (props) => {
|
|
19
19
|
return react_1.default.createElement(QrCode_1.QrCode, { ...props });
|
|
20
20
|
};
|
|
21
|
+
const CompactTemplate = (props) => {
|
|
22
|
+
return react_1.default.createElement(QrCode_1.CompactQrCode, { ...props });
|
|
23
|
+
};
|
|
21
24
|
exports.Default = (0, testing_1.templateForComponent)(Template)({
|
|
22
25
|
value: '',
|
|
23
26
|
label: ''
|
|
@@ -26,4 +29,14 @@ exports.Default.args = {
|
|
|
26
29
|
label: 'Click to copy this code’s value',
|
|
27
30
|
value: 'https://dxos.org'
|
|
28
31
|
};
|
|
32
|
+
exports.Compact = (0, testing_1.templateForComponent)(CompactTemplate)({
|
|
33
|
+
value: '',
|
|
34
|
+
copyLabel: '',
|
|
35
|
+
displayQrLabel: ''
|
|
36
|
+
});
|
|
37
|
+
exports.Compact.args = {
|
|
38
|
+
copyLabel: 'Copy',
|
|
39
|
+
displayQrLabel: 'Display QR',
|
|
40
|
+
value: 'https://dxos.org'
|
|
41
|
+
};
|
|
29
42
|
//# sourceMappingURL=QrCode.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QrCode.stories.js","sourceRoot":"","sources":["../../../../src/components/QrCode/QrCode.stories.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,sBAAoB;AACpB,kDAA0B;AAE1B,2CAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"QrCode.stories.js","sourceRoot":"","sources":["../../../../src/components/QrCode/QrCode.stories.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,sBAAoB;AACpB,kDAA0B;AAE1B,2CAAqD;AACrD,qCAAkF;AAElF,kBAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,eAAM;CAClB,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,KAAkB,EAAE,EAAE;IACtC,OAAO,8BAAC,eAAM,OAAK,KAAK,GAAI,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAyB,EAAE,EAAE;IACpD,OAAO,8BAAC,sBAAa,OAAK,KAAK,GAAI,CAAC;AACtC,CAAC,CAAC;AAEW,QAAA,OAAO,GAAG,IAAA,8BAAoB,EAAC,QAAQ,CAAC,CAAC;IACpD,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;CACV,CAAC,CAAC;AACH,eAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,iCAAiC;IACxC,KAAK,EAAE,kBAAkB;CAC1B,CAAC;AAEW,QAAA,OAAO,GAAG,IAAA,8BAAoB,EAAC,eAAe,CAAC,CAAC;IAC3D,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,EAAE;IACb,cAAc,EAAE,EAAE;CACnB,CAAC,CAAC;AACH,eAAO,CAAC,IAAI,GAAG;IACb,SAAS,EAAE,MAAM;IACjB,cAAc,EAAE,YAAY;IAC5B,KAAK,EAAE,kBAAkB;CAC1B,CAAC"}
|
|
@@ -3,8 +3,9 @@ import { ComponentProps, ReactNode } from 'react';
|
|
|
3
3
|
export interface TooltipProps extends Omit<ComponentProps<typeof TooltipPrimitive.Content>, 'children'> {
|
|
4
4
|
content: ReactNode;
|
|
5
5
|
children: ReactNode;
|
|
6
|
+
compact?: boolean;
|
|
6
7
|
tooltipLabelsTrigger?: boolean;
|
|
7
8
|
mountAsSibling?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare const Tooltip: ({ content, children, tooltipLabelsTrigger, mountAsSibling, ...contentProps }: TooltipProps) => JSX.Element;
|
|
10
|
+
export declare const Tooltip: ({ content, children, compact, tooltipLabelsTrigger, mountAsSibling, ...contentProps }: TooltipProps) => JSX.Element;
|
|
10
11
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAE5D,OAAc,EAAE,cAAc,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAKnE,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrG,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAE5D,OAAc,EAAE,cAAc,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAKnE,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrG,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,OAAO,0FAOjB,YAAY,gBAuCd,CAAC"}
|
|
@@ -35,10 +35,10 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
35
35
|
const react_1 = __importStar(require("react"));
|
|
36
36
|
const hooks_1 = require("../../hooks");
|
|
37
37
|
const styles_1 = require("../../styles");
|
|
38
|
-
const Tooltip = ({ content, children, tooltipLabelsTrigger, mountAsSibling, ...contentProps }) => {
|
|
38
|
+
const Tooltip = ({ content, children, compact, tooltipLabelsTrigger, mountAsSibling, ...contentProps }) => {
|
|
39
39
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
40
40
|
const labelId = (0, hooks_1.useId)('tooltipLabel');
|
|
41
|
-
const tooltipContent = (react_1.default.createElement(TooltipPrimitive.Content, { forceMount: true, ...contentProps, className: (0, classnames_1.default)('radix-side-top:animate-slide-down-fade', 'radix-side-right:animate-slide-left-fade', 'radix-side-bottom:animate-slide-up-fade', 'radix-side-left:animate-slide-right-fade', 'inline-flex items-center rounded-md px-4 py-2.5', 'shadow-lg bg-white dark:bg-neutral-800', !isOpen && 'sr-only', styles_1.defaultTooltip, contentProps.className) },
|
|
41
|
+
const tooltipContent = (react_1.default.createElement(TooltipPrimitive.Content, { forceMount: true, ...contentProps, className: (0, classnames_1.default)('radix-side-top:animate-slide-down-fade', 'radix-side-right:animate-slide-left-fade', 'radix-side-bottom:animate-slide-up-fade', 'radix-side-left:animate-slide-right-fade', 'z-[2] inline-flex items-center rounded-md', !compact && 'px-4 py-2.5', 'shadow-lg bg-white dark:bg-neutral-800', !isOpen && 'sr-only', styles_1.defaultTooltip, contentProps.className) },
|
|
42
42
|
react_1.default.createElement(TooltipPrimitive.Arrow, { className: 'fill-current text-white dark:text-neutral-800' }),
|
|
43
43
|
content));
|
|
44
44
|
return (react_1.default.createElement(TooltipPrimitive.Root, { open: isOpen, onOpenChange: setIsOpen },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1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CAAC,IAC3F,QAAQ,CACgB;QAC1B,oBAAoB,IAAI,CACvB,wCAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,SAAS,IACnC,OAAO,CACH,CACR;QACA,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,8BAAC,gBAAgB,CAAC,MAAM,IAAC,UAAU,UAAE,cAAc,CAA2B,CAC3F,CACzB,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,OAAO,WA8ClB"}
|
|
@@ -2,7 +2,7 @@ import '@dxosTheme';
|
|
|
2
2
|
import { TooltipProps } from './Tooltip';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ content, children, tooltipLabelsTrigger, mountAsSibling, ...contentProps }: TooltipProps) => JSX.Element;
|
|
5
|
+
component: ({ content, children, compact, tooltipLabelsTrigger, mountAsSibling, ...contentProps }: TooltipProps) => JSX.Element;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
8
|
export declare const Default: import("@storybook/react").Story<TooltipProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useId.d.ts","sourceRoot":"","sources":["../../../src/hooks/useId.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useId.d.ts","sourceRoot":"","sources":["../../../src/hooks/useId.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY,wBAGL,CAAC;AAErB,eAAO,MAAM,KAAK,cAAe,MAAM,MAAM,MAAM,WAAyD,CAAC"}
|
package/dist/src/hooks/useId.js
CHANGED
|
@@ -6,7 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.useId = void 0;
|
|
9
|
+
exports.useId = exports.randomString = void 0;
|
|
10
10
|
const alea_1 = __importDefault(require("alea"));
|
|
11
11
|
const react_1 = require("react");
|
|
12
12
|
const Alea = alea_1.default;
|
|
@@ -14,6 +14,7 @@ const prng = new Alea('@dxos/react-ui');
|
|
|
14
14
|
const randomString = (n = 4) => prng()
|
|
15
15
|
.toString(16)
|
|
16
16
|
.slice(2, n + 2);
|
|
17
|
-
|
|
17
|
+
exports.randomString = randomString;
|
|
18
|
+
const useId = (namespace, n) => (0, react_1.useMemo)(() => `${namespace}-${(0, exports.randomString)(n)}`, []);
|
|
18
19
|
exports.useId = useId;
|
|
19
20
|
//# sourceMappingURL=useId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useId.js","sourceRoot":"","sources":["../../../src/hooks/useId.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,gDAAwB;AACxB,iCAAgC;AAMhC,MAAM,IAAI,GAAgB,cAA8B,CAAC;AAEzD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"useId.js","sourceRoot":"","sources":["../../../src/hooks/useId.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,gDAAwB;AACxB,iCAAgC;AAMhC,MAAM,IAAI,GAAgB,cAA8B,CAAC;AAEzD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAEjC,MAAM,YAAY,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CACpC,IAAI,EAAE;KACH,QAAQ,CAAC,EAAE,CAAC;KACZ,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAHR,QAAA,YAAY,gBAGJ;AAEd,MAAM,KAAK,GAAG,CAAC,SAAiB,EAAE,CAAU,EAAE,EAAE,CAAC,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,GAAG,SAAS,IAAI,IAAA,oBAAY,EAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAhG,QAAA,KAAK,SAA2F"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const defaultFocus = "focus:outline-none focus-visible:hover:outline-none dark:focus-visible:hover:outline-none focus-visible:ring focus-visible:ring-offset-1 focus-visible:ring-primary-500 focus-visible:ring-offset-white dark:focus-visible:ring-primary-200 dark:focus-visible:ring-offset-black";
|
|
1
|
+
export declare const defaultFocus = "focus:outline-none focus-visible:z-[1] focus-visible:hover:outline-none dark:focus-visible:hover:outline-none focus-visible:ring focus-visible:ring-offset-1 focus-visible:ring-primary-500 focus-visible:ring-offset-white dark:focus-visible:ring-primary-200 dark:focus-visible:ring-offset-black";
|
|
2
2
|
export declare const staticFocus = "ring ring-offset-1 ring-primary-500 ring-offset-white dark:ring-primary-200 dark:ring-offset-black";
|
|
3
3
|
//# sourceMappingURL=focus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/styles/focus.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/styles/focus.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,ySAC+Q,CAAC;AAEzS,eAAO,MAAM,WAAW,uGAC8E,CAAC"}
|
package/dist/src/styles/focus.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
//
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.staticFocus = exports.defaultFocus = void 0;
|
|
7
|
-
exports.defaultFocus = 'focus:outline-none focus-visible:hover:outline-none dark:focus-visible:hover:outline-none focus-visible:ring focus-visible:ring-offset-1 focus-visible:ring-primary-500 focus-visible:ring-offset-white dark:focus-visible:ring-primary-200 dark:focus-visible:ring-offset-black';
|
|
7
|
+
exports.defaultFocus = 'focus:outline-none focus-visible:z-[1] focus-visible:hover:outline-none dark:focus-visible:hover:outline-none focus-visible:ring focus-visible:ring-offset-1 focus-visible:ring-primary-500 focus-visible:ring-offset-white dark:focus-visible:ring-primary-200 dark:focus-visible:ring-offset-black';
|
|
8
8
|
exports.staticFocus = 'ring ring-offset-1 ring-primary-500 ring-offset-white dark:ring-primary-200 dark:ring-offset-black';
|
|
9
9
|
//# sourceMappingURL=focus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.js","sourceRoot":"","sources":["../../../src/styles/focus.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEW,QAAA,YAAY,GACvB,
|
|
1
|
+
{"version":3,"file":"focus.js","sourceRoot":"","sources":["../../../src/styles/focus.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEW,QAAA,YAAY,GACvB,sSAAsS,CAAC;AAE5R,QAAA,WAAW,GACtB,oGAAoG,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Elevation } from '../props';
|
|
2
|
-
export declare const defaultGroup: ({ elevation }: {
|
|
2
|
+
export declare const defaultGroup: ({ elevation, rounding, spacing }: {
|
|
3
3
|
elevation: Elevation;
|
|
4
|
+
rounding?: string | undefined;
|
|
5
|
+
spacing?: string | undefined;
|
|
4
6
|
}) => string;
|
|
5
7
|
//# sourceMappingURL=group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../../src/styles/group.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAYrC,eAAO,MAAM,YAAY;
|
|
1
|
+
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../../src/styles/group.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAYrC,eAAO,MAAM,YAAY;eAKZ,SAAS;;;YAYrB,CAAC"}
|
package/dist/src/styles/group.js
CHANGED
|
@@ -17,8 +17,8 @@ const elevationClassNameMap = new Map([
|
|
|
17
17
|
[5, 'shadow-xl'],
|
|
18
18
|
[6, 'shadow-2xl']
|
|
19
19
|
]);
|
|
20
|
-
const defaultGroup = ({ elevation }) => {
|
|
21
|
-
return (0, classnames_1.default)('rounded-lg p-4', elevation === 0
|
|
20
|
+
const defaultGroup = ({ elevation, rounding, spacing }) => {
|
|
21
|
+
return (0, classnames_1.default)(rounding !== null && rounding !== void 0 ? rounding : 'rounded-lg', spacing !== null && spacing !== void 0 ? spacing : 'p-4', elevation === 0
|
|
22
22
|
? 'bg-transparent border border-neutral-200 dark:border-neutral-700'
|
|
23
23
|
: 'bg-white dark:bg-neutral-800 elevated-buttons', elevationClassNameMap.get(elevation));
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/styles/group.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,4DAA4B;AAI5B,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAiB;IACpD,CAAC,CAAC,EAAE,aAAa,CAAC;IAClB,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,CAAC,CAAC,EAAE,QAAQ,CAAC;IACb,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,CAAC,CAAC,EAAE,YAAY,CAAC;CAClB,CAAC,CAAC;AAEI,MAAM,YAAY,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/styles/group.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,4DAA4B;AAI5B,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAiB;IACpD,CAAC,CAAC,EAAE,aAAa,CAAC;IAClB,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,CAAC,CAAC,EAAE,QAAQ,CAAC;IACb,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,CAAC,CAAC,EAAE,YAAY,CAAC;CAClB,CAAC,CAAC;AAEI,MAAM,YAAY,GAAG,CAAC,EAC3B,SAAS,EACT,QAAQ,EACR,OAAO,EAKR,EAAE,EAAE;IACH,OAAO,IAAA,oBAAE,EACP,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,YAAY,EACxB,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,KAAK,EAChB,SAAS,KAAK,CAAC;QACb,CAAC,CAAC,kEAAkE;QACpE,CAAC,CAAC,+CAA+C,EACnD,qBAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,YAAY,gBAiBvB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const defaultHover: ({ disabled }: {
|
|
2
2
|
disabled?: boolean | undefined;
|
|
3
|
-
}) => false | "outline outline-3 outline-transparent hover:outline-primary-300 dark:hover:outline-primary-400 hover:focus:outline-primary-300 dark:hover:focus:outline-primary-400";
|
|
3
|
+
}) => false | "outline outline-3 outline-transparent hover:z-[1] hover:outline-primary-300 dark:hover:outline-primary-400 hover:focus:outline-primary-300 dark:hover:focus:outline-primary-400";
|
|
4
4
|
//# sourceMappingURL=hover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../src/styles/hover.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../src/styles/hover.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;+LAKxB,CAAC"}
|
package/dist/src/styles/hover.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.defaultHover = void 0;
|
|
7
7
|
const defaultHover = ({ disabled }) => {
|
|
8
8
|
return (!disabled &&
|
|
9
|
-
'outline outline-3 outline-transparent hover:outline-primary-300 dark:hover:outline-primary-400 hover:focus:outline-primary-300 dark:hover:focus:outline-primary-400');
|
|
9
|
+
'outline outline-3 outline-transparent hover:z-[1] hover:outline-primary-300 dark:hover:outline-primary-400 hover:focus:outline-primary-300 dark:hover:focus:outline-primary-400');
|
|
10
10
|
};
|
|
11
11
|
exports.defaultHover = defaultHover;
|
|
12
12
|
//# sourceMappingURL=hover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.js","sourceRoot":"","sources":["../../../src/styles/hover.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEK,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAA0B,EAAE,EAAE;IACnE,OAAO,CACL,CAAC,QAAQ;QACT,
|
|
1
|
+
{"version":3,"file":"hover.js","sourceRoot":"","sources":["../../../src/styles/hover.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEK,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAA0B,EAAE,EAAE;IACnE,OAAO,CACL,CAAC,QAAQ;QACT,iLAAiL,CAClL,CAAC;AACJ,CAAC,CAAC;AALW,QAAA,YAAY,gBAKvB"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export declare const defaultShimmer = "relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-neutral-100/
|
|
1
|
+
export declare const defaultShimmer = "relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-neutral-100/10 before:to-transparent isolate overflow-hidden";
|
|
2
|
+
export declare const strongShimmer = "relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-primary-100/80 before:to-transparent isolate overflow-hidden";
|
|
2
3
|
//# sourceMappingURL=shimmer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shimmer.d.ts","sourceRoot":"","sources":["../../../src/styles/shimmer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"shimmer.d.ts","sourceRoot":"","sources":["../../../src/styles/shimmer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,oNACwL,CAAC;AAEpN,eAAO,MAAM,aAAa,oNACyL,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// Copyright 2022 DXOS.org
|
|
4
4
|
//
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.defaultShimmer = void 0;
|
|
7
|
-
exports.defaultShimmer = 'relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-neutral-100/
|
|
6
|
+
exports.strongShimmer = exports.defaultShimmer = void 0;
|
|
7
|
+
exports.defaultShimmer = 'relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-neutral-100/10 before:to-transparent isolate overflow-hidden';
|
|
8
|
+
exports.strongShimmer = 'relative before:absolute before:inset-0 before:-translate-x-full before:animate-shimmer before:bg-gradient-to-r before:from-transparent before:via-primary-100/80 before:to-transparent isolate overflow-hidden';
|
|
8
9
|
//# sourceMappingURL=shimmer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shimmer.js","sourceRoot":"","sources":["../../../src/styles/shimmer.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEW,QAAA,cAAc,GACzB,
|
|
1
|
+
{"version":3,"file":"shimmer.js","sourceRoot":"","sources":["../../../src/styles/shimmer.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEW,QAAA,cAAc,GACzB,iNAAiN,CAAC;AAEvM,QAAA,aAAa,GACxB,iNAAiN,CAAC"}
|
package/dist/src/theme.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Vite plugin which configures a low-level design system for DXOS.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"types": "dist/src/index.d.ts",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
|
-
"src"
|
|
13
|
+
"src",
|
|
14
|
+
"plugin.js",
|
|
15
|
+
"plugin.d.ts"
|
|
14
16
|
],
|
|
15
17
|
"dependencies": {
|
|
16
18
|
"@fontsource/fira-code": "^4.5.12",
|
|
@@ -37,7 +39,6 @@
|
|
|
37
39
|
"tailwindcss-radix": "^2.6.0"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
|
-
"@dxos/vite-plugin": "0.1.5",
|
|
41
42
|
"@types/react": "^18.0.21",
|
|
42
43
|
"@types/react-dom": "^18.0.6",
|
|
43
44
|
"@vitejs/plugin-react": "^2.0.1",
|
package/plugin.d.ts
ADDED
package/plugin.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2021 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// Not included in the main `index.ts` so that the apps are not bundled with it.
|
|
6
|
+
// It contains native Node functionality so must not be included in the final app bundle, only during compilation/bundling.
|
|
7
|
+
|
|
8
|
+
module.exports = require('./dist/src/plugin');
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
import React, { ComponentProps, ReactNode } from 'react';
|
|
7
|
+
|
|
8
|
+
export interface ButtonGroupProps extends ComponentProps<'div'> {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ButtonGroup = ({ children, ...divProps }: ButtonGroupProps) => {
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
role='none'
|
|
16
|
+
{...divProps}
|
|
17
|
+
className={cx('button-elevation [&>*]:grouped-buttons rounded-md', divProps.className)}
|
|
18
|
+
>
|
|
19
|
+
{children}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -50,7 +50,7 @@ export const BarePinInput = forwardRef<HTMLInputElement, BarePinInputProps>(
|
|
|
50
50
|
...bareInputStyleProps,
|
|
51
51
|
inputRef,
|
|
52
52
|
className: cx(
|
|
53
|
-
'font-mono selection:bg-transparent',
|
|
53
|
+
'font-mono selection:bg-transparent mli-auto',
|
|
54
54
|
inputProps.disabled && 'cursor-not-allowed',
|
|
55
55
|
inputProps.className
|
|
56
56
|
),
|
|
@@ -11,7 +11,8 @@ import { InputProps, InputSize } from './InputProps';
|
|
|
11
11
|
const sizeMap: Record<InputSize, string> = {
|
|
12
12
|
md: 'text-sm',
|
|
13
13
|
lg: 'text-base',
|
|
14
|
-
pin: ''
|
|
14
|
+
pin: '',
|
|
15
|
+
textarea: ''
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export type BareTextInputProps = Omit<InputProps, 'label' | 'initialValue' | 'onChange'> &
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
import React, { ComponentProps } from 'react';
|
|
7
|
+
|
|
8
|
+
import { defaultInput } from '../../styles/input';
|
|
9
|
+
import { TextareaProps } from './InputProps';
|
|
10
|
+
|
|
11
|
+
export type BareTextareaInputProps = Omit<TextareaProps, 'label' | 'initialValue' | 'onChange'> &
|
|
12
|
+
Pick<ComponentProps<'textarea'>, 'onChange'>;
|
|
13
|
+
|
|
14
|
+
export const BareTextareaInput = ({
|
|
15
|
+
validationValence,
|
|
16
|
+
validationMessage,
|
|
17
|
+
size,
|
|
18
|
+
...inputProps
|
|
19
|
+
}: BareTextareaInputProps) => {
|
|
20
|
+
return (
|
|
21
|
+
<textarea
|
|
22
|
+
{...inputProps}
|
|
23
|
+
className={cx(
|
|
24
|
+
defaultInput({ disabled: inputProps.disabled, ...(validationMessage && { validationValence }) }),
|
|
25
|
+
'block w-full px-2.5 py-2'
|
|
26
|
+
)}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -9,6 +9,7 @@ import { useId } from '../../hooks';
|
|
|
9
9
|
import { defaultDescription, valenceColorText } from '../../styles';
|
|
10
10
|
import { BarePinInput } from './BarePinInput';
|
|
11
11
|
import { BareTextInput } from './BareTextInput';
|
|
12
|
+
import { BareTextareaInput, BareTextareaInputProps } from './BareTextareaInput';
|
|
12
13
|
import { InputProps as NaturalInputProps } from './InputProps';
|
|
13
14
|
|
|
14
15
|
export type InputProps = NaturalInputProps;
|
|
@@ -30,7 +31,7 @@ export const Input = ({
|
|
|
30
31
|
validationValence,
|
|
31
32
|
...inputProps
|
|
32
33
|
}: InputProps) => {
|
|
33
|
-
const inputId = inputProps.id
|
|
34
|
+
const inputId = inputProps.id ?? useId('input');
|
|
34
35
|
const descriptionId = useId('input-description');
|
|
35
36
|
const validationId = useId('input-validation');
|
|
36
37
|
|
|
@@ -41,7 +42,7 @@ export const Input = ({
|
|
|
41
42
|
const [internalValue, setInternalValue] = useState<string>(initialValue?.toString() || '');
|
|
42
43
|
|
|
43
44
|
const onInternalChange = useCallback(
|
|
44
|
-
(e: ChangeEvent<HTMLInputElement>) => {
|
|
45
|
+
(e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
45
46
|
const nextValue = e.target?.value || '';
|
|
46
47
|
setInternalValue(nextValue);
|
|
47
48
|
onChange &&
|
|
@@ -72,6 +73,8 @@ export const Input = ({
|
|
|
72
73
|
const bareInput =
|
|
73
74
|
size === 'pin' ? (
|
|
74
75
|
<BarePinInput {...bareInputBaseProps} length={length} />
|
|
76
|
+
) : size === 'textarea' ? (
|
|
77
|
+
<BareTextareaInput {...(bareInputBaseProps as BareTextareaInputProps)} />
|
|
75
78
|
) : (
|
|
76
79
|
<BareTextInput {...bareInputBaseProps} size={size} />
|
|
77
80
|
);
|
|
@@ -6,9 +6,9 @@ import { ComponentProps, ReactNode } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { MessageValence } from '../../props';
|
|
8
8
|
|
|
9
|
-
export type InputSize = 'md' | 'lg' | 'pin';
|
|
9
|
+
export type InputSize = 'md' | 'lg' | 'pin' | 'textarea';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface InputPropsExtension {
|
|
12
12
|
label: ReactNode;
|
|
13
13
|
labelVisuallyHidden?: boolean;
|
|
14
14
|
description?: ReactNode;
|
|
@@ -21,3 +21,11 @@ export interface InputProps extends Omit<ComponentProps<'input'>, 'value' | 'onC
|
|
|
21
21
|
validationValence?: MessageValence;
|
|
22
22
|
length?: number;
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
export interface InputProps
|
|
26
|
+
extends Omit<ComponentProps<'input'>, 'value' | 'onChange' | 'size' | 'ref'>,
|
|
27
|
+
InputPropsExtension {}
|
|
28
|
+
|
|
29
|
+
export interface TextareaProps
|
|
30
|
+
extends Omit<ComponentProps<'textarea'>, 'value' | 'onChange' | 'size' | 'ref'>,
|
|
31
|
+
InputPropsExtension {}
|
|
@@ -6,7 +6,7 @@ import '@dxosTheme';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { templateForComponent } from '../../testing';
|
|
9
|
-
import { QrCode, QrCodeProps } from './QrCode';
|
|
9
|
+
import { QrCode, QrCodeProps, CompactQrCode, CompactQrCodeProps } from './QrCode';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
title: 'react-ui/QrCode',
|
|
@@ -17,6 +17,10 @@ const Template = (props: QrCodeProps) => {
|
|
|
17
17
|
return <QrCode {...props} />;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
const CompactTemplate = (props: CompactQrCodeProps) => {
|
|
21
|
+
return <CompactQrCode {...props} />;
|
|
22
|
+
};
|
|
23
|
+
|
|
20
24
|
export const Default = templateForComponent(Template)({
|
|
21
25
|
value: '',
|
|
22
26
|
label: ''
|
|
@@ -25,3 +29,14 @@ Default.args = {
|
|
|
25
29
|
label: 'Click to copy this code’s value',
|
|
26
30
|
value: 'https://dxos.org'
|
|
27
31
|
};
|
|
32
|
+
|
|
33
|
+
export const Compact = templateForComponent(CompactTemplate)({
|
|
34
|
+
value: '',
|
|
35
|
+
copyLabel: '',
|
|
36
|
+
displayQrLabel: ''
|
|
37
|
+
});
|
|
38
|
+
Compact.args = {
|
|
39
|
+
copyLabel: 'Copy',
|
|
40
|
+
displayQrLabel: 'Display QR',
|
|
41
|
+
value: 'https://dxos.org'
|
|
42
|
+
};
|