@nldd/design-system 0.15.0 → 0.16.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.
Files changed (190) hide show
  1. package/custom-elements.json +1201 -172
  2. package/dist/components/actions/button/button.d.ts +2 -17
  3. package/dist/components/actions/button/button.d.ts.map +1 -1
  4. package/dist/components/actions/button/button.js +10 -35
  5. package/dist/components/actions/button/button.js.map +1 -1
  6. package/dist/components/actions/icon-button/icon-button.d.ts +2 -1
  7. package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
  8. package/dist/components/actions/icon-button/icon-button.js +8 -2
  9. package/dist/components/actions/icon-button/icon-button.js.map +1 -1
  10. package/dist/components/actions/menu/menu.d.ts +9 -1
  11. package/dist/components/actions/menu/menu.d.ts.map +1 -1
  12. package/dist/components/actions/menu/menu.js +11 -1
  13. package/dist/components/actions/menu/menu.js.map +1 -1
  14. package/dist/components/actions/split-button/split-button.d.ts +63 -34
  15. package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
  16. package/dist/components/actions/split-button/split-button.i18n.d.ts +1 -1
  17. package/dist/components/actions/split-button/split-button.i18n.js +1 -1
  18. package/dist/components/actions/split-button/split-button.i18n.js.map +1 -1
  19. package/dist/components/actions/split-button/split-button.js +116 -76
  20. package/dist/components/actions/split-button/split-button.js.map +1 -1
  21. package/dist/components/actions/split-button/split-button.styles.d.ts.map +1 -1
  22. package/dist/components/actions/split-button/split-button.styles.js +4 -0
  23. package/dist/components/actions/split-button/split-button.styles.js.map +1 -1
  24. package/dist/components/actions/split-button/split-button.template.d.ts +2 -1
  25. package/dist/components/actions/split-button/split-button.template.d.ts.map +1 -1
  26. package/dist/components/actions/split-button/split-button.template.js +25 -20
  27. package/dist/components/actions/split-button/split-button.template.js.map +1 -1
  28. package/dist/components/actions/toolbar/toolbar.story-sync.d.ts +13 -0
  29. package/dist/components/actions/toolbar/toolbar.story-sync.d.ts.map +1 -0
  30. package/dist/components/actions/toolbar/toolbar.story-sync.js +89 -0
  31. package/dist/components/actions/toolbar/toolbar.story-sync.js.map +1 -0
  32. package/dist/components/components.js +1214 -276
  33. package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
  34. package/dist/components/content/code-viewer/code-viewer.styles.js +5 -2
  35. package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
  36. package/dist/components/content/code-viewer/code-viewer.template.js +1 -1
  37. package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
  38. package/dist/components/content/icon/icon-aliases.js +2 -0
  39. package/dist/components/content/icon/icon-aliases.js.map +1 -1
  40. package/dist/components/content/tooltip/tooltip.d.ts +13 -1
  41. package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
  42. package/dist/components/content/tooltip/tooltip.js +49 -5
  43. package/dist/components/content/tooltip/tooltip.js.map +1 -1
  44. package/dist/components/content/tooltip/tooltip.styles.d.ts.map +1 -1
  45. package/dist/components/content/tooltip/tooltip.styles.js +9 -0
  46. package/dist/components/content/tooltip/tooltip.styles.js.map +1 -1
  47. package/dist/components/{decorate-CzRe1eif.js → decorate-pEFCObfp.js} +1 -1
  48. package/dist/components/{defer-focus-DIPAUUJa.js → defer-focus-CkNrCf_g.js} +2 -2
  49. package/dist/components/{dev-checks-tdnaA2UV.js → dev-checks--aiYe9Pe.js} +85 -4
  50. package/dist/components/{icon-BPNDyhu9.js → icon-BQjRjtKH.js} +2 -1
  51. package/dist/components/{icon-button-Dbo_SGor.js → icon-button-CDYZPHYe.js} +93 -12
  52. package/dist/components/index.d.ts +2 -0
  53. package/dist/components/index.d.ts.map +1 -1
  54. package/dist/components/index.js +2 -0
  55. package/dist/components/index.js.map +1 -1
  56. package/dist/components/inputs/checkbox/checkbox.d.ts +0 -5
  57. package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
  58. package/dist/components/inputs/checkbox/checkbox.js +0 -5
  59. package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
  60. package/dist/components/inputs/checkbox/checkbox.styles.js +9 -9
  61. package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
  62. package/dist/components/inputs/code-editor/code-editor.styles.js +6 -0
  63. package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
  64. package/dist/components/inputs/file-field/file-field.styles.js +17 -17
  65. package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
  66. package/dist/components/inputs/file-field/file-field.template.js +3 -2
  67. package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
  68. package/dist/components/inputs/password-field/password-field.d.ts +5 -12
  69. package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
  70. package/dist/components/inputs/password-field/password-field.i18n.d.ts +8 -0
  71. package/dist/components/inputs/password-field/password-field.i18n.d.ts.map +1 -0
  72. package/dist/components/inputs/password-field/password-field.i18n.js +7 -0
  73. package/dist/components/inputs/password-field/password-field.i18n.js.map +1 -0
  74. package/dist/components/inputs/password-field/password-field.js +10 -23
  75. package/dist/components/inputs/password-field/password-field.js.map +1 -1
  76. package/dist/components/inputs/password-field/password-field.template.js +2 -2
  77. package/dist/components/inputs/password-field/password-field.template.js.map +1 -1
  78. package/dist/components/inputs/radio-button/radio-button.d.ts +0 -5
  79. package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
  80. package/dist/components/inputs/radio-button/radio-button.js +0 -5
  81. package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
  82. package/dist/components/inputs/radio-button/radio-button.styles.js +9 -9
  83. package/dist/components/inputs/slider/slider.d.ts +19 -4
  84. package/dist/components/inputs/slider/slider.d.ts.map +1 -1
  85. package/dist/components/inputs/slider/slider.js +87 -19
  86. package/dist/components/inputs/slider/slider.js.map +1 -1
  87. package/dist/components/inputs/slider/slider.styles.d.ts.map +1 -1
  88. package/dist/components/inputs/slider/slider.styles.js +21 -6
  89. package/dist/components/inputs/slider/slider.styles.js.map +1 -1
  90. package/dist/components/inputs/slider/slider.template.js +1 -1
  91. package/dist/components/inputs/slider/slider.template.js.map +1 -1
  92. package/dist/components/inputs/swatch-picker/swatch-picker.d.ts +185 -0
  93. package/dist/components/inputs/swatch-picker/swatch-picker.d.ts.map +1 -0
  94. package/dist/components/inputs/swatch-picker/swatch-picker.i18n.d.ts +22 -0
  95. package/dist/components/inputs/swatch-picker/swatch-picker.i18n.d.ts.map +1 -0
  96. package/dist/components/inputs/swatch-picker/swatch-picker.i18n.js +21 -0
  97. package/dist/components/inputs/swatch-picker/swatch-picker.i18n.js.map +1 -0
  98. package/dist/components/inputs/swatch-picker/swatch-picker.js +491 -0
  99. package/dist/components/inputs/swatch-picker/swatch-picker.js.map +1 -0
  100. package/dist/components/inputs/swatch-picker/swatch-picker.styles.d.ts +3 -0
  101. package/dist/components/inputs/swatch-picker/swatch-picker.styles.d.ts.map +1 -0
  102. package/dist/components/inputs/swatch-picker/swatch-picker.styles.js +180 -0
  103. package/dist/components/inputs/swatch-picker/swatch-picker.styles.js.map +1 -0
  104. package/dist/components/inputs/swatch-picker/swatch-picker.template.d.ts +6 -0
  105. package/dist/components/inputs/swatch-picker/swatch-picker.template.d.ts.map +1 -0
  106. package/dist/components/inputs/swatch-picker/swatch-picker.template.js +44 -0
  107. package/dist/components/inputs/swatch-picker/swatch-picker.template.js.map +1 -0
  108. package/dist/components/inputs/switch/switch.d.ts +0 -5
  109. package/dist/components/inputs/switch/switch.d.ts.map +1 -1
  110. package/dist/components/inputs/switch/switch.js +0 -5
  111. package/dist/components/inputs/switch/switch.js.map +1 -1
  112. package/dist/components/inputs/switch/switch.styles.js +2 -2
  113. package/dist/components/{just-in-time-education.i18n-BgCd3s-c.js → just-in-time-education.i18n-S05IOgqk.js} +30 -2
  114. package/dist/components/layout/page-footer/page-footer.styles.d.ts.map +1 -1
  115. package/dist/components/layout/page-footer/page-footer.styles.js +11 -3
  116. package/dist/components/layout/page-footer/page-footer.styles.js.map +1 -1
  117. package/dist/components/layout/page-sections/hero/hero.styles.js +1 -1
  118. package/dist/components/layout/popover/popover.d.ts +5 -3
  119. package/dist/components/layout/popover/popover.d.ts.map +1 -1
  120. package/dist/components/layout/popover/popover.js +5 -3
  121. package/dist/components/layout/popover/popover.js.map +1 -1
  122. package/dist/components/layout/task-board/task-board.d.ts +8 -0
  123. package/dist/components/layout/task-board/task-board.d.ts.map +1 -1
  124. package/dist/components/layout/task-board/task-board.js +59 -0
  125. package/dist/components/layout/task-board/task-board.js.map +1 -1
  126. package/dist/components/lists-and-tables/list-item/list-item.d.ts +1 -1
  127. package/dist/components/lists-and-tables/list-item/list-item.js +1 -1
  128. package/dist/components/lists-and-tables/list-item/list-item.styles.d.ts.map +1 -1
  129. package/dist/components/lists-and-tables/list-item/list-item.styles.js +0 -6
  130. package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
  131. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +1 -1
  132. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
  133. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +5 -2
  134. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
  135. package/dist/components/navigation/link-group/link-group.d.ts +47 -0
  136. package/dist/components/navigation/link-group/link-group.d.ts.map +1 -0
  137. package/dist/components/navigation/link-group/link-group.js +81 -0
  138. package/dist/components/navigation/link-group/link-group.js.map +1 -0
  139. package/dist/components/navigation/link-group/link-group.styles.d.ts +2 -0
  140. package/dist/components/navigation/link-group/link-group.styles.d.ts.map +1 -0
  141. package/dist/components/navigation/link-group/link-group.styles.js +60 -0
  142. package/dist/components/navigation/link-group/link-group.styles.js.map +1 -0
  143. package/dist/components/navigation/link-group/link-group.template.d.ts +3 -0
  144. package/dist/components/navigation/link-group/link-group.template.d.ts.map +1 -0
  145. package/dist/components/navigation/link-group/link-group.template.js +15 -0
  146. package/dist/components/navigation/link-group/link-group.template.js.map +1 -0
  147. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
  148. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +7 -6
  149. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
  150. package/dist/components/{nl.generated-D-8UF1iR.js → nl.generated-CUo20aPV.js} +3 -1
  151. package/dist/components/{visibility-mixin-CNCT26tu.js → visibility-mixin-Ce0goNS6.js} +1 -1
  152. package/dist/css/variables.css +3 -1
  153. package/dist/nldd.min.js +1087 -771
  154. package/dist/translations/en-US.d.ts.map +1 -1
  155. package/dist/translations/en-US.js +23 -1
  156. package/dist/translations/en-US.js.map +1 -1
  157. package/dist/translations/fy.d.ts +3 -3
  158. package/dist/translations/fy.d.ts.map +1 -1
  159. package/dist/translations/fy.js +38 -1
  160. package/dist/translations/fy.js.map +1 -1
  161. package/dist/translations/nl.generated.d.ts +23 -1
  162. package/dist/translations/nl.generated.d.ts.map +1 -1
  163. package/dist/translations/nl.generated.js +4 -0
  164. package/dist/translations/nl.generated.js.map +1 -1
  165. package/dist/translations/pap-AW.d.ts +3 -3
  166. package/dist/translations/pap-AW.d.ts.map +1 -1
  167. package/dist/translations/pap-AW.js +38 -1
  168. package/dist/translations/pap-AW.js.map +1 -1
  169. package/dist/translations/pap-CW.d.ts +3 -3
  170. package/dist/translations/pap-CW.d.ts.map +1 -1
  171. package/dist/translations/pap-CW.js +38 -1
  172. package/dist/translations/pap-CW.js.map +1 -1
  173. package/dist/types/vue.d.ts +111 -33
  174. package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
  175. package/dist/utilities/dev-rules.generated.js +90 -3
  176. package/dist/utilities/dev-rules.generated.js.map +1 -1
  177. package/dist/utilities/owner-form.d.ts +21 -0
  178. package/dist/utilities/owner-form.d.ts.map +1 -0
  179. package/dist/utilities/owner-form.js +39 -0
  180. package/dist/utilities/owner-form.js.map +1 -0
  181. package/dist/utilities/popover-target.d.ts +11 -0
  182. package/dist/utilities/popover-target.d.ts.map +1 -1
  183. package/dist/utilities/popover-target.js +27 -0
  184. package/dist/utilities/popover-target.js.map +1 -1
  185. package/dist/utilities/popup-anchor-controller.d.ts.map +1 -1
  186. package/dist/utilities/popup-anchor-controller.js +5 -1
  187. package/dist/utilities/popup-anchor-controller.js.map +1 -1
  188. package/lint/cli.js +4 -4
  189. package/lint/data.generated.json +1 -1
  190. package/package.json +18 -5
@@ -0,0 +1,491 @@
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
+ * Nederlandse Digitale Dienst Swatch Picker Component (Lit + TypeScript)
9
+ *
10
+ * A row of swatches to choose one from: a color, or an image of a pattern or a
11
+ * material. The row wraps onto the next line when the swatches do not fit.
12
+ *
13
+ * It is a radio group: Tab enters and leaves it in one stop, the arrow keys
14
+ * choose, and the value goes with a form under `name`. The chosen swatch shows
15
+ * a check mark. Put it in an `nldd-form-field`, which names the group.
16
+ *
17
+ * Every swatch needs a name, since a color or an image says nothing to a screen
18
+ * reader. A swatch with a category `color` takes the name of that color from
19
+ * the translations ("Rood"); one with a `custom-color` or an `image` has to say
20
+ * it in `text`. The name shows as a tooltip.
21
+ *
22
+ * Exports both NLDDSwatchPicker and NLDDSwatchPickerItem.
23
+ *
24
+ * @element nldd-swatch-picker
25
+ * @attr {string} size - Swatch size, on the control scale: 'xs' (24px) | 'sm' (32px) | 'md' (44px) (default: 'md')
26
+ * @attr {string} accessible-label - Accessible name for the group, set as aria-label. In an nldd-form-field the field names it.
27
+ * @attr {string} accessible-labeled-by - Id of an external label element, set as aria-labelledby on the group
28
+ * @attr {boolean} invalid - Marks the group as invalid. Announced with aria-invalid; nothing is drawn for it.
29
+ * @attr {boolean} disabled - Disabled state for all swatches
30
+ * @attr {string} name - Name for form submission
31
+ * @attr {string} value - Value of the chosen swatch
32
+ * @attr {boolean} required - Something has to be chosen
33
+ *
34
+ * @fires change - When the choice changes; detail: { value: string }
35
+ *
36
+ * @slot - nldd-swatch-picker-item elements
37
+ *
38
+ * ---
39
+ *
40
+ * @element nldd-swatch-picker-item
41
+ * @attr {string} color - Category color: 'lintblauw' | 'donkerblauw' | 'hemelblauw' | 'lichtblauw' | 'paars' | 'violet' | 'robijnrood' | 'roze' | 'rood' | 'oranje' | 'donkergeel' | 'geel' | 'donkerbruin' | 'bruin' | 'donkergroen' | 'groen' | 'mosgroen' | 'mintgroen'. Brings its name along, so `text` is optional.
42
+ * @attr {string} custom-color - Any CSS color of your own (e.g. '#7a1f3d' or 'var(--brand-color)'), for a color outside the categories. Needs `text`.
43
+ * @attr {string} image - URL of an image that fills the swatch, for a pattern or a material. Needs `text`.
44
+ * @attr {string} image-srcset - Sources of the image at other pixel densities, with x descriptors (e.g. '/oak.jpg 1x, /oak@2x.jpg 2x'). The swatch has a fixed size, so there are no widths to choose from.
45
+ * @attr {string} text - Name of the swatch, for screen readers and the tooltip. Overrides the name of a category `color`.
46
+ * @attr {boolean} selected - Whether this swatch is chosen (set by the picker)
47
+ * @attr {boolean} disabled - Disabled state
48
+ * @attr {string} value - Value for this swatch
49
+ * @attr {string} size - Swatch size: 'xs' | 'sm' | 'md' (set by the picker, default: 'md')
50
+ * @attr {object} translations - Override translation keys (the names of the category colors); unset keys fall back to Dutch.
51
+ */
52
+ import { LitElement } from 'lit';
53
+ import { property, state } from 'lit/decorators.js';
54
+ import { customElement } from '../../../utilities/custom-element.js';
55
+ import { FormAssociated } from '../../../utilities/form-associated-mixin.js';
56
+ import { reflectNonDefault } from '../../../utilities/reflect-non-default.js';
57
+ import { radioPositions } from '../../../utilities/radio-position.js';
58
+ import { setOwnedAttribute } from '../../../utilities/owned-attribute.js';
59
+ import { submitOnEnter } from '../../../utilities/implicit-submission.js';
60
+ import { deferFocus } from '../../../utilities/defer-focus.js';
61
+ import { withTranslations } from '../../../utilities/with-translations.js';
62
+ import { swatchPickerStyles, swatchPickerItemStyles } from './swatch-picker.styles.js';
63
+ import { swatchPickerTemplate, swatchPickerItemTemplate } from './swatch-picker.template.js';
64
+ import { nlddSwatchPickerItemTranslations } from './swatch-picker.i18n.js';
65
+ import '../../content/icon/icon.js';
66
+ /** How long the name stays after a tap, in ms. */
67
+ const NAME_AFTER_TAP_MS = 1500;
68
+ // # nldd-swatch-picker-item
69
+ let NLDDSwatchPickerItem = class NLDDSwatchPickerItem extends withTranslations(LitElement, nlddSwatchPickerItemTranslations) {
70
+ constructor() {
71
+ super(...arguments);
72
+ this.color = '';
73
+ this.customColor = '';
74
+ this.image = '';
75
+ this.imageSrcset = '';
76
+ this.text = '';
77
+ this.selected = false;
78
+ this.disabled = false;
79
+ this.value = '';
80
+ /** Set by nldd-swatch-picker. Not part of the public API. */
81
+ this.size = 'md';
82
+ /** Set by nldd-swatch-picker: this swatch's place in the group, which it
83
+ * cannot count by itself. */
84
+ this._groupPosition = null;
85
+ /** The aria-label this swatch wrote on itself, so it only takes back its own. */
86
+ this._appliedLabel = null;
87
+ /** Ends the name shown after a tap. */
88
+ this._nameTimer = 0;
89
+ /** The pointer of the last press, so a click knows how to keep the name. */
90
+ this._pointerType = '';
91
+ this._onFocus = () => {
92
+ this._tooltip?._handleFocusIn();
93
+ };
94
+ this._onBlur = () => {
95
+ this._tooltip?._handleTriggerLeave();
96
+ };
97
+ this._onClick = () => {
98
+ this._select();
99
+ this._showName();
100
+ };
101
+ this._onPointerDown = (e) => {
102
+ this._pointerType = e.pointerType;
103
+ // Before the click, which closes a tooltip that is not held open: held
104
+ // already, the hovered name stays where it is instead of flickering.
105
+ if (e.pointerType !== 'touch')
106
+ this._showName();
107
+ };
108
+ this._onPointerLeave = (e) => {
109
+ if (e.pointerType !== 'touch')
110
+ this._hideName();
111
+ };
112
+ this._onScroll = () => {
113
+ this._hideName();
114
+ };
115
+ this._onKeyDown = (e) => {
116
+ if (this.disabled)
117
+ return;
118
+ // Space is the key a radio answers to itself. The arrow keys and Enter
119
+ // belong to the group: it knows the form.
120
+ if (e.key === ' ') {
121
+ e.preventDefault();
122
+ this._select();
123
+ }
124
+ };
125
+ }
126
+ /** The name of the swatch: its own text, or that of its category color. */
127
+ get _name() {
128
+ if (this.text)
129
+ return this.text;
130
+ if (!this.color)
131
+ return '';
132
+ return this._t(`components.swatch-picker-item.${this.color}-text`);
133
+ }
134
+ connectedCallback() {
135
+ super.connectedCallback();
136
+ this.addEventListener('pointerdown', this._onPointerDown);
137
+ this.addEventListener('pointerleave', this._onPointerLeave);
138
+ this.addEventListener('click', this._onClick);
139
+ this.addEventListener('keydown', this._onKeyDown);
140
+ this.addEventListener('focus', this._onFocus);
141
+ this.addEventListener('blur', this._onBlur);
142
+ }
143
+ disconnectedCallback() {
144
+ super.disconnectedCallback();
145
+ this.removeEventListener('pointerdown', this._onPointerDown);
146
+ this.removeEventListener('pointerleave', this._onPointerLeave);
147
+ this.removeEventListener('click', this._onClick);
148
+ this.removeEventListener('keydown', this._onKeyDown);
149
+ this.removeEventListener('focus', this._onFocus);
150
+ this.removeEventListener('blur', this._onBlur);
151
+ this._hideName();
152
+ }
153
+ updated(changedProperties) {
154
+ if (changedProperties.has('customColor')) {
155
+ if (this.customColor && CSS.supports('color', this.customColor)) {
156
+ this.style.setProperty('--_swatch-picker-item-custom-color', this.customColor);
157
+ }
158
+ else {
159
+ this.style.removeProperty('--_swatch-picker-item-custom-color');
160
+ }
161
+ }
162
+ this._syncAria();
163
+ }
164
+ /**
165
+ * The swatch is the radio itself. A native radio in a shadow root of its own
166
+ * is a group of one: a screen reader counts it as "1 of 1" and Tab stops at
167
+ * every option. The role on the element puts the group back in one tree,
168
+ * under the radiogroup the picker carries.
169
+ */
170
+ _syncAria() {
171
+ this.setAttribute('role', 'radio');
172
+ this.setAttribute('aria-checked', String(this.selected));
173
+ this._appliedLabel = setOwnedAttribute(this, 'aria-label', this._name, this._appliedLabel);
174
+ if (this.disabled)
175
+ this.setAttribute('aria-disabled', 'true');
176
+ else
177
+ this.removeAttribute('aria-disabled');
178
+ const position = this._groupPosition;
179
+ if (position) {
180
+ this.setAttribute('aria-posinset', String(position.posInSet));
181
+ this.setAttribute('aria-setsize', String(position.setSize));
182
+ }
183
+ else {
184
+ this.removeAttribute('aria-posinset');
185
+ this.removeAttribute('aria-setsize');
186
+ }
187
+ // A disabled option is not in the tab order, as a native one is not.
188
+ const tabbable = !this.disabled && position?.tabbable !== false;
189
+ this.setAttribute('tabindex', tabbable ? '0' : '-1');
190
+ }
191
+ /** The tooltip, which shows itself when focus moves into it. The focus is on
192
+ * this element, outside it, so it hears about focus from here. */
193
+ get _tooltip() {
194
+ return this.shadowRoot?.querySelector('nldd-tooltip') ?? null;
195
+ }
196
+ /** Chosen, the way a click, the space bar or an arrow key in the group does
197
+ * it. A radio never unchecks itself, so a chosen swatch says nothing.
198
+ *
199
+ * @internal */
200
+ _select() {
201
+ if (this.disabled || this.selected)
202
+ return;
203
+ this.dispatchEvent(new CustomEvent('item-change', {
204
+ detail: { value: this.value },
205
+ bubbles: true,
206
+ composed: true,
207
+ }));
208
+ }
209
+ /**
210
+ * Keeps the name in view after a click or a tap: a click hides a tooltip,
211
+ * and a tap never shows one, while the name is the only label a swatch has.
212
+ * After a click it stays until the pointer leaves the swatch. After a tap it
213
+ * stays a moment, clear of the finger.
214
+ */
215
+ _showName() {
216
+ const tooltip = this._tooltip;
217
+ if (!tooltip || !this._name)
218
+ return;
219
+ // One name at a time: a tap on the next swatch closes the one before,
220
+ // which would otherwise stay for the rest of its moment.
221
+ this.closest('nldd-swatch-picker')
222
+ ?.querySelectorAll('nldd-swatch-picker-item')
223
+ .forEach((item) => { if (item !== this)
224
+ item._hideName(); });
225
+ tooltip.open = true;
226
+ clearTimeout(this._nameTimer);
227
+ this._nameTimer = this._pointerType === 'touch'
228
+ ? window.setTimeout(() => this._hideName(), NAME_AFTER_TAP_MS)
229
+ : 0;
230
+ // Held for the pointer, so it goes the way a hover does: on a scroll too.
231
+ document.addEventListener('scroll', this._onScroll, { capture: true, passive: true });
232
+ }
233
+ _hideName() {
234
+ document.removeEventListener('scroll', this._onScroll, { capture: true });
235
+ clearTimeout(this._nameTimer);
236
+ this._nameTimer = 0;
237
+ const tooltip = this._tooltip;
238
+ if (tooltip)
239
+ tooltip.open = false;
240
+ }
241
+ focus(options) {
242
+ if (deferFocus(this, options))
243
+ return;
244
+ super.focus(options);
245
+ }
246
+ render() {
247
+ return swatchPickerItemTemplate(this);
248
+ }
249
+ };
250
+ NLDDSwatchPickerItem.styles = swatchPickerItemStyles;
251
+ __decorate([
252
+ property({ reflect: true, converter: reflectNonDefault('') })
253
+ ], NLDDSwatchPickerItem.prototype, "color", void 0);
254
+ __decorate([
255
+ property({ reflect: true, attribute: 'custom-color', converter: reflectNonDefault('') })
256
+ ], NLDDSwatchPickerItem.prototype, "customColor", void 0);
257
+ __decorate([
258
+ property({ type: String })
259
+ ], NLDDSwatchPickerItem.prototype, "image", void 0);
260
+ __decorate([
261
+ property({ type: String, attribute: 'image-srcset' })
262
+ ], NLDDSwatchPickerItem.prototype, "imageSrcset", void 0);
263
+ __decorate([
264
+ property({ reflect: true, converter: reflectNonDefault('') })
265
+ ], NLDDSwatchPickerItem.prototype, "text", void 0);
266
+ __decorate([
267
+ property({ type: Boolean, reflect: true })
268
+ ], NLDDSwatchPickerItem.prototype, "selected", void 0);
269
+ __decorate([
270
+ property({ type: Boolean, reflect: true })
271
+ ], NLDDSwatchPickerItem.prototype, "disabled", void 0);
272
+ __decorate([
273
+ property({ type: String })
274
+ ], NLDDSwatchPickerItem.prototype, "value", void 0);
275
+ __decorate([
276
+ property({ reflect: true, converter: reflectNonDefault('md') })
277
+ ], NLDDSwatchPickerItem.prototype, "size", void 0);
278
+ __decorate([
279
+ state()
280
+ ], NLDDSwatchPickerItem.prototype, "_groupPosition", void 0);
281
+ NLDDSwatchPickerItem = __decorate([
282
+ customElement('nldd-swatch-picker-item')
283
+ ], NLDDSwatchPickerItem);
284
+ export { NLDDSwatchPickerItem };
285
+ // # nldd-swatch-picker
286
+ let NLDDSwatchPicker = class NLDDSwatchPicker extends FormAssociated(LitElement) {
287
+ constructor() {
288
+ super(...arguments);
289
+ this.size = 'md';
290
+ this.accessibleLabel = '';
291
+ this.accessibleLabeledBy = '';
292
+ /**
293
+ * Marks the group as invalid. Announced and not drawn, and on the group: a
294
+ * red ring around one swatch would say that swatch is wrong, while it is the
295
+ * question that is unanswered.
296
+ */
297
+ this.invalid = false;
298
+ this.disabled = false;
299
+ this.name = '';
300
+ this.value = '';
301
+ /** Something has to be chosen. Carried by a hidden radio of the group's own,
302
+ * checked as soon as anything is chosen, so the browser writes the message. */
303
+ this.required = false;
304
+ this._initialValue = '';
305
+ /** The name this group wrote onto its host, so it only takes back its own. */
306
+ this._appliedLabel = null;
307
+ this._handleItemChange = (e) => {
308
+ e.stopPropagation();
309
+ if (this.disabled || e.detail.value === this.value)
310
+ return;
311
+ this.value = e.detail.value;
312
+ this._syncItems();
313
+ this.commitFormValue();
314
+ this.dispatchEvent(new CustomEvent('change', {
315
+ detail: { value: this.value },
316
+ bubbles: true,
317
+ composed: true,
318
+ }));
319
+ };
320
+ this._handleKeydown = (e) => {
321
+ if (this.disabled)
322
+ return;
323
+ // Enter on a radio submits the form it belongs to, and the group is what
324
+ // the form knows.
325
+ if (e.key === 'Enter') {
326
+ submitOnEnter(this, e);
327
+ return;
328
+ }
329
+ const items = this._getItems().filter((item) => !item.disabled);
330
+ if (items.length === 0)
331
+ return;
332
+ const current = items.findIndex((item) => item.selected);
333
+ let next;
334
+ switch (e.key) {
335
+ case 'ArrowLeft':
336
+ case 'ArrowUp':
337
+ next = current <= 0 ? items.length - 1 : current - 1;
338
+ break;
339
+ case 'ArrowRight':
340
+ case 'ArrowDown':
341
+ next = current >= items.length - 1 ? 0 : current + 1;
342
+ break;
343
+ case 'Home':
344
+ next = 0;
345
+ break;
346
+ case 'End':
347
+ next = items.length - 1;
348
+ break;
349
+ default:
350
+ return;
351
+ }
352
+ e.preventDefault();
353
+ if (next === current || !items[next])
354
+ return;
355
+ items[next].focus();
356
+ // Through the swatch, as a click: it fires item-change, and the group
357
+ // answers with change, so every way of choosing sends both.
358
+ items[next]._select();
359
+ };
360
+ }
361
+ connectedCallback() {
362
+ super.connectedCallback();
363
+ this.setAttribute('role', 'radiogroup');
364
+ this.addEventListener('item-change', this._handleItemChange);
365
+ this.addEventListener('keydown', this._handleKeydown);
366
+ }
367
+ disconnectedCallback() {
368
+ super.disconnectedCallback();
369
+ this.removeEventListener('item-change', this._handleItemChange);
370
+ this.removeEventListener('keydown', this._handleKeydown);
371
+ }
372
+ firstUpdated() {
373
+ this._syncItems();
374
+ this._initialValue = this.value;
375
+ }
376
+ formValue() {
377
+ return this.value || null;
378
+ }
379
+ formResetCallback() {
380
+ this.value = this._initialValue;
381
+ }
382
+ formStateRestoreCallback(state) {
383
+ if (typeof state === 'string')
384
+ this.value = state;
385
+ }
386
+ /** The group has no focus of its own, so an invalid submit lands where Tab
387
+ * would: on the chosen swatch, or the first one that is enabled. */
388
+ validationAnchor() {
389
+ const items = this._getItems().filter((item) => !item.disabled);
390
+ return items.find((item) => item.selected) ?? items[0];
391
+ }
392
+ updated(changedProperties) {
393
+ if (changedProperties.has('value') ||
394
+ changedProperties.has('size') ||
395
+ changedProperties.has('disabled') ||
396
+ changedProperties.has('required') ||
397
+ changedProperties.has('invalid')) {
398
+ this._syncItems();
399
+ }
400
+ if (changedProperties.has('value'))
401
+ this.commitFormValue();
402
+ if (changedProperties.has('accessibleLabel')) {
403
+ this._appliedLabel = setOwnedAttribute(this, 'aria-label', this.accessibleLabel, this._appliedLabel);
404
+ }
405
+ if (changedProperties.has('accessibleLabeledBy')) {
406
+ if (this.accessibleLabeledBy)
407
+ this.setAttribute('aria-labelledby', this.accessibleLabeledBy);
408
+ else
409
+ this.removeAttribute('aria-labelledby');
410
+ }
411
+ }
412
+ _getItems() {
413
+ const slot = this.shadowRoot?.querySelector('slot');
414
+ if (!slot)
415
+ return [];
416
+ return slot
417
+ .assignedElements()
418
+ .filter((el) => el.localName === 'nldd-swatch-picker-item');
419
+ }
420
+ _syncItems() {
421
+ const items = this._getItems();
422
+ this.toggleAttribute('aria-required', this.required);
423
+ if (this.invalid)
424
+ this.setAttribute('aria-invalid', 'true');
425
+ else
426
+ this.removeAttribute('aria-invalid');
427
+ for (const item of items) {
428
+ if (this.disabled && !item.hasAttribute('disabled')) {
429
+ item.setAttribute('group-disabled', '');
430
+ item.disabled = true;
431
+ }
432
+ else if (!this.disabled && item.hasAttribute('group-disabled')) {
433
+ item.removeAttribute('group-disabled');
434
+ item.disabled = false;
435
+ }
436
+ item.size = this.size;
437
+ item.selected = !!this.value && item.value === this.value;
438
+ }
439
+ const positions = radioPositions(items, (item) => item.selected, (item) => item.disabled);
440
+ items.forEach((item, index) => {
441
+ item._groupPosition = positions[index] ?? null;
442
+ });
443
+ }
444
+ /** @internal */
445
+ _onSlotChange() {
446
+ this._syncItems();
447
+ }
448
+ /** Focus goes to the chosen swatch, or the first enabled one: where Tab lands. */
449
+ focus(options) {
450
+ if (deferFocus(this, options))
451
+ return;
452
+ const items = this._getItems().filter((item) => !item.disabled);
453
+ (items.find((item) => item.selected) ?? items[0])?.focus(options);
454
+ }
455
+ render() {
456
+ return swatchPickerTemplate(this);
457
+ }
458
+ };
459
+ NLDDSwatchPicker.styles = swatchPickerStyles;
460
+ /** Says this is the control an nldd-form-field is about, so the field can
461
+ * find it, name it and move focus into it. See nldd-form-field. */
462
+ NLDDSwatchPicker.isFormInput = true;
463
+ __decorate([
464
+ property({ reflect: true, converter: reflectNonDefault('md') })
465
+ ], NLDDSwatchPicker.prototype, "size", void 0);
466
+ __decorate([
467
+ property({ type: String, attribute: 'accessible-label' })
468
+ ], NLDDSwatchPicker.prototype, "accessibleLabel", void 0);
469
+ __decorate([
470
+ property({ type: String, attribute: 'accessible-labeled-by' })
471
+ ], NLDDSwatchPicker.prototype, "accessibleLabeledBy", void 0);
472
+ __decorate([
473
+ property({ type: Boolean, reflect: true })
474
+ ], NLDDSwatchPicker.prototype, "invalid", void 0);
475
+ __decorate([
476
+ property({ type: Boolean, reflect: true })
477
+ ], NLDDSwatchPicker.prototype, "disabled", void 0);
478
+ __decorate([
479
+ property({ reflect: true, converter: reflectNonDefault('') })
480
+ ], NLDDSwatchPicker.prototype, "name", void 0);
481
+ __decorate([
482
+ property({ type: String, reflect: true })
483
+ ], NLDDSwatchPicker.prototype, "value", void 0);
484
+ __decorate([
485
+ property({ type: Boolean, reflect: true })
486
+ ], NLDDSwatchPicker.prototype, "required", void 0);
487
+ NLDDSwatchPicker = __decorate([
488
+ customElement('nldd-swatch-picker')
489
+ ], NLDDSwatchPicker);
490
+ export { NLDDSwatchPicker };
491
+ //# sourceMappingURL=swatch-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swatch-picker.js","sourceRoot":"","sources":["../../../../src/components/inputs/swatch-picker/swatch-picker.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAkB,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAsB,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,O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AAE,CAAC;iDAC3B;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC;8CACpD;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAC/B;AAKX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAC1B;AApCL,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAsM5B"}
@@ -0,0 +1,3 @@
1
+ export declare const swatchPickerStyles: import("lit").CSSResult;
2
+ export declare const swatchPickerItemStyles: import("lit").CSSResult;
3
+ //# sourceMappingURL=swatch-picker.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swatch-picker.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/swatch-picker/swatch-picker.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,yBA6B9B,CAAC;AAKF,eAAO,MAAM,sBAAsB,yBAiJlC,CAAC"}