@situaction/traquiste-mobile 1.0.0-next.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.
Files changed (168) hide show
  1. package/.eslintrc.js +5 -0
  2. package/.releaserc +12 -0
  3. package/CLAUDE.md +25 -0
  4. package/README.md +124 -0
  5. package/app.json +5 -0
  6. package/bitbucket-pipelines.yml +81 -0
  7. package/build/components/Button/Button.d.ts +31 -0
  8. package/build/components/Button/Button.d.ts.map +1 -0
  9. package/build/components/Button/Button.js +67 -0
  10. package/build/components/Button/Button.js.map +1 -0
  11. package/build/components/Button/Button.stories.d.ts +19 -0
  12. package/build/components/Button/Button.stories.d.ts.map +1 -0
  13. package/build/components/Button/Button.stories.js +95 -0
  14. package/build/components/Button/Button.stories.js.map +1 -0
  15. package/build/components/Button/index.d.ts +3 -0
  16. package/build/components/Button/index.d.ts.map +1 -0
  17. package/build/components/Button/index.js +2 -0
  18. package/build/components/Button/index.js.map +1 -0
  19. package/build/components/ButtonAction/ButtonAction.d.ts +21 -0
  20. package/build/components/ButtonAction/ButtonAction.d.ts.map +1 -0
  21. package/build/components/ButtonAction/ButtonAction.js +35 -0
  22. package/build/components/ButtonAction/ButtonAction.js.map +1 -0
  23. package/build/components/ButtonAction/ButtonAction.stories.d.ts +13 -0
  24. package/build/components/ButtonAction/ButtonAction.stories.d.ts.map +1 -0
  25. package/build/components/ButtonAction/ButtonAction.stories.js +51 -0
  26. package/build/components/ButtonAction/ButtonAction.stories.js.map +1 -0
  27. package/build/components/ButtonAction/index.d.ts +3 -0
  28. package/build/components/ButtonAction/index.d.ts.map +1 -0
  29. package/build/components/ButtonAction/index.js +2 -0
  30. package/build/components/ButtonAction/index.js.map +1 -0
  31. package/build/components/ButtonMap/ButtonMap.d.ts +18 -0
  32. package/build/components/ButtonMap/ButtonMap.d.ts.map +1 -0
  33. package/build/components/ButtonMap/ButtonMap.js +17 -0
  34. package/build/components/ButtonMap/ButtonMap.js.map +1 -0
  35. package/build/components/ButtonMap/ButtonMap.stories.d.ts +12 -0
  36. package/build/components/ButtonMap/ButtonMap.stories.d.ts.map +1 -0
  37. package/build/components/ButtonMap/ButtonMap.stories.js +36 -0
  38. package/build/components/ButtonMap/ButtonMap.stories.js.map +1 -0
  39. package/build/components/ButtonMap/index.d.ts +3 -0
  40. package/build/components/ButtonMap/index.d.ts.map +1 -0
  41. package/build/components/ButtonMap/index.js +2 -0
  42. package/build/components/ButtonMap/index.js.map +1 -0
  43. package/build/components/ButtonMenu/ButtonMenu.d.ts +21 -0
  44. package/build/components/ButtonMenu/ButtonMenu.d.ts.map +1 -0
  45. package/build/components/ButtonMenu/ButtonMenu.js +56 -0
  46. package/build/components/ButtonMenu/ButtonMenu.js.map +1 -0
  47. package/build/components/ButtonMenu/ButtonMenu.stories.d.ts +15 -0
  48. package/build/components/ButtonMenu/ButtonMenu.stories.d.ts.map +1 -0
  49. package/build/components/ButtonMenu/ButtonMenu.stories.js +52 -0
  50. package/build/components/ButtonMenu/ButtonMenu.stories.js.map +1 -0
  51. package/build/components/ButtonMenu/index.d.ts +3 -0
  52. package/build/components/ButtonMenu/index.d.ts.map +1 -0
  53. package/build/components/ButtonMenu/index.js +2 -0
  54. package/build/components/ButtonMenu/index.js.map +1 -0
  55. package/build/components/FilterChip/FilterChip.d.ts +28 -0
  56. package/build/components/FilterChip/FilterChip.d.ts.map +1 -0
  57. package/build/components/FilterChip/FilterChip.js +66 -0
  58. package/build/components/FilterChip/FilterChip.js.map +1 -0
  59. package/build/components/FilterChip/FilterChip.stories.d.ts +15 -0
  60. package/build/components/FilterChip/FilterChip.stories.d.ts.map +1 -0
  61. package/build/components/FilterChip/FilterChip.stories.js +55 -0
  62. package/build/components/FilterChip/FilterChip.stories.js.map +1 -0
  63. package/build/components/FilterChip/index.d.ts +3 -0
  64. package/build/components/FilterChip/index.d.ts.map +1 -0
  65. package/build/components/FilterChip/index.js +2 -0
  66. package/build/components/FilterChip/index.js.map +1 -0
  67. package/build/constants/colors.d.ts +2 -0
  68. package/build/constants/colors.d.ts.map +1 -0
  69. package/build/constants/colors.js +3 -0
  70. package/build/constants/colors.js.map +1 -0
  71. package/build/context/ThemeContext.d.ts +30 -0
  72. package/build/context/ThemeContext.d.ts.map +1 -0
  73. package/build/context/ThemeContext.js +34 -0
  74. package/build/context/ThemeContext.js.map +1 -0
  75. package/build/index.d.ts +7 -0
  76. package/build/index.d.ts.map +1 -0
  77. package/build/index.js +8 -0
  78. package/build/index.js.map +1 -0
  79. package/build/theme/index.d.ts +5 -0
  80. package/build/theme/index.d.ts.map +1 -0
  81. package/build/theme/index.js +6 -0
  82. package/build/theme/index.js.map +1 -0
  83. package/build/theme/tokens/dark.d.ts +8 -0
  84. package/build/theme/tokens/dark.d.ts.map +1 -0
  85. package/build/theme/tokens/dark.js +146 -0
  86. package/build/theme/tokens/dark.js.map +1 -0
  87. package/build/theme/tokens/light.d.ts +8 -0
  88. package/build/theme/tokens/light.d.ts.map +1 -0
  89. package/build/theme/tokens/light.js +152 -0
  90. package/build/theme/tokens/light.js.map +1 -0
  91. package/build/theme/type.d.ts +75 -0
  92. package/build/theme/type.d.ts.map +1 -0
  93. package/build/theme/type.js +7 -0
  94. package/build/theme/type.js.map +1 -0
  95. package/docs/README.md +73 -0
  96. package/docs/eslint.config.js +22 -0
  97. package/docs/index.html +16 -0
  98. package/docs/package-lock.json +5578 -0
  99. package/docs/package.json +37 -0
  100. package/docs/public/favicon.svg +1 -0
  101. package/docs/public/icons.svg +24 -0
  102. package/docs/src/App.css +184 -0
  103. package/docs/src/App.tsx +38 -0
  104. package/docs/src/assets/hero.png +0 -0
  105. package/docs/src/assets/react.svg +1 -0
  106. package/docs/src/assets/vite.svg +1 -0
  107. package/docs/src/components/Layout.tsx +108 -0
  108. package/docs/src/components/LiveEditor.tsx +294 -0
  109. package/docs/src/components/PropsTable.tsx +101 -0
  110. package/docs/src/components/Sidebar.tsx +103 -0
  111. package/docs/src/components/TableOfContents.tsx +75 -0
  112. package/docs/src/context/ColorModeContext.tsx +34 -0
  113. package/docs/src/index.css +76 -0
  114. package/docs/src/lib/createComponentPage.tsx +270 -0
  115. package/docs/src/main.tsx +13 -0
  116. package/docs/src/pages/Examples.tsx +273 -0
  117. package/docs/src/pages/Home.tsx +70 -0
  118. package/docs/src/pages/components/button-action.ts +88 -0
  119. package/docs/src/pages/components/button-map.ts +67 -0
  120. package/docs/src/pages/components/button-menu.ts +90 -0
  121. package/docs/src/pages/components/button.ts +158 -0
  122. package/docs/src/pages/components/filter-chip.ts +109 -0
  123. package/docs/tsconfig.app.json +32 -0
  124. package/docs/tsconfig.json +7 -0
  125. package/docs/tsconfig.node.json +24 -0
  126. package/docs/vite.config.ts +18 -0
  127. package/ios/.xcode.env +11 -0
  128. package/ios/Podfile +63 -0
  129. package/ios/Podfile.properties.json +4 -0
  130. package/ios/situactiontraquistemobile/AppDelegate.swift +69 -0
  131. package/ios/situactiontraquistemobile/Images.xcassets/AppIcon.appiconset/Contents.json +13 -0
  132. package/ios/situactiontraquistemobile/Images.xcassets/Contents.json +6 -0
  133. package/ios/situactiontraquistemobile/Images.xcassets/SplashScreenLegacy.imageset/Contents.json +21 -0
  134. package/ios/situactiontraquistemobile/Images.xcassets/SplashScreenLegacy.imageset/SplashScreenLegacy.png +0 -0
  135. package/ios/situactiontraquistemobile/Info.plist +53 -0
  136. package/ios/situactiontraquistemobile/SplashScreen.storyboard +47 -0
  137. package/ios/situactiontraquistemobile/Supporting/Expo.plist +6 -0
  138. package/ios/situactiontraquistemobile/situactiontraquistemobile-Bridging-Header.h +3 -0
  139. package/ios/situactiontraquistemobile.xcodeproj/project.pbxproj +432 -0
  140. package/ios/situactiontraquistemobile.xcodeproj/xcshareddata/xcschemes/situactiontraquistemobile.xcscheme +88 -0
  141. package/jest.config.js +197 -0
  142. package/package.json +90 -0
  143. package/src/components/.gitkeep +0 -0
  144. package/src/components/Button/Button.stories.tsx +123 -0
  145. package/src/components/Button/Button.tsx +128 -0
  146. package/src/components/Button/index.ts +2 -0
  147. package/src/components/ButtonAction/ButtonAction.stories.tsx +67 -0
  148. package/src/components/ButtonAction/ButtonAction.tsx +67 -0
  149. package/src/components/ButtonAction/index.ts +2 -0
  150. package/src/components/ButtonMap/ButtonMap.stories.tsx +49 -0
  151. package/src/components/ButtonMap/ButtonMap.tsx +40 -0
  152. package/src/components/ButtonMap/index.ts +2 -0
  153. package/src/components/ButtonMenu/ButtonMenu.stories.tsx +68 -0
  154. package/src/components/ButtonMenu/ButtonMenu.tsx +97 -0
  155. package/src/components/ButtonMenu/index.ts +2 -0
  156. package/src/components/FilterChip/FilterChip.stories.tsx +71 -0
  157. package/src/components/FilterChip/FilterChip.tsx +124 -0
  158. package/src/components/FilterChip/index.ts +2 -0
  159. package/src/constants/colors.ts +2 -0
  160. package/src/context/ThemeContext.tsx +84 -0
  161. package/src/index.ts +23 -0
  162. package/src/theme/index.ts +20 -0
  163. package/src/theme/tokens/dark.ts +160 -0
  164. package/src/theme/tokens/light.ts +166 -0
  165. package/src/theme/type.ts +122 -0
  166. package/src/types/.gitkeep +0 -0
  167. package/src/utils/.gitkeep +0 -0
  168. package/tsconfig.json +9 -0
@@ -0,0 +1,88 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "1130"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
18
+ BuildableName = "situactiontraquistemobile.app"
19
+ BlueprintName = "situactiontraquistemobile"
20
+ ReferencedContainer = "container:situactiontraquistemobile.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ buildConfiguration = "Debug"
27
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+ shouldUseLaunchSchemeArgsEnv = "YES">
30
+ <Testables>
31
+ <TestableReference
32
+ skipped = "NO">
33
+ <BuildableReference
34
+ BuildableIdentifier = "primary"
35
+ BlueprintIdentifier = "00E356ED1AD99517003FC87E"
36
+ BuildableName = "situactiontraquistemobileTests.xctest"
37
+ BlueprintName = "situactiontraquistemobileTests"
38
+ ReferencedContainer = "container:situactiontraquistemobile.xcodeproj">
39
+ </BuildableReference>
40
+ </TestableReference>
41
+ </Testables>
42
+ </TestAction>
43
+ <LaunchAction
44
+ buildConfiguration = "Debug"
45
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47
+ launchStyle = "0"
48
+ useCustomWorkingDirectory = "NO"
49
+ ignoresPersistentStateOnLaunch = "NO"
50
+ debugDocumentVersioning = "YES"
51
+ debugServiceExtension = "internal"
52
+ allowLocationSimulation = "YES">
53
+ <BuildableProductRunnable
54
+ runnableDebuggingMode = "0">
55
+ <BuildableReference
56
+ BuildableIdentifier = "primary"
57
+ BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
58
+ BuildableName = "situactiontraquistemobile.app"
59
+ BlueprintName = "situactiontraquistemobile"
60
+ ReferencedContainer = "container:situactiontraquistemobile.xcodeproj">
61
+ </BuildableReference>
62
+ </BuildableProductRunnable>
63
+ </LaunchAction>
64
+ <ProfileAction
65
+ buildConfiguration = "Release"
66
+ shouldUseLaunchSchemeArgsEnv = "YES"
67
+ savedToolIdentifier = ""
68
+ useCustomWorkingDirectory = "NO"
69
+ debugDocumentVersioning = "YES">
70
+ <BuildableProductRunnable
71
+ runnableDebuggingMode = "0">
72
+ <BuildableReference
73
+ BuildableIdentifier = "primary"
74
+ BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
75
+ BuildableName = "situactiontraquistemobile.app"
76
+ BlueprintName = "situactiontraquistemobile"
77
+ ReferencedContainer = "container:situactiontraquistemobile.xcodeproj">
78
+ </BuildableReference>
79
+ </BuildableProductRunnable>
80
+ </ProfileAction>
81
+ <AnalyzeAction
82
+ buildConfiguration = "Debug">
83
+ </AnalyzeAction>
84
+ <ArchiveAction
85
+ buildConfiguration = "Release"
86
+ revealArchiveInOrganizer = "YES">
87
+ </ArchiveAction>
88
+ </Scheme>
package/jest.config.js ADDED
@@ -0,0 +1,197 @@
1
+ /**
2
+ * For a detailed explanation regarding each configuration property, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+
6
+ /** @type {import('jest').Config} */
7
+ const config = {
8
+ // All imported modules in your tests should be mocked automatically
9
+ // automock: false,
10
+
11
+ // Stop running tests after `n` failures
12
+ // bail: 0,
13
+
14
+ // The directory where Jest should store its cached dependency information
15
+ // cacheDirectory: "/private/var/folders/2h/q6p2v9t50l7b_vtjw41zzqbr0000gn/T/jest_dx",
16
+
17
+ // Automatically clear mock calls, instances, contexts and results before every test
18
+ clearMocks: true,
19
+
20
+ // Indicates whether the coverage information should be collected while executing the test
21
+ // collectCoverage: false,
22
+
23
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
24
+ // collectCoverageFrom: undefined,
25
+
26
+ // The directory where Jest should output its coverage files
27
+ // coverageDirectory: undefined,
28
+
29
+ // An array of regexp pattern strings used to skip coverage collection
30
+ // coveragePathIgnorePatterns: [
31
+ // "/node_modules/"
32
+ // ],
33
+
34
+ // Indicates which provider should be used to instrument code for coverage
35
+ coverageProvider: "v8",
36
+
37
+ // A list of reporter names that Jest uses when writing coverage reports
38
+ // coverageReporters: [
39
+ // "json",
40
+ // "text",
41
+ // "lcov",
42
+ // "clover"
43
+ // ],
44
+
45
+ // An object that configures minimum threshold enforcement for coverage results
46
+ // coverageThreshold: undefined,
47
+
48
+ // A path to a custom dependency extractor
49
+ // dependencyExtractor: undefined,
50
+
51
+ // Make calling deprecated APIs throw helpful error messages
52
+ // errorOnDeprecated: false,
53
+
54
+ // The default configuration for fake timers
55
+ // fakeTimers: {
56
+ // "enableGlobally": false
57
+ // },
58
+
59
+ // Force coverage collection from ignored files using an array of glob patterns
60
+ // forceCoverageMatch: [],
61
+
62
+ // A path to a module which exports an async function that is triggered once before all test suites
63
+ // globalSetup: undefined,
64
+
65
+ // A path to a module which exports an async function that is triggered once after all test suites
66
+ // globalTeardown: undefined,
67
+
68
+ // A set of global variables that need to be available in all test environments
69
+ // globals: {},
70
+
71
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
72
+ // maxWorkers: "50%",
73
+
74
+ // An array of directory names to be searched recursively up from the requiring module's location
75
+ // moduleDirectories: [
76
+ // "node_modules"
77
+ // ],
78
+
79
+ // An array of file extensions your modules use
80
+ // moduleFileExtensions: [
81
+ // "js",
82
+ // "mjs",
83
+ // "cjs",
84
+ // "jsx",
85
+ // "ts",
86
+ // "tsx",
87
+ // "json",
88
+ // "node"
89
+ // ],
90
+
91
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
92
+ // moduleNameMapper: {},
93
+
94
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
95
+ // modulePathIgnorePatterns: [],
96
+
97
+ // Activates notifications for test results
98
+ // notify: false,
99
+
100
+ // An enum that specifies notification mode. Requires { notify: true }
101
+ // notifyMode: "failure-change",
102
+
103
+ // A preset that is used as a base for Jest's configuration
104
+ preset: 'jest-expo/ios',
105
+
106
+ // Run tests from one or more projects
107
+ // projects: undefined,
108
+
109
+ // Use this configuration option to add custom reporters to Jest
110
+ // reporters: undefined,
111
+
112
+ // Automatically reset mock state before every test
113
+ // resetMocks: false,
114
+
115
+ // Reset the module registry before running each individual test
116
+ // resetModules: false,
117
+
118
+ // A path to a custom resolver
119
+ // resolver: undefined,
120
+
121
+ // Automatically restore mock state and implementation before every test
122
+ // restoreMocks: false,
123
+
124
+ // The root directory that Jest should scan for tests and modules within
125
+ // rootDir: undefined,
126
+
127
+ // A list of paths to directories that Jest should use to search for files in
128
+ roots: [
129
+ '<rootDir>/src',
130
+ ],
131
+
132
+ // Allows you to use a custom runner instead of Jest's default test runner
133
+ // runner: "jest-runner",
134
+
135
+ // The paths to modules that run some code to configure or set up the testing environment before each test
136
+ // setupFiles: [],
137
+
138
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
139
+ setupFilesAfterEnv: ['@testing-library/react-native/matchers'],
140
+
141
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
142
+ // slowTestThreshold: 5,
143
+
144
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
145
+ // snapshotSerializers: [],
146
+
147
+ // The test environment that will be used for testing
148
+ // testEnvironment: "jest-environment-node",
149
+
150
+ // Options that will be passed to the testEnvironment
151
+ // testEnvironmentOptions: {},
152
+
153
+ // Adds a location field to test results
154
+ // testLocationInResults: false,
155
+
156
+ // The glob patterns Jest uses to detect test files
157
+ // testMatch: [
158
+ // "**/__tests__/**/*.[jt]s?(x)",
159
+ // "**/?(*.)+(spec|test).[tj]s?(x)"
160
+ // ],
161
+
162
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
163
+ // testPathIgnorePatterns: [
164
+ // "/node_modules/"
165
+ // ],
166
+
167
+ // The regexp pattern or array of patterns that Jest uses to detect test files
168
+ // testRegex: [],
169
+
170
+ // This option allows the use of a custom results processor
171
+ // testResultsProcessor: undefined,
172
+
173
+ // This option allows use of a custom test runner
174
+ // testRunner: "jest-circus/runner",
175
+
176
+ // A map from regular expressions to paths to transformers
177
+ // transform: undefined,
178
+
179
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
180
+ transformIgnorePatterns: [
181
+ 'node_modules/(?!((jest-)?react-native|@react-native(-community)?|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg))',
182
+ ],
183
+
184
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
185
+ // unmockedModulePathPatterns: undefined,
186
+
187
+ // Indicates whether each individual test should be reported during the run
188
+ // verbose: undefined,
189
+
190
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
191
+ // watchPathIgnorePatterns: [],
192
+
193
+ // Whether to use watchman for file crawling
194
+ // watchman: true,
195
+ };
196
+
197
+ module.exports = config;
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@situaction/traquiste-mobile",
3
+ "version": "1.0.0-next.2",
4
+ "description": "React Native UI component library for Traquiste",
5
+ "main": "build/index.js",
6
+ "types": "build/index.d.ts",
7
+ "scripts": {
8
+ "build": "expo-module build",
9
+ "clean": "expo-module clean",
10
+ "lint": "expo-module lint",
11
+ "test": "expo-module test",
12
+ "prepare": "expo-module build",
13
+ "prepublishOnly": "expo-module prepublishOnly",
14
+ "expo-module": "expo-module",
15
+ "storybook": "npm run start --prefix example"
16
+ },
17
+ "keywords": [
18
+ "react-native",
19
+ "expo",
20
+ "ui",
21
+ "components",
22
+ "traquiste"
23
+ ],
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://bitbucket.org/winoc/traq-ui-ste-mobile"
27
+ },
28
+ "bugs": {
29
+ "url": "https://bitbucket.org/winoc/traq-ui-ste-mobile/issues"
30
+ },
31
+ "author": "Situaction <dev@situaction.fr>",
32
+ "license": "MIT",
33
+ "homepage": "https://bitbucket.org/winoc/traq-ui-ste-mobile#readme",
34
+ "devDependencies": {
35
+ "@babel/core": "^7.29.0",
36
+ "@react-native-async-storage/async-storage": "^3.0.3",
37
+ "@semantic-release/commit-analyzer": "^13.0.1",
38
+ "@semantic-release/git": "^10.0.1",
39
+ "@semantic-release/npm": "^13.1.5",
40
+ "@semantic-release/release-notes-generator": "^14.1.1",
41
+ "@storybook/addon-ondevice-actions": "^10.4.4",
42
+ "@storybook/addon-ondevice-controls": "^10.4.4",
43
+ "@storybook/react-native": "^10.4.4",
44
+ "@storybook/react-native-ui-lite": "^10.4.4",
45
+ "@testing-library/react-native": "^13.3.3",
46
+ "@types/react": "~19.1.1",
47
+ "expo": "^55.0.25",
48
+ "expo-module-scripts": "^55.0.2",
49
+ "phosphor-react-native": "^3.0.6",
50
+ "react-native": "0.83.6",
51
+ "semantic-release": "^25.0.3",
52
+ "storybook": "^10.4.0"
53
+ },
54
+ "peerDependencies": {
55
+ "expo": ">=50.0.0",
56
+ "react": ">=18.0.0",
57
+ "react-native": ">=0.74.0"
58
+ },
59
+ "release": {
60
+ "branches": [
61
+ "master",
62
+ {
63
+ "name": "develop",
64
+ "prerelease": "next"
65
+ }
66
+ ],
67
+ "plugins": [
68
+ "@semantic-release/commit-analyzer",
69
+ "@semantic-release/release-notes-generator",
70
+ "@semantic-release/npm",
71
+ [
72
+ "@semantic-release/git",
73
+ {
74
+ "assets": [
75
+ "package.json"
76
+ ],
77
+ "message": "chore(release): ${nextRelease.version} [skip ci]"
78
+ }
79
+ ]
80
+ ]
81
+ },
82
+ "publishConfig": {
83
+ "access": "public"
84
+ },
85
+ "dependencies": {
86
+ "expo": ">=50.0.0",
87
+ "react": ">=18.0.0",
88
+ "react-native": ">=0.74.0"
89
+ }
90
+ }
File without changes
@@ -0,0 +1,123 @@
1
+ /** Storybook stories for the Button component */
2
+ import React from 'react';
3
+ import type { Meta, StoryObj } from '@storybook/react-native';
4
+ import { View } from 'react-native';
5
+ import { ArrowRight, Check, Trash, Plus, X, MagnifyingGlass } from 'phosphor-react-native';
6
+ import { Button, type ButtonProps } from './Button';
7
+
8
+ type StoryArgs = ButtonProps & { colorScheme: 'light' | 'dark' };
9
+
10
+ const meta: Meta<StoryArgs> = {
11
+ title: 'Components/Button',
12
+ component: Button,
13
+ render: ({ colorScheme: _colorScheme, ...args }) => <Button {...args} />,
14
+ argTypes: {
15
+ colorScheme: {
16
+ control: { type: 'radio' },
17
+ options: ['light', 'dark'],
18
+ },
19
+ variant: {
20
+ control: { type: 'radio' },
21
+ options: ['primary', 'tertiary', 'ghost', 'destructive'],
22
+ },
23
+ size: {
24
+ control: { type: 'radio' },
25
+ options: ['S', 'M', 'L', 'XL'],
26
+ },
27
+ content: {
28
+ control: { type: 'radio' },
29
+ options: ['icon-only', 'icon-only-rounded', 'icon-both'],
30
+ },
31
+ disabled: { control: { type: 'boolean' } },
32
+ },
33
+ args: {
34
+ colorScheme: 'light',
35
+ label: 'Button',
36
+ variant: 'primary',
37
+ size: 'M',
38
+ content: 'icon-both',
39
+ disabled: false,
40
+ },
41
+ };
42
+
43
+ export default meta;
44
+
45
+ type Story = StoryObj<StoryArgs>;
46
+
47
+ export const Primary: Story = {
48
+ args: { variant: 'primary', label: 'Primary' },
49
+ };
50
+
51
+ export const Tertiary: Story = {
52
+ args: { variant: 'tertiary', label: 'Tertiary' },
53
+ };
54
+
55
+ export const Ghost: Story = {
56
+ args: { variant: 'ghost', label: 'Ghost' },
57
+ };
58
+
59
+ export const Destructive: Story = {
60
+ args: { variant: 'destructive', label: 'Destructive' },
61
+ };
62
+
63
+ export const WithIconLeft: Story = {
64
+ render: () => (
65
+ <View style={{ gap: 12, padding: 16, alignItems: 'flex-start' }}>
66
+ <Button variant="primary" label="Rechercher" iconLeft={<MagnifyingGlass />} />
67
+ <Button variant="tertiary" label="Ajouter" iconLeft={<Plus />} />
68
+ <Button variant="ghost" label="Confirmer" iconLeft={<Check />} />
69
+ <Button variant="destructive" label="Supprimer" iconLeft={<Trash />} />
70
+ </View>
71
+ ),
72
+ };
73
+
74
+ export const WithIconRight: Story = {
75
+ render: () => (
76
+ <View style={{ gap: 12, padding: 16, alignItems: 'flex-start' }}>
77
+ <Button variant="primary" label="Suivant" iconRight={<ArrowRight />} />
78
+ <Button variant="tertiary" label="Fermer" iconRight={<X />} />
79
+ </View>
80
+ ),
81
+ };
82
+
83
+ export const WithIconBoth: Story = {
84
+ render: () => (
85
+ <View style={{ gap: 12, padding: 16, alignItems: 'flex-start' }}>
86
+ <Button variant="primary" label="Rechercher" iconLeft={<MagnifyingGlass />} iconRight={<ArrowRight />} />
87
+ <Button variant="tertiary" label="Supprimer" iconLeft={<Trash />} iconRight={<X />} />
88
+ </View>
89
+ ),
90
+ };
91
+
92
+ export const IconOnly: Story = {
93
+ render: () => (
94
+ <View style={{ flexDirection: 'row', gap: 12, padding: 16 }}>
95
+ <Button variant="primary" content="icon-only" iconLeft={<Plus />} />
96
+ <Button variant="tertiary" content="icon-only" iconLeft={<MagnifyingGlass />} />
97
+ <Button variant="ghost" content="icon-only" iconLeft={<X />} />
98
+ <Button variant="destructive" content="icon-only-rounded" iconLeft={<Trash />} />
99
+ </View>
100
+ ),
101
+ };
102
+
103
+ export const AllSizes: Story = {
104
+ render: () => (
105
+ <View style={{ gap: 12, padding: 16, alignItems: 'flex-start' }}>
106
+ <Button variant="primary" size="S" label="Small" iconLeft={<Check />} />
107
+ <Button variant="primary" size="M" label="Medium" iconLeft={<Check />} />
108
+ <Button variant="primary" size="L" label="Large" iconLeft={<Check />} />
109
+ <Button variant="primary" size="XL" label="XLarge" iconLeft={<Check />} />
110
+ </View>
111
+ ),
112
+ };
113
+
114
+ export const Disabled: Story = {
115
+ render: () => (
116
+ <View style={{ gap: 12, padding: 16, alignItems: 'flex-start' }}>
117
+ <Button variant="primary" disabled label="Primary" iconLeft={<Check />} />
118
+ <Button variant="tertiary" disabled label="Tertiary" iconLeft={<Check />} />
119
+ <Button variant="ghost" disabled label="Ghost" iconLeft={<Check />} />
120
+ <Button variant="destructive" disabled label="Destructive" iconLeft={<Trash />} />
121
+ </View>
122
+ ),
123
+ };
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Button component for Traq[UI]ste Mobile.
3
+ * Supports four variants, four sizes and three content layouts.
4
+ */
5
+ import React, { useState } from 'react';
6
+ import { Pressable, Text } from 'react-native';
7
+ import type { StyleProp, ViewStyle } from 'react-native';
8
+ import { useTheme } from '../../context/ThemeContext';
9
+
10
+ export type ButtonVariant = 'primary' | 'tertiary' | 'ghost' | 'destructive';
11
+ export type ButtonSize = 'S' | 'M' | 'L' | 'XL';
12
+ export type ButtonContent = 'icon-only' | 'icon-only-rounded' | 'icon-both';
13
+
14
+ export interface ButtonProps {
15
+ /** Button visual variant */
16
+ variant?: ButtonVariant;
17
+ /** Button size */
18
+ size?: ButtonSize;
19
+ /** Content layout */
20
+ content?: ButtonContent;
21
+ /** Label text — required when content is 'icon-both' */
22
+ label?: string;
23
+ /** Left icon component (Phosphor icon) */
24
+ iconLeft?: React.ReactElement;
25
+ /** Right icon component (Phosphor icon) */
26
+ iconRight?: React.ReactElement;
27
+ /** Disabled state */
28
+ disabled?: boolean;
29
+ /** Press handler */
30
+ onPress?: () => void;
31
+ /** Additional container styles */
32
+ style?: StyleProp<ViewStyle>;
33
+ }
34
+
35
+ // --- Size tokens (static, theme-independent) ---
36
+
37
+ const SIZE_TOKENS = {
38
+ S: { height: 36, paddingVertical: 10, paddingHorizontal: 10, gap: 8, borderRadius: 8, iconSize: 16, fontSize: 12, lineHeight: 16 },
39
+ M: { height: 40, paddingVertical: 10, paddingHorizontal: 16, gap: 4, borderRadius: 8, iconSize: 18, fontSize: 14, lineHeight: 20 },
40
+ L: { height: 48, paddingVertical: 12, paddingHorizontal: 12, gap: 10, borderRadius: 8, iconSize: 20, fontSize: 16, lineHeight: 24 },
41
+ XL: { height: 60, paddingVertical: 16, paddingHorizontal: 32, gap: 12, borderRadius: 8, iconSize: 24, fontSize: 18, lineHeight: 26 },
42
+ } as const;
43
+
44
+ // --- Component ---
45
+
46
+ export function Button({
47
+ variant = 'primary',
48
+ size = 'M',
49
+ content = 'icon-both',
50
+ label,
51
+ iconLeft,
52
+ iconRight,
53
+ disabled = false,
54
+ onPress,
55
+ style,
56
+ }: ButtonProps) {
57
+ const [pressed, setPressed] = useState(false);
58
+ const { colors } = useTheme();
59
+
60
+ const sizeTokens = SIZE_TOKENS[size];
61
+ const state = disabled ? 'disabled' : pressed ? 'pressed' : 'default';
62
+ const colorTokens = colors.button[variant][state];
63
+
64
+ const isIconOnly = content === 'icon-only' || content === 'icon-only-rounded';
65
+ const borderRadius = content === 'icon-only-rounded' ? 9999 : sizeTokens.borderRadius;
66
+ const hasBorder = colorTokens.border !== 'transparent';
67
+
68
+ const containerStyle: ViewStyle = {
69
+ height: sizeTokens.height,
70
+ paddingVertical: isIconOnly ? undefined : sizeTokens.paddingVertical,
71
+ paddingHorizontal: isIconOnly ? undefined : sizeTokens.paddingHorizontal,
72
+ width: isIconOnly ? sizeTokens.height : undefined,
73
+ borderRadius,
74
+ gap: sizeTokens.gap,
75
+ backgroundColor: colorTokens.background,
76
+ borderWidth: hasBorder ? 1 : undefined,
77
+ borderColor: hasBorder ? colorTokens.border : undefined,
78
+ alignItems: 'center',
79
+ justifyContent: 'center',
80
+ flexDirection: 'row',
81
+ };
82
+
83
+ const textStyle = {
84
+ color: colorTokens.text,
85
+ fontSize: sizeTokens.fontSize,
86
+ lineHeight: sizeTokens.lineHeight,
87
+ fontFamily: 'Urbanist',
88
+ fontWeight: '500' as const,
89
+ };
90
+
91
+ // Clone icon elements to inject size and color from active theme state
92
+ const cloneIcon = (icon: React.ReactElement | undefined) => {
93
+ if (!icon) return null;
94
+ return React.cloneElement(icon, {
95
+ size: sizeTokens.iconSize,
96
+ color: colorTokens.icon,
97
+ ...(icon.props as Record<string, unknown>),
98
+ } as object);
99
+ };
100
+
101
+ if (isIconOnly) {
102
+ return (
103
+ <Pressable
104
+ pointerEvents={disabled ? 'none' : 'auto'}
105
+ onPressIn={() => setPressed(true)}
106
+ onPressOut={() => setPressed(false)}
107
+ onPress={disabled ? undefined : onPress}
108
+ style={[containerStyle, style]}
109
+ >
110
+ {cloneIcon(iconLeft)}
111
+ </Pressable>
112
+ );
113
+ }
114
+
115
+ return (
116
+ <Pressable
117
+ pointerEvents={disabled ? 'none' : 'auto'}
118
+ onPressIn={() => setPressed(true)}
119
+ onPressOut={() => setPressed(false)}
120
+ onPress={disabled ? undefined : onPress}
121
+ style={[containerStyle, style]}
122
+ >
123
+ {cloneIcon(iconLeft)}
124
+ {label != null && <Text style={textStyle}>{label}</Text>}
125
+ {cloneIcon(iconRight)}
126
+ </Pressable>
127
+ );
128
+ }
@@ -0,0 +1,2 @@
1
+ export { Button } from './Button';
2
+ export type { ButtonProps, ButtonVariant, ButtonSize, ButtonContent } from './Button';