panelui-native 0.28.1 → 0.32.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.
Files changed (121) hide show
  1. package/README.md +22 -3
  2. package/lib/module/components/calendar/index.js +450 -132
  3. package/lib/module/components/calendar/index.js.map +1 -1
  4. package/lib/module/components/code-block/highlight.js +363 -0
  5. package/lib/module/components/code-block/highlight.js.map +1 -0
  6. package/lib/module/components/code-block/index.js +313 -0
  7. package/lib/module/components/code-block/index.js.map +1 -0
  8. package/lib/module/components/date-picker/index.js +8 -1
  9. package/lib/module/components/date-picker/index.js.map +1 -1
  10. package/lib/module/components/heatmap-chart/index.js +9 -8
  11. package/lib/module/components/heatmap-chart/index.js.map +1 -1
  12. package/lib/module/components/map/index.js +50 -4
  13. package/lib/module/components/map/index.js.map +1 -1
  14. package/lib/module/components/menu/index.js +714 -0
  15. package/lib/module/components/menu/index.js.map +1 -0
  16. package/lib/module/components/plan/index.js +582 -0
  17. package/lib/module/components/plan/index.js.map +1 -0
  18. package/lib/module/components/popover/index.js +35 -4
  19. package/lib/module/components/popover/index.js.map +1 -1
  20. package/lib/module/components/post/index.js +992 -0
  21. package/lib/module/components/post/index.js.map +1 -0
  22. package/lib/module/components/radio-group/index.js +13 -8
  23. package/lib/module/components/radio-group/index.js.map +1 -1
  24. package/lib/module/components/reasoning/index.js +244 -0
  25. package/lib/module/components/reasoning/index.js.map +1 -0
  26. package/lib/module/components/response/index.js +296 -0
  27. package/lib/module/components/response/index.js.map +1 -0
  28. package/lib/module/components/response/markdown.js +463 -0
  29. package/lib/module/components/response/markdown.js.map +1 -0
  30. package/lib/module/components/select/index.js +97 -15
  31. package/lib/module/components/select/index.js.map +1 -1
  32. package/lib/module/components/sources/index.js +221 -0
  33. package/lib/module/components/sources/index.js.map +1 -0
  34. package/lib/module/components/table/index.js +632 -0
  35. package/lib/module/components/table/index.js.map +1 -0
  36. package/lib/module/components/task/index.js +300 -0
  37. package/lib/module/components/task/index.js.map +1 -0
  38. package/lib/module/components/textarea/index.js +295 -0
  39. package/lib/module/components/textarea/index.js.map +1 -0
  40. package/lib/module/components/tooltip/index.js +179 -23
  41. package/lib/module/components/tooltip/index.js.map +1 -1
  42. package/lib/module/icons/index.js +339 -0
  43. package/lib/module/icons/index.js.map +1 -1
  44. package/lib/module/index.js +12 -1
  45. package/lib/module/index.js.map +1 -1
  46. package/lib/module/primitives/collapse.js +112 -0
  47. package/lib/module/primitives/collapse.js.map +1 -0
  48. package/lib/module/utils/date.js +129 -22
  49. package/lib/module/utils/date.js.map +1 -1
  50. package/lib/typescript/src/components/calendar/index.d.ts +79 -5
  51. package/lib/typescript/src/components/calendar/index.d.ts.map +1 -1
  52. package/lib/typescript/src/components/code-block/highlight.d.ts +39 -0
  53. package/lib/typescript/src/components/code-block/highlight.d.ts.map +1 -0
  54. package/lib/typescript/src/components/code-block/index.d.ts +113 -0
  55. package/lib/typescript/src/components/code-block/index.d.ts.map +1 -0
  56. package/lib/typescript/src/components/date-picker/index.d.ts +7 -1
  57. package/lib/typescript/src/components/date-picker/index.d.ts.map +1 -1
  58. package/lib/typescript/src/components/heatmap-chart/index.d.ts.map +1 -1
  59. package/lib/typescript/src/components/map/index.d.ts +8 -1
  60. package/lib/typescript/src/components/map/index.d.ts.map +1 -1
  61. package/lib/typescript/src/components/menu/index.d.ts +261 -0
  62. package/lib/typescript/src/components/menu/index.d.ts.map +1 -0
  63. package/lib/typescript/src/components/plan/index.d.ts +238 -0
  64. package/lib/typescript/src/components/plan/index.d.ts.map +1 -0
  65. package/lib/typescript/src/components/popover/index.d.ts +35 -1
  66. package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
  67. package/lib/typescript/src/components/post/index.d.ts +358 -0
  68. package/lib/typescript/src/components/post/index.d.ts.map +1 -0
  69. package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
  70. package/lib/typescript/src/components/reasoning/index.d.ts +97 -0
  71. package/lib/typescript/src/components/reasoning/index.d.ts.map +1 -0
  72. package/lib/typescript/src/components/response/index.d.ts +91 -0
  73. package/lib/typescript/src/components/response/index.d.ts.map +1 -0
  74. package/lib/typescript/src/components/response/markdown.d.ts +88 -0
  75. package/lib/typescript/src/components/response/markdown.d.ts.map +1 -0
  76. package/lib/typescript/src/components/select/index.d.ts +27 -2
  77. package/lib/typescript/src/components/select/index.d.ts.map +1 -1
  78. package/lib/typescript/src/components/sources/index.d.ts +85 -0
  79. package/lib/typescript/src/components/sources/index.d.ts.map +1 -0
  80. package/lib/typescript/src/components/table/index.d.ts +274 -0
  81. package/lib/typescript/src/components/table/index.d.ts.map +1 -0
  82. package/lib/typescript/src/components/task/index.d.ts +103 -0
  83. package/lib/typescript/src/components/task/index.d.ts.map +1 -0
  84. package/lib/typescript/src/components/textarea/index.d.ts +175 -0
  85. package/lib/typescript/src/components/textarea/index.d.ts.map +1 -0
  86. package/lib/typescript/src/components/tooltip/index.d.ts +63 -8
  87. package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -1
  88. package/lib/typescript/src/icons/index.d.ts +54 -1
  89. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  90. package/lib/typescript/src/index.d.ts +14 -3
  91. package/lib/typescript/src/index.d.ts.map +1 -1
  92. package/lib/typescript/src/primitives/collapse.d.ts +42 -0
  93. package/lib/typescript/src/primitives/collapse.d.ts.map +1 -0
  94. package/lib/typescript/src/utils/date.d.ts +49 -5
  95. package/lib/typescript/src/utils/date.d.ts.map +1 -1
  96. package/package.json +1 -1
  97. package/src/components/calendar/index.tsx +519 -139
  98. package/src/components/code-block/highlight.ts +278 -0
  99. package/src/components/code-block/index.tsx +341 -0
  100. package/src/components/date-picker/index.tsx +19 -1
  101. package/src/components/heatmap-chart/index.tsx +9 -9
  102. package/src/components/map/index.tsx +53 -4
  103. package/src/components/menu/index.tsx +812 -0
  104. package/src/components/plan/index.tsx +648 -0
  105. package/src/components/popover/index.tsx +69 -2
  106. package/src/components/post/index.tsx +1116 -0
  107. package/src/components/radio-group/index.tsx +11 -2
  108. package/src/components/reasoning/index.tsx +297 -0
  109. package/src/components/response/index.tsx +390 -0
  110. package/src/components/response/markdown.ts +489 -0
  111. package/src/components/select/index.tsx +132 -12
  112. package/src/components/sources/index.tsx +278 -0
  113. package/src/components/table/index.tsx +747 -0
  114. package/src/components/task/index.tsx +329 -0
  115. package/src/components/textarea/index.tsx +381 -0
  116. package/src/components/tooltip/index.tsx +203 -20
  117. package/src/icons/index.tsx +264 -1
  118. package/src/index.ts +131 -0
  119. package/src/primitives/collapse.tsx +128 -0
  120. package/src/utils/date.ts +146 -22
  121. package/theme.css +112 -0
@@ -0,0 +1,238 @@
1
+ /**
2
+ * Plan — what an agent intends to do, before it does it.
3
+ *
4
+ * A card rather than a run of rows, because a plan is a thing the reader is
5
+ * being asked to approve: it needs an edge around it so that where it starts
6
+ * and stops is not a matter of interpretation, and a footer that can hold the
7
+ * button that approves it.
8
+ *
9
+ * The body is a rail of steps rather than prose, because a plan is an ordered
10
+ * list of things that will happen and the reader's question is always *which
11
+ * one is running*. A paragraph describing the same four steps cannot be glanced
12
+ * at to answer that; a column of markers can. The rail fills behind the steps
13
+ * that are done, so progress is legible from its left edge alone, and
14
+ * `Plan.Steps` counts itself so `Plan.Progress` can say `2 of 4` up in the
15
+ * header without the total being stated twice.
16
+ *
17
+ * It streams. `isStreaming` puts a shimmer on the title, the description and
18
+ * the one step that is running, which is the honest way to render text that is
19
+ * still arriving — the alternative is a title that grows a word at a time and
20
+ * reads as finished at every intermediate length.
21
+ *
22
+ * ```tsx
23
+ * <Plan isStreaming={streaming}>
24
+ * <Plan.Header>
25
+ * <Plan.Icon><FileIcon size={16} /></Plan.Icon>
26
+ * <Plan.Title>Migrate the calendar</Plan.Title>
27
+ * <Plan.Description>Four files, no API change.</Plan.Description>
28
+ * <Plan.Action>
29
+ * <Plan.Progress />
30
+ * <Plan.Trigger />
31
+ * </Plan.Action>
32
+ * </Plan.Header>
33
+ * <Plan.Content>
34
+ * <Plan.Steps>
35
+ * <Plan.Step status="done" meta="utils/date.ts">Read the date utils</Plan.Step>
36
+ * <Plan.Step status="active">Replace the month grid</Plan.Step>
37
+ * <Plan.Step>Update the docs page</Plan.Step>
38
+ * </Plan.Steps>
39
+ * </Plan.Content>
40
+ * <Plan.Footer>
41
+ * <Button variant="outline">Revise</Button>
42
+ * <Button>Approve</Button>
43
+ * </Plan.Footer>
44
+ * </Plan>
45
+ * ```
46
+ *
47
+ * ## Where the props come from
48
+ *
49
+ * With the AI SDK a plan is usually an `experimental_useObject` stream, where
50
+ * `isStreaming` is the hook's `isLoading` and the fields arrive one at a time —
51
+ * which is exactly the case the shimmer exists for, since a partial object has
52
+ * a title before it has anything else.
53
+ */
54
+ import { type ReactNode } from 'react';
55
+ import { type PressableProps, type ViewProps } from 'react-native';
56
+ import { type TextProps } from '../../primitives/text.js';
57
+ export type PlanStepStatus = 'pending' | 'active' | 'done' | 'skipped';
58
+ /** How far down the rail the plan has got. Reported by `Plan.Steps`. */
59
+ export interface PlanStepCounts {
60
+ done: number;
61
+ total: number;
62
+ }
63
+ export interface PlanProps extends Omit<ViewProps, 'children'> {
64
+ className?: string;
65
+ /** Whether the plan is still being written. Shimmers the title and description. */
66
+ isStreaming?: boolean;
67
+ /** Controlled open state of the body. */
68
+ open?: boolean;
69
+ /** Initial state when uncontrolled. */
70
+ defaultOpen?: boolean;
71
+ onOpenChange?: (open: boolean) => void;
72
+ children?: ReactNode;
73
+ }
74
+ declare function PlanRoot({ className, isStreaming, open: openProp, defaultOpen, onOpenChange, children, ...props }: PlanProps): import("react").JSX.Element;
75
+ declare namespace PlanRoot {
76
+ var displayName: string;
77
+ }
78
+ export interface PlanHeaderProps extends ViewProps {
79
+ className?: string;
80
+ children?: ReactNode;
81
+ }
82
+ /**
83
+ * The title, the description and whatever acts on them.
84
+ *
85
+ * The heading is wrapped in a column of its own so the action stays pinned to
86
+ * the trailing edge as the title wraps, rather than riding down with it. An
87
+ * icon is pulled out to the leading edge for the same reason, in the other
88
+ * direction — a badge that rode down with a wrapping title would stop reading
89
+ * as a badge for the plan.
90
+ */
91
+ declare function PlanHeader({ className, children, ...props }: PlanHeaderProps): import("react").JSX.Element;
92
+ declare namespace PlanHeader {
93
+ var displayName: string;
94
+ }
95
+ export interface PlanIconProps extends ViewProps {
96
+ className?: string;
97
+ children?: ReactNode;
98
+ }
99
+ /** A badge on the header's leading edge — what kind of plan this is. */
100
+ declare function PlanIcon({ className, children, ...props }: PlanIconProps): import("react").JSX.Element;
101
+ declare namespace PlanIcon {
102
+ var displayName: string;
103
+ }
104
+ export interface PlanTitleProps extends ViewProps {
105
+ className?: string;
106
+ children?: ReactNode;
107
+ }
108
+ /** The plan's name. Shimmers while it is still being written. */
109
+ declare function PlanTitle({ className, children, ...props }: PlanTitleProps): import("react").JSX.Element;
110
+ declare namespace PlanTitle {
111
+ var displayName: string;
112
+ }
113
+ export interface PlanDescriptionProps extends ViewProps {
114
+ className?: string;
115
+ children?: ReactNode;
116
+ }
117
+ declare function PlanDescription({ className, children, ...props }: PlanDescriptionProps): import("react").JSX.Element;
118
+ declare namespace PlanDescription {
119
+ var displayName: string;
120
+ }
121
+ export interface PlanActionProps extends ViewProps {
122
+ className?: string;
123
+ children?: ReactNode;
124
+ }
125
+ /** Pinned to the header's trailing edge — the toggle, a badge, a menu. */
126
+ declare function PlanAction({ className, children, ...props }: PlanActionProps): import("react").JSX.Element;
127
+ declare namespace PlanAction {
128
+ var displayName: string;
129
+ }
130
+ export interface PlanTriggerProps extends Omit<PressableProps, 'children' | 'style'> {
131
+ className?: string;
132
+ children?: ReactNode;
133
+ }
134
+ /** Folds the body away. Its chevron turns to point at the state it will reach. */
135
+ declare function PlanTrigger({ className, children, onPress, ...props }: PlanTriggerProps): import("react").JSX.Element;
136
+ declare namespace PlanTrigger {
137
+ var displayName: string;
138
+ }
139
+ export interface PlanContentProps extends Omit<ViewProps, 'children'> {
140
+ className?: string;
141
+ children?: ReactNode;
142
+ }
143
+ /** The steps. Collapses rather than unmounting, so it can still be growing. */
144
+ declare function PlanContent({ className, children, ...props }: PlanContentProps): import("react").JSX.Element;
145
+ declare namespace PlanContent {
146
+ var displayName: string;
147
+ }
148
+ export interface PlanStepsProps extends ViewProps {
149
+ className?: string;
150
+ children?: ReactNode;
151
+ }
152
+ /**
153
+ * The rail. A plan is an ordered list of things that will happen, and this is
154
+ * the list — a paragraph describing the same four steps cannot be glanced at to
155
+ * see which one is running.
156
+ *
157
+ * It counts its own steps and reports the count up, which is what lets
158
+ * `Plan.Progress` sit in the header without the caller stating the total twice.
159
+ */
160
+ declare function PlanSteps({ className, children, ...props }: PlanStepsProps): import("react").JSX.Element;
161
+ declare namespace PlanSteps {
162
+ var displayName: string;
163
+ }
164
+ export interface PlanStepProps extends Omit<ViewProps, 'children'> {
165
+ className?: string;
166
+ /** How far this step has got. Decides the marker, the title and the rail below it. */
167
+ status?: PlanStepStatus;
168
+ /** A line under the title — what the step will touch, or what it found. */
169
+ description?: ReactNode;
170
+ /** A file path, a count, a duration. Rendered as a small mono chip. */
171
+ meta?: ReactNode;
172
+ /** Drop the connector below this step. `Plan.Steps` sets it for you. */
173
+ last?: boolean;
174
+ children?: ReactNode;
175
+ }
176
+ /**
177
+ * One step. The marker says which of the four states it is in and the rail
178
+ * below it is filled once it is done, so the plan's progress is legible from
179
+ * the shape of the left-hand column alone.
180
+ */
181
+ declare function PlanStep({ className, status, description, meta, last, children, ...props }: PlanStepProps): import("react").JSX.Element;
182
+ declare namespace PlanStep {
183
+ var displayName: string;
184
+ }
185
+ export interface PlanProgressProps extends TextProps {
186
+ className?: string;
187
+ /** Steps settled so far. Defaults to what `Plan.Steps` counted. */
188
+ value?: number;
189
+ /** Steps in total. Defaults to what `Plan.Steps` counted. */
190
+ total?: number;
191
+ }
192
+ /**
193
+ * How far down the rail the plan has got, as `2 of 4`. Renders nothing until
194
+ * there is a rail to count — a plan with no steps has no progress to report,
195
+ * and `0 of 0` is worse than silence.
196
+ */
197
+ declare function PlanProgress({ className, value, total, ...props }: PlanProgressProps): import("react").JSX.Element | null;
198
+ declare namespace PlanProgress {
199
+ var displayName: string;
200
+ }
201
+ export interface PlanFooterProps extends ViewProps {
202
+ className?: string;
203
+ /**
204
+ * How the actions divide the row. `stretch` splits it between them, which is
205
+ * what a phone wants: the decision is the point of the card, and the two
206
+ * buttons that make it should be the width of a thumb. `end` packs them
207
+ * against the trailing edge for a plan sitting inside something denser.
208
+ */
209
+ layout?: 'stretch' | 'end';
210
+ children?: ReactNode;
211
+ }
212
+ /**
213
+ * Where the buttons that answer the plan go.
214
+ *
215
+ * Each action takes an equal share of the row by default. A pair of small
216
+ * buttons hugging the trailing corner is a pointer-and-cursor shape; on a phone
217
+ * the answer to "shall I do this" is the most important control on the screen
218
+ * and wants to be hit without aiming.
219
+ */
220
+ declare function PlanFooter({ className, layout, children, ...props }: PlanFooterProps): import("react").JSX.Element;
221
+ declare namespace PlanFooter {
222
+ var displayName: string;
223
+ }
224
+ export declare const Plan: typeof PlanRoot & {
225
+ Header: typeof PlanHeader;
226
+ Icon: typeof PlanIcon;
227
+ Title: typeof PlanTitle;
228
+ Description: typeof PlanDescription;
229
+ Action: typeof PlanAction;
230
+ Progress: typeof PlanProgress;
231
+ Trigger: typeof PlanTrigger;
232
+ Content: typeof PlanContent;
233
+ Steps: typeof PlanSteps;
234
+ Step: typeof PlanStep;
235
+ Footer: typeof PlanFooter;
236
+ };
237
+ export {};
238
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/plan/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAWpF,OAAO,EAAsB,KAAK,SAAS,EAAE,MAA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AAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,MAAkB,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,+BAiBzF;kBAjBQ,UAAU;;;AA+BnB,eAAO,MAAM,IAAI;;;;;;;;;;;;CAYf,CAAC"}
@@ -85,6 +85,40 @@ export interface PopoverContentProps extends ViewProps {
85
85
  * content into a column.
86
86
  */
87
87
  minWidth?: number;
88
+ /**
89
+ * Ceiling for the panel's height, in pixels. Always clamped to the room
90
+ * inside the safe area, which is also the default — a panel is never
91
+ * positioned so that part of it falls off the screen, because the part that
92
+ * falls off cannot be scrolled back into view.
93
+ */
94
+ maxHeight?: number;
95
+ /**
96
+ * Scroll the panel's body when it is taller than `maxHeight`.
97
+ *
98
+ * Off by default, because a popover is usually a paragraph or a short form
99
+ * and a scroller around either one only adds a bounce. Worth turning on for
100
+ * a list of unknown length, which is the case where the cap actually bites.
101
+ *
102
+ * The spacing between children moves to the scroller's content when this is
103
+ * set; `className` still dresses the panel itself.
104
+ */
105
+ scrollable?: boolean;
106
+ /**
107
+ * Drop the panel's own surface — its background, border, radius, padding and
108
+ * shadow — and keep only its position and its size. For a caller that draws
109
+ * the surface itself, so that something can be put *behind* the content
110
+ * rather than layered on top of a background that is already painted.
111
+ *
112
+ * The panel is still clipped to a rounded rectangle, because a surface drawn
113
+ * inside it has to have something to be clipped by.
114
+ */
115
+ unstyled?: boolean;
116
+ /**
117
+ * A layer drawn inside the panel, behind its content — and, crucially,
118
+ * outside its scroller, so that a surface does not scroll away with the rows
119
+ * on top of it. Pair it with `unstyled` to own the panel's appearance.
120
+ */
121
+ background?: ReactNode;
88
122
  /** Tap outside the panel closes it. Default true. */
89
123
  dismissible?: boolean;
90
124
  /**
@@ -95,7 +129,7 @@ export interface PopoverContentProps extends ViewProps {
95
129
  blur?: boolean;
96
130
  children?: ReactNode;
97
131
  }
98
- declare function PopoverContent({ className, placement, align, offset, alignOffset, width, minWidth, dismissible, blur, children, onLayout: onLayoutProp, style, ...props }: PopoverContentProps): import("react").JSX.Element | null;
132
+ declare function PopoverContent({ className, placement, align, offset, alignOffset, width, minWidth, maxHeight, scrollable, unstyled, background, dismissible, blur, children, onLayout: onLayoutProp, style, ...props }: PopoverContentProps): import("react").JSX.Element | null;
99
133
  export interface PopoverArrowProps extends ViewProps {
100
134
  className?: string;
101
135
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAUL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AActB,OAAO,EAAQ,KAAK,SAAS,EAAgB,MAAM,0BAAuB,CAAC;AAU3E,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAwBtD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,cAAc,CAAC;AAY7D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AAED,iBAAS,WAAW,CAAC,EACnB,QAAQ,EACR,IAAI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EACf,KAAqB,EACrB,QAAQ,EACR,SAAS,EACT,UAAkB,EAClB,QAAgB,EAChB,UAAU,EACV,WAAkB,EAClB,IAAY,EACZ,QAAQ,EACR,QAAQ,EAAE,YAAY,EACtB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,mBAAmB,sCAoOrB;AAED,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,sCA2CtE;AAiBD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAC;QAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,uDAAuD;AACvD,iBAAS,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB;cAJhB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI;wDAchE;AA2GD,eAAO,MAAM,OAAO;;;;;kCAzI2B,SAAS;;;;kCAUH,SAAS;;;;CAsI5D,CAAC"}
@@ -0,0 +1,358 @@
1
+ /**
2
+ * Post — a card carrying something somebody said, and what everyone did about it.
3
+ *
4
+ * Four shapes, because a feed is not one thing. `feed` is the full card: author,
5
+ * body, media and a row of counts. `vote` puts a score pill beside a headline
6
+ * and a thumbnail, the way a ranked community reads. `compact` drops the media
7
+ * and puts the name and handle on one line, for a dense timeline. `media` gives
8
+ * the image the whole card and lays the author over it.
9
+ *
10
+ * What they share is the anatomy — the same `Post.Header`, `Post.Body`,
11
+ * `Post.Footer` in every one — so moving between them is a prop rather than a
12
+ * rewrite. The variant decides padding, media shape and where the author sits;
13
+ * it does not decide which parts exist.
14
+ *
15
+ * ```tsx
16
+ * <Post variant="feed">
17
+ * <Post.Header>
18
+ * <Post.Author name="Dwayne F. White" verified timestamp="3m ago" avatar={face} />
19
+ * <Post.Action><EllipsisIcon /></Post.Action>
20
+ * </Post.Header>
21
+ * <Post.Body>I've been paying off my credit card #FinancialFreedom</Post.Body>
22
+ * <Post.Media source={photo} />
23
+ * <Post.Footer>
24
+ * <Post.Stat icon={EyeIcon} value="5,874" />
25
+ * <Post.Stat icon={HeartIcon} value="215" tone="like" />
26
+ * <Post.Stat icon={MessageCircleIcon} value="11" />
27
+ * <Post.Stat icon={BookmarkIcon} value="Save" align="end" />
28
+ * </Post.Footer>
29
+ * </Post>
30
+ * ```
31
+ *
32
+ * ## Counts change under the finger
33
+ *
34
+ * Every control here is a toggle over a number, and the number is the point: a
35
+ * like that lights up but leaves `215` sitting there has not told you it
36
+ * counted. So a stat that changes animates the old value out and the new one in
37
+ * along the direction of the change, and `Post.Votes` does the same with its
38
+ * arrows. The alternative — repainting the digits in place — is indisting-
39
+ * uishable from a re-render, which is exactly the doubt the animation exists to
40
+ * remove.
41
+ */
42
+ import { type ComponentType, type ReactNode } from 'react';
43
+ import { View, type ImageSourcePropType, type PressableProps, type ViewProps } from 'react-native';
44
+ import { type VariantProps } from 'tailwind-variants';
45
+ import { type IconProps } from '../../icons/index.js';
46
+ declare const postVariants: import("tailwind-variants").TVReturnType<{
47
+ variant: {
48
+ /** The full card — author, body, media, counts. */
49
+ feed: {
50
+ header: string;
51
+ body: string;
52
+ media: string;
53
+ footer: string;
54
+ };
55
+ /** A headline with a score beside it, the way a ranked community reads. */
56
+ vote: {
57
+ header: string;
58
+ body: string;
59
+ media: string;
60
+ footer: string;
61
+ };
62
+ /** No media, name and handle on one line — for a dense timeline. */
63
+ compact: {
64
+ root: string;
65
+ header: string;
66
+ body: string;
67
+ media: string;
68
+ footer: string;
69
+ };
70
+ /** The image is the card; the author is laid over it. */
71
+ media: {
72
+ header: string;
73
+ body: string;
74
+ media: string;
75
+ footer: string;
76
+ };
77
+ };
78
+ size: {
79
+ default: {};
80
+ sm: {
81
+ name: string;
82
+ meta: string;
83
+ statLabel: string;
84
+ };
85
+ };
86
+ }, {
87
+ root: string;
88
+ header: string;
89
+ author: string;
90
+ authorLine: string;
91
+ name: string;
92
+ handle: string;
93
+ meta: string;
94
+ action: string;
95
+ community: string;
96
+ communityName: string;
97
+ communityMeta: string;
98
+ title: string;
99
+ body: string;
100
+ media: string;
101
+ footer: string;
102
+ stat: string;
103
+ statLabel: string;
104
+ votes: string;
105
+ voteButton: string;
106
+ voteScore: string;
107
+ }, undefined, {
108
+ variant: {
109
+ /** The full card — author, body, media, counts. */
110
+ feed: {
111
+ header: string;
112
+ body: string;
113
+ media: string;
114
+ footer: string;
115
+ };
116
+ /** A headline with a score beside it, the way a ranked community reads. */
117
+ vote: {
118
+ header: string;
119
+ body: string;
120
+ media: string;
121
+ footer: string;
122
+ };
123
+ /** No media, name and handle on one line — for a dense timeline. */
124
+ compact: {
125
+ root: string;
126
+ header: string;
127
+ body: string;
128
+ media: string;
129
+ footer: string;
130
+ };
131
+ /** The image is the card; the author is laid over it. */
132
+ media: {
133
+ header: string;
134
+ body: string;
135
+ media: string;
136
+ footer: string;
137
+ };
138
+ };
139
+ size: {
140
+ default: {};
141
+ sm: {
142
+ name: string;
143
+ meta: string;
144
+ statLabel: string;
145
+ };
146
+ };
147
+ }, {
148
+ root: string;
149
+ header: string;
150
+ author: string;
151
+ authorLine: string;
152
+ name: string;
153
+ handle: string;
154
+ meta: string;
155
+ action: string;
156
+ community: string;
157
+ communityName: string;
158
+ communityMeta: string;
159
+ title: string;
160
+ body: string;
161
+ media: string;
162
+ footer: string;
163
+ stat: string;
164
+ statLabel: string;
165
+ votes: string;
166
+ voteButton: string;
167
+ voteScore: string;
168
+ }, import("tailwind-variants").TVReturnType<{
169
+ variant: {
170
+ /** The full card — author, body, media, counts. */
171
+ feed: {
172
+ header: string;
173
+ body: string;
174
+ media: string;
175
+ footer: string;
176
+ };
177
+ /** A headline with a score beside it, the way a ranked community reads. */
178
+ vote: {
179
+ header: string;
180
+ body: string;
181
+ media: string;
182
+ footer: string;
183
+ };
184
+ /** No media, name and handle on one line — for a dense timeline. */
185
+ compact: {
186
+ root: string;
187
+ header: string;
188
+ body: string;
189
+ media: string;
190
+ footer: string;
191
+ };
192
+ /** The image is the card; the author is laid over it. */
193
+ media: {
194
+ header: string;
195
+ body: string;
196
+ media: string;
197
+ footer: string;
198
+ };
199
+ };
200
+ size: {
201
+ default: {};
202
+ sm: {
203
+ name: string;
204
+ meta: string;
205
+ statLabel: string;
206
+ };
207
+ };
208
+ }, {
209
+ root: string;
210
+ header: string;
211
+ author: string;
212
+ authorLine: string;
213
+ name: string;
214
+ handle: string;
215
+ meta: string;
216
+ action: string;
217
+ community: string;
218
+ communityName: string;
219
+ communityMeta: string;
220
+ title: string;
221
+ body: string;
222
+ media: string;
223
+ footer: string;
224
+ stat: string;
225
+ statLabel: string;
226
+ votes: string;
227
+ voteButton: string;
228
+ voteScore: string;
229
+ }, undefined, unknown, unknown, undefined>>;
230
+ type PostVariant = 'feed' | 'vote' | 'compact' | 'media';
231
+ export interface PostProps extends Omit<ViewProps, 'children'>, VariantProps<typeof postVariants> {
232
+ className?: string;
233
+ /** Which of the four shapes. */
234
+ variant?: PostVariant;
235
+ /** `sm` tightens the type for a card in a sidebar or a preview. */
236
+ size?: 'default' | 'sm';
237
+ /** Opening the post itself. The parts inside keep their own presses. */
238
+ onPress?: PressableProps['onPress'];
239
+ children?: ReactNode;
240
+ }
241
+ export interface PostHeaderProps extends ViewProps {
242
+ className?: string;
243
+ children?: ReactNode;
244
+ }
245
+ export interface PostAuthorProps extends Omit<ViewProps, 'children'> {
246
+ className?: string;
247
+ /** Display name. */
248
+ name: string;
249
+ /** `@handle`, shown beside the name in `compact` and under it elsewhere. */
250
+ handle?: string;
251
+ avatar?: ImageSourcePropType;
252
+ /** Initials behind a missing or broken avatar. */
253
+ fallback?: string;
254
+ /** Draws the verification rosette after the name. */
255
+ verified?: boolean;
256
+ /** "Posted 3m ago" — whatever the caller wants to call the time. */
257
+ timestamp?: ReactNode;
258
+ children?: ReactNode;
259
+ }
260
+ export interface PostActionProps extends ViewProps {
261
+ className?: string;
262
+ children?: ReactNode;
263
+ }
264
+ export interface PostCommunityProps extends Omit<ViewProps, 'children'> {
265
+ className?: string;
266
+ /** The group's name — "r/reactnative", "#design". */
267
+ name: string;
268
+ avatar?: ImageSourcePropType;
269
+ /** How long ago, and anything else that belongs on the line. */
270
+ meta?: ReactNode;
271
+ children?: ReactNode;
272
+ }
273
+ export interface PostTitleProps extends ViewProps {
274
+ className?: string;
275
+ children?: ReactNode;
276
+ }
277
+ export interface PostBodyProps extends Omit<ViewProps, 'children'> {
278
+ className?: string;
279
+ /** How many lines before it is cut off. Unlimited by default. */
280
+ numberOfLines?: number;
281
+ /** Called with the tag, without its `#`. Makes hashtags pressable. */
282
+ onTagPress?: (tag: string) => void;
283
+ /** Called with the handle, without its `@`. */
284
+ onMentionPress?: (handle: string) => void;
285
+ children?: ReactNode;
286
+ }
287
+ export interface PostMediaProps extends Omit<ViewProps, 'children'> {
288
+ className?: string;
289
+ source: ImageSourcePropType;
290
+ /** Width over height. `16 / 10` by default — wide enough not to eat the feed. */
291
+ aspectRatio?: number;
292
+ /**
293
+ * Darkens an edge of the image so type laid over it stays legible.
294
+ *
295
+ * A gradient rather than a panel: a flat rectangle over the top of a
296
+ * photograph has an edge of its own, and that edge reads as a bar covering
297
+ * the picture rather than as shading. `media` posts default to `top`, where
298
+ * the author sits; everything else to `none`.
299
+ */
300
+ scrim?: 'none' | 'top' | 'bottom' | 'both';
301
+ /** Laid over the image: an expand affordance, a duration, a gallery count. */
302
+ overlay?: ReactNode;
303
+ /** Described for a screen reader. An image with nothing to say is decorative. */
304
+ alt?: string;
305
+ onPress?: PressableProps['onPress'];
306
+ children?: ReactNode;
307
+ }
308
+ export interface PostFooterProps extends ViewProps {
309
+ className?: string;
310
+ children?: ReactNode;
311
+ }
312
+ export interface PostStatProps extends Omit<PressableProps, 'children' | 'style'> {
313
+ className?: string;
314
+ /** The icon component itself, not an element — it is re-rendered on toggle. */
315
+ icon?: ComponentType<IconProps & {
316
+ filled?: boolean;
317
+ }>;
318
+ /** The number, or a word where a number would be meaningless ("Save"). */
319
+ value?: ReactNode;
320
+ /** Lit, and filled. */
321
+ active?: boolean;
322
+ /** Which colour "lit" is. */
323
+ tone?: 'default' | 'like' | 'save' | 'repost';
324
+ /** Pushes this stat and everything after it to the trailing edge. */
325
+ align?: 'start' | 'end';
326
+ children?: ReactNode;
327
+ }
328
+ export type PostVote = 'up' | 'down' | null;
329
+ export interface PostVotesProps extends Omit<ViewProps, 'children'> {
330
+ className?: string;
331
+ /** The score as it stands, with the reader's own vote already in it. */
332
+ score: number | string;
333
+ /** Which way this reader voted, if either. */
334
+ vote?: PostVote;
335
+ /**
336
+ * Called with the new vote. Pressing the arrow already cast clears it, so
337
+ * `null` arrives as often as the other two — a vote you cannot take back is
338
+ * a vote people hesitate over.
339
+ */
340
+ onVote?: (vote: PostVote) => void;
341
+ /** `vertical` stacks the arrows beside a thumbnail, the way a ranked list reads. */
342
+ orientation?: 'horizontal' | 'vertical';
343
+ disabled?: boolean;
344
+ }
345
+ export declare const Post: import("react").ForwardRefExoticComponent<PostProps & import("react").RefAttributes<View>> & {
346
+ Header: import("react").ForwardRefExoticComponent<PostHeaderProps & import("react").RefAttributes<View>>;
347
+ Author: import("react").ForwardRefExoticComponent<PostAuthorProps & import("react").RefAttributes<View>>;
348
+ Action: import("react").ForwardRefExoticComponent<PostActionProps & import("react").RefAttributes<View>>;
349
+ Community: import("react").ForwardRefExoticComponent<PostCommunityProps & import("react").RefAttributes<View>>;
350
+ Title: import("react").ForwardRefExoticComponent<PostTitleProps & import("react").RefAttributes<View>>;
351
+ Body: import("react").ForwardRefExoticComponent<PostBodyProps & import("react").RefAttributes<View>>;
352
+ Media: import("react").ForwardRefExoticComponent<PostMediaProps & import("react").RefAttributes<View>>;
353
+ Footer: import("react").ForwardRefExoticComponent<PostFooterProps & import("react").RefAttributes<View>>;
354
+ Stat: import("react").ForwardRefExoticComponent<PostStatProps & import("react").RefAttributes<View>>;
355
+ Votes: import("react").ForwardRefExoticComponent<PostVotesProps & import("react").RefAttributes<View>>;
356
+ };
357
+ export {};
358
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/post/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,IAAI,EACJ,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AActB,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,sBAAa,CAAC;AAcrB,QAAA,MAAM,YAAY;;QA+BZ,mDAAmD;;;;;;;QAOnD,2EAA2E;;;;;;;QAO3E,oEAAoE;;;;;;;;QAQpE,yDAAyD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAtBzD,mDAAmD;;;;;;;QAOnD,2EAA2E;;;;;;;QAO3E,oEAAoE;;;;;;;;QAQpE,yDAAyD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAtBzD,mDAAmD;;;;;;;QAOnD,2EAA2E;;;;;;;QAO3E,oEAAoE;;;;;;;;QAQpE,yDAAyD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAiB7D,CAAC;AAEH,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAWzD,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EACjC,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,SAAS,CAAC,EAAE,MA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