@salesforce/ui-bundle-template-feature-react-search 11.21.0 → 11.22.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.22.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.22.0...v11.22.1) (2026-07-10)
7
+
8
+ **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
9
+
10
+
11
+
12
+
13
+
14
+ ## [11.22.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.21.0...v11.22.0) (2026-07-10)
15
+
16
+ **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
17
+
18
+
19
+
20
+
21
+
6
22
  ## [11.21.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.20.0...v11.21.0) (2026-07-10)
7
23
 
8
24
  **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
@@ -18,8 +18,8 @@
18
18
  "graphql:schema": "node scripts/get-graphql-schema.mjs"
19
19
  },
20
20
  "dependencies": {
21
- "@salesforce/platform-sdk": "^11.21.0",
22
- "@salesforce/ui-bundle": "^11.21.0",
21
+ "@salesforce/platform-sdk": "^11.22.1",
22
+ "@salesforce/ui-bundle": "^11.22.1",
23
23
  "@tailwindcss/vite": "^4.1.17",
24
24
  "class-variance-authority": "^0.7.1",
25
25
  "clsx": "^2.1.1",
@@ -44,8 +44,8 @@
44
44
  "@graphql-eslint/eslint-plugin": "^4.1.0",
45
45
  "@graphql-tools/utils": "^11.0.0",
46
46
  "@playwright/test": "^1.49.0",
47
- "@salesforce/graphiti": "^11.21.0",
48
- "@salesforce/vite-plugin-ui-bundle": "^11.21.0",
47
+ "@salesforce/graphiti": "^11.22.1",
48
+ "@salesforce/vite-plugin-ui-bundle": "^11.22.1",
49
49
  "@testing-library/jest-dom": "^6.6.3",
50
50
  "@testing-library/react": "^16.1.0",
51
51
  "@testing-library/user-event": "^14.5.2",
@@ -30,7 +30,7 @@ export function SortControl({ configs, sort, onSortChange, className }: SortCont
30
30
  else onSortChange({ field: v, direction: sort?.direction ?? "ASC" });
31
31
  }}
32
32
  >
33
- <SelectTrigger size="sm" className="w-[160px]">
33
+ <SelectTrigger size="sm" className="w-[160px]" aria-label="Sort by">
34
34
  <SelectValue placeholder="Default" />
35
35
  </SelectTrigger>
36
36
  <SelectContent>
@@ -4,7 +4,9 @@ import { Label } from "../../../../../components/ui/label";
4
4
  interface FilterFieldWrapperProps {
5
5
  label: string;
6
6
  htmlFor?: string;
7
+ errorId?: string;
7
8
  helpText?: string;
9
+ error?: string;
8
10
  className?: string;
9
11
  children: ReactNode;
10
12
  }
@@ -12,7 +14,9 @@ interface FilterFieldWrapperProps {
12
14
  export function FilterFieldWrapper({
13
15
  label,
14
16
  htmlFor,
17
+ errorId,
15
18
  helpText,
19
+ error,
16
20
  className,
17
21
  children,
18
22
  }: FilterFieldWrapperProps) {
@@ -20,7 +24,15 @@ export function FilterFieldWrapper({
20
24
  <div className={`space-y-1 ${className ?? ""}`}>
21
25
  <Label htmlFor={htmlFor}>{label}</Label>
22
26
  {children}
23
- {helpText && <p className="text-xs text-muted-foreground min-h-4">{helpText}</p>}
27
+ <div className="min-h-4">
28
+ {error ? (
29
+ <p id={errorId} role="alert" className="text-xs text-destructive">
30
+ {error}
31
+ </p>
32
+ ) : (
33
+ helpText && <p className="text-xs text-muted-foreground">{helpText}</p>
34
+ )}
35
+ </div>
24
36
  </div>
25
37
  );
26
38
  }
@@ -1,4 +1,4 @@
1
- import { useEffect, useRef, useState } from "react";
1
+ import { useEffect, useId, useRef, useState } from "react";
2
2
  import { Input } from "../../../../../components/ui/input";
3
3
  import { useFilterField } from "../FilterContext";
4
4
  import { FilterFieldWrapper } from "./FilterFieldWrapper";
@@ -14,6 +14,7 @@ interface NumericRangeFilterProps {
14
14
 
15
15
  export function NumericRangeFilter({ field, label, helpText, min, max }: NumericRangeFilterProps) {
16
16
  const { value, onChange } = useFilterField(field);
17
+ const errorId = useId();
17
18
  const [draftMin, setDraftMin] = useState(value?.min ?? "");
18
19
  const [draftMax, setDraftMax] = useState(value?.max ?? "");
19
20
 
@@ -44,8 +45,33 @@ export function NumericRangeFilter({ field, label, helpText, min, max }: Numeric
44
45
  setDraftMax(value?.max ?? "");
45
46
  }, [value?.min, value?.max]);
46
47
 
48
+ const isOutOfBounds = (v: string) => {
49
+ if (v === "") return false;
50
+ const n = Number(v);
51
+ return (min != null && n < min) || (max != null && n > max);
52
+ };
53
+ const minOutOfBounds = isOutOfBounds(draftMin);
54
+ const maxOutOfBounds = isOutOfBounds(draftMax);
55
+ const isRangeInverted = draftMin !== "" && draftMax !== "" && Number(draftMin) > Number(draftMax);
56
+ const hasError = minOutOfBounds || maxOutOfBounds || isRangeInverted;
57
+
58
+ const boundsLabel =
59
+ min != null && max != null
60
+ ? `${min}–${max}`
61
+ : min != null
62
+ ? `${min} or more`
63
+ : max != null
64
+ ? `${max} or less`
65
+ : null;
66
+
67
+ const errorMessage = isRangeInverted
68
+ ? "Min must not exceed max"
69
+ : (minOutOfBounds || maxOutOfBounds) && boundsLabel
70
+ ? `Value must be between ${boundsLabel}`
71
+ : undefined;
72
+
47
73
  return (
48
- <FilterFieldWrapper label={label} helpText={helpText}>
74
+ <FilterFieldWrapper label={label} helpText={helpText} error={errorMessage} errorId={errorId}>
49
75
  <div className="flex items-center gap-2">
50
76
  <Input
51
77
  type="number"
@@ -58,6 +84,8 @@ export function NumericRangeFilter({ field, label, helpText, min, max }: Numeric
58
84
  debouncedRef.current?.(e.target.value, draftMax);
59
85
  }}
60
86
  aria-label={`${label} minimum`}
87
+ aria-invalid={hasError || undefined}
88
+ aria-describedby={hasError ? errorId : undefined}
61
89
  />
62
90
  <span className="text-sm text-muted-foreground">–</span>
63
91
  <Input
@@ -71,6 +99,8 @@ export function NumericRangeFilter({ field, label, helpText, min, max }: Numeric
71
99
  debouncedRef.current?.(draftMin, e.target.value);
72
100
  }}
73
101
  aria-label={`${label} maximum`}
102
+ aria-invalid={hasError || undefined}
103
+ aria-describedby={hasError ? errorId : undefined}
74
104
  />
75
105
  </div>
76
106
  </FilterFieldWrapper>
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
3
- "version": "11.21.0",
3
+ "version": "11.22.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
9
- "version": "11.21.0",
9
+ "version": "11.22.1",
10
10
  "license": "SEE LICENSE IN LICENSE.txt",
11
11
  "dependencies": {
12
12
  "fast-xml-parser": "^5.9.3",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
3
- "version": "11.21.0",
3
+ "version": "11.22.1",
4
4
  "description": "Base SFDX project template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-feature-react-search",
3
- "version": "11.21.0",
3
+ "version": "11.22.1",
4
4
  "description": "[Beta] Configuration-driven multi-source search for UI Bundles",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -30,7 +30,7 @@ export function SortControl({ configs, sort, onSortChange, className }: SortCont
30
30
  else onSortChange({ field: v, direction: sort?.direction ?? "ASC" });
31
31
  }}
32
32
  >
33
- <SelectTrigger size="sm" className="w-[160px]">
33
+ <SelectTrigger size="sm" className="w-[160px]" aria-label="Sort by">
34
34
  <SelectValue placeholder="Default" />
35
35
  </SelectTrigger>
36
36
  <SelectContent>
@@ -4,7 +4,9 @@ import { Label } from "../../../../../components/ui/__inherit__label";
4
4
  interface FilterFieldWrapperProps {
5
5
  label: string;
6
6
  htmlFor?: string;
7
+ errorId?: string;
7
8
  helpText?: string;
9
+ error?: string;
8
10
  className?: string;
9
11
  children: ReactNode;
10
12
  }
@@ -12,7 +14,9 @@ interface FilterFieldWrapperProps {
12
14
  export function FilterFieldWrapper({
13
15
  label,
14
16
  htmlFor,
17
+ errorId,
15
18
  helpText,
19
+ error,
16
20
  className,
17
21
  children,
18
22
  }: FilterFieldWrapperProps) {
@@ -20,7 +24,15 @@ export function FilterFieldWrapper({
20
24
  <div className={`space-y-1 ${className ?? ""}`}>
21
25
  <Label htmlFor={htmlFor}>{label}</Label>
22
26
  {children}
23
- {helpText && <p className="text-xs text-muted-foreground min-h-4">{helpText}</p>}
27
+ <div className="min-h-4">
28
+ {error ? (
29
+ <p id={errorId} role="alert" className="text-xs text-destructive">
30
+ {error}
31
+ </p>
32
+ ) : (
33
+ helpText && <p className="text-xs text-muted-foreground">{helpText}</p>
34
+ )}
35
+ </div>
24
36
  </div>
25
37
  );
26
38
  }
@@ -1,4 +1,4 @@
1
- import { useEffect, useRef, useState } from "react";
1
+ import { useEffect, useId, useRef, useState } from "react";
2
2
  import { Input } from "../../../../../components/ui/__inherit__input";
3
3
  import { useFilterField } from "../FilterContext";
4
4
  import { FilterFieldWrapper } from "./FilterFieldWrapper";
@@ -14,6 +14,7 @@ interface NumericRangeFilterProps {
14
14
 
15
15
  export function NumericRangeFilter({ field, label, helpText, min, max }: NumericRangeFilterProps) {
16
16
  const { value, onChange } = useFilterField(field);
17
+ const errorId = useId();
17
18
  const [draftMin, setDraftMin] = useState(value?.min ?? "");
18
19
  const [draftMax, setDraftMax] = useState(value?.max ?? "");
19
20
 
@@ -44,8 +45,33 @@ export function NumericRangeFilter({ field, label, helpText, min, max }: Numeric
44
45
  setDraftMax(value?.max ?? "");
45
46
  }, [value?.min, value?.max]);
46
47
 
48
+ const isOutOfBounds = (v: string) => {
49
+ if (v === "") return false;
50
+ const n = Number(v);
51
+ return (min != null && n < min) || (max != null && n > max);
52
+ };
53
+ const minOutOfBounds = isOutOfBounds(draftMin);
54
+ const maxOutOfBounds = isOutOfBounds(draftMax);
55
+ const isRangeInverted = draftMin !== "" && draftMax !== "" && Number(draftMin) > Number(draftMax);
56
+ const hasError = minOutOfBounds || maxOutOfBounds || isRangeInverted;
57
+
58
+ const boundsLabel =
59
+ min != null && max != null
60
+ ? `${min}–${max}`
61
+ : min != null
62
+ ? `${min} or more`
63
+ : max != null
64
+ ? `${max} or less`
65
+ : null;
66
+
67
+ const errorMessage = isRangeInverted
68
+ ? "Min must not exceed max"
69
+ : (minOutOfBounds || maxOutOfBounds) && boundsLabel
70
+ ? `Value must be between ${boundsLabel}`
71
+ : undefined;
72
+
47
73
  return (
48
- <FilterFieldWrapper label={label} helpText={helpText}>
74
+ <FilterFieldWrapper label={label} helpText={helpText} error={errorMessage} errorId={errorId}>
49
75
  <div className="flex items-center gap-2">
50
76
  <Input
51
77
  type="number"
@@ -58,6 +84,8 @@ export function NumericRangeFilter({ field, label, helpText, min, max }: Numeric
58
84
  debouncedRef.current?.(e.target.value, draftMax);
59
85
  }}
60
86
  aria-label={`${label} minimum`}
87
+ aria-invalid={hasError || undefined}
88
+ aria-describedby={hasError ? errorId : undefined}
61
89
  />
62
90
  <span className="text-sm text-muted-foreground">–</span>
63
91
  <Input
@@ -71,6 +99,8 @@ export function NumericRangeFilter({ field, label, helpText, min, max }: Numeric
71
99
  debouncedRef.current?.(draftMin, e.target.value);
72
100
  }}
73
101
  aria-label={`${label} maximum`}
102
+ aria-invalid={hasError || undefined}
103
+ aria-describedby={hasError ? errorId : undefined}
74
104
  />
75
105
  </div>
76
106
  </FilterFieldWrapper>