@companycam/slab-web 2.1.3 → 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/index.js +569 -523
- package/index.mjs +4207 -4170
- package/lib/InputCheckbox/InputCheckbox.d.ts +21 -12
- package/lib/InputCheckboxGroup/InputCheckboxGroup.d.ts +4 -2
- package/lib/InputRadio/InputRadio.d.ts +2 -0
- package/lib/InputRadioGroup/InputRadioGroup.d.ts +4 -2
- package/package.json +1 -1
|
@@ -2,14 +2,17 @@ import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
|
2
2
|
import { UseMessageProps } from '../shared/types';
|
|
3
3
|
type HTMLInputProps = ComponentPropsWithRef<'input'>;
|
|
4
4
|
type FilteredHTMLInputProps = Omit<HTMLInputProps, 'type'>;
|
|
5
|
+
export type InputCheckboxScale = 'medium' | 'large';
|
|
5
6
|
type BaseInputCheckboxProps = FilteredHTMLInputProps & UseMessageProps & {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
'data-testid'?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
design?: 'default' | 'assetFeed' | 'task';
|
|
8
10
|
hideLabel?: boolean;
|
|
9
|
-
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
scale?: InputCheckboxScale;
|
|
10
13
|
/** @deprecated - use `data-testid` */
|
|
11
14
|
testId?: string;
|
|
12
|
-
|
|
15
|
+
value: string;
|
|
13
16
|
};
|
|
14
17
|
type IndeterminateProps = {
|
|
15
18
|
indeterminate?: false;
|
|
@@ -26,18 +29,22 @@ export type InputCheckboxProps = BaseInputCheckboxProps & IndeterminateProps;
|
|
|
26
29
|
- `id` is required to associate the checkbox with the optional `message`.
|
|
27
30
|
- In general, use sentence case for the required `label` (e.g., "I agree to the terms"; not "I Agree to the Terms").
|
|
28
31
|
- **Indeterminate**: When using `indeterminate={true}`, you must also control the `checked` state. **Recommendation**: Set `checked={false}` when `indeterminate={true}` for consistent behavior (clicking an indeterminate checkbox typically checks it).
|
|
32
|
+
- **aria-disabled**: When set, the checkbox appears visually disabled (dashed border) but remains interactive. Use this when the checkbox should signal "not yet actionable" while still allowing user interaction — for example, to surface a validation message.
|
|
33
|
+
- **`design="assetFeed"` is deprecated.** Use `scale="large"` instead — `large` matches the assetFeed dimensions.
|
|
29
34
|
*/
|
|
30
35
|
export declare const InputCheckbox: import('react').ForwardRefExoticComponent<(Omit<FilteredHTMLInputProps & import('../shared/types').GetStatusProps & {
|
|
31
36
|
id: string;
|
|
32
37
|
message?: ReactNode;
|
|
33
38
|
} & {
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
'data-testid'?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
design?: "default" | "assetFeed" | "task";
|
|
36
42
|
hideLabel?: boolean;
|
|
37
|
-
|
|
43
|
+
label: ReactNode;
|
|
44
|
+
scale?: InputCheckboxScale;
|
|
38
45
|
/** @deprecated - use `data-testid` */
|
|
39
46
|
testId?: string;
|
|
40
|
-
|
|
47
|
+
value: string;
|
|
41
48
|
} & {
|
|
42
49
|
indeterminate?: false;
|
|
43
50
|
checked?: boolean;
|
|
@@ -45,13 +52,15 @@ export declare const InputCheckbox: import('react').ForwardRefExoticComponent<(O
|
|
|
45
52
|
id: string;
|
|
46
53
|
message?: ReactNode;
|
|
47
54
|
} & {
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
'data-testid'?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
design?: "default" | "assetFeed" | "task";
|
|
50
58
|
hideLabel?: boolean;
|
|
51
|
-
|
|
59
|
+
label: ReactNode;
|
|
60
|
+
scale?: InputCheckboxScale;
|
|
52
61
|
/** @deprecated - use `data-testid` */
|
|
53
62
|
testId?: string;
|
|
54
|
-
|
|
63
|
+
value: string;
|
|
55
64
|
} & {
|
|
56
65
|
indeterminate: true;
|
|
57
66
|
checked: boolean;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { InputGroupProps } from '../shared/InputGroup/InputGroup';
|
|
3
|
-
import { InputCheckboxProps } from '../InputCheckbox/InputCheckbox';
|
|
3
|
+
import { InputCheckboxProps, InputCheckboxScale } from '../InputCheckbox/InputCheckbox';
|
|
4
4
|
type FilteredInputCheckboxProps = Readonly<Omit<InputCheckboxProps, 'id' | 'name' | 'onChange'>>;
|
|
5
5
|
export type InputCheckboxGroupProps = InputGroupProps & {
|
|
6
6
|
options: readonly FilteredInputCheckboxProps[];
|
|
7
7
|
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
selectedValues: readonly string[];
|
|
9
|
+
/** Controls the scale of all checkboxes in the group. Overridden per-item by a `scale` on the option itself. */
|
|
10
|
+
scale?: InputCheckboxScale;
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* - InputCheckboxGroup is a controlled component: You must provide an `onChange` handler to update `selectedValues`.
|
|
@@ -53,5 +55,5 @@ export type InputCheckboxGroupProps = InputGroupProps & {
|
|
|
53
55
|
* );
|
|
54
56
|
* ```
|
|
55
57
|
*/
|
|
56
|
-
export declare function InputCheckboxGroup({ onChange, options, selectedValues, ...props }: InputCheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export declare function InputCheckboxGroup({ onChange, options, selectedValues, scale, ...props }: InputCheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
57
59
|
export default InputCheckboxGroup;
|
|
@@ -2,11 +2,13 @@ import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
|
2
2
|
import { GetStatusProps } from '../shared/types.js';
|
|
3
3
|
type HTMLInputProps = ComponentPropsWithRef<'input'>;
|
|
4
4
|
type FilteredHTMLInputProps = Omit<HTMLInputProps, 'type'>;
|
|
5
|
+
export type InputRadioScale = 'medium' | 'large';
|
|
5
6
|
export type InputRadioProps = FilteredHTMLInputProps & GetStatusProps & {
|
|
6
7
|
id: string;
|
|
7
8
|
label: ReactNode;
|
|
8
9
|
value: string;
|
|
9
10
|
name: string;
|
|
11
|
+
scale?: InputRadioScale;
|
|
10
12
|
/** @deprecated use `data-testid` instead */
|
|
11
13
|
testId?: string;
|
|
12
14
|
'data-testid'?: string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { InputGroupProps } from '../shared/InputGroup/InputGroup';
|
|
3
|
-
import { InputRadioProps } from '../InputRadio/InputRadio';
|
|
3
|
+
import { InputRadioProps, InputRadioScale } from '../InputRadio/InputRadio';
|
|
4
4
|
type FilteredInputRadioProps = Readonly<Omit<InputRadioProps, 'id' | 'name' | 'onChange'>>;
|
|
5
5
|
export type InputRadioGroupProps = InputGroupProps & {
|
|
6
6
|
options: readonly FilteredInputRadioProps[];
|
|
7
7
|
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
selectedValue: string;
|
|
9
|
+
/** Controls the scale of all radio inputs in the group. Overridden per-item by a `scale` on the option itself. */
|
|
10
|
+
scale?: InputRadioScale;
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* - InputRadioGroup is a controlled component: You must provide an `onChange` handler to update the `selectedValue`.
|
|
@@ -48,5 +50,5 @@ export type InputRadioGroupProps = InputGroupProps & {
|
|
|
48
50
|
* );
|
|
49
51
|
* ```
|
|
50
52
|
*/
|
|
51
|
-
export declare function InputRadioGroup({ onChange, options, selectedValue, ...props }: InputRadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare function InputRadioGroup({ onChange, options, selectedValue, scale, ...props }: InputRadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
52
54
|
export default InputRadioGroup;
|