@nordhealth/components 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1024 -829
- package/lib/AutocompleteMixin-370de2be.js.map +1 -1
- package/lib/Button.js +1 -1
- package/lib/Button.js.map +1 -1
- package/lib/{Calendar-7ae2dda7.js → Calendar-49dc5248.js} +1 -1
- package/lib/{Calendar-7ae2dda7.js.map → Calendar-49dc5248.js.map} +1 -1
- package/lib/Calendar.js +1 -1
- package/lib/Card.js +1 -1
- package/lib/Card.js.map +1 -1
- package/lib/DatePicker.js +1 -1
- package/lib/Drawer.js +2 -0
- package/lib/Drawer.js.map +1 -0
- package/lib/Dropdown.js +1 -1
- package/lib/Dropdown.js.map +1 -1
- package/lib/Header.js +1 -1
- package/lib/Header.js.map +1 -1
- package/lib/InputMixin-158f63fb.js.map +1 -1
- package/lib/Layout.js +1 -1
- package/lib/Layout.js.map +1 -1
- package/lib/Modal.js +1 -1
- package/lib/Modal.js.map +1 -1
- package/lib/Popout.js +1 -1
- package/lib/Popout.js.map +1 -1
- package/lib/ScrollbarController-680392c9.js +2 -0
- package/lib/ScrollbarController-680392c9.js.map +1 -0
- package/lib/TextField-94b0839b.js.map +1 -1
- package/lib/Tooltip.js +1 -1
- package/lib/Tooltip.js.map +1 -1
- package/lib/bundle.js +3 -3
- package/lib/bundle.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/src/common/mixins/InputMixin.d.ts +1 -1
- package/lib/src/drawer/Drawer.d.ts +29 -0
- package/lib/src/drawer/Drawer.test.d.ts +6 -0
- package/lib/src/dropdown/Dropdown.d.ts +5 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/layout/Layout.d.ts +4 -0
- package/lib/src/layout/Layout.test.d.ts +1 -0
- package/lib/src/popout/Popout.d.ts +7 -1
- package/package.json +2 -2
package/custom-elements.json
CHANGED
|
@@ -366,6 +366,14 @@
|
|
|
366
366
|
"name": "default",
|
|
367
367
|
"module": "\"./qrcode/Qrcode.js\""
|
|
368
368
|
}
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"kind": "js",
|
|
372
|
+
"name": "Drawer",
|
|
373
|
+
"declaration": {
|
|
374
|
+
"name": "default",
|
|
375
|
+
"module": "\"./drawer/Drawer.js\""
|
|
376
|
+
}
|
|
369
377
|
}
|
|
370
378
|
]
|
|
371
379
|
},
|
|
@@ -513,244 +521,152 @@
|
|
|
513
521
|
},
|
|
514
522
|
{
|
|
515
523
|
"kind": "javascript-module",
|
|
516
|
-
"path": "src/
|
|
524
|
+
"path": "src/calendar/Calendar.ts",
|
|
517
525
|
"declarations": [
|
|
518
526
|
{
|
|
519
527
|
"kind": "class",
|
|
520
|
-
"description": "
|
|
521
|
-
"name": "
|
|
522
|
-
"
|
|
528
|
+
"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.",
|
|
529
|
+
"name": "Calendar",
|
|
530
|
+
"cssProperties": [
|
|
523
531
|
{
|
|
524
|
-
"description": "
|
|
525
|
-
"name": ""
|
|
532
|
+
"description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
|
|
533
|
+
"name": "--n-calendar-border-radius",
|
|
534
|
+
"default": "var(--n-border-radius)"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
|
|
538
|
+
"name": "--n-calendar-box-shadow",
|
|
539
|
+
"default": "var(--n-box-shadow-popout)"
|
|
526
540
|
}
|
|
527
541
|
],
|
|
528
542
|
"members": [
|
|
529
543
|
{
|
|
530
544
|
"kind": "field",
|
|
531
|
-
"name": "
|
|
545
|
+
"name": "dialogLabelId",
|
|
532
546
|
"type": {
|
|
533
|
-
"text": "
|
|
547
|
+
"text": "string"
|
|
534
548
|
},
|
|
535
|
-
"
|
|
536
|
-
"
|
|
537
|
-
"attribute": "type",
|
|
538
|
-
"reflects": true
|
|
549
|
+
"privacy": "private",
|
|
550
|
+
"default": "\"dialog-header\""
|
|
539
551
|
},
|
|
540
552
|
{
|
|
541
553
|
"kind": "field",
|
|
542
|
-
"name": "
|
|
543
|
-
"type": {
|
|
544
|
-
"text": "\"cancelled\" | \"complete\" | \"incomplete\" | \"partially-complete\" | undefined"
|
|
545
|
-
},
|
|
546
|
-
"description": "The progress of the badge. Displays a progress\nindicator next to the label.",
|
|
547
|
-
"attribute": "progress"
|
|
548
|
-
}
|
|
549
|
-
],
|
|
550
|
-
"attributes": [
|
|
551
|
-
{
|
|
552
|
-
"name": "type",
|
|
554
|
+
"name": "monthSelectNode",
|
|
553
555
|
"type": {
|
|
554
|
-
"text": "
|
|
556
|
+
"text": "HTMLElement"
|
|
555
557
|
},
|
|
556
|
-
"
|
|
557
|
-
"description": "The type of badge.\nDetermines the background color of the badge.",
|
|
558
|
-
"fieldName": "type"
|
|
558
|
+
"privacy": "private"
|
|
559
559
|
},
|
|
560
560
|
{
|
|
561
|
-
"
|
|
561
|
+
"kind": "field",
|
|
562
|
+
"name": "focusedDayNode",
|
|
562
563
|
"type": {
|
|
563
|
-
"text": "
|
|
564
|
+
"text": "HTMLButtonElement"
|
|
564
565
|
},
|
|
565
|
-
"
|
|
566
|
-
"fieldName": "progress"
|
|
567
|
-
}
|
|
568
|
-
],
|
|
569
|
-
"superclass": {
|
|
570
|
-
"name": "LitElement",
|
|
571
|
-
"package": "lit"
|
|
572
|
-
},
|
|
573
|
-
"status": "ready",
|
|
574
|
-
"category": "text",
|
|
575
|
-
"displayName": null,
|
|
576
|
-
"examples": [],
|
|
577
|
-
"tagName": "nord-badge",
|
|
578
|
-
"customElement": true
|
|
579
|
-
}
|
|
580
|
-
],
|
|
581
|
-
"exports": [
|
|
582
|
-
{
|
|
583
|
-
"kind": "js",
|
|
584
|
-
"name": "default",
|
|
585
|
-
"declaration": {
|
|
586
|
-
"name": "Badge",
|
|
587
|
-
"module": "src/badge/Badge.ts"
|
|
588
|
-
}
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
"kind": "custom-element-definition",
|
|
592
|
-
"name": "nord-badge",
|
|
593
|
-
"declaration": {
|
|
594
|
-
"name": "Badge",
|
|
595
|
-
"module": "src/badge/Badge.ts"
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
],
|
|
599
|
-
"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"
|
|
600
|
-
},
|
|
601
|
-
{
|
|
602
|
-
"kind": "javascript-module",
|
|
603
|
-
"path": "src/button/Button.ts",
|
|
604
|
-
"declarations": [
|
|
605
|
-
{
|
|
606
|
-
"kind": "class",
|
|
607
|
-
"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.",
|
|
608
|
-
"name": "Button",
|
|
609
|
-
"cssProperties": [
|
|
610
|
-
{
|
|
611
|
-
"description": "Controls the rounded corners of the button, using [border radius tokens](/tokens/#border-radius).",
|
|
612
|
-
"name": "--n-button-border-radius",
|
|
613
|
-
"default": "var(--n-border-radius-s)"
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
"description": "Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).",
|
|
617
|
-
"name": "--n-button-gap",
|
|
618
|
-
"default": "var(--n-space-s)"
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
"description": "Controls the overlayed gradient background on the button.",
|
|
622
|
-
"name": "--n-button-gradient",
|
|
623
|
-
"default": "linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))"
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
"description": "Controls the background color of the button, using [color tokens](/tokens/#color).",
|
|
627
|
-
"name": "--n-button-background-color",
|
|
628
|
-
"default": "var(--n-color-button)"
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
"description": "Controls the border color of the button, using [color tokens](/tokens/#color).",
|
|
632
|
-
"name": "--n-button-border-color",
|
|
633
|
-
"default": "var(--n-color-border-strong)"
|
|
566
|
+
"privacy": "private"
|
|
634
567
|
},
|
|
635
568
|
{
|
|
636
|
-
"
|
|
637
|
-
"name": "
|
|
638
|
-
"
|
|
639
|
-
|
|
640
|
-
],
|
|
641
|
-
"slots": [
|
|
642
|
-
{
|
|
643
|
-
"description": "The button content",
|
|
644
|
-
"name": ""
|
|
569
|
+
"kind": "field",
|
|
570
|
+
"name": "direction",
|
|
571
|
+
"privacy": "private",
|
|
572
|
+
"default": "new DirectionController(this)"
|
|
645
573
|
},
|
|
646
574
|
{
|
|
647
|
-
"
|
|
648
|
-
"name": "
|
|
575
|
+
"kind": "field",
|
|
576
|
+
"name": "swipe",
|
|
577
|
+
"privacy": "private",
|
|
578
|
+
"default": "new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })"
|
|
649
579
|
},
|
|
650
|
-
{
|
|
651
|
-
"description": "Used to place content at the end of button text. Typically used for icons.",
|
|
652
|
-
"name": "end"
|
|
653
|
-
}
|
|
654
|
-
],
|
|
655
|
-
"members": [
|
|
656
580
|
{
|
|
657
581
|
"kind": "field",
|
|
658
|
-
"name": "
|
|
582
|
+
"name": "shortcuts",
|
|
659
583
|
"privacy": "private"
|
|
660
584
|
},
|
|
661
585
|
{
|
|
662
586
|
"kind": "field",
|
|
663
|
-
"name": "
|
|
587
|
+
"name": "localize",
|
|
664
588
|
"privacy": "private",
|
|
665
|
-
"default": "new
|
|
589
|
+
"default": "new LocalizeController<\"nord-calendar\">(this, {\n onLangChange: () => this.handleLangChange(),\n })"
|
|
666
590
|
},
|
|
667
591
|
{
|
|
668
592
|
"kind": "field",
|
|
669
|
-
"name": "
|
|
593
|
+
"name": "dateFormatShort",
|
|
594
|
+
"type": {
|
|
595
|
+
"text": "Intl.DateTimeFormat"
|
|
596
|
+
},
|
|
670
597
|
"privacy": "private",
|
|
671
|
-
"
|
|
598
|
+
"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"
|
|
672
599
|
},
|
|
673
600
|
{
|
|
674
601
|
"kind": "field",
|
|
675
|
-
"name": "
|
|
602
|
+
"name": "monthNames",
|
|
676
603
|
"type": {
|
|
677
|
-
"text": "
|
|
604
|
+
"text": "string[]"
|
|
678
605
|
},
|
|
679
|
-
"
|
|
680
|
-
"description": "The style variant of the button.",
|
|
681
|
-
"attribute": "variant",
|
|
682
|
-
"reflects": true
|
|
606
|
+
"privacy": "private"
|
|
683
607
|
},
|
|
684
608
|
{
|
|
685
609
|
"kind": "field",
|
|
686
|
-
"name": "
|
|
610
|
+
"name": "monthNamesShort",
|
|
687
611
|
"type": {
|
|
688
|
-
"text": "
|
|
612
|
+
"text": "string[]"
|
|
689
613
|
},
|
|
690
|
-
"
|
|
691
|
-
"description": "The type of the button.",
|
|
692
|
-
"attribute": "type",
|
|
693
|
-
"reflects": true
|
|
614
|
+
"privacy": "private"
|
|
694
615
|
},
|
|
695
616
|
{
|
|
696
617
|
"kind": "field",
|
|
697
|
-
"name": "
|
|
618
|
+
"name": "dayNames",
|
|
698
619
|
"type": {
|
|
699
|
-
"text": "
|
|
620
|
+
"text": "string[]"
|
|
700
621
|
},
|
|
701
|
-
"
|
|
702
|
-
"description": "The size of the button.\nThis affects font-size and padding.",
|
|
703
|
-
"attribute": "size",
|
|
704
|
-
"reflects": true
|
|
622
|
+
"privacy": "private"
|
|
705
623
|
},
|
|
706
624
|
{
|
|
707
625
|
"kind": "field",
|
|
708
|
-
"name": "
|
|
626
|
+
"name": "dayNamesShort",
|
|
709
627
|
"type": {
|
|
710
|
-
"text": "
|
|
628
|
+
"text": "string[]"
|
|
711
629
|
},
|
|
712
|
-
"privacy": "private"
|
|
713
|
-
"attribute": "aria-expanded"
|
|
630
|
+
"privacy": "private"
|
|
714
631
|
},
|
|
715
632
|
{
|
|
716
633
|
"kind": "field",
|
|
717
|
-
"name": "
|
|
634
|
+
"name": "value",
|
|
718
635
|
"type": {
|
|
719
|
-
"text": "
|
|
636
|
+
"text": "string"
|
|
720
637
|
},
|
|
721
|
-
"
|
|
722
|
-
"
|
|
638
|
+
"default": "\"\"",
|
|
639
|
+
"description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
|
|
640
|
+
"attribute": "value"
|
|
723
641
|
},
|
|
724
642
|
{
|
|
725
643
|
"kind": "field",
|
|
726
|
-
"name": "
|
|
644
|
+
"name": "firstDayOfWeek",
|
|
727
645
|
"type": {
|
|
728
|
-
"text": "
|
|
646
|
+
"text": "DaysOfWeek"
|
|
729
647
|
},
|
|
730
|
-
"description": "
|
|
731
|
-
"attribute": "
|
|
732
|
-
"reflects": true
|
|
648
|
+
"description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
|
|
649
|
+
"attribute": "firstDayOfWeek"
|
|
733
650
|
},
|
|
734
651
|
{
|
|
735
652
|
"kind": "field",
|
|
736
|
-
"name": "
|
|
653
|
+
"name": "min",
|
|
737
654
|
"type": {
|
|
738
|
-
"text": "
|
|
655
|
+
"text": "string"
|
|
739
656
|
},
|
|
740
|
-
"default": "
|
|
741
|
-
"description": "
|
|
742
|
-
"attribute": "
|
|
657
|
+
"default": "\"\"",
|
|
658
|
+
"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.",
|
|
659
|
+
"attribute": "min"
|
|
743
660
|
},
|
|
744
661
|
{
|
|
745
662
|
"kind": "field",
|
|
746
|
-
"name": "
|
|
663
|
+
"name": "max",
|
|
747
664
|
"type": {
|
|
748
|
-
"text": "
|
|
665
|
+
"text": "string"
|
|
749
666
|
},
|
|
750
|
-
"default": "\"
|
|
751
|
-
"description": "
|
|
752
|
-
"attribute": "
|
|
753
|
-
"reflects": true
|
|
667
|
+
"default": "\"\"",
|
|
668
|
+
"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.",
|
|
669
|
+
"attribute": "max"
|
|
754
670
|
},
|
|
755
671
|
{
|
|
756
672
|
"kind": "field",
|
|
@@ -759,250 +675,239 @@
|
|
|
759
675
|
"text": "boolean"
|
|
760
676
|
},
|
|
761
677
|
"default": "false",
|
|
762
|
-
"description": "Controls whether the
|
|
678
|
+
"description": "Controls whether the calendar expands to fill the width of its container.",
|
|
763
679
|
"attribute": "expand",
|
|
764
680
|
"reflects": true
|
|
765
681
|
},
|
|
766
682
|
{
|
|
767
683
|
"kind": "field",
|
|
768
|
-
"name": "
|
|
684
|
+
"name": "isDateDisabled",
|
|
769
685
|
"type": {
|
|
770
|
-
"text": "
|
|
686
|
+
"text": "DateDisabledPredicate"
|
|
771
687
|
},
|
|
772
|
-
"default": "
|
|
773
|
-
"description": "Controls
|
|
774
|
-
"attribute": "loading",
|
|
775
|
-
"reflects": true
|
|
688
|
+
"default": "isDateDisabled",
|
|
689
|
+
"description": "Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
|
|
776
690
|
},
|
|
777
691
|
{
|
|
778
|
-
"kind": "
|
|
779
|
-
"name": "
|
|
780
|
-
"
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
692
|
+
"kind": "field",
|
|
693
|
+
"name": "activeFocus",
|
|
694
|
+
"type": {
|
|
695
|
+
"text": "boolean"
|
|
696
|
+
},
|
|
697
|
+
"privacy": "private",
|
|
698
|
+
"default": "false"
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
"kind": "field",
|
|
702
|
+
"name": "focusedDay",
|
|
703
|
+
"privacy": "private",
|
|
704
|
+
"default": "new Date()"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"kind": "method",
|
|
708
|
+
"name": "focus",
|
|
709
|
+
"parameters": [
|
|
710
|
+
{
|
|
711
|
+
"name": "options",
|
|
712
|
+
"optional": true,
|
|
784
713
|
"type": {
|
|
785
|
-
"text": "
|
|
786
|
-
}
|
|
714
|
+
"text": "FocusOptions & { target: \"day\" | \"month\" }"
|
|
715
|
+
},
|
|
716
|
+
"description": "An object which controls aspects of the focusing process."
|
|
787
717
|
}
|
|
788
718
|
],
|
|
789
|
-
"description": "
|
|
719
|
+
"description": "Programmatically move focus to the calendar."
|
|
790
720
|
},
|
|
791
721
|
{
|
|
792
722
|
"kind": "method",
|
|
793
|
-
"name": "
|
|
723
|
+
"name": "handleValueChange",
|
|
724
|
+
"privacy": "protected"
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"kind": "method",
|
|
728
|
+
"name": "handleFocusedDayChange",
|
|
729
|
+
"privacy": "protected"
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"kind": "method",
|
|
733
|
+
"name": "handleLangChange",
|
|
734
|
+
"privacy": "private"
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"kind": "field",
|
|
738
|
+
"name": "handleDaySelect",
|
|
739
|
+
"privacy": "private"
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"kind": "method",
|
|
743
|
+
"name": "addDays",
|
|
794
744
|
"privacy": "private",
|
|
795
745
|
"parameters": [
|
|
796
746
|
{
|
|
797
|
-
"name": "
|
|
747
|
+
"name": "days",
|
|
798
748
|
"type": {
|
|
799
|
-
"text": "
|
|
749
|
+
"text": "number"
|
|
800
750
|
}
|
|
801
751
|
}
|
|
802
752
|
]
|
|
803
753
|
},
|
|
804
754
|
{
|
|
805
755
|
"kind": "method",
|
|
806
|
-
"name": "
|
|
756
|
+
"name": "addMonths",
|
|
757
|
+
"privacy": "private",
|
|
758
|
+
"parameters": [
|
|
759
|
+
{
|
|
760
|
+
"name": "months",
|
|
761
|
+
"type": {
|
|
762
|
+
"text": "number"
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
]
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"kind": "method",
|
|
769
|
+
"name": "addYears",
|
|
770
|
+
"privacy": "private",
|
|
771
|
+
"parameters": [
|
|
772
|
+
{
|
|
773
|
+
"name": "years",
|
|
774
|
+
"type": {
|
|
775
|
+
"text": "number"
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
]
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"kind": "method",
|
|
782
|
+
"name": "startOfWeek",
|
|
807
783
|
"privacy": "private"
|
|
808
784
|
},
|
|
809
785
|
{
|
|
810
|
-
"kind": "
|
|
811
|
-
"name": "
|
|
786
|
+
"kind": "method",
|
|
787
|
+
"name": "endOfWeek",
|
|
812
788
|
"privacy": "private"
|
|
813
789
|
},
|
|
814
790
|
{
|
|
815
791
|
"kind": "method",
|
|
816
|
-
"name": "
|
|
792
|
+
"name": "setMonth",
|
|
817
793
|
"privacy": "private",
|
|
818
794
|
"parameters": [
|
|
819
795
|
{
|
|
820
|
-
"name": "
|
|
796
|
+
"name": "month",
|
|
821
797
|
"type": {
|
|
822
|
-
"text": "
|
|
798
|
+
"text": "number"
|
|
823
799
|
}
|
|
824
800
|
}
|
|
825
801
|
]
|
|
826
802
|
},
|
|
827
803
|
{
|
|
828
804
|
"kind": "method",
|
|
829
|
-
"name": "
|
|
805
|
+
"name": "setYear",
|
|
830
806
|
"privacy": "private",
|
|
831
807
|
"parameters": [
|
|
832
808
|
{
|
|
833
|
-
"name": "
|
|
809
|
+
"name": "year",
|
|
834
810
|
"type": {
|
|
835
|
-
"text": "
|
|
811
|
+
"text": "number"
|
|
836
812
|
}
|
|
837
813
|
}
|
|
838
|
-
]
|
|
839
|
-
"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."
|
|
814
|
+
]
|
|
840
815
|
},
|
|
841
816
|
{
|
|
842
|
-
"kind": "
|
|
843
|
-
"name": "
|
|
844
|
-
"
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
854
|
-
}
|
|
817
|
+
"kind": "method",
|
|
818
|
+
"name": "setFocusedDay",
|
|
819
|
+
"privacy": "private",
|
|
820
|
+
"parameters": [
|
|
821
|
+
{
|
|
822
|
+
"name": "day",
|
|
823
|
+
"type": {
|
|
824
|
+
"text": "Date"
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
]
|
|
855
828
|
},
|
|
856
829
|
{
|
|
857
830
|
"kind": "field",
|
|
858
|
-
"name": "
|
|
859
|
-
"
|
|
860
|
-
"text": "string | undefined"
|
|
861
|
-
},
|
|
862
|
-
"description": "The name of the form component.",
|
|
863
|
-
"attribute": "name",
|
|
864
|
-
"inheritedFrom": {
|
|
865
|
-
"name": "InputMixin",
|
|
866
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
867
|
-
}
|
|
831
|
+
"name": "handleMonthSelect",
|
|
832
|
+
"privacy": "private"
|
|
868
833
|
},
|
|
869
834
|
{
|
|
870
835
|
"kind": "field",
|
|
871
|
-
"name": "
|
|
872
|
-
"
|
|
873
|
-
"text": "string"
|
|
874
|
-
},
|
|
875
|
-
"default": "\"\"",
|
|
876
|
-
"description": "The value of the form component.",
|
|
877
|
-
"attribute": "value",
|
|
878
|
-
"inheritedFrom": {
|
|
879
|
-
"name": "InputMixin",
|
|
880
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
881
|
-
}
|
|
836
|
+
"name": "handleYearSelect",
|
|
837
|
+
"privacy": "private"
|
|
882
838
|
},
|
|
883
839
|
{
|
|
884
840
|
"kind": "field",
|
|
885
|
-
"name": "
|
|
886
|
-
"
|
|
887
|
-
"inheritedFrom": {
|
|
888
|
-
"name": "InputMixin",
|
|
889
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
890
|
-
}
|
|
841
|
+
"name": "handleNextMonthClick",
|
|
842
|
+
"privacy": "private"
|
|
891
843
|
},
|
|
892
844
|
{
|
|
893
845
|
"kind": "field",
|
|
894
|
-
"name": "
|
|
895
|
-
"privacy": "
|
|
896
|
-
"inheritedFrom": {
|
|
897
|
-
"name": "FocusableMixin",
|
|
898
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
899
|
-
}
|
|
900
|
-
},
|
|
901
|
-
{
|
|
902
|
-
"kind": "method",
|
|
903
|
-
"name": "focus",
|
|
904
|
-
"parameters": [
|
|
905
|
-
{
|
|
906
|
-
"name": "options",
|
|
907
|
-
"optional": true,
|
|
908
|
-
"type": {
|
|
909
|
-
"text": "FocusOptions"
|
|
910
|
-
},
|
|
911
|
-
"description": "An object which controls aspects of the focusing process."
|
|
912
|
-
}
|
|
913
|
-
],
|
|
914
|
-
"description": "Programmatically move focus to the component.",
|
|
915
|
-
"inheritedFrom": {
|
|
916
|
-
"name": "FocusableMixin",
|
|
917
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
918
|
-
}
|
|
846
|
+
"name": "handlePreviousMonthClick",
|
|
847
|
+
"privacy": "private"
|
|
919
848
|
},
|
|
920
849
|
{
|
|
921
|
-
"kind": "
|
|
922
|
-
"name": "
|
|
923
|
-
"
|
|
924
|
-
"inheritedFrom": {
|
|
925
|
-
"name": "FocusableMixin",
|
|
926
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
927
|
-
}
|
|
850
|
+
"kind": "field",
|
|
851
|
+
"name": "enableActiveFocus",
|
|
852
|
+
"privacy": "private"
|
|
928
853
|
},
|
|
929
854
|
{
|
|
930
|
-
"kind": "
|
|
931
|
-
"name": "
|
|
932
|
-
"
|
|
933
|
-
"inheritedFrom": {
|
|
934
|
-
"name": "FocusableMixin",
|
|
935
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
936
|
-
}
|
|
855
|
+
"kind": "field",
|
|
856
|
+
"name": "disableActiveFocus",
|
|
857
|
+
"privacy": "private"
|
|
937
858
|
}
|
|
938
859
|
],
|
|
939
|
-
"
|
|
860
|
+
"events": [
|
|
940
861
|
{
|
|
941
|
-
"name": "
|
|
862
|
+
"name": "nord-focus-date",
|
|
942
863
|
"type": {
|
|
943
|
-
"text": "
|
|
864
|
+
"text": "DateSelectEvent"
|
|
944
865
|
},
|
|
945
|
-
"
|
|
946
|
-
"description": "The style variant of the button.",
|
|
947
|
-
"fieldName": "variant"
|
|
866
|
+
"description": "Dispatched when the calendar's focused date changes."
|
|
948
867
|
},
|
|
949
868
|
{
|
|
950
|
-
"name": "type",
|
|
951
869
|
"type": {
|
|
952
|
-
"text": "
|
|
870
|
+
"text": "DateSelectEvent"
|
|
953
871
|
},
|
|
954
|
-
"
|
|
955
|
-
"
|
|
956
|
-
|
|
957
|
-
|
|
872
|
+
"description": "Dispatched when a date is selected and the value changes.",
|
|
873
|
+
"name": "change"
|
|
874
|
+
}
|
|
875
|
+
],
|
|
876
|
+
"attributes": [
|
|
958
877
|
{
|
|
959
|
-
"name": "
|
|
878
|
+
"name": "value",
|
|
960
879
|
"type": {
|
|
961
|
-
"text": "
|
|
880
|
+
"text": "string"
|
|
962
881
|
},
|
|
963
|
-
"default": "\"
|
|
964
|
-
"description": "The
|
|
965
|
-
"fieldName": "
|
|
882
|
+
"default": "\"\"",
|
|
883
|
+
"description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
|
|
884
|
+
"fieldName": "value"
|
|
966
885
|
},
|
|
967
886
|
{
|
|
968
|
-
"name": "
|
|
887
|
+
"name": "firstDayOfWeek",
|
|
969
888
|
"type": {
|
|
970
|
-
"text": "
|
|
889
|
+
"text": "DaysOfWeek"
|
|
971
890
|
},
|
|
972
|
-
"
|
|
891
|
+
"description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
|
|
892
|
+
"fieldName": "firstDayOfWeek"
|
|
973
893
|
},
|
|
974
894
|
{
|
|
975
|
-
"name": "
|
|
895
|
+
"name": "min",
|
|
976
896
|
"type": {
|
|
977
|
-
"text": "
|
|
897
|
+
"text": "string"
|
|
978
898
|
},
|
|
979
|
-
"
|
|
899
|
+
"default": "\"\"",
|
|
900
|
+
"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.",
|
|
901
|
+
"fieldName": "min"
|
|
980
902
|
},
|
|
981
903
|
{
|
|
982
|
-
"name": "
|
|
904
|
+
"name": "max",
|
|
983
905
|
"type": {
|
|
984
|
-
"text": "string
|
|
906
|
+
"text": "string"
|
|
985
907
|
},
|
|
986
|
-
"
|
|
987
|
-
"
|
|
988
|
-
|
|
989
|
-
{
|
|
990
|
-
"name": "download",
|
|
991
|
-
"type": {
|
|
992
|
-
"text": "boolean"
|
|
993
|
-
},
|
|
994
|
-
"default": "false",
|
|
995
|
-
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
996
|
-
"fieldName": "download"
|
|
997
|
-
},
|
|
998
|
-
{
|
|
999
|
-
"name": "target",
|
|
1000
|
-
"type": {
|
|
1001
|
-
"text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
|
|
1002
|
-
},
|
|
1003
|
-
"default": "\"_self\"",
|
|
1004
|
-
"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.",
|
|
1005
|
-
"fieldName": "target"
|
|
908
|
+
"default": "\"\"",
|
|
909
|
+
"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.",
|
|
910
|
+
"fieldName": "max"
|
|
1006
911
|
},
|
|
1007
912
|
{
|
|
1008
913
|
"name": "expand",
|
|
@@ -1010,65 +915,8 @@
|
|
|
1010
915
|
"text": "boolean"
|
|
1011
916
|
},
|
|
1012
917
|
"default": "false",
|
|
1013
|
-
"description": "Controls whether the
|
|
918
|
+
"description": "Controls whether the calendar expands to fill the width of its container.",
|
|
1014
919
|
"fieldName": "expand"
|
|
1015
|
-
},
|
|
1016
|
-
{
|
|
1017
|
-
"name": "loading",
|
|
1018
|
-
"type": {
|
|
1019
|
-
"text": "boolean"
|
|
1020
|
-
},
|
|
1021
|
-
"default": "false",
|
|
1022
|
-
"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.",
|
|
1023
|
-
"fieldName": "loading"
|
|
1024
|
-
},
|
|
1025
|
-
{
|
|
1026
|
-
"name": "disabled",
|
|
1027
|
-
"type": {
|
|
1028
|
-
"text": "boolean"
|
|
1029
|
-
},
|
|
1030
|
-
"default": "false",
|
|
1031
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1032
|
-
"fieldName": "disabled",
|
|
1033
|
-
"inheritedFrom": {
|
|
1034
|
-
"name": "InputMixin",
|
|
1035
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1036
|
-
}
|
|
1037
|
-
},
|
|
1038
|
-
{
|
|
1039
|
-
"name": "name",
|
|
1040
|
-
"type": {
|
|
1041
|
-
"text": "string | undefined"
|
|
1042
|
-
},
|
|
1043
|
-
"description": "The name of the form component.",
|
|
1044
|
-
"fieldName": "name",
|
|
1045
|
-
"inheritedFrom": {
|
|
1046
|
-
"name": "InputMixin",
|
|
1047
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1048
|
-
}
|
|
1049
|
-
},
|
|
1050
|
-
{
|
|
1051
|
-
"name": "value",
|
|
1052
|
-
"type": {
|
|
1053
|
-
"text": "string"
|
|
1054
|
-
},
|
|
1055
|
-
"default": "\"\"",
|
|
1056
|
-
"description": "The value of the form component.",
|
|
1057
|
-
"fieldName": "value",
|
|
1058
|
-
"inheritedFrom": {
|
|
1059
|
-
"name": "InputMixin",
|
|
1060
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
],
|
|
1064
|
-
"mixins": [
|
|
1065
|
-
{
|
|
1066
|
-
"name": "InputMixin",
|
|
1067
|
-
"module": "/src/common/mixins/InputMixin.js"
|
|
1068
|
-
},
|
|
1069
|
-
{
|
|
1070
|
-
"name": "FocusableMixin",
|
|
1071
|
-
"module": "/src/common/mixins/FocusableMixin.js"
|
|
1072
920
|
}
|
|
1073
921
|
],
|
|
1074
922
|
"superclass": {
|
|
@@ -1076,10 +924,10 @@
|
|
|
1076
924
|
"package": "lit"
|
|
1077
925
|
},
|
|
1078
926
|
"status": "ready",
|
|
1079
|
-
"category": "
|
|
927
|
+
"category": "list",
|
|
1080
928
|
"displayName": null,
|
|
1081
929
|
"examples": [],
|
|
1082
|
-
"tagName": "nord-
|
|
930
|
+
"tagName": "nord-calendar",
|
|
1083
931
|
"customElement": true
|
|
1084
932
|
}
|
|
1085
933
|
],
|
|
@@ -1088,373 +936,275 @@
|
|
|
1088
936
|
"kind": "js",
|
|
1089
937
|
"name": "default",
|
|
1090
938
|
"declaration": {
|
|
1091
|
-
"name": "
|
|
1092
|
-
"module": "src/
|
|
939
|
+
"name": "Calendar",
|
|
940
|
+
"module": "src/calendar/Calendar.ts"
|
|
1093
941
|
}
|
|
1094
942
|
},
|
|
1095
943
|
{
|
|
1096
944
|
"kind": "custom-element-definition",
|
|
1097
|
-
"name": "nord-
|
|
945
|
+
"name": "nord-calendar",
|
|
1098
946
|
"declaration": {
|
|
1099
|
-
"name": "
|
|
1100
|
-
"module": "src/
|
|
947
|
+
"name": "Calendar",
|
|
948
|
+
"module": "src/calendar/Calendar.ts"
|
|
1101
949
|
}
|
|
1102
950
|
}
|
|
1103
951
|
],
|
|
1104
|
-
"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-
|
|
952
|
+
"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"
|
|
1105
953
|
},
|
|
1106
954
|
{
|
|
1107
955
|
"kind": "javascript-module",
|
|
1108
|
-
"path": "src/
|
|
956
|
+
"path": "src/calendar/DateSelectEvent.ts",
|
|
1109
957
|
"declarations": [
|
|
1110
958
|
{
|
|
1111
959
|
"kind": "class",
|
|
1112
|
-
"description": "
|
|
1113
|
-
"name": "
|
|
1114
|
-
"cssProperties": [
|
|
1115
|
-
{
|
|
1116
|
-
"description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
|
|
1117
|
-
"name": "--n-card-border-radius",
|
|
1118
|
-
"default": "var(--n-border-radius)"
|
|
1119
|
-
},
|
|
1120
|
-
{
|
|
1121
|
-
"description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
|
|
1122
|
-
"name": "--n-card-box-shadow",
|
|
1123
|
-
"default": "var(--n-box-shadow-popout)"
|
|
1124
|
-
},
|
|
1125
|
-
{
|
|
1126
|
-
"description": "Controls the padding on all sides of the card.",
|
|
1127
|
-
"name": "--n-card-padding",
|
|
1128
|
-
"default": "var(--n-space-m)"
|
|
1129
|
-
},
|
|
1130
|
-
{
|
|
1131
|
-
"description": "Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.",
|
|
1132
|
-
"name": "--n-card-slot-padding",
|
|
1133
|
-
"default": "var(--n-space-m)"
|
|
1134
|
-
}
|
|
1135
|
-
],
|
|
1136
|
-
"slots": [
|
|
1137
|
-
{
|
|
1138
|
-
"description": "The card content.",
|
|
1139
|
-
"name": ""
|
|
1140
|
-
},
|
|
1141
|
-
{
|
|
1142
|
-
"description": "Optional slot that holds a header for the card.",
|
|
1143
|
-
"name": "header"
|
|
1144
|
-
},
|
|
1145
|
-
{
|
|
1146
|
-
"description": "Optional slot that positions content at the end of the header. Useful for actions or additional info.",
|
|
1147
|
-
"name": "header-end"
|
|
1148
|
-
},
|
|
1149
|
-
{
|
|
1150
|
-
"description": "Optional slot that holds footer content for the card.",
|
|
1151
|
-
"name": "footer"
|
|
1152
|
-
}
|
|
1153
|
-
],
|
|
1154
|
-
"members": [
|
|
1155
|
-
{
|
|
1156
|
-
"kind": "field",
|
|
1157
|
-
"name": "headerSlot",
|
|
1158
|
-
"privacy": "private",
|
|
1159
|
-
"default": "new SlotController(this, \"header\")"
|
|
1160
|
-
},
|
|
1161
|
-
{
|
|
1162
|
-
"kind": "field",
|
|
1163
|
-
"name": "headerEndSlot",
|
|
1164
|
-
"privacy": "private",
|
|
1165
|
-
"default": "new SlotController(this, \"header-end\")"
|
|
1166
|
-
},
|
|
1167
|
-
{
|
|
1168
|
-
"kind": "field",
|
|
1169
|
-
"name": "footerSlot",
|
|
1170
|
-
"privacy": "private",
|
|
1171
|
-
"default": "new SlotController(this, \"footer\")"
|
|
1172
|
-
},
|
|
1173
|
-
{
|
|
1174
|
-
"kind": "field",
|
|
1175
|
-
"name": "padding",
|
|
1176
|
-
"type": {
|
|
1177
|
-
"text": "\"m\" | \"l\" | \"none\""
|
|
1178
|
-
},
|
|
1179
|
-
"default": "\"m\"",
|
|
1180
|
-
"description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1181
|
-
"attribute": "padding",
|
|
1182
|
-
"reflects": true
|
|
1183
|
-
}
|
|
1184
|
-
],
|
|
1185
|
-
"attributes": [
|
|
1186
|
-
{
|
|
1187
|
-
"name": "padding",
|
|
1188
|
-
"type": {
|
|
1189
|
-
"text": "\"m\" | \"l\" | \"none\""
|
|
1190
|
-
},
|
|
1191
|
-
"default": "\"m\"",
|
|
1192
|
-
"description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1193
|
-
"fieldName": "padding"
|
|
1194
|
-
}
|
|
1195
|
-
],
|
|
960
|
+
"description": "",
|
|
961
|
+
"name": "DateSelectEvent",
|
|
1196
962
|
"superclass": {
|
|
1197
|
-
"name": "
|
|
1198
|
-
"
|
|
963
|
+
"name": "NordEvent",
|
|
964
|
+
"module": "/src/common/events.js"
|
|
1199
965
|
},
|
|
1200
|
-
"
|
|
1201
|
-
"category": "structure",
|
|
1202
|
-
"displayName": null,
|
|
1203
|
-
"examples": [],
|
|
1204
|
-
"tagName": "nord-card",
|
|
1205
|
-
"customElement": true
|
|
966
|
+
"examples": []
|
|
1206
967
|
}
|
|
1207
968
|
],
|
|
1208
969
|
"exports": [
|
|
1209
970
|
{
|
|
1210
971
|
"kind": "js",
|
|
1211
|
-
"name": "
|
|
972
|
+
"name": "DateSelectEvent",
|
|
1212
973
|
"declaration": {
|
|
1213
|
-
"name": "
|
|
1214
|
-
"module": "src/
|
|
974
|
+
"name": "DateSelectEvent",
|
|
975
|
+
"module": "src/calendar/DateSelectEvent.ts"
|
|
1215
976
|
}
|
|
1216
|
-
}
|
|
977
|
+
}
|
|
978
|
+
],
|
|
979
|
+
"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"
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
"kind": "javascript-module",
|
|
983
|
+
"path": "src/calendar/localization.ts",
|
|
984
|
+
"declarations": [
|
|
1217
985
|
{
|
|
1218
|
-
"kind": "
|
|
1219
|
-
"name": "
|
|
986
|
+
"kind": "variable",
|
|
987
|
+
"name": "calendarLocalization",
|
|
988
|
+
"type": {
|
|
989
|
+
"text": "object"
|
|
990
|
+
},
|
|
991
|
+
"default": "{\n prevMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n}"
|
|
992
|
+
}
|
|
993
|
+
],
|
|
994
|
+
"exports": [
|
|
995
|
+
{
|
|
996
|
+
"kind": "js",
|
|
997
|
+
"name": "default",
|
|
1220
998
|
"declaration": {
|
|
1221
|
-
"name": "
|
|
1222
|
-
"module": "src/
|
|
999
|
+
"name": "calendarLocalization",
|
|
1000
|
+
"module": "src/calendar/localization.ts"
|
|
1223
1001
|
}
|
|
1224
1002
|
}
|
|
1225
1003
|
],
|
|
1226
|
-
"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
|
|
1004
|
+
"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"
|
|
1227
1005
|
},
|
|
1228
1006
|
{
|
|
1229
1007
|
"kind": "javascript-module",
|
|
1230
|
-
"path": "src/
|
|
1008
|
+
"path": "src/calendar/month-view.ts",
|
|
1231
1009
|
"declarations": [
|
|
1232
1010
|
{
|
|
1233
|
-
"kind": "
|
|
1234
|
-
"
|
|
1235
|
-
"
|
|
1236
|
-
"cssProperties": [
|
|
1237
|
-
{
|
|
1238
|
-
"description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
|
|
1239
|
-
"name": "--n-banner-border-radius",
|
|
1240
|
-
"default": "var(--n-border-radius)"
|
|
1241
|
-
},
|
|
1242
|
-
{
|
|
1243
|
-
"description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
|
|
1244
|
-
"name": "--n-banner-box-shadow",
|
|
1245
|
-
"default": "var(--n-box-shadow-card)"
|
|
1246
|
-
}
|
|
1247
|
-
],
|
|
1248
|
-
"slots": [
|
|
1249
|
-
{
|
|
1250
|
-
"description": "default slot",
|
|
1251
|
-
"name": ""
|
|
1252
|
-
}
|
|
1253
|
-
],
|
|
1254
|
-
"members": [
|
|
1011
|
+
"kind": "function",
|
|
1012
|
+
"name": "dayView",
|
|
1013
|
+
"parameters": [
|
|
1255
1014
|
{
|
|
1256
|
-
"
|
|
1257
|
-
"name": "variant",
|
|
1015
|
+
"name": "{\n focusedDay,\n today,\n day,\n onDaySelect,\n onKeyboardNavigation,\n disabled,\n inRange,\n isSelected,\n dateFormatter,\n}",
|
|
1258
1016
|
"type": {
|
|
1259
|
-
"text": "
|
|
1260
|
-
}
|
|
1261
|
-
"default": "\"info\"",
|
|
1262
|
-
"description": "The style variant of the banner.",
|
|
1263
|
-
"attribute": "variant",
|
|
1264
|
-
"reflects": true
|
|
1017
|
+
"text": "DatePickerDayProps"
|
|
1018
|
+
}
|
|
1265
1019
|
}
|
|
1266
|
-
]
|
|
1267
|
-
|
|
1020
|
+
]
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
"kind": "function",
|
|
1024
|
+
"name": "monthView",
|
|
1025
|
+
"parameters": [
|
|
1268
1026
|
{
|
|
1269
|
-
"name": "
|
|
1027
|
+
"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}",
|
|
1270
1028
|
"type": {
|
|
1271
|
-
"text": "
|
|
1272
|
-
}
|
|
1273
|
-
"default": "\"info\"",
|
|
1274
|
-
"description": "The style variant of the banner.",
|
|
1275
|
-
"fieldName": "variant"
|
|
1029
|
+
"text": "MonthViewArgs"
|
|
1030
|
+
}
|
|
1276
1031
|
}
|
|
1277
|
-
]
|
|
1278
|
-
"superclass": {
|
|
1279
|
-
"name": "LitElement",
|
|
1280
|
-
"package": "lit"
|
|
1281
|
-
},
|
|
1282
|
-
"status": "ready",
|
|
1283
|
-
"category": "feedback",
|
|
1284
|
-
"displayName": null,
|
|
1285
|
-
"examples": [],
|
|
1286
|
-
"tagName": "nord-banner",
|
|
1287
|
-
"customElement": true
|
|
1032
|
+
]
|
|
1288
1033
|
}
|
|
1289
1034
|
],
|
|
1290
1035
|
"exports": [
|
|
1291
1036
|
{
|
|
1292
1037
|
"kind": "js",
|
|
1293
|
-
"name": "
|
|
1038
|
+
"name": "dayView",
|
|
1294
1039
|
"declaration": {
|
|
1295
|
-
"name": "
|
|
1296
|
-
"module": "src/
|
|
1040
|
+
"name": "dayView",
|
|
1041
|
+
"module": "src/calendar/month-view.ts"
|
|
1297
1042
|
}
|
|
1298
1043
|
},
|
|
1299
1044
|
{
|
|
1300
|
-
"kind": "
|
|
1301
|
-
"name": "
|
|
1045
|
+
"kind": "js",
|
|
1046
|
+
"name": "monthView",
|
|
1302
1047
|
"declaration": {
|
|
1303
|
-
"name": "
|
|
1304
|
-
"module": "src/
|
|
1048
|
+
"name": "monthView",
|
|
1049
|
+
"module": "src/calendar/month-view.ts"
|
|
1305
1050
|
}
|
|
1306
1051
|
}
|
|
1307
1052
|
],
|
|
1308
|
-
"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
|
|
1053
|
+
"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"
|
|
1309
1054
|
},
|
|
1310
1055
|
{
|
|
1311
1056
|
"kind": "javascript-module",
|
|
1312
|
-
"path": "src/
|
|
1057
|
+
"path": "src/button/Button.ts",
|
|
1313
1058
|
"declarations": [
|
|
1314
1059
|
{
|
|
1315
1060
|
"kind": "class",
|
|
1316
|
-
"description": "
|
|
1317
|
-
"name": "
|
|
1061
|
+
"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.",
|
|
1062
|
+
"name": "Button",
|
|
1318
1063
|
"cssProperties": [
|
|
1319
1064
|
{
|
|
1320
|
-
"description": "Controls
|
|
1321
|
-
"name": "--n-
|
|
1322
|
-
"default": "var(--n-border-radius)"
|
|
1065
|
+
"description": "Controls the rounded corners of the button, using [border radius tokens](/tokens/#border-radius).",
|
|
1066
|
+
"name": "--n-button-border-radius",
|
|
1067
|
+
"default": "var(--n-border-radius-s)"
|
|
1323
1068
|
},
|
|
1324
1069
|
{
|
|
1325
|
-
"description": "Controls the
|
|
1326
|
-
"name": "--n-
|
|
1327
|
-
"default": "var(--n-
|
|
1328
|
-
}
|
|
1329
|
-
],
|
|
1330
|
-
"members": [
|
|
1070
|
+
"description": "Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).",
|
|
1071
|
+
"name": "--n-button-gap",
|
|
1072
|
+
"default": "var(--n-space-s)"
|
|
1073
|
+
},
|
|
1331
1074
|
{
|
|
1332
|
-
"
|
|
1333
|
-
"name": "
|
|
1334
|
-
"
|
|
1335
|
-
"text": "string"
|
|
1336
|
-
},
|
|
1337
|
-
"privacy": "private",
|
|
1338
|
-
"default": "\"dialog-header\""
|
|
1075
|
+
"description": "Controls the overlayed gradient background on the button.",
|
|
1076
|
+
"name": "--n-button-gradient",
|
|
1077
|
+
"default": "linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))"
|
|
1339
1078
|
},
|
|
1340
1079
|
{
|
|
1341
|
-
"
|
|
1342
|
-
"name": "
|
|
1343
|
-
"
|
|
1344
|
-
"text": "HTMLElement"
|
|
1345
|
-
},
|
|
1346
|
-
"privacy": "private"
|
|
1080
|
+
"description": "Controls the background color of the button, using [color tokens](/tokens/#color).",
|
|
1081
|
+
"name": "--n-button-background-color",
|
|
1082
|
+
"default": "var(--n-color-button)"
|
|
1347
1083
|
},
|
|
1348
1084
|
{
|
|
1349
|
-
"
|
|
1350
|
-
"name": "
|
|
1351
|
-
"
|
|
1352
|
-
"text": "HTMLButtonElement"
|
|
1353
|
-
},
|
|
1354
|
-
"privacy": "private"
|
|
1085
|
+
"description": "Controls the border color of the button, using [color tokens](/tokens/#color).",
|
|
1086
|
+
"name": "--n-button-border-color",
|
|
1087
|
+
"default": "var(--n-color-border-strong)"
|
|
1355
1088
|
},
|
|
1356
1089
|
{
|
|
1357
|
-
"
|
|
1358
|
-
"name": "
|
|
1359
|
-
"
|
|
1360
|
-
|
|
1090
|
+
"description": "Controls the text alignment for the text in the button.",
|
|
1091
|
+
"name": "--n-button-text-align",
|
|
1092
|
+
"default": "center"
|
|
1093
|
+
}
|
|
1094
|
+
],
|
|
1095
|
+
"slots": [
|
|
1096
|
+
{
|
|
1097
|
+
"description": "The button content",
|
|
1098
|
+
"name": ""
|
|
1361
1099
|
},
|
|
1362
1100
|
{
|
|
1363
|
-
"
|
|
1364
|
-
"name": "
|
|
1365
|
-
"privacy": "private",
|
|
1366
|
-
"default": "new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })"
|
|
1101
|
+
"description": "Used to place content at the start of button text. Typically used for icons.",
|
|
1102
|
+
"name": "start"
|
|
1367
1103
|
},
|
|
1104
|
+
{
|
|
1105
|
+
"description": "Used to place content at the end of button text. Typically used for icons.",
|
|
1106
|
+
"name": "end"
|
|
1107
|
+
}
|
|
1108
|
+
],
|
|
1109
|
+
"members": [
|
|
1368
1110
|
{
|
|
1369
1111
|
"kind": "field",
|
|
1370
|
-
"name": "
|
|
1112
|
+
"name": "buttonRef",
|
|
1371
1113
|
"privacy": "private"
|
|
1372
1114
|
},
|
|
1373
1115
|
{
|
|
1374
1116
|
"kind": "field",
|
|
1375
|
-
"name": "
|
|
1117
|
+
"name": "events",
|
|
1376
1118
|
"privacy": "private",
|
|
1377
|
-
"default": "new
|
|
1119
|
+
"default": "new EventController(this)"
|
|
1378
1120
|
},
|
|
1379
1121
|
{
|
|
1380
1122
|
"kind": "field",
|
|
1381
|
-
"name": "
|
|
1382
|
-
"type": {
|
|
1383
|
-
"text": "Intl.DateTimeFormat"
|
|
1384
|
-
},
|
|
1123
|
+
"name": "lightDom",
|
|
1385
1124
|
"privacy": "private",
|
|
1386
|
-
"
|
|
1125
|
+
"default": "new LightDomController(this, {\n render: () => this.renderLightDom(),\n })"
|
|
1387
1126
|
},
|
|
1388
1127
|
{
|
|
1389
1128
|
"kind": "field",
|
|
1390
|
-
"name": "
|
|
1129
|
+
"name": "variant",
|
|
1391
1130
|
"type": {
|
|
1392
|
-
"text": "
|
|
1131
|
+
"text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
|
|
1393
1132
|
},
|
|
1394
|
-
"
|
|
1133
|
+
"default": "\"default\"",
|
|
1134
|
+
"description": "The style variant of the button.",
|
|
1135
|
+
"attribute": "variant",
|
|
1136
|
+
"reflects": true
|
|
1395
1137
|
},
|
|
1396
1138
|
{
|
|
1397
1139
|
"kind": "field",
|
|
1398
|
-
"name": "
|
|
1140
|
+
"name": "type",
|
|
1399
1141
|
"type": {
|
|
1400
|
-
"text": "
|
|
1142
|
+
"text": "\"button\" | \"submit\" | \"reset\""
|
|
1401
1143
|
},
|
|
1402
|
-
"
|
|
1144
|
+
"default": "\"submit\"",
|
|
1145
|
+
"description": "The type of the button.",
|
|
1146
|
+
"attribute": "type",
|
|
1147
|
+
"reflects": true
|
|
1403
1148
|
},
|
|
1404
1149
|
{
|
|
1405
1150
|
"kind": "field",
|
|
1406
|
-
"name": "
|
|
1151
|
+
"name": "size",
|
|
1407
1152
|
"type": {
|
|
1408
|
-
"text": "
|
|
1153
|
+
"text": "\"s\" | \"m\" | \"l\""
|
|
1409
1154
|
},
|
|
1410
|
-
"
|
|
1155
|
+
"default": "\"m\"",
|
|
1156
|
+
"description": "The size of the button.\nThis affects font-size and padding.",
|
|
1157
|
+
"attribute": "size",
|
|
1158
|
+
"reflects": true
|
|
1411
1159
|
},
|
|
1412
1160
|
{
|
|
1413
1161
|
"kind": "field",
|
|
1414
|
-
"name": "
|
|
1162
|
+
"name": "accessibleExpanded",
|
|
1415
1163
|
"type": {
|
|
1416
|
-
"text": "
|
|
1164
|
+
"text": "\"true\" | \"false\" | undefined"
|
|
1417
1165
|
},
|
|
1418
|
-
"privacy": "private"
|
|
1166
|
+
"privacy": "private",
|
|
1167
|
+
"attribute": "aria-expanded"
|
|
1419
1168
|
},
|
|
1420
1169
|
{
|
|
1421
1170
|
"kind": "field",
|
|
1422
|
-
"name": "
|
|
1171
|
+
"name": "accessibleHasPopup",
|
|
1423
1172
|
"type": {
|
|
1424
|
-
"text": "
|
|
1173
|
+
"text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
|
|
1425
1174
|
},
|
|
1426
|
-
"
|
|
1427
|
-
"
|
|
1428
|
-
"attribute": "value"
|
|
1175
|
+
"privacy": "private",
|
|
1176
|
+
"attribute": "aria-haspopup"
|
|
1429
1177
|
},
|
|
1430
1178
|
{
|
|
1431
1179
|
"kind": "field",
|
|
1432
|
-
"name": "
|
|
1180
|
+
"name": "href",
|
|
1433
1181
|
"type": {
|
|
1434
|
-
"text": "
|
|
1182
|
+
"text": "string | undefined"
|
|
1435
1183
|
},
|
|
1436
|
-
"description": "
|
|
1437
|
-
"attribute": "
|
|
1184
|
+
"description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
|
|
1185
|
+
"attribute": "href",
|
|
1186
|
+
"reflects": true
|
|
1438
1187
|
},
|
|
1439
1188
|
{
|
|
1440
1189
|
"kind": "field",
|
|
1441
|
-
"name": "
|
|
1190
|
+
"name": "download",
|
|
1442
1191
|
"type": {
|
|
1443
|
-
"text": "
|
|
1192
|
+
"text": "boolean"
|
|
1444
1193
|
},
|
|
1445
|
-
"default": "
|
|
1446
|
-
"description": "
|
|
1447
|
-
"attribute": "
|
|
1194
|
+
"default": "false",
|
|
1195
|
+
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
1196
|
+
"attribute": "download"
|
|
1448
1197
|
},
|
|
1449
1198
|
{
|
|
1450
1199
|
"kind": "field",
|
|
1451
|
-
"name": "
|
|
1200
|
+
"name": "target",
|
|
1452
1201
|
"type": {
|
|
1453
|
-
"text": "
|
|
1202
|
+
"text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
|
|
1454
1203
|
},
|
|
1455
|
-
"default": "\"\"",
|
|
1456
|
-
"description": "
|
|
1457
|
-
"attribute": "
|
|
1204
|
+
"default": "\"_self\"",
|
|
1205
|
+
"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.",
|
|
1206
|
+
"attribute": "target",
|
|
1207
|
+
"reflects": true
|
|
1458
1208
|
},
|
|
1459
1209
|
{
|
|
1460
1210
|
"kind": "field",
|
|
@@ -1463,248 +1213,316 @@
|
|
|
1463
1213
|
"text": "boolean"
|
|
1464
1214
|
},
|
|
1465
1215
|
"default": "false",
|
|
1466
|
-
"description": "Controls whether the
|
|
1216
|
+
"description": "Controls whether the button expands to fill the width of its container.",
|
|
1467
1217
|
"attribute": "expand",
|
|
1468
|
-
"reflects": true
|
|
1469
|
-
},
|
|
1470
|
-
{
|
|
1471
|
-
"kind": "field",
|
|
1472
|
-
"name": "isDateDisabled",
|
|
1473
|
-
"type": {
|
|
1474
|
-
"text": "DateDisabledPredicate"
|
|
1475
|
-
},
|
|
1476
|
-
"default": "isDateDisabled",
|
|
1477
|
-
"description": "Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
|
|
1478
|
-
},
|
|
1479
|
-
{
|
|
1480
|
-
"kind": "field",
|
|
1481
|
-
"name": "activeFocus",
|
|
1482
|
-
"type": {
|
|
1483
|
-
"text": "boolean"
|
|
1484
|
-
},
|
|
1485
|
-
"privacy": "private",
|
|
1486
|
-
"default": "false"
|
|
1487
|
-
},
|
|
1488
|
-
{
|
|
1489
|
-
"kind": "field",
|
|
1490
|
-
"name": "focusedDay",
|
|
1491
|
-
"privacy": "private",
|
|
1492
|
-
"default": "new Date()"
|
|
1493
|
-
},
|
|
1494
|
-
{
|
|
1495
|
-
"kind": "method",
|
|
1496
|
-
"name": "focus",
|
|
1497
|
-
"parameters": [
|
|
1498
|
-
{
|
|
1499
|
-
"name": "options",
|
|
1500
|
-
"optional": true,
|
|
1501
|
-
"type": {
|
|
1502
|
-
"text": "FocusOptions & { target: \"day\" | \"month\" }"
|
|
1503
|
-
},
|
|
1504
|
-
"description": "An object which controls aspects of the focusing process."
|
|
1505
|
-
}
|
|
1506
|
-
],
|
|
1507
|
-
"description": "Programmatically move focus to the calendar."
|
|
1508
|
-
},
|
|
1509
|
-
{
|
|
1510
|
-
"kind": "method",
|
|
1511
|
-
"name": "handleValueChange",
|
|
1512
|
-
"privacy": "protected"
|
|
1513
|
-
},
|
|
1514
|
-
{
|
|
1515
|
-
"kind": "method",
|
|
1516
|
-
"name": "handleFocusedDayChange",
|
|
1517
|
-
"privacy": "protected"
|
|
1518
|
-
},
|
|
1519
|
-
{
|
|
1520
|
-
"kind": "method",
|
|
1521
|
-
"name": "handleLangChange",
|
|
1522
|
-
"privacy": "private"
|
|
1218
|
+
"reflects": true
|
|
1523
1219
|
},
|
|
1524
1220
|
{
|
|
1525
1221
|
"kind": "field",
|
|
1526
|
-
"name": "
|
|
1527
|
-
"
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
"
|
|
1531
|
-
"
|
|
1532
|
-
"
|
|
1533
|
-
"
|
|
1534
|
-
{
|
|
1535
|
-
"name": "days",
|
|
1536
|
-
"type": {
|
|
1537
|
-
"text": "number"
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
]
|
|
1222
|
+
"name": "loading",
|
|
1223
|
+
"type": {
|
|
1224
|
+
"text": "boolean"
|
|
1225
|
+
},
|
|
1226
|
+
"default": "false",
|
|
1227
|
+
"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.",
|
|
1228
|
+
"attribute": "loading",
|
|
1229
|
+
"reflects": true
|
|
1541
1230
|
},
|
|
1542
1231
|
{
|
|
1543
1232
|
"kind": "method",
|
|
1544
|
-
"name": "
|
|
1233
|
+
"name": "renderLink",
|
|
1545
1234
|
"privacy": "private",
|
|
1546
1235
|
"parameters": [
|
|
1547
1236
|
{
|
|
1548
|
-
"name": "
|
|
1237
|
+
"name": "innards",
|
|
1549
1238
|
"type": {
|
|
1550
|
-
"text": "
|
|
1239
|
+
"text": "TemplateResult"
|
|
1551
1240
|
}
|
|
1552
1241
|
}
|
|
1553
|
-
]
|
|
1242
|
+
],
|
|
1243
|
+
"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."
|
|
1554
1244
|
},
|
|
1555
1245
|
{
|
|
1556
1246
|
"kind": "method",
|
|
1557
|
-
"name": "
|
|
1247
|
+
"name": "renderButton",
|
|
1558
1248
|
"privacy": "private",
|
|
1559
1249
|
"parameters": [
|
|
1560
1250
|
{
|
|
1561
|
-
"name": "
|
|
1251
|
+
"name": "innards",
|
|
1562
1252
|
"type": {
|
|
1563
|
-
"text": "
|
|
1253
|
+
"text": "TemplateResult"
|
|
1564
1254
|
}
|
|
1565
1255
|
}
|
|
1566
1256
|
]
|
|
1567
1257
|
},
|
|
1568
1258
|
{
|
|
1569
1259
|
"kind": "method",
|
|
1570
|
-
"name": "
|
|
1260
|
+
"name": "renderLightDom",
|
|
1571
1261
|
"privacy": "private"
|
|
1572
1262
|
},
|
|
1573
1263
|
{
|
|
1574
|
-
"kind": "
|
|
1575
|
-
"name": "
|
|
1264
|
+
"kind": "field",
|
|
1265
|
+
"name": "handleOuterClick",
|
|
1576
1266
|
"privacy": "private"
|
|
1577
1267
|
},
|
|
1578
1268
|
{
|
|
1579
1269
|
"kind": "method",
|
|
1580
|
-
"name": "
|
|
1270
|
+
"name": "handleClick",
|
|
1581
1271
|
"privacy": "private",
|
|
1582
1272
|
"parameters": [
|
|
1583
1273
|
{
|
|
1584
|
-
"name": "
|
|
1274
|
+
"name": "e",
|
|
1585
1275
|
"type": {
|
|
1586
|
-
"text": "
|
|
1276
|
+
"text": "Event"
|
|
1587
1277
|
}
|
|
1588
1278
|
}
|
|
1589
1279
|
]
|
|
1590
1280
|
},
|
|
1591
1281
|
{
|
|
1592
1282
|
"kind": "method",
|
|
1593
|
-
"name": "
|
|
1283
|
+
"name": "handleProxyChange",
|
|
1594
1284
|
"privacy": "private",
|
|
1595
1285
|
"parameters": [
|
|
1596
1286
|
{
|
|
1597
|
-
"name": "
|
|
1287
|
+
"name": "e",
|
|
1598
1288
|
"type": {
|
|
1599
|
-
"text": "
|
|
1289
|
+
"text": "Event"
|
|
1600
1290
|
}
|
|
1601
1291
|
}
|
|
1602
|
-
]
|
|
1292
|
+
],
|
|
1293
|
+
"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."
|
|
1603
1294
|
},
|
|
1604
1295
|
{
|
|
1605
|
-
"kind": "
|
|
1606
|
-
"name": "
|
|
1607
|
-
"
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1296
|
+
"kind": "field",
|
|
1297
|
+
"name": "disabled",
|
|
1298
|
+
"type": {
|
|
1299
|
+
"text": "boolean"
|
|
1300
|
+
},
|
|
1301
|
+
"default": "false",
|
|
1302
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1303
|
+
"attribute": "disabled",
|
|
1304
|
+
"reflects": true,
|
|
1305
|
+
"inheritedFrom": {
|
|
1306
|
+
"name": "InputMixin",
|
|
1307
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1308
|
+
}
|
|
1616
1309
|
},
|
|
1617
1310
|
{
|
|
1618
1311
|
"kind": "field",
|
|
1619
|
-
"name": "
|
|
1620
|
-
"
|
|
1312
|
+
"name": "name",
|
|
1313
|
+
"type": {
|
|
1314
|
+
"text": "string | undefined"
|
|
1315
|
+
},
|
|
1316
|
+
"description": "The name of the form component.",
|
|
1317
|
+
"attribute": "name",
|
|
1318
|
+
"inheritedFrom": {
|
|
1319
|
+
"name": "InputMixin",
|
|
1320
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1321
|
+
}
|
|
1621
1322
|
},
|
|
1622
1323
|
{
|
|
1623
1324
|
"kind": "field",
|
|
1624
|
-
"name": "
|
|
1625
|
-
"
|
|
1325
|
+
"name": "value",
|
|
1326
|
+
"type": {
|
|
1327
|
+
"text": "string"
|
|
1328
|
+
},
|
|
1329
|
+
"default": "\"\"",
|
|
1330
|
+
"description": "The value of the form component.",
|
|
1331
|
+
"attribute": "value",
|
|
1332
|
+
"inheritedFrom": {
|
|
1333
|
+
"name": "InputMixin",
|
|
1334
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1335
|
+
}
|
|
1626
1336
|
},
|
|
1627
1337
|
{
|
|
1628
1338
|
"kind": "field",
|
|
1629
|
-
"name": "
|
|
1630
|
-
"
|
|
1339
|
+
"name": "form",
|
|
1340
|
+
"description": "Gets the form, if any, associated with the form element.",
|
|
1341
|
+
"inheritedFrom": {
|
|
1342
|
+
"name": "InputMixin",
|
|
1343
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1344
|
+
}
|
|
1631
1345
|
},
|
|
1632
1346
|
{
|
|
1633
1347
|
"kind": "field",
|
|
1634
|
-
"name": "
|
|
1635
|
-
"privacy": "
|
|
1348
|
+
"name": "focusableRef",
|
|
1349
|
+
"privacy": "protected",
|
|
1350
|
+
"inheritedFrom": {
|
|
1351
|
+
"name": "FocusableMixin",
|
|
1352
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1353
|
+
}
|
|
1636
1354
|
},
|
|
1637
1355
|
{
|
|
1638
|
-
"kind": "
|
|
1639
|
-
"name": "
|
|
1640
|
-
"
|
|
1356
|
+
"kind": "method",
|
|
1357
|
+
"name": "focus",
|
|
1358
|
+
"parameters": [
|
|
1359
|
+
{
|
|
1360
|
+
"name": "options",
|
|
1361
|
+
"optional": true,
|
|
1362
|
+
"type": {
|
|
1363
|
+
"text": "FocusOptions"
|
|
1364
|
+
},
|
|
1365
|
+
"description": "An object which controls aspects of the focusing process."
|
|
1366
|
+
}
|
|
1367
|
+
],
|
|
1368
|
+
"description": "Programmatically move focus to the component.",
|
|
1369
|
+
"inheritedFrom": {
|
|
1370
|
+
"name": "FocusableMixin",
|
|
1371
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1372
|
+
}
|
|
1641
1373
|
},
|
|
1642
1374
|
{
|
|
1643
|
-
"kind": "
|
|
1644
|
-
"name": "
|
|
1645
|
-
"
|
|
1375
|
+
"kind": "method",
|
|
1376
|
+
"name": "blur",
|
|
1377
|
+
"description": "Programmatically remove focus from the component.",
|
|
1378
|
+
"inheritedFrom": {
|
|
1379
|
+
"name": "FocusableMixin",
|
|
1380
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1381
|
+
}
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
"kind": "method",
|
|
1385
|
+
"name": "click",
|
|
1386
|
+
"description": "Programmatically simulates a click on the component.",
|
|
1387
|
+
"inheritedFrom": {
|
|
1388
|
+
"name": "FocusableMixin",
|
|
1389
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1390
|
+
}
|
|
1646
1391
|
}
|
|
1647
1392
|
],
|
|
1648
|
-
"
|
|
1393
|
+
"attributes": [
|
|
1649
1394
|
{
|
|
1650
|
-
"name": "
|
|
1395
|
+
"name": "variant",
|
|
1651
1396
|
"type": {
|
|
1652
|
-
"text": "
|
|
1397
|
+
"text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
|
|
1653
1398
|
},
|
|
1654
|
-
"
|
|
1399
|
+
"default": "\"default\"",
|
|
1400
|
+
"description": "The style variant of the button.",
|
|
1401
|
+
"fieldName": "variant"
|
|
1655
1402
|
},
|
|
1656
1403
|
{
|
|
1404
|
+
"name": "type",
|
|
1657
1405
|
"type": {
|
|
1658
|
-
"text": "
|
|
1406
|
+
"text": "\"button\" | \"submit\" | \"reset\""
|
|
1659
1407
|
},
|
|
1660
|
-
"
|
|
1661
|
-
"
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
"attributes": [
|
|
1408
|
+
"default": "\"submit\"",
|
|
1409
|
+
"description": "The type of the button.",
|
|
1410
|
+
"fieldName": "type"
|
|
1411
|
+
},
|
|
1665
1412
|
{
|
|
1666
|
-
"name": "
|
|
1413
|
+
"name": "size",
|
|
1667
1414
|
"type": {
|
|
1668
|
-
"text": "
|
|
1415
|
+
"text": "\"s\" | \"m\" | \"l\""
|
|
1669
1416
|
},
|
|
1670
|
-
"default": "\"\"",
|
|
1671
|
-
"description": "The
|
|
1672
|
-
"fieldName": "
|
|
1417
|
+
"default": "\"m\"",
|
|
1418
|
+
"description": "The size of the button.\nThis affects font-size and padding.",
|
|
1419
|
+
"fieldName": "size"
|
|
1673
1420
|
},
|
|
1674
1421
|
{
|
|
1675
|
-
"name": "
|
|
1422
|
+
"name": "aria-expanded",
|
|
1423
|
+
"type": {
|
|
1424
|
+
"text": "\"true\" | \"false\" | undefined"
|
|
1425
|
+
},
|
|
1426
|
+
"fieldName": "accessibleExpanded"
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
"name": "aria-haspopup",
|
|
1430
|
+
"type": {
|
|
1431
|
+
"text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
|
|
1432
|
+
},
|
|
1433
|
+
"fieldName": "accessibleHasPopup"
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
"name": "href",
|
|
1437
|
+
"type": {
|
|
1438
|
+
"text": "string | undefined"
|
|
1439
|
+
},
|
|
1440
|
+
"description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
|
|
1441
|
+
"fieldName": "href"
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
"name": "download",
|
|
1445
|
+
"type": {
|
|
1446
|
+
"text": "boolean"
|
|
1447
|
+
},
|
|
1448
|
+
"default": "false",
|
|
1449
|
+
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
1450
|
+
"fieldName": "download"
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
"name": "target",
|
|
1454
|
+
"type": {
|
|
1455
|
+
"text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
|
|
1456
|
+
},
|
|
1457
|
+
"default": "\"_self\"",
|
|
1458
|
+
"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.",
|
|
1459
|
+
"fieldName": "target"
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
"name": "expand",
|
|
1463
|
+
"type": {
|
|
1464
|
+
"text": "boolean"
|
|
1465
|
+
},
|
|
1466
|
+
"default": "false",
|
|
1467
|
+
"description": "Controls whether the button expands to fill the width of its container.",
|
|
1468
|
+
"fieldName": "expand"
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
"name": "loading",
|
|
1472
|
+
"type": {
|
|
1473
|
+
"text": "boolean"
|
|
1474
|
+
},
|
|
1475
|
+
"default": "false",
|
|
1476
|
+
"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.",
|
|
1477
|
+
"fieldName": "loading"
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
"name": "disabled",
|
|
1676
1481
|
"type": {
|
|
1677
|
-
"text": "
|
|
1482
|
+
"text": "boolean"
|
|
1678
1483
|
},
|
|
1679
|
-
"
|
|
1680
|
-
"
|
|
1484
|
+
"default": "false",
|
|
1485
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1486
|
+
"fieldName": "disabled",
|
|
1487
|
+
"inheritedFrom": {
|
|
1488
|
+
"name": "InputMixin",
|
|
1489
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1490
|
+
}
|
|
1681
1491
|
},
|
|
1682
1492
|
{
|
|
1683
|
-
"name": "
|
|
1493
|
+
"name": "name",
|
|
1684
1494
|
"type": {
|
|
1685
|
-
"text": "string"
|
|
1495
|
+
"text": "string | undefined"
|
|
1686
1496
|
},
|
|
1687
|
-
"
|
|
1688
|
-
"
|
|
1689
|
-
"
|
|
1497
|
+
"description": "The name of the form component.",
|
|
1498
|
+
"fieldName": "name",
|
|
1499
|
+
"inheritedFrom": {
|
|
1500
|
+
"name": "InputMixin",
|
|
1501
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1502
|
+
}
|
|
1690
1503
|
},
|
|
1691
1504
|
{
|
|
1692
|
-
"name": "
|
|
1505
|
+
"name": "value",
|
|
1693
1506
|
"type": {
|
|
1694
1507
|
"text": "string"
|
|
1695
1508
|
},
|
|
1696
1509
|
"default": "\"\"",
|
|
1697
|
-
"description": "
|
|
1698
|
-
"fieldName": "
|
|
1510
|
+
"description": "The value of the form component.",
|
|
1511
|
+
"fieldName": "value",
|
|
1512
|
+
"inheritedFrom": {
|
|
1513
|
+
"name": "InputMixin",
|
|
1514
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
],
|
|
1518
|
+
"mixins": [
|
|
1519
|
+
{
|
|
1520
|
+
"name": "InputMixin",
|
|
1521
|
+
"module": "/src/common/mixins/InputMixin.js"
|
|
1699
1522
|
},
|
|
1700
1523
|
{
|
|
1701
|
-
"name": "
|
|
1702
|
-
"
|
|
1703
|
-
"text": "boolean"
|
|
1704
|
-
},
|
|
1705
|
-
"default": "false",
|
|
1706
|
-
"description": "Controls whether the calendar expands to fill the width of its container.",
|
|
1707
|
-
"fieldName": "expand"
|
|
1524
|
+
"name": "FocusableMixin",
|
|
1525
|
+
"module": "/src/common/mixins/FocusableMixin.js"
|
|
1708
1526
|
}
|
|
1709
1527
|
],
|
|
1710
1528
|
"superclass": {
|
|
@@ -1712,10 +1530,10 @@
|
|
|
1712
1530
|
"package": "lit"
|
|
1713
1531
|
},
|
|
1714
1532
|
"status": "ready",
|
|
1715
|
-
"category": "
|
|
1533
|
+
"category": "action",
|
|
1716
1534
|
"displayName": null,
|
|
1717
1535
|
"examples": [],
|
|
1718
|
-
"tagName": "nord-
|
|
1536
|
+
"tagName": "nord-button",
|
|
1719
1537
|
"customElement": true
|
|
1720
1538
|
}
|
|
1721
1539
|
],
|
|
@@ -1724,59 +1542,168 @@
|
|
|
1724
1542
|
"kind": "js",
|
|
1725
1543
|
"name": "default",
|
|
1726
1544
|
"declaration": {
|
|
1727
|
-
"name": "
|
|
1728
|
-
"module": "src/
|
|
1545
|
+
"name": "Button",
|
|
1546
|
+
"module": "src/button/Button.ts"
|
|
1729
1547
|
}
|
|
1730
1548
|
},
|
|
1731
1549
|
{
|
|
1732
1550
|
"kind": "custom-element-definition",
|
|
1733
|
-
"name": "nord-
|
|
1551
|
+
"name": "nord-button",
|
|
1734
1552
|
"declaration": {
|
|
1735
|
-
"name": "
|
|
1736
|
-
"module": "src/
|
|
1553
|
+
"name": "Button",
|
|
1554
|
+
"module": "src/button/Button.ts"
|
|
1737
1555
|
}
|
|
1738
1556
|
}
|
|
1739
1557
|
],
|
|
1740
|
-
"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-
|
|
1558
|
+
"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"
|
|
1741
1559
|
},
|
|
1742
1560
|
{
|
|
1743
1561
|
"kind": "javascript-module",
|
|
1744
|
-
"path": "src/
|
|
1562
|
+
"path": "src/banner/Banner.ts",
|
|
1745
1563
|
"declarations": [
|
|
1746
1564
|
{
|
|
1747
1565
|
"kind": "class",
|
|
1748
|
-
"description": "",
|
|
1749
|
-
"name": "
|
|
1566
|
+
"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.",
|
|
1567
|
+
"name": "Banner",
|
|
1568
|
+
"cssProperties": [
|
|
1569
|
+
{
|
|
1570
|
+
"description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
|
|
1571
|
+
"name": "--n-banner-border-radius",
|
|
1572
|
+
"default": "var(--n-border-radius)"
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
"description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
|
|
1576
|
+
"name": "--n-banner-box-shadow",
|
|
1577
|
+
"default": "var(--n-box-shadow-card)"
|
|
1578
|
+
}
|
|
1579
|
+
],
|
|
1580
|
+
"slots": [
|
|
1581
|
+
{
|
|
1582
|
+
"description": "default slot",
|
|
1583
|
+
"name": ""
|
|
1584
|
+
}
|
|
1585
|
+
],
|
|
1586
|
+
"members": [
|
|
1587
|
+
{
|
|
1588
|
+
"kind": "field",
|
|
1589
|
+
"name": "variant",
|
|
1590
|
+
"type": {
|
|
1591
|
+
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
1592
|
+
},
|
|
1593
|
+
"default": "\"info\"",
|
|
1594
|
+
"description": "The style variant of the banner.",
|
|
1595
|
+
"attribute": "variant",
|
|
1596
|
+
"reflects": true
|
|
1597
|
+
}
|
|
1598
|
+
],
|
|
1599
|
+
"attributes": [
|
|
1600
|
+
{
|
|
1601
|
+
"name": "variant",
|
|
1602
|
+
"type": {
|
|
1603
|
+
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
1604
|
+
},
|
|
1605
|
+
"default": "\"info\"",
|
|
1606
|
+
"description": "The style variant of the banner.",
|
|
1607
|
+
"fieldName": "variant"
|
|
1608
|
+
}
|
|
1609
|
+
],
|
|
1750
1610
|
"superclass": {
|
|
1751
|
-
"name": "
|
|
1752
|
-
"
|
|
1611
|
+
"name": "LitElement",
|
|
1612
|
+
"package": "lit"
|
|
1753
1613
|
},
|
|
1754
|
-
"
|
|
1614
|
+
"status": "ready",
|
|
1615
|
+
"category": "feedback",
|
|
1616
|
+
"displayName": null,
|
|
1617
|
+
"examples": [],
|
|
1618
|
+
"tagName": "nord-banner",
|
|
1619
|
+
"customElement": true
|
|
1755
1620
|
}
|
|
1756
1621
|
],
|
|
1757
1622
|
"exports": [
|
|
1758
1623
|
{
|
|
1759
1624
|
"kind": "js",
|
|
1760
|
-
"name": "
|
|
1625
|
+
"name": "default",
|
|
1761
1626
|
"declaration": {
|
|
1762
|
-
"name": "
|
|
1763
|
-
"module": "src/
|
|
1627
|
+
"name": "Banner",
|
|
1628
|
+
"module": "src/banner/Banner.ts"
|
|
1629
|
+
}
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
"kind": "custom-element-definition",
|
|
1633
|
+
"name": "nord-banner",
|
|
1634
|
+
"declaration": {
|
|
1635
|
+
"name": "Banner",
|
|
1636
|
+
"module": "src/banner/Banner.ts"
|
|
1764
1637
|
}
|
|
1765
1638
|
}
|
|
1766
1639
|
],
|
|
1767
|
-
"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
|
|
1640
|
+
"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"
|
|
1768
1641
|
},
|
|
1769
1642
|
{
|
|
1770
1643
|
"kind": "javascript-module",
|
|
1771
|
-
"path": "src/
|
|
1644
|
+
"path": "src/badge/Badge.ts",
|
|
1772
1645
|
"declarations": [
|
|
1773
1646
|
{
|
|
1774
|
-
"kind": "
|
|
1775
|
-
"
|
|
1776
|
-
"
|
|
1777
|
-
|
|
1647
|
+
"kind": "class",
|
|
1648
|
+
"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.",
|
|
1649
|
+
"name": "Badge",
|
|
1650
|
+
"slots": [
|
|
1651
|
+
{
|
|
1652
|
+
"description": "The badge content.",
|
|
1653
|
+
"name": ""
|
|
1654
|
+
}
|
|
1655
|
+
],
|
|
1656
|
+
"members": [
|
|
1657
|
+
{
|
|
1658
|
+
"kind": "field",
|
|
1659
|
+
"name": "type",
|
|
1660
|
+
"type": {
|
|
1661
|
+
"text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
|
|
1662
|
+
},
|
|
1663
|
+
"default": "\"neutral\"",
|
|
1664
|
+
"description": "The type of badge.\nDetermines the background color of the badge.",
|
|
1665
|
+
"attribute": "type",
|
|
1666
|
+
"reflects": true
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
"kind": "field",
|
|
1670
|
+
"name": "progress",
|
|
1671
|
+
"type": {
|
|
1672
|
+
"text": "\"cancelled\" | \"complete\" | \"incomplete\" | \"partially-complete\" | undefined"
|
|
1673
|
+
},
|
|
1674
|
+
"description": "The progress of the badge. Displays a progress\nindicator next to the label.",
|
|
1675
|
+
"attribute": "progress"
|
|
1676
|
+
}
|
|
1677
|
+
],
|
|
1678
|
+
"attributes": [
|
|
1679
|
+
{
|
|
1680
|
+
"name": "type",
|
|
1681
|
+
"type": {
|
|
1682
|
+
"text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
|
|
1683
|
+
},
|
|
1684
|
+
"default": "\"neutral\"",
|
|
1685
|
+
"description": "The type of badge.\nDetermines the background color of the badge.",
|
|
1686
|
+
"fieldName": "type"
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
"name": "progress",
|
|
1690
|
+
"type": {
|
|
1691
|
+
"text": "\"cancelled\" | \"complete\" | \"incomplete\" | \"partially-complete\" | undefined"
|
|
1692
|
+
},
|
|
1693
|
+
"description": "The progress of the badge. Displays a progress\nindicator next to the label.",
|
|
1694
|
+
"fieldName": "progress"
|
|
1695
|
+
}
|
|
1696
|
+
],
|
|
1697
|
+
"superclass": {
|
|
1698
|
+
"name": "LitElement",
|
|
1699
|
+
"package": "lit"
|
|
1778
1700
|
},
|
|
1779
|
-
"
|
|
1701
|
+
"status": "ready",
|
|
1702
|
+
"category": "text",
|
|
1703
|
+
"displayName": null,
|
|
1704
|
+
"examples": [],
|
|
1705
|
+
"tagName": "nord-badge",
|
|
1706
|
+
"customElement": true
|
|
1780
1707
|
}
|
|
1781
1708
|
],
|
|
1782
1709
|
"exports": [
|
|
@@ -1784,61 +1711,142 @@
|
|
|
1784
1711
|
"kind": "js",
|
|
1785
1712
|
"name": "default",
|
|
1786
1713
|
"declaration": {
|
|
1787
|
-
"name": "
|
|
1788
|
-
"module": "src/
|
|
1714
|
+
"name": "Badge",
|
|
1715
|
+
"module": "src/badge/Badge.ts"
|
|
1716
|
+
}
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
"kind": "custom-element-definition",
|
|
1720
|
+
"name": "nord-badge",
|
|
1721
|
+
"declaration": {
|
|
1722
|
+
"name": "Badge",
|
|
1723
|
+
"module": "src/badge/Badge.ts"
|
|
1789
1724
|
}
|
|
1790
1725
|
}
|
|
1791
1726
|
],
|
|
1792
|
-
"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
|
|
1727
|
+
"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"
|
|
1793
1728
|
},
|
|
1794
1729
|
{
|
|
1795
1730
|
"kind": "javascript-module",
|
|
1796
|
-
"path": "src/
|
|
1731
|
+
"path": "src/card/Card.ts",
|
|
1797
1732
|
"declarations": [
|
|
1798
1733
|
{
|
|
1799
|
-
"kind": "
|
|
1800
|
-
"
|
|
1801
|
-
"
|
|
1734
|
+
"kind": "class",
|
|
1735
|
+
"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.",
|
|
1736
|
+
"name": "Card",
|
|
1737
|
+
"cssProperties": [
|
|
1738
|
+
{
|
|
1739
|
+
"description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
|
|
1740
|
+
"name": "--n-card-border-radius",
|
|
1741
|
+
"default": "var(--n-border-radius)"
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
"description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
|
|
1745
|
+
"name": "--n-card-box-shadow",
|
|
1746
|
+
"default": "var(--n-box-shadow-popout)"
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
"description": "Controls the padding on all sides of the card.",
|
|
1750
|
+
"name": "--n-card-padding",
|
|
1751
|
+
"default": "var(--n-space-m)"
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
"description": "Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.",
|
|
1755
|
+
"name": "--n-card-slot-padding",
|
|
1756
|
+
"default": "var(--n-space-m)"
|
|
1757
|
+
}
|
|
1758
|
+
],
|
|
1759
|
+
"slots": [
|
|
1760
|
+
{
|
|
1761
|
+
"description": "The card content.",
|
|
1762
|
+
"name": ""
|
|
1763
|
+
},
|
|
1764
|
+
{
|
|
1765
|
+
"description": "Optional slot that holds a header for the card.",
|
|
1766
|
+
"name": "header"
|
|
1767
|
+
},
|
|
1802
1768
|
{
|
|
1803
|
-
"
|
|
1769
|
+
"description": "Optional slot that positions content at the end of the header. Useful for actions or additional info.",
|
|
1770
|
+
"name": "header-end"
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
"description": "Optional slot that holds footer content for the card.",
|
|
1774
|
+
"name": "footer"
|
|
1775
|
+
}
|
|
1776
|
+
],
|
|
1777
|
+
"members": [
|
|
1778
|
+
{
|
|
1779
|
+
"kind": "field",
|
|
1780
|
+
"name": "headerSlot",
|
|
1781
|
+
"privacy": "private",
|
|
1782
|
+
"default": "new SlotController(this, \"header\")"
|
|
1783
|
+
},
|
|
1784
|
+
{
|
|
1785
|
+
"kind": "field",
|
|
1786
|
+
"name": "headerEndSlot",
|
|
1787
|
+
"privacy": "private",
|
|
1788
|
+
"default": "new SlotController(this, \"header-end\")"
|
|
1789
|
+
},
|
|
1790
|
+
{
|
|
1791
|
+
"kind": "field",
|
|
1792
|
+
"name": "footerSlot",
|
|
1793
|
+
"privacy": "private",
|
|
1794
|
+
"default": "new SlotController(this, \"footer\")"
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
"kind": "field",
|
|
1798
|
+
"name": "padding",
|
|
1804
1799
|
"type": {
|
|
1805
|
-
"text": "
|
|
1806
|
-
}
|
|
1800
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
1801
|
+
},
|
|
1802
|
+
"default": "\"m\"",
|
|
1803
|
+
"description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1804
|
+
"attribute": "padding",
|
|
1805
|
+
"reflects": true
|
|
1807
1806
|
}
|
|
1808
|
-
]
|
|
1809
|
-
|
|
1810
|
-
{
|
|
1811
|
-
"kind": "function",
|
|
1812
|
-
"name": "monthView",
|
|
1813
|
-
"parameters": [
|
|
1807
|
+
],
|
|
1808
|
+
"attributes": [
|
|
1814
1809
|
{
|
|
1815
|
-
"name": "
|
|
1810
|
+
"name": "padding",
|
|
1816
1811
|
"type": {
|
|
1817
|
-
"text": "
|
|
1818
|
-
}
|
|
1812
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
1813
|
+
},
|
|
1814
|
+
"default": "\"m\"",
|
|
1815
|
+
"description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1816
|
+
"fieldName": "padding"
|
|
1819
1817
|
}
|
|
1820
|
-
]
|
|
1818
|
+
],
|
|
1819
|
+
"superclass": {
|
|
1820
|
+
"name": "LitElement",
|
|
1821
|
+
"package": "lit"
|
|
1822
|
+
},
|
|
1823
|
+
"status": "ready",
|
|
1824
|
+
"category": "structure",
|
|
1825
|
+
"displayName": null,
|
|
1826
|
+
"examples": [],
|
|
1827
|
+
"tagName": "nord-card",
|
|
1828
|
+
"customElement": true
|
|
1821
1829
|
}
|
|
1822
1830
|
],
|
|
1823
1831
|
"exports": [
|
|
1824
1832
|
{
|
|
1825
1833
|
"kind": "js",
|
|
1826
|
-
"name": "
|
|
1834
|
+
"name": "default",
|
|
1827
1835
|
"declaration": {
|
|
1828
|
-
"name": "
|
|
1829
|
-
"module": "src/
|
|
1836
|
+
"name": "Card",
|
|
1837
|
+
"module": "src/card/Card.ts"
|
|
1830
1838
|
}
|
|
1831
1839
|
},
|
|
1832
1840
|
{
|
|
1833
|
-
"kind": "
|
|
1834
|
-
"name": "
|
|
1841
|
+
"kind": "custom-element-definition",
|
|
1842
|
+
"name": "nord-card",
|
|
1835
1843
|
"declaration": {
|
|
1836
|
-
"name": "
|
|
1837
|
-
"module": "src/
|
|
1844
|
+
"name": "Card",
|
|
1845
|
+
"module": "src/card/Card.ts"
|
|
1838
1846
|
}
|
|
1839
1847
|
}
|
|
1840
1848
|
],
|
|
1841
|
-
"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
|
|
1849
|
+
"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- Include a header when placing a [Table](/components/table) component inside the card.\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"
|
|
1842
1850
|
},
|
|
1843
1851
|
{
|
|
1844
1852
|
"kind": "javascript-module",
|
|
@@ -5370,6 +5378,117 @@
|
|
|
5370
5378
|
],
|
|
5371
5379
|
"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 represent thematic breaks between elements.\n- Use when you need to divide sections of content from each other.\n- Use to separate content into clear groups.\n- Use dividers sparingly, to create groupings or to separate items.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Avoid using for presentational purposes only.\n- Don’t use strong colors in dividers.\n- Don’t use dividers for replacing card components.\n\n</div>\n\n---\n\n## Additional considerations\n\n- Divider uses a role called `separator` which indicates that the element is a divider that separates and distinguishes sections of content or groups of menu items. The implicit ARIA role of the native thematic break (`<hr>` element) is a separator.\n- Dividers have an implicit aria-orientation value of `horizontal` which can be changed using the `direction` property.\n- For more details, please see [ARIA: separator role on MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/separator_role).\n"
|
|
5372
5380
|
},
|
|
5381
|
+
{
|
|
5382
|
+
"kind": "javascript-module",
|
|
5383
|
+
"path": "src/drawer/Drawer.ts",
|
|
5384
|
+
"declarations": [
|
|
5385
|
+
{
|
|
5386
|
+
"kind": "class",
|
|
5387
|
+
"description": "Drawer is used to display context-sensitive actions and information.\nDrawer doesn’t block users from completing their task, like a modal would.",
|
|
5388
|
+
"name": "Drawer",
|
|
5389
|
+
"cssProperties": [
|
|
5390
|
+
{
|
|
5391
|
+
"description": "Controls the padding around the main area (the default slot), using our [spacing tokens](/tokens/#space).",
|
|
5392
|
+
"name": "--n-drawer-padding",
|
|
5393
|
+
"default": "var(--n-space-l)"
|
|
5394
|
+
}
|
|
5395
|
+
],
|
|
5396
|
+
"slots": [
|
|
5397
|
+
{
|
|
5398
|
+
"description": "Optional slot that holds a header for the drawer.",
|
|
5399
|
+
"name": "header"
|
|
5400
|
+
},
|
|
5401
|
+
{
|
|
5402
|
+
"description": "Default slot.",
|
|
5403
|
+
"name": ""
|
|
5404
|
+
},
|
|
5405
|
+
{
|
|
5406
|
+
"description": "Optional slot that holds footer content for the drawer.",
|
|
5407
|
+
"name": "footer"
|
|
5408
|
+
}
|
|
5409
|
+
],
|
|
5410
|
+
"members": [
|
|
5411
|
+
{
|
|
5412
|
+
"kind": "field",
|
|
5413
|
+
"name": "footerSlot",
|
|
5414
|
+
"privacy": "private",
|
|
5415
|
+
"default": "new SlotController(this, \"footer\")"
|
|
5416
|
+
},
|
|
5417
|
+
{
|
|
5418
|
+
"kind": "field",
|
|
5419
|
+
"name": "padding",
|
|
5420
|
+
"type": {
|
|
5421
|
+
"text": "\"m\" | \"none\""
|
|
5422
|
+
},
|
|
5423
|
+
"default": "\"m\"",
|
|
5424
|
+
"description": "Controls the padding of the drawer component.",
|
|
5425
|
+
"attribute": "padding",
|
|
5426
|
+
"reflects": true
|
|
5427
|
+
},
|
|
5428
|
+
{
|
|
5429
|
+
"kind": "field",
|
|
5430
|
+
"name": "_warningLogged",
|
|
5431
|
+
"type": {
|
|
5432
|
+
"text": "boolean"
|
|
5433
|
+
},
|
|
5434
|
+
"privacy": "private",
|
|
5435
|
+
"static": true,
|
|
5436
|
+
"default": "false",
|
|
5437
|
+
"inheritedFrom": {
|
|
5438
|
+
"name": "DraftComponentMixin",
|
|
5439
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
5440
|
+
}
|
|
5441
|
+
}
|
|
5442
|
+
],
|
|
5443
|
+
"attributes": [
|
|
5444
|
+
{
|
|
5445
|
+
"name": "padding",
|
|
5446
|
+
"type": {
|
|
5447
|
+
"text": "\"m\" | \"none\""
|
|
5448
|
+
},
|
|
5449
|
+
"default": "\"m\"",
|
|
5450
|
+
"description": "Controls the padding of the drawer component.",
|
|
5451
|
+
"fieldName": "padding"
|
|
5452
|
+
}
|
|
5453
|
+
],
|
|
5454
|
+
"mixins": [
|
|
5455
|
+
{
|
|
5456
|
+
"name": "DraftComponentMixin",
|
|
5457
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
5458
|
+
}
|
|
5459
|
+
],
|
|
5460
|
+
"superclass": {
|
|
5461
|
+
"name": "LitElement",
|
|
5462
|
+
"package": "lit"
|
|
5463
|
+
},
|
|
5464
|
+
"status": "draft",
|
|
5465
|
+
"category": "structure",
|
|
5466
|
+
"displayName": null,
|
|
5467
|
+
"examples": [],
|
|
5468
|
+
"tagName": "nord-drawer",
|
|
5469
|
+
"customElement": true
|
|
5470
|
+
}
|
|
5471
|
+
],
|
|
5472
|
+
"exports": [
|
|
5473
|
+
{
|
|
5474
|
+
"kind": "js",
|
|
5475
|
+
"name": "default",
|
|
5476
|
+
"declaration": {
|
|
5477
|
+
"name": "Drawer",
|
|
5478
|
+
"module": "src/drawer/Drawer.ts"
|
|
5479
|
+
}
|
|
5480
|
+
},
|
|
5481
|
+
{
|
|
5482
|
+
"kind": "custom-element-definition",
|
|
5483
|
+
"name": "nord-drawer",
|
|
5484
|
+
"declaration": {
|
|
5485
|
+
"name": "Drawer",
|
|
5486
|
+
"module": "src/drawer/Drawer.ts"
|
|
5487
|
+
}
|
|
5488
|
+
}
|
|
5489
|
+
],
|
|
5490
|
+
"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 displaying contextual actions or information. For example, when clicking on a table row.\n- Use when you don’t want to block users from completing their task in the main view of an application.\n- Always include a header that summarizes the actions and information in the drawer.\n- Should be closeable through actions like “Done” and “Close”.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t reset the drawer’s state when closed if used for settings or filters. Settings should persist.\n- Don’t open from within another drawer. Only one drawer can be open at a time.\n- Don’t use for presenting a small amount of content or an actions menu, use the [popout](/components/popout/) or [dropdown](/components/dropdown/) component instead.\n\n</div>\n"
|
|
5491
|
+
},
|
|
5373
5492
|
{
|
|
5374
5493
|
"kind": "javascript-module",
|
|
5375
5494
|
"path": "src/dropdown/Dropdown.ts",
|
|
@@ -5404,6 +5523,17 @@
|
|
|
5404
5523
|
},
|
|
5405
5524
|
"privacy": "private"
|
|
5406
5525
|
},
|
|
5526
|
+
{
|
|
5527
|
+
"kind": "field",
|
|
5528
|
+
"name": "open",
|
|
5529
|
+
"type": {
|
|
5530
|
+
"text": "boolean"
|
|
5531
|
+
},
|
|
5532
|
+
"default": "false",
|
|
5533
|
+
"description": "Controls whether the dropdown is open or not.",
|
|
5534
|
+
"attribute": "open",
|
|
5535
|
+
"reflects": true
|
|
5536
|
+
},
|
|
5407
5537
|
{
|
|
5408
5538
|
"kind": "field",
|
|
5409
5539
|
"name": "align",
|
|
@@ -5480,9 +5610,23 @@
|
|
|
5480
5610
|
"kind": "method",
|
|
5481
5611
|
"name": "handleOpen",
|
|
5482
5612
|
"privacy": "private"
|
|
5613
|
+
},
|
|
5614
|
+
{
|
|
5615
|
+
"kind": "method",
|
|
5616
|
+
"name": "handleClose",
|
|
5617
|
+
"privacy": "private"
|
|
5483
5618
|
}
|
|
5484
5619
|
],
|
|
5485
5620
|
"attributes": [
|
|
5621
|
+
{
|
|
5622
|
+
"name": "open",
|
|
5623
|
+
"type": {
|
|
5624
|
+
"text": "boolean"
|
|
5625
|
+
},
|
|
5626
|
+
"default": "false",
|
|
5627
|
+
"description": "Controls whether the dropdown is open or not.",
|
|
5628
|
+
"fieldName": "open"
|
|
5629
|
+
},
|
|
5486
5630
|
{
|
|
5487
5631
|
"name": "align",
|
|
5488
5632
|
"type": {
|
|
@@ -6994,6 +7138,11 @@
|
|
|
6994
7138
|
"description": "Controls the padding around the main layout area (the main slot), using our [spacing tokens](/tokens/#space).",
|
|
6995
7139
|
"name": "--n-layout-padding",
|
|
6996
7140
|
"default": "var(--n-space-l)"
|
|
7141
|
+
},
|
|
7142
|
+
{
|
|
7143
|
+
"description": "Controls the width of the drawer area, when used.",
|
|
7144
|
+
"name": "--n-layout-drawer-inline-size",
|
|
7145
|
+
"default": "320px"
|
|
6997
7146
|
}
|
|
6998
7147
|
],
|
|
6999
7148
|
"slots": [
|
|
@@ -7008,6 +7157,10 @@
|
|
|
7008
7157
|
{
|
|
7009
7158
|
"description": "Used to place content inside the header section.",
|
|
7010
7159
|
"name": "header"
|
|
7160
|
+
},
|
|
7161
|
+
{
|
|
7162
|
+
"description": "Used to place additional content/details relating to a selected item.",
|
|
7163
|
+
"name": "drawer"
|
|
7011
7164
|
}
|
|
7012
7165
|
],
|
|
7013
7166
|
"members": [
|
|
@@ -7019,6 +7172,18 @@
|
|
|
7019
7172
|
},
|
|
7020
7173
|
"privacy": "private"
|
|
7021
7174
|
},
|
|
7175
|
+
{
|
|
7176
|
+
"kind": "field",
|
|
7177
|
+
"name": "navSlot",
|
|
7178
|
+
"privacy": "private",
|
|
7179
|
+
"default": "new SlotController(this, \"nav\")"
|
|
7180
|
+
},
|
|
7181
|
+
{
|
|
7182
|
+
"kind": "field",
|
|
7183
|
+
"name": "drawerSlot",
|
|
7184
|
+
"privacy": "private",
|
|
7185
|
+
"default": "new SlotController(this, \"drawer\")"
|
|
7186
|
+
},
|
|
7022
7187
|
{
|
|
7023
7188
|
"kind": "field",
|
|
7024
7189
|
"name": "direction",
|
|
@@ -8325,11 +8490,25 @@
|
|
|
8325
8490
|
},
|
|
8326
8491
|
"privacy": "private"
|
|
8327
8492
|
},
|
|
8493
|
+
{
|
|
8494
|
+
"kind": "field",
|
|
8495
|
+
"name": "popout",
|
|
8496
|
+
"type": {
|
|
8497
|
+
"text": "HTMLDivElement"
|
|
8498
|
+
},
|
|
8499
|
+
"privacy": "private"
|
|
8500
|
+
},
|
|
8501
|
+
{
|
|
8502
|
+
"kind": "field",
|
|
8503
|
+
"name": "scrollBar",
|
|
8504
|
+
"privacy": "private",
|
|
8505
|
+
"default": "new ScrollbarController(this)"
|
|
8506
|
+
},
|
|
8328
8507
|
{
|
|
8329
8508
|
"kind": "field",
|
|
8330
8509
|
"name": "dismiss",
|
|
8331
8510
|
"privacy": "private",
|
|
8332
|
-
"default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: e => this.hide(e.type !== \"click\"),\n isDismissible: node => node !== this && node !== this.targetElement,\n })",
|
|
8511
|
+
"default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: e => this.hide(e.type !== \"click\"),\n isDismissible: node => node !== this.popout && node !== this.targetElement,\n })",
|
|
8333
8512
|
"description": "Handle dismissal of the popout, clicking outside the target button and popout."
|
|
8334
8513
|
},
|
|
8335
8514
|
{
|
|
@@ -8344,15 +8523,6 @@
|
|
|
8344
8523
|
"privacy": "private",
|
|
8345
8524
|
"default": "new DirectionController(this)"
|
|
8346
8525
|
},
|
|
8347
|
-
{
|
|
8348
|
-
"kind": "field",
|
|
8349
|
-
"name": "open",
|
|
8350
|
-
"type": {
|
|
8351
|
-
"text": "boolean"
|
|
8352
|
-
},
|
|
8353
|
-
"privacy": "private",
|
|
8354
|
-
"default": "false"
|
|
8355
|
-
},
|
|
8356
8526
|
{
|
|
8357
8527
|
"kind": "field",
|
|
8358
8528
|
"name": "computedPosition",
|
|
@@ -8366,6 +8536,17 @@
|
|
|
8366
8536
|
"name": "smallViewport",
|
|
8367
8537
|
"privacy": "private"
|
|
8368
8538
|
},
|
|
8539
|
+
{
|
|
8540
|
+
"kind": "field",
|
|
8541
|
+
"name": "open",
|
|
8542
|
+
"type": {
|
|
8543
|
+
"text": "boolean"
|
|
8544
|
+
},
|
|
8545
|
+
"default": "false",
|
|
8546
|
+
"description": "Controls whether the popout is open or not.",
|
|
8547
|
+
"attribute": "open",
|
|
8548
|
+
"reflects": true
|
|
8549
|
+
},
|
|
8369
8550
|
{
|
|
8370
8551
|
"kind": "field",
|
|
8371
8552
|
"name": "align",
|
|
@@ -8429,6 +8610,11 @@
|
|
|
8429
8610
|
"name": "handleOpenChange",
|
|
8430
8611
|
"privacy": "protected"
|
|
8431
8612
|
},
|
|
8613
|
+
{
|
|
8614
|
+
"kind": "field",
|
|
8615
|
+
"name": "enableScroll",
|
|
8616
|
+
"privacy": "private"
|
|
8617
|
+
},
|
|
8432
8618
|
{
|
|
8433
8619
|
"kind": "field",
|
|
8434
8620
|
"name": "updatePosition",
|
|
@@ -8470,6 +8656,15 @@
|
|
|
8470
8656
|
}
|
|
8471
8657
|
],
|
|
8472
8658
|
"attributes": [
|
|
8659
|
+
{
|
|
8660
|
+
"name": "open",
|
|
8661
|
+
"type": {
|
|
8662
|
+
"text": "boolean"
|
|
8663
|
+
},
|
|
8664
|
+
"default": "false",
|
|
8665
|
+
"description": "Controls whether the popout is open or not.",
|
|
8666
|
+
"fieldName": "open"
|
|
8667
|
+
},
|
|
8473
8668
|
{
|
|
8474
8669
|
"name": "align",
|
|
8475
8670
|
"type": {
|