@the-seeker/feedback-react-native 0.0.0-stage → 0.2.1

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.
Files changed (80) hide show
  1. package/README.md +266 -2
  2. package/dist/core/author-token.d.ts +16 -0
  3. package/dist/core/author-token.js +96 -0
  4. package/dist/core/client.d.ts +55 -0
  5. package/dist/core/client.js +98 -0
  6. package/dist/core/config.d.ts +59 -0
  7. package/dist/core/config.js +112 -0
  8. package/dist/core/posts-schema.d.ts +306 -0
  9. package/dist/core/posts-schema.js +131 -0
  10. package/dist/core/posts.d.ts +67 -0
  11. package/dist/core/posts.js +113 -0
  12. package/dist/core/request.d.ts +53 -0
  13. package/dist/core/request.js +88 -0
  14. package/dist/core/survey.d.ts +12 -0
  15. package/dist/core/survey.js +26 -0
  16. package/dist/core/texts.d.ts +196 -0
  17. package/dist/core/texts.js +232 -0
  18. package/dist/core/theme.d.ts +6 -0
  19. package/dist/core/theme.js +55 -0
  20. package/dist/core/transport.d.ts +9 -0
  21. package/dist/core/transport.js +37 -0
  22. package/dist/index.d.ts +16 -0
  23. package/dist/index.js +34 -0
  24. package/dist/ui/Attachments.d.ts +9 -0
  25. package/dist/ui/Attachments.js +27 -0
  26. package/dist/ui/FeedbackForm.d.ts +8 -0
  27. package/dist/ui/FeedbackForm.js +92 -0
  28. package/dist/ui/FeedbackPostScreen.d.ts +8 -0
  29. package/dist/ui/FeedbackPostScreen.js +74 -0
  30. package/dist/ui/FeedbackSheet.d.ts +2 -0
  31. package/dist/ui/FeedbackSheet.js +14 -0
  32. package/dist/ui/FollowUpSheet.d.ts +17 -0
  33. package/dist/ui/FollowUpSheet.js +50 -0
  34. package/dist/ui/Inline.d.ts +6 -0
  35. package/dist/ui/Inline.js +16 -0
  36. package/dist/ui/Launcher.d.ts +1 -0
  37. package/dist/ui/Launcher.js +16 -0
  38. package/dist/ui/MyFeedbackModal.d.ts +10 -0
  39. package/dist/ui/MyFeedbackModal.js +45 -0
  40. package/dist/ui/MyFeedbackScreen.d.ts +9 -0
  41. package/dist/ui/MyFeedbackScreen.js +88 -0
  42. package/dist/ui/PostThread.d.ts +17 -0
  43. package/dist/ui/PostThread.js +57 -0
  44. package/dist/ui/Provider.d.ts +24 -0
  45. package/dist/ui/Provider.js +186 -0
  46. package/dist/ui/SurveyPrompt.d.ts +2 -0
  47. package/dist/ui/SurveyPrompt.js +52 -0
  48. package/dist/ui/context.d.ts +122 -0
  49. package/dist/ui/context.js +28 -0
  50. package/dist/ui/device.d.ts +10 -0
  51. package/dist/ui/device.js +22 -0
  52. package/dist/ui/forms.d.ts +32 -0
  53. package/dist/ui/forms.js +62 -0
  54. package/dist/ui/motion.d.ts +1 -0
  55. package/dist/ui/motion.js +23 -0
  56. package/dist/ui/post-format.d.ts +19 -0
  57. package/dist/ui/post-format.js +79 -0
  58. package/dist/ui/post-pieces.d.ts +24 -0
  59. package/dist/ui/post-pieces.js +60 -0
  60. package/dist/ui/post-styles.d.ts +317 -0
  61. package/dist/ui/post-styles.js +103 -0
  62. package/dist/ui/post-view-model.d.ts +52 -0
  63. package/dist/ui/post-view-model.js +181 -0
  64. package/dist/ui/primitives.d.ts +33 -0
  65. package/dist/ui/primitives.js +55 -0
  66. package/dist/ui/prop-state.d.ts +9 -0
  67. package/dist/ui/prop-state.js +27 -0
  68. package/dist/ui/storage.d.ts +15 -0
  69. package/dist/ui/storage.js +35 -0
  70. package/dist/ui/styles.d.ts +774 -0
  71. package/dist/ui/styles.js +185 -0
  72. package/dist/ui/surfaces.d.ts +13 -0
  73. package/dist/ui/surfaces.js +41 -0
  74. package/dist/ui/tokens.d.ts +16 -0
  75. package/dist/ui/tokens.js +62 -0
  76. package/dist/ui/useMyPosts.d.ts +35 -0
  77. package/dist/ui/useMyPosts.js +124 -0
  78. package/dist/ui/useSurvey.d.ts +12 -0
  79. package/dist/ui/useSurvey.js +52 -0
  80. package/package.json +32 -3
@@ -0,0 +1,122 @@
1
+ import type { SubmitResult } from "../core/client";
2
+ import type { Survey, WidgetConfig } from "../core/config";
3
+ import type { AppSite, PostsClient } from "../core/posts";
4
+ import type { ImageAsset } from "../core/request";
5
+ import type { Locale, LocaleMode, ResolvedTexts } from "../core/texts";
6
+ import type { DraftStore } from "./forms";
7
+ import type { FeedbackStyles } from "./styles";
8
+ import type { Tokens } from "./tokens";
9
+ export type SubmissionKind = "feedback" | "nps" | "csat";
10
+ export type SubmitInput = Readonly<{
11
+ message: string;
12
+ contact?: string | null;
13
+ images?: readonly ImageAsset[];
14
+ }>;
15
+ export type PickImages = () => Promise<readonly ImageAsset[]>;
16
+ export type TheSeekerFeedbackApi = Readonly<{
17
+ /** `true` once the widget config loaded; the form, launcher and survey only render when ready. */
18
+ ready: boolean;
19
+ config: WidgetConfig | null;
20
+ open: () => void;
21
+ close: () => void;
22
+ setScreen: (screen: string) => void;
23
+ setUser: (userId: string | number | null) => void;
24
+ setContact: (contact: string | null) => void;
25
+ setLocale: (locale: LocaleMode) => void;
26
+ submit: (input: SubmitInput) => Promise<SubmitResult>;
27
+ /** Alias of `open`. */
28
+ presentFeedback: () => void;
29
+ /** `true` once the site enables my-feedback screens for this install (needs `storage` and a secure RNG). */
30
+ myFeedbackReady: boolean;
31
+ /** Opens "내 피드백" (my posts, answers, follow-ups); no-op until `myFeedbackReady`. */
32
+ openMyFeedback: () => void;
33
+ /** Alias of `openMyFeedback`. */
34
+ presentMyFeedback: () => void;
35
+ /** Posts with an answer the author has not read yet; `0` while my-feedback is unavailable. */
36
+ unreadCount: number;
37
+ refreshUnread: () => Promise<void>;
38
+ }>;
39
+ /** My-feedback state for the built-in screens; present only when the site enables it for this install. */
40
+ export type MineUi = Readonly<{
41
+ client: PostsClient;
42
+ site: AppSite;
43
+ isOpen: boolean;
44
+ /** Increments on every open so the screens start again from the list. */
45
+ session: number;
46
+ open: () => void;
47
+ close: () => void;
48
+ unreadCount: number;
49
+ refreshUnread: () => Promise<void>;
50
+ }>;
51
+ /** Everything the built-in components need; only provided while the config is loaded. */
52
+ export type FeedbackUi = Readonly<{
53
+ config: WidgetConfig;
54
+ locale: Locale;
55
+ mine: MineUi | null;
56
+ /** iOS: a modal finished closing, so a queued one may present now. */
57
+ modalDismissed: () => void;
58
+ texts: ResolvedTexts;
59
+ tokens: Tokens;
60
+ styles: FeedbackStyles;
61
+ isOpen: boolean;
62
+ launcherShown: boolean;
63
+ contact: string | null;
64
+ draft: DraftStore;
65
+ pickImages: PickImages | undefined;
66
+ open: () => void;
67
+ close: () => void;
68
+ submit: (input: SubmitInput) => Promise<SubmitResult>;
69
+ survey: Survey | null;
70
+ dismissSurvey: () => void;
71
+ sendSurvey: (score: number, message: string) => Promise<SubmitResult>;
72
+ }>;
73
+ export declare class TheSeekerFeedbackContextError extends Error {
74
+ readonly caller: string;
75
+ constructor(caller: string);
76
+ }
77
+ export declare const FeedbackApiContext: import("react").Context<Readonly<{
78
+ /** `true` once the widget config loaded; the form, launcher and survey only render when ready. */
79
+ ready: boolean;
80
+ config: WidgetConfig | null;
81
+ open: () => void;
82
+ close: () => void;
83
+ setScreen: (screen: string) => void;
84
+ setUser: (userId: string | number | null) => void;
85
+ setContact: (contact: string | null) => void;
86
+ setLocale: (locale: LocaleMode) => void;
87
+ submit: (input: SubmitInput) => Promise<SubmitResult>;
88
+ /** Alias of `open`. */
89
+ presentFeedback: () => void;
90
+ /** `true` once the site enables my-feedback screens for this install (needs `storage` and a secure RNG). */
91
+ myFeedbackReady: boolean;
92
+ /** Opens "내 피드백" (my posts, answers, follow-ups); no-op until `myFeedbackReady`. */
93
+ openMyFeedback: () => void;
94
+ /** Alias of `openMyFeedback`. */
95
+ presentMyFeedback: () => void;
96
+ /** Posts with an answer the author has not read yet; `0` while my-feedback is unavailable. */
97
+ unreadCount: number;
98
+ refreshUnread: () => Promise<void>;
99
+ }> | null>;
100
+ export declare const FeedbackUiContext: import("react").Context<Readonly<{
101
+ config: WidgetConfig;
102
+ locale: Locale;
103
+ mine: MineUi | null;
104
+ /** iOS: a modal finished closing, so a queued one may present now. */
105
+ modalDismissed: () => void;
106
+ texts: ResolvedTexts;
107
+ tokens: Tokens;
108
+ styles: FeedbackStyles;
109
+ isOpen: boolean;
110
+ launcherShown: boolean;
111
+ contact: string | null;
112
+ draft: DraftStore;
113
+ pickImages: PickImages | undefined;
114
+ open: () => void;
115
+ close: () => void;
116
+ submit: (input: SubmitInput) => Promise<SubmitResult>;
117
+ survey: Survey | null;
118
+ dismissSurvey: () => void;
119
+ sendSurvey: (score: number, message: string) => Promise<SubmitResult>;
120
+ }> | null>;
121
+ export declare function useTheSeekerFeedback(): TheSeekerFeedbackApi;
122
+ export declare function useFeedbackUi(): FeedbackUi;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FeedbackUiContext = exports.FeedbackApiContext = exports.TheSeekerFeedbackContextError = void 0;
4
+ exports.useTheSeekerFeedback = useTheSeekerFeedback;
5
+ exports.useFeedbackUi = useFeedbackUi;
6
+ const react_1 = require("react");
7
+ class TheSeekerFeedbackContextError extends Error {
8
+ constructor(caller) {
9
+ super(`${caller} must be rendered inside <TheSeekerFeedbackProvider>.`);
10
+ this.caller = caller;
11
+ this.name = "TheSeekerFeedbackContextError";
12
+ }
13
+ }
14
+ exports.TheSeekerFeedbackContextError = TheSeekerFeedbackContextError;
15
+ exports.FeedbackApiContext = (0, react_1.createContext)(null);
16
+ exports.FeedbackUiContext = (0, react_1.createContext)(null);
17
+ function useTheSeekerFeedback() {
18
+ const api = (0, react_1.useContext)(exports.FeedbackApiContext);
19
+ if (api === null)
20
+ throw new TheSeekerFeedbackContextError("useTheSeekerFeedback()");
21
+ return api;
22
+ }
23
+ function useFeedbackUi() {
24
+ const ui = (0, react_1.useContext)(exports.FeedbackUiContext);
25
+ if (ui === null)
26
+ throw new TheSeekerFeedbackContextError("TheSeekerFeedback UI");
27
+ return ui;
28
+ }
@@ -0,0 +1,10 @@
1
+ import type { ClientMetadata } from "../core/request";
2
+ /** The slice of RN `Platform` the client metadata needs; kept RN-free so it stays unit-testable. */
3
+ export type PlatformInfo = Readonly<{
4
+ os: string;
5
+ version: string | number;
6
+ release?: string;
7
+ isPad?: boolean;
8
+ }>;
9
+ export declare function clientFromPlatform({ os, version, release, isPad }: PlatformInfo): ClientMetadata | undefined;
10
+ export declare function deviceLocale(): string;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clientFromPlatform = clientFromPlatform;
4
+ exports.deviceLocale = deviceLocale;
5
+ function clientFromPlatform({ os, version, release, isPad }) {
6
+ switch (os) {
7
+ case "ios":
8
+ return {
9
+ platform: "ios",
10
+ osVersion: String(version).slice(0, 32),
11
+ deviceType: isPad === true ? "tablet" : "phone",
12
+ };
13
+ case "android":
14
+ // Platform.Version is the API level (35); the user-facing release ("15") reads better in the CRM.
15
+ return { platform: "android", osVersion: (release ?? String(version)).slice(0, 32) };
16
+ default:
17
+ return undefined;
18
+ }
19
+ }
20
+ function deviceLocale() {
21
+ return Intl.DateTimeFormat().resolvedOptions().locale;
22
+ }
@@ -0,0 +1,32 @@
1
+ import type { ContactMode, Survey } from "../core/config";
2
+ import type { ImageAsset } from "../core/request";
3
+ import type { ResolvedTexts } from "../core/texts";
4
+ export declare const MAX_MESSAGE = 5000;
5
+ export declare const MAX_IMAGES = 4;
6
+ export declare const AUTO_CLOSE_MS = 1500;
7
+ export type TextKey = keyof ResolvedTexts;
8
+ export type DraftError = Readonly<{
9
+ field: "message" | "contact";
10
+ key: TextKey;
11
+ }>;
12
+ export type Draft = Readonly<{
13
+ message: string;
14
+ contact: string | null;
15
+ images: readonly ImageAsset[];
16
+ }>;
17
+ export type DraftStore = Readonly<{
18
+ read(): Draft;
19
+ write(draft: Draft): void;
20
+ }>;
21
+ export type PickOutcome = Readonly<{
22
+ images: readonly ImageAsset[];
23
+ errorKey: TextKey | null;
24
+ }>;
25
+ export declare const EMPTY_DRAFT: Draft;
26
+ /** First problem with a draft, keyed to the field it belongs to; `null` when it can be sent. */
27
+ export declare function draftError(message: string, contact: string, mode: ContactMode): DraftError | null;
28
+ /** Appends picked assets one by one, skipping invalid ones and stopping at the attachment limit. */
29
+ export declare function addPicked(current: readonly ImageAsset[], picked: readonly ImageAsset[]): PickOutcome;
30
+ export declare function surveyScores(type: Survey["type"]): readonly number[];
31
+ /** Keeps the sheet's unsent draft across close/open; a plain closure so render never touches a ref. */
32
+ export declare function createDraftStore(): DraftStore;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMPTY_DRAFT = exports.AUTO_CLOSE_MS = exports.MAX_IMAGES = exports.MAX_MESSAGE = void 0;
4
+ exports.draftError = draftError;
5
+ exports.addPicked = addPicked;
6
+ exports.surveyScores = surveyScores;
7
+ exports.createDraftStore = createDraftStore;
8
+ const zod_1 = require("zod");
9
+ const request_1 = require("../core/request");
10
+ exports.MAX_MESSAGE = 5000;
11
+ exports.MAX_IMAGES = 4;
12
+ exports.AUTO_CLOSE_MS = 1500;
13
+ exports.EMPTY_DRAFT = { message: "", contact: null, images: [] };
14
+ // Same check the server runs on `contactEmail`, so the form never accepts what the API rejects.
15
+ const emailSchema = zod_1.z.email().max(254);
16
+ /** First problem with a draft, keyed to the field it belongs to; `null` when it can be sent. */
17
+ function draftError(message, contact, mode) {
18
+ if (!message.trim())
19
+ return { field: "message", key: "empty" };
20
+ const trimmed = contact.trim();
21
+ if (mode === "email" && trimmed && !emailSchema.safeParse(trimmed).success)
22
+ return { field: "contact", key: "badEmail" };
23
+ return null;
24
+ }
25
+ /** Appends picked assets one by one, skipping invalid ones and stopping at the attachment limit. */
26
+ function addPicked(current, picked) {
27
+ let images = current;
28
+ let errorKey = null;
29
+ for (const asset of picked) {
30
+ if (images.length >= exports.MAX_IMAGES)
31
+ return { images, errorKey: "tooMany" };
32
+ const verdict = (0, request_1.validateImages)([asset]);
33
+ if (verdict === "ok")
34
+ images = [...images, asset];
35
+ else
36
+ errorKey = (0, request_1.errorMessageKey)(verdict);
37
+ }
38
+ return { images, errorKey };
39
+ }
40
+ function surveyScores(type) {
41
+ switch (type) {
42
+ case "nps":
43
+ return Array.from({ length: 11 }, (_, index) => index);
44
+ case "csat":
45
+ return Array.from({ length: 5 }, (_, index) => index + 1);
46
+ default:
47
+ return assertNever(type);
48
+ }
49
+ }
50
+ /** Keeps the sheet's unsent draft across close/open; a plain closure so render never touches a ref. */
51
+ function createDraftStore() {
52
+ let draft = exports.EMPTY_DRAFT;
53
+ return {
54
+ read: () => draft,
55
+ write: (next) => {
56
+ draft = next;
57
+ },
58
+ };
59
+ }
60
+ function assertNever(value) {
61
+ throw new TypeError(`Unexpected survey type: ${String(value)}`);
62
+ }
@@ -0,0 +1 @@
1
+ export declare function useReducedMotion(): boolean;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useReducedMotion = useReducedMotion;
4
+ const react_1 = require("react");
5
+ const react_native_1 = require("react-native");
6
+ function useReducedMotion() {
7
+ const [reduced, setReduced] = (0, react_1.useState)(false);
8
+ (0, react_1.useEffect)(() => {
9
+ let live = true;
10
+ async function read() {
11
+ const value = await react_native_1.AccessibilityInfo.isReduceMotionEnabled();
12
+ if (live)
13
+ setReduced(value);
14
+ }
15
+ void read();
16
+ const subscription = react_native_1.AccessibilityInfo.addEventListener("reduceMotionChanged", setReduced);
17
+ return () => {
18
+ live = false;
19
+ subscription.remove();
20
+ };
21
+ }, []);
22
+ return reduced;
23
+ }
@@ -0,0 +1,19 @@
1
+ import type { AppSite, BoardStatus, FeedbackStatus } from "../core/posts";
2
+ import type { DEFAULT_TEXTS, Locale } from "../core/texts";
3
+ export type TextKey = keyof (typeof DEFAULT_TEXTS)["ko"];
4
+ export type PostTexts = Readonly<Record<TextKey, string>>;
5
+ export type ViewContext = Readonly<{
6
+ texts: PostTexts;
7
+ locale: Locale;
8
+ now: Date;
9
+ site: AppSite;
10
+ }>;
11
+ export declare const join: (...parts: readonly (string | null)[]) => string;
12
+ /** Device-local day: `11월 21일` / `Nov 21`, with the year only when it is not the current one. */
13
+ export declare function formatDay(date: Date, locale: Locale, now: Date): string;
14
+ export declare function formatDateTime(date: Date, locale: Locale, now: Date): string;
15
+ export declare function statusLabel(status: FeedbackStatus, texts: PostTexts): string;
16
+ export declare function boardStatusLabel(status: BoardStatus, ctx: ViewContext): string;
17
+ /** Korean 로/으로 after the label's last syllable (vowel or ㄹ ending → 로). */
18
+ export declare function particleRo(label: string): string;
19
+ export declare function assertNever(value: never): never;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.join = void 0;
4
+ exports.formatDay = formatDay;
5
+ exports.formatDateTime = formatDateTime;
6
+ exports.statusLabel = statusLabel;
7
+ exports.boardStatusLabel = boardStatusLabel;
8
+ exports.particleRo = particleRo;
9
+ exports.assertNever = assertNever;
10
+ const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
11
+ const join = (...parts) => parts.filter((part) => part !== null && part !== "").join(" · ");
12
+ exports.join = join;
13
+ /** Device-local day: `11월 21일` / `Nov 21`, with the year only when it is not the current one. */
14
+ function formatDay(date, locale, now) {
15
+ const sameYear = date.getFullYear() === now.getFullYear();
16
+ switch (locale) {
17
+ case "ko":
18
+ return `${sameYear ? "" : `${date.getFullYear()}년 `}${date.getMonth() + 1}월 ${date.getDate()}일`;
19
+ case "en":
20
+ return `${MONTHS[date.getMonth()] ?? ""} ${date.getDate()}${sameYear ? "" : `, ${date.getFullYear()}`}`;
21
+ default:
22
+ return assertNever(locale);
23
+ }
24
+ }
25
+ function formatDateTime(date, locale, now) {
26
+ const hour = date.getHours() % 12 === 0 ? 12 : date.getHours() % 12;
27
+ const clock = `${hour}:${String(date.getMinutes()).padStart(2, "0")}`;
28
+ const morning = date.getHours() < 12;
29
+ switch (locale) {
30
+ case "ko":
31
+ return `${formatDay(date, locale, now)} ${morning ? "오전" : "오후"} ${clock}`;
32
+ case "en":
33
+ return `${formatDay(date, locale, now)}, ${clock} ${morning ? "AM" : "PM"}`;
34
+ default:
35
+ return assertNever(locale);
36
+ }
37
+ }
38
+ function statusLabel(status, texts) {
39
+ switch (status) {
40
+ case "new":
41
+ return texts.statusNew;
42
+ case "in_progress":
43
+ return texts.statusInProgress;
44
+ case "resolved":
45
+ return texts.statusResolved;
46
+ case "closed":
47
+ return texts.statusClosed;
48
+ default:
49
+ return assertNever(status);
50
+ }
51
+ }
52
+ function boardStatusLabel(status, ctx) {
53
+ const custom = ctx.site.statusLabels[status];
54
+ if (custom !== null)
55
+ return custom;
56
+ switch (status) {
57
+ case "review":
58
+ return ctx.texts.boardReview;
59
+ case "planned":
60
+ return ctx.texts.boardPlanned;
61
+ case "in_progress":
62
+ return ctx.texts.boardInProgress;
63
+ case "done":
64
+ return ctx.texts.boardDone;
65
+ default:
66
+ return assertNever(status);
67
+ }
68
+ }
69
+ /** Korean 로/으로 after the label's last syllable (vowel or ㄹ ending → 로). */
70
+ function particleRo(label) {
71
+ const code = label.charCodeAt(label.length - 1) - 0xac00;
72
+ if (code < 0 || code > 11171)
73
+ return "(으)로";
74
+ const final = code % 28;
75
+ return final === 0 || final === 8 ? "로" : "으로";
76
+ }
77
+ function assertNever(value) {
78
+ throw new TypeError(`Unexpected post view variant: ${String(value)}`);
79
+ }
@@ -0,0 +1,24 @@
1
+ /** lucide:chevron-left (6×12 strokes in a 24 box) drawn with Views: no SVG renderer in pure JS. */
2
+ export declare function Chevron({ size, color, direction, }: Readonly<{
3
+ size: number;
4
+ color: string;
5
+ direction: "back" | "forward";
6
+ }>): import("react").JSX.Element;
7
+ export type BarAction = Readonly<{
8
+ label: string;
9
+ onPress: () => void;
10
+ back?: boolean;
11
+ testID?: string;
12
+ }>;
13
+ /** Screen chrome: a leading action (close or back) and an optional trailing one. No pinned composer. */
14
+ export declare function NavBar({ leading, trailing }: Readonly<{
15
+ leading: BarAction;
16
+ trailing?: BarAction;
17
+ }>): import("react").JSX.Element;
18
+ export declare function StatusBadge({ label }: Readonly<{
19
+ label: string;
20
+ }>): import("react").JSX.Element;
21
+ /** Unread-answer dot inside a row; the row's own label carries the same cue as text. */
22
+ export declare function UnreadDot(): import("react").JSX.Element;
23
+ /** The send form's way into "내 피드백", with the unread count; hidden while my-feedback is unavailable. */
24
+ export declare function MyFeedbackEntry(): import("react").JSX.Element | null;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Chevron = Chevron;
4
+ exports.NavBar = NavBar;
5
+ exports.StatusBadge = StatusBadge;
6
+ exports.UnreadDot = UnreadDot;
7
+ exports.MyFeedbackEntry = MyFeedbackEntry;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const react_native_1 = require("react-native");
10
+ const context_1 = require("./context");
11
+ const post_styles_1 = require("./post-styles");
12
+ /** lucide:chevron-left (6×12 strokes in a 24 box) drawn with Views: no SVG renderer in pure JS. */
13
+ function Chevron({ size, color, direction, }) {
14
+ const arm = size * 0.354;
15
+ const stroke = Math.max(1.5, size / 12);
16
+ return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
17
+ width: size / 2,
18
+ height: size,
19
+ alignItems: "center",
20
+ justifyContent: "center",
21
+ transform: [{ scaleX: direction === "back" ? 1 : -1 }],
22
+ }, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
23
+ width: arm,
24
+ height: arm,
25
+ marginStart: arm / 2,
26
+ borderStartWidth: stroke,
27
+ borderBottomWidth: stroke,
28
+ borderColor: color,
29
+ transform: [{ rotate: "45deg" }],
30
+ } }) }));
31
+ }
32
+ function BarButton({ label, onPress, back = false, testID }) {
33
+ const styles = (0, post_styles_1.usePostStyles)();
34
+ const { tokens } = (0, context_1.useFeedbackUi)();
35
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.Pressable, { accessibilityRole: "button", accessibilityLabel: label, onPress: onPress, hitSlop: 4, ...(testID === undefined ? {} : { testID }), style: ({ pressed }) => [styles.barButton, pressed && styles.barButtonPressed], children: [back ? (0, jsx_runtime_1.jsx)(Chevron, { size: 18, color: tokens.accent, direction: "back" }) : null, (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.barLabel, numberOfLines: 1, children: label })] }));
36
+ }
37
+ /** Screen chrome: a leading action (close or back) and an optional trailing one. No pinned composer. */
38
+ function NavBar({ leading, trailing }) {
39
+ const styles = (0, post_styles_1.usePostStyles)();
40
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.bar, children: [(0, jsx_runtime_1.jsx)(BarButton, { ...leading }), trailing === undefined ? null : ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.barEnd, children: (0, jsx_runtime_1.jsx)(BarButton, { ...trailing }) }))] }));
41
+ }
42
+ function StatusBadge({ label }) {
43
+ const styles = (0, post_styles_1.usePostStyles)();
44
+ return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.badge, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.badgeLabel, numberOfLines: 1, children: label }) }));
45
+ }
46
+ /** Unread-answer dot inside a row; the row's own label carries the same cue as text. */
47
+ function UnreadDot() {
48
+ const styles = (0, post_styles_1.usePostStyles)();
49
+ return (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.dot });
50
+ }
51
+ /** The send form's way into "내 피드백", with the unread count; hidden while my-feedback is unavailable. */
52
+ function MyFeedbackEntry() {
53
+ const { mine, texts } = (0, context_1.useFeedbackUi)();
54
+ const styles = (0, post_styles_1.usePostStyles)();
55
+ if (mine === null)
56
+ return null;
57
+ const unread = mine.unreadCount;
58
+ const label = unread > 0 ? `${texts.myFeedback}, ${texts.unreadCount.replace("{n}", String(unread))}` : null;
59
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.Pressable, { accessibilityRole: "button", accessibilityLabel: label ?? texts.myFeedback, onPress: mine.open, testID: "theseeker-feedback-mine", style: ({ pressed }) => [styles.barButton, styles.entry, pressed && styles.barButtonPressed], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.barLabel, numberOfLines: 1, children: texts.myFeedback }), unread > 0 ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.count, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.countLabel, children: unread > 99 ? "99+" : String(unread) }) })) : null] }));
60
+ }