automoby-kit 1.0.2 → 1.0.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 (82) hide show
  1. package/dist/cjs/Accordion.js +1 -0
  2. package/dist/cjs/Backdrop.js +1 -0
  3. package/dist/cjs/Breadcrumb.js +1 -0
  4. package/dist/cjs/Button.js +1 -0
  5. package/dist/cjs/Chips.js +1 -0
  6. package/dist/cjs/Divider.js +1 -0
  7. package/dist/cjs/Drawer.js +1 -0
  8. package/dist/cjs/Input.js +1 -0
  9. package/dist/cjs/Menu.js +1 -0
  10. package/dist/cjs/Pagination.js +1 -0
  11. package/dist/cjs/ProtectedComponent.js +1 -0
  12. package/dist/cjs/RadioGroup.js +1 -0
  13. package/dist/cjs/Tabs.js +1 -0
  14. package/dist/cjs/Typography.js +1 -0
  15. package/dist/cjs/chunks/MobileContext-Cmx8hQxY.js +1 -0
  16. package/dist/cjs/chunks/chevron-left-Do__K6cA.js +1 -0
  17. package/dist/cjs/chunks/createLucideIcon-BqJVOzoK.js +1 -0
  18. package/dist/cjs/chunks/jsx-runtime-Bgd4cJfV.js +1 -0
  19. package/dist/cjs/contexts.js +1 -0
  20. package/dist/cjs/index.js +1 -0
  21. package/dist/cjs/licensing.js +1 -0
  22. package/dist/cjs/utils.js +1 -0
  23. package/dist/esm/Accordion.js +1 -0
  24. package/dist/esm/Backdrop.js +1 -0
  25. package/dist/esm/Breadcrumb.js +1 -0
  26. package/dist/esm/Button.js +1 -0
  27. package/dist/esm/Chips.js +1 -0
  28. package/dist/esm/Divider.js +1 -0
  29. package/dist/esm/Drawer.js +1 -0
  30. package/dist/esm/Input.js +1 -0
  31. package/dist/esm/Menu.js +1 -0
  32. package/dist/esm/Pagination.js +1 -0
  33. package/dist/esm/ProtectedComponent.js +1 -0
  34. package/dist/esm/RadioGroup.js +1 -0
  35. package/dist/esm/Tabs.js +1 -0
  36. package/dist/esm/Typography.js +1 -0
  37. package/dist/esm/chunks/MobileContext-BtGMRo2b.js +1 -0
  38. package/dist/esm/chunks/chevron-left-4HSuTes3.js +1 -0
  39. package/dist/esm/chunks/createLucideIcon-DGp0SoUT.js +1 -0
  40. package/dist/esm/chunks/jsx-runtime-DZXOD2H9.js +1 -0
  41. package/dist/esm/contexts.js +1 -0
  42. package/dist/esm/index.js +1 -0
  43. package/dist/esm/licensing.js +1 -0
  44. package/dist/esm/utils.js +1 -0
  45. package/dist/types/Accordion.js +54 -0
  46. package/dist/types/Backdrop.js +24 -0
  47. package/dist/types/Breadcrumb.js +56 -0
  48. package/dist/types/Button.js +46 -0
  49. package/dist/types/Chips.js +109 -0
  50. package/dist/types/Divider.js +21 -0
  51. package/dist/types/Drawer.js +107 -0
  52. package/dist/types/Input.js +78 -0
  53. package/dist/types/Menu.js +120 -0
  54. package/dist/{index.esm.js → types/MobileContext-D-Cbqeno.js} +3 -1519
  55. package/dist/types/Pagination.js +183 -0
  56. package/dist/types/ProtectedComponent.js +33 -0
  57. package/dist/types/RadioGroup.js +68 -0
  58. package/dist/types/Tabs.js +49 -0
  59. package/dist/types/Typography.js +60 -0
  60. package/dist/types/chevron-left-Ck6O99eF.js +14 -0
  61. package/dist/types/components/Accordion/Accordion.d.ts +2 -2
  62. package/dist/types/components/Accordion/Accordion.stories.d.ts +10 -9
  63. package/dist/types/components/Breadcrumb/Breadcrumb.d.ts +4 -1
  64. package/dist/types/components/Breadcrumb/Breadcrumb.stories.d.ts +4 -3
  65. package/dist/types/components/Chips/Chips.d.ts +2 -2
  66. package/dist/types/components/Drawer/Drawer.d.ts +4 -0
  67. package/dist/types/components/Drawer/Drawer.stories.d.ts +21 -8
  68. package/dist/types/components/Input/Input.d.ts +8 -0
  69. package/dist/types/components/Input/Input.stories.d.ts +1 -0
  70. package/dist/types/components/Pagination/Pagination.d.ts +4 -0
  71. package/dist/types/components/Pagination/Pagination.stories.d.ts +17 -2
  72. package/dist/types/components/RadioGroup/RadioGroup.d.ts +2 -2
  73. package/dist/types/components/Tabs/Tabs.d.ts +2 -2
  74. package/dist/types/contexts.js +3 -0
  75. package/dist/types/createLucideIcon-D-q73LTT.js +112 -0
  76. package/dist/types/index.d.ts +3 -0
  77. package/dist/types/index.js +38 -0
  78. package/dist/types/jsx-runtime-BiC2V0nk.js +430 -0
  79. package/dist/types/licensing.js +125 -0
  80. package/dist/types/utils.js +7 -0
  81. package/package.json +93 -4
  82. package/dist/index.cjs.js +0 -3019
@@ -1,685 +1,5 @@
1
- import React, { createContext, useContext, useMemo, useState, useId, useRef, useEffect, forwardRef, createElement } from 'react';
2
-
3
- var jsxRuntime = {exports: {}};
4
-
5
- var reactJsxRuntime_production = {};
6
-
7
- /**
8
- * @license React
9
- * react-jsx-runtime.production.js
10
- *
11
- * Copyright (c) Meta Platforms, Inc. and affiliates.
12
- *
13
- * This source code is licensed under the MIT license found in the
14
- * LICENSE file in the root directory of this source tree.
15
- */
16
-
17
- var hasRequiredReactJsxRuntime_production;
18
-
19
- function requireReactJsxRuntime_production () {
20
- if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
21
- hasRequiredReactJsxRuntime_production = 1;
22
- var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
23
- REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
24
- function jsxProd(type, config, maybeKey) {
25
- var key = null;
26
- void 0 !== maybeKey && (key = "" + maybeKey);
27
- void 0 !== config.key && (key = "" + config.key);
28
- if ("key" in config) {
29
- maybeKey = {};
30
- for (var propName in config)
31
- "key" !== propName && (maybeKey[propName] = config[propName]);
32
- } else maybeKey = config;
33
- config = maybeKey.ref;
34
- return {
35
- $$typeof: REACT_ELEMENT_TYPE,
36
- type: type,
37
- key: key,
38
- ref: void 0 !== config ? config : null,
39
- props: maybeKey
40
- };
41
- }
42
- reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
43
- reactJsxRuntime_production.jsx = jsxProd;
44
- reactJsxRuntime_production.jsxs = jsxProd;
45
- return reactJsxRuntime_production;
46
- }
47
-
48
- var reactJsxRuntime_development = {};
49
-
50
- /**
51
- * @license React
52
- * react-jsx-runtime.development.js
53
- *
54
- * Copyright (c) Meta Platforms, Inc. and affiliates.
55
- *
56
- * This source code is licensed under the MIT license found in the
57
- * LICENSE file in the root directory of this source tree.
58
- */
59
-
60
- var hasRequiredReactJsxRuntime_development;
61
-
62
- function requireReactJsxRuntime_development () {
63
- if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
64
- hasRequiredReactJsxRuntime_development = 1;
65
- "production" !== process.env.NODE_ENV &&
66
- (function () {
67
- function getComponentNameFromType(type) {
68
- if (null == type) return null;
69
- if ("function" === typeof type)
70
- return type.$$typeof === REACT_CLIENT_REFERENCE
71
- ? null
72
- : type.displayName || type.name || null;
73
- if ("string" === typeof type) return type;
74
- switch (type) {
75
- case REACT_FRAGMENT_TYPE:
76
- return "Fragment";
77
- case REACT_PROFILER_TYPE:
78
- return "Profiler";
79
- case REACT_STRICT_MODE_TYPE:
80
- return "StrictMode";
81
- case REACT_SUSPENSE_TYPE:
82
- return "Suspense";
83
- case REACT_SUSPENSE_LIST_TYPE:
84
- return "SuspenseList";
85
- case REACT_ACTIVITY_TYPE:
86
- return "Activity";
87
- }
88
- if ("object" === typeof type)
89
- switch (
90
- ("number" === typeof type.tag &&
91
- console.error(
92
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
93
- ),
94
- type.$$typeof)
95
- ) {
96
- case REACT_PORTAL_TYPE:
97
- return "Portal";
98
- case REACT_CONTEXT_TYPE:
99
- return (type.displayName || "Context") + ".Provider";
100
- case REACT_CONSUMER_TYPE:
101
- return (type._context.displayName || "Context") + ".Consumer";
102
- case REACT_FORWARD_REF_TYPE:
103
- var innerType = type.render;
104
- type = type.displayName;
105
- type ||
106
- ((type = innerType.displayName || innerType.name || ""),
107
- (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
108
- return type;
109
- case REACT_MEMO_TYPE:
110
- return (
111
- (innerType = type.displayName || null),
112
- null !== innerType
113
- ? innerType
114
- : getComponentNameFromType(type.type) || "Memo"
115
- );
116
- case REACT_LAZY_TYPE:
117
- innerType = type._payload;
118
- type = type._init;
119
- try {
120
- return getComponentNameFromType(type(innerType));
121
- } catch (x) {}
122
- }
123
- return null;
124
- }
125
- function testStringCoercion(value) {
126
- return "" + value;
127
- }
128
- function checkKeyStringCoercion(value) {
129
- try {
130
- testStringCoercion(value);
131
- var JSCompiler_inline_result = !1;
132
- } catch (e) {
133
- JSCompiler_inline_result = true;
134
- }
135
- if (JSCompiler_inline_result) {
136
- JSCompiler_inline_result = console;
137
- var JSCompiler_temp_const = JSCompiler_inline_result.error;
138
- var JSCompiler_inline_result$jscomp$0 =
139
- ("function" === typeof Symbol &&
140
- Symbol.toStringTag &&
141
- value[Symbol.toStringTag]) ||
142
- value.constructor.name ||
143
- "Object";
144
- JSCompiler_temp_const.call(
145
- JSCompiler_inline_result,
146
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
147
- JSCompiler_inline_result$jscomp$0
148
- );
149
- return testStringCoercion(value);
150
- }
151
- }
152
- function getTaskName(type) {
153
- if (type === REACT_FRAGMENT_TYPE) return "<>";
154
- if (
155
- "object" === typeof type &&
156
- null !== type &&
157
- type.$$typeof === REACT_LAZY_TYPE
158
- )
159
- return "<...>";
160
- try {
161
- var name = getComponentNameFromType(type);
162
- return name ? "<" + name + ">" : "<...>";
163
- } catch (x) {
164
- return "<...>";
165
- }
166
- }
167
- function getOwner() {
168
- var dispatcher = ReactSharedInternals.A;
169
- return null === dispatcher ? null : dispatcher.getOwner();
170
- }
171
- function UnknownOwner() {
172
- return Error("react-stack-top-frame");
173
- }
174
- function hasValidKey(config) {
175
- if (hasOwnProperty.call(config, "key")) {
176
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
177
- if (getter && getter.isReactWarning) return false;
178
- }
179
- return void 0 !== config.key;
180
- }
181
- function defineKeyPropWarningGetter(props, displayName) {
182
- function warnAboutAccessingKey() {
183
- specialPropKeyWarningShown ||
184
- ((specialPropKeyWarningShown = true),
185
- console.error(
186
- "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
187
- displayName
188
- ));
189
- }
190
- warnAboutAccessingKey.isReactWarning = true;
191
- Object.defineProperty(props, "key", {
192
- get: warnAboutAccessingKey,
193
- configurable: true
194
- });
195
- }
196
- function elementRefGetterWithDeprecationWarning() {
197
- var componentName = getComponentNameFromType(this.type);
198
- didWarnAboutElementRef[componentName] ||
199
- ((didWarnAboutElementRef[componentName] = true),
200
- console.error(
201
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
202
- ));
203
- componentName = this.props.ref;
204
- return void 0 !== componentName ? componentName : null;
205
- }
206
- function ReactElement(
207
- type,
208
- key,
209
- self,
210
- source,
211
- owner,
212
- props,
213
- debugStack,
214
- debugTask
215
- ) {
216
- self = props.ref;
217
- type = {
218
- $$typeof: REACT_ELEMENT_TYPE,
219
- type: type,
220
- key: key,
221
- props: props,
222
- _owner: owner
223
- };
224
- null !== (void 0 !== self ? self : null)
225
- ? Object.defineProperty(type, "ref", {
226
- enumerable: false,
227
- get: elementRefGetterWithDeprecationWarning
228
- })
229
- : Object.defineProperty(type, "ref", { enumerable: false, value: null });
230
- type._store = {};
231
- Object.defineProperty(type._store, "validated", {
232
- configurable: false,
233
- enumerable: false,
234
- writable: true,
235
- value: 0
236
- });
237
- Object.defineProperty(type, "_debugInfo", {
238
- configurable: false,
239
- enumerable: false,
240
- writable: true,
241
- value: null
242
- });
243
- Object.defineProperty(type, "_debugStack", {
244
- configurable: false,
245
- enumerable: false,
246
- writable: true,
247
- value: debugStack
248
- });
249
- Object.defineProperty(type, "_debugTask", {
250
- configurable: false,
251
- enumerable: false,
252
- writable: true,
253
- value: debugTask
254
- });
255
- Object.freeze && (Object.freeze(type.props), Object.freeze(type));
256
- return type;
257
- }
258
- function jsxDEVImpl(
259
- type,
260
- config,
261
- maybeKey,
262
- isStaticChildren,
263
- source,
264
- self,
265
- debugStack,
266
- debugTask
267
- ) {
268
- var children = config.children;
269
- if (void 0 !== children)
270
- if (isStaticChildren)
271
- if (isArrayImpl(children)) {
272
- for (
273
- isStaticChildren = 0;
274
- isStaticChildren < children.length;
275
- isStaticChildren++
276
- )
277
- validateChildKeys(children[isStaticChildren]);
278
- Object.freeze && Object.freeze(children);
279
- } else
280
- console.error(
281
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
282
- );
283
- else validateChildKeys(children);
284
- if (hasOwnProperty.call(config, "key")) {
285
- children = getComponentNameFromType(type);
286
- var keys = Object.keys(config).filter(function (k) {
287
- return "key" !== k;
288
- });
289
- isStaticChildren =
290
- 0 < keys.length
291
- ? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
292
- : "{key: someKey}";
293
- didWarnAboutKeySpread[children + isStaticChildren] ||
294
- ((keys =
295
- 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
296
- console.error(
297
- 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
298
- isStaticChildren,
299
- children,
300
- keys,
301
- children
302
- ),
303
- (didWarnAboutKeySpread[children + isStaticChildren] = true));
304
- }
305
- children = null;
306
- void 0 !== maybeKey &&
307
- (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
308
- hasValidKey(config) &&
309
- (checkKeyStringCoercion(config.key), (children = "" + config.key));
310
- if ("key" in config) {
311
- maybeKey = {};
312
- for (var propName in config)
313
- "key" !== propName && (maybeKey[propName] = config[propName]);
314
- } else maybeKey = config;
315
- children &&
316
- defineKeyPropWarningGetter(
317
- maybeKey,
318
- "function" === typeof type
319
- ? type.displayName || type.name || "Unknown"
320
- : type
321
- );
322
- return ReactElement(
323
- type,
324
- children,
325
- self,
326
- source,
327
- getOwner(),
328
- maybeKey,
329
- debugStack,
330
- debugTask
331
- );
332
- }
333
- function validateChildKeys(node) {
334
- "object" === typeof node &&
335
- null !== node &&
336
- node.$$typeof === REACT_ELEMENT_TYPE &&
337
- node._store &&
338
- (node._store.validated = 1);
339
- }
340
- var React$1 = React,
341
- REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
342
- REACT_PORTAL_TYPE = Symbol.for("react.portal"),
343
- REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
344
- REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
345
- REACT_PROFILER_TYPE = Symbol.for("react.profiler");
346
- var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
347
- REACT_CONTEXT_TYPE = Symbol.for("react.context"),
348
- REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
349
- REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
350
- REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
351
- REACT_MEMO_TYPE = Symbol.for("react.memo"),
352
- REACT_LAZY_TYPE = Symbol.for("react.lazy"),
353
- REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
354
- REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
355
- ReactSharedInternals =
356
- React$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
357
- hasOwnProperty = Object.prototype.hasOwnProperty,
358
- isArrayImpl = Array.isArray,
359
- createTask = console.createTask
360
- ? console.createTask
361
- : function () {
362
- return null;
363
- };
364
- React$1 = {
365
- "react-stack-bottom-frame": function (callStackForError) {
366
- return callStackForError();
367
- }
368
- };
369
- var specialPropKeyWarningShown;
370
- var didWarnAboutElementRef = {};
371
- var unknownOwnerDebugStack = React$1["react-stack-bottom-frame"].bind(
372
- React$1,
373
- UnknownOwner
374
- )();
375
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
376
- var didWarnAboutKeySpread = {};
377
- reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
378
- reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
379
- var trackActualOwner =
380
- 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
381
- return jsxDEVImpl(
382
- type,
383
- config,
384
- maybeKey,
385
- false,
386
- source,
387
- self,
388
- trackActualOwner
389
- ? Error("react-stack-top-frame")
390
- : unknownOwnerDebugStack,
391
- trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
392
- );
393
- };
394
- reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
395
- var trackActualOwner =
396
- 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
397
- return jsxDEVImpl(
398
- type,
399
- config,
400
- maybeKey,
401
- true,
402
- source,
403
- self,
404
- trackActualOwner
405
- ? Error("react-stack-top-frame")
406
- : unknownOwnerDebugStack,
407
- trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
408
- );
409
- };
410
- })();
411
- return reactJsxRuntime_development;
412
- }
413
-
414
- var hasRequiredJsxRuntime;
415
-
416
- function requireJsxRuntime () {
417
- if (hasRequiredJsxRuntime) return jsxRuntime.exports;
418
- hasRequiredJsxRuntime = 1;
419
-
420
- if (process.env.NODE_ENV === 'production') {
421
- jsxRuntime.exports = requireReactJsxRuntime_production();
422
- } else {
423
- jsxRuntime.exports = requireReactJsxRuntime_development();
424
- }
425
- return jsxRuntime.exports;
426
- }
427
-
428
- var jsxRuntimeExports = requireJsxRuntime();
429
-
430
- /**
431
- * License Manager for Automoby Kit
432
- * Handles runtime key validation and component access control
433
- */
434
- class LicenseManager {
435
- static instance;
436
- isInitialized = false;
437
- isValid = false;
438
- licenseKey = null;
439
- // Valid license keys - in production, these would be validated against your backend
440
- validKeys = ['automoby-kit-war-key-2025'];
441
- constructor() {
442
- // Private constructor for singleton pattern
443
- }
444
- static getInstance() {
445
- if (!LicenseManager.instance) {
446
- LicenseManager.instance = new LicenseManager();
447
- }
448
- return LicenseManager.instance;
449
- }
450
- /**
451
- * Initialize the license with provided configuration
452
- */
453
- initialize(config) {
454
- try {
455
- this.licenseKey = config.key;
456
- // Validate the license key
457
- this.isValid = this.validateLicense(config.key);
458
- this.isInitialized = true;
459
- if (this.isValid) {
460
- console.log('✅ Automoby Kit initialized successfully');
461
- return true;
462
- }
463
- console.error('❌ Invalid license key provided for Automoby Kit');
464
- return false;
465
- }
466
- catch (error) {
467
- console.error('❌ Failed to initialize Automoby Kit:', error);
468
- this.isValid = false;
469
- this.isInitialized = true;
470
- return false;
471
- }
472
- }
473
- /**
474
- * Validate license key (in production, this would call your backend)
475
- */
476
- validateLicense(key) {
477
- // Basic validation - empty key is invalid
478
- if (!key || key.trim() === '') {
479
- return false;
480
- }
481
- // For demo purposes, we're using hardcoded keys
482
- // In production, you would validate against your backend API
483
- return this.validKeys.includes(key);
484
- }
485
- /**
486
- * Check if the license is valid and components can be used
487
- */
488
- canUseComponents() {
489
- if (!this.isInitialized) {
490
- console.error('❌ Automoby Kit not initialized. Please call initializeAutomobiKit() with your license key.');
491
- return false;
492
- }
493
- if (!this.isValid) {
494
- console.error('❌ Invalid license key. Please contact support or provide a valid license key.');
495
- return false;
496
- }
497
- return true;
498
- }
499
- /**
500
- * Get current license status
501
- */
502
- getLicenseStatus() {
503
- return {
504
- initialized: this.isInitialized,
505
- valid: this.isValid,
506
- key: this.licenseKey ? `${this.licenseKey.substring(0, 8)}...` : null,
507
- };
508
- }
509
- /**
510
- * Reset license state (useful for testing)
511
- */
512
- reset() {
513
- this.isInitialized = false;
514
- this.isValid = false;
515
- this.licenseKey = null;
516
- }
517
- }
518
-
519
- /**
520
- * Initialize Automoby Kit with your license key
521
- * This function must be called before using any components
522
- *
523
- * @param config - License configuration
524
- * @returns boolean indicating success
525
- *
526
- * @example
527
- * ```typescript
528
- * import { initializeAutomobiKit } from 'automoby-kit';
529
- *
530
- * // Initialize with your license key
531
- * const success = initializeAutomobiKit({
532
- * key: 'your-license-key-here',
533
- * domain: 'yourdomain.com', // optional
534
- * environment: 'production' // optional
535
- * });
536
- *
537
- * if (success) {
538
- * // Now you can use components
539
- * }
540
- * ```
541
- */
542
- function initializeAutomobiKit(config) {
543
- const licenseManager = LicenseManager.getInstance();
544
- return licenseManager.initialize(config);
545
- }
546
- /**
547
- * Check if components can be used
548
- */
549
- function canUseComponents() {
550
- const licenseManager = LicenseManager.getInstance();
551
- return licenseManager.canUseComponents();
552
- }
553
-
554
- /**
555
- * Higher-order component that protects components with license validation
556
- */
557
- function withLicenseProtection(Component, componentName) {
558
- const ProtectedComponent = React.forwardRef((props, ref) => {
559
- if (!canUseComponents()) {
560
- // Return a placeholder component with error styling
561
- return (jsxRuntimeExports.jsxs("div", { style: {
562
- padding: '16px',
563
- border: '2px dashed #ef4444',
564
- borderRadius: '8px',
565
- backgroundColor: '#fef2f2',
566
- color: '#dc2626',
567
- textAlign: 'center',
568
- fontFamily: 'system-ui, sans-serif',
569
- fontSize: '14px',
570
- maxWidth: '400px',
571
- margin: '16px auto',
572
- }, children: [jsxRuntimeExports.jsx("div", { style: { fontWeight: 'bold', marginBottom: '8px' }, children: "\uD83D\uDD12 License Required" }), jsxRuntimeExports.jsxs("div", { style: { marginBottom: '8px' }, children: ["Component \"", componentName, "\" requires a valid license key."] }), jsxRuntimeExports.jsx("div", { style: { fontSize: '12px', opacity: 0.8 }, children: "Please initialize Automoby Kit with your license key before using components." })] }));
573
- }
574
- // If license is valid, render the actual component
575
- // Use type assertion to handle the generic component props properly
576
- return jsxRuntimeExports.jsx(Component, { ...props, ref: ref });
577
- });
578
- ProtectedComponent.displayName = `Protected(${componentName})`;
579
- return ProtectedComponent;
580
- }
581
-
582
- function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
583
-
584
- function cn(...inputs) {
585
- return clsx(inputs);
586
- }
587
-
588
- const variantClasses$1 = {
589
- // Headings with Fat weight (900)
590
- h1: 'text-[36px] font-[var(--font-weight-fat)]',
591
- h2: 'text-[32px] font-[var(--font-weight-fat)]',
592
- h3: 'text-[28px] font-[var(--font-weight-fat)]',
593
- h4: 'text-[24px] font-[var(--font-weight-heavy)]',
594
- h5: 'text-[22px] font-[var(--font-weight-heavy)]',
595
- h6: 'text-[20px] font-[var(--font-weight-heavy)]',
596
- // Body Copy with specific weight variants
597
- 'body-xl-heavy': 'text-[20px] font-[var(--font-weight-heavy)]',
598
- 'body-l-heavy': 'text-[18px] font-[var(--font-weight-heavy)]',
599
- 'body-l-bold': 'text-[18px] font-[var(--font-weight-bold)]',
600
- 'body-l-medium': 'text-[18px] font-[var(--font-weight-medium)]',
601
- 'body-m-heavy': 'text-[16px] font-[var(--font-weight-heavy)]',
602
- 'body-m-bold': 'text-[16px] font-[var(--font-weight-bold)]',
603
- 'body-m-medium': 'text-[16px] font-[var(--font-weight-medium)]',
604
- 'body-s-heavy': 'text-[14px] font-[var(--font-weight-heavy)]',
605
- 'body-s-bold': 'text-[14px] font-[var(--font-weight-bold)]',
606
- 'body-s-medium': 'text-[14px] font-[var(--font-weight-medium)]',
607
- 'body-ms-bold': 'text-[13px] font-[var(--font-weight-bold)]',
608
- 'body-ms-medium': 'text-[13px] font-[var(--font-weight-medium)]',
609
- 'body-xs-bold': 'text-[12px] font-[var(--font-weight-bold)]',
610
- 'body-xs-medium': 'text-[12px] font-[var(--font-weight-medium)]',
611
- 'body-t-bold': 'text-[10px] font-[var(--font-weight-bold)]',
612
- 'body-t-medium': 'text-[10px] font-[var(--font-weight-medium)]',
613
- 'body-ss-medium': 'text-[9px] font-[var(--font-weight-medium)]',
614
- };
615
- // Export for reuse in other components
616
- const getTypographyClasses = (variant) => {
617
- return variantClasses$1[variant];
618
- };
619
- const colorClasses = {
620
- primary: 'text-[var(--color-primary)]',
621
- secondary: 'text-[var(--color-secondary)]',
622
- 'neutral-darker': 'text-[var(--color-neutral-darker)]',
623
- 'neutral-dark': 'text-[var(--color-neutral-dark)]',
624
- 'neutral-main': 'text-[var(--color-neutral-main)]',
625
- white: 'text-[var(--color-white)]',
626
- inherit: 'text-inherit',
627
- };
628
- const getDefaultElement = (variant) => {
629
- if (variant.startsWith('h'))
630
- return variant.split('-')[0]; // h1, h2, etc.
631
- return 'p';
632
- };
633
- const Typography$1 = React.forwardRef(({ variant = 'body-m-medium', color = 'inherit', as, className, children, ...props }, ref) => {
634
- const Element = as || getDefaultElement(variant);
635
- return React.createElement(Element, {
636
- ref,
637
- className: cn(variantClasses$1[variant], colorClasses[color], 'leading-[var(--leading-default)]', // 180% line height
638
- className),
639
- ...props,
640
- }, children);
641
- });
642
- Typography$1.displayName = 'Typography';
643
-
644
- const sizeClasses = {
645
- sm: 'px-[16px] py-[7px]',
646
- md: 'px-[16px] py-[9px]',
647
- lg: 'px-[16px] py-[13px]',
648
- xl: 'px-[20px] py-[13px]',
649
- };
650
- const defaultTextVariants = {
651
- sm: 'body-s-bold', // 14px / Bold (600)
652
- md: 'body-m-bold', // 16px / Bold (600)
653
- lg: 'body-l-bold', // 18px / Bold (600)
654
- xl: 'body-xl-heavy', // 20px / Heavy (700)
655
- };
656
- const variantClasses = {
657
- primary: `
658
- bg-[var(--color-primary)] text-white
659
- hover:bg-[var(--color-primary-dark)]
660
- disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
661
- `,
662
- secondary: `
663
- bg-[var(--color-primary-lightest)] text-[var(--color-primary)]
664
- hover:bg-[var(--color-primary-lighter)]
665
- disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
666
- `,
667
- tertiary: `
668
- bg-white border border-[var(--color-primary-light)] text-[var(--color-primary)]
669
- hover:bg-[var(--color-neutral-lighter)]
670
- disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
671
- `,
672
- ghost: `
673
- bg-transparent text-[var(--color-primary)]
674
- hover:bg-[var(--color-primary-lightest)]
675
- disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
676
- `,
677
- };
678
- const Button$1 = React.forwardRef(({ className, variant = 'primary', size = 'md', icon, iconPosition = 'right', children, loading = false, disabled, textVariant, ...props }, ref) => {
679
- const finalTextVariant = textVariant || defaultTextVariants[size];
680
- return (jsxRuntimeExports.jsxs("button", { ref: ref, type: "button", className: cn('inline-flex items-center justify-center rounded-[8px] transition-colors duration-200', sizeClasses[size], variantClasses[variant], getTypographyClasses(finalTextVariant), disabled && 'opacity-50 pointer-events-none', className), disabled: disabled || loading, ...props, children: [icon && iconPosition === 'left' && (jsxRuntimeExports.jsx("span", { className: "mr-2 flex items-center", children: icon })), loading ? '...' : children, icon && iconPosition === 'right' && (jsxRuntimeExports.jsx("span", { className: "ml-2 flex items-center", children: icon }))] }));
681
- });
682
- Button$1.displayName = 'Button';
1
+ import { j as jsxRuntimeExports } from './jsx-runtime-BiC2V0nk.js';
2
+ import { createContext, useMemo, useContext } from 'react';
683
3
 
684
4
  // Generated ESM version of ua-parser-js
685
5
  // DO NOT EDIT THIS FILE!
@@ -2164,840 +1484,4 @@ const useMobile = (isMobile) => {
2164
1484
  : { isMobile, userAgent: context.userAgent };
2165
1485
  };
2166
1486
 
2167
- const Input$1 = React.forwardRef(({ state = 'default', label, value, onChange, helperText, startIcon, endIcon, type = 'text', ...props }, ref) => {
2168
- const [isFocused, setIsFocused] = useState(false);
2169
- const id = useId();
2170
- const hasContent = value !== '' && value !== null && value !== undefined;
2171
- const isLabelFloated = isFocused || hasContent;
2172
- const isDisabled = state === 'disabled';
2173
- const { isMobile } = useMobile();
2174
- const handleFocus = (e) => {
2175
- if (!isDisabled) {
2176
- setIsFocused(true);
2177
- props.onFocus?.(e);
2178
- }
2179
- };
2180
- const handleBlur = (e) => {
2181
- if (!isDisabled) {
2182
- setIsFocused(false);
2183
- props.onBlur?.(e);
2184
- }
2185
- };
2186
- const baseContainerClasses = 'relative flex items-center border rounded-lg transition-all duration-300 w-[360px]';
2187
- const baseLabelClasses = 'absolute pointer-events-none transition-all duration-300';
2188
- const baseInputClasses = 'peer w-full h-full bg-transparent outline-none text-m font-medium disabled:text-neutral-light';
2189
- const baseIconClasses = 'absolute h-5 w-5 transition-colors duration-300';
2190
- const containerClasses = cn(baseContainerClasses, {
2191
- 'h-[54px]': !isMobile,
2192
- 'h-12': isMobile,
2193
- 'border-neutral-light': state === 'default' && !isFocused,
2194
- 'border-primary': state === 'default' && isFocused,
2195
- 'border-error': state === 'error',
2196
- 'bg-white border-neutral-light cursor-not-allowed': isDisabled,
2197
- });
2198
- const labelClasses = cn(baseLabelClasses, {
2199
- 'top-[-10px] bg-white px-1 mx-3 font-medium': isLabelFloated,
2200
- 'text-s': (!isMobile && isLabelFloated) || (isMobile && !isLabelFloated),
2201
- 'text-xs': isMobile && isLabelFloated,
2202
- 'text-m': !isMobile && !isLabelFloated,
2203
- 'right-1': startIcon,
2204
- 'right-3': !startIcon,
2205
- 'top-1/2 -translate-y-1/2 text-m font-medium': !isLabelFloated,
2206
- 'right-11': !isLabelFloated && startIcon,
2207
- 'right-4': !isLabelFloated && !startIcon,
2208
- 'text-neutral-main': !isFocused && state === 'default',
2209
- 'text-neutral-light': isDisabled,
2210
- 'text-primary': isFocused && state === 'default',
2211
- 'text-error': isLabelFloated && state === 'error',
2212
- });
2213
- const inputClasses = cn(baseInputClasses, {
2214
- 'pr-12': startIcon,
2215
- 'pl-12': endIcon,
2216
- 'px-4': !startIcon && !endIcon,
2217
- 'pr-4 pl-12': !startIcon && endIcon,
2218
- 'pl-4 pr-12': startIcon && !endIcon,
2219
- 'cursor-not-allowed text-red-500': isDisabled,
2220
- 'text-neutral-dark': !isFocused,
2221
- 'text-neutral-darker': isFocused,
2222
- });
2223
- const iconClasses = cn(baseIconClasses, {
2224
- 'text-neutral-main': state !== 'error' && !isFocused,
2225
- 'text-primary': state === 'default' && isFocused,
2226
- 'text-error': state === 'error',
2227
- 'text-neutral-light': isDisabled,
2228
- });
2229
- const helperTextClasses = cn('font-light mt-1 px-2 h-4', {
2230
- 'text-s': !isMobile,
2231
- 'text-xs': isMobile,
2232
- 'text-neutral-main': state === 'default',
2233
- 'text-primary': state === 'default' && isFocused,
2234
- 'text-error': state === 'error',
2235
- 'text-neutral-light': isDisabled,
2236
- });
2237
- return (jsxRuntimeExports.jsxs("div", { children: [jsxRuntimeExports.jsxs("div", { className: containerClasses, children: [endIcon && (jsxRuntimeExports.jsx("span", { className: cn(iconClasses, 'left-4'), children: endIcon })), jsxRuntimeExports.jsx("label", { htmlFor: id, className: labelClasses, children: label }), jsxRuntimeExports.jsx("input", { ref: ref, id: id, type: type, value: value, onChange: onChange, onFocus: handleFocus, onBlur: handleBlur, disabled: isDisabled, className: inputClasses, ...props }), startIcon && (jsxRuntimeExports.jsx("span", { className: cn(iconClasses, 'right-4'), children: startIcon }))] }), helperText && jsxRuntimeExports.jsx("p", { className: helperTextClasses, children: helperText })] }));
2238
- });
2239
- Input$1.displayName = 'Input';
2240
-
2241
- // Helper functions moved outside component
2242
- const handleTabClick = (tabId, disabled, onTabChange) => {
2243
- if (!disabled) {
2244
- onTabChange(tabId);
2245
- }
2246
- };
2247
- const handleKeyDown = (e, tabId, disabled, onTabChange) => {
2248
- if ((e.key === 'Enter' || e.key === ' ') && !disabled) {
2249
- e.preventDefault();
2250
- onTabChange(tabId);
2251
- }
2252
- };
2253
- const renderBadge = (count, isActive, disabled, isMobile) => {
2254
- if (count === undefined)
2255
- return null;
2256
- return (jsxRuntimeExports.jsx("div", { className: cn('flex items-center justify-center rounded-[5px] font-sans font-bold text-white', 'transition-colors duration-200', isMobile
2257
- ? 'size-6 text-[14px] pt-0.5'
2258
- : 'size-[25px] text-[14px] pt-[3px]', disabled ? 'bg-midnight' : isActive ? 'bg-primary' : 'bg-neutral-main'), children: jsxRuntimeExports.jsx("p", { className: "leading-[24px] whitespace-pre", dir: "auto", children: count }) }));
2259
- };
2260
- const renderTabContent = (item, isActive, isMobile) => {
2261
- const hasCount = item.count !== undefined;
2262
- return (jsxRuntimeExports.jsxs("div", { className: cn('flex flex-row items-center justify-start transition-colors duration-200', isMobile ? 'gap-1.5' : 'gap-1.5'), children: [hasCount && renderBadge(item.count, isActive, item.disabled, isMobile), jsxRuntimeExports.jsx("div", { className: cn('font-sans text-nowrap text-right transition-colors duration-200', isMobile ? 'text-[14px]' : isActive ? 'text-[16px]' : 'text-[18px]', item.disabled
2263
- ? 'font-normal text-midnight'
2264
- : isActive
2265
- ? 'font-bold text-primary'
2266
- : 'font-normal text-neutral-main', isMobile
2267
- ? 'leading-[24px]'
2268
- : isActive
2269
- ? 'leading-normal'
2270
- : 'leading-[1.9]'), children: jsxRuntimeExports.jsx("p", { className: "whitespace-pre", dir: "auto", children: item.label }) })] }));
2271
- };
2272
- const renderTab = (item, activeTab, isMobile, onTabChange) => {
2273
- const isActive = item.id === activeTab;
2274
- return (jsxRuntimeExports.jsxs("div", { className: cn('box-border flex flex-col items-center justify-between relative shrink-0', 'cursor-pointer transition-all duration-200', isMobile ? 'h-12 px-3' : 'h-14 px-4', isActive
2275
- ? isMobile
2276
- ? 'pt-[11px] pb-0'
2277
- : 'pt-3.5 pb-0'
2278
- : 'py-0 justify-center', item.disabled && 'cursor-not-allowed opacity-50', !item.disabled && 'hover:opacity-80'), onClick: () => handleTabClick(item.id, item.disabled, onTabChange), onKeyDown: (e) => handleKeyDown(e, item.id, item.disabled, onTabChange), tabIndex: item.disabled ? -1 : 0, role: "tab", "aria-selected": isActive, "aria-disabled": item.disabled, children: [renderTabContent(item, isActive, isMobile), isActive && (jsxRuntimeExports.jsx("div", { className: "bg-primary h-1 rounded-tl-[8px] rounded-tr-[8px] shrink-0 w-full" }))] }, item.id));
2279
- };
2280
- const Tabs$1 = React.forwardRef(({ items, activeTab, onTabChange, className, isMobile: isMobileProp, ...props }, ref) => {
2281
- const { isMobile } = useMobile(isMobileProp);
2282
- return (jsxRuntimeExports.jsxs("div", { ref: ref, className: cn('relative w-full', className), ...props, children: [jsxRuntimeExports.jsx("div", { className: "box-border flex flex-row items-center justify-end p-0 relative w-full", children: items.map((item) => renderTab(item, activeTab, isMobile, onTabChange)) }), jsxRuntimeExports.jsx("div", { className: "absolute border-midnight-light border-[0px_0px_1px] border-solid bottom-[-0.5px] left-0 right-0 top-0 pointer-events-none" })] }));
2283
- });
2284
- Tabs$1.displayName = 'Tabs';
2285
-
2286
- const Drawer$1 = React.forwardRef(({ children, direction = 'bottom', fullScreen = false, isOpen = false, onClose, className, ...props }, ref) => {
2287
- const overlayRef = useRef(null);
2288
- const drawerRef = useRef(null);
2289
- const { isMobile } = useMobile();
2290
- // Handle escape key
2291
- useEffect(() => {
2292
- const handleEscape = (event) => {
2293
- if (event.key === 'Escape' && isOpen && onClose) {
2294
- onClose();
2295
- }
2296
- };
2297
- if (isOpen) {
2298
- document.addEventListener('keydown', handleEscape);
2299
- // Prevent body scroll when drawer is open
2300
- document.body.style.overflow = 'hidden';
2301
- }
2302
- return () => {
2303
- document.removeEventListener('keydown', handleEscape);
2304
- document.body.style.overflow = 'auto';
2305
- };
2306
- }, [isOpen, onClose]);
2307
- // Handle click outside
2308
- const handleOverlayClick = (event) => {
2309
- if (!fullScreen &&
2310
- onClose &&
2311
- overlayRef.current &&
2312
- event.target === overlayRef.current) {
2313
- onClose();
2314
- }
2315
- };
2316
- // Handle keyboard events on overlay
2317
- const handleOverlayKeyDown = (event) => {
2318
- if (event.key === 'Enter' || event.key === ' ') {
2319
- if (!fullScreen &&
2320
- onClose &&
2321
- overlayRef.current &&
2322
- event.target === overlayRef.current) {
2323
- onClose();
2324
- }
2325
- }
2326
- };
2327
- const getTranslateClasses = () => {
2328
- if (!isOpen) {
2329
- switch (direction) {
2330
- case 'top':
2331
- return '-translate-y-full';
2332
- case 'bottom':
2333
- return 'translate-y-full';
2334
- case 'left':
2335
- return '-translate-x-full';
2336
- case 'right':
2337
- return 'translate-x-full';
2338
- default:
2339
- return 'translate-y-full';
2340
- }
2341
- }
2342
- return 'translate-x-0 translate-y-0';
2343
- };
2344
- const getPositionClasses = () => {
2345
- switch (direction) {
2346
- case 'top':
2347
- return 'top-0 left-0 right-0';
2348
- case 'bottom':
2349
- return 'bottom-0 left-0 right-0';
2350
- case 'left':
2351
- return 'top-0 left-0 bottom-0';
2352
- case 'right':
2353
- return 'top-0 right-0 bottom-0';
2354
- default:
2355
- return 'bottom-0 left-0 right-0';
2356
- }
2357
- };
2358
- const getSizeClasses = () => {
2359
- const isVertical = direction === 'top' || direction === 'bottom';
2360
- if (fullScreen) {
2361
- return isVertical ? 'w-full h-full' : 'w-full h-full';
2362
- }
2363
- if (isVertical) {
2364
- return 'w-full max-h-[90vh]';
2365
- }
2366
- return 'h-full max-w-[90vw]';
2367
- };
2368
- const baseOverlayClasses = 'fixed inset-0 z-50 transition-all duration-300';
2369
- const baseDrawerClasses = 'fixed bg-white shadow-2xl transition-all duration-300 ease-out overflow-auto';
2370
- const overlayClasses = cn(baseOverlayClasses, {
2371
- 'bg-neutral-darker/50 backdrop-blur-sm': isOpen,
2372
- 'bg-transparent pointer-events-none': !isOpen,
2373
- });
2374
- const drawerClasses = cn(baseDrawerClasses, getPositionClasses(), getSizeClasses(), getTranslateClasses(), {
2375
- 'rounded-t-2xl': direction === 'bottom' && !fullScreen,
2376
- 'rounded-b-2xl': direction === 'top' && !fullScreen,
2377
- 'rounded-r-2xl': direction === 'left' && !fullScreen,
2378
- 'rounded-l-2xl': direction === 'right' && !fullScreen,
2379
- 'p-6': !isMobile,
2380
- 'p-4': isMobile,
2381
- }, className);
2382
- if (!isOpen) {
2383
- return null;
2384
- }
2385
- return (jsxRuntimeExports.jsx("div", { ref: overlayRef, className: overlayClasses, onClick: handleOverlayClick, onKeyDown: handleOverlayKeyDown, tabIndex: -1, role: "button", "aria-label": "Close drawer", children: jsxRuntimeExports.jsx("div", { ref: ref || drawerRef, className: drawerClasses, role: "dialog", "aria-modal": "true", "aria-label": "Drawer", ...props, children: children }) }));
2386
- });
2387
- Drawer$1.displayName = 'Drawer';
2388
-
2389
- const Backdrop$1 = React.forwardRef(({ isOpen = false, onClick, blur = false, zIndex = 51, className, children, ...props }, ref) => {
2390
- const handleClick = (event) => {
2391
- if (onClick && event.target === event.currentTarget) {
2392
- onClick();
2393
- }
2394
- };
2395
- const backdropClasses = cn('fixed inset-0 transition-all duration-300', {
2396
- 'opacity-100 pointer-events-auto': isOpen,
2397
- 'opacity-0 pointer-events-none': !isOpen,
2398
- 'backdrop-blur-sm': blur,
2399
- }, className);
2400
- const backdropStyle = {
2401
- backgroundColor: 'rgba(0, 0, 0, 0.60)',
2402
- zIndex,
2403
- };
2404
- return (jsxRuntimeExports.jsx("div", { ref: ref, className: backdropClasses, style: backdropStyle, onClick: handleClick, role: "presentation", "aria-hidden": !isOpen, ...props, children: children }));
2405
- });
2406
- Backdrop$1.displayName = 'Backdrop';
2407
-
2408
- /**
2409
- * @license lucide-react v0.522.0 - ISC
2410
- *
2411
- * This source code is licensed under the ISC license.
2412
- * See the LICENSE file in the root directory of this source tree.
2413
- */
2414
-
2415
- const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
2416
- const toCamelCase = (string) => string.replace(
2417
- /^([A-Z])|[\s-_]+(\w)/g,
2418
- (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
2419
- );
2420
- const toPascalCase = (string) => {
2421
- const camelCase = toCamelCase(string);
2422
- return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
2423
- };
2424
- const mergeClasses = (...classes) => classes.filter((className, index, array) => {
2425
- return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
2426
- }).join(" ").trim();
2427
- const hasA11yProp = (props) => {
2428
- for (const prop in props) {
2429
- if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
2430
- return true;
2431
- }
2432
- }
2433
- };
2434
-
2435
- /**
2436
- * @license lucide-react v0.522.0 - ISC
2437
- *
2438
- * This source code is licensed under the ISC license.
2439
- * See the LICENSE file in the root directory of this source tree.
2440
- */
2441
-
2442
- var defaultAttributes = {
2443
- xmlns: "http://www.w3.org/2000/svg",
2444
- width: 24,
2445
- height: 24,
2446
- viewBox: "0 0 24 24",
2447
- fill: "none",
2448
- stroke: "currentColor",
2449
- strokeWidth: 2,
2450
- strokeLinecap: "round",
2451
- strokeLinejoin: "round"
2452
- };
2453
-
2454
- /**
2455
- * @license lucide-react v0.522.0 - ISC
2456
- *
2457
- * This source code is licensed under the ISC license.
2458
- * See the LICENSE file in the root directory of this source tree.
2459
- */
2460
-
2461
-
2462
- const Icon = forwardRef(
2463
- ({
2464
- color = "currentColor",
2465
- size = 24,
2466
- strokeWidth = 2,
2467
- absoluteStrokeWidth,
2468
- className = "",
2469
- children,
2470
- iconNode,
2471
- ...rest
2472
- }, ref) => createElement(
2473
- "svg",
2474
- {
2475
- ref,
2476
- ...defaultAttributes,
2477
- width: size,
2478
- height: size,
2479
- stroke: color,
2480
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
2481
- className: mergeClasses("lucide", className),
2482
- ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
2483
- ...rest
2484
- },
2485
- [
2486
- ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
2487
- ...Array.isArray(children) ? children : [children]
2488
- ]
2489
- )
2490
- );
2491
-
2492
- /**
2493
- * @license lucide-react v0.522.0 - ISC
2494
- *
2495
- * This source code is licensed under the ISC license.
2496
- * See the LICENSE file in the root directory of this source tree.
2497
- */
2498
-
2499
-
2500
- const createLucideIcon = (iconName, iconNode) => {
2501
- const Component = forwardRef(
2502
- ({ className, ...props }, ref) => createElement(Icon, {
2503
- ref,
2504
- iconNode,
2505
- className: mergeClasses(
2506
- `lucide-${toKebabCase(toPascalCase(iconName))}`,
2507
- `lucide-${iconName}`,
2508
- className
2509
- ),
2510
- ...props
2511
- })
2512
- );
2513
- Component.displayName = toPascalCase(iconName);
2514
- return Component;
2515
- };
2516
-
2517
- /**
2518
- * @license lucide-react v0.522.0 - ISC
2519
- *
2520
- * This source code is licensed under the ISC license.
2521
- * See the LICENSE file in the root directory of this source tree.
2522
- */
2523
-
2524
-
2525
- const __iconNode$7 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
2526
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$7);
2527
-
2528
- /**
2529
- * @license lucide-react v0.522.0 - ISC
2530
- *
2531
- * This source code is licensed under the ISC license.
2532
- * See the LICENSE file in the root directory of this source tree.
2533
- */
2534
-
2535
-
2536
- const __iconNode$6 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
2537
- const ChevronLeft = createLucideIcon("chevron-left", __iconNode$6);
2538
-
2539
- /**
2540
- * @license lucide-react v0.522.0 - ISC
2541
- *
2542
- * This source code is licensed under the ISC license.
2543
- * See the LICENSE file in the root directory of this source tree.
2544
- */
2545
-
2546
-
2547
- const __iconNode$5 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
2548
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$5);
2549
-
2550
- /**
2551
- * @license lucide-react v0.522.0 - ISC
2552
- *
2553
- * This source code is licensed under the ISC license.
2554
- * See the LICENSE file in the root directory of this source tree.
2555
- */
2556
-
2557
-
2558
- const __iconNode$4 = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
2559
- const ChevronUp = createLucideIcon("chevron-up", __iconNode$4);
2560
-
2561
- /**
2562
- * @license lucide-react v0.522.0 - ISC
2563
- *
2564
- * This source code is licensed under the ISC license.
2565
- * See the LICENSE file in the root directory of this source tree.
2566
- */
2567
-
2568
-
2569
- const __iconNode$3 = [
2570
- ["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
2571
- ["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
2572
- ];
2573
- const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$3);
2574
-
2575
- /**
2576
- * @license lucide-react v0.522.0 - ISC
2577
- *
2578
- * This source code is licensed under the ISC license.
2579
- * See the LICENSE file in the root directory of this source tree.
2580
- */
2581
-
2582
-
2583
- const __iconNode$2 = [
2584
- ["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
2585
- ["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
2586
- ];
2587
- const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$2);
2588
-
2589
- /**
2590
- * @license lucide-react v0.522.0 - ISC
2591
- *
2592
- * This source code is licensed under the ISC license.
2593
- * See the LICENSE file in the root directory of this source tree.
2594
- */
2595
-
2596
-
2597
- const __iconNode$1 = [
2598
- ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
2599
- ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
2600
- ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
2601
- ];
2602
- const Ellipsis = createLucideIcon("ellipsis", __iconNode$1);
2603
-
2604
- /**
2605
- * @license lucide-react v0.522.0 - ISC
2606
- *
2607
- * This source code is licensed under the ISC license.
2608
- * See the LICENSE file in the root directory of this source tree.
2609
- */
2610
-
2611
-
2612
- const __iconNode = [
2613
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
2614
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
2615
- ];
2616
- const X = createLucideIcon("x", __iconNode);
2617
-
2618
- const Breadcrumb$1 = React.forwardRef(({ items, className, testIsMobile }, ref) => {
2619
- const { isMobile } = useMobile(testIsMobile);
2620
- const handleItemClick = (item, index, e) => {
2621
- // Don't make the last item (current page) clickable
2622
- if (index === items.length - 1)
2623
- return;
2624
- if (item.onClick) {
2625
- e.preventDefault();
2626
- item.onClick();
2627
- }
2628
- // If item has href, let the anchor tag handle navigation naturally
2629
- };
2630
- return (jsxRuntimeExports.jsx("nav", { ref: ref, className: cn(
2631
- // Base layout - RTL with flex-row-reverse to show items right to left
2632
- 'flex flex-row-reverse items-center',
2633
- // Responsive gap and padding based on mobile state
2634
- isMobile ? 'gap-1 px-4 py-2.5' : 'gap-3 pr-1 pt-3 pb-4 pl-0', className), "aria-label": "Breadcrumb navigation", children: jsxRuntimeExports.jsx("ol", { className: "flex flex-row-reverse items-center gap-inherit", children: items.map((item, index) => {
2635
- const isLast = index === items.length - 1;
2636
- const isClickable = !isLast && (item.href || item.onClick);
2637
- const itemKey = `${item.label}-${index}`;
2638
- return (jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-inherit", children: [isClickable ? (jsxRuntimeExports.jsx("a", { href: item.href || '#', className: cn(
2639
- // Base styles
2640
- 'whitespace-nowrap border-0 bg-transparent p-0 no-underline',
2641
- // Responsive font size based on mobile state
2642
- isMobile ? 'text-t' : 'text-s',
2643
- // Color
2644
- 'text-neutral-main',
2645
- // Cursor and hover effects for clickable items
2646
- 'cursor-pointer hover:text-neutral-dark transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-sm'), onClick: (e) => handleItemClick(item, index, e), onKeyDown: (e) => {
2647
- if (e.key === 'Enter' || e.key === ' ') {
2648
- e.preventDefault();
2649
- if (item.onClick) {
2650
- item.onClick();
2651
- }
2652
- }
2653
- }, "aria-label": `Go to ${item.label}`, children: item.label })) : (jsxRuntimeExports.jsx("span", { className: cn(
2654
- // Base styles
2655
- 'whitespace-nowrap',
2656
- // Responsive font size based on mobile state
2657
- isMobile ? 'text-t' : 'text-s',
2658
- // Color
2659
- 'text-neutral-main',
2660
- // Different styles for current page (last item)
2661
- 'font-medium'), "aria-current": isLast ? 'page' : undefined, "aria-label": isLast ? `Current page: ${item.label}` : undefined, children: item.label })), !isLast && (jsxRuntimeExports.jsx(ChevronLeft, { className: cn('text-black flex-shrink-0',
2662
- // Responsive icon size
2663
- isMobile ? 'w-2.5 h-2.5' : 'w-3 h-3'), "aria-hidden": "true" }))] }, itemKey));
2664
- }) }) }));
2665
- });
2666
- Breadcrumb$1.displayName = 'Breadcrumb';
2667
-
2668
- function PaginationRoot({ className, ...props }) {
2669
- return (jsxRuntimeExports.jsx("nav", { role: "navigation", "aria-label": "pagination", "data-slot": "pagination", className: cn('mx-auto flex w-full justify-center', className), ...props }));
2670
- }
2671
- function PaginationContent({ className, device, ...props }) {
2672
- return (jsxRuntimeExports.jsx("ul", { "data-slot": "pagination-content", className: cn('flex flex-row items-center', device === 'mobile' ? 'gap-[6px]' : 'gap-2', className), ...props }));
2673
- }
2674
- function PaginationItem({ ...props }) {
2675
- return jsxRuntimeExports.jsx("li", { "data-slot": "pagination-item", ...props });
2676
- }
2677
- function PaginationLink({ className, device, variant, isActive, ...props }) {
2678
- return (jsxRuntimeExports.jsx("a", { "aria-current": isActive ? 'page' : undefined, "data-slot": "pagination-link", "data-active": isActive, className: cn(buttonVariants({
2679
- variant: variant === 'nextPrev' ? variant : isActive ? 'active' : 'outline',
2680
- device,
2681
- }), className), tabIndex: props['aria-disabled'] ? -1 : 0, ...props }));
2682
- }
2683
- function PaginationPrevious({ className, device, variant, ...props }) {
2684
- const isMobile = device === 'mobile';
2685
- const content = {
2686
- mobile: jsxRuntimeExports.jsx(ChevronRight, { size: 18 }),
2687
- desktop: (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(ChevronsRight, { size: 20 }), " ", jsxRuntimeExports.jsx("span", { children: "\u0642\u0628\u0644\u06CC" })] })),
2688
- };
2689
- return (jsxRuntimeExports.jsx(PaginationLink, { "aria-label": "Go to previous page", className: !isMobile
2690
- ? 'flex justify-center items-center gap-2 w-[89px] h-[48px] ml-4'
2691
- : 'ml-2.5', device: device, variant: "nextPrev", ...props, children: device === 'mobile' ? content.mobile : content.desktop }));
2692
- }
2693
- function PaginationNext({ className, device, variant, ...props }) {
2694
- const isMobile = device === 'mobile';
2695
- const content = {
2696
- mobile: jsxRuntimeExports.jsx(ChevronLeft, { size: 18 }),
2697
- desktop: (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("span", { children: "\u0628\u0639\u062F\u06CC" }), jsxRuntimeExports.jsx(ChevronsLeft, { size: 20 })] })),
2698
- };
2699
- return (jsxRuntimeExports.jsx(PaginationLink, { "aria-label": "Go to next page", className: !isMobile
2700
- ? 'flex justify-center items-center gap-2 w-[89px] h-[48px] mr-4'
2701
- : 'mr-2.5', device: device, variant: "nextPrev", ...props, children: device === 'mobile' ? content.mobile : content.desktop }));
2702
- }
2703
- function PaginationEllipsis({ className, ...props }) {
2704
- return (jsxRuntimeExports.jsx("span", { "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn('flex size-9 items-center justify-center', className), ...props, children: jsxRuntimeExports.jsx(Ellipsis, { className: "size-4" }) }));
2705
- }
2706
- function buttonVariants({ variant, device, }) {
2707
- const isMobile = device === 'mobile';
2708
- const base = cn({
2709
- 'flex items-center justify-center rounded-[6px]': true,
2710
- 'w-[40px] h-[40px] text-s font-heavy': isMobile,
2711
- 'w-[48px] h-[48px] text-l font-heavy': !isMobile,
2712
- });
2713
- const variants = {
2714
- outline: 'border border-neutral-light bg-white text-neutral-darker',
2715
- active: 'bg-primary text-white',
2716
- nextPrev: 'border border-neutral-light bg-white text-neutral-darker',
2717
- };
2718
- return [base, variants[variant]].join(' ');
2719
- }
2720
- const Pagination$1 = ({ pageCount, page: controlledPage, defaultPage = 1, onPageChange, className, ...navProps }) => {
2721
- const isControlled = controlledPage !== undefined;
2722
- const [internalPage, setInternalPage] = useState(defaultPage);
2723
- const page = isControlled ? controlledPage : internalPage;
2724
- const { isMobile } = useMobile();
2725
- const device = isMobile ? 'mobile' : 'desktop';
2726
- useEffect(() => {
2727
- if (!isControlled)
2728
- setInternalPage(defaultPage);
2729
- }, [defaultPage, isControlled]);
2730
- const changePage = (newPage) => {
2731
- if (!isControlled)
2732
- setInternalPage(newPage);
2733
- onPageChange?.(newPage);
2734
- };
2735
- function renderPages() {
2736
- const items = [];
2737
- if (pageCount <= 5) {
2738
- for (let i = 1; i <= pageCount; i++) {
2739
- items.push(jsxRuntimeExports.jsx(PaginationItem, { children: jsxRuntimeExports.jsx(PaginationLink, { href: "#", isActive: page === i, variant: "main", device: device, onClick: (e) => {
2740
- e.preventDefault();
2741
- if (page !== i)
2742
- changePage(i);
2743
- }, "aria-disabled": page === i, tabIndex: page === i ? -1 : 0, children: i }) }, i));
2744
- }
2745
- }
2746
- else {
2747
- // First page
2748
- items.push(jsxRuntimeExports.jsx(PaginationItem, { children: jsxRuntimeExports.jsx(PaginationLink, { href: "#", isActive: page === 1, device: device, variant: "main", onClick: (e) => {
2749
- e.preventDefault();
2750
- if (page !== 1)
2751
- changePage(1);
2752
- }, "aria-disabled": page === 1, tabIndex: page === 1 ? -1 : 0, children: "1" }) }, 1));
2753
- // Ellipsis start
2754
- if (page > 3) {
2755
- items.push(jsxRuntimeExports.jsx(PaginationItem, { children: jsxRuntimeExports.jsx(PaginationEllipsis, {}) }, "start-ellipsis"));
2756
- }
2757
- // Middle pages
2758
- const start = Math.max(2, page - 1);
2759
- const end = Math.min(pageCount - 1, page + 1);
2760
- for (let i = start; i <= end; i++) {
2761
- items.push(jsxRuntimeExports.jsx(PaginationItem, { children: jsxRuntimeExports.jsx(PaginationLink, { href: "#", isActive: page === i, device: device, variant: "main", onClick: (e) => {
2762
- e.preventDefault();
2763
- if (page !== i)
2764
- changePage(i);
2765
- }, "aria-disabled": page === i, tabIndex: page === i ? -1 : 0, children: i }) }, i));
2766
- }
2767
- // Ellipsis end
2768
- if (page < pageCount - 2) {
2769
- items.push(jsxRuntimeExports.jsx(PaginationItem, { children: jsxRuntimeExports.jsx(PaginationEllipsis, {}) }, "end-ellipsis"));
2770
- }
2771
- // Last page
2772
- items.push(jsxRuntimeExports.jsx(PaginationItem, { children: jsxRuntimeExports.jsx(PaginationLink, { href: "#", isActive: page === pageCount, device: device, variant: "main", onClick: (e) => {
2773
- e.preventDefault();
2774
- if (page !== pageCount)
2775
- changePage(pageCount);
2776
- }, "aria-disabled": page === pageCount, tabIndex: page === pageCount ? -1 : 0, children: pageCount }) }, pageCount));
2777
- }
2778
- return items;
2779
- }
2780
- return (jsxRuntimeExports.jsx(PaginationRoot, { className: className, ...navProps, children: jsxRuntimeExports.jsxs(PaginationContent, { device: "mobile", children: [jsxRuntimeExports.jsx(PaginationItem, { children: jsxRuntimeExports.jsx(PaginationPrevious, { href: "#", onClick: (e) => {
2781
- e.preventDefault();
2782
- if (page > 1)
2783
- changePage(page - 1);
2784
- }, variant: "nextPrev", device: device, "aria-disabled": page === 1, tabIndex: page === 1 ? -1 : 0 }) }), renderPages(), jsxRuntimeExports.jsx(PaginationItem, { children: jsxRuntimeExports.jsx(PaginationNext, { href: "#", onClick: (e) => {
2785
- e.preventDefault();
2786
- if (page < pageCount)
2787
- changePage(page + 1);
2788
- }, variant: "nextPrev", device: device, "aria-disabled": page === pageCount, tabIndex: page === pageCount ? -1 : 0 }) })] }) }));
2789
- };
2790
-
2791
- const Accordion$1 = React.forwardRef(({ title, body, startIcon, isExpanded: controlledExpanded, onToggle, defaultExpanded = false, className, id, disabled = false, forceMobile, ...props }, ref) => {
2792
- const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);
2793
- const { isMobile: contextIsMobile } = useMobile();
2794
- // Use forceMobile prop if provided, otherwise use context
2795
- const isMobile = forceMobile !== undefined ? forceMobile : contextIsMobile;
2796
- // Use controlled state if provided, otherwise use internal state
2797
- const isExpanded = controlledExpanded !== undefined ? controlledExpanded : internalExpanded;
2798
- const handleToggle = () => {
2799
- if (disabled)
2800
- return;
2801
- const newExpanded = !isExpanded;
2802
- if (controlledExpanded === undefined) {
2803
- setInternalExpanded(newExpanded);
2804
- }
2805
- onToggle?.(newExpanded);
2806
- };
2807
- const accordionId = id || `accordion-${Math.random().toString(36).substr(2, 9)}`;
2808
- const headerId = `${accordionId}-header`;
2809
- const contentId = `${accordionId}-content`;
2810
- // Icon size based on device
2811
- const iconSize = isMobile ? 20 : 24;
2812
- // Typography variants based on device
2813
- const titleVariant = isMobile ? 'body-s-heavy' : 'body-l-heavy';
2814
- const bodyVariant = isMobile ? 'body-s-medium' : 'body-m-medium';
2815
- return (jsxRuntimeExports.jsxs("div", { ref: ref, className: cn('rounded-2xl border-0 overflow-hidden', 'transition-all duration-200 ease-in-out', className), ...props, children: [jsxRuntimeExports.jsxs("button", { id: headerId, type: "button", onClick: handleToggle, disabled: disabled, "aria-expanded": isExpanded, "aria-controls": contentId, className: cn('w-full flex items-center justify-between', isMobile ? 'p-3' : 'p-4', 'focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2', 'disabled:opacity-50 disabled:cursor-not-allowed', 'transition-all duration-200 ease-in-out', !disabled && 'hover:bg-neutral-lighter'), children: [jsxRuntimeExports.jsx("div", { className: "flex-shrink-0 mr-4", children: isExpanded ? (jsxRuntimeExports.jsx(ChevronUp, { size: iconSize, className: "text-neutral-darker transition-transform duration-200", "aria-hidden": "true" })) : (jsxRuntimeExports.jsx(ChevronDown, { size: iconSize, className: "text-neutral-darker transition-transform duration-200", "aria-hidden": "true" })) }), jsxRuntimeExports.jsxs("div", { className: cn('flex items-center flex-1', isMobile ? 'gap-3' : 'gap-4'), children: [jsxRuntimeExports.jsx("div", { className: "flex-1 text-right", children: jsxRuntimeExports.jsx(Typography$1, { variant: titleVariant, color: "neutral-darker", children: title }) }), startIcon && (jsxRuntimeExports.jsx("div", { className: cn('flex-shrink-0 flex items-center justify-center', isMobile ? 'w-6 h-6' : 'w-8 h-8'), children: startIcon }))] })] }), jsxRuntimeExports.jsx("div", { id: contentId, role: "region", "aria-labelledby": headerId, className: cn('w-full overflow-hidden transition-all duration-300 ease-in-out', isExpanded ? 'max-h-screen opacity-100' : 'max-h-0 opacity-0'), children: jsxRuntimeExports.jsx("div", { className: cn(isMobile ? 'pb-3 mt-1' : 'pb-4 mt-1.5'), children: jsxRuntimeExports.jsx("div", { className: cn('bg-neutral-lighter rounded-lg', isMobile ? 'p-3' : 'p-4'), children: jsxRuntimeExports.jsx(Typography$1, { variant: bodyVariant, color: "neutral-dark", children: body }) }) }) })] }));
2816
- });
2817
- Accordion$1.displayName = 'Accordion';
2818
-
2819
- const Divider$1 = React.forwardRef(({ width = '100%', height = 1, orientation = 'horizontal', variant = 'neutral-light', className, style, ...props }, ref) => {
2820
- const isHorizontal = orientation === 'horizontal';
2821
- const variantClasses = {
2822
- 'neutral-light': 'bg-neutral-light',
2823
- 'neutral-main': 'bg-neutral-main',
2824
- primary: 'bg-primary',
2825
- };
2826
- const dividerStyle = {
2827
- width: isHorizontal ? width : height,
2828
- height: isHorizontal ? height : width,
2829
- ...style,
2830
- };
2831
- return (jsxRuntimeExports.jsx("div", { ref: ref, className: cn('shrink-0', variantClasses[variant], className), style: dividerStyle, role: "separator", ...props }));
2832
- });
2833
- Divider$1.displayName = 'Divider';
2834
-
2835
- const RadioButton = ({ selected, disabled, isMobile, }) => {
2836
- const size = isMobile ? 'size-5' : 'size-6';
2837
- if (selected) {
2838
- return (jsxRuntimeExports.jsxs("div", { className: cn('relative flex items-center justify-center', size), children: [jsxRuntimeExports.jsx("div", { className: cn('absolute inset-0 rounded-full border-2', disabled
2839
- ? 'bg-neutral-light border-neutral-light'
2840
- : 'bg-primary border-primary') }), jsxRuntimeExports.jsx("div", { className: cn('absolute rounded-full bg-white', isMobile ? 'inset-[5px]' : 'inset-1.5') })] }));
2841
- }
2842
- return (jsxRuntimeExports.jsx("div", { className: cn('relative flex items-center justify-center', size), children: jsxRuntimeExports.jsx("div", { className: cn('absolute inset-0 rounded-full border', isMobile ? 'border' : 'border-[1.5px]', disabled ? 'border-neutral-light' : 'border-midnight') }) }));
2843
- };
2844
- const RadioOptionComponent = ({ option, selected, disabled, onClick, name, isMobile, }) => {
2845
- const [isHovered, setIsHovered] = React.useState(false);
2846
- const handleKeyDown = (e) => {
2847
- if ((e.key === 'Enter' || e.key === ' ') && !disabled) {
2848
- e.preventDefault();
2849
- onClick();
2850
- }
2851
- };
2852
- const getBackgroundColor = () => {
2853
- if (disabled)
2854
- return 'bg-neutral-lighter';
2855
- if (selected)
2856
- return 'bg-primary-lightest';
2857
- if (isHovered)
2858
- return 'bg-primary-lightest/20';
2859
- return 'bg-white';
2860
- };
2861
- const getBorderColor = () => {
2862
- if (selected)
2863
- return 'border-primary';
2864
- return 'border-transparent';
2865
- };
2866
- const getTextColor = () => {
2867
- if (disabled)
2868
- return 'text-midnight';
2869
- if (selected)
2870
- return 'text-primary';
2871
- return 'text-neutral-dark';
2872
- };
2873
- const getShadow = () => {
2874
- if (disabled)
2875
- return '';
2876
- return 'shadow-[0px_2px_4px_0px_rgba(0,0,0,0.08)]';
2877
- };
2878
- return (jsxRuntimeExports.jsx("div", { className: cn('relative rounded-lg border-[1.5px] cursor-pointer transition-all duration-200', getBackgroundColor(), getBorderColor(), getShadow(), disabled && 'cursor-not-allowed'), onClick: disabled ? undefined : onClick, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onKeyDown: handleKeyDown, tabIndex: disabled ? -1 : 0, role: "radio", "aria-checked": selected, "aria-disabled": disabled, children: jsxRuntimeExports.jsx("div", { className: "flex flex-row items-center justify-end relative w-full", children: jsxRuntimeExports.jsx("div", { className: cn('box-border flex flex-row items-center justify-end relative w-full', isMobile ? 'gap-2 px-4 py-3' : 'gap-4 px-6 py-4'), children: jsxRuntimeExports.jsxs("div", { className: cn('flex flex-row items-center justify-end p-0 relative shrink-0', isMobile ? 'gap-2' : 'gap-3'), children: [jsxRuntimeExports.jsx("input", { type: "radio", name: name, value: option.id, checked: selected, disabled: disabled, onChange: onClick, className: "sr-only", "aria-label": option.label }), jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-0.5 items-end justify-start p-0 relative shrink-0", children: jsxRuntimeExports.jsx("div", { className: cn('font-sans font-bold text-nowrap text-right transition-colors duration-200', isMobile
2879
- ? 'text-[14px] leading-[24px]'
2880
- : 'text-[16px] leading-normal', getTextColor()), children: jsxRuntimeExports.jsx("p", { className: "whitespace-pre", dir: "auto", children: option.label }) }) }), option.icon && (jsxRuntimeExports.jsx("div", { className: cn('flex items-center justify-center shrink-0 transition-colors duration-200', isMobile ? 'size-6' : 'size-7', getTextColor()), children: option.icon })), jsxRuntimeExports.jsx("div", { className: "flex flex-col items-start justify-start p-0 relative shrink-0", children: jsxRuntimeExports.jsx(RadioButton, { selected: selected, disabled: disabled, isMobile: isMobile }) })] }) }) }) }));
2881
- };
2882
- const RadioGroup$1 = React.forwardRef(({ options, value, onChange, name, disabled = false, className, isMobile: isMobileProp, direction = 'vertical', ...props }, ref) => {
2883
- const { isMobile } = useMobile(isMobileProp);
2884
- const handleOptionClick = (optionId) => {
2885
- if (!disabled && onChange) {
2886
- onChange(optionId);
2887
- }
2888
- };
2889
- const getContainerClasses = () => {
2890
- if (direction === 'horizontal') {
2891
- return cn('flex flex-row gap-2', isMobile ? 'flex-wrap' : 'flex-nowrap', className);
2892
- }
2893
- return cn('flex flex-col gap-2', className);
2894
- };
2895
- return (jsxRuntimeExports.jsx("div", { ref: ref, className: getContainerClasses(), role: "radiogroup", ...props, children: options.map((option) => (jsxRuntimeExports.jsx(RadioOptionComponent, { option: option, selected: value === option.id, disabled: disabled || option.disabled, onClick: () => handleOptionClick(option.id), name: name, isMobile: isMobile }, option.id))) }));
2896
- });
2897
- RadioGroup$1.displayName = 'RadioGroup';
2898
-
2899
- const chipVariants = {
2900
- purple: {
2901
- background: 'bg-[var(--color-primary-lightest)]',
2902
- text: 'text-[var(--color-primary-darkest)]',
2903
- border: 'border-[var(--color-primary-light)]',
2904
- },
2905
- red: {
2906
- background: 'bg-[var(--color-error-light)]',
2907
- text: 'text-[var(--color-error)]',
2908
- border: 'border-[#f0d6d6]',
2909
- },
2910
- green: {
2911
- background: 'bg-[var(--color-success-light)]',
2912
- text: 'text-[var(--color-success)]',
2913
- border: 'border-[#d4e8dc]',
2914
- },
2915
- orange: {
2916
- background: 'bg-[var(--color-warning-light)]',
2917
- text: 'text-[var(--color-warning)]',
2918
- border: 'border-[#f5e1d1]',
2919
- },
2920
- blue: {
2921
- background: 'bg-[var(--color-info-light)]',
2922
- text: 'text-[var(--color-info)]',
2923
- border: 'border-[#d3e9f2]',
2924
- },
2925
- white: {
2926
- background: 'bg-[var(--color-white)]',
2927
- text: 'text-[var(--color-neutral-darker)]',
2928
- border: 'border-[var(--color-neutral-light)]',
2929
- },
2930
- disabled: {
2931
- background: 'bg-[var(--color-neutral-lighter)]',
2932
- text: 'text-[var(--color-neutral-main)]',
2933
- border: 'border-[var(--color-neutral-light)]',
2934
- },
2935
- };
2936
- const chipSizes = {
2937
- mobile: {
2938
- padding: 'px-2.5 py-1',
2939
- gap: 'gap-1',
2940
- iconSize: 'size-4',
2941
- fontSize: 'text-[12px]',
2942
- lineHeight: 'leading-[1.8]',
2943
- },
2944
- desktop: {
2945
- padding: 'px-3 py-1',
2946
- gap: 'gap-1.5',
2947
- iconSize: 'size-5',
2948
- fontSize: 'text-[14px]',
2949
- lineHeight: 'leading-[24px]',
2950
- },
2951
- };
2952
- const Chips$1 = React.forwardRef(({ variant = 'purple', size, children = 'متن پیشفرض', disabled = false, onClick, onIconClick, className, isMobile: isMobileProp, ...props }, ref) => {
2953
- const { isMobile } = useMobile(isMobileProp);
2954
- const actualSize = size || (isMobile ? 'mobile' : 'desktop');
2955
- const actualVariant = disabled ? 'disabled' : variant;
2956
- const variantStyles = chipVariants[actualVariant];
2957
- const sizeStyles = chipSizes[actualSize];
2958
- const handleIconClick = (e) => {
2959
- e.stopPropagation();
2960
- if (onIconClick) {
2961
- onIconClick();
2962
- }
2963
- };
2964
- const handleKeyDown = (e) => {
2965
- if ((e.key === 'Enter' || e.key === ' ') && onClick && !disabled) {
2966
- e.preventDefault();
2967
- onClick();
2968
- }
2969
- };
2970
- const renderIcon = () => {
2971
- const iconElement = jsxRuntimeExports.jsx(X, { className: cn(sizeStyles.iconSize) });
2972
- if (onIconClick) {
2973
- return (jsxRuntimeExports.jsx("button", { type: "button", onClick: handleIconClick, disabled: disabled, className: cn('flex items-center justify-center', 'hover:opacity-70 transition-opacity', disabled && 'cursor-not-allowed opacity-50'), "aria-label": "\u062D\u0630\u0641", children: iconElement }));
2974
- }
2975
- return iconElement;
2976
- };
2977
- return (jsxRuntimeExports.jsxs("div", { ref: ref, className: cn(
2978
- // Base styles
2979
- 'relative rounded-[50px] border border-solid inline-flex', 'flex-row items-center justify-center', 'font-sans font-bold not-italic', 'text-nowrap text-right', 'transition-all duration-200',
2980
- // Variant styles
2981
- variantStyles.background, variantStyles.text, variantStyles.border,
2982
- // Size styles
2983
- sizeStyles.padding, sizeStyles.gap, sizeStyles.fontSize, sizeStyles.lineHeight,
2984
- // Interactive styles
2985
- onClick && !disabled && 'cursor-pointer hover:opacity-80', disabled && 'cursor-not-allowed opacity-60', className), onClick: disabled ? undefined : onClick, onKeyDown: onClick && !disabled ? handleKeyDown : undefined, tabIndex: onClick && !disabled ? 0 : undefined, role: onClick ? 'button' : undefined, ...props, children: [jsxRuntimeExports.jsx("span", { className: "text-center", children: children }), renderIcon()] }));
2986
- });
2987
- Chips$1.displayName = 'Chips';
2988
-
2989
- // Protected Components (license-wrapped)
2990
- const Typography = withLicenseProtection(Typography$1, 'Typography');
2991
- const Button = withLicenseProtection(Button$1, 'Button');
2992
- const Input = withLicenseProtection(Input$1, 'Input');
2993
- const Tabs = withLicenseProtection(Tabs$1, 'Tabs');
2994
- const Drawer = withLicenseProtection(Drawer$1, 'Drawer');
2995
- const Backdrop = withLicenseProtection(Backdrop$1, 'Backdrop');
2996
- const Breadcrumb = withLicenseProtection(Breadcrumb$1, 'Breadcrumb');
2997
- const Pagination = withLicenseProtection(Pagination$1, 'Pagination');
2998
- const Accordion = withLicenseProtection(Accordion$1, 'Accordion');
2999
- const Divider = withLicenseProtection(Divider$1, 'Divider');
3000
- const RadioGroup = withLicenseProtection(RadioGroup$1, 'RadioGroup');
3001
- const Chips = withLicenseProtection(Chips$1, 'Chips');
3002
-
3003
- export { Accordion, Backdrop, Breadcrumb, Button, Chips, Divider, Drawer, Input, MobileProvider, Pagination, RadioGroup, Tabs, Typography, initializeAutomobiKit, useMobile };
1487
+ export { MobileProvider as M, MobileContext as a, useMobile as u };