@theredhead/lucid-kit 0.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.
- package/README.md +148 -0
- package/fesm2022/theredhead-lucid-kit.mjs +25318 -0
- package/fesm2022/theredhead-lucid-kit.mjs.map +1 -0
- package/package.json +56 -0
- package/types/theredhead-lucid-kit.d.ts +17088 -0
- package/types/theredhead-lucid-kit.d.ts.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# @theredhead/lucid-kit
|
|
2
|
+
|
|
3
|
+
Core reusable UI components library for theredhead Angular applications.
|
|
4
|
+
Every component is **standalone**, uses **signal-based** inputs/state, and
|
|
5
|
+
**OnPush** change detection. There are no runtime dependencies beyond Angular
|
|
6
|
+
core and `@angular/cdk`.
|
|
7
|
+
|
|
8
|
+
> **Early-stage — not production ready.** This package is still undergoing
|
|
9
|
+
> active development and is subject to breaking changes without notice until
|
|
10
|
+
> a stable `1.0` release.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Components at a glance
|
|
15
|
+
|
|
16
|
+
| Component | Selector | Description |
|
|
17
|
+
| -------------------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
|
|
18
|
+
| **UIButton** | `ui-button` | Push button with `filled`, `outlined`, `text`, and `ghost` variants |
|
|
19
|
+
| **UIInput** | `ui-input` | Styled text input with label and two-way `[(value)]` binding |
|
|
20
|
+
| **UIDropdownList** | `ui-dropdown-list` | Popup dropdown select with `SelectOption[]` binding and keyboard nav |
|
|
21
|
+
| **UICheckbox** | `ui-checkbox` | Styled checkbox with label and two-way model |
|
|
22
|
+
| **UIRadioGroup / UIRadioButton** | `ui-radio-group` / `ui-radio-button` | Radio button group with two-way value binding |
|
|
23
|
+
| **UISlider** | `ui-slider` | Range slider supporting single-value and range modes |
|
|
24
|
+
| **UIDatePicker** | `ui-date-picker` | Calendar date picker with locale-aware formatting, min/max constraints |
|
|
25
|
+
| **UITimePicker** | `ui-time-picker` | Time input supporting 12 h / 24 h modes, step intervals |
|
|
26
|
+
| **UIDateTimePicker** | `ui-date-time-picker` | Composite control combining date picker + time picker |
|
|
27
|
+
| **UIAutocomplete** | `ui-autocomplete` | Type-ahead input with popup suggestions, chip multi-select |
|
|
28
|
+
| **UIFilter** | `ui-filter` | Predicate builder (AND/OR) emitting `Predicate<T>` for datasource use |
|
|
29
|
+
| **UITableView** | `ui-table-view` | Virtual-scrolling data table with sortable columns, selection, pagination |
|
|
30
|
+
| **UITreeView** | `ui-tree-view` | Hierarchical tree with expand/collapse, selection, keyboard navigation |
|
|
31
|
+
| **UIMapView** | `ui-map-view` | Tile-based slippy map (zero-dep) with markers, polylines, polygons |
|
|
32
|
+
| **UIAccordion** | `ui-accordion` | Expandable/collapsible panels (single, collapsible, multi-expand modes) |
|
|
33
|
+
| **UITabGroup / UITab** | `ui-tab-group` / `ui-tab` | Tabbed container with lazy-rendered tab panels |
|
|
34
|
+
| **UIBadge** | `ui-badge` | Small status badge/label with colour variants |
|
|
35
|
+
| **UIChip** | `ui-chip` | Rounded tag/chip with colour and optional removable |
|
|
36
|
+
| **UIAvatar** | `ui-avatar` | Circular avatar with image, initials fallback, or Gravatar |
|
|
37
|
+
| **UIIcon** | `ui-icon` | Inline SVG icon renderer with bundled icon registry |
|
|
38
|
+
| **UIBreadcrumb** | `ui-breadcrumb` | Horizontal breadcrumb navigation trail |
|
|
39
|
+
| **UIPagination** | `ui-pagination` | Page navigation bar with page-size selector |
|
|
40
|
+
| **UIProgress** | `ui-progress` | Progress bar (determinate / indeterminate) with colour variants |
|
|
41
|
+
| **UIRepeater** | `ui-repeater` | Template repeater with grid, flex-row, flex-column, masonry layouts |
|
|
42
|
+
| **UIFileUpload** | `ui-file-upload` | Drag-and-drop file upload zone with accept filter and size limits |
|
|
43
|
+
| **UIRichTextEditor** | `ui-rich-text-editor` | WYSIWYG contenteditable editor with configurable toolbar |
|
|
44
|
+
| **UIDialog** | `ui-dialog` | Modal dialog container with backdrop, size options |
|
|
45
|
+
| **UIThemeToggle** | `ui-theme-toggle` | Light/dark mode toggle button with inline SVG icons |
|
|
46
|
+
|
|
47
|
+
## Table View Columns
|
|
48
|
+
|
|
49
|
+
The table view supports multiple column types that use Angular's dependency injection (DI) forwarding system for flexible column composition:
|
|
50
|
+
|
|
51
|
+
- `ui-text-column` - Renders text values with optional truncation
|
|
52
|
+
- `ui-badge-column` - Renders badge status values
|
|
53
|
+
- `ui-number-column` - Renders formatted numbers
|
|
54
|
+
- `ui-template-column` - Renders custom templates with projected content
|
|
55
|
+
|
|
56
|
+
All column types extend `UITableViewColumn` and provide themselves via DI forwarding, enabling the parent table to discover all columns through a single `contentChildren()` query on the base class token. This pattern allows for extensibility - new column types can be added without modifying the parent table component.
|
|
57
|
+
|
|
58
|
+
For more information about the column inheritance pattern, see [column-inheritance-pattern.md](src/lib/table-view/column-inheritance-pattern.md).
|
|
59
|
+
|
|
60
|
+
## Table View Columns
|
|
61
|
+
|
|
62
|
+
The table view supports multiple column types that use Angular's dependency injection (DI) forwarding system for flexible column composition:
|
|
63
|
+
|
|
64
|
+
- `ui-text-column` - Renders text values with optional truncation
|
|
65
|
+
- `ui-badge-column` - Renders badge status values
|
|
66
|
+
- `ui-number-column` - Renders formatted numbers
|
|
67
|
+
- `ui-template-column` - Renders custom templates with projected content
|
|
68
|
+
|
|
69
|
+
All column types extend `UITableViewColumn` and provide themselves via DI forwarding, enabling the parent table to discover all columns through a single `contentChildren()` query on the base class token. This pattern allows for extensibility - new column types can be added without modifying the parent table component.
|
|
70
|
+
|
|
71
|
+
### Directives
|
|
72
|
+
|
|
73
|
+
| Directive | Selector | Description |
|
|
74
|
+
| ---------------------- | ------------- | ----------------------------------------------------------- |
|
|
75
|
+
| **UIDensityDirective** | `[uiDensity]` | Applies density CSS tokens (compact, comfortable, generous) |
|
|
76
|
+
| **UITooltip** | `[uiTooltip]` | Tooltip popup on hover/focus |
|
|
77
|
+
|
|
78
|
+
### Services
|
|
79
|
+
|
|
80
|
+
| Service | Description |
|
|
81
|
+
| ------------------ | -------------------------------------------------- |
|
|
82
|
+
| **PopoverService** | Opens positioned popover overlays programmatically |
|
|
83
|
+
| **ModalService** | Opens modal dialogs programmatically |
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Table View columns
|
|
88
|
+
|
|
89
|
+
All columns extend `UITableViewColumn` and register via DI forwarding:
|
|
90
|
+
|
|
91
|
+
| Column | Selector | Notes |
|
|
92
|
+
| -------------------- | -------------------- | ---------------------------------- |
|
|
93
|
+
| **UITextColumn** | `ui-text-column` | Plain text with optional truncate |
|
|
94
|
+
| **UINumberColumn** | `ui-number-column` | Locale-aware number formatting |
|
|
95
|
+
| **UIBadgeColumn** | `ui-badge-column` | Badge cell with variant colours |
|
|
96
|
+
| **UITemplateColumn** | `ui-template-column` | Consumer-projected `<ng-template>` |
|
|
97
|
+
|
|
98
|
+
## Table View datasources
|
|
99
|
+
|
|
100
|
+
| Class | Description |
|
|
101
|
+
| --------------------------- | ---------------------------------------------------- |
|
|
102
|
+
| `ArrayDatasource` | In-memory datasource backed by a plain array |
|
|
103
|
+
| `FilterableArrayDatasource` | Extends `ArrayDatasource` with client-side filtering |
|
|
104
|
+
| `RestDatasource` | HTTP-backed datasource for REST APIs |
|
|
105
|
+
|
|
106
|
+
## Tree View datasources
|
|
107
|
+
|
|
108
|
+
| Class | Description |
|
|
109
|
+
| --------------------- | -------------------------------------------------- |
|
|
110
|
+
| `ArrayTreeDatasource` | In-memory tree datasource backed by nested objects |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Quick start
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import { UIButton, UITableView, UITextColumn } from "@theredhead/lucid-kit";
|
|
118
|
+
|
|
119
|
+
@Component({
|
|
120
|
+
selector: "app-demo",
|
|
121
|
+
standalone: true,
|
|
122
|
+
imports: [UIButton, UITableView, UITextColumn],
|
|
123
|
+
template: `
|
|
124
|
+
<ui-button variant="filled" (click)="load()">Refresh</ui-button>
|
|
125
|
+
|
|
126
|
+
<ui-table-view [datasource]="datasource">
|
|
127
|
+
<ui-text-column key="name" headerText="Name" [sortable]="true" />
|
|
128
|
+
<ui-text-column key="email" headerText="Email" [truncate]="true" />
|
|
129
|
+
</ui-table-view>
|
|
130
|
+
`,
|
|
131
|
+
})
|
|
132
|
+
export class DemoComponent {
|
|
133
|
+
datasource = new ArrayDatasource(this.data);
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Features
|
|
140
|
+
|
|
141
|
+
- No external runtime UI dependency — native browser controls
|
|
142
|
+
- Fully typed with TypeScript
|
|
143
|
+
- Signal-based reactive state (`input()`, `model()`, `computed()`, `effect()`)
|
|
144
|
+
- Modern control flow in templates (`@if`, `@for`, `@switch`)
|
|
145
|
+
- OnPush change detection throughout
|
|
146
|
+
- Keyboard accessible with ARIA patterns
|
|
147
|
+
- CSS custom-property theming (`--ui-*` tokens)
|
|
148
|
+
- Light & dark mode support via three-tier pattern
|