@withone/connect 0.14.0 → 0.16.0

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/src/types.ts CHANGED
@@ -31,8 +31,6 @@ export interface OneConnectFlowOptions {
31
31
  /** Theme for One's hosted page. Carried on the URL fragment, which
32
32
  * survives the redirect chain, so the backend forwards nothing. */
33
33
  connectTheme?: OneConnectTheme;
34
- /** @deprecated Renamed to `connectTheme`; removed in the next minor. */
35
- appTheme?: OneConnectTheme;
36
34
  /** The grant completed and the backend stored the tokens. Fires once
37
35
  * per page load, on the first flow still mounted when the tab
38
36
  * returns. Treat it as a hint to refetch: your server is the truth. */
@@ -62,20 +60,26 @@ export interface OneConnectReturn {
62
60
  }
63
61
 
64
62
  /**
65
- * A connector chip on the button. Pass One's connector slug ("stripe",
63
+ * A logo chip on the button. Pass One's connector slug ("stripe",
66
64
  * "google-calendar") and the SDK shows its logo and name; pass an
67
- * object to override either.
65
+ * object to override either. Decoration only: what One asks the user
66
+ * for comes from the app's permission set, not from this list.
68
67
  */
69
- export type ConnectButtonPlatformInput =
68
+ export type ConnectButtonLogoInput =
70
69
  string | { slug?: string; name?: string; imageUrl?: string };
71
70
 
72
71
  /** A normalized chip: what the button actually draws. */
73
- export interface ConnectButtonPlatform {
72
+ export interface ConnectButtonLogo {
74
73
  slug: string;
75
74
  name: string;
76
75
  imageUrl: string;
77
76
  }
78
77
 
78
+ /** @deprecated Renamed to `ConnectButtonLogoInput`; removed in 0.17.0. */
79
+ export type ConnectButtonPlatformInput = ConnectButtonLogoInput;
80
+ /** @deprecated Renamed to `ConnectButtonLogo`; removed in 0.17.0. */
81
+ export type ConnectButtonPlatform = ConnectButtonLogo;
82
+
79
83
  export type ConnectButtonVariant = "default" | "accent" | "block";
80
84
  export type ConnectButtonSize = "sm" | "md" | "lg";
81
85
  export type ConnectButtonState = "idle" | "connecting" | "connected";
@@ -85,17 +89,22 @@ export type ConnectButtonState = "idle" | "connecting" | "connected";
85
89
  export interface ConnectButtonProps {
86
90
  /** The app's own backend authorize route; relative is fine. */
87
91
  authorizeUrl: string;
88
- /** Connector slugs, or objects that override the name or the logo.
89
- * The first three draw as logos; the rest fold into a "+N" chip. */
90
- platforms?: ConnectButtonPlatformInput[];
92
+ /** Logos to draw on the button: connector slugs, or objects that
93
+ * override the name or the image. The first three draw; the rest fold
94
+ * into a "+N" chip. Decoration only; the permission set decides what
95
+ * One asks for. */
96
+ logos?: ConnectButtonLogoInput[];
97
+ /** @deprecated Renamed to `logos`; removed in 0.17.0. */
98
+ platforms?: ConnectButtonLogoInput[];
91
99
  /** Whether this user has a live grant, from your server. When set, it
92
100
  * decides the Connected state. When omitted, the button shows
93
101
  * Connected only right after a successful return. */
94
102
  connected?: boolean;
95
103
  /** Not clickable, for example until terms are accepted. */
96
104
  disabled?: boolean;
97
- /** default = neutral, accent = your brand colour, block = a card with
98
- * a description and a "Secured by One" foot. */
105
+ /** default = neutral, accent = your brand colour (set
106
+ * `--one-connect-accent` and `--one-connect-accent-fg` on the host),
107
+ * block = a card with a description and a "Secured by One" foot. */
99
108
  variant?: ConnectButtonVariant;
100
109
  size?: ConnectButtonSize;
101
110
  /** Stretches to the width of its container. */
@@ -104,11 +113,6 @@ export interface ConnectButtonProps {
104
113
  theme?: ConnectButtonTheme;
105
114
  /** Theme of One's hosted page. */
106
115
  connectTheme?: OneConnectTheme;
107
- /** @deprecated Renamed to `connectTheme`; removed in the next minor. */
108
- appTheme?: OneConnectTheme;
109
- /** Fill of the accent variant; One's lime when omitted. The label is
110
- * black or white, whichever reads better on it. */
111
- accentColor?: string;
112
116
  /** "Connect your apps" unless set. */
113
117
  label?: string;
114
118
  /** "Connected" unless set. */
package/src/vue.ts CHANGED
@@ -23,7 +23,7 @@ import type { PropType } from "vue";
23
23
  import {
24
24
  renderConnectButton,
25
25
  type ConnectButtonHandle,
26
- type ConnectButtonPlatformInput,
26
+ type ConnectButtonLogoInput,
27
27
  type ConnectButtonProps,
28
28
  type ConnectButtonSize,
29
29
  type ConnectButtonTheme,
@@ -40,8 +40,13 @@ export const ConnectButton = defineComponent({
40
40
  name: "OneConnectButton",
41
41
  props: {
42
42
  authorizeUrl: { type: String, required: true },
43
+ logos: {
44
+ type: Array as PropType<ConnectButtonLogoInput[]>,
45
+ default: undefined,
46
+ },
47
+ /** @deprecated use logos */
43
48
  platforms: {
44
- type: Array as PropType<ConnectButtonPlatformInput[]>,
49
+ type: Array as PropType<ConnectButtonLogoInput[]>,
45
50
  default: undefined,
46
51
  },
47
52
  connected: optionalBoolean,
@@ -57,9 +62,6 @@ export const ConnectButton = defineComponent({
57
62
  type: String as PropType<OneConnectTheme>,
58
63
  default: undefined,
59
64
  },
60
- /** @deprecated use connectTheme */
61
- appTheme: { type: String as PropType<OneConnectTheme>, default: undefined },
62
- accentColor: { type: String, default: undefined },
63
65
  label: { type: String, default: undefined },
64
66
  connectedLabel: { type: String, default: undefined },
65
67
  description: { type: String, default: undefined },