@nordhealth/components 1.0.0-beta.2 → 1.0.0-beta.5
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 +270 -174
- package/lib/Banner.js +2 -0
- package/lib/Banner.js.map +1 -0
- package/lib/EmptyState.js.map +1 -1
- package/lib/Icon.js +1 -1
- package/lib/bundle.js +2 -2
- package/lib/bundle.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/src/banner/Banner.d.ts +25 -0
- package/lib/src/banner/Banner.test.d.ts +2 -0
- package/lib/src/empty-state/EmptyState.d.ts +2 -2
- package/lib/src/index.d.ts +1 -0
- package/package.json +6 -6
package/custom-elements.json
CHANGED
|
@@ -206,6 +206,14 @@
|
|
|
206
206
|
"name": "default",
|
|
207
207
|
"module": "\"./empty-state/EmptyState.js\""
|
|
208
208
|
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"kind": "js",
|
|
212
|
+
"name": "Banner",
|
|
213
|
+
"declaration": {
|
|
214
|
+
"name": "default",
|
|
215
|
+
"module": "\"./banner/Banner.js\""
|
|
216
|
+
}
|
|
209
217
|
}
|
|
210
218
|
]
|
|
211
219
|
},
|
|
@@ -297,6 +305,94 @@
|
|
|
297
305
|
],
|
|
298
306
|
"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 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- Use established color patterns so that users can clearly identify the importance level.\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| `info` | The default variant. 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"
|
|
299
307
|
},
|
|
308
|
+
{
|
|
309
|
+
"kind": "javascript-module",
|
|
310
|
+
"path": "src/banner/Banner.ts",
|
|
311
|
+
"declarations": [
|
|
312
|
+
{
|
|
313
|
+
"kind": "class",
|
|
314
|
+
"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.",
|
|
315
|
+
"name": "Banner",
|
|
316
|
+
"slots": [
|
|
317
|
+
{
|
|
318
|
+
"description": "default slot",
|
|
319
|
+
"name": ""
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"members": [
|
|
323
|
+
{
|
|
324
|
+
"kind": "field",
|
|
325
|
+
"name": "variant",
|
|
326
|
+
"type": {
|
|
327
|
+
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
328
|
+
},
|
|
329
|
+
"default": "\"info\"",
|
|
330
|
+
"description": "The style variant of the banner.",
|
|
331
|
+
"attribute": "variant",
|
|
332
|
+
"reflects": true
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"kind": "field",
|
|
336
|
+
"name": "_warningLogged",
|
|
337
|
+
"type": {
|
|
338
|
+
"text": "boolean"
|
|
339
|
+
},
|
|
340
|
+
"privacy": "private",
|
|
341
|
+
"static": true,
|
|
342
|
+
"default": "false",
|
|
343
|
+
"inheritedFrom": {
|
|
344
|
+
"name": "DraftComponentMixin",
|
|
345
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"attributes": [
|
|
350
|
+
{
|
|
351
|
+
"name": "variant",
|
|
352
|
+
"type": {
|
|
353
|
+
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
354
|
+
},
|
|
355
|
+
"default": "\"info\"",
|
|
356
|
+
"description": "The style variant of the banner.",
|
|
357
|
+
"fieldName": "variant"
|
|
358
|
+
}
|
|
359
|
+
],
|
|
360
|
+
"mixins": [
|
|
361
|
+
{
|
|
362
|
+
"name": "DraftComponentMixin",
|
|
363
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
364
|
+
}
|
|
365
|
+
],
|
|
366
|
+
"superclass": {
|
|
367
|
+
"name": "LitElement",
|
|
368
|
+
"package": "lit"
|
|
369
|
+
},
|
|
370
|
+
"status": "draft",
|
|
371
|
+
"category": "feedback",
|
|
372
|
+
"tagName": "nord-banner",
|
|
373
|
+
"customElement": true
|
|
374
|
+
}
|
|
375
|
+
],
|
|
376
|
+
"exports": [
|
|
377
|
+
{
|
|
378
|
+
"kind": "js",
|
|
379
|
+
"name": "default",
|
|
380
|
+
"declaration": {
|
|
381
|
+
"name": "Banner",
|
|
382
|
+
"module": "src/banner/Banner.ts"
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"kind": "custom-element-definition",
|
|
387
|
+
"name": "nord-banner",
|
|
388
|
+
"declaration": {
|
|
389
|
+
"name": "Banner",
|
|
390
|
+
"module": "src/banner/Banner.ts"
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
"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"
|
|
395
|
+
},
|
|
300
396
|
{
|
|
301
397
|
"kind": "javascript-module",
|
|
302
398
|
"path": "src/button/Button.ts",
|
|
@@ -702,6 +798,114 @@
|
|
|
702
798
|
],
|
|
703
799
|
"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 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 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\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"
|
|
704
800
|
},
|
|
801
|
+
{
|
|
802
|
+
"kind": "javascript-module",
|
|
803
|
+
"path": "src/card/Card.ts",
|
|
804
|
+
"declarations": [
|
|
805
|
+
{
|
|
806
|
+
"kind": "class",
|
|
807
|
+
"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.",
|
|
808
|
+
"name": "Card",
|
|
809
|
+
"slots": [
|
|
810
|
+
{
|
|
811
|
+
"description": "The card content.",
|
|
812
|
+
"name": ""
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"description": "Optional slot that holds a header for the card.",
|
|
816
|
+
"name": "header"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"description": "Optional slot that holds footer content for the card.",
|
|
820
|
+
"name": "footer"
|
|
821
|
+
}
|
|
822
|
+
],
|
|
823
|
+
"members": [
|
|
824
|
+
{
|
|
825
|
+
"kind": "field",
|
|
826
|
+
"name": "headerSlot",
|
|
827
|
+
"privacy": "private",
|
|
828
|
+
"default": "new SlotController(this, \"header\")"
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
"kind": "field",
|
|
832
|
+
"name": "footerSlot",
|
|
833
|
+
"privacy": "private",
|
|
834
|
+
"default": "new SlotController(this, \"footer\")"
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
"kind": "field",
|
|
838
|
+
"name": "padding",
|
|
839
|
+
"type": {
|
|
840
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
841
|
+
},
|
|
842
|
+
"default": "\"m\"",
|
|
843
|
+
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
844
|
+
"attribute": "padding",
|
|
845
|
+
"reflects": true
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"kind": "field",
|
|
849
|
+
"name": "_warningLogged",
|
|
850
|
+
"type": {
|
|
851
|
+
"text": "boolean"
|
|
852
|
+
},
|
|
853
|
+
"privacy": "private",
|
|
854
|
+
"static": true,
|
|
855
|
+
"default": "false",
|
|
856
|
+
"inheritedFrom": {
|
|
857
|
+
"name": "DraftComponentMixin",
|
|
858
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
],
|
|
862
|
+
"attributes": [
|
|
863
|
+
{
|
|
864
|
+
"name": "padding",
|
|
865
|
+
"type": {
|
|
866
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
867
|
+
},
|
|
868
|
+
"default": "\"m\"",
|
|
869
|
+
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
870
|
+
"fieldName": "padding"
|
|
871
|
+
}
|
|
872
|
+
],
|
|
873
|
+
"mixins": [
|
|
874
|
+
{
|
|
875
|
+
"name": "DraftComponentMixin",
|
|
876
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
877
|
+
}
|
|
878
|
+
],
|
|
879
|
+
"superclass": {
|
|
880
|
+
"name": "LitElement",
|
|
881
|
+
"package": "lit"
|
|
882
|
+
},
|
|
883
|
+
"status": "draft",
|
|
884
|
+
"category": "structure",
|
|
885
|
+
"tagName": "nord-card",
|
|
886
|
+
"customElement": true
|
|
887
|
+
}
|
|
888
|
+
],
|
|
889
|
+
"exports": [
|
|
890
|
+
{
|
|
891
|
+
"kind": "js",
|
|
892
|
+
"name": "default",
|
|
893
|
+
"declaration": {
|
|
894
|
+
"name": "Card",
|
|
895
|
+
"module": "src/card/Card.ts"
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
"kind": "custom-element-definition",
|
|
900
|
+
"name": "nord-card",
|
|
901
|
+
"declaration": {
|
|
902
|
+
"name": "Card",
|
|
903
|
+
"module": "src/card/Card.ts"
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
],
|
|
907
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n"
|
|
908
|
+
},
|
|
705
909
|
{
|
|
706
910
|
"kind": "javascript-module",
|
|
707
911
|
"path": "src/calendar/Calendar.ts",
|
|
@@ -1813,114 +2017,6 @@
|
|
|
1813
2017
|
],
|
|
1814
2018
|
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
|
|
1815
2019
|
},
|
|
1816
|
-
{
|
|
1817
|
-
"kind": "javascript-module",
|
|
1818
|
-
"path": "src/card/Card.ts",
|
|
1819
|
-
"declarations": [
|
|
1820
|
-
{
|
|
1821
|
-
"kind": "class",
|
|
1822
|
-
"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.",
|
|
1823
|
-
"name": "Card",
|
|
1824
|
-
"slots": [
|
|
1825
|
-
{
|
|
1826
|
-
"description": "The card content.",
|
|
1827
|
-
"name": ""
|
|
1828
|
-
},
|
|
1829
|
-
{
|
|
1830
|
-
"description": "Optional slot that holds a header for the card.",
|
|
1831
|
-
"name": "header"
|
|
1832
|
-
},
|
|
1833
|
-
{
|
|
1834
|
-
"description": "Optional slot that holds footer content for the card.",
|
|
1835
|
-
"name": "footer"
|
|
1836
|
-
}
|
|
1837
|
-
],
|
|
1838
|
-
"members": [
|
|
1839
|
-
{
|
|
1840
|
-
"kind": "field",
|
|
1841
|
-
"name": "headerSlot",
|
|
1842
|
-
"privacy": "private",
|
|
1843
|
-
"default": "new SlotController(this, \"header\")"
|
|
1844
|
-
},
|
|
1845
|
-
{
|
|
1846
|
-
"kind": "field",
|
|
1847
|
-
"name": "footerSlot",
|
|
1848
|
-
"privacy": "private",
|
|
1849
|
-
"default": "new SlotController(this, \"footer\")"
|
|
1850
|
-
},
|
|
1851
|
-
{
|
|
1852
|
-
"kind": "field",
|
|
1853
|
-
"name": "padding",
|
|
1854
|
-
"type": {
|
|
1855
|
-
"text": "\"m\" | \"l\" | \"none\""
|
|
1856
|
-
},
|
|
1857
|
-
"default": "\"m\"",
|
|
1858
|
-
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1859
|
-
"attribute": "padding",
|
|
1860
|
-
"reflects": true
|
|
1861
|
-
},
|
|
1862
|
-
{
|
|
1863
|
-
"kind": "field",
|
|
1864
|
-
"name": "_warningLogged",
|
|
1865
|
-
"type": {
|
|
1866
|
-
"text": "boolean"
|
|
1867
|
-
},
|
|
1868
|
-
"privacy": "private",
|
|
1869
|
-
"static": true,
|
|
1870
|
-
"default": "false",
|
|
1871
|
-
"inheritedFrom": {
|
|
1872
|
-
"name": "DraftComponentMixin",
|
|
1873
|
-
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
],
|
|
1877
|
-
"attributes": [
|
|
1878
|
-
{
|
|
1879
|
-
"name": "padding",
|
|
1880
|
-
"type": {
|
|
1881
|
-
"text": "\"m\" | \"l\" | \"none\""
|
|
1882
|
-
},
|
|
1883
|
-
"default": "\"m\"",
|
|
1884
|
-
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1885
|
-
"fieldName": "padding"
|
|
1886
|
-
}
|
|
1887
|
-
],
|
|
1888
|
-
"mixins": [
|
|
1889
|
-
{
|
|
1890
|
-
"name": "DraftComponentMixin",
|
|
1891
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
1892
|
-
}
|
|
1893
|
-
],
|
|
1894
|
-
"superclass": {
|
|
1895
|
-
"name": "LitElement",
|
|
1896
|
-
"package": "lit"
|
|
1897
|
-
},
|
|
1898
|
-
"status": "draft",
|
|
1899
|
-
"category": "structure",
|
|
1900
|
-
"tagName": "nord-card",
|
|
1901
|
-
"customElement": true
|
|
1902
|
-
}
|
|
1903
|
-
],
|
|
1904
|
-
"exports": [
|
|
1905
|
-
{
|
|
1906
|
-
"kind": "js",
|
|
1907
|
-
"name": "default",
|
|
1908
|
-
"declaration": {
|
|
1909
|
-
"name": "Card",
|
|
1910
|
-
"module": "src/card/Card.ts"
|
|
1911
|
-
}
|
|
1912
|
-
},
|
|
1913
|
-
{
|
|
1914
|
-
"kind": "custom-element-definition",
|
|
1915
|
-
"name": "nord-card",
|
|
1916
|
-
"declaration": {
|
|
1917
|
-
"name": "Card",
|
|
1918
|
-
"module": "src/card/Card.ts"
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1921
|
-
],
|
|
1922
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n"
|
|
1923
|
-
},
|
|
1924
2020
|
{
|
|
1925
2021
|
"kind": "javascript-module",
|
|
1926
2022
|
"path": "src/command-menu/CommandMenu.ts",
|
|
@@ -4358,72 +4454,6 @@
|
|
|
4358
4454
|
],
|
|
4359
4455
|
"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\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 to choose a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nDate picker 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### Choose date button\n\n- `Space, Enter`: Opens the date picker dialog and moves focus to the first select menu in the dialog.\n\n### Date picker dialog\n\n- `Esc`: Closes the date picker dialog and moves focus back to the “choose date” button.\n- `Tab`: Moves focus to the next element in the dialog. Please note since the calendar uses `role=\"grid\"`, only one button in the calendar grid is in the tab sequence. Additionally, if focus is on the last focusable element, focus is next moved back to the first focusable element inside the date picker dialog.\n- `Shift + Tab`: Same as above, but in reverse order.\n\n### Date picker dialog: Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Date picker dialog: Date grid\n\n- `Space, Enter`: Selects a date, closes the dialog, and moves focus back to the “Choose Date” button. Additionally updates the value of the date picker input with the selected date, and adds selected date to “Choose Date” button label.\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\n#### Date picker dialog: Close button\n\n- `Space, Enter`: Closes the dialog, moves focus to “choose date” button, but does not update the date in input.\n"
|
|
4360
4456
|
},
|
|
4361
|
-
{
|
|
4362
|
-
"kind": "javascript-module",
|
|
4363
|
-
"path": "src/empty-state/EmptyState.ts",
|
|
4364
|
-
"declarations": [
|
|
4365
|
-
{
|
|
4366
|
-
"kind": "class",
|
|
4367
|
-
"description": "Empty state can be used when there is no data to display to\ndescribe what the user can do next. Empty state should provide\nexplanation or guidance to help user progress.",
|
|
4368
|
-
"name": "EmptyState",
|
|
4369
|
-
"slots": [
|
|
4370
|
-
{
|
|
4371
|
-
"description": "default slot",
|
|
4372
|
-
"name": ""
|
|
4373
|
-
}
|
|
4374
|
-
],
|
|
4375
|
-
"members": [
|
|
4376
|
-
{
|
|
4377
|
-
"kind": "field",
|
|
4378
|
-
"name": "_warningLogged",
|
|
4379
|
-
"type": {
|
|
4380
|
-
"text": "boolean"
|
|
4381
|
-
},
|
|
4382
|
-
"privacy": "private",
|
|
4383
|
-
"static": true,
|
|
4384
|
-
"default": "false",
|
|
4385
|
-
"inheritedFrom": {
|
|
4386
|
-
"name": "DraftComponentMixin",
|
|
4387
|
-
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4388
|
-
}
|
|
4389
|
-
}
|
|
4390
|
-
],
|
|
4391
|
-
"mixins": [
|
|
4392
|
-
{
|
|
4393
|
-
"name": "DraftComponentMixin",
|
|
4394
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4395
|
-
}
|
|
4396
|
-
],
|
|
4397
|
-
"superclass": {
|
|
4398
|
-
"name": "LitElement",
|
|
4399
|
-
"package": "lit"
|
|
4400
|
-
},
|
|
4401
|
-
"status": "draft",
|
|
4402
|
-
"category": "feedback",
|
|
4403
|
-
"tagName": "nord-empty-state",
|
|
4404
|
-
"customElement": true
|
|
4405
|
-
}
|
|
4406
|
-
],
|
|
4407
|
-
"exports": [
|
|
4408
|
-
{
|
|
4409
|
-
"kind": "js",
|
|
4410
|
-
"name": "default",
|
|
4411
|
-
"declaration": {
|
|
4412
|
-
"name": "EmptyState",
|
|
4413
|
-
"module": "src/empty-state/EmptyState.ts"
|
|
4414
|
-
}
|
|
4415
|
-
},
|
|
4416
|
-
{
|
|
4417
|
-
"kind": "custom-element-definition",
|
|
4418
|
-
"name": "nord-empty-state",
|
|
4419
|
-
"declaration": {
|
|
4420
|
-
"name": "EmptyState",
|
|
4421
|
-
"module": "src/empty-state/EmptyState.ts"
|
|
4422
|
-
}
|
|
4423
|
-
}
|
|
4424
|
-
],
|
|
4425
|
-
"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 another component or part of UI has no items or data to show.\n- Help users by clearly explaining the benefit and utility of a product or feature.\n- Be encouraging and never make users feel unsuccessful or guilty.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use as a generic banner to highlight specific content.\n\n</div>\n\n---\n\n## Content guidelines\n\nEmpty state headings should state to the user what’s wrong or why there’s no content:\n\n<div class=\"n-usage n-usage-do\">No results found</div>\n<div class=\"n-usage n-usage-dont\">Error</div>\n\nWhen writing empty state headings, 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\">You don’t have access to this content</div>\n<div class=\"n-usage n-usage-dont\">You Don’t Have Access To This Content</div>\n\nDescriptions in empty states should add useful and relevant additional information:\n\n<div class=\"n-usage n-usage-do\">We were unable to connect to the service. Click Retry to try again or View log to learn what happened.</div>\n<div class=\"n-usage n-usage-dont\">No connection.</div>\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\">Clear filters</div>\n<div class=\"n-usage n-usage-dont\">Clear</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\">View log</div>\n<div class=\"n-usage n-usage-dont\">View Log</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\">Request access</div>\n<div class=\"n-usage n-usage-dont\">Request an access</div>\n"
|
|
4426
|
-
},
|
|
4427
4457
|
{
|
|
4428
4458
|
"kind": "javascript-module",
|
|
4429
4459
|
"path": "src/fieldset/Fieldset.ts",
|
|
@@ -4575,6 +4605,72 @@
|
|
|
4575
4605
|
],
|
|
4576
4606
|
"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 the fieldset component when you need to create a relationship between multiple form inputs.\n- It is especially important to use with a group of radio components.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use with a checkbox component when there is **only one** checkbox. For example, when accepting terms and conditions.\n\n</div>\n\n-------\n\n## Content guidelines\n\nFieldset label should be clear, accurate and predictable. It should help the user to understand how the items in the fieldset are grouped together, or what kind of choice the user is making:\n\n<div class=\"n-usage n-usage-do\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Choose</div>\n\nWhen writing fieldset 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\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick A Color</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick a color.</div>\n\nDo not use colons in fieldset label:\n\n<div class=\"n-usage n-usage-do\">Payment details</div>\n<div class=\"n-usage n-usage-dont\">Payment details:</div>\n\n-------\n\n## Additional considerations\n\n- A label (which becomes to `<legend>` inside the fieldset) is always required.\n- Hint text can be used to offer further information or explanation for an option.\n"
|
|
4577
4607
|
},
|
|
4608
|
+
{
|
|
4609
|
+
"kind": "javascript-module",
|
|
4610
|
+
"path": "src/empty-state/EmptyState.ts",
|
|
4611
|
+
"declarations": [
|
|
4612
|
+
{
|
|
4613
|
+
"kind": "class",
|
|
4614
|
+
"description": "Empty state can be used when there is no data to display to\ndescribe what the user can do next. Empty state provides\nexplanation and guidance to help user progress.",
|
|
4615
|
+
"name": "EmptyState",
|
|
4616
|
+
"slots": [
|
|
4617
|
+
{
|
|
4618
|
+
"description": "default slot",
|
|
4619
|
+
"name": ""
|
|
4620
|
+
}
|
|
4621
|
+
],
|
|
4622
|
+
"members": [
|
|
4623
|
+
{
|
|
4624
|
+
"kind": "field",
|
|
4625
|
+
"name": "_warningLogged",
|
|
4626
|
+
"type": {
|
|
4627
|
+
"text": "boolean"
|
|
4628
|
+
},
|
|
4629
|
+
"privacy": "private",
|
|
4630
|
+
"static": true,
|
|
4631
|
+
"default": "false",
|
|
4632
|
+
"inheritedFrom": {
|
|
4633
|
+
"name": "DraftComponentMixin",
|
|
4634
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4635
|
+
}
|
|
4636
|
+
}
|
|
4637
|
+
],
|
|
4638
|
+
"mixins": [
|
|
4639
|
+
{
|
|
4640
|
+
"name": "DraftComponentMixin",
|
|
4641
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4642
|
+
}
|
|
4643
|
+
],
|
|
4644
|
+
"superclass": {
|
|
4645
|
+
"name": "LitElement",
|
|
4646
|
+
"package": "lit"
|
|
4647
|
+
},
|
|
4648
|
+
"status": "draft",
|
|
4649
|
+
"category": "feedback",
|
|
4650
|
+
"tagName": "nord-empty-state",
|
|
4651
|
+
"customElement": true
|
|
4652
|
+
}
|
|
4653
|
+
],
|
|
4654
|
+
"exports": [
|
|
4655
|
+
{
|
|
4656
|
+
"kind": "js",
|
|
4657
|
+
"name": "default",
|
|
4658
|
+
"declaration": {
|
|
4659
|
+
"name": "EmptyState",
|
|
4660
|
+
"module": "src/empty-state/EmptyState.ts"
|
|
4661
|
+
}
|
|
4662
|
+
},
|
|
4663
|
+
{
|
|
4664
|
+
"kind": "custom-element-definition",
|
|
4665
|
+
"name": "nord-empty-state",
|
|
4666
|
+
"declaration": {
|
|
4667
|
+
"name": "EmptyState",
|
|
4668
|
+
"module": "src/empty-state/EmptyState.ts"
|
|
4669
|
+
}
|
|
4670
|
+
}
|
|
4671
|
+
],
|
|
4672
|
+
"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 another component or part of UI has no items or data to show.\n- Help users by clearly explaining the benefit and utility of a product or feature.\n- Be encouraging and never make users feel unsuccessful or guilty.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use as a generic banner to highlight specific content.\n\n</div>\n\n---\n\n## Content guidelines\n\nEmpty state headings should state to the user what’s wrong or why there’s no content:\n\n<div class=\"n-usage n-usage-do\">No results found</div>\n<div class=\"n-usage n-usage-dont\">Error</div>\n\nWhen writing empty state headings, 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\">You don’t have access to this content</div>\n<div class=\"n-usage n-usage-dont\">You Don’t Have Access To This Content</div>\n\nDescriptions in empty states should add useful and relevant additional information:\n\n<div class=\"n-usage n-usage-do\">We were unable to connect to the service. Click Retry to try again or View log to learn what happened.</div>\n<div class=\"n-usage n-usage-dont\">No connection.</div>\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\">Clear filters</div>\n<div class=\"n-usage n-usage-dont\">Clear</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\">View log</div>\n<div class=\"n-usage n-usage-dont\">View Log</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\">Request access</div>\n<div class=\"n-usage n-usage-dont\">Request an access</div>\n"
|
|
4673
|
+
},
|
|
4578
4674
|
{
|
|
4579
4675
|
"kind": "javascript-module",
|
|
4580
4676
|
"path": "src/header/Header.ts",
|
package/lib/Banner.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{D as n,_ as r,n as a}from"./DraftComponentMixin-30345acf.js";import{r as o,$ as e,s as t}from"./lit-element-9646ab7e.js";import{e as i}from"./property-03f59dce.js";import{s}from"./Component-a19be7c9.js";const c=o`:host{--n-banner-padding:var(--n-space-m);--n-banner-background:var(--n-color-status-info-weak);font-size:var(--n-font-size-m);color:var(--n-color-text);display:contents}.n-banner{background:var(--n-banner-background);box-shadow:var(--n-box-shadow-card);border-radius:var(--n-border-radius);padding:var(--n-space-m) var(--n-space-l);margin:0;inline-size:100%}.n-banner-content{inline-size:calc(100% - var(--n-space-xl))}nord-icon{transform:translateY(2px);color:var(--n-color-icon-hover)}::slotted(a){color:var(--n-color-text)!important;text-decoration:underline!important}::slotted(p){margin:0!important}:host([variant=success]){--n-banner-background:var(--n-color-status-success-weak)}:host([variant=danger]){--n-banner-background:var(--n-color-status-danger-weak)}:host([variant=warning]){--n-banner-background:var(--n-color-status-warning-weak)}`;let d=class extends(n(t)){constructor(){super(...arguments),this.variant="info"}render(){return e`<div class="n-banner"><nord-stack align-items="start" direction="horizontal"><nord-icon name="interface-warning" size="m" ?hidden="${"warning"!==this.variant}"></nord-icon><nord-icon name="interface-warning" size="m" ?hidden="${"danger"!==this.variant}"></nord-icon><nord-icon name="interface-info" size="m" ?hidden="${"info"!==this.variant}"></nord-icon><nord-icon name="interface-help-2" size="m" ?hidden="${"success"!==this.variant}"></nord-icon><div class="n-banner-content"><slot></slot></div></nord-stack></div>`}};d.styles=[s,c],r([i({reflect:!0})],d.prototype,"variant",void 0),d=r([a("nord-banner")],d);var l=d;export{l as default};
|
|
2
|
+
//# sourceMappingURL=Banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.js","sources":["../src/banner/Banner.ts"],"sourcesContent":["import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\n\nimport componentStyle from \"../common/styles/Component.css\"\nimport style from \"./Banner.css\"\n\n/**\n * Banner informs users about important changes or conditions in the\n * interface. Use this component if you need to communicate to users\n * in a prominent way.\n *\n * @status draft\n * @category feedback\n * @slot - default slot\n */\n@customElement(\"nord-banner\")\nexport default class Banner extends DraftComponentMixin(LitElement) {\n static styles = [componentStyle, style]\n\n /**\n * The style variant of the banner.\n */\n @property({ reflect: true }) variant: \"info\" | \"danger\" | \"success\" | \"warning\" = \"info\"\n\n render() {\n return html`\n <div class=\"n-banner\">\n <nord-stack align-items=\"start\" direction=\"horizontal\">\n <nord-icon name=\"interface-warning\" size=\"m\" ?hidden=${this.variant !== \"warning\"}></nord-icon>\n <nord-icon name=\"interface-warning\" size=\"m\" ?hidden=${this.variant !== \"danger\"}></nord-icon>\n <nord-icon name=\"interface-info\" size=\"m\" ?hidden=${this.variant !== \"info\"}></nord-icon>\n <nord-icon name=\"interface-help-2\" size=\"m\" ?hidden=${this.variant !== \"success\"}></nord-icon>\n <div class=\"n-banner-content\">\n <slot></slot>\n </div>\n </nord-stack>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-banner\": Banner\n }\n}\n"],"names":["Banner","DraftComponentMixin","LitElement","constructor","this","render","html","variant","componentStyle","style","__decorate","property","reflect","customElement"],"mappings":"+iCAiBA,IAAqBA,EAArB,cAAoCC,EAAoBC,IAAxDC,kCAM+BC,aAAqD,OAElFC,SACE,OAAOC,CAAI,sIAGmE,YAAjBF,KAAKG,8EACY,WAAjBH,KAAKG,2EACS,SAAjBH,KAAKG,6EACc,YAAjBH,KAAKG,8FAd5DP,SAAS,CAACQ,EAAgBC,GAKJC,GAA5BC,EAAS,CAAEC,SAAS,mCANFZ,KADpBa,EAAc,gBACMb,SAAAA"}
|
package/lib/EmptyState.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","sources":["../src/empty-state/EmptyState.ts"],"sourcesContent":["import { LitElement, html } from \"lit\"\nimport { customElement } from \"lit/decorators.js\"\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\n\nimport componentStyle from \"../common/styles/Component.css\"\nimport style from \"./EmptyState.css\"\n\n/**\n * Empty state can be used when there is no data to display to\n * describe what the user can do next. Empty state
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sources":["../src/empty-state/EmptyState.ts"],"sourcesContent":["import { LitElement, html } from \"lit\"\nimport { customElement } from \"lit/decorators.js\"\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\n\nimport componentStyle from \"../common/styles/Component.css\"\nimport style from \"./EmptyState.css\"\n\n/**\n * Empty state can be used when there is no data to display to\n * describe what the user can do next. Empty state provides\n * explanation and guidance to help user progress.\n *\n * @status draft\n * @category feedback\n * @slot - default slot\n */\n@customElement(\"nord-empty-state\")\nexport default class EmptyState extends DraftComponentMixin(LitElement) {\n static styles = [componentStyle, style]\n\n render() {\n return html`<div class=\"n-empty-state\">\n <slot></slot>\n </div>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-empty-state\": EmptyState\n }\n}\n"],"names":["EmptyState","DraftComponentMixin","LitElement","render","html","componentStyle","style","customElement"],"mappings":"giCAiBA,IAAqBA,EAArB,cAAwCC,EAAoBC,IAG1DC,SACE,OAAOC,CAAI,mDAHNJ,SAAS,CAACK,EAAgBC,GADdN,KADpBO,EAAc,qBACMP,SAAAA"}
|
package/lib/Icon.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as e,_ as s,n as i}from"./DraftComponentMixin-30345acf.js";import{r as t,$ as o,s as r}from"./lit-element-9646ab7e.js";import{e as n}from"./property-03f59dce.js";import{t as a}from"./state-70f38ceb.js";import{l as c}from"./if-defined-2a4c6dbc.js";import{o as l}from"./unsafe-html-4da54dd2.js";import{s as d}from"./Component-a19be7c9.js";import"./directive-de55b00a.js";const h=t`:host{--n-icon-size:var(--n-size-icon-m);display:inline-block;block-size:var(--n-icon-size);inline-size:var(--n-icon-size)}:host([size=xs]){--n-icon-size:var(--n-size-icon-xs)}:host([size="s"]){--n-icon-size:var(--n-size-icon-s)}:host([size="l"]){--n-icon-size:var(--n-size-icon-l)}:host([size=xl]){--n-icon-size:var(--n-size-icon-xl)}:host([size=xxl]){--n-icon-size:var(--n-size-icon-xxl)}.n-icon{display:block}svg{display:block}`;var v;let p=v=class extends(e(r)){constructor(){super(...arguments),this.name="",this.size="m",this.svg=""}static registerResolver(e){v.resolver=e}static registerIcon(e,s){let i,t;if("string"==typeof e?(i=e,t=s):(i=e.title,t=e.default),!i)throw new Error("name is required when registering an icon");if(!t)throw new Error("icon must not be empty");v.registeredIcons.has(i)||v.registeredIcons.set(i,t)}willUpdate(e){if(!e.has("name"))return;const s=this.resolve();"string"==typeof s?this.svg=s:s.then((e=>{this.svg=e})).catch((()=>{this.svg=""}))}render(){return o`<div role="${c(this.label?"img":void 0)}" aria-label="${c(this.label)}"><slot style="${c(this.color?`color:${this.color}`:void 0)}" aria-hidden="true">${l(this.svg)}</slot></div>`}resolve(){return this.name?v.registeredIcons.has(this.name)?v.registeredIcons.get(this.name):v.resolver(this.name):""}};p.styles=[d,h],p.resolver=e=>fetch(`https://nordcdn.net/ds/icons/1.3.
|
|
1
|
+
import{D as e,_ as s,n as i}from"./DraftComponentMixin-30345acf.js";import{r as t,$ as o,s as r}from"./lit-element-9646ab7e.js";import{e as n}from"./property-03f59dce.js";import{t as a}from"./state-70f38ceb.js";import{l as c}from"./if-defined-2a4c6dbc.js";import{o as l}from"./unsafe-html-4da54dd2.js";import{s as d}from"./Component-a19be7c9.js";import"./directive-de55b00a.js";const h=t`:host{--n-icon-size:var(--n-size-icon-m);display:inline-block;block-size:var(--n-icon-size);inline-size:var(--n-icon-size)}:host([size=xs]){--n-icon-size:var(--n-size-icon-xs)}:host([size="s"]){--n-icon-size:var(--n-size-icon-s)}:host([size="l"]){--n-icon-size:var(--n-size-icon-l)}:host([size=xl]){--n-icon-size:var(--n-size-icon-xl)}:host([size=xxl]){--n-icon-size:var(--n-size-icon-xxl)}.n-icon{display:block}svg{display:block}`;var v;let p=v=class extends(e(r)){constructor(){super(...arguments),this.name="",this.size="m",this.svg=""}static registerResolver(e){v.resolver=e}static registerIcon(e,s){let i,t;if("string"==typeof e?(i=e,t=s):(i=e.title,t=e.default),!i)throw new Error("name is required when registering an icon");if(!t)throw new Error("icon must not be empty");v.registeredIcons.has(i)||v.registeredIcons.set(i,t)}willUpdate(e){if(!e.has("name"))return;const s=this.resolve();"string"==typeof s?this.svg=s:s.then((e=>{this.svg=e})).catch((()=>{this.svg=""}))}render(){return o`<div role="${c(this.label?"img":void 0)}" aria-label="${c(this.label)}"><slot style="${c(this.color?`color:${this.color}`:void 0)}" aria-hidden="true">${l(this.svg)}</slot></div>`}resolve(){return this.name?v.registeredIcons.has(this.name)?v.registeredIcons.get(this.name):v.resolver(this.name):""}};p.styles=[d,h],p.resolver=e=>fetch(`https://nordcdn.net/ds/icons/1.3.4/assets/${e}.svg`).then((e=>e.text())),p.registeredIcons=new Map,s([n({reflect:!0})],p.prototype,"name",void 0),s([n({reflect:!0})],p.prototype,"size",void 0),s([n({reflect:!0})],p.prototype,"color",void 0),s([n({reflect:!0})],p.prototype,"label",void 0),s([a()],p.prototype,"svg",void 0),p=v=s([i("nord-icon")],p);var m=p;export{m as default};
|
|
2
2
|
//# sourceMappingURL=Icon.js.map
|