@youasked/react 0.5.0 → 0.7.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/README.md CHANGED
@@ -67,9 +67,11 @@ Then pass `user={{ id: userId }} signature={signature} ready={loaded}` to `<YouA
67
67
  It reads shadcn tokens (`--primary`, `--background`, `--radius` and so on) on its own. Otherwise pass `appearance`:
68
68
 
69
69
  ```tsx
70
- <YouAsked appKey="ya_pub_…" appearance={{ accent: "#5b3df5", radius: 16, fontFamily: "inherit" }} />
70
+ <YouAsked appKey="ya_pub_…" appearance={{ accent: "#5b3df5", radius: 16, buttonRadius: "pill", fontFamily: "inherit" }} />
71
71
  ```
72
72
 
73
+ `radius` shapes cards, rows and the sheet; `buttonRadius` shapes buttons, the ask bar, the composer and chips (a number in px, any CSS length, or `"pill"`). Leave `buttonRadius` out and each control keeps its own shape.
74
+
73
75
  Dark mode follows the page's `.dark` class or `data-theme`.
74
76
 
75
77
  ## Shipping
@@ -1,5 +1,6 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { type YouAskedUser } from "./client";
3
+ import { type NudgeSettings } from "./nudge";
3
4
  import { type Appearance } from "./theme";
4
5
  export declare const DEFAULT_API_URL = "https://api.youasked.dev";
5
6
  export type YouAskedProps = {
@@ -34,7 +35,13 @@ export type YouAskedProps = {
34
35
  offset?: number;
35
36
  /** Show the corner card for replies, shipped requests and what's new. Turn off for previews embedded in a page. */
36
37
  cards?: boolean;
38
+ /**
39
+ * The occasional "Got an idea for <App>?" prompt. Set it up in the dashboard; this overrides it:
40
+ * false turns it off, true turns it on with the dashboard's (or default) settings, an object
41
+ * changes individual settings, e.g. `{ everyDays: 14, activeSeconds: 60 }`.
42
+ */
43
+ nudge?: boolean | Partial<NudgeSettings>;
37
44
  apiUrl?: string;
38
45
  children?: ReactNode;
39
46
  };
40
- export declare function YouAsked({ appKey, demo, cards, user, signature, ready, appearance, trigger, position, label, appName, appIcon, greeting, title, offset, apiUrl, children, }: YouAskedProps): import("react").JSX.Element;
47
+ export declare function YouAsked({ appKey, demo, cards, nudge: nudgeProp, user, signature, ready, appearance, trigger, position, label, appName, appIcon, greeting, title, offset, apiUrl, children, }: YouAskedProps): import("react").JSX.Element;
package/dist/client.d.ts CHANGED
@@ -69,6 +69,8 @@ export type Config = {
69
69
  unseen: Notice[];
70
70
  whatsNew: WhatsNew | null;
71
71
  mode?: "test" | "live";
72
+ /** The occasional in-app prompt, as set in the dashboard. null when it's off. */
73
+ nudge?: import("./nudge").NudgeSettings | null;
72
74
  };
73
75
  export type NewRequest = {
74
76
  title: string;
package/dist/context.d.ts CHANGED
@@ -23,9 +23,12 @@ export type Route = {
23
23
  } | {
24
24
  view: "board";
25
25
  tab?: "top" | "new" | "shipped";
26
- } | {
26
+ }
27
+ /** `from` is where Back goes: the list they opened it from. */
28
+ | {
27
29
  view: "detail";
28
30
  id: string;
31
+ from?: "home" | "board" | "mine";
29
32
  } | {
30
33
  view: "mine";
31
34
  };
package/dist/icons.d.ts CHANGED
@@ -11,4 +11,7 @@ export declare const IconBulb: () => import("react").JSX.Element;
11
11
  export declare const IconFrame: () => import("react").JSX.Element;
12
12
  export declare const IconSpark: () => import("react").JSX.Element;
13
13
  /** YouAsked's own mark for asking: a speech bubble with an up arrow (ask, and vote it up). */
14
- export declare const IconIdea: () => import("react").JSX.Element;
14
+ /** The ask mark: a speech bubble holding the vote arrow. `ink` colours the arrow; by default the background. */
15
+ export declare const IconIdea: ({ ink }: {
16
+ ink?: string;
17
+ }) => import("react").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { YouAsked, DEFAULT_API_URL } from "./YouAsked";
2
+ export type { NudgeSettings } from "./nudge";
2
3
  export type { YouAskedProps } from "./YouAsked";
3
4
  export { useYouAsked, openYouAsked } from "./context";
4
5
  export type { OpenOptions } from "./context";