@midas-ds/components 1.2.3 → 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/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "description": "Midas Components",
15
15
  "homepage": "https://designsystem.migrationsverket.se/",
16
16
  "license": "CC0-1.0",
17
- "version": "1.2.3",
17
+ "version": "1.3.0",
18
18
  "main": "./index.cjs",
19
19
  "module": "./index.js",
20
20
  "types": "./index.d.ts",
@@ -39,6 +39,7 @@
39
39
  "require": "./index.cjs"
40
40
  },
41
41
  "./theme": {
42
+ "types": "./theme/index.d.ts",
42
43
  "import": "./theme.js",
43
44
  "require": "./theme.cjs"
44
45
  }
package/table/Table.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { RowProps, TableHeaderProps, ColumnProps, TableProps as AriaTableProps, CellProps, TableBody } from 'react-aria-components';
2
- export interface TableProps<T> extends AriaTableProps {
2
+ export interface TableProps extends AriaTableProps {
3
3
  narrow?: boolean;
4
4
  striped?: boolean;
5
- rows: T[];
6
5
  }
7
- export declare const Table: <T extends object>({ narrow, striped, ...rest }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
8
- export declare const TableHeader: <T extends object>({ columns, children }: TableHeaderProps<T>) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const Table: ({ narrow, striped, className, ...rest }: TableProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const TableHeader: <T extends object>({ columns, children, }: TableHeaderProps<T>) => import("react/jsx-runtime").JSX.Element;
9
8
  export declare const Row: <T extends object>({ id, columns, children, ...rest }: RowProps<T>) => import("react/jsx-runtime").JSX.Element;
10
9
  export declare const Column: ({ children, ...rest }: ColumnProps) => import("react/jsx-runtime").JSX.Element;
11
10
  export declare const Cell: ({ ...rest }: CellProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,27 @@
1
- import { default as React, ReactNode } from 'react';
2
1
  import { TextFieldProps as AriaTextFieldProps, ValidationResult } from 'react-aria-components';
2
+ import * as React from 'react';
3
3
  export interface TextFieldProps extends AriaTextFieldProps {
4
- children?: ReactNode;
4
+ children?: React.ReactNode;
5
+ /** Specify label displayed above the TextField*/
5
6
  label?: string;
7
+ /** Specify description displayed below the label */
6
8
  description?: string;
9
+ /** Custom error messages */
7
10
  errorMessage?: string | ((validation: ValidationResult) => string) | undefined;
8
- validationType?: 'ssn' | RegExp;
11
+ /** Enable validations or add your own regex */
12
+ validationType?: 'ssn' | 'dossnr' | RegExp;
13
+ /** Set number of characters that are allowed before the TextField is put in an invalid state */
9
14
  maxCharacters?: number;
15
+ /**
16
+ * Whether to show the character counter or not
17
+ * @default
18
+ * false
19
+ */
10
20
  showCounter?: boolean;
11
21
  }
12
22
  export declare const TextField: React.FC<TextFieldProps>;
13
23
  type InputWrapperProps = Pick<TextFieldProps, 'label' | 'description' | 'errorMessage' | 'children'>;
14
- export declare const InputWrapper: ({ label, description, errorMessage, children }: InputWrapperProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const InputWrapper: ({ label, description, errorMessage, children, }: InputWrapperProps) => import("react/jsx-runtime").JSX.Element;
15
25
  export declare const ssnRegEx: RegExp;
26
+ export declare const dossNrRegEx: RegExp;
16
27
  export {};