automoby-kit 1.0.12 → 1.0.13

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 (126) hide show
  1. package/README.md +7 -71
  2. package/dist/cjs/Accordion.js +59 -1
  3. package/dist/cjs/Backdrop.js +26 -1
  4. package/dist/cjs/Breadcrumb.js +61 -1
  5. package/dist/cjs/Button.js +48 -1
  6. package/dist/cjs/Chips.js +117 -1
  7. package/dist/cjs/Divider.js +23 -1
  8. package/dist/cjs/Drawer.js +112 -1
  9. package/dist/cjs/Input.js +84 -1
  10. package/dist/cjs/Menu.js +122 -1
  11. package/dist/cjs/Pagination.js +188 -1
  12. package/dist/cjs/RadioGroup.js +73 -1
  13. package/dist/cjs/Tabs.js +54 -1
  14. package/dist/cjs/Typography.js +63 -1
  15. package/dist/cjs/chevron-left-COj1qGVo.js +16 -0
  16. package/dist/{types → cjs}/components/Accordion/Accordion.d.ts +2 -2
  17. package/dist/{types → cjs}/components/Breadcrumb/Breadcrumb.d.ts +2 -2
  18. package/dist/{types → cjs}/components/Chips/Chips.d.ts +5 -5
  19. package/dist/{types → cjs}/components/Drawer/Drawer.d.ts +2 -2
  20. package/dist/{types → cjs}/components/Input/Input.d.ts +4 -4
  21. package/dist/{types → cjs}/components/Input/Input.stories.d.ts +1 -1
  22. package/dist/{types → cjs}/components/Pagination/Pagination.d.ts +2 -2
  23. package/dist/{types → cjs}/components/RadioGroup/RadioGroup.d.ts +2 -2
  24. package/dist/cjs/components/Select/Select.d.ts +17 -0
  25. package/dist/cjs/components/Select/Select.stories.d.ts +104 -0
  26. package/dist/{types → cjs}/components/Tabs/Tabs.d.ts +2 -2
  27. package/dist/{types → cjs}/contexts/MobileContext.d.ts +1 -0
  28. package/dist/cjs/contexts.js +1491 -1
  29. package/dist/cjs/createLucideIcon-BTjFFtDc.js +114 -0
  30. package/dist/cjs/index.d.ts +34 -0
  31. package/dist/cjs/index.js +52 -1
  32. package/dist/cjs/utils.js +9 -1
  33. package/dist/esm/Accordion.js +57 -1
  34. package/dist/esm/Backdrop.js +24 -1
  35. package/dist/esm/Breadcrumb.js +59 -1
  36. package/dist/esm/Button.js +46 -1
  37. package/dist/esm/Chips.js +112 -1
  38. package/dist/esm/Divider.js +21 -1
  39. package/dist/esm/Drawer.js +110 -1
  40. package/dist/esm/Input.js +82 -1
  41. package/dist/esm/Menu.js +120 -1
  42. package/dist/esm/Pagination.js +186 -1
  43. package/dist/esm/RadioGroup.js +71 -1
  44. package/dist/esm/Tabs.js +52 -1
  45. package/dist/esm/Typography.js +60 -1
  46. package/dist/esm/components/Accordion/Accordion.d.ts +25 -0
  47. package/dist/esm/components/Accordion/Accordion.stories.d.ts +175 -0
  48. package/dist/esm/components/Backdrop/Backdrop.d.ts +20 -0
  49. package/dist/esm/components/Backdrop/Backdrop.stories.d.ts +9 -0
  50. package/dist/esm/components/Breadcrumb/Breadcrumb.d.ts +16 -0
  51. package/dist/esm/components/Breadcrumb/Breadcrumb.stories.d.ts +177 -0
  52. package/dist/esm/components/Button/Button.d.ts +13 -0
  53. package/dist/esm/components/Button/Button.stories.d.ts +100 -0
  54. package/dist/esm/components/Chips/Chips.d.ts +37 -0
  55. package/dist/esm/components/Chips/Chips.stories.d.ts +90 -0
  56. package/dist/esm/components/Divider/Divider.d.ts +25 -0
  57. package/dist/esm/components/Divider/Divider.stories.d.ts +88 -0
  58. package/dist/esm/components/Drawer/Drawer.d.ts +16 -0
  59. package/dist/esm/components/Drawer/Drawer.stories.d.ts +128 -0
  60. package/dist/esm/components/Input/Input.d.ts +24 -0
  61. package/dist/esm/components/Input/Input.stories.d.ts +131 -0
  62. package/dist/esm/components/Menu/Menu.d.ts +39 -0
  63. package/dist/esm/components/Menu/Menu.stories.d.ts +89 -0
  64. package/dist/esm/components/Pagination/Pagination.d.ts +12 -0
  65. package/dist/esm/components/Pagination/Pagination.stories.d.ts +76 -0
  66. package/dist/esm/components/RadioGroup/RadioGroup.d.ts +55 -0
  67. package/dist/esm/components/RadioGroup/RadioGroup.stories.d.ts +86 -0
  68. package/dist/esm/components/Select/Select.d.ts +17 -0
  69. package/dist/esm/components/Select/Select.stories.d.ts +104 -0
  70. package/dist/esm/components/Tabs/Tabs.d.ts +43 -0
  71. package/dist/esm/components/Tabs/Tabs.stories.d.ts +66 -0
  72. package/dist/esm/components/Typography/Typography.d.ts +9 -0
  73. package/dist/esm/components/Typography/Typography.stories.d.ts +57 -0
  74. package/dist/esm/contexts/MobileContext.d.ts +13 -0
  75. package/dist/esm/contexts.js +1485 -1
  76. package/dist/esm/index.d.ts +34 -0
  77. package/dist/esm/index.js +37 -1
  78. package/dist/esm/utils/cn.d.ts +2 -0
  79. package/dist/esm/utils.js +7 -1
  80. package/package.json +2 -7
  81. package/dist/cjs/ProtectedComponent.js +0 -1
  82. package/dist/cjs/licensing.js +0 -1
  83. package/dist/esm/ProtectedComponent.js +0 -1
  84. package/dist/esm/licensing.js +0 -1
  85. package/dist/types/Accordion.js +0 -54
  86. package/dist/types/Backdrop.js +0 -24
  87. package/dist/types/Breadcrumb.js +0 -56
  88. package/dist/types/Button.js +0 -46
  89. package/dist/types/Chips.js +0 -109
  90. package/dist/types/Divider.js +0 -21
  91. package/dist/types/Drawer.js +0 -107
  92. package/dist/types/Input.js +0 -78
  93. package/dist/types/Menu.js +0 -120
  94. package/dist/types/Pagination.js +0 -183
  95. package/dist/types/ProtectedComponent.js +0 -33
  96. package/dist/types/RadioGroup.js +0 -68
  97. package/dist/types/Tabs.js +0 -49
  98. package/dist/types/Typography.js +0 -60
  99. package/dist/types/components/ProtectedComponent.d.ts +0 -5
  100. package/dist/types/contexts.js +0 -1478
  101. package/dist/types/index.d.ts +0 -36
  102. package/dist/types/index.js +0 -38
  103. package/dist/types/licensing/LicenseManager.d.ts +0 -41
  104. package/dist/types/licensing/index.d.ts +0 -30
  105. package/dist/types/licensing.js +0 -125
  106. package/dist/types/utils.js +0 -7
  107. /package/dist/{types → cjs}/components/Accordion/Accordion.stories.d.ts +0 -0
  108. /package/dist/{types → cjs}/components/Backdrop/Backdrop.d.ts +0 -0
  109. /package/dist/{types → cjs}/components/Backdrop/Backdrop.stories.d.ts +0 -0
  110. /package/dist/{types → cjs}/components/Breadcrumb/Breadcrumb.stories.d.ts +0 -0
  111. /package/dist/{types → cjs}/components/Button/Button.d.ts +0 -0
  112. /package/dist/{types → cjs}/components/Button/Button.stories.d.ts +0 -0
  113. /package/dist/{types → cjs}/components/Chips/Chips.stories.d.ts +0 -0
  114. /package/dist/{types → cjs}/components/Divider/Divider.d.ts +0 -0
  115. /package/dist/{types → cjs}/components/Divider/Divider.stories.d.ts +0 -0
  116. /package/dist/{types → cjs}/components/Drawer/Drawer.stories.d.ts +0 -0
  117. /package/dist/{types → cjs}/components/Menu/Menu.d.ts +0 -0
  118. /package/dist/{types → cjs}/components/Menu/Menu.stories.d.ts +0 -0
  119. /package/dist/{types → cjs}/components/Pagination/Pagination.stories.d.ts +0 -0
  120. /package/dist/{types → cjs}/components/RadioGroup/RadioGroup.stories.d.ts +0 -0
  121. /package/dist/{types → cjs}/components/Tabs/Tabs.stories.d.ts +0 -0
  122. /package/dist/{types → cjs}/components/Typography/Typography.d.ts +0 -0
  123. /package/dist/{types → cjs}/components/Typography/Typography.stories.d.ts +0 -0
  124. /package/dist/{types → cjs}/utils/cn.d.ts +0 -0
  125. /package/dist/{types → esm}/chevron-left-Ck6O99eF.js +0 -0
  126. /package/dist/{types → esm}/createLucideIcon-D-q73LTT.js +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Automoby Kit
2
2
 
3
- A comprehensive React UI component library with built-in licensing system.
3
+ A comprehensive React UI component library - created in war 2025.
4
4
 
5
5
  ## 🚀 Installation
6
6
 
@@ -8,42 +8,16 @@ A comprehensive React UI component library with built-in licensing system.
8
8
  npm install automoby-kit
9
9
  ```
10
10
 
11
- ## 🔑 License Initialization (Required)
12
-
13
- **Important**: You must initialize Automoby Kit with a valid license key before using any components.
14
-
15
- ```typescript
16
- import { initializeAutomobiKit } from 'automoby-kit';
17
-
18
- // Initialize with your license key (call this once at the start of your app)
19
- const success = initializeAutomobiKit({
20
- key: 'your-license-key-here'
21
- });
22
-
23
- if (success) {
24
- console.log('✅ Automoby Kit initialized successfully');
25
- } else {
26
- console.error('❌ Failed to initialize Automoby Kit');
27
- }
28
- ```
29
11
  ## 📦 Usage
30
12
 
31
- After successful initialization, you can use any component:
32
-
33
13
  ```typescript
34
14
  import {
35
15
  Button,
36
16
  Typography,
37
17
  Input,
38
- Tabs,
39
- initializeAutomobiKit
18
+ Tabs
40
19
  } from 'automoby-kit';
41
20
 
42
- // Initialize first
43
- initializeAutomobiKit({
44
- key: '-------------------'
45
- });
46
-
47
21
  function App() {
48
22
  return (
49
23
  <div>
@@ -71,38 +45,7 @@ function App() {
71
45
  - **Divider** - Visual separators
72
46
  - **RadioGroup** - Radio button groups
73
47
  - **Chips** - Tag-like elements
74
-
75
- ## 🔧 License Management Functions
76
-
77
- ```typescript
78
- import {
79
- initializeAutomobiKit,
80
- getLicenseStatus,
81
- canUseComponents
82
- } from 'automoby-kit';
83
-
84
- // Check if components can be used
85
- const canUse = canUseComponents();
86
-
87
- // Get detailed license status
88
- const status = getLicenseStatus();
89
- console.log(status);
90
- // {
91
- // initialized: true,
92
- // valid: true,
93
- // key: "automoby-..."
94
- // }
95
- ```
96
-
97
- ## ⚠️ What Happens Without a Valid License?
98
-
99
- If you try to use components without proper initialization or with an invalid key, you'll see a license error component instead of the actual component:
100
-
101
- ```
102
- 🔒 License Required
103
- Component "Button" requires a valid license key.
104
- Please initialize Automoby Kit with your license key before using components.
105
- ```
48
+ - **Menu** - Context menus and dropdowns
106
49
 
107
50
  ## 🏗️ TypeScript Support
108
51
 
@@ -129,8 +72,6 @@ function App() {
129
72
  <MyComponent />
130
73
  </MobileProvider>
131
74
  );
132
- }
133
- );
134
75
  }
135
76
  ```
136
77
 
@@ -147,18 +88,13 @@ This package requires the following peer dependencies:
147
88
  }
148
89
  ```
149
90
 
150
- ## 📄 License
151
-
152
- This is a commercial package. You need a valid license key to use it in production.
153
-
154
91
  ## 🆘 Support
155
92
 
156
- If you need a license key or have issues:
93
+ If you have issues:
157
94
 
158
- 1. Contact our sales team for licensing
159
- 2. Check the [GitHub issues](https://github.com/yourusername/automoby-kit/issues) for known problems
160
- 3. Make sure you're calling `initializeAutomobiKit()` before using any components
95
+ 1. Check the [GitHub issues](https://github.com/yourusername/automoby-kit/issues) for known problems
96
+ 2. Submit a new issue with detailed information about your problem
161
97
 
162
98
  ## 🔄 Version History
163
99
 
164
- - **1.0.0** - Initial release with licensing system
100
+ - **1.0.0** - Initial release
@@ -1 +1,59 @@
1
- "use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),a=require("./utils.js"),i=require("./Typography.js"),s=require("./chunks/createLucideIcon-BqJVOzoK.js");const t=s.createLucideIcon("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),n=s.createLucideIcon("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),d=r.forwardRef(({title:s,body:d,startIcon:o,isExpanded:l,onToggle:c,defaultExpanded:u=!1,className:h,id:m,disabled:x=!1,isMobile:p,...f},y)=>{const[b,v]=r.useState(u),j=void 0!==l?l:b,g=m||`accordion-${Math.random().toString(36).substr(2,9)}`,N=`${g}-header`,k=`${g}-content`,w=p?20:24,q=p?"body-s-heavy":"body-l-heavy",I=p?"body-s-medium":"body-m-medium";return e.jsxs("div",{ref:y,className:a("rounded-2xl border-0 overflow-hidden","transition-all duration-200 ease-in-out",h),...f,children:[e.jsxs("button",{id:N,type:"button",onClick:()=>{if(x)return;const e=!j;void 0===l&&v(e),c?.(e)},disabled:x,"aria-expanded":j,"aria-controls":k,className:a("w-full flex items-center justify-between",p?"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",!x&&"hover:bg-neutral-lighter"),children:[e.jsx("div",{className:"flex-shrink-0 mr-4",children:j?e.jsx(n,{size:w,className:"text-neutral-darker transition-transform duration-200","aria-hidden":"true"}):e.jsx(t,{size:w,className:"text-neutral-darker transition-transform duration-200","aria-hidden":"true"})}),e.jsxs("div",{className:a("flex items-center flex-1",p?"gap-3":"gap-4"),children:[e.jsx("div",{className:"flex-1 text-right",children:e.jsx(i.Typography,{variant:q,color:"neutral-darker",children:s})}),o&&e.jsx("div",{className:a("flex-shrink-0 flex items-center justify-center",p?"w-6 h-6":"w-8 h-8"),children:o})]})]}),e.jsx("div",{id:k,role:"region","aria-labelledby":N,className:a("w-full overflow-hidden transition-all duration-300 ease-in-out",j?"max-h-screen opacity-100":"max-h-0 opacity-0"),children:e.jsx("div",{className:a(p?"pb-3 mt-1":"pb-4 mt-1.5"),children:e.jsx("div",{className:a("bg-neutral-lighter rounded-lg",p?"p-3":"p-4"),children:e.jsx(i.Typography,{variant:I,color:"neutral-dark",children:d})})})})]})});d.displayName="Accordion",exports.Accordion=d;
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var utils = require('./utils.js');
6
+ var contexts = require('./contexts.js');
7
+ var Typography = require('./Typography.js');
8
+ var createLucideIcon = require('./createLucideIcon-BTjFFtDc.js');
9
+
10
+ /**
11
+ * @license lucide-react v0.522.0 - ISC
12
+ *
13
+ * This source code is licensed under the ISC license.
14
+ * See the LICENSE file in the root directory of this source tree.
15
+ */
16
+
17
+
18
+ const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
19
+ const ChevronDown = createLucideIcon.createLucideIcon("chevron-down", __iconNode$1);
20
+
21
+ /**
22
+ * @license lucide-react v0.522.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */
27
+
28
+
29
+ const __iconNode = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
30
+ const ChevronUp = createLucideIcon.createLucideIcon("chevron-up", __iconNode);
31
+
32
+ const Accordion = React.forwardRef(({ title, body, startIcon, isExpanded: controlledExpanded, onToggle, defaultExpanded = false, className, id, disabled = false, isMobile, ...props }, ref) => {
33
+ const detectedIsMobile = contexts.useMobile();
34
+ const actualIsMobile = isMobile ?? detectedIsMobile;
35
+ const [internalExpanded, setInternalExpanded] = React.useState(defaultExpanded);
36
+ // Use controlled state if provided, otherwise use internal state
37
+ const isExpanded = controlledExpanded !== undefined ? controlledExpanded : internalExpanded;
38
+ const handleToggle = () => {
39
+ if (disabled)
40
+ return;
41
+ const newExpanded = !isExpanded;
42
+ if (controlledExpanded === undefined) {
43
+ setInternalExpanded(newExpanded);
44
+ }
45
+ onToggle?.(newExpanded);
46
+ };
47
+ const accordionId = id || `accordion-${Math.random().toString(36).substr(2, 9)}`;
48
+ const headerId = `${accordionId}-header`;
49
+ const contentId = `${accordionId}-content`;
50
+ // Icon size based on device
51
+ const iconSize = actualIsMobile ? 20 : 24;
52
+ // Typography variants based on device
53
+ const titleVariant = actualIsMobile ? 'body-s-heavy' : 'body-l-heavy';
54
+ const bodyVariant = actualIsMobile ? 'body-s-medium' : 'body-m-medium';
55
+ return (jsxRuntime.jsxs("div", { ref: ref, className: utils('rounded-2xl border-0 overflow-hidden', 'transition-all duration-200 ease-in-out', className), ...props, children: [jsxRuntime.jsxs("button", { id: headerId, type: "button", onClick: handleToggle, disabled: disabled, "aria-expanded": isExpanded, "aria-controls": contentId, className: utils('w-full flex items-center justify-between', actualIsMobile ? '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: [jsxRuntime.jsx("div", { className: "flex-shrink-0 mr-4", children: isExpanded ? (jsxRuntime.jsx(ChevronUp, { size: iconSize, className: "text-neutral-darker transition-transform duration-200", "aria-hidden": "true" })) : (jsxRuntime.jsx(ChevronDown, { size: iconSize, className: "text-neutral-darker transition-transform duration-200", "aria-hidden": "true" })) }), jsxRuntime.jsxs("div", { className: utils('flex items-center flex-1', actualIsMobile ? 'gap-3' : 'gap-4'), children: [jsxRuntime.jsx("div", { className: "flex-1 text-right", children: jsxRuntime.jsx(Typography.Typography, { variant: titleVariant, color: "neutral-darker", children: title }) }), startIcon && (jsxRuntime.jsx("div", { className: utils('flex-shrink-0 flex items-center justify-center', actualIsMobile ? 'w-6 h-6' : 'w-8 h-8'), children: startIcon }))] })] }), jsxRuntime.jsx("div", { id: contentId, role: "region", "aria-labelledby": headerId, className: utils('w-full overflow-hidden transition-all duration-300 ease-in-out', isExpanded ? 'max-h-screen opacity-100' : 'max-h-0 opacity-0'), children: jsxRuntime.jsx("div", { className: utils(actualIsMobile ? 'pb-3 mt-1' : 'pb-4 mt-1.5'), children: jsxRuntime.jsx("div", { className: utils('bg-neutral-lighter rounded-lg', actualIsMobile ? 'p-3' : 'p-4'), children: jsxRuntime.jsx(Typography.Typography, { variant: bodyVariant, color: "neutral-dark", children: body }) }) }) })] }));
56
+ });
57
+ Accordion.displayName = 'Accordion';
58
+
59
+ exports.Accordion = Accordion;
@@ -1 +1,26 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js");const a=r.forwardRef(({isOpen:r=!1,onClick:a,blur:n=!1,zIndex:i=51,className:o,children:s,...c},d)=>{const l=t("fixed inset-0 transition-all duration-300",{"opacity-100 pointer-events-auto":r,"opacity-0 pointer-events-none":!r,"backdrop-blur-sm":n},o),u={backgroundColor:"rgba(0, 0, 0, 0.60)",zIndex:i};return e.jsx("div",{ref:d,className:l,style:u,onClick:e=>{a&&e.target===e.currentTarget&&a()},role:"presentation","aria-hidden":!r,...c,children:s})});a.displayName="Backdrop",exports.Backdrop=a;
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var utils = require('./utils.js');
6
+
7
+ const Backdrop = React.forwardRef(({ isOpen = false, onClick, blur = false, zIndex = 51, className, children, ...props }, ref) => {
8
+ const handleClick = (event) => {
9
+ if (onClick && event.target === event.currentTarget) {
10
+ onClick();
11
+ }
12
+ };
13
+ const backdropClasses = utils('fixed inset-0 transition-all duration-300', {
14
+ 'opacity-100 pointer-events-auto': isOpen,
15
+ 'opacity-0 pointer-events-none': !isOpen,
16
+ 'backdrop-blur-sm': blur,
17
+ }, className);
18
+ const backdropStyle = {
19
+ backgroundColor: 'rgba(0, 0, 0, 0.60)',
20
+ zIndex,
21
+ };
22
+ return (jsxRuntime.jsx("div", { ref: ref, className: backdropClasses, style: backdropStyle, onClick: handleClick, role: "presentation", "aria-hidden": !isOpen, ...props, children: children }));
23
+ });
24
+ Backdrop.displayName = 'Backdrop';
25
+
26
+ exports.Backdrop = Backdrop;
@@ -1 +1,61 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),a=require("./utils.js"),t=require("./chunks/chevron-left-Do__K6cA.js");require("./chunks/createLucideIcon-BqJVOzoK.js");const n=r.forwardRef(({items:r,className:n,isMobile:l},s)=>e.jsx("nav",{ref:s,className:a("flex flex-row-reverse items-center",l?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",n),"aria-label":"Breadcrumb navigation",children:e.jsx("ol",{className:"flex flex-row-reverse items-center gap-inherit",children:r.map((n,s)=>{const i=s===r.length-1,c=!i&&(n.href||n.onClick),o=`${n.label}-${s}`;return e.jsxs("li",{className:"flex items-center gap-inherit",children:[c?e.jsx("a",{href:n.href||"#",className:a("whitespace-nowrap border-0 bg-transparent p-0 no-underline",l?"text-t":"text-s","text-neutral-main","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=>((e,a,t)=>{a!==r.length-1&&e.onClick&&(t.preventDefault(),e.onClick())})(n,s,e),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick&&n.onClick())},"aria-label":`Go to ${n.label}`,children:n.label}):e.jsx("span",{className:a("whitespace-nowrap",l?"text-t":"text-s","text-neutral-main","font-medium"),"aria-current":i?"page":void 0,"aria-label":i?`Current page: ${n.label}`:void 0,children:n.label}),!i&&e.jsx(t.ChevronLeft,{className:a("text-black flex-shrink-0",l?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},o)})})}));n.displayName="Breadcrumb",exports.Breadcrumb=n;
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var utils = require('./utils.js');
6
+ var contexts = require('./contexts.js');
7
+ var chevronLeft = require('./chevron-left-COj1qGVo.js');
8
+ require('./createLucideIcon-BTjFFtDc.js');
9
+
10
+ const Breadcrumb = React.forwardRef(({ items, className, isMobile }, ref) => {
11
+ const detectedIsMobile = contexts.useMobile();
12
+ const actualIsMobile = isMobile ?? detectedIsMobile;
13
+ const handleItemClick = (item, index, e) => {
14
+ // Don't make the last item (current page) clickable
15
+ if (index === items.length - 1)
16
+ return;
17
+ if (item.onClick) {
18
+ e.preventDefault();
19
+ item.onClick();
20
+ }
21
+ // If item has href, let the anchor tag handle navigation naturally
22
+ };
23
+ return (jsxRuntime.jsx("nav", { ref: ref, className: utils(
24
+ // Base layout - RTL with flex-row-reverse to show items right to left
25
+ 'flex flex-row-reverse items-center',
26
+ // Responsive gap and padding based on mobile state
27
+ actualIsMobile ? 'gap-1 px-4 py-2.5' : 'gap-3 pr-1 pt-3 pb-4 pl-0', className), "aria-label": "Breadcrumb navigation", children: jsxRuntime.jsx("ol", { className: "flex flex-row-reverse items-center gap-inherit", children: items.map((item, index) => {
28
+ const isLast = index === items.length - 1;
29
+ const isClickable = !isLast && (item.href || item.onClick);
30
+ const itemKey = `${item.label}-${index}`;
31
+ return (jsxRuntime.jsxs("li", { className: "flex items-center gap-inherit", children: [isClickable ? (jsxRuntime.jsx("a", { href: item.href || '#', className: utils(
32
+ // Base styles
33
+ 'whitespace-nowrap border-0 bg-transparent p-0 no-underline',
34
+ // Responsive font size based on mobile state
35
+ actualIsMobile ? 'text-t' : 'text-s',
36
+ // Color
37
+ 'text-neutral-main',
38
+ // Cursor and hover effects for clickable items
39
+ '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) => {
40
+ if (e.key === 'Enter' || e.key === ' ') {
41
+ e.preventDefault();
42
+ if (item.onClick) {
43
+ item.onClick();
44
+ }
45
+ }
46
+ }, "aria-label": `Go to ${item.label}`, children: item.label })) : (jsxRuntime.jsx("span", { className: utils(
47
+ // Base styles
48
+ 'whitespace-nowrap',
49
+ // Responsive font size based on mobile state
50
+ actualIsMobile ? 'text-t' : 'text-s',
51
+ // Color
52
+ 'text-neutral-main',
53
+ // Different styles for current page (last item)
54
+ 'font-medium'), "aria-current": isLast ? 'page' : undefined, "aria-label": isLast ? `Current page: ${item.label}` : undefined, children: item.label })), !isLast && (jsxRuntime.jsx(chevronLeft.ChevronLeft, { className: utils('text-black flex-shrink-0',
55
+ // Responsive icon size
56
+ actualIsMobile ? 'w-2.5 h-2.5' : 'w-3 h-3'), "aria-hidden": "true" }))] }, itemKey));
57
+ }) }) }));
58
+ });
59
+ Breadcrumb.displayName = 'Breadcrumb';
60
+
61
+ exports.Breadcrumb = Breadcrumb;
@@ -1 +1,48 @@
1
- "use strict";var r=require("react/jsx-runtime"),e=require("react"),a=require("./utils.js"),t=require("./Typography.js");const l={sm:"px-[16px] py-[7px]",md:"px-[16px] py-[9px]",lg:"px-[16px] py-[13px]",xl:"px-[20px] py-[13px]"},o={sm:"body-s-bold",md:"body-m-bold",lg:"body-l-bold",xl:"body-xl-heavy"},i={primary:"\n bg-[var(--color-primary)] text-white\n hover:bg-[var(--color-primary-dark)]\n disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]\n ",secondary:"\n bg-[var(--color-primary-lightest)] text-[var(--color-primary)]\n hover:bg-[var(--color-primary-lighter)]\n disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]\n ",tertiary:"\n bg-white border border-[var(--color-primary-light)] text-[var(--color-primary)]\n hover:bg-[var(--color-neutral-lighter)]\n disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]\n ",ghost:"\n bg-transparent text-[var(--color-primary)]\n hover:bg-[var(--color-primary-lightest)]\n disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]\n "},n=e.forwardRef(({className:e,variant:n="primary",size:s="md",icon:d,iconPosition:c="right",children:p,loading:b=!1,disabled:x,textVariant:g,...y},m)=>{const v=g||o[s];return r.jsxs("button",{ref:m,type:"button",className:a("inline-flex items-center justify-center rounded-[8px] transition-colors duration-200",l[s],i[n],t.getTypographyClasses(v),x&&"opacity-50 pointer-events-none",e),disabled:x||b,...y,children:[d&&"left"===c&&r.jsx("span",{className:"mr-2 flex items-center",children:d}),b?"...":p,d&&"right"===c&&r.jsx("span",{className:"ml-2 flex items-center",children:d})]})});n.displayName="Button",exports.Button=n;
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var utils = require('./utils.js');
6
+ var Typography = require('./Typography.js');
7
+
8
+ const sizeClasses = {
9
+ sm: 'px-[16px] py-[7px]',
10
+ md: 'px-[16px] py-[9px]',
11
+ lg: 'px-[16px] py-[13px]',
12
+ xl: 'px-[20px] py-[13px]',
13
+ };
14
+ const defaultTextVariants = {
15
+ sm: 'body-s-bold', // 14px / Bold (600)
16
+ md: 'body-m-bold', // 16px / Bold (600)
17
+ lg: 'body-l-bold', // 18px / Bold (600)
18
+ xl: 'body-xl-heavy', // 20px / Heavy (700)
19
+ };
20
+ const variantClasses = {
21
+ primary: `
22
+ bg-[var(--color-primary)] text-white
23
+ hover:bg-[var(--color-primary-dark)]
24
+ disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
25
+ `,
26
+ secondary: `
27
+ bg-[var(--color-primary-lightest)] text-[var(--color-primary)]
28
+ hover:bg-[var(--color-primary-lighter)]
29
+ disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
30
+ `,
31
+ tertiary: `
32
+ bg-white border border-[var(--color-primary-light)] text-[var(--color-primary)]
33
+ hover:bg-[var(--color-neutral-lighter)]
34
+ disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
35
+ `,
36
+ ghost: `
37
+ bg-transparent text-[var(--color-primary)]
38
+ hover:bg-[var(--color-primary-lightest)]
39
+ disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
40
+ `,
41
+ };
42
+ const Button = React.forwardRef(({ className, variant = 'primary', size = 'md', icon, iconPosition = 'right', children, loading = false, disabled, textVariant, ...props }, ref) => {
43
+ const finalTextVariant = textVariant || defaultTextVariants[size];
44
+ return (jsxRuntime.jsxs("button", { ref: ref, type: "button", className: utils('inline-flex items-center justify-center rounded-[8px] transition-colors duration-200', sizeClasses[size], variantClasses[variant], Typography.getTypographyClasses(finalTextVariant), disabled && 'opacity-50 pointer-events-none', className), disabled: disabled || loading, ...props, children: [icon && iconPosition === 'left' && (jsxRuntime.jsx("span", { className: "mr-2 flex items-center", children: icon })), loading ? '...' : children, icon && iconPosition === 'right' && (jsxRuntime.jsx("span", { className: "ml-2 flex items-center", children: icon }))] }));
45
+ });
46
+ Button.displayName = 'Button';
47
+
48
+ exports.Button = Button;
package/dist/cjs/Chips.js CHANGED
@@ -1 +1,117 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),o=require("./utils.js");const t=require("./chunks/createLucideIcon-BqJVOzoK.js").createLucideIcon("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),i={purple:{background:"bg-[var(--color-primary-lightest)]",text:"text-[var(--color-primary-darkest)]",border:"border-[var(--color-primary-light)]"},red:{background:"bg-[var(--color-error-light)]",text:"text-[var(--color-error)]",border:"border-[#f0d6d6]"},green:{background:"bg-[var(--color-success-light)]",text:"text-[var(--color-success)]",border:"border-[#d4e8dc]"},orange:{background:"bg-[var(--color-warning-light)]",text:"text-[var(--color-warning)]",border:"border-[#f5e1d1]"},blue:{background:"bg-[var(--color-info-light)]",text:"text-[var(--color-info)]",border:"border-[#d3e9f2]"},white:{background:"bg-[var(--color-white)]",text:"text-[var(--color-neutral-darker)]",border:"border-[var(--color-neutral-light)]"},disabled:{background:"bg-[var(--color-neutral-lighter)]",text:"text-[var(--color-neutral-main)]",border:"border-[var(--color-neutral-light)]"}},a={mobile:{padding:"px-2.5 py-1",gap:"gap-1",iconSize:"size-4",fontSize:"text-[12px]",lineHeight:"leading-[1.8]"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"size-5",fontSize:"text-[14px]",lineHeight:"leading-[24px]"}},n=r.forwardRef(({variant:r="purple",size:n,children:l="متن پیشفرض",disabled:d=!1,onClick:c,onIconClick:s,className:b,isMobile:p,...u},g)=>{const x=i[d?"disabled":r],v=a[n||(p?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),s&&s()};return e.jsxs("div",{ref:g,className:o("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",x.background,x.text,x.border,v.padding,v.gap,v.fontSize,v.lineHeight,c&&!d&&"cursor-pointer hover:opacity-80",d&&"cursor-not-allowed opacity-60",b),onClick:d?void 0:c,onKeyDown:c&&!d?e=>{"Enter"!==e.key&&" "!==e.key||!c||d||(e.preventDefault(),c())}:void 0,tabIndex:c&&!d?0:void 0,role:c?"button":void 0,...u,children:[e.jsx("span",{className:"text-center",children:l}),(()=>{const r=e.jsx(t,{className:o(v.iconSize)});return s?e.jsx("button",{type:"button",onClick:handleIconClick,disabled:d,className:o("flex items-center justify-center","hover:opacity-70 transition-opacity",d&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:r}):r})()]})});n.displayName="Chips",exports.Chips=n,exports.default=n;
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
7
+ var utils = require('./utils.js');
8
+ var contexts = require('./contexts.js');
9
+ var createLucideIcon = require('./createLucideIcon-BTjFFtDc.js');
10
+
11
+ /**
12
+ * @license lucide-react v0.522.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */
17
+
18
+
19
+ const __iconNode = [
20
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
21
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
22
+ ];
23
+ const X = createLucideIcon.createLucideIcon("x", __iconNode);
24
+
25
+ const chipVariants = {
26
+ purple: {
27
+ background: 'bg-[var(--color-primary-lightest)]',
28
+ text: 'text-[var(--color-primary-darkest)]',
29
+ border: 'border-[var(--color-primary-light)]',
30
+ },
31
+ red: {
32
+ background: 'bg-[var(--color-error-light)]',
33
+ text: 'text-[var(--color-error)]',
34
+ border: 'border-[#f0d6d6]',
35
+ },
36
+ green: {
37
+ background: 'bg-[var(--color-success-light)]',
38
+ text: 'text-[var(--color-success)]',
39
+ border: 'border-[#d4e8dc]',
40
+ },
41
+ orange: {
42
+ background: 'bg-[var(--color-warning-light)]',
43
+ text: 'text-[var(--color-warning)]',
44
+ border: 'border-[#f5e1d1]',
45
+ },
46
+ blue: {
47
+ background: 'bg-[var(--color-info-light)]',
48
+ text: 'text-[var(--color-info)]',
49
+ border: 'border-[#d3e9f2]',
50
+ },
51
+ white: {
52
+ background: 'bg-[var(--color-white)]',
53
+ text: 'text-[var(--color-neutral-darker)]',
54
+ border: 'border-[var(--color-neutral-light)]',
55
+ },
56
+ disabled: {
57
+ background: 'bg-[var(--color-neutral-lighter)]',
58
+ text: 'text-[var(--color-neutral-main)]',
59
+ border: 'border-[var(--color-neutral-light)]',
60
+ },
61
+ };
62
+ const chipSizes = {
63
+ mobile: {
64
+ padding: 'px-2.5 py-1',
65
+ gap: 'gap-1',
66
+ iconSize: 'size-4',
67
+ fontSize: 'text-[12px]',
68
+ lineHeight: 'leading-[1.8]',
69
+ },
70
+ desktop: {
71
+ padding: 'px-3 py-1',
72
+ gap: 'gap-1.5',
73
+ iconSize: 'size-5',
74
+ fontSize: 'text-[14px]',
75
+ lineHeight: 'leading-[24px]',
76
+ },
77
+ };
78
+ const Chips = React.forwardRef(({ variant = 'purple', size, children = 'متن پیشفرض', disabled = false, onClick, onIconClick, className, isMobile, ...props }, ref) => {
79
+ const detectedIsMobile = contexts.useMobile();
80
+ const actualIsMobile = isMobile ?? detectedIsMobile;
81
+ const actualSize = size || (actualIsMobile ? 'mobile' : 'desktop');
82
+ const actualVariant = disabled ? 'disabled' : variant;
83
+ const variantStyles = chipVariants[actualVariant];
84
+ const sizeStyles = chipSizes[actualSize];
85
+ const handleIconClick = (e) => {
86
+ e.stopPropagation();
87
+ if (onIconClick) {
88
+ onIconClick();
89
+ }
90
+ };
91
+ const handleKeyDown = (e) => {
92
+ if ((e.key === 'Enter' || e.key === ' ') && onClick && !disabled) {
93
+ e.preventDefault();
94
+ onClick();
95
+ }
96
+ };
97
+ const renderIcon = () => {
98
+ const iconElement = jsxRuntime.jsx(X, { className: utils(sizeStyles.iconSize) });
99
+ if (onIconClick) {
100
+ return (jsxRuntime.jsx("button", { type: "button", onClick: handleIconClick, disabled: disabled, className: utils('flex items-center justify-center', 'hover:opacity-70 transition-opacity', disabled && 'cursor-not-allowed opacity-50'), "aria-label": "\u062D\u0630\u0641", children: iconElement }));
101
+ }
102
+ return iconElement;
103
+ };
104
+ return (jsxRuntime.jsxs("div", { ref: ref, className: utils(
105
+ // Base styles
106
+ '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',
107
+ // Variant styles
108
+ variantStyles.background, variantStyles.text, variantStyles.border,
109
+ // Size styles
110
+ sizeStyles.padding, sizeStyles.gap, sizeStyles.fontSize, sizeStyles.lineHeight,
111
+ // Interactive styles
112
+ 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: [jsxRuntime.jsx("span", { className: "text-center", children: children }), renderIcon()] }));
113
+ });
114
+ Chips.displayName = 'Chips';
115
+
116
+ exports.Chips = Chips;
117
+ exports.default = Chips;
@@ -1 +1,23 @@
1
- "use strict";var r=require("react/jsx-runtime"),e=require("react"),t=require("./utils.js");const i=e.forwardRef(({width:e="100%",height:i=1,orientation:a="horizontal",variant:s="neutral-light",className:l,style:n,...h},o)=>{const u="horizontal"===a,g={width:u?e:i,height:u?i:e,...n};return r.jsx("div",{ref:o,className:t("shrink-0",{"neutral-light":"bg-neutral-light","neutral-main":"bg-neutral-main",primary:"bg-primary"}[s],l),style:g,role:"separator",...h})});i.displayName="Divider",exports.Divider=i;
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var utils = require('./utils.js');
6
+
7
+ const Divider = React.forwardRef(({ width = '100%', height = 1, orientation = 'horizontal', variant = 'neutral-light', className, style, ...props }, ref) => {
8
+ const isHorizontal = orientation === 'horizontal';
9
+ const variantClasses = {
10
+ 'neutral-light': 'bg-neutral-light',
11
+ 'neutral-main': 'bg-neutral-main',
12
+ primary: 'bg-primary',
13
+ };
14
+ const dividerStyle = {
15
+ width: isHorizontal ? width : height,
16
+ height: isHorizontal ? height : width,
17
+ ...style,
18
+ };
19
+ return (jsxRuntime.jsx("div", { ref: ref, className: utils('shrink-0', variantClasses[variant], className), style: dividerStyle, role: "separator", ...props }));
20
+ });
21
+ Divider.displayName = 'Divider';
22
+
23
+ exports.Divider = Divider;
@@ -1 +1,112 @@
1
- "use client";"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("./utils.js");const l=t.forwardRef(({children:l,direction:n="bottom",fullScreen:o=!1,isOpen:a=!1,onClose:s,className:u,isMobile:i,...d},c)=>{const f=t.useRef(null),m=t.useRef(null);t.useEffect(()=>{const handleEscape=e=>{"Escape"===e.key&&a&&s&&s()};return a&&(document.addEventListener("keydown",handleEscape),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",handleEscape),document.body.style.overflow="auto"}},[a,s]);const b=r("fixed inset-0 z-50 transition-all duration-300",{"bg-neutral-darker/50 backdrop-blur-sm":a,"bg-transparent pointer-events-none":!a}),w=r("fixed bg-white shadow-2xl transition-all duration-300 ease-out overflow-auto",(()=>{switch(n){case"top":return"top-0 left-0 right-0";case"bottom":default:return"bottom-0 left-0 right-0";case"left":return"top-0 left-0 bottom-0";case"right":return"top-0 right-0 bottom-0"}})(),(()=>{const e="top"===n||"bottom"===n;return o?"w-full h-full":e?"w-full max-h-[90vh]":"h-full max-w-[90vw]"})(),(()=>{if(!a)switch(n){case"top":return"-translate-y-full";case"bottom":default:return"translate-y-full";case"left":return"-translate-x-full";case"right":return"translate-x-full"}return"translate-x-0 translate-y-0"})(),{"rounded-t-2xl":"bottom"===n&&!o,"rounded-b-2xl":"top"===n&&!o,"rounded-r-2xl":"left"===n&&!o,"rounded-l-2xl":"right"===n&&!o,"p-6":!i,"p-4":i},u);return a?e.jsx("div",{ref:f,className:b,onClick:e=>{!o&&s&&f.current&&e.target===f.current&&s()},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||!o&&s&&f.current&&e.target===f.current&&s()},tabIndex:-1,role:"button","aria-label":"Close drawer",children:e.jsx("div",{ref:c||m,className:w,role:"dialog","aria-modal":"true","aria-label":"Drawer",...d,children:l})}):null});l.displayName="Drawer",exports.Drawer=l;
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var utils = require('./utils.js');
6
+ var contexts = require('./contexts.js');
7
+
8
+ const Drawer = React.forwardRef(({ children, direction = 'bottom', fullScreen = false, isOpen = false, onClose, className, isMobile, ...props }, ref) => {
9
+ const detectedIsMobile = contexts.useMobile();
10
+ const actualIsMobile = isMobile ?? detectedIsMobile;
11
+ const overlayRef = React.useRef(null);
12
+ const drawerRef = React.useRef(null);
13
+ // Handle escape key
14
+ React.useEffect(() => {
15
+ const handleEscape = (event) => {
16
+ if (event.key === 'Escape' && isOpen && onClose) {
17
+ onClose();
18
+ }
19
+ };
20
+ if (isOpen) {
21
+ document.addEventListener('keydown', handleEscape);
22
+ // Prevent body scroll when drawer is open
23
+ document.body.style.overflow = 'hidden';
24
+ }
25
+ return () => {
26
+ document.removeEventListener('keydown', handleEscape);
27
+ document.body.style.overflow = 'auto';
28
+ };
29
+ }, [isOpen, onClose]);
30
+ // Handle click outside
31
+ const handleOverlayClick = (event) => {
32
+ if (!fullScreen &&
33
+ onClose &&
34
+ overlayRef.current &&
35
+ event.target === overlayRef.current) {
36
+ onClose();
37
+ }
38
+ };
39
+ // Handle keyboard events on overlay
40
+ const handleOverlayKeyDown = (event) => {
41
+ if (event.key === 'Enter' || event.key === ' ') {
42
+ if (!fullScreen &&
43
+ onClose &&
44
+ overlayRef.current &&
45
+ event.target === overlayRef.current) {
46
+ onClose();
47
+ }
48
+ }
49
+ };
50
+ const getTranslateClasses = () => {
51
+ if (!isOpen) {
52
+ switch (direction) {
53
+ case 'top':
54
+ return '-translate-y-full';
55
+ case 'bottom':
56
+ return 'translate-y-full';
57
+ case 'left':
58
+ return '-translate-x-full';
59
+ case 'right':
60
+ return 'translate-x-full';
61
+ default:
62
+ return 'translate-y-full';
63
+ }
64
+ }
65
+ return 'translate-x-0 translate-y-0';
66
+ };
67
+ const getPositionClasses = () => {
68
+ switch (direction) {
69
+ case 'top':
70
+ return 'top-0 left-0 right-0';
71
+ case 'bottom':
72
+ return 'bottom-0 left-0 right-0';
73
+ case 'left':
74
+ return 'top-0 left-0 bottom-0';
75
+ case 'right':
76
+ return 'top-0 right-0 bottom-0';
77
+ default:
78
+ return 'bottom-0 left-0 right-0';
79
+ }
80
+ };
81
+ const getSizeClasses = () => {
82
+ const isVertical = direction === 'top' || direction === 'bottom';
83
+ if (fullScreen) {
84
+ return isVertical ? 'w-full h-full' : 'w-full h-full';
85
+ }
86
+ if (isVertical) {
87
+ return 'w-full max-h-[90vh]';
88
+ }
89
+ return 'h-full max-w-[90vw]';
90
+ };
91
+ const baseOverlayClasses = 'fixed inset-0 z-50 transition-all duration-300';
92
+ const baseDrawerClasses = 'fixed bg-white shadow-2xl transition-all duration-300 ease-out overflow-auto';
93
+ const overlayClasses = utils(baseOverlayClasses, {
94
+ 'bg-neutral-darker/50 backdrop-blur-sm': isOpen,
95
+ 'bg-transparent pointer-events-none': !isOpen,
96
+ });
97
+ const drawerClasses = utils(baseDrawerClasses, getPositionClasses(), getSizeClasses(), getTranslateClasses(), {
98
+ 'rounded-t-2xl': direction === 'bottom' && !fullScreen,
99
+ 'rounded-b-2xl': direction === 'top' && !fullScreen,
100
+ 'rounded-r-2xl': direction === 'left' && !fullScreen,
101
+ 'rounded-l-2xl': direction === 'right' && !fullScreen,
102
+ 'p-6': !actualIsMobile,
103
+ 'p-4': actualIsMobile,
104
+ }, className);
105
+ if (!isOpen) {
106
+ return null;
107
+ }
108
+ return (jsxRuntime.jsx("div", { ref: overlayRef, className: overlayClasses, onClick: handleOverlayClick, onKeyDown: handleOverlayKeyDown, tabIndex: -1, role: "button", "aria-label": "Close drawer", children: jsxRuntime.jsx("div", { ref: ref || drawerRef, className: drawerClasses, role: "dialog", "aria-modal": "true", "aria-label": "Drawer", ...props, children: children }) }));
109
+ });
110
+ Drawer.displayName = 'Drawer';
111
+
112
+ exports.Drawer = Drawer;