@alfadocs/ui-kit 0.0.15 → 0.0.17
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/_chunks/{matrix-rain-C2kqBVxr.js → matrix-rain-Q7xTEpKu.js} +11 -11
- package/dist/_chunks/{matrix-rain-C2kqBVxr.js.map → matrix-rain-Q7xTEpKu.js.map} +1 -1
- package/dist/_chunks/sign-in-with-alfadocs-button-CprizH2U.js +23 -0
- package/dist/_chunks/sign-in-with-alfadocs-button-CprizH2U.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/matrix-rain/index.js +1 -1
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/sign-in-with-alfadocs-button/sign-in-with-alfadocs-button.d.ts +3 -13
- package/dist/components/sign-in-with-alfadocs-button/sign-in-with-alfadocs-button.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/sign-in-with-alfadocs-button-Gu7Qk2gq.js +0 -88
- package/dist/_chunks/sign-in-with-alfadocs-button-Gu7Qk2gq.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsxs as b, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as m } from "react";
|
|
3
|
-
import { c as v } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as h } from "react-i18next";
|
|
5
|
-
import { L as g } from "./logo-BlIdYz3n.js";
|
|
6
|
-
import { S as p } from "./spinner-77xUGpuX.js";
|
|
7
|
-
const w = v(
|
|
8
|
-
[
|
|
9
|
-
"inline-flex items-center justify-center gap-[var(--spacing-sm)]",
|
|
10
|
-
"font-medium transition-colors relative",
|
|
11
|
-
"rounded-[var(--radius-md)]",
|
|
12
|
-
"border border-[length:var(--border-width-sm)]",
|
|
13
|
-
"focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
14
|
-
"focus-visible:outline-solid focus-visible:outline-ring",
|
|
15
|
-
"focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
16
|
-
// Windows High Contrast — collapse to system button chrome so the
|
|
17
|
-
// control remains visible when our tokens get stripped.
|
|
18
|
-
"forced-colors:border forced-colors:border-[ButtonBorder]",
|
|
19
|
-
"forced-colors:focus-visible:outline-[CanvasText]",
|
|
20
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
21
|
-
"aria-disabled:opacity-50 aria-disabled:cursor-not-allowed",
|
|
22
|
-
"aria-busy:cursor-wait"
|
|
23
|
-
].join(" "),
|
|
24
|
-
{
|
|
25
|
-
variants: {
|
|
26
|
-
surface: {
|
|
27
|
-
light: "bg-background text-foreground border-border hover:bg-muted/10 active:opacity-90 shadow-[var(--shadow-sm)]",
|
|
28
|
-
dark: "bg-foreground text-background border-foreground hover:opacity-90 active:opacity-80 shadow-[var(--shadow-sm)]",
|
|
29
|
-
// `auto` follows the ambient theme root (`.theme-light` /
|
|
30
|
-
// `.theme-dark`) so the button tracks whichever theme the host
|
|
31
|
-
// sets on its root.
|
|
32
|
-
auto: "bg-card text-card-foreground border-border hover:bg-muted/10 active:opacity-90 shadow-[var(--shadow-sm)]"
|
|
33
|
-
},
|
|
34
|
-
size: {
|
|
35
|
-
// Sizing mirrors Button so a row of provider buttons aligns with
|
|
36
|
-
// the primary CTA. See `src/components/button/button.tsx`.
|
|
37
|
-
sm: [
|
|
38
|
-
"h-8 ps-3 pe-3 text-[var(--font-size-sm)]",
|
|
39
|
-
"min-h-[var(--min-target-size)] sm:min-h-0",
|
|
40
|
-
'before:absolute before:content-[""]',
|
|
41
|
-
"before:inset-x-[calc((var(--min-target-size)-100%)/-2)]",
|
|
42
|
-
"before:inset-y-[calc((var(--min-target-size)-100%)/-2)]",
|
|
43
|
-
"sm:before:hidden"
|
|
44
|
-
].join(" "),
|
|
45
|
-
md: "h-10 ps-4 pe-4 text-[var(--font-size-base)]",
|
|
46
|
-
lg: "h-12 ps-6 pe-6 text-[var(--font-size-lg)]"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
defaultVariants: {
|
|
50
|
-
surface: "auto",
|
|
51
|
-
size: "md"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
), x = m(
|
|
55
|
-
({
|
|
56
|
-
surface: r,
|
|
57
|
-
size: t,
|
|
58
|
-
className: a,
|
|
59
|
-
loading: o = !1,
|
|
60
|
-
disabled: s,
|
|
61
|
-
label: i,
|
|
62
|
-
type: n = "button",
|
|
63
|
-
...d
|
|
64
|
-
}, c) => {
|
|
65
|
-
const { t: l } = h(), u = i ?? l("ui.auth.continueWithAlfadocs", "Continue with AlfaDocs"), f = t ?? "md";
|
|
66
|
-
return /* @__PURE__ */ b(
|
|
67
|
-
"button",
|
|
68
|
-
{
|
|
69
|
-
ref: c,
|
|
70
|
-
type: n,
|
|
71
|
-
className: w({ surface: r, size: t, className: a }),
|
|
72
|
-
disabled: s || o,
|
|
73
|
-
"aria-busy": o || void 0,
|
|
74
|
-
"data-surface": r ?? "auto",
|
|
75
|
-
...d,
|
|
76
|
-
children: [
|
|
77
|
-
o ? /* @__PURE__ */ e(p, { size: f }) : /* @__PURE__ */ e(g, { variant: "mark", size: "sm", decorative: !0 }),
|
|
78
|
-
/* @__PURE__ */ e("span", { children: u })
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
x.displayName = "SignInWithAlfadocsButton";
|
|
85
|
-
export {
|
|
86
|
-
x as S
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=sign-in-with-alfadocs-button-Gu7Qk2gq.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in-with-alfadocs-button-Gu7Qk2gq.js","sources":["../../src/components/sign-in-with-alfadocs-button/sign-in-with-alfadocs-button.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Logo } from '../logo';\nimport { Spinner } from '../spinner';\n\n// A provider-style button (\"Sign in with AlfaDocs\"). Sits on top of our\n// Button primitive visually — same sizing tokens, same focus ring, same\n// loading affordance — but with surface variants tuned for third-party\n// host pages that may render on light, dark, or system-driven backgrounds.\nconst signInVariants = cva(\n [\n 'inline-flex items-center justify-center gap-[var(--spacing-sm)]',\n 'font-medium transition-colors relative',\n 'rounded-[var(--radius-md)]',\n 'border border-[length:var(--border-width-sm)]',\n 'focus-visible:outline-[length:var(--focus-ring-width)]',\n 'focus-visible:outline-solid focus-visible:outline-ring',\n 'focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n // Windows High Contrast — collapse to system button chrome so the\n // control remains visible when our tokens get stripped.\n 'forced-colors:border forced-colors:border-[ButtonBorder]',\n 'forced-colors:focus-visible:outline-[CanvasText]',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n 'aria-disabled:opacity-50 aria-disabled:cursor-not-allowed',\n 'aria-busy:cursor-wait',\n ].join(' '),\n {\n variants: {\n surface: {\n light:\n 'bg-background text-foreground border-border hover:bg-muted/10 active:opacity-90 shadow-[var(--shadow-sm)]',\n dark: 'bg-foreground text-background border-foreground hover:opacity-90 active:opacity-80 shadow-[var(--shadow-sm)]',\n // `auto` follows the ambient theme root (`.theme-light` /\n // `.theme-dark`) so the button tracks whichever theme the host\n // sets on its root.\n auto: 'bg-card text-card-foreground border-border hover:bg-muted/10 active:opacity-90 shadow-[var(--shadow-sm)]',\n },\n size: {\n // Sizing mirrors Button so a row of provider buttons aligns with\n // the primary CTA. See `src/components/button/button.tsx`.\n sm: [\n 'h-8 ps-3 pe-3 text-[var(--font-size-sm)]',\n 'min-h-[var(--min-target-size)] sm:min-h-0',\n 'before:absolute before:content-[\"\"]',\n 'before:inset-x-[calc((var(--min-target-size)-100%)/-2)]',\n 'before:inset-y-[calc((var(--min-target-size)-100%)/-2)]',\n 'sm:before:hidden',\n ].join(' '),\n md: 'h-10 ps-4 pe-4 text-[var(--font-size-base)]',\n lg: 'h-12 ps-6 pe-6 text-[var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n surface: 'auto',\n size: 'md',\n },\n },\n);\n\nexport interface SignInWithAlfadocsButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof signInVariants> {\n /**\n * Show the loading spinner and disable the button. Mirrors Button's\n * loading contract so the two can be swapped without surprise.\n */\n loading?: boolean;\n /**\n * Override the visible label. When omitted, the component reads\n * `ui.auth.continueWithAlfadocs` (English fallback: \"Continue with\n * AlfaDocs\"). Pass a node to render e.g. \"Sign in with AlfaDocs\" or a\n * fully-translated string.\n */\n label?: ReactNode;\n}\n\nexport const SignInWithAlfadocsButton = forwardRef<\n HTMLButtonElement,\n SignInWithAlfadocsButtonProps\n>(\n (\n {\n surface,\n size,\n className,\n loading = false,\n disabled,\n label,\n type = 'button',\n ...props\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const resolvedLabel =\n label ?? t('ui.auth.continueWithAlfadocs', 'Continue with AlfaDocs');\n const resolvedSize = size ?? 'md';\n\n return (\n <button\n ref={ref}\n type={type}\n className={signInVariants({ surface, size, className })}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n data-surface={surface ?? 'auto'}\n {...props}\n >\n {loading ? (\n <Spinner size={resolvedSize} />\n ) : (\n <Logo variant=\"mark\" size=\"sm\" decorative />\n )}\n <span>{resolvedLabel}</span>\n </button>\n );\n },\n);\n\nSignInWithAlfadocsButton.displayName = 'SignInWithAlfadocsButton';\n"],"names":["signInVariants","cva","SignInWithAlfadocsButton","forwardRef","surface","size","className","loading","disabled","label","type","props","ref","t","useTranslation","resolvedLabel","resolvedSize","jsxs","jsx","Spinner","Logo"],"mappings":";;;;;;AAUA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,I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