@ramme-io/ui 1.1.0 → 1.1.2

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.
@@ -0,0 +1,35 @@
1
+ import { default as React } from 'react';
2
+
3
+ export type StatusType = 'online' | 'offline' | 'error' | 'warning' | 'active';
4
+ export interface StatusBadgeProps {
5
+ status: StatusType;
6
+ /**
7
+ * Optional custom label. If not provided, uses the default status name.
8
+ * Pass explicit `null` to show only the dot.
9
+ */
10
+ label?: string | null;
11
+ className?: string;
12
+ showDot?: boolean;
13
+ }
14
+ /**
15
+ * @wizard
16
+ * @name StatusBadge
17
+ * @description A consistent status indicator featuring a color-coded dot and an optional text label. Essential for IoT devices and system states.
18
+ * @tags status, badge, iot, indicator, dot
19
+ * @category data-display
20
+ * @props
21
+ * - name: status
22
+ * type: 'online' | 'offline' | 'error' | 'warning' | 'active'
23
+ * description: The state to represent. Determines the color of the dot.
24
+ * - name: label
25
+ * type: string
26
+ * description: Custom text to display next to the dot. If omitted, displays the status name (e.g., "Online").
27
+ * - name: showDot
28
+ * type: boolean
29
+ * description: Whether to show the colored indicator dot.
30
+ * default: true
31
+ * - name: className
32
+ * type: string
33
+ * description: Additional CSS classes.
34
+ */
35
+ export declare const StatusBadge: React.FC<StatusBadgeProps>;
@@ -0,0 +1,39 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface SegmentedControlOption {
4
+ label: string;
5
+ value: string | number;
6
+ disabled?: boolean;
7
+ }
8
+ export interface SegmentedControlProps {
9
+ options: SegmentedControlOption[];
10
+ value: string | number;
11
+ onChange: (value: any) => void;
12
+ size?: 'sm' | 'md';
13
+ className?: string;
14
+ }
15
+ /**
16
+ * @wizard
17
+ * @name SegmentedControl
18
+ * @description A linear toggle component that functions like a radio group. Ideal for switching between discrete modes (e.g., "Off / Auto / On").
19
+ * @tags input, toggle, switch, radio, control
20
+ * @category input
21
+ * @props
22
+ * - name: options
23
+ * type: Array<{ label: string, value: string | number }>
24
+ * description: The list of segments to display.
25
+ * - name: value
26
+ * type: string | number
27
+ * description: The currently selected value.
28
+ * - name: onChange
29
+ * type: function
30
+ * description: Callback fired when a segment is selected.
31
+ * - name: size
32
+ * type: 'sm' | 'md'
33
+ * description: The size of the control.
34
+ * default: 'md'
35
+ * - name: className
36
+ * type: string
37
+ * description: Additional CSS classes.
38
+ */
39
+ export declare const SegmentedControl: React.FC<SegmentedControlProps>;
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export * from './components/data-display/LineChart';
20
20
  export * from './components/data-display/PieChart';
21
21
  export * from './components/data-display/CodeBlock';
22
22
  export * from './components/data-display/StatCard';
23
+ export * from './components/data-display/StatusBadge';
23
24
  export * from './components/feedback/Alert';
24
25
  export * from './components/feedback/EmptyState';
25
26
  export * from './components/feedback/TippyTooltip';
@@ -35,6 +36,7 @@ export * from './components/forms/Input';
35
36
  export * from './components/forms/MultiSelect';
36
37
  export * from './components/forms/Radio';
37
38
  export * from './components/forms/SearchInput';
39
+ export * from './components/forms/SegmentedControl';
38
40
  export * from './components/forms/Select';
39
41
  export * from './components/forms/Textarea';
40
42
  export * from './components/forms/ToggleSwitch';