@common-origin/design-system 1.4.2 → 1.6.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/dist/components/atoms/Chip/BooleanChip.d.ts +23 -0
- package/dist/components/atoms/Chip/Chip.d.ts +22 -9
- package/dist/components/atoms/Chip/FilterChip.d.ts +27 -0
- package/dist/components/atoms/Chip/index.d.ts +2 -0
- package/dist/components/atoms/Chip/shared/ChipBase.d.ts +8 -0
- package/dist/components/atoms/Chip/shared/types.d.ts +18 -0
- package/dist/components/atoms/Chip/shared/utils.d.ts +47 -0
- package/dist/components/atoms/ProgressBar/ProgressBar.d.ts +17 -0
- package/dist/components/atoms/ProgressBar/index.d.ts +2 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/index.esm.js +334 -67
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +336 -66
- package/dist/index.js.map +1 -1
- package/dist/lib/styleUtils.d.ts +1 -1
- package/dist/tokens/index.esm.js +20 -1
- package/dist/tokens/index.esm.js.map +1 -1
- package/dist/tokens/index.js +20 -1
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/tokens.d.ts +19 -0
- package/dist/types/icons.d.ts +1 -1
- package/package.json +3 -2
- package/dist/components/atoms/CoverImage/CoverImage.d.ts +0 -11
- package/dist/components/atoms/CoverImage/index.d.ts +0 -1
- package/dist/components/dateFormatter.d.ts +0 -7
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseChipProps } from './shared/types';
|
|
3
|
+
export interface BooleanChipProps extends BaseChipProps {
|
|
4
|
+
/** Whether the chip is in selected state */
|
|
5
|
+
selected: boolean;
|
|
6
|
+
/** Callback function when the chip is clicked/toggled */
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* BooleanChip - Toggleable chip for quick filter controls
|
|
11
|
+
*
|
|
12
|
+
* Use this component for multi-select filter controls where users can
|
|
13
|
+
* see which options are active. Common in table filtering patterns where
|
|
14
|
+
* users toggle filters on/off.
|
|
15
|
+
*
|
|
16
|
+
* Features:
|
|
17
|
+
* - Shows checkmark icon when selected
|
|
18
|
+
* - Entire chip is clickable to toggle
|
|
19
|
+
* - Keyboard activation with Space or Enter
|
|
20
|
+
* - Uses checkbox role with aria-checked
|
|
21
|
+
* - Visual background change when selected
|
|
22
|
+
*/
|
|
23
|
+
export declare const BooleanChip: React.FC<BooleanChipProps>;
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { BaseChipProps, ChipVariant, LegacyVariant } from './shared/types';
|
|
3
|
+
export interface ChipProps extends BaseChipProps {
|
|
4
|
+
/** Visual style variant */
|
|
5
|
+
variant?: ChipVariant | LegacyVariant;
|
|
6
|
+
/** Click handler for interactive chips */
|
|
6
7
|
onClick?: () => void;
|
|
7
|
-
|
|
8
|
-
'data-testid'?: string;
|
|
9
|
-
'aria-label'?: string;
|
|
10
|
-
'aria-describedby'?: string;
|
|
8
|
+
/** Custom ARIA role override */
|
|
11
9
|
role?: string;
|
|
10
|
+
/** Legacy title prop for backward compatibility */
|
|
12
11
|
title?: string;
|
|
13
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Chip - Compact element for displaying tags, categories, and labels
|
|
15
|
+
*
|
|
16
|
+
* Use this component for static display chips or simple interactive chips.
|
|
17
|
+
* For specialized filtering patterns, use:
|
|
18
|
+
* - FilterChip: Dismissible chips for showing applied filters
|
|
19
|
+
* - BooleanChip: Toggleable chips for quick filter controls
|
|
20
|
+
*
|
|
21
|
+
* Variants:
|
|
22
|
+
* - default: Standard gray background
|
|
23
|
+
* - emphasis: High-contrast dark background
|
|
24
|
+
* - subtle: Light background for secondary info
|
|
25
|
+
* - interactive: Blue background with hover states
|
|
26
|
+
*/
|
|
14
27
|
export declare const Chip: React.FC<ChipProps>;
|
|
15
28
|
export interface LegacyChipProps {
|
|
16
29
|
title: string;
|
|
17
|
-
variant?:
|
|
30
|
+
variant?: LegacyVariant;
|
|
18
31
|
}
|
|
19
32
|
export declare const LegacyChip: React.FC<LegacyChipProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseChipProps } from './shared/types';
|
|
3
|
+
export interface FilterChipProps extends BaseChipProps {
|
|
4
|
+
/** Whether the filter is in selected/applied state */
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
/** Callback function when the chip is dismissed via close button or keyboard */
|
|
7
|
+
onDismiss?: () => void;
|
|
8
|
+
/** Custom ARIA role override */
|
|
9
|
+
role?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* FilterChip - Chip for displaying filters with selected state and optional dismissal
|
|
13
|
+
*
|
|
14
|
+
* Use this component to show filters that can be selected/deselected.
|
|
15
|
+
* When selected, displays a checkmark and light blue background.
|
|
16
|
+
* Optionally dismissible when onDismiss is provided.
|
|
17
|
+
*
|
|
18
|
+
* Features:
|
|
19
|
+
* - Shows checkmark icon when selected
|
|
20
|
+
* - Light blue background when selected
|
|
21
|
+
* - Optional close (×) button when onDismiss is provided
|
|
22
|
+
* - Keyboard dismissal with Delete or Backspace keys (when dismissible)
|
|
23
|
+
* - Non-clickable body (only close button is interactive when present)
|
|
24
|
+
* - Uses subtle/interactive background styling based on selected state
|
|
25
|
+
* - Announces as "status" to screen readers
|
|
26
|
+
*/
|
|
27
|
+
export declare const FilterChip: React.FC<FilterChipProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InternalStyledProps } from './types';
|
|
3
|
+
export declare const BaseChipStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
4
|
+
export declare const IconContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
5
|
+
export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
6
|
+
$disabled?: boolean | undefined;
|
|
7
|
+
}>> & string;
|
|
8
|
+
export declare const StyledChipWrapper: React.FC<React.PropsWithChildren<InternalStyledProps & React.HTMLAttributes<HTMLSpanElement>>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BaseChipProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
size?: 'small' | 'medium';
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
'data-testid'?: string;
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
'aria-describedby'?: string;
|
|
9
|
+
}
|
|
10
|
+
export type ChipVariant = 'default' | 'emphasis' | 'subtle' | 'interactive';
|
|
11
|
+
export interface InternalStyledProps {
|
|
12
|
+
$variant: ChipVariant;
|
|
13
|
+
$size: BaseChipProps['size'];
|
|
14
|
+
$disabled?: boolean;
|
|
15
|
+
$clickable?: boolean;
|
|
16
|
+
$selected?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export type LegacyVariant = 'light' | 'dark';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ChipVariant, BaseChipProps } from './types';
|
|
2
|
+
declare const chip: {
|
|
3
|
+
default: {
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
textColor: string;
|
|
6
|
+
borderRadius: string;
|
|
7
|
+
padding: string;
|
|
8
|
+
font: string;
|
|
9
|
+
};
|
|
10
|
+
variants: {
|
|
11
|
+
emphasis: {
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
textColor: string;
|
|
14
|
+
};
|
|
15
|
+
subtle: {
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
textColor: string;
|
|
18
|
+
};
|
|
19
|
+
interactive: {
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
textColor: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
sizes: {
|
|
25
|
+
small: {
|
|
26
|
+
padding: string;
|
|
27
|
+
font: string;
|
|
28
|
+
};
|
|
29
|
+
medium: {
|
|
30
|
+
padding: string;
|
|
31
|
+
font: string;
|
|
32
|
+
};
|
|
33
|
+
large: {
|
|
34
|
+
padding: string;
|
|
35
|
+
font: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare const getVariantStylesAsObject: (variant: ChipVariant, selected?: boolean) => {
|
|
40
|
+
backgroundColor: string;
|
|
41
|
+
color: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const getSizeStylesAsObject: (size: BaseChipProps['size']) => {
|
|
44
|
+
font: string;
|
|
45
|
+
padding: string;
|
|
46
|
+
};
|
|
47
|
+
export { chip as chipTokens };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ProgressBarProps {
|
|
3
|
+
/** Progress value from 0 to 100 */
|
|
4
|
+
value: number;
|
|
5
|
+
/** Orientation of the progress bar */
|
|
6
|
+
variant?: 'horizontal' | 'vertical';
|
|
7
|
+
/** Color variant for the progress bar */
|
|
8
|
+
color?: 'success' | 'error' | 'default';
|
|
9
|
+
/** Height size for horizontal progress bar (default: md) */
|
|
10
|
+
height?: 'sm' | 'md' | 'lg' | 'xl';
|
|
11
|
+
/** Width size for vertical progress bar (default: md) */
|
|
12
|
+
width?: 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
/** Data attribute for testing */
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const ProgressBar: React.FC<ProgressBarProps>;
|
|
17
|
+
export default ProgressBar;
|