@nldd/design-system 0.8.67 → 0.8.69

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.
Files changed (151) hide show
  1. package/dist/components/actions/button/button.d.ts +6 -0
  2. package/dist/components/actions/button/button.d.ts.map +1 -1
  3. package/dist/components/actions/button/button.js +12 -0
  4. package/dist/components/actions/button/button.js.map +1 -1
  5. package/dist/components/actions/button/button.styles.js +108 -108
  6. package/dist/components/actions/button/button.template.d.ts.map +1 -1
  7. package/dist/components/actions/button/button.template.js +9 -0
  8. package/dist/components/actions/button/button.template.js.map +1 -1
  9. package/dist/components/actions/icon-button/icon-button.d.ts +9 -0
  10. package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
  11. package/dist/components/actions/icon-button/icon-button.js +15 -0
  12. package/dist/components/actions/icon-button/icon-button.js.map +1 -1
  13. package/dist/components/actions/icon-button/icon-button.styles.js +54 -54
  14. package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
  15. package/dist/components/actions/icon-button/icon-button.template.js +7 -1
  16. package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
  17. package/dist/components/actions/menu/menu.d.ts +19 -0
  18. package/dist/components/actions/menu/menu.d.ts.map +1 -1
  19. package/dist/components/actions/menu/menu.js +53 -2
  20. package/dist/components/actions/menu/menu.js.map +1 -1
  21. package/dist/components/actions/menu/menu.styles.d.ts.map +1 -1
  22. package/dist/components/actions/menu/menu.styles.js +50 -23
  23. package/dist/components/actions/menu/menu.styles.js.map +1 -1
  24. package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
  25. package/dist/components/actions/menu/menu.template.js +58 -33
  26. package/dist/components/actions/menu/menu.template.js.map +1 -1
  27. package/dist/components/actions/split-button/split-button.d.ts +16 -18
  28. package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
  29. package/dist/components/actions/split-button/split-button.js +28 -54
  30. package/dist/components/actions/split-button/split-button.js.map +1 -1
  31. package/dist/components/actions/split-button/split-button.template.js +1 -1
  32. package/dist/components/actions/split-button/split-button.template.js.map +1 -1
  33. package/dist/components/actions/toolbar/toolbar.d.ts +10 -0
  34. package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
  35. package/dist/components/actions/toolbar/toolbar.js +41 -2
  36. package/dist/components/actions/toolbar/toolbar.js.map +1 -1
  37. package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
  38. package/dist/components/actions/toolbar/toolbar.styles.js +16 -2
  39. package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
  40. package/dist/components/components.js +103 -102
  41. package/dist/components/content/avatar/avatar.d.ts +96 -0
  42. package/dist/components/content/avatar/avatar.d.ts.map +1 -0
  43. package/dist/components/content/avatar/avatar.js +210 -0
  44. package/dist/components/content/avatar/avatar.js.map +1 -0
  45. package/dist/components/content/avatar/avatar.styles.d.ts +2 -0
  46. package/dist/components/content/avatar/avatar.styles.d.ts.map +1 -0
  47. package/dist/components/content/avatar/avatar.styles.js +126 -0
  48. package/dist/components/content/avatar/avatar.styles.js.map +1 -0
  49. package/dist/components/content/avatar/avatar.template.d.ts +3 -0
  50. package/dist/components/content/avatar/avatar.template.d.ts.map +1 -0
  51. package/dist/components/content/avatar/avatar.template.js +36 -0
  52. package/dist/components/content/avatar/avatar.template.js.map +1 -0
  53. package/dist/components/content/byline/byline.d.ts +1 -0
  54. package/dist/components/content/byline/byline.d.ts.map +1 -1
  55. package/dist/components/content/byline/byline.js +1 -0
  56. package/dist/components/content/byline/byline.js.map +1 -1
  57. package/dist/components/content/byline/byline.styles.d.ts.map +1 -1
  58. package/dist/components/content/byline/byline.styles.js +15 -5
  59. package/dist/components/content/byline/byline.styles.js.map +1 -1
  60. package/dist/components/content/byline/byline.template.js +11 -11
  61. package/dist/components/content/byline/byline.template.js.map +1 -1
  62. package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
  63. package/dist/components/content/icon/icon-aliases.js +2 -0
  64. package/dist/components/content/icon/icon-aliases.js.map +1 -1
  65. package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
  66. package/dist/components/content/icon/icon-registry.js +1 -0
  67. package/dist/components/content/icon/icon-registry.js.map +1 -1
  68. package/dist/components/content/image/lqip-encoder-element.js +1 -1
  69. package/dist/components/content/rich-text/rich-text.d.ts +7 -0
  70. package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
  71. package/dist/components/content/rich-text/rich-text.js +10 -0
  72. package/dist/components/content/rich-text/rich-text.js.map +1 -1
  73. package/dist/components/content/tag/tag.styles.js +23 -23
  74. package/dist/components/content/token/token.styles.js +1 -1
  75. package/dist/components/{index-CXT1jMFt.js → index-Bf4pa5Bp.js} +1 -1
  76. package/dist/components/{index-DWwviobk.js → index-BfOpap4b.js} +1 -1
  77. package/dist/components/{index-Bfw_pYWB.js → index-CXC-Objp.js} +1 -1
  78. package/dist/components/{index-CKnwqp_9.js → index-CfvgUB5p.js} +1 -1
  79. package/dist/components/{index-DO7aT0MT.js → index-DB-i084x.js} +1 -1
  80. package/dist/components/{index-Bqf6o41r.js → index-DZo3DrGQ.js} +1 -1
  81. package/dist/components/{index-DjsXjoZJ.js → index-VwuVCCal.js} +1474 -927
  82. package/dist/components/index.d.ts +1 -0
  83. package/dist/components/index.d.ts.map +1 -1
  84. package/dist/components/index.js +1 -0
  85. package/dist/components/index.js.map +1 -1
  86. package/dist/components/inputs/dropdown/dropdown.styles.js +6 -6
  87. package/dist/components/inputs/segmented-control/segmented-control.styles.js +6 -6
  88. package/dist/components/inputs/text-editor/text-editor.links.d.ts +8 -0
  89. package/dist/components/inputs/text-editor/text-editor.links.d.ts.map +1 -1
  90. package/dist/components/inputs/text-editor/text-editor.links.js +48 -7
  91. package/dist/components/inputs/text-editor/text-editor.links.js.map +1 -1
  92. package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
  93. package/dist/components/inputs/text-editor/text-editor.markdown.js +11 -0
  94. package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
  95. package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
  96. package/dist/components/inputs/text-editor/text-editor.styles.js +14 -3
  97. package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
  98. package/dist/components/inputs/toggle-button/toggle-button.styles.js +6 -6
  99. package/dist/components/layout/page-footer/page-footer.d.ts +9 -1
  100. package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
  101. package/dist/components/layout/page-footer/page-footer.js +23 -1
  102. package/dist/components/layout/page-footer/page-footer.js.map +1 -1
  103. package/dist/components/layout/page-footer/page-footer.styles.d.ts.map +1 -1
  104. package/dist/components/layout/page-footer/page-footer.styles.js +9 -0
  105. package/dist/components/layout/page-footer/page-footer.styles.js.map +1 -1
  106. package/dist/components/layout/page-sections/hero/hero.styles.js +19 -19
  107. package/dist/components/layout/popover/popover.d.ts.map +1 -1
  108. package/dist/components/layout/popover/popover.js +32 -2
  109. package/dist/components/layout/popover/popover.js.map +1 -1
  110. package/dist/components/layout/sheet/sheet.d.ts +6 -0
  111. package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
  112. package/dist/components/layout/sheet/sheet.js +13 -1
  113. package/dist/components/layout/sheet/sheet.js.map +1 -1
  114. package/dist/components/layout/sheet/sheet.template.d.ts.map +1 -1
  115. package/dist/components/layout/sheet/sheet.template.js +1 -0
  116. package/dist/components/layout/sheet/sheet.template.js.map +1 -1
  117. package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.js +2 -2
  118. package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js +6 -6
  119. package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +11 -11
  120. package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +11 -11
  121. package/dist/components/lists-and-tables/list-item/list-item.styles.d.ts.map +1 -1
  122. package/dist/components/lists-and-tables/list-item/list-item.styles.js +14 -7
  123. package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
  124. package/dist/components/lists-and-tables/table/table.styles.d.ts.map +1 -1
  125. package/dist/components/lists-and-tables/table/table.styles.js +2 -1
  126. package/dist/components/lists-and-tables/table/table.styles.js.map +1 -1
  127. package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js +14 -14
  128. package/dist/components/navigation/pagination/pagination.styles.js +9 -9
  129. package/dist/components/navigation/tab-bar/tab-bar.styles.js +6 -6
  130. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +14 -2
  131. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts.map +1 -1
  132. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +14 -2
  133. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
  134. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.d.ts.map +1 -1
  135. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js +3 -2
  136. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js.map +1 -1
  137. package/dist/components/status-and-feedback/badge/badge.styles.js +23 -23
  138. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts +3 -2
  139. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts.map +1 -1
  140. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +2 -1
  141. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js.map +1 -1
  142. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.d.ts.map +1 -1
  143. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js +8 -1
  144. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js.map +1 -1
  145. package/dist/css/rich-text.css +19 -0
  146. package/dist/css/settings.css +253 -246
  147. package/dist/utilities/popup-anchor-controller.d.ts +63 -0
  148. package/dist/utilities/popup-anchor-controller.d.ts.map +1 -0
  149. package/dist/utilities/popup-anchor-controller.js +63 -0
  150. package/dist/utilities/popup-anchor-controller.js.map +1 -0
  151. package/package.json +5 -1
@@ -1,106 +1,107 @@
1
- import { o, q, r, u, v, w, x, y, z, A, B, D, F, G, H, J, K, M, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6 } from "./index-DjsXjoZJ.js";
1
+ import { o, q, r, u, v, w, x, y, z, A, B, D, F, G, H, J, K, M, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7 } from "./index-VwuVCCal.js";
2
2
  export {
3
3
  o as NLDDActivityIndicator,
4
4
  q as NLDDAppView,
5
- r as NLDDBadge,
6
- u as NLDDBanner,
7
- v as NLDDBarSplitView,
8
- w as NLDDBlockquote,
9
- x as NLDDBox,
10
- y as NLDDBreadcrumbs,
11
- z as NLDDBreadcrumbsItem,
12
- A as NLDDButton,
13
- B as NLDDButtonBar,
14
- D as NLDDButtonGroup,
15
- F as NLDDByline,
16
- G as NLDDCard,
17
- H as NLDDCell,
18
- J as NLDDCheckbox,
19
- K as NLDDCheckboxField,
20
- M as NLDDCodeEditor,
21
- O as NLDDCodeViewer,
22
- P as NLDDCollection,
23
- Q as NLDDComboBox,
24
- R as NLDDContainer,
25
- S as NLDDDescriptionCell,
26
- T as NLDDDivider,
27
- U as NLDDDocumentTabBar,
28
- V as NLDDDragHandleCell,
29
- W as NLDDDropdown,
30
- X as NLDDForm,
31
- Y as NLDDFormActions,
32
- Z as NLDDFormField,
33
- _ as NLDDFormSection,
34
- $ as NLDDFullBleedSection,
35
- a0 as NLDDHero,
36
- a1 as NLDDIcon,
37
- a2 as NLDDIconButton,
38
- a3 as NLDDIconCell,
39
- a4 as NLDDImage,
40
- a5 as NLDDInlineDialog,
41
- a6 as NLDDJustInTimeEducation,
42
- a7 as NLDDKeyboardShortcut,
43
- a8 as NLDDLink,
44
- a9 as NLDDList,
45
- aa as NLDDListItem,
46
- ab as NLDDMenu,
47
- ac as NLDDMenuBar,
48
- ad as NLDDMenuBarItem,
49
- ae as NLDDModalDialog,
50
- af as NLDDMultiLineTextField,
51
- ag as NLDDNavigationSplitView,
52
- ah as NLDDNumberField,
53
- ai as NLDDOneHalfOneHalfSection,
54
- aj as NLDDOneThirdTwoThirdsSection,
55
- ak as NLDDPage,
56
- al as NLDDPageFooter,
57
- am as NLDDPageFooterLegalBar,
58
- an as NLDDPageFooterLegalBarItem,
59
- ao as NLDDPagination,
60
- ap as NLDDPasswordField,
61
- aq as NLDDPopover,
62
- ar as NLDDProgressBar,
63
- as as NLDDProgressBarSegmentIndicator,
64
- at as NLDDProgressCircle,
65
- au as NLDDProgressCircleSegmentIndicator,
66
- av as NLDDRadioButton,
67
- aw as NLDDRadioButtonField,
68
- ax as NLDDRadioButtonGroup,
69
- ay as NLDDRichText,
70
- az as NLDDSearchField,
71
- aA as NLDDSegmentedControl,
72
- aB as NLDDSheet,
73
- aC as NLDDSideBySideSplitView,
74
- aD as NLDDSidebarSection,
75
- aE as NLDDSimpleSection,
76
- aF as NLDDSkipLink,
77
- aG as NLDDSpacer,
78
- aH as NLDDSpacerCell,
79
- aI as NLDDSplitButton,
80
- aJ as NLDDSplitViewPane,
81
- aK as NLDDStackedSplitView,
82
- aL as NLDDStatusBar,
83
- aM as NLDDStepper,
84
- aN as NLDDSwitch,
85
- aO as NLDDSwitchField,
86
- aP as NLDDTabBar,
87
- aQ as NLDDTable,
88
- aR as NLDDTableRow,
89
- aS as NLDDTag,
90
- aT as NLDDTextCell,
91
- aU as NLDDTextEditor,
92
- aV as NLDDTextField,
93
- aW as NLDDTimelineTrackCell,
94
- aX as NLDDTitle,
95
- aY as NLDDTitleCell,
96
- aZ as NLDDToggleButton,
97
- a_ as NLDDToggleButtonGroup,
98
- a$ as NLDDToken,
99
- b0 as NLDDTokenField,
100
- b1 as NLDDToolbar,
101
- b2 as NLDDTooltip,
102
- b3 as NLDDTopNavigationBar,
103
- b4 as NLDDTopTitleBar,
104
- b5 as NLDDTwoThirdsOneThirdSection,
105
- b6 as NLDDWindow
5
+ r as NLDDAvatar,
6
+ u as NLDDBadge,
7
+ v as NLDDBanner,
8
+ w as NLDDBarSplitView,
9
+ x as NLDDBlockquote,
10
+ y as NLDDBox,
11
+ z as NLDDBreadcrumbs,
12
+ A as NLDDBreadcrumbsItem,
13
+ B as NLDDButton,
14
+ D as NLDDButtonBar,
15
+ F as NLDDButtonGroup,
16
+ G as NLDDByline,
17
+ H as NLDDCard,
18
+ J as NLDDCell,
19
+ K as NLDDCheckbox,
20
+ M as NLDDCheckboxField,
21
+ O as NLDDCodeEditor,
22
+ P as NLDDCodeViewer,
23
+ Q as NLDDCollection,
24
+ R as NLDDComboBox,
25
+ S as NLDDContainer,
26
+ T as NLDDDescriptionCell,
27
+ U as NLDDDivider,
28
+ V as NLDDDocumentTabBar,
29
+ W as NLDDDragHandleCell,
30
+ X as NLDDDropdown,
31
+ Y as NLDDForm,
32
+ Z as NLDDFormActions,
33
+ _ as NLDDFormField,
34
+ $ as NLDDFormSection,
35
+ a0 as NLDDFullBleedSection,
36
+ a1 as NLDDHero,
37
+ a2 as NLDDIcon,
38
+ a3 as NLDDIconButton,
39
+ a4 as NLDDIconCell,
40
+ a5 as NLDDImage,
41
+ a6 as NLDDInlineDialog,
42
+ a7 as NLDDJustInTimeEducation,
43
+ a8 as NLDDKeyboardShortcut,
44
+ a9 as NLDDLink,
45
+ aa as NLDDList,
46
+ ab as NLDDListItem,
47
+ ac as NLDDMenu,
48
+ ad as NLDDMenuBar,
49
+ ae as NLDDMenuBarItem,
50
+ af as NLDDModalDialog,
51
+ ag as NLDDMultiLineTextField,
52
+ ah as NLDDNavigationSplitView,
53
+ ai as NLDDNumberField,
54
+ aj as NLDDOneHalfOneHalfSection,
55
+ ak as NLDDOneThirdTwoThirdsSection,
56
+ al as NLDDPage,
57
+ am as NLDDPageFooter,
58
+ an as NLDDPageFooterLegalBar,
59
+ ao as NLDDPageFooterLegalBarItem,
60
+ ap as NLDDPagination,
61
+ aq as NLDDPasswordField,
62
+ ar as NLDDPopover,
63
+ as as NLDDProgressBar,
64
+ at as NLDDProgressBarSegmentIndicator,
65
+ au as NLDDProgressCircle,
66
+ av as NLDDProgressCircleSegmentIndicator,
67
+ aw as NLDDRadioButton,
68
+ ax as NLDDRadioButtonField,
69
+ ay as NLDDRadioButtonGroup,
70
+ az as NLDDRichText,
71
+ aA as NLDDSearchField,
72
+ aB as NLDDSegmentedControl,
73
+ aC as NLDDSheet,
74
+ aD as NLDDSideBySideSplitView,
75
+ aE as NLDDSidebarSection,
76
+ aF as NLDDSimpleSection,
77
+ aG as NLDDSkipLink,
78
+ aH as NLDDSpacer,
79
+ aI as NLDDSpacerCell,
80
+ aJ as NLDDSplitButton,
81
+ aK as NLDDSplitViewPane,
82
+ aL as NLDDStackedSplitView,
83
+ aM as NLDDStatusBar,
84
+ aN as NLDDStepper,
85
+ aO as NLDDSwitch,
86
+ aP as NLDDSwitchField,
87
+ aQ as NLDDTabBar,
88
+ aR as NLDDTable,
89
+ aS as NLDDTableRow,
90
+ aT as NLDDTag,
91
+ aU as NLDDTextCell,
92
+ aV as NLDDTextEditor,
93
+ aW as NLDDTextField,
94
+ aX as NLDDTimelineTrackCell,
95
+ aY as NLDDTitle,
96
+ aZ as NLDDTitleCell,
97
+ a_ as NLDDToggleButton,
98
+ a$ as NLDDToggleButtonGroup,
99
+ b0 as NLDDToken,
100
+ b1 as NLDDTokenField,
101
+ b2 as NLDDToolbar,
102
+ b3 as NLDDTooltip,
103
+ b4 as NLDDTopNavigationBar,
104
+ b5 as NLDDTopTitleBar,
105
+ b6 as NLDDTwoThirdsOneThirdSection,
106
+ b7 as NLDDWindow
106
107
  };
@@ -0,0 +1,96 @@
1
+ /**
2
+ * NLDD Design System Avatar Component (Lit + TypeScript)
3
+ *
4
+ * Toont één persoon of organisatie als een compacte, ronde (persoon) of
5
+ * afgeronde (organisatie) representatie. De inhoud volgt een vaste
6
+ * terugvalketen: een afbeelding wanneer `src` laadt, anders de initialen
7
+ * (uit `initials` of afgeleid uit `name`), en anders een terugval-icoon.
8
+ *
9
+ * `type` bepaalt zowel de vorm als het terugval-icoon: `person` geeft een
10
+ * cirkel met een person-icoon, `organization` een afgeronde vierkant met een
11
+ * building-icoon. De vorm hoort dus bij de betekenis en is niet los
12
+ * instelbaar. Overschrijf het terugval-icoon desgewenst met `icon`.
13
+ *
14
+ * Zonder `size` schaalt de avatar mee met zijn container (net als `nldd-icon`);
15
+ * een vaste maat (dezelfde spacer-uitgelijnde schaal, 16 tot en met 96) is de
16
+ * uitzondering. De initialen en het icoon schalen mee. Brede initialen (WW, MMM)
17
+ * worden automatisch teruggeschaald zodat ze binnen de schijf blijven.
18
+ *
19
+ * Toegankelijkheid: het host-element draagt de betekenis. Met een `name`
20
+ * (en zonder `decorative`) krijgt het `role="img"` met de naam als label.
21
+ * Staat de naam al als tekst ernaast (bijvoorbeeld in een byline), zet dan
22
+ * `decorative` zodat de avatar voor hulpsoftware verborgen blijft. Een dode
23
+ * `src` valt automatisch terug op de initialen of het icoon, nooit op een
24
+ * gebroken-afbeelding-icoon.
25
+ *
26
+ * @element nldd-avatar
27
+ *
28
+ * @attr {string} src - Afbeeldingsbron; valt bij een laadfout terug op initialen/icoon
29
+ * @attr {string} srcset - Responsive source set voor de afbeelding (het component zet zelf `sizes`)
30
+ * @attr {string} name - Naam van de persoon/organisatie; levert de afgeleide initialen en het toegankelijke label
31
+ * @attr {string} initials - Expliciete initialen, max 3 tekens (overschrijft de afleiding uit `name`; ook voor organisatie-acroniemen)
32
+ * @attr {string} type - `person` (cirkel, person-icoon) of `organization` (afgerond, building-icoon); standaard `person`
33
+ * @attr {string} icon - Overschrijft het type-afhankelijke terugval-icoon
34
+ * @attr {string} size - Vaste maat in px (spacer-uitgelijnd: 16, 20, 24, 28, 32, 40, 44, 48, 56, 64, 80, 96). Leeg = schaal mee met de container (net als nldd-icon); de initialen en het icoon schalen mee
35
+ * @attr {string} color - `default` (neutrale vulling) of `inherit` (vulling in de content-kleur: de `--context-content-color`-channel, of `currentColor` als die niet gezet is; tekst in de contrastkleur, zodat de avatar een icoon in bijvoorbeeld een knop kan vervangen); standaard `default`
36
+ * @attr {boolean} icon-aligned - Krimpt de zichtbare schijf naar 5/6 van de host, gecentreerd, zodat de avatar optisch uitlijnt met een icoon op hetzelfde grid (een icoon-glyph heeft ingebouwde marge)
37
+ * @attr {boolean} decorative - Verbergt de avatar voor hulpsoftware (gebruik wanneer de naam er al als tekst naast staat)
38
+ *
39
+ * @example
40
+ * ```html
41
+ * <nldd-avatar name="Bart van de Biezen"></nldd-avatar>
42
+ * <nldd-avatar name="Jan Jansen" src="/avatars/jan.jpg" size="48"></nldd-avatar>
43
+ * <nldd-avatar type="organization" name="Kamer van Koophandel" initials="KvK"></nldd-avatar>
44
+ * <nldd-avatar name="Bart van de Biezen" color="inherit"></nldd-avatar>
45
+ * ```
46
+ */
47
+ import { LitElement, type PropertyValues } from 'lit';
48
+ import '../icon/icon.js';
49
+ export type AvatarType = 'person' | 'organization';
50
+ export type AvatarColor = 'default' | 'inherit';
51
+ /** Empty = scale to the container (like nldd-icon); the rest pin a fixed px size. */
52
+ export type AvatarSize = '' | '16' | '20' | '24' | '28' | '32' | '40' | '44' | '48' | '56' | '64' | '80' | '96';
53
+ export declare class NLDDAvatar extends LitElement {
54
+ static styles: import("lit").CSSResult;
55
+ src: string;
56
+ srcset: string;
57
+ name: string;
58
+ initials: string;
59
+ icon: string;
60
+ type: AvatarType;
61
+ color: AvatarColor;
62
+ size: AvatarSize;
63
+ iconAligned: boolean;
64
+ decorative: boolean;
65
+ /** Set when the image errors, so the template falls through to the next
66
+ * content step. Not private: the template module reads it. */
67
+ _imageFailed: boolean;
68
+ /** Initials shown when there is no image: an explicit `initials` wins,
69
+ * otherwise the first letter of the first and last word of `name`. */
70
+ get resolvedInitials(): string;
71
+ /** Fallback icon when there is neither image nor initials. */
72
+ get resolvedIcon(): string;
73
+ _onImageError: () => void;
74
+ /** Re-measures the initials fit when the disc lays out or resizes; covers the
75
+ * case where the avatar is only sized after first render (e.g. filling a
76
+ * container that appears later). Content changes are handled in updated(). */
77
+ private _resizeObserver;
78
+ willUpdate(changed: PropertyValues<this>): void;
79
+ firstUpdated(): void;
80
+ connectedCallback(): void;
81
+ disconnectedCallback(): void;
82
+ updated(changed: PropertyValues<this>): void;
83
+ /** Shrink wide initials so they always fit the disc. The fit factor is the
84
+ * disc's usable width over the initials' natural width (scrollWidth ignores
85
+ * the applied transform, so the measurement stays stable); capped at 1 so
86
+ * narrow initials are never enlarged. Applied via --_initials-fit (a
87
+ * transform scale), so no reflow and it stays measurable. */
88
+ private _fitInitials;
89
+ render(): import("lit-html").TemplateResult<1>;
90
+ }
91
+ declare global {
92
+ interface HTMLElementTagNameMap {
93
+ 'nldd-avatar': NLDDAvatar;
94
+ }
95
+ }
96
+ //# sourceMappingURL=avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar/avatar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAKtD,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,cAAc,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAOhD,qFAAqF;AACrF,MAAM,MAAM,UAAU,GACrB,EAAE,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAExF,qBACa,UAAW,SAAQ,UAAU;IACzC,OAAgB,MAAM,0BAAgB;IAGtC,GAAG,SAAM;IAGT,MAAM,SAAM;IAGZ,IAAI,SAAM;IAGV,QAAQ,SAAM;IAGd,IAAI,SAAM;IAGV,IAAI,EAAE,UAAU,CAAY;IAG5B,KAAK,EAAE,WAAW,CAAa;IAG/B,IAAI,EAAE,UAAU,CAAM;IAGtB,WAAW,UAAS;IAGpB,UAAU,UAAS;IAEnB;mEAC+D;IAE/D,YAAY,UAAS;IAErB;2EACuE;IACvE,IAAI,gBAAgB,IAAI,MAAM,CAO7B;IAED,8DAA8D;IAC9D,IAAI,YAAY,IAAI,MAAM,CAGzB;IAED,aAAa,QAAO,IAAI,CAEtB;IAEF;;mFAE+E;IAC/E,OAAO,CAAC,eAAe,CAAiD;IAE/D,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAM/C,YAAY,IAAI,IAAI;IAKpB,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAK5B,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IA2BrD;;;;kEAI8D;IAC9D,OAAO,CAAC,YAAY;IAaX,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;CACD"}
@@ -0,0 +1,210 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ /**
8
+ * NLDD Design System Avatar Component (Lit + TypeScript)
9
+ *
10
+ * Toont één persoon of organisatie als een compacte, ronde (persoon) of
11
+ * afgeronde (organisatie) representatie. De inhoud volgt een vaste
12
+ * terugvalketen: een afbeelding wanneer `src` laadt, anders de initialen
13
+ * (uit `initials` of afgeleid uit `name`), en anders een terugval-icoon.
14
+ *
15
+ * `type` bepaalt zowel de vorm als het terugval-icoon: `person` geeft een
16
+ * cirkel met een person-icoon, `organization` een afgeronde vierkant met een
17
+ * building-icoon. De vorm hoort dus bij de betekenis en is niet los
18
+ * instelbaar. Overschrijf het terugval-icoon desgewenst met `icon`.
19
+ *
20
+ * Zonder `size` schaalt de avatar mee met zijn container (net als `nldd-icon`);
21
+ * een vaste maat (dezelfde spacer-uitgelijnde schaal, 16 tot en met 96) is de
22
+ * uitzondering. De initialen en het icoon schalen mee. Brede initialen (WW, MMM)
23
+ * worden automatisch teruggeschaald zodat ze binnen de schijf blijven.
24
+ *
25
+ * Toegankelijkheid: het host-element draagt de betekenis. Met een `name`
26
+ * (en zonder `decorative`) krijgt het `role="img"` met de naam als label.
27
+ * Staat de naam al als tekst ernaast (bijvoorbeeld in een byline), zet dan
28
+ * `decorative` zodat de avatar voor hulpsoftware verborgen blijft. Een dode
29
+ * `src` valt automatisch terug op de initialen of het icoon, nooit op een
30
+ * gebroken-afbeelding-icoon.
31
+ *
32
+ * @element nldd-avatar
33
+ *
34
+ * @attr {string} src - Afbeeldingsbron; valt bij een laadfout terug op initialen/icoon
35
+ * @attr {string} srcset - Responsive source set voor de afbeelding (het component zet zelf `sizes`)
36
+ * @attr {string} name - Naam van de persoon/organisatie; levert de afgeleide initialen en het toegankelijke label
37
+ * @attr {string} initials - Expliciete initialen, max 3 tekens (overschrijft de afleiding uit `name`; ook voor organisatie-acroniemen)
38
+ * @attr {string} type - `person` (cirkel, person-icoon) of `organization` (afgerond, building-icoon); standaard `person`
39
+ * @attr {string} icon - Overschrijft het type-afhankelijke terugval-icoon
40
+ * @attr {string} size - Vaste maat in px (spacer-uitgelijnd: 16, 20, 24, 28, 32, 40, 44, 48, 56, 64, 80, 96). Leeg = schaal mee met de container (net als nldd-icon); de initialen en het icoon schalen mee
41
+ * @attr {string} color - `default` (neutrale vulling) of `inherit` (vulling in de content-kleur: de `--context-content-color`-channel, of `currentColor` als die niet gezet is; tekst in de contrastkleur, zodat de avatar een icoon in bijvoorbeeld een knop kan vervangen); standaard `default`
42
+ * @attr {boolean} icon-aligned - Krimpt de zichtbare schijf naar 5/6 van de host, gecentreerd, zodat de avatar optisch uitlijnt met een icoon op hetzelfde grid (een icoon-glyph heeft ingebouwde marge)
43
+ * @attr {boolean} decorative - Verbergt de avatar voor hulpsoftware (gebruik wanneer de naam er al als tekst naast staat)
44
+ *
45
+ * @example
46
+ * ```html
47
+ * <nldd-avatar name="Bart van de Biezen"></nldd-avatar>
48
+ * <nldd-avatar name="Jan Jansen" src="/avatars/jan.jpg" size="48"></nldd-avatar>
49
+ * <nldd-avatar type="organization" name="Kamer van Koophandel" initials="KvK"></nldd-avatar>
50
+ * <nldd-avatar name="Bart van de Biezen" color="inherit"></nldd-avatar>
51
+ * ```
52
+ */
53
+ import { LitElement } from 'lit';
54
+ import { customElement, property, state } from 'lit/decorators.js';
55
+ import { reflectNonDefault } from '../../../utilities/reflect-non-default.js';
56
+ import { avatarStyles } from './avatar.styles.js';
57
+ import { avatarTemplate } from './avatar.template.js';
58
+ import '../icon/icon.js';
59
+ /** Fraction of the disc width the initials may occupy before they are scaled to
60
+ * fit. Leaves margin inside the circle so wide glyphs stay clear of the edge
61
+ * (the circle narrows above/below the centre, so caps need room). */
62
+ const INITIALS_FIT_RATIO = 0.75;
63
+ let NLDDAvatar = class NLDDAvatar extends LitElement {
64
+ constructor() {
65
+ super(...arguments);
66
+ this.src = '';
67
+ this.srcset = '';
68
+ this.name = '';
69
+ this.initials = '';
70
+ this.icon = '';
71
+ this.type = 'person';
72
+ this.color = 'default';
73
+ this.size = '';
74
+ this.iconAligned = false;
75
+ this.decorative = false;
76
+ /** Set when the image errors, so the template falls through to the next
77
+ * content step. Not private: the template module reads it. */
78
+ this._imageFailed = false;
79
+ this._onImageError = () => {
80
+ this._imageFailed = true;
81
+ };
82
+ /** Re-measures the initials fit when the disc lays out or resizes; covers the
83
+ * case where the avatar is only sized after first render (e.g. filling a
84
+ * container that appears later). Content changes are handled in updated(). */
85
+ this._resizeObserver = new ResizeObserver(() => this._fitInitials());
86
+ }
87
+ /** Initials shown when there is no image: an explicit `initials` wins,
88
+ * otherwise the first letter of the first and last word of `name`. */
89
+ get resolvedInitials() {
90
+ if (this.initials)
91
+ return this.initials.slice(0, 3);
92
+ const words = this.name.trim().split(/\s+/).filter(Boolean);
93
+ if (words.length === 0)
94
+ return '';
95
+ const first = words[0].charAt(0);
96
+ const last = words.length > 1 ? words[words.length - 1].charAt(0) : '';
97
+ return (first + last).toUpperCase();
98
+ }
99
+ /** Fallback icon when there is neither image nor initials. */
100
+ get resolvedIcon() {
101
+ if (this.icon)
102
+ return this.icon;
103
+ return this.type === 'organization' ? 'building' : 'person';
104
+ }
105
+ willUpdate(changed) {
106
+ // Either source changing offers a fresh candidate, so give the image
107
+ // another chance rather than staying on the fallback forever.
108
+ if (changed.has('src') || changed.has('srcset'))
109
+ this._imageFailed = false;
110
+ }
111
+ firstUpdated() {
112
+ const disc = this.shadowRoot?.querySelector('.avatar');
113
+ if (disc)
114
+ this._resizeObserver.observe(disc);
115
+ }
116
+ connectedCallback() {
117
+ super.connectedCallback();
118
+ const disc = this.shadowRoot?.querySelector('.avatar');
119
+ if (this.hasUpdated && disc)
120
+ this._resizeObserver.observe(disc);
121
+ }
122
+ disconnectedCallback() {
123
+ super.disconnectedCallback();
124
+ this._resizeObserver.disconnect();
125
+ }
126
+ updated(changed) {
127
+ // Trim to match resolvedInitials: a whitespace-only name yields no
128
+ // initials (so the icon shows), and must not claim role="img" with a
129
+ // blank label either — that reads as an unnamed image.
130
+ const labelled = !this.decorative && this.name.trim() !== '';
131
+ if (labelled) {
132
+ this.setAttribute('role', 'img');
133
+ this.setAttribute('aria-label', this.name);
134
+ this.removeAttribute('aria-hidden');
135
+ }
136
+ else {
137
+ this.setAttribute('aria-hidden', 'true');
138
+ this.removeAttribute('role');
139
+ this.removeAttribute('aria-label');
140
+ }
141
+ // The disc size doesn't change when only its content does, so the
142
+ // ResizeObserver won't fire — re-measure here on every change that can
143
+ // swap the initials in or alter their text. src/_imageFailed matter too:
144
+ // a dead image falls back to initials that were never measured.
145
+ if (changed.has('name') || changed.has('initials')
146
+ || changed.has('src') || changed.has('srcset') || changed.has('_imageFailed')) {
147
+ this._fitInitials();
148
+ }
149
+ }
150
+ /** Shrink wide initials so they always fit the disc. The fit factor is the
151
+ * disc's usable width over the initials' natural width (scrollWidth ignores
152
+ * the applied transform, so the measurement stays stable); capped at 1 so
153
+ * narrow initials are never enlarged. Applied via --_initials-fit (a
154
+ * transform scale), so no reflow and it stays measurable. */
155
+ _fitInitials() {
156
+ const initials = this.shadowRoot?.querySelector('.avatar__initials');
157
+ const disc = this.shadowRoot?.querySelector('.avatar');
158
+ if (!initials || !disc) {
159
+ this.style.removeProperty('--_initials-fit');
160
+ return;
161
+ }
162
+ const available = disc.clientWidth * INITIALS_FIT_RATIO;
163
+ const actual = initials.scrollWidth;
164
+ if (available <= 0 || actual <= 0)
165
+ return; // not laid out yet — leave as is
166
+ this.style.setProperty('--_initials-fit', String(Math.min(1, available / actual)));
167
+ }
168
+ render() {
169
+ return avatarTemplate(this);
170
+ }
171
+ };
172
+ NLDDAvatar.styles = avatarStyles;
173
+ __decorate([
174
+ property({ type: String })
175
+ ], NLDDAvatar.prototype, "src", void 0);
176
+ __decorate([
177
+ property({ type: String })
178
+ ], NLDDAvatar.prototype, "srcset", void 0);
179
+ __decorate([
180
+ property({ type: String })
181
+ ], NLDDAvatar.prototype, "name", void 0);
182
+ __decorate([
183
+ property({ type: String })
184
+ ], NLDDAvatar.prototype, "initials", void 0);
185
+ __decorate([
186
+ property({ type: String })
187
+ ], NLDDAvatar.prototype, "icon", void 0);
188
+ __decorate([
189
+ property({ reflect: true, converter: reflectNonDefault('person') })
190
+ ], NLDDAvatar.prototype, "type", void 0);
191
+ __decorate([
192
+ property({ reflect: true, converter: reflectNonDefault('default') })
193
+ ], NLDDAvatar.prototype, "color", void 0);
194
+ __decorate([
195
+ property({ reflect: true, converter: reflectNonDefault('') })
196
+ ], NLDDAvatar.prototype, "size", void 0);
197
+ __decorate([
198
+ property({ type: Boolean, reflect: true, attribute: 'icon-aligned' })
199
+ ], NLDDAvatar.prototype, "iconAligned", void 0);
200
+ __decorate([
201
+ property({ type: Boolean, reflect: true })
202
+ ], NLDDAvatar.prototype, "decorative", void 0);
203
+ __decorate([
204
+ state()
205
+ ], NLDDAvatar.prototype, "_imageFailed", void 0);
206
+ NLDDAvatar = __decorate([
207
+ customElement('nldd-avatar')
208
+ ], NLDDAvatar);
209
+ export { NLDDAvatar };
210
+ //# sourceMappingURL=avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../../src/components/content/avatar/avatar.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,O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QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACxB;AAKnB;IADC,KAAK,EAAE;gDACa;AApCT,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAsItB"}
@@ -0,0 +1,2 @@
1
+ export declare const avatarStyles: import("lit").CSSResult;
2
+ //# sourceMappingURL=avatar.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/content/avatar/avatar.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,yBA0HxB,CAAC"}
@@ -0,0 +1,126 @@
1
+ import { css } from 'lit';
2
+ import { inheritedTextReset } from '../../../assets/styles/style-resets.js';
3
+ export const avatarStyles = css `
4
+ :host {
5
+ box-sizing: border-box;
6
+ }
7
+
8
+
9
+ /* # Host */
10
+
11
+ :host {
12
+ --_size: 100%;
13
+ --_corner-radius: var(--components-avatar-corner-radius);
14
+ --_background-color: var(--components-avatar-background-color);
15
+ --_content-color: var(--components-avatar-content-color);
16
+ --_icon-scale: 0.6;
17
+ --_initials-scale: 0.56;
18
+ --_initials-font-weight: 600;
19
+ --_initials-fit: 1;
20
+ --_shape-scale: 1;
21
+
22
+ ${inheritedTextReset}
23
+ display: inline-flex;
24
+ width: var(--_size);
25
+ aspect-ratio: 1;
26
+ flex-shrink: 0;
27
+ align-items: center;
28
+ justify-content: center;
29
+ }
30
+
31
+ :host([hidden]) {
32
+ display: none;
33
+ }
34
+
35
+ :host([type="organization"]) {
36
+ --_corner-radius: var(--components-avatar-organization-corner-radius);
37
+ }
38
+
39
+ /* Fill tracks the shared content-colour channel (set by list-item / table /
40
+ menu), falling back to currentColor for buttons / standalone — mirrors
41
+ nldd-activity-indicator. The fill (not the text) colour must resolve here,
42
+ so .avatar keeps its inherited colour and the contrast text lives on the
43
+ child elements. */
44
+ :host([color="inherit"]) {
45
+ --_background-color: var(--context-content-color, currentColor);
46
+ --_content-color: var(--semantics-content-contrast-color);
47
+ }
48
+
49
+ /* Shrink the visible disc to 5/6 of the host (centred), so the avatar lines
50
+ up optically with an icon on the same grid (an icon glyph has built-in
51
+ padding). The host keeps the grid cell size. */
52
+ :host([icon-aligned]) {
53
+ --_shape-scale: calc(5 / 6);
54
+ }
55
+
56
+
57
+ /* # Size — spacer-aligned, mirrors nldd-icon */
58
+
59
+ :host([size="16"]) { --_size: var(--primitives-space-16); }
60
+ :host([size="20"]) { --_size: var(--primitives-space-20); }
61
+ :host([size="24"]) { --_size: var(--primitives-space-24); }
62
+ :host([size="28"]) { --_size: var(--primitives-space-28); }
63
+ :host([size="32"]) { --_size: var(--primitives-space-32); }
64
+ :host([size="40"]) { --_size: var(--primitives-space-40); }
65
+ :host([size="44"]) { --_size: var(--primitives-space-44); }
66
+ :host([size="48"]) { --_size: var(--primitives-space-48); }
67
+ :host([size="56"]) { --_size: var(--primitives-space-56); }
68
+ :host([size="64"]) { --_size: var(--primitives-space-64); }
69
+ :host([size="80"]) { --_size: var(--primitives-space-80); }
70
+ :host([size="96"]) { --_size: var(--primitives-space-96); }
71
+
72
+
73
+ /* # Avatar */
74
+
75
+ /* container-type: inline-size lets the initials and icon scale (cqi) with the
76
+ avatar's rendered width, so a fixed size and a filled (100%) size both work.
77
+ inline-size (not size) leaves the block axis free, so aspect-ratio can drive
78
+ the height without the box collapsing in flex/grid. color stays inherited
79
+ here so --_background-color's currentColor (color="inherit") resolves to the
80
+ surrounding colour, not the content colour. */
81
+ .avatar {
82
+ container-type: inline-size;
83
+ display: flex;
84
+ width: calc(100% * var(--_shape-scale));
85
+ height: calc(100% * var(--_shape-scale));
86
+ align-items: center;
87
+ justify-content: center;
88
+ overflow: hidden;
89
+ border-radius: var(--_corner-radius);
90
+ background-color: var(--_background-color);
91
+ }
92
+
93
+
94
+ /* # Content */
95
+
96
+ .avatar__image {
97
+ display: block;
98
+ width: 100%;
99
+ height: 100%;
100
+ object-fit: cover;
101
+ }
102
+
103
+ .avatar__initials {
104
+ font-family: var(--primitives-font-family-body);
105
+ font-weight: var(--_initials-font-weight);
106
+ font-size: calc(var(--_initials-scale) * 100cqi);
107
+ line-height: 1;
108
+ color: var(--_content-color);
109
+ /* fit-initials shrinks wide initials via this factor (measured in JS);
110
+ transform (not font-size) so scrollWidth stays the natural width. */
111
+ transform: scale(var(--_initials-fit));
112
+ user-select: none;
113
+ }
114
+
115
+ .avatar__icon {
116
+ width: calc(var(--_icon-scale) * 100cqi);
117
+ color: var(--_content-color);
118
+ }
119
+
120
+ @media (forced-colors: active) {
121
+ .avatar {
122
+ border: var(--primitives-border-width-regular) solid CanvasText;
123
+ }
124
+ }
125
+ `;
126
+ //# sourceMappingURL=avatar.styles.js.map