@wasto/cms-components 1.5.10 → 1.5.11

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 (98) hide show
  1. package/README.md +47 -47
  2. package/dist/index.d.mts +103 -2
  3. package/dist/index.d.ts +103 -2
  4. package/dist/index.js +2861 -2442
  5. package/dist/index.mjs +3651 -3227
  6. package/package.json +2 -2
  7. package/src/components/announcement-modal/AnnouncementModal.tsx +183 -183
  8. package/src/components/article/Article.tsx +21 -21
  9. package/src/components/article/ArticleCard.tsx +81 -81
  10. package/src/components/article/ArticleExcerpts.tsx +80 -80
  11. package/src/components/article/ArticleList.tsx +114 -114
  12. package/src/components/article/ArticleMarkdown.tsx +170 -170
  13. package/src/components/article/ArticleReaderModal.tsx +93 -93
  14. package/src/components/article/ArticleSingle.tsx +57 -57
  15. package/src/components/bottom-tab/BottomTab.tsx +392 -392
  16. package/src/components/button/Button.tsx +154 -154
  17. package/src/components/challenge/Badges.tsx +84 -84
  18. package/src/components/challenge/BadgesModal.tsx +166 -166
  19. package/src/components/challenge/Challenge.tsx +380 -380
  20. package/src/components/challenge/ChallengeModal.tsx +231 -231
  21. package/src/components/challenge/ChallengeVignette.tsx +249 -249
  22. package/src/components/challenge/ChallengesModal.tsx +243 -243
  23. package/src/components/challenge/QuizModal.tsx +381 -381
  24. package/src/components/challenge/ResultModal.tsx +144 -144
  25. package/src/components/chat/Chat.tsx +928 -928
  26. package/src/components/collection-calendar/CollectionCalendar.tsx +274 -274
  27. package/src/components/columns/Columns.tsx +33 -33
  28. package/src/components/consignes-modal/ConsignesModal.tsx +267 -267
  29. package/src/components/content-inset/ContentInset.tsx +33 -33
  30. package/src/components/header/Header.tsx +391 -391
  31. package/src/components/image/Image.tsx +15 -15
  32. package/src/components/image/ImageFrame.tsx +102 -102
  33. package/src/components/image/ImageMedia.tsx +31 -31
  34. package/src/components/image/ImageUrl.tsx +30 -30
  35. package/src/components/locations-map/LocationSheet.tsx +417 -417
  36. package/src/components/locations-map/LocationsMap.native.tsx +260 -260
  37. package/src/components/locations-map/LocationsMap.tsx +13 -13
  38. package/src/components/locations-map/LocationsMap.web.tsx +10 -10
  39. package/src/components/locations-map/LocationsMapShell.tsx +527 -527
  40. package/src/components/locations-map/LocationsMapView.tsx +108 -108
  41. package/src/components/locations-map/LocationsMapView.web.tsx +331 -331
  42. package/src/components/nav-button/NavButton.tsx +59 -59
  43. package/src/components/next-collection/NextCollection.tsx +636 -621
  44. package/src/components/notifications/NotificationsScreen.tsx +247 -247
  45. package/src/components/page/Page.tsx +102 -64
  46. package/src/components/parapraph/Paragraph.tsx +67 -67
  47. package/src/components/profile/ProfileScreen.tsx +236 -236
  48. package/src/components/recycling-info/RecyclingInfo.tsx +189 -189
  49. package/src/components/safe-area/OptionalSafeAreaProvider.tsx +17 -17
  50. package/src/components/search/Search.tsx +320 -320
  51. package/src/components/select-street-modal/SelectStreetModal.tsx +475 -475
  52. package/src/components/title/Title.tsx +100 -100
  53. package/src/components/vision/Vision.tsx +447 -447
  54. package/src/components/vision/VisionActionCard.tsx +117 -117
  55. package/src/components/vision/VisionCapture.tsx +30 -30
  56. package/src/components/vision/VisionTapOverlay.tsx +122 -122
  57. package/src/contexts/AnnouncementsContext.tsx +171 -171
  58. package/src/contexts/AppDataContext.tsx +458 -0
  59. package/src/contexts/ChallengesContext.tsx +182 -182
  60. package/src/contexts/LocalContext.tsx +227 -227
  61. package/src/contexts/ThemeContext.tsx +37 -37
  62. package/src/contexts/WastoContext.tsx +130 -127
  63. package/src/helpers/blogPost.ts +72 -72
  64. package/src/helpers/generateQuizQuestions.ts +247 -247
  65. package/src/helpers/getContrastColor.ts +18 -18
  66. package/src/helpers/haptics.ts +20 -20
  67. package/src/helpers/hoursSchedule.ts +230 -230
  68. package/src/helpers/htmlContentToMarkdown.ts +114 -114
  69. package/src/helpers/layout.ts +54 -54
  70. package/src/helpers/loadLinearGradient.ts +22 -22
  71. package/src/helpers/mapLocations.ts +170 -0
  72. package/src/helpers/maquetteTheme.ts +76 -76
  73. package/src/helpers/markdownUnderlinePlugin.ts +32 -32
  74. package/src/helpers/nextCollection.ts +122 -0
  75. package/src/helpers/normalizeWasteTypeRecyclingInfo.ts +80 -80
  76. package/src/helpers/publicMediaUrl.ts +8 -8
  77. package/src/helpers/resolveApiAssetUrl.ts +21 -21
  78. package/src/helpers/systemRoutes.ts +7 -7
  79. package/src/helpers/themeStyles.ts +114 -114
  80. package/src/helpers/ttlCache.ts +41 -0
  81. package/src/helpers/useSafeAreaPadding.ts +14 -14
  82. package/src/hooks/useBadges.ts +100 -100
  83. package/src/hooks/useBlogPosts.ts +109 -105
  84. package/src/hooks/useChallenges.ts +110 -110
  85. package/src/hooks/useCities.ts +56 -56
  86. package/src/hooks/useCityAnnouncements.ts +118 -118
  87. package/src/hooks/useCollectionCalendar.ts +421 -421
  88. package/src/hooks/useColumns.ts +19 -19
  89. package/src/hooks/useConsignes.ts +62 -62
  90. package/src/hooks/useLocations.ts +120 -248
  91. package/src/hooks/useNextCollection.ts +163 -238
  92. package/src/hooks/useRecyclingInfo.ts +90 -90
  93. package/src/hooks/useWastoClient.ts +16 -16
  94. package/src/index.ts +149 -142
  95. package/src/navigation/NavigationContext.tsx +56 -56
  96. package/src/sentry/initSentry.ts +120 -120
  97. package/src/types/Theme.ts +72 -72
  98. package/src/types/css-modules.d.ts +1 -1
@@ -1,59 +1,59 @@
1
- import type { ReactNode } from "react";
2
- import { Pressable, PressableProps, StyleProp, StyleSheet, ViewStyle } from "react-native";
3
- import { useTheme } from "../../contexts/ThemeContext";
4
- import { LucideIcon } from "lucide-react-native";
5
- import { resolveTheme } from "../../helpers/themeStyles";
6
- import { SPACE } from "../../helpers/layout";
7
-
8
- export type NavButtonVariant = "default" | "close";
9
-
10
- export type NavButtonProps = Omit<PressableProps, "children" | "style"> & {
11
- icon: LucideIcon;
12
- style?: StyleProp<ViewStyle>;
13
- variant?: NavButtonVariant;
14
- };
15
-
16
- export function NavButton({
17
- style,
18
- icon: Icon,
19
- variant = "default",
20
- ...props
21
- }: NavButtonProps): ReactNode {
22
- const { theme } = useTheme();
23
- const t = resolveTheme(theme);
24
- const isClose = variant === "close";
25
-
26
- return (
27
- <Pressable
28
- style={({ pressed }) => [
29
- styles.button,
30
- {
31
- borderRadius: t.radii.pill,
32
- backgroundColor: isClose ? t.colors.surface : theme.colors.primary,
33
- borderWidth: isClose ? 1 : 0,
34
- borderColor: t.colors.border,
35
- },
36
- pressed && styles.pressed,
37
- style,
38
- ]}
39
- {...props}
40
- >
41
- <Icon
42
- size={SPACE.iconGlyph}
43
- color={isClose ? t.colors.onSurface : theme.colors.onPrimary}
44
- />
45
- </Pressable>
46
- );
47
- }
48
-
49
- const styles = StyleSheet.create({
50
- button: {
51
- width: SPACE.iconHit,
52
- height: SPACE.iconHit,
53
- alignItems: "center",
54
- justifyContent: "center",
55
- },
56
- pressed: {
57
- opacity: 0.85,
58
- },
59
- });
1
+ import type { ReactNode } from "react";
2
+ import { Pressable, PressableProps, StyleProp, StyleSheet, ViewStyle } from "react-native";
3
+ import { useTheme } from "../../contexts/ThemeContext";
4
+ import { LucideIcon } from "lucide-react-native";
5
+ import { resolveTheme } from "../../helpers/themeStyles";
6
+ import { SPACE } from "../../helpers/layout";
7
+
8
+ export type NavButtonVariant = "default" | "close";
9
+
10
+ export type NavButtonProps = Omit<PressableProps, "children" | "style"> & {
11
+ icon: LucideIcon;
12
+ style?: StyleProp<ViewStyle>;
13
+ variant?: NavButtonVariant;
14
+ };
15
+
16
+ export function NavButton({
17
+ style,
18
+ icon: Icon,
19
+ variant = "default",
20
+ ...props
21
+ }: NavButtonProps): ReactNode {
22
+ const { theme } = useTheme();
23
+ const t = resolveTheme(theme);
24
+ const isClose = variant === "close";
25
+
26
+ return (
27
+ <Pressable
28
+ style={({ pressed }) => [
29
+ styles.button,
30
+ {
31
+ borderRadius: t.radii.pill,
32
+ backgroundColor: isClose ? t.colors.surface : theme.colors.primary,
33
+ borderWidth: isClose ? 1 : 0,
34
+ borderColor: t.colors.border,
35
+ },
36
+ pressed && styles.pressed,
37
+ style,
38
+ ]}
39
+ {...props}
40
+ >
41
+ <Icon
42
+ size={SPACE.iconGlyph}
43
+ color={isClose ? t.colors.onSurface : theme.colors.onPrimary}
44
+ />
45
+ </Pressable>
46
+ );
47
+ }
48
+
49
+ const styles = StyleSheet.create({
50
+ button: {
51
+ width: SPACE.iconHit,
52
+ height: SPACE.iconHit,
53
+ alignItems: "center",
54
+ justifyContent: "center",
55
+ },
56
+ pressed: {
57
+ opacity: 0.85,
58
+ },
59
+ });