@nordhealth/components 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1662 -1662
- package/lib/Select.js +1 -1
- package/lib/Select.js.map +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.js.map +1 -1
- package/package.json +6 -6
package/custom-elements.json
CHANGED
|
@@ -512,152 +512,233 @@
|
|
|
512
512
|
},
|
|
513
513
|
{
|
|
514
514
|
"kind": "javascript-module",
|
|
515
|
-
"path": "src/
|
|
515
|
+
"path": "src/banner/Banner.ts",
|
|
516
516
|
"declarations": [
|
|
517
517
|
{
|
|
518
518
|
"kind": "class",
|
|
519
|
-
"description": "
|
|
520
|
-
"name": "
|
|
519
|
+
"description": "Banner informs users about important changes or conditions in the\ninterface. Use this component if you need to communicate to users\nin a prominent way.",
|
|
520
|
+
"name": "Banner",
|
|
521
521
|
"cssProperties": [
|
|
522
522
|
{
|
|
523
|
-
"description": "Controls
|
|
524
|
-
"name": "--n-
|
|
525
|
-
"default": "var(--n-border-radius
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
"description": "Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).",
|
|
529
|
-
"name": "--n-button-gap",
|
|
530
|
-
"default": "var(--n-space-s)"
|
|
531
|
-
},
|
|
532
|
-
{
|
|
533
|
-
"description": "Controls the overlayed gradient background on the button.",
|
|
534
|
-
"name": "--n-button-gradient",
|
|
535
|
-
"default": "linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))"
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
"description": "Controls the border color of the button, using [color tokens](/tokens/#color).",
|
|
539
|
-
"name": "--n-button-border-color",
|
|
540
|
-
"default": "var(--n-color-border-strong)"
|
|
523
|
+
"description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
|
|
524
|
+
"name": "--n-banner-border-radius",
|
|
525
|
+
"default": "var(--n-border-radius)"
|
|
541
526
|
},
|
|
542
527
|
{
|
|
543
|
-
"description": "Controls the
|
|
544
|
-
"name": "--n-
|
|
545
|
-
"default": "
|
|
528
|
+
"description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
|
|
529
|
+
"name": "--n-banner-box-shadow",
|
|
530
|
+
"default": "var(--n-box-shadow-card)"
|
|
546
531
|
}
|
|
547
532
|
],
|
|
548
533
|
"slots": [
|
|
549
534
|
{
|
|
550
|
-
"description": "
|
|
535
|
+
"description": "default slot",
|
|
551
536
|
"name": ""
|
|
552
|
-
}
|
|
537
|
+
}
|
|
538
|
+
],
|
|
539
|
+
"members": [
|
|
553
540
|
{
|
|
554
|
-
"
|
|
555
|
-
"name": "
|
|
541
|
+
"kind": "field",
|
|
542
|
+
"name": "variant",
|
|
543
|
+
"type": {
|
|
544
|
+
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
545
|
+
},
|
|
546
|
+
"default": "\"info\"",
|
|
547
|
+
"description": "The style variant of the banner.",
|
|
548
|
+
"attribute": "variant",
|
|
549
|
+
"reflects": true
|
|
550
|
+
}
|
|
551
|
+
],
|
|
552
|
+
"attributes": [
|
|
553
|
+
{
|
|
554
|
+
"name": "variant",
|
|
555
|
+
"type": {
|
|
556
|
+
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
557
|
+
},
|
|
558
|
+
"default": "\"info\"",
|
|
559
|
+
"description": "The style variant of the banner.",
|
|
560
|
+
"fieldName": "variant"
|
|
561
|
+
}
|
|
562
|
+
],
|
|
563
|
+
"superclass": {
|
|
564
|
+
"name": "LitElement",
|
|
565
|
+
"package": "lit"
|
|
566
|
+
},
|
|
567
|
+
"status": "ready",
|
|
568
|
+
"category": "feedback",
|
|
569
|
+
"displayName": null,
|
|
570
|
+
"tagName": "nord-banner",
|
|
571
|
+
"customElement": true
|
|
572
|
+
}
|
|
573
|
+
],
|
|
574
|
+
"exports": [
|
|
575
|
+
{
|
|
576
|
+
"kind": "js",
|
|
577
|
+
"name": "default",
|
|
578
|
+
"declaration": {
|
|
579
|
+
"name": "Banner",
|
|
580
|
+
"module": "src/banner/Banner.ts"
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"kind": "custom-element-definition",
|
|
585
|
+
"name": "nord-banner",
|
|
586
|
+
"declaration": {
|
|
587
|
+
"name": "Banner",
|
|
588
|
+
"module": "src/banner/Banner.ts"
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
],
|
|
592
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use this component if you need to communicate in a prominent way.\n- Place banner at the top of the section it applies to.\n- Use for highlighting errors and success statuses.\n- Put banner close to the context it’s referring to.\n- Move focus to the banner if it’s relevant to the current workflow.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Move focus to banner if it appears on page load.\n- Use for highlighting general content or as a banner.\n- Use to replace an error page.\n\n</div>\n\n---\n\n## Content guidelines\n\nBanner content should be clear, accurate and easy to understand:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident. Please see our status page for more details.</div>\n<div class=\"n-usage n-usage-dont\">There was an error.</div>\n\nWhen writing banner content, always write it in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re Experiencing An Incident.</div>\n\nAlways end in punctuation:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re experiencing an incident</div>\n"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"kind": "javascript-module",
|
|
596
|
+
"path": "src/calendar/Calendar.ts",
|
|
597
|
+
"declarations": [
|
|
598
|
+
{
|
|
599
|
+
"kind": "class",
|
|
600
|
+
"description": "Calendar allows user to pick a date. It comes with built-in\nfunctionality that allows you to set a minimum and a maximum allowed date.\nPlease note that the date must be passed in ISO-8601 format.",
|
|
601
|
+
"name": "Calendar",
|
|
602
|
+
"cssProperties": [
|
|
603
|
+
{
|
|
604
|
+
"description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
|
|
605
|
+
"name": "--n-calendar-border-radius",
|
|
606
|
+
"default": "var(--n-border-radius)"
|
|
556
607
|
},
|
|
557
608
|
{
|
|
558
|
-
"description": "
|
|
559
|
-
"name": "
|
|
609
|
+
"description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
|
|
610
|
+
"name": "--n-calendar-box-shadow",
|
|
611
|
+
"default": "var(--n-box-shadow-popout)"
|
|
560
612
|
}
|
|
561
613
|
],
|
|
562
614
|
"members": [
|
|
563
615
|
{
|
|
564
616
|
"kind": "field",
|
|
565
|
-
"name": "
|
|
617
|
+
"name": "dialogLabelId",
|
|
618
|
+
"type": {
|
|
619
|
+
"text": "string"
|
|
620
|
+
},
|
|
621
|
+
"privacy": "private",
|
|
622
|
+
"default": "\"dialog-header\""
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"kind": "field",
|
|
626
|
+
"name": "monthSelectNode",
|
|
627
|
+
"type": {
|
|
628
|
+
"text": "HTMLElement"
|
|
629
|
+
},
|
|
566
630
|
"privacy": "private"
|
|
567
631
|
},
|
|
568
632
|
{
|
|
569
633
|
"kind": "field",
|
|
570
|
-
"name": "
|
|
634
|
+
"name": "focusedDayNode",
|
|
635
|
+
"type": {
|
|
636
|
+
"text": "HTMLButtonElement"
|
|
637
|
+
},
|
|
638
|
+
"privacy": "private"
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"kind": "field",
|
|
642
|
+
"name": "direction",
|
|
571
643
|
"privacy": "private",
|
|
572
|
-
"default": "new
|
|
644
|
+
"default": "new DirectionController(this)"
|
|
573
645
|
},
|
|
574
646
|
{
|
|
575
647
|
"kind": "field",
|
|
576
|
-
"name": "
|
|
648
|
+
"name": "swipe",
|
|
577
649
|
"privacy": "private",
|
|
578
|
-
"default": "new
|
|
650
|
+
"default": "new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })"
|
|
579
651
|
},
|
|
580
652
|
{
|
|
581
653
|
"kind": "field",
|
|
582
|
-
"name": "
|
|
654
|
+
"name": "shortcuts",
|
|
655
|
+
"privacy": "private"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"kind": "field",
|
|
659
|
+
"name": "localize",
|
|
660
|
+
"privacy": "private",
|
|
661
|
+
"default": "new LocalizeController<\"nord-calendar\">(this, {\n onLangChange: () => this.handleLangChange(),\n })"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"kind": "field",
|
|
665
|
+
"name": "dateFormatShort",
|
|
583
666
|
"type": {
|
|
584
|
-
"text": "
|
|
667
|
+
"text": "Intl.DateTimeFormat"
|
|
585
668
|
},
|
|
586
|
-
"
|
|
587
|
-
"description": "
|
|
588
|
-
"attribute": "variant",
|
|
589
|
-
"reflects": true
|
|
669
|
+
"privacy": "private",
|
|
670
|
+
"description": "Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\nthese are used to format dates exclusively for the benefit of screen readers.\n\nWe prefer DateTimeFormat over date.toLocaleDateString, as the former has\nbetter performance when formatting large number of dates. See:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance"
|
|
590
671
|
},
|
|
591
672
|
{
|
|
592
673
|
"kind": "field",
|
|
593
|
-
"name": "
|
|
674
|
+
"name": "monthNames",
|
|
594
675
|
"type": {
|
|
595
|
-
"text": "
|
|
676
|
+
"text": "string[]"
|
|
596
677
|
},
|
|
597
|
-
"
|
|
598
|
-
"description": "The type of the button.",
|
|
599
|
-
"attribute": "type",
|
|
600
|
-
"reflects": true
|
|
678
|
+
"privacy": "private"
|
|
601
679
|
},
|
|
602
680
|
{
|
|
603
681
|
"kind": "field",
|
|
604
|
-
"name": "
|
|
682
|
+
"name": "monthNamesShort",
|
|
605
683
|
"type": {
|
|
606
|
-
"text": "
|
|
684
|
+
"text": "string[]"
|
|
607
685
|
},
|
|
608
|
-
"
|
|
609
|
-
"description": "The size of the button.\nThis affects font-size and padding.",
|
|
610
|
-
"attribute": "size",
|
|
611
|
-
"reflects": true
|
|
686
|
+
"privacy": "private"
|
|
612
687
|
},
|
|
613
688
|
{
|
|
614
689
|
"kind": "field",
|
|
615
|
-
"name": "
|
|
690
|
+
"name": "dayNames",
|
|
616
691
|
"type": {
|
|
617
|
-
"text": "
|
|
692
|
+
"text": "string[]"
|
|
618
693
|
},
|
|
619
|
-
"privacy": "private"
|
|
620
|
-
"attribute": "aria-expanded"
|
|
694
|
+
"privacy": "private"
|
|
621
695
|
},
|
|
622
696
|
{
|
|
623
697
|
"kind": "field",
|
|
624
|
-
"name": "
|
|
698
|
+
"name": "dayNamesShort",
|
|
625
699
|
"type": {
|
|
626
|
-
"text": "
|
|
700
|
+
"text": "string[]"
|
|
627
701
|
},
|
|
628
|
-
"privacy": "private"
|
|
629
|
-
"attribute": "aria-haspopup"
|
|
702
|
+
"privacy": "private"
|
|
630
703
|
},
|
|
631
704
|
{
|
|
632
705
|
"kind": "field",
|
|
633
|
-
"name": "
|
|
706
|
+
"name": "value",
|
|
634
707
|
"type": {
|
|
635
|
-
"text": "string
|
|
708
|
+
"text": "string"
|
|
636
709
|
},
|
|
637
|
-
"
|
|
638
|
-
"
|
|
639
|
-
"
|
|
710
|
+
"default": "\"\"",
|
|
711
|
+
"description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
|
|
712
|
+
"attribute": "value"
|
|
640
713
|
},
|
|
641
714
|
{
|
|
642
715
|
"kind": "field",
|
|
643
|
-
"name": "
|
|
716
|
+
"name": "firstDayOfWeek",
|
|
644
717
|
"type": {
|
|
645
|
-
"text": "
|
|
718
|
+
"text": "DaysOfWeek"
|
|
646
719
|
},
|
|
647
|
-
"
|
|
648
|
-
"
|
|
649
|
-
"attribute": "download"
|
|
720
|
+
"description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
|
|
721
|
+
"attribute": "firstDayOfWeek"
|
|
650
722
|
},
|
|
651
723
|
{
|
|
652
724
|
"kind": "field",
|
|
653
|
-
"name": "
|
|
725
|
+
"name": "min",
|
|
654
726
|
"type": {
|
|
655
|
-
"text": "
|
|
727
|
+
"text": "string"
|
|
656
728
|
},
|
|
657
|
-
"default": "\"
|
|
658
|
-
"description": "
|
|
659
|
-
"attribute": "
|
|
660
|
-
|
|
729
|
+
"default": "\"\"",
|
|
730
|
+
"description": "Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the max property.",
|
|
731
|
+
"attribute": "min"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"kind": "field",
|
|
735
|
+
"name": "max",
|
|
736
|
+
"type": {
|
|
737
|
+
"text": "string"
|
|
738
|
+
},
|
|
739
|
+
"default": "\"\"",
|
|
740
|
+
"description": "Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the min property.",
|
|
741
|
+
"attribute": "max"
|
|
661
742
|
},
|
|
662
743
|
{
|
|
663
744
|
"kind": "field",
|
|
@@ -666,250 +747,239 @@
|
|
|
666
747
|
"text": "boolean"
|
|
667
748
|
},
|
|
668
749
|
"default": "false",
|
|
669
|
-
"description": "Controls whether the
|
|
750
|
+
"description": "Controls whether the calendar expands to fill the width of its container.",
|
|
670
751
|
"attribute": "expand",
|
|
671
752
|
"reflects": true
|
|
672
753
|
},
|
|
673
754
|
{
|
|
674
755
|
"kind": "field",
|
|
675
|
-
"name": "
|
|
756
|
+
"name": "isDateDisabled",
|
|
676
757
|
"type": {
|
|
677
|
-
"text": "
|
|
758
|
+
"text": "DateDisabledPredicate"
|
|
678
759
|
},
|
|
679
|
-
"default": "
|
|
680
|
-
"description": "Controls
|
|
681
|
-
"attribute": "loading",
|
|
682
|
-
"reflects": true
|
|
760
|
+
"default": "isDateDisabled",
|
|
761
|
+
"description": "Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
|
|
683
762
|
},
|
|
684
763
|
{
|
|
685
|
-
"kind": "
|
|
686
|
-
"name": "
|
|
764
|
+
"kind": "field",
|
|
765
|
+
"name": "activeFocus",
|
|
766
|
+
"type": {
|
|
767
|
+
"text": "boolean"
|
|
768
|
+
},
|
|
687
769
|
"privacy": "private",
|
|
688
|
-
"
|
|
689
|
-
|
|
690
|
-
|
|
770
|
+
"default": "false"
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"kind": "field",
|
|
774
|
+
"name": "focusedDay",
|
|
775
|
+
"privacy": "private",
|
|
776
|
+
"default": "new Date()"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"kind": "method",
|
|
780
|
+
"name": "focus",
|
|
781
|
+
"parameters": [
|
|
782
|
+
{
|
|
783
|
+
"name": "options",
|
|
784
|
+
"optional": true,
|
|
691
785
|
"type": {
|
|
692
|
-
"text": "
|
|
693
|
-
}
|
|
786
|
+
"text": "FocusOptions & { target: \"day\" | \"month\" }"
|
|
787
|
+
},
|
|
788
|
+
"description": "An object which controls aspects of the focusing process."
|
|
694
789
|
}
|
|
695
790
|
],
|
|
696
|
-
"description": "
|
|
791
|
+
"description": "Programmatically move focus to the calendar."
|
|
697
792
|
},
|
|
698
793
|
{
|
|
699
794
|
"kind": "method",
|
|
700
|
-
"name": "
|
|
795
|
+
"name": "handleValueChange",
|
|
796
|
+
"privacy": "protected"
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
"kind": "method",
|
|
800
|
+
"name": "handleFocusedDayChange",
|
|
801
|
+
"privacy": "protected"
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
"kind": "method",
|
|
805
|
+
"name": "handleLangChange",
|
|
806
|
+
"privacy": "private"
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
"kind": "field",
|
|
810
|
+
"name": "handleDaySelect",
|
|
811
|
+
"privacy": "private"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"kind": "method",
|
|
815
|
+
"name": "addDays",
|
|
701
816
|
"privacy": "private",
|
|
702
817
|
"parameters": [
|
|
703
818
|
{
|
|
704
|
-
"name": "
|
|
819
|
+
"name": "days",
|
|
705
820
|
"type": {
|
|
706
|
-
"text": "
|
|
821
|
+
"text": "number"
|
|
707
822
|
}
|
|
708
823
|
}
|
|
709
824
|
]
|
|
710
825
|
},
|
|
711
826
|
{
|
|
712
827
|
"kind": "method",
|
|
713
|
-
"name": "
|
|
828
|
+
"name": "addMonths",
|
|
829
|
+
"privacy": "private",
|
|
830
|
+
"parameters": [
|
|
831
|
+
{
|
|
832
|
+
"name": "months",
|
|
833
|
+
"type": {
|
|
834
|
+
"text": "number"
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
]
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"kind": "method",
|
|
841
|
+
"name": "addYears",
|
|
842
|
+
"privacy": "private",
|
|
843
|
+
"parameters": [
|
|
844
|
+
{
|
|
845
|
+
"name": "years",
|
|
846
|
+
"type": {
|
|
847
|
+
"text": "number"
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
]
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
"kind": "method",
|
|
854
|
+
"name": "startOfWeek",
|
|
714
855
|
"privacy": "private"
|
|
715
856
|
},
|
|
716
857
|
{
|
|
717
|
-
"kind": "
|
|
718
|
-
"name": "
|
|
858
|
+
"kind": "method",
|
|
859
|
+
"name": "endOfWeek",
|
|
719
860
|
"privacy": "private"
|
|
720
861
|
},
|
|
721
862
|
{
|
|
722
863
|
"kind": "method",
|
|
723
|
-
"name": "
|
|
864
|
+
"name": "setMonth",
|
|
724
865
|
"privacy": "private",
|
|
725
866
|
"parameters": [
|
|
726
867
|
{
|
|
727
|
-
"name": "
|
|
868
|
+
"name": "month",
|
|
728
869
|
"type": {
|
|
729
|
-
"text": "
|
|
870
|
+
"text": "number"
|
|
730
871
|
}
|
|
731
872
|
}
|
|
732
873
|
]
|
|
733
874
|
},
|
|
734
875
|
{
|
|
735
876
|
"kind": "method",
|
|
736
|
-
"name": "
|
|
877
|
+
"name": "setYear",
|
|
737
878
|
"privacy": "private",
|
|
738
879
|
"parameters": [
|
|
739
880
|
{
|
|
740
|
-
"name": "
|
|
881
|
+
"name": "year",
|
|
741
882
|
"type": {
|
|
742
|
-
"text": "
|
|
883
|
+
"text": "number"
|
|
743
884
|
}
|
|
744
885
|
}
|
|
745
|
-
]
|
|
746
|
-
"description": "React/Vue etc may remove our proxy button when updating button text, since they are unaware of its existence.\nSo we listen for a slotchange event, and if the element is no longer connected to the DOM we add it back in."
|
|
886
|
+
]
|
|
747
887
|
},
|
|
748
888
|
{
|
|
749
|
-
"kind": "
|
|
750
|
-
"name": "
|
|
751
|
-
"
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
761
|
-
}
|
|
889
|
+
"kind": "method",
|
|
890
|
+
"name": "setFocusedDay",
|
|
891
|
+
"privacy": "private",
|
|
892
|
+
"parameters": [
|
|
893
|
+
{
|
|
894
|
+
"name": "day",
|
|
895
|
+
"type": {
|
|
896
|
+
"text": "Date"
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
]
|
|
762
900
|
},
|
|
763
901
|
{
|
|
764
902
|
"kind": "field",
|
|
765
|
-
"name": "
|
|
766
|
-
"
|
|
767
|
-
"text": "string | undefined"
|
|
768
|
-
},
|
|
769
|
-
"description": "The name of the form component.",
|
|
770
|
-
"attribute": "name",
|
|
771
|
-
"inheritedFrom": {
|
|
772
|
-
"name": "InputMixin",
|
|
773
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
774
|
-
}
|
|
903
|
+
"name": "handleMonthSelect",
|
|
904
|
+
"privacy": "private"
|
|
775
905
|
},
|
|
776
906
|
{
|
|
777
907
|
"kind": "field",
|
|
778
|
-
"name": "
|
|
779
|
-
"
|
|
780
|
-
"text": "string"
|
|
781
|
-
},
|
|
782
|
-
"default": "\"\"",
|
|
783
|
-
"description": "The value of the form component.",
|
|
784
|
-
"attribute": "value",
|
|
785
|
-
"inheritedFrom": {
|
|
786
|
-
"name": "InputMixin",
|
|
787
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
788
|
-
}
|
|
908
|
+
"name": "handleYearSelect",
|
|
909
|
+
"privacy": "private"
|
|
789
910
|
},
|
|
790
911
|
{
|
|
791
912
|
"kind": "field",
|
|
792
|
-
"name": "
|
|
793
|
-
"
|
|
794
|
-
"inheritedFrom": {
|
|
795
|
-
"name": "InputMixin",
|
|
796
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
797
|
-
}
|
|
913
|
+
"name": "handleNextMonthClick",
|
|
914
|
+
"privacy": "private"
|
|
798
915
|
},
|
|
799
916
|
{
|
|
800
917
|
"kind": "field",
|
|
801
|
-
"name": "
|
|
802
|
-
"privacy": "
|
|
803
|
-
"inheritedFrom": {
|
|
804
|
-
"name": "FocusableMixin",
|
|
805
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
806
|
-
}
|
|
807
|
-
},
|
|
808
|
-
{
|
|
809
|
-
"kind": "method",
|
|
810
|
-
"name": "focus",
|
|
811
|
-
"parameters": [
|
|
812
|
-
{
|
|
813
|
-
"name": "options",
|
|
814
|
-
"optional": true,
|
|
815
|
-
"type": {
|
|
816
|
-
"text": "FocusOptions"
|
|
817
|
-
},
|
|
818
|
-
"description": "An object which controls aspects of the focusing process."
|
|
819
|
-
}
|
|
820
|
-
],
|
|
821
|
-
"description": "Programmatically move focus to the component.",
|
|
822
|
-
"inheritedFrom": {
|
|
823
|
-
"name": "FocusableMixin",
|
|
824
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
825
|
-
}
|
|
918
|
+
"name": "handlePreviousMonthClick",
|
|
919
|
+
"privacy": "private"
|
|
826
920
|
},
|
|
827
921
|
{
|
|
828
|
-
"kind": "
|
|
829
|
-
"name": "
|
|
830
|
-
"
|
|
831
|
-
"inheritedFrom": {
|
|
832
|
-
"name": "FocusableMixin",
|
|
833
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
834
|
-
}
|
|
922
|
+
"kind": "field",
|
|
923
|
+
"name": "enableActiveFocus",
|
|
924
|
+
"privacy": "private"
|
|
835
925
|
},
|
|
836
926
|
{
|
|
837
|
-
"kind": "
|
|
838
|
-
"name": "
|
|
839
|
-
"
|
|
840
|
-
"inheritedFrom": {
|
|
841
|
-
"name": "FocusableMixin",
|
|
842
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
843
|
-
}
|
|
927
|
+
"kind": "field",
|
|
928
|
+
"name": "disableActiveFocus",
|
|
929
|
+
"privacy": "private"
|
|
844
930
|
}
|
|
845
931
|
],
|
|
846
|
-
"
|
|
932
|
+
"events": [
|
|
847
933
|
{
|
|
848
|
-
"name": "
|
|
934
|
+
"name": "nord-focus-date",
|
|
849
935
|
"type": {
|
|
850
|
-
"text": "
|
|
936
|
+
"text": "DateSelectEvent"
|
|
851
937
|
},
|
|
852
|
-
"
|
|
853
|
-
"description": "The style variant of the button.",
|
|
854
|
-
"fieldName": "variant"
|
|
938
|
+
"description": "Dispatched when the calendar's focused date changes."
|
|
855
939
|
},
|
|
856
940
|
{
|
|
857
|
-
"name": "type",
|
|
858
941
|
"type": {
|
|
859
|
-
"text": "
|
|
942
|
+
"text": "DateSelectEvent"
|
|
860
943
|
},
|
|
861
|
-
"
|
|
862
|
-
"
|
|
863
|
-
|
|
864
|
-
|
|
944
|
+
"description": "Dispatched when a date is selected and the value changes.",
|
|
945
|
+
"name": "change"
|
|
946
|
+
}
|
|
947
|
+
],
|
|
948
|
+
"attributes": [
|
|
865
949
|
{
|
|
866
|
-
"name": "
|
|
950
|
+
"name": "value",
|
|
867
951
|
"type": {
|
|
868
|
-
"text": "
|
|
952
|
+
"text": "string"
|
|
869
953
|
},
|
|
870
|
-
"default": "\"
|
|
871
|
-
"description": "The
|
|
872
|
-
"fieldName": "
|
|
954
|
+
"default": "\"\"",
|
|
955
|
+
"description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
|
|
956
|
+
"fieldName": "value"
|
|
873
957
|
},
|
|
874
958
|
{
|
|
875
|
-
"name": "
|
|
959
|
+
"name": "firstDayOfWeek",
|
|
876
960
|
"type": {
|
|
877
|
-
"text": "
|
|
961
|
+
"text": "DaysOfWeek"
|
|
878
962
|
},
|
|
879
|
-
"
|
|
963
|
+
"description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
|
|
964
|
+
"fieldName": "firstDayOfWeek"
|
|
880
965
|
},
|
|
881
966
|
{
|
|
882
|
-
"name": "
|
|
967
|
+
"name": "min",
|
|
883
968
|
"type": {
|
|
884
|
-
"text": "
|
|
969
|
+
"text": "string"
|
|
885
970
|
},
|
|
886
|
-
"
|
|
971
|
+
"default": "\"\"",
|
|
972
|
+
"description": "Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the max property.",
|
|
973
|
+
"fieldName": "min"
|
|
887
974
|
},
|
|
888
975
|
{
|
|
889
|
-
"name": "
|
|
976
|
+
"name": "max",
|
|
890
977
|
"type": {
|
|
891
|
-
"text": "string
|
|
978
|
+
"text": "string"
|
|
892
979
|
},
|
|
893
|
-
"
|
|
894
|
-
"
|
|
895
|
-
|
|
896
|
-
{
|
|
897
|
-
"name": "download",
|
|
898
|
-
"type": {
|
|
899
|
-
"text": "boolean"
|
|
900
|
-
},
|
|
901
|
-
"default": "false",
|
|
902
|
-
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
903
|
-
"fieldName": "download"
|
|
904
|
-
},
|
|
905
|
-
{
|
|
906
|
-
"name": "target",
|
|
907
|
-
"type": {
|
|
908
|
-
"text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
|
|
909
|
-
},
|
|
910
|
-
"default": "\"_self\"",
|
|
911
|
-
"description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
|
|
912
|
-
"fieldName": "target"
|
|
980
|
+
"default": "\"\"",
|
|
981
|
+
"description": "Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the min property.",
|
|
982
|
+
"fieldName": "max"
|
|
913
983
|
},
|
|
914
984
|
{
|
|
915
985
|
"name": "expand",
|
|
@@ -917,65 +987,8 @@
|
|
|
917
987
|
"text": "boolean"
|
|
918
988
|
},
|
|
919
989
|
"default": "false",
|
|
920
|
-
"description": "Controls whether the
|
|
990
|
+
"description": "Controls whether the calendar expands to fill the width of its container.",
|
|
921
991
|
"fieldName": "expand"
|
|
922
|
-
},
|
|
923
|
-
{
|
|
924
|
-
"name": "loading",
|
|
925
|
-
"type": {
|
|
926
|
-
"text": "boolean"
|
|
927
|
-
},
|
|
928
|
-
"default": "false",
|
|
929
|
-
"description": "Controls whether the button is in loading state. Please note that the spinner\nis hidden from assistive technologies, so you need to make sure to announce\nthe loading state to e.g. screen reader users. We also recommend disabling\nall user interactions on the button itself while in loading state.",
|
|
930
|
-
"fieldName": "loading"
|
|
931
|
-
},
|
|
932
|
-
{
|
|
933
|
-
"name": "disabled",
|
|
934
|
-
"type": {
|
|
935
|
-
"text": "boolean"
|
|
936
|
-
},
|
|
937
|
-
"default": "false",
|
|
938
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
939
|
-
"fieldName": "disabled",
|
|
940
|
-
"inheritedFrom": {
|
|
941
|
-
"name": "InputMixin",
|
|
942
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
943
|
-
}
|
|
944
|
-
},
|
|
945
|
-
{
|
|
946
|
-
"name": "name",
|
|
947
|
-
"type": {
|
|
948
|
-
"text": "string | undefined"
|
|
949
|
-
},
|
|
950
|
-
"description": "The name of the form component.",
|
|
951
|
-
"fieldName": "name",
|
|
952
|
-
"inheritedFrom": {
|
|
953
|
-
"name": "InputMixin",
|
|
954
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
955
|
-
}
|
|
956
|
-
},
|
|
957
|
-
{
|
|
958
|
-
"name": "value",
|
|
959
|
-
"type": {
|
|
960
|
-
"text": "string"
|
|
961
|
-
},
|
|
962
|
-
"default": "\"\"",
|
|
963
|
-
"description": "The value of the form component.",
|
|
964
|
-
"fieldName": "value",
|
|
965
|
-
"inheritedFrom": {
|
|
966
|
-
"name": "InputMixin",
|
|
967
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
],
|
|
971
|
-
"mixins": [
|
|
972
|
-
{
|
|
973
|
-
"name": "InputMixin",
|
|
974
|
-
"module": "/src/common/mixins/InputMixin.js"
|
|
975
|
-
},
|
|
976
|
-
{
|
|
977
|
-
"name": "FocusableMixin",
|
|
978
|
-
"module": "/src/common/mixins/FocusableMixin.js"
|
|
979
992
|
}
|
|
980
993
|
],
|
|
981
994
|
"superclass": {
|
|
@@ -983,9 +996,9 @@
|
|
|
983
996
|
"package": "lit"
|
|
984
997
|
},
|
|
985
998
|
"status": "ready",
|
|
986
|
-
"category": "
|
|
999
|
+
"category": "list",
|
|
987
1000
|
"displayName": null,
|
|
988
|
-
"tagName": "nord-
|
|
1001
|
+
"tagName": "nord-calendar",
|
|
989
1002
|
"customElement": true
|
|
990
1003
|
}
|
|
991
1004
|
],
|
|
@@ -994,69 +1007,174 @@
|
|
|
994
1007
|
"kind": "js",
|
|
995
1008
|
"name": "default",
|
|
996
1009
|
"declaration": {
|
|
997
|
-
"name": "
|
|
998
|
-
"module": "src/
|
|
1010
|
+
"name": "Calendar",
|
|
1011
|
+
"module": "src/calendar/Calendar.ts"
|
|
999
1012
|
}
|
|
1000
1013
|
},
|
|
1001
1014
|
{
|
|
1002
1015
|
"kind": "custom-element-definition",
|
|
1003
|
-
"name": "nord-
|
|
1016
|
+
"name": "nord-calendar",
|
|
1004
1017
|
"declaration": {
|
|
1005
|
-
"name": "
|
|
1006
|
-
"module": "src/
|
|
1018
|
+
"name": "Calendar",
|
|
1019
|
+
"module": "src/calendar/Calendar.ts"
|
|
1007
1020
|
}
|
|
1008
1021
|
}
|
|
1009
1022
|
],
|
|
1010
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n-
|
|
1023
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1011
1024
|
},
|
|
1012
1025
|
{
|
|
1013
1026
|
"kind": "javascript-module",
|
|
1014
|
-
"path": "src/
|
|
1027
|
+
"path": "src/calendar/DateSelectEvent.ts",
|
|
1015
1028
|
"declarations": [
|
|
1016
1029
|
{
|
|
1017
1030
|
"kind": "class",
|
|
1018
|
-
"description": "
|
|
1019
|
-
"name": "
|
|
1020
|
-
"
|
|
1031
|
+
"description": "",
|
|
1032
|
+
"name": "DateSelectEvent",
|
|
1033
|
+
"superclass": {
|
|
1034
|
+
"name": "NordEvent",
|
|
1035
|
+
"module": "/src/common/events.js"
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
],
|
|
1039
|
+
"exports": [
|
|
1040
|
+
{
|
|
1041
|
+
"kind": "js",
|
|
1042
|
+
"name": "DateSelectEvent",
|
|
1043
|
+
"declaration": {
|
|
1044
|
+
"name": "DateSelectEvent",
|
|
1045
|
+
"module": "src/calendar/DateSelectEvent.ts"
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
],
|
|
1049
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
"kind": "javascript-module",
|
|
1053
|
+
"path": "src/calendar/localization.ts",
|
|
1054
|
+
"declarations": [
|
|
1055
|
+
{
|
|
1056
|
+
"kind": "variable",
|
|
1057
|
+
"name": "calendarLocalization",
|
|
1058
|
+
"type": {
|
|
1059
|
+
"text": "object"
|
|
1060
|
+
},
|
|
1061
|
+
"default": "{\n prevMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n}"
|
|
1062
|
+
}
|
|
1063
|
+
],
|
|
1064
|
+
"exports": [
|
|
1065
|
+
{
|
|
1066
|
+
"kind": "js",
|
|
1067
|
+
"name": "default",
|
|
1068
|
+
"declaration": {
|
|
1069
|
+
"name": "calendarLocalization",
|
|
1070
|
+
"module": "src/calendar/localization.ts"
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
],
|
|
1074
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
"kind": "javascript-module",
|
|
1078
|
+
"path": "src/calendar/month-view.ts",
|
|
1079
|
+
"declarations": [
|
|
1080
|
+
{
|
|
1081
|
+
"kind": "function",
|
|
1082
|
+
"name": "dayView",
|
|
1083
|
+
"parameters": [
|
|
1021
1084
|
{
|
|
1022
|
-
"
|
|
1023
|
-
"
|
|
1024
|
-
|
|
1025
|
-
|
|
1085
|
+
"name": "{\n focusedDay,\n today,\n day,\n onDaySelect,\n onKeyboardNavigation,\n disabled,\n inRange,\n isSelected,\n dateFormatter,\n}",
|
|
1086
|
+
"type": {
|
|
1087
|
+
"text": "DatePickerDayProps"
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
]
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
"kind": "function",
|
|
1094
|
+
"name": "monthView",
|
|
1095
|
+
"parameters": [
|
|
1026
1096
|
{
|
|
1027
|
-
"
|
|
1028
|
-
"
|
|
1029
|
-
|
|
1097
|
+
"name": "{\n onFocusIn,\n onFocusOut,\n selectedDate,\n focusedDate,\n labelledById,\n dayNames,\n dayNamesShort,\n firstDayOfWeek,\n min,\n max,\n dateFormatter,\n isDateDisabled,\n onDateSelect,\n onKeyboardNavigation,\n}",
|
|
1098
|
+
"type": {
|
|
1099
|
+
"text": "MonthViewArgs"
|
|
1100
|
+
}
|
|
1030
1101
|
}
|
|
1031
|
-
]
|
|
1102
|
+
]
|
|
1103
|
+
}
|
|
1104
|
+
],
|
|
1105
|
+
"exports": [
|
|
1106
|
+
{
|
|
1107
|
+
"kind": "js",
|
|
1108
|
+
"name": "dayView",
|
|
1109
|
+
"declaration": {
|
|
1110
|
+
"name": "dayView",
|
|
1111
|
+
"module": "src/calendar/month-view.ts"
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
"kind": "js",
|
|
1116
|
+
"name": "monthView",
|
|
1117
|
+
"declaration": {
|
|
1118
|
+
"name": "monthView",
|
|
1119
|
+
"module": "src/calendar/month-view.ts"
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
],
|
|
1123
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
"kind": "javascript-module",
|
|
1127
|
+
"path": "src/badge/Badge.ts",
|
|
1128
|
+
"declarations": [
|
|
1129
|
+
{
|
|
1130
|
+
"kind": "class",
|
|
1131
|
+
"description": "Badges are used to inform users of the status of an object\nor of an action that’s been taken. Commonly used in tabular\ndata to indicate status.",
|
|
1132
|
+
"name": "Badge",
|
|
1032
1133
|
"slots": [
|
|
1033
1134
|
{
|
|
1034
|
-
"description": "
|
|
1135
|
+
"description": "The badge content.",
|
|
1035
1136
|
"name": ""
|
|
1036
1137
|
}
|
|
1037
1138
|
],
|
|
1038
1139
|
"members": [
|
|
1039
1140
|
{
|
|
1040
1141
|
"kind": "field",
|
|
1041
|
-
"name": "
|
|
1142
|
+
"name": "type",
|
|
1042
1143
|
"type": {
|
|
1043
|
-
"text": "\"
|
|
1144
|
+
"text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
|
|
1044
1145
|
},
|
|
1045
|
-
"default": "\"
|
|
1046
|
-
"description": "The
|
|
1047
|
-
"attribute": "
|
|
1146
|
+
"default": "\"neutral\"",
|
|
1147
|
+
"description": "The type of badge.\nDetermines the background color of the badge.",
|
|
1148
|
+
"attribute": "type",
|
|
1048
1149
|
"reflects": true
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
"kind": "field",
|
|
1153
|
+
"name": "progress",
|
|
1154
|
+
"type": {
|
|
1155
|
+
"text": "\"cancelled\" | \"complete\" | \"incomplete\" | \"partially-complete\" | undefined"
|
|
1156
|
+
},
|
|
1157
|
+
"description": "The progress of the badge. Displays a progress\nindicator next to the label.",
|
|
1158
|
+
"attribute": "progress"
|
|
1049
1159
|
}
|
|
1050
1160
|
],
|
|
1051
1161
|
"attributes": [
|
|
1052
1162
|
{
|
|
1053
|
-
"name": "
|
|
1163
|
+
"name": "type",
|
|
1054
1164
|
"type": {
|
|
1055
|
-
"text": "\"
|
|
1165
|
+
"text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
|
|
1056
1166
|
},
|
|
1057
|
-
"default": "\"
|
|
1058
|
-
"description": "The
|
|
1059
|
-
"fieldName": "
|
|
1167
|
+
"default": "\"neutral\"",
|
|
1168
|
+
"description": "The type of badge.\nDetermines the background color of the badge.",
|
|
1169
|
+
"fieldName": "type"
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
"name": "progress",
|
|
1173
|
+
"type": {
|
|
1174
|
+
"text": "\"cancelled\" | \"complete\" | \"incomplete\" | \"partially-complete\" | undefined"
|
|
1175
|
+
},
|
|
1176
|
+
"description": "The progress of the badge. Displays a progress\nindicator next to the label.",
|
|
1177
|
+
"fieldName": "progress"
|
|
1060
1178
|
}
|
|
1061
1179
|
],
|
|
1062
1180
|
"superclass": {
|
|
@@ -1064,9 +1182,9 @@
|
|
|
1064
1182
|
"package": "lit"
|
|
1065
1183
|
},
|
|
1066
1184
|
"status": "ready",
|
|
1067
|
-
"category": "
|
|
1185
|
+
"category": "text",
|
|
1068
1186
|
"displayName": null,
|
|
1069
|
-
"tagName": "nord-
|
|
1187
|
+
"tagName": "nord-badge",
|
|
1070
1188
|
"customElement": true
|
|
1071
1189
|
}
|
|
1072
1190
|
],
|
|
@@ -1075,605 +1193,690 @@
|
|
|
1075
1193
|
"kind": "js",
|
|
1076
1194
|
"name": "default",
|
|
1077
1195
|
"declaration": {
|
|
1078
|
-
"name": "
|
|
1079
|
-
"module": "src/
|
|
1196
|
+
"name": "Badge",
|
|
1197
|
+
"module": "src/badge/Badge.ts"
|
|
1080
1198
|
}
|
|
1081
1199
|
},
|
|
1082
1200
|
{
|
|
1083
1201
|
"kind": "custom-element-definition",
|
|
1084
|
-
"name": "nord-
|
|
1202
|
+
"name": "nord-badge",
|
|
1085
1203
|
"declaration": {
|
|
1086
|
-
"name": "
|
|
1087
|
-
"module": "src/
|
|
1204
|
+
"name": "Badge",
|
|
1205
|
+
"module": "src/badge/Badge.ts"
|
|
1088
1206
|
}
|
|
1089
1207
|
}
|
|
1090
1208
|
],
|
|
1091
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use
|
|
1209
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use established variants and color patterns so that users can clearly identify the importance level.\n- Use to show a status update on a piece of information or action.\n- Use to mark something as a “draft” or “new”.\n- Use when you want to highlight something that has been added recently.\n- Always position badge so that it’s clear to understand what object it’s related to.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make badges clickable. Instead use button component’s small variant.\n- Don’t use alternatives to existing badge variants.\n\n</div>\n\n---\n\n## Content guidelines\n\nBadge labels should use a single word to describe the status of an object. Only use two words if you need to describe a complex state:\n\n<div class=\"n-usage n-usage-do\">Complete</div>\n<div class=\"n-usage n-usage-dont\">Action completed</div>\n\nWhen writing badge labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">Partially refunded</div>\n<div class=\"n-usage n-usage-dont\">Partially Refunded</div>\n\nAvoid unnecessary words and articles in badge labels, such as “is”, “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Pending</div>\n<div class=\"n-usage n-usage-dont\">Item is pending</div>\n\nAlways describe the status in the past tense:\n\n<div class=\"n-usage n-usage-do\">Refunded</div>\n<div class=\"n-usage n-usage-dont\">Refund</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `neutral` | The default style variant. |\n| `info` | Used to convey general information that isn’t critical. |\n| `success` | Used to convey success states. For example, you might want to show a badge that tells the user a payment was successful. |\n| `highlight` | Used to highlight specific items in the interface, like notifications. |\n| `danger` | Used to communicate problems that have to be resolved so that user can continue forward. Should always be used for highlighting errors. |\n| `warning` | Used to display information that needs a user’s attention attention and may require further steps. |\n| `progress` | Used to convey something that’s in progress. |\n"
|
|
1092
1210
|
},
|
|
1093
1211
|
{
|
|
1094
1212
|
"kind": "javascript-module",
|
|
1095
|
-
"path": "src/
|
|
1213
|
+
"path": "src/card/Card.ts",
|
|
1096
1214
|
"declarations": [
|
|
1097
1215
|
{
|
|
1098
1216
|
"kind": "class",
|
|
1099
|
-
"description": "
|
|
1100
|
-
"name": "
|
|
1217
|
+
"description": "Cards are shadowed surfaces that display content and actions on a\nsingle topic. They should be easy to scan for relevant and\nactionable information.",
|
|
1218
|
+
"name": "Card",
|
|
1101
1219
|
"cssProperties": [
|
|
1102
1220
|
{
|
|
1103
1221
|
"description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
|
|
1104
|
-
"name": "--n-
|
|
1222
|
+
"name": "--n-card-border-radius",
|
|
1105
1223
|
"default": "var(--n-border-radius)"
|
|
1106
1224
|
},
|
|
1107
1225
|
{
|
|
1108
1226
|
"description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
|
|
1109
|
-
"name": "--n-
|
|
1227
|
+
"name": "--n-card-box-shadow",
|
|
1110
1228
|
"default": "var(--n-box-shadow-popout)"
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
"description": "Controls the padding on all sides of the card.",
|
|
1232
|
+
"name": "--n-card-padding",
|
|
1233
|
+
"default": "var(--n-space-m)"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"description": "Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.",
|
|
1237
|
+
"name": "--n-card-slot-padding",
|
|
1238
|
+
"default": "var(--n-space-m)"
|
|
1111
1239
|
}
|
|
1112
1240
|
],
|
|
1113
|
-
"
|
|
1241
|
+
"slots": [
|
|
1114
1242
|
{
|
|
1115
|
-
"
|
|
1116
|
-
"name": "
|
|
1117
|
-
"type": {
|
|
1118
|
-
"text": "string"
|
|
1119
|
-
},
|
|
1120
|
-
"privacy": "private",
|
|
1121
|
-
"default": "\"dialog-header\""
|
|
1243
|
+
"description": "The card content.",
|
|
1244
|
+
"name": ""
|
|
1122
1245
|
},
|
|
1123
1246
|
{
|
|
1124
|
-
"
|
|
1125
|
-
"name": "
|
|
1126
|
-
"type": {
|
|
1127
|
-
"text": "HTMLElement"
|
|
1128
|
-
},
|
|
1129
|
-
"privacy": "private"
|
|
1247
|
+
"description": "Optional slot that holds a header for the card.",
|
|
1248
|
+
"name": "header"
|
|
1130
1249
|
},
|
|
1131
1250
|
{
|
|
1132
|
-
"
|
|
1133
|
-
"name": "
|
|
1134
|
-
"type": {
|
|
1135
|
-
"text": "HTMLButtonElement"
|
|
1136
|
-
},
|
|
1137
|
-
"privacy": "private"
|
|
1251
|
+
"description": "Optional slot that positions content at the end of the header. Useful for actions or additional info.",
|
|
1252
|
+
"name": "header-end"
|
|
1138
1253
|
},
|
|
1139
1254
|
{
|
|
1140
|
-
"
|
|
1141
|
-
"name": "
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1255
|
+
"description": "Optional slot that holds footer content for the card.",
|
|
1256
|
+
"name": "footer"
|
|
1257
|
+
}
|
|
1258
|
+
],
|
|
1259
|
+
"members": [
|
|
1145
1260
|
{
|
|
1146
1261
|
"kind": "field",
|
|
1147
|
-
"name": "
|
|
1262
|
+
"name": "headerSlot",
|
|
1148
1263
|
"privacy": "private",
|
|
1149
|
-
"default": "new
|
|
1264
|
+
"default": "new SlotController(this, \"header\")"
|
|
1150
1265
|
},
|
|
1151
1266
|
{
|
|
1152
1267
|
"kind": "field",
|
|
1153
|
-
"name": "
|
|
1154
|
-
"privacy": "private"
|
|
1268
|
+
"name": "headerEndSlot",
|
|
1269
|
+
"privacy": "private",
|
|
1270
|
+
"default": "new SlotController(this, \"header-end\")"
|
|
1155
1271
|
},
|
|
1156
1272
|
{
|
|
1157
1273
|
"kind": "field",
|
|
1158
|
-
"name": "
|
|
1274
|
+
"name": "footerSlot",
|
|
1159
1275
|
"privacy": "private",
|
|
1160
|
-
"default": "new
|
|
1276
|
+
"default": "new SlotController(this, \"footer\")"
|
|
1161
1277
|
},
|
|
1162
1278
|
{
|
|
1163
1279
|
"kind": "field",
|
|
1164
|
-
"name": "
|
|
1280
|
+
"name": "padding",
|
|
1165
1281
|
"type": {
|
|
1166
|
-
"text": "
|
|
1282
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
1167
1283
|
},
|
|
1168
|
-
"
|
|
1169
|
-
"description": "
|
|
1170
|
-
|
|
1284
|
+
"default": "\"m\"",
|
|
1285
|
+
"description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1286
|
+
"attribute": "padding",
|
|
1287
|
+
"reflects": true
|
|
1288
|
+
}
|
|
1289
|
+
],
|
|
1290
|
+
"attributes": [
|
|
1171
1291
|
{
|
|
1172
|
-
"
|
|
1173
|
-
"name": "monthNames",
|
|
1292
|
+
"name": "padding",
|
|
1174
1293
|
"type": {
|
|
1175
|
-
"text": "
|
|
1294
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
1176
1295
|
},
|
|
1177
|
-
"
|
|
1296
|
+
"default": "\"m\"",
|
|
1297
|
+
"description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1298
|
+
"fieldName": "padding"
|
|
1299
|
+
}
|
|
1300
|
+
],
|
|
1301
|
+
"superclass": {
|
|
1302
|
+
"name": "LitElement",
|
|
1303
|
+
"package": "lit"
|
|
1304
|
+
},
|
|
1305
|
+
"status": "ready",
|
|
1306
|
+
"category": "structure",
|
|
1307
|
+
"displayName": null,
|
|
1308
|
+
"tagName": "nord-card",
|
|
1309
|
+
"customElement": true
|
|
1310
|
+
}
|
|
1311
|
+
],
|
|
1312
|
+
"exports": [
|
|
1313
|
+
{
|
|
1314
|
+
"kind": "js",
|
|
1315
|
+
"name": "default",
|
|
1316
|
+
"declaration": {
|
|
1317
|
+
"name": "Card",
|
|
1318
|
+
"module": "src/card/Card.ts"
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
"kind": "custom-element-definition",
|
|
1323
|
+
"name": "nord-card",
|
|
1324
|
+
"declaration": {
|
|
1325
|
+
"name": "Card",
|
|
1326
|
+
"module": "src/card/Card.ts"
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
],
|
|
1330
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n"
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
"kind": "javascript-module",
|
|
1334
|
+
"path": "src/checkbox/Checkbox.ts",
|
|
1335
|
+
"declarations": [
|
|
1336
|
+
{
|
|
1337
|
+
"kind": "class",
|
|
1338
|
+
"description": "Checkboxes allow user to choose one or more options from a limited set of options.\nIf you have more than 10 options, please use Select component instead.",
|
|
1339
|
+
"name": "Checkbox",
|
|
1340
|
+
"slots": [
|
|
1341
|
+
{
|
|
1342
|
+
"description": "Use when a label requires more than plain text.",
|
|
1343
|
+
"name": "label"
|
|
1178
1344
|
},
|
|
1179
1345
|
{
|
|
1180
|
-
"
|
|
1181
|
-
"name": "
|
|
1182
|
-
"type": {
|
|
1183
|
-
"text": "string[]"
|
|
1184
|
-
},
|
|
1185
|
-
"privacy": "private"
|
|
1346
|
+
"description": "Optional slot that holds hint text for the input.",
|
|
1347
|
+
"name": "hint"
|
|
1186
1348
|
},
|
|
1349
|
+
{
|
|
1350
|
+
"description": "Optional slot that holds error text for the input.",
|
|
1351
|
+
"name": "error"
|
|
1352
|
+
}
|
|
1353
|
+
],
|
|
1354
|
+
"members": [
|
|
1187
1355
|
{
|
|
1188
1356
|
"kind": "field",
|
|
1189
|
-
"name": "
|
|
1190
|
-
"
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1357
|
+
"name": "formValue",
|
|
1358
|
+
"privacy": "protected",
|
|
1359
|
+
"inheritedFrom": {
|
|
1360
|
+
"name": "FormAssociatedMixin",
|
|
1361
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1362
|
+
}
|
|
1194
1363
|
},
|
|
1195
1364
|
{
|
|
1196
1365
|
"kind": "field",
|
|
1197
|
-
"name": "
|
|
1366
|
+
"name": "indeterminate",
|
|
1198
1367
|
"type": {
|
|
1199
|
-
"text": "
|
|
1368
|
+
"text": "boolean"
|
|
1200
1369
|
},
|
|
1201
|
-
"
|
|
1370
|
+
"default": "false",
|
|
1371
|
+
"description": "Controls whether the checkbox is in an indeterminate state.",
|
|
1372
|
+
"attribute": "indeterminate"
|
|
1202
1373
|
},
|
|
1203
1374
|
{
|
|
1204
1375
|
"kind": "field",
|
|
1205
|
-
"name": "
|
|
1376
|
+
"name": "checked",
|
|
1206
1377
|
"type": {
|
|
1207
|
-
"text": "
|
|
1378
|
+
"text": "boolean"
|
|
1208
1379
|
},
|
|
1209
|
-
"default": "
|
|
1210
|
-
"description": "
|
|
1211
|
-
"attribute": "
|
|
1380
|
+
"default": "false",
|
|
1381
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
1382
|
+
"attribute": "checked"
|
|
1212
1383
|
},
|
|
1213
1384
|
{
|
|
1214
|
-
"kind": "
|
|
1215
|
-
"name": "
|
|
1216
|
-
"
|
|
1217
|
-
|
|
1385
|
+
"kind": "method",
|
|
1386
|
+
"name": "handleChange",
|
|
1387
|
+
"privacy": "protected",
|
|
1388
|
+
"parameters": [
|
|
1389
|
+
{
|
|
1390
|
+
"name": "e",
|
|
1391
|
+
"type": {
|
|
1392
|
+
"text": "Event"
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
],
|
|
1396
|
+
"return": {
|
|
1397
|
+
"type": {
|
|
1398
|
+
"text": "void"
|
|
1399
|
+
}
|
|
1218
1400
|
},
|
|
1219
|
-
"
|
|
1220
|
-
|
|
1401
|
+
"inheritedFrom": {
|
|
1402
|
+
"name": "FormAssociatedMixin",
|
|
1403
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1404
|
+
}
|
|
1221
1405
|
},
|
|
1222
1406
|
{
|
|
1223
1407
|
"kind": "field",
|
|
1224
|
-
"name": "
|
|
1225
|
-
"
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1408
|
+
"name": "labelSlot",
|
|
1409
|
+
"privacy": "protected",
|
|
1410
|
+
"default": "new SlotController(this, \"label\")",
|
|
1411
|
+
"inheritedFrom": {
|
|
1412
|
+
"name": "FormAssociatedMixin",
|
|
1413
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1414
|
+
}
|
|
1231
1415
|
},
|
|
1232
1416
|
{
|
|
1233
1417
|
"kind": "field",
|
|
1234
|
-
"name": "
|
|
1235
|
-
"
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1418
|
+
"name": "errorSlot",
|
|
1419
|
+
"privacy": "protected",
|
|
1420
|
+
"default": "new SlotController(this, \"error\")",
|
|
1421
|
+
"inheritedFrom": {
|
|
1422
|
+
"name": "FormAssociatedMixin",
|
|
1423
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1424
|
+
}
|
|
1241
1425
|
},
|
|
1242
1426
|
{
|
|
1243
1427
|
"kind": "field",
|
|
1244
|
-
"name": "
|
|
1245
|
-
"
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
"reflects": true
|
|
1428
|
+
"name": "hintSlot",
|
|
1429
|
+
"privacy": "protected",
|
|
1430
|
+
"default": "new SlotController(this, \"hint\")",
|
|
1431
|
+
"inheritedFrom": {
|
|
1432
|
+
"name": "FormAssociatedMixin",
|
|
1433
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1434
|
+
}
|
|
1252
1435
|
},
|
|
1253
1436
|
{
|
|
1254
1437
|
"kind": "field",
|
|
1255
|
-
"name": "
|
|
1256
|
-
"
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1438
|
+
"name": "formData",
|
|
1439
|
+
"privacy": "protected",
|
|
1440
|
+
"default": "new FormDataController(this, { value: () => this.formValue })",
|
|
1441
|
+
"inheritedFrom": {
|
|
1442
|
+
"name": "FormAssociatedMixin",
|
|
1443
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1444
|
+
}
|
|
1261
1445
|
},
|
|
1262
1446
|
{
|
|
1263
1447
|
"kind": "field",
|
|
1264
|
-
"name": "
|
|
1448
|
+
"name": "inputId",
|
|
1265
1449
|
"type": {
|
|
1266
|
-
"text": "
|
|
1450
|
+
"text": "string"
|
|
1267
1451
|
},
|
|
1268
|
-
"privacy": "
|
|
1269
|
-
"default": "
|
|
1452
|
+
"privacy": "protected",
|
|
1453
|
+
"default": "\"input\"",
|
|
1454
|
+
"inheritedFrom": {
|
|
1455
|
+
"name": "FormAssociatedMixin",
|
|
1456
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1457
|
+
}
|
|
1270
1458
|
},
|
|
1271
1459
|
{
|
|
1272
1460
|
"kind": "field",
|
|
1273
|
-
"name": "
|
|
1274
|
-
"
|
|
1275
|
-
|
|
1461
|
+
"name": "errorId",
|
|
1462
|
+
"type": {
|
|
1463
|
+
"text": "string"
|
|
1464
|
+
},
|
|
1465
|
+
"privacy": "protected",
|
|
1466
|
+
"default": "\"error\"",
|
|
1467
|
+
"inheritedFrom": {
|
|
1468
|
+
"name": "FormAssociatedMixin",
|
|
1469
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1470
|
+
}
|
|
1276
1471
|
},
|
|
1277
1472
|
{
|
|
1278
|
-
"kind": "
|
|
1279
|
-
"name": "
|
|
1280
|
-
"
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
],
|
|
1290
|
-
"description": "Programmatically move focus to the calendar."
|
|
1473
|
+
"kind": "field",
|
|
1474
|
+
"name": "hintId",
|
|
1475
|
+
"type": {
|
|
1476
|
+
"text": "string"
|
|
1477
|
+
},
|
|
1478
|
+
"privacy": "protected",
|
|
1479
|
+
"default": "\"hint\"",
|
|
1480
|
+
"inheritedFrom": {
|
|
1481
|
+
"name": "FormAssociatedMixin",
|
|
1482
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1483
|
+
}
|
|
1291
1484
|
},
|
|
1292
1485
|
{
|
|
1293
|
-
"kind": "
|
|
1294
|
-
"name": "
|
|
1295
|
-
"
|
|
1486
|
+
"kind": "field",
|
|
1487
|
+
"name": "label",
|
|
1488
|
+
"type": {
|
|
1489
|
+
"text": "string"
|
|
1490
|
+
},
|
|
1491
|
+
"default": "\"\"",
|
|
1492
|
+
"description": "Label for the input.",
|
|
1493
|
+
"attribute": "label",
|
|
1494
|
+
"inheritedFrom": {
|
|
1495
|
+
"name": "FormAssociatedMixin",
|
|
1496
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1497
|
+
}
|
|
1296
1498
|
},
|
|
1297
1499
|
{
|
|
1298
|
-
"kind": "
|
|
1299
|
-
"name": "
|
|
1300
|
-
"
|
|
1500
|
+
"kind": "field",
|
|
1501
|
+
"name": "hint",
|
|
1502
|
+
"type": {
|
|
1503
|
+
"text": "string | undefined"
|
|
1504
|
+
},
|
|
1505
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
1506
|
+
"attribute": "hint",
|
|
1507
|
+
"inheritedFrom": {
|
|
1508
|
+
"name": "FormAssociatedMixin",
|
|
1509
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1510
|
+
}
|
|
1301
1511
|
},
|
|
1302
1512
|
{
|
|
1303
|
-
"kind": "
|
|
1304
|
-
"name": "
|
|
1305
|
-
"
|
|
1513
|
+
"kind": "field",
|
|
1514
|
+
"name": "hideLabel",
|
|
1515
|
+
"type": {
|
|
1516
|
+
"text": "boolean"
|
|
1517
|
+
},
|
|
1518
|
+
"default": "false",
|
|
1519
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
1520
|
+
"attribute": "hide-label",
|
|
1521
|
+
"inheritedFrom": {
|
|
1522
|
+
"name": "FormAssociatedMixin",
|
|
1523
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1524
|
+
}
|
|
1306
1525
|
},
|
|
1307
1526
|
{
|
|
1308
1527
|
"kind": "field",
|
|
1309
|
-
"name": "
|
|
1310
|
-
"
|
|
1528
|
+
"name": "placeholder",
|
|
1529
|
+
"type": {
|
|
1530
|
+
"text": "string | undefined"
|
|
1531
|
+
},
|
|
1532
|
+
"description": "Placeholder text to display within the input.",
|
|
1533
|
+
"attribute": "placeholder",
|
|
1534
|
+
"inheritedFrom": {
|
|
1535
|
+
"name": "FormAssociatedMixin",
|
|
1536
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1537
|
+
}
|
|
1311
1538
|
},
|
|
1312
1539
|
{
|
|
1313
|
-
"kind": "
|
|
1314
|
-
"name": "
|
|
1315
|
-
"
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1540
|
+
"kind": "field",
|
|
1541
|
+
"name": "error",
|
|
1542
|
+
"type": {
|
|
1543
|
+
"text": "string | undefined"
|
|
1544
|
+
},
|
|
1545
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
1546
|
+
"attribute": "error",
|
|
1547
|
+
"inheritedFrom": {
|
|
1548
|
+
"name": "FormAssociatedMixin",
|
|
1549
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1550
|
+
}
|
|
1324
1551
|
},
|
|
1325
1552
|
{
|
|
1326
|
-
"kind": "
|
|
1327
|
-
"name": "
|
|
1328
|
-
"
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1553
|
+
"kind": "field",
|
|
1554
|
+
"name": "required",
|
|
1555
|
+
"type": {
|
|
1556
|
+
"text": "boolean"
|
|
1557
|
+
},
|
|
1558
|
+
"default": "false",
|
|
1559
|
+
"description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
|
|
1560
|
+
"attribute": "required",
|
|
1561
|
+
"inheritedFrom": {
|
|
1562
|
+
"name": "FormAssociatedMixin",
|
|
1563
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1564
|
+
}
|
|
1337
1565
|
},
|
|
1338
1566
|
{
|
|
1339
1567
|
"kind": "method",
|
|
1340
|
-
"name": "
|
|
1341
|
-
"privacy": "
|
|
1568
|
+
"name": "handleInput",
|
|
1569
|
+
"privacy": "protected",
|
|
1342
1570
|
"parameters": [
|
|
1343
1571
|
{
|
|
1344
|
-
"name": "
|
|
1572
|
+
"name": "e",
|
|
1345
1573
|
"type": {
|
|
1346
|
-
"text": "
|
|
1574
|
+
"text": "Event"
|
|
1347
1575
|
}
|
|
1348
1576
|
}
|
|
1349
|
-
]
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
"privacy": "private"
|
|
1577
|
+
],
|
|
1578
|
+
"inheritedFrom": {
|
|
1579
|
+
"name": "FormAssociatedMixin",
|
|
1580
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1581
|
+
}
|
|
1355
1582
|
},
|
|
1356
1583
|
{
|
|
1357
1584
|
"kind": "method",
|
|
1358
|
-
"name": "
|
|
1359
|
-
"privacy": "
|
|
1585
|
+
"name": "renderLabel",
|
|
1586
|
+
"privacy": "protected",
|
|
1587
|
+
"inheritedFrom": {
|
|
1588
|
+
"name": "FormAssociatedMixin",
|
|
1589
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1590
|
+
}
|
|
1360
1591
|
},
|
|
1361
1592
|
{
|
|
1362
1593
|
"kind": "method",
|
|
1363
|
-
"name": "
|
|
1364
|
-
"privacy": "
|
|
1365
|
-
"
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
"text": "number"
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
]
|
|
1594
|
+
"name": "renderError",
|
|
1595
|
+
"privacy": "protected",
|
|
1596
|
+
"inheritedFrom": {
|
|
1597
|
+
"name": "FormAssociatedMixin",
|
|
1598
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1599
|
+
}
|
|
1373
1600
|
},
|
|
1374
1601
|
{
|
|
1375
1602
|
"kind": "method",
|
|
1376
|
-
"name": "
|
|
1377
|
-
"privacy": "
|
|
1378
|
-
"
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
"text": "number"
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
]
|
|
1603
|
+
"name": "getDescribedBy",
|
|
1604
|
+
"privacy": "protected",
|
|
1605
|
+
"inheritedFrom": {
|
|
1606
|
+
"name": "FormAssociatedMixin",
|
|
1607
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1608
|
+
}
|
|
1386
1609
|
},
|
|
1387
1610
|
{
|
|
1388
1611
|
"kind": "method",
|
|
1389
|
-
"name": "
|
|
1390
|
-
"privacy": "
|
|
1391
|
-
"
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
"text": "Date"
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
]
|
|
1399
|
-
},
|
|
1400
|
-
{
|
|
1401
|
-
"kind": "field",
|
|
1402
|
-
"name": "handleMonthSelect",
|
|
1403
|
-
"privacy": "private"
|
|
1612
|
+
"name": "getInvalid",
|
|
1613
|
+
"privacy": "protected",
|
|
1614
|
+
"inheritedFrom": {
|
|
1615
|
+
"name": "FormAssociatedMixin",
|
|
1616
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1617
|
+
}
|
|
1404
1618
|
},
|
|
1405
1619
|
{
|
|
1406
1620
|
"kind": "field",
|
|
1407
|
-
"name": "
|
|
1408
|
-
"privacy": "
|
|
1621
|
+
"name": "hasHint",
|
|
1622
|
+
"privacy": "protected",
|
|
1623
|
+
"inheritedFrom": {
|
|
1624
|
+
"name": "FormAssociatedMixin",
|
|
1625
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1626
|
+
}
|
|
1409
1627
|
},
|
|
1410
1628
|
{
|
|
1411
1629
|
"kind": "field",
|
|
1412
|
-
"name": "
|
|
1413
|
-
"privacy": "
|
|
1630
|
+
"name": "hasError",
|
|
1631
|
+
"privacy": "protected",
|
|
1632
|
+
"inheritedFrom": {
|
|
1633
|
+
"name": "FormAssociatedMixin",
|
|
1634
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1635
|
+
}
|
|
1414
1636
|
},
|
|
1415
1637
|
{
|
|
1416
1638
|
"kind": "field",
|
|
1417
|
-
"name": "
|
|
1418
|
-
"
|
|
1639
|
+
"name": "disabled",
|
|
1640
|
+
"type": {
|
|
1641
|
+
"text": "boolean"
|
|
1642
|
+
},
|
|
1643
|
+
"default": "false",
|
|
1644
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1645
|
+
"attribute": "disabled",
|
|
1646
|
+
"reflects": true,
|
|
1647
|
+
"inheritedFrom": {
|
|
1648
|
+
"name": "InputMixin",
|
|
1649
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1650
|
+
}
|
|
1419
1651
|
},
|
|
1420
1652
|
{
|
|
1421
1653
|
"kind": "field",
|
|
1422
|
-
"name": "
|
|
1423
|
-
"
|
|
1654
|
+
"name": "name",
|
|
1655
|
+
"type": {
|
|
1656
|
+
"text": "string | undefined"
|
|
1657
|
+
},
|
|
1658
|
+
"description": "The name of the form component.",
|
|
1659
|
+
"attribute": "name",
|
|
1660
|
+
"inheritedFrom": {
|
|
1661
|
+
"name": "InputMixin",
|
|
1662
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1663
|
+
}
|
|
1424
1664
|
},
|
|
1425
1665
|
{
|
|
1426
1666
|
"kind": "field",
|
|
1427
|
-
"name": "
|
|
1428
|
-
"privacy": "private"
|
|
1429
|
-
}
|
|
1430
|
-
],
|
|
1431
|
-
"events": [
|
|
1432
|
-
{
|
|
1433
|
-
"name": "nord-focus-date",
|
|
1667
|
+
"name": "value",
|
|
1434
1668
|
"type": {
|
|
1435
|
-
"text": "
|
|
1669
|
+
"text": "string"
|
|
1436
1670
|
},
|
|
1437
|
-
"
|
|
1671
|
+
"default": "\"\"",
|
|
1672
|
+
"description": "The value of the form component.",
|
|
1673
|
+
"attribute": "value",
|
|
1674
|
+
"inheritedFrom": {
|
|
1675
|
+
"name": "InputMixin",
|
|
1676
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1677
|
+
}
|
|
1438
1678
|
},
|
|
1439
1679
|
{
|
|
1440
|
-
"
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
"
|
|
1444
|
-
|
|
1680
|
+
"kind": "field",
|
|
1681
|
+
"name": "form",
|
|
1682
|
+
"description": "Gets the form, if any, associated with the form element.",
|
|
1683
|
+
"inheritedFrom": {
|
|
1684
|
+
"name": "InputMixin",
|
|
1685
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1686
|
+
}
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
"kind": "field",
|
|
1690
|
+
"name": "focusableRef",
|
|
1691
|
+
"privacy": "protected",
|
|
1692
|
+
"inheritedFrom": {
|
|
1693
|
+
"name": "FocusableMixin",
|
|
1694
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1695
|
+
}
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
"kind": "method",
|
|
1699
|
+
"name": "focus",
|
|
1700
|
+
"parameters": [
|
|
1701
|
+
{
|
|
1702
|
+
"name": "options",
|
|
1703
|
+
"optional": true,
|
|
1704
|
+
"type": {
|
|
1705
|
+
"text": "FocusOptions"
|
|
1706
|
+
},
|
|
1707
|
+
"description": "An object which controls aspects of the focusing process."
|
|
1708
|
+
}
|
|
1709
|
+
],
|
|
1710
|
+
"description": "Programmatically move focus to the component.",
|
|
1711
|
+
"inheritedFrom": {
|
|
1712
|
+
"name": "FocusableMixin",
|
|
1713
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1714
|
+
}
|
|
1715
|
+
},
|
|
1716
|
+
{
|
|
1717
|
+
"kind": "method",
|
|
1718
|
+
"name": "blur",
|
|
1719
|
+
"description": "Programmatically remove focus from the component.",
|
|
1720
|
+
"inheritedFrom": {
|
|
1721
|
+
"name": "FocusableMixin",
|
|
1722
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
"kind": "method",
|
|
1727
|
+
"name": "click",
|
|
1728
|
+
"description": "Programmatically simulates a click on the component.",
|
|
1729
|
+
"inheritedFrom": {
|
|
1730
|
+
"name": "FocusableMixin",
|
|
1731
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1732
|
+
}
|
|
1445
1733
|
}
|
|
1446
1734
|
],
|
|
1447
1735
|
"attributes": [
|
|
1448
1736
|
{
|
|
1449
|
-
"name": "
|
|
1737
|
+
"name": "indeterminate",
|
|
1450
1738
|
"type": {
|
|
1451
|
-
"text": "
|
|
1739
|
+
"text": "boolean"
|
|
1452
1740
|
},
|
|
1453
|
-
"default": "
|
|
1454
|
-
"description": "
|
|
1455
|
-
"fieldName": "
|
|
1741
|
+
"default": "false",
|
|
1742
|
+
"description": "Controls whether the checkbox is in an indeterminate state.",
|
|
1743
|
+
"fieldName": "indeterminate"
|
|
1456
1744
|
},
|
|
1457
1745
|
{
|
|
1458
|
-
"name": "
|
|
1746
|
+
"name": "checked",
|
|
1459
1747
|
"type": {
|
|
1460
|
-
"text": "
|
|
1748
|
+
"text": "boolean"
|
|
1461
1749
|
},
|
|
1462
|
-
"
|
|
1463
|
-
"
|
|
1750
|
+
"default": "false",
|
|
1751
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
1752
|
+
"fieldName": "checked"
|
|
1464
1753
|
},
|
|
1465
1754
|
{
|
|
1466
|
-
"name": "
|
|
1755
|
+
"name": "label",
|
|
1467
1756
|
"type": {
|
|
1468
1757
|
"text": "string"
|
|
1469
1758
|
},
|
|
1470
1759
|
"default": "\"\"",
|
|
1471
|
-
"description": "
|
|
1472
|
-
"fieldName": "
|
|
1760
|
+
"description": "Label for the input.",
|
|
1761
|
+
"fieldName": "label",
|
|
1762
|
+
"inheritedFrom": {
|
|
1763
|
+
"name": "FormAssociatedMixin",
|
|
1764
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1765
|
+
}
|
|
1473
1766
|
},
|
|
1474
1767
|
{
|
|
1475
|
-
"name": "
|
|
1768
|
+
"name": "hint",
|
|
1476
1769
|
"type": {
|
|
1477
|
-
"text": "string"
|
|
1770
|
+
"text": "string | undefined"
|
|
1478
1771
|
},
|
|
1479
|
-
"
|
|
1480
|
-
"
|
|
1481
|
-
"
|
|
1772
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
1773
|
+
"fieldName": "hint",
|
|
1774
|
+
"inheritedFrom": {
|
|
1775
|
+
"name": "FormAssociatedMixin",
|
|
1776
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1777
|
+
}
|
|
1482
1778
|
},
|
|
1483
1779
|
{
|
|
1484
|
-
"name": "
|
|
1780
|
+
"name": "hide-label",
|
|
1485
1781
|
"type": {
|
|
1486
1782
|
"text": "boolean"
|
|
1487
1783
|
},
|
|
1488
1784
|
"default": "false",
|
|
1489
|
-
"description": "
|
|
1490
|
-
"fieldName": "
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
},
|
|
1497
|
-
"status": "ready",
|
|
1498
|
-
"category": "list",
|
|
1499
|
-
"displayName": null,
|
|
1500
|
-
"tagName": "nord-calendar",
|
|
1501
|
-
"customElement": true
|
|
1502
|
-
}
|
|
1503
|
-
],
|
|
1504
|
-
"exports": [
|
|
1505
|
-
{
|
|
1506
|
-
"kind": "js",
|
|
1507
|
-
"name": "default",
|
|
1508
|
-
"declaration": {
|
|
1509
|
-
"name": "Calendar",
|
|
1510
|
-
"module": "src/calendar/Calendar.ts"
|
|
1511
|
-
}
|
|
1512
|
-
},
|
|
1513
|
-
{
|
|
1514
|
-
"kind": "custom-element-definition",
|
|
1515
|
-
"name": "nord-calendar",
|
|
1516
|
-
"declaration": {
|
|
1517
|
-
"name": "Calendar",
|
|
1518
|
-
"module": "src/calendar/Calendar.ts"
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
],
|
|
1522
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1523
|
-
},
|
|
1524
|
-
{
|
|
1525
|
-
"kind": "javascript-module",
|
|
1526
|
-
"path": "src/calendar/DateSelectEvent.ts",
|
|
1527
|
-
"declarations": [
|
|
1528
|
-
{
|
|
1529
|
-
"kind": "class",
|
|
1530
|
-
"description": "",
|
|
1531
|
-
"name": "DateSelectEvent",
|
|
1532
|
-
"superclass": {
|
|
1533
|
-
"name": "NordEvent",
|
|
1534
|
-
"module": "/src/common/events.js"
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
],
|
|
1538
|
-
"exports": [
|
|
1539
|
-
{
|
|
1540
|
-
"kind": "js",
|
|
1541
|
-
"name": "DateSelectEvent",
|
|
1542
|
-
"declaration": {
|
|
1543
|
-
"name": "DateSelectEvent",
|
|
1544
|
-
"module": "src/calendar/DateSelectEvent.ts"
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
],
|
|
1548
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1549
|
-
},
|
|
1550
|
-
{
|
|
1551
|
-
"kind": "javascript-module",
|
|
1552
|
-
"path": "src/calendar/localization.ts",
|
|
1553
|
-
"declarations": [
|
|
1554
|
-
{
|
|
1555
|
-
"kind": "variable",
|
|
1556
|
-
"name": "calendarLocalization",
|
|
1557
|
-
"type": {
|
|
1558
|
-
"text": "object"
|
|
1559
|
-
},
|
|
1560
|
-
"default": "{\n prevMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n}"
|
|
1561
|
-
}
|
|
1562
|
-
],
|
|
1563
|
-
"exports": [
|
|
1564
|
-
{
|
|
1565
|
-
"kind": "js",
|
|
1566
|
-
"name": "default",
|
|
1567
|
-
"declaration": {
|
|
1568
|
-
"name": "calendarLocalization",
|
|
1569
|
-
"module": "src/calendar/localization.ts"
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
],
|
|
1573
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1574
|
-
},
|
|
1575
|
-
{
|
|
1576
|
-
"kind": "javascript-module",
|
|
1577
|
-
"path": "src/calendar/month-view.ts",
|
|
1578
|
-
"declarations": [
|
|
1579
|
-
{
|
|
1580
|
-
"kind": "function",
|
|
1581
|
-
"name": "dayView",
|
|
1582
|
-
"parameters": [
|
|
1785
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
1786
|
+
"fieldName": "hideLabel",
|
|
1787
|
+
"inheritedFrom": {
|
|
1788
|
+
"name": "FormAssociatedMixin",
|
|
1789
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1790
|
+
}
|
|
1791
|
+
},
|
|
1583
1792
|
{
|
|
1584
|
-
"name": "
|
|
1793
|
+
"name": "placeholder",
|
|
1585
1794
|
"type": {
|
|
1586
|
-
"text": "
|
|
1795
|
+
"text": "string | undefined"
|
|
1796
|
+
},
|
|
1797
|
+
"description": "Placeholder text to display within the input.",
|
|
1798
|
+
"fieldName": "placeholder",
|
|
1799
|
+
"inheritedFrom": {
|
|
1800
|
+
"name": "FormAssociatedMixin",
|
|
1801
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1587
1802
|
}
|
|
1588
|
-
}
|
|
1589
|
-
]
|
|
1590
|
-
},
|
|
1591
|
-
{
|
|
1592
|
-
"kind": "function",
|
|
1593
|
-
"name": "monthView",
|
|
1594
|
-
"parameters": [
|
|
1803
|
+
},
|
|
1595
1804
|
{
|
|
1596
|
-
"name": "
|
|
1805
|
+
"name": "error",
|
|
1597
1806
|
"type": {
|
|
1598
|
-
"text": "
|
|
1807
|
+
"text": "string | undefined"
|
|
1808
|
+
},
|
|
1809
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
1810
|
+
"fieldName": "error",
|
|
1811
|
+
"inheritedFrom": {
|
|
1812
|
+
"name": "FormAssociatedMixin",
|
|
1813
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1599
1814
|
}
|
|
1600
|
-
}
|
|
1601
|
-
]
|
|
1602
|
-
}
|
|
1603
|
-
],
|
|
1604
|
-
"exports": [
|
|
1605
|
-
{
|
|
1606
|
-
"kind": "js",
|
|
1607
|
-
"name": "dayView",
|
|
1608
|
-
"declaration": {
|
|
1609
|
-
"name": "dayView",
|
|
1610
|
-
"module": "src/calendar/month-view.ts"
|
|
1611
|
-
}
|
|
1612
|
-
},
|
|
1613
|
-
{
|
|
1614
|
-
"kind": "js",
|
|
1615
|
-
"name": "monthView",
|
|
1616
|
-
"declaration": {
|
|
1617
|
-
"name": "monthView",
|
|
1618
|
-
"module": "src/calendar/month-view.ts"
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
|
-
],
|
|
1622
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1623
|
-
},
|
|
1624
|
-
{
|
|
1625
|
-
"kind": "javascript-module",
|
|
1626
|
-
"path": "src/badge/Badge.ts",
|
|
1627
|
-
"declarations": [
|
|
1628
|
-
{
|
|
1629
|
-
"kind": "class",
|
|
1630
|
-
"description": "Badges are used to inform users of the status of an object\nor of an action that’s been taken. Commonly used in tabular\ndata to indicate status.",
|
|
1631
|
-
"name": "Badge",
|
|
1632
|
-
"slots": [
|
|
1633
|
-
{
|
|
1634
|
-
"description": "The badge content.",
|
|
1635
|
-
"name": ""
|
|
1636
|
-
}
|
|
1637
|
-
],
|
|
1638
|
-
"members": [
|
|
1815
|
+
},
|
|
1639
1816
|
{
|
|
1640
|
-
"
|
|
1641
|
-
"name": "type",
|
|
1817
|
+
"name": "required",
|
|
1642
1818
|
"type": {
|
|
1643
|
-
"text": "
|
|
1819
|
+
"text": "boolean"
|
|
1644
1820
|
},
|
|
1645
|
-
"default": "
|
|
1646
|
-
"description": "
|
|
1647
|
-
"
|
|
1648
|
-
"
|
|
1821
|
+
"default": "false",
|
|
1822
|
+
"description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
|
|
1823
|
+
"fieldName": "required",
|
|
1824
|
+
"inheritedFrom": {
|
|
1825
|
+
"name": "FormAssociatedMixin",
|
|
1826
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1827
|
+
}
|
|
1649
1828
|
},
|
|
1650
1829
|
{
|
|
1651
|
-
"
|
|
1652
|
-
"name": "progress",
|
|
1830
|
+
"name": "disabled",
|
|
1653
1831
|
"type": {
|
|
1654
|
-
"text": "
|
|
1832
|
+
"text": "boolean"
|
|
1655
1833
|
},
|
|
1656
|
-
"
|
|
1657
|
-
"
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1834
|
+
"default": "false",
|
|
1835
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1836
|
+
"fieldName": "disabled",
|
|
1837
|
+
"inheritedFrom": {
|
|
1838
|
+
"name": "InputMixin",
|
|
1839
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1840
|
+
}
|
|
1841
|
+
},
|
|
1661
1842
|
{
|
|
1662
|
-
"name": "
|
|
1843
|
+
"name": "name",
|
|
1663
1844
|
"type": {
|
|
1664
|
-
"text": "
|
|
1845
|
+
"text": "string | undefined"
|
|
1665
1846
|
},
|
|
1666
|
-
"
|
|
1667
|
-
"
|
|
1668
|
-
"
|
|
1847
|
+
"description": "The name of the form component.",
|
|
1848
|
+
"fieldName": "name",
|
|
1849
|
+
"inheritedFrom": {
|
|
1850
|
+
"name": "InputMixin",
|
|
1851
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1852
|
+
}
|
|
1669
1853
|
},
|
|
1670
1854
|
{
|
|
1671
|
-
"name": "
|
|
1855
|
+
"name": "value",
|
|
1672
1856
|
"type": {
|
|
1673
|
-
"text": "
|
|
1857
|
+
"text": "string"
|
|
1674
1858
|
},
|
|
1675
|
-
"
|
|
1676
|
-
"
|
|
1859
|
+
"default": "\"\"",
|
|
1860
|
+
"description": "The value of the form component.",
|
|
1861
|
+
"fieldName": "value",
|
|
1862
|
+
"inheritedFrom": {
|
|
1863
|
+
"name": "InputMixin",
|
|
1864
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
],
|
|
1868
|
+
"mixins": [
|
|
1869
|
+
{
|
|
1870
|
+
"name": "FormAssociatedMixin",
|
|
1871
|
+
"module": "/src/common/mixins/FormAssociatedMixin.js"
|
|
1872
|
+
},
|
|
1873
|
+
{
|
|
1874
|
+
"name": "InputMixin",
|
|
1875
|
+
"module": "/src/common/mixins/InputMixin.js"
|
|
1876
|
+
},
|
|
1877
|
+
{
|
|
1878
|
+
"name": "FocusableMixin",
|
|
1879
|
+
"module": "/src/common/mixins/FocusableMixin.js"
|
|
1677
1880
|
}
|
|
1678
1881
|
],
|
|
1679
1882
|
"superclass": {
|
|
@@ -1681,10 +1884,34 @@
|
|
|
1681
1884
|
"package": "lit"
|
|
1682
1885
|
},
|
|
1683
1886
|
"status": "ready",
|
|
1684
|
-
"category": "
|
|
1887
|
+
"category": "form",
|
|
1685
1888
|
"displayName": null,
|
|
1686
|
-
"tagName": "nord-
|
|
1687
|
-
"customElement": true
|
|
1889
|
+
"tagName": "nord-checkbox",
|
|
1890
|
+
"customElement": true,
|
|
1891
|
+
"events": [
|
|
1892
|
+
{
|
|
1893
|
+
"name": "input",
|
|
1894
|
+
"type": {
|
|
1895
|
+
"text": "NordEvent"
|
|
1896
|
+
},
|
|
1897
|
+
"description": "Fired as the user types into the input.",
|
|
1898
|
+
"inheritedFrom": {
|
|
1899
|
+
"name": "FormAssociatedMixin",
|
|
1900
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1901
|
+
}
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
"name": "change",
|
|
1905
|
+
"type": {
|
|
1906
|
+
"text": "NordEvent"
|
|
1907
|
+
},
|
|
1908
|
+
"description": "Fired whenever the input's value is changed via user interaction.",
|
|
1909
|
+
"inheritedFrom": {
|
|
1910
|
+
"name": "FormAssociatedMixin",
|
|
1911
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
]
|
|
1688
1915
|
}
|
|
1689
1916
|
],
|
|
1690
1917
|
"exports": [
|
|
@@ -1692,604 +1919,483 @@
|
|
|
1692
1919
|
"kind": "js",
|
|
1693
1920
|
"name": "default",
|
|
1694
1921
|
"declaration": {
|
|
1695
|
-
"name": "
|
|
1696
|
-
"module": "src/
|
|
1922
|
+
"name": "Checkbox",
|
|
1923
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
1697
1924
|
}
|
|
1698
1925
|
},
|
|
1699
1926
|
{
|
|
1700
1927
|
"kind": "custom-element-definition",
|
|
1701
|
-
"name": "nord-
|
|
1928
|
+
"name": "nord-checkbox",
|
|
1702
1929
|
"declaration": {
|
|
1703
|
-
"name": "
|
|
1704
|
-
"module": "src/
|
|
1930
|
+
"name": "Checkbox",
|
|
1931
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
1705
1932
|
}
|
|
1706
1933
|
}
|
|
1707
1934
|
],
|
|
1708
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use
|
|
1935
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Avoid using when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
|
|
1709
1936
|
},
|
|
1710
1937
|
{
|
|
1711
1938
|
"kind": "javascript-module",
|
|
1712
|
-
"path": "src/
|
|
1939
|
+
"path": "src/command-menu/CommandMenu.ts",
|
|
1713
1940
|
"declarations": [
|
|
1714
1941
|
{
|
|
1715
1942
|
"kind": "class",
|
|
1716
|
-
"description": "
|
|
1717
|
-
"name": "
|
|
1718
|
-
"
|
|
1943
|
+
"description": "Command Menu allows users to navigate and use an app without\ntouching the mouse and helps them transform into “power users”\nwho can harness more advanced features far faster.",
|
|
1944
|
+
"name": "CommandMenu",
|
|
1945
|
+
"cssProperties": [
|
|
1719
1946
|
{
|
|
1720
|
-
"description": "
|
|
1721
|
-
"name": "
|
|
1947
|
+
"description": "Controls the max inline size, or width, of the command menu.",
|
|
1948
|
+
"name": "--n-command-menu-inline-size",
|
|
1949
|
+
"default": "640px"
|
|
1722
1950
|
},
|
|
1723
1951
|
{
|
|
1724
|
-
"description": "
|
|
1725
|
-
"name": "
|
|
1952
|
+
"description": "Controls the max block size, or height, of the command menu.",
|
|
1953
|
+
"name": "--n-command-menu-block-size",
|
|
1954
|
+
"default": "290px"
|
|
1726
1955
|
},
|
|
1727
1956
|
{
|
|
1728
|
-
"description": "
|
|
1729
|
-
"name": "
|
|
1957
|
+
"description": "Controls the command menu offset from the block start, or top, of the screen.",
|
|
1958
|
+
"name": "--n-command-menu-block-start",
|
|
1959
|
+
"default": "16%"
|
|
1730
1960
|
}
|
|
1731
1961
|
],
|
|
1732
|
-
"
|
|
1733
|
-
{
|
|
1734
|
-
"kind": "field",
|
|
1735
|
-
"name": "formValue",
|
|
1736
|
-
"privacy": "protected",
|
|
1737
|
-
"inheritedFrom": {
|
|
1738
|
-
"name": "FormAssociatedMixin",
|
|
1739
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1740
|
-
}
|
|
1741
|
-
},
|
|
1962
|
+
"slots": [
|
|
1742
1963
|
{
|
|
1743
|
-
"
|
|
1744
|
-
"name": "
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
"default": "false",
|
|
1749
|
-
"description": "Controls whether the checkbox is in an indeterminate state.",
|
|
1750
|
-
"attribute": "indeterminate"
|
|
1751
|
-
},
|
|
1964
|
+
"description": "Used to replace the default footer contents.",
|
|
1965
|
+
"name": "footer"
|
|
1966
|
+
}
|
|
1967
|
+
],
|
|
1968
|
+
"members": [
|
|
1752
1969
|
{
|
|
1753
1970
|
"kind": "field",
|
|
1754
|
-
"name": "
|
|
1755
|
-
"
|
|
1756
|
-
"text": "boolean"
|
|
1757
|
-
},
|
|
1758
|
-
"default": "false",
|
|
1759
|
-
"description": "Controls whether the checkbox is checked or not.",
|
|
1760
|
-
"attribute": "checked"
|
|
1761
|
-
},
|
|
1762
|
-
{
|
|
1763
|
-
"kind": "method",
|
|
1764
|
-
"name": "handleChange",
|
|
1765
|
-
"privacy": "protected",
|
|
1766
|
-
"parameters": [
|
|
1767
|
-
{
|
|
1768
|
-
"name": "e",
|
|
1769
|
-
"type": {
|
|
1770
|
-
"text": "Event"
|
|
1771
|
-
}
|
|
1772
|
-
}
|
|
1773
|
-
],
|
|
1774
|
-
"return": {
|
|
1775
|
-
"type": {
|
|
1776
|
-
"text": "void"
|
|
1777
|
-
}
|
|
1778
|
-
},
|
|
1779
|
-
"inheritedFrom": {
|
|
1780
|
-
"name": "FormAssociatedMixin",
|
|
1781
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1782
|
-
}
|
|
1971
|
+
"name": "inputRef",
|
|
1972
|
+
"privacy": "private"
|
|
1783
1973
|
},
|
|
1784
1974
|
{
|
|
1785
1975
|
"kind": "field",
|
|
1786
|
-
"name": "
|
|
1787
|
-
"privacy": "
|
|
1788
|
-
"default": "new SlotController(this, \"label\")",
|
|
1789
|
-
"inheritedFrom": {
|
|
1790
|
-
"name": "FormAssociatedMixin",
|
|
1791
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1792
|
-
}
|
|
1976
|
+
"name": "listRef",
|
|
1977
|
+
"privacy": "private"
|
|
1793
1978
|
},
|
|
1794
1979
|
{
|
|
1795
1980
|
"kind": "field",
|
|
1796
|
-
"name": "
|
|
1797
|
-
"
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1802
|
-
}
|
|
1981
|
+
"name": "previousFocus",
|
|
1982
|
+
"type": {
|
|
1983
|
+
"text": "HTMLElement | undefined"
|
|
1984
|
+
},
|
|
1985
|
+
"privacy": "private"
|
|
1803
1986
|
},
|
|
1804
1987
|
{
|
|
1805
1988
|
"kind": "field",
|
|
1806
|
-
"name": "
|
|
1807
|
-
"privacy": "
|
|
1808
|
-
"default": "new
|
|
1809
|
-
"inheritedFrom": {
|
|
1810
|
-
"name": "FormAssociatedMixin",
|
|
1811
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1812
|
-
}
|
|
1989
|
+
"name": "localize",
|
|
1990
|
+
"privacy": "private",
|
|
1991
|
+
"default": "new LocalizeController<\"nord-command-menu\">(this)"
|
|
1813
1992
|
},
|
|
1814
1993
|
{
|
|
1815
1994
|
"kind": "field",
|
|
1816
|
-
"name": "
|
|
1817
|
-
"privacy": "
|
|
1818
|
-
"default": "new
|
|
1819
|
-
"inheritedFrom": {
|
|
1820
|
-
"name": "FormAssociatedMixin",
|
|
1821
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1822
|
-
}
|
|
1995
|
+
"name": "dismissController",
|
|
1996
|
+
"privacy": "private",
|
|
1997
|
+
"default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
|
|
1823
1998
|
},
|
|
1824
1999
|
{
|
|
1825
2000
|
"kind": "field",
|
|
1826
|
-
"name": "
|
|
2001
|
+
"name": "keyboardController",
|
|
2002
|
+
"privacy": "private",
|
|
2003
|
+
"default": "new KeyboardController(this, {\n trigger: () => this.select(),\n goBack: () => this.goBack(),\n end: () => this.end(),\n start: () => this.start(),\n next: () => this.next(),\n previous: () => this.previous(),\n toggleOpen: () => this.toggleOpen(),\n })"
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
"kind": "field",
|
|
2007
|
+
"name": "open",
|
|
1827
2008
|
"type": {
|
|
1828
|
-
"text": "
|
|
2009
|
+
"text": "boolean"
|
|
1829
2010
|
},
|
|
1830
|
-
"
|
|
1831
|
-
"
|
|
1832
|
-
"
|
|
1833
|
-
"name": "FormAssociatedMixin",
|
|
1834
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1835
|
-
}
|
|
2011
|
+
"default": "false",
|
|
2012
|
+
"description": "Show or hide the command menu.",
|
|
2013
|
+
"attribute": "open"
|
|
1836
2014
|
},
|
|
1837
2015
|
{
|
|
1838
2016
|
"kind": "field",
|
|
1839
|
-
"name": "
|
|
2017
|
+
"name": "placeholder",
|
|
1840
2018
|
"type": {
|
|
1841
2019
|
"text": "string"
|
|
1842
2020
|
},
|
|
1843
|
-
"
|
|
1844
|
-
"
|
|
1845
|
-
"
|
|
1846
|
-
"name": "FormAssociatedMixin",
|
|
1847
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1848
|
-
}
|
|
2021
|
+
"default": "\"Type a command or search...\"",
|
|
2022
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
2023
|
+
"attribute": "placeholder"
|
|
1849
2024
|
},
|
|
1850
2025
|
{
|
|
1851
2026
|
"kind": "field",
|
|
1852
|
-
"name": "
|
|
2027
|
+
"name": "commands",
|
|
1853
2028
|
"type": {
|
|
1854
|
-
"text": "
|
|
2029
|
+
"text": "Array<ICommandMenuAction>"
|
|
1855
2030
|
},
|
|
1856
|
-
"
|
|
1857
|
-
"
|
|
1858
|
-
"inheritedFrom": {
|
|
1859
|
-
"name": "FormAssociatedMixin",
|
|
1860
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1861
|
-
}
|
|
2031
|
+
"default": "[]",
|
|
2032
|
+
"description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
|
|
1862
2033
|
},
|
|
1863
2034
|
{
|
|
1864
2035
|
"kind": "field",
|
|
1865
|
-
"name": "
|
|
2036
|
+
"name": "parent",
|
|
1866
2037
|
"type": {
|
|
1867
|
-
"text": "
|
|
2038
|
+
"text": "ICommandMenuAction[\"parent\"]"
|
|
1868
2039
|
},
|
|
1869
|
-
"
|
|
1870
|
-
"description": "Label for the input.",
|
|
1871
|
-
"attribute": "label",
|
|
1872
|
-
"inheritedFrom": {
|
|
1873
|
-
"name": "FormAssociatedMixin",
|
|
1874
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1875
|
-
}
|
|
2040
|
+
"privacy": "private"
|
|
1876
2041
|
},
|
|
1877
2042
|
{
|
|
1878
2043
|
"kind": "field",
|
|
1879
|
-
"name": "
|
|
2044
|
+
"name": "search",
|
|
1880
2045
|
"type": {
|
|
1881
|
-
"text": "string
|
|
2046
|
+
"text": "string"
|
|
1882
2047
|
},
|
|
1883
|
-
"
|
|
1884
|
-
"
|
|
1885
|
-
"inheritedFrom": {
|
|
1886
|
-
"name": "FormAssociatedMixin",
|
|
1887
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1888
|
-
}
|
|
2048
|
+
"privacy": "private",
|
|
2049
|
+
"default": "\"\""
|
|
1889
2050
|
},
|
|
1890
2051
|
{
|
|
1891
2052
|
"kind": "field",
|
|
1892
|
-
"name": "
|
|
2053
|
+
"name": "bump",
|
|
1893
2054
|
"type": {
|
|
1894
2055
|
"text": "boolean"
|
|
1895
2056
|
},
|
|
1896
|
-
"
|
|
1897
|
-
"
|
|
1898
|
-
"attribute": "hide-label",
|
|
1899
|
-
"inheritedFrom": {
|
|
1900
|
-
"name": "FormAssociatedMixin",
|
|
1901
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1902
|
-
}
|
|
2057
|
+
"privacy": "private",
|
|
2058
|
+
"default": "true"
|
|
1903
2059
|
},
|
|
1904
2060
|
{
|
|
1905
2061
|
"kind": "field",
|
|
1906
|
-
"name": "
|
|
2062
|
+
"name": "selectedIndex",
|
|
1907
2063
|
"type": {
|
|
1908
|
-
"text": "
|
|
2064
|
+
"text": "number"
|
|
1909
2065
|
},
|
|
1910
|
-
"
|
|
1911
|
-
"
|
|
1912
|
-
"inheritedFrom": {
|
|
1913
|
-
"name": "FormAssociatedMixin",
|
|
1914
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1915
|
-
}
|
|
2066
|
+
"privacy": "private",
|
|
2067
|
+
"default": "0"
|
|
1916
2068
|
},
|
|
1917
2069
|
{
|
|
1918
2070
|
"kind": "field",
|
|
1919
|
-
"name": "
|
|
2071
|
+
"name": "filteredCommands",
|
|
1920
2072
|
"type": {
|
|
1921
|
-
"text": "
|
|
2073
|
+
"text": "Array<ICommandMenuAction>"
|
|
1922
2074
|
},
|
|
1923
|
-
"
|
|
1924
|
-
"
|
|
1925
|
-
"inheritedFrom": {
|
|
1926
|
-
"name": "FormAssociatedMixin",
|
|
1927
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1928
|
-
}
|
|
2075
|
+
"privacy": "private",
|
|
2076
|
+
"default": "[]"
|
|
1929
2077
|
},
|
|
1930
2078
|
{
|
|
1931
2079
|
"kind": "field",
|
|
1932
|
-
"name": "
|
|
2080
|
+
"name": "selected",
|
|
1933
2081
|
"type": {
|
|
1934
|
-
"text": "
|
|
2082
|
+
"text": "ICommandMenuAction"
|
|
1935
2083
|
},
|
|
1936
|
-
"
|
|
1937
|
-
"description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
|
|
1938
|
-
"attribute": "required",
|
|
1939
|
-
"inheritedFrom": {
|
|
1940
|
-
"name": "FormAssociatedMixin",
|
|
1941
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1942
|
-
}
|
|
2084
|
+
"privacy": "private"
|
|
1943
2085
|
},
|
|
1944
2086
|
{
|
|
1945
2087
|
"kind": "method",
|
|
1946
|
-
"name": "
|
|
1947
|
-
"privacy": "protected",
|
|
2088
|
+
"name": "show",
|
|
1948
2089
|
"parameters": [
|
|
1949
2090
|
{
|
|
1950
|
-
"name": "
|
|
2091
|
+
"name": "options",
|
|
2092
|
+
"default": "{}",
|
|
1951
2093
|
"type": {
|
|
1952
|
-
"text": "
|
|
1953
|
-
}
|
|
2094
|
+
"text": "{ parent?: string }"
|
|
2095
|
+
},
|
|
2096
|
+
"description": "allows you to open the menu filtered to a specific parent command."
|
|
1954
2097
|
}
|
|
1955
2098
|
],
|
|
1956
|
-
"
|
|
1957
|
-
"name": "FormAssociatedMixin",
|
|
1958
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1959
|
-
}
|
|
2099
|
+
"description": "Show the command menu programmatically."
|
|
1960
2100
|
},
|
|
1961
2101
|
{
|
|
1962
2102
|
"kind": "method",
|
|
1963
|
-
"name": "
|
|
1964
|
-
"
|
|
1965
|
-
"inheritedFrom": {
|
|
1966
|
-
"name": "FormAssociatedMixin",
|
|
1967
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1968
|
-
}
|
|
2103
|
+
"name": "close",
|
|
2104
|
+
"description": "Close the command menu programmatically."
|
|
1969
2105
|
},
|
|
1970
2106
|
{
|
|
1971
2107
|
"kind": "method",
|
|
1972
|
-
"name": "
|
|
1973
|
-
"
|
|
1974
|
-
"inheritedFrom": {
|
|
1975
|
-
"name": "FormAssociatedMixin",
|
|
1976
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1977
|
-
}
|
|
2108
|
+
"name": "toggleOpen",
|
|
2109
|
+
"description": "Toggle the open state programmatically."
|
|
1978
2110
|
},
|
|
1979
2111
|
{
|
|
1980
2112
|
"kind": "method",
|
|
1981
|
-
"name": "
|
|
1982
|
-
"
|
|
1983
|
-
"inheritedFrom": {
|
|
1984
|
-
"name": "FormAssociatedMixin",
|
|
1985
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1986
|
-
}
|
|
2113
|
+
"name": "focus",
|
|
2114
|
+
"description": "Focus the command menu's input."
|
|
1987
2115
|
},
|
|
1988
2116
|
{
|
|
1989
2117
|
"kind": "method",
|
|
1990
|
-
"name": "
|
|
1991
|
-
"privacy": "
|
|
1992
|
-
"inheritedFrom": {
|
|
1993
|
-
"name": "FormAssociatedMixin",
|
|
1994
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1995
|
-
}
|
|
2118
|
+
"name": "renderNoResults",
|
|
2119
|
+
"privacy": "private"
|
|
1996
2120
|
},
|
|
1997
2121
|
{
|
|
1998
|
-
"kind": "
|
|
1999
|
-
"name": "
|
|
2000
|
-
"privacy": "
|
|
2001
|
-
"
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2122
|
+
"kind": "method",
|
|
2123
|
+
"name": "renderSection",
|
|
2124
|
+
"privacy": "private",
|
|
2125
|
+
"parameters": [
|
|
2126
|
+
{
|
|
2127
|
+
"name": "section",
|
|
2128
|
+
"type": {
|
|
2129
|
+
"text": "string | undefined"
|
|
2130
|
+
}
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
"name": "commands",
|
|
2134
|
+
"type": {
|
|
2135
|
+
"text": "ICommandMenuAction[]"
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
]
|
|
2139
|
+
},
|
|
2140
|
+
{
|
|
2141
|
+
"kind": "method",
|
|
2142
|
+
"name": "handleCommandsChange",
|
|
2143
|
+
"privacy": "protected"
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
"kind": "method",
|
|
2147
|
+
"name": "handleBump",
|
|
2148
|
+
"privacy": "protected"
|
|
2149
|
+
},
|
|
2150
|
+
{
|
|
2151
|
+
"kind": "method",
|
|
2152
|
+
"name": "focusOnOpen",
|
|
2153
|
+
"privacy": "protected"
|
|
2154
|
+
},
|
|
2155
|
+
{
|
|
2156
|
+
"kind": "method",
|
|
2157
|
+
"name": "handleAnimationEnd",
|
|
2158
|
+
"privacy": "private"
|
|
2159
|
+
},
|
|
2160
|
+
{
|
|
2161
|
+
"kind": "method",
|
|
2162
|
+
"name": "handleBlur",
|
|
2163
|
+
"privacy": "private"
|
|
2164
|
+
},
|
|
2165
|
+
{
|
|
2166
|
+
"kind": "method",
|
|
2167
|
+
"name": "handleInput",
|
|
2168
|
+
"privacy": "private",
|
|
2169
|
+
"parameters": [
|
|
2170
|
+
{
|
|
2171
|
+
"name": "event",
|
|
2172
|
+
"type": {
|
|
2173
|
+
"text": "KeyboardEvent"
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
]
|
|
2005
2177
|
},
|
|
2006
2178
|
{
|
|
2007
|
-
"kind": "
|
|
2008
|
-
"name": "
|
|
2009
|
-
"privacy": "
|
|
2010
|
-
"
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2179
|
+
"kind": "method",
|
|
2180
|
+
"name": "select",
|
|
2181
|
+
"privacy": "private",
|
|
2182
|
+
"parameters": [
|
|
2183
|
+
{
|
|
2184
|
+
"name": "command",
|
|
2185
|
+
"default": "this.selected",
|
|
2186
|
+
"type": {
|
|
2187
|
+
"text": "ICommandMenuAction"
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
]
|
|
2014
2191
|
},
|
|
2015
2192
|
{
|
|
2016
|
-
"kind": "
|
|
2017
|
-
"name": "
|
|
2018
|
-
"
|
|
2019
|
-
"text": "boolean"
|
|
2020
|
-
},
|
|
2021
|
-
"default": "false",
|
|
2022
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2023
|
-
"attribute": "disabled",
|
|
2024
|
-
"reflects": true,
|
|
2025
|
-
"inheritedFrom": {
|
|
2026
|
-
"name": "InputMixin",
|
|
2027
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2028
|
-
}
|
|
2193
|
+
"kind": "method",
|
|
2194
|
+
"name": "start",
|
|
2195
|
+
"privacy": "private"
|
|
2029
2196
|
},
|
|
2030
2197
|
{
|
|
2031
|
-
"kind": "
|
|
2032
|
-
"name": "
|
|
2033
|
-
"
|
|
2034
|
-
"text": "string | undefined"
|
|
2035
|
-
},
|
|
2036
|
-
"description": "The name of the form component.",
|
|
2037
|
-
"attribute": "name",
|
|
2038
|
-
"inheritedFrom": {
|
|
2039
|
-
"name": "InputMixin",
|
|
2040
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2041
|
-
}
|
|
2198
|
+
"kind": "method",
|
|
2199
|
+
"name": "end",
|
|
2200
|
+
"privacy": "private"
|
|
2042
2201
|
},
|
|
2043
2202
|
{
|
|
2044
|
-
"kind": "
|
|
2045
|
-
"name": "
|
|
2046
|
-
"
|
|
2047
|
-
"text": "string"
|
|
2048
|
-
},
|
|
2049
|
-
"default": "\"\"",
|
|
2050
|
-
"description": "The value of the form component.",
|
|
2051
|
-
"attribute": "value",
|
|
2052
|
-
"inheritedFrom": {
|
|
2053
|
-
"name": "InputMixin",
|
|
2054
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2055
|
-
}
|
|
2203
|
+
"kind": "method",
|
|
2204
|
+
"name": "next",
|
|
2205
|
+
"privacy": "private"
|
|
2056
2206
|
},
|
|
2057
2207
|
{
|
|
2058
|
-
"kind": "
|
|
2059
|
-
"name": "
|
|
2060
|
-
"
|
|
2061
|
-
"inheritedFrom": {
|
|
2062
|
-
"name": "InputMixin",
|
|
2063
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2064
|
-
}
|
|
2208
|
+
"kind": "method",
|
|
2209
|
+
"name": "previous",
|
|
2210
|
+
"privacy": "private"
|
|
2065
2211
|
},
|
|
2066
2212
|
{
|
|
2067
|
-
"kind": "
|
|
2068
|
-
"name": "
|
|
2069
|
-
"privacy": "
|
|
2070
|
-
"inheritedFrom": {
|
|
2071
|
-
"name": "FocusableMixin",
|
|
2072
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2073
|
-
}
|
|
2213
|
+
"kind": "method",
|
|
2214
|
+
"name": "goBack",
|
|
2215
|
+
"privacy": "private"
|
|
2074
2216
|
},
|
|
2075
2217
|
{
|
|
2076
2218
|
"kind": "method",
|
|
2077
|
-
"name": "
|
|
2219
|
+
"name": "setParent",
|
|
2220
|
+
"privacy": "private",
|
|
2078
2221
|
"parameters": [
|
|
2079
2222
|
{
|
|
2080
|
-
"name": "
|
|
2223
|
+
"name": "parent",
|
|
2081
2224
|
"optional": true,
|
|
2082
2225
|
"type": {
|
|
2083
|
-
"text": "
|
|
2084
|
-
}
|
|
2085
|
-
"description": "An object which controls aspects of the focusing process."
|
|
2226
|
+
"text": "ICommandMenuAction[\"parent\"]"
|
|
2227
|
+
}
|
|
2086
2228
|
}
|
|
2087
|
-
]
|
|
2088
|
-
"description": "Programmatically move focus to the component.",
|
|
2089
|
-
"inheritedFrom": {
|
|
2090
|
-
"name": "FocusableMixin",
|
|
2091
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2092
|
-
}
|
|
2229
|
+
]
|
|
2093
2230
|
},
|
|
2094
2231
|
{
|
|
2095
2232
|
"kind": "method",
|
|
2096
|
-
"name": "
|
|
2097
|
-
"
|
|
2098
|
-
"
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2233
|
+
"name": "setSearch",
|
|
2234
|
+
"privacy": "private",
|
|
2235
|
+
"parameters": [
|
|
2236
|
+
{
|
|
2237
|
+
"name": "str",
|
|
2238
|
+
"type": {
|
|
2239
|
+
"text": "string"
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
]
|
|
2102
2243
|
},
|
|
2103
2244
|
{
|
|
2104
2245
|
"kind": "method",
|
|
2105
|
-
"name": "
|
|
2106
|
-
"
|
|
2107
|
-
"inheritedFrom": {
|
|
2108
|
-
"name": "FocusableMixin",
|
|
2109
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2110
|
-
}
|
|
2246
|
+
"name": "filterCommands",
|
|
2247
|
+
"privacy": "private"
|
|
2111
2248
|
}
|
|
2112
2249
|
],
|
|
2113
|
-
"
|
|
2114
|
-
{
|
|
2115
|
-
"name": "indeterminate",
|
|
2116
|
-
"type": {
|
|
2117
|
-
"text": "boolean"
|
|
2118
|
-
},
|
|
2119
|
-
"default": "false",
|
|
2120
|
-
"description": "Controls whether the checkbox is in an indeterminate state.",
|
|
2121
|
-
"fieldName": "indeterminate"
|
|
2122
|
-
},
|
|
2250
|
+
"events": [
|
|
2123
2251
|
{
|
|
2124
|
-
"name": "
|
|
2252
|
+
"name": "open",
|
|
2125
2253
|
"type": {
|
|
2126
|
-
"text": "
|
|
2254
|
+
"text": "NordEvent"
|
|
2127
2255
|
},
|
|
2128
|
-
"
|
|
2129
|
-
"description": "Controls whether the checkbox is checked or not.",
|
|
2130
|
-
"fieldName": "checked"
|
|
2256
|
+
"description": "The command menu was opened."
|
|
2131
2257
|
},
|
|
2132
2258
|
{
|
|
2133
|
-
"name": "
|
|
2259
|
+
"name": "close",
|
|
2134
2260
|
"type": {
|
|
2135
|
-
"text": "
|
|
2261
|
+
"text": "NordEvent"
|
|
2136
2262
|
},
|
|
2137
|
-
"
|
|
2138
|
-
"description": "Label for the input.",
|
|
2139
|
-
"fieldName": "label",
|
|
2140
|
-
"inheritedFrom": {
|
|
2141
|
-
"name": "FormAssociatedMixin",
|
|
2142
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2143
|
-
}
|
|
2263
|
+
"description": "The command menu was closed."
|
|
2144
2264
|
},
|
|
2145
2265
|
{
|
|
2146
|
-
"name": "hint",
|
|
2147
2266
|
"type": {
|
|
2148
|
-
"text": "
|
|
2267
|
+
"text": "SelectEvent"
|
|
2149
2268
|
},
|
|
2150
|
-
"description": "
|
|
2151
|
-
"
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
}
|
|
2156
|
-
},
|
|
2269
|
+
"description": "User selected a command from the menu.",
|
|
2270
|
+
"name": "nord-select"
|
|
2271
|
+
}
|
|
2272
|
+
],
|
|
2273
|
+
"attributes": [
|
|
2157
2274
|
{
|
|
2158
|
-
"name": "
|
|
2275
|
+
"name": "open",
|
|
2159
2276
|
"type": {
|
|
2160
2277
|
"text": "boolean"
|
|
2161
2278
|
},
|
|
2162
2279
|
"default": "false",
|
|
2163
|
-
"description": "
|
|
2164
|
-
"fieldName": "
|
|
2165
|
-
"inheritedFrom": {
|
|
2166
|
-
"name": "FormAssociatedMixin",
|
|
2167
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2168
|
-
}
|
|
2280
|
+
"description": "Show or hide the command menu.",
|
|
2281
|
+
"fieldName": "open"
|
|
2169
2282
|
},
|
|
2170
2283
|
{
|
|
2171
2284
|
"name": "placeholder",
|
|
2172
2285
|
"type": {
|
|
2173
|
-
"text": "string
|
|
2286
|
+
"text": "string"
|
|
2174
2287
|
},
|
|
2175
|
-
"
|
|
2176
|
-
"
|
|
2177
|
-
"
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2288
|
+
"default": "\"Type a command or search...\"",
|
|
2289
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
2290
|
+
"fieldName": "placeholder"
|
|
2291
|
+
}
|
|
2292
|
+
],
|
|
2293
|
+
"superclass": {
|
|
2294
|
+
"name": "LitElement",
|
|
2295
|
+
"package": "lit"
|
|
2296
|
+
},
|
|
2297
|
+
"status": "ready",
|
|
2298
|
+
"category": "action",
|
|
2299
|
+
"displayName": null,
|
|
2300
|
+
"tagName": "nord-command-menu",
|
|
2301
|
+
"customElement": true
|
|
2302
|
+
}
|
|
2303
|
+
],
|
|
2304
|
+
"exports": [
|
|
2305
|
+
{
|
|
2306
|
+
"kind": "js",
|
|
2307
|
+
"name": "default",
|
|
2308
|
+
"declaration": {
|
|
2309
|
+
"name": "CommandMenu",
|
|
2310
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
2311
|
+
}
|
|
2312
|
+
},
|
|
2313
|
+
{
|
|
2314
|
+
"kind": "custom-element-definition",
|
|
2315
|
+
"name": "nord-command-menu",
|
|
2316
|
+
"declaration": {
|
|
2317
|
+
"name": "CommandMenu",
|
|
2318
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
],
|
|
2322
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2323
|
+
},
|
|
2324
|
+
{
|
|
2325
|
+
"kind": "javascript-module",
|
|
2326
|
+
"path": "src/command-menu/CommandMenuAction.ts",
|
|
2327
|
+
"declarations": [
|
|
2328
|
+
{
|
|
2329
|
+
"kind": "class",
|
|
2330
|
+
"description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
|
|
2331
|
+
"name": "CommandMenuAction",
|
|
2332
|
+
"members": [
|
|
2182
2333
|
{
|
|
2183
|
-
"
|
|
2184
|
-
"
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
2188
|
-
"fieldName": "error",
|
|
2189
|
-
"inheritedFrom": {
|
|
2190
|
-
"name": "FormAssociatedMixin",
|
|
2191
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2192
|
-
}
|
|
2334
|
+
"kind": "field",
|
|
2335
|
+
"name": "direction",
|
|
2336
|
+
"privacy": "private",
|
|
2337
|
+
"default": "new DirectionController(this)"
|
|
2193
2338
|
},
|
|
2194
2339
|
{
|
|
2195
|
-
"
|
|
2340
|
+
"kind": "field",
|
|
2341
|
+
"name": "command",
|
|
2196
2342
|
"type": {
|
|
2197
|
-
"text": "
|
|
2343
|
+
"text": "ICommandMenuAction"
|
|
2198
2344
|
},
|
|
2199
|
-
"
|
|
2200
|
-
"description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
|
|
2201
|
-
"fieldName": "required",
|
|
2202
|
-
"inheritedFrom": {
|
|
2203
|
-
"name": "FormAssociatedMixin",
|
|
2204
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2205
|
-
}
|
|
2345
|
+
"attribute": "command"
|
|
2206
2346
|
},
|
|
2207
2347
|
{
|
|
2208
|
-
"
|
|
2348
|
+
"kind": "field",
|
|
2349
|
+
"name": "selected",
|
|
2209
2350
|
"type": {
|
|
2210
2351
|
"text": "boolean"
|
|
2211
2352
|
},
|
|
2212
2353
|
"default": "false",
|
|
2213
|
-
"
|
|
2214
|
-
"fieldName": "disabled",
|
|
2215
|
-
"inheritedFrom": {
|
|
2216
|
-
"name": "InputMixin",
|
|
2217
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2218
|
-
}
|
|
2219
|
-
},
|
|
2220
|
-
{
|
|
2221
|
-
"name": "name",
|
|
2222
|
-
"type": {
|
|
2223
|
-
"text": "string | undefined"
|
|
2224
|
-
},
|
|
2225
|
-
"description": "The name of the form component.",
|
|
2226
|
-
"fieldName": "name",
|
|
2227
|
-
"inheritedFrom": {
|
|
2228
|
-
"name": "InputMixin",
|
|
2229
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2230
|
-
}
|
|
2354
|
+
"attribute": "selected"
|
|
2231
2355
|
},
|
|
2232
2356
|
{
|
|
2233
|
-
"
|
|
2234
|
-
"
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
"default": "\"\"",
|
|
2238
|
-
"description": "The value of the form component.",
|
|
2239
|
-
"fieldName": "value",
|
|
2240
|
-
"inheritedFrom": {
|
|
2241
|
-
"name": "InputMixin",
|
|
2242
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2243
|
-
}
|
|
2244
|
-
}
|
|
2245
|
-
],
|
|
2246
|
-
"mixins": [
|
|
2247
|
-
{
|
|
2248
|
-
"name": "FormAssociatedMixin",
|
|
2249
|
-
"module": "/src/common/mixins/FormAssociatedMixin.js"
|
|
2357
|
+
"kind": "method",
|
|
2358
|
+
"name": "ensureInView",
|
|
2359
|
+
"privacy": "protected",
|
|
2360
|
+
"description": "Scroll to show element"
|
|
2250
2361
|
},
|
|
2251
2362
|
{
|
|
2252
|
-
"
|
|
2253
|
-
"
|
|
2363
|
+
"kind": "method",
|
|
2364
|
+
"name": "getIconName",
|
|
2365
|
+
"privacy": "private"
|
|
2254
2366
|
},
|
|
2255
2367
|
{
|
|
2256
|
-
"
|
|
2257
|
-
"
|
|
2368
|
+
"kind": "method",
|
|
2369
|
+
"name": "renderShortcut",
|
|
2370
|
+
"privacy": "private"
|
|
2258
2371
|
}
|
|
2259
2372
|
],
|
|
2260
|
-
"
|
|
2261
|
-
"name": "LitElement",
|
|
2262
|
-
"package": "lit"
|
|
2263
|
-
},
|
|
2264
|
-
"status": "ready",
|
|
2265
|
-
"category": "form",
|
|
2266
|
-
"displayName": null,
|
|
2267
|
-
"tagName": "nord-checkbox",
|
|
2268
|
-
"customElement": true,
|
|
2269
|
-
"events": [
|
|
2373
|
+
"attributes": [
|
|
2270
2374
|
{
|
|
2271
|
-
"name": "
|
|
2375
|
+
"name": "command",
|
|
2272
2376
|
"type": {
|
|
2273
|
-
"text": "
|
|
2377
|
+
"text": "ICommandMenuAction"
|
|
2274
2378
|
},
|
|
2275
|
-
"
|
|
2276
|
-
"inheritedFrom": {
|
|
2277
|
-
"name": "FormAssociatedMixin",
|
|
2278
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2279
|
-
}
|
|
2379
|
+
"fieldName": "command"
|
|
2280
2380
|
},
|
|
2281
2381
|
{
|
|
2282
|
-
"name": "
|
|
2382
|
+
"name": "selected",
|
|
2283
2383
|
"type": {
|
|
2284
|
-
"text": "
|
|
2384
|
+
"text": "boolean"
|
|
2285
2385
|
},
|
|
2286
|
-
"
|
|
2287
|
-
"
|
|
2288
|
-
"name": "FormAssociatedMixin",
|
|
2289
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2290
|
-
}
|
|
2386
|
+
"default": "false",
|
|
2387
|
+
"fieldName": "selected"
|
|
2291
2388
|
}
|
|
2292
|
-
]
|
|
2389
|
+
],
|
|
2390
|
+
"superclass": {
|
|
2391
|
+
"name": "LitElement",
|
|
2392
|
+
"package": "lit"
|
|
2393
|
+
},
|
|
2394
|
+
"status": "internal",
|
|
2395
|
+
"category": null,
|
|
2396
|
+
"displayName": null,
|
|
2397
|
+
"tagName": "nord-command-menu-action",
|
|
2398
|
+
"customElement": true
|
|
2293
2399
|
}
|
|
2294
2400
|
],
|
|
2295
2401
|
"exports": [
|
|
@@ -2297,749 +2403,643 @@
|
|
|
2297
2403
|
"kind": "js",
|
|
2298
2404
|
"name": "default",
|
|
2299
2405
|
"declaration": {
|
|
2300
|
-
"name": "
|
|
2301
|
-
"module": "src/
|
|
2406
|
+
"name": "CommandMenuAction",
|
|
2407
|
+
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2302
2408
|
}
|
|
2303
2409
|
},
|
|
2304
2410
|
{
|
|
2305
2411
|
"kind": "custom-element-definition",
|
|
2306
|
-
"name": "nord-
|
|
2412
|
+
"name": "nord-command-menu-action",
|
|
2307
2413
|
"declaration": {
|
|
2308
|
-
"name": "
|
|
2309
|
-
"module": "src/
|
|
2414
|
+
"name": "CommandMenuAction",
|
|
2415
|
+
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2310
2416
|
}
|
|
2311
2417
|
}
|
|
2312
2418
|
],
|
|
2313
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Avoid using when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
|
|
2419
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2314
2420
|
},
|
|
2315
2421
|
{
|
|
2316
2422
|
"kind": "javascript-module",
|
|
2317
|
-
"path": "src/
|
|
2423
|
+
"path": "src/command-menu/ICommandMenuAction.ts",
|
|
2424
|
+
"declarations": [],
|
|
2425
|
+
"exports": [],
|
|
2426
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2427
|
+
},
|
|
2428
|
+
{
|
|
2429
|
+
"kind": "javascript-module",
|
|
2430
|
+
"path": "src/command-menu/KeyboardController.ts",
|
|
2318
2431
|
"declarations": [
|
|
2319
2432
|
{
|
|
2320
2433
|
"kind": "class",
|
|
2321
|
-
"description": "
|
|
2322
|
-
"name": "
|
|
2323
|
-
"cssProperties": [
|
|
2324
|
-
{
|
|
2325
|
-
"description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
|
|
2326
|
-
"name": "--n-card-border-radius",
|
|
2327
|
-
"default": "var(--n-border-radius)"
|
|
2328
|
-
},
|
|
2329
|
-
{
|
|
2330
|
-
"description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
|
|
2331
|
-
"name": "--n-card-box-shadow",
|
|
2332
|
-
"default": "var(--n-box-shadow-popout)"
|
|
2333
|
-
},
|
|
2334
|
-
{
|
|
2335
|
-
"description": "Controls the padding on all sides of the card.",
|
|
2336
|
-
"name": "--n-card-padding",
|
|
2337
|
-
"default": "var(--n-space-m)"
|
|
2338
|
-
},
|
|
2339
|
-
{
|
|
2340
|
-
"description": "Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.",
|
|
2341
|
-
"name": "--n-card-slot-padding",
|
|
2342
|
-
"default": "var(--n-space-m)"
|
|
2343
|
-
}
|
|
2344
|
-
],
|
|
2345
|
-
"slots": [
|
|
2346
|
-
{
|
|
2347
|
-
"description": "The card content.",
|
|
2348
|
-
"name": ""
|
|
2349
|
-
},
|
|
2350
|
-
{
|
|
2351
|
-
"description": "Optional slot that holds a header for the card.",
|
|
2352
|
-
"name": "header"
|
|
2353
|
-
},
|
|
2354
|
-
{
|
|
2355
|
-
"description": "Optional slot that positions content at the end of the header. Useful for actions or additional info.",
|
|
2356
|
-
"name": "header-end"
|
|
2357
|
-
},
|
|
2358
|
-
{
|
|
2359
|
-
"description": "Optional slot that holds footer content for the card.",
|
|
2360
|
-
"name": "footer"
|
|
2361
|
-
}
|
|
2362
|
-
],
|
|
2434
|
+
"description": "",
|
|
2435
|
+
"name": "KeyboardController",
|
|
2363
2436
|
"members": [
|
|
2364
2437
|
{
|
|
2365
2438
|
"kind": "field",
|
|
2366
|
-
"name": "
|
|
2439
|
+
"name": "globalShortcuts",
|
|
2440
|
+
"type": {
|
|
2441
|
+
"text": "ShortcutController"
|
|
2442
|
+
},
|
|
2367
2443
|
"privacy": "private",
|
|
2368
|
-
"default": "new
|
|
2444
|
+
"default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
|
|
2369
2445
|
},
|
|
2370
2446
|
{
|
|
2371
2447
|
"kind": "field",
|
|
2372
|
-
"name": "
|
|
2448
|
+
"name": "navigationShortcuts",
|
|
2449
|
+
"type": {
|
|
2450
|
+
"text": "ShortcutController"
|
|
2451
|
+
},
|
|
2373
2452
|
"privacy": "private",
|
|
2374
|
-
"default": "new
|
|
2453
|
+
"default": "new ShortcutController(\n host,\n {\n Enter: preventDefault(actions.trigger),\n Backspace: actions.goBack, // we don't want to prevent default, since that would stop backspace deleting chars\n End: preventDefault(actions.end),\n Home: preventDefault(actions.start),\n ArrowDown: preventDefault(actions.next),\n ArrowUp: preventDefault(actions.previous),\n },\n host\n )"
|
|
2375
2454
|
},
|
|
2376
2455
|
{
|
|
2377
2456
|
"kind": "field",
|
|
2378
|
-
"name": "
|
|
2457
|
+
"name": "commandShortcuts",
|
|
2458
|
+
"type": {
|
|
2459
|
+
"text": "ShortcutController"
|
|
2460
|
+
},
|
|
2379
2461
|
"privacy": "private",
|
|
2380
|
-
"default": "new
|
|
2462
|
+
"default": "new ShortcutController(host)"
|
|
2381
2463
|
},
|
|
2382
2464
|
{
|
|
2383
|
-
"kind": "
|
|
2384
|
-
"name": "
|
|
2385
|
-
"type": {
|
|
2386
|
-
"text": "\"m\" | \"l\" | \"none\""
|
|
2387
|
-
},
|
|
2388
|
-
"default": "\"m\"",
|
|
2389
|
-
"description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
2390
|
-
"attribute": "padding",
|
|
2391
|
-
"reflects": true
|
|
2465
|
+
"kind": "method",
|
|
2466
|
+
"name": "registerCommandShortcuts"
|
|
2392
2467
|
}
|
|
2393
|
-
]
|
|
2394
|
-
|
|
2468
|
+
]
|
|
2469
|
+
}
|
|
2470
|
+
],
|
|
2471
|
+
"exports": [
|
|
2472
|
+
{
|
|
2473
|
+
"kind": "js",
|
|
2474
|
+
"name": "KeyboardController",
|
|
2475
|
+
"declaration": {
|
|
2476
|
+
"name": "KeyboardController",
|
|
2477
|
+
"module": "src/command-menu/KeyboardController.ts"
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
],
|
|
2481
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2482
|
+
},
|
|
2483
|
+
{
|
|
2484
|
+
"kind": "javascript-module",
|
|
2485
|
+
"path": "src/command-menu/SelectEvent.ts",
|
|
2486
|
+
"declarations": [
|
|
2487
|
+
{
|
|
2488
|
+
"kind": "class",
|
|
2489
|
+
"description": "",
|
|
2490
|
+
"name": "SelectEvent",
|
|
2491
|
+
"members": [
|
|
2395
2492
|
{
|
|
2396
|
-
"
|
|
2493
|
+
"kind": "field",
|
|
2494
|
+
"name": "eventName",
|
|
2397
2495
|
"type": {
|
|
2398
|
-
"text": "
|
|
2496
|
+
"text": "string"
|
|
2399
2497
|
},
|
|
2400
|
-
"
|
|
2401
|
-
"
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
"
|
|
2407
|
-
|
|
2408
|
-
},
|
|
2409
|
-
"status": "ready",
|
|
2410
|
-
"category": "structure",
|
|
2411
|
-
"displayName": null,
|
|
2412
|
-
"tagName": "nord-card",
|
|
2413
|
-
"customElement": true
|
|
2498
|
+
"static": true,
|
|
2499
|
+
"default": "\"nord-select\""
|
|
2500
|
+
}
|
|
2501
|
+
],
|
|
2502
|
+
"superclass": {
|
|
2503
|
+
"name": "NordEvent",
|
|
2504
|
+
"module": "/src/common/events.js"
|
|
2505
|
+
}
|
|
2414
2506
|
}
|
|
2415
2507
|
],
|
|
2416
2508
|
"exports": [
|
|
2417
2509
|
{
|
|
2418
2510
|
"kind": "js",
|
|
2419
|
-
"name": "
|
|
2511
|
+
"name": "SelectEvent",
|
|
2420
2512
|
"declaration": {
|
|
2421
|
-
"name": "
|
|
2422
|
-
"module": "src/
|
|
2513
|
+
"name": "SelectEvent",
|
|
2514
|
+
"module": "src/command-menu/SelectEvent.ts"
|
|
2423
2515
|
}
|
|
2424
|
-
}
|
|
2516
|
+
}
|
|
2517
|
+
],
|
|
2518
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2519
|
+
},
|
|
2520
|
+
{
|
|
2521
|
+
"kind": "javascript-module",
|
|
2522
|
+
"path": "src/command-menu/localization.ts",
|
|
2523
|
+
"declarations": [
|
|
2425
2524
|
{
|
|
2426
|
-
"kind": "
|
|
2427
|
-
"name": "
|
|
2525
|
+
"kind": "variable",
|
|
2526
|
+
"name": "commandMenuLocalization",
|
|
2527
|
+
"type": {
|
|
2528
|
+
"text": "object"
|
|
2529
|
+
},
|
|
2530
|
+
"default": "{\n instructions: \"Press 'Enter' to confirm your input or 'Escape' to cancel\",\n inputLabel: \"Type the name of a command to run.\",\n footerArrowKeys: \"Navigate\",\n footerEnterKey: \"Select\",\n footerEscapeKey: \"Esc to dismiss\",\n footerBackspaceKey: \"Move to parent\",\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: \"Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase.\",\n}"
|
|
2531
|
+
}
|
|
2532
|
+
],
|
|
2533
|
+
"exports": [
|
|
2534
|
+
{
|
|
2535
|
+
"kind": "js",
|
|
2536
|
+
"name": "default",
|
|
2428
2537
|
"declaration": {
|
|
2429
|
-
"name": "
|
|
2430
|
-
"module": "src/
|
|
2538
|
+
"name": "commandMenuLocalization",
|
|
2539
|
+
"module": "src/command-menu/localization.ts"
|
|
2431
2540
|
}
|
|
2432
2541
|
}
|
|
2433
2542
|
],
|
|
2434
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n"
|
|
2543
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2435
2544
|
},
|
|
2436
2545
|
{
|
|
2437
2546
|
"kind": "javascript-module",
|
|
2438
|
-
"path": "src/
|
|
2547
|
+
"path": "src/button/Button.ts",
|
|
2439
2548
|
"declarations": [
|
|
2440
2549
|
{
|
|
2441
2550
|
"kind": "class",
|
|
2442
|
-
"description": "
|
|
2443
|
-
"name": "
|
|
2551
|
+
"description": "Buttons are used for interface actions. Primary style should be\nused only once per section for main call-to-action, while other\nstyles can appear more frequently.",
|
|
2552
|
+
"name": "Button",
|
|
2444
2553
|
"cssProperties": [
|
|
2445
2554
|
{
|
|
2446
|
-
"description": "Controls the
|
|
2447
|
-
"name": "--n-
|
|
2448
|
-
"default": "
|
|
2555
|
+
"description": "Controls the rounded corners of the button, using [border radius tokens](/tokens/#border-radius).",
|
|
2556
|
+
"name": "--n-button-border-radius",
|
|
2557
|
+
"default": "var(--n-border-radius-s)"
|
|
2449
2558
|
},
|
|
2450
2559
|
{
|
|
2451
|
-
"description": "Controls the
|
|
2452
|
-
"name": "--n-
|
|
2453
|
-
"default": "
|
|
2560
|
+
"description": "Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).",
|
|
2561
|
+
"name": "--n-button-gap",
|
|
2562
|
+
"default": "var(--n-space-s)"
|
|
2454
2563
|
},
|
|
2455
2564
|
{
|
|
2456
|
-
"description": "Controls the
|
|
2457
|
-
"name": "--n-
|
|
2458
|
-
"default": "
|
|
2459
|
-
}
|
|
2460
|
-
],
|
|
2461
|
-
"slots": [
|
|
2565
|
+
"description": "Controls the overlayed gradient background on the button.",
|
|
2566
|
+
"name": "--n-button-gradient",
|
|
2567
|
+
"default": "linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))"
|
|
2568
|
+
},
|
|
2462
2569
|
{
|
|
2463
|
-
"description": "
|
|
2464
|
-
"name": "
|
|
2570
|
+
"description": "Controls the border color of the button, using [color tokens](/tokens/#color).",
|
|
2571
|
+
"name": "--n-button-border-color",
|
|
2572
|
+
"default": "var(--n-color-border-strong)"
|
|
2573
|
+
},
|
|
2574
|
+
{
|
|
2575
|
+
"description": "Controls the text alignment for the text in the button.",
|
|
2576
|
+
"name": "--n-button-text-align",
|
|
2577
|
+
"default": "center"
|
|
2465
2578
|
}
|
|
2466
2579
|
],
|
|
2467
|
-
"
|
|
2580
|
+
"slots": [
|
|
2468
2581
|
{
|
|
2469
|
-
"
|
|
2470
|
-
"name": "
|
|
2471
|
-
"privacy": "private"
|
|
2582
|
+
"description": "The button content",
|
|
2583
|
+
"name": ""
|
|
2472
2584
|
},
|
|
2473
2585
|
{
|
|
2474
|
-
"
|
|
2475
|
-
"name": "
|
|
2476
|
-
"privacy": "private"
|
|
2586
|
+
"description": "Used to place content at the start of button text. Typically used for icons.",
|
|
2587
|
+
"name": "start"
|
|
2477
2588
|
},
|
|
2478
2589
|
{
|
|
2479
|
-
"
|
|
2480
|
-
"name": "
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
"privacy": "private"
|
|
2485
|
-
},
|
|
2590
|
+
"description": "Used to place content at the end of button text. Typically used for icons.",
|
|
2591
|
+
"name": "end"
|
|
2592
|
+
}
|
|
2593
|
+
],
|
|
2594
|
+
"members": [
|
|
2486
2595
|
{
|
|
2487
2596
|
"kind": "field",
|
|
2488
|
-
"name": "
|
|
2489
|
-
"privacy": "private"
|
|
2490
|
-
"default": "new LocalizeController<\"nord-command-menu\">(this)"
|
|
2597
|
+
"name": "buttonRef",
|
|
2598
|
+
"privacy": "private"
|
|
2491
2599
|
},
|
|
2492
2600
|
{
|
|
2493
2601
|
"kind": "field",
|
|
2494
|
-
"name": "
|
|
2602
|
+
"name": "events",
|
|
2495
2603
|
"privacy": "private",
|
|
2496
|
-
"default": "new
|
|
2604
|
+
"default": "new EventController(this)"
|
|
2497
2605
|
},
|
|
2498
2606
|
{
|
|
2499
2607
|
"kind": "field",
|
|
2500
|
-
"name": "
|
|
2608
|
+
"name": "lightDom",
|
|
2501
2609
|
"privacy": "private",
|
|
2502
|
-
"default": "new
|
|
2503
|
-
},
|
|
2504
|
-
{
|
|
2505
|
-
"kind": "field",
|
|
2506
|
-
"name": "open",
|
|
2507
|
-
"type": {
|
|
2508
|
-
"text": "boolean"
|
|
2509
|
-
},
|
|
2510
|
-
"default": "false",
|
|
2511
|
-
"description": "Show or hide the command menu.",
|
|
2512
|
-
"attribute": "open"
|
|
2513
|
-
},
|
|
2514
|
-
{
|
|
2515
|
-
"kind": "field",
|
|
2516
|
-
"name": "placeholder",
|
|
2517
|
-
"type": {
|
|
2518
|
-
"text": "string"
|
|
2519
|
-
},
|
|
2520
|
-
"default": "\"Type a command or search...\"",
|
|
2521
|
-
"description": "Hint text to display in the Command Menu search field.",
|
|
2522
|
-
"attribute": "placeholder"
|
|
2610
|
+
"default": "new LightDomController(this, {\n render: () => this.renderLightDom(),\n })"
|
|
2523
2611
|
},
|
|
2524
2612
|
{
|
|
2525
2613
|
"kind": "field",
|
|
2526
|
-
"name": "
|
|
2614
|
+
"name": "variant",
|
|
2527
2615
|
"type": {
|
|
2528
|
-
"text": "
|
|
2616
|
+
"text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
|
|
2529
2617
|
},
|
|
2530
|
-
"default": "
|
|
2531
|
-
"description": "
|
|
2618
|
+
"default": "\"default\"",
|
|
2619
|
+
"description": "The style variant of the button.",
|
|
2620
|
+
"attribute": "variant",
|
|
2621
|
+
"reflects": true
|
|
2532
2622
|
},
|
|
2533
2623
|
{
|
|
2534
2624
|
"kind": "field",
|
|
2535
|
-
"name": "
|
|
2625
|
+
"name": "type",
|
|
2536
2626
|
"type": {
|
|
2537
|
-
"text": "
|
|
2627
|
+
"text": "\"button\" | \"submit\" | \"reset\""
|
|
2538
2628
|
},
|
|
2539
|
-
"
|
|
2629
|
+
"default": "\"submit\"",
|
|
2630
|
+
"description": "The type of the button.",
|
|
2631
|
+
"attribute": "type",
|
|
2632
|
+
"reflects": true
|
|
2540
2633
|
},
|
|
2541
2634
|
{
|
|
2542
2635
|
"kind": "field",
|
|
2543
|
-
"name": "
|
|
2636
|
+
"name": "size",
|
|
2544
2637
|
"type": {
|
|
2545
|
-
"text": "
|
|
2638
|
+
"text": "\"s\" | \"m\" | \"l\""
|
|
2546
2639
|
},
|
|
2547
|
-
"
|
|
2548
|
-
"
|
|
2640
|
+
"default": "\"m\"",
|
|
2641
|
+
"description": "The size of the button.\nThis affects font-size and padding.",
|
|
2642
|
+
"attribute": "size",
|
|
2643
|
+
"reflects": true
|
|
2549
2644
|
},
|
|
2550
2645
|
{
|
|
2551
2646
|
"kind": "field",
|
|
2552
|
-
"name": "
|
|
2647
|
+
"name": "accessibleExpanded",
|
|
2553
2648
|
"type": {
|
|
2554
|
-
"text": "
|
|
2649
|
+
"text": "\"true\" | \"false\" | undefined"
|
|
2555
2650
|
},
|
|
2556
2651
|
"privacy": "private",
|
|
2557
|
-
"
|
|
2652
|
+
"attribute": "aria-expanded"
|
|
2558
2653
|
},
|
|
2559
2654
|
{
|
|
2560
2655
|
"kind": "field",
|
|
2561
|
-
"name": "
|
|
2656
|
+
"name": "accessibleHasPopup",
|
|
2562
2657
|
"type": {
|
|
2563
|
-
"text": "
|
|
2658
|
+
"text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
|
|
2564
2659
|
},
|
|
2565
2660
|
"privacy": "private",
|
|
2566
|
-
"
|
|
2661
|
+
"attribute": "aria-haspopup"
|
|
2567
2662
|
},
|
|
2568
2663
|
{
|
|
2569
2664
|
"kind": "field",
|
|
2570
|
-
"name": "
|
|
2665
|
+
"name": "href",
|
|
2571
2666
|
"type": {
|
|
2572
|
-
"text": "
|
|
2667
|
+
"text": "string | undefined"
|
|
2573
2668
|
},
|
|
2574
|
-
"
|
|
2575
|
-
"
|
|
2669
|
+
"description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
|
|
2670
|
+
"attribute": "href",
|
|
2671
|
+
"reflects": true
|
|
2576
2672
|
},
|
|
2577
2673
|
{
|
|
2578
2674
|
"kind": "field",
|
|
2579
|
-
"name": "
|
|
2580
|
-
"type": {
|
|
2581
|
-
"text": "
|
|
2582
|
-
},
|
|
2583
|
-
"
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
"kind": "method",
|
|
2587
|
-
"name": "show",
|
|
2588
|
-
"parameters": [
|
|
2589
|
-
{
|
|
2590
|
-
"name": "options",
|
|
2591
|
-
"default": "{}",
|
|
2592
|
-
"type": {
|
|
2593
|
-
"text": "{ parent?: string }"
|
|
2594
|
-
},
|
|
2595
|
-
"description": "allows you to open the menu filtered to a specific parent command."
|
|
2596
|
-
}
|
|
2597
|
-
],
|
|
2598
|
-
"description": "Show the command menu programmatically."
|
|
2599
|
-
},
|
|
2600
|
-
{
|
|
2601
|
-
"kind": "method",
|
|
2602
|
-
"name": "close",
|
|
2603
|
-
"description": "Close the command menu programmatically."
|
|
2604
|
-
},
|
|
2605
|
-
{
|
|
2606
|
-
"kind": "method",
|
|
2607
|
-
"name": "toggleOpen",
|
|
2608
|
-
"description": "Toggle the open state programmatically."
|
|
2609
|
-
},
|
|
2610
|
-
{
|
|
2611
|
-
"kind": "method",
|
|
2612
|
-
"name": "focus",
|
|
2613
|
-
"description": "Focus the command menu's input."
|
|
2614
|
-
},
|
|
2615
|
-
{
|
|
2616
|
-
"kind": "method",
|
|
2617
|
-
"name": "renderNoResults",
|
|
2618
|
-
"privacy": "private"
|
|
2619
|
-
},
|
|
2620
|
-
{
|
|
2621
|
-
"kind": "method",
|
|
2622
|
-
"name": "renderSection",
|
|
2623
|
-
"privacy": "private",
|
|
2624
|
-
"parameters": [
|
|
2625
|
-
{
|
|
2626
|
-
"name": "section",
|
|
2627
|
-
"type": {
|
|
2628
|
-
"text": "string | undefined"
|
|
2629
|
-
}
|
|
2630
|
-
},
|
|
2631
|
-
{
|
|
2632
|
-
"name": "commands",
|
|
2633
|
-
"type": {
|
|
2634
|
-
"text": "ICommandMenuAction[]"
|
|
2635
|
-
}
|
|
2636
|
-
}
|
|
2637
|
-
]
|
|
2638
|
-
},
|
|
2639
|
-
{
|
|
2640
|
-
"kind": "method",
|
|
2641
|
-
"name": "handleCommandsChange",
|
|
2642
|
-
"privacy": "protected"
|
|
2643
|
-
},
|
|
2644
|
-
{
|
|
2645
|
-
"kind": "method",
|
|
2646
|
-
"name": "handleBump",
|
|
2647
|
-
"privacy": "protected"
|
|
2675
|
+
"name": "download",
|
|
2676
|
+
"type": {
|
|
2677
|
+
"text": "boolean"
|
|
2678
|
+
},
|
|
2679
|
+
"default": "false",
|
|
2680
|
+
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
2681
|
+
"attribute": "download"
|
|
2648
2682
|
},
|
|
2649
2683
|
{
|
|
2650
|
-
"kind": "
|
|
2651
|
-
"name": "
|
|
2652
|
-
"
|
|
2684
|
+
"kind": "field",
|
|
2685
|
+
"name": "target",
|
|
2686
|
+
"type": {
|
|
2687
|
+
"text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
|
|
2688
|
+
},
|
|
2689
|
+
"default": "\"_self\"",
|
|
2690
|
+
"description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
|
|
2691
|
+
"attribute": "target",
|
|
2692
|
+
"reflects": true
|
|
2653
2693
|
},
|
|
2654
2694
|
{
|
|
2655
|
-
"kind": "
|
|
2656
|
-
"name": "
|
|
2657
|
-
"
|
|
2695
|
+
"kind": "field",
|
|
2696
|
+
"name": "expand",
|
|
2697
|
+
"type": {
|
|
2698
|
+
"text": "boolean"
|
|
2699
|
+
},
|
|
2700
|
+
"default": "false",
|
|
2701
|
+
"description": "Controls whether the button expands to fill the width of its container.",
|
|
2702
|
+
"attribute": "expand",
|
|
2703
|
+
"reflects": true
|
|
2658
2704
|
},
|
|
2659
2705
|
{
|
|
2660
|
-
"kind": "
|
|
2661
|
-
"name": "
|
|
2662
|
-
"
|
|
2706
|
+
"kind": "field",
|
|
2707
|
+
"name": "loading",
|
|
2708
|
+
"type": {
|
|
2709
|
+
"text": "boolean"
|
|
2710
|
+
},
|
|
2711
|
+
"default": "false",
|
|
2712
|
+
"description": "Controls whether the button is in loading state. Please note that the spinner\nis hidden from assistive technologies, so you need to make sure to announce\nthe loading state to e.g. screen reader users. We also recommend disabling\nall user interactions on the button itself while in loading state.",
|
|
2713
|
+
"attribute": "loading",
|
|
2714
|
+
"reflects": true
|
|
2663
2715
|
},
|
|
2664
2716
|
{
|
|
2665
2717
|
"kind": "method",
|
|
2666
|
-
"name": "
|
|
2718
|
+
"name": "renderLink",
|
|
2667
2719
|
"privacy": "private",
|
|
2668
2720
|
"parameters": [
|
|
2669
2721
|
{
|
|
2670
|
-
"name": "
|
|
2722
|
+
"name": "innards",
|
|
2671
2723
|
"type": {
|
|
2672
|
-
"text": "
|
|
2724
|
+
"text": "TemplateResult"
|
|
2673
2725
|
}
|
|
2674
2726
|
}
|
|
2675
|
-
]
|
|
2727
|
+
],
|
|
2728
|
+
"description": "We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\nLinks cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\nAlong with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order."
|
|
2676
2729
|
},
|
|
2677
2730
|
{
|
|
2678
2731
|
"kind": "method",
|
|
2679
|
-
"name": "
|
|
2732
|
+
"name": "renderButton",
|
|
2680
2733
|
"privacy": "private",
|
|
2681
2734
|
"parameters": [
|
|
2682
2735
|
{
|
|
2683
|
-
"name": "
|
|
2684
|
-
"default": "this.selected",
|
|
2736
|
+
"name": "innards",
|
|
2685
2737
|
"type": {
|
|
2686
|
-
"text": "
|
|
2738
|
+
"text": "TemplateResult"
|
|
2687
2739
|
}
|
|
2688
2740
|
}
|
|
2689
2741
|
]
|
|
2690
2742
|
},
|
|
2691
2743
|
{
|
|
2692
2744
|
"kind": "method",
|
|
2693
|
-
"name": "
|
|
2694
|
-
"privacy": "private"
|
|
2695
|
-
},
|
|
2696
|
-
{
|
|
2697
|
-
"kind": "method",
|
|
2698
|
-
"name": "end",
|
|
2699
|
-
"privacy": "private"
|
|
2700
|
-
},
|
|
2701
|
-
{
|
|
2702
|
-
"kind": "method",
|
|
2703
|
-
"name": "next",
|
|
2704
|
-
"privacy": "private"
|
|
2705
|
-
},
|
|
2706
|
-
{
|
|
2707
|
-
"kind": "method",
|
|
2708
|
-
"name": "previous",
|
|
2745
|
+
"name": "renderLightDom",
|
|
2709
2746
|
"privacy": "private"
|
|
2710
2747
|
},
|
|
2711
2748
|
{
|
|
2712
|
-
"kind": "
|
|
2713
|
-
"name": "
|
|
2749
|
+
"kind": "field",
|
|
2750
|
+
"name": "handleOuterClick",
|
|
2714
2751
|
"privacy": "private"
|
|
2715
2752
|
},
|
|
2716
2753
|
{
|
|
2717
2754
|
"kind": "method",
|
|
2718
|
-
"name": "
|
|
2755
|
+
"name": "handleClick",
|
|
2719
2756
|
"privacy": "private",
|
|
2720
2757
|
"parameters": [
|
|
2721
2758
|
{
|
|
2722
|
-
"name": "
|
|
2723
|
-
"optional": true,
|
|
2759
|
+
"name": "e",
|
|
2724
2760
|
"type": {
|
|
2725
|
-
"text": "
|
|
2761
|
+
"text": "Event"
|
|
2726
2762
|
}
|
|
2727
2763
|
}
|
|
2728
2764
|
]
|
|
2729
2765
|
},
|
|
2730
2766
|
{
|
|
2731
2767
|
"kind": "method",
|
|
2732
|
-
"name": "
|
|
2768
|
+
"name": "handleProxyChange",
|
|
2733
2769
|
"privacy": "private",
|
|
2734
2770
|
"parameters": [
|
|
2735
2771
|
{
|
|
2736
|
-
"name": "
|
|
2772
|
+
"name": "e",
|
|
2737
2773
|
"type": {
|
|
2738
|
-
"text": "
|
|
2774
|
+
"text": "Event"
|
|
2739
2775
|
}
|
|
2740
2776
|
}
|
|
2741
|
-
]
|
|
2777
|
+
],
|
|
2778
|
+
"description": "React/Vue etc may remove our proxy button when updating button text, since they are unaware of its existence.\nSo we listen for a slotchange event, and if the element is no longer connected to the DOM we add it back in."
|
|
2742
2779
|
},
|
|
2743
2780
|
{
|
|
2744
|
-
"kind": "
|
|
2745
|
-
"name": "
|
|
2746
|
-
"privacy": "private"
|
|
2747
|
-
}
|
|
2748
|
-
],
|
|
2749
|
-
"events": [
|
|
2750
|
-
{
|
|
2751
|
-
"name": "open",
|
|
2781
|
+
"kind": "field",
|
|
2782
|
+
"name": "disabled",
|
|
2752
2783
|
"type": {
|
|
2753
|
-
"text": "
|
|
2784
|
+
"text": "boolean"
|
|
2754
2785
|
},
|
|
2755
|
-
"
|
|
2786
|
+
"default": "false",
|
|
2787
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2788
|
+
"attribute": "disabled",
|
|
2789
|
+
"reflects": true,
|
|
2790
|
+
"inheritedFrom": {
|
|
2791
|
+
"name": "InputMixin",
|
|
2792
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2793
|
+
}
|
|
2756
2794
|
},
|
|
2757
2795
|
{
|
|
2758
|
-
"
|
|
2796
|
+
"kind": "field",
|
|
2797
|
+
"name": "name",
|
|
2759
2798
|
"type": {
|
|
2760
|
-
"text": "
|
|
2799
|
+
"text": "string | undefined"
|
|
2761
2800
|
},
|
|
2762
|
-
"description": "The
|
|
2801
|
+
"description": "The name of the form component.",
|
|
2802
|
+
"attribute": "name",
|
|
2803
|
+
"inheritedFrom": {
|
|
2804
|
+
"name": "InputMixin",
|
|
2805
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2806
|
+
}
|
|
2763
2807
|
},
|
|
2764
2808
|
{
|
|
2809
|
+
"kind": "field",
|
|
2810
|
+
"name": "value",
|
|
2765
2811
|
"type": {
|
|
2766
|
-
"text": "
|
|
2812
|
+
"text": "string"
|
|
2767
2813
|
},
|
|
2768
|
-
"
|
|
2769
|
-
"
|
|
2814
|
+
"default": "\"\"",
|
|
2815
|
+
"description": "The value of the form component.",
|
|
2816
|
+
"attribute": "value",
|
|
2817
|
+
"inheritedFrom": {
|
|
2818
|
+
"name": "InputMixin",
|
|
2819
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2820
|
+
}
|
|
2821
|
+
},
|
|
2822
|
+
{
|
|
2823
|
+
"kind": "field",
|
|
2824
|
+
"name": "form",
|
|
2825
|
+
"description": "Gets the form, if any, associated with the form element.",
|
|
2826
|
+
"inheritedFrom": {
|
|
2827
|
+
"name": "InputMixin",
|
|
2828
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2829
|
+
}
|
|
2830
|
+
},
|
|
2831
|
+
{
|
|
2832
|
+
"kind": "field",
|
|
2833
|
+
"name": "focusableRef",
|
|
2834
|
+
"privacy": "protected",
|
|
2835
|
+
"inheritedFrom": {
|
|
2836
|
+
"name": "FocusableMixin",
|
|
2837
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2838
|
+
}
|
|
2839
|
+
},
|
|
2840
|
+
{
|
|
2841
|
+
"kind": "method",
|
|
2842
|
+
"name": "focus",
|
|
2843
|
+
"parameters": [
|
|
2844
|
+
{
|
|
2845
|
+
"name": "options",
|
|
2846
|
+
"optional": true,
|
|
2847
|
+
"type": {
|
|
2848
|
+
"text": "FocusOptions"
|
|
2849
|
+
},
|
|
2850
|
+
"description": "An object which controls aspects of the focusing process."
|
|
2851
|
+
}
|
|
2852
|
+
],
|
|
2853
|
+
"description": "Programmatically move focus to the component.",
|
|
2854
|
+
"inheritedFrom": {
|
|
2855
|
+
"name": "FocusableMixin",
|
|
2856
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2857
|
+
}
|
|
2858
|
+
},
|
|
2859
|
+
{
|
|
2860
|
+
"kind": "method",
|
|
2861
|
+
"name": "blur",
|
|
2862
|
+
"description": "Programmatically remove focus from the component.",
|
|
2863
|
+
"inheritedFrom": {
|
|
2864
|
+
"name": "FocusableMixin",
|
|
2865
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2866
|
+
}
|
|
2867
|
+
},
|
|
2868
|
+
{
|
|
2869
|
+
"kind": "method",
|
|
2870
|
+
"name": "click",
|
|
2871
|
+
"description": "Programmatically simulates a click on the component.",
|
|
2872
|
+
"inheritedFrom": {
|
|
2873
|
+
"name": "FocusableMixin",
|
|
2874
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2875
|
+
}
|
|
2770
2876
|
}
|
|
2771
2877
|
],
|
|
2772
2878
|
"attributes": [
|
|
2773
2879
|
{
|
|
2774
|
-
"name": "
|
|
2880
|
+
"name": "variant",
|
|
2775
2881
|
"type": {
|
|
2776
|
-
"text": "
|
|
2882
|
+
"text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
|
|
2777
2883
|
},
|
|
2778
|
-
"default": "
|
|
2779
|
-
"description": "
|
|
2780
|
-
"fieldName": "
|
|
2884
|
+
"default": "\"default\"",
|
|
2885
|
+
"description": "The style variant of the button.",
|
|
2886
|
+
"fieldName": "variant"
|
|
2781
2887
|
},
|
|
2782
2888
|
{
|
|
2783
|
-
"name": "
|
|
2784
|
-
"type": {
|
|
2785
|
-
"text": "
|
|
2786
|
-
},
|
|
2787
|
-
"default": "\"
|
|
2788
|
-
"description": "
|
|
2789
|
-
"fieldName": "
|
|
2790
|
-
}
|
|
2791
|
-
],
|
|
2792
|
-
"superclass": {
|
|
2793
|
-
"name": "LitElement",
|
|
2794
|
-
"package": "lit"
|
|
2795
|
-
},
|
|
2796
|
-
"status": "ready",
|
|
2797
|
-
"category": "action",
|
|
2798
|
-
"displayName": null,
|
|
2799
|
-
"tagName": "nord-command-menu",
|
|
2800
|
-
"customElement": true
|
|
2801
|
-
}
|
|
2802
|
-
],
|
|
2803
|
-
"exports": [
|
|
2804
|
-
{
|
|
2805
|
-
"kind": "js",
|
|
2806
|
-
"name": "default",
|
|
2807
|
-
"declaration": {
|
|
2808
|
-
"name": "CommandMenu",
|
|
2809
|
-
"module": "src/command-menu/CommandMenu.ts"
|
|
2810
|
-
}
|
|
2811
|
-
},
|
|
2812
|
-
{
|
|
2813
|
-
"kind": "custom-element-definition",
|
|
2814
|
-
"name": "nord-command-menu",
|
|
2815
|
-
"declaration": {
|
|
2816
|
-
"name": "CommandMenu",
|
|
2817
|
-
"module": "src/command-menu/CommandMenu.ts"
|
|
2818
|
-
}
|
|
2819
|
-
}
|
|
2820
|
-
],
|
|
2821
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2822
|
-
},
|
|
2823
|
-
{
|
|
2824
|
-
"kind": "javascript-module",
|
|
2825
|
-
"path": "src/command-menu/CommandMenuAction.ts",
|
|
2826
|
-
"declarations": [
|
|
2827
|
-
{
|
|
2828
|
-
"kind": "class",
|
|
2829
|
-
"description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
|
|
2830
|
-
"name": "CommandMenuAction",
|
|
2831
|
-
"members": [
|
|
2832
|
-
{
|
|
2833
|
-
"kind": "field",
|
|
2834
|
-
"name": "direction",
|
|
2835
|
-
"privacy": "private",
|
|
2836
|
-
"default": "new DirectionController(this)"
|
|
2889
|
+
"name": "type",
|
|
2890
|
+
"type": {
|
|
2891
|
+
"text": "\"button\" | \"submit\" | \"reset\""
|
|
2892
|
+
},
|
|
2893
|
+
"default": "\"submit\"",
|
|
2894
|
+
"description": "The type of the button.",
|
|
2895
|
+
"fieldName": "type"
|
|
2837
2896
|
},
|
|
2838
2897
|
{
|
|
2839
|
-
"
|
|
2840
|
-
"name": "command",
|
|
2898
|
+
"name": "size",
|
|
2841
2899
|
"type": {
|
|
2842
|
-
"text": "
|
|
2900
|
+
"text": "\"s\" | \"m\" | \"l\""
|
|
2843
2901
|
},
|
|
2844
|
-
"
|
|
2902
|
+
"default": "\"m\"",
|
|
2903
|
+
"description": "The size of the button.\nThis affects font-size and padding.",
|
|
2904
|
+
"fieldName": "size"
|
|
2845
2905
|
},
|
|
2846
2906
|
{
|
|
2847
|
-
"
|
|
2848
|
-
"name": "selected",
|
|
2907
|
+
"name": "aria-expanded",
|
|
2849
2908
|
"type": {
|
|
2850
|
-
"text": "
|
|
2909
|
+
"text": "\"true\" | \"false\" | undefined"
|
|
2851
2910
|
},
|
|
2852
|
-
"
|
|
2853
|
-
"attribute": "selected"
|
|
2911
|
+
"fieldName": "accessibleExpanded"
|
|
2854
2912
|
},
|
|
2855
2913
|
{
|
|
2856
|
-
"
|
|
2857
|
-
"
|
|
2858
|
-
|
|
2859
|
-
|
|
2914
|
+
"name": "aria-haspopup",
|
|
2915
|
+
"type": {
|
|
2916
|
+
"text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
|
|
2917
|
+
},
|
|
2918
|
+
"fieldName": "accessibleHasPopup"
|
|
2860
2919
|
},
|
|
2861
2920
|
{
|
|
2862
|
-
"
|
|
2863
|
-
"
|
|
2864
|
-
|
|
2921
|
+
"name": "href",
|
|
2922
|
+
"type": {
|
|
2923
|
+
"text": "string | undefined"
|
|
2924
|
+
},
|
|
2925
|
+
"description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
|
|
2926
|
+
"fieldName": "href"
|
|
2865
2927
|
},
|
|
2866
2928
|
{
|
|
2867
|
-
"
|
|
2868
|
-
"
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2929
|
+
"name": "download",
|
|
2930
|
+
"type": {
|
|
2931
|
+
"text": "boolean"
|
|
2932
|
+
},
|
|
2933
|
+
"default": "false",
|
|
2934
|
+
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
2935
|
+
"fieldName": "download"
|
|
2936
|
+
},
|
|
2873
2937
|
{
|
|
2874
|
-
"name": "
|
|
2938
|
+
"name": "target",
|
|
2875
2939
|
"type": {
|
|
2876
|
-
"text": "
|
|
2940
|
+
"text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
|
|
2877
2941
|
},
|
|
2878
|
-
"
|
|
2942
|
+
"default": "\"_self\"",
|
|
2943
|
+
"description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
|
|
2944
|
+
"fieldName": "target"
|
|
2879
2945
|
},
|
|
2880
2946
|
{
|
|
2881
|
-
"name": "
|
|
2947
|
+
"name": "expand",
|
|
2882
2948
|
"type": {
|
|
2883
2949
|
"text": "boolean"
|
|
2884
2950
|
},
|
|
2885
2951
|
"default": "false",
|
|
2886
|
-
"
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
"superclass": {
|
|
2890
|
-
"name": "LitElement",
|
|
2891
|
-
"package": "lit"
|
|
2892
|
-
},
|
|
2893
|
-
"status": "internal",
|
|
2894
|
-
"category": null,
|
|
2895
|
-
"displayName": null,
|
|
2896
|
-
"tagName": "nord-command-menu-action",
|
|
2897
|
-
"customElement": true
|
|
2898
|
-
}
|
|
2899
|
-
],
|
|
2900
|
-
"exports": [
|
|
2901
|
-
{
|
|
2902
|
-
"kind": "js",
|
|
2903
|
-
"name": "default",
|
|
2904
|
-
"declaration": {
|
|
2905
|
-
"name": "CommandMenuAction",
|
|
2906
|
-
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2907
|
-
}
|
|
2908
|
-
},
|
|
2909
|
-
{
|
|
2910
|
-
"kind": "custom-element-definition",
|
|
2911
|
-
"name": "nord-command-menu-action",
|
|
2912
|
-
"declaration": {
|
|
2913
|
-
"name": "CommandMenuAction",
|
|
2914
|
-
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
|
-
],
|
|
2918
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2919
|
-
},
|
|
2920
|
-
{
|
|
2921
|
-
"kind": "javascript-module",
|
|
2922
|
-
"path": "src/command-menu/ICommandMenuAction.ts",
|
|
2923
|
-
"declarations": [],
|
|
2924
|
-
"exports": [],
|
|
2925
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2926
|
-
},
|
|
2927
|
-
{
|
|
2928
|
-
"kind": "javascript-module",
|
|
2929
|
-
"path": "src/command-menu/KeyboardController.ts",
|
|
2930
|
-
"declarations": [
|
|
2931
|
-
{
|
|
2932
|
-
"kind": "class",
|
|
2933
|
-
"description": "",
|
|
2934
|
-
"name": "KeyboardController",
|
|
2935
|
-
"members": [
|
|
2952
|
+
"description": "Controls whether the button expands to fill the width of its container.",
|
|
2953
|
+
"fieldName": "expand"
|
|
2954
|
+
},
|
|
2936
2955
|
{
|
|
2937
|
-
"
|
|
2938
|
-
"name": "globalShortcuts",
|
|
2956
|
+
"name": "loading",
|
|
2939
2957
|
"type": {
|
|
2940
|
-
"text": "
|
|
2958
|
+
"text": "boolean"
|
|
2941
2959
|
},
|
|
2942
|
-
"
|
|
2943
|
-
"
|
|
2960
|
+
"default": "false",
|
|
2961
|
+
"description": "Controls whether the button is in loading state. Please note that the spinner\nis hidden from assistive technologies, so you need to make sure to announce\nthe loading state to e.g. screen reader users. We also recommend disabling\nall user interactions on the button itself while in loading state.",
|
|
2962
|
+
"fieldName": "loading"
|
|
2944
2963
|
},
|
|
2945
2964
|
{
|
|
2946
|
-
"
|
|
2947
|
-
"name": "navigationShortcuts",
|
|
2965
|
+
"name": "disabled",
|
|
2948
2966
|
"type": {
|
|
2949
|
-
"text": "
|
|
2967
|
+
"text": "boolean"
|
|
2950
2968
|
},
|
|
2951
|
-
"
|
|
2952
|
-
"
|
|
2969
|
+
"default": "false",
|
|
2970
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2971
|
+
"fieldName": "disabled",
|
|
2972
|
+
"inheritedFrom": {
|
|
2973
|
+
"name": "InputMixin",
|
|
2974
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2975
|
+
}
|
|
2953
2976
|
},
|
|
2954
2977
|
{
|
|
2955
|
-
"
|
|
2956
|
-
"name": "commandShortcuts",
|
|
2978
|
+
"name": "name",
|
|
2957
2979
|
"type": {
|
|
2958
|
-
"text": "
|
|
2980
|
+
"text": "string | undefined"
|
|
2959
2981
|
},
|
|
2960
|
-
"
|
|
2961
|
-
"
|
|
2982
|
+
"description": "The name of the form component.",
|
|
2983
|
+
"fieldName": "name",
|
|
2984
|
+
"inheritedFrom": {
|
|
2985
|
+
"name": "InputMixin",
|
|
2986
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2987
|
+
}
|
|
2962
2988
|
},
|
|
2963
2989
|
{
|
|
2964
|
-
"
|
|
2965
|
-
"name": "registerCommandShortcuts"
|
|
2966
|
-
}
|
|
2967
|
-
]
|
|
2968
|
-
}
|
|
2969
|
-
],
|
|
2970
|
-
"exports": [
|
|
2971
|
-
{
|
|
2972
|
-
"kind": "js",
|
|
2973
|
-
"name": "KeyboardController",
|
|
2974
|
-
"declaration": {
|
|
2975
|
-
"name": "KeyboardController",
|
|
2976
|
-
"module": "src/command-menu/KeyboardController.ts"
|
|
2977
|
-
}
|
|
2978
|
-
}
|
|
2979
|
-
],
|
|
2980
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2981
|
-
},
|
|
2982
|
-
{
|
|
2983
|
-
"kind": "javascript-module",
|
|
2984
|
-
"path": "src/command-menu/SelectEvent.ts",
|
|
2985
|
-
"declarations": [
|
|
2986
|
-
{
|
|
2987
|
-
"kind": "class",
|
|
2988
|
-
"description": "",
|
|
2989
|
-
"name": "SelectEvent",
|
|
2990
|
-
"members": [
|
|
2991
|
-
{
|
|
2992
|
-
"kind": "field",
|
|
2993
|
-
"name": "eventName",
|
|
2990
|
+
"name": "value",
|
|
2994
2991
|
"type": {
|
|
2995
2992
|
"text": "string"
|
|
2996
2993
|
},
|
|
2997
|
-
"
|
|
2998
|
-
"
|
|
2994
|
+
"default": "\"\"",
|
|
2995
|
+
"description": "The value of the form component.",
|
|
2996
|
+
"fieldName": "value",
|
|
2997
|
+
"inheritedFrom": {
|
|
2998
|
+
"name": "InputMixin",
|
|
2999
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
3000
|
+
}
|
|
3001
|
+
}
|
|
3002
|
+
],
|
|
3003
|
+
"mixins": [
|
|
3004
|
+
{
|
|
3005
|
+
"name": "InputMixin",
|
|
3006
|
+
"module": "/src/common/mixins/InputMixin.js"
|
|
3007
|
+
},
|
|
3008
|
+
{
|
|
3009
|
+
"name": "FocusableMixin",
|
|
3010
|
+
"module": "/src/common/mixins/FocusableMixin.js"
|
|
2999
3011
|
}
|
|
3000
3012
|
],
|
|
3001
3013
|
"superclass": {
|
|
3002
|
-
"name": "
|
|
3003
|
-
"
|
|
3004
|
-
}
|
|
3014
|
+
"name": "LitElement",
|
|
3015
|
+
"package": "lit"
|
|
3016
|
+
},
|
|
3017
|
+
"status": "ready",
|
|
3018
|
+
"category": "action",
|
|
3019
|
+
"displayName": null,
|
|
3020
|
+
"tagName": "nord-button",
|
|
3021
|
+
"customElement": true
|
|
3005
3022
|
}
|
|
3006
3023
|
],
|
|
3007
3024
|
"exports": [
|
|
3008
3025
|
{
|
|
3009
3026
|
"kind": "js",
|
|
3010
|
-
"name": "
|
|
3027
|
+
"name": "default",
|
|
3011
3028
|
"declaration": {
|
|
3012
|
-
"name": "
|
|
3013
|
-
"module": "src/
|
|
3029
|
+
"name": "Button",
|
|
3030
|
+
"module": "src/button/Button.ts"
|
|
3014
3031
|
}
|
|
3015
|
-
}
|
|
3016
|
-
],
|
|
3017
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
3018
|
-
},
|
|
3019
|
-
{
|
|
3020
|
-
"kind": "javascript-module",
|
|
3021
|
-
"path": "src/command-menu/localization.ts",
|
|
3022
|
-
"declarations": [
|
|
3023
|
-
{
|
|
3024
|
-
"kind": "variable",
|
|
3025
|
-
"name": "commandMenuLocalization",
|
|
3026
|
-
"type": {
|
|
3027
|
-
"text": "object"
|
|
3028
|
-
},
|
|
3029
|
-
"default": "{\n instructions: \"Press 'Enter' to confirm your input or 'Escape' to cancel\",\n inputLabel: \"Type the name of a command to run.\",\n footerArrowKeys: \"Navigate\",\n footerEnterKey: \"Select\",\n footerEscapeKey: \"Esc to dismiss\",\n footerBackspaceKey: \"Move to parent\",\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: \"Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase.\",\n}"
|
|
3030
|
-
}
|
|
3031
|
-
],
|
|
3032
|
-
"exports": [
|
|
3032
|
+
},
|
|
3033
3033
|
{
|
|
3034
|
-
"kind": "
|
|
3035
|
-
"name": "
|
|
3034
|
+
"kind": "custom-element-definition",
|
|
3035
|
+
"name": "nord-button",
|
|
3036
3036
|
"declaration": {
|
|
3037
|
-
"name": "
|
|
3038
|
-
"module": "src/
|
|
3037
|
+
"name": "Button",
|
|
3038
|
+
"module": "src/button/Button.ts"
|
|
3039
3039
|
}
|
|
3040
3040
|
}
|
|
3041
3041
|
],
|
|
3042
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
3042
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Only use one primary button per section, as a main call-to-action.\n- Use clear and accurate labels.\n- Use established button colors appropriately. For example, only use a danger button style for an action that’s difficult or impossible to undo.\n- Prioritize the most important actions. Too many buttons will cause confusion.\n- Be consistent with positioning of buttons in the user interface.\n- Use strong, actionable verbs in labels such as “Add”, “Close”, “Cancel”, or “Save”.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don't use a primary button in every row of a table.\n- Don’t use buttons to link to other pages. Use regular link or a plain style instead where necessary.\n- Don’t use buttons for navigation where the link appears within or following a sentence.\n- Don’t use labels such as “Read more”, “Click here” or “More”.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `default` | Default style is the most common button variant. Only switch to another variant if you need to adjust the visual weight of the element. |\n| `primary` | Primary style is reserved for main call-to-actions. Should be used only once per content area or panel, e.g. for a “Save” action. |\n| `dashed` | Dashed style should be used for actions that trigger filtering. |\n| `danger` | Danger style should be used for actions that delete data or otherwise make it hard to undo the action. |\n| `plain` | Used for less important or less common actions. Can be also used for linking to other pages. |\n| `disabled` | Used for actions that aren’t currently available or not available anymore. Also prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies. |\n| `switch` | Switch style is reserved for the clinic switcher in the top left corner of an application. |\n\n---\n\n## Additional considerations\n\n- Users of assistive technology expect a button to submit data or do an action. If you need the button to navigate into another view, use the `href` property which will output `<a>` tag instead of a `<button>`.\n- When you need to disable a button, use `disabled` property as it conveys this information correctly to assistive technologies like screen readers.\n- Button component provides 3 size variants; small, medium and large. The large size should only be used for marketing purposes or on areas such as an empty space/content notice.\n"
|
|
3043
3043
|
},
|
|
3044
3044
|
{
|
|
3045
3045
|
"kind": "javascript-module",
|