@common-origin/design-system 1.5.0 → 1.7.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/README.md CHANGED
@@ -109,7 +109,7 @@ function MyApp() {
109
109
 
110
110
  **✅ Atoms (12 components)**:
111
111
  - Alert, Avatar, Box, Button, Chip, Container
112
- - Picture, Icon, IconButton, SectionSeparator
112
+ - Picture, Icon, IconButton, Divider
113
113
  - Stack, Typography
114
114
 
115
115
  **✅ Molecules (8 components)**:
@@ -134,16 +134,48 @@ This design system is production-ready with:
134
134
 
135
135
  ## 🤝 Contributing
136
136
 
137
- This design system follows established patterns:
138
- - **Comprehensive testing** with jest-axe for accessibility compliance
139
- - **Token-driven styling** - all components use semantic design tokens
140
- - **TypeScript interfaces** with complete props documentation
141
- - **Atomic design principles** for scalable component organization
142
- - **Component documentation** with interactive examples and usage patterns
137
+ We welcome contributions! Please follow our established standards:
143
138
 
144
- ### Development Workflow
139
+ ### Quick Start
140
+ ```bash
141
+ # Fork and clone
142
+ git clone <your-fork>
143
+ cd common-origin-design-system
144
+ npm install
145
+
146
+ # Start development
147
+ npm run docs:dev # Starts dev server with docs
148
+ npm test # Run tests
149
+ ```
150
+
151
+ ### Commit Convention
152
+ We use [Conventional Commits](https://www.conventionalcommits.org/) for automatic changelog generation:
153
+
154
+ ```bash
155
+ feat(Component): add new feature
156
+ fix(Component): fix bug
157
+ docs: update documentation
158
+ chore: bump version to X.Y.Z
159
+ ```
160
+
161
+ ### Release Process
162
+ ```bash
163
+ # Automated release (recommended)
164
+ npm run release:create
165
+
166
+ # Manual release - see .github/RELEASE_PROCESS.md
167
+ ```
168
+
169
+ ### Documentation
170
+ - **Contributing Guide**: [CONTRIBUTING.md](./CONTRIBUTING.md)
171
+ - **Release Process**: [.github/RELEASE_PROCESS.md](./.github/RELEASE_PROCESS.md)
172
+ - **Documentation Standards**: [.github/DOCUMENTATION_STANDARDS.md](./.github/DOCUMENTATION_STANDARDS.md)
173
+ - **Quick Reference**: [.github/RELEASE_CHEATSHEET.md](./.github/RELEASE_CHEATSHEET.md)
174
+
175
+ ### Development Standards
145
176
  1. Components follow the atomic design hierarchy
146
177
  2. All styling uses design tokens from `src/styles/tokens.json`
147
178
  3. Each component includes `.test.tsx`, `.docs.tsx`, and implementation files
148
179
  4. Tests must include accessibility validation with jest-axe
149
- 5. Documentation includes live examples and prop descriptions
180
+ 5. Documentation includes live examples and prop descriptions
181
+ 6. Use conventional commit messages for all commits
@@ -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
- export interface ChipProps {
3
- children?: React.ReactNode;
4
- variant?: 'default' | 'emphasis' | 'subtle' | 'interactive' | 'light' | 'dark';
5
- size?: 'small' | 'medium' | 'large';
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
- disabled?: boolean;
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?: 'light' | 'dark';
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>;
@@ -1 +1,3 @@
1
1
  export * from './Chip';
2
+ export * from './FilterChip';
3
+ export * from './BooleanChip';
@@ -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,30 @@
1
+ import React from 'react';
2
+ export interface DividerProps {
3
+ /** Variant style of the divider */
4
+ variant?: 'default' | 'strong' | 'minimal';
5
+ /** Size variation affecting spacing */
6
+ size?: 'small' | 'medium' | 'large' | 'xlarge';
7
+ /** Orientation of the divider */
8
+ orientation?: 'horizontal' | 'vertical';
9
+ /** Data test id for testing */
10
+ 'data-testid'?: string;
11
+ }
12
+ /**
13
+ * Divider is an atomic component that provides visual separation between content sections.
14
+ *
15
+ * Features:
16
+ * - Multiple variants (default, strong, minimal)
17
+ * - Size variations for different spacing needs
18
+ * - Horizontal and vertical orientations
19
+ * - Semantic token usage for consistent styling
20
+ * - Full accessibility support
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <Divider />
25
+ * <Divider variant="strong" size="xlarge" />
26
+ * <Divider variant="minimal" />
27
+ * <Divider orientation="vertical" />
28
+ * ```
29
+ */
30
+ export declare const Divider: React.FC<DividerProps>;
@@ -0,0 +1 @@
1
+ export * from './Divider';
@@ -8,6 +8,6 @@ export * from './DateFormatter';
8
8
  export * from './Icon';
9
9
  export * from './IconButton';
10
10
  export * from './ProgressBar';
11
- export * from './SectionSeparator';
11
+ export * from './Divider';
12
12
  export * from './Stack';
13
13
  export * from './Typography';