@openpeepshq/rn-components 0.6.0 → 0.6.2
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/package.json +7 -6
- package/src/components/conversations/ConversationMessageBubble.tsx +11 -1
- package/src/components/conversations/ConversationParticipantsModal.tsx +6 -1
- package/src/components/conversations/ConversationPreviewCard.tsx +1 -1
- package/src/components/custom/navigation/side-menu.tsx +2 -1
- package/src/components/icons/index.ts +8 -0
- package/src/components/index.ts +1 -0
- package/src/components/navigation/helpers.ts +3 -0
- package/src/components/navigation/main-navigator.tsx +4 -0
- package/src/components/navigation/nativeRouter.tsx +11 -0
- package/src/components/navigation/tab-navigator.tsx +13 -3
- package/src/components/navigation/types/main.ts +6 -0
- package/src/components/navigation/types/tabs.ts +2 -0
- package/src/components/post/CompactReplyParent.tsx +22 -0
- package/src/components/post/FeedPostContent.tsx +4 -0
- package/src/components/post/NewResourceButton.tsx +57 -0
- package/src/components/post/PostDetail.tsx +3 -0
- package/src/components/post/index.ts +1 -0
- package/src/components/post/pieces/PostMenu.tsx +15 -9
- package/src/components/post/post-form/PostTypeSwitcher.tsx +19 -1
- package/src/components/post/post-form/ResourceForm.tsx +221 -0
- package/src/components/post/post-form/index.ts +1 -0
- package/src/components/post/types/Event.tsx +39 -20
- package/src/components/post/types/index.ts +1 -0
- package/src/components/post/types/resource/FullResource.tsx +177 -0
- package/src/components/resources/ResourceCard.tsx +289 -0
- package/src/components/resources/ResourceLibrary.tsx +369 -0
- package/src/components/resources/index.ts +4 -0
- package/src/components/ui/button.tsx +2 -2
- package/src/global.css +16 -14
- package/src/pages/conversations/Show.tsx +54 -12
- package/src/pages/groups/Show.tsx +19 -1
- package/src/pages/index.ts +3 -0
- package/src/pages/resources/Edit.tsx +72 -0
- package/src/pages/resources/Index.tsx +25 -0
- package/src/pages/resources/New.tsx +55 -0
- package/src/theme/OpenPeepsThemeProvider.tsx +1 -5
- package/src/theme/defaults.ts +22 -106
- package/src/theme/utils.ts +22 -0
- package/tailwind.config.js +78 -14
package/tailwind.config.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
const { hairlineWidth } = require('nativewind/theme');
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* NOTE: NativeWind v4 does not resolve Tailwind's `<alpha-value>` token,
|
|
5
|
+
* so the `rgb(var(--x) / <alpha-value>)` "channel()" pattern used on web
|
|
6
|
+
* breaks ALL color classes on native. Colors use plain `var(--x)` references
|
|
7
|
+
* instead. Opacity modifiers (`bg-primary/10`) are handled via inline styles
|
|
8
|
+
* in the components that need them (see ConversationMessageBubble).
|
|
9
|
+
*/
|
|
3
10
|
export default {
|
|
4
11
|
// NOTE: Update this to include the paths to all of your component files.
|
|
5
12
|
darkMode: 'class',
|
|
@@ -9,40 +16,51 @@ export default {
|
|
|
9
16
|
theme: {
|
|
10
17
|
extend: {
|
|
11
18
|
colors: {
|
|
12
|
-
border: 'var(--border)',
|
|
13
|
-
input: 'var(--input)',
|
|
14
|
-
ring: 'var(--ring)',
|
|
15
|
-
background: 'var(--background)',
|
|
16
|
-
foreground: 'var(--foreground)',
|
|
17
|
-
primary: {
|
|
19
|
+
'border': 'var(--border)',
|
|
20
|
+
'input': 'var(--input)',
|
|
21
|
+
'ring': 'var(--ring)',
|
|
22
|
+
'background': 'var(--background)',
|
|
23
|
+
'foreground': 'var(--foreground)',
|
|
24
|
+
'primary': {
|
|
18
25
|
DEFAULT: 'var(--primary)',
|
|
19
26
|
foreground: 'var(--primary-foreground)',
|
|
20
27
|
},
|
|
21
|
-
secondary: {
|
|
28
|
+
'secondary': {
|
|
22
29
|
DEFAULT: 'var(--secondary)',
|
|
23
30
|
foreground: 'var(--secondary-foreground)',
|
|
24
31
|
},
|
|
25
|
-
destructive: {
|
|
32
|
+
'destructive': {
|
|
26
33
|
DEFAULT: 'var(--destructive)',
|
|
27
34
|
foreground: 'var(--destructive-foreground)',
|
|
28
35
|
},
|
|
29
|
-
muted: {
|
|
36
|
+
'muted': {
|
|
30
37
|
DEFAULT: 'var(--muted)',
|
|
31
38
|
foreground: 'var(--muted-foreground)',
|
|
32
39
|
},
|
|
33
|
-
accent: {
|
|
40
|
+
'accent': {
|
|
34
41
|
DEFAULT: 'var(--accent)',
|
|
35
42
|
foreground: 'var(--accent-foreground)',
|
|
36
43
|
},
|
|
37
|
-
popover: {
|
|
44
|
+
'popover': {
|
|
38
45
|
DEFAULT: 'var(--popover)',
|
|
39
46
|
foreground: 'var(--popover-foreground)',
|
|
40
47
|
},
|
|
41
|
-
card: {
|
|
48
|
+
'card': {
|
|
42
49
|
DEFAULT: 'var(--card)',
|
|
43
50
|
foreground: 'var(--card-foreground)',
|
|
44
51
|
},
|
|
45
|
-
|
|
52
|
+
// `surface` mirrors `muted` (same token on the web preset).
|
|
53
|
+
'surface': {
|
|
54
|
+
DEFAULT: 'var(--muted)',
|
|
55
|
+
foreground: 'var(--muted-foreground)',
|
|
56
|
+
},
|
|
57
|
+
'surface-2': 'var(--surface-2)',
|
|
58
|
+
'alpha': 'var(--alpha)',
|
|
59
|
+
},
|
|
60
|
+
// Override Tailwind's default `borderColor.DEFAULT` so bare `border`/`border-b`
|
|
61
|
+
// utilities follow the theme border color instead of a static gray.
|
|
62
|
+
borderColor: {
|
|
63
|
+
DEFAULT: 'var(--border)',
|
|
46
64
|
},
|
|
47
65
|
borderWidth: {
|
|
48
66
|
hairline: hairlineWidth(),
|
|
@@ -53,7 +71,53 @@ export default {
|
|
|
53
71
|
md: 'calc(var(--theme-rounded-container, 0.5rem) - 2px)',
|
|
54
72
|
sm: 'calc(var(--theme-rounded-container, 0.5rem) - 4px)',
|
|
55
73
|
},
|
|
74
|
+
fontFamily: {
|
|
75
|
+
sans: 'var(--theme-font-family-base, system-ui)',
|
|
76
|
+
heading: 'var(--theme-font-family-heading, system-ui)',
|
|
77
|
+
},
|
|
78
|
+
keyframes: {
|
|
79
|
+
'accordion-down': {
|
|
80
|
+
from: { height: '0' },
|
|
81
|
+
to: { height: 'var(--radix-accordion-content-height)' },
|
|
82
|
+
},
|
|
83
|
+
'accordion-up': {
|
|
84
|
+
from: { height: 'var(--radix-accordion-content-height)' },
|
|
85
|
+
to: { height: '0' },
|
|
86
|
+
},
|
|
87
|
+
'spin': {
|
|
88
|
+
to: { transform: 'rotate(360deg)' },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
animation: {
|
|
92
|
+
'accordion-down': 'accordion-down 0.2s ease-out',
|
|
93
|
+
'accordion-up': 'accordion-up 0.2s ease-out',
|
|
94
|
+
'spin': 'spin 1s linear infinite',
|
|
95
|
+
},
|
|
96
|
+
spacing: {
|
|
97
|
+
70: '17.5rem',
|
|
98
|
+
128: '32rem',
|
|
99
|
+
},
|
|
56
100
|
},
|
|
57
101
|
},
|
|
58
|
-
plugins: [
|
|
102
|
+
plugins: [
|
|
103
|
+
// Constrain iframes rendered inside markdown prose so they can't
|
|
104
|
+
// break through scroll/overflow boundaries (Safari doesn't clip iframes
|
|
105
|
+
// via overflow:hidden alone).
|
|
106
|
+
function ({ addComponents }) {
|
|
107
|
+
addComponents({
|
|
108
|
+
'.allpeep-markdown iframe': {
|
|
109
|
+
maxWidth: '100% !important',
|
|
110
|
+
width: '100% !important',
|
|
111
|
+
border: '0',
|
|
112
|
+
display: 'block',
|
|
113
|
+
},
|
|
114
|
+
'.allpeep-markdown iframe[style]': {
|
|
115
|
+
// Override inline styles set by markdown source so iframes
|
|
116
|
+
// can never exceed the container bounds.
|
|
117
|
+
maxWidth: '100% !important',
|
|
118
|
+
width: '100% !important',
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
],
|
|
59
123
|
};
|