@machinemetrics/mm-react-components 0.2.0 → 0.2.3-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.
- package/README.md +73 -25
- package/dist/App.d.ts.map +1 -1
- package/dist/README.md +266 -0
- package/dist/components/ui/accordion.d.ts +10 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +4 -16
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +0 -12
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/collapsible.d.ts +7 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/data-table/TableView.d.ts +3 -0
- package/dist/components/ui/data-table/TableView.d.ts.map +1 -0
- package/dist/components/ui/data-table/cards/ResponsiveTable.d.ts +10 -0
- package/dist/components/ui/data-table/cards/ResponsiveTable.d.ts.map +1 -0
- package/dist/components/ui/data-table/cards/RowCard.d.ts +9 -0
- package/dist/components/ui/data-table/cards/RowCard.d.ts.map +1 -0
- package/dist/components/ui/data-table/cards/index.d.ts +2 -0
- package/dist/components/ui/data-table/cards/index.d.ts.map +1 -0
- package/dist/components/ui/data-table/columnTypes/badgeColumn.d.ts +16 -0
- package/dist/components/ui/data-table/columnTypes/badgeColumn.d.ts.map +1 -0
- package/dist/components/ui/data-table/columnTypes/createColumn.d.ts +8 -0
- package/dist/components/ui/data-table/columnTypes/createColumn.d.ts.map +1 -0
- package/dist/components/ui/data-table/columnTypes/dateColumn.d.ts +13 -0
- package/dist/components/ui/data-table/columnTypes/dateColumn.d.ts.map +1 -0
- package/dist/components/ui/data-table/columnTypes/index.d.ts +8 -0
- package/dist/components/ui/data-table/columnTypes/index.d.ts.map +1 -0
- package/dist/components/ui/data-table/columnTypes/multiBadgeColumn.d.ts +16 -0
- package/dist/components/ui/data-table/columnTypes/multiBadgeColumn.d.ts.map +1 -0
- package/dist/components/ui/data-table/columnTypes/numericColumn.d.ts +15 -0
- package/dist/components/ui/data-table/columnTypes/numericColumn.d.ts.map +1 -0
- package/dist/components/ui/data-table/columnTypes/selectionColumn.d.ts +10 -0
- package/dist/components/ui/data-table/columnTypes/selectionColumn.d.ts.map +1 -0
- package/dist/components/ui/data-table/columnTypes/textColumn.d.ts +13 -0
- package/dist/components/ui/data-table/columnTypes/textColumn.d.ts.map +1 -0
- package/dist/components/ui/data-table/index.d.ts +14 -0
- package/dist/components/ui/data-table/index.d.ts.map +1 -0
- package/dist/components/ui/data-table/metadata/ColumnRegistry.d.ts +90 -0
- package/dist/components/ui/data-table/metadata/ColumnRegistry.d.ts.map +1 -0
- package/dist/components/ui/data-table/metadata/alignment.d.ts +8 -0
- package/dist/components/ui/data-table/metadata/alignment.d.ts.map +1 -0
- package/dist/components/ui/data-table/pagination.d.ts +9 -0
- package/dist/components/ui/data-table/pagination.d.ts.map +1 -0
- package/dist/components/ui/data-table/state/index.d.ts +3 -0
- package/dist/components/ui/data-table/state/index.d.ts.map +1 -0
- package/dist/components/ui/data-table/state/useBreakpoint.d.ts +2 -0
- package/dist/components/ui/data-table/state/useBreakpoint.d.ts.map +1 -0
- package/dist/components/ui/data-table/state/useDataTableState.d.ts +19 -0
- package/dist/components/ui/data-table/state/useDataTableState.d.ts.map +1 -0
- package/dist/components/ui/data-table/tokens.d.ts +10 -0
- package/dist/components/ui/data-table/tokens.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/ColumnVisibilityMenu.d.ts +8 -0
- package/dist/components/ui/data-table/toolbar/ColumnVisibilityMenu.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/DataTableToolbar.d.ts +15 -0
- package/dist/components/ui/data-table/toolbar/DataTableToolbar.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/MenuHeader.d.ts +8 -0
- package/dist/components/ui/data-table/toolbar/MenuHeader.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/SortMenu.d.ts +7 -0
- package/dist/components/ui/data-table/toolbar/SortMenu.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/filters/DateRangeFilter.d.ts +5 -0
- package/dist/components/ui/data-table/toolbar/filters/DateRangeFilter.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/filters/FilterMenu.d.ts +10 -0
- package/dist/components/ui/data-table/toolbar/filters/FilterMenu.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/filters/InlineDateRangePicker.d.ts +10 -0
- package/dist/components/ui/data-table/toolbar/filters/InlineDateRangePicker.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/filters/NumericRangeFilter.d.ts +5 -0
- package/dist/components/ui/data-table/toolbar/filters/NumericRangeFilter.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/filters/SelectFilter.d.ts +6 -0
- package/dist/components/ui/data-table/toolbar/filters/SelectFilter.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/filters/TextFilter.d.ts +5 -0
- package/dist/components/ui/data-table/toolbar/filters/TextFilter.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/filters/index.d.ts +9 -0
- package/dist/components/ui/data-table/toolbar/filters/index.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/filters/types.d.ts +26 -0
- package/dist/components/ui/data-table/toolbar/filters/types.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/filters/useColumnFilters.d.ts +5 -0
- package/dist/components/ui/data-table/toolbar/filters/useColumnFilters.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/index.d.ts +5 -0
- package/dist/components/ui/data-table/toolbar/index.d.ts.map +1 -0
- package/dist/components/ui/data-table/types.d.ts +40 -0
- package/dist/components/ui/data-table/types.d.ts.map +1 -0
- package/dist/components/ui/data-table/useTableController.d.ts +29 -0
- package/dist/components/ui/data-table/useTableController.d.ts.map +1 -0
- package/dist/components/ui/data-table/utils.d.ts +3 -0
- package/dist/components/ui/data-table/utils.d.ts.map +1 -0
- package/dist/components/ui/date-range-picker.d.ts +9 -0
- package/dist/components/ui/date-range-picker.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +16 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/drawer.d.ts +16 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropzone/index.d.ts +25 -0
- package/dist/components/ui/dropzone/index.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +2 -15
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/label.d.ts +0 -9
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/page-header/index.d.ts +3 -0
- package/dist/components/ui/page-header/index.d.ts.map +1 -0
- package/dist/components/ui/page-header/page-header-types.d.ts +44 -0
- package/dist/components/ui/page-header/page-header-types.d.ts.map +1 -0
- package/dist/components/ui/page-header/page-header.d.ts +5 -0
- package/dist/components/ui/page-header/page-header.d.ts.map +1 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/radio-group.d.ts +0 -19
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/search-input.d.ts +7 -0
- package/dist/components/ui/search-input.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/slider.d.ts +15 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/table/Table.d.ts +21 -0
- package/dist/components/ui/table/Table.d.ts.map +1 -0
- package/dist/components/ui/table/index.d.ts +2 -0
- package/dist/components/ui/table/index.d.ts.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +15 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/docs/TAILWIND_SETUP.md +339 -0
- package/dist/index.css +536 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/page-header-utils.d.ts +2 -0
- package/dist/lib/page-header-utils.d.ts.map +1 -0
- package/dist/mm-react-components.es.js +30238 -1350
- package/dist/mm-react-components.es.js.map +1 -1
- package/dist/mm-react-components.umd.js +41 -6
- package/dist/mm-react-components.umd.js.map +1 -1
- package/dist/preview/AccordionPreview.d.ts +2 -0
- package/dist/preview/AccordionPreview.d.ts.map +1 -0
- package/dist/preview/BadgePreview.d.ts +2 -0
- package/dist/preview/BadgePreview.d.ts.map +1 -0
- package/dist/preview/CalendarPreview.d.ts +2 -0
- package/dist/preview/CalendarPreview.d.ts.map +1 -0
- package/dist/preview/CollapsiblePreview.d.ts +2 -0
- package/dist/preview/CollapsiblePreview.d.ts.map +1 -0
- package/dist/preview/DataTablePreview.d.ts +9 -0
- package/dist/preview/DataTablePreview.d.ts.map +1 -0
- package/dist/preview/DateRangePickerPreview.d.ts +2 -0
- package/dist/preview/DateRangePickerPreview.d.ts.map +1 -0
- package/dist/preview/DialogPreview.d.ts +2 -0
- package/dist/preview/DialogPreview.d.ts.map +1 -0
- package/dist/preview/DrawerPreview.d.ts +2 -0
- package/dist/preview/DrawerPreview.d.ts.map +1 -0
- package/dist/preview/DropdownMenuPreview.d.ts +2 -0
- package/dist/preview/DropdownMenuPreview.d.ts.map +1 -0
- package/dist/preview/DropzonePreview.d.ts +2 -0
- package/dist/preview/DropzonePreview.d.ts.map +1 -0
- package/dist/preview/InputPreview.d.ts.map +1 -1
- package/dist/preview/PopoverPreview.d.ts +2 -0
- package/dist/preview/PopoverPreview.d.ts.map +1 -0
- package/dist/preview/ProgressPreview.d.ts +2 -0
- package/dist/preview/ProgressPreview.d.ts.map +1 -0
- package/dist/preview/SelectPreview.d.ts +2 -0
- package/dist/preview/SelectPreview.d.ts.map +1 -0
- package/dist/preview/SheetPreview.d.ts +2 -0
- package/dist/preview/SheetPreview.d.ts.map +1 -0
- package/dist/preview/SkeletonPreview.d.ts +2 -0
- package/dist/preview/SkeletonPreview.d.ts.map +1 -0
- package/dist/preview/SliderPreview.d.ts +2 -0
- package/dist/preview/SliderPreview.d.ts.map +1 -0
- package/dist/preview/SwitchPreview.d.ts +2 -0
- package/dist/preview/SwitchPreview.d.ts.map +1 -0
- package/dist/preview/TablePreview.d.ts +2 -0
- package/dist/preview/TablePreview.d.ts.map +1 -0
- package/dist/preview/TabsPreview.d.ts +2 -0
- package/dist/preview/TabsPreview.d.ts.map +1 -0
- package/dist/preview/TogglePreview.d.ts +2 -0
- package/dist/preview/TogglePreview.d.ts.map +1 -0
- package/dist/preview/TooltipPreview.d.ts +2 -0
- package/dist/preview/TooltipPreview.d.ts.map +1 -0
- package/dist/preview/data-table/data-table-preview_column-content.d.ts +18 -0
- package/dist/preview/data-table/data-table-preview_column-content.d.ts.map +1 -0
- package/dist/preview/page-header/PageHeaderPreview.d.ts +3 -0
- package/dist/preview/page-header/PageHeaderPreview.d.ts.map +1 -0
- package/dist/tailwind.config.export.js +153 -0
- package/dist/themes/carbide.css +1257 -0
- package/dist/themes/complete.css +8 -0
- package/docs/TAILWIND_SETUP.md +339 -0
- package/package.json +38 -5
- package/scripts/README.md +171 -0
- package/scripts/chakra-to-shadcn-migrator/README.md +107 -0
- package/scripts/chakra-to-shadcn-migrator/bin/chakra-to-shadcn.js +1135 -0
- package/src/index.css +536 -0
- package/src/themes/carbide.css +1257 -0
- package/src/themes/complete.css +8 -0
- package/tailwind.config.export.js +153 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
# Tailwind CSS Setup for MM React Components
|
|
2
|
+
|
|
3
|
+
This guide shows how to configure Tailwind CSS in your consuming application to get the same styling as the component preview interface.
|
|
4
|
+
|
|
5
|
+
## Quick Setup
|
|
6
|
+
|
|
7
|
+
### 1. Install Dependencies
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @machinemetrics/mm-react-components tailwindcss postcss autoprefixer
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 2. Copy Tailwind Configuration
|
|
14
|
+
|
|
15
|
+
Copy the `tailwind.config.export.js` file to your project and rename it to `tailwind.config.js`:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cp node_modules/@machinemetrics/mm-react-components/tailwind.config.export.js tailwind.config.js
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 3. Import Theme CSS
|
|
22
|
+
|
|
23
|
+
**Option A: Complete All-in-One (Recommended)**
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
/* Import everything in one go - includes Tailwind reset, base theme, and Carbide theme */
|
|
27
|
+
@import '@machinemetrics/mm-react-components/themes/complete';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Option B: Manual Setup**
|
|
31
|
+
|
|
32
|
+
```css
|
|
33
|
+
/* Import base theme */
|
|
34
|
+
@import '@machinemetrics/mm-react-components/themes/base';
|
|
35
|
+
|
|
36
|
+
/* Import Carbide theme (optional) */
|
|
37
|
+
@import '@machinemetrics/mm-react-components/themes/carbide';
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 4. Configure PostCSS
|
|
41
|
+
|
|
42
|
+
Create or update your `postcss.config.js`:
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
export default {
|
|
46
|
+
plugins: {
|
|
47
|
+
tailwindcss: {},
|
|
48
|
+
autoprefixer: {},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Complete Setup Example
|
|
54
|
+
|
|
55
|
+
### package.json
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@machinemetrics/mm-react-components": "^0.2.1",
|
|
61
|
+
"tailwindcss": "^3.4.17",
|
|
62
|
+
"postcss": "^8.4.35",
|
|
63
|
+
"autoprefixer": "^10.4.17"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### tailwind.config.js
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
/** @type {import('tailwindcss').Config} */
|
|
72
|
+
export default {
|
|
73
|
+
content: [
|
|
74
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
75
|
+
'./node_modules/@machinemetrics/mm-react-components/dist/**/*.{js,ts,jsx,tsx}',
|
|
76
|
+
],
|
|
77
|
+
theme: {
|
|
78
|
+
extend: {
|
|
79
|
+
colors: {
|
|
80
|
+
background: 'var(--background)',
|
|
81
|
+
foreground: 'var(--foreground)',
|
|
82
|
+
card: 'var(--card)',
|
|
83
|
+
'card-foreground': 'var(--card-foreground)',
|
|
84
|
+
popover: 'var(--popover)',
|
|
85
|
+
'popover-foreground': 'var(--popover-foreground)',
|
|
86
|
+
primary: 'var(--primary)',
|
|
87
|
+
'primary-foreground': 'var(--primary-foreground)',
|
|
88
|
+
secondary: 'var(--secondary)',
|
|
89
|
+
'secondary-foreground': 'var(--secondary-foreground)',
|
|
90
|
+
muted: 'var(--muted)',
|
|
91
|
+
'muted-foreground': 'var(--muted-foreground)',
|
|
92
|
+
accent: 'var(--accent)',
|
|
93
|
+
'accent-foreground': 'var(--accent-foreground)',
|
|
94
|
+
destructive: 'var(--destructive)',
|
|
95
|
+
'destructive-foreground': 'var(--destructive-foreground)',
|
|
96
|
+
border: 'var(--border)',
|
|
97
|
+
input: 'var(--input)',
|
|
98
|
+
'bg-input': 'var(--bg-input)',
|
|
99
|
+
'border-input': 'var(--border-input)',
|
|
100
|
+
ring: 'var(--ring)',
|
|
101
|
+
// Chart colors for data visualization
|
|
102
|
+
'chart-1': 'var(--chart-1)',
|
|
103
|
+
'chart-2': 'var(--chart-2)',
|
|
104
|
+
'chart-3': 'var(--chart-3)',
|
|
105
|
+
'chart-4': 'var(--chart-4)',
|
|
106
|
+
'chart-5': 'var(--chart-5)',
|
|
107
|
+
// Sidebar colors
|
|
108
|
+
sidebar: 'var(--sidebar)',
|
|
109
|
+
'sidebar-foreground': 'var(--sidebar-foreground)',
|
|
110
|
+
'sidebar-primary': 'var(--sidebar-primary)',
|
|
111
|
+
'sidebar-primary-foreground': 'var(--sidebar-primary-foreground)',
|
|
112
|
+
'sidebar-accent': 'var(--sidebar-accent)',
|
|
113
|
+
'sidebar-accent-foreground': 'var(--sidebar-accent-foreground)',
|
|
114
|
+
'sidebar-border': 'var(--sidebar-border)',
|
|
115
|
+
'sidebar-ring': 'var(--sidebar-ring)',
|
|
116
|
+
},
|
|
117
|
+
borderRadius: {
|
|
118
|
+
sm: 'var(--radius-sm)',
|
|
119
|
+
md: 'var(--radius-md)',
|
|
120
|
+
lg: 'var(--radius-lg)',
|
|
121
|
+
xl: 'var(--radius-xl)',
|
|
122
|
+
},
|
|
123
|
+
fontFamily: {
|
|
124
|
+
sans: [
|
|
125
|
+
'Noto Sans',
|
|
126
|
+
'Inter',
|
|
127
|
+
'ui-sans-serif',
|
|
128
|
+
'system-ui',
|
|
129
|
+
'-apple-system',
|
|
130
|
+
'BlinkMacSystemFont',
|
|
131
|
+
'Segoe UI',
|
|
132
|
+
'Roboto',
|
|
133
|
+
'Helvetica Neue',
|
|
134
|
+
'Arial',
|
|
135
|
+
'sans-serif',
|
|
136
|
+
'Apple Color Emoji',
|
|
137
|
+
'Segoe UI Emoji',
|
|
138
|
+
'Segoe UI Symbol',
|
|
139
|
+
'Noto Color Emoji',
|
|
140
|
+
],
|
|
141
|
+
mono: [
|
|
142
|
+
'Inconsolata',
|
|
143
|
+
'ui-monospace',
|
|
144
|
+
'SFMono-Regular',
|
|
145
|
+
'Menlo',
|
|
146
|
+
'Monaco',
|
|
147
|
+
'Consolas',
|
|
148
|
+
'Liberation Mono',
|
|
149
|
+
'Courier New',
|
|
150
|
+
'monospace',
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
fontWeight: {
|
|
154
|
+
normal: '400',
|
|
155
|
+
medium: '500',
|
|
156
|
+
semibold: '600',
|
|
157
|
+
bold: 'var(--font-weight-bold)',
|
|
158
|
+
},
|
|
159
|
+
spacing: {
|
|
160
|
+
sidebar: '16rem', // 256px for sidebar width
|
|
161
|
+
},
|
|
162
|
+
animation: {
|
|
163
|
+
'fade-in': 'fadeIn 0.2s ease-in-out',
|
|
164
|
+
'slide-in': 'slideIn 0.3s ease-out',
|
|
165
|
+
},
|
|
166
|
+
keyframes: {
|
|
167
|
+
fadeIn: {
|
|
168
|
+
'0%': { opacity: '0' },
|
|
169
|
+
'100%': { opacity: '1' },
|
|
170
|
+
},
|
|
171
|
+
slideIn: {
|
|
172
|
+
'0%': { transform: 'translateX(-10px)', opacity: '0' },
|
|
173
|
+
'100%': { transform: 'translateX(0)', opacity: '1' },
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
plugins: [
|
|
179
|
+
function ({ addUtilities, theme }) {
|
|
180
|
+
const newUtilities = {
|
|
181
|
+
'.preview-sidebar': {
|
|
182
|
+
width: '16rem',
|
|
183
|
+
minHeight: '100vh',
|
|
184
|
+
backgroundColor: 'var(--muted)',
|
|
185
|
+
borderRight: '1px solid var(--border)',
|
|
186
|
+
padding: '1rem',
|
|
187
|
+
},
|
|
188
|
+
'.preview-main': {
|
|
189
|
+
flex: '1',
|
|
190
|
+
minWidth: '0',
|
|
191
|
+
padding: '2rem',
|
|
192
|
+
},
|
|
193
|
+
'.preview-card': {
|
|
194
|
+
backgroundColor: 'var(--card)',
|
|
195
|
+
border: '1px solid var(--border)',
|
|
196
|
+
borderRadius: 'var(--radius-lg)',
|
|
197
|
+
padding: '1.5rem',
|
|
198
|
+
},
|
|
199
|
+
'.preview-nav-item': {
|
|
200
|
+
width: '100%',
|
|
201
|
+
textAlign: 'left',
|
|
202
|
+
padding: '0.75rem',
|
|
203
|
+
borderRadius: '0.375rem',
|
|
204
|
+
fontSize: '0.875rem',
|
|
205
|
+
fontWeight: '500',
|
|
206
|
+
transition: 'colors 0.2s ease-in-out',
|
|
207
|
+
'&:hover': {
|
|
208
|
+
backgroundColor: 'var(--muted)',
|
|
209
|
+
color: 'var(--foreground)',
|
|
210
|
+
},
|
|
211
|
+
'&.active': {
|
|
212
|
+
backgroundColor: 'var(--primary)',
|
|
213
|
+
color: 'var(--primary-foreground)',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
addUtilities(newUtilities);
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### src/index.css
|
|
224
|
+
|
|
225
|
+
```css
|
|
226
|
+
@import '@machinemetrics/mm-react-components/themes/base';
|
|
227
|
+
@import '@machinemetrics/mm-react-components/themes/carbide';
|
|
228
|
+
@import 'tailwindcss';
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### postcss.config.js
|
|
232
|
+
|
|
233
|
+
```javascript
|
|
234
|
+
export default {
|
|
235
|
+
plugins: {
|
|
236
|
+
tailwindcss: {},
|
|
237
|
+
autoprefixer: {},
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Component Preview Interface
|
|
243
|
+
|
|
244
|
+
To recreate the component preview interface from the library, use these utility classes:
|
|
245
|
+
|
|
246
|
+
```tsx
|
|
247
|
+
// Main layout container
|
|
248
|
+
<div className="min-h-screen bg-background flex">
|
|
249
|
+
{/* Left Navigation Sidebar */}
|
|
250
|
+
<div className="preview-sidebar">
|
|
251
|
+
<h1 className="text-xl font-bold text-foreground mb-6">MM Components</h1>
|
|
252
|
+
|
|
253
|
+
{/* Theme Toggles */}
|
|
254
|
+
<div className="mb-6 space-y-3">
|
|
255
|
+
{/* Add your theme toggle components here */}
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
{/* Component Navigation */}
|
|
259
|
+
<nav className="space-y-2">
|
|
260
|
+
<button className="preview-nav-item active">Button</button>
|
|
261
|
+
<button className="preview-nav-item">Input</button>
|
|
262
|
+
{/* Add more component navigation items */}
|
|
263
|
+
</nav>
|
|
264
|
+
</div>
|
|
265
|
+
|
|
266
|
+
{/* Main Preview Pane */}
|
|
267
|
+
<div className="preview-main">
|
|
268
|
+
<div>
|
|
269
|
+
<div className="mb-6">
|
|
270
|
+
<h2 className="text-2xl font-semibold text-foreground capitalize">
|
|
271
|
+
Component Name
|
|
272
|
+
</h2>
|
|
273
|
+
<p className="text-muted-foreground mt-1">
|
|
274
|
+
Preview and test the component
|
|
275
|
+
</p>
|
|
276
|
+
</div>
|
|
277
|
+
<div className="preview-card">{/* Your component preview content */}</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Theme Customization
|
|
284
|
+
|
|
285
|
+
### Using Base Theme Only
|
|
286
|
+
|
|
287
|
+
```css
|
|
288
|
+
@import '@machinemetrics/mm-react-components/themes/base';
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Using Carbide Theme
|
|
292
|
+
|
|
293
|
+
```css
|
|
294
|
+
@import '@machinemetrics/mm-react-components/themes/base';
|
|
295
|
+
@import '@machinemetrics/mm-react-components/themes/carbide';
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Custom Theme Overrides
|
|
299
|
+
|
|
300
|
+
You can override theme variables in your CSS:
|
|
301
|
+
|
|
302
|
+
```css
|
|
303
|
+
:root {
|
|
304
|
+
--primary: #your-custom-color;
|
|
305
|
+
--background: #your-custom-background;
|
|
306
|
+
/* Override other variables as needed */
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## Available Utility Classes
|
|
311
|
+
|
|
312
|
+
The exported configuration includes these custom utility classes:
|
|
313
|
+
|
|
314
|
+
- `.preview-sidebar` - Sidebar styling
|
|
315
|
+
- `.preview-main` - Main content area styling
|
|
316
|
+
- `.preview-card` - Component preview card styling
|
|
317
|
+
- `.preview-nav-item` - Navigation item styling
|
|
318
|
+
|
|
319
|
+
## Color System
|
|
320
|
+
|
|
321
|
+
The configuration includes a comprehensive color system:
|
|
322
|
+
|
|
323
|
+
- **Semantic Colors**: `background`, `foreground`, `primary`, `secondary`, etc.
|
|
324
|
+
- **Chart Colors**: `chart-1` through `chart-5` for data visualization
|
|
325
|
+
- **Sidebar Colors**: Complete sidebar color system
|
|
326
|
+
- **Input Colors**: Specialized input styling colors
|
|
327
|
+
|
|
328
|
+
## Typography
|
|
329
|
+
|
|
330
|
+
- **Sans Font**: Noto Sans (primary), Inter, system fonts
|
|
331
|
+
- **Mono Font**: Inconsolata (primary), system monospace fonts
|
|
332
|
+
- **Font Weights**: Normal (400), Medium (500), Semibold (600), Bold (700)
|
|
333
|
+
|
|
334
|
+
## Animation
|
|
335
|
+
|
|
336
|
+
- **Fade In**: `animate-fade-in`
|
|
337
|
+
- **Slide In**: `animate-slide-in`
|
|
338
|
+
|
|
339
|
+
This configuration ensures your consuming application will have the same professional styling as the component preview interface.
|