@ramme-io/ui 1.0.4 → 1.1.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.
Files changed (65) hide show
  1. package/dist/blocks/iot/DeviceCard.d.ts +57 -0
  2. package/dist/{charts → components/data-display}/ChartWithTable.d.ts +1 -1
  3. package/dist/{charts → components/data-display}/LineChart.d.ts +2 -0
  4. package/dist/components/data-display/StatusBadge.d.ts +35 -0
  5. package/dist/{form → components/forms}/FormTemplate.d.ts +21 -1
  6. package/dist/{form → components/forms}/Input.d.ts +2 -3
  7. package/dist/components/forms/SegmentedControl.d.ts +39 -0
  8. package/dist/{layout → components/layout}/Sidebar.d.ts +1 -0
  9. package/dist/components/ui/Button.d.ts +44 -0
  10. package/dist/data/mockData.d.ts +9 -2
  11. package/dist/index.d.ts +57 -54
  12. package/dist/index.es.js +115226 -115133
  13. package/dist/index.umd.js +1989 -1989
  14. package/dist/style.css +1 -1
  15. package/package.json +6 -2
  16. package/dist/ui/Button.d.ts +0 -16
  17. /package/dist/{ai → blocks/ai}/Actions.d.ts +0 -0
  18. /package/dist/{ui → blocks/ai}/ChatFAB.d.ts +0 -0
  19. /package/dist/{ai → blocks/ai}/Conversation.d.ts +0 -0
  20. /package/dist/{ai → blocks/ai}/Loader.d.ts +0 -0
  21. /package/dist/{ai → blocks/ai}/Message.d.ts +0 -0
  22. /package/dist/{ai → blocks/ai}/PromptInput.d.ts +0 -0
  23. /package/dist/{templates-patterns → components/data-display}/ActivityFeed.d.ts +0 -0
  24. /package/dist/{charts → components/data-display}/BarChart.d.ts +0 -0
  25. /package/dist/{ui → components/data-display}/CodeBlock.d.ts +0 -0
  26. /package/dist/{data-display → components/data-display}/DataTable.d.ts +0 -0
  27. /package/dist/{charts → components/data-display}/PieChart.d.ts +0 -0
  28. /package/dist/{templates-patterns → components/data-display}/StatCard.d.ts +0 -0
  29. /package/dist/{data-display → components/data-display}/Table.d.ts +0 -0
  30. /package/dist/{feedback → components/feedback}/Alert.d.ts +0 -0
  31. /package/dist/{feedback → components/feedback}/EmptyState.d.ts +0 -0
  32. /package/dist/{feedback → components/feedback}/TippyTooltip.d.ts +0 -0
  33. /package/dist/{feedback → components/feedback}/Toast.d.ts +0 -0
  34. /package/dist/{feedback → components/feedback}/ToastProvider.d.ts +0 -0
  35. /package/dist/{form → components/forms}/ButtonGroup.d.ts +0 -0
  36. /package/dist/{form → components/forms}/Checkbox.d.ts +0 -0
  37. /package/dist/{form → components/forms}/ComboBox.d.ts +0 -0
  38. /package/dist/{form → components/forms}/DatePicker.d.ts +0 -0
  39. /package/dist/{form → components/forms}/FileUpload.d.ts +0 -0
  40. /package/dist/{form → components/forms}/MultiSelect.d.ts +0 -0
  41. /package/dist/{form → components/forms}/Radio.d.ts +0 -0
  42. /package/dist/{form → components/forms}/SearchInput.d.ts +0 -0
  43. /package/dist/{form → components/forms}/Select.d.ts +0 -0
  44. /package/dist/{form → components/forms}/Textarea.d.ts +0 -0
  45. /package/dist/{form → components/forms}/ToggleSwitch.d.ts +0 -0
  46. /package/dist/{layout → components/layout}/Accordion.d.ts +0 -0
  47. /package/dist/{templates-patterns → components/layout}/ActionBar.d.ts +0 -0
  48. /package/dist/{layout → components/layout}/Card.d.ts +0 -0
  49. /package/dist/{layout → components/layout}/Drawer.d.ts +0 -0
  50. /package/dist/{layout → components/layout}/List.d.ts +0 -0
  51. /package/dist/{layout → components/layout}/Modal.d.ts +0 -0
  52. /package/dist/{templates-patterns → components/layout}/PageHeader.d.ts +0 -0
  53. /package/dist/{templates-patterns → components/layout}/SectionHeader.d.ts +0 -0
  54. /package/dist/{layout → components/layout}/StorySidebarContent.d.ts +0 -0
  55. /package/dist/{navigation → components/navigation}/Breadcrumbs.d.ts +0 -0
  56. /package/dist/{navigation → components/navigation}/Menu.d.ts +0 -0
  57. /package/dist/{navigation → components/navigation}/Pagination.d.ts +0 -0
  58. /package/dist/{navigation → components/navigation}/Stepper.d.ts +0 -0
  59. /package/dist/{navigation → components/navigation}/Tabs.d.ts +0 -0
  60. /package/dist/{ui → components/ui}/Avatar.d.ts +0 -0
  61. /package/dist/{ui → components/ui}/Badge.d.ts +0 -0
  62. /package/dist/{ui → components/ui}/Icon.d.ts +0 -0
  63. /package/dist/{ui → components/ui}/icon-loader.d.ts +0 -0
  64. /package/dist/{hooks → lib/hooks}/useChartTheme.d.ts +0 -0
  65. /package/dist/{hooks → lib/hooks}/useDataFetch.d.ts +0 -0
@@ -0,0 +1,57 @@
1
+ import { default as React } from 'react';
2
+ import { IconName } from '../../components/ui/Icon';
3
+
4
+ declare const statusColorMap: {
5
+ readonly online: "success";
6
+ readonly offline: "secondary";
7
+ readonly error: "danger";
8
+ readonly warning: "outline";
9
+ readonly active: "primary";
10
+ };
11
+ export type DeviceStatus = keyof typeof statusColorMap;
12
+ /**
13
+ * @wizard
14
+ * @name DeviceCard
15
+ * @description A specialized card designed to represent a physical device or a digital entity with live state. Features slots for status, live values, and interactive controls.
16
+ * @tags layout, iot, device, card, dashboard
17
+ * @category layout
18
+ * @props
19
+ * - name: title
20
+ * type: string
21
+ * description: The name of the device or entity (e.g., "Living Room Thermostat").
22
+ * - name: description
23
+ * type: string
24
+ * description: A subtitle, often used for location or ID (e.g., "Floor 2 • ID: #442").
25
+ * - name: icon
26
+ * type: IconName
27
+ * description: The icon representing the device type.
28
+ * - name: status
29
+ * type: 'online' | 'offline' | 'error' | 'warning' | 'active'
30
+ * description: The current operational state of the device. Changes the badge color.
31
+ * default: 'offline'
32
+ * - name: value
33
+ * type: string | number
34
+ * description: The primary "live" metric to display (e.g., "72°", "1,240 rpm").
35
+ * - name: trend
36
+ * type: string
37
+ * description: Optional secondary metric to show change (e.g., "+2%").
38
+ * - name: children
39
+ * type: React.ReactNode
40
+ * description: Interactive controls to place at the bottom of the card (e.g., a ToggleSwitch or Button).
41
+ * - name: className
42
+ * type: string
43
+ * description: Optional additional CSS classes.
44
+ */
45
+ export interface DeviceCardProps {
46
+ title: string;
47
+ description?: string;
48
+ icon?: IconName;
49
+ status?: DeviceStatus;
50
+ value?: string | number;
51
+ trend?: string;
52
+ children?: React.ReactNode;
53
+ className?: string;
54
+ onClick?: () => void;
55
+ }
56
+ export declare const DeviceCard: React.FC<DeviceCardProps>;
57
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { TableHeader } from '../data-display/Table';
2
+ import { TableHeader } from './Table';
3
3
 
4
4
  export interface ChartWithTableProps {
5
5
  /** The title of the chart. */
@@ -13,5 +13,7 @@ export interface LineChartProps {
13
13
  * @wizard
14
14
  * @name LineChart
15
15
  * @description A theme-aware line chart component...
16
+ * @tags charts, data-visualization, rechart
17
+ * @category charts
16
18
  */
17
19
  export declare const LineChart: React.FC<LineChartProps>;
@@ -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>;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { MultiSelectOption } from '../form/MultiSelect';
2
+ import { MultiSelectOption } from '../forms/MultiSelect';
3
3
 
4
4
  interface FormFieldBase {
5
5
  name: string;
@@ -65,5 +65,25 @@ export interface FormTemplateProps {
65
65
  className?: string;
66
66
  children?: React.ReactNode;
67
67
  }
68
+ /**
69
+ * @wizard
70
+ * @name FormTemplate
71
+ * @description A data-driven form builder that renders a grid of input fields from a configuration array, handling internal state and submission.
72
+ * @category form
73
+ * @tags form, template, builder, input, layout
74
+ * @props
75
+ * - name: fields
76
+ * type: FormField[]
77
+ * description: An array of field definition objects (name, label, type, etc.) that determine the form structure.
78
+ * - name: onSubmit
79
+ * type: (formData: Record<string, any>) => void
80
+ * description: Callback function triggered when the form is submitted, receiving the collected data.
81
+ * - name: className
82
+ * type: string
83
+ * description: Optional additional CSS classes for the form container.
84
+ * - name: children
85
+ * type: React.ReactNode
86
+ * description: Content to render at the bottom of the form, typically used for action buttons like "Save" or "Cancel".
87
+ */
68
88
  export declare const FormTemplate: React.FC<FormTemplateProps>;
69
89
  export {};
@@ -13,8 +13,9 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
13
13
  /**
14
14
  * @wizard
15
15
  * @name Input
16
- * @description A theme-aware text input component with support for labels, icons, helper text, and validation states.
16
+ * @description A theme-aware text input component with support for labels, icons, helper text, and validation states. Supports all standard HTML input attributes.
17
17
  * @tags form, input, ui, text
18
+ * @category form
18
19
  * @props
19
20
  * - name: label
20
21
  * type: string
@@ -40,7 +41,5 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
40
41
  * - name: containerClassName
41
42
  * type: string
42
43
  * description: Optional additional CSS classes for the container.
43
- * - name: All other standard HTML input attributes are also supported.
44
- * @category form
45
44
  */
46
45
  export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
@@ -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>;
@@ -11,6 +11,7 @@ export declare const SidebarProvider: ({ children }: {
11
11
  }) => import("react/jsx-runtime").JSX.Element;
12
12
  /**
13
13
  * @wizard
14
+ * @name Sidebar
14
15
  * @description A collapsible, responsive sidebar component.
15
16
  * @props
16
17
  * @prop {React.ReactNode} children - The content of the sidebar.
@@ -0,0 +1,44 @@
1
+ import { default as React } from 'react';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { IconName } from './Icon';
4
+
5
+ /** @wizard
6
+ * @name Button
7
+ * @description The primary interactive element. Supports polymorphism (rendering as a link) via the 'asChild' prop.
8
+ * @category Input
9
+ * @props
10
+ * - name: variant
11
+ * type: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'link'
12
+ * description: The visual style of the button.
13
+ * default: 'primary'
14
+ * - name: size
15
+ * type: 'sm' | 'md' | 'lg' | 'icon'
16
+ * description: The size of the button.
17
+ * default: 'md'
18
+ * - name: loading
19
+ * type: boolean
20
+ * description: If true, replaces content with a spinner.
21
+ * default: false
22
+ * - name: iconLeft
23
+ * type: IconName
24
+ * description: Optional icon to display before the text.
25
+ * - name: asChild
26
+ * type: boolean
27
+ * description: If true, delegates rendering to the child element (e.g. for Links).
28
+ * default: false
29
+ * - name: onClick
30
+ * type: () => void
31
+ * description: Callback fired when the button is clicked.
32
+ */
33
+ declare const buttonVariants: (props?: ({
34
+ variant?: "link" | "ghost" | "primary" | "danger" | "outline" | "secondary" | "accent" | null | undefined;
35
+ size?: "sm" | "md" | "lg" | "icon" | null | undefined;
36
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
37
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
38
+ asChild?: boolean;
39
+ loading?: boolean;
40
+ iconLeft?: IconName;
41
+ iconRight?: IconName;
42
+ }
43
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
44
+ export { Button, buttonVariants };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @wizard
3
- * @name Mock Data Sets
4
- * @description Pre-defined datasets for prototyping tables, charts, and other data-driven components.
3
+ * @name mockChartData
4
+ * @description Pre-defined datasets for prototyping charts and other data-driven components.
5
5
  * @tags data, mock, example
6
6
  * @category data
7
7
  */
@@ -10,6 +10,13 @@ export declare const mockChartData: {
10
10
  uv: number;
11
11
  pv: number;
12
12
  }[];
13
+ /**
14
+ * @wizard
15
+ * @name mockTableData
16
+ * @description Pre-defined datasets for prototyping tables and other data-driven components.
17
+ * @tags data, mock, example
18
+ * @category data
19
+ */
13
20
  export declare const mockTableData: {
14
21
  make: string;
15
22
  model: string;
package/dist/index.d.ts CHANGED
@@ -1,59 +1,62 @@
1
1
 
2
- export type * from './types/wizard.d';
2
+ export type * from './lib/types/wizard';
3
3
  export type { ThemeName } from './contexts/ThemeContext';
4
- export type { MultiSelectOption } from './form/MultiSelect';
4
+ export type { MultiSelectOption } from './components/forms/MultiSelect';
5
5
  export type { ColDef, ColGroupDef, GridOptions, GridApi, ColumnApi, ValueFormatterParams, ValueGetterParams, ICellRendererParams, CellClickedEvent, RowSelectedEvent, IHeaderParams, } from 'ag-grid-community';
6
6
  export * from './data/mockData';
7
- export * from './charts/BarChart';
8
- export * from './charts/ChartWithTable';
9
- export * from './charts/LineChart';
10
- export * from './charts/PieChart';
7
+ export * from './blocks/ai/Loader';
8
+ export * from './blocks/ai/Actions';
9
+ export * from './blocks/ai/PromptInput';
10
+ export * from './blocks/ai/Message';
11
+ export * from './blocks/ai/Conversation';
12
+ export * from './blocks/ai/ChatFAB';
11
13
  export * from './contexts/ThemeContext';
12
- export * from './data-display/DataTable';
13
- export * from './data-display/Table';
14
- export * from './feedback/Alert';
15
- export * from './feedback/EmptyState';
16
- export * from './feedback/TippyTooltip';
17
- export * from './feedback/Toast';
18
- export * from './feedback/ToastProvider';
19
- export * from './form/ButtonGroup';
20
- export * from './form/Checkbox';
21
- export * from './form/ComboBox';
22
- export * from './form/DatePicker';
23
- export * from './form/FileUpload';
24
- export * from './form/FormTemplate';
25
- export * from './form/Input';
26
- export * from './form/MultiSelect';
27
- export * from './form/Radio';
28
- export * from './form/SearchInput';
29
- export * from './form/Select';
30
- export * from './form/Textarea';
31
- export * from './form/ToggleSwitch';
32
- export * from './hooks/useDataFetch';
33
- export * from './layout/Accordion';
34
- export * from './layout/Card';
35
- export * from './layout/Drawer';
36
- export * from './layout/List';
37
- export * from './layout/Modal';
38
- export * from './layout/Sidebar';
39
- export * from './navigation/Breadcrumbs';
40
- export * from './navigation/Menu';
41
- export * from './navigation/Pagination';
42
- export * from './navigation/Stepper';
43
- export * from './navigation/Tabs';
44
- export * from './templates-patterns/ActionBar';
45
- export * from './templates-patterns/ActivityFeed';
46
- export * from './templates-patterns/PageHeader';
47
- export * from './templates-patterns/SectionHeader';
48
- export * from './templates-patterns/StatCard';
49
- export * from './ui/Avatar';
50
- export * from './ui/Badge';
51
- export * from './ui/Button';
52
- export * from './ui/ChatFAB';
53
- export * from './ui/Icon';
54
- export * from './ui/CodeBlock';
55
- export * from './ai/Loader';
56
- export * from './ai/Actions';
57
- export * from './ai/PromptInput';
58
- export * from './ai/Message';
59
- export * from './ai/Conversation';
14
+ export * from './components/data-display/ActivityFeed';
15
+ export * from './components/data-display/DataTable';
16
+ export * from './components/data-display/Table';
17
+ export * from './components/data-display/BarChart';
18
+ export * from './components/data-display/ChartWithTable';
19
+ export * from './components/data-display/LineChart';
20
+ export * from './components/data-display/PieChart';
21
+ export * from './components/data-display/CodeBlock';
22
+ export * from './components/data-display/StatCard';
23
+ export * from './components/data-display/StatusBadge';
24
+ export * from './components/feedback/Alert';
25
+ export * from './components/feedback/EmptyState';
26
+ export * from './components/feedback/TippyTooltip';
27
+ export * from './components/feedback/Toast';
28
+ export * from './components/feedback/ToastProvider';
29
+ export * from './components/forms/ButtonGroup';
30
+ export * from './components/forms/Checkbox';
31
+ export * from './components/forms/ComboBox';
32
+ export * from './components/forms/DatePicker';
33
+ export * from './components/forms/FileUpload';
34
+ export * from './components/forms/FormTemplate';
35
+ export * from './components/forms/Input';
36
+ export * from './components/forms/MultiSelect';
37
+ export * from './components/forms/Radio';
38
+ export * from './components/forms/SearchInput';
39
+ export * from './components/forms/SegmentedControl';
40
+ export * from './components/forms/Select';
41
+ export * from './components/forms/Textarea';
42
+ export * from './components/forms/ToggleSwitch';
43
+ export * from './lib/hooks/useDataFetch';
44
+ export * from './blocks/iot/DeviceCard';
45
+ export * from './components/layout/Accordion';
46
+ export * from './components/layout/Card';
47
+ export * from './components/layout/Drawer';
48
+ export * from './components/layout/List';
49
+ export * from './components/layout/Modal';
50
+ export * from './components/layout/Sidebar';
51
+ export * from './components/layout/ActionBar';
52
+ export * from './components/layout/PageHeader';
53
+ export * from './components/layout/SectionHeader';
54
+ export * from './components/navigation/Breadcrumbs';
55
+ export * from './components/navigation/Menu';
56
+ export * from './components/navigation/Pagination';
57
+ export * from './components/navigation/Stepper';
58
+ export * from './components/navigation/Tabs';
59
+ export * from './components/ui/Avatar';
60
+ export * from './components/ui/Badge';
61
+ export * from './components/ui/Button';
62
+ export * from './components/ui/Icon';