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.
@@ -1 +1 @@
1
- "use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js"),a=require("./contexts.js"),n=require("./chunks/chevron-left-Do__K6cA.js");require("./chunks/createLucideIcon-BqJVOzoK.js");const s=r.forwardRef(({items:r,className:s,isMobile:l},i)=>{const c=a.useMobile(),o=l??c;return e.jsx("nav",{ref:i,className:t("flex flex-row-reverse items-center",o?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",s),"aria-label":"Breadcrumb navigation",children:e.jsx("ol",{className:"flex flex-row-reverse items-center gap-inherit",children:r.map((a,s)=>{const l=s===r.length-1,i=!l&&(a.href||a.onClick),c=`${a.label}-${s}`;return e.jsxs("li",{className:"flex items-center gap-inherit",children:[i?e.jsx("a",{href:a.href||"#",className:t("whitespace-nowrap border-0 bg-transparent p-0 no-underline",o?"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,t,a)=>{t!==r.length-1&&e.onClick&&(a.preventDefault(),e.onClick())})(a,s,e),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a.onClick&&a.onClick())},"aria-label":`Go to ${a.label}`,children:a.label}):e.jsx("span",{className:t("whitespace-nowrap",o?"text-t":"text-s","text-neutral-main","font-medium"),"aria-current":l?"page":void 0,"aria-label":l?`Current page: ${a.label}`:void 0,children:a.label}),!l&&e.jsx(n.ChevronLeft,{className:t("text-black flex-shrink-0",o?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},c)})})})});s.displayName="Breadcrumb",exports.Breadcrumb=s;
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;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"react";import a from"./utils.js";import{useMobile as n}from"./contexts.js";import{C as l}from"./chunks/chevron-left-4HSuTes3.js";import"./chunks/createLucideIcon-DGp0SoUT.js";const i=t.forwardRef(({items:t,className:i,isMobile:o},s)=>{const c=n(),m=o??c;return e("nav",{ref:s,className:a("flex flex-row-reverse items-center",m?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",i),"aria-label":"Breadcrumb navigation",children:e("ol",{className:"flex flex-row-reverse items-center gap-inherit",children:t.map((n,i)=>{const o=i===t.length-1,s=!o&&(n.href||n.onClick),c=`${n.label}-${i}`;return r("li",{className:"flex items-center gap-inherit",children:[s?e("a",{href:n.href||"#",className:a("whitespace-nowrap border-0 bg-transparent p-0 no-underline",m?"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,a)=>{r!==t.length-1&&e.onClick&&(a.preventDefault(),e.onClick())})(n,i,e),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick&&n.onClick())},"aria-label":`Go to ${n.label}`,children:n.label}):e("span",{className:a("whitespace-nowrap",m?"text-t":"text-s","text-neutral-main","font-medium"),"aria-current":o?"page":void 0,"aria-label":o?`Current page: ${n.label}`:void 0,children:n.label}),!o&&e(l,{className:a("text-black flex-shrink-0",m?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},c)})})})});i.displayName="Breadcrumb";export{i as Breadcrumb};
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};
@@ -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 - RTL with flex-row-reverse to show items right to left
23
- 'flex flex-row-reverse items-center',
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 flex-row-reverse items-center gap-inherit", children: items.map((item, index) => {
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 && (item.href || item.onClick);
26
+ const isClickable = !isLast && !!item.onClick;
28
27
  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();
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
- }, "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',
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
  }) }) }));
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  export interface BreadcrumbItem {
3
3
  label: string;
4
- href?: string;
5
4
  onClick?: () => void;
6
5
  }
7
6
  export interface BreadcrumbProps {
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "automoby-kit",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "A comprehensive React UI component library - created in war 2025",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",