panelui-native 0.54.0 → 0.57.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 (47) hide show
  1. package/README.md +18 -9
  2. package/lib/module/components/combobox/index.js +61 -7
  3. package/lib/module/components/combobox/index.js.map +1 -1
  4. package/lib/module/components/hex-chart/index.js +765 -0
  5. package/lib/module/components/hex-chart/index.js.map +1 -0
  6. package/lib/module/components/qr-code/index.js +641 -0
  7. package/lib/module/components/qr-code/index.js.map +1 -0
  8. package/lib/module/components/qr-code/qr-encode.js +475 -0
  9. package/lib/module/components/qr-code/qr-encode.js.map +1 -0
  10. package/lib/module/components/sortable/index.js +74 -12
  11. package/lib/module/components/sortable/index.js.map +1 -1
  12. package/lib/module/components/steps/index.js +95 -12
  13. package/lib/module/components/steps/index.js.map +1 -1
  14. package/lib/module/components/tag-input/index.js +435 -0
  15. package/lib/module/components/tag-input/index.js.map +1 -0
  16. package/lib/module/components/tour/index.js +661 -0
  17. package/lib/module/components/tour/index.js.map +1 -0
  18. package/lib/module/index.js +4 -0
  19. package/lib/module/index.js.map +1 -1
  20. package/lib/module/utils/chart.js +209 -0
  21. package/lib/module/utils/chart.js.map +1 -1
  22. package/lib/typescript/src/components/combobox/index.d.ts.map +1 -1
  23. package/lib/typescript/src/components/hex-chart/index.d.ts +277 -0
  24. package/lib/typescript/src/components/hex-chart/index.d.ts.map +1 -0
  25. package/lib/typescript/src/components/qr-code/index.d.ts +221 -0
  26. package/lib/typescript/src/components/qr-code/index.d.ts.map +1 -0
  27. package/lib/typescript/src/components/qr-code/qr-encode.d.ts +39 -0
  28. package/lib/typescript/src/components/qr-code/qr-encode.d.ts.map +1 -0
  29. package/lib/typescript/src/components/sortable/index.d.ts.map +1 -1
  30. package/lib/typescript/src/components/steps/index.d.ts +19 -0
  31. package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
  32. package/lib/typescript/src/components/tag-input/index.d.ts +240 -0
  33. package/lib/typescript/src/components/tag-input/index.d.ts.map +1 -0
  34. package/lib/typescript/src/components/tour/index.d.ts +168 -0
  35. package/lib/typescript/src/components/tour/index.d.ts.map +1 -0
  36. package/lib/typescript/src/index.d.ts +4 -0
  37. package/lib/typescript/src/index.d.ts.map +1 -1
  38. package/lib/typescript/src/utils/chart.d.ts +98 -0
  39. package/lib/typescript/src/utils/chart.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/src/components/hex-chart/index.tsx +1009 -0
  42. package/src/components/qr-code/index.tsx +663 -0
  43. package/src/components/qr-code/qr-encode.ts +548 -0
  44. package/src/components/steps/index.tsx +103 -8
  45. package/src/components/tour/index.tsx +933 -0
  46. package/src/index.ts +41 -0
  47. package/src/utils/chart.ts +236 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Children","createContext","forwardRef","isValidElement","useContext","useEffect","useImperativeHandle","useMemo","useRef","useState","Pressable","View","Animated","Easing","useAnimatedProps","useReducedMotion","useSharedValue","withTiming","Svg","ClipPath","Defs","Ellipse","G","Path","Rect","useCSSVariable","Text","compactNumber","hexAt","hexCenter","hexFillOrder","hexMetrics","hexPath","hexRadiusFor","hexRowsFor","shareCounts","useSeriesColor","cn","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","AnimatedEllipse","createAnimatedComponent","AnimatedRect","EMPTY_PLAN","paths","field","counts","labelAnchors","owners","HexChartContext","useChart","component","context","Error","useHexChart","data","plan","total","activeIndex","series","activeSeries","activeFraction","Math","max","value","activeCells","CORNER_REACH","SQRT2","HexChartRoot","className","columns","aspectRatio","density","shape","cellGap","animationDuration","status","activeIndexProp","onActiveIndexChange","children","props","ref","measured","setMeasured","internalActive","setInternalActive","reveal","reducedMotion","clipId","random","toString","slice","current","controlled","undefined","setActiveIndex","index","width","height","reduce","sum","columnCount","round","metrics","rows","fieldWidth","stepX","fieldHeight","stepY","left","top","loading","radius","length","cells","capacity","budget","min","map","sequence","_","sort","a","b","Array","fill","sums","x","highest","Infinity","cursor","n","cell","row","column","centre","y","count","playReveal","duration","easing","bezier","revealed","replay","c1","c2","c3","c4","c5","palette","colors","color","onLayout","event","next","nativeEvent","layout","ellipseProps","rx","ry","rectProps","slots","svg","overlay","header","footer","forEach","child","slot","type","push","ChildSlot","Provider","style","id","cx","cy","animatedProps","pointerEvents","position","displayName","HexChartCells","emptyColor","dimOpacity","token","empty","d","clipPath","percent","fillOpacity","accessibilityLabel","label","HexChartSkeleton","LABEL_GAP","HexChartTooltip","formatValue","showCells","format","onPress","owner","anchor","locationX","locationY","HexChartLabel","detail","size","setSize","placed","w","h","abs","opacity","maxWidth","borderRadius","backgroundColor","weight","numberOfLines","muted","HexChartLegend","showValue","dimmed","accessibilityRole","HexChartHeader","title","caption","labels","legend","trailing","HexChart","Object","assign","Header","Cells","Tooltip","Legend","Skeleton"],"sourceRoot":"../../../../src","sources":["components/hex-chart/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,QAAQ,EACRC,aAAa,EACbC,UAAU,EACVC,cAAc,EACdC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAEH,OAAO;AACd,SACEC,SAAS,EACTC,IAAI,QAGC,cAAc;AACrB,OAAOC,QAAQ,IACbC,MAAM,EACNC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QAEL,yBAAyB;AAChC,OAAOC,GAAG,IAAIC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,CAA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
6
+ * ```tsx
7
+ * <QRCode value="https://panelui.dev">
8
+ * <QRCode.Frame>
9
+ * <QRCode.Canvas />
10
+ * </QRCode.Frame>
11
+ * <QRCode.Caption>Scan to open the docs</QRCode.Caption>
12
+ * </QRCode>
13
+ * ```
14
+ *
15
+ * Composition is the API, as everywhere else here: a code in a titled panel is
16
+ * one with a `QRCode.Header` in it, and a code behind a button is one wrapped
17
+ * in a `QRCode.Trigger` and a `QRCode.Content` — not one with a prop turned on.
18
+ *
19
+ * ## What it draws
20
+ *
21
+ * Every dark module is one subpath of a single `<Path>`, not a `<Rect>` of its
22
+ * own. A version 10 code is 3,481 modules; half of them dark is seventeen
23
+ * hundred native views for a picture that never changes, and the difference
24
+ * between that and one node is the difference between a code that appears and
25
+ * one that appears eventually.
26
+ *
27
+ * The colours come from the theme, so a code drawn on a card is legible on
28
+ * every one of them — and light-on-dark is drawn the way scanners expect it,
29
+ * with the quiet zone painted rather than left transparent. A code with
30
+ * nothing behind it reads at about half the distance.
31
+ *
32
+ * ## The hole in the middle
33
+ *
34
+ * `QRCode.Logo` clears a square of modules and puts its children there.
35
+ * Error correction is what makes that survivable — the modules are gone, and
36
+ * the code still reads because there is enough redundancy to reconstruct them.
37
+ * How much is `errorCorrection`, and a logo raises the level it needs: the
38
+ * default `M` tolerates about 15% loss, `H` about 30%. A logo is measured
39
+ * against that budget and the level is raised for you if it has to be.
40
+ */
41
+ import { createContext, forwardRef, useContext, useMemo } from 'react';
42
+ import { View } from 'react-native';
43
+ import Svg, { Path, Rect } from 'react-native-svg';
44
+ import { tv } from 'tailwind-variants';
45
+ import { Text } from "../../primitives/text.js";
46
+ import { cn } from "../../utils/cn.js";
47
+ import { Popover } from "../popover/index.js";
48
+ import { encodeQr } from "./qr-encode.js";
49
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
50
+ const qrCodeVariants = tv({
51
+ slots: {
52
+ root: 'items-center gap-3',
53
+ // The widget shell every chart in the library is shown in: a titled tray
54
+ // with the card flush inside it. A code is the same kind of thing — one
55
+ // object with a label over it — so it is the same shape.
56
+ frame: 'w-full overflow-hidden rounded-3xl border border-border bg-surface',
57
+ header: 'w-full flex-row items-center justify-between gap-3 px-4 pb-3 pt-2.5',
58
+ // Flush left, right and bottom: the shell's own edge is already there.
59
+ panel: 'relative items-center justify-center overflow-hidden rounded-t-2xl border-t border-border bg-card p-4',
60
+ caption: 'text-center text-sm text-muted-foreground',
61
+ value: 'text-center text-xs text-muted-foreground'
62
+ },
63
+ variants: {
64
+ size: {
65
+ sm: {},
66
+ md: {},
67
+ lg: {}
68
+ }
69
+ },
70
+ defaultVariants: {
71
+ size: 'md'
72
+ }
73
+ });
74
+
75
+ /** How big the drawn code is. */
76
+
77
+ /** Side length in points per size. The module grid divides into it. */
78
+ const CANVAS_SIZE = {
79
+ sm: 128,
80
+ md: 180,
81
+ lg: 240
82
+ };
83
+
84
+ /**
85
+ * The quiet zone, in modules. Four is what the specification asks for and what
86
+ * scanners are tuned to; less and a code against a busy background stops being
87
+ * found at all.
88
+ */
89
+ const QUIET_ZONE = 4;
90
+
91
+ /** Roughly how much of the code each level can lose and still be read. */
92
+ const TOLERANCE = {
93
+ L: 0.07,
94
+ M: 0.15,
95
+ Q: 0.25,
96
+ H: 0.3
97
+ };
98
+
99
+ /** Ascending, so "the next level up" is a step through this. */
100
+ const LEVELS = ['L', 'M', 'Q', 'H'];
101
+
102
+ /** How much of the code a logo of this fraction covers. */
103
+ function coverage(logoFraction) {
104
+ return logoFraction * logoFraction;
105
+ }
106
+
107
+ /**
108
+ * The cleared square, in module coordinates.
109
+ *
110
+ * Both the canvas and the logo compute it from this, so the hole and the thing
111
+ * filling it are the same square. Two nearly-equal calculations is how you get
112
+ * a dark ring around a logo, which is the failure the screenshot showed.
113
+ */
114
+ function holeBounds(matrixSize, logoFraction) {
115
+ const from = Math.floor(matrixSize * (1 - logoFraction) / 2);
116
+ const to = Math.ceil(matrixSize * (1 + logoFraction) / 2);
117
+ return {
118
+ from,
119
+ to
120
+ };
121
+ }
122
+
123
+ /**
124
+ * The level actually used: the one asked for, unless a logo would eat more of
125
+ * the code than it can afford, in which case the next one that can.
126
+ */
127
+ function levelFor(requested, logoFraction) {
128
+ const needed = coverage(logoFraction);
129
+ // Half the budget, not all of it: the rest is for the things a code in the
130
+ // world actually loses — glare, a fold, a thumb.
131
+ const affordable = level => TOLERANCE[level] / 2 >= needed;
132
+ if (affordable(requested)) return requested;
133
+ return LEVELS.slice(LEVELS.indexOf(requested)).find(affordable) ?? 'H';
134
+ }
135
+ const QRCodeContext = /*#__PURE__*/createContext(null);
136
+ function useQRCode(part) {
137
+ const context = useContext(QRCodeContext);
138
+ if (!context) throw new Error(`${part} must be used inside <QRCode>.`);
139
+ return context;
140
+ }
141
+
142
+ /** Where the code is drawn: in place, in a popover, or up from the bottom. */
143
+
144
+ const QRCodeRoot = /*#__PURE__*/forwardRef(({
145
+ className,
146
+ value,
147
+ errorCorrection = 'M',
148
+ version,
149
+ size = 'md',
150
+ presentation = 'inline',
151
+ open,
152
+ onOpenChange,
153
+ children,
154
+ ...props
155
+ }, ref) => {
156
+ const slots = qrCodeVariants({
157
+ size
158
+ });
159
+
160
+ /*
161
+ * A logo is a child, and the matrix has to know about it before the child
162
+ * renders — the level it forces changes the matrix itself. Rather than
163
+ * inspecting children, the fraction is a constant the Logo part also uses,
164
+ * and the root asks whether one is present at all.
165
+ */
166
+ const logoFraction = hasLogo(children) ? LOGO_FRACTION : 0;
167
+ const level = levelFor(errorCorrection, logoFraction);
168
+ const {
169
+ matrix,
170
+ error
171
+ } = useMemo(() => {
172
+ try {
173
+ return {
174
+ matrix: encodeQr(value, {
175
+ errorCorrection: level,
176
+ version
177
+ }),
178
+ error: null
179
+ };
180
+ } catch (cause) {
181
+ // Too much data, or a version too small for it. A throw here would
182
+ // take a screen down over a string, so it draws nothing and says why.
183
+ return {
184
+ matrix: null,
185
+ error: cause.message
186
+ };
187
+ }
188
+ }, [value, level, version]);
189
+ const context = {
190
+ matrix,
191
+ error,
192
+ value,
193
+ size,
194
+ logoFraction,
195
+ slots
196
+ };
197
+ if (presentation !== 'inline') {
198
+ // The provider stays outside the Popover, and Content re-provides it
199
+ // inside — portal content mounts under the portal host, which is not in
200
+ // this subtree.
201
+ return /*#__PURE__*/_jsx(QRCodeContext.Provider, {
202
+ value: context,
203
+ children: /*#__PURE__*/_jsx(Popover, {
204
+ open: open,
205
+ onOpenChange: onOpenChange,
206
+ presentation: presentation,
207
+ children: children
208
+ })
209
+ });
210
+ }
211
+ return /*#__PURE__*/_jsx(QRCodeContext.Provider, {
212
+ value: context,
213
+ children: /*#__PURE__*/_jsx(View, {
214
+ ref: ref,
215
+ className: slots.root({
216
+ className
217
+ }),
218
+ ...props,
219
+ children: children
220
+ })
221
+ });
222
+ });
223
+ QRCodeRoot.displayName = 'QRCode';
224
+
225
+ /* ------------------------------------------------------------------ *
226
+ * The code itself.
227
+ * ------------------------------------------------------------------ */
228
+
229
+ /**
230
+ * Dark modules on a light plate, whatever the theme is doing.
231
+ *
232
+ * This is the one place in the library that does not follow the tokens, and it
233
+ * is deliberate. A QR code is not a surface — it is a thing a camera has to
234
+ * read, and readers expect dark on light. Inverted, a code is rejected outright
235
+ * by a good share of scanners and found late by most of the rest, which turns a
236
+ * dark theme into a bug report about a code that "sometimes does not work".
237
+ *
238
+ * On a light theme the plate is white on a near-white card, which looks like
239
+ * nothing at all — correct, and the intended outcome. On a dark theme it reads
240
+ * as a light plate holding a code, which is the shape everyone recognises.
241
+ *
242
+ * `color` and `backgroundColor` override both, for a code that is definitely
243
+ * being read by something you control.
244
+ */
245
+ const PLATE = '#ffffff';
246
+ const MODULE = '#111111';
247
+ const QRCodeCanvas = /*#__PURE__*/forwardRef(({
248
+ className,
249
+ pixelSize,
250
+ color,
251
+ backgroundColor,
252
+ ...props
253
+ }, ref) => {
254
+ const {
255
+ matrix,
256
+ error,
257
+ value,
258
+ size,
259
+ logoFraction
260
+ } = useQRCode('QRCode.Canvas');
261
+ const side = pixelSize ?? CANVAS_SIZE[size];
262
+ const dark = color ?? MODULE;
263
+ const light = backgroundColor ?? PLATE;
264
+
265
+ /*
266
+ * One path for every dark module.
267
+ *
268
+ * The viewBox is in module units, so the path is written once and scales
269
+ * to whatever `side` is — no arithmetic per module, and no rounding gaps
270
+ * between neighbours at fractional sizes.
271
+ */
272
+ const path = useMemo(() => {
273
+ if (!matrix) return '';
274
+ const hole = logoFraction ? holeBounds(matrix.size, logoFraction) : null;
275
+ let d = '';
276
+ for (let y = 0; y < matrix.size; y++) {
277
+ for (let x = 0; x < matrix.size; x++) {
278
+ if (!matrix.modules[y][x]) continue;
279
+ // Modules under the logo are not drawn at all — drawing them and
280
+ // covering them leaves a dark edge wherever the logo is smaller
281
+ // than the square it cleared.
282
+ if (hole && x >= hole.from && x < hole.to && y >= hole.from && y < hole.to) continue;
283
+ d += `M${x + QUIET_ZONE} ${y + QUIET_ZONE}h1v1h-1z`;
284
+ }
285
+ }
286
+ return d;
287
+ }, [matrix, logoFraction]);
288
+ if (error) {
289
+ // A box the size the code would have been, so the layout does not jump
290
+ // when the value becomes something that fits.
291
+ return /*#__PURE__*/_jsx(View, {
292
+ ref: ref,
293
+ accessibilityRole: "image",
294
+ accessibilityLabel: "QR code could not be generated",
295
+ className: cn('items-center justify-center rounded-lg bg-muted', className),
296
+ style: {
297
+ width: side,
298
+ height: side
299
+ },
300
+ ...props
301
+ });
302
+ }
303
+ if (!matrix) return null;
304
+ const grid = matrix.size + QUIET_ZONE * 2;
305
+ return /*#__PURE__*/_jsx(View, {
306
+ ref: ref,
307
+ accessibilityRole: "image",
308
+ accessibilityLabel: `QR code for ${value}`,
309
+ className: className,
310
+ style: {
311
+ width: side,
312
+ height: side
313
+ },
314
+ ...props,
315
+ children: /*#__PURE__*/_jsxs(Svg, {
316
+ width: "100%",
317
+ height: "100%",
318
+ viewBox: `0 0 ${grid} ${grid}`,
319
+ children: [/*#__PURE__*/_jsx(Rect, {
320
+ x: 0,
321
+ y: 0,
322
+ width: grid,
323
+ height: grid,
324
+ rx: 2.5,
325
+ fill: light
326
+ }), /*#__PURE__*/_jsx(Path, {
327
+ d: path,
328
+ fill: dark
329
+ })]
330
+ })
331
+ });
332
+ });
333
+ QRCodeCanvas.displayName = 'QRCode.Canvas';
334
+
335
+ /* ------------------------------------------------------------------ *
336
+ * The shells around it.
337
+ * ------------------------------------------------------------------ */
338
+
339
+ /**
340
+ * The tray the code sits in — the same widget shell the charts use: a titled
341
+ * strip, and a card flush inside it holding the thing itself.
342
+ */
343
+ const QRCodeFrame = /*#__PURE__*/forwardRef(({
344
+ className,
345
+ children,
346
+ ...props
347
+ }, ref) => {
348
+ const {
349
+ slots
350
+ } = useQRCode('QRCode.Frame');
351
+ return /*#__PURE__*/_jsx(View, {
352
+ ref: ref,
353
+ className: slots.frame({
354
+ className
355
+ }),
356
+ ...props,
357
+ children: children
358
+ });
359
+ });
360
+ QRCodeFrame.displayName = 'QRCode.Frame';
361
+ /**
362
+ * The strip across the top of the tray. `QRCode.Title` takes the flexible
363
+ * side and `QRCode.Action` the end, so a long title truncates rather than
364
+ * shoving the trailing slot off the edge.
365
+ */
366
+ const QRCodeHeader = /*#__PURE__*/forwardRef(({
367
+ className,
368
+ children,
369
+ ...props
370
+ }, ref) => {
371
+ const {
372
+ slots
373
+ } = useQRCode('QRCode.Header');
374
+ return /*#__PURE__*/_jsx(View, {
375
+ ref: ref,
376
+ className: slots.header({
377
+ className
378
+ }),
379
+ ...props,
380
+ children: children
381
+ });
382
+ });
383
+ QRCodeHeader.displayName = 'QRCode.Header';
384
+ /** What the code is for. Muted — it is a caption on the tray, not a heading. */
385
+ function QRCodeTitle({
386
+ className,
387
+ children
388
+ }) {
389
+ useQRCode('QRCode.Title');
390
+ return /*#__PURE__*/_jsx(Text, {
391
+ size: "sm",
392
+ muted: true,
393
+ numberOfLines: 1,
394
+ className: cn('min-w-0 shrink', className),
395
+ children: children
396
+ });
397
+ }
398
+ QRCodeTitle.displayName = 'QRCode.Title';
399
+ /**
400
+ * The trailing slot on the header row — an expiry, a count, a button. A plain
401
+ * string draws as muted text; anything else draws as itself.
402
+ */
403
+ const QRCodeAction = /*#__PURE__*/forwardRef(({
404
+ className,
405
+ children,
406
+ ...props
407
+ }, ref) => {
408
+ useQRCode('QRCode.Action');
409
+ return /*#__PURE__*/_jsx(View, {
410
+ ref: ref,
411
+ className: cn('shrink-0 flex-row items-center gap-2', className),
412
+ ...props,
413
+ children: typeof children === 'string' ? /*#__PURE__*/_jsx(Text, {
414
+ size: "sm",
415
+ muted: true,
416
+ children: children
417
+ }) : children
418
+ });
419
+ });
420
+ QRCodeAction.displayName = 'QRCode.Action';
421
+ /**
422
+ * The card the code is drawn on, flush inside the tray. It is also what the
423
+ * logo positions itself against, so a `QRCode.Logo` belongs in here beside the
424
+ * canvas rather than anywhere else.
425
+ */
426
+ const QRCodePanel = /*#__PURE__*/forwardRef(({
427
+ className,
428
+ children,
429
+ ...props
430
+ }, ref) => {
431
+ const {
432
+ slots
433
+ } = useQRCode('QRCode.Panel');
434
+ return /*#__PURE__*/_jsx(View, {
435
+ ref: ref,
436
+ className: slots.panel({
437
+ className
438
+ }),
439
+ ...props,
440
+ children: children
441
+ });
442
+ });
443
+ QRCodePanel.displayName = 'QRCode.Panel';
444
+
445
+ /* ------------------------------------------------------------------ *
446
+ * The readouts.
447
+ * ------------------------------------------------------------------ */
448
+
449
+ /** A muted line inside the panel, under the code. */
450
+ function QRCodeDescription({
451
+ className,
452
+ children
453
+ }) {
454
+ useQRCode('QRCode.Description');
455
+ return /*#__PURE__*/_jsx(Text, {
456
+ size: "sm",
457
+ muted: true,
458
+ className: cn('text-center', className),
459
+ children: children
460
+ });
461
+ }
462
+ QRCodeDescription.displayName = 'QRCode.Description';
463
+ /** A line under the code saying what scanning it does. */
464
+ function QRCodeCaption({
465
+ className,
466
+ children
467
+ }) {
468
+ const {
469
+ slots
470
+ } = useQRCode('QRCode.Caption');
471
+ return /*#__PURE__*/_jsx(Text, {
472
+ className: slots.caption({
473
+ className
474
+ }),
475
+ children: children
476
+ });
477
+ }
478
+ QRCodeCaption.displayName = 'QRCode.Caption';
479
+ /**
480
+ * The encoded string itself, for someone who cannot scan it — typing a URL out
481
+ * is slower than pointing a camera at it and it is the only way through when
482
+ * the camera is the thing you are setting up.
483
+ */
484
+ function QRCodeValue({
485
+ className,
486
+ full
487
+ }) {
488
+ const {
489
+ value,
490
+ slots
491
+ } = useQRCode('QRCode.Value');
492
+ return /*#__PURE__*/_jsx(Text, {
493
+ className: slots.value({
494
+ className
495
+ }),
496
+ numberOfLines: full ? undefined : 1,
497
+ selectable: true,
498
+ children: value
499
+ });
500
+ }
501
+ QRCodeValue.displayName = 'QRCode.Value';
502
+
503
+ /* ------------------------------------------------------------------ *
504
+ * The logo.
505
+ * ------------------------------------------------------------------ */
506
+
507
+ /**
508
+ * How much of the code's width the logo hole takes.
509
+ *
510
+ * Constant rather than a prop, because the value has to be known before the
511
+ * matrix is built — it decides the error-correction level — and a prop on a
512
+ * child cannot be read from the parent without inspecting the tree. A quarter
513
+ * costs about 6% of the modules, which every level above `L` can afford.
514
+ */
515
+ const LOGO_FRACTION = 0.25;
516
+ /** Whether the tree contains a `QRCode.Logo`, without walking it deeply. */
517
+ function hasLogo(children) {
518
+ let found = false;
519
+ const walk = node => {
520
+ if (found || !node) return;
521
+ if (Array.isArray(node)) {
522
+ node.forEach(walk);
523
+ return;
524
+ }
525
+ const element = node;
526
+ if (typeof element !== 'object' || !('type' in element)) return;
527
+ if (element.type === QRCodeLogo) {
528
+ found = true;
529
+ return;
530
+ }
531
+ walk(element.props?.children);
532
+ };
533
+ walk(children);
534
+ return found;
535
+ }
536
+
537
+ /**
538
+ * Content for the cleared square in the middle — a mark, an avatar, an icon.
539
+ * Its presence is what clears the square, and what raises the error-correction
540
+ * level if the one asked for could not afford it.
541
+ */
542
+ const QRCodeLogo = /*#__PURE__*/forwardRef(({
543
+ className,
544
+ children,
545
+ ...props
546
+ }, ref) => {
547
+ const {
548
+ size,
549
+ matrix
550
+ } = useQRCode('QRCode.Logo');
551
+ if (!matrix) return null;
552
+
553
+ /*
554
+ * Sized from the same square the canvas cleared, in the same units.
555
+ *
556
+ * Taking a flat 25% of the canvas instead is close, but not equal — the
557
+ * hole is a whole number of modules and the canvas is not necessarily
558
+ * divisible by them, so the two disagreed by a module or so and the
559
+ * difference showed as a dark ring around the logo.
560
+ */
561
+ const {
562
+ from,
563
+ to
564
+ } = holeBounds(matrix.size, LOGO_FRACTION);
565
+ const grid = matrix.size + QUIET_ZONE * 2;
566
+ const box = (to - from) / grid * CANVAS_SIZE[size];
567
+ return (
568
+ /*#__PURE__*/
569
+ // `inset-0` and centred, not `absolute` with nothing else: an absolute
570
+ // box with no offsets takes its parent's alignment, which put the logo
571
+ // at the top of the panel rather than over the middle of the code.
572
+ _jsx(View, {
573
+ pointerEvents: "none",
574
+ className: "absolute bottom-0 left-0 right-0 top-0 items-center justify-center",
575
+ children: /*#__PURE__*/_jsx(View, {
576
+ ref: ref
577
+ // The plate colour, so the square reads as part of the code rather
578
+ // than as a hole cut in it — and rounded, matching the plate.
579
+ ,
580
+ className: cn('items-center justify-center overflow-hidden rounded-md', className),
581
+ style: {
582
+ width: box,
583
+ height: box,
584
+ backgroundColor: PLATE
585
+ },
586
+ ...props,
587
+ children: children
588
+ })
589
+ })
590
+ );
591
+ });
592
+ QRCodeLogo.displayName = 'QRCode.Logo';
593
+
594
+ /* ------------------------------------------------------------------ *
595
+ * Folded away.
596
+ * ------------------------------------------------------------------ */
597
+
598
+ /** What opens a `popover` or `bottom-sheet` code. */
599
+ function QRCodeTrigger({
600
+ children
601
+ }) {
602
+ useQRCode('QRCode.Trigger');
603
+ return /*#__PURE__*/_jsx(Popover.Trigger, {
604
+ children: children
605
+ });
606
+ }
607
+ QRCodeTrigger.displayName = 'QRCode.Trigger';
608
+ /** The panel the code is drawn in, when it is not drawn in place. */
609
+ function QRCodeContent({
610
+ className,
611
+ width = 'content-fit',
612
+ children,
613
+ ...props
614
+ }) {
615
+ const context = useQRCode('QRCode.Content');
616
+ return /*#__PURE__*/_jsx(Popover.Content, {
617
+ width: width,
618
+ className: cn('items-center gap-3', className),
619
+ ...props,
620
+ children: /*#__PURE__*/_jsx(QRCodeContext.Provider, {
621
+ value: context,
622
+ children: children
623
+ })
624
+ });
625
+ }
626
+ QRCodeContent.displayName = 'QRCode.Content';
627
+ export const QRCode = Object.assign(QRCodeRoot, {
628
+ Canvas: QRCodeCanvas,
629
+ Frame: QRCodeFrame,
630
+ Header: QRCodeHeader,
631
+ Title: QRCodeTitle,
632
+ Action: QRCodeAction,
633
+ Panel: QRCodePanel,
634
+ Description: QRCodeDescription,
635
+ Caption: QRCodeCaption,
636
+ Value: QRCodeValue,
637
+ Logo: QRCodeLogo,
638
+ Trigger: QRCodeTrigger,
639
+ Content: QRCodeContent
640
+ });
641
+ //# sourceMappingURL=index.js.map