panelui-native 0.108.0 → 0.109.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.
- package/lib/module/components/badge/index.js +85 -4
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/button/index.js +12 -0
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/button-group/index.js +3 -0
- package/lib/module/components/button-group/index.js.map +1 -1
- package/lib/module/components/checkbox/index.js +54 -4
- package/lib/module/components/checkbox/index.js.map +1 -1
- package/lib/module/components/chip/index.js +23 -1
- package/lib/module/components/chip/index.js.map +1 -1
- package/lib/module/components/input/index.js +14 -0
- package/lib/module/components/input/index.js.map +1 -1
- package/lib/module/components/map/index.js +157 -5
- package/lib/module/components/map/index.js.map +1 -1
- package/lib/module/components/map/map-insets.js +174 -0
- package/lib/module/components/map/map-insets.js.map +1 -0
- package/lib/module/components/radio-group/index.js +49 -3
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/select/index.js +54 -2
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/switch/index.js +42 -3
- package/lib/module/components/switch/index.js.map +1 -1
- package/lib/module/components/tabs/index.js +147 -1
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/textarea/index.js +18 -0
- package/lib/module/components/textarea/index.js.map +1 -1
- package/lib/module/components/toggle-button/index.js +34 -2
- package/lib/module/components/toggle-button/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/badge/index.d.ts +68 -0
- package/lib/typescript/src/components/badge/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts +12 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button-group/index.d.ts +9 -0
- package/lib/typescript/src/components/button-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/checkbox/index.d.ts +89 -0
- package/lib/typescript/src/components/checkbox/index.d.ts.map +1 -1
- package/lib/typescript/src/components/chip/index.d.ts +24 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input/index.d.ts +30 -0
- package/lib/typescript/src/components/input/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/index.d.ts +67 -1
- package/lib/typescript/src/components/map/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/map-insets.d.ts +80 -0
- package/lib/typescript/src/components/map/map-insets.d.ts.map +1 -0
- package/lib/typescript/src/components/radio-group/index.d.ts +188 -1
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/select/index.d.ts +9 -1
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/switch/index.d.ts +38 -0
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts +10 -1
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/textarea/index.d.ts +18 -0
- package/lib/typescript/src/components/textarea/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toggle-button/index.d.ts +24 -0
- package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +7 -7
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/badge/index.tsx +30 -4
- package/src/components/button/index.tsx +9 -2
- package/src/components/button-group/index.tsx +1 -0
- package/src/components/checkbox/index.tsx +47 -3
- package/src/components/chip/index.tsx +5 -1
- package/src/components/input/index.tsx +6 -0
- package/src/components/map/index.tsx +215 -5
- package/src/components/map/map-insets.ts +169 -0
- package/src/components/radio-group/index.tsx +56 -4
- package/src/components/select/index.tsx +50 -1
- package/src/components/switch/index.tsx +16 -4
- package/src/components/tabs/index.tsx +61 -0
- package/src/components/textarea/index.tsx +6 -0
- package/src/components/toggle-button/index.tsx +16 -1
- package/src/index.ts +8 -3
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
import { View } from 'react-native';
|
|
2
2
|
import { type VariantProps } from 'tailwind-variants';
|
|
3
3
|
declare const checkboxVariants: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
size: {
|
|
5
|
+
xs: {
|
|
6
|
+
row: string;
|
|
7
|
+
box: string;
|
|
8
|
+
fill: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
sm: {
|
|
13
|
+
row: string;
|
|
14
|
+
box: string;
|
|
15
|
+
fill: string;
|
|
16
|
+
label: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
md: {};
|
|
20
|
+
lg: {
|
|
21
|
+
row: string;
|
|
22
|
+
box: string;
|
|
23
|
+
label: string;
|
|
24
|
+
};
|
|
25
|
+
xl: {
|
|
26
|
+
row: string;
|
|
27
|
+
box: string;
|
|
28
|
+
fill: string;
|
|
29
|
+
label: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
4
33
|
variant: {
|
|
5
34
|
default: {};
|
|
6
35
|
/**
|
|
@@ -28,6 +57,35 @@ declare const checkboxVariants: import("tailwind-variants").TVReturnType<{
|
|
|
28
57
|
label: string;
|
|
29
58
|
description: string;
|
|
30
59
|
}, undefined, {
|
|
60
|
+
size: {
|
|
61
|
+
xs: {
|
|
62
|
+
row: string;
|
|
63
|
+
box: string;
|
|
64
|
+
fill: string;
|
|
65
|
+
label: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
sm: {
|
|
69
|
+
row: string;
|
|
70
|
+
box: string;
|
|
71
|
+
fill: string;
|
|
72
|
+
label: string;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
md: {};
|
|
76
|
+
lg: {
|
|
77
|
+
row: string;
|
|
78
|
+
box: string;
|
|
79
|
+
label: string;
|
|
80
|
+
};
|
|
81
|
+
xl: {
|
|
82
|
+
row: string;
|
|
83
|
+
box: string;
|
|
84
|
+
fill: string;
|
|
85
|
+
label: string;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
31
89
|
variant: {
|
|
32
90
|
default: {};
|
|
33
91
|
/**
|
|
@@ -55,6 +113,35 @@ declare const checkboxVariants: import("tailwind-variants").TVReturnType<{
|
|
|
55
113
|
label: string;
|
|
56
114
|
description: string;
|
|
57
115
|
}, import("tailwind-variants").TVReturnType<{
|
|
116
|
+
size: {
|
|
117
|
+
xs: {
|
|
118
|
+
row: string;
|
|
119
|
+
box: string;
|
|
120
|
+
fill: string;
|
|
121
|
+
label: string;
|
|
122
|
+
description: string;
|
|
123
|
+
};
|
|
124
|
+
sm: {
|
|
125
|
+
row: string;
|
|
126
|
+
box: string;
|
|
127
|
+
fill: string;
|
|
128
|
+
label: string;
|
|
129
|
+
description: string;
|
|
130
|
+
};
|
|
131
|
+
md: {};
|
|
132
|
+
lg: {
|
|
133
|
+
row: string;
|
|
134
|
+
box: string;
|
|
135
|
+
label: string;
|
|
136
|
+
};
|
|
137
|
+
xl: {
|
|
138
|
+
row: string;
|
|
139
|
+
box: string;
|
|
140
|
+
fill: string;
|
|
141
|
+
label: string;
|
|
142
|
+
description: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
58
145
|
variant: {
|
|
59
146
|
default: {};
|
|
60
147
|
/**
|
|
@@ -82,6 +169,8 @@ declare const checkboxVariants: import("tailwind-variants").TVReturnType<{
|
|
|
82
169
|
label: string;
|
|
83
170
|
description: string;
|
|
84
171
|
}, undefined, unknown, unknown, undefined>>;
|
|
172
|
+
/** How big a checkbox is. */
|
|
173
|
+
export type CheckboxSize = NonNullable<VariantProps<typeof checkboxVariants>['size']>;
|
|
85
174
|
export interface CheckboxProps extends VariantProps<typeof checkboxVariants> {
|
|
86
175
|
/**
|
|
87
176
|
* Styles the pressable row — layout, border, fill. It does not reach the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkbox/index.tsx"],"names":[],"mappings":"AACA,OAAO,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AAO,MAAM,QAAQ,gGA0FpB,CAAC"}
|
|
@@ -61,6 +61,10 @@ declare const chipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
size: {
|
|
64
|
+
xs: {
|
|
65
|
+
root: string;
|
|
66
|
+
label: string;
|
|
67
|
+
};
|
|
64
68
|
sm: {
|
|
65
69
|
root: string;
|
|
66
70
|
label: string;
|
|
@@ -73,6 +77,10 @@ declare const chipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
73
77
|
root: string;
|
|
74
78
|
label: string;
|
|
75
79
|
};
|
|
80
|
+
xl: {
|
|
81
|
+
root: string;
|
|
82
|
+
label: string;
|
|
83
|
+
};
|
|
76
84
|
};
|
|
77
85
|
/**
|
|
78
86
|
* The filter "on" state — a loud accent surface that wins over the resting
|
|
@@ -134,6 +142,10 @@ declare const chipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
134
142
|
};
|
|
135
143
|
};
|
|
136
144
|
size: {
|
|
145
|
+
xs: {
|
|
146
|
+
root: string;
|
|
147
|
+
label: string;
|
|
148
|
+
};
|
|
137
149
|
sm: {
|
|
138
150
|
root: string;
|
|
139
151
|
label: string;
|
|
@@ -146,6 +158,10 @@ declare const chipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
146
158
|
root: string;
|
|
147
159
|
label: string;
|
|
148
160
|
};
|
|
161
|
+
xl: {
|
|
162
|
+
root: string;
|
|
163
|
+
label: string;
|
|
164
|
+
};
|
|
149
165
|
};
|
|
150
166
|
/**
|
|
151
167
|
* The filter "on" state — a loud accent surface that wins over the resting
|
|
@@ -207,6 +223,10 @@ declare const chipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
207
223
|
};
|
|
208
224
|
};
|
|
209
225
|
size: {
|
|
226
|
+
xs: {
|
|
227
|
+
root: string;
|
|
228
|
+
label: string;
|
|
229
|
+
};
|
|
210
230
|
sm: {
|
|
211
231
|
root: string;
|
|
212
232
|
label: string;
|
|
@@ -219,6 +239,10 @@ declare const chipVariants: import("tailwind-variants").TVReturnType<{
|
|
|
219
239
|
root: string;
|
|
220
240
|
label: string;
|
|
221
241
|
};
|
|
242
|
+
xl: {
|
|
243
|
+
root: string;
|
|
244
|
+
label: string;
|
|
245
|
+
};
|
|
222
246
|
};
|
|
223
247
|
/**
|
|
224
248
|
* The filter "on" state — a loud accent surface that wins over the resting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/chip/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,IAAI,EAAkB,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAK7C,QAAA,MAAM,YAAY;;QASZ,8CAA8C;;;;;QAE9C,oDAAoD;;;;;QAEpD,4EAA4E
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/chip/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,IAAI,EAAkB,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAK7C,QAAA,MAAM,YAAY;;QASZ,8CAA8C;;;;;QAE9C,oDAAoD;;;;;QAEpD,4EAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuB9E;;;OAGG;;;;;;;IAOH,0EAA0E;;;;;;;;;;;;;;;;;QArCxE,8CAA8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GG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA6HD,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,cAAc,+BAMzD;kBANQ,SAAS;;;AASlB,eAAO,MAAM,IAAI;;CAEf,CAAC"}
|
|
@@ -53,6 +53,11 @@ declare const inputVariants: import("tailwind-variants").TVReturnType<{
|
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
size: {
|
|
56
|
+
xs: {
|
|
57
|
+
field: string;
|
|
58
|
+
startContent: string;
|
|
59
|
+
endContent: string;
|
|
60
|
+
};
|
|
56
61
|
sm: {
|
|
57
62
|
field: string;
|
|
58
63
|
startContent: string;
|
|
@@ -68,6 +73,11 @@ declare const inputVariants: import("tailwind-variants").TVReturnType<{
|
|
|
68
73
|
startContent: string;
|
|
69
74
|
endContent: string;
|
|
70
75
|
};
|
|
76
|
+
xl: {
|
|
77
|
+
field: string;
|
|
78
|
+
startContent: string;
|
|
79
|
+
endContent: string;
|
|
80
|
+
};
|
|
71
81
|
};
|
|
72
82
|
multiline: {
|
|
73
83
|
true: {
|
|
@@ -101,6 +111,11 @@ declare const inputVariants: import("tailwind-variants").TVReturnType<{
|
|
|
101
111
|
};
|
|
102
112
|
};
|
|
103
113
|
size: {
|
|
114
|
+
xs: {
|
|
115
|
+
field: string;
|
|
116
|
+
startContent: string;
|
|
117
|
+
endContent: string;
|
|
118
|
+
};
|
|
104
119
|
sm: {
|
|
105
120
|
field: string;
|
|
106
121
|
startContent: string;
|
|
@@ -116,6 +131,11 @@ declare const inputVariants: import("tailwind-variants").TVReturnType<{
|
|
|
116
131
|
startContent: string;
|
|
117
132
|
endContent: string;
|
|
118
133
|
};
|
|
134
|
+
xl: {
|
|
135
|
+
field: string;
|
|
136
|
+
startContent: string;
|
|
137
|
+
endContent: string;
|
|
138
|
+
};
|
|
119
139
|
};
|
|
120
140
|
multiline: {
|
|
121
141
|
true: {
|
|
@@ -149,6 +169,11 @@ declare const inputVariants: import("tailwind-variants").TVReturnType<{
|
|
|
149
169
|
};
|
|
150
170
|
};
|
|
151
171
|
size: {
|
|
172
|
+
xs: {
|
|
173
|
+
field: string;
|
|
174
|
+
startContent: string;
|
|
175
|
+
endContent: string;
|
|
176
|
+
};
|
|
152
177
|
sm: {
|
|
153
178
|
field: string;
|
|
154
179
|
startContent: string;
|
|
@@ -164,6 +189,11 @@ declare const inputVariants: import("tailwind-variants").TVReturnType<{
|
|
|
164
189
|
startContent: string;
|
|
165
190
|
endContent: string;
|
|
166
191
|
};
|
|
192
|
+
xl: {
|
|
193
|
+
field: string;
|
|
194
|
+
startContent: string;
|
|
195
|
+
endContent: string;
|
|
196
|
+
};
|
|
167
197
|
};
|
|
168
198
|
multiline: {
|
|
169
199
|
true: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/input/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,EAAgD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EACL,SAAS,EAGT,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAoC,CAAC;AAUhF,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/input/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,EAAgD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EACL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,MAAM,CAAC;CAC9B;AAID,eAAO,MAAM,KAAK,kGA8NjB,CAAC"}
|
|
@@ -18,6 +18,19 @@
|
|
|
18
18
|
* </Map>
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
|
+
* Anything else drawn over the map goes in a `Map.Overlay`. It is pinned to an
|
|
22
|
+
* edge or a corner and tells the map how much room it takes, so a control
|
|
23
|
+
* stack in the same corner sits past it rather than underneath:
|
|
24
|
+
*
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Map center={[-0.12, 51.5]} zoom={11}>
|
|
27
|
+
* <Map.Overlay position="bottom" safeArea>
|
|
28
|
+
* <Card>…</Card>
|
|
29
|
+
* </Map.Overlay>
|
|
30
|
+
* <Map.Controls position="bottom-right" />
|
|
31
|
+
* </Map>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
21
34
|
* The renderer is native and optional, so `Map` has a state no other component
|
|
22
35
|
* here does: it may be unable to draw at all. It says so in place rather than
|
|
23
36
|
* throwing, because the usual way to reach that state is running in a client
|
|
@@ -34,9 +47,11 @@ import { type PressableProps, type ViewProps } from 'react-native';
|
|
|
34
47
|
import { CARTO_SOURCE, type BasemapSource, type BasemapTokens } from './basemap.js';
|
|
35
48
|
import { hasMapLibre, type CameraRef, type LngLat, type LngLatBounds, type MapRef, type PixelPoint, type StyleSpecification, type ViewPadding, type ViewState } from './maplibre.js';
|
|
36
49
|
import { type MapFeatureAccessibility } from './map-accessibility.js';
|
|
50
|
+
import { type MapOverlayPosition } from './map-insets.js';
|
|
37
51
|
export { hasMapLibre, CARTO_SOURCE };
|
|
38
52
|
export type { BasemapSource, BasemapTokens, LngLat, LngLatBounds, PixelPoint, ViewPadding, ViewState, };
|
|
39
53
|
export type { MapFeatureAccessibility } from './map-accessibility.js';
|
|
54
|
+
export type { MapOverlayPosition } from './map-insets.js';
|
|
40
55
|
export type MapControlsPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
41
56
|
interface MapContextValue {
|
|
42
57
|
mapRef: React.RefObject<MapRef | null>;
|
|
@@ -226,6 +241,19 @@ declare namespace MapPopup {
|
|
|
226
241
|
export interface MapControlsProps {
|
|
227
242
|
/** Which corner the stack sits in. */
|
|
228
243
|
position?: MapControlsPosition;
|
|
244
|
+
/**
|
|
245
|
+
* How far the stack sits from the map's edges, in points: one number for
|
|
246
|
+
* every side, or only the sides that need one. Defaults to 12. For chrome
|
|
247
|
+
* that floats over the map without being inside it, such as a translucent
|
|
248
|
+
* tab bar or a header.
|
|
249
|
+
*/
|
|
250
|
+
inset?: number | ViewPadding;
|
|
251
|
+
/**
|
|
252
|
+
* Keep clear of the status bar and the home indicator, for a map that runs
|
|
253
|
+
* underneath them. Reads the insets from the nearest `SafeAreaProvider` and
|
|
254
|
+
* does nothing without one.
|
|
255
|
+
*/
|
|
256
|
+
safeArea?: boolean;
|
|
229
257
|
/** Zoom in and out. On by default — it is the one control a map always needs. */
|
|
230
258
|
zoom?: boolean;
|
|
231
259
|
/** Recentre on the device's location. Needs a location permission. */
|
|
@@ -249,10 +277,47 @@ export interface MapControlsProps {
|
|
|
249
277
|
* off in `Map` and replaced here by buttons built from the same tokens as
|
|
250
278
|
* every other control in the library.
|
|
251
279
|
*/
|
|
252
|
-
declare function MapControls({ position, zoom, locate, compass, recenter, className, onLocate, }: MapControlsProps): import("react").JSX.Element;
|
|
280
|
+
declare function MapControls({ position, inset, safeArea, zoom, locate, compass, recenter, className, onLocate, }: MapControlsProps): import("react").JSX.Element;
|
|
253
281
|
declare namespace MapControls {
|
|
254
282
|
var displayName: string;
|
|
255
283
|
}
|
|
284
|
+
export interface MapOverlayProps extends Omit<ViewProps, 'children'> {
|
|
285
|
+
children?: ReactNode;
|
|
286
|
+
/**
|
|
287
|
+
* Where it is pinned: `top` or `bottom` for a band across the map between
|
|
288
|
+
* its insets, or a corner (`top-left`, `top-right`, `bottom-left`,
|
|
289
|
+
* `bottom-right`), which is as wide as what is inside it.
|
|
290
|
+
*/
|
|
291
|
+
position?: MapOverlayPosition;
|
|
292
|
+
/**
|
|
293
|
+
* How far it sits from the map's edges, in points: one number for every
|
|
294
|
+
* side, or only the sides that need one. Defaults to 12. Pass `0` for a card
|
|
295
|
+
* that runs edge to edge.
|
|
296
|
+
*/
|
|
297
|
+
inset?: number | ViewPadding;
|
|
298
|
+
/**
|
|
299
|
+
* Keep clear of the status bar and the home indicator, for a map that runs
|
|
300
|
+
* underneath them. Reads the insets from the nearest `SafeAreaProvider` and
|
|
301
|
+
* does nothing without one.
|
|
302
|
+
*/
|
|
303
|
+
safeArea?: boolean;
|
|
304
|
+
className?: string;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* A place for your own views over the map.
|
|
308
|
+
*
|
|
309
|
+
* Any view can already be a child of `Map` and positioned by hand. What this
|
|
310
|
+
* adds is that the map knows about it: it is measured, and a `Map.Controls`
|
|
311
|
+
* in the same corner moves past it. Without that each is positioned without
|
|
312
|
+
* knowing where the other is, and the card lands on the zoom buttons.
|
|
313
|
+
*
|
|
314
|
+
* The container itself takes no touches, so the map underneath still pans in
|
|
315
|
+
* the gaps around whatever is inside it.
|
|
316
|
+
*/
|
|
317
|
+
declare function MapOverlay({ position, inset, safeArea, className, style, onLayout, children, ...props }: MapOverlayProps): import("react").JSX.Element;
|
|
318
|
+
declare namespace MapOverlay {
|
|
319
|
+
var displayName: string;
|
|
320
|
+
}
|
|
256
321
|
export interface MapRouteProps {
|
|
257
322
|
/** The path, in order. */
|
|
258
323
|
coordinates: LngLat[];
|
|
@@ -446,6 +511,7 @@ export declare const Map: import("react").ForwardRefExoticComponent<MapProps & i
|
|
|
446
511
|
Label: typeof MapLabel;
|
|
447
512
|
Popup: typeof MapPopup;
|
|
448
513
|
Controls: typeof MapControls;
|
|
514
|
+
Overlay: typeof MapOverlay;
|
|
449
515
|
Route: typeof MapRoute;
|
|
450
516
|
Arc: typeof MapArc;
|
|
451
517
|
GeoJSON: typeof MapGeoJSON;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/map/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/map/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAaL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AActB,OAAO,EAEL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,cAAW,CAAC;AACnB,OAAO,EACL,WAAW,EAEX,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,eAAY,CAAC;AACpB,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,wBAAqB,CAAC;AAE7B,OAAO,EAOL,KAAK,kBAAkB,EAExB,MAAM,iBAAc,CAAC;AAGtB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACrC,YAAY,EACV,aAAa,EACb,aAAa,EACb,MAAM,EACN,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,CAAC;AACF,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAqB,CAAC;AACnE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAc,CAAC;AAsDvD,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AA6CnB,UAAU,eAAe;IACvB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,CA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EACd,OAAY,EACZ,MAAc,EACd,EAAc,GACf,EAAE,eAAe,sCAqIjB;kBAhJQ,UAAU;;;AAoJnB,MAAM,WAAW,oBAAoB;IACnC,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wDAAwD;AACxD,iBAAS,eAAe,CAAC,EACvB,OAAe,EACf,QAAgB,GACjB,EAAE,oBAAoB,sCAItB;kBAPQ,eAAe;;;AAWxB,eAAO,MAAM,GAAG;;;;;;;;;;;;CAYd,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where things sit once something else is drawn over the map.
|
|
3
|
+
*
|
|
4
|
+
* A map that fills the screen usually has chrome on top of it: a card of
|
|
5
|
+
* figures along the top, a summary along the bottom, the status bar, a
|
|
6
|
+
* floating tab bar. The controls belong in a corner, and a corner is exactly
|
|
7
|
+
* where that chrome goes, so left alone they end up underneath it.
|
|
8
|
+
*
|
|
9
|
+
* Everything drawn over the map therefore says how far in from its edge it
|
|
10
|
+
* reaches, and the controls take the largest claim on their corner and sit
|
|
11
|
+
* past it. This file is that arithmetic and nothing else, kept apart from the
|
|
12
|
+
* views so it can be checked without a device.
|
|
13
|
+
*/
|
|
14
|
+
export type MapCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
15
|
+
/** A band across the whole of one edge, or a single corner. */
|
|
16
|
+
export type MapOverlayPosition = 'top' | 'bottom' | MapCorner;
|
|
17
|
+
/** A distance from each edge of the map, in points. */
|
|
18
|
+
export interface MapInsets {
|
|
19
|
+
top: number;
|
|
20
|
+
right: number;
|
|
21
|
+
bottom: number;
|
|
22
|
+
left: number;
|
|
23
|
+
}
|
|
24
|
+
/** One number for every side, or only the sides that need one. */
|
|
25
|
+
export type MapInsetsInput = number | Partial<MapInsets>;
|
|
26
|
+
/** What one overlay takes: where it is, and how far in from that edge it reaches. */
|
|
27
|
+
export interface MapReservation {
|
|
28
|
+
position: MapOverlayPosition;
|
|
29
|
+
/** Points from the map's top or bottom edge to the overlay's far side. */
|
|
30
|
+
extent: number;
|
|
31
|
+
}
|
|
32
|
+
/** The style offsets that pin a view: one vertical side and, for a corner, one horizontal. */
|
|
33
|
+
export type MapOffsets = Partial<MapInsets>;
|
|
34
|
+
/** Expands the `inset` shorthand to four sides. */
|
|
35
|
+
export declare function toMapInsets(inset: MapInsetsInput | undefined): MapInsets;
|
|
36
|
+
/** Two sets of insets, side by side. */
|
|
37
|
+
export declare function addMapInsets(a: MapInsets, b: MapInsets): MapInsets;
|
|
38
|
+
/** The corners a position covers. A band covers both corners of its edge. */
|
|
39
|
+
export declare function cornersOf(position: MapOverlayPosition): MapCorner[];
|
|
40
|
+
/** The furthest any overlay reaches into a corner. 0 when nothing is there. */
|
|
41
|
+
export declare function reservedAt(corner: MapCorner, reservations: Iterable<MapReservation>): number;
|
|
42
|
+
/**
|
|
43
|
+
* Where an overlay is pinned, and how far it reaches once it has a height.
|
|
44
|
+
*
|
|
45
|
+
* A band is pinned on three sides so it spans the map between its insets. A
|
|
46
|
+
* corner is pinned on two and is as wide as what is inside it.
|
|
47
|
+
*/
|
|
48
|
+
export declare function overlayOffsets(position: MapOverlayPosition, inset: MapInsets): MapOffsets;
|
|
49
|
+
/**
|
|
50
|
+
* The reservation an overlay makes once it has been measured.
|
|
51
|
+
*
|
|
52
|
+
* Nothing until it has a height. An overlay that is empty, or has not been
|
|
53
|
+
* laid out yet, would otherwise claim its inset alone and nudge the controls
|
|
54
|
+
* by a gap for a frame before moving them to where they belong.
|
|
55
|
+
*/
|
|
56
|
+
export declare function overlayReservation(position: MapOverlayPosition, inset: MapInsets, height: number): MapReservation | null;
|
|
57
|
+
/**
|
|
58
|
+
* The distance a part keeps from each edge of the map.
|
|
59
|
+
*
|
|
60
|
+
* `inset` means the same thing on `Map.Controls` and `Map.Overlay`: how far
|
|
61
|
+
* from the edge, with the standard gap on any side it leaves out. The safe
|
|
62
|
+
* area is added on top, because a card 12 points from the edge of the screen
|
|
63
|
+
* and a card 12 points below the status bar are both "12 points in" to the
|
|
64
|
+
* person looking at them.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveMapInsets(inset: MapInsetsInput | undefined, gap: number, safeArea: MapInsets): MapInsets;
|
|
67
|
+
/**
|
|
68
|
+
* Where a control stack in `corner` goes.
|
|
69
|
+
*
|
|
70
|
+
* `inset` is the stack's own distance from the map's edges. `reserved` is what
|
|
71
|
+
* an overlay has taken from the same edge, and the stack sits one `gap` past
|
|
72
|
+
* it. The two are not added: an overlay that already clears the status bar has
|
|
73
|
+
* cleared it for the controls too, so whichever reaches further decides.
|
|
74
|
+
*/
|
|
75
|
+
export declare function controlsOffsets(corner: MapCorner, { gap, inset, reserved }: {
|
|
76
|
+
gap: number;
|
|
77
|
+
inset: MapInsets;
|
|
78
|
+
reserved: number;
|
|
79
|
+
}): MapOffsets;
|
|
80
|
+
//# sourceMappingURL=map-insets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-insets.d.ts","sourceRoot":"","sources":["../../../../../src/components/map/map-insets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAElF,+DAA+D;AAC/D,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9D,uDAAuD;AACvD,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kEAAkE;AAClE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEzD,qFAAqF;AACrF,MAAM,WAAW,cAAc;IAC7B,QAAQ,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