@ng-primitives/mcp 0.125.0 → 0.127.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/package.json
CHANGED
|
@@ -29,30 +29,6 @@
|
|
|
29
29
|
"inputs": [],
|
|
30
30
|
"outputs": []
|
|
31
31
|
},
|
|
32
|
-
"NgpAccordionItem": {
|
|
33
|
-
"name": "NgpAccordionItem",
|
|
34
|
-
"description": "Apply the `ngpAccordionItem` directive to an element that represents an accordion item.",
|
|
35
|
-
"selector": "[ngpAccordionItem]",
|
|
36
|
-
"exportAs": [
|
|
37
|
-
"ngpAccordionItem"
|
|
38
|
-
],
|
|
39
|
-
"inputs": [
|
|
40
|
-
{
|
|
41
|
-
"name": "ngpAccordionItemValue",
|
|
42
|
-
"type": "T",
|
|
43
|
-
"description": "The value of the accordion item.",
|
|
44
|
-
"isRequired": false
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"name": "ngpAccordionItemDisabled",
|
|
48
|
-
"type": "boolean",
|
|
49
|
-
"description": "Whether the accordion item is disabled.",
|
|
50
|
-
"isRequired": false,
|
|
51
|
-
"defaultValue": "false"
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
"outputs": []
|
|
55
|
-
},
|
|
56
32
|
"NgpAccordion": {
|
|
57
33
|
"name": "NgpAccordion",
|
|
58
34
|
"description": "Apply the `ngpAccordion` directive to an element that represents the group of accordion items.",
|
|
@@ -105,6 +81,30 @@
|
|
|
105
81
|
}
|
|
106
82
|
]
|
|
107
83
|
},
|
|
84
|
+
"NgpAccordionItem": {
|
|
85
|
+
"name": "NgpAccordionItem",
|
|
86
|
+
"description": "Apply the `ngpAccordionItem` directive to an element that represents an accordion item.",
|
|
87
|
+
"selector": "[ngpAccordionItem]",
|
|
88
|
+
"exportAs": [
|
|
89
|
+
"ngpAccordionItem"
|
|
90
|
+
],
|
|
91
|
+
"inputs": [
|
|
92
|
+
{
|
|
93
|
+
"name": "ngpAccordionItemValue",
|
|
94
|
+
"type": "T",
|
|
95
|
+
"description": "The value of the accordion item.",
|
|
96
|
+
"isRequired": false
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "ngpAccordionItemDisabled",
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"description": "Whether the accordion item is disabled.",
|
|
102
|
+
"isRequired": false,
|
|
103
|
+
"defaultValue": "false"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"outputs": []
|
|
107
|
+
},
|
|
108
108
|
"NgpThread": {
|
|
109
109
|
"name": "NgpThread",
|
|
110
110
|
"description": "",
|
|
@@ -430,6 +430,407 @@
|
|
|
430
430
|
}
|
|
431
431
|
]
|
|
432
432
|
},
|
|
433
|
+
"NgpCollapsibleTrigger": {
|
|
434
|
+
"name": "NgpCollapsibleTrigger",
|
|
435
|
+
"description": "Apply the `ngpCollapsibleTrigger` directive to an element - typically a\n`button` - that toggles the collapsible open and closed.",
|
|
436
|
+
"selector": "[ngpCollapsibleTrigger]",
|
|
437
|
+
"exportAs": [
|
|
438
|
+
"ngpCollapsibleTrigger"
|
|
439
|
+
],
|
|
440
|
+
"inputs": [],
|
|
441
|
+
"outputs": []
|
|
442
|
+
},
|
|
443
|
+
"NgpCollapsibleContent": {
|
|
444
|
+
"name": "NgpCollapsibleContent",
|
|
445
|
+
"description": "Apply the `ngpCollapsibleContent` directive to the element that contains the\ncollapsible content that is shown and hidden by the trigger.",
|
|
446
|
+
"selector": "[ngpCollapsibleContent]",
|
|
447
|
+
"exportAs": [
|
|
448
|
+
"ngpCollapsibleContent"
|
|
449
|
+
],
|
|
450
|
+
"inputs": [],
|
|
451
|
+
"outputs": []
|
|
452
|
+
},
|
|
453
|
+
"NgpCollapsible": {
|
|
454
|
+
"name": "NgpCollapsible",
|
|
455
|
+
"description": "Apply the `ngpCollapsible` directive to an element that contains a collapsible\ntrigger and content. It manages the open state of a single disclosure.",
|
|
456
|
+
"selector": "[ngpCollapsible]",
|
|
457
|
+
"exportAs": [
|
|
458
|
+
"ngpCollapsible"
|
|
459
|
+
],
|
|
460
|
+
"inputs": [
|
|
461
|
+
{
|
|
462
|
+
"name": "ngpCollapsibleOpen",
|
|
463
|
+
"type": "boolean | undefined",
|
|
464
|
+
"description": "Whether the collapsible is open. Leave unset for uncontrolled usage.",
|
|
465
|
+
"isRequired": false
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "ngpCollapsibleDefaultOpen",
|
|
469
|
+
"type": "boolean",
|
|
470
|
+
"description": "The default open state for uncontrolled usage.\n@default false",
|
|
471
|
+
"isRequired": false,
|
|
472
|
+
"defaultValue": "false"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"name": "ngpCollapsibleDisabled",
|
|
476
|
+
"type": "boolean",
|
|
477
|
+
"description": "Whether the collapsible is disabled.\n@default false",
|
|
478
|
+
"isRequired": false,
|
|
479
|
+
"defaultValue": "false"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"name": "ngpCollapsibleOrientation",
|
|
483
|
+
"type": "'horizontal' | 'vertical'",
|
|
484
|
+
"description": "The orientation of the collapsible.\n@default 'vertical'",
|
|
485
|
+
"isRequired": false,
|
|
486
|
+
"defaultValue": "'vertical'"
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
"outputs": [
|
|
490
|
+
{
|
|
491
|
+
"name": "ngpCollapsibleOpenChange",
|
|
492
|
+
"type": "boolean",
|
|
493
|
+
"description": "Emits when the open state changes."
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
"NgpColorAreaThumb": {
|
|
498
|
+
"name": "NgpColorAreaThumb",
|
|
499
|
+
"description": "Apply the `ngpColorAreaThumb` directive to the element that represents the color area thumb.",
|
|
500
|
+
"selector": "[ngpColorAreaThumb]",
|
|
501
|
+
"exportAs": [
|
|
502
|
+
"ngpColorAreaThumb"
|
|
503
|
+
],
|
|
504
|
+
"inputs": [],
|
|
505
|
+
"outputs": []
|
|
506
|
+
},
|
|
507
|
+
"NgpColorWheelThumb": {
|
|
508
|
+
"name": "NgpColorWheelThumb",
|
|
509
|
+
"description": "Apply the `ngpColorWheelThumb` directive to the element that represents the color wheel thumb.\nPosition it with the `--ngp-color-wheel-hue` custom property, e.g.\n`transform: translate(-50%, -50%) rotate(var(--ngp-color-wheel-hue)) translateY(calc(-1 * <radius>))`.",
|
|
510
|
+
"selector": "[ngpColorWheelThumb]",
|
|
511
|
+
"exportAs": [
|
|
512
|
+
"ngpColorWheelThumb"
|
|
513
|
+
],
|
|
514
|
+
"inputs": [],
|
|
515
|
+
"outputs": []
|
|
516
|
+
},
|
|
517
|
+
"NgpColorSwatch": {
|
|
518
|
+
"name": "NgpColorSwatch",
|
|
519
|
+
"description": "Apply the `ngpColorSwatch` directive to an element to display a color preview. Set its background to\n`var(--ngp-color-swatch-color)`. Inside a color picker it shows the picker's value by default.",
|
|
520
|
+
"selector": "[ngpColorSwatch]",
|
|
521
|
+
"exportAs": [
|
|
522
|
+
"ngpColorSwatch"
|
|
523
|
+
],
|
|
524
|
+
"inputs": [
|
|
525
|
+
{
|
|
526
|
+
"name": "ngpColorSwatch",
|
|
527
|
+
"type": "Color | undefined",
|
|
528
|
+
"description": "The color to display. Falls back to the parent picker's value when omitted.",
|
|
529
|
+
"isRequired": false
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "ngpColorSwatchLabel",
|
|
533
|
+
"type": "string | undefined",
|
|
534
|
+
"description": "An accessible label. Defaults to the color's hex string.",
|
|
535
|
+
"isRequired": false
|
|
536
|
+
}
|
|
537
|
+
],
|
|
538
|
+
"outputs": []
|
|
539
|
+
},
|
|
540
|
+
"NgpColorSliderTrack": {
|
|
541
|
+
"name": "NgpColorSliderTrack",
|
|
542
|
+
"description": "Apply the `ngpColorSliderTrack` directive to the element that represents the color slider track.\nSet its background to `var(--ngp-color-slider-background)` to render the channel gradient.",
|
|
543
|
+
"selector": "[ngpColorSliderTrack]",
|
|
544
|
+
"exportAs": [
|
|
545
|
+
"ngpColorSliderTrack"
|
|
546
|
+
],
|
|
547
|
+
"inputs": [],
|
|
548
|
+
"outputs": []
|
|
549
|
+
},
|
|
550
|
+
"NgpColorSliderThumb": {
|
|
551
|
+
"name": "NgpColorSliderThumb",
|
|
552
|
+
"description": "Apply the `ngpColorSliderThumb` directive to the element that represents the color slider thumb.",
|
|
553
|
+
"selector": "[ngpColorSliderThumb]",
|
|
554
|
+
"exportAs": [
|
|
555
|
+
"ngpColorSliderThumb"
|
|
556
|
+
],
|
|
557
|
+
"inputs": [],
|
|
558
|
+
"outputs": [
|
|
559
|
+
{
|
|
560
|
+
"name": "ngpColorSliderThumbDragStart",
|
|
561
|
+
"type": "void",
|
|
562
|
+
"description": "Emits when the thumb drag starts."
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"name": "ngpColorSliderThumbDragEnd",
|
|
566
|
+
"type": "void",
|
|
567
|
+
"description": "Emits when the thumb drag ends."
|
|
568
|
+
}
|
|
569
|
+
]
|
|
570
|
+
},
|
|
571
|
+
"NgpColorPicker": {
|
|
572
|
+
"name": "NgpColorPicker",
|
|
573
|
+
"description": "Apply the `ngpColorPicker` directive to a container that coordinates a single color value across\nchild color components. Child areas, sliders and fields bind to the picker's value automatically.",
|
|
574
|
+
"selector": "[ngpColorPicker]",
|
|
575
|
+
"exportAs": [
|
|
576
|
+
"ngpColorPicker"
|
|
577
|
+
],
|
|
578
|
+
"inputs": [
|
|
579
|
+
{
|
|
580
|
+
"name": "ngpColorPickerValue",
|
|
581
|
+
"type": "Color",
|
|
582
|
+
"description": "The color value.",
|
|
583
|
+
"isRequired": false
|
|
584
|
+
}
|
|
585
|
+
],
|
|
586
|
+
"outputs": [
|
|
587
|
+
{
|
|
588
|
+
"name": "ngpColorPickerValueChange",
|
|
589
|
+
"type": "Color",
|
|
590
|
+
"description": "Emits when the value changes."
|
|
591
|
+
}
|
|
592
|
+
]
|
|
593
|
+
},
|
|
594
|
+
"NgpColorSwatchPickerItem": {
|
|
595
|
+
"name": "NgpColorSwatchPickerItem",
|
|
596
|
+
"description": "Apply the `ngpColorSwatchPickerItem` directive to a selectable swatch within a swatch picker. Set its\nbackground to `var(--ngp-color-swatch-color)`. It composes a roving focus item.",
|
|
597
|
+
"selector": "[ngpColorSwatchPickerItem]",
|
|
598
|
+
"exportAs": [
|
|
599
|
+
"ngpColorSwatchPickerItem"
|
|
600
|
+
],
|
|
601
|
+
"inputs": [
|
|
602
|
+
{
|
|
603
|
+
"name": "ngpColorSwatchPickerItem",
|
|
604
|
+
"type": "Color",
|
|
605
|
+
"description": "The color this swatch represents.",
|
|
606
|
+
"isRequired": false
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"name": "ngpColorSwatchPickerItemDisabled",
|
|
610
|
+
"type": "boolean",
|
|
611
|
+
"description": "Whether the swatch is disabled.",
|
|
612
|
+
"isRequired": false,
|
|
613
|
+
"defaultValue": "false"
|
|
614
|
+
}
|
|
615
|
+
],
|
|
616
|
+
"outputs": []
|
|
617
|
+
},
|
|
618
|
+
"NgpColorWheel": {
|
|
619
|
+
"name": "NgpColorWheel",
|
|
620
|
+
"description": "Apply the `ngpColorWheel` directive to a circular element that adjusts the hue channel of a color.\nSet its background to `var(--ngp-color-wheel-background)` and contain a thumb.",
|
|
621
|
+
"selector": "[ngpColorWheel]",
|
|
622
|
+
"exportAs": [
|
|
623
|
+
"ngpColorWheel"
|
|
624
|
+
],
|
|
625
|
+
"inputs": [
|
|
626
|
+
{
|
|
627
|
+
"name": "ngpColorWheelValue",
|
|
628
|
+
"type": "Color",
|
|
629
|
+
"description": "The color value.",
|
|
630
|
+
"isRequired": false
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"name": "ngpColorWheelColorSpace",
|
|
634
|
+
"type": "'rgb' | 'hsl' | 'hsb'",
|
|
635
|
+
"description": "The color space to operate in.",
|
|
636
|
+
"isRequired": false,
|
|
637
|
+
"defaultValue": "'hsl'"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"name": "ngpColorWheelDisabled",
|
|
641
|
+
"type": "boolean",
|
|
642
|
+
"description": "The disabled state of the wheel.",
|
|
643
|
+
"isRequired": false,
|
|
644
|
+
"defaultValue": "false"
|
|
645
|
+
}
|
|
646
|
+
],
|
|
647
|
+
"outputs": [
|
|
648
|
+
{
|
|
649
|
+
"name": "ngpColorWheelValueChange",
|
|
650
|
+
"type": "Color",
|
|
651
|
+
"description": "Emits when the value changes."
|
|
652
|
+
}
|
|
653
|
+
]
|
|
654
|
+
},
|
|
655
|
+
"NgpColorArea": {
|
|
656
|
+
"name": "NgpColorArea",
|
|
657
|
+
"description": "Apply the `ngpColorArea` directive to a 2D surface that adjusts two channels of a color value.\nThe surface should set its background to `var(--ngp-color-area-background)` and contain a thumb.",
|
|
658
|
+
"selector": "[ngpColorArea]",
|
|
659
|
+
"exportAs": [
|
|
660
|
+
"ngpColorArea"
|
|
661
|
+
],
|
|
662
|
+
"inputs": [
|
|
663
|
+
{
|
|
664
|
+
"name": "ngpColorAreaValue",
|
|
665
|
+
"type": "Color",
|
|
666
|
+
"description": "The color value.",
|
|
667
|
+
"isRequired": false
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"name": "ngpColorAreaXChannel",
|
|
671
|
+
"type": "'red' | 'green' | 'blue' | 'hue' | 'saturation' | 'lightness' | 'brightness' | 'alpha'",
|
|
672
|
+
"description": "The channel mapped to the horizontal axis.",
|
|
673
|
+
"isRequired": false,
|
|
674
|
+
"defaultValue": "'saturation'"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"name": "ngpColorAreaYChannel",
|
|
678
|
+
"type": "'red' | 'green' | 'blue' | 'hue' | 'saturation' | 'lightness' | 'brightness' | 'alpha'",
|
|
679
|
+
"description": "The channel mapped to the vertical axis.",
|
|
680
|
+
"isRequired": false,
|
|
681
|
+
"defaultValue": "'brightness'"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "ngpColorAreaColorSpace",
|
|
685
|
+
"type": "ColorSpace | undefined",
|
|
686
|
+
"description": "The color space to operate in. Resolved from the channels/value when not set.",
|
|
687
|
+
"isRequired": false
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"name": "ngpColorAreaDisabled",
|
|
691
|
+
"type": "boolean",
|
|
692
|
+
"description": "The disabled state of the area.",
|
|
693
|
+
"isRequired": false,
|
|
694
|
+
"defaultValue": "false"
|
|
695
|
+
}
|
|
696
|
+
],
|
|
697
|
+
"outputs": [
|
|
698
|
+
{
|
|
699
|
+
"name": "ngpColorAreaValueChange",
|
|
700
|
+
"type": "Color",
|
|
701
|
+
"description": "Emits when the value changes."
|
|
702
|
+
}
|
|
703
|
+
]
|
|
704
|
+
},
|
|
705
|
+
"NgpColorField": {
|
|
706
|
+
"name": "NgpColorField",
|
|
707
|
+
"description": "Apply the `ngpColorField` directive to an `input` element to edit a color. Without a channel it\nedits the whole color as a hex string; with a channel it edits that single channel as a number.\nIt composes the input primitive, so it provides the input state.",
|
|
708
|
+
"selector": "input[ngpColorField]",
|
|
709
|
+
"exportAs": [
|
|
710
|
+
"ngpColorField"
|
|
711
|
+
],
|
|
712
|
+
"inputs": [
|
|
713
|
+
{
|
|
714
|
+
"name": "ngpColorFieldValue",
|
|
715
|
+
"type": "Color",
|
|
716
|
+
"description": "The color value.",
|
|
717
|
+
"isRequired": false
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"name": "ngpColorFieldChannel",
|
|
721
|
+
"type": "ColorChannel | undefined",
|
|
722
|
+
"description": "The channel to edit. When omitted, the field edits the whole color as hex.",
|
|
723
|
+
"isRequired": false
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "ngpColorFieldColorSpace",
|
|
727
|
+
"type": "ColorSpace | undefined",
|
|
728
|
+
"description": "The color space for channel mode. Resolved from the channel/value when not set.",
|
|
729
|
+
"isRequired": false
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"name": "ngpColorFieldDisabled",
|
|
733
|
+
"type": "boolean",
|
|
734
|
+
"description": "The disabled state of the field.",
|
|
735
|
+
"isRequired": false,
|
|
736
|
+
"defaultValue": "false"
|
|
737
|
+
}
|
|
738
|
+
],
|
|
739
|
+
"outputs": [
|
|
740
|
+
{
|
|
741
|
+
"name": "ngpColorFieldValueChange",
|
|
742
|
+
"type": "Color",
|
|
743
|
+
"description": "Emits when the value changes."
|
|
744
|
+
}
|
|
745
|
+
]
|
|
746
|
+
},
|
|
747
|
+
"NgpColorSlider": {
|
|
748
|
+
"name": "NgpColorSlider",
|
|
749
|
+
"description": "Apply the `ngpColorSlider` directive to an element that contains a color slider track and thumb.\nA color slider adjusts a single channel (e.g. hue, saturation, alpha) of a color value. It composes\nthe underlying slider primitive, so it provides the slider state its track and thumb parts read.",
|
|
750
|
+
"selector": "[ngpColorSlider]",
|
|
751
|
+
"exportAs": [
|
|
752
|
+
"ngpColorSlider"
|
|
753
|
+
],
|
|
754
|
+
"inputs": [
|
|
755
|
+
{
|
|
756
|
+
"name": "ngpColorSliderValue",
|
|
757
|
+
"type": "Color",
|
|
758
|
+
"description": "The color value.",
|
|
759
|
+
"isRequired": false
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "ngpColorSliderChannel",
|
|
763
|
+
"type": "'red' | 'green' | 'blue' | 'hue' | 'saturation' | 'lightness' | 'brightness' | 'alpha'",
|
|
764
|
+
"description": "The channel this slider adjusts.",
|
|
765
|
+
"isRequired": false,
|
|
766
|
+
"defaultValue": "'hue'"
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
"name": "ngpColorSliderColorSpace",
|
|
770
|
+
"type": "ColorSpace | undefined",
|
|
771
|
+
"description": "The color space to operate in. Resolved from the channel/value when not set.",
|
|
772
|
+
"isRequired": false
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"name": "ngpColorSliderOrientation",
|
|
776
|
+
"type": "'horizontal' | 'vertical'",
|
|
777
|
+
"description": "The orientation of the slider.",
|
|
778
|
+
"isRequired": false,
|
|
779
|
+
"defaultValue": "'horizontal'"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"name": "ngpColorSliderDisabled",
|
|
783
|
+
"type": "boolean",
|
|
784
|
+
"description": "The disabled state of the slider.",
|
|
785
|
+
"isRequired": false,
|
|
786
|
+
"defaultValue": "false"
|
|
787
|
+
}
|
|
788
|
+
],
|
|
789
|
+
"outputs": [
|
|
790
|
+
{
|
|
791
|
+
"name": "ngpColorSliderValueChange",
|
|
792
|
+
"type": "Color",
|
|
793
|
+
"description": "Emits when the value changes."
|
|
794
|
+
}
|
|
795
|
+
]
|
|
796
|
+
},
|
|
797
|
+
"NgpColorSwatchPicker": {
|
|
798
|
+
"name": "NgpColorSwatchPicker",
|
|
799
|
+
"description": "Apply the `ngpColorSwatchPicker` directive to a container of selectable color swatches. It composes\nroving focus for keyboard navigation, so it provides the roving focus group state.",
|
|
800
|
+
"selector": "[ngpColorSwatchPicker]",
|
|
801
|
+
"exportAs": [
|
|
802
|
+
"ngpColorSwatchPicker"
|
|
803
|
+
],
|
|
804
|
+
"inputs": [
|
|
805
|
+
{
|
|
806
|
+
"name": "ngpColorSwatchPickerValue",
|
|
807
|
+
"type": "Color | undefined",
|
|
808
|
+
"description": "The selected color.",
|
|
809
|
+
"isRequired": false
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"name": "ngpColorSwatchPickerOrientation",
|
|
813
|
+
"type": "'horizontal' | 'vertical'",
|
|
814
|
+
"description": "The orientation of the swatch list.",
|
|
815
|
+
"isRequired": false,
|
|
816
|
+
"defaultValue": "'horizontal'"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"name": "ngpColorSwatchPickerDisabled",
|
|
820
|
+
"type": "boolean",
|
|
821
|
+
"description": "The disabled state of the swatch picker.",
|
|
822
|
+
"isRequired": false,
|
|
823
|
+
"defaultValue": "false"
|
|
824
|
+
}
|
|
825
|
+
],
|
|
826
|
+
"outputs": [
|
|
827
|
+
{
|
|
828
|
+
"name": "ngpColorSwatchPickerValueChange",
|
|
829
|
+
"type": "Color",
|
|
830
|
+
"description": "Emits when the selected color changes."
|
|
831
|
+
}
|
|
832
|
+
]
|
|
833
|
+
},
|
|
433
834
|
"NgpComboboxPortal": {
|
|
434
835
|
"name": "NgpComboboxPortal",
|
|
435
836
|
"description": "",
|
|
@@ -1081,22 +1482,22 @@
|
|
|
1081
1482
|
}
|
|
1082
1483
|
]
|
|
1083
1484
|
},
|
|
1084
|
-
"
|
|
1085
|
-
"name": "
|
|
1485
|
+
"NgpDialogTitle": {
|
|
1486
|
+
"name": "NgpDialogTitle",
|
|
1086
1487
|
"description": "",
|
|
1087
|
-
"selector": "[
|
|
1488
|
+
"selector": "[ngpDialogTitle]",
|
|
1088
1489
|
"exportAs": [
|
|
1089
|
-
"
|
|
1490
|
+
"ngpDialogTitle"
|
|
1090
1491
|
],
|
|
1091
1492
|
"inputs": [],
|
|
1092
1493
|
"outputs": []
|
|
1093
1494
|
},
|
|
1094
|
-
"
|
|
1095
|
-
"name": "
|
|
1495
|
+
"NgpDialogDescription": {
|
|
1496
|
+
"name": "NgpDialogDescription",
|
|
1096
1497
|
"description": "",
|
|
1097
|
-
"selector": "[
|
|
1498
|
+
"selector": "[ngpDialogDescription]",
|
|
1098
1499
|
"exportAs": [
|
|
1099
|
-
"
|
|
1500
|
+
"ngpDialogDescription"
|
|
1100
1501
|
],
|
|
1101
1502
|
"inputs": [],
|
|
1102
1503
|
"outputs": []
|
|
@@ -2564,6 +2965,99 @@
|
|
|
2564
2965
|
}
|
|
2565
2966
|
]
|
|
2566
2967
|
},
|
|
2968
|
+
"NgpPasswordToggle": {
|
|
2969
|
+
"name": "NgpPasswordToggle",
|
|
2970
|
+
"description": "Apply the `ngpPasswordToggle` directive to a `button` element to toggle the visibility of the\npassword within an `ngpPassword` container.",
|
|
2971
|
+
"selector": "button[ngpPasswordToggle]",
|
|
2972
|
+
"exportAs": [
|
|
2973
|
+
"ngpPasswordToggle"
|
|
2974
|
+
],
|
|
2975
|
+
"inputs": [
|
|
2976
|
+
{
|
|
2977
|
+
"name": "ngpPasswordToggleShowLabel",
|
|
2978
|
+
"type": "string",
|
|
2979
|
+
"description": "The accessible label shown when the password is hidden.",
|
|
2980
|
+
"isRequired": false,
|
|
2981
|
+
"defaultValue": "'Show password'"
|
|
2982
|
+
},
|
|
2983
|
+
{
|
|
2984
|
+
"name": "ngpPasswordToggleHideLabel",
|
|
2985
|
+
"type": "string",
|
|
2986
|
+
"description": "The accessible label shown when the password is visible.",
|
|
2987
|
+
"isRequired": false,
|
|
2988
|
+
"defaultValue": "'Hide password'"
|
|
2989
|
+
},
|
|
2990
|
+
{
|
|
2991
|
+
"name": "ngpPasswordToggleShownAnnouncement",
|
|
2992
|
+
"type": "string",
|
|
2993
|
+
"description": "The message announced when the password becomes visible.",
|
|
2994
|
+
"isRequired": false,
|
|
2995
|
+
"defaultValue": "'Your password is shown'"
|
|
2996
|
+
},
|
|
2997
|
+
{
|
|
2998
|
+
"name": "ngpPasswordToggleHiddenAnnouncement",
|
|
2999
|
+
"type": "string",
|
|
3000
|
+
"description": "The message announced when the password becomes hidden.",
|
|
3001
|
+
"isRequired": false,
|
|
3002
|
+
"defaultValue": "'Your password is hidden'"
|
|
3003
|
+
}
|
|
3004
|
+
],
|
|
3005
|
+
"outputs": []
|
|
3006
|
+
},
|
|
3007
|
+
"NgpPassword": {
|
|
3008
|
+
"name": "NgpPassword",
|
|
3009
|
+
"description": "The `NgpPassword` directive is a container for a password field and its visibility toggle.",
|
|
3010
|
+
"selector": "[ngpPassword]",
|
|
3011
|
+
"exportAs": [
|
|
3012
|
+
"ngpPassword"
|
|
3013
|
+
],
|
|
3014
|
+
"inputs": [
|
|
3015
|
+
{
|
|
3016
|
+
"name": "ngpPasswordVisible",
|
|
3017
|
+
"type": "boolean | undefined",
|
|
3018
|
+
"description": "Whether the password is visible.",
|
|
3019
|
+
"isRequired": false
|
|
3020
|
+
},
|
|
3021
|
+
{
|
|
3022
|
+
"name": "ngpPasswordDefaultVisible",
|
|
3023
|
+
"type": "boolean",
|
|
3024
|
+
"description": "The default visibility state for uncontrolled usage.\n@default false",
|
|
3025
|
+
"isRequired": false,
|
|
3026
|
+
"defaultValue": "false"
|
|
3027
|
+
}
|
|
3028
|
+
],
|
|
3029
|
+
"outputs": [
|
|
3030
|
+
{
|
|
3031
|
+
"name": "ngpPasswordVisibleChange",
|
|
3032
|
+
"type": "boolean",
|
|
3033
|
+
"description": "Emits when the visibility state changes."
|
|
3034
|
+
}
|
|
3035
|
+
]
|
|
3036
|
+
},
|
|
3037
|
+
"NgpPasswordInput": {
|
|
3038
|
+
"name": "NgpPasswordInput",
|
|
3039
|
+
"description": "Apply the `ngpPasswordInput` directive to an `input` element within an `ngpPassword` container.\nIt is a complete input (form control, interactions, autofill) with password visibility toggling\nlayered on top, so it does not need to be combined with `ngpInput`.",
|
|
3040
|
+
"selector": "input[ngpPasswordInput]",
|
|
3041
|
+
"exportAs": [
|
|
3042
|
+
"ngpPasswordInput"
|
|
3043
|
+
],
|
|
3044
|
+
"inputs": [
|
|
3045
|
+
{
|
|
3046
|
+
"name": "disabled",
|
|
3047
|
+
"type": "boolean",
|
|
3048
|
+
"description": "Whether the input is disabled.",
|
|
3049
|
+
"isRequired": false
|
|
3050
|
+
},
|
|
3051
|
+
{
|
|
3052
|
+
"name": "ngpPasswordInputIgnorePasswordManagers",
|
|
3053
|
+
"type": "boolean",
|
|
3054
|
+
"description": "Whether to opt the input out of password manager injection\n(1Password, LastPass, Bitwarden, etc.).",
|
|
3055
|
+
"isRequired": false,
|
|
3056
|
+
"defaultValue": "false"
|
|
3057
|
+
}
|
|
3058
|
+
],
|
|
3059
|
+
"outputs": []
|
|
3060
|
+
},
|
|
2567
3061
|
"NgpPopoverArrow": {
|
|
2568
3062
|
"name": "NgpPopoverArrow",
|
|
2569
3063
|
"description": "",
|
|
@@ -2869,6 +3363,81 @@
|
|
|
2869
3363
|
}
|
|
2870
3364
|
]
|
|
2871
3365
|
},
|
|
3366
|
+
"NgpRating": {
|
|
3367
|
+
"name": "NgpRating",
|
|
3368
|
+
"description": "Apply the `ngpRating` directive to an element that represents the rating. It\nexposes the slider role and owns the value, keyboard, and form integration.\nProject the star markup once via the `*ngpRatingItem` structural directive.",
|
|
3369
|
+
"selector": "[ngpRating]",
|
|
3370
|
+
"exportAs": [
|
|
3371
|
+
"ngpRating"
|
|
3372
|
+
],
|
|
3373
|
+
"inputs": [
|
|
3374
|
+
{
|
|
3375
|
+
"name": "ngpRatingValue",
|
|
3376
|
+
"type": "number",
|
|
3377
|
+
"description": "The value of the rating.",
|
|
3378
|
+
"isRequired": false,
|
|
3379
|
+
"defaultValue": "0"
|
|
3380
|
+
},
|
|
3381
|
+
{
|
|
3382
|
+
"name": "ngpRatingCount",
|
|
3383
|
+
"type": "number",
|
|
3384
|
+
"description": "The number of items in the rating.",
|
|
3385
|
+
"isRequired": false,
|
|
3386
|
+
"defaultValue": "5"
|
|
3387
|
+
},
|
|
3388
|
+
{
|
|
3389
|
+
"name": "ngpRatingAllowHalf",
|
|
3390
|
+
"type": "boolean",
|
|
3391
|
+
"description": "Whether half values are allowed.",
|
|
3392
|
+
"isRequired": false,
|
|
3393
|
+
"defaultValue": "false"
|
|
3394
|
+
},
|
|
3395
|
+
{
|
|
3396
|
+
"name": "ngpRatingDisabled",
|
|
3397
|
+
"type": "boolean",
|
|
3398
|
+
"description": "Whether the rating is disabled.",
|
|
3399
|
+
"isRequired": false,
|
|
3400
|
+
"defaultValue": "false"
|
|
3401
|
+
},
|
|
3402
|
+
{
|
|
3403
|
+
"name": "ngpRatingReadonly",
|
|
3404
|
+
"type": "boolean",
|
|
3405
|
+
"description": "Whether the rating is read-only.",
|
|
3406
|
+
"isRequired": false,
|
|
3407
|
+
"defaultValue": "false"
|
|
3408
|
+
},
|
|
3409
|
+
{
|
|
3410
|
+
"name": "ngpRatingClearable",
|
|
3411
|
+
"type": "boolean",
|
|
3412
|
+
"description": "Whether re-selecting the current value clears the rating to 0 (deselection).",
|
|
3413
|
+
"isRequired": false,
|
|
3414
|
+
"defaultValue": "false"
|
|
3415
|
+
},
|
|
3416
|
+
{
|
|
3417
|
+
"name": "ngpRatingValueText",
|
|
3418
|
+
"type": "(value: number, count: number) => string",
|
|
3419
|
+
"description": "Produce the `aria-valuetext` announced to assistive technology.",
|
|
3420
|
+
"isRequired": false
|
|
3421
|
+
}
|
|
3422
|
+
],
|
|
3423
|
+
"outputs": [
|
|
3424
|
+
{
|
|
3425
|
+
"name": "ngpRatingValueChange",
|
|
3426
|
+
"type": "number",
|
|
3427
|
+
"description": "Emits when the value changes."
|
|
3428
|
+
}
|
|
3429
|
+
]
|
|
3430
|
+
},
|
|
3431
|
+
"NgpRatingItem": {
|
|
3432
|
+
"name": "NgpRatingItem",
|
|
3433
|
+
"description": "A structural directive that renders one item (star) per `count`, driven by the\nparent `ngpRating`. Each generated element automatically receives the\n`data-checked`, `data-half` and `data-highlighted` attributes and has its\npointer interactions wired up via the `ngpRatingItem` state function.",
|
|
3434
|
+
"selector": "[ngpRatingItem]",
|
|
3435
|
+
"exportAs": [
|
|
3436
|
+
"ngpRatingItem"
|
|
3437
|
+
],
|
|
3438
|
+
"inputs": [],
|
|
3439
|
+
"outputs": []
|
|
3440
|
+
},
|
|
2872
3441
|
"NgpResize": {
|
|
2873
3442
|
"name": "NgpResize",
|
|
2874
3443
|
"description": "Apply the `ngpResize` directive to an element to listen for resize events.",
|
|
@@ -4177,6 +4746,41 @@
|
|
|
4177
4746
|
}
|
|
4178
4747
|
]
|
|
4179
4748
|
},
|
|
4749
|
+
"NgpPasswordConfig": {
|
|
4750
|
+
"name": "NgpPasswordConfig",
|
|
4751
|
+
"properties": [
|
|
4752
|
+
{
|
|
4753
|
+
"name": "showLabel",
|
|
4754
|
+
"type": "string",
|
|
4755
|
+
"description": "The accessible label for the toggle button when the password is hidden.",
|
|
4756
|
+
"default": "'Show password'"
|
|
4757
|
+
},
|
|
4758
|
+
{
|
|
4759
|
+
"name": "hideLabel",
|
|
4760
|
+
"type": "string",
|
|
4761
|
+
"description": "The accessible label for the toggle button when the password is visible.",
|
|
4762
|
+
"default": "'Hide password'"
|
|
4763
|
+
},
|
|
4764
|
+
{
|
|
4765
|
+
"name": "shownAnnouncement",
|
|
4766
|
+
"type": "string",
|
|
4767
|
+
"description": "The message announced to screen readers when the password becomes visible.",
|
|
4768
|
+
"default": "'Your password is shown'"
|
|
4769
|
+
},
|
|
4770
|
+
{
|
|
4771
|
+
"name": "hiddenAnnouncement",
|
|
4772
|
+
"type": "string",
|
|
4773
|
+
"description": "The message announced to screen readers when the password becomes hidden.",
|
|
4774
|
+
"default": "'Your password is hidden'"
|
|
4775
|
+
},
|
|
4776
|
+
{
|
|
4777
|
+
"name": "ignorePasswordManagers",
|
|
4778
|
+
"type": "boolean",
|
|
4779
|
+
"description": "Whether to opt the input out of password manager injection by default.",
|
|
4780
|
+
"default": "false"
|
|
4781
|
+
}
|
|
4782
|
+
]
|
|
4783
|
+
},
|
|
4180
4784
|
"NgpPopoverConfig": {
|
|
4181
4785
|
"name": "NgpPopoverConfig",
|
|
4182
4786
|
"properties": [
|
|
@@ -4390,6 +4994,28 @@
|
|
|
4390
4994
|
}
|
|
4391
4995
|
]
|
|
4392
4996
|
},
|
|
4997
|
+
"NgpRatingConfig": {
|
|
4998
|
+
"name": "NgpRatingConfig",
|
|
4999
|
+
"properties": [
|
|
5000
|
+
{
|
|
5001
|
+
"name": "count",
|
|
5002
|
+
"type": "number",
|
|
5003
|
+
"description": "The default number of items in the rating.",
|
|
5004
|
+
"default": "5"
|
|
5005
|
+
},
|
|
5006
|
+
{
|
|
5007
|
+
"name": "clearable",
|
|
5008
|
+
"type": "boolean",
|
|
5009
|
+
"description": "Whether re-selecting the current value clears the rating to 0 (deselection).",
|
|
5010
|
+
"default": "false"
|
|
5011
|
+
},
|
|
5012
|
+
{
|
|
5013
|
+
"name": "valueText",
|
|
5014
|
+
"type": "(value: number, count: number) => string",
|
|
5015
|
+
"description": "Produce the `aria-valuetext` announced to assistive technology. Override for localisation."
|
|
5016
|
+
}
|
|
5017
|
+
]
|
|
5018
|
+
},
|
|
4393
5019
|
"NgpSelectConfig": {
|
|
4394
5020
|
"name": "NgpSelectConfig",
|
|
4395
5021
|
"properties": [
|
|
@@ -316,6 +316,151 @@
|
|
|
316
316
|
"hasSizes": true
|
|
317
317
|
}
|
|
318
318
|
},
|
|
319
|
+
{
|
|
320
|
+
"name": "collapsible",
|
|
321
|
+
"entryPoint": "ng-primitives/collapsible",
|
|
322
|
+
"exports": [
|
|
323
|
+
"NgpCollapsible",
|
|
324
|
+
"NgpCollapsibleStateToken",
|
|
325
|
+
"ngpCollapsible",
|
|
326
|
+
"injectCollapsibleState",
|
|
327
|
+
"provideCollapsibleState",
|
|
328
|
+
"type NgpCollapsibleState",
|
|
329
|
+
"type NgpCollapsibleProps",
|
|
330
|
+
"NgpCollapsibleTrigger",
|
|
331
|
+
"NgpCollapsibleTriggerStateToken",
|
|
332
|
+
"ngpCollapsibleTrigger",
|
|
333
|
+
"injectCollapsibleTriggerState",
|
|
334
|
+
"provideCollapsibleTriggerState",
|
|
335
|
+
"type NgpCollapsibleTriggerState",
|
|
336
|
+
"type NgpCollapsibleTriggerProps",
|
|
337
|
+
"NgpCollapsibleContent",
|
|
338
|
+
"NgpCollapsibleContentStateToken",
|
|
339
|
+
"ngpCollapsibleContent",
|
|
340
|
+
"injectCollapsibleContentState",
|
|
341
|
+
"provideCollapsibleContentState",
|
|
342
|
+
"type NgpCollapsibleContentState",
|
|
343
|
+
"type NgpCollapsibleContentProps"
|
|
344
|
+
],
|
|
345
|
+
"hasSecondaryEntryPoint": true,
|
|
346
|
+
"category": "utility",
|
|
347
|
+
"description": "A collapsible shows and hides an associated section of content, following the WAI-ARIA disclosure pattern.",
|
|
348
|
+
"accessibility": [
|
|
349
|
+
"ARIA disclosure",
|
|
350
|
+
"ARIA design"
|
|
351
|
+
],
|
|
352
|
+
"examples": [
|
|
353
|
+
{
|
|
354
|
+
"name": "example-0",
|
|
355
|
+
"code": "import {\n NgpCollapsible,\n NgpCollapsibleTrigger,\n NgpCollapsibleContent,\n} from 'ng-primitives/collapsible';",
|
|
356
|
+
"description": "Import"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "example-1",
|
|
360
|
+
"code": "<div ngpCollapsible>\n <button ngpCollapsibleTrigger>Show details</button>\n <div ngpCollapsibleContent>The content that is shown and hidden.</div>\n</div>",
|
|
361
|
+
"description": "Usage"
|
|
362
|
+
}
|
|
363
|
+
]
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "color",
|
|
367
|
+
"entryPoint": "ng-primitives/color",
|
|
368
|
+
"exports": [
|
|
369
|
+
"Color",
|
|
370
|
+
"ColorSpace",
|
|
371
|
+
"ColorChannel",
|
|
372
|
+
"ColorChannelRange",
|
|
373
|
+
"NgpColorSlider",
|
|
374
|
+
"NgpColorSliderStateToken",
|
|
375
|
+
"ngpColorSlider",
|
|
376
|
+
"injectColorSliderState",
|
|
377
|
+
"provideColorSliderState",
|
|
378
|
+
"type NgpColorSliderState",
|
|
379
|
+
"type NgpColorSliderProps",
|
|
380
|
+
"NgpColorSliderTrack",
|
|
381
|
+
"NgpColorSliderTrackStateToken",
|
|
382
|
+
"ngpColorSliderTrack",
|
|
383
|
+
"injectColorSliderTrackState",
|
|
384
|
+
"provideColorSliderTrackState",
|
|
385
|
+
"type NgpColorSliderTrackState",
|
|
386
|
+
"type NgpColorSliderTrackProps",
|
|
387
|
+
"NgpColorSliderThumb",
|
|
388
|
+
"NgpColorSliderThumbStateToken",
|
|
389
|
+
"ngpColorSliderThumb",
|
|
390
|
+
"injectColorSliderThumbState",
|
|
391
|
+
"provideColorSliderThumbState",
|
|
392
|
+
"type NgpColorSliderThumbState",
|
|
393
|
+
"type NgpColorSliderThumbProps",
|
|
394
|
+
"NgpColorArea",
|
|
395
|
+
"NgpColorAreaStateToken",
|
|
396
|
+
"ngpColorArea",
|
|
397
|
+
"injectColorAreaState",
|
|
398
|
+
"provideColorAreaState",
|
|
399
|
+
"type NgpColorAreaState",
|
|
400
|
+
"type NgpColorAreaProps",
|
|
401
|
+
"NgpColorAreaThumb",
|
|
402
|
+
"NgpColorAreaThumbStateToken",
|
|
403
|
+
"ngpColorAreaThumb",
|
|
404
|
+
"injectColorAreaThumbState",
|
|
405
|
+
"provideColorAreaThumbState",
|
|
406
|
+
"type NgpColorAreaThumbState",
|
|
407
|
+
"type NgpColorAreaThumbProps",
|
|
408
|
+
"NgpColorField",
|
|
409
|
+
"NgpColorFieldStateToken",
|
|
410
|
+
"ngpColorField",
|
|
411
|
+
"injectColorFieldState",
|
|
412
|
+
"provideColorFieldState",
|
|
413
|
+
"type NgpColorFieldState",
|
|
414
|
+
"type NgpColorFieldProps",
|
|
415
|
+
"NgpColorPicker",
|
|
416
|
+
"NgpColorPickerStateToken",
|
|
417
|
+
"ngpColorPicker",
|
|
418
|
+
"injectColorPickerState",
|
|
419
|
+
"provideColorPickerState",
|
|
420
|
+
"type NgpColorPickerState",
|
|
421
|
+
"type NgpColorPickerProps",
|
|
422
|
+
"NgpColorSwatch",
|
|
423
|
+
"NgpColorSwatchStateToken",
|
|
424
|
+
"ngpColorSwatch",
|
|
425
|
+
"injectColorSwatchState",
|
|
426
|
+
"provideColorSwatchState",
|
|
427
|
+
"type NgpColorSwatchState",
|
|
428
|
+
"type NgpColorSwatchProps",
|
|
429
|
+
"NgpColorWheel",
|
|
430
|
+
"NgpColorWheelStateToken",
|
|
431
|
+
"ngpColorWheel",
|
|
432
|
+
"injectColorWheelState",
|
|
433
|
+
"provideColorWheelState",
|
|
434
|
+
"type NgpColorWheelState",
|
|
435
|
+
"type NgpColorWheelProps",
|
|
436
|
+
"NgpColorWheelThumb",
|
|
437
|
+
"NgpColorWheelThumbStateToken",
|
|
438
|
+
"ngpColorWheelThumb",
|
|
439
|
+
"injectColorWheelThumbState",
|
|
440
|
+
"provideColorWheelThumbState",
|
|
441
|
+
"type NgpColorWheelThumbState",
|
|
442
|
+
"type NgpColorWheelThumbProps",
|
|
443
|
+
"NgpColorSwatchPicker",
|
|
444
|
+
"NgpColorSwatchPickerStateToken",
|
|
445
|
+
"ngpColorSwatchPicker",
|
|
446
|
+
"injectColorSwatchPickerState",
|
|
447
|
+
"provideColorSwatchPickerState",
|
|
448
|
+
"type NgpColorSwatchPickerState",
|
|
449
|
+
"type NgpColorSwatchPickerProps",
|
|
450
|
+
"NgpColorSwatchPickerItem",
|
|
451
|
+
"NgpColorSwatchPickerItemStateToken",
|
|
452
|
+
"ngpColorSwatchPickerItem",
|
|
453
|
+
"injectColorSwatchPickerItemState",
|
|
454
|
+
"provideColorSwatchPickerItemState",
|
|
455
|
+
"type NgpColorSwatchPickerItemState",
|
|
456
|
+
"type NgpColorSwatchPickerItemProps"
|
|
457
|
+
],
|
|
458
|
+
"hasSecondaryEntryPoint": true,
|
|
459
|
+
"category": "utility",
|
|
460
|
+
"description": "color primitive component",
|
|
461
|
+
"accessibility": [],
|
|
462
|
+
"examples": []
|
|
463
|
+
},
|
|
319
464
|
{
|
|
320
465
|
"name": "combobox",
|
|
321
466
|
"entryPoint": "ng-primitives/combobox",
|
|
@@ -541,10 +686,44 @@
|
|
|
541
686
|
"NgpDialog",
|
|
542
687
|
"injectDialogRef",
|
|
543
688
|
"NgpDialogRef",
|
|
689
|
+
"NgpDialogContext",
|
|
690
|
+
"NgpDialogManager",
|
|
691
|
+
"NgpDialogDescriptionStateToken",
|
|
692
|
+
"ngpDialogDescription",
|
|
693
|
+
"injectDialogDescriptionState",
|
|
694
|
+
"provideDialogDescriptionState",
|
|
695
|
+
"type NgpDialogDescriptionState",
|
|
696
|
+
"type NgpDialogDescriptionProps",
|
|
697
|
+
"NgpDialogOverlayStateToken",
|
|
698
|
+
"ngpDialogOverlay",
|
|
699
|
+
"injectDialogOverlayState",
|
|
700
|
+
"provideDialogOverlayState",
|
|
701
|
+
"type NgpDialogOverlayState",
|
|
702
|
+
"type NgpDialogOverlayProps",
|
|
703
|
+
"NgpDialogPanelStateToken",
|
|
704
|
+
"ngpDialogPanel",
|
|
705
|
+
"injectDialogPanelState",
|
|
706
|
+
"provideDialogPanelState",
|
|
707
|
+
"type NgpDialogPanelState",
|
|
708
|
+
"type NgpDialogPanelProps",
|
|
709
|
+
"NgpDialogTitleStateToken",
|
|
710
|
+
"ngpDialogTitle",
|
|
711
|
+
"injectDialogTitleState",
|
|
712
|
+
"provideDialogTitleState",
|
|
713
|
+
"type NgpDialogTitleState",
|
|
714
|
+
"type NgpDialogTitleProps",
|
|
715
|
+
"NgpDialogTriggerStateToken",
|
|
716
|
+
"ngpDialogTrigger",
|
|
717
|
+
"injectDialogTriggerState",
|
|
718
|
+
"provideDialogTriggerState",
|
|
719
|
+
"type NgpDialogTriggerState",
|
|
720
|
+
"type NgpDialogTriggerProps",
|
|
721
|
+
"NgpDialogStateToken",
|
|
722
|
+
"ngpDialog",
|
|
544
723
|
"injectDialogState",
|
|
545
724
|
"provideDialogState",
|
|
546
|
-
"
|
|
547
|
-
"
|
|
725
|
+
"type NgpDialogState",
|
|
726
|
+
"type NgpDialogProps"
|
|
548
727
|
],
|
|
549
728
|
"hasSecondaryEntryPoint": true,
|
|
550
729
|
"category": "feedback",
|
|
@@ -1134,6 +1313,58 @@
|
|
|
1134
1313
|
"hasSizes": true
|
|
1135
1314
|
}
|
|
1136
1315
|
},
|
|
1316
|
+
{
|
|
1317
|
+
"name": "password",
|
|
1318
|
+
"entryPoint": "ng-primitives/password",
|
|
1319
|
+
"exports": [
|
|
1320
|
+
"defaultPasswordConfig",
|
|
1321
|
+
"injectPasswordConfig",
|
|
1322
|
+
"NgpPasswordConfig",
|
|
1323
|
+
"NgpPasswordConfigToken",
|
|
1324
|
+
"providePasswordConfig",
|
|
1325
|
+
"NgpPasswordInput",
|
|
1326
|
+
"injectPasswordInputState",
|
|
1327
|
+
"ngpPasswordInput",
|
|
1328
|
+
"NgpPasswordInputProps",
|
|
1329
|
+
"NgpPasswordInputState",
|
|
1330
|
+
"providePasswordInputState",
|
|
1331
|
+
"NgpPasswordToggle",
|
|
1332
|
+
"injectPasswordToggleState",
|
|
1333
|
+
"ngpPasswordToggle",
|
|
1334
|
+
"NgpPasswordToggleProps",
|
|
1335
|
+
"NgpPasswordToggleState",
|
|
1336
|
+
"providePasswordToggleState",
|
|
1337
|
+
"NgpPassword",
|
|
1338
|
+
"injectPasswordState",
|
|
1339
|
+
"ngpPassword",
|
|
1340
|
+
"NgpPasswordProps",
|
|
1341
|
+
"NgpPasswordState",
|
|
1342
|
+
"providePasswordState"
|
|
1343
|
+
],
|
|
1344
|
+
"hasSecondaryEntryPoint": true,
|
|
1345
|
+
"category": "utility",
|
|
1346
|
+
"description": "The password primitive is a form control that lets users reveal and hide the contents of a password field with an accessible toggle button.",
|
|
1347
|
+
"accessibility": [
|
|
1348
|
+
"screen reader"
|
|
1349
|
+
],
|
|
1350
|
+
"examples": [
|
|
1351
|
+
{
|
|
1352
|
+
"name": "example-0",
|
|
1353
|
+
"code": "<div ngpFormField>\n <label ngpLabel>Password</label>\n <div ngpPassword #password=\"ngpPassword\">\n <input ngpPasswordInput type=\"password\" autocomplete=\"current-password\" />\n <button ngpButton ngpPasswordToggle>\n <ng-icon [name]=\"password.isVisible() ? 'lucideEyeOff' : 'lucideEye'\" />\n </button>\n </div>\n</div>",
|
|
1354
|
+
"description": "Usage"
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
"name": "example-1",
|
|
1358
|
+
"code": "import { providePasswordConfig } from 'ng-primitives/password';\n\nbootstrapApplication(AppComponent, {\n providers: [\n providePasswordConfig({\n showLabel: 'Show password',\n hideLabel: 'Hide password',\n shownAnnouncement: 'Your password is shown',\n hiddenAnnouncement: 'Your password is hidden',\n ignorePasswordManagers: false,\n }),\n ],\n});",
|
|
1359
|
+
"description": "Global Configuration"
|
|
1360
|
+
}
|
|
1361
|
+
],
|
|
1362
|
+
"reusableComponent": {
|
|
1363
|
+
"code": "import { Component, input, signal } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { lucideEye, lucideEyeOff } from '@ng-icons/lucide';\nimport { NgpButton } from 'ng-primitives/button';\nimport {\n injectPasswordState,\n NgpPassword,\n NgpPasswordInput,\n NgpPasswordToggle,\n} from 'ng-primitives/password';\nimport { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';\n\n@Component({\n selector: 'app-password',\n hostDirectives: [NgpPassword],\n imports: [NgIcon, NgpPasswordInput, NgpPasswordToggle, NgpButton],\n providers: [provideValueAccessor(Password), provideIcons({ lucideEye, lucideEyeOff })],\n template: `\n <input\n [value]=\"value()\"\n [placeholder]=\"placeholder()\"\n (input)=\"onValueChange($event)\"\n ngpPasswordInput\n type=\"password\"\n autocomplete=\"current-password\"\n />\n <button ngpButton ngpPasswordToggle>\n <ng-icon [name]=\"state().visible() ? 'lucideEyeOff' : 'lucideEye'\" />\n </button>\n `,\n styles: `\n :host {\n display: block;\n position: relative;\n }\n\n [ngpPasswordInput] {\n height: 2.125rem;\n width: 100%;\n border-radius: 0.5rem;\n padding: 0 40px 0 12px;\n border: none;\n background: var(--ngp-background);\n color: var(--ngp-text-primary);\n font-size: 0.875rem;\n letter-spacing: -0.006em;\n box-shadow: var(--ngp-input-shadow);\n outline: none;\n }\n\n [ngpPasswordInput][data-focus] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: 2px;\n }\n\n [ngpPasswordInput]::placeholder {\n color: var(--ngp-text-placeholder);\n }\n\n [ngpPasswordToggle] {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 2.125rem;\n width: 2.125rem;\n border: none;\n border-radius: 0.5rem;\n background-color: transparent;\n color: var(--ngp-text-tertiary);\n font-size: 1.125rem;\n cursor: pointer;\n outline: none;\n transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n [ngpPasswordToggle][data-hover] {\n color: var(--ngp-text-secondary);\n }\n\n [ngpPasswordToggle][data-visible] {\n color: var(--ngp-primary);\n }\n\n [ngpPasswordToggle][data-focus-visible] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: -2px;\n }\n `,\n host: {\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class Password implements ControlValueAccessor {\n /** Access the password state to read the visibility. */\n protected readonly state = injectPasswordState();\n\n /** The placeholder text */\n readonly placeholder = input<string>('');\n\n /** The current value */\n protected value = signal<string>('');\n\n /** The function to call when the value changes */\n private onChange?: ChangeFn<string>;\n\n /** The function to call when the control is touched */\n protected onTouched?: TouchedFn;\n\n writeValue(value: string): void {\n this.value.set(value);\n }\n\n registerOnChange(fn: ChangeFn<string>): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: TouchedFn): void {\n this.onTouched = fn;\n }\n\n protected onValueChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value.set(input.value);\n this.onChange?.(input.value);\n }\n\n protected onFocusOut(event: FocusEvent): void {\n // only mark as touched when focus leaves the component, not when moving\n // between the input and the toggle button\n const host = event.currentTarget as HTMLElement;\n if (!host.contains(event.relatedTarget as Node | null)) {\n this.onTouched?.();\n }\n }\n}\n",
|
|
1364
|
+
"hasVariants": false,
|
|
1365
|
+
"hasSizes": true
|
|
1366
|
+
}
|
|
1367
|
+
},
|
|
1137
1368
|
{
|
|
1138
1369
|
"name": "popover",
|
|
1139
1370
|
"entryPoint": "ng-primitives/popover",
|
|
@@ -1336,6 +1567,52 @@
|
|
|
1336
1567
|
"hasSizes": false
|
|
1337
1568
|
}
|
|
1338
1569
|
},
|
|
1570
|
+
{
|
|
1571
|
+
"name": "rating",
|
|
1572
|
+
"entryPoint": "ng-primitives/rating",
|
|
1573
|
+
"exports": [
|
|
1574
|
+
"NgpRating",
|
|
1575
|
+
"NgpRatingStateToken",
|
|
1576
|
+
"ngpRating",
|
|
1577
|
+
"injectRatingState",
|
|
1578
|
+
"provideRatingState",
|
|
1579
|
+
"type NgpRatingState",
|
|
1580
|
+
"type NgpRatingProps",
|
|
1581
|
+
"type NgpRatingItemState",
|
|
1582
|
+
"NgpRatingConfig",
|
|
1583
|
+
"provideRatingConfig",
|
|
1584
|
+
"NgpRatingItem",
|
|
1585
|
+
"type NgpRatingItemContext",
|
|
1586
|
+
"NgpRatingItemStateToken",
|
|
1587
|
+
"ngpRatingItem",
|
|
1588
|
+
"injectRatingItemState",
|
|
1589
|
+
"provideRatingItemState",
|
|
1590
|
+
"type NgpRatingItemProps"
|
|
1591
|
+
],
|
|
1592
|
+
"hasSecondaryEntryPoint": true,
|
|
1593
|
+
"category": "utility",
|
|
1594
|
+
"description": "Capture a star rating within a range.",
|
|
1595
|
+
"accessibility": [
|
|
1596
|
+
"ARIA design"
|
|
1597
|
+
],
|
|
1598
|
+
"examples": [
|
|
1599
|
+
{
|
|
1600
|
+
"name": "example-0",
|
|
1601
|
+
"code": "<div ngpRating [(ngpRatingValue)]=\"value\" [ngpRatingCount]=\"5\">\n <span *ngpRatingItem=\"let star\">{{ star.checked ? '★' : '☆' }}</span>\n</div>",
|
|
1602
|
+
"description": "Usage"
|
|
1603
|
+
},
|
|
1604
|
+
{
|
|
1605
|
+
"name": "example-1",
|
|
1606
|
+
"code": "import { provideRatingConfig } from 'ng-primitives/rating';\n\nbootstrapApplication(AppComponent, {\n providers: [\n provideRatingConfig({\n count: 5,\n clearable: false,\n valueText: (value, count) => `${value} out of ${count} stars`,\n }),\n ],\n});",
|
|
1607
|
+
"description": "Global Configuration"
|
|
1608
|
+
}
|
|
1609
|
+
],
|
|
1610
|
+
"reusableComponent": {
|
|
1611
|
+
"code": "import { Component } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { heroStarSolid } from '@ng-icons/heroicons/solid';\nimport { injectRatingState, NgpRating, NgpRatingItem } from 'ng-primitives/rating';\nimport { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';\n\n@Component({\n selector: 'app-rating',\n hostDirectives: [\n {\n directive: NgpRating,\n inputs: [\n 'ngpRatingValue:value',\n 'ngpRatingCount:count',\n 'ngpRatingAllowHalf:allowHalf',\n 'ngpRatingDisabled:disabled',\n 'ngpRatingReadonly:readonly',\n 'ngpRatingClearable:clearable',\n ],\n outputs: ['ngpRatingValueChange:valueChange'],\n },\n ],\n imports: [NgIcon, NgpRatingItem],\n providers: [provideIcons({ heroStarSolid }), provideValueAccessor(Rating)],\n template: `\n <span class=\"star\" *ngpRatingItem=\"let star\">\n <ng-icon class=\"star-background\" name=\"heroStarSolid\" />\n <span class=\"star-fill\" [style.width.%]=\"star.fraction * 100\">\n <ng-icon name=\"heroStarSolid\" />\n </span>\n </span>\n `,\n styles: `\n :host {\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n outline: none;\n border-radius: 0.5rem;\n cursor: pointer;\n }\n\n :host[data-disabled] {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n :host[data-readonly] {\n cursor: default;\n }\n\n :host[data-focus-visible] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: 2px;\n }\n\n .star {\n position: relative;\n display: inline-flex;\n font-size: 1.5rem;\n line-height: 1;\n color: var(--ngp-background-secondary);\n transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .star-fill {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n display: inline-flex;\n overflow: hidden;\n color: var(--ngp-primary);\n }\n `,\n host: {\n '(focusout)': 'onTouched?.()',\n },\n})\nexport class Rating implements ControlValueAccessor {\n /** Access the rating state. */\n private readonly state = injectRatingState();\n\n /** The onChange callback function. */\n private onChange?: ChangeFn<number>;\n\n /** The onTouched callback function. */\n protected onTouched?: TouchedFn;\n\n constructor() {\n // Whenever the user interacts with the rating, call onChange with the new value.\n this.state()\n .valueChange.pipe(takeUntilDestroyed())\n .subscribe(value => this.onChange?.(value));\n }\n\n writeValue(value: number): void {\n // writing a value from the model must not re-emit through onChange\n this.state().setValue(value, { emit: false });\n }\n\n registerOnChange(fn: ChangeFn<number>): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: TouchedFn): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.state().setDisabled(isDisabled);\n }\n}\n",
|
|
1612
|
+
"hasVariants": false,
|
|
1613
|
+
"hasSizes": true
|
|
1614
|
+
}
|
|
1615
|
+
},
|
|
1339
1616
|
{
|
|
1340
1617
|
"name": "resize",
|
|
1341
1618
|
"entryPoint": "ng-primitives/resize",
|
|
@@ -125,6 +125,13 @@
|
|
|
125
125
|
"hasVariants": false,
|
|
126
126
|
"hasSizes": true
|
|
127
127
|
},
|
|
128
|
+
{
|
|
129
|
+
"name": "password",
|
|
130
|
+
"code": "import { Component, input, signal } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { lucideEye, lucideEyeOff } from '@ng-icons/lucide';\nimport { NgpButton } from 'ng-primitives/button';\nimport {\n injectPasswordState,\n NgpPassword,\n NgpPasswordInput,\n NgpPasswordToggle,\n} from 'ng-primitives/password';\nimport { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';\n\n@Component({\n selector: 'app-password',\n hostDirectives: [NgpPassword],\n imports: [NgIcon, NgpPasswordInput, NgpPasswordToggle, NgpButton],\n providers: [provideValueAccessor(Password), provideIcons({ lucideEye, lucideEyeOff })],\n template: `\n <input\n [value]=\"value()\"\n [placeholder]=\"placeholder()\"\n (input)=\"onValueChange($event)\"\n ngpPasswordInput\n type=\"password\"\n autocomplete=\"current-password\"\n />\n <button ngpButton ngpPasswordToggle>\n <ng-icon [name]=\"state().visible() ? 'lucideEyeOff' : 'lucideEye'\" />\n </button>\n `,\n styles: `\n :host {\n display: block;\n position: relative;\n }\n\n [ngpPasswordInput] {\n height: 2.125rem;\n width: 100%;\n border-radius: 0.5rem;\n padding: 0 40px 0 12px;\n border: none;\n background: var(--ngp-background);\n color: var(--ngp-text-primary);\n font-size: 0.875rem;\n letter-spacing: -0.006em;\n box-shadow: var(--ngp-input-shadow);\n outline: none;\n }\n\n [ngpPasswordInput][data-focus] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: 2px;\n }\n\n [ngpPasswordInput]::placeholder {\n color: var(--ngp-text-placeholder);\n }\n\n [ngpPasswordToggle] {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 2.125rem;\n width: 2.125rem;\n border: none;\n border-radius: 0.5rem;\n background-color: transparent;\n color: var(--ngp-text-tertiary);\n font-size: 1.125rem;\n cursor: pointer;\n outline: none;\n transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n [ngpPasswordToggle][data-hover] {\n color: var(--ngp-text-secondary);\n }\n\n [ngpPasswordToggle][data-visible] {\n color: var(--ngp-primary);\n }\n\n [ngpPasswordToggle][data-focus-visible] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: -2px;\n }\n `,\n host: {\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class Password implements ControlValueAccessor {\n /** Access the password state to read the visibility. */\n protected readonly state = injectPasswordState();\n\n /** The placeholder text */\n readonly placeholder = input<string>('');\n\n /** The current value */\n protected value = signal<string>('');\n\n /** The function to call when the value changes */\n private onChange?: ChangeFn<string>;\n\n /** The function to call when the control is touched */\n protected onTouched?: TouchedFn;\n\n writeValue(value: string): void {\n this.value.set(value);\n }\n\n registerOnChange(fn: ChangeFn<string>): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: TouchedFn): void {\n this.onTouched = fn;\n }\n\n protected onValueChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value.set(input.value);\n this.onChange?.(input.value);\n }\n\n protected onFocusOut(event: FocusEvent): void {\n // only mark as touched when focus leaves the component, not when moving\n // between the input and the toggle button\n const host = event.currentTarget as HTMLElement;\n if (!host.contains(event.relatedTarget as Node | null)) {\n this.onTouched?.();\n }\n }\n}\n",
|
|
131
|
+
"primitive": "password",
|
|
132
|
+
"hasVariants": false,
|
|
133
|
+
"hasSizes": true
|
|
134
|
+
},
|
|
128
135
|
{
|
|
129
136
|
"name": "popover",
|
|
130
137
|
"code": "import { Directive, input } from '@angular/core';\nimport { injectPopoverTriggerState } from 'ng-primitives/popover';\nimport { NgpPopoverTrigger } from 'ng-primitives/popover';\nimport { Popover } from './popover';\n\n@Directive({\n selector: '[appPopoverTrigger]',\n hostDirectives: [\n {\n directive: NgpPopoverTrigger,\n inputs: [\n 'ngpPopoverTriggerDisabled:appPopoverTriggerDisabled',\n 'ngpPopoverTriggerPlacement:appPopoverTriggerPlacement',\n 'ngpPopoverTriggerOffset:appPopoverTriggerOffset',\n 'ngpPopoverTriggerShowDelay:appPopoverTriggerShowDelay',\n 'ngpPopoverTriggerHideDelay:appPopoverTriggerHideDelay',\n 'ngpPopoverTriggerFlip:appPopoverTriggerFlip',\n 'ngpPopoverTriggerContainer:appPopoverTriggerContainer',\n 'ngpPopoverTriggerCloseOnOutsideClick:appPopoverTriggerCloseOnOutsideClick',\n 'ngpPopoverTriggerCloseOnEscape:appPopoverTriggerCloseOnEscape',\n 'ngpPopoverTriggerScrollBehavior:appPopoverTriggerScrollBehavior',\n 'ngpPopoverTriggerContext:appPopoverTrigger',\n ],\n },\n ],\n})\nexport class PopoverTrigger {\n /** Access the popover trigger */\n private readonly popoverTrigger = injectPopoverTriggerState();\n\n /** Define the content of the popover */\n readonly content = input.required<string>({\n alias: 'appPopoverTrigger',\n });\n\n constructor() {\n this.popoverTrigger().popover.set(Popover);\n }\n}\n",
|
|
@@ -153,6 +160,13 @@
|
|
|
153
160
|
"hasVariants": false,
|
|
154
161
|
"hasSizes": false
|
|
155
162
|
},
|
|
163
|
+
{
|
|
164
|
+
"name": "rating",
|
|
165
|
+
"code": "import { Component } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { heroStarSolid } from '@ng-icons/heroicons/solid';\nimport { injectRatingState, NgpRating, NgpRatingItem } from 'ng-primitives/rating';\nimport { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';\n\n@Component({\n selector: 'app-rating',\n hostDirectives: [\n {\n directive: NgpRating,\n inputs: [\n 'ngpRatingValue:value',\n 'ngpRatingCount:count',\n 'ngpRatingAllowHalf:allowHalf',\n 'ngpRatingDisabled:disabled',\n 'ngpRatingReadonly:readonly',\n 'ngpRatingClearable:clearable',\n ],\n outputs: ['ngpRatingValueChange:valueChange'],\n },\n ],\n imports: [NgIcon, NgpRatingItem],\n providers: [provideIcons({ heroStarSolid }), provideValueAccessor(Rating)],\n template: `\n <span class=\"star\" *ngpRatingItem=\"let star\">\n <ng-icon class=\"star-background\" name=\"heroStarSolid\" />\n <span class=\"star-fill\" [style.width.%]=\"star.fraction * 100\">\n <ng-icon name=\"heroStarSolid\" />\n </span>\n </span>\n `,\n styles: `\n :host {\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n outline: none;\n border-radius: 0.5rem;\n cursor: pointer;\n }\n\n :host[data-disabled] {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n :host[data-readonly] {\n cursor: default;\n }\n\n :host[data-focus-visible] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: 2px;\n }\n\n .star {\n position: relative;\n display: inline-flex;\n font-size: 1.5rem;\n line-height: 1;\n color: var(--ngp-background-secondary);\n transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .star-fill {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n display: inline-flex;\n overflow: hidden;\n color: var(--ngp-primary);\n }\n `,\n host: {\n '(focusout)': 'onTouched?.()',\n },\n})\nexport class Rating implements ControlValueAccessor {\n /** Access the rating state. */\n private readonly state = injectRatingState();\n\n /** The onChange callback function. */\n private onChange?: ChangeFn<number>;\n\n /** The onTouched callback function. */\n protected onTouched?: TouchedFn;\n\n constructor() {\n // Whenever the user interacts with the rating, call onChange with the new value.\n this.state()\n .valueChange.pipe(takeUntilDestroyed())\n .subscribe(value => this.onChange?.(value));\n }\n\n writeValue(value: number): void {\n // writing a value from the model must not re-emit through onChange\n this.state().setValue(value, { emit: false });\n }\n\n registerOnChange(fn: ChangeFn<number>): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: TouchedFn): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.state().setDisabled(isDisabled);\n }\n}\n",
|
|
166
|
+
"primitive": "rating",
|
|
167
|
+
"hasVariants": false,
|
|
168
|
+
"hasSizes": true
|
|
169
|
+
},
|
|
156
170
|
{
|
|
157
171
|
"name": "search",
|
|
158
172
|
"code": "import { Component, input, model } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { heroMagnifyingGlass } from '@ng-icons/heroicons/outline';\nimport { NgpButton } from 'ng-primitives/button';\nimport { NgpInput } from 'ng-primitives/input';\nimport { NgpSearch, NgpSearchClear } from 'ng-primitives/search';\nimport { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';\n\n@Component({\n selector: 'app-search',\n hostDirectives: [NgpSearch],\n imports: [NgIcon, NgpSearchClear, NgpInput, NgpButton],\n providers: [provideValueAccessor(Search), provideIcons({ heroMagnifyingGlass })],\n template: `\n <ng-icon name=\"heroMagnifyingGlass\" />\n <input\n [value]=\"query()\"\n [placeholder]=\"placeholder()\"\n (input)=\"onQueryChange($event)\"\n ngpInput\n type=\"search\"\n />\n <button ngpSearchClear ngpButton aria-label=\"Clear search\">Clear</button>\n `,\n styles: `\n :host {\n display: block;\n position: relative;\n }\n\n [ngpInput] {\n height: 36px;\n width: 100%;\n border-radius: 8px;\n padding: 0 16px 0 40px;\n border: none;\n background: var(--ngp-background);\n box-shadow: var(--ngp-input-shadow);\n outline: none;\n }\n\n /* clears the 'X' from Chrome */\n [ngpInput]::-webkit-search-decoration,\n [ngpInput]::-webkit-search-cancel-button,\n [ngpInput]::-webkit-search-results-button,\n [ngpInput]::-webkit-search-results-decoration {\n display: none;\n }\n\n [ngpInput][data-focus] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: 0px;\n }\n\n [ngpInput]::placeholder {\n color: var(--ngp-text-placeholder);\n }\n\n [ngpButton] {\n position: absolute;\n top: 0;\n right: 0;\n height: 36px;\n padding: 0 16px;\n border: none;\n border-radius: 0 8px 8px 0;\n background-color: transparent;\n color: var(--ngp-text-blue);\n font-size: 0.875rem;\n line-height: 1.25rem;\n cursor: pointer;\n outline: none;\n display: none;\n }\n\n [ngpButton]:not([data-empty]) {\n display: block;\n }\n\n ng-icon {\n position: absolute;\n font-size: 1.25rem;\n top: 18px;\n left: 12px;\n transform: translateY(-50%);\n color: var(--ngp-text-tertiary);\n }\n `,\n host: {\n '(focusout)': 'onTouched?.()',\n },\n})\nexport class Search implements ControlValueAccessor {\n /** The search query */\n readonly query = model<string>('');\n\n /** The placeholder text */\n readonly placeholder = input<string>('');\n\n /** The function to call when the value changes */\n private onChange?: ChangeFn<string>;\n\n /** The function to call when the control is touched */\n protected onTouched?: TouchedFn;\n\n writeValue(value: string): void {\n this.query.set(value);\n }\n\n registerOnChange(fn: ChangeFn<string>): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: TouchedFn): void {\n this.onTouched = fn;\n }\n\n protected onQueryChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.query.set(input.value);\n this.onChange?.(input.value);\n }\n}\n",
|