@exhaustive-ui/mcp 0.0.0-stage → 22.0.0-alpha.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.
Files changed (121) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +167 -2
  3. package/data/components/accordion.md +421 -0
  4. package/data/components/animateonscroll.md +163 -0
  5. package/data/components/autocomplete.md +1077 -0
  6. package/data/components/autofocus.md +38 -0
  7. package/data/components/avatar.md +417 -0
  8. package/data/components/badge.md +234 -0
  9. package/data/components/blockui.md +108 -0
  10. package/data/components/breadcrumb.md +178 -0
  11. package/data/components/button.md +774 -0
  12. package/data/components/card.md +138 -0
  13. package/data/components/carousel.md +440 -0
  14. package/data/components/cascadeselect.md +1387 -0
  15. package/data/components/chart.md +1178 -0
  16. package/data/components/checkbox.md +529 -0
  17. package/data/components/chip.md +180 -0
  18. package/data/components/colorpicker.md +301 -0
  19. package/data/components/confirmdialog.md +287 -0
  20. package/data/components/confirmpopup.md +417 -0
  21. package/data/components/contextmenu.md +491 -0
  22. package/data/components/dataview.md +600 -0
  23. package/data/components/datepicker.md +1262 -0
  24. package/data/components/dialog.md +622 -0
  25. package/data/components/divider.md +250 -0
  26. package/data/components/dock.md +500 -0
  27. package/data/components/dragdrop.md +285 -0
  28. package/data/components/drawer.md +510 -0
  29. package/data/components/dynamicdialog.md +109 -0
  30. package/data/components/editor.md +291 -0
  31. package/data/components/fieldset.md +182 -0
  32. package/data/components/fileupload.md +430 -0
  33. package/data/components/floatlabel.md +155 -0
  34. package/data/components/fluid.md +72 -0
  35. package/data/components/focustrap.md +65 -0
  36. package/data/components/galleria.md +627 -0
  37. package/data/components/iconfield.md +246 -0
  38. package/data/components/iftalabel.md +105 -0
  39. package/data/components/imagecompare.md +97 -0
  40. package/data/components/inplace.md +233 -0
  41. package/data/components/inputgroup.md +306 -0
  42. package/data/components/inputmask.md +518 -0
  43. package/data/components/inputnumber.md +675 -0
  44. package/data/components/inputotp.md +336 -0
  45. package/data/components/inputtext.md +488 -0
  46. package/data/components/keyfilter.md +85 -0
  47. package/data/components/knob.md +462 -0
  48. package/data/components/listbox.md +798 -0
  49. package/data/components/llms.md +28 -0
  50. package/data/components/megamenu.md +587 -0
  51. package/data/components/menu.md +483 -0
  52. package/data/components/menubar.md +462 -0
  53. package/data/components/message.md +449 -0
  54. package/data/components/metergroup.md +241 -0
  55. package/data/components/multiselect.md +1047 -0
  56. package/data/components/orderlist.md +342 -0
  57. package/data/components/organizationchart.md +197 -0
  58. package/data/components/overlay.md +217 -0
  59. package/data/components/paginator.md +314 -0
  60. package/data/components/panel.md +214 -0
  61. package/data/components/panelmenu.md +699 -0
  62. package/data/components/password.md +570 -0
  63. package/data/components/picklist.md +420 -0
  64. package/data/components/popover.md +378 -0
  65. package/data/components/progressbar.md +181 -0
  66. package/data/components/progressspinner.md +91 -0
  67. package/data/components/radiobutton.md +377 -0
  68. package/data/components/rating.md +312 -0
  69. package/data/components/ripple.md +89 -0
  70. package/data/components/scroller.md +122 -0
  71. package/data/components/scrollpanel.md +149 -0
  72. package/data/components/scrolltop.md +105 -0
  73. package/data/components/select.md +1206 -0
  74. package/data/components/selectbutton.md +356 -0
  75. package/data/components/skeleton.md +242 -0
  76. package/data/components/slider.md +337 -0
  77. package/data/components/speeddial.md +589 -0
  78. package/data/components/splitbutton.md +945 -0
  79. package/data/components/splitter.md +196 -0
  80. package/data/components/stepper.md +411 -0
  81. package/data/components/styleclass.md +126 -0
  82. package/data/components/table.md +4557 -0
  83. package/data/components/tabs.md +467 -0
  84. package/data/components/tag.md +200 -0
  85. package/data/components/terminal.md +118 -0
  86. package/data/components/textarea.md +416 -0
  87. package/data/components/tieredmenu.md +578 -0
  88. package/data/components/timeline.md +310 -0
  89. package/data/components/toast.md +596 -0
  90. package/data/components/togglebutton.md +356 -0
  91. package/data/components/toggleswitch.md +285 -0
  92. package/data/components/toolbar.md +182 -0
  93. package/data/components/tooltip.md +211 -0
  94. package/data/components/tree.md +746 -0
  95. package/data/components/treeselect.md +912 -0
  96. package/data/components/treetable.md +2814 -0
  97. package/data/components.json +43751 -0
  98. package/data/llms-full.txt +47433 -0
  99. package/data/llms.txt +121 -0
  100. package/data/manifest.json +46513 -0
  101. package/data/pages/accessibility.md +28 -0
  102. package/data/pages/animations.md +28 -0
  103. package/data/pages/configuration.md +210 -0
  104. package/data/pages/contribution.md +20 -0
  105. package/data/pages/customicons.md +20 -0
  106. package/data/pages/faq.md +20 -0
  107. package/data/pages/icons.md +66 -0
  108. package/data/pages/installation.md +71 -0
  109. package/data/pages/llms.md +61 -0
  110. package/data/pages/passthrough.md +32 -0
  111. package/data/pages/philosophy.md +28 -0
  112. package/data/pages/primeflex.md +20 -0
  113. package/data/pages/rtl.md +12 -0
  114. package/data/pages/styled.md +132 -0
  115. package/data/pages/tailwind.md +40 -0
  116. package/data/pages/unstyled.md +39 -0
  117. package/data/snapshot.json +9 -0
  118. package/dist/index.d.mts +448 -0
  119. package/dist/index.mjs +2501 -0
  120. package/dist/index.mjs.map +1 -0
  121. package/package.json +67 -3
@@ -0,0 +1,462 @@
1
+ # Angular Knob Component
2
+
3
+ Knob is a form component to define number inputs with a dial.
4
+
5
+ ## Accessibility
6
+
7
+ Screen Reader Knob element component uses slider role in addition to the aria-valuemin , aria-valuemax and aria-valuenow attributes. Value to describe the component can be defined using ariaLabelledBy and ariaLabel props.
8
+
9
+ ## Basic
10
+
11
+ Knob is an input component and used with the standard ngModel directive.
12
+
13
+ ```typescript
14
+ import { Component } from '@angular/core';
15
+ import { FormsModule } from '@angular/forms';
16
+ import { KnobModule } from '@exhaustive-ui/core/knob';
17
+
18
+ @Component({
19
+ template: `
20
+ <div class="card flex justify-center">
21
+ <p-knob [(ngModel)]="value" />
22
+ </div>
23
+ `,
24
+ standalone: true,
25
+ imports: [KnobModule, FormsModule]
26
+ })
27
+ export class KnobBasicDemo {
28
+ value!: number;
29
+ }
30
+ ```
31
+
32
+ ## Color
33
+
34
+ Colors are customized with the textColor , rangeColor and valueColor properties.
35
+
36
+ ```typescript
37
+ import { Component } from '@angular/core';
38
+ import { FormsModule } from '@angular/forms';
39
+ import { KnobModule } from '@exhaustive-ui/core/knob';
40
+
41
+ @Component({
42
+ template: `
43
+ <div class="card flex justify-center">
44
+ <p-knob [(ngModel)]="value" valueColor="SlateGray" rangeColor="MediumTurquoise" />
45
+ </div>
46
+ `,
47
+ standalone: true,
48
+ imports: [KnobModule, FormsModule]
49
+ })
50
+ export class KnobColorDemo {
51
+ value: number = 50;
52
+ }
53
+ ```
54
+
55
+ ## Disabled
56
+
57
+ When disabled is present, a visual hint is applied to indicate that the Knob cannot be interacted with.
58
+
59
+ ```typescript
60
+ import { Component } from '@angular/core';
61
+ import { FormsModule } from '@angular/forms';
62
+ import { KnobModule } from '@exhaustive-ui/core/knob';
63
+
64
+ @Component({
65
+ template: `
66
+ <div class="card flex justify-center">
67
+ <p-knob [(ngModel)]="value" [disabled]="true" />
68
+ </div>
69
+ `,
70
+ standalone: true,
71
+ imports: [KnobModule, FormsModule]
72
+ })
73
+ export class KnobDisabledDemo {
74
+ value: number = 75;
75
+ }
76
+ ```
77
+
78
+ ## Min/Max
79
+
80
+ Boundaries are configured with the min and max properties whose defaults are 0 and 100 respectively.
81
+
82
+ ```typescript
83
+ import { Component } from '@angular/core';
84
+ import { FormsModule } from '@angular/forms';
85
+ import { KnobModule } from '@exhaustive-ui/core/knob';
86
+
87
+ @Component({
88
+ template: `
89
+ <div class="card flex justify-center">
90
+ <p-knob [(ngModel)]="value" [min]="-50" [max]="50" />
91
+ </div>
92
+ `,
93
+ standalone: true,
94
+ imports: [KnobModule, FormsModule]
95
+ })
96
+ export class KnobMinmaxDemo {
97
+ value: number = 10;
98
+ }
99
+ ```
100
+
101
+ ## Reactive
102
+
103
+ Knob can be controlled with custom controls as well.
104
+
105
+ ```typescript
106
+ import { Component } from '@angular/core';
107
+ import { FormsModule } from '@angular/forms';
108
+ import { ButtonModule } from '@exhaustive-ui/core/button';
109
+ import { KnobModule } from '@exhaustive-ui/core/knob';
110
+
111
+ @Component({
112
+ template: `
113
+ <div class="card flex flex-col items-center gap-2">
114
+ <p-knob [(ngModel)]="value" size="150" readonly="true" />
115
+ <div class="flex gap-2">
116
+ <p-button icon="pi pi-plus" (click)="value = value + 1" [disabled]="value >= 100" />
117
+ <p-button icon="pi pi-minus" (click)="value = value - 1" [disabled]="value <= 0" />
118
+ </div>
119
+ </div>
120
+ `,
121
+ standalone: true,
122
+ imports: [ButtonModule, KnobModule, FormsModule]
123
+ })
124
+ export class KnobReactiveDemo {
125
+ value: number = 0;
126
+ }
127
+ ```
128
+
129
+ ## Reactive Forms
130
+
131
+ Knob can also be used with reactive forms. In this case, the formControlName property is used to bind the component to a form control.
132
+
133
+ ```typescript
134
+ import { Component, inject } from '@angular/core';
135
+ import { ReactiveFormsModule } from '@angular/forms';
136
+ import { KnobModule } from '@exhaustive-ui/core/knob';
137
+ import { MessageModule } from '@exhaustive-ui/core/message';
138
+ import { ToastModule } from '@exhaustive-ui/core/toast';
139
+ import { ButtonModule } from '@exhaustive-ui/core/button';
140
+ import { MessageService } from '@exhaustive-ui/core/api';
141
+
142
+ @Component({
143
+ template: `
144
+ <p-toast />
145
+ <div class="card flex justify-center">
146
+ <form [formGroup]="exampleForm" (ngSubmit)="onSubmit()" class="flex flex-col items-center gap-4">
147
+ <div class="flex flex-col items-center gap-1">
148
+ <p-knob formControlName="value" [invalid]="isInvalid('value')" />
149
+ @if (isInvalid('value')) {
150
+ <p-message severity="error" size="small" variant="simple">{{ getErrorMessage('value') }}</p-message>
151
+ }
152
+ </div>
153
+ <button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
154
+ </form>
155
+ </div>
156
+ `,
157
+ standalone: true,
158
+ imports: [KnobModule, MessageModule, ToastModule, ButtonModule, ReactiveFormsModule]
159
+ })
160
+ export class KnobReactiveformsDemo {
161
+ messageService = inject(MessageService);
162
+ items: any[] | undefined;
163
+ exampleForm: FormGroup | undefined;
164
+ formSubmitted: boolean = false;
165
+
166
+ constructor() {
167
+ this.exampleForm = this.fb.group({
168
+ value: [15, [Validators.min(25), Validators.max(75)]]
169
+ });
170
+ }
171
+
172
+ onSubmit() {
173
+ this.formSubmitted = true;
174
+ if (this.exampleForm.valid) {
175
+ this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
176
+ this.exampleForm.reset({
177
+ value: 15
178
+ });
179
+ this.formSubmitted = false;
180
+ }
181
+ }
182
+
183
+ getControl(controlName: string): AbstractControl | null {
184
+ return this.exampleForm?.get(controlName) ?? null;
185
+ }
186
+
187
+ getErrorMessage(controlName: string): string | null {
188
+ const control = this.getControl(controlName);
189
+ if (!control || !control.errors) return null;
190
+
191
+ if (control.errors['min']) {
192
+ return 'Value must be greater than 15.';
193
+ }
194
+
195
+ if (control.errors['max']) {
196
+ return 'Must be less than 75.';
197
+ }
198
+ }
199
+
200
+ isInvalid(controlName: string) {
201
+ const control = this.getControl(controlName);
202
+ return control?.invalid && (control.dirty || this.formSubmitted);
203
+ }
204
+ }
205
+ ```
206
+
207
+ ## ReadOnly
208
+
209
+ When readonly present, value cannot be edited.
210
+
211
+ ```typescript
212
+ import { Component } from '@angular/core';
213
+ import { FormsModule } from '@angular/forms';
214
+ import { KnobModule } from '@exhaustive-ui/core/knob';
215
+
216
+ @Component({
217
+ template: `
218
+ <div class="card flex justify-center">
219
+ <p-knob [(ngModel)]="value" [readonly]="true" />
220
+ </div>
221
+ `,
222
+ standalone: true,
223
+ imports: [KnobModule, FormsModule]
224
+ })
225
+ export class KnobReadonlyDemo {
226
+ value: number = 50;
227
+ }
228
+ ```
229
+
230
+ ## Size
231
+
232
+ Diameter of the knob is defined in pixels using the size property.
233
+
234
+ ```typescript
235
+ import { Component } from '@angular/core';
236
+ import { FormsModule } from '@angular/forms';
237
+ import { KnobModule } from '@exhaustive-ui/core/knob';
238
+
239
+ @Component({
240
+ template: `
241
+ <div class="card flex justify-center">
242
+ <p-knob [(ngModel)]="value" [size]="200" />
243
+ </div>
244
+ `,
245
+ standalone: true,
246
+ imports: [KnobModule, FormsModule]
247
+ })
248
+ export class KnobSizeDemo {
249
+ value: number = 60;
250
+ }
251
+ ```
252
+
253
+ ## Step
254
+
255
+ Size of each movement is defined with the step property.
256
+
257
+ ```typescript
258
+ import { Component } from '@angular/core';
259
+ import { FormsModule } from '@angular/forms';
260
+ import { KnobModule } from '@exhaustive-ui/core/knob';
261
+
262
+ @Component({
263
+ template: `
264
+ <div class="card flex justify-center">
265
+ <p-knob [(ngModel)]="value" [step]="10" />
266
+ </div>
267
+ `,
268
+ standalone: true,
269
+ imports: [KnobModule, FormsModule]
270
+ })
271
+ export class KnobStepDemo {
272
+ value!: number;
273
+ }
274
+ ```
275
+
276
+ ## Stroke
277
+
278
+ The border size is specified with the strokeWidth property as a number in pixels.
279
+
280
+ ```typescript
281
+ import { Component } from '@angular/core';
282
+ import { FormsModule } from '@angular/forms';
283
+ import { KnobModule } from '@exhaustive-ui/core/knob';
284
+
285
+ @Component({
286
+ template: `
287
+ <div class="card flex justify-center">
288
+ <p-knob [(ngModel)]="value" [strokeWidth]="5" />
289
+ </div>
290
+ `,
291
+ standalone: true,
292
+ imports: [KnobModule, FormsModule]
293
+ })
294
+ export class KnobStrokeDemo {
295
+ value: number = 40;
296
+ }
297
+ ```
298
+
299
+ ## Template
300
+
301
+ Label is a string template that can be customized with the valueTemplate property having 60 as the placeholder .
302
+
303
+ ```typescript
304
+ import { Component } from '@angular/core';
305
+ import { FormsModule } from '@angular/forms';
306
+ import { KnobModule } from '@exhaustive-ui/core/knob';
307
+
308
+ @Component({
309
+ template: `
310
+ <div class="card flex justify-center">
311
+ <p-knob [(ngModel)]="value" valueTemplate="{value}%" />
312
+ </div>
313
+ `,
314
+ standalone: true,
315
+ imports: [KnobModule, FormsModule]
316
+ })
317
+ export class KnobTemplateDemo {
318
+ value: number = 60;
319
+ }
320
+ ```
321
+
322
+ ## templatedrivenforms-doc
323
+
324
+ ```typescript
325
+ import { Component, inject } from '@angular/core';
326
+ import { FormsModule } from '@angular/forms';
327
+ import { KnobModule } from '@exhaustive-ui/core/knob';
328
+ import { MessageModule } from '@exhaustive-ui/core/message';
329
+ import { ToastModule } from '@exhaustive-ui/core/toast';
330
+ import { ButtonModule } from '@exhaustive-ui/core/button';
331
+ import { MessageService } from '@exhaustive-ui/core/api';
332
+
333
+ @Component({
334
+ template: `
335
+ <p-toast />
336
+ <div class="card flex justify-center">
337
+ <form #exampleForm="ngForm" (ngSubmit)="onSubmit(exampleForm)" class="flex flex-col items-center gap-4">
338
+ <div class="flex flex-col items-center gap-1">
339
+ <p-knob #model="ngModel" [(ngModel)]="value" [invalid]="isInvalid(model)" name="knob" />
340
+ @if (isInvalid(model)) {
341
+ <p-message severity="error" size="small" variant="simple">{{ getErrorMessage(model) }}</p-message>
342
+ }
343
+ </div>
344
+ <button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
345
+ </form>
346
+ </div>
347
+ `,
348
+ standalone: true,
349
+ imports: [KnobModule, MessageModule, ToastModule, ButtonModule, FormsModule]
350
+ })
351
+ export class KnobTemplatedrivenformsDemo {
352
+ messageService = inject(MessageService);
353
+ value: number = 15;
354
+ formSubmitted: boolean = false;
355
+
356
+ onSubmit(form: NgForm) {
357
+ this.formSubmitted = true;
358
+
359
+ if (!this.isInvalid(form.controls['knob'])) {
360
+ this.messageService.add({
361
+ severity: 'success',
362
+ summary: 'Success',
363
+ detail: 'Form is submitted',
364
+ life: 3000
365
+ });
366
+
367
+ form.resetForm({ knob: 15 });
368
+
369
+ this.formSubmitted = false;
370
+ }
371
+ }
372
+
373
+ getErrorMessage(control: any): string | null {
374
+ const value = control?.value;
375
+
376
+ return value < 25 ? 'Value must be greater than 25.' : value > 75 ? 'Must be less than 75.' : null;
377
+ }
378
+
379
+ isInvalid(control: any): boolean {
380
+ if (!control) return false;
381
+
382
+ const value = control.value;
383
+
384
+ const hasError = value < 25 || value > 75;
385
+
386
+ return hasError && (this.formSubmitted || control.dirty);
387
+ }
388
+ }
389
+ ```
390
+
391
+ ## Knob
392
+
393
+ Knob is a form component to define number inputs with a dial.
394
+
395
+ ### Props
396
+
397
+ | Name | Type | Default | Description |
398
+ |------|------|---------|-------------|
399
+ | dt | InputSignal<Object> | undefined | Defines scoped design tokens of the component. |
400
+ | unstyled | InputSignal<boolean> | undefined | Indicates whether the component should be rendered without styles. |
401
+ | pt | InputSignal<KnobPassThrough> | undefined | Used to pass attributes to DOM elements inside the component. |
402
+ | ptOptions | InputSignal<PassThroughOptions> | undefined | Used to configure passthrough(pt) options of the component. |
403
+ | required | InputSignalWithTransform<boolean, unknown> | false | There must be a value (if set). |
404
+ | invalid | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have invalid state style. |
405
+ | disabled | InputSignalWithTransform<boolean, unknown> | false | When present, it specifies that the component should have disabled state style. |
406
+ | name | InputSignal<string> | undefined | When present, it specifies that the name of the input. |
407
+ | ariaLabel | InputSignal<string> | ... | Defines a string that labels the input for accessibility. |
408
+ | ariaLabelledBy | InputSignal<string> | ... | Specifies one or more IDs in the DOM that labels the input field. |
409
+ | tabindex | InputSignalWithTransform<number, unknown> | ... | Index of the element in tabbing order. |
410
+ | valueColor | InputSignal<string> | ... | Background of the value. |
411
+ | rangeColor | InputSignal<string> | ... | Background color of the range. |
412
+ | textColor | InputSignal<string> | ... | Color of the value text. |
413
+ | valueTemplate | InputSignal<string> | ... | Template string of the value. |
414
+ | size | InputSignalWithTransform<number, unknown> | ... | Size of the component in pixels. |
415
+ | min | InputSignalWithTransform<number, unknown> | ... | Mininum boundary value. |
416
+ | max | InputSignalWithTransform<number, unknown> | ... | Maximum boundary value. |
417
+ | step | InputSignalWithTransform<number, unknown> | ... | Step factor to increment/decrement the value. |
418
+ | strokeWidth | InputSignalWithTransform<number, unknown> | ... | Width of the knob stroke. |
419
+ | showValue | InputSignalWithTransform<boolean, unknown> | ... | Whether the show the value inside the knob. |
420
+ | readonly | InputSignalWithTransform<boolean, unknown> | ... | When present, it specifies that the component value cannot be edited. |
421
+
422
+ ### Emits
423
+
424
+ | Name | Parameters | Description |
425
+ |------|------------|-------------|
426
+ | onChange | value: number | Callback to invoke on value change. |
427
+
428
+ ## Pass Through Options
429
+
430
+ | Name | Type | Description |
431
+ |------|------|-------------|
432
+ | host | PassThroughOption<HTMLElement, I> | Used to pass attributes to the host's DOM element. |
433
+ | svg | PassThroughOption<SVGElement, I> | Used to pass attributes to the SVG's DOM element. |
434
+ | range | PassThroughOption<SVGPathElement, I> | Used to pass attributes to the range's DOM element. |
435
+ | value | PassThroughOption<SVGPathElement, I> | Used to pass attributes to the value's DOM element. |
436
+ | text | PassThroughOption<SVGTextElement, I> | Used to pass attributes to the text's DOM element. |
437
+
438
+ ## Theming
439
+
440
+ ### CSS Classes
441
+
442
+ | Class | Description |
443
+ |-------|-------------|
444
+ | p-knob | Class name of the root element |
445
+ | p-knob-range | Class name of the range element |
446
+ | p-knob-value | Class name of the value element |
447
+ | p-knob-text | Class name of the text element |
448
+
449
+ ### Design Tokens
450
+
451
+ | Token | CSS Variable | Description |
452
+ |-------|--------------|-------------|
453
+ | knob.transition.duration | --p-knob-transition-duration | Transition duration of root |
454
+ | knob.focus.ring.width | --p-knob-focus-ring-width | Focus ring width of root |
455
+ | knob.focus.ring.style | --p-knob-focus-ring-style | Focus ring style of root |
456
+ | knob.focus.ring.color | --p-knob-focus-ring-color | Focus ring color of root |
457
+ | knob.focus.ring.offset | --p-knob-focus-ring-offset | Focus ring offset of root |
458
+ | knob.focus.ring.shadow | --p-knob-focus-ring-shadow | Focus ring shadow of root |
459
+ | knob.value.background | --p-knob-value-background | Background of value |
460
+ | knob.range.background | --p-knob-range-background | Background of range |
461
+ | knob.text.color | --p-knob-text-color | Color of text |
462
+