@tociva/tailng-ui 0.1.0 → 0.6.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 CHANGED
@@ -1,7 +1,246 @@
1
1
  # @tociva/tailng-ui
2
2
 
3
- Modern Angular UI components powered by Tailwind CSS.
3
+ Modern Angular UI components powered by Tailwind CSS. Built for Angular 21+ with standalone components, signals, and a clean API.
4
+
5
+ ## Overview
6
+
7
+ `@tociva/tailng-ui` is a comprehensive component library for Angular applications. It provides 50+ production-ready components styled with Tailwind CSS, featuring a "Material-like" developer experience without heavy theming overhead.
4
8
 
5
9
  ## Installation
10
+
6
11
  ```bash
7
- npm install @tociva/tailng-ui
12
+ npm install @tociva/tailng-ui
13
+ ```
14
+
15
+ ## Peer Dependencies
16
+
17
+ - `@angular/core`: ^21.0.0
18
+ - `@angular/common`: ^21.0.0
19
+ - `@angular/forms`: ^21.0.0
20
+ - `@tociva/tailng-cdk`: ^0.1.0
21
+ - `dayjs`: ^1.11.19
22
+
23
+ ## Features
24
+
25
+ - **Standalone Components**: All components are standalone, no NgModules required
26
+ - **Signal-based API**: Built with Angular signals for reactive, performant components
27
+ - **Tailwind CSS**: Styled with utility classes, fully customizable
28
+ - **Accessible**: WCAG-compliant components with proper ARIA attributes
29
+ - **Type-safe**: Full TypeScript support with comprehensive types
30
+ - **Tree-shakable**: Import only what you need
31
+ - **CSS Variables**: Theme support via CSS custom properties
32
+ - **"klass signal" Pattern**: Consistent styling API across components
33
+
34
+ ## Quick Start
35
+
36
+ ```typescript
37
+ import { Component } from '@angular/core';
38
+ import { TailngButtonComponent } from '@tociva/tailng-ui';
39
+
40
+ @Component({
41
+ selector: 'app-example',
42
+ standalone: true,
43
+ imports: [TailngButtonComponent],
44
+ template: `
45
+ <tng-button variant="primary">Click me</tng-button>
46
+ `,
47
+ })
48
+ export class ExampleComponent {}
49
+ ```
50
+
51
+ ## Component Categories
52
+
53
+ ### Form Controls
54
+
55
+ Complete set of form input components with validation support:
56
+
57
+ - **Autocomplete** - Searchable dropdown with typeahead
58
+ - **Checkbox** - Single and multi-select checkboxes
59
+ - **Chips** - Multi-value input with tags
60
+ - **Datepicker** - Date selection with calendar
61
+ - **Timepicker** - Time selection component
62
+ - **Form Field** - Wrapper with label, hint, and error states
63
+ - **Text Input** - Standard text input
64
+ - **Number Input** - Numeric input with validation
65
+ - **Textarea** - Multi-line text input
66
+ - **File Upload** - File selection and upload
67
+ - **Radio Button** - Single selection from options
68
+ - **Select** - Dropdown selection
69
+ - **Slider** - Range input slider
70
+ - **Slide Toggle** - Toggle switch
71
+ - **Button Toggle** - Toggle button group
72
+
73
+ ### Buttons & Indicators
74
+
75
+ Interactive elements and status indicators:
76
+
77
+ - **Button** - Primary, outline, and text variants
78
+ - **Badge** - Status badges and labels
79
+ - **Icon** - Icon component (from `@tociva/tailng-icons`)
80
+ - **Ripples** - Material-style ripple effect
81
+ - **Progress Bar** - Linear progress indicator
82
+ - **Progress Spinner** - Circular progress indicator
83
+ - **Skeleton** - Loading placeholder
84
+
85
+ ### Layout
86
+
87
+ Structural components for page layout:
88
+
89
+ - **Card** - Container with header, content, and footer
90
+ - **Divider** - Visual separator
91
+ - **Expansion Panel** - Collapsible content panel
92
+ - **Tabs** - Tabbed interface
93
+ - **Accordion** - Collapsible accordion list
94
+
95
+ ### Navigation
96
+
97
+ Components for app navigation:
98
+
99
+ - **Menu** - Context and dropdown menus
100
+ - **Sidenav** - Side navigation drawer
101
+ - **Drawer** - Slide-out drawer panel
102
+ - **Stepper** - Multi-step wizard
103
+ - **Paginator** - Pagination controls
104
+ - **Breadcrumbs** - Navigation breadcrumb trail
105
+
106
+ ### Popups & Overlays
107
+
108
+ Modal and overlay components:
109
+
110
+ - **Dialog** - Modal dialog
111
+ - **Snackbar** - Toast notifications
112
+ - **Tooltip** - Hover tooltips
113
+ - **Popover** - Contextual popover
114
+
115
+ ### Data Table & Structure
116
+
117
+ Data display components:
118
+
119
+ - **Table** - Data table with sorting and filtering
120
+ - **Sort Header** - Sortable table columns
121
+ - **Filter Header** - Filterable table columns
122
+ - **Tree** - Hierarchical tree view
123
+ - **Virtual Scroll** - Efficient scrolling for large lists
124
+ - **Empty State** - Empty state placeholder
125
+
126
+ ### Utilities
127
+
128
+ Helper components:
129
+
130
+ - **Code Block** - Syntax-highlighted code display
131
+ - **Copy Button** - Copy-to-clipboard button
132
+
133
+ ## Usage Examples
134
+
135
+ ### Button
136
+
137
+ ```typescript
138
+ import { TailngButtonComponent } from '@tociva/tailng-ui';
139
+
140
+ @Component({
141
+ template: `
142
+ <tng-button variant="primary">Primary</tng-button>
143
+ <tng-button variant="outline">Outline</tng-button>
144
+ <tng-button variant="text">Text</tng-button>
145
+ `,
146
+ imports: [TailngButtonComponent],
147
+ })
148
+ export class MyComponent {}
149
+ ```
150
+
151
+ ### Form Input
152
+
153
+ ```typescript
154
+ import { TailngTextInputComponent } from '@tociva/tailng-ui';
155
+ import { FormControl, ReactiveFormsModule } from '@angular/forms';
156
+
157
+ @Component({
158
+ template: `
159
+ <tng-text-input
160
+ [formControl]="email"
161
+ type="email"
162
+ placeholder="Enter email"
163
+ />
164
+ `,
165
+ imports: [TailngTextInputComponent, ReactiveFormsModule],
166
+ })
167
+ export class MyComponent {
168
+ email = new FormControl('');
169
+ }
170
+ ```
171
+
172
+ ### Dialog
173
+
174
+ ```typescript
175
+ import { TailngDialogComponent } from '@tociva/tailng-ui';
176
+
177
+ @Component({
178
+ template: `
179
+ <tng-dialog>
180
+ <div tngDialogHeader>
181
+ <h2>Confirm Action</h2>
182
+ </div>
183
+ <div tngDialogContent>
184
+ Are you sure you want to proceed?
185
+ </div>
186
+ <div tngDialogFooter>
187
+ <tng-button (click)="close()">Cancel</tng-button>
188
+ <tng-button variant="primary" (click)="confirm()">Confirm</tng-button>
189
+ </div>
190
+ </tng-dialog>
191
+ `,
192
+ imports: [TailngDialogComponent, TailngButtonComponent],
193
+ })
194
+ export class MyComponent {}
195
+ ```
196
+
197
+ ## Theming
198
+
199
+ Components support theming via CSS variables:
200
+
201
+ ```css
202
+ :root {
203
+ --color-primary: #2563eb;
204
+ --radius: 0.25rem;
205
+ --surface: #ffffff;
206
+ --surface-2: #f8fafc;
207
+ }
208
+ ```
209
+
210
+ See [`@tociva/tailng-theme`](../theme/README.md) for the complete theming guide.
211
+
212
+ ## "klass signal" Pattern
213
+
214
+ Many components expose a `klass` signal that composes Tailwind classes from inputs and state:
215
+
216
+ ```typescript
217
+ @Component({
218
+ template: `<button [class]="klass()">Click me</button>`,
219
+ })
220
+ export class MyButton {
221
+ variant = input<'primary' | 'outline'>('primary');
222
+
223
+ klass = computed(() => {
224
+ const base = 'px-3 py-2 rounded-md';
225
+ const primary = 'bg-blue-500 text-white';
226
+ const outline = 'border border-gray-300';
227
+
228
+ return [base, this.variant() === 'primary' ? primary : outline].join(' ');
229
+ });
230
+ }
231
+ ```
232
+
233
+ ## Related Packages
234
+
235
+ - [`@tociva/tailng-cdk`](../cdk/README.md) - Component development kit (required)
236
+ - [`@tociva/tailng-icons`](../icons/README.md) - Icon components
237
+ - [`@tociva/tailng-theme`](../theme/README.md) - Tailwind CSS theme preset
238
+
239
+ ## Documentation
240
+
241
+ - [Component Documentation](https://tailng.dev) - Full component docs and examples
242
+ - [GitHub Repository](https://github.com/tociva/tailng) - Source code and issues
243
+
244
+ ## License
245
+
246
+ MIT
package/package.json CHANGED
@@ -1,14 +1,23 @@
1
1
  {
2
2
  "name": "@tociva/tailng-ui",
3
- "version": "0.1.0",
3
+ "version": "0.6.0",
4
4
  "description": "Modern Angular UI components powered by Tailwind CSS",
5
5
  "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/tociva/tailng.git"
9
+ },
10
+ "homepage": "https://github.com/tociva/tailng",
11
+ "bugs": {
12
+ "url": "https://github.com/tociva/tailng/issues"
13
+ },
6
14
  "sideEffects": false,
7
15
  "peerDependencies": {
8
16
  "@angular/core": "^21.0.0",
9
17
  "@angular/common": "^21.0.0",
10
18
  "@angular/forms": "^21.0.0",
11
- "@tociva/tailng-cdk": "^0.1.0"
19
+ "@tociva/tailng-cdk": "^0.6.0",
20
+ "dayjs": "^1.11.19"
12
21
  },
13
22
  "dependencies": {
14
23
  "tslib": "^2.6.0"
@@ -84,13 +84,13 @@ declare class TailngOptionListComponent<T> {
84
84
  private emitKeyStroke;
85
85
  private computeNextIndex;
86
86
  /**
87
- * Controlled activeIndex
87
+ * Controlled activeIndex
88
88
  * - Emit activeIndexChange (parent owns state)
89
89
  * - Scrolling is handled by the effect() reacting to activeIndex()
90
90
  */
91
91
  private commitActive;
92
92
  /**
93
- * Scroll the active option into view.
93
+ * Scroll the active option into view.
94
94
  * Let the browser pick the nearest scrollable ancestor.
95
95
  */
96
96
  private scrollIndexIntoView;
@@ -1092,7 +1092,7 @@ declare class TailngDividerComponent {
1092
1092
  labelKlass: _angular_core.InputSignal<string>;
1093
1093
  gapKlass: _angular_core.InputSignal<string>;
1094
1094
  thicknessKlass: _angular_core.InputSignal<string>;
1095
- /** NEW: vertical height that does NOT depend on parent height */
1095
+ /** NEW: vertical height that does NOT depend on parent height */
1096
1096
  verticalHeightKlass: _angular_core.InputSignal<string>;
1097
1097
  readonly isVertical: _angular_core.Signal<boolean>;
1098
1098
  readonly rootClasses: _angular_core.Signal<string>;
@@ -1758,7 +1758,7 @@ declare class TailngTableComponent<T extends Record<string, any> = any> implemen
1758
1758
  readonly sortChange: EventEmitter<TailngSort>;
1759
1759
  readonly rows: _angular_core.InputSignal<T[]>;
1760
1760
  readonly rowKey: _angular_core.InputSignal<string | null>;
1761
- /** Default: client (static) sort */
1761
+ /** Default: client (static) sort */
1762
1762
  readonly sortMode: _angular_core.InputSignal<"server" | "client">;
1763
1763
  /** styling */
1764
1764
  readonly tableKlass: _angular_core.InputSignal<string>;