@alexandregme/zljs 1.1.1 → 1.3.0

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/index.d.ts CHANGED
@@ -20,12 +20,13 @@ type DataColor = "blue" | "red" | "yellow" | "green" | "gray" | "orange";
20
20
  */
21
21
  type Size = "sm" | "md" | "lg";
22
22
 
23
- declare const iconNames: readonly ["Check", "X", "Plus", "Minus", "Search", "Menu", "ChevronDown", "ChevronUp", "ChevronLeft", "ChevronRight", "Pencil", "Trash2", "Save", "RefreshCw", "Home", "MessageSquare", "Users", "Store", "ShoppingCart", "BarChart3", "Brain", "Send", "LogOut", "User", "Key", "Contact", "Package", "Warehouse", "HandCoins", "Stethoscope", "LogIn", "Megaphone", "LayoutDashboard", "Smile", "Frown", "Cat", "ArrowRight", "Loader", "LoaderCircle", "CheckCircle", "XCircle", "AlertTriangle", "Info", "SiWhatsapp", "SiFacebook", "SiInstagram", "SiShopify"];
23
+ declare const iconNames: readonly ["Check", "X", "Plus", "Minus", "Search", "Menu", "ChevronDown", "ChevronUp", "ChevronLeft", "ChevronRight", "ChevronsUp", "ArrowUp", "Pencil", "Trash2", "Save", "RefreshCw", "Home", "MessageSquare", "Users", "Store", "ShoppingCart", "BarChart3", "Brain", "Send", "LogOut", "User", "Key", "Contact", "Package", "Warehouse", "HandCoins", "Stethoscope", "LogIn", "Megaphone", "LayoutDashboard", "Smile", "Frown", "Cat", "ArrowRight", "Loader", "LoaderCircle", "CheckCircle", "XCircle", "AlertTriangle", "Info", "Route", "Navigation", "ListChecks", "Map", "MapPinOff", "SiWhatsapp", "SiFacebook", "SiInstagram", "SiShopify"];
24
24
 
25
25
  type IconName = (typeof iconNames)[number];
26
26
  interface IconProps {
27
27
  name: IconName;
28
28
  size?: Size;
29
+ "aria-label"?: string;
29
30
  }
30
31
 
31
32
  type ButtonVariant = "default" | "icon" | "link";
@@ -146,7 +147,7 @@ interface TextAreaProps {
146
147
 
147
148
  declare const TextArea: ({ label: labelText, placeholder, value, rows, error, disabled, onChange, }: TextAreaProps) => react.JSX.Element;
148
149
 
149
- declare const Icon: ({ name, size }: IconProps) => react.JSX.Element;
150
+ declare const Icon: ({ name, size, "aria-label": ariaLabel, }: IconProps) => react.JSX.Element;
150
151
 
151
152
  interface StatsCardProps {
152
153
  label: string;
@@ -456,4 +457,4 @@ declare class HTTPClient {
456
457
  }
457
458
 
458
459
  export { AppWrapper, Button, Checkbox, ConnectedModal, DataGrid, DocumentWrapper, Error, Form, GlobalState, HTTPClient, Heading, Icon, Input, Loader, Modal, PageWrapper, Radio, Select, Sidebar, Spinner, StatsCard, Tag, Text, TextArea, Toaster, WhatsAppButton, splitURLasPath, useAppStore, useModalStore, usePageStore, useRouterStore, useToastStore };
459
- export type { AppState, AppWrapperProps, ButtonColor, ButtonProps, ButtonVariant, CheckboxProps, ConnectedModalProps, DataColor, DataGridColumn, DataGridProps, DocumentWrapperProps, ErrorProps, ExtendedStore, FormProps, GlobalStateProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, InitPageFunction, InputProps, LoaderProps, ModalEntry, ModalProps, ModalState, PageState, PageWrapperProps, RadioProps, RouterState, SelectOption, SelectProps, SemanticColor, SidebarItem, SidebarProps, SidebarSection, SidebarUser, Size, SpinnerProps, SpinnerVariant, StatsCardProps, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
460
+ export type { AppState, AppWrapperProps, ButtonColor, ButtonProps, ButtonVariant, CheckboxProps, ConnectedModalProps, DataColor, DataGridColumn, DataGridProps, DocumentWrapperProps, ErrorProps, ExtendedStore, FormProps, GlobalStateProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, IconProps, InitPageFunction, InputProps, LoaderProps, ModalEntry, ModalProps, ModalState, PageState, PageWrapperProps, RadioProps, RouterState, SelectOption, SelectProps, SemanticColor, SidebarItem, SidebarProps, SidebarSection, SidebarUser, Size, SpinnerProps, SpinnerVariant, StatsCardProps, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
package/dist/index.js CHANGED
@@ -25,11 +25,23 @@ var iconSizes = {
25
25
 
26
26
  // core/icon/icon.tsx
27
27
  import { Fragment, jsx } from "react/jsx-runtime";
28
- var Icon = ({ name, size = "md" }) => {
28
+ var Icon = ({
29
+ name,
30
+ size = "md",
31
+ "aria-label": ariaLabel
32
+ }) => {
29
33
  const isBrand = name.startsWith("Si");
30
34
  const IconComponent = isBrand ? iconBrands[name] : LucideIcons[name];
31
35
  if (!IconComponent) return /* @__PURE__ */ jsx(Fragment, {});
32
- return /* @__PURE__ */ jsx("span", { "data-testid": name, children: /* @__PURE__ */ jsx(IconComponent, { size: iconSizes[size] }) });
36
+ return /* @__PURE__ */ jsx(
37
+ "span",
38
+ {
39
+ "data-testid": name,
40
+ role: ariaLabel ? "img" : void 0,
41
+ "aria-label": ariaLabel,
42
+ children: /* @__PURE__ */ jsx(IconComponent, { size: iconSizes[size], "aria-hidden": "true" })
43
+ }
44
+ );
33
45
  };
34
46
 
35
47
  // core/button/button.styles.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexandregme/zljs",
3
- "version": "1.1.1",
3
+ "version": "1.3.0",
4
4
  "description": "Opinionated, accessible React component library for enterprise apps (Next.js, Tailwind CSS v4).",
5
5
  "keywords": [
6
6
  "react",
@@ -59,6 +59,7 @@
59
59
  "test:watch": "vitest --project unit --coverage",
60
60
  "test:coverage": "vitest run --project unit --coverage",
61
61
  "test:storybook": "vitest run --project storybook",
62
+ "test:visual": "chromatic",
62
63
  "eslint": "eslint ./ --color --fix",
63
64
  "prettier": "prettier --write .",
64
65
  "stylelint": "stylelint '**/*.{css,scss}' --allow-empty-input",
@@ -84,9 +85,12 @@
84
85
  "zustand": "^5.0.11"
85
86
  },
86
87
  "devDependencies": {
88
+ "@chromatic-com/storybook": "^5.6.0",
87
89
  "@commitlint/cli": "^20.2.0",
88
90
  "@commitlint/config-conventional": "^20.2.0",
89
91
  "@eslint/js": "^9.39.1",
92
+ "@storybook/addon-a11y": "^10.6.3",
93
+ "@storybook/addon-docs": "^10.6.3",
90
94
  "@storybook/addon-vitest": "^10.6.3",
91
95
  "@storybook/react-vite": "^10.6.3",
92
96
  "@tailwindcss/vite": "^4.1.18",
@@ -97,6 +101,7 @@
97
101
  "@vitest/browser-playwright": "^4.1.12",
98
102
  "@vitest/coverage-v8": "^4.1.12",
99
103
  "autoprefixer": "^10.4.23",
104
+ "chromatic": "^18.13.4",
100
105
  "eslint": "^9.39.1",
101
106
  "eslint-plugin-storybook": "10.6.3",
102
107
  "globals": "^16.5.0",