@proulr/sdui-components 0.1.0 → 0.1.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.
@@ -0,0 +1,15 @@
1
+ /** Tamanhos alinhados ao compose da tela de publicar (glyph ~24 em alvo 48). */
2
+ export const APP_ICON_SIZE = {
3
+ chromeHeader: 26,
4
+ tabBar: 26,
5
+ composer: 24,
6
+ composerAction: 26,
7
+ drawerRow: 24,
8
+ drawerAddon: 28,
9
+ feedAction: 22,
10
+ searchInline: 20,
11
+ banner: 22,
12
+ fab: 26,
13
+ scrollFab: 22,
14
+ fabMenu: 28,
15
+ } as const;
@@ -0,0 +1,175 @@
1
+ import type { ComponentType } from 'react';
2
+ import { APP_ICON_SIZE } from './app-icon-size-catalog';
3
+ import {
4
+ AppChromeBackGlyph,
5
+ AppChromeBookmarkGlyph,
6
+ AppChromeBoostGlyph,
7
+ AppChromeChatGlyph,
8
+ AppChromeChevronDownGlyph,
9
+ AppChromeChevronRightGlyph,
10
+ AppChromeCloseGlyph,
11
+ AppChromeCommunitiesGlyph,
12
+ AppChromeEditGlyph,
13
+ AppChromeEventsGlyph,
14
+ AppChromeFireGlyph,
15
+ AppChromeFlashGlyph,
16
+ AppChromeFlipCameraGlyph,
17
+ AppChromeHeartFilledGlyph,
18
+ AppChromeHeartGlyph,
19
+ AppChromeHuntGlyph,
20
+ AppChromeIncognitoGlyph,
21
+ AppChromeListGlyph,
22
+ AppChromeLocationGlyph,
23
+ AppChromeMicGlyph,
24
+ AppChromeOverflowGlyph,
25
+ AppChromePauseGlyph,
26
+ AppChromePlayGlyph,
27
+ AppChromePlusGlyph,
28
+ AppChromeProfileGlyph,
29
+ AppChromePublishGlyph,
30
+ AppChromeRepostGlyph,
31
+ AppChromeSearchGlyph,
32
+ AppChromeSendGlyph,
33
+ AppChromeSettingsGlyph,
34
+ AppChromeShieldGlyph,
35
+ AppChromeSignOutGlyph,
36
+ AppChromeStarGlyph,
37
+ AppChromeStoryEffectsGlyph,
38
+ AppChromeStoryGlyph,
39
+ AppChromeStoryMentionGlyph,
40
+ AppChromeStoryMusicGlyph,
41
+ AppChromeStoryStickerGlyph,
42
+ AppChromeStoryTextGlyph,
43
+ AppChromeTabChatGlyph,
44
+ AppChromeTabDiscoverGlyph,
45
+ AppChromeTabFlashGlyph,
46
+ AppChromeTabVibesGlyph,
47
+ type AppChromeGlyphProps,
48
+ } from './app-glyphs';
49
+ import {
50
+ ComposeCameraGlyph,
51
+ ComposeFollowersGlyph,
52
+ ComposeGalleryGlyph,
53
+ ComposeGlobeGlyph,
54
+ ComposeMentionGlyph,
55
+ ComposeTrashGlyph,
56
+ ComposeVideoGlyph,
57
+ } from './compose-glyphs';
58
+
59
+ export type AppIconName =
60
+ | 'search'
61
+ | 'hunt'
62
+ | 'back'
63
+ | 'overflow'
64
+ | 'location'
65
+ | 'mic'
66
+ | 'send'
67
+ | 'chat'
68
+ | 'close'
69
+ | 'chevron-down'
70
+ | 'chevron-right'
71
+ | 'flip-camera'
72
+ | 'flash'
73
+ | 'gallery'
74
+ | 'video'
75
+ | 'camera'
76
+ | 'trash'
77
+ | 'globe'
78
+ | 'tab-discover'
79
+ | 'tab-vibes'
80
+ | 'tab-flash'
81
+ | 'tab-chat'
82
+ | 'boost'
83
+ | 'fire'
84
+ | 'settings'
85
+ | 'edit'
86
+ | 'incognito'
87
+ | 'events'
88
+ | 'shield'
89
+ | 'profile'
90
+ | 'bookmark'
91
+ | 'list'
92
+ | 'communities'
93
+ | 'star'
94
+ | 'sign-out'
95
+ | 'publish'
96
+ | 'story'
97
+ | 'story-music'
98
+ | 'story-sticker'
99
+ | 'story-text'
100
+ | 'story-effects'
101
+ | 'story-mention'
102
+ | 'repost'
103
+ | 'heart'
104
+ | 'heart-filled'
105
+ | 'play'
106
+ | 'pause'
107
+ | 'plus'
108
+ | 'followers'
109
+ | 'mention';
110
+
111
+ const ICON_REGISTRY: Record<AppIconName, ComponentType<AppChromeGlyphProps>> = {
112
+ search: AppChromeSearchGlyph,
113
+ hunt: AppChromeHuntGlyph,
114
+ back: AppChromeBackGlyph,
115
+ overflow: AppChromeOverflowGlyph,
116
+ location: AppChromeLocationGlyph,
117
+ mic: AppChromeMicGlyph,
118
+ send: AppChromeSendGlyph,
119
+ chat: AppChromeChatGlyph,
120
+ close: AppChromeCloseGlyph,
121
+ 'chevron-down': AppChromeChevronDownGlyph,
122
+ 'chevron-right': AppChromeChevronRightGlyph,
123
+ 'flip-camera': AppChromeFlipCameraGlyph,
124
+ flash: AppChromeFlashGlyph,
125
+ gallery: ComposeGalleryGlyph,
126
+ video: ComposeVideoGlyph,
127
+ camera: ComposeCameraGlyph,
128
+ trash: ComposeTrashGlyph,
129
+ globe: ComposeGlobeGlyph,
130
+ 'tab-discover': AppChromeTabDiscoverGlyph,
131
+ 'tab-vibes': AppChromeTabVibesGlyph,
132
+ 'tab-flash': AppChromeTabFlashGlyph,
133
+ 'tab-chat': AppChromeTabChatGlyph,
134
+ boost: AppChromeBoostGlyph,
135
+ fire: AppChromeFireGlyph,
136
+ settings: AppChromeSettingsGlyph,
137
+ edit: AppChromeEditGlyph,
138
+ incognito: AppChromeIncognitoGlyph,
139
+ events: AppChromeEventsGlyph,
140
+ shield: AppChromeShieldGlyph,
141
+ profile: AppChromeProfileGlyph,
142
+ bookmark: AppChromeBookmarkGlyph,
143
+ list: AppChromeListGlyph,
144
+ communities: AppChromeCommunitiesGlyph,
145
+ star: AppChromeStarGlyph,
146
+ 'sign-out': AppChromeSignOutGlyph,
147
+ publish: AppChromePublishGlyph,
148
+ story: AppChromeStoryGlyph,
149
+ 'story-music': AppChromeStoryMusicGlyph,
150
+ 'story-sticker': AppChromeStoryStickerGlyph,
151
+ 'story-text': AppChromeStoryTextGlyph,
152
+ 'story-effects': AppChromeStoryEffectsGlyph,
153
+ 'story-mention': AppChromeStoryMentionGlyph,
154
+ repost: AppChromeRepostGlyph,
155
+ heart: AppChromeHeartGlyph,
156
+ 'heart-filled': AppChromeHeartFilledGlyph,
157
+ play: AppChromePlayGlyph,
158
+ pause: AppChromePauseGlyph,
159
+ plus: AppChromePlusGlyph,
160
+ followers: ComposeFollowersGlyph,
161
+ mention: ComposeMentionGlyph,
162
+ };
163
+
164
+ export type AppIconProps = {
165
+ name: AppIconName;
166
+ color?: string;
167
+ size?: number;
168
+ };
169
+
170
+ export function AppIcon({ name, color, size = APP_ICON_SIZE.composer }: AppIconProps) {
171
+ const Glyph = ICON_REGISTRY[name];
172
+ return <Glyph color={color} size={size} />;
173
+ }
174
+
175
+ export { APP_ICON_SIZE };
@@ -293,32 +293,34 @@ export function ComposeTrashGlyph({ color = m3Colors.primary, size = 22 }: Glyph
293
293
  );
294
294
  }
295
295
 
296
- export function ComposePostGlyph({ color = m3Colors.onPrimary, size = 22 }: GlyphProps) {
296
+ export function ComposePostGlyph({ color = m3Colors.onPrimary, size = 24 }: GlyphProps) {
297
+ const stroke = Math.max(1.8, size * 0.075);
298
+ const frame = size * 0.74;
299
+ const plusLen = frame * 0.42;
297
300
  return (
298
301
  <View style={{ width: size, height: size, alignItems: 'center', justifyContent: 'center' }}>
299
302
  <View
300
303
  style={{
301
- width: size * 0.14,
302
- height: size * 0.72,
303
- borderRadius: size * 0.07,
304
- backgroundColor: color,
305
- transform: [{ rotate: '-18deg' }],
306
- }}
307
- />
308
- <View
309
- style={{
310
- position: 'absolute',
311
- top: size * 0.08,
312
- left: size * 0.34,
313
- width: size * 0.34,
314
- height: size * 0.12,
315
- borderTopWidth: 1.8,
316
- borderRightWidth: 1.8,
304
+ width: frame,
305
+ height: frame,
306
+ borderRadius: size * 0.12,
307
+ borderWidth: stroke,
317
308
  borderColor: color,
318
- borderTopRightRadius: size * 0.08,
319
- transform: [{ rotate: '12deg' }],
309
+ alignItems: 'center',
310
+ justifyContent: 'center',
320
311
  }}
321
- />
312
+ >
313
+ <View style={{ width: plusLen, height: stroke, backgroundColor: color, borderRadius: 1 }} />
314
+ <View
315
+ style={{
316
+ position: 'absolute',
317
+ width: stroke,
318
+ height: plusLen,
319
+ backgroundColor: color,
320
+ borderRadius: 1,
321
+ }}
322
+ />
323
+ </View>
322
324
  </View>
323
325
  );
324
326
  }
@@ -17,6 +17,53 @@ export {
17
17
  ComposeTrashGlyph,
18
18
  ComposeVideoGlyph,
19
19
  } from './compose-glyphs';
20
+ export {
21
+ AppChromeBackGlyph,
22
+ AppChromeBookmarkGlyph,
23
+ AppChromeBoostGlyph,
24
+ AppChromeChatGlyph,
25
+ AppChromeChevronDownGlyph,
26
+ AppChromeChevronRightGlyph,
27
+ AppChromeCloseGlyph,
28
+ AppChromeCommunitiesGlyph,
29
+ AppChromeEditGlyph,
30
+ AppChromeEventsGlyph,
31
+ AppChromeFireGlyph,
32
+ AppChromeFlashGlyph,
33
+ AppChromeFlipCameraGlyph,
34
+ AppChromeHeartFilledGlyph,
35
+ AppChromeHeartGlyph,
36
+ AppChromeHuntGlyph,
37
+ AppChromeIncognitoGlyph,
38
+ AppChromeListGlyph,
39
+ AppChromeLocationGlyph,
40
+ AppChromeMicGlyph,
41
+ AppChromeOverflowGlyph,
42
+ AppChromePauseGlyph,
43
+ AppChromePlayGlyph,
44
+ AppChromePlusGlyph,
45
+ AppChromeProfileGlyph,
46
+ AppChromePublishGlyph,
47
+ AppChromeRepostGlyph,
48
+ AppChromeSearchGlyph,
49
+ AppChromeSendGlyph,
50
+ AppChromeSettingsGlyph,
51
+ AppChromeShieldGlyph,
52
+ AppChromeSignOutGlyph,
53
+ AppChromeStarGlyph,
54
+ AppChromeStoryEffectsGlyph,
55
+ AppChromeStoryGlyph,
56
+ AppChromeStoryMentionGlyph,
57
+ AppChromeStoryMusicGlyph,
58
+ AppChromeStoryStickerGlyph,
59
+ AppChromeStoryTextGlyph,
60
+ AppChromeTabChatGlyph,
61
+ AppChromeTabDiscoverGlyph,
62
+ AppChromeTabFlashGlyph,
63
+ AppChromeTabVibesGlyph,
64
+ type AppChromeGlyphProps,
65
+ } from './app-glyphs';
66
+ export { AppIcon, APP_ICON_SIZE, type AppIconName, type AppIconProps } from './app-icon';
20
67
  export { ComposeMediaCarousel, type ComposeMediaCarouselItem } from './compose-media-carousel';
21
68
  export { ComposeMediaShortcut, COMPOSE_MEDIA_TILE_SIZE } from './compose-media-shortcut';
22
69
  export { ComposeRecentMediaGrid, type ComposeRecentMediaItem } from './compose-recent-media-grid';