@dxos/react-ui 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/src/components/Heading/Heading.d.ts +1 -1
- package/dist/src/components/Heading/Heading.stories.d.ts +1 -1
- package/dist/src/components/Input/BarePinInput.d.ts +310 -0
- package/dist/src/components/Input/BarePinInput.d.ts.map +1 -0
- package/dist/src/components/Input/BarePinInput.js +62 -0
- package/dist/src/components/Input/BarePinInput.js.map +1 -0
- package/dist/src/components/Input/BareTextInput.d.ts +5 -0
- package/dist/src/components/Input/BareTextInput.d.ts.map +1 -0
- package/dist/src/components/Input/BareTextInput.js +22 -0
- package/dist/src/components/Input/BareTextInput.js.map +1 -0
- package/dist/src/components/Input/Input.d.ts +3 -16
- package/dist/src/components/Input/Input.d.ts.map +1 -1
- package/dist/src/components/Input/Input.js +22 -10
- package/dist/src/components/Input/Input.js.map +1 -1
- package/dist/src/components/Input/Input.stories.d.ts +7 -3
- package/dist/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/src/components/Input/Input.stories.js +15 -2
- package/dist/src/components/Input/Input.stories.js.map +1 -1
- package/dist/src/components/Input/InputProps.d.ts +17 -0
- package/dist/src/components/Input/InputProps.d.ts.map +1 -0
- package/dist/src/components/Input/InputProps.js +6 -0
- package/dist/src/components/Input/InputProps.js.map +1 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +2 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/useForwardedRef.d.ts +2 -0
- package/dist/src/hooks/useForwardedRef.d.ts.map +1 -0
- package/dist/src/hooks/useForwardedRef.js +24 -0
- package/dist/src/hooks/useForwardedRef.js.map +1 -0
- package/dist/src/hooks/useIsFocused.d.ts +3 -0
- package/dist/src/hooks/useIsFocused.d.ts.map +1 -0
- package/dist/src/hooks/useIsFocused.js +34 -0
- package/dist/src/hooks/useIsFocused.js.map +1 -0
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +9 -1
- package/dist/src/plugin.js.map +1 -1
- package/dist/src/styles/focus.d.ts +1 -0
- package/dist/src/styles/focus.d.ts.map +1 -1
- package/dist/src/styles/focus.js +2 -1
- package/dist/src/styles/focus.js.map +1 -1
- package/dist/src/styles/index.d.ts +1 -0
- package/dist/src/styles/index.d.ts.map +1 -1
- package/dist/src/styles/index.js +1 -0
- package/dist/src/styles/index.js.map +1 -1
- package/dist/src/styles/input.d.ts +11 -0
- package/dist/src/styles/input.d.ts.map +1 -0
- package/dist/src/styles/input.js +24 -0
- package/dist/src/styles/input.js.map +1 -0
- package/dist/src/styles/shimmer.d.ts +2 -0
- package/dist/src/styles/shimmer.d.ts.map +1 -0
- package/dist/src/styles/shimmer.js +8 -0
- package/dist/src/styles/shimmer.js.map +1 -0
- package/package.json +3 -2
- package/src/components/AlertDialog/AlertDialog.tsx +1 -1
- package/src/components/Input/BarePinInput.tsx +62 -0
- package/src/components/Input/BareTextInput.tsx +31 -0
- package/src/components/Input/Input.stories.tsx +18 -1
- package/src/components/Input/Input.tsx +33 -54
- package/src/components/Input/InputProps.ts +23 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useForwardedRef.ts +22 -0
- package/src/hooks/useIsFocused.ts +38 -0
- package/src/plugin.ts +9 -1
- package/src/styles/focus.ts +3 -0
- package/src/styles/index.ts +1 -0
- package/src/styles/input.ts +47 -0
- package/src/styles/shimmer.ts +6 -0
|
@@ -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.InputWithValidationAndDescription = exports.InputWithErrorAndDescription = exports.InputWithDescription = exports.LabelVisuallyHidden = exports.Disabled = exports.Default = void 0;
|
|
9
|
+
exports.PinInput = exports.InputWithValidationAndDescription = exports.InputWithErrorAndDescription = exports.InputWithDescription = exports.LabelVisuallyHidden = exports.Disabled = exports.Default = void 0;
|
|
10
10
|
require("@dxosTheme");
|
|
11
11
|
const react_1 = __importDefault(require("react"));
|
|
12
12
|
const testing_1 = require("../../testing");
|
|
@@ -19,6 +19,10 @@ exports.default = {
|
|
|
19
19
|
validationValence: {
|
|
20
20
|
control: 'select',
|
|
21
21
|
options: ['success', 'info', 'warning', 'error']
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
control: 'select',
|
|
25
|
+
options: ['md', 'lg', 'pin']
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
};
|
|
@@ -34,7 +38,8 @@ exports.Default.args = {
|
|
|
34
38
|
labelVisuallyHidden: false,
|
|
35
39
|
descriptionVisuallyHidden: false,
|
|
36
40
|
validationMessage: '',
|
|
37
|
-
validationValence: undefined
|
|
41
|
+
validationValence: undefined,
|
|
42
|
+
length: 6
|
|
38
43
|
};
|
|
39
44
|
const Disabled = () => (react_1.default.createElement(Template, { ...{
|
|
40
45
|
label: 'Disabled',
|
|
@@ -70,4 +75,12 @@ const InputWithValidationAndDescription = () => (react_1.default.createElement(T
|
|
|
70
75
|
validationMessage: 'This validation message is really part of the description.'
|
|
71
76
|
} }));
|
|
72
77
|
exports.InputWithValidationAndDescription = InputWithValidationAndDescription;
|
|
78
|
+
const PinInput = () => (react_1.default.createElement(Template, { ...{
|
|
79
|
+
label: 'This input is a PIN-style input',
|
|
80
|
+
size: 'pin',
|
|
81
|
+
length: 6,
|
|
82
|
+
description: 'Type in secret you received',
|
|
83
|
+
placeholder: '••••••'
|
|
84
|
+
} }));
|
|
85
|
+
exports.PinInput = PinInput;
|
|
73
86
|
//# sourceMappingURL=Input.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.stories.js","sourceRoot":"","sources":["../../../../src/components/Input/Input.stories.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,sBAAoB;AACpB,kDAA0B;AAE1B,2CAAqD;AACrD,mCAA4C;AAE5C,kBAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,aAAK;IAChB,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAChC,iBAAiB,EAAE;YACjB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;SACjD;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,KAAiB,EAAE,EAAE;IACrC,OAAO,8BAAC,aAAK,OAAK,KAAK,GAAI,CAAC;AAC9B,CAAC,CAAC;AAEW,QAAA,OAAO,GAAG,IAAA,8BAAoB,EAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;AACrE,eAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,kBAAkB;IAC/B,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,SAAS;IACtB,mBAAmB,EAAE,KAAK;IAC1B,yBAAyB,EAAE,KAAK;IAChC,iBAAiB,EAAE,EAAE;IACrB,iBAAiB,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"Input.stories.js","sourceRoot":"","sources":["../../../../src/components/Input/Input.stories.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,sBAAoB;AACpB,kDAA0B;AAE1B,2CAAqD;AACrD,mCAA4C;AAE5C,kBAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,aAAK;IAChB,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAChC,iBAAiB,EAAE;YACjB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,C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CAAC;AARW,QAAA,oBAAoB,wBAQ/B;AAEK,MAAM,4BAA4B,GAAG,GAAG,EAAE,CAAC,CAChD,8BAAC,QAAQ,OACH;QACF,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,sEAAsE;QACnF,WAAW,EAAE,sEAAsE;QACnF,iBAAiB,EAAE,OAAO;QAC1B,iBAAiB,EAAE,yBAAyB;KAC7C,GACD,CACH,CAAC;AAVW,QAAA,4BAA4B,gCAUvC;AAEK,MAAM,iCAAiC,GAAG,GAAG,EAAE,CAAC,CACrD,8BAAC,QAAQ,OACH;QACF,KAAK,EAAE,yCAAyC;QAChD,WAAW,EAAE,sDAAsD;QACnE,WAAW,EAAE,4BAA4B;QACzC,iBAAiB,EAAE,SAAS;QAC5B,iBAAiB,EAAE,4DAA4D;KAChF,GACD,CACH,CAAC;AAVW,QAAA,iCAAiC,qCAU5C;AAEK,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,CAC5B,8BAAC,QAAQ,OACH;QACF,KAAK,EAAE,iCAAiC;QACxC,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,CAAC;QACT,WAAW,EAAE,6BAA6B;QAC1C,WAAW,EAAE,QAAQ;KACtB,GACD,CACH,CAAC;AAVW,QAAA,QAAQ,YAUnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { MessageValence } from '../../props';
|
|
3
|
+
export declare type InputSize = 'md' | 'lg' | 'pin';
|
|
4
|
+
export interface InputProps extends Omit<ComponentProps<'input'>, 'value' | 'onChange' | 'size' | 'ref'> {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
labelVisuallyHidden?: boolean;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
descriptionVisuallyHidden?: boolean;
|
|
9
|
+
initialValue?: string;
|
|
10
|
+
onChange?: (value: string) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
size?: InputSize;
|
|
13
|
+
validationMessage?: ReactNode;
|
|
14
|
+
validationValence?: MessageValence;
|
|
15
|
+
length?: number;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=InputProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputProps.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/InputProps.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,oBAAY,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAE5C,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;IACtG,KAAK,EAAE,SAAS,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,iBAAiB,CAAC,EAAE,cAAc,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputProps.js","sourceRoot":"","sources":["../../../../src/components/Input/InputProps.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
package/dist/src/hooks/index.js
CHANGED
|
@@ -18,4 +18,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
__exportStar(require("./useId"), exports);
|
|
21
|
+
__exportStar(require("./useForwardedRef"), exports);
|
|
22
|
+
__exportStar(require("./useIsFocused"), exports);
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,0CAAwB;AACxB,oDAAkC;AAClC,iDAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForwardedRef.d.ts","sourceRoot":"","sources":["../../../src/hooks/useForwardedRef.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,2EAe3B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useForwardedRef = void 0;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const useForwardedRef = (ref) => {
|
|
9
|
+
const innerRef = (0, react_1.useRef)(null);
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
11
|
+
if (!ref) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (typeof ref === 'function') {
|
|
15
|
+
ref(innerRef.current);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
ref.current = innerRef.current;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return innerRef;
|
|
22
|
+
};
|
|
23
|
+
exports.useForwardedRef = useForwardedRef;
|
|
24
|
+
//# sourceMappingURL=useForwardedRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForwardedRef.js","sourceRoot":"","sources":["../../../src/hooks/useForwardedRef.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,iCAA0C;AAEnC,MAAM,eAAe,GAAG,CAAI,GAA0B,EAAE,EAAE;IAC/D,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAI,IAAI,CAAC,CAAC;IAEjC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,EAAE;YACR,OAAO;SACR;QACD,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;YAC7B,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACvB;aAAM;YACL,GAAG,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;SAChC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsFocused.d.ts","sourceRoot":"","sources":["../../../src/hooks/useIsFocused.ts"],"names":[],"mappings":"AAOA,OAAO,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/D,eAAO,MAAM,YAAY,aAAc,UAAU,gBAAgB,CAAC,wBA4BjE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useIsFocused = void 0;
|
|
7
|
+
// Based upon the useIsFocused hook which is part of the `rci` project:
|
|
8
|
+
/// https://github.com/leonardodino/rci/blob/main/packages/use-is-focused
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const useIsFocused = (inputRef) => {
|
|
11
|
+
const [isFocused, setIsFocused] = (0, react_1.useState)(undefined);
|
|
12
|
+
const isFocusedRef = (0, react_1.useRef)(isFocused);
|
|
13
|
+
isFocusedRef.current = isFocused;
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
const input = inputRef.current;
|
|
16
|
+
if (!input) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const onFocus = () => setIsFocused(true);
|
|
20
|
+
const onBlur = () => setIsFocused(false);
|
|
21
|
+
input.addEventListener('focus', onFocus);
|
|
22
|
+
input.addEventListener('blur', onBlur);
|
|
23
|
+
if (isFocusedRef.current === undefined) {
|
|
24
|
+
setIsFocused(document.activeElement === input);
|
|
25
|
+
}
|
|
26
|
+
return () => {
|
|
27
|
+
input.removeEventListener('focus', onFocus);
|
|
28
|
+
input.removeEventListener('blur', onBlur);
|
|
29
|
+
};
|
|
30
|
+
}, [inputRef, setIsFocused]);
|
|
31
|
+
return isFocused;
|
|
32
|
+
};
|
|
33
|
+
exports.useIsFocused = useIsFocused;
|
|
34
|
+
//# sourceMappingURL=useIsFocused.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsFocused.js","sourceRoot":"","sources":["../../../src/hooks/useIsFocused.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,uEAAuE;AACvE,yEAAyE;AAEzE,iCAA+D;AAExD,MAAM,YAAY,GAAG,CAAC,QAAqC,EAAE,EAAE;IACpE,MAAM,C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AAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,YAAa,yBAAyB,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,MAAM,WAAW,yBAAyB;IACxC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,YAAa,yBAAyB,WAiQ7D,CAAC"}
|
package/dist/src/plugin.js
CHANGED
|
@@ -218,6 +218,12 @@ const themePlugin = (options) => {
|
|
|
218
218
|
'100%': {
|
|
219
219
|
transform: 'translateX(calc(100% + 1rem))'
|
|
220
220
|
}
|
|
221
|
+
},
|
|
222
|
+
// Shimmer
|
|
223
|
+
'shimmer-loop': {
|
|
224
|
+
'100%': {
|
|
225
|
+
transform: 'translateX(100%)'
|
|
226
|
+
}
|
|
221
227
|
}
|
|
222
228
|
},
|
|
223
229
|
animation: {
|
|
@@ -243,7 +249,9 @@ const themePlugin = (options) => {
|
|
|
243
249
|
'toast-hide': 'toast-hide 100ms ease-in forwards',
|
|
244
250
|
'toast-slide-in-right': 'toast-slide-in-right 150ms cubic-bezier(0.16, 1, 0.3, 1)',
|
|
245
251
|
'toast-slide-in-bottom': 'toast-slide-in-bottom 150ms cubic-bezier(0.16, 1, 0.3, 1)',
|
|
246
|
-
'toast-swipe-out': 'toast-swipe-out 100ms ease-out forwards'
|
|
252
|
+
'toast-swipe-out': 'toast-swipe-out 100ms ease-out forwards',
|
|
253
|
+
// Shimmer
|
|
254
|
+
shimmer: 'shimmer-loop 2s infinite'
|
|
247
255
|
}
|
|
248
256
|
}
|
|
249
257
|
},
|
package/dist/src/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,+DAAkD;AAClD,gEAAwC;AACxC,+BAA+B;AAC/B,8DAAsC;AACtC,8EAAqD;AACrD,0EAAiD;AACjD,gEAAgD;AAChD,oGAAoE;AAU7D,MAAM,WAAW,GAAG,CAAC,OAAkC,EAAE,EAAE;IAChE,MAAM,MAAM,GAA8B;QACxC,GAAG,EAAE,IAAI;QACT,OAAO,EAAE,IAAA,cAAO,EAAC,SAAS,EAAE,aAAa,CAAC;QAC1C,aAAa,EAAE,YAAY;QAC3B,GAAG,OAAO;KACX,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,2BAA2B;QACjC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;YACxB,OAAO;gBACL,GAAG,EAAE;oBACH,OAAO,EAAE;wBACP,OAAO,EAAE;4BACP,IAAA,qBAAW,EAAC;gCACV,QAAQ,EAAE,OAAO;gCACjB,KAAK,EAAE;oCACL,UAAU,EAAE;wCACV,IAAI,EAAE,CAAC,qBAAqB,EAAE,GAAG,+BAAa,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;wCACrE,OAAO,EAAE,CAAC,uBAAuB,EAAE,qBAAqB,EAAE,GAAG,+BAAa,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;wCACjG,IAAI,EAAE,CAAC,mBAAmB,EAAE,GAAG,+BAAa,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;qCACpE;oCACD,MAAM,EAAE;wCACN,MAAM,EAAE;4CACN,OAAO,EAAE,gBAAc,CAAC,OAAO;4CAC/B,OAAO,EAAE,gBAAc,CAAC,KAAK;4CAC7B,KAAK,EAAE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AgB,GAAE,CAAC;gCACnE,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,aAAa,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gCAClD,OAAO,EAAE,CAAC,IAAA,cAAO,EAAC,IAAI,IAAI,IAAI,EAAE,0CAA0C,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;6BAChG,CAAC;4BACF,sBAAY;yBACb;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QACD,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE;YAChB,IAAI,EAAE,KAAK,MAAM,CAAC,aAAa,EAAE;gBAC/B,OAAO,MAAM,CAAC,OAAO,CAAC;aACvB;QACH,CAAC;KACQ,CAAC;AACd,CAAC,CAAC;AAjQW,QAAA,WAAW,eAiQtB"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
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";
|
|
2
|
+
export declare const staticFocus = "ring ring-offset-1 ring-primary-500 ring-offset-white dark:ring-primary-200 dark:ring-offset-black";
|
|
2
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,qRAC2P,CAAC"}
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/styles/focus.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,qRAC2P,CAAC;AAErR,eAAO,MAAM,WAAW,uGAC8E,CAAC"}
|
package/dist/src/styles/focus.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// Copyright 2022 DXOS.org
|
|
4
4
|
//
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.defaultFocus = void 0;
|
|
6
|
+
exports.staticFocus = exports.defaultFocus = void 0;
|
|
7
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';
|
|
8
|
+
exports.staticFocus = 'ring ring-offset-1 ring-primary-500 ring-offset-white dark:ring-primary-200 dark:ring-offset-black';
|
|
8
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,kRAAkR,CAAC"}
|
|
1
|
+
{"version":3,"file":"focus.js","sourceRoot":"","sources":["../../../src/styles/focus.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEW,QAAA,YAAY,GACvB,kRAAkR,CAAC;AAExQ,QAAA,WAAW,GACtB,oGAAoG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
package/dist/src/styles/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __exportStar(require("./focus"), exports);
|
|
|
23
23
|
__exportStar(require("./group"), exports);
|
|
24
24
|
__exportStar(require("./hover"), exports);
|
|
25
25
|
__exportStar(require("./ornament"), exports);
|
|
26
|
+
__exportStar(require("./shimmer"), exports);
|
|
26
27
|
__exportStar(require("./size"), exports);
|
|
27
28
|
__exportStar(require("./text"), exports);
|
|
28
29
|
__exportStar(require("./valence"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,2CAAyB;AACzB,6CAA2B;AAC3B,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,6CAA2B;AAC3B,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,2CAAyB;AACzB,6CAA2B;AAC3B,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,6CAA2B;AAC3B,4CAA0B;AAC1B,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MessageValence } from '../props';
|
|
2
|
+
export declare const defaultInput: ({ disabled, validationValence }: {
|
|
3
|
+
disabled?: boolean | undefined;
|
|
4
|
+
validationValence?: MessageValence | undefined;
|
|
5
|
+
}) => string;
|
|
6
|
+
export declare const staticInput: ({ disabled, focused, validationValence }: {
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
focused?: boolean | undefined;
|
|
9
|
+
validationValence?: MessageValence | undefined;
|
|
10
|
+
}) => string;
|
|
11
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/styles/input.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAO1C,eAAO,MAAM,YAAY;;;YAexB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;YAgBvB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.staticInput = exports.defaultInput = void 0;
|
|
10
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
11
|
+
const disabled_1 = require("./disabled");
|
|
12
|
+
const focus_1 = require("./focus");
|
|
13
|
+
const hover_1 = require("./hover");
|
|
14
|
+
const text_1 = require("./text");
|
|
15
|
+
const valence_1 = require("./valence");
|
|
16
|
+
const defaultInput = ({ disabled, validationValence }) => {
|
|
17
|
+
return (0, classnames_1.default)(focus_1.defaultFocus, text_1.defaultPlaceholder, (0, hover_1.defaultHover)({ disabled }), 'bg-white/50 border text-neutral-900 text-sm rounded-lg dark:bg-neutral-700/50 dark:text-white', (0, valence_1.valenceInputBorder)(validationValence), disabled && disabled_1.defaultDisabled);
|
|
18
|
+
};
|
|
19
|
+
exports.defaultInput = defaultInput;
|
|
20
|
+
const staticInput = ({ disabled, focused, validationValence }) => {
|
|
21
|
+
return (0, classnames_1.default)(text_1.defaultPlaceholder, 'bg-white/50 border text-neutral-900 text-sm rounded-lg dark:bg-neutral-700/50 dark:text-white', (0, valence_1.valenceInputBorder)(validationValence), disabled && disabled_1.defaultDisabled, focused && focus_1.staticFocus);
|
|
22
|
+
};
|
|
23
|
+
exports.staticInput = staticInput;
|
|
24
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/styles/input.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,4DAA4B;AAG5B,yCAA6C;AAC7C,mCAAoD;AACpD,mCAAuC;AACvC,iCAA4C;AAC5C,uCAA+C;AAExC,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,iBAAiB,EAIlB,EAAE,EAAE;IACH,OAAO,IAAA,oBAAE,EACP,oBAAY,EACZ,yBAAkB,EAClB,IAAA,oBAAY,EAAC,EAAE,QAAQ,EAAE,CAAC,EAC1B,+FAA+F,EAC/F,IAAA,4BAAkB,EAAC,iBAAiB,CAAC,EACrC,QAAQ,IAAI,0BAAe,CAC5B,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,YAAY,gBAevB;AAEK,MAAM,WAAW,GAAG,CAAC,EAC1B,QAAQ,EACR,OAAO,EACP,iBAAiB,EAKlB,EAAE,EAAE;IACH,OAAO,IAAA,oBAAE,EACP,yBAAkB,EAClB,+FAA+F,EAC/F,IAAA,4BAAkB,EAAC,iBAAiB,CAAC,EACrC,QAAQ,IAAI,0BAAe,EAC3B,OAAO,IAAI,mBAAW,CACvB,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,WAAW,eAgBtB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
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/20 before:to-transparent isolate overflow-hidden before:border-t before:border-neutral-100/20";
|
|
2
|
+
//# sourceMappingURL=shimmer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shimmer.d.ts","sourceRoot":"","sources":["../../../src/styles/shimmer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,iQACqO,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
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/20 before:to-transparent isolate overflow-hidden before:border-t before:border-neutral-100/20';
|
|
8
|
+
//# sourceMappingURL=shimmer.js.map
|
|
@@ -0,0 +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,8PAA8P,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
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",
|
|
@@ -31,12 +31,13 @@
|
|
|
31
31
|
"jdenticon": "^3.2.0",
|
|
32
32
|
"postcss": "^8.4.17",
|
|
33
33
|
"qrcode.react": "^3.1.0",
|
|
34
|
+
"rci": "^0.0.3",
|
|
34
35
|
"tailwindcss": "^3.1.8",
|
|
35
36
|
"tailwindcss-logical": "^3.0.0",
|
|
36
37
|
"tailwindcss-radix": "^2.6.0"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@dxos/vite-plugin": "0.1.
|
|
40
|
+
"@dxos/vite-plugin": "0.1.3",
|
|
40
41
|
"@types/react": "^18.0.21",
|
|
41
42
|
"@types/react-dom": "^18.0.6",
|
|
42
43
|
"@vitejs/plugin-react": "^2.0.1",
|
|
@@ -90,7 +90,7 @@ export const AlertDialog = ({
|
|
|
90
90
|
{title}
|
|
91
91
|
</AlertDialogPrimitive.Title>
|
|
92
92
|
{description && (
|
|
93
|
-
<AlertDialogPrimitive.Description className={cx('
|
|
93
|
+
<AlertDialogPrimitive.Description className={cx('my-2', defaultDescription)}>
|
|
94
94
|
{description}
|
|
95
95
|
</AlertDialogPrimitive.Description>
|
|
96
96
|
)}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
import { CodeInput, getSegmentCssWidth } from 'rci';
|
|
7
|
+
import React, { forwardRef, useCallback, ComponentProps } from 'react';
|
|
8
|
+
|
|
9
|
+
import { useForwardedRef, useIsFocused } from '../../hooks';
|
|
10
|
+
import { staticInput } from '../../styles/input';
|
|
11
|
+
import { InputProps } from './InputProps';
|
|
12
|
+
|
|
13
|
+
const bareInputStyleProps = {
|
|
14
|
+
padding: '8px',
|
|
15
|
+
spacing: '8px',
|
|
16
|
+
fontFamily: ''
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type BarePinInputProps = Omit<InputProps, 'ref' | 'label' | 'onChange'> &
|
|
20
|
+
Pick<ComponentProps<typeof CodeInput>, 'onChange' | 'value' | 'length'>;
|
|
21
|
+
|
|
22
|
+
// TODO(thure): supplying a `value` prop to CodeInput does not yield correct controlled input interactivity; this may be an issue with RCI (filed as https://github.com/leonardodino/rci/issues/25).
|
|
23
|
+
export const BarePinInput = forwardRef<HTMLInputElement, BarePinInputProps>(
|
|
24
|
+
({ initialValue, size, validationMessage, validationValence, value, ...inputProps }, ref) => {
|
|
25
|
+
const width = getSegmentCssWidth('13px');
|
|
26
|
+
const inputRef = useForwardedRef(ref);
|
|
27
|
+
const inputFocused = useIsFocused(inputRef);
|
|
28
|
+
|
|
29
|
+
const renderSegment = useCallback<ComponentProps<typeof CodeInput>['renderSegment']>(
|
|
30
|
+
({ state, index }) => (
|
|
31
|
+
<div
|
|
32
|
+
key={index}
|
|
33
|
+
className={staticInput({
|
|
34
|
+
focused: inputFocused && !!state,
|
|
35
|
+
disabled: inputProps.disabled,
|
|
36
|
+
...(validationMessage && { validationValence })
|
|
37
|
+
})}
|
|
38
|
+
data-state={state}
|
|
39
|
+
style={{ width, height: '100%' }}
|
|
40
|
+
/>
|
|
41
|
+
),
|
|
42
|
+
[inputFocused, validationValence, validationMessage, inputProps.disabled]
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<CodeInput
|
|
47
|
+
{...{
|
|
48
|
+
spellCheck: false,
|
|
49
|
+
...inputProps,
|
|
50
|
+
...bareInputStyleProps,
|
|
51
|
+
inputRef,
|
|
52
|
+
className: cx(
|
|
53
|
+
'font-mono selection:bg-transparent',
|
|
54
|
+
inputProps.disabled && 'cursor-not-allowed',
|
|
55
|
+
inputProps.className
|
|
56
|
+
),
|
|
57
|
+
renderSegment
|
|
58
|
+
}}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { InputProps, InputSize } from './InputProps';
|
|
10
|
+
|
|
11
|
+
const sizeMap: Record<InputSize, string> = {
|
|
12
|
+
md: 'text-sm',
|
|
13
|
+
lg: 'text-base',
|
|
14
|
+
pin: ''
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type BareTextInputProps = Omit<InputProps, 'label' | 'initialValue' | 'onChange'> &
|
|
18
|
+
Pick<ComponentProps<'input'>, 'onChange'>;
|
|
19
|
+
|
|
20
|
+
export const BareTextInput = ({ validationValence, validationMessage, size, ...inputProps }: BareTextInputProps) => {
|
|
21
|
+
return (
|
|
22
|
+
<input
|
|
23
|
+
{...inputProps}
|
|
24
|
+
className={cx(
|
|
25
|
+
defaultInput({ disabled: inputProps.disabled, ...(validationMessage && { validationValence }) }),
|
|
26
|
+
'block w-full px-2.5 py-2',
|
|
27
|
+
sizeMap[size ?? 'md']
|
|
28
|
+
)}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -16,6 +16,10 @@ export default {
|
|
|
16
16
|
validationValence: {
|
|
17
17
|
control: 'select',
|
|
18
18
|
options: ['success', 'info', 'warning', 'error']
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
control: 'select',
|
|
22
|
+
options: ['md', 'lg', 'pin']
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
};
|
|
@@ -33,7 +37,8 @@ Default.args = {
|
|
|
33
37
|
labelVisuallyHidden: false,
|
|
34
38
|
descriptionVisuallyHidden: false,
|
|
35
39
|
validationMessage: '',
|
|
36
|
-
validationValence: undefined
|
|
40
|
+
validationValence: undefined,
|
|
41
|
+
length: 6
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
export const Disabled = () => (
|
|
@@ -89,3 +94,15 @@ export const InputWithValidationAndDescription = () => (
|
|
|
89
94
|
}}
|
|
90
95
|
/>
|
|
91
96
|
);
|
|
97
|
+
|
|
98
|
+
export const PinInput = () => (
|
|
99
|
+
<Template
|
|
100
|
+
{...{
|
|
101
|
+
label: 'This input is a PIN-style input',
|
|
102
|
+
size: 'pin',
|
|
103
|
+
length: 6,
|
|
104
|
+
description: 'Type in secret you received',
|
|
105
|
+
placeholder: '••••••'
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
108
|
+
);
|