diff --git a/eslint.config.mjs b/eslint.config.mjs index ed92fb90f..e8ae9e4b6 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -6,6 +6,7 @@ import pluginPromise from "eslint-plugin-promise" import react from "eslint-plugin-react" import reactHooks from "eslint-plugin-react-hooks" import storybook from "eslint-plugin-storybook" +import tailwind from "eslint-plugin-tailwindcss" import tsdoc from "eslint-plugin-tsdoc" import globals from "globals" import tseslint from "typescript-eslint" @@ -177,6 +178,17 @@ const config = tseslint.config([ "@typescript-eslint/no-unsafe-call": "off", }, }, + { + name: "tailwind", + files: ["packages/elements-react/**/*.{js,jsx,ts,tsx}"], + ...tailwind.configs["flat/recommended"][0], + ...tailwind.configs["flat/recommended"][1], + settings: { + tailwindcss: { + config: "packages/elements-react/tailwind.config.ts", + }, + }, + }, ]) export default config diff --git a/package-lock.json b/package-lock.json index d23dfec06..4b781716b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,6 +77,7 @@ "eslint-plugin-react": "7.37.2", "eslint-plugin-react-hooks": "5.0.0", "eslint-plugin-storybook": "0.11.1", + "eslint-plugin-tailwindcss": "3.17.5", "eslint-plugin-tsdoc": "0.4.0", "globals": "15.13.0", "jest": "29.7.0", @@ -18814,6 +18815,23 @@ "eslint": ">=6" } }, + "node_modules/eslint-plugin-tailwindcss": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-tailwindcss/-/eslint-plugin-tailwindcss-3.17.5.tgz", + "integrity": "sha512-8Mi7p7dm+mO1dHgRHHFdPu4RDTBk69Cn4P0B40vRQR+MrguUpwmKwhZy1kqYe3Km8/4nb+cyrCF+5SodOEmaow==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "^3.2.5", + "postcss": "^8.4.4" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "tailwindcss": "^3.4.0" + } + }, "node_modules/eslint-plugin-tsdoc": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.4.0.tgz", @@ -18915,13 +18933,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true, - "license": "MIT" - }, "node_modules/eslint/node_modules/acorn": { "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", diff --git a/package.json b/package.json index a919cf0df..3fa7ffcdc 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ "eslint-plugin-react": "7.37.2", "eslint-plugin-react-hooks": "5.0.0", "eslint-plugin-storybook": "0.11.1", + "eslint-plugin-tailwindcss": "3.17.5", "eslint-plugin-tsdoc": "0.4.0", "globals": "15.13.0", "jest": "29.7.0", diff --git a/packages/elements-react/src/theme/default/components/card/auth-methods.tsx b/packages/elements-react/src/theme/default/components/card/auth-methods.tsx index 82c5fc36a..d15361485 100644 --- a/packages/elements-react/src/theme/default/components/card/auth-methods.tsx +++ b/packages/elements-react/src/theme/default/components/card/auth-methods.tsx @@ -25,23 +25,23 @@ export function DefaultAuthMethodListItem({ const Icon = iconsMap[group] || null return ( -
+
diff --git a/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx b/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx index e5cb8650b..44cf75155 100644 --- a/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx +++ b/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx @@ -24,12 +24,12 @@ export const DefaultPinCodeInput = ({ attributes }: OryNodeInputProps) => { name={name} value={value} > - + {[...Array(elements)].map((_, index) => ( ))} diff --git a/packages/elements-react/src/theme/default/components/form/section.tsx b/packages/elements-react/src/theme/default/components/form/section.tsx index f59324ce1..06993f4e9 100644 --- a/packages/elements-react/src/theme/default/components/form/section.tsx +++ b/packages/elements-react/src/theme/default/components/form/section.tsx @@ -9,7 +9,7 @@ import { const DefaultFormSection = ({ children }: OryFormSectionProps) => { return ( -
+
{children}
) @@ -21,7 +21,7 @@ const DefaultFormSectionContent = ({ children, }: OryFormSectionContentProps) => { return ( -
+

{title}

{description} @@ -33,7 +33,7 @@ const DefaultFormSectionContent = ({ const DefaultFormSectionFooter = ({ children }: OryFormSectionFooterProps) => { return ( -
+
{children}
) diff --git a/packages/elements-react/src/theme/default/components/form/shadcn/otp-input.tsx b/packages/elements-react/src/theme/default/components/form/shadcn/otp-input.tsx index c916bcfa2..1f40d339d 100644 --- a/packages/elements-react/src/theme/default/components/form/shadcn/otp-input.tsx +++ b/packages/elements-react/src/theme/default/components/form/shadcn/otp-input.tsx @@ -52,7 +52,7 @@ const InputOTPSlot = React.forwardRef< {char} {hasFakeCaret && (
-
+
)}
diff --git a/packages/elements-react/src/theme/default/components/form/social.tsx b/packages/elements-react/src/theme/default/components/form/social.tsx index 1bcac25b1..8586f3af4 100644 --- a/packages/elements-react/src/theme/default/components/form/social.tsx +++ b/packages/elements-react/src/theme/default/components/form/social.tsx @@ -72,7 +72,7 @@ export function DefaultButtonSocial({ {...props} onClick={onClick} > - + {Logo ? ( ) : ( - + {provider.slice(0, 2)} )} {showLabel && node.meta.label ? ( - + {uiTextToFormattedMessage(node.meta.label, intl)} ) : null} diff --git a/packages/elements-react/src/theme/default/components/generic/page-header.tsx b/packages/elements-react/src/theme/default/components/generic/page-header.tsx index 1533cced1..1bcd86d30 100644 --- a/packages/elements-react/src/theme/default/components/generic/page-header.tsx +++ b/packages/elements-react/src/theme/default/components/generic/page-header.tsx @@ -10,10 +10,10 @@ export const DefaultPageHeader = (_props: OryPageHeaderProps) => { const { session } = useSession() return ( -
+
-
-
+
+
diff --git a/packages/elements-react/src/theme/default/components/settings/settings-oidc.tsx b/packages/elements-react/src/theme/default/components/settings/settings-oidc.tsx index 2be9dc778..fb5703d8b 100644 --- a/packages/elements-react/src/theme/default/components/settings/settings-oidc.tsx +++ b/packages/elements-react/src/theme/default/components/settings/settings-oidc.tsx @@ -20,7 +20,7 @@ export function DefaultSettingsOidc({ return (
{hasLinkButtons && ( -
+
{linkButtons.map((button) => { const attrs = button.attributes as UiNodeInputAttributes @@ -47,9 +47,9 @@ export function DefaultSettingsOidc({ return (
-
+
-

+

{provider}

diff --git a/packages/elements-react/src/theme/default/components/settings/settings-passkey.tsx b/packages/elements-react/src/theme/default/components/settings/settings-passkey.tsx index 81bad6155..2cf1a6bfc 100644 --- a/packages/elements-react/src/theme/default/components/settings/settings-passkey.tsx +++ b/packages/elements-react/src/theme/default/components/settings/settings-passkey.tsx @@ -16,7 +16,7 @@ export function DefaultSettingsPasskey({ return (
-
+
{triggerButton ? ( {keyId}
{addedAt && ( -

+

{new Date(addedAt).toLocaleDateString()}

)} diff --git a/packages/elements-react/src/theme/default/components/settings/settings-recovery-codes.tsx b/packages/elements-react/src/theme/default/components/settings/settings-recovery-codes.tsx index 391407650..c9ade2f23 100644 --- a/packages/elements-react/src/theme/default/components/settings/settings-recovery-codes.tsx +++ b/packages/elements-react/src/theme/default/components/settings/settings-recovery-codes.tsx @@ -67,8 +67,8 @@ export function DefaultSettingsRecoveryCodes({ ) : null}
{hasCodes ? ( -
-
+
+
{codes.map((code) => (

{code}

))} diff --git a/packages/elements-react/src/theme/default/components/settings/settings-top.tsx b/packages/elements-react/src/theme/default/components/settings/settings-top.tsx index 6d19e9e40..0894030bc 100644 --- a/packages/elements-react/src/theme/default/components/settings/settings-top.tsx +++ b/packages/elements-react/src/theme/default/components/settings/settings-top.tsx @@ -25,16 +25,16 @@ export function DefaultSettingsTotp(props: OrySettingsTotpProps) { } = props.totpUnlink?.attributes as UiNodeInputAttributes return ( -
+
-
-
+
+
-
-

+

+

Authenticator app

@@ -54,13 +54,13 @@ export function DefaultSettingsTotp(props: OrySettingsTotpProps) { if ("totpSecret" in props) { return ( -
+
-
-
-
+
+
+
-
+
{keyId}
{addedAt && ( -

+

{new Date(addedAt).toLocaleDateString()}

)} diff --git a/packages/elements-react/src/theme/default/components/ui/user-avater.tsx b/packages/elements-react/src/theme/default/components/ui/user-avater.tsx index 0387fa3bc..de7f602e7 100644 --- a/packages/elements-react/src/theme/default/components/ui/user-avater.tsx +++ b/packages/elements-react/src/theme/default/components/ui/user-avater.tsx @@ -14,10 +14,10 @@ export const UserAvatar = forwardRef( return (