@donotdev/oauth 0.0.4 → 0.0.5
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import{Alert as A,Stack as O,Grid as P}from"@donotdev/components";import{useTranslation as b,getEnabledOAuthPartners as w}from"@donotdev/core";import{withOAuthFallback as x}from"./OAuthFallback";import{OAuthPartnerButton as $}from"./OAuthPartnerButton";const N=({providers:n=w(),purpose:a="api-access",containerClassName:i="",providerClassName:u="",variant:S="outline",layout:t="vertical",showLabels:l=!0,ariaLabel:d,id:m,fullWidth:h=!0,onSuccess:p,onError:v})=>{const{t:o}=b("oauth"),s=m||`oauth-providers-${Math.random().toString(36).slice(2,9)}`;if(n.length===0)return r(A,{title:o("noProviders","No OAuth Providers"),description:o("noProvidersMessage","No OAuth providers are currently enabled. Check your environment configuration.")});const f=()=>{const c=n.map((e,g)=>r($,{partnerId:e,purpose:a,className:`${u} ${h?"dndev-w-full":""}`,tabIndex:g===0?0:void 0,id:`${s}-${e}-button`,onSuccess:p,onOAuthError:v,children:l?`${e.charAt(0).toUpperCase()+e.slice(1)}`:null},e));return t==="grid"?r(P,{cols:{base:1,sm:2,md:3},gap:"medium",className:i,children:c}):r(O,{direction:t==="horizontal"?"row":"column",wrap:t==="horizontal"?"wrap":void 0,align:t==="horizontal"?"center":"stretch",gap:"medium",className:i,children:c})};return r("div",{className:"dndev-mx-auto",id:s,role:"region","aria-label":d||o("aria.connectionOptions","Service connection options"),children:f()})},M=x(N,{message:"OAuth connections are not configured",showConnectButton:!0});var E=M;export{M as MultipleOAuthProviders,E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as c}from"react/jsx-runtime";import{Dialog as d,BUTTON_VARIANT as l}from"@donotdev/components";import{useTranslation as p,getEnabledOAuthPartners as h}from"@donotdev/core";import{MultipleOAuthProviders as u}from"./MultipleOAuthProviders";function y({open:n,onOpenChange:t,purpose:i="api-access",title:a,description:s}){const{t:o}=p("
|
|
1
|
+
import{jsx as e,jsxs as c}from"react/jsx-runtime";import{Dialog as d,BUTTON_VARIANT as l}from"@donotdev/components";import{useTranslation as p,getEnabledOAuthPartners as h}from"@donotdev/core";import{MultipleOAuthProviders as u}from"./MultipleOAuthProviders";function y({open:n,onOpenChange:t,purpose:i="api-access",title:a,description:s}){const{t:o}=p("oauth"),r=h();return e(d,{open:n,onOpenChange:t,title:a||o("connectServices","Connect Services"),description:s||o("oauth.chooseService","Choose which services to connect for enhanced functionality"),children:e("div",{style:{padding:"var(--gap-md)"},children:r.length>0?e(u,{providers:r,purpose:i,layout:"vertical",variant:l.OUTLINE,showLabels:!0}):c("div",{style:{paddingTop:"var(--gap-lg)",paddingBottom:"var(--gap-lg)",color:"var(--muted-foreground)"},children:[e("p",{children:o("oauth.noProvidersEnabled","No OAuth providers are currently enabled")}),e("p",{style:{marginTop:"var(--gap-sm)",fontSize:"var(--font-size-sm)"},children:o("oauth.checkConfiguration","Check your environment configuration")})]})})})}export{y as OAuthConnectionModal};
|