@companycam/slab-web 2.1.3 → 2.2.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/index.js +623 -618
- package/index.mjs +8682 -8892
- 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/lib/Spinner/Spinner.d.ts +1 -1
- package/lib/shared/Message/Message.d.ts +3 -3
- package/package.json +1 -1
- package/storybook/TokenDocs/FilterableTokensList.d.ts +1 -0
- package/storybook/TokenDocs/TokenItem.d.ts +6 -0
- package/storybook/TokenDocs/TokenItemLeft.d.ts +7 -0
- package/storybook/TokenDocs/TokenSearchForm.d.ts +10 -0
- package/storybook/TokenDocs/TokenUsage.d.ts +7 -0
- package/storybook/TokenDocs/TokensList.d.ts +6 -0
- package/storybook/TokenDocs/types.d.ts +3 -0
- package/storybook/TokenDocs/utils.d.ts +6 -0
|
@@ -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;
|
package/lib/Spinner/Spinner.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ type LayoutProps = {
|
|
|
23
23
|
$layout?: Layout;
|
|
24
24
|
$ccMargin?: SpinnerProps['ccMargin'];
|
|
25
25
|
};
|
|
26
|
-
declare const Layout: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components
|
|
26
|
+
declare const Layout: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof LayoutProps> & LayoutProps, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof LayoutProps> & LayoutProps, never>>> & string;
|
|
27
27
|
/** Use Spinner when something's happening and the user needs to wait. Versatile and customizable. */
|
|
28
28
|
export declare const Spinner: ({ accessibilityLabel, ccMargin, "data-testid": dataTestId, isCentered, label, layout, meterColor, size, trackColor, testId, ...props }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
export default Spinner;
|
|
@@ -9,9 +9,9 @@ export type MessageProps = HTMLDivProps & GetStatusProps & {
|
|
|
9
9
|
type MessageContentProps = {
|
|
10
10
|
$status: MessageProps['status'];
|
|
11
11
|
};
|
|
12
|
-
export declare const MessageContent: import('styled-components/dist/types.js').IStyledComponentBase<"web", import('styled-components
|
|
13
|
-
export declare const MessageIcon: import('styled-components/dist/types.js').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, never
|
|
14
|
-
export declare const MessageText: import('styled-components/dist/types.js').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never
|
|
12
|
+
export declare const MessageContent: import('styled-components/dist/types.js').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$status"> & MessageContentProps, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$status"> & MessageContentProps, never>>> & string;
|
|
13
|
+
export declare const MessageIcon: import('styled-components/dist/types.js').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, never>>> & string;
|
|
14
|
+
export declare const MessageText: import('styled-components/dist/types.js').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
15
15
|
/**
|
|
16
16
|
* Message is used inside forms components like InputText as a DRY way of rendering a message below the input / label UI.
|
|
17
17
|
* */
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FilterableTokensList: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TokenDoc, WebTokenDocCategory } from './types';
|
|
2
|
+
type TokenItemLeftProps = {
|
|
3
|
+
token: TokenDoc;
|
|
4
|
+
category: WebTokenDocCategory;
|
|
5
|
+
};
|
|
6
|
+
export declare const TokenItemLeft: ({ token, category }: TokenItemLeftProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WebTokenDocCategory } from './types';
|
|
2
|
+
export type TokenSearchFormValues = {
|
|
3
|
+
query: string;
|
|
4
|
+
category: WebTokenDocCategory | '';
|
|
5
|
+
};
|
|
6
|
+
type TokenSearchFormProps = {
|
|
7
|
+
onChange: (values: TokenSearchFormValues) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const TokenSearchForm: ({ onChange }: TokenSearchFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TokenDoc, WebTokenDocCategory } from './types';
|
|
2
|
+
type TokenUsageProps = {
|
|
3
|
+
token: TokenDoc;
|
|
4
|
+
category: WebTokenDocCategory;
|
|
5
|
+
};
|
|
6
|
+
export declare const TokenUsage: ({ token, category }: TokenUsageProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TokenDoc, WebTokenDocCategory } from './types';
|
|
2
|
+
export declare const getTokenWebCategory: (token: TokenDoc) => WebTokenDocCategory | null;
|
|
3
|
+
export declare const getFilteredTokenDocs: ({ query, category, }: {
|
|
4
|
+
query?: string;
|
|
5
|
+
category?: WebTokenDocCategory;
|
|
6
|
+
}) => TokenDoc[];
|