@nordhealth/components 1.5.0 → 1.5.1

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/README.md CHANGED
@@ -62,4 +62,4 @@ See license in LICENSE.md
62
62
 
63
63
  ## Copyright
64
64
 
65
- Copyright © 2022 Nordhealth Ltd.
65
+ Copyright © 2022 Nordhealth Ltd
@@ -299,40 +299,105 @@
299
299
  },
300
300
  {
301
301
  "kind": "javascript-module",
302
- "path": "src/badge/Badge.ts",
302
+ "path": "src/avatar/Avatar.ts",
303
303
  "declarations": [
304
304
  {
305
305
  "kind": "class",
306
- "description": "Badges are used to inform users of the status of an object or of an action that’s been taken. Commonly used in tabular data to indicate status.",
307
- "name": "Badge",
308
- "slots": [
309
- {
310
- "description": "The badge content.",
311
- "name": ""
312
- }
313
- ],
306
+ "description": "Avatar is used for showing a thumbnail representation of a user or entity.\nDefault avatar illustration is displayed when no src is specified.",
307
+ "name": "Avatar",
314
308
  "members": [
315
309
  {
316
310
  "kind": "field",
317
- "name": "type",
311
+ "name": "state",
318
312
  "type": {
319
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
313
+ "text": "States<typeof transition>"
320
314
  },
321
- "default": "\"info\"",
322
- "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
323
- "attribute": "type",
315
+ "privacy": "private",
316
+ "default": "\"initial\""
317
+ },
318
+ {
319
+ "kind": "field",
320
+ "name": "size",
321
+ "type": {
322
+ "text": "\"m\" | \"l\" | \"xl\" | \"xxl\""
323
+ },
324
+ "default": "\"m\"",
325
+ "description": "The size of the avatar.",
326
+ "attribute": "size",
327
+ "reflects": true
328
+ },
329
+ {
330
+ "kind": "field",
331
+ "name": "src",
332
+ "type": {
333
+ "text": "string | undefined"
334
+ },
335
+ "description": "The URL of the avatar image uploaded by the user.",
336
+ "attribute": "src",
324
337
  "reflects": true
338
+ },
339
+ {
340
+ "kind": "field",
341
+ "name": "name",
342
+ "type": {
343
+ "text": "string"
344
+ },
345
+ "default": "\"\"",
346
+ "description": "The name of the person.",
347
+ "attribute": "name"
348
+ },
349
+ {
350
+ "kind": "method",
351
+ "name": "handleSrcChange",
352
+ "privacy": "protected"
353
+ },
354
+ {
355
+ "kind": "method",
356
+ "name": "renderImage",
357
+ "privacy": "protected"
358
+ },
359
+ {
360
+ "kind": "method",
361
+ "name": "renderFallback",
362
+ "privacy": "protected"
363
+ },
364
+ {
365
+ "kind": "method",
366
+ "name": "handleLoad",
367
+ "privacy": "private"
368
+ },
369
+ {
370
+ "kind": "method",
371
+ "name": "handleError",
372
+ "privacy": "private"
325
373
  }
326
374
  ],
327
375
  "attributes": [
328
376
  {
329
- "name": "type",
377
+ "name": "size",
330
378
  "type": {
331
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
379
+ "text": "\"m\" | \"l\" | \"xl\" | \"xxl\""
332
380
  },
333
- "default": "\"info\"",
334
- "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
335
- "fieldName": "type"
381
+ "default": "\"m\"",
382
+ "description": "The size of the avatar.",
383
+ "fieldName": "size"
384
+ },
385
+ {
386
+ "name": "src",
387
+ "type": {
388
+ "text": "string | undefined"
389
+ },
390
+ "description": "The URL of the avatar image uploaded by the user.",
391
+ "fieldName": "src"
392
+ },
393
+ {
394
+ "name": "name",
395
+ "type": {
396
+ "text": "string"
397
+ },
398
+ "default": "\"\"",
399
+ "description": "The name of the person.",
400
+ "fieldName": "name"
336
401
  }
337
402
  ],
338
403
  "superclass": {
@@ -340,8 +405,8 @@
340
405
  "package": "lit"
341
406
  },
342
407
  "status": "ready",
343
- "category": "text",
344
- "tagName": "nord-badge",
408
+ "category": "image",
409
+ "tagName": "nord-avatar",
345
410
  "customElement": true
346
411
  }
347
412
  ],
@@ -350,20 +415,20 @@
350
415
  "kind": "js",
351
416
  "name": "default",
352
417
  "declaration": {
353
- "name": "Badge",
354
- "module": "src/badge/Badge.ts"
418
+ "name": "Avatar",
419
+ "module": "src/avatar/Avatar.ts"
355
420
  }
356
421
  },
357
422
  {
358
423
  "kind": "custom-element-definition",
359
- "name": "nord-badge",
424
+ "name": "nord-avatar",
360
425
  "declaration": {
361
- "name": "Badge",
362
- "module": "src/badge/Badge.ts"
426
+ "name": "Avatar",
427
+ "module": "src/avatar/Avatar.ts"
363
428
  }
364
429
  }
365
430
  ],
366
- "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"
431
+ "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- Always add the name of the person using the `name` property.\n- For the best results, use square images or images cropped into a square.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Try to avoid using landscape or portrait images as avatars. Let users crop their images before or after uploading if possible.\n\n</div>\n"
367
432
  },
368
433
  {
369
434
  "kind": "javascript-module",
@@ -871,6 +936,74 @@
871
936
  ],
872
937
  "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| `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"
873
938
  },
939
+ {
940
+ "kind": "javascript-module",
941
+ "path": "src/badge/Badge.ts",
942
+ "declarations": [
943
+ {
944
+ "kind": "class",
945
+ "description": "Badges are used to inform users of the status of an object or of an action that’s been taken. Commonly used in tabular data to indicate status.",
946
+ "name": "Badge",
947
+ "slots": [
948
+ {
949
+ "description": "The badge content.",
950
+ "name": ""
951
+ }
952
+ ],
953
+ "members": [
954
+ {
955
+ "kind": "field",
956
+ "name": "type",
957
+ "type": {
958
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
959
+ },
960
+ "default": "\"info\"",
961
+ "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
962
+ "attribute": "type",
963
+ "reflects": true
964
+ }
965
+ ],
966
+ "attributes": [
967
+ {
968
+ "name": "type",
969
+ "type": {
970
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
971
+ },
972
+ "default": "\"info\"",
973
+ "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
974
+ "fieldName": "type"
975
+ }
976
+ ],
977
+ "superclass": {
978
+ "name": "LitElement",
979
+ "package": "lit"
980
+ },
981
+ "status": "ready",
982
+ "category": "text",
983
+ "tagName": "nord-badge",
984
+ "customElement": true
985
+ }
986
+ ],
987
+ "exports": [
988
+ {
989
+ "kind": "js",
990
+ "name": "default",
991
+ "declaration": {
992
+ "name": "Badge",
993
+ "module": "src/badge/Badge.ts"
994
+ }
995
+ },
996
+ {
997
+ "kind": "custom-element-definition",
998
+ "name": "nord-badge",
999
+ "declaration": {
1000
+ "name": "Badge",
1001
+ "module": "src/badge/Badge.ts"
1002
+ }
1003
+ }
1004
+ ],
1005
+ "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"
1006
+ },
874
1007
  {
875
1008
  "kind": "javascript-module",
876
1009
  "path": "src/calendar/Calendar.ts",
@@ -2680,139 +2813,6 @@
2680
2813
  ],
2681
2814
  "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
2682
2815
  },
2683
- {
2684
- "kind": "javascript-module",
2685
- "path": "src/avatar/Avatar.ts",
2686
- "declarations": [
2687
- {
2688
- "kind": "class",
2689
- "description": "Avatar is used for showing a thumbnail representation of a user or entity.\nDefault avatar illustration is displayed when no src is specified.",
2690
- "name": "Avatar",
2691
- "members": [
2692
- {
2693
- "kind": "field",
2694
- "name": "state",
2695
- "type": {
2696
- "text": "States<typeof transition>"
2697
- },
2698
- "privacy": "private",
2699
- "default": "\"initial\""
2700
- },
2701
- {
2702
- "kind": "field",
2703
- "name": "size",
2704
- "type": {
2705
- "text": "\"m\" | \"l\" | \"xl\" | \"xxl\""
2706
- },
2707
- "default": "\"m\"",
2708
- "description": "The size of the avatar.",
2709
- "attribute": "size",
2710
- "reflects": true
2711
- },
2712
- {
2713
- "kind": "field",
2714
- "name": "src",
2715
- "type": {
2716
- "text": "string | undefined"
2717
- },
2718
- "description": "The URL of the avatar image uploaded by the user.",
2719
- "attribute": "src",
2720
- "reflects": true
2721
- },
2722
- {
2723
- "kind": "field",
2724
- "name": "name",
2725
- "type": {
2726
- "text": "string"
2727
- },
2728
- "default": "\"\"",
2729
- "description": "The name of the person.",
2730
- "attribute": "name"
2731
- },
2732
- {
2733
- "kind": "method",
2734
- "name": "handleSrcChange",
2735
- "privacy": "protected"
2736
- },
2737
- {
2738
- "kind": "method",
2739
- "name": "renderImage",
2740
- "privacy": "protected"
2741
- },
2742
- {
2743
- "kind": "method",
2744
- "name": "renderFallback",
2745
- "privacy": "protected"
2746
- },
2747
- {
2748
- "kind": "method",
2749
- "name": "handleLoad",
2750
- "privacy": "private"
2751
- },
2752
- {
2753
- "kind": "method",
2754
- "name": "handleError",
2755
- "privacy": "private"
2756
- }
2757
- ],
2758
- "attributes": [
2759
- {
2760
- "name": "size",
2761
- "type": {
2762
- "text": "\"m\" | \"l\" | \"xl\" | \"xxl\""
2763
- },
2764
- "default": "\"m\"",
2765
- "description": "The size of the avatar.",
2766
- "fieldName": "size"
2767
- },
2768
- {
2769
- "name": "src",
2770
- "type": {
2771
- "text": "string | undefined"
2772
- },
2773
- "description": "The URL of the avatar image uploaded by the user.",
2774
- "fieldName": "src"
2775
- },
2776
- {
2777
- "name": "name",
2778
- "type": {
2779
- "text": "string"
2780
- },
2781
- "default": "\"\"",
2782
- "description": "The name of the person.",
2783
- "fieldName": "name"
2784
- }
2785
- ],
2786
- "superclass": {
2787
- "name": "LitElement",
2788
- "package": "lit"
2789
- },
2790
- "status": "ready",
2791
- "category": "image",
2792
- "tagName": "nord-avatar",
2793
- "customElement": true
2794
- }
2795
- ],
2796
- "exports": [
2797
- {
2798
- "kind": "js",
2799
- "name": "default",
2800
- "declaration": {
2801
- "name": "Avatar",
2802
- "module": "src/avatar/Avatar.ts"
2803
- }
2804
- },
2805
- {
2806
- "kind": "custom-element-definition",
2807
- "name": "nord-avatar",
2808
- "declaration": {
2809
- "name": "Avatar",
2810
- "module": "src/avatar/Avatar.ts"
2811
- }
2812
- }
2813
- ],
2814
- "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- Always add the name of the person using the `name` property.\n- For the best results, use square images or images cropped into a square.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Try to avoid using landscape or portrait images as avatars. Let users crop their images before or after uploading if possible.\n\n</div>\n"
2815
- },
2816
2816
  {
2817
2817
  "kind": "javascript-module",
2818
2818
  "path": "src/common/attribute.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nordhealth/components",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "This package includes Nord Design System web components",
5
5
  "author": "Nordhealth <support@nordhealth.design>",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -168,5 +168,5 @@
168
168
  }
169
169
  ]
170
170
  },
171
- "gitHead": "ce78354459bd954ace8877f5fd1f1d4f10f511eb"
171
+ "gitHead": "8ed2ab283ef04baf922293d32aaf04aff905328c"
172
172
  }