@startsimpli/integrations 0.2.106 → 0.2.107
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startsimpli/integrations",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.107",
|
|
4
4
|
"description": "Provider-agnostic types, API clients, hooks, and UI primitives for email + calendar integrations across StartSimpli apps, plus foundry customer email (subpath ./comms).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://startsimpli.com",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"react-native": ">=0.74.0",
|
|
51
51
|
"@startsimpli/ui-native": ">=0.1.11",
|
|
52
52
|
"react-native-safe-area-context": ">=4.0.0",
|
|
53
|
-
"@startsimpli/auth": "^0.4.49",
|
|
54
53
|
"@startsimpli/ui": "^0.4.170",
|
|
54
|
+
"@startsimpli/auth": "^0.4.49",
|
|
55
55
|
"@startsimpli/utils": "^0.4.17"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import { FlatList, Pressable, RefreshControl, View } from 'react-native';
|
|
3
|
-
import { Alert, Button, EmptyState, Header, IconTile, ListRow, SectionHeader, Skeleton, StatTile,
|
|
3
|
+
import { Alert, Button, EmptyState, Header, IconTile, ListRow, SectionHeader, Skeleton, StatTile, useHaptics, useTheme } from '@startsimpli/ui-native';
|
|
4
4
|
import { iconName, toneKey } from '../screens/shared/displayView';
|
|
5
5
|
import { useControllerState } from '../components/useControllerState';
|
|
6
6
|
import { timeAgo, type HomeArrival, type HomeController } from './controller';
|
|
@@ -61,7 +61,6 @@ export function HomeScreen({ controller, brand, tagline, onRecord, onOpenType, o
|
|
|
61
61
|
eyebrow={item.typeLabel || undefined}
|
|
62
62
|
title={item.title}
|
|
63
63
|
subtitle={item.display.subtitle ?? undefined}
|
|
64
|
-
trailing={item.display.status ? <StatusChip status={item.display.status.value} tone={toneKey(item.display.status.tone)} /> : undefined}
|
|
65
64
|
meta={timeAgo(item.createdAt, now())}
|
|
66
65
|
onPress={onOpenArrival ? () => onOpenArrival(item) : undefined}
|
|
67
66
|
/>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { iconName, toneKey, whenText } from '../shared/displayView';
|
|
3
|
+
|
|
4
|
+
describe('displayView', () => {
|
|
5
|
+
it('icon tokens: exact, then the head word, then the fallback', () => {
|
|
6
|
+
expect(iconName('note')).toBe('note');
|
|
7
|
+
expect(iconName('check-circle')).toBe('check');
|
|
8
|
+
expect(iconName('rocket')).toBe('dot');
|
|
9
|
+
expect(iconName(null, 'note')).toBe('note');
|
|
10
|
+
});
|
|
11
|
+
it('tones map to the design system and unknown reads neutral', () => {
|
|
12
|
+
expect(toneKey('good')).toBe('success');
|
|
13
|
+
expect(toneKey('bad')).toBe('danger');
|
|
14
|
+
expect(toneKey(undefined)).toBe('neutral');
|
|
15
|
+
});
|
|
16
|
+
it('dates read short, a non-date shows as written', () => {
|
|
17
|
+
expect(whenText('2026-11-05', Date.parse('2026-11-04'))).toBe('Nov 5');
|
|
18
|
+
expect(whenText('soon')).toBe('soon');
|
|
19
|
+
expect(whenText(null)).toBeUndefined();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -9,7 +9,11 @@ export const toneKey = (tone: DisplayTone | undefined | null): ToneKey => (tone
|
|
|
9
9
|
|
|
10
10
|
/** A declared icon token as an icon the app draws: the shared icon set, else `fallback`. */
|
|
11
11
|
export function iconName(token: string | null | undefined, fallback: IconName = 'dot'): IconName {
|
|
12
|
-
|
|
12
|
+
if (!token) return fallback;
|
|
13
|
+
if (token in ICON_PATHS) return token as IconName;
|
|
14
|
+
// `check-circle` -> `check`: a more specific token falls back to its head word before the generic icon.
|
|
15
|
+
const head = token.split('-')[0];
|
|
16
|
+
return head in ICON_PATHS ? (head as IconName) : fallback;
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
/** A declared date attribute as a short date; a value that is not a date shows as written. */
|