react-french-ssn 1.3.0

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,520 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useState, useCallback, useEffect } from 'react';
3
+
4
+ function styleInject(css, ref) {
5
+ if ( ref === void 0 ) ref = {};
6
+ var insertAt = ref.insertAt;
7
+
8
+ if (!css || typeof document === 'undefined') { return; }
9
+
10
+ var head = document.head || document.getElementsByTagName('head')[0];
11
+ var style = document.createElement('style');
12
+ style.type = 'text/css';
13
+
14
+ if (insertAt === 'top') {
15
+ if (head.firstChild) {
16
+ head.insertBefore(style, head.firstChild);
17
+ } else {
18
+ head.appendChild(style);
19
+ }
20
+ } else {
21
+ head.appendChild(style);
22
+ }
23
+
24
+ if (style.styleSheet) {
25
+ style.styleSheet.cssText = css;
26
+ } else {
27
+ style.appendChild(document.createTextNode(css));
28
+ }
29
+ }
30
+
31
+ var css_248z$1 = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto:wght@400;500;700&family=Poppins:wght@400;500;600;700&family=Open+Sans:wght@400;500;700&family=Montserrat:wght@400;500;600;700&family=Lato:wght@400;500;700&family=Nunito:wght@400;500;600;700&family=Source+Sans+Pro:wght@400;500;700&display=swap\");:root{--ui-color-primary:#3b82f6;--ui-color-primary-dark:#2563eb;--ui-color-secondary:#64748b;--ui-color-background:#fff;--ui-color-surface:#f8fafc;--ui-color-text-primary:#1e293b;--ui-color-text-secondary:#64748b;--ui-color-text-disabled:#94a3b8;--ui-color-border-default:#e2e8f0;--ui-color-border-focus:#3b82f6;--ui-color-error:#ef4444;--ui-color-success:#10b981;--ui-color-warning:#f59e0b;--ui-color-gray-300:#d1d5db;--ui-spacing-xs:0.25rem;--ui-spacing-sm:0.5rem;--ui-spacing-md:1rem;--ui-spacing-lg:1.5rem;--ui-spacing-xl:2rem;--ui-font-family:\"Inter\",-apple-system,BlinkMacSystemFont,\"Segoe UI\",\"Roboto\",\"Oxygen\",\"Ubuntu\",\"Cantarell\",\"Fira Sans\",\"Droid Sans\",\"Helvetica Neue\",sans-serif;--ui-font-size-xs:0.75rem;--ui-font-size-sm:0.875rem;--ui-font-size-md:1rem;--ui-font-size-lg:1.125rem;--ui-font-size-xl:1.25rem;--ui-font-weight-normal:400;--ui-font-weight-medium:500;--ui-font-weight-semibold:600;--ui-font-weight-bold:700;--ui-border-radius-sm:0.25rem;--ui-border-radius-md:0.375rem;--ui-border-radius-lg:0.5rem;--ui-border-radius-xl:0.75rem;--ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--ui-shadow-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)}@media (prefers-color-scheme:dark){:root{--ui-color-background:#0f172a;--ui-color-surface:#1e293b;--ui-color-text-primary:#f1f5f9;--ui-color-text-secondary:#cbd5e1;--ui-color-text-disabled:#64748b;--ui-color-border-default:#334155;--ui-color-border-focus:#3b82f6}}";
32
+ styleInject(css_248z$1);
33
+
34
+ const useSocialSecurityInput = ({ onChange, placeholder = '269054958815780', value }) => {
35
+ const [state, setState] = useState({
36
+ sex: '',
37
+ year: '',
38
+ month: '',
39
+ department: '',
40
+ insee: '',
41
+ order: '',
42
+ controlKey: '',
43
+ error: '',
44
+ });
45
+ const calculateControlKey = (nir) => {
46
+ if (nir.length !== 13)
47
+ return '';
48
+ let nirForCalculation = nir;
49
+ if (nirForCalculation.includes('2A')) {
50
+ nirForCalculation = nirForCalculation.replace('2A', '19');
51
+ }
52
+ if (nirForCalculation.includes('2B')) {
53
+ nirForCalculation = nirForCalculation.replace('2B', '20');
54
+ }
55
+ let remainder = 0;
56
+ for (let i = 0; i < nirForCalculation.length; i++) {
57
+ remainder = (remainder * 10 + parseInt(nirForCalculation[i], 10)) % 97;
58
+ }
59
+ const controlKey = 97 - remainder;
60
+ return controlKey.toString().padStart(2, '0');
61
+ };
62
+ const updateControlKey = useCallback(() => {
63
+ const nir = state.sex + state.year + state.month + state.department + state.insee + state.order;
64
+ const key = calculateControlKey(nir);
65
+ setState(prev => ({ ...prev, controlKey: key }));
66
+ if (nir.length === 13 && key) {
67
+ const fullNir = nir + key;
68
+ onChange?.(fullNir);
69
+ }
70
+ }, [state.sex, state.year, state.month, state.department, state.insee, state.order, onChange]);
71
+ useEffect(() => {
72
+ updateControlKey();
73
+ }, [state.sex, state.year, state.month, state.department, state.insee, state.order, updateControlKey]);
74
+ const updateField = (field, value) => {
75
+ setState(prev => ({ ...prev, [field]: value, error: '' }));
76
+ };
77
+ const parsePlaceholder = (placeholder) => {
78
+ const cleaned = placeholder.replace(/\D/g, '');
79
+ if (cleaned.length >= 15) {
80
+ return {
81
+ sex: cleaned.substring(0, 1),
82
+ year: cleaned.substring(1, 3),
83
+ month: cleaned.substring(3, 5),
84
+ department: cleaned.substring(5, 7),
85
+ insee: cleaned.substring(7, 10),
86
+ order: cleaned.substring(10, 13),
87
+ controlKey: cleaned.substring(13, 15),
88
+ };
89
+ }
90
+ return {
91
+ sex: '2',
92
+ year: '69',
93
+ month: '05',
94
+ department: '49',
95
+ insee: '588',
96
+ order: '157',
97
+ controlKey: '80',
98
+ };
99
+ };
100
+ const placeholders = parsePlaceholder(placeholder);
101
+ const parseValue = (value) => {
102
+ const cleaned = value.replace(/\D/g, '');
103
+ if (cleaned.length === 15) {
104
+ return {
105
+ sex: cleaned.substring(0, 1),
106
+ year: cleaned.substring(1, 3),
107
+ month: cleaned.substring(3, 5),
108
+ department: cleaned.substring(5, 7),
109
+ insee: cleaned.substring(7, 10),
110
+ order: cleaned.substring(10, 13),
111
+ controlKey: cleaned.substring(13, 15),
112
+ };
113
+ }
114
+ return null;
115
+ };
116
+ useEffect(() => {
117
+ if (value) {
118
+ const parsed = parseValue(value);
119
+ if (parsed) {
120
+ setState(prev => ({ ...prev, ...parsed, error: '' }));
121
+ }
122
+ }
123
+ else {
124
+ setState(prev => ({
125
+ ...prev,
126
+ sex: '',
127
+ year: '',
128
+ month: '',
129
+ department: '',
130
+ insee: '',
131
+ order: '',
132
+ controlKey: '',
133
+ error: '',
134
+ }));
135
+ }
136
+ }, [value]);
137
+ const parseSocialSecurityNumber = (fullNumber) => {
138
+ const cleaned = fullNumber.replace(/\D/g, '');
139
+ if (cleaned.length === 15) {
140
+ const parsed = {
141
+ sex: cleaned.substring(0, 1),
142
+ year: cleaned.substring(1, 3),
143
+ month: cleaned.substring(3, 5),
144
+ department: cleaned.substring(5, 7),
145
+ insee: cleaned.substring(7, 10),
146
+ order: cleaned.substring(10, 13),
147
+ controlKey: cleaned.substring(13, 15),
148
+ };
149
+ const nir = parsed.sex + parsed.year + parsed.month + parsed.department + parsed.insee + parsed.order;
150
+ const calculatedKey = calculateControlKey(nir);
151
+ if (calculatedKey === parsed.controlKey) {
152
+ setState(prev => ({ ...prev, ...parsed, error: '' }));
153
+ onChange?.(cleaned);
154
+ }
155
+ else {
156
+ setState(prev => ({
157
+ ...prev,
158
+ ...parsed,
159
+ error: 'Clé de contrôle incorrecte. La clé calculée est ' + calculatedKey + ' mais vous avez saisi ' + parsed.controlKey
160
+ }));
161
+ }
162
+ }
163
+ else {
164
+ setState(prev => ({ ...prev, error: 'Le numéro de sécurité sociale doit contenir exactement 15 chiffres' }));
165
+ }
166
+ };
167
+ const handlers = {
168
+ sex: {
169
+ onChange: (e) => {
170
+ const inputValue = e.target.value;
171
+ if (inputValue === '' || inputValue === '1' || inputValue === '2') {
172
+ updateField('sex', inputValue);
173
+ if (inputValue === '1' || inputValue === '2') {
174
+ const nextInput = e.target.parentElement?.querySelector('input:nth-child(2)');
175
+ nextInput?.focus();
176
+ }
177
+ }
178
+ },
179
+ onPaste: (e) => {
180
+ const pastedText = e.clipboardData.getData('text');
181
+ const cleaned = pastedText.replace(/\D/g, '');
182
+ if (cleaned.length === 15) {
183
+ e.preventDefault();
184
+ parseSocialSecurityNumber(pastedText);
185
+ }
186
+ // Sinon, laisser le comportement par défaut (pas de preventDefault)
187
+ },
188
+ },
189
+ year: {
190
+ onChange: (e) => {
191
+ const inputValue = e.target.value;
192
+ const cleaned = inputValue.replace(/\D/g, '');
193
+ if (cleaned.length <= 2) {
194
+ updateField('year', cleaned);
195
+ if (cleaned.length === 2) {
196
+ const nextInput = e.target.parentElement?.querySelector('input:nth-child(3)');
197
+ nextInput?.focus();
198
+ }
199
+ }
200
+ },
201
+ onKeyDown: (e) => {
202
+ if (e.key === 'Backspace' && e.currentTarget.value === '') {
203
+ const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(1)');
204
+ prevInput?.focus();
205
+ }
206
+ },
207
+ },
208
+ month: {
209
+ onChange: (e) => {
210
+ const inputValue = e.target.value;
211
+ const cleaned = inputValue.replace(/\D/g, '');
212
+ if (cleaned.length <= 2) {
213
+ updateField('month', cleaned);
214
+ if (cleaned.length === 2 && cleaned >= '01' && cleaned <= '12') {
215
+ const nextInput = e.target.parentElement?.querySelector('input:nth-child(4)');
216
+ nextInput?.focus();
217
+ }
218
+ }
219
+ },
220
+ onKeyDown: (e) => {
221
+ if (e.key === 'Backspace' && e.currentTarget.value === '') {
222
+ const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(2)');
223
+ prevInput?.focus();
224
+ }
225
+ },
226
+ },
227
+ department: {
228
+ onChange: (e) => {
229
+ const inputValue = e.target.value.toUpperCase();
230
+ const cleaned = inputValue.replace(/[^0-9AB]/g, '');
231
+ if (cleaned.length <= 2) {
232
+ updateField('department', cleaned);
233
+ if (cleaned.length === 2 && ((cleaned >= '01' && cleaned <= '95') ||
234
+ cleaned === '2A' ||
235
+ cleaned === '2B' ||
236
+ cleaned === '99')) {
237
+ const nextInput = e.target.parentElement?.querySelector('input:nth-child(5)');
238
+ nextInput?.focus();
239
+ }
240
+ }
241
+ },
242
+ onKeyDown: (e) => {
243
+ if (e.key === 'Backspace' && e.currentTarget.value === '') {
244
+ const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(3)');
245
+ prevInput?.focus();
246
+ }
247
+ },
248
+ },
249
+ insee: {
250
+ onChange: (e) => {
251
+ const inputValue = e.target.value;
252
+ const cleaned = inputValue.replace(/\D/g, '');
253
+ if (cleaned.length <= 3) {
254
+ updateField('insee', cleaned);
255
+ if (cleaned.length === 3) {
256
+ const nextInput = e.target.parentElement?.querySelector('input:nth-child(6)');
257
+ nextInput?.focus();
258
+ }
259
+ }
260
+ },
261
+ onKeyDown: (e) => {
262
+ if (e.key === 'Backspace' && e.currentTarget.value === '') {
263
+ const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(4)');
264
+ prevInput?.focus();
265
+ }
266
+ },
267
+ },
268
+ order: {
269
+ onChange: (e) => {
270
+ const inputValue = e.target.value;
271
+ const cleaned = inputValue.replace(/\D/g, '');
272
+ if (cleaned.length <= 3) {
273
+ updateField('order', cleaned);
274
+ }
275
+ },
276
+ onKeyDown: (e) => {
277
+ if (e.key === 'Backspace' && e.currentTarget.value === '') {
278
+ const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(5)');
279
+ prevInput?.focus();
280
+ }
281
+ },
282
+ },
283
+ };
284
+ return {
285
+ values: state,
286
+ handlers,
287
+ parseSocialSecurityNumber,
288
+ placeholders,
289
+ };
290
+ };
291
+
292
+ var css_248z = ".SocialSecurityInput-module__inputContainer___Og6B7{width:100%}.SocialSecurityInput-module__inputsRow___zwkoW{align-items:center;display:flex;gap:var(--ui-spacing-xs);width:100%}.SocialSecurityInput-module__inputLabel___4Agoh{color:var(--ui-color-text-secondary);display:block;margin-bottom:var(--ui-spacing-xs)}.SocialSecurityInput-module__inputLabel___4Agoh,.SocialSecurityInput-module__input___NmvkG{font-family:var(--ui-font-family);font-size:var(--ui-font-size-sm);font-weight:var(--ui-font-weight-medium)}.SocialSecurityInput-module__input___NmvkG{background-color:var(--ui-color-background);border:1px solid var(--ui-color-border-default);border-radius:var(--ui-border-radius-md);box-shadow:var(--ui-shadow-sm);color:var(--ui-color-text-primary);line-height:1.5;padding:var(--ui-spacing-sm);text-align:center;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.SocialSecurityInput-module__input___NmvkG:first-child{width:.5rem}.SocialSecurityInput-module__input___NmvkG:nth-child(2),.SocialSecurityInput-module__input___NmvkG:nth-child(3),.SocialSecurityInput-module__input___NmvkG:nth-child(4){width:1.25rem}.SocialSecurityInput-module__input___NmvkG:nth-child(5),.SocialSecurityInput-module__input___NmvkG:nth-child(6){width:1.75rem}.SocialSecurityInput-module__input___NmvkG:nth-child(7){width:1.25rem}.SocialSecurityInput-module__input___NmvkG::placeholder{color:var(--ui-color-text-disabled);font-size:var(--ui-font-size-xs)}.SocialSecurityInput-module__input___NmvkG:focus{border-color:var(--ui-color-border-focus);box-shadow:0 0 0 3px rgba(59,130,246,.1);outline:none}.SocialSecurityInput-module__input___NmvkG:disabled{background-color:var(--ui-color-surface);color:var(--ui-color-text-disabled);cursor:not-allowed}.SocialSecurityInput-module__input--error___9tEpq{border-color:var(--ui-color-error)}.SocialSecurityInput-module__input--error___9tEpq:focus{border-color:var(--ui-color-error);box-shadow:0 0 0 3px rgba(239,68,68,.1)}.SocialSecurityInput-module__inputError___TymBP{color:var(--ui-color-error);font-family:var(--ui-font-family);font-size:var(--ui-font-size-sm);margin-top:var(--ui-spacing-xs)}.SocialSecurityInput-module__copyButton___Cx1bs{align-items:center;background-color:inherit;border:none;cursor:pointer;display:flex;font-size:16px;height:40px;justify-content:center;margin-left:var(--ui-spacing-xs);padding:0;transition:background-color .2s ease;width:40px}.SocialSecurityInput-module__copyButton___Cx1bs svg{fill:var(--ui-color-border-default)}.SocialSecurityInput-module__copyButton___Cx1bs:hover:not(:disabled){background:var(--ui-color-primary-dark)}.SocialSecurityInput-module__copyButton___Cx1bs:disabled{background:var(--ui-color-gray-300);cursor:not-allowed;opacity:.6}.SocialSecurityInput-module__copyButton___Cx1bs.SocialSecurityInput-module__copied___23tm0{animation:SocialSecurityInput-module__copySuccess___aC-bf .3s ease-in-out}@keyframes SocialSecurityInput-module__copySuccess___aC-bf{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}";
293
+ var styles = {"inputContainer":"SocialSecurityInput-module__inputContainer___Og6B7","inputsRow":"SocialSecurityInput-module__inputsRow___zwkoW","inputLabel":"SocialSecurityInput-module__inputLabel___4Agoh","input":"SocialSecurityInput-module__input___NmvkG","inputError":"SocialSecurityInput-module__inputError___TymBP","copyButton":"SocialSecurityInput-module__copyButton___Cx1bs","copied":"SocialSecurityInput-module__copied___23tm0"};
294
+ styleInject(css_248z);
295
+
296
+ const SocialSecurityInput = ({ label = 'Numéro de sécurité sociale', placeholder = '269054958815780', value, onChange, error, disabled = false, className, showCopyButton = false, }) => {
297
+ const { values, handlers, placeholders } = useSocialSecurityInput({
298
+ onChange,
299
+ placeholder,
300
+ value,
301
+ });
302
+ const [copied, setCopied] = useState(false);
303
+ const handleCopy = async () => {
304
+ const fullNumber = values.sex +
305
+ values.year +
306
+ values.month +
307
+ values.department +
308
+ values.insee +
309
+ values.order +
310
+ values.controlKey;
311
+ if (fullNumber.length === 15) {
312
+ try {
313
+ await navigator.clipboard.writeText(fullNumber);
314
+ setCopied(true);
315
+ setTimeout(() => setCopied(false), 2000);
316
+ }
317
+ catch (err) {
318
+ console.error('Failed to copy:', err);
319
+ }
320
+ }
321
+ };
322
+ return (jsxs("div", { className: `${styles.inputContainer} ${className}`, children: [label && jsx("label", { className: styles.inputLabel, children: label }), jsxs("div", { className: styles.inputsRow, children: [jsx("input", { type: "text", className: styles.input, placeholder: placeholders.sex, minLength: 1, maxLength: 1, disabled: disabled, onChange: handlers.sex.onChange, onPaste: handlers.sex.onPaste, value: values.sex }), jsx("input", { type: "text", className: styles.input, placeholder: placeholders.year, minLength: 2, maxLength: 2, disabled: disabled, onChange: handlers.year.onChange, onKeyDown: handlers.year.onKeyDown, value: values.year }), jsx("input", { type: "text", className: styles.input, placeholder: placeholders.month, minLength: 2, maxLength: 2, disabled: disabled, onChange: handlers.month.onChange, onKeyDown: handlers.month.onKeyDown, value: values.month }), jsx("input", { type: "text", className: styles.input, placeholder: placeholders.department, minLength: 2, maxLength: 2, disabled: disabled, onChange: handlers.department.onChange, onKeyDown: handlers.department.onKeyDown, value: values.department }), jsx("input", { type: "text", className: styles.input, placeholder: placeholders.insee, minLength: 3, maxLength: 3, disabled: disabled, onChange: handlers.insee.onChange, onKeyDown: handlers.insee.onKeyDown, value: values.insee }), jsx("input", { type: "text", className: styles.input, placeholder: placeholders.order, minLength: 3, maxLength: 3, disabled: disabled, onChange: handlers.order.onChange, onKeyDown: handlers.order.onKeyDown, value: values.order }), jsx("input", { type: "text", className: styles.input, placeholder: placeholders.controlKey, minLength: 2, maxLength: 2, disabled: true, value: values.controlKey, readOnly: true }), showCopyButton && (jsx("button", { type: "button", className: `${styles.copyButton} ${copied ? styles.copied : ''}`, onClick: handleCopy, disabled: disabled ||
323
+ (values.sex +
324
+ values.year +
325
+ values.month +
326
+ values.department +
327
+ values.insee +
328
+ values.order +
329
+ values.controlKey).length !== 15, title: copied ? "Copié !" : "Copier le numéro de sécurité sociale", children: copied ? (jsx("svg", { height: "24px", width: "24px", viewBox: "0 -960 960 960", fill: "white", children: jsx("path", { d: "M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z" }) })) : (jsx("svg", { height: "24px", width: "24px", viewBox: "0 -960 960 960", fill: "white", children: jsx("path", { d: "M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z" }) })) }))] }), error && jsx("p", { className: styles.inputError, children: error }), values.error && jsx("p", { className: styles.inputError, children: values.error })] }));
330
+ };
331
+
332
+ const defaultTheme = {
333
+ colors: {
334
+ primary: '#F17F29',
335
+ secondary: '#4b5563',
336
+ success: '#10b981',
337
+ warning: '#f59e0b',
338
+ error: '#ef4444',
339
+ info: '#3b82f6',
340
+ background: '#ffffff',
341
+ surface: '#f9fafb',
342
+ text: {
343
+ primary: '#111827',
344
+ secondary: '#6b7280',
345
+ disabled: '#9ca3af',
346
+ },
347
+ border: {
348
+ default: '#d1d5db',
349
+ focus: '#3b82f6',
350
+ error: '#ef4444',
351
+ },
352
+ },
353
+ spacing: {
354
+ xs: '4px',
355
+ sm: '8px',
356
+ md: '16px',
357
+ lg: '24px',
358
+ xl: '32px',
359
+ },
360
+ typography: {
361
+ fontFamily: "'Inter', 'Roboto', system-ui, -apple-system, sans-serif",
362
+ fontSize: {
363
+ xs: '12px',
364
+ sm: '14px',
365
+ base: '16px',
366
+ lg: '18px',
367
+ xl: '20px',
368
+ },
369
+ fontWeight: {
370
+ normal: 400,
371
+ medium: 500,
372
+ semibold: 600,
373
+ bold: 700,
374
+ },
375
+ },
376
+ borderRadius: {
377
+ sm: '4px',
378
+ md: '6px',
379
+ lg: '8px',
380
+ full: '9999px',
381
+ },
382
+ shadows: {
383
+ sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
384
+ md: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',
385
+ lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
386
+ },
387
+ breakpoints: {
388
+ sm: '640px',
389
+ md: '768px',
390
+ lg: '1024px',
391
+ xl: '1280px',
392
+ },
393
+ };
394
+ const defaultComponents = {
395
+ button: {
396
+ defaultVariant: 'primary',
397
+ defaultSize: 'medium',
398
+ disabledOpacity: 0.5,
399
+ },
400
+ input: {
401
+ defaultType: 'text',
402
+ disabledOpacity: 0.5,
403
+ },
404
+ };
405
+ const defaultConfig = {
406
+ theme: defaultTheme,
407
+ components: defaultComponents,
408
+ prefix: 'ui',
409
+ };
410
+ let globalConfig = { ...defaultConfig };
411
+ const setGlobalConfig = (config) => {
412
+ globalConfig = {
413
+ ...globalConfig,
414
+ ...config,
415
+ theme: {
416
+ ...globalConfig.theme,
417
+ ...config.theme,
418
+ },
419
+ components: {
420
+ ...globalConfig.components,
421
+ ...config.components,
422
+ },
423
+ };
424
+ };
425
+ const getGlobalConfig = () => {
426
+ return globalConfig;
427
+ };
428
+ const resetGlobalConfig = () => {
429
+ globalConfig = { ...defaultConfig };
430
+ };
431
+
432
+ const getCSSVariable = (path) => {
433
+ const config = getGlobalConfig();
434
+ const keys = path.split('.');
435
+ let value = config;
436
+ for (const key of keys) {
437
+ value = value[key];
438
+ if (value === undefined) {
439
+ console.warn(`CSS variable not found: ${path}`);
440
+ return '';
441
+ }
442
+ }
443
+ return typeof value === 'string' ? value : String(value);
444
+ };
445
+ const createCSSVariables = () => {
446
+ const config = getGlobalConfig();
447
+ const prefix = config.prefix;
448
+ const variables = [
449
+ `--${prefix}-color-primary: ${config.theme.colors.primary};`,
450
+ `--${prefix}-color-secondary: ${config.theme.colors.secondary};`,
451
+ `--${prefix}-color-success: ${config.theme.colors.success};`,
452
+ `--${prefix}-color-warning: ${config.theme.colors.warning};`,
453
+ `--${prefix}-color-error: ${config.theme.colors.error};`,
454
+ `--${prefix}-color-info: ${config.theme.colors.info};`,
455
+ `--${prefix}-color-background: ${config.theme.colors.background};`,
456
+ `--${prefix}-color-surface: ${config.theme.colors.surface};`,
457
+ `--${prefix}-color-text-primary: ${config.theme.colors.text.primary};`,
458
+ `--${prefix}-color-text-secondary: ${config.theme.colors.text.secondary};`,
459
+ `--${prefix}-color-text-disabled: ${config.theme.colors.text.disabled};`,
460
+ `--${prefix}-color-border-default: ${config.theme.colors.border.default};`,
461
+ `--${prefix}-color-border-focus: ${config.theme.colors.border.focus};`,
462
+ `--${prefix}-color-border-error: ${config.theme.colors.border.error};`,
463
+ `--${prefix}-spacing-xs: ${config.theme.spacing.xs};`,
464
+ `--${prefix}-spacing-sm: ${config.theme.spacing.sm};`,
465
+ `--${prefix}-spacing-md: ${config.theme.spacing.md};`,
466
+ `--${prefix}-spacing-lg: ${config.theme.spacing.lg};`,
467
+ `--${prefix}-spacing-xl: ${config.theme.spacing.xl};`,
468
+ `--${prefix}-font-family: ${config.theme.typography.fontFamily};`,
469
+ `--${prefix}-font-size-xs: ${config.theme.typography.fontSize.xs};`,
470
+ `--${prefix}-font-size-sm: ${config.theme.typography.fontSize.sm};`,
471
+ `--${prefix}-font-size-base: ${config.theme.typography.fontSize.base};`,
472
+ `--${prefix}-font-size-lg: ${config.theme.typography.fontSize.lg};`,
473
+ `--${prefix}-font-size-xl: ${config.theme.typography.fontSize.xl};`,
474
+ `--${prefix}-font-weight-normal: ${config.theme.typography.fontWeight.normal};`,
475
+ `--${prefix}-font-weight-medium: ${config.theme.typography.fontWeight.medium};`,
476
+ `--${prefix}-font-weight-semibold: ${config.theme.typography.fontWeight.semibold};`,
477
+ `--${prefix}-font-weight-bold: ${config.theme.typography.fontWeight.bold};`,
478
+ `--${prefix}-border-radius-sm: ${config.theme.borderRadius.sm};`,
479
+ `--${prefix}-border-radius-md: ${config.theme.borderRadius.md};`,
480
+ `--${prefix}-border-radius-lg: ${config.theme.borderRadius.lg};`,
481
+ `--${prefix}-border-radius-full: ${config.theme.borderRadius.full};`,
482
+ `--${prefix}-shadow-sm: ${config.theme.shadows.sm};`,
483
+ `--${prefix}-shadow-md: ${config.theme.shadows.md};`,
484
+ `--${prefix}-shadow-lg: ${config.theme.shadows.lg};`,
485
+ ];
486
+ return `:root {\n ${variables.join('\n ')}\n}\n\n* {\n font-family: var(--ui-font-family);\n}`;
487
+ };
488
+
489
+ const ThemeProvider = ({ children, theme }) => {
490
+ useEffect(() => {
491
+ if (theme && Object.keys(theme).length > 0) {
492
+ const currentConfig = getGlobalConfig();
493
+ setGlobalConfig({
494
+ theme: {
495
+ ...currentConfig.theme,
496
+ ...theme,
497
+ colors: {
498
+ ...currentConfig.theme.colors,
499
+ ...theme.colors,
500
+ },
501
+ },
502
+ });
503
+ }
504
+ const cssVariables = createCSSVariables();
505
+ const styleElement = document.createElement('style');
506
+ styleElement.textContent = cssVariables;
507
+ styleElement.id = 'ui-theme-variables';
508
+ document.head.appendChild(styleElement);
509
+ return () => {
510
+ const existingStyle = document.getElementById('ui-theme-variables');
511
+ if (existingStyle) {
512
+ existingStyle.remove();
513
+ }
514
+ };
515
+ }, [theme]);
516
+ return jsx(Fragment, { children: children });
517
+ };
518
+
519
+ export { SocialSecurityInput, ThemeProvider, createCSSVariables, defaultConfig, getCSSVariable, getGlobalConfig, resetGlobalConfig, setGlobalConfig };
520
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/components/SocialSecurityInput/useSocialSecurityInput.ts","../src/components/SocialSecurityInput/SocialSecurityInput.tsx","../src/config/index.ts","../src/utils/cssVariables.ts","../src/components/ThemeProvider.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import { useState, useEffect, useCallback } from 'react';\n\ninterface UseSocialSecurityInputProps {\n onChange?: (value: string) => void;\n placeholder?: string;\n value?: string;\n}\n\ninterface SocialSecurityState {\n sex: string;\n year: string;\n month: string;\n department: string;\n insee: string;\n order: string;\n controlKey: string;\n error: string;\n}\n\nexport const useSocialSecurityInput = ({ onChange, placeholder = '269054958815780', value }: UseSocialSecurityInputProps) => {\n const [state, setState] = useState<SocialSecurityState>({\n sex: '',\n year: '',\n month: '',\n department: '',\n insee: '',\n order: '',\n controlKey: '',\n error: '',\n });\n\n const calculateControlKey = (nir: string): string => {\n if (nir.length !== 13) return '';\n \n let nirForCalculation = nir;\n if (nirForCalculation.includes('2A')) {\n nirForCalculation = nirForCalculation.replace('2A', '19');\n }\n if (nirForCalculation.includes('2B')) {\n nirForCalculation = nirForCalculation.replace('2B', '20');\n }\n \n let remainder = 0;\n for (let i = 0; i < nirForCalculation.length; i++) {\n remainder = (remainder * 10 + parseInt(nirForCalculation[i], 10)) % 97;\n }\n \n const controlKey = 97 - remainder;\n return controlKey.toString().padStart(2, '0');\n };\n\n const updateControlKey = useCallback(() => {\n const nir = state.sex + state.year + state.month + state.department + state.insee + state.order;\n const key = calculateControlKey(nir);\n \n setState(prev => ({ ...prev, controlKey: key }));\n \n if (nir.length === 13 && key) {\n const fullNir = nir + key;\n onChange?.(fullNir);\n }\n }, [state.sex, state.year, state.month, state.department, state.insee, state.order, onChange]);\n\n useEffect(() => {\n updateControlKey();\n }, [state.sex, state.year, state.month, state.department, state.insee, state.order, updateControlKey]);\n\n const updateField = (field: keyof SocialSecurityState, value: string) => {\n setState(prev => ({ ...prev, [field]: value, error: '' }));\n };\n\n const parsePlaceholder = (placeholder: string) => {\n const cleaned = placeholder.replace(/\\D/g, '');\n if (cleaned.length >= 15) {\n return {\n sex: cleaned.substring(0, 1),\n year: cleaned.substring(1, 3),\n month: cleaned.substring(3, 5),\n department: cleaned.substring(5, 7),\n insee: cleaned.substring(7, 10),\n order: cleaned.substring(10, 13),\n controlKey: cleaned.substring(13, 15),\n };\n }\n return {\n sex: '2',\n year: '69',\n month: '05',\n department: '49',\n insee: '588',\n order: '157',\n controlKey: '80',\n };\n };\n\n const placeholders = parsePlaceholder(placeholder);\n\n const parseValue = (value: string) => {\n const cleaned = value.replace(/\\D/g, '');\n if (cleaned.length === 15) {\n return {\n sex: cleaned.substring(0, 1),\n year: cleaned.substring(1, 3),\n month: cleaned.substring(3, 5),\n department: cleaned.substring(5, 7),\n insee: cleaned.substring(7, 10),\n order: cleaned.substring(10, 13),\n controlKey: cleaned.substring(13, 15),\n };\n }\n return null;\n };\n\n\n useEffect(() => {\n if (value) {\n const parsed = parseValue(value);\n if (parsed) {\n setState(prev => ({ ...prev, ...parsed, error: '' }));\n }\n } else {\n setState(prev => ({\n ...prev,\n sex: '',\n year: '',\n month: '',\n department: '',\n insee: '',\n order: '',\n controlKey: '',\n error: '',\n }));\n }\n }, [value]);\n\n const parseSocialSecurityNumber = (fullNumber: string) => {\n const cleaned = fullNumber.replace(/\\D/g, '');\n \n if (cleaned.length === 15) {\n const parsed = {\n sex: cleaned.substring(0, 1),\n year: cleaned.substring(1, 3),\n month: cleaned.substring(3, 5),\n department: cleaned.substring(5, 7),\n insee: cleaned.substring(7, 10),\n order: cleaned.substring(10, 13),\n controlKey: cleaned.substring(13, 15),\n };\n \n const nir = parsed.sex + parsed.year + parsed.month + parsed.department + parsed.insee + parsed.order;\n const calculatedKey = calculateControlKey(nir);\n \n if (calculatedKey === parsed.controlKey) {\n setState(prev => ({ ...prev, ...parsed, error: '' }));\n onChange?.(cleaned);\n } else {\n setState(prev => ({ \n ...prev, \n ...parsed, \n error: 'Clé de contrôle incorrecte. La clé calculée est ' + calculatedKey + ' mais vous avez saisi ' + parsed.controlKey \n }));\n }\n } else {\n setState(prev => ({ ...prev, error: 'Le numéro de sécurité sociale doit contenir exactement 15 chiffres' }));\n }\n };\n\n const handlers = {\n sex: {\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n if (inputValue === '' || inputValue === '1' || inputValue === '2') {\n updateField('sex', inputValue);\n if (inputValue === '1' || inputValue === '2') {\n const nextInput = e.target.parentElement?.querySelector('input:nth-child(2)') as HTMLInputElement;\n nextInput?.focus();\n }\n }\n },\n onPaste: (e: React.ClipboardEvent<HTMLInputElement>) => {\n const pastedText = e.clipboardData.getData('text');\n const cleaned = pastedText.replace(/\\D/g, '');\n \n if (cleaned.length === 15) {\n e.preventDefault();\n parseSocialSecurityNumber(pastedText);\n }\n // Sinon, laisser le comportement par défaut (pas de preventDefault)\n },\n },\n\n year: {\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleaned = inputValue.replace(/\\D/g, '');\n if (cleaned.length <= 2) {\n updateField('year', cleaned);\n if (cleaned.length === 2) {\n const nextInput = e.target.parentElement?.querySelector('input:nth-child(3)') as HTMLInputElement;\n nextInput?.focus();\n }\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Backspace' && e.currentTarget.value === '') {\n const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(1)') as HTMLInputElement;\n prevInput?.focus();\n }\n },\n },\n\n month: {\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleaned = inputValue.replace(/\\D/g, '');\n if (cleaned.length <= 2) {\n updateField('month', cleaned);\n if (cleaned.length === 2 && cleaned >= '01' && cleaned <= '12') {\n const nextInput = e.target.parentElement?.querySelector('input:nth-child(4)') as HTMLInputElement;\n nextInput?.focus();\n }\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Backspace' && e.currentTarget.value === '') {\n const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(2)') as HTMLInputElement;\n prevInput?.focus();\n }\n },\n },\n\n department: {\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value.toUpperCase();\n const cleaned = inputValue.replace(/[^0-9AB]/g, '');\n \n if (cleaned.length <= 2) {\n updateField('department', cleaned);\n \n if (cleaned.length === 2 && (\n (cleaned >= '01' && cleaned <= '95') || \n cleaned === '2A' || \n cleaned === '2B' ||\n cleaned === '99'\n )) {\n const nextInput = e.target.parentElement?.querySelector('input:nth-child(5)') as HTMLInputElement;\n nextInput?.focus();\n }\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Backspace' && e.currentTarget.value === '') {\n const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(3)') as HTMLInputElement;\n prevInput?.focus();\n }\n },\n },\n\n insee: {\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleaned = inputValue.replace(/\\D/g, '');\n if (cleaned.length <= 3) {\n updateField('insee', cleaned);\n if (cleaned.length === 3) {\n const nextInput = e.target.parentElement?.querySelector('input:nth-child(6)') as HTMLInputElement;\n nextInput?.focus();\n }\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Backspace' && e.currentTarget.value === '') {\n const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(4)') as HTMLInputElement;\n prevInput?.focus();\n }\n },\n },\n\n order: {\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleaned = inputValue.replace(/\\D/g, '');\n if (cleaned.length <= 3) {\n updateField('order', cleaned);\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Backspace' && e.currentTarget.value === '') {\n const prevInput = e.currentTarget.parentElement?.querySelector('input:nth-child(5)') as HTMLInputElement;\n prevInput?.focus();\n }\n },\n },\n };\n\n return {\n values: state,\n handlers,\n parseSocialSecurityNumber,\n placeholders,\n };\n};\n","import React, { useState } from 'react';\nimport { SocialSecurityInputProps } from '../../types';\nimport { useSocialSecurityInput } from './useSocialSecurityInput';\nimport styles from './SocialSecurityInput.module.css';\n\nconst SocialSecurityInput: React.FC<SocialSecurityInputProps> = ({\n label = 'Numéro de sécurité sociale',\n placeholder = '269054958815780',\n value,\n onChange,\n error,\n disabled = false,\n className,\n showCopyButton = false,\n}) => {\n const { values, handlers, placeholders } = useSocialSecurityInput({\n onChange,\n placeholder,\n value,\n });\n\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n const fullNumber =\n values.sex +\n values.year +\n values.month +\n values.department +\n values.insee +\n values.order +\n values.controlKey;\n if (fullNumber.length === 15) {\n try {\n await navigator.clipboard.writeText(fullNumber);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch (err) {\n console.error('Failed to copy:', err);\n }\n }\n };\n\n return (\n <div className={`${styles.inputContainer} ${className}`}>\n {label && <label className={styles.inputLabel}>{label}</label>}\n <div className={styles.inputsRow}>\n <input\n type=\"text\"\n className={styles.input}\n placeholder={placeholders.sex}\n minLength={1}\n maxLength={1}\n disabled={disabled}\n onChange={handlers.sex.onChange}\n onPaste={handlers.sex.onPaste}\n value={values.sex}\n />\n <input\n type=\"text\"\n className={styles.input}\n placeholder={placeholders.year}\n minLength={2}\n maxLength={2}\n disabled={disabled}\n onChange={handlers.year.onChange}\n onKeyDown={handlers.year.onKeyDown}\n value={values.year}\n />\n <input\n type=\"text\"\n className={styles.input}\n placeholder={placeholders.month}\n minLength={2}\n maxLength={2}\n disabled={disabled}\n onChange={handlers.month.onChange}\n onKeyDown={handlers.month.onKeyDown}\n value={values.month}\n />\n <input\n type=\"text\"\n className={styles.input}\n placeholder={placeholders.department}\n minLength={2}\n maxLength={2}\n disabled={disabled}\n onChange={handlers.department.onChange}\n onKeyDown={handlers.department.onKeyDown}\n value={values.department}\n />\n <input\n type=\"text\"\n className={styles.input}\n placeholder={placeholders.insee}\n minLength={3}\n maxLength={3}\n disabled={disabled}\n onChange={handlers.insee.onChange}\n onKeyDown={handlers.insee.onKeyDown}\n value={values.insee}\n />\n <input\n type=\"text\"\n className={styles.input}\n placeholder={placeholders.order}\n minLength={3}\n maxLength={3}\n disabled={disabled}\n onChange={handlers.order.onChange}\n onKeyDown={handlers.order.onKeyDown}\n value={values.order}\n />\n <input\n type=\"text\"\n className={styles.input}\n placeholder={placeholders.controlKey}\n minLength={2}\n maxLength={2}\n disabled={true}\n value={values.controlKey}\n readOnly\n />\n {showCopyButton && (\n <button\n type=\"button\"\n className={`${styles.copyButton} ${copied ? styles.copied : ''}`}\n onClick={handleCopy}\n disabled={\n disabled ||\n (\n values.sex +\n values.year +\n values.month +\n values.department +\n values.insee +\n values.order +\n values.controlKey\n ).length !== 15\n }\n title={copied ? \"Copié !\" : \"Copier le numéro de sécurité sociale\"}\n >\n {copied ? (\n <svg\n height=\"24px\"\n width=\"24px\"\n viewBox=\"0 -960 960 960\"\n fill=\"white\"\n >\n <path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" />\n </svg>\n ) : (\n <svg\n height=\"24px\"\n width=\"24px\"\n viewBox=\"0 -960 960 960\"\n fill=\"white\"\n >\n <path d=\"M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z\" />\n </svg>\n )}\n </button>\n )}\n </div>\n {error && <p className={styles.inputError}>{error}</p>}\n {values.error && <p className={styles.inputError}>{values.error}</p>}\n </div>\n );\n};\n\nexport default SocialSecurityInput;\n","export interface ThemeConfig {\n colors: {\n primary: string;\n secondary: string;\n success: string;\n warning: string;\n error: string;\n info: string;\n background: string;\n surface: string;\n text: {\n primary: string;\n secondary: string;\n disabled: string;\n };\n border: {\n default: string;\n focus: string;\n error: string;\n };\n };\n spacing: {\n xs: string;\n sm: string;\n md: string;\n lg: string;\n xl: string;\n };\n typography: {\n fontFamily: string;\n fontSize: {\n xs: string;\n sm: string;\n base: string;\n lg: string;\n xl: string;\n };\n fontWeight: {\n normal: number;\n medium: number;\n semibold: number;\n bold: number;\n };\n };\n borderRadius: {\n sm: string;\n md: string;\n lg: string;\n full: string;\n };\n shadows: {\n sm: string;\n md: string;\n lg: string;\n };\n breakpoints: {\n sm: string;\n md: string;\n lg: string;\n xl: string;\n };\n}\n\nexport interface ComponentConfig {\n button: {\n defaultVariant: 'primary' | 'secondary' | 'outline';\n defaultSize: 'small' | 'medium' | 'large';\n disabledOpacity: number;\n };\n input: {\n defaultType: 'text' | 'email' | 'password' | 'number';\n disabledOpacity: number;\n };\n}\n\nexport interface GlobalConfig {\n theme: ThemeConfig;\n components: ComponentConfig;\n prefix: string;\n}\n\nconst defaultTheme: ThemeConfig = {\n colors: {\n primary: '#F17F29',\n secondary: '#4b5563',\n success: '#10b981',\n warning: '#f59e0b',\n error: '#ef4444',\n info: '#3b82f6',\n background: '#ffffff',\n surface: '#f9fafb',\n text: {\n primary: '#111827',\n secondary: '#6b7280',\n disabled: '#9ca3af',\n },\n border: {\n default: '#d1d5db',\n focus: '#3b82f6',\n error: '#ef4444',\n },\n },\n spacing: {\n xs: '4px',\n sm: '8px',\n md: '16px',\n lg: '24px',\n xl: '32px',\n },\n typography: {\n fontFamily: \"'Inter', 'Roboto', system-ui, -apple-system, sans-serif\",\n fontSize: {\n xs: '12px',\n sm: '14px',\n base: '16px',\n lg: '18px',\n xl: '20px',\n },\n fontWeight: {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n },\n borderRadius: {\n sm: '4px',\n md: '6px',\n lg: '8px',\n full: '9999px',\n },\n shadows: {\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',\n },\n breakpoints: {\n sm: '640px',\n md: '768px',\n lg: '1024px',\n xl: '1280px',\n },\n};\n\nconst defaultComponents: ComponentConfig = {\n button: {\n defaultVariant: 'primary',\n defaultSize: 'medium',\n disabledOpacity: 0.5,\n },\n input: {\n defaultType: 'text',\n disabledOpacity: 0.5,\n },\n};\n\nexport const defaultConfig: GlobalConfig = {\n theme: defaultTheme,\n components: defaultComponents,\n prefix: 'ui',\n};\n\nlet globalConfig: GlobalConfig = { ...defaultConfig };\n\nexport const setGlobalConfig = (config: Partial<GlobalConfig>): void => {\n globalConfig = {\n ...globalConfig,\n ...config,\n theme: {\n ...globalConfig.theme,\n ...config.theme,\n },\n components: {\n ...globalConfig.components,\n ...config.components,\n },\n };\n};\n\nexport const getGlobalConfig = (): GlobalConfig => {\n return globalConfig;\n};\n\nexport const resetGlobalConfig = (): void => {\n globalConfig = { ...defaultConfig };\n};\n","import { getGlobalConfig } from '../config';\n\nexport const getCSSVariable = (path: string): string => {\n const config = getGlobalConfig();\n const keys = path.split('.');\n let value: unknown = config;\n \n for (const key of keys) {\n value = (value as Record<string, unknown>)[key];\n if (value === undefined) {\n console.warn(`CSS variable not found: ${path}`);\n return '';\n }\n }\n \n return typeof value === 'string' ? value : String(value);\n};\n\nexport const createCSSVariables = (): string => {\n const config = getGlobalConfig();\n const prefix = config.prefix;\n \n const variables = [\n `--${prefix}-color-primary: ${config.theme.colors.primary};`,\n `--${prefix}-color-secondary: ${config.theme.colors.secondary};`,\n `--${prefix}-color-success: ${config.theme.colors.success};`,\n `--${prefix}-color-warning: ${config.theme.colors.warning};`,\n `--${prefix}-color-error: ${config.theme.colors.error};`,\n `--${prefix}-color-info: ${config.theme.colors.info};`,\n `--${prefix}-color-background: ${config.theme.colors.background};`,\n `--${prefix}-color-surface: ${config.theme.colors.surface};`,\n `--${prefix}-color-text-primary: ${config.theme.colors.text.primary};`,\n `--${prefix}-color-text-secondary: ${config.theme.colors.text.secondary};`,\n `--${prefix}-color-text-disabled: ${config.theme.colors.text.disabled};`,\n `--${prefix}-color-border-default: ${config.theme.colors.border.default};`,\n `--${prefix}-color-border-focus: ${config.theme.colors.border.focus};`,\n `--${prefix}-color-border-error: ${config.theme.colors.border.error};`,\n `--${prefix}-spacing-xs: ${config.theme.spacing.xs};`,\n `--${prefix}-spacing-sm: ${config.theme.spacing.sm};`,\n `--${prefix}-spacing-md: ${config.theme.spacing.md};`,\n `--${prefix}-spacing-lg: ${config.theme.spacing.lg};`,\n `--${prefix}-spacing-xl: ${config.theme.spacing.xl};`,\n `--${prefix}-font-family: ${config.theme.typography.fontFamily};`,\n `--${prefix}-font-size-xs: ${config.theme.typography.fontSize.xs};`,\n `--${prefix}-font-size-sm: ${config.theme.typography.fontSize.sm};`,\n `--${prefix}-font-size-base: ${config.theme.typography.fontSize.base};`,\n `--${prefix}-font-size-lg: ${config.theme.typography.fontSize.lg};`,\n `--${prefix}-font-size-xl: ${config.theme.typography.fontSize.xl};`,\n `--${prefix}-font-weight-normal: ${config.theme.typography.fontWeight.normal};`,\n `--${prefix}-font-weight-medium: ${config.theme.typography.fontWeight.medium};`,\n `--${prefix}-font-weight-semibold: ${config.theme.typography.fontWeight.semibold};`,\n `--${prefix}-font-weight-bold: ${config.theme.typography.fontWeight.bold};`,\n `--${prefix}-border-radius-sm: ${config.theme.borderRadius.sm};`,\n `--${prefix}-border-radius-md: ${config.theme.borderRadius.md};`,\n `--${prefix}-border-radius-lg: ${config.theme.borderRadius.lg};`,\n `--${prefix}-border-radius-full: ${config.theme.borderRadius.full};`,\n `--${prefix}-shadow-sm: ${config.theme.shadows.sm};`,\n `--${prefix}-shadow-md: ${config.theme.shadows.md};`,\n `--${prefix}-shadow-lg: ${config.theme.shadows.lg};`,\n ];\n \n return `:root {\\n ${variables.join('\\n ')}\\n}\\n\\n* {\\n font-family: var(--ui-font-family);\\n}`;\n};\n","import React, { useEffect } from 'react';\nimport { createCSSVariables } from '../utils/cssVariables';\nimport { setGlobalConfig, getGlobalConfig, ThemeConfig } from '../config';\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n theme?: Partial<ThemeConfig>;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ children, theme }) => {\n useEffect(() => {\n if (theme && Object.keys(theme).length > 0) {\n const currentConfig = getGlobalConfig();\n setGlobalConfig({\n theme: {\n ...currentConfig.theme,\n ...theme,\n colors: {\n ...currentConfig.theme.colors,\n ...theme.colors,\n },\n },\n });\n }\n \n const cssVariables = createCSSVariables();\n \n const styleElement = document.createElement('style');\n styleElement.textContent = cssVariables;\n styleElement.id = 'ui-theme-variables';\n \n document.head.appendChild(styleElement);\n \n return () => {\n const existingStyle = document.getElementById('ui-theme-variables');\n if (existingStyle) {\n existingStyle.remove();\n }\n };\n }, [theme]);\n\n return <>{children}</>;\n};\n"],"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