automoby-kit 1.0.37 → 1.0.39
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/dist/cjs/Breadcrumb.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js"),
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js"),n=require("./contexts.js"),i=require("./chunks/chevron-left-Do__K6cA.js");require("./chunks/createLucideIcon-BqJVOzoK.js");const a=r.forwardRef(({items:r,className:a,isMobile:s},l)=>{const o=n.useMobile(),c=s??o;return e.jsx("nav",{ref:l,className:t("flex items-center",c?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",a),"aria-label":"Breadcrumb navigation",children:e.jsx("ol",{className:"flex items-center gap-inherit",children:r.map((n,a)=>{const s=a===r.length-1,l=!s&&!!n.onClick,o=`${n.label}-${a}`;return e.jsxs("li",{className:"flex items-center gap-inherit",children:[e.jsx("span",{className:t("whitespace-nowrap",c?"text-t":"text-s","text-neutral-main",s?"font-medium":void 0,l?"cursor-pointer hover:text-neutral-dark transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-sm":void 0),role:l?"button":void 0,tabIndex:l?0:void 0,"aria-current":s?"page":void 0,"aria-label":s?`Current page: ${n.label}`:void 0,onClick:l?e=>((e,t,n)=>{t!==r.length-1&&e.onClick&&(n.preventDefault(),e.onClick())})(n,a,e):void 0,onKeyDown:l?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick&&n.onClick())}:void 0,children:n.label}),!s&&e.jsx(i.ChevronLeft,{className:t("text-neutral-main flex-shrink-0",c?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},o)})})})});a.displayName="Breadcrumb",exports.Breadcrumb=a;
|
package/dist/esm/Breadcrumb.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"react";import
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"react";import n from"./utils.js";import{useMobile as i}from"./contexts.js";import{C as a}from"./chunks/chevron-left-4HSuTes3.js";import"./chunks/createLucideIcon-DGp0SoUT.js";const o=t.forwardRef(({items:t,className:o,isMobile:l},s)=>{const c=i(),m=l??c;return e("nav",{ref:s,className:n("flex items-center",m?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",o),"aria-label":"Breadcrumb navigation",children:e("ol",{className:"flex items-center gap-inherit",children:t.map((i,o)=>{const l=o===t.length-1,s=!l&&!!i.onClick,c=`${i.label}-${o}`;return r("li",{className:"flex items-center gap-inherit",children:[e("span",{className:n("whitespace-nowrap",m?"text-t":"text-s","text-neutral-main",l?"font-medium":void 0,s?"cursor-pointer hover:text-neutral-dark transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-sm":void 0),role:s?"button":void 0,tabIndex:s?0:void 0,"aria-current":l?"page":void 0,"aria-label":l?`Current page: ${i.label}`:void 0,onClick:s?e=>((e,r,n)=>{r!==t.length-1&&e.onClick&&(n.preventDefault(),e.onClick())})(i,o,e):void 0,onKeyDown:s?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i.onClick&&i.onClick())}:void 0,children:i.label}),!l&&e(a,{className:n("text-neutral-main flex-shrink-0",m?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},c)})})})});o.displayName="Breadcrumb";export{o as Breadcrumb};
|
package/dist/types/Breadcrumb.js
CHANGED
|
@@ -16,40 +16,29 @@ const Breadcrumb = React.forwardRef(({ items, className, isMobile }, ref) => {
|
|
|
16
16
|
e.preventDefault();
|
|
17
17
|
item.onClick();
|
|
18
18
|
}
|
|
19
|
-
// If item has href, let the anchor tag handle navigation naturally
|
|
20
19
|
};
|
|
21
20
|
return (jsx("nav", { ref: ref, className: cn(
|
|
22
|
-
// Base layout -
|
|
23
|
-
'flex
|
|
21
|
+
// Base layout - rely on page RTL direction; no manual row-reverse
|
|
22
|
+
'flex items-center',
|
|
24
23
|
// 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
|
|
24
|
+
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 items-center gap-inherit", children: items.map((item, index) => {
|
|
26
25
|
const isLast = index === items.length - 1;
|
|
27
|
-
const isClickable = !isLast &&
|
|
26
|
+
const isClickable = !isLast && !!item.onClick;
|
|
28
27
|
const itemKey = `${item.label}-${index}`;
|
|
29
|
-
return (jsxs("li", { className: "flex items-center gap-inherit", children: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (item.onClick) {
|
|
41
|
-
item.onClick();
|
|
28
|
+
return (jsxs("li", { className: "flex items-center gap-inherit", children: [jsx("span", { className: cn('whitespace-nowrap', actualIsMobile ? 'text-t' : 'text-s', 'text-neutral-main', isLast ? 'font-medium' : undefined, isClickable
|
|
29
|
+
? 'cursor-pointer hover:text-neutral-dark transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-sm'
|
|
30
|
+
: undefined), role: isClickable ? 'button' : undefined, tabIndex: isClickable ? 0 : undefined, "aria-current": isLast ? 'page' : undefined, "aria-label": isLast ? `Current page: ${item.label}` : undefined, onClick: isClickable
|
|
31
|
+
? (e) => handleItemClick(item, index, e)
|
|
32
|
+
: undefined, onKeyDown: isClickable
|
|
33
|
+
? (e) => {
|
|
34
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
if (item.onClick) {
|
|
37
|
+
item.onClick();
|
|
38
|
+
}
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
|
-
|
|
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',
|
|
41
|
+
: undefined, children: item.label }), !isLast && (jsx(ChevronLeft, { className: cn('text-neutral-main flex-shrink-0',
|
|
53
42
|
// Responsive icon size
|
|
54
43
|
actualIsMobile ? 'w-2.5 h-2.5' : 'w-3 h-3'), "aria-hidden": "true" }))] }, itemKey));
|
|
55
44
|
}) }) }));
|
|
@@ -36,11 +36,9 @@ declare const _default: {
|
|
|
36
36
|
args: {
|
|
37
37
|
items: ({
|
|
38
38
|
label: string;
|
|
39
|
-
href: string;
|
|
40
39
|
onClick: () => void;
|
|
41
40
|
} | {
|
|
42
41
|
label: string;
|
|
43
|
-
href?: undefined;
|
|
44
42
|
onClick?: undefined;
|
|
45
43
|
})[];
|
|
46
44
|
isMobile: boolean;
|
|
@@ -53,11 +51,9 @@ export declare const Default: {
|
|
|
53
51
|
args: {
|
|
54
52
|
items: ({
|
|
55
53
|
label: string;
|
|
56
|
-
href: string;
|
|
57
54
|
onClick: () => void;
|
|
58
55
|
} | {
|
|
59
56
|
label: string;
|
|
60
|
-
href?: undefined;
|
|
61
57
|
onClick?: undefined;
|
|
62
58
|
})[];
|
|
63
59
|
};
|
|
@@ -68,11 +64,9 @@ export declare const ShortBreadcrumb: {
|
|
|
68
64
|
args: {
|
|
69
65
|
items: ({
|
|
70
66
|
label: string;
|
|
71
|
-
href: string;
|
|
72
67
|
onClick: () => void;
|
|
73
68
|
} | {
|
|
74
69
|
label: string;
|
|
75
|
-
href?: undefined;
|
|
76
70
|
onClick?: undefined;
|
|
77
71
|
})[];
|
|
78
72
|
};
|
|
@@ -83,11 +77,9 @@ export declare const LongBreadcrumb: {
|
|
|
83
77
|
args: {
|
|
84
78
|
items: ({
|
|
85
79
|
label: string;
|
|
86
|
-
href: string;
|
|
87
80
|
onClick: () => void;
|
|
88
81
|
} | {
|
|
89
82
|
label: string;
|
|
90
|
-
href?: undefined;
|
|
91
83
|
onClick?: undefined;
|
|
92
84
|
})[];
|
|
93
85
|
};
|
|
@@ -111,19 +103,9 @@ export declare const WithMixedNavigation: {
|
|
|
111
103
|
args: {
|
|
112
104
|
items: ({
|
|
113
105
|
label: string;
|
|
114
|
-
href: string;
|
|
115
|
-
onClick?: undefined;
|
|
116
|
-
} | {
|
|
117
|
-
label: string;
|
|
118
|
-
onClick: () => void;
|
|
119
|
-
href?: undefined;
|
|
120
|
-
} | {
|
|
121
|
-
label: string;
|
|
122
|
-
href: string;
|
|
123
106
|
onClick: () => void;
|
|
124
107
|
} | {
|
|
125
108
|
label: string;
|
|
126
|
-
href?: undefined;
|
|
127
109
|
onClick?: undefined;
|
|
128
110
|
})[];
|
|
129
111
|
};
|
|
@@ -134,11 +116,9 @@ export declare const EnglishContent: {
|
|
|
134
116
|
args: {
|
|
135
117
|
items: ({
|
|
136
118
|
label: string;
|
|
137
|
-
href: string;
|
|
138
119
|
onClick: () => void;
|
|
139
120
|
} | {
|
|
140
121
|
label: string;
|
|
141
|
-
href?: undefined;
|
|
142
122
|
onClick?: undefined;
|
|
143
123
|
})[];
|
|
144
124
|
};
|