shekel-fe-shared-lib 3.2.2 → 3.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.
@@ -18,3 +18,39 @@ export interface ErrorIconProps {
18
18
  className?: string;
19
19
  }
20
20
  export declare const ErrorIcon: React.FC<ErrorIconProps>;
21
+ /**
22
+ * Ids + ARIA wiring that associates a field with its visible error/helper
23
+ * text, so assistive tech announces the field as invalid and reads the
24
+ * message: spread `fieldProps` on the focusable element (input, combobox,
25
+ * radiogroup) and put `errorId`/`helperId` on the rendered message.
26
+ *
27
+ * `describedBy` merges a consumer-supplied `aria-describedby` rather than
28
+ * letting either one clobber the other. `isError` should include
29
+ * `status === 'error'`, which marks the field invalid with no message.
30
+ * `ariaRequired` is only for elements without a native `required` (custom
31
+ * comboboxes, radiogroups) — native inputs already expose it.
32
+ */
33
+ export declare const fieldDescription: (fieldId: string, { isError, error, helperText, describedBy, ariaRequired, }: {
34
+ isError: boolean;
35
+ error?: React.ReactNode;
36
+ helperText?: React.ReactNode;
37
+ describedBy?: string | undefined;
38
+ ariaRequired?: boolean | undefined;
39
+ }) => {
40
+ errorId: string;
41
+ helperId: string;
42
+ fieldProps: {
43
+ 'aria-required'?: true | undefined;
44
+ 'aria-invalid': true | undefined;
45
+ 'aria-describedby': string | undefined;
46
+ };
47
+ };
48
+ /**
49
+ * The visual "*" after a required field's label. aria-hidden because the
50
+ * field itself already exposes required-ness (native `required` or
51
+ * `aria-required`) — otherwise screen readers read "star" as part of the
52
+ * label.
53
+ */
54
+ export declare const RequiredMark: React.FC<{
55
+ mark: React.ReactNode;
56
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shekel-fe-shared-lib",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "description": "Shared component library built with React and Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -51,8 +51,8 @@
51
51
  "vite-plugin-dts": "^4.5.4"
52
52
  },
53
53
  "peerDependencies": {
54
- "react": "^18.0.0",
55
- "react-dom": "^18.0.0",
54
+ "react": "^18.0.0 || ^19.0.0",
55
+ "react-dom": "^18.0.0 || ^19.0.0",
56
56
  "react-hook-form": "^7.0.0"
57
57
  },
58
58
  "peerDependenciesMeta": {