@compsych/mobile-ui 1.0.25 → 1.0.26
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 +1 -1
- package/src/components/ServiceCard/index.tsx +32 -8
- package/src/icons/index.ts +2 -13
- package/src/index.ts +1 -1
- package/src/icons/UserCall.tsx +0 -53
package/package.json
CHANGED
|
@@ -92,6 +92,7 @@ export function ServiceCard({
|
|
|
92
92
|
innerBg: undefined,
|
|
93
93
|
iconBadgeBg: undefined,
|
|
94
94
|
iconBadgeColor: undefined,
|
|
95
|
+
buttonIconBg: cr.surface.surfaceContainer.sysSurfaceContainer,
|
|
95
96
|
},
|
|
96
97
|
tonal: {
|
|
97
98
|
bg: cr.addOn.primaryFixed.sysPrimaryFixedDim,
|
|
@@ -104,6 +105,7 @@ export function ServiceCard({
|
|
|
104
105
|
innerBg: undefined,
|
|
105
106
|
iconBadgeBg: undefined,
|
|
106
107
|
iconBadgeColor: undefined,
|
|
108
|
+
buttonIconBg: cr.surface.surfaceContainer.sysSurfaceContainerLowest,
|
|
107
109
|
},
|
|
108
110
|
filled: {
|
|
109
111
|
bg: cr.accent.primary.sysPrimaryContainer,
|
|
@@ -116,6 +118,7 @@ export function ServiceCard({
|
|
|
116
118
|
innerBg: undefined,
|
|
117
119
|
iconBadgeBg: undefined,
|
|
118
120
|
iconBadgeColor: undefined,
|
|
121
|
+
buttonIconBg: cr.surface.surfaceContainer.sysSurfaceContainerLowest,
|
|
119
122
|
},
|
|
120
123
|
doubled: {
|
|
121
124
|
bg: cr.surface.surfaceContainer.sysSurfaceContainerLowest,
|
|
@@ -128,6 +131,7 @@ export function ServiceCard({
|
|
|
128
131
|
innerBg: cr.transparent.primary.sysPrimary08,
|
|
129
132
|
iconBadgeBg: cr.accent.primary.sysPrimary,
|
|
130
133
|
iconBadgeColor: cr.accent.primary.sysOnPrimary,
|
|
134
|
+
buttonIconBg: cr.surface.surfaceContainer.sysSurfaceContainerLowest,
|
|
131
135
|
},
|
|
132
136
|
image: {
|
|
133
137
|
bg: 'transparent',
|
|
@@ -140,6 +144,7 @@ export function ServiceCard({
|
|
|
140
144
|
innerBg: undefined,
|
|
141
145
|
iconBadgeBg: undefined,
|
|
142
146
|
iconBadgeColor: undefined,
|
|
147
|
+
buttonIconBg: cr.surface.surfaceContainer.sysSurfaceContainerLowest,
|
|
143
148
|
},
|
|
144
149
|
}),
|
|
145
150
|
[cr, dim],
|
|
@@ -366,16 +371,25 @@ export function ServiceCard({
|
|
|
366
371
|
{children}
|
|
367
372
|
{buttonIcon && (
|
|
368
373
|
<View
|
|
369
|
-
style={
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
style={[
|
|
375
|
+
styles.buttonIconWrapper,
|
|
376
|
+
{
|
|
377
|
+
bottom: s.paddingV,
|
|
378
|
+
...(I18nManager.isRTL
|
|
379
|
+
? { left: s.paddingH }
|
|
380
|
+
: { right: s.paddingH }),
|
|
381
|
+
},
|
|
382
|
+
]}
|
|
376
383
|
pointerEvents="none"
|
|
377
384
|
>
|
|
378
|
-
|
|
385
|
+
<View
|
|
386
|
+
style={[
|
|
387
|
+
styles.buttonIconCircle,
|
|
388
|
+
{ backgroundColor: v.buttonIconBg },
|
|
389
|
+
]}
|
|
390
|
+
>
|
|
391
|
+
{buttonIcon}
|
|
392
|
+
</View>
|
|
379
393
|
</View>
|
|
380
394
|
)}
|
|
381
395
|
</>
|
|
@@ -425,6 +439,16 @@ const styles = StyleSheet.create({
|
|
|
425
439
|
width: '100%',
|
|
426
440
|
gap: 16,
|
|
427
441
|
},
|
|
442
|
+
buttonIconWrapper: {
|
|
443
|
+
position: 'absolute',
|
|
444
|
+
},
|
|
445
|
+
buttonIconCircle: {
|
|
446
|
+
width: 36,
|
|
447
|
+
height: 36,
|
|
448
|
+
borderRadius: 18,
|
|
449
|
+
alignItems: 'center',
|
|
450
|
+
justifyContent: 'center',
|
|
451
|
+
},
|
|
428
452
|
imageArrowButton: {
|
|
429
453
|
width: 32,
|
|
430
454
|
height: 32,
|
package/src/icons/index.ts
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
import type { LucideIcon } from 'lucide-react-native';
|
|
2
2
|
|
|
3
|
-
import { UserCall } from './UserCall';
|
|
4
|
-
|
|
5
3
|
export type { IconProps, IconSize, IconName } from './types';
|
|
6
4
|
export { DEFAULT_ICON_COLOR, SIZE_MAP } from './types';
|
|
7
|
-
export { UserCall } from './UserCall';
|
|
8
|
-
|
|
9
|
-
const CUSTOM_ICONS: Record<string, unknown> = {
|
|
10
|
-
UserCall,
|
|
11
|
-
};
|
|
12
5
|
|
|
13
6
|
/**
|
|
14
|
-
* Resolves an icon name to a Lucide React Native component
|
|
7
|
+
* Resolves an icon name to a Lucide React Native component.
|
|
15
8
|
* Accepts both "StethoscopeIcon" (trailing Icon suffix) and "Stethoscope".
|
|
16
|
-
* Returns undefined if the icon name is not found.
|
|
9
|
+
* Returns undefined if the icon name is not found in lucide-react-native.
|
|
17
10
|
*/
|
|
18
11
|
export function resolveIcon(name: string): LucideIcon | undefined {
|
|
19
12
|
const componentName = name.endsWith('Icon') ? name.slice(0, -4) : name;
|
|
20
13
|
|
|
21
|
-
if (CUSTOM_ICONS[componentName]) {
|
|
22
|
-
return CUSTOM_ICONS[componentName] as LucideIcon;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
14
|
const icons = require('lucide-react-native') as Record<string, unknown>;
|
|
26
15
|
return icons[componentName] as LucideIcon | undefined;
|
|
27
16
|
}
|
package/src/index.ts
CHANGED
|
@@ -153,5 +153,5 @@ export { ThemeProvider, useTheme, defaultTheme } from './theme';
|
|
|
153
153
|
export type { ThemeProviderProps, Theme, ThemeOverride } from './theme';
|
|
154
154
|
|
|
155
155
|
// Icons — resolved from lucide-react-native at runtime
|
|
156
|
-
export { resolveIcon, SIZE_MAP, DEFAULT_ICON_COLOR
|
|
156
|
+
export { resolveIcon, SIZE_MAP, DEFAULT_ICON_COLOR } from './icons';
|
|
157
157
|
export type { IconProps, IconSize, IconName } from './icons';
|
package/src/icons/UserCall.tsx
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { G, Path, Svg } from 'react-native-svg';
|
|
3
|
-
|
|
4
|
-
interface UserCallProps {
|
|
5
|
-
size?: number;
|
|
6
|
-
color?: string;
|
|
7
|
-
strokeWidth?: number;
|
|
8
|
-
style?: object;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function UserCall({
|
|
12
|
-
size = 24,
|
|
13
|
-
color = '#1a1a1a',
|
|
14
|
-
strokeWidth = 1.5,
|
|
15
|
-
style,
|
|
16
|
-
}: UserCallProps) {
|
|
17
|
-
return (
|
|
18
|
-
<Svg
|
|
19
|
-
width={size}
|
|
20
|
-
height={size}
|
|
21
|
-
viewBox="0 0 24 24"
|
|
22
|
-
fill="none"
|
|
23
|
-
style={style}
|
|
24
|
-
>
|
|
25
|
-
<G transform="translate(3, 2)">
|
|
26
|
-
<Path
|
|
27
|
-
d="M 8 8 C 10.2091 8 12 6.20914 12 4 C 12 1.79086 10.2091 0 8 0 C 5.79086 0 4 1.79086 4 4 C 4 6.20914 5.79086 8 8 8 Z"
|
|
28
|
-
stroke={color}
|
|
29
|
-
strokeWidth={strokeWidth}
|
|
30
|
-
strokeLinecap="round"
|
|
31
|
-
strokeLinejoin="round"
|
|
32
|
-
fill="none"
|
|
33
|
-
/>
|
|
34
|
-
<Path
|
|
35
|
-
d="M 15.2892 17.7358 L 16.4228 16.3183 L 19.5 17.6848 L 18.9014 19.9919 C 18.8136 20.329 18.4871 20.5469 18.1421 20.4994 C 13.6595 19.8701 10.1362 16.3469 9.5066 11.8641 C 9.4587 11.5191 9.6769 11.1927 10.0141 11.1044 L 12.322 10.5059 L 13.6888 13.5834 L 12.2709 14.7176"
|
|
36
|
-
stroke={color}
|
|
37
|
-
strokeWidth={strokeWidth}
|
|
38
|
-
strokeLinecap="round"
|
|
39
|
-
strokeLinejoin="round"
|
|
40
|
-
fill="none"
|
|
41
|
-
/>
|
|
42
|
-
<Path
|
|
43
|
-
d="M 5.5 11.3984 C 2.3062 12.4483 0 15.455 0 19 C 3 19.7498 6 20.0779 9 19.9841"
|
|
44
|
-
stroke={color}
|
|
45
|
-
strokeWidth={strokeWidth}
|
|
46
|
-
strokeLinecap="round"
|
|
47
|
-
strokeLinejoin="round"
|
|
48
|
-
fill="none"
|
|
49
|
-
/>
|
|
50
|
-
</G>
|
|
51
|
-
</Svg>
|
|
52
|
-
);
|
|
53
|
-
}
|