@nexub/patterns 5.3.0 → 5.5.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.
@@ -2,10 +2,10 @@
2
2
 
3
3
  // src/components/FilterBar/FilterBar.tsx
4
4
  import * as React from "react";
5
- import { cn, SearchInput, useNexubMessages } from "@nexub/react";
5
+ import { Button, cn, SearchInput, useNexubMessages } from "@nexub/react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  var FilterBar = React.forwardRef(
8
- ({ searchPlaceholder, searchLabel, onSearch, searchValue, filters, actions, className, ...props }, ref) => {
8
+ ({ searchPlaceholder, searchLabel, onSearch, searchValue, filters, actions, activeCount = 0, onClearAll, className, ...props }, ref) => {
9
9
  const t = useNexubMessages();
10
10
  return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-wrap items-center gap-3", className), ...props, children: [
11
11
  /* @__PURE__ */ jsx(
@@ -20,6 +20,10 @@ var FilterBar = React.forwardRef(
20
20
  }
21
21
  ),
22
22
  filters && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2", children: filters }),
23
+ activeCount > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-body-sm text-[var(--color-on-surface-muted)]", children: [
24
+ /* @__PURE__ */ jsx("span", { "aria-live": "polite", children: t.filtersApplied(activeCount) }),
25
+ onClearAll && /* @__PURE__ */ jsx(Button, { variant: "link", size: "sm", onClick: onClearAll, children: t.clearAll })
26
+ ] }),
23
27
  actions && /* @__PURE__ */ jsx("div", { className: "ms-auto flex items-center gap-2", children: actions })
24
28
  ] });
25
29
  }
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  FilterBar
4
- } from "../../chunk-IHI73CCF.js";
4
+ } from "../../chunk-DOHN66SE.js";
5
5
  export {
6
6
  FilterBar
7
7
  };
package/dist/index.d.ts CHANGED
@@ -24,6 +24,10 @@ interface FilterBarProps extends React.HTMLAttributes<HTMLDivElement> {
24
24
  searchValue?: string;
25
25
  filters?: React.ReactNode;
26
26
  actions?: React.ReactNode;
27
+ /** How many filters are applied; shows "N filters" with a Clear all button when above 0. */
28
+ activeCount?: number;
29
+ /** Clears search and filters; the button shows when `activeCount` is above 0. */
30
+ onClearAll?: () => void;
27
31
  }
28
32
  declare const FilterBar: React.ForwardRefExoticComponent<FilterBarProps & React.RefAttributes<HTMLDivElement>>;
29
33
 
package/dist/index.js CHANGED
@@ -1,7 +1,4 @@
1
1
  'use client';
2
- import {
3
- StepIndicator
4
- } from "./chunk-L456OB3Q.js";
5
2
  import {
6
3
  TransactionDetailPage
7
4
  } from "./chunk-CJBHDX2U.js";
@@ -22,12 +19,15 @@ import {
22
19
  import {
23
20
  SettingsPage
24
21
  } from "./chunk-27N33TGN.js";
22
+ import {
23
+ SignInPage
24
+ } from "./chunk-UNQD426H.js";
25
25
  import {
26
26
  SettingsSection
27
27
  } from "./chunk-U3FT7XAU.js";
28
28
  import {
29
- SignInPage
30
- } from "./chunk-UNQD426H.js";
29
+ StepIndicator
30
+ } from "./chunk-L456OB3Q.js";
31
31
  import {
32
32
  CheckoutPage
33
33
  } from "./chunk-CZR6NZDH.js";
@@ -43,7 +43,7 @@ import {
43
43
  } from "./chunk-RWPFCNMJ.js";
44
44
  import {
45
45
  FilterBar
46
- } from "./chunk-IHI73CCF.js";
46
+ } from "./chunk-DOHN66SE.js";
47
47
  import {
48
48
  InfoList
49
49
  } from "./chunk-WPNT5JOU.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/patterns",
3
- "version": "5.3.0",
3
+ "version": "5.5.0",
4
4
  "description": "Composite UI patterns for Nexub Design System — pre-built, production-ready layouts and widgets built on @nexub/react.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -39,9 +39,9 @@
39
39
  "peerDependencies": {
40
40
  "react": ">=19 <20",
41
41
  "react-dom": ">=19 <20",
42
- "@nexub/icons": "^5.3.0",
43
- "@nexub/react": "^5.3.0",
44
- "@nexub/tokens": "^5.3.0"
42
+ "@nexub/icons": "^5.5.0",
43
+ "@nexub/react": "^5.5.0",
44
+ "@nexub/tokens": "^5.5.0"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "@nexub/icons": {
@@ -64,9 +64,9 @@
64
64
  "typescript": "~6.0.3",
65
65
  "vite": "^8.3.5",
66
66
  "vitest": "^5.0.5",
67
- "@nexub/icons": "5.3.0",
68
- "@nexub/react": "5.3.0",
69
- "@nexub/tokens": "5.3.0"
67
+ "@nexub/icons": "5.5.0",
68
+ "@nexub/react": "5.5.0",
69
+ "@nexub/tokens": "5.5.0"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "tsup && tailwindcss -i src/styles.css -o dist/styles.css --minify",