@activecollab/components 2.0.359 → 2.0.360
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/cjs/components/Icons/collection/Key.js +60 -0
- package/dist/cjs/components/Icons/collection/Key.js.map +1 -0
- package/dist/cjs/components/Icons/collection/index.js +7 -0
- package/dist/cjs/components/Icons/collection/index.js.map +1 -1
- package/dist/cjs/presentation/shared/TwoFactorDialogs.js +432 -0
- package/dist/cjs/presentation/shared/TwoFactorDialogs.js.map +1 -0
- package/dist/cjs/presentation/shared/TwoFactorShield.js +31 -0
- package/dist/cjs/presentation/shared/TwoFactorShield.js.map +1 -0
- package/dist/cjs/presentation/shared/UserMenu.js +282 -0
- package/dist/cjs/presentation/shared/UserMenu.js.map +1 -0
- package/dist/cjs/presentation/shared/index.js +32 -1
- package/dist/cjs/presentation/shared/index.js.map +1 -1
- package/dist/esm/components/Icons/collection/Key.d.ts +32 -0
- package/dist/esm/components/Icons/collection/Key.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/Key.js +53 -0
- package/dist/esm/components/Icons/collection/Key.js.map +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/index.js +1 -0
- package/dist/esm/components/Icons/collection/index.js.map +1 -1
- package/dist/esm/presentation/shared/TwoFactorDialogs.d.ts +24 -0
- package/dist/esm/presentation/shared/TwoFactorDialogs.d.ts.map +1 -0
- package/dist/esm/presentation/shared/TwoFactorDialogs.js +383 -0
- package/dist/esm/presentation/shared/TwoFactorDialogs.js.map +1 -0
- package/dist/esm/presentation/shared/TwoFactorShield.d.ts +13 -0
- package/dist/esm/presentation/shared/TwoFactorShield.d.ts.map +1 -0
- package/dist/esm/presentation/shared/TwoFactorShield.js +25 -0
- package/dist/esm/presentation/shared/TwoFactorShield.js.map +1 -0
- package/dist/esm/presentation/shared/UserMenu.d.ts +27 -0
- package/dist/esm/presentation/shared/UserMenu.d.ts.map +1 -0
- package/dist/esm/presentation/shared/UserMenu.js +255 -0
- package/dist/esm/presentation/shared/UserMenu.js.map +1 -0
- package/dist/esm/presentation/shared/index.d.ts +6 -0
- package/dist/esm/presentation/shared/index.d.ts.map +1 -1
- package/dist/esm/presentation/shared/index.js +3 -0
- package/dist/esm/presentation/shared/index.js.map +1 -1
- package/dist/index.js +318 -268
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoFactorDialogs.js","names":["React","useEffect","useMemo","useState","styled","Button","Dialog","IconButton","CancelCrossIcon","CopyIcon","InfoBox","InputPassword","Label","SkeletonLoader","ToastMessage","Tooltip","SlideFromTop","Body2","Caption1","Header3","SANS","MONO","asInputChange","fn","SAMPLE_BACKUP_CODES","SAMPLE_LOGIN_CODE","StyledToastAnchor","div","withConfig","displayName","componentId","CopyToast","_ref","open","toastKey","text","onClose","createElement","in","key","className","type","dismissible","dropShadow","timeout","StyledGateBody","BackupCodesDialogs","_ref2","_useState","password","setPassword","_useState2","attempted","setAttempted","_useState3","revealOpen","setRevealOpen","_useState4","loading","setLoading","_useState5","copyOpen","setCopyOpen","_useState6","copyKey","setCopyKey","undefined","timer","window","setTimeout","clearTimeout","passwordInvalid","trim","handleConfirm","handleCopy","k","closeReveal","Fragment","disableCloseOnEsc","Title","ContentDivider","Content","color","lineHeight","htmlFor","id","wrapperClassName","value","onChange","invalid","errorMessage","autoFocus","autoComplete","Actions","variant","style","marginRight","onClick","BackupCodesRevealDialog","onCopy","StyledRevealBody","_ref3","Array","map","_","index","code","showIcon","title","disabled","StyledCodeRow","StyledRevealTitle","CreateLoginCodeDialogs","_ref4","userName","firstName","split","_useState7","_useState8","_useState9","_useState0","expiry","setExpiry","_useState1","_useState10","when","Date","now","hh","String","getHours","padStart","mm","getMinutes","disableDefaultHeading"],"sources":["../../../../src/presentation/shared/TwoFactorDialogs.tsx"],"sourcesContent":["import React, { ReactElement, useEffect, useMemo, useState } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport { Button } from \"../../components/Button\";\nimport { Dialog } from \"../../components/Dialog\";\nimport { IconButton } from \"../../components/IconButton\";\nimport { CancelCrossIcon, CopyIcon } from \"../../components/Icons\";\nimport { InfoBox } from \"../../components/InfoBox\";\nimport { InputPassword } from \"../../components/Input\";\nimport { Label } from \"../../components/Label\";\nimport { SkeletonLoader } from \"../../components/Loaders\";\nimport { ToastMessage } from \"../../components/ToastMessage\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { SlideFromTop } from \"../../components/Transitions\";\nimport { Body2, Caption1, Header3 } from \"../../components/Typography\";\n\n/**\n * Self-hosted 2FA dialogs shared by the People stories (Users list + User\n * profile). Two flows, both reached from the user three-dot menu and both\n * gated (in the menu) behind the self-hosted + 2FA-enabled guard:\n *\n * - **Backup Codes** (own account, `self` menu): a single dialog that both\n * explains the destructive regenerate and takes the password (identity\n * confirmation is \"valid password + submit\", no separate confirm step).\n * Submitting opens the reveal dialog, which shows a skeleton while the new\n * set \"loads\", then the 10 codes once.\n * - **Create Login Code** (another user, `member`/`client` menu): an owner\n * re-enters their own password, then a one-time code is revealed once with\n * its expiry and a \"user notified\" note. (Task #18.)\n *\n * Everything is mocked locally: passwords aren't checked, the \"load\" is a\n * timer, and the codes are static samples.\n */\n\nconst SANS =\n '-apple-system, BlinkMacSystemFont, \"Roboto\", \"Helvetica Neue\", Arial, sans-serif';\nconst MONO =\n '\"SF Mono\", \"Roboto Mono\", Menlo, Consolas, \"Courier New\", monospace';\n\n/**\n * DS `InputPassword` calls `onChange` with the string value at runtime, but its\n * type is still inherited from the native input (`ChangeEventHandler`). Adapt a\n * string handler so TypeScript is satisfied without lying about the value.\n */\nconst asInputChange = (\n fn: (value: string) => void\n): React.ChangeEventHandler<HTMLInputElement> =>\n fn as unknown as React.ChangeEventHandler<HTMLInputElement>;\n\n/* Sample codes (10+10 A-Z0-9), mirroring the real generator's format. */\nconst SAMPLE_BACKUP_CODES = [\n \"4K7Q9ZM2XN-8V3TJRD6WP\",\n \"P2W8XK4M9Q-3RJ7VND5TZ\",\n \"9ZM2XN4K7Q-6WP8V3TJRD\",\n \"TJRD6WP8V3-2XN4K7Q9ZM\",\n \"V3TJRD6WP8-K7Q9ZM2XN4\",\n \"8V3TJRD6WP-Q9ZM2XN4K7\",\n \"RD5TZP2W8X-M9Q3RJ7VND\",\n \"3RJ7VND5TZ-8XK4M9QP2W\",\n \"N4K7Q9ZM2X-6WP8V3TJRD\",\n \"Q9ZM2XN4K7-8V3TJRD6WP\",\n];\n\nconst SAMPLE_LOGIN_CODE = \"4K7Q9ZM2XN-8V3TJRD6WP\";\n\n/* ------------------------------------------------------------------ */\n/* Toast (reuses the fixed upper-right anchor pattern from headers) */\n/* ------------------------------------------------------------------ */\n\nconst StyledToastAnchor = styled.div`\n position: fixed;\n top: 16px;\n right: 16px;\n z-index: 10000;\n pointer-events: none;\n\n .c-toast-message {\n pointer-events: auto;\n }\n`;\n\ninterface CopyToastProps {\n open: boolean;\n toastKey: number;\n text: string;\n onClose: () => void;\n}\n\nconst CopyToast = ({\n open,\n toastKey,\n text,\n onClose,\n}: CopyToastProps): ReactElement => (\n <StyledToastAnchor>\n <SlideFromTop in={open}>\n <ToastMessage\n key={toastKey}\n className=\"c-toast-message\"\n type=\"success\"\n text={text}\n dismissible\n dropShadow\n timeout={3000}\n onClose={onClose}\n />\n </SlideFromTop>\n </StyledToastAnchor>\n);\n\n/* ------------------------------------------------------------------ */\n/* Shared password-gate body (describe + password in one dialog) */\n/* ------------------------------------------------------------------ */\n\nconst StyledGateBody = styled.div`\n font-family: ${SANS};\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n .pg-field {\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n /* DS InputPassword wrapper is fixed-width — fill the dialog. */\n .pg-input.c-input-wrapper,\n .pg-input {\n width: 100%;\n max-width: none;\n }\n`;\n\n/* ------------------------------------------------------------------ */\n/* Backup Codes — combined describe + password dialog */\n/* ------------------------------------------------------------------ */\n\nexport interface BackupCodesDialogsProps {\n open: boolean;\n onClose: () => void;\n}\n\n/**\n * The full Backup Codes flow: the combined regenerate/password dialog, then the\n * one-time reveal dialog with its loading skeleton. Cancelling the first dialog\n * is a pure no-op — no codes are issued, no toast.\n */\nexport const BackupCodesDialogs = ({\n open,\n onClose,\n}: BackupCodesDialogsProps): ReactElement => {\n const [password, setPassword] = useState(\"\");\n const [attempted, setAttempted] = useState(false);\n const [revealOpen, setRevealOpen] = useState(false);\n const [loading, setLoading] = useState(true);\n\n const [copyOpen, setCopyOpen] = useState(false);\n const [copyKey, setCopyKey] = useState(0);\n\n // Reset the gate each time it (re)opens.\n useEffect(() => {\n if (open) {\n setPassword(\"\");\n setAttempted(false);\n }\n }, [open]);\n\n // Simulate the API generating the new set: a ~1s skeleton on reveal.\n useEffect(() => {\n if (!revealOpen) {\n return undefined;\n }\n setLoading(true);\n const timer = window.setTimeout(() => setLoading(false), 1100);\n return () => window.clearTimeout(timer);\n }, [revealOpen]);\n\n const passwordInvalid = attempted && password.trim() === \"\";\n\n const handleConfirm = (): void => {\n if (password.trim() === \"\") {\n setAttempted(true);\n return;\n }\n // Valid password + submit is all the confirmation we need: close the gate\n // and open the reveal (which regenerates the set).\n onClose();\n setRevealOpen(true);\n };\n\n const handleCopy = (): void => {\n setCopyOpen(true);\n setCopyKey((k) => k + 1);\n };\n\n const closeReveal = (): void => {\n setRevealOpen(false);\n };\n\n return (\n <>\n <Dialog open={open} onClose={onClose} disableCloseOnEsc>\n <Dialog.Title>Regenerate Backup Codes</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledGateBody>\n <Body2 color=\"secondary\" lineHeight=\"loose\">\n This drops all of your existing backup codes and creates a new set\n of 10. Any codes you saved before will stop working. The new codes\n are shown only once. Enter your password to confirm it's you.\n </Body2>\n <div className=\"pg-field\">\n <Label htmlFor=\"backup-codes-password\">Your Password</Label>\n <InputPassword\n id=\"backup-codes-password\"\n wrapperClassName=\"pg-input\"\n value={password}\n onChange={asInputChange((value) => {\n setPassword(value);\n setAttempted(false);\n })}\n invalid={passwordInvalid}\n errorMessage={\n passwordInvalid ? \"Your password is required.\" : undefined\n }\n autoFocus\n autoComplete=\"current-password\"\n />\n </div>\n </StyledGateBody>\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n style={{ marginRight: 12 }}\n onClick={handleConfirm}\n >\n Regenerate Codes\n </Button>\n <Button variant=\"secondary\" onClick={onClose}>\n Cancel\n </Button>\n </Dialog.Actions>\n </Dialog>\n\n <BackupCodesRevealDialog\n open={revealOpen}\n loading={loading}\n onClose={closeReveal}\n onCopy={handleCopy}\n />\n\n <CopyToast\n open={copyOpen}\n toastKey={copyKey}\n text=\"Backup codes copied to clipboard.\"\n onClose={() => setCopyOpen(false)}\n />\n </>\n );\n};\n\n/* ------------------------------------------------------------------ */\n/* Backup Codes — one-time reveal (skeleton while loading) */\n/* ------------------------------------------------------------------ */\n\nconst StyledRevealBody = styled.div`\n font-family: ${SANS};\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n .bc-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px 16px;\n }\n\n .bc-code {\n font-family: ${MONO};\n font-size: 14px;\n letter-spacing: 0.5px;\n color: var(--color-theme-900);\n padding: 6px 10px;\n border-radius: 6px;\n background-color: var(--color-theme-200);\n text-align: center;\n }\n\n .bc-skeleton {\n height: 32px;\n border-radius: 6px;\n width: 100%;\n }\n`;\n\ninterface BackupCodesRevealDialogProps {\n open: boolean;\n loading: boolean;\n onClose: () => void;\n onCopy: () => void;\n}\n\nconst BackupCodesRevealDialog = ({\n open,\n loading,\n onClose,\n onCopy,\n}: BackupCodesRevealDialogProps): ReactElement => (\n <Dialog open={open} onClose={onClose} disableCloseOnEsc>\n <Dialog.Title>Your Backup Codes</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledRevealBody>\n <Body2 color=\"secondary\" lineHeight=\"loose\">\n Use a backup code to log in when email isn't available. Each code\n works once.\n </Body2>\n <div className=\"bc-grid\">\n {loading\n ? [...Array(10)].map((_, index) => (\n <SkeletonLoader key={index} className=\"bc-skeleton\" />\n ))\n : SAMPLE_BACKUP_CODES.map((code) => (\n <div key={code} className=\"bc-code\">\n {code}\n </div>\n ))}\n </div>\n <InfoBox type=\"note\" showIcon title=\"Codes are shown only once\">\n <Body2 color=\"secondary\">\n Save them somewhere safe, they can't be displayed again. You\n can generate a new set from your profile at any time.\n </Body2>\n </InfoBox>\n </StyledRevealBody>\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n style={{ marginRight: 12 }}\n onClick={onClose}\n disabled={loading}\n >\n I've Saved My Codes\n </Button>\n <Button variant=\"secondary\" onClick={onCopy} disabled={loading}>\n Copy Codes\n </Button>\n </Dialog.Actions>\n </Dialog>\n);\n\n/* ------------------------------------------------------------------ */\n/* Create Login Code — password gate + one-time reveal */\n/* ------------------------------------------------------------------ */\n\nconst StyledCodeRow = styled.div`\n font-family: ${SANS};\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n .lc-label {\n display: block;\n margin-bottom: 6px;\n }\n\n .lc-code-field {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border-radius: 8px;\n background-color: var(--color-theme-200);\n }\n\n .lc-code {\n font-family: ${MONO};\n font-size: 15px;\n letter-spacing: 0.5px;\n color: var(--color-theme-900);\n flex: 1 1 auto;\n }\n\n .lc-copy svg {\n fill: var(--color-theme-600);\n }\n\n .lc-caption {\n display: block;\n margin-top: 6px;\n }\n`;\n\n/* Title row for the reveal dialog: heading on the left, X close on the right\n (the app's Use Token dialog pattern). Applied via className since\n Dialog.Title doesn't accept inline style. */\nconst StyledRevealTitle = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n .lc-close svg {\n fill: var(--color-theme-600);\n }\n`;\n\nexport interface CreateLoginCodeDialogsProps {\n open: boolean;\n onClose: () => void;\n /** Target user's full name (drives the dialog copy). */\n userName: string;\n}\n\n/**\n * Owner-minted login code flow (task #18): password gate first, then the\n * one-time reveal. The reveal has no footer — an X in the title closes it —\n * mirroring the app's Use Token dialog.\n */\nexport const CreateLoginCodeDialogs = ({\n open,\n onClose,\n userName,\n}: CreateLoginCodeDialogsProps): ReactElement => {\n const firstName = useMemo(\n () => userName.split(\" \")[0] || userName,\n [userName]\n );\n\n const [password, setPassword] = useState(\"\");\n const [attempted, setAttempted] = useState(false);\n const [revealOpen, setRevealOpen] = useState(false);\n // Expiry copy: computed as \"now + 10 min\" at the moment the code is minted.\n const [expiry, setExpiry] = useState(\"\");\n\n const [copyOpen, setCopyOpen] = useState(false);\n const [copyKey, setCopyKey] = useState(0);\n\n useEffect(() => {\n if (open) {\n setPassword(\"\");\n setAttempted(false);\n }\n }, [open]);\n\n const passwordInvalid = attempted && password.trim() === \"\";\n\n const handleConfirm = (): void => {\n if (password.trim() === \"\") {\n setAttempted(true);\n return;\n }\n const when = new Date(Date.now() + 10 * 60000);\n const hh = String(when.getHours()).padStart(2, \"0\");\n const mm = String(when.getMinutes()).padStart(2, \"0\");\n setExpiry(`${hh}:${mm}`);\n onClose();\n setRevealOpen(true);\n };\n\n const handleCopy = (): void => {\n setCopyOpen(true);\n setCopyKey((k) => k + 1);\n };\n\n return (\n <>\n <Dialog open={open} onClose={onClose} disableCloseOnEsc>\n <Dialog.Title>Confirm Password</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledGateBody>\n <Body2 color=\"secondary\" lineHeight=\"loose\">\n You're about to create a one-time login code for {userName}.\n Any code they already had pending will be replaced.\n </Body2>\n <div className=\"pg-field\">\n <Label htmlFor=\"login-code-password\">Your Password</Label>\n <InputPassword\n id=\"login-code-password\"\n wrapperClassName=\"pg-input\"\n value={password}\n onChange={asInputChange((value) => {\n setPassword(value);\n setAttempted(false);\n })}\n invalid={passwordInvalid}\n errorMessage={\n passwordInvalid ? \"Your password is required.\" : undefined\n }\n autoFocus\n autoComplete=\"current-password\"\n />\n </div>\n </StyledGateBody>\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n style={{ marginRight: 12 }}\n onClick={handleConfirm}\n >\n Confirm\n </Button>\n <Button variant=\"secondary\" onClick={onClose}>\n Cancel\n </Button>\n </Dialog.Actions>\n </Dialog>\n\n <Dialog open={revealOpen} onClose={() => setRevealOpen(false)}>\n <Dialog.Title disableDefaultHeading>\n <StyledRevealTitle>\n <Header3>One-Time Login Code</Header3>\n <IconButton\n variant=\"text gray\"\n className=\"lc-close\"\n onClick={() => setRevealOpen(false)}\n >\n <CancelCrossIcon />\n </IconButton>\n </StyledRevealTitle>\n </Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledCodeRow>\n <Body2 color=\"secondary\" lineHeight=\"loose\">\n Share this code with {firstName} through a secure channel.\n They'll still need their password to log in, the code alone\n won't work.\n </Body2>\n <div>\n <Label className=\"lc-label\">Login Code</Label>\n <div className=\"lc-code-field\">\n <span className=\"lc-code\">{SAMPLE_LOGIN_CODE}</span>\n <Tooltip title=\"Copy code\">\n <IconButton\n variant=\"text gray\"\n className=\"lc-copy\"\n onClick={handleCopy}\n >\n <CopyIcon />\n </IconButton>\n </Tooltip>\n </div>\n <Caption1 color=\"tertiary\" className=\"lc-caption\">\n Expires at {expiry} (in 10 minutes), it can't be shown\n again.\n </Caption1>\n </div>\n <InfoBox\n type=\"default\"\n showIcon\n title={`${firstName} has been notified`}\n >\n <Body2 color=\"secondary\">\n They received an email saying you created this code for their\n account. The email doesn't include the code.\n </Body2>\n </InfoBox>\n </StyledCodeRow>\n </Dialog.Content>\n </Dialog>\n\n <CopyToast\n open={copyOpen}\n toastKey={copyKey}\n text=\"Login code copied to clipboard.\"\n onClose={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aAAA,2BACErC,KAAA,CAAAqC,aAAA,CAACzB,KAAK;IAAC4B,SAAS,EAAC;EAAU,GAAC,YAAiB,CAAC,eAC9CxC,KAAA,CAAAqC,aAAA;IAAKG,SAAS,EAAC;EAAe,gBAC5BxC,KAAA,CAAAqC,aAAA;IAAMG,SAAS,EAAC;EAAS,GAAEf,iBAAwB,CAAC,eACpDzB,KAAA,CAAAqC,aAAA,CAACtB,OAAO;IAAC6F,KAAK,EAAC;EAAW,gBACxB5G,KAAA,CAAAqC,aAAA,CAAC9B,UAAU;IACTuF,OAAO,EAAC,WAAW;IACnBtD,SAAS,EAAC,SAAS;IACnByD,OAAO,EAAEvB;EAAW,gBAEpB1E,KAAA,CAAAqC,aAAA,CAAC5B,QAAQ,MAAE,CACD,CACL,CACN,CAAC,eACNT,KAAA,CAAAqC,aAAA,CAACnB,QAAQ;IAACgE,KAAK,EAAC,UAAU;IAAC1C,SAAS,EAAC;EAAY,GAAC,aACrC,EAACiF,MAAM,EAAC,4CAEX,CACP,CAAC,eACNzH,KAAA,CAAAqC,aAAA,CAAC3B,OAAO;IACN+B,IAAI,EAAC,SAAS;IACdkE,QAAQ;IACRC,KAAK,EAAKO,SAAS;EAAqB,gBAExCnH,KAAA,CAAAqC,aAAA,CAACpB,KAAK;IAACiE,KAAK,EAAC;EAAW,GAAC,4GAGlB,CACA,CACI,CACD,CACV,CAAC,eAETlF,KAAA,CAAAqC,aAAA,CAACN,SAAS;IACRE,IAAI,EAAE4B,QAAS;IACf3B,QAAQ,EAAE8B,OAAQ;IAClB7B,IAAI,EAAC,iCAAiC;IACtCC,OAAO,EAAEA,CAAA,KAAM0B,WAAW,CAAC,KAAK;EAAE,CACnC,CACD,CAAC;AAEP,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export interface TwoFactorShieldProps {
|
|
3
|
+
/** When true, 2FA isn't set up yet for the logged-in user: the shield is
|
|
4
|
+
* dimmed and clickable, and the tooltip prompts to enable it. Otherwise it
|
|
5
|
+
* reads as "enabled" (the default). Mirrors `isLoggedUser2FADisabled`. */
|
|
6
|
+
needsSetup?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TwoFactorShield: {
|
|
10
|
+
({ needsSetup, className, }: TwoFactorShieldProps): ReactElement;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=TwoFactorShield.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoFactorShield.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/TwoFactorShield.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAU5C,MAAM,WAAW,oBAAoB;IACnC;;+EAE2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe;iCAGzB,oBAAoB,GAAG,YAAY;;CAarC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ShieldIcon } from "../../components/Icons";
|
|
3
|
+
import { Tooltip } from "../../components/Tooltip";
|
|
4
|
+
|
|
5
|
+
/* Two-factor-authentication shield — the same indicator as the app's
|
|
6
|
+
`User2FA` (ShieldIcon + Tooltip). Shared by the Users list and the User
|
|
7
|
+
profile so the icon and its tooltip stay identical in one place. The shield
|
|
8
|
+
uses its default muted `--color-theme-600` fill. */
|
|
9
|
+
|
|
10
|
+
export const TwoFactorShield = _ref => {
|
|
11
|
+
let _ref$needsSetup = _ref.needsSetup,
|
|
12
|
+
needsSetup = _ref$needsSetup === void 0 ? false : _ref$needsSetup,
|
|
13
|
+
className = _ref.className;
|
|
14
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
15
|
+
title: needsSetup ? "Enable two-factor authentication" : "Two-factor authentication enabled"
|
|
16
|
+
}, /*#__PURE__*/React.createElement(ShieldIcon, {
|
|
17
|
+
className: className,
|
|
18
|
+
style: needsSetup ? {
|
|
19
|
+
opacity: 0.5,
|
|
20
|
+
cursor: "pointer"
|
|
21
|
+
} : undefined
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
TwoFactorShield.displayName = "TwoFactorShield";
|
|
25
|
+
//# sourceMappingURL=TwoFactorShield.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoFactorShield.js","names":["React","ShieldIcon","Tooltip","TwoFactorShield","_ref","_ref$needsSetup","needsSetup","className","createElement","title","style","opacity","cursor","undefined","displayName"],"sources":["../../../../src/presentation/shared/TwoFactorShield.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\nimport { ShieldIcon } from \"../../components/Icons\";\nimport { Tooltip } from \"../../components/Tooltip\";\n\n/* Two-factor-authentication shield — the same indicator as the app's\n `User2FA` (ShieldIcon + Tooltip). Shared by the Users list and the User\n profile so the icon and its tooltip stay identical in one place. The shield\n uses its default muted `--color-theme-600` fill. */\n\nexport interface TwoFactorShieldProps {\n /** When true, 2FA isn't set up yet for the logged-in user: the shield is\n * dimmed and clickable, and the tooltip prompts to enable it. Otherwise it\n * reads as \"enabled\" (the default). Mirrors `isLoggedUser2FADisabled`. */\n needsSetup?: boolean;\n className?: string;\n}\n\nexport const TwoFactorShield = ({\n needsSetup = false,\n className,\n}: TwoFactorShieldProps): ReactElement => (\n <Tooltip\n title={\n needsSetup\n ? \"Enable two-factor authentication\"\n : \"Two-factor authentication enabled\"\n }\n >\n <ShieldIcon\n className={className}\n style={needsSetup ? { opacity: 0.5, cursor: \"pointer\" } : undefined}\n />\n </Tooltip>\n);\n\nTwoFactorShield.displayName = \"TwoFactorShield\";\n"],"mappings":"AAAA,OAAOA,KAAK,MAAwB,OAAO;AAE3C,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,OAAO,QAAQ,0BAA0B;;AAElD;AACA;AACA;AACA;;AAUA,OAAO,MAAMC,eAAe,GAAGC,IAAA;EAAA,IAAAC,eAAA,GAAAD,IAAA,CAC7BE,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,KAAK,GAAAA,eAAA;IAClBE,SAAS,GAAAH,IAAA,CAATG,SAAS;EAAA,oBAETP,KAAA,CAAAQ,aAAA,CAACN,OAAO;IACNO,KAAK,EACHH,UAAU,GACN,kCAAkC,GAClC;EACL,gBAEDN,KAAA,CAAAQ,aAAA,CAACP,UAAU;IACTM,SAAS,EAAEA,SAAU;IACrBG,KAAK,EAAEJ,UAAU,GAAG;MAAEK,OAAO,EAAE,GAAG;MAAEC,MAAM,EAAE;IAAU,CAAC,GAAGC;EAAU,CACrE,CACM,CAAC;AAAA,CACX;AAEDV,eAAe,CAACW,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
/** Which set of actions to show, from the owner/power-user's point of view.
|
|
3
|
+
* `self` = acting on their own row; `member` = another (active) member;
|
|
4
|
+
* `client` = a client/client+ (no rates & capacity — clients are excluded). */
|
|
5
|
+
export type UserMenuVariant = "self" | "member" | "client";
|
|
6
|
+
export interface UserMenuProps {
|
|
7
|
+
/** Which action set to render. Defaults to `member`. */
|
|
8
|
+
variant?: UserMenuVariant;
|
|
9
|
+
/** Class on the TreeDots trigger (parent controls its hover visibility). */
|
|
10
|
+
targetClassName?: string;
|
|
11
|
+
/** IconButton size of the trigger (omit for the default/regular size). */
|
|
12
|
+
size?: "small" | "medium" | "big";
|
|
13
|
+
/**
|
|
14
|
+
* The combined self-hosted + 2FA-enabled guard (`!isOnDemand &&
|
|
15
|
+
* multiFactorEnabled`). When true, the variant's 2FA item (Backup Codes for
|
|
16
|
+
* `self`, Create Login Code otherwise) is shown. Defaults to true here so the
|
|
17
|
+
* prototype demonstrates the enabled state.
|
|
18
|
+
*/
|
|
19
|
+
selfHosted2FA?: boolean;
|
|
20
|
+
/** Target user's name — drives the Create Login Code dialog copy. */
|
|
21
|
+
userName?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const UserMenu: {
|
|
24
|
+
({ variant, targetClassName, size, selfHosted2FA, userName, }: UserMenuProps): ReactElement;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=UserMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/UserMenu.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAyB,MAAM,OAAO,CAAC;AAyBnE;;gFAEgF;AAChF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAqH3D,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAClC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,QAAQ;mEAMlB,aAAa,GAAG,YAAY;;CAmF9B,CAAC"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { BackupCodesDialogs, CreateLoginCodeDialogs } from "./TwoFactorDialogs";
|
|
3
|
+
import { IconButton } from "../../components/IconButton";
|
|
4
|
+
import { ArchiveIcon, DollarIcon, EditIcon, HistoryOfChangesIcon, KeyIcon, LockIcon, PersonArrowOutCircleIcon, ProjectAddIcon, TrashIcon, TreeDotsIcon } from "../../components/Icons";
|
|
5
|
+
import { List, ListItem, ListSeparator } from "../../components/List";
|
|
6
|
+
import { Menu } from "../../components/Menu";
|
|
7
|
+
|
|
8
|
+
/* User three-dot options menu — the same component as the real
|
|
9
|
+
`PeopleItemMenu` in the app (Menu + List of leading-icon items). Shared by
|
|
10
|
+
every story under `Presentation/People/*` so the user-row actions stay
|
|
11
|
+
identical in one place. Companies get their own menu. Most clicks are
|
|
12
|
+
intentionally no-ops; the two self-hosted 2FA items open working dialogs. */
|
|
13
|
+
|
|
14
|
+
/** Which set of actions to show, from the owner/power-user's point of view.
|
|
15
|
+
* `self` = acting on their own row; `member` = another (active) member;
|
|
16
|
+
* `client` = a client/client+ (no rates & capacity — clients are excluded). */
|
|
17
|
+
|
|
18
|
+
/** A menu entry: a plain action row, a divider, or one of the self-hosted 2FA
|
|
19
|
+
* actions that open a dialog. */
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The two self-hosted 2FA menu items, kept separate from the always-present
|
|
23
|
+
* entries because they render only when {@link UserMenuProps.selfHosted2FA} is
|
|
24
|
+
* true. In the real app that flag is the combined guard
|
|
25
|
+
* `!isOnDemand && multiFactorEnabled` — a Cloud account (Shepherd handles 2FA)
|
|
26
|
+
* or a self-hosted account with 2FA off must never render them.
|
|
27
|
+
*
|
|
28
|
+
* - `backup-codes` — own account only (`self`), sits under Change Password.
|
|
29
|
+
* - `create-login-code` — an owner acting on another user (`member`/`client`),
|
|
30
|
+
* sits after Change Permissions.
|
|
31
|
+
*/
|
|
32
|
+
const TWO_FACTOR_ENTRIES = {
|
|
33
|
+
self: {
|
|
34
|
+
type: "twoFactor",
|
|
35
|
+
action: "backup-codes"
|
|
36
|
+
},
|
|
37
|
+
member: {
|
|
38
|
+
type: "twoFactor",
|
|
39
|
+
action: "create-login-code"
|
|
40
|
+
},
|
|
41
|
+
client: {
|
|
42
|
+
type: "twoFactor",
|
|
43
|
+
action: "create-login-code"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const TWO_FACTOR_LABELS = {
|
|
47
|
+
"backup-codes": "Backup Codes",
|
|
48
|
+
"create-login-code": "Create Login Code"
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Menu contents per variant, mirroring the app's capability checks:
|
|
53
|
+
* - `self` can edit their profile, change their password (and, on self-hosted
|
|
54
|
+
* with 2FA on, manage their Backup Codes), see rates/capacity and history,
|
|
55
|
+
* and invite themselves to projects.
|
|
56
|
+
* - `member` (owner viewing another member) can change permissions (and, on
|
|
57
|
+
* self-hosted with 2FA on, Create Login Code), rates/capacity and history,
|
|
58
|
+
* invite to projects, then archive or delete.
|
|
59
|
+
* - `client` (owner viewing a client) can edit profile, change password and
|
|
60
|
+
* permissions (and Create Login Code), see history, invite to projects, then
|
|
61
|
+
* archive or delete — but NOT rates & capacity.
|
|
62
|
+
*
|
|
63
|
+
* The 2FA entry is spliced in right after the anchor action below.
|
|
64
|
+
*/
|
|
65
|
+
const BASE_ENTRIES = {
|
|
66
|
+
self: [{
|
|
67
|
+
type: "item",
|
|
68
|
+
icon: EditIcon,
|
|
69
|
+
label: "Edit Profile"
|
|
70
|
+
}, {
|
|
71
|
+
type: "item",
|
|
72
|
+
icon: LockIcon,
|
|
73
|
+
label: "Change Password"
|
|
74
|
+
}, {
|
|
75
|
+
type: "item",
|
|
76
|
+
icon: DollarIcon,
|
|
77
|
+
label: "Rates and Capacity"
|
|
78
|
+
}, {
|
|
79
|
+
type: "item",
|
|
80
|
+
icon: HistoryOfChangesIcon,
|
|
81
|
+
label: "History of Changes"
|
|
82
|
+
}, {
|
|
83
|
+
type: "separator"
|
|
84
|
+
}, {
|
|
85
|
+
type: "item",
|
|
86
|
+
icon: ProjectAddIcon,
|
|
87
|
+
label: "Invite to Projects"
|
|
88
|
+
}],
|
|
89
|
+
member: [{
|
|
90
|
+
type: "item",
|
|
91
|
+
icon: PersonArrowOutCircleIcon,
|
|
92
|
+
label: "Change Permissions"
|
|
93
|
+
}, {
|
|
94
|
+
type: "item",
|
|
95
|
+
icon: DollarIcon,
|
|
96
|
+
label: "Rates and Capacity"
|
|
97
|
+
}, {
|
|
98
|
+
type: "item",
|
|
99
|
+
icon: HistoryOfChangesIcon,
|
|
100
|
+
label: "History of Changes"
|
|
101
|
+
}, {
|
|
102
|
+
type: "separator"
|
|
103
|
+
}, {
|
|
104
|
+
type: "item",
|
|
105
|
+
icon: ProjectAddIcon,
|
|
106
|
+
label: "Invite to Projects"
|
|
107
|
+
}, {
|
|
108
|
+
type: "separator"
|
|
109
|
+
}, {
|
|
110
|
+
type: "item",
|
|
111
|
+
icon: ArchiveIcon,
|
|
112
|
+
label: "Archive"
|
|
113
|
+
}, {
|
|
114
|
+
type: "item",
|
|
115
|
+
icon: TrashIcon,
|
|
116
|
+
label: "Delete"
|
|
117
|
+
}],
|
|
118
|
+
client: [{
|
|
119
|
+
type: "item",
|
|
120
|
+
icon: EditIcon,
|
|
121
|
+
label: "Edit Profile"
|
|
122
|
+
}, {
|
|
123
|
+
type: "item",
|
|
124
|
+
icon: LockIcon,
|
|
125
|
+
label: "Change Password"
|
|
126
|
+
}, {
|
|
127
|
+
type: "item",
|
|
128
|
+
icon: PersonArrowOutCircleIcon,
|
|
129
|
+
label: "Change Permissions"
|
|
130
|
+
}, {
|
|
131
|
+
type: "item",
|
|
132
|
+
icon: HistoryOfChangesIcon,
|
|
133
|
+
label: "History of Changes"
|
|
134
|
+
}, {
|
|
135
|
+
type: "separator"
|
|
136
|
+
}, {
|
|
137
|
+
type: "item",
|
|
138
|
+
icon: ProjectAddIcon,
|
|
139
|
+
label: "Invite to Projects"
|
|
140
|
+
}, {
|
|
141
|
+
type: "separator"
|
|
142
|
+
}, {
|
|
143
|
+
type: "item",
|
|
144
|
+
icon: ArchiveIcon,
|
|
145
|
+
label: "Archive"
|
|
146
|
+
}, {
|
|
147
|
+
type: "item",
|
|
148
|
+
icon: TrashIcon,
|
|
149
|
+
label: "Delete"
|
|
150
|
+
}]
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/** The action row each variant's 2FA item is inserted directly after. */
|
|
154
|
+
const TWO_FACTOR_ANCHOR = {
|
|
155
|
+
self: "Change Password",
|
|
156
|
+
member: "Change Permissions",
|
|
157
|
+
client: "Change Permissions"
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/** Build the final entry list, splicing the 2FA item in after its anchor when
|
|
161
|
+
* the self-hosted + 2FA-enabled guard is on. */
|
|
162
|
+
const entriesFor = (variant, selfHosted2FA) => {
|
|
163
|
+
const base = BASE_ENTRIES[variant];
|
|
164
|
+
const twoFactor = TWO_FACTOR_ENTRIES[variant];
|
|
165
|
+
if (!selfHosted2FA || !twoFactor) {
|
|
166
|
+
return base;
|
|
167
|
+
}
|
|
168
|
+
const anchorLabel = TWO_FACTOR_ANCHOR[variant];
|
|
169
|
+
const out = [];
|
|
170
|
+
base.forEach(entry => {
|
|
171
|
+
out.push(entry);
|
|
172
|
+
if (entry.type === "item" && entry.label === anchorLabel) {
|
|
173
|
+
out.push(twoFactor);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
return out;
|
|
177
|
+
};
|
|
178
|
+
export const UserMenu = _ref => {
|
|
179
|
+
let _ref$variant = _ref.variant,
|
|
180
|
+
variant = _ref$variant === void 0 ? "member" : _ref$variant,
|
|
181
|
+
targetClassName = _ref.targetClassName,
|
|
182
|
+
_ref$size = _ref.size,
|
|
183
|
+
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
184
|
+
_ref$selfHosted2FA = _ref.selfHosted2FA,
|
|
185
|
+
selfHosted2FA = _ref$selfHosted2FA === void 0 ? true : _ref$selfHosted2FA,
|
|
186
|
+
_ref$userName = _ref.userName,
|
|
187
|
+
userName = _ref$userName === void 0 ? "this user" : _ref$userName;
|
|
188
|
+
const _useState = useState(false),
|
|
189
|
+
open = _useState[0],
|
|
190
|
+
setOpen = _useState[1];
|
|
191
|
+
const _useState2 = useState(false),
|
|
192
|
+
backupCodesOpen = _useState2[0],
|
|
193
|
+
setBackupCodesOpen = _useState2[1];
|
|
194
|
+
const _useState3 = useState(false),
|
|
195
|
+
loginCodeOpen = _useState3[0],
|
|
196
|
+
setLoginCodeOpen = _useState3[1];
|
|
197
|
+
const handleOpen = useCallback(() => setOpen(true), []);
|
|
198
|
+
const handleClose = useCallback(() => setOpen(false), []);
|
|
199
|
+
const handleTwoFactor = useCallback(action => {
|
|
200
|
+
// Close the menu first, then open the dialog (the app's
|
|
201
|
+
// closed-menu-then-dialog pattern).
|
|
202
|
+
setOpen(false);
|
|
203
|
+
if (action === "backup-codes") {
|
|
204
|
+
setBackupCodesOpen(true);
|
|
205
|
+
} else {
|
|
206
|
+
setLoginCodeOpen(true);
|
|
207
|
+
}
|
|
208
|
+
}, []);
|
|
209
|
+
const triggerClassName = [targetClassName, open ? "open" : ""].filter(Boolean).join(" ") || undefined;
|
|
210
|
+
const entries = entriesFor(variant, selfHosted2FA);
|
|
211
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Menu, {
|
|
212
|
+
open: open,
|
|
213
|
+
onOpen: handleOpen,
|
|
214
|
+
onClose: handleClose,
|
|
215
|
+
position: "bottom-end",
|
|
216
|
+
target: /*#__PURE__*/React.createElement(IconButton, {
|
|
217
|
+
type: "button",
|
|
218
|
+
variant: "text gray",
|
|
219
|
+
size: size,
|
|
220
|
+
className: triggerClassName,
|
|
221
|
+
active: open
|
|
222
|
+
}, /*#__PURE__*/React.createElement(TreeDotsIcon, null))
|
|
223
|
+
}, /*#__PURE__*/React.createElement(List, {
|
|
224
|
+
style: {
|
|
225
|
+
padding: "8px 0",
|
|
226
|
+
minWidth: 220
|
|
227
|
+
},
|
|
228
|
+
tabIndex: -1
|
|
229
|
+
}, entries.map((entry, index) => {
|
|
230
|
+
if (entry.type === "separator") {
|
|
231
|
+
return /*#__PURE__*/React.createElement(ListSeparator, {
|
|
232
|
+
key: "sep-" + index
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
if (entry.type === "twoFactor") {
|
|
236
|
+
return /*#__PURE__*/React.createElement(ListItem, {
|
|
237
|
+
key: entry.action,
|
|
238
|
+
onClick: () => handleTwoFactor(entry.action)
|
|
239
|
+
}, /*#__PURE__*/React.createElement(KeyIcon, null), TWO_FACTOR_LABELS[entry.action]);
|
|
240
|
+
}
|
|
241
|
+
return /*#__PURE__*/React.createElement(ListItem, {
|
|
242
|
+
key: entry.label,
|
|
243
|
+
onClick: () => undefined
|
|
244
|
+
}, /*#__PURE__*/React.createElement(entry.icon, null), entry.label);
|
|
245
|
+
}))), /*#__PURE__*/React.createElement(BackupCodesDialogs, {
|
|
246
|
+
open: backupCodesOpen,
|
|
247
|
+
onClose: () => setBackupCodesOpen(false)
|
|
248
|
+
}), /*#__PURE__*/React.createElement(CreateLoginCodeDialogs, {
|
|
249
|
+
open: loginCodeOpen,
|
|
250
|
+
onClose: () => setLoginCodeOpen(false),
|
|
251
|
+
userName: userName
|
|
252
|
+
}));
|
|
253
|
+
};
|
|
254
|
+
UserMenu.displayName = "UserMenu";
|
|
255
|
+
//# sourceMappingURL=UserMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserMenu.js","names":["React","useCallback","useState","BackupCodesDialogs","CreateLoginCodeDialogs","IconButton","ArchiveIcon","DollarIcon","EditIcon","HistoryOfChangesIcon","KeyIcon","LockIcon","PersonArrowOutCircleIcon","ProjectAddIcon","TrashIcon","TreeDotsIcon","List","ListItem","ListSeparator","Menu","TWO_FACTOR_ENTRIES","self","type","action","member","client","TWO_FACTOR_LABELS","BASE_ENTRIES","icon","label","TWO_FACTOR_ANCHOR","entriesFor","variant","selfHosted2FA","base","twoFactor","anchorLabel","out","forEach","entry","push","UserMenu","_ref","_ref$variant","targetClassName","_ref$size","size","_ref$selfHosted2FA","_ref$userName","userName","_useState","open","setOpen","_useState2","backupCodesOpen","setBackupCodesOpen","_useState3","loginCodeOpen","setLoginCodeOpen","handleOpen","handleClose","handleTwoFactor","triggerClassName","filter","Boolean","join","undefined","entries","createElement","Fragment","onOpen","onClose","position","target","className","active","style","padding","minWidth","tabIndex","map","index","key","onClick","displayName"],"sources":["../../../../src/presentation/shared/UserMenu.tsx"],"sourcesContent":["import React, { ReactElement, useCallback, useState } from \"react\";\n\nimport { BackupCodesDialogs, CreateLoginCodeDialogs } from \"./TwoFactorDialogs\";\nimport { IconButton } from \"../../components/IconButton\";\nimport {\n ArchiveIcon,\n DollarIcon,\n EditIcon,\n HistoryOfChangesIcon,\n KeyIcon,\n LockIcon,\n PersonArrowOutCircleIcon,\n ProjectAddIcon,\n TrashIcon,\n TreeDotsIcon,\n} from \"../../components/Icons\";\nimport { List, ListItem, ListSeparator } from \"../../components/List\";\nimport { Menu } from \"../../components/Menu\";\n\n/* User three-dot options menu — the same component as the real\n `PeopleItemMenu` in the app (Menu + List of leading-icon items). Shared by\n every story under `Presentation/People/*` so the user-row actions stay\n identical in one place. Companies get their own menu. Most clicks are\n intentionally no-ops; the two self-hosted 2FA items open working dialogs. */\n\n/** Which set of actions to show, from the owner/power-user's point of view.\n * `self` = acting on their own row; `member` = another (active) member;\n * `client` = a client/client+ (no rates & capacity — clients are excluded). */\nexport type UserMenuVariant = \"self\" | \"member\" | \"client\";\n\ntype MenuIcon = React.FC<React.SVGProps<SVGSVGElement>>;\n\n/** A menu entry: a plain action row, a divider, or one of the self-hosted 2FA\n * actions that open a dialog. */\ntype MenuEntry =\n | { type: \"separator\" }\n | { type: \"item\"; icon: MenuIcon; label: string }\n | { type: \"twoFactor\"; action: \"backup-codes\" | \"create-login-code\" };\n\n/**\n * The two self-hosted 2FA menu items, kept separate from the always-present\n * entries because they render only when {@link UserMenuProps.selfHosted2FA} is\n * true. In the real app that flag is the combined guard\n * `!isOnDemand && multiFactorEnabled` — a Cloud account (Shepherd handles 2FA)\n * or a self-hosted account with 2FA off must never render them.\n *\n * - `backup-codes` — own account only (`self`), sits under Change Password.\n * - `create-login-code` — an owner acting on another user (`member`/`client`),\n * sits after Change Permissions.\n */\nconst TWO_FACTOR_ENTRIES: Record<UserMenuVariant, MenuEntry | null> = {\n self: { type: \"twoFactor\", action: \"backup-codes\" },\n member: { type: \"twoFactor\", action: \"create-login-code\" },\n client: { type: \"twoFactor\", action: \"create-login-code\" },\n};\n\nconst TWO_FACTOR_LABELS: Record<\"backup-codes\" | \"create-login-code\", string> =\n {\n \"backup-codes\": \"Backup Codes\",\n \"create-login-code\": \"Create Login Code\",\n };\n\n/**\n * Menu contents per variant, mirroring the app's capability checks:\n * - `self` can edit their profile, change their password (and, on self-hosted\n * with 2FA on, manage their Backup Codes), see rates/capacity and history,\n * and invite themselves to projects.\n * - `member` (owner viewing another member) can change permissions (and, on\n * self-hosted with 2FA on, Create Login Code), rates/capacity and history,\n * invite to projects, then archive or delete.\n * - `client` (owner viewing a client) can edit profile, change password and\n * permissions (and Create Login Code), see history, invite to projects, then\n * archive or delete — but NOT rates & capacity.\n *\n * The 2FA entry is spliced in right after the anchor action below.\n */\nconst BASE_ENTRIES: Record<UserMenuVariant, MenuEntry[]> = {\n self: [\n { type: \"item\", icon: EditIcon, label: \"Edit Profile\" },\n { type: \"item\", icon: LockIcon, label: \"Change Password\" },\n { type: \"item\", icon: DollarIcon, label: \"Rates and Capacity\" },\n { type: \"item\", icon: HistoryOfChangesIcon, label: \"History of Changes\" },\n { type: \"separator\" },\n { type: \"item\", icon: ProjectAddIcon, label: \"Invite to Projects\" },\n ],\n member: [\n {\n type: \"item\",\n icon: PersonArrowOutCircleIcon,\n label: \"Change Permissions\",\n },\n { type: \"item\", icon: DollarIcon, label: \"Rates and Capacity\" },\n { type: \"item\", icon: HistoryOfChangesIcon, label: \"History of Changes\" },\n { type: \"separator\" },\n { type: \"item\", icon: ProjectAddIcon, label: \"Invite to Projects\" },\n { type: \"separator\" },\n { type: \"item\", icon: ArchiveIcon, label: \"Archive\" },\n { type: \"item\", icon: TrashIcon, label: \"Delete\" },\n ],\n client: [\n { type: \"item\", icon: EditIcon, label: \"Edit Profile\" },\n { type: \"item\", icon: LockIcon, label: \"Change Password\" },\n {\n type: \"item\",\n icon: PersonArrowOutCircleIcon,\n label: \"Change Permissions\",\n },\n { type: \"item\", icon: HistoryOfChangesIcon, label: \"History of Changes\" },\n { type: \"separator\" },\n { type: \"item\", icon: ProjectAddIcon, label: \"Invite to Projects\" },\n { type: \"separator\" },\n { type: \"item\", icon: ArchiveIcon, label: \"Archive\" },\n { type: \"item\", icon: TrashIcon, label: \"Delete\" },\n ],\n};\n\n/** The action row each variant's 2FA item is inserted directly after. */\nconst TWO_FACTOR_ANCHOR: Record<UserMenuVariant, string> = {\n self: \"Change Password\",\n member: \"Change Permissions\",\n client: \"Change Permissions\",\n};\n\n/** Build the final entry list, splicing the 2FA item in after its anchor when\n * the self-hosted + 2FA-enabled guard is on. */\nconst entriesFor = (\n variant: UserMenuVariant,\n selfHosted2FA: boolean\n): MenuEntry[] => {\n const base = BASE_ENTRIES[variant];\n const twoFactor = TWO_FACTOR_ENTRIES[variant];\n if (!selfHosted2FA || !twoFactor) {\n return base;\n }\n const anchorLabel = TWO_FACTOR_ANCHOR[variant];\n const out: MenuEntry[] = [];\n base.forEach((entry) => {\n out.push(entry);\n if (entry.type === \"item\" && entry.label === anchorLabel) {\n out.push(twoFactor);\n }\n });\n return out;\n};\n\nexport interface UserMenuProps {\n /** Which action set to render. Defaults to `member`. */\n variant?: UserMenuVariant;\n /** Class on the TreeDots trigger (parent controls its hover visibility). */\n targetClassName?: string;\n /** IconButton size of the trigger (omit for the default/regular size). */\n size?: \"small\" | \"medium\" | \"big\";\n /**\n * The combined self-hosted + 2FA-enabled guard (`!isOnDemand &&\n * multiFactorEnabled`). When true, the variant's 2FA item (Backup Codes for\n * `self`, Create Login Code otherwise) is shown. Defaults to true here so the\n * prototype demonstrates the enabled state.\n */\n selfHosted2FA?: boolean;\n /** Target user's name — drives the Create Login Code dialog copy. */\n userName?: string;\n}\n\nexport const UserMenu = ({\n variant = \"member\",\n targetClassName,\n size = \"medium\",\n selfHosted2FA = true,\n userName = \"this user\",\n}: UserMenuProps): ReactElement => {\n const [open, setOpen] = useState(false);\n const [backupCodesOpen, setBackupCodesOpen] = useState(false);\n const [loginCodeOpen, setLoginCodeOpen] = useState(false);\n const handleOpen = useCallback(() => setOpen(true), []);\n const handleClose = useCallback(() => setOpen(false), []);\n\n const handleTwoFactor = useCallback(\n (action: \"backup-codes\" | \"create-login-code\") => {\n // Close the menu first, then open the dialog (the app's\n // closed-menu-then-dialog pattern).\n setOpen(false);\n if (action === \"backup-codes\") {\n setBackupCodesOpen(true);\n } else {\n setLoginCodeOpen(true);\n }\n },\n []\n );\n\n const triggerClassName =\n [targetClassName, open ? \"open\" : \"\"].filter(Boolean).join(\" \") ||\n undefined;\n\n const entries = entriesFor(variant, selfHosted2FA);\n\n return (\n <>\n <Menu\n open={open}\n onOpen={handleOpen}\n onClose={handleClose}\n position=\"bottom-end\"\n target={\n <IconButton\n type=\"button\"\n variant=\"text gray\"\n size={size}\n className={triggerClassName}\n active={open}\n >\n <TreeDotsIcon />\n </IconButton>\n }\n >\n <List style={{ padding: \"8px 0\", minWidth: 220 }} tabIndex={-1}>\n {entries.map((entry, index) => {\n if (entry.type === \"separator\") {\n return <ListSeparator key={`sep-${index}`} />;\n }\n if (entry.type === \"twoFactor\") {\n return (\n <ListItem\n key={entry.action}\n onClick={() => handleTwoFactor(entry.action)}\n >\n <KeyIcon />\n {TWO_FACTOR_LABELS[entry.action]}\n </ListItem>\n );\n }\n return (\n <ListItem key={entry.label} onClick={() => undefined}>\n <entry.icon />\n {entry.label}\n </ListItem>\n );\n })}\n </List>\n </Menu>\n\n <BackupCodesDialogs\n open={backupCodesOpen}\n onClose={() => setBackupCodesOpen(false)}\n />\n <CreateLoginCodeDialogs\n open={loginCodeOpen}\n onClose={() => setLoginCodeOpen(false)}\n userName={userName}\n />\n </>\n );\n};\n\nUserMenu.displayName = \"UserMenu\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAkBC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAElE,SAASC,kBAAkB,EAAEC,sBAAsB,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ACnD,QAAQ;MAACiE,GAAG,EAAE3C,KAAK,CAACV,KAAM;MAACsD,OAAO,EAAEA,CAAA,KAAMjB;IAAU,gBACnDlE,KAAA,CAAAoE,aAAA,CAAC7B,KAAK,CAACX,IAAI,MAAE,CAAC,EACbW,KAAK,CAACV,KACC,CAAC;EAEf,CAAC,CACG,CACF,CAAC,eAEP7B,KAAA,CAAAoE,aAAA,CAACjE,kBAAkB;IACjBgD,IAAI,EAAEG,eAAgB;IACtBiB,OAAO,EAAEA,CAAA,KAAMhB,kBAAkB,CAAC,KAAK;EAAE,CAC1C,CAAC,eACFvD,KAAA,CAAAoE,aAAA,CAAChE,sBAAsB;IACrB+C,IAAI,EAAEM,aAAc;IACpBc,OAAO,EAAEA,CAAA,KAAMb,gBAAgB,CAAC,KAAK,CAAE;IACvCT,QAAQ,EAAEA;EAAS,CACpB,CACD,CAAC;AAEP,CAAC;AAEDR,QAAQ,CAAC2C,WAAW,GAAG,UAAU","ignoreList":[]}
|
|
@@ -26,4 +26,10 @@ export type { IssueEntry, CodeEntry, Stage, HistoryEvent, StageState, CodeStatus
|
|
|
26
26
|
export { SuggestSubtasksButton } from "./SuggestSubtasksButton";
|
|
27
27
|
export { TaskOptionsMenu, TaskListOptionsMenu } from "./TaskOptionsMenu";
|
|
28
28
|
export type { TaskOptionsMenuProps, TaskListOptionsMenuProps, } from "./TaskOptionsMenu";
|
|
29
|
+
export { UserMenu } from "./UserMenu";
|
|
30
|
+
export type { UserMenuProps, UserMenuVariant } from "./UserMenu";
|
|
31
|
+
export { TwoFactorShield } from "./TwoFactorShield";
|
|
32
|
+
export type { TwoFactorShieldProps } from "./TwoFactorShield";
|
|
33
|
+
export { BackupCodesDialogs, CreateLoginCodeDialogs } from "./TwoFactorDialogs";
|
|
34
|
+
export type { BackupCodesDialogsProps, CreateLoginCodeDialogsProps, } from "./TwoFactorDialogs";
|
|
29
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,YAAY,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,UAAU,EACV,iBAAiB,EACjB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,aAAa,EACb,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,UAAU,EACV,SAAS,EACT,KAAK,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,YAAY,EACV,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,YAAY,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EACh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ine, HistoryDialog, CompletedHeader } from "./SourceCodeSection";
|
|
19
19
|
export { SuggestSubtasksButton } from "./SuggestSubtasksButton";
|
|
20
20
|
export { TaskOptionsMenu, TaskListOptionsMenu } from "./TaskOptionsMenu";
|
|
21
|
+
export { UserMenu } from "./UserMenu";
|
|
22
|
+
export { TwoFactorShield } from "./TwoFactorShield";
|
|
23
|
+
export { BackupCodesDialogs, CreateLoginCodeDialogs } from "./TwoFactorDialogs";
|
|
21
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MainLogo","RoundAvatar","PresentationShell","StyledPagePaper","PageHeader","ProjectPageHeader","TabHeader","FloatingControls","HelpAndSupportMenu","LinkingCommandsButton","LinkBranchOrPullRequestDialog","ConnectRepositoryDialog","RepositorySelect","buildRepoOptions","CONNECTIONS","PROJECT_REPOSITORIES","CONNECTABLE_REPOSITORIES","WebhookLogsDialog","WEBHOOK_CONNECTIONS","WEBHOOK_REPOSITORIES","SourceCodeSection","IssueRow","CodeRow","Spine","HistoryDialog","CompletedHeader","SuggestSubtasksButton","TaskOptionsMenu","TaskListOptionsMenu"],"sources":["../../../../src/presentation/shared/index.ts"],"sourcesContent":["/**\n * Shared building blocks for the Presentation mock-ups (`Presentation/*`\n * stories). The application shell, page headers, tab bar and small widgets are\n * defined once here and reused by the List view, Column view, Task sheet and\n * empty-page stories so the chrome stays identical and in one place.\n */\nexport * from \"./tokens\";\nexport { MainLogo } from \"./MainLogo\";\nexport { RoundAvatar } from \"./RoundAvatar\";\nexport { PresentationShell, StyledPagePaper } from \"./PresentationShell\";\nexport type { PresentationShellProps } from \"./PresentationShell\";\nexport { PageHeader, ProjectPageHeader, TabHeader } from \"./headers\";\nexport type {\n PageHeaderProps,\n ProjectPageHeaderProps,\n TabHeaderProps,\n} from \"./headers\";\nexport { FloatingControls } from \"./FloatingControls\";\nexport { HelpAndSupportMenu } from \"./HelpAndSupportMenu\";\nexport type { HelpAndSupportMenuProps } from \"./HelpAndSupportMenu\";\nexport { LinkingCommandsButton } from \"./LinkingCommandsButton\";\nexport { LinkBranchOrPullRequestDialog } from \"./LinkBranchOrPullRequestDialog\";\nexport type { LinkBranchOrPullRequestDialogProps } from \"./LinkBranchOrPullRequestDialog\";\nexport {\n ConnectRepositoryDialog,\n RepositorySelect,\n buildRepoOptions,\n CONNECTIONS,\n PROJECT_REPOSITORIES,\n CONNECTABLE_REPOSITORIES,\n} from \"./ConnectRepositoryDialog\";\nexport type {\n ConnectRepositoryDialogProps,\n RepositorySelectProps,\n Connection,\n ConnectionService,\n Repository,\n} from \"./ConnectRepositoryDialog\";\nexport {\n WebhookLogsDialog,\n WEBHOOK_CONNECTIONS,\n WEBHOOK_REPOSITORIES,\n} from \"./WebhookLogsDialog\";\nexport type {\n WebhookLogsDialogProps,\n WebhookConnection,\n WebhookRepository,\n WebhookLog,\n} from \"./WebhookLogsDialog\";\nexport {\n SourceCodeSection,\n IssueRow,\n CodeRow,\n Spine,\n HistoryDialog,\n CompletedHeader,\n} from \"./SourceCodeSection\";\nexport type {\n IssueEntry,\n CodeEntry,\n Stage,\n HistoryEvent,\n StageState,\n CodeStatus,\n SectionVariant,\n} from \"./SourceCodeSection\";\nexport { SuggestSubtasksButton } from \"./SuggestSubtasksButton\";\nexport { TaskOptionsMenu, TaskListOptionsMenu } from \"./TaskOptionsMenu\";\nexport type {\n TaskOptionsMenuProps,\n TaskListOptionsMenuProps,\n} from \"./TaskOptionsMenu\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;AACxB,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,qBAAqB;AAExE,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,SAAS,QAAQ,WAAW;AAMpE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,6BAA6B,QAAQ,iCAAiC;AAE/E,SACEC,uBAAuB,EACvBC,gBAAgB,EAChBC,gBAAgB,EAChBC,WAAW,EACXC,oBAAoB,EACpBC,wBAAwB,QACnB,2BAA2B;AAQlC,SACEC,iBAAiB,EACjBC,mBAAmB,EACnBC,oBAAoB,QACf,qBAAqB;AAO5B,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLC,aAAa,EACbC,eAAe,QACV,qBAAqB;AAU5B,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,eAAe,EAAEC,mBAAmB,QAAQ,mBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["MainLogo","RoundAvatar","PresentationShell","StyledPagePaper","PageHeader","ProjectPageHeader","TabHeader","FloatingControls","HelpAndSupportMenu","LinkingCommandsButton","LinkBranchOrPullRequestDialog","ConnectRepositoryDialog","RepositorySelect","buildRepoOptions","CONNECTIONS","PROJECT_REPOSITORIES","CONNECTABLE_REPOSITORIES","WebhookLogsDialog","WEBHOOK_CONNECTIONS","WEBHOOK_REPOSITORIES","SourceCodeSection","IssueRow","CodeRow","Spine","HistoryDialog","CompletedHeader","SuggestSubtasksButton","TaskOptionsMenu","TaskListOptionsMenu","UserMenu","TwoFactorShield","BackupCodesDialogs","CreateLoginCodeDialogs"],"sources":["../../../../src/presentation/shared/index.ts"],"sourcesContent":["/**\n * Shared building blocks for the Presentation mock-ups (`Presentation/*`\n * stories). The application shell, page headers, tab bar and small widgets are\n * defined once here and reused by the List view, Column view, Task sheet and\n * empty-page stories so the chrome stays identical and in one place.\n */\nexport * from \"./tokens\";\nexport { MainLogo } from \"./MainLogo\";\nexport { RoundAvatar } from \"./RoundAvatar\";\nexport { PresentationShell, StyledPagePaper } from \"./PresentationShell\";\nexport type { PresentationShellProps } from \"./PresentationShell\";\nexport { PageHeader, ProjectPageHeader, TabHeader } from \"./headers\";\nexport type {\n PageHeaderProps,\n ProjectPageHeaderProps,\n TabHeaderProps,\n} from \"./headers\";\nexport { FloatingControls } from \"./FloatingControls\";\nexport { HelpAndSupportMenu } from \"./HelpAndSupportMenu\";\nexport type { HelpAndSupportMenuProps } from \"./HelpAndSupportMenu\";\nexport { LinkingCommandsButton } from \"./LinkingCommandsButton\";\nexport { LinkBranchOrPullRequestDialog } from \"./LinkBranchOrPullRequestDialog\";\nexport type { LinkBranchOrPullRequestDialogProps } from \"./LinkBranchOrPullRequestDialog\";\nexport {\n ConnectRepositoryDialog,\n RepositorySelect,\n buildRepoOptions,\n CONNECTIONS,\n PROJECT_REPOSITORIES,\n CONNECTABLE_REPOSITORIES,\n} from \"./ConnectRepositoryDialog\";\nexport type {\n ConnectRepositoryDialogProps,\n RepositorySelectProps,\n Connection,\n ConnectionService,\n Repository,\n} from \"./ConnectRepositoryDialog\";\nexport {\n WebhookLogsDialog,\n WEBHOOK_CONNECTIONS,\n WEBHOOK_REPOSITORIES,\n} from \"./WebhookLogsDialog\";\nexport type {\n WebhookLogsDialogProps,\n WebhookConnection,\n WebhookRepository,\n WebhookLog,\n} from \"./WebhookLogsDialog\";\nexport {\n SourceCodeSection,\n IssueRow,\n CodeRow,\n Spine,\n HistoryDialog,\n CompletedHeader,\n} from \"./SourceCodeSection\";\nexport type {\n IssueEntry,\n CodeEntry,\n Stage,\n HistoryEvent,\n StageState,\n CodeStatus,\n SectionVariant,\n} from \"./SourceCodeSection\";\nexport { SuggestSubtasksButton } from \"./SuggestSubtasksButton\";\nexport { TaskOptionsMenu, TaskListOptionsMenu } from \"./TaskOptionsMenu\";\nexport type {\n TaskOptionsMenuProps,\n TaskListOptionsMenuProps,\n} from \"./TaskOptionsMenu\";\nexport { UserMenu } from \"./UserMenu\";\nexport type { UserMenuProps, UserMenuVariant } from \"./UserMenu\";\nexport { TwoFactorShield } from \"./TwoFactorShield\";\nexport type { TwoFactorShieldProps } from \"./TwoFactorShield\";\nexport { BackupCodesDialogs, CreateLoginCodeDialogs } from \"./TwoFactorDialogs\";\nexport type {\n BackupCodesDialogsProps,\n CreateLoginCodeDialogsProps,\n} from \"./TwoFactorDialogs\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;AACxB,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,qBAAqB;AAExE,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,SAAS,QAAQ,WAAW;AAMpE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,6BAA6B,QAAQ,iCAAiC;AAE/E,SACEC,uBAAuB,EACvBC,gBAAgB,EAChBC,gBAAgB,EAChBC,WAAW,EACXC,oBAAoB,EACpBC,wBAAwB,QACnB,2BAA2B;AAQlC,SACEC,iBAAiB,EACjBC,mBAAmB,EACnBC,oBAAoB,QACf,qBAAqB;AAO5B,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLC,aAAa,EACbC,eAAe,QACV,qBAAqB;AAU5B,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,eAAe,EAAEC,mBAAmB,QAAQ,mBAAmB;AAKxE,SAASC,QAAQ,QAAQ,YAAY;AAErC,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,kBAAkB,EAAEC,sBAAsB,QAAQ,oBAAoB","ignoreList":[]}
|