@ramme-io/ui 1.0.3 → 1.1.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.
Files changed (64) hide show
  1. package/README.md +17 -26
  2. package/dist/blocks/iot/DeviceCard.d.ts +57 -0
  3. package/dist/{charts → components/data-display}/ChartWithTable.d.ts +1 -1
  4. package/dist/{charts → components/data-display}/LineChart.d.ts +2 -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/{layout → components/layout}/Sidebar.d.ts +1 -0
  8. package/dist/components/ui/Button.d.ts +44 -0
  9. package/dist/data/mockData.d.ts +9 -2
  10. package/dist/index.d.ts +55 -54
  11. package/dist/index.es.js +133799 -133985
  12. package/dist/index.umd.js +2013 -2027
  13. package/dist/style.css +1 -1
  14. package/package.json +4 -1
  15. package/dist/ui/Button.d.ts +0 -16
  16. /package/dist/{ai → blocks/ai}/Actions.d.ts +0 -0
  17. /package/dist/{ui → blocks/ai}/ChatFAB.d.ts +0 -0
  18. /package/dist/{ai → blocks/ai}/Conversation.d.ts +0 -0
  19. /package/dist/{ai → blocks/ai}/Loader.d.ts +0 -0
  20. /package/dist/{ai → blocks/ai}/Message.d.ts +0 -0
  21. /package/dist/{ai → blocks/ai}/PromptInput.d.ts +0 -0
  22. /package/dist/{templates-patterns → components/data-display}/ActivityFeed.d.ts +0 -0
  23. /package/dist/{charts → components/data-display}/BarChart.d.ts +0 -0
  24. /package/dist/{ui → components/data-display}/CodeBlock.d.ts +0 -0
  25. /package/dist/{data-display → components/data-display}/DataTable.d.ts +0 -0
  26. /package/dist/{charts → components/data-display}/PieChart.d.ts +0 -0
  27. /package/dist/{templates-patterns → components/data-display}/StatCard.d.ts +0 -0
  28. /package/dist/{data-display → components/data-display}/Table.d.ts +0 -0
  29. /package/dist/{feedback → components/feedback}/Alert.d.ts +0 -0
  30. /package/dist/{feedback → components/feedback}/EmptyState.d.ts +0 -0
  31. /package/dist/{feedback → components/feedback}/TippyTooltip.d.ts +0 -0
  32. /package/dist/{feedback → components/feedback}/Toast.d.ts +0 -0
  33. /package/dist/{feedback → components/feedback}/ToastProvider.d.ts +0 -0
  34. /package/dist/{form → components/forms}/ButtonGroup.d.ts +0 -0
  35. /package/dist/{form → components/forms}/Checkbox.d.ts +0 -0
  36. /package/dist/{form → components/forms}/ComboBox.d.ts +0 -0
  37. /package/dist/{form → components/forms}/DatePicker.d.ts +0 -0
  38. /package/dist/{form → components/forms}/FileUpload.d.ts +0 -0
  39. /package/dist/{form → components/forms}/MultiSelect.d.ts +0 -0
  40. /package/dist/{form → components/forms}/Radio.d.ts +0 -0
  41. /package/dist/{form → components/forms}/SearchInput.d.ts +0 -0
  42. /package/dist/{form → components/forms}/Select.d.ts +0 -0
  43. /package/dist/{form → components/forms}/Textarea.d.ts +0 -0
  44. /package/dist/{form → components/forms}/ToggleSwitch.d.ts +0 -0
  45. /package/dist/{layout → components/layout}/Accordion.d.ts +0 -0
  46. /package/dist/{templates-patterns → components/layout}/ActionBar.d.ts +0 -0
  47. /package/dist/{layout → components/layout}/Card.d.ts +0 -0
  48. /package/dist/{layout → components/layout}/Drawer.d.ts +0 -0
  49. /package/dist/{layout → components/layout}/List.d.ts +0 -0
  50. /package/dist/{layout → components/layout}/Modal.d.ts +0 -0
  51. /package/dist/{templates-patterns → components/layout}/PageHeader.d.ts +0 -0
  52. /package/dist/{templates-patterns → components/layout}/SectionHeader.d.ts +0 -0
  53. /package/dist/{layout → components/layout}/StorySidebarContent.d.ts +0 -0
  54. /package/dist/{navigation → components/navigation}/Breadcrumbs.d.ts +0 -0
  55. /package/dist/{navigation → components/navigation}/Menu.d.ts +0 -0
  56. /package/dist/{navigation → components/navigation}/Pagination.d.ts +0 -0
  57. /package/dist/{navigation → components/navigation}/Stepper.d.ts +0 -0
  58. /package/dist/{navigation → components/navigation}/Tabs.d.ts +0 -0
  59. /package/dist/{ui → components/ui}/Avatar.d.ts +0 -0
  60. /package/dist/{ui → components/ui}/Badge.d.ts +0 -0
  61. /package/dist/{ui → components/ui}/Icon.d.ts +0 -0
  62. /package/dist/{ui → components/ui}/icon-loader.d.ts +0 -0
  63. /package/dist/{hooks → lib/hooks}/useChartTheme.d.ts +0 -0
  64. /package/dist/{hooks → lib/hooks}/useDataFetch.d.ts +0 -0
package/README.md CHANGED
@@ -2,34 +2,27 @@
2
2
 
3
3
  [![NPM Version](https://img.shields.io/npm/v/@ramme-io/create-app.svg)](https://www.npmjs.com/package/@ramme-io/ui) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
 
5
- **The structural frame for the modern web.**
5
+ **The blocks for the build kit.**
6
6
 
7
- Ramme UI is a curated bundle of industry-standard libraries, accessible components, and architectural best practices designed for rapid prototyping.
8
-
9
- It creates a "Golden Path" for product designers and engineers who need to validate ideas quickly without getting bogged down in configuration. By bundling the best open-source tools into a cohesive system, Ramme allows you to build high-fidelity, interactive prototypes that are production-ready from day one.
7
+ Ramme UI is a basic bundle of standard, accessible components, and best practices ready for rapid prototyping.
10
8
 
11
9
  ---
12
10
 
13
- ## The Architecture
14
- Ramme (Danish for "Frame") is not about reinventing the wheel. It is about providing a solid steel frame so you can focus on the walls and windows.
11
+ ## The Basics
15
12
 
16
- We have orchestrated the most robust third-party libraries in the ecosystem into a single, opinionated toolkit:
13
+ We have collected popular third-party libraries into a single build kit:
17
14
 
18
15
  * **Engine:** React 19+
19
- * **Styling:** Tailwind CSS (configured for rapid iteration)
20
- * **Primitives:** Radix UI (for unstyled, accessible interactive elements)
21
- * **Motion:** Framer Motion (for high-fidelity interaction design)
16
+ * **Styling:** Tailwind CSS
17
+ * **Primitives:** Radix UI
18
+ * **Motion:** Framer Motion
22
19
  * **Icons:** Lucide React
23
20
 
24
- This is not a "walled garden." It is a standardized set of building materials that respects your need for speed and flexibility.
25
-
26
21
  ---
27
22
 
28
23
  ## Quick Start
29
24
 
30
- The fastest way to start building is to use our CLI tool, which scaffolds a Vite-powered application with the Ramme Design System pre-configured.
31
-
32
- Run the following command in your terminal:
25
+ To spin up a new project, run the initialization command in your terminal. This will generate a new folder with all resources linked and configured.
33
26
 
34
27
  *(Replace `my-new-project` with your desired folder name).*
35
28
 
@@ -41,11 +34,11 @@ This single command will:
41
34
  1. **Scaffold** a high-performance Vite project structure.
42
35
  2. **Install** React 19, TypeScript, and Tailwind CSS.
43
36
  3. **Configure** the `@ramme-io/ui` component library and design tokens.
44
- 4. **Optimize** linting and build settings for immediate deployment.
37
+ 4. **Optimize** limited configuration for customization.
45
38
 
46
39
  ---
47
40
 
48
- ## Launch Sequence
41
+ ## Getting Started
49
42
 
50
43
  Once the scaffolding is complete, initialize your local environment:
51
44
 
@@ -60,18 +53,18 @@ pnpm install
60
53
  # or npm install
61
54
  ```
62
55
 
63
- **3. Ignite the dev server**
56
+ **3. Start the dev server**
64
57
  ```bash
65
58
  pnpm run dev
66
59
  ```
67
60
 
68
- Your prototype is now live at `http://localhost:5173`.
61
+ Your prototype is running locally at `http://localhost:5173`.
69
62
 
70
63
  ---
71
64
 
72
65
  ## The Tech Stack
73
66
 
74
- This starter kit is not a proprietary framework; it is an opinionated orchestration of the best open-source tools available:
67
+ This starter kit is an opinionated selection of the best open-source tools available:
75
68
 
76
69
  * **Vite:** Next-generation tooling for instant server start and lightning-fast HMR (Hot Module Replacement).
77
70
  * **React:** The standard library for building composable user interfaces.
@@ -130,7 +123,7 @@ export default LandingPage;
130
123
 
131
124
  ## Local Development
132
125
 
133
- If you want to contribute to the framework or customize the primitives, you can run our component workbench locally.
126
+ If you want to contribute to the project or customize the primitives, you can run our component workbench locally.
134
127
 
135
128
  1. Install Dependencies:
136
129
 
@@ -145,18 +138,16 @@ pnpm run storybook
145
138
  ```
146
139
  ---
147
140
 
148
- ## The Ramme Ecosystem
149
-
150
- This tool is part of a suite of developer resources maintained by **Excesspool Limited Liability Company**:
141
+ ## Project Links
151
142
 
152
143
  * **`@ramme-io/ui`**: The core library of visual primitives.
153
- * **`@ramme-io/create-app`** (This Repository): The CLI scaffolding tool.
144
+ * **`@ramme-io/create-app`** (This Repository): The quick start kit.
154
145
 
155
146
  ---
156
147
 
157
148
  ## Contributing
158
149
 
159
- We welcome contributions from the community. Please fork the repository and submit a pull request. For major architectural changes, please open an issue first to discuss the proposed direction.
150
+ We welcome contributions from the community. Just fork the repository and submit a pull request. For major changes, please open an issue first to discuss.
160
151
 
161
152
  ## License
162
153
 
@@ -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>;
@@ -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>>;
@@ -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,60 @@
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/feedback/Alert';
24
+ export * from './components/feedback/EmptyState';
25
+ export * from './components/feedback/TippyTooltip';
26
+ export * from './components/feedback/Toast';
27
+ export * from './components/feedback/ToastProvider';
28
+ export * from './components/forms/ButtonGroup';
29
+ export * from './components/forms/Checkbox';
30
+ export * from './components/forms/ComboBox';
31
+ export * from './components/forms/DatePicker';
32
+ export * from './components/forms/FileUpload';
33
+ export * from './components/forms/FormTemplate';
34
+ export * from './components/forms/Input';
35
+ export * from './components/forms/MultiSelect';
36
+ export * from './components/forms/Radio';
37
+ export * from './components/forms/SearchInput';
38
+ export * from './components/forms/Select';
39
+ export * from './components/forms/Textarea';
40
+ export * from './components/forms/ToggleSwitch';
41
+ export * from './lib/hooks/useDataFetch';
42
+ export * from './blocks/iot/DeviceCard';
43
+ export * from './components/layout/Accordion';
44
+ export * from './components/layout/Card';
45
+ export * from './components/layout/Drawer';
46
+ export * from './components/layout/List';
47
+ export * from './components/layout/Modal';
48
+ export * from './components/layout/Sidebar';
49
+ export * from './components/layout/ActionBar';
50
+ export * from './components/layout/PageHeader';
51
+ export * from './components/layout/SectionHeader';
52
+ export * from './components/navigation/Breadcrumbs';
53
+ export * from './components/navigation/Menu';
54
+ export * from './components/navigation/Pagination';
55
+ export * from './components/navigation/Stepper';
56
+ export * from './components/navigation/Tabs';
57
+ export * from './components/ui/Avatar';
58
+ export * from './components/ui/Badge';
59
+ export * from './components/ui/Button';
60
+ export * from './components/ui/Icon';