@alexandregme/zljs 2.1.1 → 2.2.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/CHANGELOG.md CHANGED
@@ -8,6 +8,18 @@ A change that needs action in an app has a **Migration** note. When updating, re
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [2.2.0] - 2026-11-10
12
+
13
+ ### Added
14
+
15
+ - `Card`, a surface with a border, rounded corners and a soft shadow, which groups what belongs together. `title`, `titleLevel` and `message` show a header above the children, and `color` sets the border, a light background and the shadow from the theme. It takes the width of its parent
16
+
17
+ ## [2.1.2] - 2026-11-04
18
+
19
+ ### Fixed
20
+
21
+ - `WhatsAppButton` opens `whatsapp://send` on a phone, the scheme in Meta's iOS docs. It opened `whatsapp-business://send`, which is in no official doc: on an iPhone with WhatsApp Business installed, Safari said the address was invalid. On Android, a phone with both apps asks which one to use; on an iPhone, iOS picks one of them
22
+
11
23
  ## [2.1.0] - 2026-11-03
12
24
 
13
25
  ### Added
@@ -369,7 +381,9 @@ Replace the shade with the class of the `color` being tested, for example `/(^|\
369
381
 
370
382
  The message of `Error` is `text-zl-danger`. `none` and `ghost` didn't change.
371
383
 
372
- [Unreleased]: https://github.com/alexandregme/zljs/compare/v2.1.0...HEAD
384
+ [Unreleased]: https://github.com/alexandregme/zljs/compare/v2.2.0...HEAD
385
+ [2.2.0]: https://github.com/alexandregme/zljs/compare/v2.1.2...v2.2.0
386
+ [2.1.2]: https://github.com/alexandregme/zljs/compare/v2.1.0...v2.1.2
373
387
  [2.1.0]: https://github.com/alexandregme/zljs/compare/v2.0.1...v2.1.0
374
388
  [2.0.1]: https://github.com/alexandregme/zljs/compare/v2.0.0...v2.0.1
375
389
  [2.0.0]: https://github.com/alexandregme/zljs/compare/v1.19.1...v2.0.0
package/dist/index.d.ts CHANGED
@@ -430,6 +430,20 @@ interface ConnectedModalProps {
430
430
 
431
431
  declare const ConnectedModal: ({ modalId, title, description, size, children, }: ConnectedModalProps) => react.JSX.Element;
432
432
 
433
+ interface CardProps {
434
+ children: ReactNode;
435
+ /** Shows above the children, as a heading. */
436
+ title?: string;
437
+ /** The heading level of `title`: 1 when the card is the whole page. */
438
+ titleLevel?: 1 | 2 | 3 | 4 | 5 | 6;
439
+ /** Shows under `title`. Muted on a white card. */
440
+ message?: string;
441
+ /** The border and a light background in that color. `none` is white. */
442
+ color?: SemanticColor;
443
+ }
444
+
445
+ declare const Card: ({ children, title, titleLevel, message, color, }: CardProps) => react.JSX.Element;
446
+
433
447
  type SpinnerVariant = "circle" | "dots" | "refresh";
434
448
  interface SpinnerProps {
435
449
  variant?: SpinnerVariant;
@@ -468,5 +482,5 @@ declare class HTTPClient {
468
482
  patch<T = unknown>(url: string, config?: HttpRequestConfig): Promise<T | undefined>;
469
483
  }
470
484
 
471
- export { AuxiliaryColor, Button, Checkbox, ConnectedModal, DataColor, DataGrid, Error, Form, HTTPClient, Heading, Icon, Input, Loader, Modal, Radio, ReduxProvider, ReduxProviderProps, Select, SemanticColor, Sidebar, Spinner, StatsCard, Tag, Text, TextArea, Toaster, WhatsAppButton, splitURLasPath, useAppStore, useModalStore, usePageStore, useRouterStore, useToastStore };
472
- export type { AppState, ButtonColor, ButtonProps, ButtonVariant, CheckboxProps, CheckboxVariant, ConnectedModalProps, DataGridColumn, DataGridProps, ErrorProps, FormProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, IconProps, InputProps, LoaderProps, ModalEntry, ModalProps, ModalState, PageState, RadioProps, ReduxStore, RouterState, SelectOption, SelectProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, Size, SpinnerProps, SpinnerVariant, StatsCardProps, TagColor, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
485
+ export { AuxiliaryColor, Button, Card, Checkbox, ConnectedModal, DataColor, DataGrid, Error, Form, HTTPClient, Heading, Icon, Input, Loader, Modal, Radio, ReduxProvider, ReduxProviderProps, Select, SemanticColor, Sidebar, Spinner, StatsCard, Tag, Text, TextArea, Toaster, WhatsAppButton, splitURLasPath, useAppStore, useModalStore, usePageStore, useRouterStore, useToastStore };
486
+ export type { AppState, ButtonColor, ButtonProps, ButtonVariant, CardProps, CheckboxProps, CheckboxVariant, ConnectedModalProps, DataGridColumn, DataGridProps, ErrorProps, FormProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, IconProps, InputProps, LoaderProps, ModalEntry, ModalProps, ModalState, PageState, RadioProps, ReduxStore, RouterState, SelectOption, SelectProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, Size, SpinnerProps, SpinnerVariant, StatsCardProps, TagColor, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
package/dist/index.js CHANGED
@@ -804,7 +804,7 @@ var Modal = ({
804
804
 
805
805
  // core/whatsapp-button/whatsapp-button.const.ts
806
806
  var whatsappWebUrl = "https://wa.me";
807
- var whatsappBusinessUrl = "whatsapp-business://send";
807
+ var whatsappAppUrl = "whatsapp://send";
808
808
  var whatsappMobileUserAgent = /Android|iPhone|iPad|iPod/i;
809
809
 
810
810
  // core/whatsapp-button/whatsapp-button.tsx
@@ -821,12 +821,12 @@ var WhatsAppButton = ({
821
821
  const hasMessage = Boolean(message);
822
822
  const encodedMessage = hasMessage ? encodeURIComponent(message) : "";
823
823
  const webUrl = hasMessage ? `${whatsappWebUrl}/${phone}?text=${encodedMessage}` : `${whatsappWebUrl}/${phone}`;
824
- const businessUrl = hasMessage ? `${whatsappBusinessUrl}?phone=${phone}&text=${encodedMessage}` : `${whatsappBusinessUrl}?phone=${phone}`;
824
+ const appUrl = hasMessage ? `${whatsappAppUrl}?phone=${phone}&text=${encodedMessage}` : `${whatsappAppUrl}?phone=${phone}`;
825
825
  if (isMobile) {
826
826
  if (window.location?.assign) {
827
- window.location.assign(businessUrl);
827
+ window.location.assign(appUrl);
828
828
  } else {
829
- window.location.href = businessUrl;
829
+ window.location.href = appUrl;
830
830
  }
831
831
  } else {
832
832
  window.open(webUrl, "_blank");
@@ -1042,6 +1042,57 @@ var ConnectedModal = ({
1042
1042
  );
1043
1043
  };
1044
1044
 
1045
+ // core/card/card.styles.ts
1046
+ import { tv as tv12 } from "tailwind-variants";
1047
+ var card = tv12({
1048
+ slots: {
1049
+ // A soft, wide shadow in the color of the card. shadow-sm only spreads 1 to
1050
+ // 3px and reads as part of the border on a white page.
1051
+ base: "flex flex-col gap-6 w-full p-6 rounded-2xl border shadow-lg",
1052
+ header: "flex flex-col gap-1"
1053
+ },
1054
+ variants: {
1055
+ color: {
1056
+ primary: {
1057
+ base: "border-zl-primary bg-zl-primary/15 shadow-zl-primary/20"
1058
+ },
1059
+ success: {
1060
+ base: "border-zl-success bg-zl-success/15 shadow-zl-success/20"
1061
+ },
1062
+ danger: { base: "border-zl-danger bg-zl-danger/15 shadow-zl-danger/20" },
1063
+ warning: {
1064
+ base: "border-zl-warning bg-zl-warning/15 shadow-zl-warning/20"
1065
+ },
1066
+ info: { base: "border-zl-info bg-zl-info/15 shadow-zl-info/20" },
1067
+ muted: { base: "border-zl-muted bg-zl-muted/15 shadow-zl-muted/20" },
1068
+ none: { base: "border-gray-200 bg-white shadow-black/12" }
1069
+ }
1070
+ },
1071
+ defaultVariants: {
1072
+ color: "none"
1073
+ }
1074
+ });
1075
+
1076
+ // core/card/card.tsx
1077
+ import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
1078
+ var Card = ({
1079
+ children,
1080
+ title: title2,
1081
+ titleLevel = 2,
1082
+ message,
1083
+ color = "none"
1084
+ }) => {
1085
+ const { base, header: header3 } = card({ color });
1086
+ const messageColor = color === "none" ? "muted" : "none";
1087
+ return /* @__PURE__ */ jsxs13("div", { "data-testid": "card", className: base(), children: [
1088
+ (title2 || message) && /* @__PURE__ */ jsxs13("div", { className: header3(), children: [
1089
+ title2 && /* @__PURE__ */ jsx16(Heading, { level: titleLevel, children: title2 }),
1090
+ message && /* @__PURE__ */ jsx16(Text, { color: messageColor, children: message })
1091
+ ] }),
1092
+ children
1093
+ ] });
1094
+ };
1095
+
1045
1096
  // core/http/http.client.ts
1046
1097
  import axios from "axios";
1047
1098
  var HTTPClient = class {
@@ -1115,6 +1166,7 @@ var HTTPClient = class {
1115
1166
  };
1116
1167
  export {
1117
1168
  Button,
1169
+ Card,
1118
1170
  Checkbox,
1119
1171
  ConnectedModal,
1120
1172
  DataGrid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexandregme/zljs",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Opinionated, accessible React component library for enterprise apps (Next.js, Tailwind CSS v4).",
5
5
  "keywords": [
6
6
  "react",