flet-box 1.0.6 → 1.0.8

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 (162) hide show
  1. package/README.md +28 -1
  2. package/bin/cli.js +90 -11
  3. package/bin/commands/auditFix.js +682 -0
  4. package/bin/commands/checkApi.js +20 -6
  5. package/bin/commands/checkUi.js +1369 -0
  6. package/bin/commands/create.js +86 -12
  7. package/bin/commands/createBundle.js +75 -1
  8. package/bin/commands/images.js +349 -0
  9. package/bin/commands/pruneAssets.js +170 -0
  10. package/bin/commands/release.js +34 -1
  11. package/bin/commands/runCloudflare.js +47 -9
  12. package/bin/commands/runServer.js +91 -25
  13. package/bin/commands/toPng.js +346 -0
  14. package/bin/commands/unpack.js +1173 -0
  15. package/bin/ota/loader.js +90 -0
  16. package/bin/utils/appSources.js +101 -0
  17. package/bin/utils/bundleConfig.js +166 -0
  18. package/bin/utils/dtsProps.js +147 -0
  19. package/bin/utils/imageTools.js +271 -0
  20. package/bin/utils/images/bmp.js +99 -0
  21. package/bin/utils/images/gif.js +244 -0
  22. package/bin/utils/images/index.js +163 -0
  23. package/bin/utils/images/jpeg.js +643 -0
  24. package/bin/utils/images/png.js +486 -0
  25. package/bin/utils/images/unsupported.js +29 -0
  26. package/bin/utils/neutralise.js +109 -6
  27. package/bin/utils/pwaShell.js +137 -0
  28. package/bin/utils/templates.js +1653 -471
  29. package/docs/README.md +2 -0
  30. package/docs/cli/README.md +144 -1
  31. package/docs/guides/README.md +2 -0
  32. package/docs/guides/clean-ui.md +211 -0
  33. package/docs/guides/minification-and-protection.md +1 -1
  34. package/docs/guides/online-updates.md +105 -9
  35. package/docs/tools/README.md +1 -1
  36. package/docs/tools/animation.md +1 -1
  37. package/docs/tools/markdown.md +3 -3
  38. package/docs/tools/theme.md +41 -1
  39. package/docs/widget/Accordion.md +4 -0
  40. package/docs/widget/AdMob.md +5 -1
  41. package/docs/widget/AdSense.md +4 -0
  42. package/docs/widget/AnimatedBox.md +7 -3
  43. package/docs/widget/AnimatedText.md +4 -0
  44. package/docs/widget/Audio.md +5 -1
  45. package/docs/widget/Avatar.md +15 -3
  46. package/docs/widget/Badge.md +4 -0
  47. package/docs/widget/Button.md +4 -0
  48. package/docs/widget/COMMON_PROPS.md +52 -0
  49. package/docs/widget/Card.md +4 -0
  50. package/docs/widget/Carousel.md +4 -0
  51. package/docs/widget/Chart.md +4 -0
  52. package/docs/widget/Checkbox.md +4 -0
  53. package/docs/widget/Chip.md +4 -0
  54. package/docs/widget/CircularBar.md +4 -0
  55. package/docs/widget/CircularChart.md +4 -0
  56. package/docs/widget/CodeViewer.md +4 -0
  57. package/docs/widget/Column.md +4 -0
  58. package/docs/widget/Container.md +4 -0
  59. package/docs/widget/DataTable.md +4 -0
  60. package/docs/widget/Divider.md +4 -0
  61. package/docs/widget/DraggBox.md +6 -2
  62. package/docs/widget/Dropdown.md +6 -0
  63. package/docs/widget/DroppBox.md +5 -1
  64. package/docs/widget/FloatingActionButton.md +4 -0
  65. package/docs/widget/GridView.md +4 -0
  66. package/docs/widget/Icon.md +4 -0
  67. package/docs/widget/Image.md +14 -3
  68. package/docs/widget/Input.md +4 -0
  69. package/docs/widget/Inspector.md +2 -2
  70. package/docs/widget/InstallButton.md +4 -0
  71. package/docs/widget/ListTile.md +4 -0
  72. package/docs/widget/ListView.md +4 -0
  73. package/docs/widget/Maps.md +191 -0
  74. package/docs/widget/Markdown.md +4 -0
  75. package/docs/widget/MatrixRain.md +4 -0
  76. package/docs/widget/Pagination.md +4 -0
  77. package/docs/widget/ParallaxBox.md +4 -0
  78. package/docs/widget/ProgressBar.md +4 -0
  79. package/docs/widget/QRCode.md +4 -0
  80. package/docs/widget/README.md +12 -10
  81. package/docs/widget/Radio.md +5 -1
  82. package/docs/widget/Rating.md +4 -0
  83. package/docs/widget/Row.md +4 -0
  84. package/docs/widget/Skeleton.md +4 -0
  85. package/docs/widget/Slider.md +4 -0
  86. package/docs/widget/Stack.md +4 -0
  87. package/docs/widget/Stepper.md +4 -0
  88. package/docs/widget/Switch.md +4 -0
  89. package/docs/widget/Tabs.md +5 -5
  90. package/docs/widget/Text.md +4 -0
  91. package/docs/widget/Tooltip.md +14 -13
  92. package/docs/widget/TreeView.md +4 -0
  93. package/docs/widget/Video.md +6 -2
  94. package/package.json +2 -2
  95. package/src/animations/AnimatedBox.js +4 -1
  96. package/src/animations/MatrixRain.js +3 -3
  97. package/src/core/hmr-client.js +129 -34
  98. package/src/index.d.ts +195 -7
  99. package/src/index.js +2 -0
  100. package/src/navigations/AppBar.js +22 -16
  101. package/src/navigations/BottomNavigation.js +8 -13
  102. package/src/navigations/CollapsibleSideBar.js +30 -8
  103. package/src/navigations/Drawer.js +25 -15
  104. package/src/navigations/DrawerItem.js +3 -1
  105. package/src/navigations/Scaffold.js +26 -12
  106. package/src/navigations/Tabs.js +104 -59
  107. package/src/tools/color.js +54 -0
  108. package/src/tools/index.js +9 -1
  109. package/src/tools/scale.js +41 -0
  110. package/src/tools/shadow.js +20 -0
  111. package/src/utils/index.js +1 -0
  112. package/src/utils/readableInk.js +19 -0
  113. package/src/utils/syntaxHighlight.js +78 -10
  114. package/src/utils/themes.js +217 -54
  115. package/src/utils/units.js +33 -11
  116. package/src/widget-factory/effects.js +56 -5
  117. package/src/widget-factory/processProps.js +10 -1
  118. package/src/widget-factory/remTool.js +15 -29
  119. package/src/widget-factory/stackPosition.js +18 -3
  120. package/src/widget-factory/translateProps.js +60 -1
  121. package/src/widgets/Accordion.js +20 -23
  122. package/src/widgets/AdMob.js +7 -2
  123. package/src/widgets/Avatar.js +236 -133
  124. package/src/widgets/Badge.js +3 -2
  125. package/src/widgets/BottomSheet.js +14 -13
  126. package/src/widgets/Button.js +69 -30
  127. package/src/widgets/Card.js +6 -2
  128. package/src/widgets/Carousel.js +12 -10
  129. package/src/widgets/Chart.js +28 -5
  130. package/src/widgets/Checkbox.js +76 -18
  131. package/src/widgets/Chip.js +31 -10
  132. package/src/widgets/CircularBar.js +7 -7
  133. package/src/widgets/CircularChart.js +26 -8
  134. package/src/widgets/CodeViewer.js +93 -20
  135. package/src/widgets/Container.js +13 -0
  136. package/src/widgets/DataTable.js +17 -11
  137. package/src/widgets/DraggBox.js +2 -1
  138. package/src/widgets/Dropdown.js +59 -14
  139. package/src/widgets/DroppBox.js +4 -2
  140. package/src/widgets/FloatingActionButton.js +13 -7
  141. package/src/widgets/Icon.js +3 -1
  142. package/src/widgets/Image.js +102 -3
  143. package/src/widgets/Input.js +30 -23
  144. package/src/widgets/Inspector.js +54 -1
  145. package/src/widgets/InstallButton.js +6 -4
  146. package/src/widgets/ListTile.js +4 -3
  147. package/src/widgets/ListView.js +30 -12
  148. package/src/widgets/Maps.js +1495 -0
  149. package/src/widgets/Markdown.js +37 -26
  150. package/src/widgets/Modal.js +14 -11
  151. package/src/widgets/Pagination.js +16 -11
  152. package/src/widgets/ProgressBar.js +6 -4
  153. package/src/widgets/Radio.js +73 -15
  154. package/src/widgets/Rating.js +24 -6
  155. package/src/widgets/Skeleton.js +31 -31
  156. package/src/widgets/Slider.js +29 -18
  157. package/src/widgets/SnackBar.js +35 -39
  158. package/src/widgets/Stepper.js +13 -9
  159. package/src/widgets/Switch.js +59 -18
  160. package/src/widgets/Tooltip.js +24 -12
  161. package/src/widgets/TreeView.js +27 -15
  162. package/src/widgets/index.js +1 -0
@@ -53,10 +53,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
53
53
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
54
54
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
55
55
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
56
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
56
57
  | `color` | `Color` | Foreground color, usually the text or icon color. |
57
58
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
58
59
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
59
60
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
61
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
62
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
63
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
60
64
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
61
65
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
62
66
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -112,6 +116,7 @@ const country = Dropdown({
112
116
 
113
117
  - Pass objects with value/label when the value sent to onChange must differ from the text shown, such as an id versus a name.
114
118
  - Set clearable: true to give users an explicit way back to no selection.
119
+ - Bind a useState value to `value` to move the selection from code, such as auto-picking a default after a lookup; pass `''` to clear it back to the placeholder.
115
120
 
116
121
  ## Accessibility
117
122
 
@@ -121,6 +126,7 @@ const country = Dropdown({
121
126
 
122
127
  - The option menu is portaled to document.body by default and repositions on scroll/resize; set portal: false to keep it inline.
123
128
  - The returned element exposes value, open(), close() and update(), and removes its listeners on unmount.
129
+ - A value applied from outside — a bound state change or `dropdown.value = x` — re-fires onChange when it differs from the current selection, and is ignored when it is the same, so a state → value → onChange → state loop settles after one pass.
124
130
 
125
131
  ## Related widgets
126
132
 
@@ -61,10 +61,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
61
61
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
62
62
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
63
63
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
64
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
64
65
  | `color` | `Color` | Foreground color, usually the text or icon color. |
65
66
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
66
67
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
67
68
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
69
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
70
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
71
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
68
72
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
69
73
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
70
74
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -149,4 +153,4 @@ const zone = DroppBox({
149
153
  - **Next:** [Scaffold](Scaffold.md) — Chapter 8 · App navigation
150
154
  - **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
151
155
 
152
- You are reading **Chapter 7 · Media and drag & drop** (4 of 4).
156
+ You are reading **Chapter 7 · Media and drag & drop** (5 of 5).
@@ -45,10 +45,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
45
45
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
46
46
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
47
47
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
48
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
48
49
  | `color` | `Color` | Foreground color, usually the text or icon color. |
49
50
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
50
51
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
51
52
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
53
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
54
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
55
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
52
56
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
53
57
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
54
58
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -54,10 +54,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
54
54
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
55
55
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
56
56
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
57
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
57
58
  | `color` | `Color` | Foreground color, usually the text or icon color. |
58
59
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
59
60
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
60
61
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
62
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
63
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
64
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
61
65
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
62
66
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
63
67
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -39,10 +39,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
39
39
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
40
40
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
41
41
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
42
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
42
43
  | `color` | `Color` | Foreground color, usually the text or icon color. |
43
44
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
44
45
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
45
46
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
47
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
48
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
49
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
46
50
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
47
51
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
48
52
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -1,6 +1,6 @@
1
1
  # Image
2
2
 
3
- Renders an image element from a URL or path. Supports fixed sizing, object-fit modes, and a circular crop for avatars.
3
+ Renders an image element from a URL or path. Supports fixed sizing, object-fit modes, a circular crop for avatars, and saving on click.
4
4
 
5
5
  ## When to use it
6
6
 
@@ -29,6 +29,8 @@ const photo = Image({
29
29
  | `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
30
30
  | `fit` | `'cover' \| 'contain' \| 'fill' \| 'none' \| 'scale-down'` | How the image fits its box (CSS `object-fit`). |
31
31
  | `circular` | `boolean` | Clips the image into a circle. |
32
+ | `downloadable` | `boolean` | Makes a click on the image save it. |
33
+ | `downloadFileName` | `string` | File name suggested when saving; defaults to the name in the URL. |
32
34
  | `onLoad` | `(widget: Widget) => void` | Fired when the media finishes loading. |
33
35
  | `onError` | `(widget: Widget) => void` | Fired when the media fails to load. |
34
36
  | `onPress` | `(widget: Widget) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
@@ -45,10 +47,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
45
47
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
46
48
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
47
49
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
50
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
48
51
  | `color` | `Color` | Foreground color, usually the text or icon color. |
49
52
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
50
53
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
51
54
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
55
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
56
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
57
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
52
58
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
53
59
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
54
60
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -82,12 +88,14 @@ const cover = Image({
82
88
  import { Image } from "flet-box";
83
89
 
84
90
  const teamPhoto = Image({
85
- src: "/team/anna.jpg",
91
+ src: "/team/anna.jpg?v=3",
86
92
  alt: "Anna at the keynote",
87
93
  width: 96,
88
94
  height: 96,
89
95
  fit: "cover",
90
96
  circular: true,
97
+ downloadable: true,
98
+ downloadFileName: "anna-keynote.jpg",
91
99
  onLoad: () => console.log("loaded"),
92
100
  onError: () => console.error("failed"),
93
101
  onPress: () => console.log("open profile"),
@@ -98,6 +106,7 @@ const teamPhoto = Image({
98
106
 
99
107
  - Set both width and height with fit: "cover" to avoid stretched or squashed art.
100
108
  - Use circular: true instead of a full borderRadius when you want a perfect avatar crop.
109
+ - downloadable only saves the file when the image is same-origin or CORS-served; anything else opens in a new tab instead of replacing your app.
101
110
 
102
111
  ## Accessibility
103
112
 
@@ -106,7 +115,9 @@ const teamPhoto = Image({
106
115
  ## Behavior
107
116
 
108
117
  - onLoad fires once the image decodes; onError fires when the src fails to load.
109
- - onPress is attached to the wrapper, so the image behaves like a tappable tile.
118
+ - onPress is attached to the image itself, so the image behaves like a tappable tile.
119
+ - With downloadable: true a click saves the image under downloadFileName, or under the file name in the URL when that prop is absent.
120
+ - Both download props stay live: update() can turn the offer on or off and rename it, and a downloadable bound to a useState key follows the store.
110
121
 
111
122
  ## Related widgets
112
123
 
@@ -65,10 +65,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
65
65
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
66
66
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
67
67
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
68
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
68
69
  | `color` | `Color` | Foreground color, usually the text or icon color. |
69
70
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
70
71
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
71
72
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
73
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
74
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
75
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
72
76
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
73
77
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
74
78
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -23,7 +23,7 @@ const debug = Inspector({
23
23
  | Prop | Type | Description |
24
24
  | --- | --- | --- |
25
25
  | `widget` | `Widget` | The DOM node or widget to inspect. |
26
- | `indent` | `number` | Indentation depth used when printing nested structures. |
26
+ | `indent` | `number` | Starting indentation depth of the printout; each level is two spaces. |
27
27
 
28
28
  ## Examples
29
29
 
@@ -37,7 +37,7 @@ const debug = Inspector({
37
37
  padding: 16,
38
38
  child: Text({ text: "Profile" }),
39
39
  }),
40
- indent: 16,
40
+ indent: 1,
41
41
  });
42
42
  ```
43
43
 
@@ -43,10 +43,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
43
43
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
44
44
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
45
45
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
46
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
46
47
  | `color` | `Color` | Foreground color, usually the text or icon color. |
47
48
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
48
49
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
49
50
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
51
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
52
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
53
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
50
54
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
51
55
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
52
56
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -54,10 +54,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
54
54
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
55
55
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
56
56
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
57
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
57
58
  | `color` | `Color` | Foreground color, usually the text or icon color. |
58
59
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
59
60
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
60
61
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
62
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
63
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
64
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
61
65
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
62
66
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
63
67
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -53,10 +53,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
53
53
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
54
54
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
55
55
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
56
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
56
57
  | `color` | `Color` | Foreground color, usually the text or icon color. |
57
58
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
58
59
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
59
60
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
61
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
62
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
63
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
60
64
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
61
65
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
62
66
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -0,0 +1,191 @@
1
+ # Maps
2
+
3
+ An interactive map — pan, zoom, markers and polylines — with no map library behind it. The Web Mercator projection and the XYZ tile grid are implemented inside the widget, so any provider that answers `{z}/{x}/{y}` works and nothing needs an API key, a CDN or a build step.
4
+
5
+ ## When to use it
6
+
7
+ Use it to show a venue, plot delivery stops, draw a route, or let a picker return a coordinate.
8
+
9
+ ## Quick start
10
+
11
+ ```javascript
12
+ import { Maps } from "flet-box";
13
+
14
+ const place = Maps({
15
+ center: [40.4168, -3.7038],
16
+ zoom: 12,
17
+ });
18
+ ```
19
+
20
+ > The prop table is generated from `src/index.d.ts`; the examples use only documented props.
21
+
22
+ ## Props
23
+
24
+ | Prop | Type | Description |
25
+ | --- | --- | --- |
26
+ | `center` | `LatLng` | View centre as `[lat, lng]`, `{lat, lng}` or `{latitude, longitude}`. |
27
+ | `zoom` | `number` | Integer zoom level: `0` shows the whole world, each step doubles the scale. |
28
+ | `minZoom` | `number` | Lowest zoom level the user can reach. |
29
+ | `maxZoom` | `number` | Highest zoom level the user can reach, usually the provider's last tile level. |
30
+ | `markers` | `Array<MapMarker \| LatLng>` | Pins to draw: bare positions or `{position, label, color, id, rotation, clickable, data}` records. |
31
+ | `markerColor` | `Color` | Colour of the pins that do not set a `color` of their own. |
32
+ | `polylines` | `Array<MapPolyline \| LatLng[]>` | Stroked paths: bare position lists or `{points, color, width, opacity, dashed, id}` records. |
33
+ | `polylineColor` | `Color` | Stroke of the lines that do not set a `color` of their own. |
34
+ | `tileUrl` | `string` | `{z}/{x}/{y}` tile template of the provider. |
35
+ | `attribution` | `string` | Credit line shown in the corner; most tile providers require one. |
36
+ | `showAttribution` | `boolean` | Shows the credit line. |
37
+ | `showZoomControl` | `boolean` | Shows the ± zoom buttons in the top-right corner. |
38
+ | `interactive` | `boolean` | Lets the user pan and zoom. When false, only the imperative API moves the view. |
39
+ | `scrollZoom` | `boolean` | Zooms with the mouse wheel, centred on the cursor. |
40
+ | `doubleClickZoom` | `boolean` | Zooms on double-click; `Shift` + double-click zooms out. |
41
+ | `showUserLocation` | `boolean` | Draws the browser's position; asks for permission on the first paint. |
42
+ | `followUser` | `boolean` | Keeps the view centred on the browser's position, asking for fresh high-accuracy fixes. |
43
+ | `onMapClick` | `(point: MapClick, event: PointerEvent) => void` | Fired with `{ lat, lng, zoom }` when the map is clicked without panning. |
44
+ | `onMarkerClick` | `(marker: MapMarker, event: MouseEvent) => void` | Fired with the clicked marker. |
45
+ | `onMoveEnd` | `(state: MapState) => void` | Fired with `{ center, zoom, bounds }` once the view stops changing. |
46
+ | `onUserUpdate` | `(fix: MapFix) => void` | Fired with `{ lat, lng, accuracy }` on each position the watcher reports. |
47
+
48
+ ### Common props
49
+
50
+ Every widget also accepts these shared props — see [common props](COMMON_PROPS.md) for the full rules and aliases.
51
+
52
+ | Prop | Type | Description |
53
+ | --- | --- | --- |
54
+ | `width` | `Size` | Width of the widget. A number is pixels; a string uses any CSS unit. |
55
+ | `height` | `Size` | Height of the widget. A number is pixels; a string uses any CSS unit. |
56
+ | `size` | `Size` | Overall size preset or pixel value, depending on the widget. |
57
+ | `padding` | `Padding` | Space inside the widget, between its content and its border. |
58
+ | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
59
+ | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
60
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
61
+ | `color` | `Color` | Foreground color, usually the text or icon color. |
62
+ | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
63
+ | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
64
+ | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
65
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
66
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
67
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
68
+ | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
69
+ | `visible` | `boolean` | Whether the widget is rendered and visible. |
70
+ | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
71
+ | `onPress` | `(widget: Widget) => void` | Callback fired when the widget is pressed. Alias: `onClick`. |
72
+ | `onClick` | `(widget: Widget) => void` | Callback fired when the widget is clicked. Alias: `onPress`. |
73
+ | `id` | `string` | DOM `id` for the rendered element. |
74
+ | `className` | `string` | CSS class names applied to the rendered element. |
75
+ | `ref` | `(widget: Widget) => void` | Callback that receives the underlying DOM node. |
76
+ | `disableTransform` | `boolean` | Disables the default press/scale transform animation. |
77
+
78
+ ## Examples
79
+
80
+ ### Everyday
81
+
82
+ ```javascript
83
+ import { Maps, colors } from "flet-box";
84
+
85
+ const stops = Maps({
86
+ center: [40.4168, -3.7038],
87
+ zoom: 13,
88
+ height: 420,
89
+ markerColor: colors.primary,
90
+ polylineColor: colors.primary,
91
+ markers: [
92
+ { position: [40.4168, -3.7038], label: "Sol" },
93
+ { position: [40.4308, -3.693], label: "Chueca", color: "#0ea5e9" },
94
+ ],
95
+ polylines: [
96
+ [[40.4168, -3.7038], [40.424, -3.698], [40.4308, -3.693]],
97
+ ],
98
+ onMarkerClick: (marker) => pick(marker),
99
+ });
100
+ ```
101
+
102
+ ### Full
103
+
104
+ ```javascript
105
+ import { Maps, colors } from "flet-box";
106
+
107
+ const picker = Maps({
108
+ center: [40.4168, -3.7038],
109
+ zoom: 14,
110
+ minZoom: 5,
111
+ maxZoom: 18,
112
+ height: 480,
113
+ borderRadius: 12,
114
+ tileUrl: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
115
+ attribution: "© OpenStreetMap contributors",
116
+ showAttribution: true,
117
+ showZoomControl: true,
118
+ interactive: true,
119
+ scrollZoom: true,
120
+ doubleClickZoom: true,
121
+ showUserLocation: true,
122
+ followUser: false,
123
+ markers: stops.map((stop) => ({ id: stop.id, position: stop.at, label: stop.name })),
124
+ polylines: [
125
+ { id: "route", points: route.geometry, color: colors.primary, width: 5 },
126
+ { id: "track", points: breadcrumbs, dashed: true, opacity: 0.7 },
127
+ ],
128
+ onMapClick: (point) => setPicked(point),
129
+ onMarkerClick: (marker) => setPicked(marker.position),
130
+ onMoveEnd: (view) => saveView(view),
131
+ onUserUpdate: (fix) => breadcrumbs.push([fix.lat, fix.lng]),
132
+ });
133
+
134
+ picker.fitBounds(route.geometry);
135
+ picker.addMarker({ position: [40.42, -3.7], label: "Dropped" });
136
+ picker.setMarker({ id: "taxi", position: [40.42, -3.7], rotation: 128, clickable: false });
137
+ picker.addPolyline({ id: "leg", points: [picked, stop.at] });
138
+ picker.locate();
139
+ picker.setFollowUser(true);
140
+ ```
141
+
142
+ ## Tips
143
+
144
+ - The default tile server is OpenStreetMap and its credit line renders by default; when you change tileUrl, change attribution in the same breath.
145
+ - Match maxZoom to the provider. Asking level 20 from a server that stops at 18 shows the offline notice instead of a map.
146
+ - `locate()` takes `{ timeout, maximumAge, highAccuracy, setCenter, zoom }`. Desktop laptops can need more than the 10 s default for a first fix, and a slow fix (code 3) is not the same failure as a denied permission (code 1) — branch on `error.code` in the rejected handler instead of reporting one generic error.
147
+ - Give markers an id: the pin node is then reused across updates instead of rebuilt, which matters for a list that moves often.
148
+ - `setMarker({id, ...})` replaces the pin with that id instead of stacking another under it — that is the call to make on every GPS fix, and `addMarker()` is the one that grows the list forever. The reused node restates what it shows, so a new `label`, `color` or `rotation` reaches the screen, the tooltip and the accessibility name.
149
+ - `rotation` is degrees clockwise from north, the compass convention `onUserUpdate` reports as `fix.heading`. The pin turns around its own tip, so the point it marks never moves, and its caption stays upright to read.
150
+ - `clickable: false` makes a pin transparent to the pointer: the tap reaches `onMapClick` with the coordinate under it. A vehicle drawn at the centre of the view would otherwise cover that whole spot, and every attempt to pick a pick-up point would answer with the car.
151
+ - A polyline needs two usable points; `addPolyline()` returns null for one-point input rather than drawing a speck that looks like a broken route. Lines are stroked on a canvas above the tiles and below the pins, so a long route costs no DOM nodes — but it also means a line is not clickable; put an invisible marker on each stop you want tappable.
152
+ - `fitBounds(pointList)` frames a route in one call: pass the coordinates and it picks the zoom and centre. Feed it the geometry an OSRM or GraphHopper reply returns, and keep the distance and duration from that same reply for the readout.
153
+ - A track grows by re-passing `polylines` with the fixes collected so far, or by keeping one line with an id and calling `update()`. `onUserUpdate` is the source of those fixes: it fires for every watched position, following or not.
154
+ - `followUser` is a different promise from `showUserLocation`: it recentres the view on every fix and asks the browser for fresh high-accuracy ones, so it is the option that costs battery. Turn it off when the user pans away to look at something else.
155
+ - The widget defaults to 400 tall and full width. Any size you give it is fine — a ResizeObserver repaints the tiles when the box changes.
156
+ - Wheel zoom is one level per gesture and follows the cursor, so a long trackpad flick does not throw the view across the world.
157
+
158
+ ## Accessibility
159
+
160
+ - The map is focusable and keyboard-driven: arrows pan, + and - zoom, and the ± buttons carry aria-labels.
161
+ - Each marker is a real button, so it is reachable with Tab and announced with its label.
162
+ - A map cannot be read by a screen reader, so keep the same places in a list next to it.
163
+
164
+ ## Behavior
165
+
166
+ - Tiles are pooled per zoom level and the previous level is kept until the new one is on screen, so a zoom step never flashes an empty grid.
167
+ - onMoveEnd is debounced — it fires once the view settles, not on every pan frame.
168
+ - Lines are redrawn from their geographic points on every frame, so a polyline follows the pan and the zoom instead of being pinned to the screen. A line whose bounding box misses the viewport is skipped before any coordinate is projected.
169
+ - Whether a press was a drag is judged by how far the pointer ended up from the point it went down on, not by the length of the path it walked: a trembling finger keeps its click and never nudges the view.
170
+ - A press on a pin answers onMarkerClick only; the map never reports the same press twice.
171
+ - A press on the widget's own chrome — the ± buttons or the credit link — is not a click on the map underneath, so onMapClick reports only the bare map surface.
172
+ - Props bound with useState patch this widget alone — the map subscribes to the key and redraws without re-rendering the app.
173
+ - Nothing is fetched until the widget enters the DOM; unmount cancels the frame, the observer and the geolocation watch.
174
+ - When every visible tile fails, a notice appears over the map instead of a blank panel.
175
+
176
+ ## Related widgets
177
+
178
+ - [Card](Card.md)
179
+ - [Button](Button.md)
180
+ - [ListView](ListView.md)
181
+ - [Image](Image.md)
182
+
183
+ ---
184
+
185
+ ## Continue reading
186
+
187
+ - **Previous:** [Video](Video.md)
188
+ - **Next:** [DraggBox](DraggBox.md)
189
+ - **Index:** [Widget index](README.md) · [Start here](START_HERE.md)
190
+
191
+ You are reading **Chapter 7 · Media and drag & drop** (3 of 5).
@@ -79,10 +79,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
79
79
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
80
80
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
81
81
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
82
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
82
83
  | `color` | `Color` | Foreground color, usually the text or icon color. |
83
84
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
84
85
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
85
86
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
87
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
88
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
89
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
86
90
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
87
91
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
88
92
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -41,10 +41,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
41
41
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
42
42
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
43
43
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
44
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
44
45
  | `color` | `Color` | Foreground color, usually the text or icon color. |
45
46
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
46
47
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
47
48
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
49
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
50
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
51
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
48
52
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
49
53
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
50
54
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -50,10 +50,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
50
50
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
51
51
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
52
52
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
53
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
53
54
  | `color` | `Color` | Foreground color, usually the text or icon color. |
54
55
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
55
56
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
56
57
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
58
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
59
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
60
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
57
61
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
58
62
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
59
63
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -45,10 +45,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
45
45
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
46
46
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
47
47
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
48
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
48
49
  | `color` | `Color` | Foreground color, usually the text or icon color. |
49
50
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
50
51
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
51
52
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
53
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
54
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
55
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
52
56
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
53
57
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
54
58
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -48,10 +48,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
48
48
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
49
49
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
50
50
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
51
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
51
52
  | `color` | `Color` | Foreground color, usually the text or icon color. |
52
53
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
53
54
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
54
55
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
56
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
57
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
58
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
55
59
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
56
60
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
57
61
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -41,10 +41,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
41
41
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
42
42
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
43
43
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
44
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
44
45
  | `color` | `Color` | Foreground color, usually the text or icon color. |
45
46
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
46
47
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
47
48
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
49
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
50
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
51
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
48
52
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
49
53
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
50
54
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -102,21 +102,22 @@ _audio, video and drag-and-drop_
102
102
 
103
103
  52. [Audio](Audio.md) — A thin wrapper around the native <audio> element with reliable duration detection, progress callbacks, and an imperative playback API
104
104
  53. [Video](Video.md) — Renders a native <video> element with proper media attributes and a convenient playback API
105
- 54. [DraggBox](DraggBox.md) — Wraps a child so it can be dragged with the native drag-and-drop API
106
- 55. [DroppBox](DroppBox.md) — A drop target for DraggBox items
105
+ 54. [Maps](Maps.md) — An interactive map — pan, zoom, markers and polylines — with no map library behind it
106
+ 55. [DraggBox](DraggBox.md) — Wraps a child so it can be dragged with the native drag-and-drop API
107
+ 56. [DroppBox](DroppBox.md) — A drop target for DraggBox items
107
108
 
108
109
  ### Chapter 8 · App navigation
109
110
 
110
111
  _Build the shell of a real application and wire it to the router._
111
112
 
112
- 56. [Scaffold](Scaffold.md) — the app shell: app bar, body, drawer, side bars
113
- 57. [AdaptiveScaffold](AdaptiveScaffold.md) — the same shell, adapted to phone and desktop
114
- 58. [AppBar](AppBar.md) — a top bar for titles, actions, and back navigation
115
- 59. [Drawer](Drawer.md) — a panel that slides in from the side
116
- 60. [DrawerItem](DrawerItem.md) — a router-aware row for a drawer or side bar
117
- 61. [BottomNavigation](BottomNavigation.md) — a bottom tab bar synced with the router
118
- 62. [Tabs](Tabs.md) — switch panes inside a screen
119
- 63. [CollapsibleSideBar](CollapsibleSideBar.md) — a side panel that collapses to icons
113
+ 57. [Scaffold](Scaffold.md) — the app shell: app bar, body, drawer, side bars
114
+ 58. [AdaptiveScaffold](AdaptiveScaffold.md) — the same shell, adapted to phone and desktop
115
+ 59. [AppBar](AppBar.md) — a top bar for titles, actions, and back navigation
116
+ 60. [Drawer](Drawer.md) — a panel that slides in from the side
117
+ 61. [DrawerItem](DrawerItem.md) — a router-aware row for a drawer or side bar
118
+ 62. [BottomNavigation](BottomNavigation.md) — a bottom tab bar synced with the router
119
+ 63. [Tabs](Tabs.md) — switch panes inside a screen
120
+ 64. [CollapsibleSideBar](CollapsibleSideBar.md) — a side panel that collapses to icons
120
121
 
121
122
  Then continue with [State, Router & Services](../guides/state.md) — Chapter 9.
122
123
 
@@ -163,6 +164,7 @@ Then continue with [State, Router & Services](../guides/state.md) — Chapter 9.
163
164
  - [InstallButton](InstallButton.md)
164
165
  - [ListTile](ListTile.md)
165
166
  - [ListView](ListView.md)
167
+ - [Maps](Maps.md)
166
168
  - [Markdown](Markdown.md)
167
169
  - [MatrixRain](MatrixRain.md)
168
170
  - [Modal](Modal.md)
@@ -44,10 +44,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
44
44
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
45
45
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
46
46
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
47
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
47
48
  | `color` | `Color` | Foreground color, usually the text or icon color. |
48
49
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
49
50
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
50
51
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
52
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
53
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
54
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
51
55
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
52
56
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
53
57
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |
@@ -99,7 +103,7 @@ const option = Radio({
99
103
 
100
104
  ## Accessibility
101
105
 
102
- - The circle carries no visible label on its own; render a Text beside it and never rely on color alone.
106
+ - The `label` prop renders the words beside the ring inside the same pressable row; never rely on color alone to convey the selection.
103
107
 
104
108
  ## Behavior
105
109
 
@@ -50,10 +50,14 @@ Every widget also accepts these shared props — see [common props](COMMON_PROPS
50
50
  | `padding` | `Padding` | Space inside the widget, between its content and its border. |
51
51
  | `margin` | `Margin` | Space outside the widget, between it and its neighbors. |
52
52
  | `bgColor` | `Color` | Background color. Alias: `backgroundColor`. |
53
+ | `backgroundColor` | `Color` | Background color. Alias of `bgColor`. |
53
54
  | `color` | `Color` | Foreground color, usually the text or icon color. |
54
55
  | `borderRadius` | `number \| string` | Rounds the corners of the widget. |
55
56
  | `elevation` | `number` | Shadow depth. Higher values lift the widget off the page. |
56
57
  | `shadow` | `string` | Raw CSS `box-shadow` value, for a custom shadow. |
58
+ | `filter` | `string` | Raw CSS `filter` value applied to the widget itself, e.g. `blur(4px)`. |
59
+ | `backdropFilter` | `string` | Raw CSS `backdrop-filter` value: what sits behind the widget is blurred through it, which is what makes a translucent card frosted glass. |
60
+ | `maskImage` | `string` | Raw CSS `mask-image` value, used to fade a widget out at its edges instead of cutting it. |
57
61
  | `opacity` | `number` | Opacity from 0 (invisible) to 1 (fully opaque). |
58
62
  | `visible` | `boolean` | Whether the widget is rendered and visible. |
59
63
  | `disabled` | `boolean` | Disables interaction and shows the non-interactive state. |