@situaction/traquiste-mobile 1.0.0-next.2 → 1.0.0-next.4

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 (99) hide show
  1. package/package.json +4 -1
  2. package/.eslintrc.js +0 -5
  3. package/.releaserc +0 -12
  4. package/CLAUDE.md +0 -25
  5. package/app.json +0 -5
  6. package/bitbucket-pipelines.yml +0 -81
  7. package/build/components/Button/Button.stories.d.ts +0 -19
  8. package/build/components/Button/Button.stories.d.ts.map +0 -1
  9. package/build/components/Button/Button.stories.js +0 -95
  10. package/build/components/Button/Button.stories.js.map +0 -1
  11. package/build/components/ButtonAction/ButtonAction.stories.d.ts +0 -13
  12. package/build/components/ButtonAction/ButtonAction.stories.d.ts.map +0 -1
  13. package/build/components/ButtonAction/ButtonAction.stories.js +0 -51
  14. package/build/components/ButtonAction/ButtonAction.stories.js.map +0 -1
  15. package/build/components/ButtonMap/ButtonMap.stories.d.ts +0 -12
  16. package/build/components/ButtonMap/ButtonMap.stories.d.ts.map +0 -1
  17. package/build/components/ButtonMap/ButtonMap.stories.js +0 -36
  18. package/build/components/ButtonMap/ButtonMap.stories.js.map +0 -1
  19. package/build/components/ButtonMenu/ButtonMenu.stories.d.ts +0 -15
  20. package/build/components/ButtonMenu/ButtonMenu.stories.d.ts.map +0 -1
  21. package/build/components/ButtonMenu/ButtonMenu.stories.js +0 -52
  22. package/build/components/ButtonMenu/ButtonMenu.stories.js.map +0 -1
  23. package/build/components/FilterChip/FilterChip.stories.d.ts +0 -15
  24. package/build/components/FilterChip/FilterChip.stories.d.ts.map +0 -1
  25. package/build/components/FilterChip/FilterChip.stories.js +0 -55
  26. package/build/components/FilterChip/FilterChip.stories.js.map +0 -1
  27. package/docs/README.md +0 -73
  28. package/docs/eslint.config.js +0 -22
  29. package/docs/index.html +0 -16
  30. package/docs/package-lock.json +0 -5578
  31. package/docs/package.json +0 -37
  32. package/docs/public/favicon.svg +0 -1
  33. package/docs/public/icons.svg +0 -24
  34. package/docs/src/App.css +0 -184
  35. package/docs/src/App.tsx +0 -38
  36. package/docs/src/assets/hero.png +0 -0
  37. package/docs/src/assets/react.svg +0 -1
  38. package/docs/src/assets/vite.svg +0 -1
  39. package/docs/src/components/Layout.tsx +0 -108
  40. package/docs/src/components/LiveEditor.tsx +0 -294
  41. package/docs/src/components/PropsTable.tsx +0 -101
  42. package/docs/src/components/Sidebar.tsx +0 -103
  43. package/docs/src/components/TableOfContents.tsx +0 -75
  44. package/docs/src/context/ColorModeContext.tsx +0 -34
  45. package/docs/src/index.css +0 -76
  46. package/docs/src/lib/createComponentPage.tsx +0 -270
  47. package/docs/src/main.tsx +0 -13
  48. package/docs/src/pages/Examples.tsx +0 -273
  49. package/docs/src/pages/Home.tsx +0 -70
  50. package/docs/src/pages/components/button-action.ts +0 -88
  51. package/docs/src/pages/components/button-map.ts +0 -67
  52. package/docs/src/pages/components/button-menu.ts +0 -90
  53. package/docs/src/pages/components/button.ts +0 -158
  54. package/docs/src/pages/components/filter-chip.ts +0 -109
  55. package/docs/tsconfig.app.json +0 -32
  56. package/docs/tsconfig.json +0 -7
  57. package/docs/tsconfig.node.json +0 -24
  58. package/docs/vite.config.ts +0 -18
  59. package/ios/.xcode.env +0 -11
  60. package/ios/Podfile +0 -63
  61. package/ios/Podfile.properties.json +0 -4
  62. package/ios/situactiontraquistemobile/AppDelegate.swift +0 -69
  63. package/ios/situactiontraquistemobile/Images.xcassets/AppIcon.appiconset/Contents.json +0 -13
  64. package/ios/situactiontraquistemobile/Images.xcassets/Contents.json +0 -6
  65. package/ios/situactiontraquistemobile/Images.xcassets/SplashScreenLegacy.imageset/Contents.json +0 -21
  66. package/ios/situactiontraquistemobile/Images.xcassets/SplashScreenLegacy.imageset/SplashScreenLegacy.png +0 -0
  67. package/ios/situactiontraquistemobile/Info.plist +0 -53
  68. package/ios/situactiontraquistemobile/SplashScreen.storyboard +0 -47
  69. package/ios/situactiontraquistemobile/Supporting/Expo.plist +0 -6
  70. package/ios/situactiontraquistemobile/situactiontraquistemobile-Bridging-Header.h +0 -3
  71. package/ios/situactiontraquistemobile.xcodeproj/project.pbxproj +0 -432
  72. package/ios/situactiontraquistemobile.xcodeproj/xcshareddata/xcschemes/situactiontraquistemobile.xcscheme +0 -88
  73. package/jest.config.js +0 -197
  74. package/src/components/.gitkeep +0 -0
  75. package/src/components/Button/Button.stories.tsx +0 -123
  76. package/src/components/Button/Button.tsx +0 -128
  77. package/src/components/Button/index.ts +0 -2
  78. package/src/components/ButtonAction/ButtonAction.stories.tsx +0 -67
  79. package/src/components/ButtonAction/ButtonAction.tsx +0 -67
  80. package/src/components/ButtonAction/index.ts +0 -2
  81. package/src/components/ButtonMap/ButtonMap.stories.tsx +0 -49
  82. package/src/components/ButtonMap/ButtonMap.tsx +0 -40
  83. package/src/components/ButtonMap/index.ts +0 -2
  84. package/src/components/ButtonMenu/ButtonMenu.stories.tsx +0 -68
  85. package/src/components/ButtonMenu/ButtonMenu.tsx +0 -97
  86. package/src/components/ButtonMenu/index.ts +0 -2
  87. package/src/components/FilterChip/FilterChip.stories.tsx +0 -71
  88. package/src/components/FilterChip/FilterChip.tsx +0 -124
  89. package/src/components/FilterChip/index.ts +0 -2
  90. package/src/constants/colors.ts +0 -2
  91. package/src/context/ThemeContext.tsx +0 -84
  92. package/src/index.ts +0 -23
  93. package/src/theme/index.ts +0 -20
  94. package/src/theme/tokens/dark.ts +0 -160
  95. package/src/theme/tokens/light.ts +0 -166
  96. package/src/theme/type.ts +0 -122
  97. package/src/types/.gitkeep +0 -0
  98. package/src/utils/.gitkeep +0 -0
  99. package/tsconfig.json +0 -9
@@ -1,270 +0,0 @@
1
- /** Factory that generates a full documentation page for a component */
2
- import { useState } from 'react'
3
- import PropsTable from '../components/PropsTable'
4
- import LiveEditor from '../components/LiveEditor'
5
- import TableOfContents from '../components/TableOfContents'
6
- import type { PropDef } from '../components/PropsTable'
7
- import type { TocItem } from '../components/TableOfContents'
8
-
9
- export type { PropDef }
10
-
11
- export interface Demo {
12
- /** Optional H2 section heading rendered above this demo */
13
- section?: string
14
- /** Optional description rendered below the section heading */
15
- sectionDescription?: string
16
- /** Label shown in the demo card header */
17
- title: string
18
- /** JSX expression shown and evaluated live */
19
- code: string
20
- }
21
-
22
- export type ComponentStatus = 'stable' | 'beta' | 'new' | 'deprecated'
23
-
24
- export interface ComponentPageConfig {
25
- title: string
26
- description: string
27
- /** Maturity status of the component */
28
- status?: ComponentStatus
29
- /** Link to the Figma component (opens in a new tab) */
30
- figma?: string
31
- /** Components available in the live editor. React is injected automatically. */
32
- scope: Record<string, unknown>
33
- demos: Demo[]
34
- props: PropDef[]
35
- }
36
-
37
- const STATUS_CONFIG: Record<ComponentStatus, { label: string; color: string; bg: string; border: string }> = {
38
- stable: { label: 'Stable', color: '#16a34a', bg: '#f0fdf4', border: '#bbf7d0' },
39
- beta: { label: 'Beta', color: '#d97706', bg: '#fffbeb', border: '#fde68a' },
40
- new: { label: 'Nouveau', color: '#2563eb', bg: '#eff6ff', border: '#bfdbfe' },
41
- deprecated: { label: 'Déprécié', color: '#dc2626', bg: '#fef2f2', border: '#fecaca' },
42
- }
43
-
44
- function StatusBadge({ status }: { status: ComponentStatus }) {
45
- const { label, color, bg, border } = STATUS_CONFIG[status]
46
- return (
47
- <span style={{
48
- display: 'inline-flex',
49
- alignItems: 'center',
50
- fontSize: 11,
51
- fontWeight: 700,
52
- letterSpacing: '0.05em',
53
- textTransform: 'uppercase' as const,
54
- color,
55
- backgroundColor: bg,
56
- border: `1px solid ${border}`,
57
- borderRadius: 999,
58
- padding: '3px 10px',
59
- }}>
60
- {label}
61
- </span>
62
- )
63
- }
64
-
65
- function ImportBlock({ componentName }: { componentName: string }) {
66
- const [copied, setCopied] = useState(false)
67
- const snippet = `import { ${componentName} } from '@situaction/traquiste-mobile'`
68
-
69
- function handleCopy() {
70
- navigator.clipboard.writeText(snippet).then(() => {
71
- setCopied(true)
72
- setTimeout(() => setCopied(false), 2000)
73
- })
74
- }
75
-
76
- return (
77
- <div style={S.importBlock}>
78
- <code style={S.importCode}>{snippet}</code>
79
- <button
80
- style={{ ...S.importBtn, ...(copied ? S.importBtnCopied : {}) }}
81
- onClick={handleCopy}
82
- >
83
- {copied ? '✓ Copié' : 'Copier'}
84
- </button>
85
- </div>
86
- )
87
- }
88
-
89
- function FigmaIcon() {
90
- return (
91
- <svg width="12" height="16" viewBox="0 0 38 57" fill="none" xmlns="http://www.w3.org/2000/svg">
92
- <path d="M19 28.5A9.5 9.5 0 1 1 28.5 19 9.5 9.5 0 0 1 19 28.5Z" fill="#1ABCFE"/>
93
- <path d="M0 47.5A9.5 9.5 0 0 1 9.5 38H19V47.5A9.5 9.5 0 0 1 0 47.5Z" fill="#0ACF83"/>
94
- <path d="M19 0V19H28.5A9.5 9.5 0 0 0 19 0Z" fill="#FF7262"/>
95
- <path d="M0 9.5A9.5 9.5 0 0 0 9.5 19H19V0H9.5A9.5 9.5 0 0 0 0 9.5Z" fill="#F24E1E"/>
96
- <path d="M0 28.5A9.5 9.5 0 0 0 9.5 38H19V19H9.5A9.5 9.5 0 0 0 0 28.5Z" fill="#A259FF"/>
97
- </svg>
98
- )
99
- }
100
-
101
- function slugify(text: string): string {
102
- return text.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '')
103
- }
104
-
105
- const S = {
106
- layout: { display: 'flex', gap: 48, alignItems: 'flex-start' as const },
107
- content: { flex: 1, minWidth: 0 },
108
- title: {
109
- fontSize: 36,
110
- fontWeight: 700,
111
- marginBottom: 8,
112
- color: 'var(--docs-text-primary)',
113
- letterSpacing: '-0.02em',
114
- },
115
- description: {
116
- fontSize: 16,
117
- color: 'var(--docs-text-secondary)',
118
- marginBottom: 40,
119
- lineHeight: 1.6,
120
- },
121
- sectionHeading: {
122
- fontSize: 22,
123
- fontWeight: 600,
124
- color: 'var(--docs-text-primary)',
125
- marginBottom: 12,
126
- marginTop: 40,
127
- paddingTop: 24,
128
- borderTop: '1px solid var(--docs-border)',
129
- scrollMarginTop: 80,
130
- },
131
- sectionDescription: {
132
- fontSize: 15,
133
- color: 'var(--docs-text-secondary)',
134
- lineHeight: 1.65,
135
- marginBottom: 20,
136
- },
137
- meta: {
138
- display: 'flex',
139
- alignItems: 'center' as const,
140
- gap: 8,
141
- marginBottom: 40,
142
- },
143
- importBlock: {
144
- display: 'flex',
145
- alignItems: 'center',
146
- justifyContent: 'space-between' as const,
147
- gap: 12,
148
- backgroundColor: '#0d1117',
149
- border: '1px solid var(--docs-border)',
150
- borderRadius: 8,
151
- padding: '12px 16px',
152
- marginBottom: 40,
153
- },
154
- importCode: {
155
- fontFamily: 'ui-monospace, Consolas, monospace',
156
- fontSize: 13,
157
- color: '#e6edf3',
158
- flex: 1,
159
- },
160
- importBtn: {
161
- fontSize: 11,
162
- fontWeight: 500,
163
- padding: '3px 8px',
164
- border: '1px solid #30363d',
165
- borderRadius: 5,
166
- cursor: 'pointer',
167
- backgroundColor: '#21262d',
168
- color: '#8b949e',
169
- fontFamily: 'inherit',
170
- whiteSpace: 'nowrap' as const,
171
- flexShrink: 0,
172
- },
173
- importBtnCopied: {
174
- color: '#3fb950',
175
- borderColor: '#238636',
176
- backgroundColor: '#0d1117',
177
- },
178
- figmaBtn: {
179
- display: 'inline-flex',
180
- alignItems: 'center' as const,
181
- gap: 6,
182
- fontSize: 13,
183
- fontWeight: 500,
184
- color: 'var(--docs-text-secondary)',
185
- backgroundColor: 'var(--docs-surface)',
186
- border: '1px solid var(--docs-border)',
187
- borderRadius: 6,
188
- padding: '5px 12px',
189
- textDecoration: 'none',
190
- boxShadow: 'var(--docs-shadow-sm)',
191
- transition: 'color 0.15s, border-color 0.15s',
192
- },
193
- propsHeading: {
194
- fontSize: 22,
195
- fontWeight: 600,
196
- color: 'var(--docs-text-primary)',
197
- marginBottom: 16,
198
- marginTop: 40,
199
- paddingTop: 24,
200
- borderTop: '1px solid var(--docs-border)',
201
- scrollMarginTop: 80,
202
- },
203
- }
204
-
205
- export function createComponentPage(config: ComponentPageConfig) {
206
- const tocItems: TocItem[] = []
207
- const seenSections = new Set<string>()
208
- for (const demo of config.demos) {
209
- if (demo.section && !seenSections.has(demo.section)) {
210
- seenSections.add(demo.section)
211
- tocItems.push({ id: slugify(demo.section), label: demo.section })
212
- }
213
- }
214
- tocItems.push({ id: 'props', label: 'Props' })
215
-
216
- return function ComponentPage() {
217
- let lastSection = ''
218
-
219
- return (
220
- <div style={S.layout}>
221
- <div style={S.content}>
222
- <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 8 }}>
223
- <h1 style={{ ...S.title, marginBottom: 0 }}>{config.title}</h1>
224
- {config.status && <StatusBadge status={config.status} />}
225
- </div>
226
- <div style={S.meta}>
227
- <p style={{ ...S.description, margin: 0, flex: 1 }}>{config.description}</p>
228
- {config.figma && (
229
- <a href={config.figma} target="_blank" rel="noreferrer" style={S.figmaBtn}>
230
- <FigmaIcon />
231
- Figma
232
- </a>
233
- )}
234
- </div>
235
-
236
- <ImportBlock componentName={config.title} />
237
-
238
- <section>
239
- {config.demos.map((demo, i) => {
240
- const showSection = !!demo.section && demo.section !== lastSection
241
- if (demo.section) lastSection = demo.section
242
- return (
243
- <div key={i}>
244
- {showSection && (
245
- <>
246
- <h2 id={slugify(demo.section!)} style={S.sectionHeading}>
247
- {demo.section}
248
- </h2>
249
- {demo.sectionDescription && (
250
- <p style={S.sectionDescription}>{demo.sectionDescription}</p>
251
- )}
252
- </>
253
- )}
254
- <LiveEditor title={demo.title} initialCode={demo.code} scope={config.scope} />
255
- </div>
256
- )
257
- })}
258
- </section>
259
-
260
- <section>
261
- <h2 id="props" style={S.propsHeading}>Props</h2>
262
- <PropsTable props={config.props} />
263
- </section>
264
- </div>
265
-
266
- <TableOfContents items={tocItems} />
267
- </div>
268
- )
269
- }
270
- }
package/docs/src/main.tsx DELETED
@@ -1,13 +0,0 @@
1
- import { StrictMode } from 'react'
2
- import { createRoot } from 'react-dom/client'
3
- import { BrowserRouter } from 'react-router-dom'
4
- import './index.css'
5
- import App from './App.tsx'
6
-
7
- createRoot(document.getElementById('root')!).render(
8
- <StrictMode>
9
- <BrowserRouter>
10
- <App />
11
- </BrowserRouter>
12
- </StrictMode>,
13
- )
@@ -1,273 +0,0 @@
1
- /** Real-world usage examples — showcases components in realistic UI scenarios */
2
- import { Text, TouchableOpacity, View, StyleSheet } from 'react-native'
3
- import LiveEditor from '../components/LiveEditor'
4
-
5
- // Button stub — mirrors docs/src/pages/components/button.tsx
6
- function Button({
7
- label = 'Button',
8
- variant = 'primary',
9
- disabled = false,
10
- onPress,
11
- }: {
12
- label?: string
13
- variant?: 'primary' | 'secondary'
14
- disabled?: boolean
15
- onPress?: () => void
16
- }) {
17
- return (
18
- <TouchableOpacity
19
- style={[
20
- btnStyles.base,
21
- variant === 'secondary' ? btnStyles.secondary : btnStyles.primary,
22
- disabled && btnStyles.disabled,
23
- ]}
24
- disabled={disabled}
25
- onPress={onPress}
26
- activeOpacity={0.8}
27
- >
28
- <Text style={[btnStyles.label, variant === 'secondary' && btnStyles.labelSecondary]}>
29
- {label}
30
- </Text>
31
- </TouchableOpacity>
32
- )
33
- }
34
-
35
- const btnStyles = StyleSheet.create({
36
- base: { paddingHorizontal: 24, paddingVertical: 12, borderRadius: 8, alignItems: 'center' },
37
- primary: { backgroundColor: '#0072E5' },
38
- secondary: { backgroundColor: 'transparent', borderWidth: 1, borderColor: '#0072E5' },
39
- disabled: { opacity: 0.4 },
40
- label: { color: '#fff', fontSize: 14, fontWeight: '600' },
41
- labelSecondary: { color: '#0072E5' },
42
- })
43
-
44
- const SCOPE = { Button, View, Text, StyleSheet }
45
-
46
- interface Example {
47
- section: string
48
- sectionDescription: string
49
- title: string
50
- description: string
51
- code: string
52
- }
53
-
54
- const EXAMPLES: Example[] = [
55
- {
56
- section: 'Authentification',
57
- sectionDescription:
58
- 'Les boutons guident l\'utilisateur à travers les formulaires d\'identification. Le bouton primary valide, le secondary offre une alternative.',
59
- title: 'Formulaire de connexion',
60
- description: 'Le bouton primary déclenche la soumission. Il peut être désactivé tant que les champs sont vides.',
61
- code: `<View style={{ width: 320, backgroundColor: '#ffffff', borderRadius: 16, padding: 28, shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.08, shadowRadius: 16, elevation: 4 }}>
62
- <Text style={{ fontSize: 22, fontWeight: '700', color: '#18181b', marginBottom: 4 }}>Connexion</Text>
63
- <Text style={{ fontSize: 14, color: '#71717a', marginBottom: 28 }}>Accédez à votre espace de travail</Text>
64
-
65
- <Text style={{ fontSize: 13, fontWeight: '500', color: '#3f3f46', marginBottom: 6 }}>Email</Text>
66
- <View style={{ borderWidth: 1, borderColor: '#e4e4e7', borderRadius: 8, paddingHorizontal: 12, paddingVertical: 11, marginBottom: 16, backgroundColor: '#fafafa' }}>
67
- <Text style={{ fontSize: 14, color: '#a1a1aa' }}>exemple@situaction.fr</Text>
68
- </View>
69
-
70
- <Text style={{ fontSize: 13, fontWeight: '500', color: '#3f3f46', marginBottom: 6 }}>Mot de passe</Text>
71
- <View style={{ borderWidth: 1, borderColor: '#e4e4e7', borderRadius: 8, paddingHorizontal: 12, paddingVertical: 11, marginBottom: 28, backgroundColor: '#fafafa' }}>
72
- <Text style={{ fontSize: 14, color: '#a1a1aa' }}>••••••••</Text>
73
- </View>
74
-
75
- <Button label="Se connecter" />
76
- </View>`,
77
- },
78
- {
79
- section: 'Authentification',
80
- sectionDescription: '',
81
- title: 'Connexion désactivée',
82
- description: 'Bouton désactivé tant que les champs obligatoires ne sont pas remplis.',
83
- code: `<View style={{ width: 320, backgroundColor: '#ffffff', borderRadius: 16, padding: 28, shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.08, shadowRadius: 16, elevation: 4 }}>
84
- <Text style={{ fontSize: 22, fontWeight: '700', color: '#18181b', marginBottom: 4 }}>Connexion</Text>
85
- <Text style={{ fontSize: 14, color: '#71717a', marginBottom: 28 }}>Accédez à votre espace de travail</Text>
86
-
87
- <Text style={{ fontSize: 13, fontWeight: '500', color: '#3f3f46', marginBottom: 6 }}>Email</Text>
88
- <View style={{ borderWidth: 1, borderColor: '#e4e4e7', borderRadius: 8, paddingHorizontal: 12, paddingVertical: 11, marginBottom: 16, backgroundColor: '#fafafa' }}>
89
- <Text style={{ fontSize: 14, color: '#d4d4d8' }}>—</Text>
90
- </View>
91
-
92
- <Text style={{ fontSize: 13, fontWeight: '500', color: '#3f3f46', marginBottom: 6 }}>Mot de passe</Text>
93
- <View style={{ borderWidth: 1, borderColor: '#e4e4e7', borderRadius: 8, paddingHorizontal: 12, paddingVertical: 11, marginBottom: 28, backgroundColor: '#fafafa' }}>
94
- <Text style={{ fontSize: 14, color: '#d4d4d8' }}>—</Text>
95
- </View>
96
-
97
- <Button label="Se connecter" disabled />
98
- </View>`,
99
- },
100
- {
101
- section: 'Confirmations',
102
- sectionDescription:
103
- 'Les actions destructives ou irréversibles nécessitent une confirmation explicite. Le bouton secondary permet d\'annuler, le primary confirme l\'action.',
104
- title: 'Suppression d\'un élément',
105
- description: 'Dialogue de confirmation avec deux choix clairs : annuler (secondary) et confirmer (primary).',
106
- code: `<View style={{ width: 320, backgroundColor: '#ffffff', borderRadius: 16, padding: 28, shadowColor: '#000', shadowOffset: { width: 0, height: 8 }, shadowOpacity: 0.12, shadowRadius: 24, elevation: 8 }}>
107
- <View style={{ width: 44, height: 44, borderRadius: 12, backgroundColor: '#fef2f2', alignItems: 'center', justifyContent: 'center', marginBottom: 16 }}>
108
- <Text style={{ fontSize: 22 }}>🗑</Text>
109
- </View>
110
- <Text style={{ fontSize: 18, fontWeight: '700', color: '#18181b', marginBottom: 8 }}>Supprimer l'intervention ?</Text>
111
- <Text style={{ fontSize: 14, color: '#71717a', lineHeight: 22, marginBottom: 28 }}>
112
- Cette action est irréversible. L'intervention et toutes ses données seront définitivement supprimées.
113
- </Text>
114
- <View style={{ flexDirection: 'row', gap: 12 }}>
115
- <View style={{ flex: 1 }}>
116
- <Button label="Annuler" variant="secondary" />
117
- </View>
118
- <View style={{ flex: 1 }}>
119
- <Button label="Supprimer" />
120
- </View>
121
- </View>
122
- </View>`,
123
- },
124
- {
125
- section: 'Confirmations',
126
- sectionDescription: '',
127
- title: 'Validation d\'un rapport',
128
- description: 'Confirmation positive avec action principale mise en avant.',
129
- code: `<View style={{ width: 320, backgroundColor: '#ffffff', borderRadius: 16, padding: 28, shadowColor: '#000', shadowOffset: { width: 0, height: 8 }, shadowOpacity: 0.12, shadowRadius: 24, elevation: 8 }}>
130
- <View style={{ width: 44, height: 44, borderRadius: 12, backgroundColor: '#f0fdf4', alignItems: 'center', justifyContent: 'center', marginBottom: 16 }}>
131
- <Text style={{ fontSize: 22 }}>✅</Text>
132
- </View>
133
- <Text style={{ fontSize: 18, fontWeight: '700', color: '#18181b', marginBottom: 8 }}>Valider le rapport ?</Text>
134
- <Text style={{ fontSize: 14, color: '#71717a', lineHeight: 22, marginBottom: 28 }}>
135
- Le rapport DEV-2024-0312 sera transmis au responsable de site pour approbation finale.
136
- </Text>
137
- <View style={{ flexDirection: 'row', gap: 12 }}>
138
- <View style={{ flex: 1 }}>
139
- <Button label="Plus tard" variant="secondary" />
140
- </View>
141
- <View style={{ flex: 1 }}>
142
- <Button label="Valider" />
143
- </View>
144
- </View>
145
- </View>`,
146
- },
147
- {
148
- section: 'Navigation et actions',
149
- sectionDescription:
150
- 'Les barres d\'actions ancrent les boutons en bas d\'écran pour faciliter l\'accès aux actions principales sur mobile.',
151
- title: 'Barre d\'actions principale',
152
- description: 'Action principale en primary et action secondaire en dessous.',
153
- code: `<View style={{ width: 360, backgroundColor: '#ffffff', borderTopWidth: 1, borderTopColor: '#e4e4e7', paddingHorizontal: 20, paddingTop: 16, paddingBottom: 32, gap: 10 }}>
154
- <Text style={{ fontSize: 12, color: '#a1a1aa', textAlign: 'center', marginBottom: 4 }}>
155
- Rapport DEV-2024-0312 · En attente de validation
156
- </Text>
157
- <Button label="Valider l'intervention" />
158
- <Button label="Signaler un problème" variant="secondary" />
159
- </View>`,
160
- },
161
- {
162
- section: 'Navigation et actions',
163
- sectionDescription: '',
164
- title: 'Actions sur une fiche',
165
- description: 'Deux actions côte à côte dans un contexte de fiche détail.',
166
- code: `<View style={{ width: 360, backgroundColor: '#ffffff', borderRadius: 16, overflow: 'hidden', shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.06, shadowRadius: 8, elevation: 2 }}>
167
- <View style={{ padding: 20, borderBottomWidth: 1, borderBottomColor: '#e4e4e7' }}>
168
- <Text style={{ fontSize: 12, color: '#a1a1aa', marginBottom: 4 }}>Intervention #DEV-2024-0312</Text>
169
- <Text style={{ fontSize: 17, fontWeight: '600', color: '#18181b', marginBottom: 4 }}>Remplacement chaudière</Text>
170
- <Text style={{ fontSize: 14, color: '#71717a' }}>12 rue des Lilas, 75011 Paris</Text>
171
- </View>
172
- <View style={{ padding: 20, flexDirection: 'row', gap: 12 }}>
173
- <View style={{ flex: 1 }}>
174
- <Button label="Refuser" variant="secondary" />
175
- </View>
176
- <View style={{ flex: 1 }}>
177
- <Button label="Accepter" />
178
- </View>
179
- </View>
180
- </View>`,
181
- },
182
- ]
183
-
184
- const S = {
185
- header: {
186
- marginBottom: 48,
187
- },
188
- badge: {
189
- display: 'inline-flex' as const,
190
- alignItems: 'center',
191
- fontSize: 12,
192
- fontWeight: 600,
193
- color: 'var(--docs-accent)',
194
- backgroundColor: 'var(--docs-accent-subtle)',
195
- padding: '3px 10px',
196
- borderRadius: 999,
197
- marginBottom: 16,
198
- letterSpacing: '0.02em',
199
- },
200
- title: {
201
- fontSize: 36,
202
- fontWeight: 700,
203
- color: 'var(--docs-text-primary)',
204
- marginBottom: 12,
205
- letterSpacing: '-0.02em',
206
- },
207
- subtitle: {
208
- fontSize: 16,
209
- color: 'var(--docs-text-secondary)',
210
- lineHeight: 1.65,
211
- maxWidth: 540,
212
- },
213
- section: {
214
- marginBottom: 40,
215
- },
216
- sectionHeading: {
217
- fontSize: 22,
218
- fontWeight: 600,
219
- color: 'var(--docs-text-primary)',
220
- marginBottom: 10,
221
- marginTop: 40,
222
- paddingTop: 24,
223
- borderTop: '1px solid var(--docs-border)',
224
- },
225
- sectionDescription: {
226
- fontSize: 15,
227
- color: 'var(--docs-text-secondary)',
228
- lineHeight: 1.65,
229
- marginBottom: 20,
230
- },
231
- exampleMeta: {
232
- fontSize: 13,
233
- color: 'var(--docs-text-muted)',
234
- marginBottom: 10,
235
- lineHeight: 1.5,
236
- },
237
- }
238
-
239
- export default function Examples() {
240
- let lastSection = ''
241
-
242
- return (
243
- <div>
244
- <div style={S.header}>
245
- <span style={S.badge}>Cas d'usage</span>
246
- <h1 style={S.title}>Exemples</h1>
247
- <p style={S.subtitle}>
248
- Les composants utilisés dans des contextes réels de l'application. Chaque exemple est
249
- éditable pour explorer les variantes et états.
250
- </p>
251
- </div>
252
-
253
- {EXAMPLES.map((ex, i) => {
254
- const showSection = ex.section !== lastSection
255
- if (showSection) lastSection = ex.section
256
- return (
257
- <div key={i}>
258
- {showSection && (
259
- <div style={S.section}>
260
- <h2 style={S.sectionHeading}>{ex.section}</h2>
261
- {ex.sectionDescription && (
262
- <p style={S.sectionDescription}>{ex.sectionDescription}</p>
263
- )}
264
- </div>
265
- )}
266
- {ex.description && <p style={S.exampleMeta}>{ex.description}</p>}
267
- <LiveEditor title={ex.title} initialCode={ex.code} scope={SCOPE} />
268
- </div>
269
- )
270
- })}
271
- </div>
272
- )
273
- }
@@ -1,70 +0,0 @@
1
- /** Documentation home page */
2
- const S = {
3
- badge: {
4
- display: 'inline-flex',
5
- alignItems: 'center',
6
- fontSize: 12,
7
- fontWeight: 600,
8
- color: 'var(--docs-accent)',
9
- backgroundColor: 'var(--docs-accent-subtle)',
10
- padding: '3px 10px',
11
- borderRadius: 999,
12
- marginBottom: 20,
13
- letterSpacing: '0.02em',
14
- },
15
- title: {
16
- fontSize: 42,
17
- fontWeight: 700,
18
- color: 'var(--docs-text-primary)',
19
- marginBottom: 16,
20
- letterSpacing: '-0.03em',
21
- lineHeight: 1.15,
22
- },
23
- subtitle: {
24
- fontSize: 17,
25
- color: 'var(--docs-text-secondary)',
26
- marginBottom: 40,
27
- lineHeight: 1.7,
28
- maxWidth: 500,
29
- },
30
- installWrap: {
31
- display: 'inline-flex',
32
- alignItems: 'center',
33
- gap: 12,
34
- backgroundColor: 'var(--docs-surface)',
35
- border: '1px solid var(--docs-border)',
36
- borderRadius: 10,
37
- padding: '12px 18px',
38
- boxShadow: 'var(--docs-shadow-sm)',
39
- },
40
- installCode: {
41
- fontFamily: 'ui-monospace, Consolas, monospace',
42
- fontSize: 14,
43
- color: 'var(--docs-text-primary)',
44
- },
45
- installLabel: {
46
- fontSize: 11,
47
- fontWeight: 600,
48
- color: 'var(--docs-text-muted)',
49
- letterSpacing: '0.06em',
50
- textTransform: 'uppercase' as const,
51
- marginBottom: 10,
52
- },
53
- }
54
-
55
- export default function Home() {
56
- return (
57
- <div>
58
- <span style={S.badge}>v0.1.0-alpha</span>
59
- <h1 style={S.title}>traquiste-mobile</h1>
60
- <p style={S.subtitle}>
61
- Bibliothèque de composants React Native pour les applications Situaction.
62
- Construite avec Expo, TypeScript strict et StyleSheet natif.
63
- </p>
64
- <p style={S.installLabel}>Installation</p>
65
- <div style={S.installWrap}>
66
- <code style={S.installCode}>npm install @situaction/traquiste-mobile</code>
67
- </div>
68
- </div>
69
- )
70
- }