@clicoh/orion-library 1.2.0-beta.21 → 1.2.0-beta.23
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/assets/avatares/caja-ruedas.svg +1 -0
- package/assets/avatares/cohete-azul.svg +1 -0
- package/assets/avatares/criatura-tres-ojos.svg +1 -0
- package/assets/avatares/cubo-brazos.svg +1 -0
- package/assets/avatares/cubo-morado.svg +1 -0
- package/assets/avatares/dino-placas-amarillas.svg +1 -0
- package/assets/avatares/dino-placas-azules.svg +1 -0
- package/assets/avatares/edificio-cupulas.svg +1 -0
- package/assets/avatares/globo-anillo.svg +1 -0
- package/assets/avatares/pulpo-morado.svg +1 -0
- package/assets/avatares/robot-lente.svg +1 -0
- package/assets/avatares/ventana-codigo.svg +1 -0
- package/assets/css/expresivo.css +37 -0
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts +11 -3
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx +13 -5
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx.map +1 -1
- package/dist/components/01-atoms/OtpInput/OtpInput.d.ts +1 -1
- package/dist/components/01-atoms/OtpInput/OtpInput.jsx +3 -2
- package/dist/components/01-atoms/OtpInput/OtpInput.jsx.map +1 -1
- package/dist/components/02-molecules/ActionMenu/ActionMenu.d.ts +39 -0
- package/dist/components/02-molecules/ActionMenu/ActionMenu.d.ts.map +1 -0
- package/dist/components/02-molecules/ActionMenu/ActionMenu.jsx +36 -0
- package/dist/components/02-molecules/ActionMenu/ActionMenu.jsx.map +1 -0
- package/dist/components/02-molecules/ActionMenu/index.d.ts +2 -0
- package/dist/components/02-molecules/ActionMenu/index.d.ts.map +1 -0
- package/dist/components/02-molecules/ActionMenu/index.js +2 -0
- package/dist/components/02-molecules/ActionMenu/index.js.map +1 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewer.d.ts +35 -3
- package/dist/components/02-molecules/ImageViewer/ImageViewer.d.ts.map +1 -1
- package/dist/components/02-molecules/ImageViewer/ImageViewer.jsx +193 -31
- package/dist/components/02-molecules/ImageViewer/ImageViewer.jsx.map +1 -1
- package/dist/components/02-molecules/ImageViewer/ImageViewerDocument.d.ts +52 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerDocument.d.ts.map +1 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerDocument.jsx +78 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerDocument.jsx.map +1 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.d.ts +8 -2
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.d.ts.map +1 -1
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.jsx +10 -4
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.jsx.map +1 -1
- package/dist/components/02-molecules/ImageViewer/usePdfPages.d.ts +20 -0
- package/dist/components/02-molecules/ImageViewer/usePdfPages.d.ts.map +1 -0
- package/dist/components/02-molecules/ImageViewer/usePdfPages.js +113 -0
- package/dist/components/02-molecules/ImageViewer/usePdfPages.js.map +1 -0
- package/dist/components/02-molecules/Tab/TabList.d.ts.map +1 -1
- package/dist/components/02-molecules/Tab/TabList.jsx +10 -6
- package/dist/components/02-molecules/Tab/TabList.jsx.map +1 -1
- package/dist/components/02-molecules/index.d.ts +1 -0
- package/dist/components/02-molecules/index.d.ts.map +1 -1
- package/dist/components/02-molecules/index.js +1 -0
- package/dist/components/02-molecules/index.js.map +1 -1
- package/dist/components/03-organisms/BarChart/BarChart.d.ts +52 -0
- package/dist/components/03-organisms/BarChart/BarChart.d.ts.map +1 -0
- package/dist/components/03-organisms/BarChart/BarChart.jsx +116 -0
- package/dist/components/03-organisms/BarChart/BarChart.jsx.map +1 -0
- package/dist/components/03-organisms/BarChart/index.d.ts +2 -0
- package/dist/components/03-organisms/BarChart/index.d.ts.map +1 -0
- package/dist/components/03-organisms/BarChart/index.js +2 -0
- package/dist/components/03-organisms/BarChart/index.js.map +1 -0
- package/dist/components/03-organisms/DataTable/DataTable.d.ts +5 -2
- package/dist/components/03-organisms/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/03-organisms/DataTable/DataTable.jsx +10 -7
- package/dist/components/03-organisms/DataTable/DataTable.jsx.map +1 -1
- package/dist/components/03-organisms/index.d.ts +1 -0
- package/dist/components/03-organisms/index.d.ts.map +1 -1
- package/dist/components/03-organisms/index.js +1 -0
- package/dist/components/03-organisms/index.js.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.d.ts +6 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.jsx +29 -7
- package/dist/components/04-templates/LoginTemplate/LoginForm.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepThree.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepThree.jsx +8 -4
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepThree.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepTwo.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepTwo.jsx +10 -3
- package/dist/components/04-templates/LoginTemplate/SetupMfa/StepTwo.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/index.d.ts +1 -1
- package/dist/components/04-templates/LoginTemplate/index.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/submitOnEnter.d.ts +9 -0
- package/dist/components/04-templates/LoginTemplate/submitOnEnter.d.ts.map +1 -0
- package/dist/components/04-templates/LoginTemplate/submitOnEnter.js +15 -0
- package/dist/components/04-templates/LoginTemplate/submitOnEnter.js.map +1 -0
- package/expresivo/ExpAccentNote/ExpAccentNote.d.ts +25 -0
- package/expresivo/ExpAccentNote/ExpAccentNote.d.ts.map +1 -0
- package/expresivo/ExpAccentNote/ExpAccentNote.jsx +47 -0
- package/expresivo/ExpAccentNote/ExpAccentNote.jsx.map +1 -0
- package/expresivo/ExpAccentNote/index.d.ts +2 -0
- package/expresivo/ExpAccentNote/index.d.ts.map +1 -0
- package/expresivo/ExpAccentNote/index.js +2 -0
- package/expresivo/ExpAccentNote/index.js.map +1 -0
- package/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.d.ts +29 -0
- package/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.d.ts.map +1 -0
- package/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.jsx +44 -0
- package/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.jsx.map +1 -0
- package/expresivo/ExpCodeHostIcon/index.d.ts +2 -0
- package/expresivo/ExpCodeHostIcon/index.d.ts.map +1 -0
- package/expresivo/ExpCodeHostIcon/index.js +2 -0
- package/expresivo/ExpCodeHostIcon/index.js.map +1 -0
- package/expresivo/ExpFigureBand/ExpFigureBand.d.ts +61 -0
- package/expresivo/ExpFigureBand/ExpFigureBand.d.ts.map +1 -0
- package/expresivo/ExpFigureBand/ExpFigureBand.jsx +102 -0
- package/expresivo/ExpFigureBand/ExpFigureBand.jsx.map +1 -0
- package/expresivo/ExpFigureBand/index.d.ts +2 -0
- package/expresivo/ExpFigureBand/index.d.ts.map +1 -0
- package/expresivo/ExpFigureBand/index.js +2 -0
- package/expresivo/ExpFigureBand/index.js.map +1 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.d.ts +13 -2
- package/expresivo/ExpGrowBar/ExpGrowBar.d.ts.map +1 -1
- package/expresivo/ExpGrowBar/ExpGrowBar.jsx +16 -4
- package/expresivo/ExpGrowBar/ExpGrowBar.jsx.map +1 -1
- package/expresivo/ExpRepoAvatar/ExpRepoAvatar.d.ts +3 -0
- package/expresivo/ExpRepoAvatar/ExpRepoAvatar.d.ts.map +1 -1
- package/expresivo/ExpRepoAvatar/ExpRepoAvatar.jsx +3 -0
- package/expresivo/ExpRepoAvatar/ExpRepoAvatar.jsx.map +1 -1
- package/expresivo/ExpRepoAvatar/catalog.d.ts +6 -2
- package/expresivo/ExpRepoAvatar/catalog.d.ts.map +1 -1
- package/expresivo/ExpRepoAvatar/catalog.js +29 -1
- package/expresivo/ExpRepoAvatar/catalog.js.map +1 -1
- package/expresivo/ExpSplitCard/ExpSplitCard.d.ts +38 -0
- package/expresivo/ExpSplitCard/ExpSplitCard.d.ts.map +1 -0
- package/expresivo/ExpSplitCard/ExpSplitCard.jsx +48 -0
- package/expresivo/ExpSplitCard/ExpSplitCard.jsx.map +1 -0
- package/expresivo/ExpSplitCard/index.d.ts +2 -0
- package/expresivo/ExpSplitCard/index.d.ts.map +1 -0
- package/expresivo/ExpSplitCard/index.js +2 -0
- package/expresivo/ExpSplitCard/index.js.map +1 -0
- package/expresivo/ExpStatusTag/ExpStatusTag.d.ts +26 -0
- package/expresivo/ExpStatusTag/ExpStatusTag.d.ts.map +1 -0
- package/expresivo/ExpStatusTag/ExpStatusTag.jsx +44 -0
- package/expresivo/ExpStatusTag/ExpStatusTag.jsx.map +1 -0
- package/expresivo/ExpStatusTag/index.d.ts +2 -0
- package/expresivo/ExpStatusTag/index.d.ts.map +1 -0
- package/expresivo/ExpStatusTag/index.js +2 -0
- package/expresivo/ExpStatusTag/index.js.map +1 -0
- package/expresivo/index.d.ts +5 -0
- package/expresivo/index.d.ts.map +1 -1
- package/expresivo/index.js +5 -0
- package/expresivo/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginForm.d.ts","sourceRoot":"","sources":["../../../../src/components/04-templates/LoginTemplate/LoginForm.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"LoginForm.d.ts","sourceRoot":"","sources":["../../../../src/components/04-templates/LoginTemplate/LoginForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,SAAS,EAIV,MAAM,OAAO,CAAC;AAYf,OAAO,EAAY,KAAK,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAGxE,0EAA0E;A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AC;IAC3B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAC;IAC1D,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAaF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,UAAc,EACd,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,2BAA2B,EAC3B,KAAqB,EACrB,WAAW,EACX,MAAM,EACN,cAAc,EACd,MAAM,EACN,YAAY,EACZ,UAAmB,EACnB,WAAkB,EAClB,WAAkB,EAClB,UAAsB,EACtB,MAAM,GACP,EAAE,cAAc,GAAG,SAAS,CAoL5B"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useEffect, useRef, useState, } from 'react';
|
|
4
4
|
import { FiArrowRight } from 'react-icons/fi';
|
|
5
5
|
import { Button, Heading, Input, OtpInput, Paragraph, showToast, Spinner, } from '../../01-atoms';
|
|
6
6
|
import { InlineMessage } from '../../02-molecules';
|
|
7
7
|
import { SetupMfa } from './SetupMfa';
|
|
8
|
+
import { submitOnEnter } from './submitOnEnter';
|
|
9
|
+
const READ_ONLY_TEXT = 'read-only:text-gray-1 dark:read-only:text-gray-2 read-only:focus:text-gray-1 dark:read-only:focus:text-gray-2';
|
|
8
10
|
const DEFAULT_LABELS = {
|
|
9
11
|
username: 'Usuario',
|
|
10
12
|
password: 'Contraseña',
|
|
@@ -61,21 +63,38 @@ const DEFAULT_LABELS = {
|
|
|
61
63
|
* @param {'text' | 'message'} [props.errorStyle='text'] - `text` shows the error as red text under the buttons; `message` as an error `InlineMessage` above the submit button.
|
|
62
64
|
* @param {boolean} [props.toastErrors=true] - Also shows each error in a toast.
|
|
63
65
|
* @param {boolean} [props.showSpinner=true] - Shows a spinner under the form while `login` runs. Turn it off when `renderSubmit` already shows the wait.
|
|
66
|
+
* @param {'replace' | 'below'} [props.codeLayout='replace'] - `replace` swaps the email and password for the code step; `below` keeps them on screen, read-only, with the code under them, and leaves them read-only instead of disabled while `login` runs. With `below` the browser only takes the sign-in as done when the code is accepted, not when the code step shows up.
|
|
67
|
+
* @param {Function} [props.onBack] - Called when the user leaves the code step or the MFA setup to edit the email and password.
|
|
64
68
|
*
|
|
65
69
|
* @returns {ReactNode} The rendered LoginForm component.
|
|
66
70
|
*/
|
|
67
|
-
export function LoginForm({ login, callback, needCode = false, lengthCode = 6, setupMfa, showPasswordAriaLabel, hidePasswordAriaLabel, getOtpDigitAriaLabel, loadingLabel, setupMfaAccessibilityLabels, title = 'Bienvenido!', description, labels, forgotPassword, footer, renderSubmit, errorStyle = 'text', toastErrors = true, showSpinner = true, }) {
|
|
71
|
+
export function LoginForm({ login, callback, needCode = false, lengthCode = 6, setupMfa, showPasswordAriaLabel, hidePasswordAriaLabel, getOtpDigitAriaLabel, loadingLabel, setupMfaAccessibilityLabels, title = 'Bienvenido!', description, labels, forgotPassword, footer, renderSubmit, errorStyle = 'text', toastErrors = true, showSpinner = true, codeLayout = 'replace', onBack, }) {
|
|
68
72
|
const [errorMessage, setErrorMessage] = useState();
|
|
69
73
|
const [otpCode, setOtpCode] = useState('');
|
|
70
74
|
const [isPending, setIsPending] = useState(false);
|
|
71
75
|
const [qr, setQr] = useState();
|
|
72
76
|
const [showLogin, setShowLogin] = useState(!needCode);
|
|
77
|
+
const codeRef = useRef(null);
|
|
73
78
|
const copy = { ...DEFAULT_LABELS, ...labels };
|
|
79
|
+
const showCredentials = showLogin || codeLayout === 'below';
|
|
80
|
+
// Chrome takes the sign-in as done when no field of the form can take focus once the request ends.
|
|
81
|
+
const lockedCredentials = !showLogin || (isPending && codeLayout === 'below');
|
|
82
|
+
const credentialState = {
|
|
83
|
+
disabled: isPending && codeLayout !== 'below',
|
|
84
|
+
readOnly: lockedCredentials,
|
|
85
|
+
className: lockedCredentials ? READ_ONLY_TEXT : undefined,
|
|
86
|
+
};
|
|
74
87
|
useEffect(() => {
|
|
75
88
|
setShowLogin(!needCode);
|
|
76
89
|
}, [needCode]);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (!showLogin && !qr)
|
|
92
|
+
codeRef.current?.querySelector('input')?.focus();
|
|
93
|
+
}, [showLogin, qr]);
|
|
77
94
|
const handlerSubmit = (event) => {
|
|
78
95
|
event.preventDefault();
|
|
96
|
+
if (isPending)
|
|
97
|
+
return;
|
|
79
98
|
setIsPending(true);
|
|
80
99
|
setErrorMessage(undefined);
|
|
81
100
|
const formData = new FormData(event.currentTarget);
|
|
@@ -100,6 +119,7 @@ export function LoginForm({ login, callback, needCode = false, lengthCode = 6, s
|
|
|
100
119
|
setQr(undefined);
|
|
101
120
|
setOtpCode('');
|
|
102
121
|
setShowLogin(true);
|
|
122
|
+
onBack?.();
|
|
103
123
|
};
|
|
104
124
|
const handleSetupMfa = (firstCode, secondCode) => {
|
|
105
125
|
return setupMfa?.(firstCode, secondCode);
|
|
@@ -118,25 +138,27 @@ export function LoginForm({ login, callback, needCode = false, lengthCode = 6, s
|
|
|
118
138
|
{description}
|
|
119
139
|
</Paragraph>)}
|
|
120
140
|
</div>
|
|
121
|
-
<form onSubmit={handlerSubmit} aria-busy={isPending} className="flex w-72 flex-col items-center gap-4">
|
|
122
|
-
{!!
|
|
141
|
+
<form onSubmit={handlerSubmit} onKeyDown={submitOnEnter} aria-busy={isPending} className="flex w-72 flex-col items-center gap-4">
|
|
142
|
+
{!!showCredentials && (<>
|
|
123
143
|
<Input label={copy.username} input={{
|
|
124
144
|
type: 'email',
|
|
125
145
|
name: 'username',
|
|
126
146
|
required: true,
|
|
127
147
|
autoComplete: 'email',
|
|
128
|
-
|
|
148
|
+
...credentialState,
|
|
129
149
|
}}/>
|
|
130
150
|
<Input label={copy.password} showPasswordAriaLabel={showPasswordAriaLabel} hidePasswordAriaLabel={hidePasswordAriaLabel} input={{
|
|
131
151
|
type: 'password',
|
|
132
152
|
name: 'password',
|
|
133
153
|
required: true,
|
|
134
154
|
autoComplete: 'current-password',
|
|
135
|
-
|
|
155
|
+
...credentialState,
|
|
136
156
|
}}/>
|
|
137
157
|
</>)}
|
|
138
158
|
|
|
139
|
-
{!showLogin && (<
|
|
159
|
+
{!showLogin && (<div ref={codeRef} className="w-full">
|
|
160
|
+
<OtpInput label={copy.code} length={lengthCode} handleSubmit={(otp) => setOtpCode(otp)} getDigitAriaLabel={getOtpDigitAriaLabel}/>
|
|
161
|
+
</div>)}
|
|
140
162
|
|
|
141
163
|
{errorStyle === 'message' && !!errorMessage && (<InlineMessage modifier="error" className="w-full">
|
|
142
164
|
{errorMessage}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginForm.jsx","sourceRoot":"","sources":["../../../../src/components/04-templates/LoginTemplate/LoginForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"LoginForm.jsx","sourceRoot":"","sources":["../../../../src/components/04-templates/LoginTemplate/LoginForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAGL,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,QAAQ,EACR,S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AC,KAAK,CAAC,CAAC,YAAY,CAAC,EAC/B;cAAA,EAAE,GAAG,CAAC,CACP,CACH;UAAA,EAAE,IAAI,CACN;UAAA,CAAC,MAAM,CACT;QAAA,GAAG,CACJ,CACD;MAAA,CAAC,CAAC,CAAC,EAAE,IAAI,CACP,CAAC,QAAQ,CACP,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,OAAO,CAAC,CAAC,EAAE,CAAC,CACZ,QAAQ,CAAC,CAAC,cAAc,CAAC,CACzB,mBAAmB,CAAC,CAAC,2BAA2B,CAAC,EACjD,CACH,CACH;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepThree.d.ts","sourceRoot":"","sources":["../../../../../src/components/04-templates/LoginTemplate/SetupMfa/StepThree.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StepThree.d.ts","sourceRoot":"","sources":["../../../../../src/components/04-templates/LoginTemplate/SetupMfa/StepThree.tsx"],"names":[],"mappings":"AAWA,KAAK,cAAc,GAAG;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,CACN,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,UAAc,EACd,iBAAiB,EACjB,YAAY,GACb,EAAE,cAAc,+BAgGhB"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Button, Heading, OtpInput, Paragraph, Spinner, } from '../../../01-atoms';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { submitOnEnter } from '../submitOnEnter';
|
|
4
5
|
export function StepThree({ previousCode, previousStep, nextStep, onCancel, submit, lengthCode = 4, getDigitAriaLabel, loadingLabel, }) {
|
|
5
6
|
const [secondCode, setSecondCode] = useState('');
|
|
6
7
|
const [errorMessage, setErrorMessage] = useState('');
|
|
7
8
|
const [isPending, setIsPending] = useState(false);
|
|
8
|
-
const handleSubmit =
|
|
9
|
+
const handleSubmit = (event) => {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
if (secondCode.length < lengthCode || isPending)
|
|
12
|
+
return;
|
|
9
13
|
setIsPending(true);
|
|
10
14
|
submit?.(previousCode, secondCode)
|
|
11
15
|
?.then(() => {
|
|
@@ -18,7 +22,7 @@ export function StepThree({ previousCode, previousStep, nextStep, onCancel, subm
|
|
|
18
22
|
setIsPending(false);
|
|
19
23
|
});
|
|
20
24
|
};
|
|
21
|
-
return (<
|
|
25
|
+
return (<form noValidate onSubmit={handleSubmit} onKeyDown={submitOnEnter} aria-busy={isPending} className="col-1 flex w-72 flex-col items-center text-black dark:text-white">
|
|
22
26
|
<Heading className="mb-4" level="h7">
|
|
23
27
|
Configurar autenticación
|
|
24
28
|
</Heading>
|
|
@@ -36,7 +40,7 @@ export function StepThree({ previousCode, previousStep, nextStep, onCancel, subm
|
|
|
36
40
|
|
|
37
41
|
<OtpInput label="Codigo de Verificación 2" length={lengthCode} handleSubmit={setSecondCode} error={errorMessage} className="dark:[&_.text-error]:text-error-1" getDigitAriaLabel={getDigitAriaLabel}/>
|
|
38
42
|
|
|
39
|
-
<Button disabled={secondCode?.length < lengthCode || isPending} modifier="principal" className="my-2 w-full" type="
|
|
43
|
+
<Button disabled={secondCode?.length < lengthCode || isPending} modifier="principal" className="my-2 w-full" type="submit" aria-disabled={isPending}>
|
|
40
44
|
Verificar y Completar
|
|
41
45
|
</Button>
|
|
42
46
|
|
|
@@ -53,6 +57,6 @@ export function StepThree({ previousCode, previousStep, nextStep, onCancel, subm
|
|
|
53
57
|
<div className={clsx('mt-4 self-center', !isPending && 'invisible opacity-0')}>
|
|
54
58
|
<Spinner label={loadingLabel}/>
|
|
55
59
|
</div>
|
|
56
|
-
</
|
|
60
|
+
</form>);
|
|
57
61
|
}
|
|
58
62
|
//# sourceMappingURL=StepThree.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepThree.jsx","sourceRoot":"","sources":["../../../../../src/components/04-templates/LoginTemplate/SetupMfa/StepThree.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,GACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"StepThree.jsx","sourceRoot":"","sources":["../../../../../src/components/04-templates/LoginTemplate/SetupMfa/StepThree.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,GACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBjD,MAAM,UAAU,SAAS,CAAC,EACxB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,UAAU,GAAG,CAAC,EACd,iBAAiB,EACjB,YAAY,GACG;IACf,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IACzD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,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fa/StepTwo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StepTwo.d.ts","sourceRoot":"","sources":["../../../../../src/components/04-templates/LoginTemplate/SetupMfa/StepTwo.tsx"],"names":[],"mappings":"AAIA,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,iBAAiB,GAClB,EAAE,YAAY,+BA6Dd"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Button, Heading, OtpInput, Paragraph } from '../../../01-atoms';
|
|
3
|
+
import { submitOnEnter } from '../submitOnEnter';
|
|
3
4
|
export function StepTwo({ nextStep, previousStep, onCancel, getDigitAriaLabel, }) {
|
|
4
5
|
const [code, setCode] = useState('');
|
|
5
|
-
|
|
6
|
+
const handleSubmit = (event) => {
|
|
7
|
+
event.preventDefault();
|
|
8
|
+
if (code.length < 6)
|
|
9
|
+
return;
|
|
10
|
+
nextStep(code);
|
|
11
|
+
};
|
|
12
|
+
return (<form noValidate onSubmit={handleSubmit} onKeyDown={submitOnEnter} className="flex w-72 flex-col items-center text-black dark:text-white">
|
|
6
13
|
<Heading className="mb-4" level="h7">
|
|
7
14
|
Configurar autenticación
|
|
8
15
|
</Heading>
|
|
@@ -13,7 +20,7 @@ export function StepTwo({ nextStep, previousStep, onCancel, getDigitAriaLabel, }
|
|
|
13
20
|
|
|
14
21
|
<OtpInput label="Codigo de Verificación 1" length={6} handleSubmit={(otp) => setCode(otp)} getDigitAriaLabel={getDigitAriaLabel}/>
|
|
15
22
|
|
|
16
|
-
<Button modifier="principal" className="my-2 w-full" type="
|
|
23
|
+
<Button modifier="principal" className="my-2 w-full" type="submit" disabled={code.length < 6}>
|
|
17
24
|
Continuar
|
|
18
25
|
</Button>
|
|
19
26
|
|
|
@@ -26,6 +33,6 @@ export function StepTwo({ nextStep, previousStep, onCancel, getDigitAriaLabel, }
|
|
|
26
33
|
Atrás
|
|
27
34
|
</Button>
|
|
28
35
|
</div>
|
|
29
|
-
</
|
|
36
|
+
</form>);
|
|
30
37
|
}
|
|
31
38
|
//# sourceMappingURL=StepTwo.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepTwo.jsx","sourceRoot":"","sources":["../../../../../src/components/04-templates/LoginTemplate/SetupMfa/StepTwo.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"StepTwo.jsx","sourceRoot":"","sources":["../../../../../src/components/04-templates/LoginTemplate/SetupMfa/StepTwo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AASjD,MAAM,UAAU,OAAO,CAAC,EACtB,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,iBAAiB,GACJ;IACb,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAE7C,MAAM,YAAY,GAAG,CAAC,KAAiC,EAAE,EAAE;QACzD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO;QAC5B,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CACH,UAAU,CACV,QAAQ,CAAC,CAAC,YAAY,CAAC,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Labels, LoginFormSubmitState, } from './LoginForm';
|
|
3
|
+
export type { LoginFormCodeLayout, LoginFormErrorStyle, LoginFormLabels, LoginFormSubmitState, } from './LoginForm';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/04-templates/LoginTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/04-templates/LoginTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { KeyboardEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Submits the form on Enter in one of its fields. The browser does not submit when something
|
|
4
|
+
* else, such as an extension, cancels the key first.
|
|
5
|
+
*
|
|
6
|
+
* @param {KeyboardEvent<HTMLFormElement>} event - The `keydown` of the form.
|
|
7
|
+
*/
|
|
8
|
+
export declare function submitOnEnter(event: KeyboardEvent<HTMLFormElement>): void;
|
|
9
|
+
//# sourceMappingURL=submitOnEnter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitOnEnter.d.ts","sourceRoot":"","sources":["../../../../src/components/04-templates/LoginTemplate/submitOnEnter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,GAAG,IAAI,CAKzE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Submits the form on Enter in one of its fields. The browser does not submit when something
|
|
3
|
+
* else, such as an extension, cancels the key first.
|
|
4
|
+
*
|
|
5
|
+
* @param {KeyboardEvent<HTMLFormElement>} event - The `keydown` of the form.
|
|
6
|
+
*/
|
|
7
|
+
export function submitOnEnter(event) {
|
|
8
|
+
if (event.key !== 'Enter' || event.nativeEvent.isComposing)
|
|
9
|
+
return;
|
|
10
|
+
if (!(event.target instanceof HTMLInputElement))
|
|
11
|
+
return;
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
event.currentTarget.requestSubmit();
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=submitOnEnter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitOnEnter.js","sourceRoot":"","sources":["../../../../src/components/04-templates/LoginTemplate/submitOnEnter.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAqC;IACjE,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,WAAW;QAAE,OAAO;IACnE,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,YAAY,gBAAgB,CAAC;QAAE,OAAO;IACxD,KAAK,CAAC,cAAc,EAAE,CAAC;IACvB,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ExpAccentNoteProps = {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
6
|
+
/**
|
|
7
|
+
* Short note with a thin clicOH gradient bar on its left: an uppercase `label`
|
|
8
|
+
* in the accent color and a line or two of gray text under it. For one fact
|
|
9
|
+
* under a page title, such as the scope a page covers. The bar is decorative.
|
|
10
|
+
*
|
|
11
|
+
* Outside an `ExpScope` it falls back to two core `Paragraph`s: the label in
|
|
12
|
+
* semibold and the text in gray.
|
|
13
|
+
*
|
|
14
|
+
* @component
|
|
15
|
+
* @example
|
|
16
|
+
* <ExpAccentNote label="Authorized scope · v1">38 repos, 18 high priority.</ExpAccentNote>
|
|
17
|
+
*
|
|
18
|
+
* @param {ExpAccentNoteProps} props - The properties of the ExpAccentNote component.
|
|
19
|
+
* @param {ReactNode} props.label - Short line above the text, shown in uppercase.
|
|
20
|
+
* @param {ReactNode} props.children - Text of the note.
|
|
21
|
+
*
|
|
22
|
+
* @returns {ReactNode} The note, or two core `Paragraph`s outside an `ExpScope`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ExpAccentNote({ label, children, ...restProps }: ExpAccentNoteProps): ReactNode;
|
|
25
|
+
//# sourceMappingURL=ExpAccentNote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpAccentNote.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpAccentNote/ExpAccentNote.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CAmChC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Paragraph } from '@clicoh/orion-library';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useExpScope } from '../ExpScope/ExpScope';
|
|
5
|
+
/**
|
|
6
|
+
* Short note with a thin clicOH gradient bar on its left: an uppercase `label`
|
|
7
|
+
* in the accent color and a line or two of gray text under it. For one fact
|
|
8
|
+
* under a page title, such as the scope a page covers. The bar is decorative.
|
|
9
|
+
*
|
|
10
|
+
* Outside an `ExpScope` it falls back to two core `Paragraph`s: the label in
|
|
11
|
+
* semibold and the text in gray.
|
|
12
|
+
*
|
|
13
|
+
* @component
|
|
14
|
+
* @example
|
|
15
|
+
* <ExpAccentNote label="Authorized scope · v1">38 repos, 18 high priority.</ExpAccentNote>
|
|
16
|
+
*
|
|
17
|
+
* @param {ExpAccentNoteProps} props - The properties of the ExpAccentNote component.
|
|
18
|
+
* @param {ReactNode} props.label - Short line above the text, shown in uppercase.
|
|
19
|
+
* @param {ReactNode} props.children - Text of the note.
|
|
20
|
+
*
|
|
21
|
+
* @returns {ReactNode} The note, or two core `Paragraph`s outside an `ExpScope`.
|
|
22
|
+
*/
|
|
23
|
+
export function ExpAccentNote({ label, children, ...restProps }) {
|
|
24
|
+
const inScope = useExpScope();
|
|
25
|
+
if (!inScope) {
|
|
26
|
+
return (<div {...restProps} className={clsx('flex flex-col gap-0.5', restProps.className)}>
|
|
27
|
+
<Paragraph size="body-2" weight="semibold">
|
|
28
|
+
{label}
|
|
29
|
+
</Paragraph>
|
|
30
|
+
<Paragraph size="body-2" className="text-gray-1 dark:text-gray-2">
|
|
31
|
+
{children}
|
|
32
|
+
</Paragraph>
|
|
33
|
+
</div>);
|
|
34
|
+
}
|
|
35
|
+
return (<div {...restProps} className={clsx('flex gap-3', restProps.className)}>
|
|
36
|
+
<span aria-hidden="true" className="from-lavender via-violet to-warning w-[3px] shrink-0 rounded-[3px] bg-linear-to-b via-60%"/>
|
|
37
|
+
<div className="flex min-w-0 flex-col gap-0.5">
|
|
38
|
+
<p className="text-lavender dark:text-lavender-dark text-xs leading-4 font-semibold tracking-[0.04em] uppercase">
|
|
39
|
+
{label}
|
|
40
|
+
</p>
|
|
41
|
+
<p className="text-gray-1 dark:text-gray-2 text-sm leading-[22px] text-pretty">
|
|
42
|
+
{children}
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
</div>);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=ExpAccentNote.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpAccentNote.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpAccentNote/ExpAccentNote.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOnD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,GAAG,SAAS,EACO;IACnB,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAE9B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CACL,CAAC,GAAG,CACF,IAAI,SAAS,CAAC,CACd,SAAS,CAAC,CAAC,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAE9D;QAAA,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CACxC;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,SAAS,CACX;QAAA,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,8BAA8B,CAC/D;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,SAAS,CACb;MAAA,EAAE,GAAG,CAAC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CACrE;MAAA,CAAC,IAAI,CACH,WAAW,CAAC,MAAM,CAClB,SAAS,CAAC,2FAA2F,EAEvG;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,+BAA+B,CAC5C;QAAA,CAAC,CAAC,CAAC,SAAS,CAAC,mGAAmG,CAC9G;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,CAAC,CACH;QAAA,CAAC,CAAC,CAAC,SAAS,CAAC,iEAAiE,CAC5E;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,CAAC,CACL;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpAccentNote/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpAccentNote/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ExpCodeHostName = 'github' | 'bitbucket';
|
|
3
|
+
export type ExpCodeHostIconProps = {
|
|
4
|
+
name: ExpCodeHostName;
|
|
5
|
+
/** Width and height on screen, in pixels. */
|
|
6
|
+
size?: number;
|
|
7
|
+
} & Omit<HTMLAttributes<HTMLSpanElement>, 'children'>;
|
|
8
|
+
/**
|
|
9
|
+
* Mark of the service that hosts a repository, to put before its name, such as
|
|
10
|
+
* in an origin column. Decorative: always `aria-hidden`, so the name next to it
|
|
11
|
+
* carries the meaning.
|
|
12
|
+
*
|
|
13
|
+
* Outside an `ExpScope` it renders nothing.
|
|
14
|
+
*
|
|
15
|
+
* @component
|
|
16
|
+
* @example
|
|
17
|
+
* <span className="flex items-center gap-2">
|
|
18
|
+
* <ExpCodeHostIcon name="github" />
|
|
19
|
+
* GitHub
|
|
20
|
+
* </span>
|
|
21
|
+
*
|
|
22
|
+
* @param {ExpCodeHostIconProps} props - The properties of the ExpCodeHostIcon component.
|
|
23
|
+
* @param {'github' | 'bitbucket'} props.name - The hosting service.
|
|
24
|
+
* @param {number} [props.size=20] - Width and height on screen, in pixels.
|
|
25
|
+
*
|
|
26
|
+
* @returns {ReactNode} The mark, or nothing outside an `ExpScope`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ExpCodeHostIcon({ name, size, ...restProps }: ExpCodeHostIconProps): ReactNode;
|
|
29
|
+
//# sourceMappingURL=ExpCodeHostIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpCodeHostIcon.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,WAAW,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,eAAe,CAAC;IACtB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,CAAC;AActD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,IAAS,EACT,GAAG,SAAS,EACb,EAAE,oBAAoB,GAAG,SAAS,CAoBlC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { FaBitbucket, FaGithub } from 'react-icons/fa';
|
|
4
|
+
import { useExpScope } from '../ExpScope/ExpScope';
|
|
5
|
+
const iconMap = {
|
|
6
|
+
github: FaGithub,
|
|
7
|
+
bitbucket: FaBitbucket,
|
|
8
|
+
};
|
|
9
|
+
// GitHub's mark is monochrome, so it follows the text; Bitbucket keeps its blue,
|
|
10
|
+
// which the `info` token matches.
|
|
11
|
+
const colorMap = {
|
|
12
|
+
github: 'text-black dark:text-white',
|
|
13
|
+
bitbucket: 'text-info dark:text-info-dark',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Mark of the service that hosts a repository, to put before its name, such as
|
|
17
|
+
* in an origin column. Decorative: always `aria-hidden`, so the name next to it
|
|
18
|
+
* carries the meaning.
|
|
19
|
+
*
|
|
20
|
+
* Outside an `ExpScope` it renders nothing.
|
|
21
|
+
*
|
|
22
|
+
* @component
|
|
23
|
+
* @example
|
|
24
|
+
* <span className="flex items-center gap-2">
|
|
25
|
+
* <ExpCodeHostIcon name="github" />
|
|
26
|
+
* GitHub
|
|
27
|
+
* </span>
|
|
28
|
+
*
|
|
29
|
+
* @param {ExpCodeHostIconProps} props - The properties of the ExpCodeHostIcon component.
|
|
30
|
+
* @param {'github' | 'bitbucket'} props.name - The hosting service.
|
|
31
|
+
* @param {number} [props.size=20] - Width and height on screen, in pixels.
|
|
32
|
+
*
|
|
33
|
+
* @returns {ReactNode} The mark, or nothing outside an `ExpScope`.
|
|
34
|
+
*/
|
|
35
|
+
export function ExpCodeHostIcon({ name, size = 20, ...restProps }) {
|
|
36
|
+
const inScope = useExpScope();
|
|
37
|
+
if (!inScope)
|
|
38
|
+
return null;
|
|
39
|
+
const Icon = iconMap[name];
|
|
40
|
+
return (<span {...restProps} aria-hidden="true" className={clsx('inline-flex shrink-0', colorMap[name], restProps.className)}>
|
|
41
|
+
<Icon size={size}/>
|
|
42
|
+
</span>);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=ExpCodeHostIcon.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpCodeHostIcon.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpCodeHostIcon/ExpCodeHostIcon.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAUnD,MAAM,OAAO,GAAsC;IACjD,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,iFAAiF;AACjF,kCAAkC;AAClC,MAAM,QAAQ,GAAoC;IAChD,MAAM,EAAE,4BAA4B;IACpC,SAAS,EAAE,+BAA+B;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,GAAG,SAAS,EACS;IACrB,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAE9B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B,OAAO,CACL,CAAC,IAAI,CACH,IAAI,SAAS,CAAC,CACd,WAAW,CAAC,MAAM,CAClB,SAAS,CAAC,CAAC,IAAI,CACb,sBAAsB,EACtB,QAAQ,CAAC,IAAI,CAAC,EACd,SAAS,CAAC,SAAS,CACpB,CAAC,CAEF;MAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EACnB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpCodeHostIcon/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpCodeHostIcon/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ExpFigureBandTone = 'accent' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type ExpFigure = {
|
|
4
|
+
/** The figure, already formatted. */
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
/** What the figure measures. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Short context under the label. */
|
|
9
|
+
hint?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ExpFigureHighlight = ExpFigure & {
|
|
12
|
+
/** Short uppercase line above the label, in the tone color. */
|
|
13
|
+
eyebrow?: string;
|
|
14
|
+
/** Color of the eyebrow. Never the only signal: the eyebrow says it in words. */
|
|
15
|
+
tone?: ExpFigureBandTone;
|
|
16
|
+
};
|
|
17
|
+
export type ExpFigureBandProps = {
|
|
18
|
+
/** The main figure, large, at the start of the band. */
|
|
19
|
+
lead: ExpFigureHighlight;
|
|
20
|
+
/** Smaller figures, in the middle. */
|
|
21
|
+
figures?: ExpFigure[];
|
|
22
|
+
/** A figure to act on, large, at the end of the band: a gap, a backlog. */
|
|
23
|
+
callout?: ExpFigureHighlight;
|
|
24
|
+
/** Holds the space with placeholders while the values load. */
|
|
25
|
+
isLoading?: boolean;
|
|
26
|
+
} & Omit<HTMLAttributes<HTMLElement>, 'children'>;
|
|
27
|
+
/**
|
|
28
|
+
* One band with the figures that sum up a list: a large figure at the start,
|
|
29
|
+
* smaller ones in the middle and, at the end, a large one to act on, such as a
|
|
30
|
+
* gap. It goes above the list, in place of a row of `Stat` cards.
|
|
31
|
+
*
|
|
32
|
+
* The band is a description list: each figure is read as its label, then its
|
|
33
|
+
* value. The eyebrows are color plus words, never color alone.
|
|
34
|
+
*
|
|
35
|
+
* Below `lg` it stacks: the lead and the callout take a row each and the
|
|
36
|
+
* smaller figures go two by two between them.
|
|
37
|
+
*
|
|
38
|
+
* Outside an `ExpScope` it falls back to a row of core `Stat` cards, with the
|
|
39
|
+
* eyebrow tone as the stat's dot.
|
|
40
|
+
*
|
|
41
|
+
* @component
|
|
42
|
+
* @example
|
|
43
|
+
* <ExpFigureBand
|
|
44
|
+
* lead={{ value: 38, eyebrow: 'Active coverage', label: 'Repos in the whitelist', hint: '27 enabled' }}
|
|
45
|
+
* figures={[
|
|
46
|
+
* { value: 10, label: 'Indexed', hint: 'Ready for a diagnosis' },
|
|
47
|
+
* { value: 28, label: 'Without a clone', hint: 'They wait for a sync' },
|
|
48
|
+
* ]}
|
|
49
|
+
* callout={{ value: 11, eyebrow: 'Gap to close', label: 'Cases without an indexed repo', tone: 'error' }}
|
|
50
|
+
* />
|
|
51
|
+
*
|
|
52
|
+
* @param {ExpFigureBandProps} props - The properties of the ExpFigureBand component.
|
|
53
|
+
* @param {ExpFigureHighlight} props.lead - The main figure, large, at the start.
|
|
54
|
+
* @param {ExpFigure[]} [props.figures] - Smaller figures, in the middle.
|
|
55
|
+
* @param {ExpFigureHighlight} [props.callout] - A figure to act on, large, at the end.
|
|
56
|
+
* @param {boolean} [props.isLoading=false] - Shows placeholders instead of the values.
|
|
57
|
+
*
|
|
58
|
+
* @returns {ReactNode} The band, or a row of core `Stat` cards outside an `ExpScope`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function ExpFigureBand({ lead, figures, callout, isLoading, ...restProps }: ExpFigureBandProps): ReactNode;
|
|
61
|
+
//# sourceMappingURL=ExpFigureBand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpFigureBand.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpFigureBand/ExpFigureBand.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3E,MAAM,MAAM,SAAS,GAAG;IACtB,qCAAqC;IACrC,KAAK,EAAE,SAAS,CAAC;IACjB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,wDAAwD;IACxD,IAAI,EAAE,kBAAkB,CAAC;IACzB,sCAAsC;IACtC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,CAAC;AAqElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,OAAY,EACZ,OAAO,EACP,SAAiB,EACjB,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CA0FhC"}
|