eidos-ui 0.1.1 → 1.0.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 +134 -84
- package/dist/{Navigation.types-DVcLJnrB.d.ts → Navigation.types-CpS3EYNz.d.ts} +14 -11
- package/dist/{Navigation.types-Ctu5mlTa.d.cts → Navigation.types-sUO9wqOp.d.cts} +14 -11
- package/dist/{chunk-HPIBYEGE.cjs → chunk-6GAIQ2IY.cjs} +5 -3
- package/dist/chunk-6GAIQ2IY.cjs.map +1 -0
- package/dist/{chunk-7NZTRSMT.js → chunk-6HGDQ4BM.js} +5 -3
- package/dist/chunk-6HGDQ4BM.js.map +1 -0
- package/dist/{chunk-YPK7RV3Y.js → chunk-BBOUUHLO.js} +2 -2
- package/dist/{chunk-MOX6LYGC.js → chunk-ICHPPNFV.js} +2 -2
- package/dist/chunk-ICHPPNFV.js.map +1 -0
- package/dist/{chunk-MSQXPGOD.cjs → chunk-YKECQKOV.cjs} +2 -2
- package/dist/chunk-YKECQKOV.cjs.map +1 -0
- package/dist/{chunk-VGYJ4VKX.cjs → chunk-YZOVF7JV.cjs} +3 -3
- package/dist/{chunk-VGYJ4VKX.cjs.map → chunk-YZOVF7JV.cjs.map} +1 -1
- package/dist/data-grid/index.cjs +2 -2
- package/dist/data-grid/index.d.cts +19 -8
- package/dist/data-grid/index.d.ts +19 -8
- package/dist/data-grid/index.js +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.css +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/navigation/index.cjs +2 -2
- package/dist/navigation/index.d.cts +2 -2
- package/dist/navigation/index.d.ts +2 -2
- package/dist/navigation/index.js +1 -1
- package/dist/page-layout/index.cjs +3 -3
- package/dist/page-layout/index.d.cts +1 -1
- package/dist/page-layout/index.d.ts +1 -1
- package/dist/page-layout/index.js +2 -2
- package/package.json +7 -2
- package/dist/chunk-7NZTRSMT.js.map +0 -1
- package/dist/chunk-HPIBYEGE.cjs.map +0 -1
- package/dist/chunk-MOX6LYGC.js.map +0 -1
- package/dist/chunk-MSQXPGOD.cjs.map +0 -1
- /package/dist/{chunk-YPK7RV3Y.js.map → chunk-BBOUUHLO.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# eidos-ui
|
|
2
4
|
|
|
3
|
-
A modern, accessible React component library built with TypeScript, SCSS, and CSS custom properties
|
|
5
|
+
**A modern, accessible React component library built with TypeScript, SCSS, and CSS custom properties.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/eidos-ui)
|
|
8
|
+
[](https://www.npmjs.com/package/eidos-ui)
|
|
9
|
+
[](./LICENSE)
|
|
10
|
+
[](https://www.typescriptlang.org/)
|
|
11
|
+
|
|
12
|
+
</div>
|
|
4
13
|
|
|
5
14
|
> **This package starts fresh at `0.1.0`.** It was previously published as `@pmealha/eidos-ui`
|
|
6
15
|
> (versions `0.1.1` through `5.0.0`), which reached `5.x` well before the API was actually stable -
|
|
@@ -8,33 +17,33 @@ A modern, accessible React component library built with TypeScript, SCSS, and CS
|
|
|
8
17
|
> will not receive further updates; install `eidos-ui` instead. See [CHANGELOG.md](./CHANGELOG.md) for
|
|
9
18
|
> what's changed release to release from here on.
|
|
10
19
|
|
|
11
|
-
##
|
|
20
|
+
## Features
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
| | |
|
|
23
|
+
| ------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
24
|
+
| **Themeable** | Every design token is a CSS custom property, so palette, spacing, and radii can be overridden without touching source. |
|
|
25
|
+
| **Type-safe** | Written in TypeScript with full prop typings exported for every component. |
|
|
26
|
+
| **Tree-shakeable** | Per-component entry points (`eidos-ui/button`, `eidos-ui/table`, ...) keep bundles lean. |
|
|
27
|
+
| **Icon-agnostic** | Works with any icon library - Lucide, MUI Icons, Font Awesome, Remix Icons, or your own. |
|
|
28
|
+
| **Accessible** | Built with keyboard navigation and ARIA semantics in mind. |
|
|
29
|
+
| **Optimized build** | Bundled with tsup, shipping both ESM and CJS with source maps and `.d.ts` files. |
|
|
20
30
|
|
|
21
|
-
##
|
|
31
|
+
## Installation
|
|
22
32
|
|
|
23
33
|
```bash
|
|
24
34
|
npm install eidos-ui
|
|
25
35
|
```
|
|
26
36
|
|
|
27
|
-
**Optional
|
|
37
|
+
**Optional** - for component-based icons (recommended over string-based icon fonts):
|
|
28
38
|
|
|
29
39
|
```bash
|
|
30
40
|
npm install lucide-react
|
|
31
|
-
# or use MUI Icons, Heroicons, etc.
|
|
32
41
|
```
|
|
33
42
|
|
|
34
|
-
##
|
|
43
|
+
## Quick Start
|
|
35
44
|
|
|
36
45
|
```tsx
|
|
37
|
-
import { Button, Tooltip
|
|
46
|
+
import { Button, Tooltip } from 'eidos-ui';
|
|
38
47
|
import 'eidos-ui/styles';
|
|
39
48
|
|
|
40
49
|
function App() {
|
|
@@ -52,50 +61,126 @@ function App() {
|
|
|
52
61
|
}
|
|
53
62
|
```
|
|
54
63
|
|
|
55
|
-
### With
|
|
64
|
+
### With icons
|
|
56
65
|
|
|
57
66
|
```tsx
|
|
58
|
-
//
|
|
67
|
+
// Component icons (tree-shakeable)
|
|
59
68
|
import { Plus, Download } from 'lucide-react';
|
|
69
|
+
|
|
60
70
|
<Button icon={Plus} />
|
|
61
71
|
<Button preIcon={Download}>Download</Button>
|
|
62
72
|
|
|
63
|
-
//
|
|
64
|
-
<Button icon="fa fa-plus" />
|
|
73
|
+
// String-based icons (icon font classes)
|
|
74
|
+
<Button icon="fa fa-plus" /> // Font Awesome
|
|
65
75
|
<Button icon="ri-add-line" /> // Remix Icons
|
|
66
76
|
```
|
|
67
77
|
|
|
68
|
-
##
|
|
78
|
+
## Components
|
|
79
|
+
|
|
80
|
+
These are the same groups used in Storybook, so the README and the docs sidebar stay in sync.
|
|
81
|
+
|
|
82
|
+
<table>
|
|
83
|
+
<tr><td valign="top">
|
|
84
|
+
|
|
85
|
+
**Layout**
|
|
86
|
+
|
|
87
|
+
- PageLayout
|
|
88
|
+
- Header
|
|
89
|
+
- Footer
|
|
90
|
+
- Navigation
|
|
91
|
+
- Toolbar
|
|
92
|
+
- Breadcrumb
|
|
93
|
+
|
|
94
|
+
**Elements**
|
|
95
|
+
|
|
96
|
+
- Button
|
|
97
|
+
- ButtonGroup
|
|
98
|
+
- SplitButton
|
|
99
|
+
- Avatar
|
|
100
|
+
- Badge
|
|
101
|
+
- Card
|
|
102
|
+
- Chip
|
|
103
|
+
- Divider
|
|
104
|
+
- EmptyState
|
|
105
|
+
- Kbd
|
|
106
|
+
- Pill
|
|
107
|
+
- SegmentedControl
|
|
108
|
+
|
|
109
|
+
</td><td valign="top">
|
|
110
|
+
|
|
111
|
+
**Forms**
|
|
112
|
+
|
|
113
|
+
- Input
|
|
114
|
+
- Textarea
|
|
115
|
+
- NumberInput
|
|
116
|
+
- Select
|
|
117
|
+
- Combobox
|
|
118
|
+
- Checkbox
|
|
119
|
+
- Radio
|
|
120
|
+
- Switch
|
|
121
|
+
- Slider
|
|
122
|
+
- ColorPicker
|
|
123
|
+
- DatePicker
|
|
124
|
+
- OTPInput
|
|
125
|
+
- TagInput
|
|
126
|
+
- FileUpload
|
|
127
|
+
- InlineEdit
|
|
128
|
+
|
|
129
|
+
**Navigation**
|
|
130
|
+
|
|
131
|
+
- Tabs
|
|
132
|
+
- Stepper
|
|
133
|
+
- Accordion
|
|
134
|
+
- Pagination
|
|
135
|
+
- TreeView
|
|
136
|
+
|
|
137
|
+
</td><td valign="top">
|
|
138
|
+
|
|
139
|
+
**Data**
|
|
140
|
+
|
|
141
|
+
- Table
|
|
142
|
+
- DataGrid
|
|
143
|
+
- Timeline
|
|
144
|
+
- VirtualList
|
|
145
|
+
|
|
146
|
+
**Overlays**
|
|
147
|
+
|
|
148
|
+
- Modal
|
|
149
|
+
- Drawer
|
|
150
|
+
- Snackbar
|
|
151
|
+
- Tooltip
|
|
152
|
+
- Popover
|
|
153
|
+
- Menu
|
|
154
|
+
- ContextMenu
|
|
155
|
+
- CommandPalette
|
|
156
|
+
- Dropdown
|
|
157
|
+
|
|
158
|
+
**Feedback**
|
|
69
159
|
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
- **Dropdown** - Customizable dropdown menus
|
|
75
|
-
- **Input** - Text input with validation and icons
|
|
76
|
-
- **Menu** - Navigation and action menus
|
|
77
|
-
- **Modal** - Dialog overlays with customizable actions
|
|
78
|
-
- **Select** - Dropdown selection with search
|
|
79
|
-
- **Snackbar** - Toast notifications with actions
|
|
80
|
-
- **Spinner** - Loading indicators
|
|
81
|
-
- **Table** - Data tables with sorting, filtering, and pagination
|
|
82
|
-
- **Tooltip** - Contextual hints with smart positioning
|
|
160
|
+
- Alert
|
|
161
|
+
- Progress
|
|
162
|
+
- Skeleton
|
|
163
|
+
- Spinner
|
|
83
164
|
|
|
84
|
-
|
|
165
|
+
</td></tr>
|
|
166
|
+
</table>
|
|
85
167
|
|
|
86
|
-
|
|
168
|
+
Full props and interactive examples for every component live in Storybook - see [Documentation](#documentation).
|
|
169
|
+
|
|
170
|
+
## Documentation
|
|
171
|
+
|
|
172
|
+
Run Storybook locally for the full interactive component reference, including a searchable "Releases" page mirroring [CHANGELOG.md](./CHANGELOG.md):
|
|
87
173
|
|
|
88
174
|
```bash
|
|
175
|
+
git clone https://github.com/PedroMealha/eidos-ui.git
|
|
176
|
+
cd eidos-ui
|
|
177
|
+
npm install
|
|
89
178
|
npm run storybook
|
|
90
179
|
```
|
|
91
180
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
## 🎨 Customization
|
|
181
|
+
## Theming
|
|
95
182
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
All design tokens are customizable via CSS custom properties:
|
|
183
|
+
All design tokens are exposed as CSS custom properties, so themes can be overridden globally without touching component source.
|
|
99
184
|
|
|
100
185
|
```css
|
|
101
186
|
:root {
|
|
@@ -112,64 +197,29 @@ All design tokens are customizable via CSS custom properties:
|
|
|
112
197
|
}
|
|
113
198
|
```
|
|
114
199
|
|
|
115
|
-
|
|
200
|
+
Individual component styles can also be targeted directly, following each component's `eidos-<name>` BEM-style class names:
|
|
116
201
|
|
|
117
202
|
```css
|
|
118
|
-
|
|
119
|
-
--primary-color: #818cf8;
|
|
120
|
-
--background: #1e293b;
|
|
121
|
-
--text-color: #f1f5f9;
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Override Component Styles
|
|
126
|
-
|
|
127
|
-
```css
|
|
128
|
-
.eidos-button {
|
|
203
|
+
.eidos-button--filled.eidos-button--primary {
|
|
129
204
|
border-radius: 20px;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.eidos-button--primary {
|
|
133
205
|
background: linear-gradient(to right, #6366f1, #8b5cf6);
|
|
134
206
|
}
|
|
135
207
|
```
|
|
136
208
|
|
|
137
|
-
##
|
|
209
|
+
## TypeScript
|
|
138
210
|
|
|
139
|
-
|
|
211
|
+
Every component ships with exported prop types:
|
|
140
212
|
|
|
141
213
|
```tsx
|
|
142
214
|
import type { ButtonProps, TooltipProps } from 'eidos-ui';
|
|
143
215
|
|
|
144
|
-
const MyButton: React.FC<ButtonProps> = (props) => {
|
|
145
|
-
return <Button {...props} />;
|
|
146
|
-
};
|
|
216
|
+
const MyButton: React.FC<ButtonProps> = (props) => <Button {...props} />;
|
|
147
217
|
```
|
|
148
218
|
|
|
149
|
-
##
|
|
150
|
-
|
|
151
|
-
The library supports multiple icon approaches:
|
|
152
|
-
|
|
153
|
-
1. **Component Icons** (Lucide, MUI, Heroicons) - Recommended for tree-shaking
|
|
154
|
-
2. **String-based Icons** (Font Awesome, Remix Icons) - Great for dynamic icons
|
|
155
|
-
|
|
156
|
-
```tsx
|
|
157
|
-
// Component-based (tree-shakeable)
|
|
158
|
-
import { Plus } from 'lucide-react';
|
|
159
|
-
<Button icon={Plus} />
|
|
160
|
-
|
|
161
|
-
// String-based (requires icon CSS to be loaded)
|
|
162
|
-
<Button icon="fa fa-plus" />
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
## 📄 License
|
|
166
|
-
|
|
167
|
-
MIT
|
|
168
|
-
|
|
169
|
-
## 👤 Author
|
|
219
|
+
## Contributing
|
|
170
220
|
|
|
171
|
-
|
|
221
|
+
This is currently a personal project without an established external contribution process. Bug reports and suggestions are welcome via [GitHub Issues](https://github.com/PedroMealha/eidos-ui/issues).
|
|
172
222
|
|
|
173
|
-
|
|
223
|
+
## License
|
|
174
224
|
|
|
175
|
-
|
|
225
|
+
[MIT](./LICENSE) © Pedro Mealha
|
|
@@ -73,17 +73,20 @@ interface NavigationProps {
|
|
|
73
73
|
/** Called whenever the collapsed state changes, in both controlled and uncontrolled modes. */
|
|
74
74
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
77
|
-
* crosses this width, in pixels - e.g.
|
|
78
|
-
* on any viewport narrower than that,
|
|
79
|
-
* `window.matchMedia` internally; does
|
|
80
|
-
* so it's SSR-safe. Works the same way
|
|
81
|
-
* modes: uncontrolled, it drives
|
|
82
|
-
* controlled, it calls
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* viewport crosses the
|
|
76
|
+
* On by default: automatically collapses (and re-expands) `Navigation`
|
|
77
|
+
* when the viewport crosses this width, in pixels - e.g.
|
|
78
|
+
* `collapseBelow={1024}` collapses it on any viewport narrower than that,
|
|
79
|
+
* and expands it again above. Uses `window.matchMedia` internally; does
|
|
80
|
+
* nothing until mounted client-side, so it's SSR-safe. Works the same way
|
|
81
|
+
* in both controlled and uncontrolled modes: uncontrolled, it drives
|
|
82
|
+
* Navigation's own state directly; controlled, it calls
|
|
83
|
+
* `onCollapsedChange` at the crossing point, exactly as if the built-in
|
|
84
|
+
* toggle button had been clicked - your own state stays in charge either
|
|
85
|
+
* way. A manual toggle in between crossings (e.g. expanding back while
|
|
86
|
+
* still narrower than this) is respected until the viewport crosses the
|
|
87
|
+
* breakpoint again. Pass `collapseBelow={0}` to opt out entirely (no
|
|
88
|
+
* viewport is ever narrower than `0px`).
|
|
89
|
+
* @default 768
|
|
87
90
|
*/
|
|
88
91
|
collapseBelow?: number;
|
|
89
92
|
/** Renders the built-in collapse/expand toggle button. @default true */
|
|
@@ -73,17 +73,20 @@ interface NavigationProps {
|
|
|
73
73
|
/** Called whenever the collapsed state changes, in both controlled and uncontrolled modes. */
|
|
74
74
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
77
|
-
* crosses this width, in pixels - e.g.
|
|
78
|
-
* on any viewport narrower than that,
|
|
79
|
-
* `window.matchMedia` internally; does
|
|
80
|
-
* so it's SSR-safe. Works the same way
|
|
81
|
-
* modes: uncontrolled, it drives
|
|
82
|
-
* controlled, it calls
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* viewport crosses the
|
|
76
|
+
* On by default: automatically collapses (and re-expands) `Navigation`
|
|
77
|
+
* when the viewport crosses this width, in pixels - e.g.
|
|
78
|
+
* `collapseBelow={1024}` collapses it on any viewport narrower than that,
|
|
79
|
+
* and expands it again above. Uses `window.matchMedia` internally; does
|
|
80
|
+
* nothing until mounted client-side, so it's SSR-safe. Works the same way
|
|
81
|
+
* in both controlled and uncontrolled modes: uncontrolled, it drives
|
|
82
|
+
* Navigation's own state directly; controlled, it calls
|
|
83
|
+
* `onCollapsedChange` at the crossing point, exactly as if the built-in
|
|
84
|
+
* toggle button had been clicked - your own state stays in charge either
|
|
85
|
+
* way. A manual toggle in between crossings (e.g. expanding back while
|
|
86
|
+
* still narrower than this) is respected until the viewport crosses the
|
|
87
|
+
* breakpoint again. Pass `collapseBelow={0}` to opt out entirely (no
|
|
88
|
+
* viewport is ever narrower than `0px`).
|
|
89
|
+
* @default 768
|
|
87
90
|
*/
|
|
88
91
|
collapseBelow?: number;
|
|
89
92
|
/** Renders the built-in collapse/expand toggle button. @default true */
|
|
@@ -64,6 +64,7 @@ var _reactdom = require('react-dom');
|
|
|
64
64
|
|
|
65
65
|
var _lucidereact = require('lucide-react');
|
|
66
66
|
var _jsxruntime = require('react/jsx-runtime');
|
|
67
|
+
var MIN_COLUMN_WIDTH_PX = 100;
|
|
67
68
|
function SortableTableRow({
|
|
68
69
|
id,
|
|
69
70
|
disabled,
|
|
@@ -199,7 +200,7 @@ function DataGridInner({
|
|
|
199
200
|
density = "comfortable",
|
|
200
201
|
showDensity = false,
|
|
201
202
|
// ── Card view ────────────────────────────────────────────────────────────────
|
|
202
|
-
hasCardView =
|
|
203
|
+
hasCardView = true,
|
|
203
204
|
cardViewBreakpoint = 640,
|
|
204
205
|
cardMinWidth = 280
|
|
205
206
|
}) {
|
|
@@ -264,7 +265,8 @@ function DataGridInner({
|
|
|
264
265
|
},
|
|
265
266
|
[hasCardView]
|
|
266
267
|
);
|
|
267
|
-
const
|
|
268
|
+
const columnCountForCardView = columns.length + (showRowNumbers ? 1 : 0) + (draggableRows ? 1 : 0) + (selectable ? 1 : 0) + (expandable ? 1 : 0);
|
|
269
|
+
const isCardView = hasCardView && containerWidth !== null && (containerWidth < cardViewBreakpoint || containerWidth < columnCountForCardView * MIN_COLUMN_WIDTH_PX);
|
|
268
270
|
const cardHeaderColumn = _react.useMemo.call(void 0, () => columns.find((c) => c.cardHeader), [columns]);
|
|
269
271
|
const cardSubheaderColumn = _react.useMemo.call(void 0, () => columns.find((c) => c.cardSubheader), [columns]);
|
|
270
272
|
const actionsColumn = _react.useMemo.call(void 0, () => columns.find((c) => c.type === "actions"), [columns]);
|
|
@@ -1481,4 +1483,4 @@ var DataGrid = Object.assign(DataGridInner, { displayName: "DataGrid" });
|
|
|
1481
1483
|
|
|
1482
1484
|
|
|
1483
1485
|
exports.DataGrid = DataGrid;
|
|
1484
|
-
//# sourceMappingURL=chunk-
|
|
1486
|
+
//# sourceMappingURL=chunk-6GAIQ2IY.cjs.map
|