@eagami/ui 1.1.1 → 1.2.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.
- package/README.md +78 -32
- package/fesm2022/eagami-ui.mjs +618 -55
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eagami-ui.d.ts +237 -15
package/README.md
CHANGED
|
@@ -8,23 +8,24 @@
|
|
|
8
8
|
<a href="https://github.com/mwiraszka/eagami-design-system/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@eagami/ui.svg" alt="license" /></a>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
|
-
A lightweight, accessible Angular component library built on CSS custom properties, with portable design system integration guides for Flutter and React ([see more](#framework-integration)). Ready to use out of the box
|
|
11
|
+
A lightweight, accessible Angular component library built on CSS custom properties, with portable design system integration guides for Flutter and React ([see more](#framework-integration)). Ready to use out of the box: install, import, and start building.
|
|
12
12
|
|
|
13
|
-
Every component is standalone, signal-based, and fully themed via design tokens
|
|
13
|
+
Every component is standalone, signal-based, and fully themed via design tokens (no wrapping modules, complex setup, or runtime style conflicts). Designed with clear APIs, consistent patterns, and comprehensive documentation to make it easy for both developers and AI assistants to integrate in any project.
|
|
14
14
|
|
|
15
15
|
**Component reference and live examples:** [eagami.com/ui](https://eagami.com/ui)
|
|
16
16
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
|
-
- **Zero configuration
|
|
20
|
-
- **Standalone components
|
|
21
|
-
- **Signal-based
|
|
22
|
-
- **Full theming via CSS custom properties
|
|
23
|
-
- **Dark mode built in
|
|
24
|
-
- **Accessible
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
19
|
+
- **Zero configuration**: works immediately after install with sensible defaults
|
|
20
|
+
- **Standalone components**: no `NgModule` boilerplate, just import and use
|
|
21
|
+
- **Signal-based**: built on Angular's modern reactivity primitives (`input()`, `model()`, `output()`, `effect()`)
|
|
22
|
+
- **Full theming via CSS custom properties**: override any design token on `:root` or scope overrides to individual components
|
|
23
|
+
- **Dark mode built in**: automatic via `prefers-color-scheme`, no extra setup
|
|
24
|
+
- **Accessible**: ARIA attributes, keyboard navigation, focus management, and screen reader support throughout
|
|
25
|
+
- **Localized**: built-in component strings ship in English, French, Greek, Polish, and Spanish, switchable at runtime
|
|
26
|
+
- **Form-ready**: `ControlValueAccessor` on every form control (input, textarea, checkbox, switch, radio, dropdown, autocomplete, date picker, slider, code input, segmented)
|
|
27
|
+
- **Tree-shakeable**: only the components you import end up in your bundle
|
|
28
|
+
- **Tiny**: the entire library is **70 KB gzipped**, and only the components you import end up in your bundle
|
|
28
29
|
|
|
29
30
|
## Installation
|
|
30
31
|
|
|
@@ -62,21 +63,21 @@ export class MyComponent {
|
|
|
62
63
|
}
|
|
63
64
|
```
|
|
64
65
|
|
|
65
|
-
No modules to register, no providers to configure. Every component works the same way
|
|
66
|
+
No modules to register, no providers to configure. Every component works the same way: import it, drop it in your template.
|
|
66
67
|
|
|
67
68
|
> **Upgrading from v0.x?** See [MIGRATION.md](MIGRATION.md) for the full list of breaking changes and a find/replace table that covers most upgrades in one pass.
|
|
68
69
|
|
|
69
70
|
## What's included
|
|
70
71
|
|
|
71
|
-
- **Form controls
|
|
72
|
-
- **Overlays
|
|
73
|
-
- **Navigation
|
|
74
|
-
- **Display
|
|
75
|
-
- **Data
|
|
76
|
-
- **Specialised
|
|
77
|
-
- **Icons
|
|
72
|
+
- **Form controls**: Input, Textarea, Checkbox, Switch, Radio, Dropdown, Autocomplete, Date picker, Slider, Code input, Segmented
|
|
73
|
+
- **Overlays**: Dialog, Drawer, Tooltip, Menu, Toast
|
|
74
|
+
- **Navigation**: Tabs, Breadcrumbs, Paginator, Accordion
|
|
75
|
+
- **Display**: Card, Badge, Tag, Alert, Avatar, Skeleton, Spinner, Progress bar, Empty state, Divider, Eagami wordmark
|
|
76
|
+
- **Data**: Data table
|
|
77
|
+
- **Specialised**: Avatar editor
|
|
78
|
+
- **Icons**: 52 stroke-based SVG icon components (`<ea-icon-*>`)
|
|
78
79
|
|
|
79
|
-
Full per-component documentation
|
|
80
|
+
Full per-component documentation (props, events, examples, and accessibility notes) lives at **[eagami.com/ui](https://eagami.com/ui)**.
|
|
80
81
|
|
|
81
82
|
## Theming
|
|
82
83
|
|
|
@@ -101,12 +102,57 @@ Component-level overrides are available where useful:
|
|
|
101
102
|
|
|
102
103
|
See [`src/styles/tokens/`](src/styles/tokens/) for the full token reference.
|
|
103
104
|
|
|
105
|
+
## Internationalization
|
|
106
|
+
|
|
107
|
+
Every component's built-in strings (ARIA labels, placeholders, empty states) ship in **English** (default), **French (France)**, **Greek**, **Polish**, and **Spanish (Spain)**. No setup is needed for English.
|
|
108
|
+
|
|
109
|
+
Set the locale once at bootstrap with `provideEagamiUi`:
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { provideEagamiUi } from '@eagami/ui';
|
|
113
|
+
|
|
114
|
+
bootstrapApplication(AppComponent, {
|
|
115
|
+
providers: [provideEagamiUi({ locale: 'fr-FR' })],
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Switch it at runtime by injecting `EagamiI18nService`, and every component updates reactively:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { EagamiI18nService } from '@eagami/ui';
|
|
123
|
+
|
|
124
|
+
export class LanguagePicker {
|
|
125
|
+
private readonly i18n = inject(EagamiI18nService);
|
|
126
|
+
setFrench() { this.i18n.setLocale('fr-FR'); }
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Individual strings can still be overridden per instance via component inputs (e.g. `placeholder`, `removeLabel`), or globally through `provideEagamiUi({ messages })`. `DatePickerComponent` also follows the active locale when formatting dates.
|
|
131
|
+
|
|
132
|
+
### French typography for user-supplied text
|
|
133
|
+
|
|
134
|
+
Standard French typography puts a narrow non-breaking space (U+202F, *espace fine insécable*) before `?` `!` `:` `;` and around `«` `»`. Without it the punctuation can wrap onto its own line. The library's built-in French messages already follow this rule, but **user-typed content and other consumer-supplied strings are not auto-transformed** — the components render whatever string they receive.
|
|
135
|
+
|
|
136
|
+
What this means in practice:
|
|
137
|
+
|
|
138
|
+
- **macOS / iOS** with a French keyboard already inserts the correct space automatically. Most other operating systems (Windows, Android, most Linux input methods) just send a regular ASCII space, so typed text can wrap awkwardly.
|
|
139
|
+
- For consumer-supplied strings you want to render correctly, the library exposes an opt-in helper:
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import { frenchSpacing } from '@eagami/ui';
|
|
143
|
+
|
|
144
|
+
const corrected = frenchSpacing(userInput);
|
|
145
|
+
// 'Lignes par page :' -> 'Lignes par page :'
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Apply it to prose only (not URLs, CSS, or JSON — `:` and `?` carry non-prose meaning there). It's idempotent and a no-op on text without space-before-punctuation. Also remember to set `<html lang="fr-FR">` so the browser applies locale-aware CSS uppercase rules; the same lang attribute lets screen readers pick the right voice.
|
|
149
|
+
|
|
104
150
|
## Framework integration
|
|
105
151
|
|
|
106
|
-
`@eagami/ui` is an Angular library, but its design tokens, rules, and component API conventions are framework-agnostic. For projects that can't consume the Angular package directly yet still want to adhere to the same design system, two self-contained integration guides are provided
|
|
152
|
+
`@eagami/ui` is an Angular library, but its design tokens, rules, and component API conventions are framework-agnostic. For projects that can't consume the Angular package directly yet still want to adhere to the same design system, two self-contained integration guides are provided, each copy-and-paste ready and written to be readable by both human developers and AI coding agents:
|
|
107
153
|
|
|
108
|
-
- **[design-system-flutter.md](design-system-flutter.md)
|
|
109
|
-
- **[design-system-react.md](design-system-react.md)
|
|
154
|
+
- **[design-system-flutter.md](design-system-flutter.md)**: Dart `ThemeExtension`, `MaterialApp` wiring, reduced-motion handling, and widget API conventions for Flutter projects
|
|
155
|
+
- **[design-system-react.md](design-system-react.md)**: CSS custom properties, TypeScript constants, and component prop conventions for React projects (plain CSS, CSS Modules, styled-components, emotion, or Tailwind)
|
|
110
156
|
|
|
111
157
|
Both files contain the full token set, mandatory design rules, theme setup, usage patterns, component API conventions, and accessibility requirements. Copy the relevant file into the target project and follow it when building UI.
|
|
112
158
|
|
|
@@ -122,9 +168,9 @@ Both files contain the full token set, mandatory design rules, theme setup, usag
|
|
|
122
168
|
|
|
123
169
|
Components are authored for modern evergreen browsers and follow Angular's default [browserslist](https://github.com/browserslist/browserslist) configuration. Specifically:
|
|
124
170
|
|
|
125
|
-
- **Chrome / Edge
|
|
126
|
-
- **Firefox
|
|
127
|
-
- **Safari
|
|
171
|
+
- **Chrome / Edge**: last 2 stable versions
|
|
172
|
+
- **Firefox**: last 2 stable versions, plus the current ESR
|
|
173
|
+
- **Safari**: last 2 stable versions
|
|
128
174
|
- **Modern mobile browsers** (iOS Safari, Chrome Android)
|
|
129
175
|
|
|
130
176
|
The library is published as ES2022. Internet Explorer and pre-Chromium Edge are not supported.
|
|
@@ -154,13 +200,13 @@ The icon set is derived from [Feather Icons](https://feathericons.com/) (© Cole
|
|
|
154
200
|
|
|
155
201
|
### Brand icons
|
|
156
202
|
|
|
157
|
-
The following icons depict third-party trademarks and are provided **only for nominative use
|
|
203
|
+
The following icons depict third-party trademarks and are provided **only for nominative use**, i.e. identifying the brand they represent in a UI (a "Sign in with Google" button, a "Share to Facebook" link, etc.). They are not licensed for general decorative use. Consumers are responsible for following each brand's guidelines and should consult them before shipping:
|
|
158
204
|
|
|
159
|
-
- **Facebook
|
|
160
|
-
- **GitHub
|
|
161
|
-
- **Google
|
|
162
|
-
- **Microsoft
|
|
163
|
-
- **X (Twitter)
|
|
205
|
+
- **Facebook**: [Brand resources](https://about.meta.com/brand/resources/facebookapp/logo/)
|
|
206
|
+
- **GitHub**: [Logos and usage](https://github.com/logos)
|
|
207
|
+
- **Google**: [Sign-in branding guidelines](https://developers.google.com/identity/branding-guidelines)
|
|
208
|
+
- **Microsoft**: [Trademark and brand guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks)
|
|
209
|
+
- **X (Twitter)**: [Brand toolkit](https://about.x.com/en/who-we-are/brand-toolkit)
|
|
164
210
|
|
|
165
211
|
## License
|
|
166
212
|
|