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.
- package/README.md +7 -71
- package/dist/cjs/Accordion.js +59 -1
- package/dist/cjs/Backdrop.js +26 -1
- package/dist/cjs/Breadcrumb.js +61 -1
- package/dist/cjs/Button.js +48 -1
- package/dist/cjs/Chips.js +117 -1
- package/dist/cjs/Divider.js +23 -1
- package/dist/cjs/Drawer.js +112 -1
- package/dist/cjs/Input.js +84 -1
- package/dist/cjs/Menu.js +122 -1
- package/dist/cjs/Pagination.js +188 -1
- package/dist/cjs/RadioGroup.js +73 -1
- package/dist/cjs/Tabs.js +54 -1
- package/dist/cjs/Typography.js +63 -1
- package/dist/cjs/chevron-left-COj1qGVo.js +16 -0
- package/dist/{types → cjs}/components/Accordion/Accordion.d.ts +2 -2
- package/dist/{types → cjs}/components/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/dist/{types → cjs}/components/Chips/Chips.d.ts +5 -5
- package/dist/{types → cjs}/components/Drawer/Drawer.d.ts +2 -2
- package/dist/{types → cjs}/components/Input/Input.d.ts +4 -4
- package/dist/{types → cjs}/components/Input/Input.stories.d.ts +1 -1
- package/dist/{types → cjs}/components/Pagination/Pagination.d.ts +2 -2
- package/dist/{types → cjs}/components/RadioGroup/RadioGroup.d.ts +2 -2
- package/dist/cjs/components/Select/Select.d.ts +17 -0
- package/dist/cjs/components/Select/Select.stories.d.ts +104 -0
- package/dist/{types → cjs}/components/Tabs/Tabs.d.ts +2 -2
- package/dist/{types → cjs}/contexts/MobileContext.d.ts +1 -0
- package/dist/cjs/contexts.js +1491 -1
- package/dist/cjs/createLucideIcon-BTjFFtDc.js +114 -0
- package/dist/cjs/index.d.ts +34 -0
- package/dist/cjs/index.js +52 -1
- package/dist/cjs/utils.js +9 -1
- package/dist/esm/Accordion.js +57 -1
- package/dist/esm/Backdrop.js +24 -1
- package/dist/esm/Breadcrumb.js +59 -1
- package/dist/esm/Button.js +46 -1
- package/dist/esm/Chips.js +112 -1
- package/dist/esm/Divider.js +21 -1
- package/dist/esm/Drawer.js +110 -1
- package/dist/esm/Input.js +82 -1
- package/dist/esm/Menu.js +120 -1
- package/dist/esm/Pagination.js +186 -1
- package/dist/esm/RadioGroup.js +71 -1
- package/dist/esm/Tabs.js +52 -1
- package/dist/esm/Typography.js +60 -1
- package/dist/esm/components/Accordion/Accordion.d.ts +25 -0
- package/dist/esm/components/Accordion/Accordion.stories.d.ts +175 -0
- package/dist/esm/components/Backdrop/Backdrop.d.ts +20 -0
- package/dist/esm/components/Backdrop/Backdrop.stories.d.ts +9 -0
- package/dist/esm/components/Breadcrumb/Breadcrumb.d.ts +16 -0
- package/dist/esm/components/Breadcrumb/Breadcrumb.stories.d.ts +177 -0
- package/dist/esm/components/Button/Button.d.ts +13 -0
- package/dist/esm/components/Button/Button.stories.d.ts +100 -0
- package/dist/esm/components/Chips/Chips.d.ts +37 -0
- package/dist/esm/components/Chips/Chips.stories.d.ts +90 -0
- package/dist/esm/components/Divider/Divider.d.ts +25 -0
- package/dist/esm/components/Divider/Divider.stories.d.ts +88 -0
- package/dist/esm/components/Drawer/Drawer.d.ts +16 -0
- package/dist/esm/components/Drawer/Drawer.stories.d.ts +128 -0
- package/dist/esm/components/Input/Input.d.ts +24 -0
- package/dist/esm/components/Input/Input.stories.d.ts +131 -0
- package/dist/esm/components/Menu/Menu.d.ts +39 -0
- package/dist/esm/components/Menu/Menu.stories.d.ts +89 -0
- package/dist/esm/components/Pagination/Pagination.d.ts +12 -0
- package/dist/esm/components/Pagination/Pagination.stories.d.ts +76 -0
- package/dist/esm/components/RadioGroup/RadioGroup.d.ts +55 -0
- package/dist/esm/components/RadioGroup/RadioGroup.stories.d.ts +86 -0
- package/dist/esm/components/Select/Select.d.ts +17 -0
- package/dist/esm/components/Select/Select.stories.d.ts +104 -0
- package/dist/esm/components/Tabs/Tabs.d.ts +43 -0
- package/dist/esm/components/Tabs/Tabs.stories.d.ts +66 -0
- package/dist/esm/components/Typography/Typography.d.ts +9 -0
- package/dist/esm/components/Typography/Typography.stories.d.ts +57 -0
- package/dist/esm/contexts/MobileContext.d.ts +13 -0
- package/dist/esm/contexts.js +1485 -1
- package/dist/esm/index.d.ts +34 -0
- package/dist/esm/index.js +37 -1
- package/dist/esm/utils/cn.d.ts +2 -0
- package/dist/esm/utils.js +7 -1
- package/package.json +2 -7
- package/dist/cjs/ProtectedComponent.js +0 -1
- package/dist/cjs/licensing.js +0 -1
- package/dist/esm/ProtectedComponent.js +0 -1
- package/dist/esm/licensing.js +0 -1
- package/dist/types/Accordion.js +0 -54
- package/dist/types/Backdrop.js +0 -24
- package/dist/types/Breadcrumb.js +0 -56
- package/dist/types/Button.js +0 -46
- package/dist/types/Chips.js +0 -109
- package/dist/types/Divider.js +0 -21
- package/dist/types/Drawer.js +0 -107
- package/dist/types/Input.js +0 -78
- package/dist/types/Menu.js +0 -120
- package/dist/types/Pagination.js +0 -183
- package/dist/types/ProtectedComponent.js +0 -33
- package/dist/types/RadioGroup.js +0 -68
- package/dist/types/Tabs.js +0 -49
- package/dist/types/Typography.js +0 -60
- package/dist/types/components/ProtectedComponent.d.ts +0 -5
- package/dist/types/contexts.js +0 -1478
- package/dist/types/index.d.ts +0 -36
- package/dist/types/index.js +0 -38
- package/dist/types/licensing/LicenseManager.d.ts +0 -41
- package/dist/types/licensing/index.d.ts +0 -30
- package/dist/types/licensing.js +0 -125
- package/dist/types/utils.js +0 -7
- /package/dist/{types → cjs}/components/Accordion/Accordion.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Backdrop/Backdrop.d.ts +0 -0
- /package/dist/{types → cjs}/components/Backdrop/Backdrop.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Breadcrumb/Breadcrumb.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Button/Button.d.ts +0 -0
- /package/dist/{types → cjs}/components/Button/Button.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Chips/Chips.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Divider/Divider.d.ts +0 -0
- /package/dist/{types → cjs}/components/Divider/Divider.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Drawer/Drawer.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Menu/Menu.d.ts +0 -0
- /package/dist/{types → cjs}/components/Menu/Menu.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Pagination/Pagination.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/RadioGroup/RadioGroup.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Tabs/Tabs.stories.d.ts +0 -0
- /package/dist/{types → cjs}/components/Typography/Typography.d.ts +0 -0
- /package/dist/{types → cjs}/components/Typography/Typography.stories.d.ts +0 -0
- /package/dist/{types → cjs}/utils/cn.d.ts +0 -0
- /package/dist/{types → esm}/chevron-left-Ck6O99eF.js +0 -0
- /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
|
-
|
|
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
|
-
|
|
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;
|
package/dist/esm/Accordion.js
CHANGED
|
@@ -1 +1,57 @@
|
|
|
1
|
-
|
|
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 };
|
package/dist/esm/Backdrop.js
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
-
import{jsx
|
|
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 };
|
package/dist/esm/Breadcrumb.js
CHANGED
|
@@ -1 +1,59 @@
|
|
|
1
|
-
import{jsx
|
|
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 };
|
package/dist/esm/Button.js
CHANGED
|
@@ -1 +1,46 @@
|
|
|
1
|
-
import{jsxs
|
|
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
|
|
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 };
|
package/dist/esm/Divider.js
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
import{jsx
|
|
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 };
|