@common-origin/design-system 2.4.0 → 2.6.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/dist/components/atoms/Box/Box.d.ts +3 -3
- package/dist/components/atoms/Button/Button.d.ts +1 -1
- package/dist/components/atoms/CategoryBadge/CategoryBadge.d.ts +4 -17
- package/dist/components/atoms/Chip/shared/ChipBase.d.ts +3 -5
- package/dist/components/atoms/Chip/shared/utils.d.ts +53 -8
- package/dist/components/atoms/StatusBadge/StatusBadge.d.ts +1 -0
- package/dist/components/molecules/ActionSheet/ActionSheet.d.ts +2 -1
- package/dist/components/molecules/CodeBlock/CodeBlock.d.ts +29 -0
- package/dist/components/molecules/List/ListItem.d.ts +7 -1
- package/dist/index.d.ts +91 -0
- package/dist/index.esm.js +973 -789
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +973 -789
- package/dist/index.js.map +1 -1
- package/dist/styles/icons.json +3 -3
- package/dist/styles/tokens.json +96 -5
- package/dist/tokens/index.esm.js +96 -5
- package/dist/tokens/index.esm.js.map +1 -1
- package/dist/tokens/index.js +96 -5
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/tokens.d.ts +91 -0
- package/package.json +1 -1
|
@@ -32,7 +32,7 @@ export interface BoxProps {
|
|
|
32
32
|
right?: string;
|
|
33
33
|
bottom?: string;
|
|
34
34
|
left?: string;
|
|
35
|
-
borderRadius?: keyof typeof tokens.
|
|
35
|
+
borderRadius?: keyof typeof tokens.semantic.border.radius;
|
|
36
36
|
border?: keyof typeof tokens.semantic.color.border;
|
|
37
37
|
borderTop?: keyof typeof tokens.semantic.color.border;
|
|
38
38
|
borderRight?: keyof typeof tokens.semantic.color.border;
|
|
@@ -40,10 +40,10 @@ export interface BoxProps {
|
|
|
40
40
|
borderLeft?: keyof typeof tokens.semantic.color.border;
|
|
41
41
|
bg?: keyof typeof tokens.semantic.color.background;
|
|
42
42
|
color?: keyof typeof tokens.semantic.color.text;
|
|
43
|
-
shadow?: keyof typeof tokens.
|
|
43
|
+
shadow?: keyof typeof tokens.semantic.elevation;
|
|
44
44
|
cursor?: 'auto' | 'default' | 'pointer' | 'wait' | 'text' | 'move' | 'help' | 'not-allowed';
|
|
45
45
|
transition?: string;
|
|
46
|
-
hoverShadow?: keyof typeof tokens.
|
|
46
|
+
hoverShadow?: keyof typeof tokens.semantic.elevation;
|
|
47
47
|
hoverTransform?: string;
|
|
48
48
|
overflow?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
49
49
|
overflowX?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type IconName } from '../Icon';
|
|
3
3
|
export interface BaseButtonProps {
|
|
4
|
-
variant?: 'primary' | 'secondary' | 'naked';
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'naked' | 'emphasis' | 'danger';
|
|
5
5
|
size?: 'small' | 'medium' | 'large';
|
|
6
6
|
url?: string;
|
|
7
7
|
purpose?: 'button' | 'link';
|
|
@@ -39,15 +39,6 @@ export interface CategoryBadgeProps {
|
|
|
39
39
|
* Optional icon name to display
|
|
40
40
|
*/
|
|
41
41
|
icon?: IconName;
|
|
42
|
-
/**
|
|
43
|
-
* Optional click handler (makes badge interactive)
|
|
44
|
-
*/
|
|
45
|
-
onClick?: () => void;
|
|
46
|
-
/**
|
|
47
|
-
* Whether the badge is disabled
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
disabled?: boolean;
|
|
51
42
|
/**
|
|
52
43
|
* Test identifier for automated testing
|
|
53
44
|
*/
|
|
@@ -60,8 +51,9 @@ export interface CategoryBadgeProps {
|
|
|
60
51
|
/**
|
|
61
52
|
* CategoryBadge component for displaying transaction categories
|
|
62
53
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
54
|
+
* A static label for categorizing content with support for 8 color options,
|
|
55
|
+
* 3 visual variants, and optional icons. Perfect for categorizing
|
|
56
|
+
* financial transactions or content types.
|
|
65
57
|
*
|
|
66
58
|
* @example
|
|
67
59
|
* ```tsx
|
|
@@ -69,12 +61,7 @@ export interface CategoryBadgeProps {
|
|
|
69
61
|
* Food & Dining
|
|
70
62
|
* </CategoryBadge>
|
|
71
63
|
*
|
|
72
|
-
* <CategoryBadge
|
|
73
|
-
* color="blue"
|
|
74
|
-
* variant="outlined"
|
|
75
|
-
* size="small"
|
|
76
|
-
* onClick={() => filterByCategory('travel')}
|
|
77
|
-
* >
|
|
64
|
+
* <CategoryBadge color="blue" variant="outlined" size="small">
|
|
78
65
|
* Travel
|
|
79
66
|
* </CategoryBadge>
|
|
80
67
|
* ```
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { InternalStyledProps } from './types';
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const IconContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<
|
|
5
|
-
export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<
|
|
2
|
+
export declare const StyledChip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, InternalStyledProps>> & string;
|
|
3
|
+
export declare const IconContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
4
|
+
export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
6
5
|
$disabled?: boolean;
|
|
7
6
|
}>> & string;
|
|
8
|
-
export declare const StyledChipWrapper: React.FC<React.PropsWithChildren<InternalStyledProps & React.HTMLAttributes<HTMLSpanElement>>>;
|
|
@@ -7,18 +7,62 @@ declare const chip: {
|
|
|
7
7
|
padding: string;
|
|
8
8
|
font: string;
|
|
9
9
|
};
|
|
10
|
+
hover: {
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
};
|
|
13
|
+
active: {
|
|
14
|
+
backgroundColor: string;
|
|
15
|
+
};
|
|
16
|
+
focus: {
|
|
17
|
+
outline: string;
|
|
18
|
+
outlineOffset: string;
|
|
19
|
+
};
|
|
20
|
+
disabled: {
|
|
21
|
+
backgroundColor: string;
|
|
22
|
+
textColor: string;
|
|
23
|
+
};
|
|
10
24
|
variants: {
|
|
11
25
|
emphasis: {
|
|
12
26
|
backgroundColor: string;
|
|
13
27
|
textColor: string;
|
|
28
|
+
hover: {
|
|
29
|
+
backgroundColor: string;
|
|
30
|
+
};
|
|
31
|
+
active: {
|
|
32
|
+
backgroundColor: string;
|
|
33
|
+
};
|
|
34
|
+
disabled: {
|
|
35
|
+
backgroundColor: string;
|
|
36
|
+
textColor: string;
|
|
37
|
+
};
|
|
14
38
|
};
|
|
15
39
|
subtle: {
|
|
16
40
|
backgroundColor: string;
|
|
17
41
|
textColor: string;
|
|
42
|
+
hover: {
|
|
43
|
+
backgroundColor: string;
|
|
44
|
+
};
|
|
45
|
+
active: {
|
|
46
|
+
backgroundColor: string;
|
|
47
|
+
};
|
|
48
|
+
disabled: {
|
|
49
|
+
backgroundColor: string;
|
|
50
|
+
textColor: string;
|
|
51
|
+
};
|
|
18
52
|
};
|
|
19
53
|
interactive: {
|
|
20
54
|
backgroundColor: string;
|
|
21
55
|
textColor: string;
|
|
56
|
+
hover: {
|
|
57
|
+
backgroundColor: string;
|
|
58
|
+
};
|
|
59
|
+
active: {
|
|
60
|
+
backgroundColor: string;
|
|
61
|
+
};
|
|
62
|
+
disabled: {
|
|
63
|
+
backgroundColor: string;
|
|
64
|
+
textColor: string;
|
|
65
|
+
};
|
|
22
66
|
};
|
|
23
67
|
};
|
|
24
68
|
sizes: {
|
|
@@ -36,12 +80,13 @@ declare const chip: {
|
|
|
36
80
|
};
|
|
37
81
|
};
|
|
38
82
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
83
|
+
interface StyledChipProps {
|
|
84
|
+
$variant: ChipVariant;
|
|
85
|
+
$size: BaseChipProps['size'];
|
|
86
|
+
$disabled?: boolean;
|
|
87
|
+
$clickable?: boolean;
|
|
88
|
+
$selected?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export declare const getVariantStyles: ({ $variant, $selected, $clickable, $disabled }: StyledChipProps) => string;
|
|
91
|
+
export declare const getSizeStyles: ({ $size }: StyledChipProps) => string;
|
|
47
92
|
export { chip as chipTokens };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type IconName } from '../../../types/icons';
|
|
2
3
|
/**
|
|
3
4
|
* Action item for the action sheet
|
|
@@ -107,4 +108,4 @@ export interface ActionSheetProps {
|
|
|
107
108
|
* />
|
|
108
109
|
* ```
|
|
109
110
|
*/
|
|
110
|
-
export declare const ActionSheet: ({ isOpen, onClose, title, description, actions, closeOnOverlayClick, closeOnEscape, showCloseButton, "data-testid": dataTestId }: ActionSheetProps) =>
|
|
111
|
+
export declare const ActionSheet: ({ isOpen, onClose, title, description, actions, closeOnOverlayClick, closeOnEscape, showCloseButton, "data-testid": dataTestId }: ActionSheetProps) => React.ReactPortal | null;
|
|
@@ -3,15 +3,44 @@ export interface CodeBlockProps {
|
|
|
3
3
|
children: string;
|
|
4
4
|
showCopyButton?: boolean;
|
|
5
5
|
onCopy?: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Maximum height in pixels before content is collapsed.
|
|
8
|
+
* When set, enables expand/collapse functionality.
|
|
9
|
+
*/
|
|
10
|
+
maxHeight?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Initial expanded state when maxHeight is set.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
defaultExpanded?: boolean;
|
|
6
16
|
'data-testid'?: string;
|
|
7
17
|
}
|
|
8
18
|
/**
|
|
9
19
|
* CodeBlock component for displaying formatted code with optional copy functionality
|
|
20
|
+
* and expandable content for long code blocks.
|
|
10
21
|
*
|
|
11
22
|
* @param children - The code content to display
|
|
12
23
|
* @param showCopyButton - Whether to show the copy button (default: true)
|
|
13
24
|
* @param onCopy - Optional callback when code is copied
|
|
25
|
+
* @param maxHeight - Maximum height in pixels before enabling expand/collapse
|
|
26
|
+
* @param defaultExpanded - Initial expanded state when maxHeight is set
|
|
14
27
|
* @param data-testid - Test identifier for the code block
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Basic usage
|
|
32
|
+
* <CodeBlock>const x = 1;</CodeBlock>
|
|
33
|
+
*
|
|
34
|
+
* // With max height and expand/collapse
|
|
35
|
+
* <CodeBlock maxHeight={200}>
|
|
36
|
+
* {longCodeString}
|
|
37
|
+
* </CodeBlock>
|
|
38
|
+
*
|
|
39
|
+
* // Start expanded
|
|
40
|
+
* <CodeBlock maxHeight={200} defaultExpanded>
|
|
41
|
+
* {longCodeString}
|
|
42
|
+
* </CodeBlock>
|
|
43
|
+
* ```
|
|
15
44
|
*/
|
|
16
45
|
export declare const CodeBlock: React.FC<CodeBlockProps>;
|
|
17
46
|
export default CodeBlock;
|
|
@@ -49,6 +49,12 @@ export interface ListItemProps {
|
|
|
49
49
|
* @default false
|
|
50
50
|
*/
|
|
51
51
|
selected?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Destructive/danger state (e.g., delete actions)
|
|
54
|
+
* Displays text and icon in error color
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
destructive?: boolean;
|
|
52
58
|
/**
|
|
53
59
|
* Spacing variant from parent List
|
|
54
60
|
* @default 'comfortable'
|
|
@@ -89,6 +95,6 @@ export interface ListItemProps {
|
|
|
89
95
|
onKeyDown?: (e: React.KeyboardEvent) => void;
|
|
90
96
|
}
|
|
91
97
|
export declare const ListItem: {
|
|
92
|
-
({ primary, secondary, badge, icon, expandable, expanded, onToggle, interactive, onClick, disabled, selected, spacing, children, className, "data-testid": dataTestId, role: customRole, "aria-selected": ariaSelected, id, tabIndex: customTabIndex, onKeyDown: customOnKeyDown, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
({ primary, secondary, badge, icon, expandable, expanded, onToggle, interactive, onClick, disabled, selected, destructive, spacing, children, className, "data-testid": dataTestId, role: customRole, "aria-selected": ariaSelected, id, tabIndex: customTabIndex, onKeyDown: customOnKeyDown, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
93
99
|
displayName: string;
|
|
94
100
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -368,6 +368,34 @@ export declare const tokens: {
|
|
|
368
368
|
textColor: string;
|
|
369
369
|
};
|
|
370
370
|
};
|
|
371
|
+
emphasis: {
|
|
372
|
+
backgroundColor: string;
|
|
373
|
+
textColor: string;
|
|
374
|
+
hover: {
|
|
375
|
+
backgroundColor: string;
|
|
376
|
+
};
|
|
377
|
+
active: {
|
|
378
|
+
backgroundColor: string;
|
|
379
|
+
};
|
|
380
|
+
disabled: {
|
|
381
|
+
backgroundColor: string;
|
|
382
|
+
textColor: string;
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
danger: {
|
|
386
|
+
backgroundColor: string;
|
|
387
|
+
textColor: string;
|
|
388
|
+
hover: {
|
|
389
|
+
backgroundColor: string;
|
|
390
|
+
};
|
|
391
|
+
active: {
|
|
392
|
+
backgroundColor: string;
|
|
393
|
+
};
|
|
394
|
+
disabled: {
|
|
395
|
+
backgroundColor: string;
|
|
396
|
+
textColor: string;
|
|
397
|
+
};
|
|
398
|
+
};
|
|
371
399
|
};
|
|
372
400
|
sizes: {
|
|
373
401
|
small: {
|
|
@@ -392,18 +420,62 @@ export declare const tokens: {
|
|
|
392
420
|
padding: string;
|
|
393
421
|
font: string;
|
|
394
422
|
};
|
|
423
|
+
hover: {
|
|
424
|
+
backgroundColor: string;
|
|
425
|
+
};
|
|
426
|
+
active: {
|
|
427
|
+
backgroundColor: string;
|
|
428
|
+
};
|
|
429
|
+
focus: {
|
|
430
|
+
outline: string;
|
|
431
|
+
outlineOffset: string;
|
|
432
|
+
};
|
|
433
|
+
disabled: {
|
|
434
|
+
backgroundColor: string;
|
|
435
|
+
textColor: string;
|
|
436
|
+
};
|
|
395
437
|
variants: {
|
|
396
438
|
emphasis: {
|
|
397
439
|
backgroundColor: string;
|
|
398
440
|
textColor: string;
|
|
441
|
+
hover: {
|
|
442
|
+
backgroundColor: string;
|
|
443
|
+
};
|
|
444
|
+
active: {
|
|
445
|
+
backgroundColor: string;
|
|
446
|
+
};
|
|
447
|
+
disabled: {
|
|
448
|
+
backgroundColor: string;
|
|
449
|
+
textColor: string;
|
|
450
|
+
};
|
|
399
451
|
};
|
|
400
452
|
subtle: {
|
|
401
453
|
backgroundColor: string;
|
|
402
454
|
textColor: string;
|
|
455
|
+
hover: {
|
|
456
|
+
backgroundColor: string;
|
|
457
|
+
};
|
|
458
|
+
active: {
|
|
459
|
+
backgroundColor: string;
|
|
460
|
+
};
|
|
461
|
+
disabled: {
|
|
462
|
+
backgroundColor: string;
|
|
463
|
+
textColor: string;
|
|
464
|
+
};
|
|
403
465
|
};
|
|
404
466
|
interactive: {
|
|
405
467
|
backgroundColor: string;
|
|
406
468
|
textColor: string;
|
|
469
|
+
hover: {
|
|
470
|
+
backgroundColor: string;
|
|
471
|
+
};
|
|
472
|
+
active: {
|
|
473
|
+
backgroundColor: string;
|
|
474
|
+
};
|
|
475
|
+
disabled: {
|
|
476
|
+
backgroundColor: string;
|
|
477
|
+
textColor: string;
|
|
478
|
+
};
|
|
407
479
|
};
|
|
408
480
|
};
|
|
409
481
|
sizes: {
|
|
@@ -581,12 +653,31 @@ export declare const tokens: {
|
|
|
581
653
|
$ref: string;
|
|
582
654
|
};
|
|
583
655
|
semantic: {
|
|
656
|
+
elevation: {
|
|
657
|
+
none: string;
|
|
658
|
+
inset: string;
|
|
659
|
+
raised: string;
|
|
660
|
+
floating: string;
|
|
661
|
+
overlay: string;
|
|
662
|
+
sticky: string;
|
|
663
|
+
};
|
|
584
664
|
border: {
|
|
585
665
|
default: string;
|
|
586
666
|
subtle: string;
|
|
587
667
|
strong: string;
|
|
588
668
|
focus: string;
|
|
589
669
|
tooltip: string;
|
|
670
|
+
radius: {
|
|
671
|
+
none: string;
|
|
672
|
+
xs: string;
|
|
673
|
+
sm: string;
|
|
674
|
+
md: string;
|
|
675
|
+
lg: string;
|
|
676
|
+
xl: string;
|
|
677
|
+
"2xl": string;
|
|
678
|
+
"3xl": string;
|
|
679
|
+
circle: string;
|
|
680
|
+
};
|
|
590
681
|
};
|
|
591
682
|
size: {
|
|
592
683
|
icon: {
|