@common-origin/design-system 1.12.1 → 1.14.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.
@@ -12,6 +12,8 @@ export interface DropdownProps {
12
12
  disabled?: boolean;
13
13
  className?: string;
14
14
  label?: string;
15
+ helperText?: string;
16
+ error?: string;
15
17
  }
16
18
  declare const DropdownOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
17
19
  $isSelected: boolean;
@@ -0,0 +1,55 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ /**
3
+ * Props for the PasswordField component
4
+ */
5
+ export interface PasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
6
+ /**
7
+ * Label text for the input
8
+ */
9
+ label?: string;
10
+ /**
11
+ * Helper text displayed below the input
12
+ */
13
+ helperText?: string;
14
+ /**
15
+ * Error message to display
16
+ */
17
+ error?: string;
18
+ /**
19
+ * Whether the field is required
20
+ * @default false
21
+ */
22
+ required?: boolean;
23
+ /**
24
+ * Whether the input is disabled
25
+ * @default false
26
+ */
27
+ disabled?: boolean;
28
+ /**
29
+ * Unique identifier for the input
30
+ * Generated automatically if not provided
31
+ */
32
+ id?: string;
33
+ /**
34
+ * Test identifier for automated testing
35
+ */
36
+ 'data-testid'?: string;
37
+ /**
38
+ * Whether to show the password visibility toggle button
39
+ * @default true
40
+ */
41
+ showToggle?: boolean;
42
+ }
43
+ /**
44
+ * PasswordField component for secure password input with visibility toggle
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * <PasswordField
49
+ * label="Password"
50
+ * helperText="Must be at least 8 characters"
51
+ * required
52
+ * />
53
+ * ```
54
+ */
55
+ export declare const PasswordField: import("react").ForwardRefExoticComponent<PasswordFieldProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,2 @@
1
+ export { PasswordField } from './PasswordField';
2
+ export type { PasswordFieldProps } from './PasswordField';
@@ -0,0 +1,96 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Props for the Sheet component
4
+ */
5
+ export interface SheetProps {
6
+ /**
7
+ * Whether the sheet is open
8
+ */
9
+ isOpen: boolean;
10
+ /**
11
+ * Callback fired when the sheet should close
12
+ */
13
+ onClose: () => void;
14
+ /**
15
+ * Position of the sheet
16
+ * @default 'right'
17
+ */
18
+ position?: 'top' | 'right' | 'bottom' | 'left';
19
+ /**
20
+ * Variant of the sheet
21
+ * - 'sheet': Full height/width edge-to-edge
22
+ * - 'drawer': Floating with rounded corners and margin
23
+ * @default 'sheet'
24
+ */
25
+ variant?: 'sheet' | 'drawer';
26
+ /**
27
+ * Width of the sheet (for left/right positions)
28
+ * @default '400px'
29
+ */
30
+ width?: string;
31
+ /**
32
+ * Height of the sheet (for top/bottom positions)
33
+ * @default '400px'
34
+ */
35
+ height?: string;
36
+ /**
37
+ * Content to display in the sheet
38
+ */
39
+ children?: ReactNode;
40
+ /**
41
+ * Whether clicking the overlay should close the sheet
42
+ * @default true
43
+ */
44
+ closeOnOverlayClick?: boolean;
45
+ /**
46
+ * Whether pressing Escape should close the sheet
47
+ * @default true
48
+ */
49
+ closeOnEscape?: boolean;
50
+ /**
51
+ * Optional title for the sheet (improves accessibility)
52
+ */
53
+ title?: string;
54
+ /**
55
+ * Test identifier for automated testing
56
+ */
57
+ 'data-testid'?: string;
58
+ /**
59
+ * Accessible label for the sheet
60
+ */
61
+ 'aria-label'?: string;
62
+ /**
63
+ * ID of element describing the sheet
64
+ */
65
+ 'aria-describedby'?: string;
66
+ }
67
+ /**
68
+ * Sheet component for side panels and drawers
69
+ *
70
+ * Provides a sliding panel that appears from any edge of the screen.
71
+ * Can be used for navigation menus, filters, forms, or additional content.
72
+ *
73
+ * @example
74
+ * ```tsx
75
+ * // Right-positioned sheet (default)
76
+ * <Sheet isOpen={isOpen} onClose={() => setIsOpen(false)}>
77
+ * <h2>Sheet Content</h2>
78
+ * <p>Your content here</p>
79
+ * </Sheet>
80
+ *
81
+ * // Drawer variant from bottom
82
+ * <Sheet
83
+ * isOpen={isOpen}
84
+ * onClose={() => setIsOpen(false)}
85
+ * position="bottom"
86
+ * variant="drawer"
87
+ * height="60vh"
88
+ * >
89
+ * <h2>Mobile Menu</h2>
90
+ * </Sheet>
91
+ * ```
92
+ */
93
+ export declare const Sheet: {
94
+ ({ isOpen, onClose, position, variant, width, height, children, closeOnOverlayClick, closeOnEscape, title, "data-testid": dataTestId, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: SheetProps): import("react").JSX.Element | null;
95
+ displayName: string;
96
+ };
@@ -0,0 +1,2 @@
1
+ export { Sheet } from './Sheet';
2
+ export type { SheetProps } from './Sheet';
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Props for the Slider component
3
+ */
4
+ export interface SliderProps {
5
+ /**
6
+ * Minimum value of the slider
7
+ * @default 0
8
+ */
9
+ min?: number;
10
+ /**
11
+ * Maximum value of the slider
12
+ * @default 100
13
+ */
14
+ max?: number;
15
+ /**
16
+ * Step increment for value changes
17
+ * @default 1
18
+ */
19
+ step?: number;
20
+ /**
21
+ * Current value for single slider
22
+ */
23
+ value?: number;
24
+ /**
25
+ * Default value for uncontrolled single slider
26
+ */
27
+ defaultValue?: number;
28
+ /**
29
+ * Current values for range slider [min, max]
30
+ */
31
+ rangeValue?: [number, number];
32
+ /**
33
+ * Default values for uncontrolled range slider [min, max]
34
+ */
35
+ defaultRangeValue?: [number, number];
36
+ /**
37
+ * Callback fired when value changes (single slider)
38
+ */
39
+ onChange?: (value: number) => void;
40
+ /**
41
+ * Callback fired when range values change (range slider)
42
+ */
43
+ onRangeChange?: (values: [number, number]) => void;
44
+ /**
45
+ * Whether the slider is disabled
46
+ * @default false
47
+ */
48
+ disabled?: boolean;
49
+ /**
50
+ * Label for the slider
51
+ */
52
+ label?: string;
53
+ /**
54
+ * Whether to show value labels
55
+ * @default true
56
+ */
57
+ showValueLabel?: boolean;
58
+ /**
59
+ * Custom formatter for value labels
60
+ */
61
+ formatValue?: (value: number) => string;
62
+ /**
63
+ * Test identifier for automated testing
64
+ */
65
+ 'data-testid'?: string;
66
+ /**
67
+ * Accessible name for the slider
68
+ */
69
+ 'aria-label'?: string;
70
+ /**
71
+ * ID of element describing the slider
72
+ */
73
+ 'aria-describedby'?: string;
74
+ }
75
+ /**
76
+ * Slider component for single value or range selection
77
+ *
78
+ * @example
79
+ * ```tsx
80
+ * // Single value slider
81
+ * <Slider
82
+ * label="Volume"
83
+ * min={0}
84
+ * max={100}
85
+ * value={50}
86
+ * onChange={(value) => console.log(value)}
87
+ * />
88
+ *
89
+ * // Range slider
90
+ * <Slider
91
+ * label="Budget Range"
92
+ * min={0}
93
+ * max={1000}
94
+ * rangeValue={[200, 800]}
95
+ * onRangeChange={(values) => console.log(values)}
96
+ * />
97
+ * ```
98
+ */
99
+ export declare const Slider: {
100
+ ({ min, max, step, value: controlledValue, defaultValue, rangeValue: controlledRangeValue, defaultRangeValue, onChange, onRangeChange, disabled, label, showValueLabel, formatValue, "data-testid": dataTestId, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: SliderProps): import("react").JSX.Element;
101
+ displayName: string;
102
+ };
@@ -0,0 +1,2 @@
1
+ export { Slider } from './Slider';
2
+ export type { SliderProps } from './Slider';
@@ -8,4 +8,7 @@ export * from './FeatureBlock';
8
8
  export * from './Dropdown';
9
9
  export * from './NumberInput';
10
10
  export * from './PageTitle';
11
+ export * from './PasswordField';
12
+ export * from './Sheet';
13
+ export * from './Slider';
11
14
  export * from './TextField';