@alfadocs/ui-kit 0.0.18 → 0.0.19

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.
@@ -0,0 +1,38 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as d } from "react";
3
+ import { useTranslation as f } from "react-i18next";
4
+ import { B as p } from "./button-CXL8bA8G.js";
5
+ import { L as S } from "./logo-UNWYb9p7.js";
6
+ import { S as h } from "./spinner-77xUGpuX.js";
7
+ const v = /* @__PURE__ */ new Set(["primary", "secondary", "tonal"]), y = d(
8
+ ({
9
+ intent: r = "primary",
10
+ size: a,
11
+ loading: o = !1,
12
+ disabled: e,
13
+ label: s,
14
+ type: i = "button",
15
+ ...n
16
+ }, m) => {
17
+ const { t: c } = f(), l = s ?? c("ui.auth.continueWithAlfadocs", "Continue with AlfaDocs"), u = v.has(r) ? "inherit" : "auto";
18
+ return /* @__PURE__ */ t(
19
+ p,
20
+ {
21
+ ref: m,
22
+ type: i,
23
+ intent: r,
24
+ size: a,
25
+ disabled: e || o,
26
+ "aria-busy": o || void 0,
27
+ startIcon: o ? /* @__PURE__ */ t(h, { size: a ?? "md", variant: "pulse" }) : /* @__PURE__ */ t(S, { variant: "mark", size: "sm", tone: u, decorative: !0 }),
28
+ ...n,
29
+ children: l
30
+ }
31
+ );
32
+ }
33
+ );
34
+ y.displayName = "SignInWithAlfadocsButton";
35
+ export {
36
+ y as S
37
+ };
38
+ //# sourceMappingURL=sign-in-with-alfadocs-button-y3gy-W-D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-with-alfadocs-button-y3gy-W-D.js","sources":["../../src/components/sign-in-with-alfadocs-button/sign-in-with-alfadocs-button.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Button, type ButtonProps } from '../button';\nimport { Logo } from '../logo';\nimport { Spinner } from '../spinner';\n\n// A provider-style button (\"Sign in with AlfaDocs\"). Wraps the Button\n// primitive so it inherits the full intent / size / asChild / endIcon /\n// forced-colors / focus-ring contract for free.\n//\n// The only differences from a plain Button are:\n// 1. A sensible default label resolved from the\n// `ui.auth.continueWithAlfadocs` translation key.\n// 2. The AlfaDocs brand mark rendered as the leading icon.\n// 3. Loading swaps the mark for the kit's `Spinner` (pulse variant)\n// rather than Button's hand-rolled SVG — visually consistent with\n// every other loading affordance in the kit.\n//\n// `destructive` is intentionally omitted — there is no \"delete the\n// user's account\" sign-in flow that this button represents.\n\ntype AllowedIntent = Exclude<NonNullable<ButtonProps['intent']>, 'destructive'>;\n\n// Intents that paint the button surface and use a foreground-tinted\n// text colour. The mark needs to inherit `currentColor` here so it\n// reads against the coloured surface; on transparent intents the\n// mark's own brand violet contrasts naturally with the foreground\n// text.\nconst FILLED_INTENTS = new Set<AllowedIntent>(['primary', 'secondary', 'tonal']);\n\nexport interface SignInWithAlfadocsButtonProps\n extends Omit<ButtonProps, 'startIcon' | 'children' | 'intent'> {\n /**\n * Visual intent. Inherits the Button intent set with `destructive`\n * omitted (no \"destroy account\" sign-in flow exists).\n */\n intent?: AllowedIntent;\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 intent = 'primary',\n size,\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 logoTone = FILLED_INTENTS.has(intent) ? 'inherit' : 'auto';\n const resolvedSize = size ?? 'md';\n\n // We don't forward `loading` to Button — Button would render its\n // own inline SVG and hide the label. Instead we keep the label\n // visible, swap the leading icon for the kit's Spinner, and\n // reproduce the disabled / aria-busy contract manually.\n return (\n <Button\n ref={ref}\n type={type}\n intent={intent}\n size={size}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n startIcon={\n loading ? (\n <Spinner size={resolvedSize} variant=\"pulse\" />\n ) : (\n <Logo variant=\"mark\" size=\"sm\" tone={logoTone} decorative />\n )\n }\n {...props}\n >\n {resolvedLabel}\n </Button>\n );\n },\n);\n\nSignInWithAlfadocsButton.displayName = 'SignInWithAlfadocsButton';\n"],"names":["FILLED_INTENTS","SignInWithAlfadocsButton","forwardRef","intent","size","loading","disabled","label","type","props","ref","t","useTranslation","resolvedLabel","logoTone","jsx","Button","Spinner","Logo"],"mappings":";;;;;;AA4BA,MAAMA,IAAiB,oBAAI,IAAmB,CAAC,WAAW,aAAa,OAAO,CAAC,GAkBlEC,IAA2BC;AAAA,EAItC,CACE;AAAA,IACE,QAAAC,IAAS;AAAA,IACT,MAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IACJN,KAASI,EAAE,gCAAgC,wBAAwB,GAC/DG,IAAWd,EAAe,IAAIG,CAAM,IAAI,YAAY;AAO1D,WACE,gBAAAY;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAAN;AAAA,QACA,MAAAF;AAAA,QACA,QAAAL;AAAA,QACA,MAAAC;AAAA,QACA,UAAUE,KAAYD;AAAA,QACtB,aAAWA,KAAW;AAAA,QACtB,WACEA,IACE,gBAAAU,EAACE,KAAQ,MAhBIb,KAAQ,MAgBQ,SAAQ,QAAA,CAAQ,IAE7C,gBAAAW,EAACG,GAAA,EAAK,SAAQ,QAAO,MAAK,MAAK,MAAMJ,GAAU,YAAU,IAAC;AAAA,QAG7D,GAAGL;AAAA,QAEH,UAAAI;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEAZ,EAAyB,cAAc;"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.0.18",
3
+ "packageVersion": "0.0.19",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -1,4 +1,4 @@
1
- import { S as n } from "../../_chunks/sign-in-with-alfadocs-button-BsV5vkHN.js";
1
+ import { S as n } from "../../_chunks/sign-in-with-alfadocs-button-y3gy-W-D.js";
2
2
  export {
3
3
  n as SignInWithAlfadocsButton
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sign-in-with-alfadocs-button.d.ts","sourceRoot":"","sources":["../../../src/components/sign-in-with-alfadocs-button/sign-in-with-alfadocs-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAarD,KAAK,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;AAShF,MAAM,WAAW,6BACf,SAAQ,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC9D;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,eAAO,MAAM,wBAAwB,6HAoBnC,CAAC"}
1
+ {"version":3,"file":"sign-in-with-alfadocs-button.d.ts","sourceRoot":"","sources":["../../../src/components/sign-in-with-alfadocs-button/sign-in-with-alfadocs-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAmBrD,KAAK,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;AAShF,MAAM,WAAW,6BACf,SAAQ,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC9D;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,eAAO,MAAM,wBAAwB,6HA+CpC,CAAC"}
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { b as S } from "./_chunks/button.agent-BuGZBktn.js";
6
6
  import { B as g } from "./_chunks/button-group-CI7LFxt3.js";
7
7
  import { F as C } from "./_chunks/floating-action-button-BM9ib-Wf.js";
8
8
  import { I as A } from "./_chunks/icon-button-group-tERESY-n.js";
9
- import { S as I } from "./_chunks/sign-in-with-alfadocs-button-BsV5vkHN.js";
9
+ import { S as I } from "./_chunks/sign-in-with-alfadocs-button-y3gy-W-D.js";
10
10
  import { SafeHtml as R, sanitiseHtml as E } from "./safe-html/index.js";
11
11
  import { A as N, a as F, b as k } from "./_chunks/autocomplete.agent-kb0nmr6F.js";
12
12
  import { C as M, a as D, u as V } from "./_chunks/checkbox-CfiZ0FZc.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
6
6
  "license": "BUSL-1.1",
@@ -1,24 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as c } from "react";
3
- import { useTranslation as u } from "react-i18next";
4
- import { B as f } from "./button-CXL8bA8G.js";
5
- import { L as l } from "./logo-UNWYb9p7.js";
6
- const d = /* @__PURE__ */ new Set(["primary", "secondary", "tonal"]), p = c(({ intent: o = "primary", label: r, type: n = "button", ...a }, i) => {
7
- const { t: s } = u(), e = r ?? s("ui.auth.continueWithAlfadocs", "Continue with AlfaDocs"), m = d.has(o) ? "inherit" : "auto";
8
- return /* @__PURE__ */ t(
9
- f,
10
- {
11
- ref: i,
12
- type: n,
13
- intent: o,
14
- startIcon: /* @__PURE__ */ t(l, { variant: "mark", size: "sm", tone: m, decorative: !0 }),
15
- ...a,
16
- children: e
17
- }
18
- );
19
- });
20
- p.displayName = "SignInWithAlfadocsButton";
21
- export {
22
- p as S
23
- };
24
- //# sourceMappingURL=sign-in-with-alfadocs-button-BsV5vkHN.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sign-in-with-alfadocs-button-BsV5vkHN.js","sources":["../../src/components/sign-in-with-alfadocs-button/sign-in-with-alfadocs-button.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Button, type ButtonProps } from '../button';\nimport { Logo } from '../logo';\n\n// A provider-style button (\"Sign in with AlfaDocs\"). Wraps the Button\n// primitive so it inherits the full intent / size / loading / asChild /\n// startIcon / endIcon / forced-colors / focus-ring contract for free.\n// The only additions are: a sensible default label resolved from the\n// `ui.auth.continueWithAlfadocs` translation key, and the AlfaDocs\n// brand mark rendered as a leading icon.\n//\n// `destructive` is intentionally omitted — there is no \"delete the\n// user's account\" sign-in flow that this button represents.\n\ntype AllowedIntent = Exclude<NonNullable<ButtonProps['intent']>, 'destructive'>;\n\n// Intents that paint the button surface and use a foreground-tinted\n// text colour. The mark needs to inherit `currentColor` here so it\n// reads against the coloured surface; on transparent intents the\n// mark's own brand violet contrasts naturally with the foreground\n// text.\nconst FILLED_INTENTS = new Set<AllowedIntent>(['primary', 'secondary', 'tonal']);\n\nexport interface SignInWithAlfadocsButtonProps\n extends Omit<ButtonProps, 'startIcon' | 'children' | 'intent'> {\n /**\n * Visual intent. Inherits the Button intent set with `destructive`\n * omitted (no \"destroy account\" sign-in flow exists).\n */\n intent?: AllowedIntent;\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>(({ intent = 'primary', label, type = 'button', ...props }, ref) => {\n const { t } = useTranslation();\n const resolvedLabel =\n label ?? t('ui.auth.continueWithAlfadocs', 'Continue with AlfaDocs');\n const logoTone = FILLED_INTENTS.has(intent) ? 'inherit' : 'auto';\n\n return (\n <Button\n ref={ref}\n type={type}\n intent={intent}\n startIcon={<Logo variant=\"mark\" size=\"sm\" tone={logoTone} decorative />}\n {...props}\n >\n {resolvedLabel}\n </Button>\n );\n});\n\nSignInWithAlfadocsButton.displayName = 'SignInWithAlfadocsButton';\n"],"names":["FILLED_INTENTS","SignInWithAlfadocsButton","forwardRef","intent","label","type","props","ref","t","useTranslation","resolvedLabel","logoTone","jsx","Button","Logo"],"mappings":";;;;;AAsBA,MAAMA,IAAiB,oBAAI,IAAmB,CAAC,WAAW,aAAa,OAAO,CAAC,GAkBlEC,IAA2BC,EAGtC,CAAC,EAAE,QAAAC,IAAS,WAAW,OAAAC,GAAO,MAAAC,IAAO,UAAU,GAAGC,EAAA,GAASC,MAAQ;AACnE,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IACJN,KAASI,EAAE,gCAAgC,wBAAwB,GAC/DG,IAAWX,EAAe,IAAIG,CAAM,IAAI,YAAY;AAE1D,SACE,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,MAAAF;AAAA,MACA,QAAAF;AAAA,MACA,WAAW,gBAAAS,EAACE,GAAA,EAAK,SAAQ,QAAO,MAAK,MAAK,MAAMH,GAAU,YAAU,GAAA,CAAC;AAAA,MACpE,GAAGL;AAAA,MAEH,UAAAI;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;AAEDT,EAAyB,cAAc;"}