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
@@ -0,0 +1,114 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ /**
6
+ * @license lucide-react v0.522.0 - ISC
7
+ *
8
+ * This source code is licensed under the ISC license.
9
+ * See the LICENSE file in the root directory of this source tree.
10
+ */
11
+
12
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
13
+ const toCamelCase = (string) => string.replace(
14
+ /^([A-Z])|[\s-_]+(\w)/g,
15
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
16
+ );
17
+ const toPascalCase = (string) => {
18
+ const camelCase = toCamelCase(string);
19
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
20
+ };
21
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
22
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
23
+ }).join(" ").trim();
24
+ const hasA11yProp = (props) => {
25
+ for (const prop in props) {
26
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
27
+ return true;
28
+ }
29
+ }
30
+ };
31
+
32
+ /**
33
+ * @license lucide-react v0.522.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */
38
+
39
+ var defaultAttributes = {
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ width: 24,
42
+ height: 24,
43
+ viewBox: "0 0 24 24",
44
+ fill: "none",
45
+ stroke: "currentColor",
46
+ strokeWidth: 2,
47
+ strokeLinecap: "round",
48
+ strokeLinejoin: "round"
49
+ };
50
+
51
+ /**
52
+ * @license lucide-react v0.522.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */
57
+
58
+
59
+ const Icon = React.forwardRef(
60
+ ({
61
+ color = "currentColor",
62
+ size = 24,
63
+ strokeWidth = 2,
64
+ absoluteStrokeWidth,
65
+ className = "",
66
+ children,
67
+ iconNode,
68
+ ...rest
69
+ }, ref) => React.createElement(
70
+ "svg",
71
+ {
72
+ ref,
73
+ ...defaultAttributes,
74
+ width: size,
75
+ height: size,
76
+ stroke: color,
77
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
78
+ className: mergeClasses("lucide", className),
79
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
80
+ ...rest
81
+ },
82
+ [
83
+ ...iconNode.map(([tag, attrs]) => React.createElement(tag, attrs)),
84
+ ...Array.isArray(children) ? children : [children]
85
+ ]
86
+ )
87
+ );
88
+
89
+ /**
90
+ * @license lucide-react v0.522.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */
95
+
96
+
97
+ const createLucideIcon = (iconName, iconNode) => {
98
+ const Component = React.forwardRef(
99
+ ({ className, ...props }, ref) => React.createElement(Icon, {
100
+ ref,
101
+ iconNode,
102
+ className: mergeClasses(
103
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
104
+ `lucide-${iconName}`,
105
+ className
106
+ ),
107
+ ...props
108
+ })
109
+ );
110
+ Component.displayName = toPascalCase(iconName);
111
+ return Component;
112
+ };
113
+
114
+ exports.createLucideIcon = createLucideIcon;
@@ -0,0 +1,34 @@
1
+ export declare const Typography: import("react").ForwardRefExoticComponent<import("./components/Typography/Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>;
2
+ export declare const Button: import("react").ForwardRefExoticComponent<import("./components/Button/Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
3
+ export declare const Input: import("react").ForwardRefExoticComponent<{
4
+ state?: "default" | "disabled" | "error";
5
+ label: string;
6
+ helperText?: string;
7
+ startIcon?: import("react").ReactNode;
8
+ endIcon?: import("react").ReactNode;
9
+ isMobile?: boolean;
10
+ } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "id"> & import("react").RefAttributes<HTMLInputElement>>;
11
+ export declare const Tabs: import("react").ForwardRefExoticComponent<import("./components/Tabs/Tabs").TabsProps & import("react").RefAttributes<HTMLDivElement>>;
12
+ export declare const Drawer: import("react").ForwardRefExoticComponent<import("./components/Drawer/Drawer").DrawerProps & import("react").RefAttributes<HTMLDivElement>>;
13
+ export declare const Backdrop: import("react").ForwardRefExoticComponent<import("./components/Backdrop/Backdrop").BackdropProps & import("react").RefAttributes<HTMLDivElement>>;
14
+ export declare const Breadcrumb: import("react").ForwardRefExoticComponent<import("./components/Breadcrumb/Breadcrumb").BreadcrumbProps & import("react").RefAttributes<HTMLElement>>;
15
+ export declare const Pagination: import("react").FC<import("./components/Pagination/Pagination").UnifiedPaginationProps>;
16
+ export declare const Accordion: import("react").ForwardRefExoticComponent<import("./components/Accordion/Accordion").AccordionProps & import("react").RefAttributes<HTMLDivElement>>;
17
+ export declare const Divider: import("react").ForwardRefExoticComponent<import("./components/Divider/Divider").DividerProps & import("react").RefAttributes<HTMLDivElement>>;
18
+ export declare const RadioGroup: import("react").ForwardRefExoticComponent<import("./components/RadioGroup/RadioGroup").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
19
+ export declare const Chips: import("react").ForwardRefExoticComponent<import("./components/Chips/Chips").ChipsProps & import("react").RefAttributes<HTMLDivElement>>;
20
+ export declare const Menu: import("react").ForwardRefExoticComponent<import("./components/Menu/Menu").MenuProps & import("react").RefAttributes<HTMLDivElement>>;
21
+ export type { TypographyProps, TypographyVariant, } from './components/Typography/Typography';
22
+ export type { ButtonProps, ButtonVariant, ButtonSize, } from './components/Button/Button';
23
+ export type { InputProps } from './components/Input/Input';
24
+ export type { TabsProps, TabItem } from './components/Tabs/Tabs';
25
+ export type { DrawerProps, DrawerDirection } from './components/Drawer/Drawer';
26
+ export type { BackdropProps } from './components/Backdrop/Backdrop';
27
+ export type { BreadcrumbProps, BreadcrumbItem, } from './components/Breadcrumb/Breadcrumb';
28
+ export type { UnifiedPaginationProps as PaginationProps } from './components/Pagination/Pagination';
29
+ export type { AccordionProps } from './components/Accordion/Accordion';
30
+ export type { DividerProps } from './components/Divider/Divider';
31
+ export type { RadioGroupProps, RadioOption, } from './components/RadioGroup/RadioGroup';
32
+ export type { ChipsProps } from './components/Chips/Chips';
33
+ export type { MenuProps, MenuItem } from './components/Menu/Menu';
34
+ export { MobileProvider } from './contexts/MobileContext';
package/dist/cjs/index.js CHANGED
@@ -1 +1,52 @@
1
- "use strict";var e=require("./ProtectedComponent.js"),r=require("./Typography.js"),i=require("./Button.js"),t=require("./Input.js"),o=require("./Tabs.js"),s=require("./Drawer.js"),n=require("./Backdrop.js"),c=require("./Breadcrumb.js"),u=require("./Pagination.js"),p=require("./Accordion.js"),a=require("./Divider.js"),d=require("./RadioGroup.js"),h=require("./Chips.js"),q=require("./Menu.js"),j=require("./licensing.js"),P=require("./contexts.js");require("react/jsx-runtime"),require("react"),require("./utils.js"),require("./chunks/chevron-left-Do__K6cA.js"),require("./chunks/createLucideIcon-BqJVOzoK.js");const w=e.withLicenseProtection(r.Typography,"Typography"),x=e.withLicenseProtection(i.Button,"Button"),L=e.withLicenseProtection(t.Input,"Input"),b=e.withLicenseProtection(o.Tabs,"Tabs"),B=e.withLicenseProtection(s.Drawer,"Drawer"),g=e.withLicenseProtection(n.Backdrop,"Backdrop"),m=e.withLicenseProtection(c.Breadcrumb,"Breadcrumb"),v=e.withLicenseProtection(u.Pagination,"Pagination"),y=e.withLicenseProtection(p.Accordion,"Accordion"),D=e.withLicenseProtection(a.Divider,"Divider"),T=e.withLicenseProtection(d.RadioGroup,"RadioGroup"),l=e.withLicenseProtection(h.Chips,"Chips"),k=e.withLicenseProtection(q.Menu,"Menu");exports.initializeAutomobiKit=j.initializeAutomobiKit,exports.MobileProvider=P.MobileProvider,exports.Accordion=y,exports.Backdrop=g,exports.Breadcrumb=m,exports.Button=x,exports.Chips=l,exports.Divider=D,exports.Drawer=B,exports.Input=L,exports.Menu=k,exports.Pagination=v,exports.RadioGroup=T,exports.Tabs=b,exports.Typography=w;
1
+ 'use strict';
2
+
3
+ var Typography$1 = require('./Typography.js');
4
+ var Button$1 = require('./Button.js');
5
+ var Input$1 = require('./Input.js');
6
+ var Tabs$1 = require('./Tabs.js');
7
+ var Drawer$1 = require('./Drawer.js');
8
+ var Backdrop$1 = require('./Backdrop.js');
9
+ var Breadcrumb$1 = require('./Breadcrumb.js');
10
+ var Pagination$1 = require('./Pagination.js');
11
+ var Accordion$1 = require('./Accordion.js');
12
+ var Divider$1 = require('./Divider.js');
13
+ var RadioGroup$1 = require('./RadioGroup.js');
14
+ var Chips$1 = require('./Chips.js');
15
+ var Menu$1 = require('./Menu.js');
16
+ var contexts = require('./contexts.js');
17
+ require('react');
18
+ require('./utils.js');
19
+ require('react/jsx-runtime');
20
+ require('./chevron-left-COj1qGVo.js');
21
+ require('./createLucideIcon-BTjFFtDc.js');
22
+
23
+ // Original Components (for internal use)
24
+ // Components (direct exports)
25
+ const Typography = Typography$1.Typography;
26
+ const Button = Button$1.Button;
27
+ const Input = Input$1.Input;
28
+ const Tabs = Tabs$1.Tabs;
29
+ const Drawer = Drawer$1.Drawer;
30
+ const Backdrop = Backdrop$1.Backdrop;
31
+ const Breadcrumb = Breadcrumb$1.Breadcrumb;
32
+ const Pagination = Pagination$1.Pagination;
33
+ const Accordion = Accordion$1.Accordion;
34
+ const Divider = Divider$1.Divider;
35
+ const RadioGroup = RadioGroup$1.RadioGroup;
36
+ const Chips = Chips$1.Chips;
37
+ const Menu = Menu$1.Menu;
38
+
39
+ exports.MobileProvider = contexts.MobileProvider;
40
+ exports.Accordion = Accordion;
41
+ exports.Backdrop = Backdrop;
42
+ exports.Breadcrumb = Breadcrumb;
43
+ exports.Button = Button;
44
+ exports.Chips = Chips;
45
+ exports.Divider = Divider;
46
+ exports.Drawer = Drawer;
47
+ exports.Input = Input;
48
+ exports.Menu = Menu;
49
+ exports.Pagination = Pagination;
50
+ exports.RadioGroup = RadioGroup;
51
+ exports.Tabs = Tabs;
52
+ exports.Typography = Typography;
package/dist/cjs/utils.js CHANGED
@@ -1 +1,9 @@
1
- "use strict";function r(e){var t,n,f="";if("string"==typeof e||"number"==typeof e)f+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=r(e[t]))&&(f&&(f+=" "),f+=n)}else for(n in e)e[n]&&(f&&(f+=" "),f+=n);return f}module.exports=function(...e){return function(){for(var e,t,n=0,f="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=r(e))&&(f&&(f+=" "),f+=t);return f}(e)};
1
+ 'use strict';
2
+
3
+ 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}
4
+
5
+ function cn(...inputs) {
6
+ return clsx(inputs);
7
+ }
8
+
9
+ module.exports = cn;
@@ -1 +1,57 @@
1
- "use client";import{jsxs as e,jsx as r}from"react/jsx-runtime";import i,{useState as a}from"react";import t from"./utils.js";import{Typography as n}from"./Typography.js";import{c as o}from"./chunks/createLucideIcon-DGp0SoUT.js";const d=o("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),l=o("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),s=i.forwardRef(({title:i,body:o,startIcon:s,isExpanded:c,onToggle:m,defaultExpanded:u=!1,className:h,id:f,disabled:p=!1,isMobile:b,...y},v)=>{const[x,g]=a(u),N=void 0!==c?c:x,w=f||`accordion-${Math.random().toString(36).substr(2,9)}`,k=`${w}-header`,j=`${w}-content`,$=b?20:24,z=b?"body-s-heavy":"body-l-heavy",E=b?"body-s-medium":"body-m-medium";return e("div",{ref:v,className:t("rounded-2xl border-0 overflow-hidden","transition-all duration-200 ease-in-out",h),...y,children:[e("button",{id:k,type:"button",onClick:()=>{if(p)return;const e=!N;void 0===c&&g(e),m?.(e)},disabled:p,"aria-expanded":N,"aria-controls":j,className:t("w-full flex items-center justify-between",b?"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",!p&&"hover:bg-neutral-lighter"),children:[r("div",{className:"flex-shrink-0 mr-4",children:r(N?l:d,{size:$,className:"text-neutral-darker transition-transform duration-200","aria-hidden":"true"})}),e("div",{className:t("flex items-center flex-1",b?"gap-3":"gap-4"),children:[r("div",{className:"flex-1 text-right",children:r(n,{variant:z,color:"neutral-darker",children:i})}),s&&r("div",{className:t("flex-shrink-0 flex items-center justify-center",b?"w-6 h-6":"w-8 h-8"),children:s})]})]}),r("div",{id:j,role:"region","aria-labelledby":k,className:t("w-full overflow-hidden transition-all duration-300 ease-in-out",N?"max-h-screen opacity-100":"max-h-0 opacity-0"),children:r("div",{className:t(b?"pb-3 mt-1":"pb-4 mt-1.5"),children:r("div",{className:t("bg-neutral-lighter rounded-lg",b?"p-3":"p-4"),children:r(n,{variant:E,color:"neutral-dark",children:o})})})})]})});s.displayName="Accordion";export{s as Accordion};
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import React, { useState } from 'react';
3
+ import cn from './utils.js';
4
+ import { useMobile } from './contexts.js';
5
+ import { Typography } from './Typography.js';
6
+ import { c as createLucideIcon } from './createLucideIcon-D-q73LTT.js';
7
+
8
+ /**
9
+ * @license lucide-react v0.522.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+
15
+
16
+ const __iconNode$1 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
17
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$1);
18
+
19
+ /**
20
+ * @license lucide-react v0.522.0 - ISC
21
+ *
22
+ * This source code is licensed under the ISC license.
23
+ * See the LICENSE file in the root directory of this source tree.
24
+ */
25
+
26
+
27
+ const __iconNode = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
28
+ const ChevronUp = createLucideIcon("chevron-up", __iconNode);
29
+
30
+ const Accordion = React.forwardRef(({ title, body, startIcon, isExpanded: controlledExpanded, onToggle, defaultExpanded = false, className, id, disabled = false, isMobile, ...props }, ref) => {
31
+ const detectedIsMobile = useMobile();
32
+ const actualIsMobile = isMobile ?? detectedIsMobile;
33
+ const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);
34
+ // Use controlled state if provided, otherwise use internal state
35
+ const isExpanded = controlledExpanded !== undefined ? controlledExpanded : internalExpanded;
36
+ const handleToggle = () => {
37
+ if (disabled)
38
+ return;
39
+ const newExpanded = !isExpanded;
40
+ if (controlledExpanded === undefined) {
41
+ setInternalExpanded(newExpanded);
42
+ }
43
+ onToggle?.(newExpanded);
44
+ };
45
+ const accordionId = id || `accordion-${Math.random().toString(36).substr(2, 9)}`;
46
+ const headerId = `${accordionId}-header`;
47
+ const contentId = `${accordionId}-content`;
48
+ // Icon size based on device
49
+ const iconSize = actualIsMobile ? 20 : 24;
50
+ // Typography variants based on device
51
+ const titleVariant = actualIsMobile ? 'body-s-heavy' : 'body-l-heavy';
52
+ const bodyVariant = actualIsMobile ? 'body-s-medium' : 'body-m-medium';
53
+ return (jsxs("div", { ref: ref, className: cn('rounded-2xl border-0 overflow-hidden', 'transition-all duration-200 ease-in-out', className), ...props, children: [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', 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: [jsx("div", { className: "flex-shrink-0 mr-4", children: isExpanded ? (jsx(ChevronUp, { size: iconSize, className: "text-neutral-darker transition-transform duration-200", "aria-hidden": "true" })) : (jsx(ChevronDown, { size: iconSize, className: "text-neutral-darker transition-transform duration-200", "aria-hidden": "true" })) }), jsxs("div", { className: cn('flex items-center flex-1', actualIsMobile ? 'gap-3' : 'gap-4'), children: [jsx("div", { className: "flex-1 text-right", children: jsx(Typography, { variant: titleVariant, color: "neutral-darker", children: title }) }), startIcon && (jsx("div", { className: cn('flex-shrink-0 flex items-center justify-center', actualIsMobile ? 'w-6 h-6' : 'w-8 h-8'), children: startIcon }))] })] }), 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: jsx("div", { className: cn(actualIsMobile ? 'pb-3 mt-1' : 'pb-4 mt-1.5'), children: jsx("div", { className: cn('bg-neutral-lighter rounded-lg', actualIsMobile ? 'p-3' : 'p-4'), children: jsx(Typography, { variant: bodyVariant, color: "neutral-dark", children: body }) }) }) })] }));
54
+ });
55
+ Accordion.displayName = 'Accordion';
56
+
57
+ export { Accordion };
@@ -1 +1,24 @@
1
- import{jsx as r}from"react/jsx-runtime";import e from"react";import t from"./utils.js";const o=e.forwardRef(({isOpen:e=!1,onClick:o,blur:n=!1,zIndex:a=51,className:i,children:s,...c},l)=>{const d=t("fixed inset-0 transition-all duration-300",{"opacity-100 pointer-events-auto":e,"opacity-0 pointer-events-none":!e,"backdrop-blur-sm":n},i);return r("div",{ref:l,className:d,style:{backgroundColor:"rgba(0, 0, 0, 0.60)",zIndex:a},onClick:r=>{o&&r.target===r.currentTarget&&o()},role:"presentation","aria-hidden":!e,...c,children:s})});o.displayName="Backdrop";export{o as Backdrop};
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import cn from './utils.js';
4
+
5
+ const Backdrop = React.forwardRef(({ isOpen = false, onClick, blur = false, zIndex = 51, className, children, ...props }, ref) => {
6
+ const handleClick = (event) => {
7
+ if (onClick && event.target === event.currentTarget) {
8
+ onClick();
9
+ }
10
+ };
11
+ const backdropClasses = cn('fixed inset-0 transition-all duration-300', {
12
+ 'opacity-100 pointer-events-auto': isOpen,
13
+ 'opacity-0 pointer-events-none': !isOpen,
14
+ 'backdrop-blur-sm': blur,
15
+ }, className);
16
+ const backdropStyle = {
17
+ backgroundColor: 'rgba(0, 0, 0, 0.60)',
18
+ zIndex,
19
+ };
20
+ return (jsx("div", { ref: ref, className: backdropClasses, style: backdropStyle, onClick: handleClick, role: "presentation", "aria-hidden": !isOpen, ...props, children: children }));
21
+ });
22
+ Backdrop.displayName = 'Backdrop';
23
+
24
+ export { Backdrop };
@@ -1 +1,59 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import a from"react";import t from"./utils.js";import{C as n}from"./chunks/chevron-left-4HSuTes3.js";import"./chunks/createLucideIcon-DGp0SoUT.js";const l=a.forwardRef(({items:a,className:l,isMobile:i},o)=>e("nav",{ref:o,className:t("flex flex-row-reverse items-center",i?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",l),"aria-label":"Breadcrumb navigation",children:e("ol",{className:"flex flex-row-reverse items-center gap-inherit",children:a.map((l,o)=>{const s=o===a.length-1,c=!s&&(l.href||l.onClick),m=`${l.label}-${o}`;return r("li",{className:"flex items-center gap-inherit",children:[c?e("a",{href:l.href||"#",className:t("whitespace-nowrap border-0 bg-transparent p-0 no-underline",i?"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,r,t)=>{r!==a.length-1&&e.onClick&&(t.preventDefault(),e.onClick())})(l,o,e),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l.onClick&&l.onClick())},"aria-label":`Go to ${l.label}`,children:l.label}):e("span",{className:t("whitespace-nowrap",i?"text-t":"text-s","text-neutral-main","font-medium"),"aria-current":s?"page":void 0,"aria-label":s?`Current page: ${l.label}`:void 0,children:l.label}),!s&&e(n,{className:t("text-black flex-shrink-0",i?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},m)})})}));l.displayName="Breadcrumb";export{l as Breadcrumb};
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import cn from './utils.js';
4
+ import { useMobile } from './contexts.js';
5
+ import { C as ChevronLeft } from './chevron-left-Ck6O99eF.js';
6
+ import './createLucideIcon-D-q73LTT.js';
7
+
8
+ const Breadcrumb = React.forwardRef(({ items, className, isMobile }, ref) => {
9
+ const detectedIsMobile = useMobile();
10
+ const actualIsMobile = isMobile ?? detectedIsMobile;
11
+ const handleItemClick = (item, index, e) => {
12
+ // Don't make the last item (current page) clickable
13
+ if (index === items.length - 1)
14
+ return;
15
+ if (item.onClick) {
16
+ e.preventDefault();
17
+ item.onClick();
18
+ }
19
+ // If item has href, let the anchor tag handle navigation naturally
20
+ };
21
+ return (jsx("nav", { ref: ref, className: cn(
22
+ // Base layout - RTL with flex-row-reverse to show items right to left
23
+ 'flex flex-row-reverse items-center',
24
+ // Responsive gap and padding based on mobile state
25
+ actualIsMobile ? 'gap-1 px-4 py-2.5' : 'gap-3 pr-1 pt-3 pb-4 pl-0', className), "aria-label": "Breadcrumb navigation", children: jsx("ol", { className: "flex flex-row-reverse items-center gap-inherit", children: items.map((item, index) => {
26
+ const isLast = index === items.length - 1;
27
+ const isClickable = !isLast && (item.href || item.onClick);
28
+ const itemKey = `${item.label}-${index}`;
29
+ return (jsxs("li", { className: "flex items-center gap-inherit", children: [isClickable ? (jsx("a", { href: item.href || '#', className: cn(
30
+ // Base styles
31
+ 'whitespace-nowrap border-0 bg-transparent p-0 no-underline',
32
+ // Responsive font size based on mobile state
33
+ actualIsMobile ? 'text-t' : 'text-s',
34
+ // Color
35
+ 'text-neutral-main',
36
+ // Cursor and hover effects for clickable items
37
+ '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) => {
38
+ if (e.key === 'Enter' || e.key === ' ') {
39
+ e.preventDefault();
40
+ if (item.onClick) {
41
+ item.onClick();
42
+ }
43
+ }
44
+ }, "aria-label": `Go to ${item.label}`, children: item.label })) : (jsx("span", { className: cn(
45
+ // Base styles
46
+ 'whitespace-nowrap',
47
+ // Responsive font size based on mobile state
48
+ actualIsMobile ? 'text-t' : 'text-s',
49
+ // Color
50
+ 'text-neutral-main',
51
+ // Different styles for current page (last item)
52
+ 'font-medium'), "aria-current": isLast ? 'page' : undefined, "aria-label": isLast ? `Current page: ${item.label}` : undefined, children: item.label })), !isLast && (jsx(ChevronLeft, { className: cn('text-black flex-shrink-0',
53
+ // Responsive icon size
54
+ actualIsMobile ? 'w-2.5 h-2.5' : 'w-3 h-3'), "aria-hidden": "true" }))] }, itemKey));
55
+ }) }) }));
56
+ });
57
+ Breadcrumb.displayName = 'Breadcrumb';
58
+
59
+ export { Breadcrumb };
@@ -1 +1,46 @@
1
- import{jsxs as r,jsx as e}from"react/jsx-runtime";import a from"react";import t from"./utils.js";import{getTypographyClasses as o}from"./Typography.js";const l={sm:"px-[16px] py-[7px]",md:"px-[16px] py-[9px]",lg:"px-[16px] py-[13px]",xl:"px-[20px] py-[13px]"},i={sm:"body-s-bold",md:"body-m-bold",lg:"body-l-bold",xl:"body-xl-heavy"},n={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 "},d=a.forwardRef(({className:a,variant:d="primary",size:s="md",icon:p,iconPosition:c="right",children:m,loading:b=!1,disabled:x,textVariant:g,...y},v)=>r("button",{ref:v,type:"button",className:t("inline-flex items-center justify-center rounded-[8px] transition-colors duration-200",l[s],n[d],o(g||i[s]),x&&"opacity-50 pointer-events-none",a),disabled:x||b,...y,children:[p&&"left"===c&&e("span",{className:"mr-2 flex items-center",children:p}),b?"...":m,p&&"right"===c&&e("span",{className:"ml-2 flex items-center",children:p})]}));d.displayName="Button";export{d as Button};
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import cn from './utils.js';
4
+ import { getTypographyClasses } from './Typography.js';
5
+
6
+ const sizeClasses = {
7
+ sm: 'px-[16px] py-[7px]',
8
+ md: 'px-[16px] py-[9px]',
9
+ lg: 'px-[16px] py-[13px]',
10
+ xl: 'px-[20px] py-[13px]',
11
+ };
12
+ const defaultTextVariants = {
13
+ sm: 'body-s-bold', // 14px / Bold (600)
14
+ md: 'body-m-bold', // 16px / Bold (600)
15
+ lg: 'body-l-bold', // 18px / Bold (600)
16
+ xl: 'body-xl-heavy', // 20px / Heavy (700)
17
+ };
18
+ const variantClasses = {
19
+ primary: `
20
+ bg-[var(--color-primary)] text-white
21
+ hover:bg-[var(--color-primary-dark)]
22
+ disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
23
+ `,
24
+ secondary: `
25
+ bg-[var(--color-primary-lightest)] text-[var(--color-primary)]
26
+ hover:bg-[var(--color-primary-lighter)]
27
+ disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
28
+ `,
29
+ tertiary: `
30
+ bg-white border border-[var(--color-primary-light)] text-[var(--color-primary)]
31
+ hover:bg-[var(--color-neutral-lighter)]
32
+ disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
33
+ `,
34
+ ghost: `
35
+ bg-transparent text-[var(--color-primary)]
36
+ hover:bg-[var(--color-primary-lightest)]
37
+ disabled:bg-[var(--color-neutral-light)] disabled:text-[var(--color-neutral-darker)]
38
+ `,
39
+ };
40
+ const Button = React.forwardRef(({ className, variant = 'primary', size = 'md', icon, iconPosition = 'right', children, loading = false, disabled, textVariant, ...props }, ref) => {
41
+ const finalTextVariant = textVariant || defaultTextVariants[size];
42
+ return (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' && (jsx("span", { className: "mr-2 flex items-center", children: icon })), loading ? '...' : children, icon && iconPosition === 'right' && (jsx("span", { className: "ml-2 flex items-center", children: icon }))] }));
43
+ });
44
+ Button.displayName = 'Button';
45
+
46
+ export { Button };
package/dist/esm/Chips.js CHANGED
@@ -1 +1,112 @@
1
- import{jsxs as r,jsx as e}from"react/jsx-runtime";import o from"react";import t from"./utils.js";import{c as a}from"./chunks/createLucideIcon-DGp0SoUT.js";const i=a("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),n={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)]"}},l={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]"}},d=o.forwardRef(({variant:o="purple",size:a,children:d="متن پیشفرض",disabled:c=!1,onClick:s,onIconClick:b,className:p,isMobile:g,...u},x)=>{const v=n[c?"disabled":o],f=l[a||(g?"mobile":"desktop")],handleIconClick=r=>{r.stopPropagation(),b&&b()};return r("div",{ref:x,className:t("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",v.background,v.text,v.border,f.padding,f.gap,f.fontSize,f.lineHeight,s&&!c&&"cursor-pointer hover:opacity-80",c&&"cursor-not-allowed opacity-60",p),onClick:c?void 0:s,onKeyDown:s&&!c?r=>{"Enter"!==r.key&&" "!==r.key||!s||c||(r.preventDefault(),s())}:void 0,tabIndex:s&&!c?0:void 0,role:s?"button":void 0,...u,children:[e("span",{className:"text-center",children:d}),(()=>{const r=e(i,{className:t(f.iconSize)});return b?e("button",{type:"button",onClick:handleIconClick,disabled:c,className:t("flex items-center justify-center","hover:opacity-70 transition-opacity",c&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:r}):r})()]})});d.displayName="Chips";export{d as Chips,d as default};
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import cn from './utils.js';
4
+ import { useMobile } from './contexts.js';
5
+ import { c as createLucideIcon } from './createLucideIcon-D-q73LTT.js';
6
+
7
+ /**
8
+ * @license lucide-react v0.522.0 - ISC
9
+ *
10
+ * This source code is licensed under the ISC license.
11
+ * See the LICENSE file in the root directory of this source tree.
12
+ */
13
+
14
+
15
+ const __iconNode = [
16
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
17
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
18
+ ];
19
+ const X = createLucideIcon("x", __iconNode);
20
+
21
+ const chipVariants = {
22
+ purple: {
23
+ background: 'bg-[var(--color-primary-lightest)]',
24
+ text: 'text-[var(--color-primary-darkest)]',
25
+ border: 'border-[var(--color-primary-light)]',
26
+ },
27
+ red: {
28
+ background: 'bg-[var(--color-error-light)]',
29
+ text: 'text-[var(--color-error)]',
30
+ border: 'border-[#f0d6d6]',
31
+ },
32
+ green: {
33
+ background: 'bg-[var(--color-success-light)]',
34
+ text: 'text-[var(--color-success)]',
35
+ border: 'border-[#d4e8dc]',
36
+ },
37
+ orange: {
38
+ background: 'bg-[var(--color-warning-light)]',
39
+ text: 'text-[var(--color-warning)]',
40
+ border: 'border-[#f5e1d1]',
41
+ },
42
+ blue: {
43
+ background: 'bg-[var(--color-info-light)]',
44
+ text: 'text-[var(--color-info)]',
45
+ border: 'border-[#d3e9f2]',
46
+ },
47
+ white: {
48
+ background: 'bg-[var(--color-white)]',
49
+ text: 'text-[var(--color-neutral-darker)]',
50
+ border: 'border-[var(--color-neutral-light)]',
51
+ },
52
+ disabled: {
53
+ background: 'bg-[var(--color-neutral-lighter)]',
54
+ text: 'text-[var(--color-neutral-main)]',
55
+ border: 'border-[var(--color-neutral-light)]',
56
+ },
57
+ };
58
+ const chipSizes = {
59
+ mobile: {
60
+ padding: 'px-2.5 py-1',
61
+ gap: 'gap-1',
62
+ iconSize: 'size-4',
63
+ fontSize: 'text-[12px]',
64
+ lineHeight: 'leading-[1.8]',
65
+ },
66
+ desktop: {
67
+ padding: 'px-3 py-1',
68
+ gap: 'gap-1.5',
69
+ iconSize: 'size-5',
70
+ fontSize: 'text-[14px]',
71
+ lineHeight: 'leading-[24px]',
72
+ },
73
+ };
74
+ const Chips = React.forwardRef(({ variant = 'purple', size, children = 'متن پیشفرض', disabled = false, onClick, onIconClick, className, isMobile, ...props }, ref) => {
75
+ const detectedIsMobile = useMobile();
76
+ const actualIsMobile = isMobile ?? detectedIsMobile;
77
+ const actualSize = size || (actualIsMobile ? 'mobile' : 'desktop');
78
+ const actualVariant = disabled ? 'disabled' : variant;
79
+ const variantStyles = chipVariants[actualVariant];
80
+ const sizeStyles = chipSizes[actualSize];
81
+ const handleIconClick = (e) => {
82
+ e.stopPropagation();
83
+ if (onIconClick) {
84
+ onIconClick();
85
+ }
86
+ };
87
+ const handleKeyDown = (e) => {
88
+ if ((e.key === 'Enter' || e.key === ' ') && onClick && !disabled) {
89
+ e.preventDefault();
90
+ onClick();
91
+ }
92
+ };
93
+ const renderIcon = () => {
94
+ const iconElement = jsx(X, { className: cn(sizeStyles.iconSize) });
95
+ if (onIconClick) {
96
+ return (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 }));
97
+ }
98
+ return iconElement;
99
+ };
100
+ return (jsxs("div", { ref: ref, className: cn(
101
+ // Base styles
102
+ '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',
103
+ // Variant styles
104
+ variantStyles.background, variantStyles.text, variantStyles.border,
105
+ // Size styles
106
+ sizeStyles.padding, sizeStyles.gap, sizeStyles.fontSize, sizeStyles.lineHeight,
107
+ // Interactive styles
108
+ 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: [jsx("span", { className: "text-center", children: children }), renderIcon()] }));
109
+ });
110
+ Chips.displayName = 'Chips';
111
+
112
+ export { Chips, Chips as default };
@@ -1 +1,21 @@
1
- import{jsx as r}from"react/jsx-runtime";import t from"react";import i from"./utils.js";const a=t.forwardRef(({width:t="100%",height:a=1,orientation:e="horizontal",variant:o="neutral-light",className:l,style:n,...m},s)=>{const h="horizontal"===e,g={width:h?t:a,height:h?a:t,...n};return r("div",{ref:s,className:i("shrink-0",{"neutral-light":"bg-neutral-light","neutral-main":"bg-neutral-main",primary:"bg-primary"}[o],l),style:g,role:"separator",...m})});a.displayName="Divider";export{a as Divider};
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import cn from './utils.js';
4
+
5
+ const Divider = React.forwardRef(({ width = '100%', height = 1, orientation = 'horizontal', variant = 'neutral-light', className, style, ...props }, ref) => {
6
+ const isHorizontal = orientation === 'horizontal';
7
+ const variantClasses = {
8
+ 'neutral-light': 'bg-neutral-light',
9
+ 'neutral-main': 'bg-neutral-main',
10
+ primary: 'bg-primary',
11
+ };
12
+ const dividerStyle = {
13
+ width: isHorizontal ? width : height,
14
+ height: isHorizontal ? height : width,
15
+ ...style,
16
+ };
17
+ return (jsx("div", { ref: ref, className: cn('shrink-0', variantClasses[variant], className), style: dividerStyle, role: "separator", ...props }));
18
+ });
19
+ Divider.displayName = 'Divider';
20
+
21
+ export { Divider };