@swiftbrowser/react 0.0.0-stage → 0.4.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 (90) hide show
  1. package/README.md +435 -2
  2. package/dist/binding.d.ts +9 -0
  3. package/dist/binding.d.ts.map +1 -0
  4. package/dist/bridge.d.ts +17 -0
  5. package/dist/bridge.d.ts.map +1 -0
  6. package/dist/components/animators.d.ts +40 -0
  7. package/dist/components/animators.d.ts.map +1 -0
  8. package/dist/components/canvas.d.ts +138 -0
  9. package/dist/components/canvas.d.ts.map +1 -0
  10. package/dist/components/charts.d.ts +100 -0
  11. package/dist/components/charts.d.ts.map +1 -0
  12. package/dist/components/containers.d.ts +78 -0
  13. package/dist/components/containers.d.ts.map +1 -0
  14. package/dist/components/controls.d.ts +106 -0
  15. package/dist/components/controls.d.ts.map +1 -0
  16. package/dist/components/geometry.d.ts +131 -0
  17. package/dist/components/geometry.d.ts.map +1 -0
  18. package/dist/components/host.d.ts +24 -0
  19. package/dist/components/host.d.ts.map +1 -0
  20. package/dist/components/images.d.ts +18 -0
  21. package/dist/components/images.d.ts.map +1 -0
  22. package/dist/components/lists.d.ts +26 -0
  23. package/dist/components/lists.d.ts.map +1 -0
  24. package/dist/components/media.d.ts +105 -0
  25. package/dist/components/media.d.ts.map +1 -0
  26. package/dist/components/menus.d.ts +20 -0
  27. package/dist/components/menus.d.ts.map +1 -0
  28. package/dist/components/navigation.d.ts +22 -0
  29. package/dist/components/navigation.d.ts.map +1 -0
  30. package/dist/components/row.d.ts +34 -0
  31. package/dist/components/row.d.ts.map +1 -0
  32. package/dist/components/shapes.d.ts +107 -0
  33. package/dist/components/shapes.d.ts.map +1 -0
  34. package/dist/components/split.d.ts +25 -0
  35. package/dist/components/split.d.ts.map +1 -0
  36. package/dist/components/stacks.d.ts +138 -0
  37. package/dist/components/stacks.d.ts.map +1 -0
  38. package/dist/components/system.d.ts +25 -0
  39. package/dist/components/system.d.ts.map +1 -0
  40. package/dist/components/table.d.ts +36 -0
  41. package/dist/components/table.d.ts.map +1 -0
  42. package/dist/components/tabs.d.ts +20 -0
  43. package/dist/components/tabs.d.ts.map +1 -0
  44. package/dist/components/text.d.ts +63 -0
  45. package/dist/components/text.d.ts.map +1 -0
  46. package/dist/coordinateSpace.d.ts +20 -0
  47. package/dist/coordinateSpace.d.ts.map +1 -0
  48. package/dist/dragDrop.d.ts +16 -0
  49. package/dist/dragDrop.d.ts.map +1 -0
  50. package/dist/environment.d.ts +54 -0
  51. package/dist/environment.d.ts.map +1 -0
  52. package/dist/host/instance.d.ts +67 -0
  53. package/dist/host/instance.d.ts.map +1 -0
  54. package/dist/host/reconciler.d.ts +9 -0
  55. package/dist/host/reconciler.d.ts.map +1 -0
  56. package/dist/host/root.d.ts +29 -0
  57. package/dist/host/root.d.ts.map +1 -0
  58. package/dist/host/sb.d.ts +5 -0
  59. package/dist/host/sb.d.ts.map +1 -0
  60. package/dist/host/tree.d.ts +35 -0
  61. package/dist/host/tree.d.ts.map +1 -0
  62. package/dist/index.d.ts +41 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +4038 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/inspector.d.ts +11 -0
  67. package/dist/inspector.d.ts.map +1 -0
  68. package/dist/island.d.ts +25 -0
  69. package/dist/island.d.ts.map +1 -0
  70. package/dist/lazy.d.ts +19 -0
  71. package/dist/lazy.d.ts.map +1 -0
  72. package/dist/lifecycle.d.ts +11 -0
  73. package/dist/lifecycle.d.ts.map +1 -0
  74. package/dist/modifiers.d.ts +330 -0
  75. package/dist/modifiers.d.ts.map +1 -0
  76. package/dist/mount.d.ts +41 -0
  77. package/dist/mount.d.ts.map +1 -0
  78. package/dist/navigation-context.d.ts +15 -0
  79. package/dist/navigation-context.d.ts.map +1 -0
  80. package/dist/path.d.ts +48 -0
  81. package/dist/path.d.ts.map +1 -0
  82. package/dist/pointer.d.ts +65 -0
  83. package/dist/pointer.d.ts.map +1 -0
  84. package/dist/presentation.d.ts +38 -0
  85. package/dist/presentation.d.ts.map +1 -0
  86. package/dist/scrollReader.d.ts +27 -0
  87. package/dist/scrollReader.d.ts.map +1 -0
  88. package/dist/values.d.ts +118 -0
  89. package/dist/values.d.ts.map +1 -0
  90. package/package.json +47 -4
@@ -0,0 +1,20 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type BindingValue } from '../binding';
3
+ import { type ViewModifiers } from '../modifiers';
4
+ export interface MenuProps extends ViewModifiers {
5
+ /** The label: a title, or any view. */
6
+ title?: string;
7
+ label?: ReactNode;
8
+ /** The items: buttons, pickers, dividers, sections, texts, nested menus. */
9
+ children?: ReactNode;
10
+ }
11
+ /** `Menu("Sort") { … }`: the label opens a popover of the items. */
12
+ export declare function Menu(props: MenuProps): ReactNode;
13
+ export interface EditButtonProps extends ViewModifiers {
14
+ /** The list's edit mode (`List editing={…}`). */
15
+ editMode: BindingValue<boolean>;
16
+ onChange?: (editing: boolean) => void;
17
+ }
18
+ /** `EditButton()`: "Edit" / "Done", flipping the edit mode it is given. */
19
+ export declare function EditButton(props: EditButtonProps): ReactNode;
20
+ //# sourceMappingURL=menus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menus.d.ts","sourceRoot":"","sources":["../../src/components/menus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAI9E,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,oEAAoE;AACpE,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAUhD;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,iDAAiD;IACjD,QAAQ,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CAI5D"}
@@ -0,0 +1,22 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type BindingValue } from '../binding';
3
+ import { type ViewModifiers } from '../modifiers';
4
+ export interface NavigationStackProps extends ViewModifiers {
5
+ /** `NavigationStack(path:)`: the pushed values. */
6
+ path?: BindingValue<readonly unknown[]>;
7
+ onPathChange?: (path: readonly unknown[]) => void;
8
+ /** `.navigationDestination(for:)`, for every pushed value. */
9
+ destination?: (value: never) => ReactNode;
10
+ children?: ReactNode;
11
+ }
12
+ export declare function NavigationStack(props: NavigationStackProps): ReactNode;
13
+ export interface NavigationLinkProps extends ViewModifiers {
14
+ title?: string;
15
+ /** The value to push (`navigationDestination` builds the screen). */
16
+ value?: unknown;
17
+ /** The screen to push. */
18
+ destination?: ReactNode;
19
+ children?: ReactNode;
20
+ }
21
+ export declare function NavigationLink(props: NavigationLinkProps): ReactNode;
22
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/components/navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAI9E,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,mDAAmD;IACnD,IAAI,CAAC,EAAE,YAAY,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,KAAK,IAAI,CAAC;IAClD,8DAA8D;IAC9D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC;IAC1C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAUD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CAMtE;AA0DD,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0BAA0B;IAC1B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CAUpE"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * List rows that can be selected or deleted are wrapped in a `listrow`
3
+ * (docs/ops-protocol.md, "Edit mode and list selection"). `ForEach`'s
4
+ * `onDelete` and a `List`'s `selection` both end in this component; a row
5
+ * that is neither selectable nor deletable renders bare.
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ export interface ListSelection {
9
+ isSelected(tag: unknown): boolean;
10
+ select(tag: unknown): void;
11
+ editing: boolean;
12
+ }
13
+ export declare const ListSelectionContext: import("react").Context<ListSelection | null>;
14
+ export interface RowProps {
15
+ /** The row's tag (`.tag`, a `NavigationLink` value or a `ForEach` id). */
16
+ tag?: unknown;
17
+ /** `ForEach` with `onDelete`: what a swipe or the edit-mode minus does. */
18
+ onDelete?: () => void;
19
+ deletable?: boolean;
20
+ /**
21
+ * `ForEach` with `onMove`: called with the destination offset in the
22
+ * `ForEach`'s data (as `move(fromOffsets:toOffset:)` takes it) when the
23
+ * row was dragged to a new place.
24
+ */
25
+ onMove?: (to: number) => void;
26
+ movable?: boolean;
27
+ /** The row's offset in its `ForEach`. */
28
+ index?: number;
29
+ /** The row's index among its container's children (set by `List` / `Section`), for mapping `move`. */
30
+ containerIndex?: number;
31
+ children?: ReactNode;
32
+ }
33
+ export declare function Row({ tag, onDelete, deletable, onMove, movable, index, containerIndex, children }: RowProps): ReactNode;
34
+ //# sourceMappingURL=row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../src/components/row.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC;IAClC,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,oBAAoB,+CAA4C,CAAC;AAE9E,MAAM,WAAW,QAAQ;IACvB,0EAA0E;IAC1E,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sGAAsG;IACtG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,QAAQ,GAAG,SAAS,CA4BvH"}
@@ -0,0 +1,107 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ViewModifiers } from '../modifiers';
3
+ import { Path, type CGRect } from '../path';
4
+ import { ColorValues, type ColorValue, type StyleValue } from '../values';
5
+ export interface StrokeSpec {
6
+ style?: StyleValue;
7
+ lineWidth?: number;
8
+ dash?: number[];
9
+ dashPhase?: number;
10
+ lineCap?: 'butt' | 'round' | 'square';
11
+ lineJoin?: 'miter' | 'round' | 'bevel';
12
+ miterLimit?: number;
13
+ }
14
+ export type StrokeValue = StyleValue | StrokeSpec;
15
+ export interface ShapeProps extends ViewModifiers {
16
+ /** `.fill(_:)`; without a fill or stroke the shape draws in the foreground color. */
17
+ fill?: StyleValue;
18
+ /** `.stroke(_:lineWidth:)` */
19
+ stroke?: StrokeValue;
20
+ /** `.strokeBorder(_:style:)`: the stroke inside the bounds. */
21
+ strokeBorder?: StrokeValue;
22
+ trim?: {
23
+ from: number;
24
+ to: number;
25
+ };
26
+ }
27
+ export declare function Rectangle(props: ShapeProps): ReactNode;
28
+ export declare namespace Rectangle {
29
+ var shape: {
30
+ kind: string;
31
+ cornerRadius: number;
32
+ };
33
+ }
34
+ export interface RoundedRectangleProps extends ShapeProps {
35
+ cornerRadius: number;
36
+ }
37
+ export declare function RoundedRectangle(props: RoundedRectangleProps): ReactNode;
38
+ export declare namespace RoundedRectangle {
39
+ var shape: {
40
+ kind: string;
41
+ cornerRadius: null;
42
+ };
43
+ }
44
+ export declare function Circle(props: ShapeProps): ReactNode;
45
+ export declare namespace Circle {
46
+ var shape: {
47
+ kind: string;
48
+ cornerRadius: number;
49
+ };
50
+ }
51
+ export declare function Capsule(props: ShapeProps): ReactNode;
52
+ export declare namespace Capsule {
53
+ var shape: {
54
+ kind: string;
55
+ cornerRadius: number;
56
+ };
57
+ }
58
+ export declare function Ellipse(props: ShapeProps): ReactNode;
59
+ export declare namespace Ellipse {
60
+ var shape: {
61
+ kind: string;
62
+ cornerRadius: number;
63
+ };
64
+ }
65
+ export interface ContainerRelativeShapeProps extends ShapeProps {
66
+ /** The container's corner radius (a widget's, a card's). */
67
+ cornerRadius?: number;
68
+ }
69
+ /** `ContainerRelativeShape`: a rounded rectangle with its container's corners. */
70
+ export declare function ContainerRelativeShape(props: ContainerRelativeShapeProps): ReactNode;
71
+ export declare namespace ContainerRelativeShape {
72
+ var shape: {
73
+ kind: string;
74
+ cornerRadius: null;
75
+ };
76
+ }
77
+ export interface CustomShapeProps extends Omit<ShapeProps, 'trim'> {
78
+ /** `path(in:)`: the shape's path for a rectangle of the size it is laid out at. */
79
+ path: (rect: CGRect) => Path;
80
+ /** `FillStyle(eoFill: true)` */
81
+ evenOdd?: boolean;
82
+ }
83
+ /**
84
+ * A custom `Shape`: the element reports its laid-out size, and the shape
85
+ * draws `path(in:)` for that size, as the Swift shim does.
86
+ */
87
+ export declare function Shape(props: CustomShapeProps): ReactNode;
88
+ export interface UnevenRoundedRectangleProps extends ShapeProps {
89
+ topLeadingRadius?: number;
90
+ bottomLeadingRadius?: number;
91
+ bottomTrailingRadius?: number;
92
+ topTrailingRadius?: number;
93
+ }
94
+ /** `UnevenRoundedRectangle`: a custom shape with a radius per corner. */
95
+ export declare function UnevenRoundedRectangle(props: UnevenRoundedRectangleProps): ReactNode;
96
+ export interface ColorViewProps extends ViewModifiers {
97
+ color: ColorValue;
98
+ }
99
+ /** `Color.red` as a view: a box of the color that fills its proposal. */
100
+ declare function ColorView(props: ColorViewProps): ReactNode;
101
+ /**
102
+ * `Color`: as a view, `<Color color="red" />`; as values, `Color.red`,
103
+ * `Color.opacity('black', 0.2)`, `Color.gradient('teal')`, `Color.hex('#336699')`.
104
+ */
105
+ export declare const Color: typeof ColorView & typeof ColorValues;
106
+ export {};
107
+ //# sourceMappingURL=shapes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../src/components/shapes.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAA8C,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,IAAI,EAAE,KAAK,M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BAAgB,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAEpD;yBAFe,OAAO;;;;;;AAKvB,MAAM,WAAW,2BAA4B,SAAQ,UAAU;IAC7D,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,kFAAkF;AAClF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,SAAS,CAGpF;yBAHe,sBAAsB;;;;;;AAUtC,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAChE,mFAAmF;IACnF,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAsBxD;AAED,MAAM,WAAW,2BAA4B,SAAQ,UAAU;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,yEAAyE;AACzE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,SAAS,CAoBpF;AAMD,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,yEAAyE;AACzE,iBAAS,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAGnD;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,OAAO,SAAS,GAAG,OAAO,WAAmD,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `NavigationSplitView`: in a regular width a `navsplit` of two columns (the
3
+ * sidebar's stack and the detail's), the sidebar toggled by the bar button;
4
+ * in a compact width one stack rooted at the sidebar that pushes the detail
5
+ * while the sidebar's list has a selection, as on iOS.
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ import { type BindingValue } from '../binding';
9
+ import { type ViewModifiers } from '../modifiers';
10
+ export type NavigationSplitViewVisibility = 'automatic' | 'all' | 'doubleColumn' | 'detailOnly';
11
+ /** What the sidebar's `List(selection:)` tells its split view: whether something is selected, and how to clear it. */
12
+ export interface SplitSelection {
13
+ report(selected: boolean, clear: () => void): void;
14
+ }
15
+ export declare const SplitSelectionContext: import("react").Context<SplitSelection | null>;
16
+ export interface NavigationSplitViewProps extends ViewModifiers {
17
+ sidebar: ReactNode;
18
+ detail: ReactNode;
19
+ columnVisibility?: BindingValue<NavigationSplitViewVisibility>;
20
+ onColumnVisibilityChange?: (visibility: NavigationSplitViewVisibility) => void;
21
+ }
22
+ export declare function NavigationSplitView(props: NavigationSplitViewProps): ReactNode;
23
+ /** Used by `List`: tells the enclosing split view whether the sidebar has a selection. */
24
+ export declare function useReportSplitSelection(split: SplitSelection | null, selected: boolean, clear: () => void): void;
25
+ //# sourceMappingURL=split.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../src/components/split.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAoE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzG,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI5D,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAI9E,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG,KAAK,GAAG,cAAc,GAAG,YAAY,CAAC;AAEhG,sHAAsH;AACtH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,qBAAqB,gDAA6C,CAAC;AAEhF,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,YAAY,CAAC,6BAA6B,CAAC,CAAC;IAC/D,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,6BAA6B,KAAK,IAAI,CAAC;CAChF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,SAAS,CAwC9E;AAoCD,0FAA0F;AAC1F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAIhH"}
@@ -0,0 +1,138 @@
1
+ import type { FrameAlignment, GridItem as GridItemProps, GridRowAlignment, HStackAlignment, ScrollAxes, VStackAlignment } from '@swiftbrowser/web/src/protocol';
2
+ import { type Key, type ReactElement, type ReactNode } from 'react';
3
+ import type { EventHandlers } from '../host/instance';
4
+ import { type ViewModifiers } from '../modifiers';
5
+ export interface VStackProps extends ViewModifiers {
6
+ alignment?: VStackAlignment;
7
+ spacing?: number | null;
8
+ /** `.scrollTargetLayout()`: the children are the enclosing scroll view's snap points. */
9
+ scrollTargetLayout?: boolean;
10
+ children?: ReactNode;
11
+ }
12
+ export declare function VStack(props: VStackProps): ReactNode;
13
+ export interface HStackProps extends ViewModifiers {
14
+ alignment?: HStackAlignment | 'firstTextBaseline' | 'lastTextBaseline';
15
+ spacing?: number | null;
16
+ scrollTargetLayout?: boolean;
17
+ children?: ReactNode;
18
+ }
19
+ export declare function HStack(props: HStackProps): ReactNode;
20
+ export interface ZStackProps extends ViewModifiers {
21
+ alignment?: FrameAlignment;
22
+ children?: ReactNode;
23
+ }
24
+ export declare function ZStack(props: ZStackProps): ReactNode;
25
+ export interface SpacerProps extends ViewModifiers {
26
+ minLength?: number | null;
27
+ }
28
+ export declare function Spacer(props: SpacerProps): ReactNode;
29
+ export declare function Divider(props: ViewModifiers): ReactNode;
30
+ export interface ScrollViewProps extends ViewModifiers {
31
+ axes?: ScrollAxes;
32
+ /** `.scrollTargetBehavior(_:)`: snap to the `scrollTargetLayout` children, or a page at a time. */
33
+ scrollTargetBehavior?: 'viewAligned' | 'paging';
34
+ /** `.scrollDismissesKeyboard(.immediately)` */
35
+ scrollDismissesKeyboard?: boolean;
36
+ children?: ReactNode;
37
+ }
38
+ export declare function ScrollView(props: ScrollViewProps): ReactNode;
39
+ /**
40
+ * `.refreshable` above a `List` or `ScrollView`: its props (`refreshable`,
41
+ * `refreshing` while the action runs) and the `refresh` handler.
42
+ */
43
+ export declare function useRefreshable(own?: () => unknown): {
44
+ props: Record<string, unknown>;
45
+ handlers?: EventHandlers;
46
+ };
47
+ export interface GroupProps extends ViewModifiers {
48
+ children?: ReactNode;
49
+ }
50
+ /** `Group { }`: the modifiers apply to each child. */
51
+ export declare function Group(props: GroupProps): ReactNode;
52
+ export interface ForEachProps<T> extends ViewModifiers {
53
+ data: readonly T[];
54
+ /** The identity of each element (`id: \.self` by default, or `.id` when the element has one). */
55
+ id?: (element: T, index: number) => Key;
56
+ /** `.onDelete`: the rows become deletable (a swipe, or edit mode's minus); called with the offsets to remove. */
57
+ onDelete?: (offsets: number[]) => void;
58
+ /** `.deleteDisabled`, per element. */
59
+ deleteDisabled?: (element: T, index: number) => boolean;
60
+ /**
61
+ * `.onMove`: the rows become movable (a grip in edit mode, a long press
62
+ * otherwise); called like `move(fromOffsets:toOffset:)`, with the offsets
63
+ * moved and the offset they go before, counted before the move
64
+ * (`moveItems` applies it to an array).
65
+ */
66
+ onMove?: (offsets: number[], to: number) => void;
67
+ /** `.moveDisabled`, per element. */
68
+ moveDisabled?: (element: T, index: number) => boolean;
69
+ children: (element: T, index: number) => ReactNode;
70
+ }
71
+ /** `Array.move(fromOffsets:toOffset:)`: the array with `offsets` moved before `to` (counted before the move). */
72
+ export declare function moveItems<T>(items: readonly T[], offsets: readonly number[], to: number): T[];
73
+ /** `ForEach(data, id:) { }`: one keyed child per element. */
74
+ export declare function ForEach<T>(props: ForEachProps<T>): ReactNode;
75
+ /**
76
+ * The elements of `children`, through fragments, arrays and `ForEach`, so
77
+ * `Picker` and `TabView` can read their options and tabs.
78
+ */
79
+ export declare function flattenChildren(children: ReactNode, options?: {
80
+ keepLazy?: boolean;
81
+ }): ReactElement[];
82
+ export interface GridItemSpec {
83
+ size?: {
84
+ fixed: number;
85
+ } | {
86
+ flexible: {
87
+ minimum?: number;
88
+ maximum?: number;
89
+ };
90
+ } | {
91
+ adaptive: {
92
+ minimum: number;
93
+ maximum?: number;
94
+ };
95
+ };
96
+ spacing?: number | null;
97
+ alignment?: FrameAlignment | null;
98
+ }
99
+ /** `GridItem(.flexible(), spacing: 8)`; `GridItem.flexible()` for short. */
100
+ export declare function GridItem(spec?: GridItemSpec): GridItemProps;
101
+ export declare namespace GridItem {
102
+ var flexible: (options?: {
103
+ minimum?: number;
104
+ maximum?: number;
105
+ spacing?: number;
106
+ alignment?: FrameAlignment;
107
+ }) => GridItemProps;
108
+ var fixed: (value: number, options?: {
109
+ spacing?: number;
110
+ alignment?: FrameAlignment;
111
+ }) => GridItemProps;
112
+ var adaptive: (options: {
113
+ minimum: number;
114
+ maximum?: number;
115
+ spacing?: number;
116
+ alignment?: FrameAlignment;
117
+ }) => GridItemProps;
118
+ }
119
+ export interface LazyVGridProps extends ViewModifiers {
120
+ columns: GridItemProps[];
121
+ alignment?: FrameAlignment;
122
+ spacing?: number | null;
123
+ children?: ReactNode;
124
+ }
125
+ export declare function LazyVGrid(props: LazyVGridProps): ReactNode;
126
+ export interface GridProps extends ViewModifiers {
127
+ alignment?: FrameAlignment;
128
+ horizontalSpacing?: number | null;
129
+ verticalSpacing?: number | null;
130
+ children?: ReactNode;
131
+ }
132
+ export declare function Grid(props: GridProps): ReactNode;
133
+ export interface GridRowProps extends ViewModifiers {
134
+ alignment?: GridRowAlignment | null;
135
+ children?: ReactNode;
136
+ }
137
+ export declare function GridRow(props: GridRowProps): ReactNode;
138
+ //# sourceMappingUR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`ShareLink`: controls that open the browser's own chooser and share sheet. */
2
+ import type { RGBAColor } from '@swiftbrowser/web/src/protocol';
3
+ import type { ReactNode } from 'react';
4
+ import { type BindingValue } from '../binding';
5
+ import { type ViewModifiers } from '../modifiers';
6
+ export interface ColorPickerProps extends ViewModifiers {
7
+ title?: string;
8
+ label?: ReactNode;
9
+ selection: BindingValue<RGBAColor>;
10
+ onChange?: (color: RGBAColor) => void;
11
+ }
12
+ /** `ColorPicker("Tint", selection:)`: the label and a swatch; tapping opens the browser's color chooser. */
13
+ export declare function ColorPicker(props: ColorPickerProps): ReactNode;
14
+ export interface ShareLinkProps extends ViewModifiers {
15
+ /** What is shared: a URL or text. */
16
+ item: string | URL;
17
+ subject?: string;
18
+ message?: string;
19
+ /** The label; "Share" with the share symbol by default. */
20
+ title?: string;
21
+ children?: ReactNode;
22
+ }
23
+ /** `ShareLink(item:)`: the Web Share API where the browser has it, else a download of the text. */
24
+ export declare function ShareLink(props: ShareLinkProps): ReactNode;
25
+ //# sourceMappingURL=system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/components/system.tsx"],"names":[],"mappings":"AAAA,mGAAmG;AAInG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAM9E,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACvC;AAKD,4GAA4G;AAC5G,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAyB9D;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,qCAAqC;IACrC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,mGAAmG;AACnG,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAgB1D"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * `Table`, drawn as iOS draws one: a list. In a compact width each row shows
3
+ * the first column; in a regular width every column under a row of the
4
+ * column titles, a sortable title a button with the sort's chevron.
5
+ */
6
+ import { type Key, type ReactNode } from 'react';
7
+ import { type BindingValue } from '../binding';
8
+ import { type ViewModifiers } from '../modifiers';
9
+ import { type Selection } from './lists';
10
+ export interface TableColumn<T> {
11
+ title: string;
12
+ /** The cell for a row; a function of the row, or a key whose value is shown as text. */
13
+ content: ((row: T) => ReactNode) | keyof T;
14
+ /** A fixed width; the other columns share the rest. */
15
+ width?: number;
16
+ minWidth?: number;
17
+ maxWidth?: number;
18
+ /** A sortable column: the key its title sorts by (the app sorts the rows by `sortOrder`). */
19
+ sortKey?: string;
20
+ }
21
+ export interface SortDescriptor {
22
+ key: string;
23
+ ascending: boolean;
24
+ }
25
+ export interface TableProps<T, K extends Key = Key> extends ViewModifiers {
26
+ data: readonly T[];
27
+ columns: readonly TableColumn<T>[];
28
+ /** Each row's identity (its `id` property by default), what the selection holds. */
29
+ id?: (row: T, index: number) => K;
30
+ selection?: BindingValue<Set<K>> | BindingValue<K | null>;
31
+ onSelectionChange?: (selection: Selection<K>) => void;
32
+ /** The sort order, first descriptor first; tapping a sortable title puts it first or reverses it. */
33
+ sortOrder?: BindingValue<readonly SortDescriptor[]>;
34
+ }
35
+ export declare function Table<T, K extends Key = Key>(props: TableProps<T, K>): ReactNode;
36
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAsC,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtF,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAI/C,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC;IAC3C,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,GAAG,GAAG,CAAE,SAAQ,aAAa;IACvE,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;IACnB,OAAO,EAAE,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACnC,oFAAoF;IACpF,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1D,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACtD,qGAAqG;IACrG,SAAS,CAAC,EAAE,YAAY,CAAC,SAAS,cAAc,EAAE,CAAC,CAAC;CACrD;AAiBD,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,GAAG,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CA+DhF"}
@@ -0,0 +1,20 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type BindingValue } from '../binding';
3
+ import { type ViewModifiers } from '../modifiers';
4
+ export interface TabViewProps<T> extends ViewModifiers {
5
+ selection?: BindingValue<T>;
6
+ onChange?: (value: T) => void;
7
+ /** `<Tab>` children. */
8
+ children?: ReactNode;
9
+ }
10
+ export declare function TabView<T = number>(props: TabViewProps<T>): ReactNode;
11
+ export interface TabProps<T> extends ViewModifiers {
12
+ title: string;
13
+ systemImage?: string;
14
+ role?: 'search';
15
+ tag?: T;
16
+ children?: ReactNode;
17
+ }
18
+ /** `Tab("Library", systemImage: "books.vertical") { }` */
19
+ export declare function Tab<T>(props: TabProps<T>): ReactNode;
20
+ //# sourceMappingURL=tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EAA4C,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAG5F,MAAM,WAAW,YAAY,CAAC,CAAC,CAAE,SAAQ,aAAa;IACpD,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,wBAAwB;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,OAAO,CAAC,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CAiBrE;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC,CAAE,SAAQ,aAAa;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,0DAA0D;AAC1D,wBAAgB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAOpD"}
@@ -0,0 +1,63 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ViewModifiers } from '../modifiers';
3
+ import { type ColorValue } from '../values';
4
+ export interface TextProps extends ViewModifiers {
5
+ /** Strings and numbers, nested `<Text>`s (`Text + Text`) and inline `<Image>`s. */
6
+ children?: ReactNode;
7
+ italic?: boolean;
8
+ underline?: boolean | {
9
+ color?: ColorValue;
10
+ };
11
+ strikethrough?: boolean | {
12
+ color?: ColorValue;
13
+ };
14
+ /** Points between characters (`.tracking` / `.kerning`). */
15
+ tracking?: number;
16
+ kerning?: number;
17
+ baselineOffset?: number;
18
+ /** A tap on the text opens this URL. */
19
+ link?: string;
20
+ }
21
+ export declare function Text(props: TextProps): ReactNode;
22
+ /**
23
+ * `.redacted(reason: .placeholder)`: the view keeps its size and draws as a
24
+ * rounded block of the tertiary fill, as iOS draws placeholder content.
25
+ */
26
+ export declare function placeholder(node: ReactNode, redacted: boolean | undefined): ReactNode;
27
+ export declare function openURL(url: string): void;
28
+ export interface ImageProps extends ViewModifiers {
29
+ /** An SF Symbol name. */
30
+ systemName?: string;
31
+ /** An asset-catalog image name (the renderer needs the catalog manifest). */
32
+ name?: string;
33
+ /** A remote image whose pixel size is known; `AsyncImage` loads one to learn it. */
34
+ url?: string;
35
+ width?: number;
36
+ height?: number;
37
+ resizable?: boolean;
38
+ }
39
+ export declare function Image(props: ImageProps): ReactNode;
40
+ export interface LabelProps extends ViewModifiers {
41
+ title: ReactNode;
42
+ systemImage?: string;
43
+ image?: string;
44
+ /** A custom icon view instead of a symbol. */
45
+ icon?: ReactNode;
46
+ }
47
+ /** `Label("Favorites", systemImage: "heart.fill")`: an 8pt-spaced `HStack` of icon and title. */
48
+ export declare function Label(props: LabelProps): ReactNode;
49
+ export interface LabeledContentProps extends ViewModifiers {
50
+ label: ReactNode;
51
+ value?: ReactNode;
52
+ children?: ReactNode;
53
+ }
54
+ /** `LabeledContent("Storage", value: "2.4 GB")`: the label, a spacer, the value in the secondary color. */
55
+ export declare function LabeledContent(props: LabeledContentProps): ReactNode;
56
+ export interface LinkProps extends ViewModifiers {
57
+ destination: string;
58
+ title?: string;
59
+ children?: ReactNode;
60
+ }
61
+ /** `Link("Visit the website", destination:)`: a plain button that opens the URL. */
62
+ export declare function Link(props: LinkProps): ReactNode;
63
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAoD,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEpG,OAAO,EAA2B,KAAK,UAAU,EAAmC,MAAM,WAAW,CAAC;AAGtG,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,mFAAmF;IACnF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG;QAAE,KAAK,CAAC,EAAE,UAAU,CAAA;KAAE,CAAC;I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EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,2GAA2G;AAC3G,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CAapE;AAED,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,oFAAoF;AACpF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAIhD"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Named coordinate spaces: `.coordinateSpace(name:)` reports where its view
3
+ * is on screen (a layout-transparent `zstack` with `reportsFrame`), and a
4
+ * `GeometryReader` inside answers `frame({ named })` relative to it.
5
+ */
6
+ import { type ReactNode } from 'react';
7
+ export interface SpaceFrame {
8
+ x: number;
9
+ y: number;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ /** The named spaces around a view: their frames on screen (null until reported). */
14
+ export declare const CoordinateSpacesContext: import("react").Context<Readonly<Record<string, SpaceFrame | null>>>;
15
+ export declare function useCoordinateSpaces(): Readonly<Record<string, SpaceFrame | null>>;
16
+ export declare function CoordinateSpace({ name, children }: {
17
+ name: string;
18
+ children?: ReactNode;
19
+ }): ReactNode;
20
+ //# sourceMappingURL=coordinateSpace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinateSpace.d.ts","sourceRoot":"","sources":["../src/coordinateSpace.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5E,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,sEAAiE,CAAC;AAEtG,wBAAgB,mBAAmB,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC,CAAC,CAEjF;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAkBrG"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `.draggable` and `.dropDestination`. What is dragged stays in React: a
3
+ * lift (`dragstart`) remembers the payload, a drop naming its source hands
4
+ * it to the destination, and `dragend` forgets it. Drops from outside the
5
+ * page arrive as text and files.
6
+ */
7
+ import type { ReactNode } from 'react';
8
+ import type { DropDestinationModifier } from './modifiers';
9
+ export declare function Draggable({ payload, children }: {
10
+ payload: unknown;
11
+ children?: ReactNode;
12
+ }): ReactNode;
13
+ export declare function DropDestination({ action, isTargeted, accepts, children }: DropDestinationModifier & {
14
+ children?: ReactNode;
15
+ }): ReactNode;
16
+ //# sourceMappingURL=dragDrop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dragDrop.d.ts","sourceRoot":"","sources":["../src/dragDrop.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAI3D,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CActG;AAoBD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,uBAAuB,GAAG;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAoBxI"}