@nebutra/ui 0.2.2 → 2.0.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 (43) hide show
  1. package/dist/animate-in-BlvjVh2S.d.ts +250 -0
  2. package/dist/{canonical-CrO71UPO.d.ts → canonical-Bf4czR2u.d.ts} +225 -211
  3. package/dist/chat/index.d.ts +1 -0
  4. package/dist/chat/index.js +3 -0
  5. package/dist/chat/index.js.map +1 -0
  6. package/dist/components/index.d.ts +58 -123
  7. package/dist/components/index.js +504 -203
  8. package/dist/components/index.js.map +1 -1
  9. package/dist/editorial/index.d.ts +404 -0
  10. package/dist/editorial/index.js +868 -0
  11. package/dist/editorial/index.js.map +1 -0
  12. package/dist/icons/index.d.ts +1 -0
  13. package/dist/layout/index.d.ts +2 -2
  14. package/dist/layout/index.js +116 -26
  15. package/dist/layout/index.js.map +1 -1
  16. package/dist/layouts/index.d.ts +80 -2
  17. package/dist/layouts/index.js +13 -11
  18. package/dist/layouts/index.js.map +1 -1
  19. package/dist/patterns/index.d.ts +4 -5
  20. package/dist/patterns/index.js +221 -106
  21. package/dist/patterns/index.js.map +1 -1
  22. package/dist/primitives/canonical.d.ts +4 -3
  23. package/dist/primitives/canonical.js +609 -197
  24. package/dist/primitives/canonical.js.map +1 -1
  25. package/dist/primitives/index.d.ts +213 -21
  26. package/dist/primitives/index.js +2209 -1317
  27. package/dist/primitives/index.js.map +1 -1
  28. package/dist/tailwind.preset.d.ts +2 -2
  29. package/dist/tailwind.preset.js +1 -1
  30. package/dist/tailwind.preset.js.map +1 -1
  31. package/dist/typography/fonts.css +21 -26
  32. package/dist/typography/index.d.ts +4 -4
  33. package/dist/typography/index.js +1 -1
  34. package/dist/typography/index.js.map +1 -1
  35. package/dist/utils/auth-surfaces.d.ts +33 -0
  36. package/dist/utils/auth-surfaces.js +9 -0
  37. package/dist/utils/auth-surfaces.js.map +1 -0
  38. package/dist/utils/index.d.ts +33 -5
  39. package/dist/utils/index.js +15 -3
  40. package/dist/utils/index.js.map +1 -1
  41. package/package.json +43 -9
  42. package/src/styles/sources.css +10 -0
  43. package/src/typography/fonts.css +21 -26
@@ -0,0 +1,404 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, CSSProperties } from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+
5
+ type EditorialAuthorLink = {
6
+ href: string;
7
+ key?: string;
8
+ label: string;
9
+ };
10
+ type EditorialAuthorBioProps = {
11
+ /** Avatar slot. Apps pass their own image component so this stays framework-free. */
12
+ avatar?: ReactNode;
13
+ bio?: string | null;
14
+ className?: string;
15
+ label?: string;
16
+ links?: EditorialAuthorLink[];
17
+ name: string;
18
+ role?: string | null;
19
+ };
20
+ /** Byline card closing an article. */
21
+ declare function EditorialAuthorBio({ avatar, bio, className, label, links, name, role, }: EditorialAuthorBioProps): react_jsx_runtime.JSX.Element | null;
22
+
23
+ /**
24
+ * Shared visual grammar for long-form editorial blocks.
25
+ *
26
+ * Every block in this directory composes these recipes instead of hand-picking
27
+ * borders, radii and shadows, so a change to the editorial voice is one edit
28
+ * here rather than fifteen edits across the renderer.
29
+ *
30
+ * The grammar is hairline-first: separation comes from a 1px border plus the
31
+ * ambient elevation ramp, never from a filled colour panel. Tone is carried by
32
+ * a 2px rail and an icon, so a page of stacked blocks still reads as one
33
+ * document rather than a row of coloured cards.
34
+ */
35
+ /** Uppercase micro-label that opens a block. Not part of the registered type scale. */
36
+ declare const EDITORIAL_EYEBROW = "text-[0.6875rem] font-semibold uppercase leading-none tracking-[0.14em] text-muted-foreground";
37
+ /** Caption / footnote text under a figure, table or chart. */
38
+ declare const EDITORIAL_CAPTION = "text-sm leading-6 text-muted-foreground";
39
+ /** Body copy inside a block. One step tighter than article prose. */
40
+ declare const EDITORIAL_BODY = "text-[0.9375rem] leading-7 text-muted-foreground";
41
+ /** Block title. Sits below an article h3 so it never competes with the outline. */
42
+ declare const EDITORIAL_TITLE = "text-base font-semibold leading-6 text-foreground";
43
+ /**
44
+ * Figures are numeric, so they take tabular lining figures — otherwise a column
45
+ * of stats visually ragged-rights itself as digit widths change.
46
+ */
47
+ declare const EDITORIAL_FIGURE = "font-mono font-semibold tabular-nums text-foreground";
48
+ /**
49
+ * Article body is a ~3xl reading column. Blocks that carry a grid, a table or a
50
+ * chart earn width by breaking out of it; prose-adjacent blocks stay inline so
51
+ * the measure is preserved.
52
+ */
53
+ declare const editorialBlock: (props?: ({
54
+ width?: "column" | "breakout" | "full" | null | undefined;
55
+ spacing?: "none" | "tight" | "normal" | "loose" | null | undefined;
56
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
57
+ /**
58
+ * Surface recipe. `resting` is the default for a card in flow; `raised` is for
59
+ * the one block in a set that should read as emphasised, not for every card.
60
+ */
61
+ declare const editorialFrame: (props?: ({
62
+ radius?: "card" | "panel" | "inner" | null | undefined;
63
+ elevation?: "flat" | "resting" | "raised" | null | undefined;
64
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
65
+ declare const EDITORIAL_TONES: readonly ["note", "insight", "success", "warning", "danger"];
66
+ type EditorialTone = (typeof EDITORIAL_TONES)[number];
67
+ declare function editorialToneAccent(tone: EditorialTone): string;
68
+ declare function isEditorialTone(value: unknown): value is EditorialTone;
69
+ /**
70
+ * Inline custom property consumed by the tone-aware utility classes below.
71
+ * `--editorial-tone` is a private name: shadowing a core token such as
72
+ * `--primary` on an element would leak into the whole subtree.
73
+ */
74
+ declare function editorialToneStyle(tone: EditorialTone): CSSProperties;
75
+ /** Foreground for icons and rails. */
76
+ declare const EDITORIAL_TONE_FG = "text-[color:var(--editorial-tone)]";
77
+ /** 5% wash — enough to register as tinted, not enough to read as a coloured block. */
78
+ declare const EDITORIAL_TONE_WASH = "bg-[color-mix(in_srgb,var(--editorial-tone)_5%,transparent)]";
79
+ /** 12% plate behind an icon. */
80
+ declare const EDITORIAL_TONE_PLATE = "bg-[color-mix(in_srgb,var(--editorial-tone)_12%,transparent)]";
81
+
82
+ type EditorialCalloutProps = {
83
+ /** Body copy. A string is wrapped in a paragraph; nodes are rendered as given. */
84
+ children?: ReactNode;
85
+ className?: string;
86
+ /** Shown in the eyebrow slot when there is no title — pass a localized word. */
87
+ label?: string;
88
+ title?: string | null;
89
+ tone?: EditorialTone;
90
+ };
91
+ /**
92
+ * Aside for a note, insight, caution or correction.
93
+ *
94
+ * Tone is a 2px rail plus a tinted icon plate, not a filled panel: a reader
95
+ * scrolling past four callouts should see four asides, not four highlighter
96
+ * swipes.
97
+ */
98
+ declare function EditorialCallout({ children, className, label, title, tone, }: EditorialCalloutProps): react_jsx_runtime.JSX.Element | null;
99
+
100
+ type EditorialChartPoint = {
101
+ /** Optional per-point display string. Falls back to the raw value. */
102
+ display?: string | null;
103
+ key?: string;
104
+ label: string;
105
+ value: number;
106
+ };
107
+ type EditorialChartProps = {
108
+ caption?: string | null;
109
+ className?: string;
110
+ label?: string;
111
+ points: EditorialChartPoint[];
112
+ title?: string | null;
113
+ variant?: "bar" | "line";
114
+ };
115
+ /**
116
+ * Small inline data figure.
117
+ *
118
+ * Values are also emitted as a visually hidden table, so the chart is readable
119
+ * without sight of the bars and copyable as data rather than as an image.
120
+ */
121
+ declare function EditorialChart({ caption, className, label, points, title, variant, }: EditorialChartProps): react_jsx_runtime.JSX.Element | null;
122
+
123
+ type EditorialComparisonRow = {
124
+ cells: string[];
125
+ key?: string;
126
+ label: string;
127
+ };
128
+ type EditorialComparisonTableProps = {
129
+ className?: string;
130
+ columns: string[];
131
+ /**
132
+ * Header for the row-label column. Localize it — leaving this to a hardcoded
133
+ * English default is how "Dimension" ended up in Chinese articles.
134
+ */
135
+ dimensionLabel?: string;
136
+ label?: string;
137
+ rows: EditorialComparisonRow[];
138
+ title?: string | null;
139
+ };
140
+ /**
141
+ * Matrix comparing options across dimensions.
142
+ *
143
+ * Below `md` the table restacks into one block per row and each cell carries
144
+ * its own column label, so the reader never has to drag a table sideways on a
145
+ * phone to find out which column a value belonged to.
146
+ */
147
+ declare function EditorialComparisonTable({ className, columns, dimensionLabel, label, rows, title, }: EditorialComparisonTableProps): react_jsx_runtime.JSX.Element | null;
148
+
149
+ type EditorialDataTableRow = {
150
+ cells: ReactNode[];
151
+ key: string;
152
+ };
153
+ type EditorialDataTableProps = {
154
+ caption?: ReactNode;
155
+ className?: string;
156
+ head: ReactNode[];
157
+ rows: EditorialDataTableRow[];
158
+ };
159
+ /**
160
+ * Table rendered from author-written markup, where cells carry links, code and
161
+ * inline math rather than plain strings.
162
+ *
163
+ * Cells are `ReactNode`, so unlike `EditorialComparisonTable` this cannot
164
+ * restack into labelled blocks on small screens — it scrolls instead, inside a
165
+ * framed container that makes the clipped edge obvious.
166
+ */
167
+ declare function EditorialDataTable({ caption, className, head, rows }: EditorialDataTableProps): react_jsx_runtime.JSX.Element | null;
168
+
169
+ type EditorialDividerProps = {
170
+ className?: string;
171
+ };
172
+ /**
173
+ * Section break inside an article.
174
+ *
175
+ * Marks a change of movement, not a new heading — an `<hr>` with a centred
176
+ * marker rather than a rule that would read as the end of the piece.
177
+ */
178
+ declare function EditorialDivider({ className }: EditorialDividerProps): react_jsx_runtime.JSX.Element;
179
+
180
+ declare const EDITORIAL_EMBED_PROVIDERS: readonly ["youtube", "x", "github", "website"];
181
+ type EditorialEmbedProvider = (typeof EDITORIAL_EMBED_PROVIDERS)[number];
182
+ type EditorialEmbedCardProps = {
183
+ caption?: string | null;
184
+ className?: string;
185
+ provider?: EditorialEmbedProvider;
186
+ title: string;
187
+ url: string;
188
+ };
189
+ declare function isEditorialEmbedProvider(value: unknown): value is EditorialEmbedProvider;
190
+ /**
191
+ * Link-out card for third-party media.
192
+ *
193
+ * Deliberately not an iframe: an embedded player ships the provider's scripts
194
+ * and cookies into the article and moves the layout around while it loads. The
195
+ * card states the provider, keeps the destination visible, and leaves the
196
+ * decision to the reader.
197
+ */
198
+ declare function EditorialEmbedCard({ caption, className, provider, title, url, }: EditorialEmbedCardProps): react_jsx_runtime.JSX.Element | null;
199
+
200
+ type EditorialEntityChipProps = {
201
+ className?: string;
202
+ href?: string | null;
203
+ /** Logo slot. Apps pass their own image component so this stays framework-free. */
204
+ logo?: ReactNode;
205
+ name: string;
206
+ };
207
+ /**
208
+ * Inline reference to a company, product or project.
209
+ *
210
+ * Sized to sit inside a sentence without changing its line height, which is
211
+ * why the logo plate is `1em` rather than a fixed pixel size.
212
+ */
213
+ declare function EditorialEntityChip({ className, href, logo, name }: EditorialEntityChipProps): react_jsx_runtime.JSX.Element | null;
214
+
215
+ type EditorialFaqItem = {
216
+ answer: string;
217
+ key?: string;
218
+ question: string;
219
+ };
220
+ type EditorialFaqProps = {
221
+ className?: string;
222
+ /** Open the first entry on load, for a short list where the answer is the point. */
223
+ defaultOpenFirst?: boolean;
224
+ items: EditorialFaqItem[];
225
+ label?: string;
226
+ title?: string | null;
227
+ };
228
+ /**
229
+ * Collapsible question list.
230
+ *
231
+ * Built on native `<details>` rather than a JS disclosure: it costs no client
232
+ * bundle, works before hydration, is keyboard-operable for free, and lets
233
+ * in-page find surface answers inside collapsed entries.
234
+ */
235
+ declare function EditorialFaq({ className, defaultOpenFirst, items, label, title, }: EditorialFaqProps): react_jsx_runtime.JSX.Element | null;
236
+
237
+ type EditorialFigureProps = {
238
+ caption?: ReactNode;
239
+ className?: string;
240
+ /**
241
+ * Image slot. Apps pass their own image component — keeping `next/image` out
242
+ * of this package is what lets it render in Storybook and non-Next surfaces.
243
+ */
244
+ media: ReactNode;
245
+ width?: "column" | "breakout" | "full";
246
+ };
247
+ /** Single image with an optional caption. */
248
+ declare function EditorialFigure({ caption, className, media, width, }: EditorialFigureProps): react_jsx_runtime.JSX.Element;
249
+ type EditorialFigureGroupProps = {
250
+ className?: string;
251
+ /** Rendered figures. Two or three read best; more should become a gallery. */
252
+ children: ReactNode;
253
+ label?: string;
254
+ title?: string | null;
255
+ variant?: "grid" | "comparison" | "sequence";
256
+ };
257
+ /** Set of related figures shown together. */
258
+ declare function EditorialFigureGroup({ children, className, label, title, variant, }: EditorialFigureGroupProps): react_jsx_runtime.JSX.Element;
259
+
260
+ type EditorialKeyTakeawayItem = {
261
+ key?: string;
262
+ text: string;
263
+ };
264
+ type EditorialKeyTakeawaysProps = {
265
+ className?: string;
266
+ items: EditorialKeyTakeawayItem[];
267
+ /** Eyebrow copy. Pass a localized string; the default is English. */
268
+ label?: string;
269
+ title?: string | null;
270
+ };
271
+ /**
272
+ * The summary panel that opens a long piece.
273
+ *
274
+ * Numbering is a hairline-separated ordered list rather than bullets or cards —
275
+ * the point is that a reader can take four lines and leave, so nothing should
276
+ * compete with the lines themselves.
277
+ */
278
+ declare function EditorialKeyTakeaways({ className, items, label, title, }: EditorialKeyTakeawaysProps): react_jsx_runtime.JSX.Element | null;
279
+
280
+ type EditorialMarginNoteProps = {
281
+ children?: string | null;
282
+ className?: string;
283
+ label?: string;
284
+ title?: string | null;
285
+ };
286
+ /**
287
+ * Short aside that steps out into the right margin on wide screens.
288
+ *
289
+ * Below `xl` there is no margin to step into, so it degrades to an indented
290
+ * inline note rather than a floated box that would strand a two-word orphan
291
+ * beside it.
292
+ */
293
+ declare function EditorialMarginNote({ children, className, label, title, }: EditorialMarginNoteProps): react_jsx_runtime.JSX.Element | null;
294
+
295
+ type EditorialPullQuoteProps = {
296
+ /** Name of the speaker or the work being quoted. */
297
+ attribution?: string | null;
298
+ className?: string;
299
+ /** Portrait slot. Apps pass their own image component so this stays framework-free. */
300
+ portrait?: ReactNode;
301
+ quote: string;
302
+ /** Title, company or context under the attribution. */
303
+ role?: string | null;
304
+ sourceHref?: string | null;
305
+ };
306
+ /**
307
+ * Display quote lifted out of the reading column.
308
+ *
309
+ * There is no oversized quotation glyph: at this size the type itself already
310
+ * reads as a quote, and the glyph only competes with the first word. Hairlines
311
+ * above and below do the separating.
312
+ */
313
+ declare function EditorialPullQuote({ attribution, className, portrait, quote, role, sourceHref, }: EditorialPullQuoteProps): react_jsx_runtime.JSX.Element | null;
314
+
315
+ type EditorialSourceItem = {
316
+ accessedAt?: string | null;
317
+ author?: string | null;
318
+ key?: string;
319
+ publisher?: string | null;
320
+ summary?: string | null;
321
+ title: string;
322
+ url: string;
323
+ };
324
+ type EditorialSourceIndexProps = {
325
+ className?: string;
326
+ /** Eyebrow copy, e.g. "Source index" / "资料索引". */
327
+ label?: string;
328
+ sources: EditorialSourceItem[];
329
+ /** Sentence under the eyebrow. Apps build this so pluralization stays localized. */
330
+ summary?: string | null;
331
+ };
332
+ /**
333
+ * Numbered reference list closing a researched piece.
334
+ *
335
+ * A numbered hairline list rather than a card grid: references are read in
336
+ * order and cited by number from the body, and boxing each one hides that
337
+ * ordering behind a wall of equal-weight rectangles.
338
+ */
339
+ declare function EditorialSourceIndex({ className, label, sources, summary, }: EditorialSourceIndexProps): react_jsx_runtime.JSX.Element | null;
340
+
341
+ type EditorialStatItem = {
342
+ caption?: string | null;
343
+ key?: string;
344
+ label: string;
345
+ value: string;
346
+ };
347
+ type EditorialStatGridProps = {
348
+ className?: string;
349
+ items: EditorialStatItem[];
350
+ label?: string;
351
+ title?: string | null;
352
+ };
353
+ /**
354
+ * Row of headline figures.
355
+ *
356
+ * Cells are separated by shared hairlines rather than being individual cards:
357
+ * boxing each number makes the set read as four unrelated facts, where the
358
+ * point of a stat row is that they are one measurement taken four ways.
359
+ */
360
+ declare function EditorialStatGrid({ className, items, label, title }: EditorialStatGridProps): react_jsx_runtime.JSX.Element | null;
361
+
362
+ type EditorialStep = {
363
+ body?: string | null;
364
+ key?: string;
365
+ title: string;
366
+ };
367
+ type EditorialStepLadderProps = {
368
+ className?: string;
369
+ label?: string;
370
+ steps: EditorialStep[];
371
+ title?: string | null;
372
+ };
373
+ /**
374
+ * Ordered procedure.
375
+ *
376
+ * Distinct from `EditorialTimeline`: a timeline reports what happened and is
377
+ * marked with dates, a ladder instructs and is marked with positions the reader
378
+ * is meant to follow in order.
379
+ */
380
+ declare function EditorialStepLadder({ className, label, steps, title }: EditorialStepLadderProps): react_jsx_runtime.JSX.Element | null;
381
+
382
+ type EditorialTimelineItem = {
383
+ body?: string | null;
384
+ /** Short marker: a year, a quarter, a version. Rendered in tabular figures. */
385
+ marker: string;
386
+ key?: string;
387
+ title: string;
388
+ };
389
+ type EditorialTimelineProps = {
390
+ className?: string;
391
+ items: EditorialTimelineItem[];
392
+ label?: string;
393
+ title?: string | null;
394
+ };
395
+ /**
396
+ * Chronology of events along a single rail.
397
+ *
398
+ * The rail is a 1px border on the list rather than a drawn line per item, so
399
+ * it stays continuous between entries and collapses cleanly when an entry has
400
+ * no body.
401
+ */
402
+ declare function EditorialTimeline({ className, items, label, title }: EditorialTimelineProps): react_jsx_runtime.JSX.Element | null;
403
+
404
+ export { EDITORIAL_BODY, EDITORIAL_CAPTION, EDITORIAL_EMBED_PROVIDERS, EDITORIAL_EYEBROW, EDITORIAL_FIGURE, EDITORIAL_TITLE, EDITORIAL_TONES, EDITORIAL_TONE_FG, EDITORIAL_TONE_PLATE, EDITORIAL_TONE_WASH, EditorialAuthorBio, type EditorialAuthorBioProps, type EditorialAuthorLink, EditorialCallout, type EditorialCalloutProps, EditorialChart, type EditorialChartPoint, type EditorialChartProps, type EditorialComparisonRow, EditorialComparisonTable, type EditorialComparisonTableProps, EditorialDataTable, type EditorialDataTableProps, type EditorialDataTableRow, EditorialDivider, type EditorialDividerProps, EditorialEmbedCard, type EditorialEmbedCardProps, type EditorialEmbedProvider, EditorialEntityChip, type EditorialEntityChipProps, EditorialFaq, type EditorialFaqItem, type EditorialFaqProps, EditorialFigure, EditorialFigureGroup, type EditorialFigureGroupProps, type EditorialFigureProps, type EditorialKeyTakeawayItem, EditorialKeyTakeaways, type EditorialKeyTakeawaysProps, EditorialMarginNote, type EditorialMarginNoteProps, EditorialPullQuote, type EditorialPullQuoteProps, EditorialSourceIndex, type EditorialSourceIndexProps, type EditorialSourceItem, EditorialStatGrid, type EditorialStatGridProps, type EditorialStatItem, type EditorialStep, EditorialStepLadder, type EditorialStepLadderProps, EditorialTimeline, type EditorialTimelineItem, type EditorialTimelineProps, type EditorialTone, editorialBlock, editorialFrame, editorialToneAccent, editorialToneStyle, isEditorialEmbedProvider, isEditorialTone };