@atproto/oauth-provider-ui 0.0.2 → 0.1.1
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/authorization-page-Cms-rcBA.js +3 -0
- package/dist/authorization-page-Cms-rcBA.js.map +1 -0
- package/dist/{assets/bundle-manifest.json → bundle-manifest.json} +197 -197
- package/dist/error-page-DC6Vc-cv.js +2 -0
- package/dist/error-page-DC6Vc-cv.js.map +1 -0
- package/dist/error-view-CRGNTAn2.css +1 -0
- package/dist/error-view-MVy7C9l0.js +59 -0
- package/dist/error-view-MVy7C9l0.js.map +1 -0
- package/dist/index-CHPoD7Rp.js +20 -0
- package/dist/index-CHPoD7Rp.js.map +1 -0
- package/dist/messages-B0mgsxS-.js +2 -0
- package/dist/messages-B0mgsxS-.js.map +1 -0
- package/dist/messages-B5g8Fkio.js +2 -0
- package/dist/messages-B5g8Fkio.js.map +1 -0
- package/dist/messages-BCMss-Kt.js +2 -0
- package/dist/messages-BCMss-Kt.js.map +1 -0
- package/dist/messages-BGUrKgyK.js +2 -0
- package/dist/messages-BGUrKgyK.js.map +1 -0
- package/dist/messages-BjxAnLDp.js +2 -0
- package/dist/messages-BjxAnLDp.js.map +1 -0
- package/dist/messages-Bjysz3rI.js +2 -0
- package/dist/messages-Bjysz3rI.js.map +1 -0
- package/dist/messages-BvvEr3UX.js +2 -0
- package/dist/messages-BvvEr3UX.js.map +1 -0
- package/dist/messages-Bz6JOhJf.js +2 -0
- package/dist/messages-Bz6JOhJf.js.map +1 -0
- package/dist/messages-BzL3D1EU.js +2 -0
- package/dist/messages-BzL3D1EU.js.map +1 -0
- package/dist/messages-CAvN5UoW.js +2 -0
- package/dist/messages-CAvN5UoW.js.map +1 -0
- package/dist/messages-CEmswT1Q.js +2 -0
- package/dist/messages-CEmswT1Q.js.map +1 -0
- package/dist/messages-CHYqz0q6.js +2 -0
- package/dist/messages-CHYqz0q6.js.map +1 -0
- package/dist/messages-CRmpdijj.js +2 -0
- package/dist/messages-CRmpdijj.js.map +1 -0
- package/dist/messages-Cdb79R6S.js +2 -0
- package/dist/messages-Cdb79R6S.js.map +1 -0
- package/dist/messages-ChkJ_0WT.js +2 -0
- package/dist/messages-ChkJ_0WT.js.map +1 -0
- package/dist/messages-CqiEX6JJ.js +2 -0
- package/dist/messages-CqiEX6JJ.js.map +1 -0
- package/dist/messages-CxkHjJSR.js +2 -0
- package/dist/messages-CxkHjJSR.js.map +1 -0
- package/dist/messages-D0-cWoJ9.js +2 -0
- package/dist/messages-D0-cWoJ9.js.map +1 -0
- package/dist/messages-D2MnAxYY.js +2 -0
- package/dist/messages-D2MnAxYY.js.map +1 -0
- package/dist/messages-D5TZVsui.js +2 -0
- package/dist/messages-D5TZVsui.js.map +1 -0
- package/dist/messages-DBdV4-iw.js +2 -0
- package/dist/messages-DBdV4-iw.js.map +1 -0
- package/dist/messages-DEK3zybC.js +2 -0
- package/dist/messages-DEK3zybC.js.map +1 -0
- package/dist/messages-DGSM5jkd.js +2 -0
- package/dist/messages-DGSM5jkd.js.map +1 -0
- package/dist/messages-DJgAnSTQ.js +2 -0
- package/dist/messages-DJgAnSTQ.js.map +1 -0
- package/dist/messages-DK7O7sb_.js +2 -0
- package/dist/messages-DK7O7sb_.js.map +1 -0
- package/dist/messages-DRp7qc3j.js +2 -0
- package/dist/messages-DRp7qc3j.js.map +1 -0
- package/dist/messages-DT6xRw0m.js +2 -0
- package/dist/messages-DT6xRw0m.js.map +1 -0
- package/dist/messages-LnzLtU0L.js +2 -0
- package/dist/messages-LnzLtU0L.js.map +1 -0
- package/dist/messages-_Nk2qNGw.js +2 -0
- package/dist/messages-_Nk2qNGw.js.map +1 -0
- package/dist/messages-eHH6nZyF.js +2 -0
- package/dist/messages-eHH6nZyF.js.map +1 -0
- package/dist/messages-iNw8zY2C.js +2 -0
- package/dist/messages-iNw8zY2C.js.map +1 -0
- package/dist/messages-ipc0L8yF.js +2 -0
- package/dist/messages-ipc0L8yF.js.map +1 -0
- package/dist/messages-j7LsWm2F.js +2 -0
- package/dist/messages-j7LsWm2F.js.map +1 -0
- package/dist/messages-mgE_5UEw.js +2 -0
- package/dist/messages-mgE_5UEw.js.map +1 -0
- package/dist/messages-oRd-J5--.js +2 -0
- package/dist/messages-oRd-J5--.js.map +1 -0
- package/hydration-data.d.ts +42 -0
- package/package.json +30 -37
- package/.linguirc +0 -57
- package/CHANGELOG.md +0 -7
- package/CONTRIBUTING.md +0 -6
- package/dist/assets/COdVzed-.css +0 -3
- package/dist/assets/COdVzed-.js +0 -100
- package/dist/assets/COdVzed-.js.map +0 -1
- package/dist/assets/Cqnfnbvc.js +0 -6
- package/dist/assets/Cqnfnbvc.js.map +0 -1
- package/dist/assets/error-view-Bu4y7Nd8.js +0 -208
- package/dist/assets/error-view-Bu4y7Nd8.js.map +0 -1
- package/dist/assets/index-DXlCRM6V.js +0 -36
- package/dist/assets/index-DXlCRM6V.js.map +0 -1
- package/dist/assets/messages-2GoTm2qL.js +0 -4
- package/dist/assets/messages-2GoTm2qL.js.map +0 -1
- package/dist/assets/messages-6Cn2Jbhw.js +0 -4
- package/dist/assets/messages-6Cn2Jbhw.js.map +0 -1
- package/dist/assets/messages-75hFgOK2.js +0 -4
- package/dist/assets/messages-75hFgOK2.js.map +0 -1
- package/dist/assets/messages-B3OK4k0O.js +0 -4
- package/dist/assets/messages-B3OK4k0O.js.map +0 -1
- package/dist/assets/messages-BNXlPzKV.js +0 -4
- package/dist/assets/messages-BNXlPzKV.js.map +0 -1
- package/dist/assets/messages-BUygB8mD.js +0 -4
- package/dist/assets/messages-BUygB8mD.js.map +0 -1
- package/dist/assets/messages-BVPPcwNr.js +0 -4
- package/dist/assets/messages-BVPPcwNr.js.map +0 -1
- package/dist/assets/messages-BbbWUQS8.js +0 -4
- package/dist/assets/messages-BbbWUQS8.js.map +0 -1
- package/dist/assets/messages-BibKCYyW.js +0 -4
- package/dist/assets/messages-BibKCYyW.js.map +0 -1
- package/dist/assets/messages-BlPrr9_7.js +0 -4
- package/dist/assets/messages-BlPrr9_7.js.map +0 -1
- package/dist/assets/messages-ByVCw40U.js +0 -4
- package/dist/assets/messages-ByVCw40U.js.map +0 -1
- package/dist/assets/messages-C5DU1neP.js +0 -4
- package/dist/assets/messages-C5DU1neP.js.map +0 -1
- package/dist/assets/messages-C6IgUtbX.js +0 -4
- package/dist/assets/messages-C6IgUtbX.js.map +0 -1
- package/dist/assets/messages-C92Zzt2o.js +0 -4
- package/dist/assets/messages-C92Zzt2o.js.map +0 -1
- package/dist/assets/messages-CGZqYT14.js +0 -4
- package/dist/assets/messages-CGZqYT14.js.map +0 -1
- package/dist/assets/messages-CGlsy4wt.js +0 -4
- package/dist/assets/messages-CGlsy4wt.js.map +0 -1
- package/dist/assets/messages-CPT1nd0u.js +0 -4
- package/dist/assets/messages-CPT1nd0u.js.map +0 -1
- package/dist/assets/messages-CTTdXyw_.js +0 -4
- package/dist/assets/messages-CTTdXyw_.js.map +0 -1
- package/dist/assets/messages-ChK_C_Pj.js +0 -4
- package/dist/assets/messages-ChK_C_Pj.js.map +0 -1
- package/dist/assets/messages-CjJbk7Uf.js +0 -4
- package/dist/assets/messages-CjJbk7Uf.js.map +0 -1
- package/dist/assets/messages-CoiLjLYO.js +0 -4
- package/dist/assets/messages-CoiLjLYO.js.map +0 -1
- package/dist/assets/messages-Cwx6B4Ti.js +0 -4
- package/dist/assets/messages-Cwx6B4Ti.js.map +0 -1
- package/dist/assets/messages-D0uXAp_H.js +0 -4
- package/dist/assets/messages-D0uXAp_H.js.map +0 -1
- package/dist/assets/messages-DG0_arU0.js +0 -4
- package/dist/assets/messages-DG0_arU0.js.map +0 -1
- package/dist/assets/messages-DOXFJh9K.js +0 -4
- package/dist/assets/messages-DOXFJh9K.js.map +0 -1
- package/dist/assets/messages-DPK7nOoC.js +0 -4
- package/dist/assets/messages-DPK7nOoC.js.map +0 -1
- package/dist/assets/messages-Duccgtu0.js +0 -4
- package/dist/assets/messages-Duccgtu0.js.map +0 -1
- package/dist/assets/messages-DxTqgsHq.js +0 -4
- package/dist/assets/messages-DxTqgsHq.js.map +0 -1
- package/dist/assets/messages-E5_lTg7A.js +0 -4
- package/dist/assets/messages-E5_lTg7A.js.map +0 -1
- package/dist/assets/messages-UhunAjh1.js +0 -4
- package/dist/assets/messages-UhunAjh1.js.map +0 -1
- package/dist/assets/messages-Xg_3YLGw.js +0 -4
- package/dist/assets/messages-Xg_3YLGw.js.map +0 -1
- package/dist/assets/messages-iliBQHY2.js +0 -4
- package/dist/assets/messages-iliBQHY2.js.map +0 -1
- package/dist/assets/messages-lRprpIl-.js +0 -4
- package/dist/assets/messages-lRprpIl-.js.map +0 -1
- package/dist/assets/messages-pbPHQbz1.js +0 -4
- package/dist/assets/messages-pbPHQbz1.js.map +0 -1
- package/dist/assets/messages-q-O7ZQGs.js +0 -4
- package/dist/assets/messages-q-O7ZQGs.js.map +0 -1
- package/dist/lib/index.d.ts +0 -19
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -47
- package/dist/lib/index.js.map +0 -1
- package/dist/tsconfig.backend.tsbuildinfo +0 -1
- package/lib/index.ts +0 -72
- package/rollup.config.js +0 -102
- package/src/authorization-page.html +0 -183
- package/src/authorization-page.tsx +0 -55
- package/src/backend-data.ts +0 -35
- package/src/components/forms/button-toggle-visibility.tsx +0 -43
- package/src/components/forms/button.tsx +0 -60
- package/src/components/forms/fieldset.tsx +0 -55
- package/src/components/forms/form-card-async.tsx +0 -103
- package/src/components/forms/form-card.tsx +0 -49
- package/src/components/forms/input-checkbox.tsx +0 -78
- package/src/components/forms/input-container.tsx +0 -107
- package/src/components/forms/input-email-address.tsx +0 -65
- package/src/components/forms/input-new-password.tsx +0 -62
- package/src/components/forms/input-password.tsx +0 -87
- package/src/components/forms/input-text.tsx +0 -82
- package/src/components/forms/input-token.tsx +0 -94
- package/src/components/forms/wizard-card.tsx +0 -116
- package/src/components/layouts/layout-title-page.tsx +0 -77
- package/src/components/layouts/layout-welcome.tsx +0 -73
- package/src/components/utils/account-identifier.tsx +0 -23
- package/src/components/utils/account-image.tsx +0 -33
- package/src/components/utils/admonition.tsx +0 -52
- package/src/components/utils/client-name.tsx +0 -45
- package/src/components/utils/error-card.tsx +0 -93
- package/src/components/utils/error-message.tsx +0 -88
- package/src/components/utils/help-card.tsx +0 -46
- package/src/components/utils/icons.tsx +0 -88
- package/src/components/utils/link-anchor.tsx +0 -28
- package/src/components/utils/link-title.tsx +0 -26
- package/src/components/utils/multi-lang-string.tsx +0 -56
- package/src/components/utils/password-strength-label.tsx +0 -37
- package/src/components/utils/password-strength-meter.tsx +0 -58
- package/src/components/utils/url-viewer.tsx +0 -73
- package/src/cookies.ts +0 -11
- package/src/error-page.html +0 -125
- package/src/error-page.tsx +0 -29
- package/src/hooks/use-api.ts +0 -182
- package/src/hooks/use-async-action.ts +0 -120
- package/src/hooks/use-bound-dispatch.ts +0 -5
- package/src/hooks/use-browser-color-scheme.ts +0 -31
- package/src/hooks/use-csrf-token.ts +0 -5
- package/src/hooks/use-random-string.ts +0 -37
- package/src/hooks/use-stepper.ts +0 -87
- package/src/index.html +0 -13
- package/src/lib/api.ts +0 -234
- package/src/lib/backend-data.ts +0 -6
- package/src/lib/clsx.ts +0 -6
- package/src/lib/json-client.ts +0 -97
- package/src/lib/password.ts +0 -98
- package/src/lib/ref.ts +0 -17
- package/src/lib/util.ts +0 -13
- package/src/locales/an/messages.po +0 -487
- package/src/locales/ast/messages.po +0 -487
- package/src/locales/ca/messages.po +0 -487
- package/src/locales/da/messages.po +0 -487
- package/src/locales/de/messages.po +0 -487
- package/src/locales/el/messages.po +0 -487
- package/src/locales/en/messages.po +0 -487
- package/src/locales/en-GB/messages.po +0 -487
- package/src/locales/es/messages.po +0 -487
- package/src/locales/eu/messages.po +0 -487
- package/src/locales/fi/messages.po +0 -487
- package/src/locales/fr/messages.po +0 -487
- package/src/locales/ga/messages.po +0 -487
- package/src/locales/gl/messages.po +0 -487
- package/src/locales/hi/messages.po +0 -487
- package/src/locales/hu/messages.po +0 -487
- package/src/locales/ia/messages.po +0 -487
- package/src/locales/id/messages.po +0 -487
- package/src/locales/it/messages.po +0 -487
- package/src/locales/ja/messages.po +0 -487
- package/src/locales/km/messages.po +0 -487
- package/src/locales/ko/messages.po +0 -487
- package/src/locales/load.ts +0 -8
- package/src/locales/locale-context.ts +0 -19
- package/src/locales/locale-provider.tsx +0 -112
- package/src/locales/locale-selector.tsx +0 -58
- package/src/locales/locales.ts +0 -168
- package/src/locales/ne/messages.po +0 -487
- package/src/locales/nl/messages.po +0 -487
- package/src/locales/pl/messages.po +0 -487
- package/src/locales/pt-BR/messages.po +0 -487
- package/src/locales/ro/messages.po +0 -487
- package/src/locales/ru/messages.po +0 -487
- package/src/locales/sv/messages.po +0 -487
- package/src/locales/th/messages.po +0 -487
- package/src/locales/tr/messages.po +0 -487
- package/src/locales/uk/messages.po +0 -487
- package/src/locales/vi/messages.po +0 -487
- package/src/locales/zh-CN/messages.po +0 -487
- package/src/locales/zh-HK/messages.po +0 -487
- package/src/locales/zh-TW/messages.po +0 -487
- package/src/styles.css +0 -33
- package/src/views/authorize/accept/accept-form.tsx +0 -150
- package/src/views/authorize/accept/accept-view.tsx +0 -70
- package/src/views/authorize/authorize-view.tsx +0 -183
- package/src/views/authorize/reset-password/reset-password-confirm-form.tsx +0 -88
- package/src/views/authorize/reset-password/reset-password-request-form.tsx +0 -80
- package/src/views/authorize/reset-password/reset-password-view.tsx +0 -127
- package/src/views/authorize/sign-in/sign-in-form.tsx +0 -242
- package/src/views/authorize/sign-in/sign-in-picker.tsx +0 -116
- package/src/views/authorize/sign-in/sign-in-view.tsx +0 -145
- package/src/views/authorize/sign-up/sign-up-account-form.tsx +0 -142
- package/src/views/authorize/sign-up/sign-up-disclaimer.tsx +0 -51
- package/src/views/authorize/sign-up/sign-up-handle-form.tsx +0 -287
- package/src/views/authorize/sign-up/sign-up-hcaptcha-form.tsx +0 -108
- package/src/views/authorize/sign-up/sign-up-view.tsx +0 -158
- package/src/views/authorize/welcome/welcome-view.tsx +0 -56
- package/src/views/error/error-view.tsx +0 -31
- package/tailwind.config.js +0 -31
- package/tsconfig.backend.json +0 -8
- package/tsconfig.frontend.json +0 -10
- package/tsconfig.frontend.tsbuildinfo +0 -1
- package/tsconfig.json +0 -8
- package/tsconfig.tools.json +0 -8
- package/tsconfig.tools.tsbuildinfo +0 -1
- package/vite.config.mjs +0 -16
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
import { Trans, useLingui } from '@lingui/react/macro'
|
|
2
|
-
import { JSX, ReactNode, useCallback, useEffect, useRef, useState } from 'react'
|
|
3
|
-
import {
|
|
4
|
-
AsyncActionController,
|
|
5
|
-
FormCardAsync,
|
|
6
|
-
FormCardAsyncProps,
|
|
7
|
-
} from '../../../components/forms/form-card-async.tsx'
|
|
8
|
-
import { InputText } from '../../../components/forms/input-text.tsx'
|
|
9
|
-
import { Admonition } from '../../../components/utils/admonition.tsx'
|
|
10
|
-
import {
|
|
11
|
-
AtSymbolIcon,
|
|
12
|
-
CheckMarkIcon,
|
|
13
|
-
XMarkIcon,
|
|
14
|
-
} from '../../../components/utils/icons.tsx'
|
|
15
|
-
import { clsx } from '../../../lib/clsx.ts'
|
|
16
|
-
import { mergeRefs } from '../../../lib/ref.ts'
|
|
17
|
-
import { Override } from '../../../lib/util.ts'
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Spec limit is 63, but in practice, we've limited it to 18 in our implementations.
|
|
21
|
-
*
|
|
22
|
-
* @see {@link https://atproto.com/specs/handle | ATProto Handle Spec}
|
|
23
|
-
*/
|
|
24
|
-
const MAX_LENGTH = 18
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Spec limit is 1, but in practice, we've targeted at least 3 characters in handles.
|
|
28
|
-
*
|
|
29
|
-
* @see {@link https://atproto.com/specs/handle | ATProto Handle Spec}
|
|
30
|
-
*/
|
|
31
|
-
const MIN_LENGTH = 3
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Spec limit is 253, but in practice, we've targeted 30 characters in handles.
|
|
35
|
-
*
|
|
36
|
-
* @see {@link https://atproto.com/specs/handle | ATProto Handle Spec}
|
|
37
|
-
*/
|
|
38
|
-
const MAX_FULL_LENGTH = 30
|
|
39
|
-
|
|
40
|
-
type ValidDomain = `.${string}`
|
|
41
|
-
const isValidDomain = (domain: string): domain is ValidDomain =>
|
|
42
|
-
// Ignore domains that are so long that they would make the handle smaller
|
|
43
|
-
// than MIN_LENGTH characters
|
|
44
|
-
MIN_LENGTH + domain.length <= MAX_FULL_LENGTH &&
|
|
45
|
-
// Basic validation here
|
|
46
|
-
domain.startsWith('.') &&
|
|
47
|
-
!domain.endsWith('.')
|
|
48
|
-
|
|
49
|
-
function useSegmentValidator(domain: ValidDomain) {
|
|
50
|
-
const minLen = MIN_LENGTH
|
|
51
|
-
const maxLen = Math.min(MAX_LENGTH, MAX_FULL_LENGTH - domain.length)
|
|
52
|
-
|
|
53
|
-
const validateSegment = useCallback(
|
|
54
|
-
(segment: string) => {
|
|
55
|
-
const validLength = segment.length >= minLen && segment.length <= maxLen
|
|
56
|
-
const validCharset = /^[a-z0-9][a-z0-9-]+[a-z0-9]$/g.test(segment)
|
|
57
|
-
|
|
58
|
-
return { validLength, validCharset, valid: validLength && validCharset }
|
|
59
|
-
},
|
|
60
|
-
[maxLen, minLen],
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
minLength: minLen,
|
|
65
|
-
maxLength: maxLen,
|
|
66
|
-
validateSegment,
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export type SignUpHandleFormProps = Override<
|
|
71
|
-
Omit<
|
|
72
|
-
FormCardAsyncProps,
|
|
73
|
-
'append' | 'onCancel' | 'cancelLabel' | 'onSubmit' | 'submitLabel'
|
|
74
|
-
>,
|
|
75
|
-
{
|
|
76
|
-
domains: string[]
|
|
77
|
-
|
|
78
|
-
onNext: (signal: AbortSignal) => void | PromiseLike<void>
|
|
79
|
-
nextLabel?: ReactNode
|
|
80
|
-
|
|
81
|
-
onPrev?: () => void
|
|
82
|
-
prevLabel?: ReactNode
|
|
83
|
-
|
|
84
|
-
handle?: string
|
|
85
|
-
onHandle?: (handle: string | undefined) => void
|
|
86
|
-
}
|
|
87
|
-
>
|
|
88
|
-
|
|
89
|
-
export function SignUpHandleForm({
|
|
90
|
-
domains: availableDomains,
|
|
91
|
-
|
|
92
|
-
onNext,
|
|
93
|
-
nextLabel,
|
|
94
|
-
|
|
95
|
-
onPrev,
|
|
96
|
-
prevLabel,
|
|
97
|
-
|
|
98
|
-
handle: handleInit,
|
|
99
|
-
onHandle,
|
|
100
|
-
|
|
101
|
-
// FormCardProps
|
|
102
|
-
invalid,
|
|
103
|
-
children,
|
|
104
|
-
ref,
|
|
105
|
-
...props
|
|
106
|
-
}: SignUpHandleFormProps) {
|
|
107
|
-
const { t } = useLingui()
|
|
108
|
-
const domains = availableDomains.filter(isValidDomain)
|
|
109
|
-
|
|
110
|
-
const formRef = useRef<AsyncActionController>(null)
|
|
111
|
-
|
|
112
|
-
const [domainIdx, setDomainIdx] = useState(() => {
|
|
113
|
-
const idx = domains.findIndex((d) => handleInit?.endsWith(d))
|
|
114
|
-
return idx === -1 ? 0 : idx
|
|
115
|
-
})
|
|
116
|
-
const [segment, setSegment] = useState(() => handleInit?.split('.')[0] || '')
|
|
117
|
-
|
|
118
|
-
// Automatically update the domain index when the list length changes
|
|
119
|
-
useEffect(() => {
|
|
120
|
-
setDomainIdx((v) => Math.min(v, domains.length - 1))
|
|
121
|
-
}, [domains.length])
|
|
122
|
-
|
|
123
|
-
const domain: ValidDomain | null = domains[domainIdx] || domains[0] || null
|
|
124
|
-
|
|
125
|
-
const { minLength, maxLength, validateSegment } = useSegmentValidator(domain)
|
|
126
|
-
|
|
127
|
-
const validity = validateSegment(segment)
|
|
128
|
-
const handle = domain && validity.valid ? `${segment}${domain}` : undefined
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
// Whenever the user changes the handle, abort any pending form action
|
|
131
|
-
formRef.current?.reset()
|
|
132
|
-
onHandle?.(handle)
|
|
133
|
-
}, [onHandle, handle])
|
|
134
|
-
|
|
135
|
-
const inputRef = useRef<HTMLInputElement>(null)
|
|
136
|
-
|
|
137
|
-
const preview = `@${segment}${domain}`
|
|
138
|
-
|
|
139
|
-
return (
|
|
140
|
-
<FormCardAsync
|
|
141
|
-
{...props}
|
|
142
|
-
ref={mergeRefs([ref, formRef])}
|
|
143
|
-
onCancel={onPrev}
|
|
144
|
-
cancelLabel={prevLabel}
|
|
145
|
-
onSubmit={onNext}
|
|
146
|
-
submitLabel={nextLabel}
|
|
147
|
-
invalid={invalid || !handle}
|
|
148
|
-
append={children}
|
|
149
|
-
>
|
|
150
|
-
<div>
|
|
151
|
-
<ValidationMessage hasValue={!!segment} valid={validity.validLength}>
|
|
152
|
-
<Trans>
|
|
153
|
-
Between {minLength} and {maxLength} characters
|
|
154
|
-
</Trans>
|
|
155
|
-
</ValidationMessage>
|
|
156
|
-
<ValidationMessage hasValue={!!segment} valid={validity.validCharset}>
|
|
157
|
-
<Trans>Only letters, numbers, and hyphens</Trans>
|
|
158
|
-
</ValidationMessage>
|
|
159
|
-
</div>
|
|
160
|
-
|
|
161
|
-
<InputText
|
|
162
|
-
ref={inputRef}
|
|
163
|
-
icon={<AtSymbolIcon className="w-5" />}
|
|
164
|
-
name="handle"
|
|
165
|
-
type="text"
|
|
166
|
-
title={t`Type your desired username`}
|
|
167
|
-
pattern="[a-z0-9][a-z0-9\-]+[a-z0-9]"
|
|
168
|
-
minLength={minLength}
|
|
169
|
-
maxLength={maxLength}
|
|
170
|
-
autoCapitalize="none"
|
|
171
|
-
autoCorrect="off"
|
|
172
|
-
autoComplete="off"
|
|
173
|
-
dir="auto"
|
|
174
|
-
enterKeyHint="done"
|
|
175
|
-
autoFocus
|
|
176
|
-
required
|
|
177
|
-
value={segment}
|
|
178
|
-
onChange={(event) => {
|
|
179
|
-
const segment = event.target.value.toLowerCase()
|
|
180
|
-
|
|
181
|
-
// Ensure the input is always lowercase
|
|
182
|
-
const selectionStart = event.target.selectionStart
|
|
183
|
-
const selectionEnd = event.target.selectionEnd
|
|
184
|
-
event.target.value = segment
|
|
185
|
-
event.target.setSelectionRange(selectionStart, selectionEnd)
|
|
186
|
-
|
|
187
|
-
setSegment(segment)
|
|
188
|
-
}}
|
|
189
|
-
append={
|
|
190
|
-
// @TODO refactor this to a separate component
|
|
191
|
-
domains.length > 1 && (
|
|
192
|
-
<select
|
|
193
|
-
onClick={(event) => event.stopPropagation()}
|
|
194
|
-
onMouseDown={(event) => event.stopPropagation()}
|
|
195
|
-
value={domainIdx}
|
|
196
|
-
aria-label={t`Select domain`}
|
|
197
|
-
onChange={(event) => {
|
|
198
|
-
setDomainIdx(Number(event.target.value))
|
|
199
|
-
inputRef.current?.focus()
|
|
200
|
-
}}
|
|
201
|
-
className={clsx(
|
|
202
|
-
'block w-full',
|
|
203
|
-
'text-sm',
|
|
204
|
-
'rounded-lg p-2',
|
|
205
|
-
'bg-white dark:bg-slate-600',
|
|
206
|
-
)}
|
|
207
|
-
>
|
|
208
|
-
{domains.map((domain, idx) => (
|
|
209
|
-
<option key={domain} value={idx}>
|
|
210
|
-
{domain}
|
|
211
|
-
</option>
|
|
212
|
-
))}
|
|
213
|
-
</select>
|
|
214
|
-
)
|
|
215
|
-
}
|
|
216
|
-
bellow={
|
|
217
|
-
<Trans>
|
|
218
|
-
Your full username will be:{' '}
|
|
219
|
-
{segment.length ? (
|
|
220
|
-
<strong className="text-gray-800 dark:text-gray-200">
|
|
221
|
-
{preview}
|
|
222
|
-
</strong>
|
|
223
|
-
) : (
|
|
224
|
-
<span
|
|
225
|
-
aria-hidden
|
|
226
|
-
className="bg-gray-300 dark:bg-slate-600 rounded-md p-2 w-24"
|
|
227
|
-
/>
|
|
228
|
-
)}
|
|
229
|
-
</Trans>
|
|
230
|
-
}
|
|
231
|
-
/>
|
|
232
|
-
|
|
233
|
-
<Admonition role="status">
|
|
234
|
-
<p className="text-md">
|
|
235
|
-
<Trans>
|
|
236
|
-
You can change this username to any domain name you control after
|
|
237
|
-
your account is set up.
|
|
238
|
-
</Trans>
|
|
239
|
-
</p>
|
|
240
|
-
</Admonition>
|
|
241
|
-
</FormCardAsync>
|
|
242
|
-
)
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
type ValidationMessageProps = JSX.IntrinsicElements['div'] & {
|
|
246
|
-
valid: boolean
|
|
247
|
-
hasValue: boolean
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function ValidationMessage({
|
|
251
|
-
valid,
|
|
252
|
-
hasValue,
|
|
253
|
-
|
|
254
|
-
// div
|
|
255
|
-
children,
|
|
256
|
-
className,
|
|
257
|
-
...props
|
|
258
|
-
}: ValidationMessageProps) {
|
|
259
|
-
const { t } = useLingui()
|
|
260
|
-
return (
|
|
261
|
-
<div
|
|
262
|
-
{...props}
|
|
263
|
-
className={clsx('flex flex-row items-center gap-2', className)}
|
|
264
|
-
>
|
|
265
|
-
{hasValue ? (
|
|
266
|
-
<>
|
|
267
|
-
{valid ? (
|
|
268
|
-
<CheckMarkIcon
|
|
269
|
-
className="inline-block w-4 h-4 text-success"
|
|
270
|
-
title={t`Valid`}
|
|
271
|
-
/>
|
|
272
|
-
) : (
|
|
273
|
-
<XMarkIcon
|
|
274
|
-
className="inline-block w-4 h-4 text-error"
|
|
275
|
-
title={t`Invalid`}
|
|
276
|
-
/>
|
|
277
|
-
)}
|
|
278
|
-
</>
|
|
279
|
-
) : (
|
|
280
|
-
<div aria-hidden className="w-4 h-4 flex items-center justify-center">
|
|
281
|
-
<div className="bg-gray-300 dark:bg-slate-600 rounded-full w-2 h-2" />
|
|
282
|
-
</div>
|
|
283
|
-
)}
|
|
284
|
-
<div className="text-sm">{children}</div>
|
|
285
|
-
</div>
|
|
286
|
-
)
|
|
287
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import type HCaptcha from '@hcaptcha/react-hcaptcha'
|
|
2
|
-
import {
|
|
3
|
-
ForwardedRef,
|
|
4
|
-
ReactNode,
|
|
5
|
-
lazy,
|
|
6
|
-
useCallback,
|
|
7
|
-
useRef,
|
|
8
|
-
useState,
|
|
9
|
-
} from 'react'
|
|
10
|
-
import {
|
|
11
|
-
FormCardAsync,
|
|
12
|
-
FormCardAsyncProps,
|
|
13
|
-
} from '../../../components/forms/form-card-async.tsx'
|
|
14
|
-
import { useBrowserColorScheme } from '../../../hooks/use-browser-color-scheme.ts'
|
|
15
|
-
import { mergeRefs } from '../../../lib/ref.ts'
|
|
16
|
-
import { Override } from '../../../lib/util.ts'
|
|
17
|
-
|
|
18
|
-
export type SignUpHcaptchaFormProps = Override<
|
|
19
|
-
Omit<
|
|
20
|
-
FormCardAsyncProps,
|
|
21
|
-
'append' | 'onSubmit' | 'submitLabel' | 'onCancel' | 'cancelLabel'
|
|
22
|
-
>,
|
|
23
|
-
{
|
|
24
|
-
siteKey: string
|
|
25
|
-
|
|
26
|
-
token?: string
|
|
27
|
-
onToken: (token: string, ekey: string) => void
|
|
28
|
-
|
|
29
|
-
prevLabel?: ReactNode
|
|
30
|
-
onPrev?: () => void
|
|
31
|
-
|
|
32
|
-
nextLabel?: ReactNode
|
|
33
|
-
onNext: (signal: AbortSignal) => void | PromiseLike<void>
|
|
34
|
-
|
|
35
|
-
ref?: ForwardedRef<HCaptcha>
|
|
36
|
-
}
|
|
37
|
-
>
|
|
38
|
-
|
|
39
|
-
const HCaptchaLazy = lazy(() => import('@hcaptcha/react-hcaptcha'))
|
|
40
|
-
|
|
41
|
-
export function SignUpHcaptchaForm({
|
|
42
|
-
siteKey,
|
|
43
|
-
|
|
44
|
-
token: tokenInit,
|
|
45
|
-
onToken,
|
|
46
|
-
|
|
47
|
-
prevLabel,
|
|
48
|
-
onPrev,
|
|
49
|
-
|
|
50
|
-
nextLabel,
|
|
51
|
-
onNext,
|
|
52
|
-
|
|
53
|
-
ref,
|
|
54
|
-
|
|
55
|
-
// FormCardProps
|
|
56
|
-
invalid,
|
|
57
|
-
children,
|
|
58
|
-
...props
|
|
59
|
-
}: SignUpHcaptchaFormProps) {
|
|
60
|
-
const captchaRef = useRef<HCaptcha>(null)
|
|
61
|
-
const theme = useBrowserColorScheme()
|
|
62
|
-
const [token, setToken] = useState<string | undefined>(tokenInit)
|
|
63
|
-
|
|
64
|
-
const onLoad = useCallback(() => {
|
|
65
|
-
// this reaches out to the hCaptcha JS API and runs the
|
|
66
|
-
// execute function on it. you can use other functions as
|
|
67
|
-
// documented here:
|
|
68
|
-
// https://docs.hcaptcha.com/configuration#jsapi
|
|
69
|
-
captchaRef.current?.execute()
|
|
70
|
-
}, [])
|
|
71
|
-
|
|
72
|
-
const onVerify = useCallback(
|
|
73
|
-
(token: string, ekey: string) => {
|
|
74
|
-
setToken(token)
|
|
75
|
-
onToken(token, ekey)
|
|
76
|
-
},
|
|
77
|
-
[onToken],
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
const doSubmit = useCallback(
|
|
81
|
-
(signal: AbortSignal) => {
|
|
82
|
-
if (token) return onNext(signal)
|
|
83
|
-
else if (captchaRef.current) captchaRef.current.execute()
|
|
84
|
-
else throw new Error('Unable to load hCaptcha')
|
|
85
|
-
},
|
|
86
|
-
[token, onNext],
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<FormCardAsync
|
|
91
|
-
{...props}
|
|
92
|
-
cancelLabel={prevLabel}
|
|
93
|
-
onCancel={onPrev}
|
|
94
|
-
submitLabel={nextLabel}
|
|
95
|
-
onSubmit={doSubmit}
|
|
96
|
-
append={children}
|
|
97
|
-
invalid={invalid || !token}
|
|
98
|
-
>
|
|
99
|
-
<HCaptchaLazy
|
|
100
|
-
theme={theme}
|
|
101
|
-
sitekey={siteKey}
|
|
102
|
-
onLoad={onLoad}
|
|
103
|
-
onVerify={onVerify}
|
|
104
|
-
ref={mergeRefs([ref, captchaRef])}
|
|
105
|
-
/>
|
|
106
|
-
</FormCardAsync>
|
|
107
|
-
)
|
|
108
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { Trans, useLingui } from '@lingui/react/macro'
|
|
2
|
-
import { useCallback, useState } from 'react'
|
|
3
|
-
import type { CustomizationData } from '@atproto/oauth-provider-api'
|
|
4
|
-
import { WizardCard } from '../../../components/forms/wizard-card.tsx'
|
|
5
|
-
import {
|
|
6
|
-
LayoutTitlePage,
|
|
7
|
-
LayoutTitlePageProps,
|
|
8
|
-
} from '../../../components/layouts/layout-title-page.tsx'
|
|
9
|
-
import { HelpCard } from '../../../components/utils/help-card.tsx'
|
|
10
|
-
import { Override } from '../../../lib/util.ts'
|
|
11
|
-
import {
|
|
12
|
-
SignUpAccountForm,
|
|
13
|
-
SignUpAccountFormOutput,
|
|
14
|
-
} from './sign-up-account-form.tsx'
|
|
15
|
-
import { SignUpDisclaimer } from './sign-up-disclaimer.tsx'
|
|
16
|
-
import { SignUpHandleForm } from './sign-up-handle-form.tsx'
|
|
17
|
-
import { SignUpHcaptchaForm } from './sign-up-hcaptcha-form.tsx'
|
|
18
|
-
|
|
19
|
-
export type SignUpViewProps = Override<
|
|
20
|
-
LayoutTitlePageProps,
|
|
21
|
-
{
|
|
22
|
-
customizationData?: CustomizationData
|
|
23
|
-
|
|
24
|
-
onBack?: () => void
|
|
25
|
-
onValidateNewHandle: (
|
|
26
|
-
data: { handle: string },
|
|
27
|
-
signal?: AbortSignal,
|
|
28
|
-
) => void | PromiseLike<void>
|
|
29
|
-
onDone: (
|
|
30
|
-
data: SignUpAccountFormOutput & {
|
|
31
|
-
handle: string
|
|
32
|
-
hcaptchaToken?: string
|
|
33
|
-
},
|
|
34
|
-
signal?: AbortSignal,
|
|
35
|
-
) => void | PromiseLike<void>
|
|
36
|
-
}
|
|
37
|
-
>
|
|
38
|
-
|
|
39
|
-
export function SignUpView({
|
|
40
|
-
customizationData: {
|
|
41
|
-
availableUserDomains = [],
|
|
42
|
-
hcaptchaSiteKey = undefined,
|
|
43
|
-
inviteCodeRequired = true,
|
|
44
|
-
links,
|
|
45
|
-
} = {},
|
|
46
|
-
|
|
47
|
-
onValidateNewHandle,
|
|
48
|
-
onDone,
|
|
49
|
-
onBack,
|
|
50
|
-
|
|
51
|
-
// LayoutTitlePage
|
|
52
|
-
...props
|
|
53
|
-
}: SignUpViewProps) {
|
|
54
|
-
const { t } = useLingui()
|
|
55
|
-
const [credentials, setCredentials] = useState<
|
|
56
|
-
undefined | SignUpAccountFormOutput
|
|
57
|
-
>(undefined)
|
|
58
|
-
const [handle, setHandle] = useState<undefined | string>(undefined)
|
|
59
|
-
const [hcaptcha, setHcaptcha] = useState<undefined | string>(undefined)
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* "false" indicates that the hcaptcha token is invalid (required but not provided)
|
|
63
|
-
*/
|
|
64
|
-
const hcaptchaToken = hcaptchaSiteKey == null ? undefined : hcaptcha || false
|
|
65
|
-
|
|
66
|
-
const doDone = useCallback(
|
|
67
|
-
(signal: AbortSignal) => {
|
|
68
|
-
if (credentials && handle && hcaptchaToken !== false) {
|
|
69
|
-
return onDone({ ...credentials, handle, hcaptchaToken }, signal)
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
[credentials, handle, hcaptchaToken, onDone],
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<LayoutTitlePage
|
|
77
|
-
{...props}
|
|
78
|
-
title={props.title ?? t`Create Account`}
|
|
79
|
-
subtitle={
|
|
80
|
-
props.subtitle ?? <Trans>We're so excited to have you join us!</Trans>
|
|
81
|
-
}
|
|
82
|
-
>
|
|
83
|
-
<WizardCard
|
|
84
|
-
doneLabel={<Trans>Sign up</Trans>}
|
|
85
|
-
onBack={onBack}
|
|
86
|
-
onDone={doDone}
|
|
87
|
-
steps={[
|
|
88
|
-
// We use the handle input first since the "onValidateNewHandle" check
|
|
89
|
-
// will make it less likely that the actual signup call will fail, and
|
|
90
|
-
// will result in a better user experience, especially if there is an
|
|
91
|
-
// issue with the email address (e.g. already in use).
|
|
92
|
-
{
|
|
93
|
-
invalid: !handle,
|
|
94
|
-
titleRender: () => <Trans>Choose a username</Trans>,
|
|
95
|
-
contentRender: ({ prev, prevLabel, next, nextLabel, invalid }) => (
|
|
96
|
-
<SignUpHandleForm
|
|
97
|
-
className="flex-grow"
|
|
98
|
-
invalid={invalid}
|
|
99
|
-
domains={availableUserDomains}
|
|
100
|
-
handle={handle}
|
|
101
|
-
onHandle={setHandle}
|
|
102
|
-
prevLabel={prevLabel}
|
|
103
|
-
onPrev={prev}
|
|
104
|
-
nextLabel={nextLabel}
|
|
105
|
-
onNext={async (signal) => {
|
|
106
|
-
if (handle) await onValidateNewHandle({ handle }, signal)
|
|
107
|
-
if (!signal.aborted) return next(signal)
|
|
108
|
-
}}
|
|
109
|
-
>
|
|
110
|
-
<SignUpDisclaimer links={links} />
|
|
111
|
-
</SignUpHandleForm>
|
|
112
|
-
),
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
invalid: !credentials,
|
|
116
|
-
titleRender: () => <Trans>Your account</Trans>,
|
|
117
|
-
contentRender: ({ prev, prevLabel, next, nextLabel, invalid }) => (
|
|
118
|
-
<SignUpAccountForm
|
|
119
|
-
className="flex-grow"
|
|
120
|
-
invalid={invalid}
|
|
121
|
-
prevLabel={prevLabel}
|
|
122
|
-
onPrev={prev}
|
|
123
|
-
nextLabel={nextLabel}
|
|
124
|
-
onNext={next}
|
|
125
|
-
inviteCodeRequired={inviteCodeRequired}
|
|
126
|
-
credentials={credentials}
|
|
127
|
-
onCredentials={setCredentials}
|
|
128
|
-
>
|
|
129
|
-
<SignUpDisclaimer links={links} />
|
|
130
|
-
</SignUpAccountForm>
|
|
131
|
-
),
|
|
132
|
-
},
|
|
133
|
-
hcaptchaSiteKey != null && {
|
|
134
|
-
invalid: hcaptchaToken === false,
|
|
135
|
-
titleRender: () => <Trans>Verify you are human</Trans>,
|
|
136
|
-
contentRender: ({ prev, prevLabel, next, nextLabel, invalid }) => (
|
|
137
|
-
<SignUpHcaptchaForm
|
|
138
|
-
className="flex-grow"
|
|
139
|
-
invalid={invalid}
|
|
140
|
-
siteKey={hcaptchaSiteKey}
|
|
141
|
-
token={hcaptcha}
|
|
142
|
-
onToken={setHcaptcha}
|
|
143
|
-
prevLabel={prevLabel}
|
|
144
|
-
onPrev={prev}
|
|
145
|
-
nextLabel={nextLabel}
|
|
146
|
-
onNext={next}
|
|
147
|
-
>
|
|
148
|
-
<SignUpDisclaimer links={links} />
|
|
149
|
-
</SignUpHcaptchaForm>
|
|
150
|
-
),
|
|
151
|
-
},
|
|
152
|
-
]}
|
|
153
|
-
/>
|
|
154
|
-
|
|
155
|
-
<HelpCard className="mt-4" links={links} />
|
|
156
|
-
</LayoutTitlePage>
|
|
157
|
-
)
|
|
158
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Trans, useLingui } from '@lingui/react/macro'
|
|
2
|
-
import { Button } from '../../../components/forms/button.tsx'
|
|
3
|
-
import {
|
|
4
|
-
LayoutWelcome,
|
|
5
|
-
LayoutWelcomeProps,
|
|
6
|
-
} from '../../../components/layouts/layout-welcome.tsx'
|
|
7
|
-
import { Override } from '../../../lib/util.ts'
|
|
8
|
-
|
|
9
|
-
export type WelcomeViewParams = Override<
|
|
10
|
-
LayoutWelcomeProps,
|
|
11
|
-
{
|
|
12
|
-
onSignIn?: () => void
|
|
13
|
-
onSignUp?: () => void
|
|
14
|
-
onCancel?: () => void
|
|
15
|
-
}
|
|
16
|
-
>
|
|
17
|
-
|
|
18
|
-
export function WelcomeView({
|
|
19
|
-
onSignUp,
|
|
20
|
-
onSignIn,
|
|
21
|
-
onCancel,
|
|
22
|
-
|
|
23
|
-
// LayoutWelcome
|
|
24
|
-
...props
|
|
25
|
-
}: WelcomeViewParams) {
|
|
26
|
-
const { t } = useLingui()
|
|
27
|
-
return (
|
|
28
|
-
<LayoutWelcome {...props} title={props.title ?? t`Authenticate`}>
|
|
29
|
-
{onSignUp && (
|
|
30
|
-
<Button
|
|
31
|
-
className={'m-1 w-60 max-w-full min-w-min'}
|
|
32
|
-
color={onSignIn ? 'brand' : undefined}
|
|
33
|
-
onClick={onSignUp}
|
|
34
|
-
>
|
|
35
|
-
<Trans>Create a new account</Trans>
|
|
36
|
-
</Button>
|
|
37
|
-
)}
|
|
38
|
-
|
|
39
|
-
{onSignIn && (
|
|
40
|
-
<Button
|
|
41
|
-
className={'m-1 w-60 max-w-full min-w-min'}
|
|
42
|
-
color={onSignUp ? undefined : 'brand'}
|
|
43
|
-
onClick={onSignIn}
|
|
44
|
-
>
|
|
45
|
-
<Trans>Sign in</Trans>
|
|
46
|
-
</Button>
|
|
47
|
-
)}
|
|
48
|
-
|
|
49
|
-
{onCancel && (
|
|
50
|
-
<Button className="m-1 w-60 max-w-full min-w-min" onClick={onCancel}>
|
|
51
|
-
<Trans>Cancel</Trans>
|
|
52
|
-
</Button>
|
|
53
|
-
)}
|
|
54
|
-
</LayoutWelcome>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useLingui } from '@lingui/react/macro'
|
|
2
|
-
import { memo } from 'react'
|
|
3
|
-
import {
|
|
4
|
-
LayoutWelcome,
|
|
5
|
-
LayoutWelcomeProps,
|
|
6
|
-
} from '../../components/layouts/layout-welcome.tsx'
|
|
7
|
-
import { ErrorCard } from '../../components/utils/error-card.tsx'
|
|
8
|
-
import { Override } from '../../lib/util.ts'
|
|
9
|
-
|
|
10
|
-
export type ErrorViewProps = Override<
|
|
11
|
-
LayoutWelcomeProps,
|
|
12
|
-
{
|
|
13
|
-
error: unknown
|
|
14
|
-
}
|
|
15
|
-
>
|
|
16
|
-
|
|
17
|
-
export const ErrorView = memo(function ErrorView({
|
|
18
|
-
error,
|
|
19
|
-
|
|
20
|
-
// LayoutWelcome
|
|
21
|
-
title,
|
|
22
|
-
...props
|
|
23
|
-
}: ErrorViewProps) {
|
|
24
|
-
const { t } = useLingui()
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<LayoutWelcome {...props} title={title ?? t`Error`}>
|
|
28
|
-
<ErrorCard error={error} />
|
|
29
|
-
</LayoutWelcome>
|
|
30
|
-
)
|
|
31
|
-
})
|
package/tailwind.config.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** @type {import('tailwindcss').Config} */
|
|
2
|
-
export default {
|
|
3
|
-
content: ['src/**/*.{js,ts,jsx,tsx}'],
|
|
4
|
-
theme: {
|
|
5
|
-
fontFamily: {
|
|
6
|
-
sans: [
|
|
7
|
-
'-apple-system',
|
|
8
|
-
'BlinkMacSystemFont',
|
|
9
|
-
'"Segoe UI"',
|
|
10
|
-
'Roboto',
|
|
11
|
-
'Helvetica',
|
|
12
|
-
'Arial',
|
|
13
|
-
'sans-serif',
|
|
14
|
-
],
|
|
15
|
-
mono: ['Monaco', 'mono'],
|
|
16
|
-
},
|
|
17
|
-
extend: {
|
|
18
|
-
colors: {
|
|
19
|
-
brand: 'rgb(var(--color-brand) / <alpha-value>)',
|
|
20
|
-
'brand-c': 'rgb(var(--color-brand-c) / <alpha-value>)',
|
|
21
|
-
error: 'rgb(var(--color-error) / <alpha-value>)',
|
|
22
|
-
'error-c': 'rgb(var(--color-error-c) / <alpha-value>)',
|
|
23
|
-
warning: 'rgb(var(--color-warning) / <alpha-value>)',
|
|
24
|
-
'warning-c': 'rgb(var(--color-warning-c) / <alpha-value>)',
|
|
25
|
-
success: 'rgb(var(--color-success) / <alpha-value>)',
|
|
26
|
-
'success-c': 'rgb(var(--color-success-c) / <alpha-value>)',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
plugins: [],
|
|
31
|
-
}
|
package/tsconfig.backend.json
DELETED