@aquera/nile-elements 0.0.4-8 → 0.0.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.
Files changed (186) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +2 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +2 -0
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js +42 -45
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.d.ts +13 -5
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js +54 -84
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.js +2 -0
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.js.map +1 -1
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/index.d.ts +1 -0
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/index.js +2 -0
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/index.js.map +1 -0
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.css.d.ts +12 -0
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.css.js +173 -0
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.css.js.map +1 -0
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.d.ts +57 -0
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.js +145 -0
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.js.map +1 -0
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/index.d.ts +1 -0
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/index.js +2 -0
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/index.js.map +1 -0
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.css.d.ts +12 -0
  24. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.css.js +70 -0
  25. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.css.js.map +1 -0
  26. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.d.ts +66 -0
  27. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.js +308 -0
  28. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.js.map +1 -0
  29. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +2 -2
  30. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  31. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  32. package/dist/{index-cd83c5c8.cjs.js → index-0da7021a.cjs.js} +2 -2
  33. package/dist/{index-cd83c5c8.cjs.js.map → index-0da7021a.cjs.js.map} +1 -1
  34. package/dist/index.cjs.js +1 -1
  35. package/dist/index.esm.js +1 -1
  36. package/dist/index.iife.js +432 -143
  37. package/dist/nile-auto-complete/index.cjs.js +1 -1
  38. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  39. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
  40. package/dist/nile-button/index.cjs.js +1 -1
  41. package/dist/nile-button/nile-button.cjs.js +1 -1
  42. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  43. package/dist/nile-calendar/index.cjs.js +1 -1
  44. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  45. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  46. package/dist/nile-checkbox/index.cjs.js +1 -1
  47. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  48. package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
  49. package/dist/nile-chip/index.cjs.js +1 -1
  50. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  51. package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
  52. package/dist/nile-date-picker/index.cjs.js +1 -1
  53. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  54. package/dist/nile-date-picker/nile-date-picker.css.cjs.js +1 -1
  55. package/dist/nile-drawer/index.cjs.js +1 -1
  56. package/dist/nile-drawer/nile-drawer.css.cjs.js +1 -1
  57. package/dist/nile-dropdown/index.cjs.js +1 -1
  58. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  59. package/dist/nile-dropdown/nile-dropdown.css.cjs.js +1 -1
  60. package/dist/nile-error-message/index.cjs.js +1 -1
  61. package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
  62. package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
  63. package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
  64. package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
  65. package/dist/nile-error-message/nile-error-message.css.esm.js +42 -45
  66. package/dist/nile-error-message/nile-error-message.esm.js +26 -28
  67. package/dist/nile-footer/index.cjs.js +1 -1
  68. package/dist/nile-footer/nile-footer.css.cjs.js +1 -1
  69. package/dist/nile-form-error-message/index.cjs.js +1 -1
  70. package/dist/nile-form-error-message/nile-form-error-message.cjs.js +1 -1
  71. package/dist/nile-form-error-message/nile-form-error-message.css.cjs.js +1 -1
  72. package/dist/nile-form-help-text/index.cjs.js +1 -1
  73. package/dist/nile-form-help-text/nile-form-help-text.cjs.js +1 -1
  74. package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js +1 -1
  75. package/dist/nile-icon-button/index.cjs.js +1 -1
  76. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  77. package/dist/nile-icon-button/nile-icon-button.css.cjs.js +1 -1
  78. package/dist/nile-input/index.cjs.js +1 -1
  79. package/dist/nile-input/nile-input.cjs.js +1 -1
  80. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  81. package/dist/nile-link/index.cjs.js +1 -1
  82. package/dist/nile-link/nile-link.cjs.js +1 -1
  83. package/dist/nile-link/nile-link.css.cjs.js +1 -1
  84. package/dist/nile-link/nile-link.css.cjs.js.map +1 -1
  85. package/dist/nile-link/nile-link.css.esm.js +2 -0
  86. package/dist/nile-loader/index.cjs.js +1 -1
  87. package/dist/nile-loader/nile-loader.cjs.js +1 -1
  88. package/dist/nile-menu/index.cjs.js +1 -1
  89. package/dist/nile-menu/nile-menu.cjs.js +1 -1
  90. package/dist/nile-menu/nile-menu.css.cjs.js +1 -1
  91. package/dist/nile-menu-item/index.cjs.js +1 -1
  92. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  93. package/dist/nile-menu-item/nile-menu-item.css.cjs.js +1 -1
  94. package/dist/nile-option/index.cjs.js +1 -1
  95. package/dist/nile-option/nile-option.cjs.js +1 -1
  96. package/dist/nile-option/nile-option.css.cjs.js +1 -1
  97. package/dist/nile-popup/index.cjs.js +1 -1
  98. package/dist/nile-popup/nile-popup.cjs.js +1 -1
  99. package/dist/nile-popup/nile-popup.css.cjs.js +1 -1
  100. package/dist/nile-progress-bar/index.cjs.js +1 -1
  101. package/dist/nile-progress-bar/nile-progress-bar.cjs.js +1 -1
  102. package/dist/nile-radio/index.cjs.js +1 -1
  103. package/dist/nile-radio/nile-radio.cjs.js +1 -1
  104. package/dist/nile-radio/nile-radio.css.cjs.js +1 -1
  105. package/dist/nile-radio-button/index.cjs.js +2 -0
  106. package/dist/nile-radio-button/index.cjs.js.map +1 -0
  107. package/dist/nile-radio-button/index.esm.js +1 -0
  108. package/dist/nile-radio-button/nile-radio-button.cjs.js +2 -0
  109. package/dist/nile-radio-button/nile-radio-button.cjs.js.map +1 -0
  110. package/dist/nile-radio-button/nile-radio-button.css.cjs.js +2 -0
  111. package/dist/nile-radio-button/nile-radio-button.css.cjs.js.map +1 -0
  112. package/dist/nile-radio-button/nile-radio-button.css.esm.js +161 -0
  113. package/dist/nile-radio-button/nile-radio-button.esm.js +21 -0
  114. package/dist/nile-radio-button-group/index.cjs.js +2 -0
  115. package/dist/nile-radio-button-group/index.cjs.js.map +1 -0
  116. package/dist/nile-radio-button-group/index.esm.js +1 -0
  117. package/dist/nile-radio-button-group/nile-radio-button-group.cjs.js +2 -0
  118. package/dist/nile-radio-button-group/nile-radio-button-group.cjs.js.map +1 -0
  119. package/dist/nile-radio-button-group/nile-radio-button-group.css.cjs.js +2 -0
  120. package/dist/nile-radio-button-group/nile-radio-button-group.css.cjs.js.map +1 -0
  121. package/dist/nile-radio-button-group/nile-radio-button-group.css.esm.js +58 -0
  122. package/dist/nile-radio-button-group/nile-radio-button-group.esm.js +56 -0
  123. package/dist/nile-select/index.cjs.js +1 -1
  124. package/dist/nile-select/nile-select.cjs.js +1 -1
  125. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  126. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  127. package/dist/nile-select/nile-select.esm.js +1 -1
  128. package/dist/nile-slide-toggle/index.cjs.js +1 -1
  129. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
  130. package/dist/nile-spinner/index.cjs.js +1 -1
  131. package/dist/nile-spinner/nile-spinner.cjs.js +1 -1
  132. package/dist/nile-spinner/nile-spinner.css.cjs.js +1 -1
  133. package/dist/nile-tag/index.cjs.js +1 -1
  134. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  135. package/dist/nile-tag/nile-tag.css.cjs.js +1 -1
  136. package/dist/nile-textarea/index.cjs.js +1 -1
  137. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  138. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  139. package/dist/nile-toolbar/index.cjs.js +1 -1
  140. package/dist/nile-toolbar/nile-toolbar.css.cjs.js +1 -1
  141. package/dist/nile-tooltip/index.cjs.js +1 -1
  142. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  143. package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
  144. package/dist/src/index.d.ts +2 -0
  145. package/dist/src/index.js +2 -0
  146. package/dist/src/index.js.map +1 -1
  147. package/dist/src/nile-error-message/nile-error-message.css.js +42 -45
  148. package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  149. package/dist/src/nile-error-message/nile-error-message.d.ts +13 -5
  150. package/dist/src/nile-error-message/nile-error-message.js +54 -84
  151. package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  152. package/dist/src/nile-link/nile-link.css.js +2 -0
  153. package/dist/src/nile-link/nile-link.css.js.map +1 -1
  154. package/dist/src/nile-radio-button/index.d.ts +1 -0
  155. package/dist/src/nile-radio-button/index.js +2 -0
  156. package/dist/src/nile-radio-button/index.js.map +1 -0
  157. package/dist/src/nile-radio-button/nile-radio-button.css.d.ts +12 -0
  158. package/dist/src/nile-radio-button/nile-radio-button.css.js +173 -0
  159. package/dist/src/nile-radio-button/nile-radio-button.css.js.map +1 -0
  160. package/dist/src/nile-radio-button/nile-radio-button.d.ts +57 -0
  161. package/dist/src/nile-radio-button/nile-radio-button.js +145 -0
  162. package/dist/src/nile-radio-button/nile-radio-button.js.map +1 -0
  163. package/dist/src/nile-radio-button-group/index.d.ts +1 -0
  164. package/dist/src/nile-radio-button-group/index.js +2 -0
  165. package/dist/src/nile-radio-button-group/index.js.map +1 -0
  166. package/dist/src/nile-radio-button-group/nile-radio-button-group.css.d.ts +12 -0
  167. package/dist/src/nile-radio-button-group/nile-radio-button-group.css.js +70 -0
  168. package/dist/src/nile-radio-button-group/nile-radio-button-group.css.js.map +1 -0
  169. package/dist/src/nile-radio-button-group/nile-radio-button-group.d.ts +66 -0
  170. package/dist/src/nile-radio-button-group/nile-radio-button-group.js +308 -0
  171. package/dist/src/nile-radio-button-group/nile-radio-button-group.js.map +1 -0
  172. package/dist/src/nile-select/nile-select.js +2 -2
  173. package/dist/src/nile-select/nile-select.js.map +1 -1
  174. package/dist/tsconfig.tsbuildinfo +1 -1
  175. package/package.json +1 -1
  176. package/src/index.ts +2 -0
  177. package/src/nile-error-message/nile-error-message.css.ts +42 -45
  178. package/src/nile-error-message/nile-error-message.ts +52 -90
  179. package/src/nile-link/nile-link.css.ts +2 -0
  180. package/src/nile-radio-button/index.ts +1 -0
  181. package/src/nile-radio-button/nile-radio-button.css.ts +175 -0
  182. package/src/nile-radio-button/nile-radio-button.ts +151 -0
  183. package/src/nile-radio-button-group/index.ts +1 -0
  184. package/src/nile-radio-button-group/nile-radio-button-group.css.ts +72 -0
  185. package/src/nile-radio-button-group/nile-radio-button-group.ts +337 -0
  186. package/src/nile-select/nile-select.ts +2 -2
@@ -0,0 +1,161 @@
1
+ import{i as t}from"../index-cd2f9c12.esm.js";const e=t`
2
+ :host {
3
+ }
4
+
5
+ .button {
6
+ display: inline-flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ width: 100%;
10
+ color: var(--color-text-default, #000);
11
+ text-align: center;
12
+ border-radius: 4px;
13
+ font-family: Colfax-regular;
14
+ font-size: 14px;
15
+ font-style: normal;
16
+ font-weight: 400;
17
+ line-height: 14px; /* 100% */
18
+ letter-spacing: 0.2px;
19
+ text-decoration: none;
20
+ user-select: none;
21
+ white-space: nowrap;
22
+ vertical-align: middle;
23
+ padding: 12px;
24
+ cursor: pointer;
25
+ gap: 10px;
26
+ }
27
+
28
+ .button::-moz-focus-inner {
29
+ border: 0;
30
+ }
31
+
32
+ .button:focus {
33
+ outline: none;
34
+ }
35
+
36
+ .button:focus-visible {
37
+ outline: var(--nile-focus-ring);
38
+ outline-offset: var(--nile-focus-ring-offset);
39
+ }
40
+
41
+ .button--disabled {
42
+ opacity: 0.5;
43
+ cursor: not-allowed;
44
+ }
45
+
46
+ /* When disabled, prevent mouse events from bubbling up from children */
47
+ .button--disabled * {
48
+ pointer-events: none;
49
+ }
50
+
51
+ .button__prefix,
52
+ .button__suffix {
53
+ flex: 0 0 auto;
54
+ display: flex;
55
+ align-items: center;
56
+ pointer-events: none;
57
+ }
58
+
59
+ .button__label {
60
+ display: inline-block;
61
+ }
62
+
63
+ .button__label::slotted(nile-icon) {
64
+ vertical-align: -2px;
65
+ }
66
+
67
+ /* Default */
68
+ .button--default {
69
+ border: 1px solid #c7ced4;
70
+ background: #fff;
71
+ color: black;
72
+ }
73
+
74
+ .button--default:hover:not(.button--disabled) {
75
+ border: 1px solid #c7ced4;
76
+ background: #e5e9eb;
77
+ }
78
+
79
+ .button--default:active:not(.button--disabled) {
80
+ border: 1px solid #c7ced4;
81
+ background: #e5e9eb;
82
+ }
83
+
84
+ .button--checked {
85
+ border: 1px solid #c7ced4;
86
+ background: #e5e9eb;
87
+ }
88
+
89
+ .button--has-label.button--medium .button__label {
90
+ padding: 0 var(--nile-spacing-medium);
91
+ }
92
+
93
+ .button--has-prefix.button--medium {
94
+ padding-inline-start: var(--nile-spacing-small);
95
+ }
96
+
97
+ .button--has-prefix.button--medium .button__label {
98
+ padding-inline-start: var(--nile-spacing-small);
99
+ }
100
+
101
+ .button--has-suffix.button--medium,
102
+ .button--caret.button--medium {
103
+ padding-inline-end: var(--nile-spacing-small);
104
+ }
105
+
106
+ .button--has-suffix.button--medium .button__label,
107
+ .button--caret.button--medium .button__label {
108
+ padding-inline-end: var(--nile-spacing-small);
109
+ }
110
+
111
+ .nile-radio-button--first {
112
+ background-color: red;
113
+ }
114
+
115
+ :host(.nile-radio-button--first:not(.nile-radio-button--last)) .button {
116
+ border-start-end-radius: 0;
117
+ border-end-end-radius: 0;
118
+ }
119
+
120
+ :host(.nile-group-button--inner) .button {
121
+ border-radius: 0;
122
+ }
123
+
124
+ :host(.nile-radio-button--last:not(.nile-radio-button--first)) .button {
125
+ border-start-start-radius: 0;
126
+ border-end-start-radius: 0;
127
+ }
128
+
129
+ /* All except the first */
130
+ :host(.nile-radio-button__button:not(.nile-radio-button__button--first)) {
131
+ margin-inline-start: calc(-1 * var(--nile-input-border-width));
132
+ }
133
+
134
+ :host(.nile-radio-button--inner) .button {
135
+ border-radius: 0;
136
+ border-left: 0;
137
+ border-right: 0;
138
+ }
139
+
140
+ .button__prefix,
141
+ .button__suffix,
142
+ .button__label {
143
+ display: inline-flex;
144
+ position: relative;
145
+ align-items: center;
146
+ }
147
+
148
+ /* We use a hidden input so constraint validation errors work, since they don't appear to show when used with buttons.
149
+ We can't actually hide it, though, otherwise the messages will be suppressed by the browser. */
150
+ .hidden-input {
151
+ all: unset;
152
+ position: absolute;
153
+ top: 0;
154
+ left: 0;
155
+ bottom: 0;
156
+ right: 0;
157
+ outline: dotted 1px red;
158
+ opacity: 0;
159
+ z-index: -1;
160
+ }
161
+ `;export{e as s};
@@ -0,0 +1,21 @@
1
+ import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{query as s,state as e,customElement as o}from"lit/decorators.js";import{s as l}from"./nile-radio-button.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{H as a}from"../slot.esm.js";import{classMap as n}from"lit/directives/class-map.js";import{ifDefined as d}from"lit/directives/if-defined.js";import{w as u}from"../internal/watch.esm.js";import{n as h}from"../property-09139d3c.esm.js";import"lit";let f=class extends r{constructor(){super(...arguments),this.hasSlotController=new a(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.checked=!1,this.disabled=!1,this.size="medium",this.pill=!1}static get styles(){return[l]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){return i`
2
+ <div part="base" role="presentation">
3
+ <button
4
+ part="${"button"+(this.checked?" button--checked":"")}"
5
+ role="radio"
6
+ aria-checked="${this.checked}"
7
+ class=${n({button:!0,"button--default":!0,"button--checked":this.checked,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")})}
8
+ aria-disabled=${this.disabled}
9
+ type="button"
10
+ value=${d(this.value)}
11
+ tabindex="${this.checked?"0":"-1"}"
12
+ @blur=${this.handleBlur}
13
+ @focus=${this.handleFocus}
14
+ @click=${this.handleClick}
15
+ >
16
+ <slot name="prefix" part="prefix" class="button__prefix"></slot>
17
+ <slot part="label" class="button__label"></slot>
18
+ <slot name="suffix" part="suffix" class="button__suffix"></slot>
19
+ </button>
20
+ </div>
21
+ `}};t([s(".button")],f.prototype,"input",void 0),t([s(".hidden-input")],f.prototype,"hiddenInput",void 0),t([e()],f.prototype,"hasFocus",void 0),t([h({type:Boolean,reflect:!0})],f.prototype,"checked",void 0),t([h()],f.prototype,"value",void 0),t([h({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),t([h({reflect:!0})],f.prototype,"size",void 0),t([h({type:Boolean,reflect:!0})],f.prototype,"pill",void 0),t([u("disabled",{waitUntilFirstUpdate:!0})],f.prototype,"handleDisabledChange",null),f=t([o("nile-radio-button")],f);export{f as N};
@@ -0,0 +1,2 @@
1
+ System.register(["./nile-radio-button-group.cjs.js","tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","lit","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-button-group.css.cjs.js","../index-0da7021a.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileRadioButtonGroupCjsJs){_export("NileRadioButtonGroup",_nileRadioButtonGroupCjsJs.N);},function(_tslib){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalSlotCjsJs){},function(_lit){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){},function(_nileRadioButtonGroupCssCjsJs){},function(_index001CjsJs){}],execute:function(){}};});
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export{N as NileRadioButtonGroup}from"./nile-radio-button-group.esm.js";import"tslib";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/slot.esm.js";import"lit";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";import"./nile-radio-button-group.css.esm.js";import"../index-cd2f9c12.esm.js";
@@ -0,0 +1,2 @@
1
+ System.register(["tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","lit","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-button-group.css.cjs.js","../index-0da7021a.cjs.js"],function(_export,_context){"use strict";var t,i,e,o,s,l,r,a,n,h,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_litDirectivesClassMapJs){i=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){e=_litDecoratorsJs.query;o=_litDecoratorsJs.state;s=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_internalSlotCjsJs){r=_internalSlotCjsJs.H;},function(_lit){a=_lit.html;},function(_internalWatchCjsJs){n=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_nileRadioButtonGroupCssCjsJs){d=_nileRadioButtonGroupCssCjsJs.s;},function(_index001CjsJs){}],execute:function(){_export("N",c=/*#__PURE__*/function(_h){_inherits(c,_h);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"help-text","label"),_this.customValidityMessage="",_this.hasButtonGroup=!1,_this.defaultValue="",_this.label="",_this.name="option",_this.value="",_this.form="",_this.required=!1,_this.labelInline=!1,_this.disabled=!1,_this.helpText="",_this.errorMessage="";return _this;}_createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.defaultValue=this.value,this.handleInitialDisabledState();}},{key:"getAllRadios",value:function getAllRadios(){return _toConsumableArray(this.querySelectorAll("nile-radio-button"));}},{key:"handleRadioClick",value:function handleRadioClick(t){var i=t.target.closest("nile-radio-button"),e=this.getAllRadios(),o=this.value;i.disabled||(this.value=i.value,e.forEach(function(t){return t.checked=t===i;}),this.value!==o&&(this.emit("nile-change",{value:this.value}),this.emit("input")));}},{key:"handleDisabledChange",value:function handleDisabledChange(){var _this2=this;this.getAllRadios().forEach(function(t){t.disabled=_this2.disabled;});}},{key:"handleInitialDisabledState",value:function handleInitialDisabledState(){var _this3=this;this.getAllRadios().forEach(function(t){t.disabled=t.hasAttribute("disabled")?t.disabled:_this3.disabled;});}},{key:"handleKeyDown",value:function handleKeyDown(t){var _i$find,_this4=this;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;var i=this.getAllRadios().filter(function(t){return!t.disabled;}),e=(_i$find=i.find(function(t){return t.checked;}))!==null&&_i$find!==void 0?_i$find:i[0],o=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,s=this.value;var l=i.indexOf(e)+o;l<0&&(l=i.length-1),l>i.length-1&&(l=0),this.getAllRadios().forEach(function(t){t.checked=!1,_this4.hasButtonGroup||(t.tabIndex=-1);}),this.value=i[l].value,i[l].checked=!0,this.hasButtonGroup?i[l].shadowRoot.querySelector("button").focus():(i[l].tabIndex=0,i[l].focus()),this.value!==s&&(this.emit("change"),this.emit("input")),t.preventDefault();}},{key:"handleLabelClick",value:function handleLabelClick(){var t=this.getAllRadios(),i=t.find(function(t){return t.checked;})||t[0];i&&i.focus();}},{key:"handleSlotChange",value:function handleSlotChange(){var _this5=this,_this$shadowRoot;var t=this.getAllRadios();if(t.forEach(function(t){return t.checked=t.value===_this5.value;}),this.hasButtonGroup=t.some(function(t){return"nile-radio-button"===t.tagName.toLowerCase();}),!t.some(function(t){return t.checked;}))if(this.hasButtonGroup){t[0].shadowRoot.querySelector("button").tabIndex=0;}else t[0].tabIndex=0;this.hasButtonGroup&&((_this$shadowRoot=this.shadowRoot)===null||_this$shadowRoot===void 0?void 0:_this$shadowRoot.querySelector("nile-button-group"));var i=_toConsumableArray(this.defaultSlot.assignedElements({flatten:!0}));i.forEach(function(t){var e=i.indexOf(t),o=_this5.findButton(t);null!==o&&(o.classList.toggle("nile-radio-button--first",0===e),o.classList.toggle("nile-radio-button--inner",e>0&&e<i.length-1),o.classList.toggle("nile-radio-button--last",e===i.length-1));});}},{key:"findButton",value:function findButton(t){var _t$closest;var i="nile-radio-button";return(_t$closest=t.closest(i))!==null&&_t$closest!==void 0?_t$closest:t.querySelector(i);}},{key:"updateCheckedRadio",value:function updateCheckedRadio(){var _this6=this;this.getAllRadios().forEach(function(t){return t.checked=t.value===_this6.value;});}},{key:"handleValueChange",value:function handleValueChange(){this.hasUpdated&&this.updateCheckedRadio();}},{key:"render",value:function render(){var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var e=!!this.label||!!t,o=!!this.helpText,s=!!this.errorMessage,l=a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <slot\n @click=","\n @keydown=","\n @slotchange=","\n role=\"presentation\"\n ></slot>\n "])),this.handleRadioClick,this.handleKeyDown,this.handleSlotChange);return a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <fieldset\n part=\"form-control\"\n class=","\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-describedby=\"help-text\"\n aria-errormessage=\"error-message\"\n >\n <label\n part=\"form-control-label\"\n id=\"label\"\n class=\"form-control__label\"\n aria-hidden=","\n @click=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div class=\"visually-hidden\">\n <label class=\"radio-group__validation\">\n <input\n type=\"text\"\n class=\"radio-group__validation-input\"\n ?required=","\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ","\n </div>\n\n ","\n ","\n </fieldset>\n "])),i({"form-control":!0,"form-control--medium":!0,"form-control--radio-group":!0,"form-control--has-label":e,"form-control--has-help-text":o}),e?"false":"true",this.handleLabelClick,this.label,this.required,this.hasButtonGroup?a(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" "," "])),l):a(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div\n class=\"","\"\n >\n ","\n </div>\n "])),this.labelInline?"form-control--inline-radio":"",l),o?a(_templateObject5||(_templateObject5=_taggedTemplateLiteral([" <nile-form-help-text>","</nile-form-help-text> "])),this.helpText):"",s?a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}]);return c;}(h));c.styles=d,t([e("slot:not([name])")],c.prototype,"defaultSlot",void 0),t([o()],c.prototype,"hasButtonGroup",void 0),t([o()],c.prototype,"defaultValue",void 0),t([s()],c.prototype,"label",void 0),t([s()],c.prototype,"name",void 0),t([s({reflect:!0})],c.prototype,"value",void 0),t([s({reflect:!0})],c.prototype,"form",void 0),t([s({type:Boolean,reflect:!0})],c.prototype,"required",void 0),t([s({type:Boolean,reflect:!0})],c.prototype,"labelInline",void 0),t([s({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([s({attribute:"help-text"})],c.prototype,"helpText",void 0),t([s({attribute:"error-message"})],c.prototype,"errorMessage",void 0),t([n("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",null),t([n("value")],c.prototype,"handleValueChange",null),_export("N",c=t([l("nile-radio-button-group")],c));}};});
2
+ //# sourceMappingURL=nile-radio-button-group.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-radio-button-group.cjs.js","sources":["../../../src/nile-radio-button-group/nile-radio-button-group.ts"],"sourcesContent":["import { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { HasSlotController } from '../internal/slot';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport styles from './nile-radio-button-group.css';\nimport type { CSSResultGroup } from 'lit';\nimport type NileRadioButton from '../nile-radio-button/nile-radio-button';\n\n/**\n * @summary Radio groups are used to group multiple [radios](/components/radio) or [radio buttons](/components/radio-button) so they function as a single form control.\n *\n * @dependency nile-button-group\n *\n * @slot - The default slot where `<nile-radio>` or `<nile-radio-button>` elements are placed.\n * @slot label - The radio group's label. Required for proper accessibility. Alternatively, you can use the `label`\n * attribute.\n *\n * @event change - Emitted when the radio group's selected value changes.\n * @event input - Emitted when the radio group receives user input.\n * @event invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n * @csspart button-group - The button group that wraps radio buttons.\n * @csspart button-group__base - The button group's `base` part.\n */\n@customElement('nile-radio-button-group')\nexport class NileRadioButtonGroup extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n private customValidityMessage = '';\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @state() private hasButtonGroup = false;\n\n @state() defaultValue = '';\n\n /**\n * The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot\n * instead.\n */\n @property() label = '';\n\n /** The name of the radio group, submitted as a name/value pair with form data. */\n @property() name = 'option';\n\n /** The current value of the radio group, submitted as a name/value pair with form data. */\n @property({ reflect: true }) value = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Ensures a child radio is checked before allowing the containing form to submit. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Used to show radio in inline or not */\n @property({ type: Boolean, reflect: true }) labelInline = false;\n\n /** Used to disabled or not */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ attribute: 'help-text' }) helpText = '';\n\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n connectedCallback() {\n super.connectedCallback();\n this.defaultValue = this.value;\n this.handleInitialDisabledState();\n }\n\n private getAllRadios() {\n return [...this.querySelectorAll<NileRadioButton>('nile-radio-button')];\n }\n\n private handleRadioClick(event: MouseEvent) {\n const target = (event.target as HTMLElement).closest<NileRadioButton>(\n 'nile-radio-button'\n )!;\n const radios = this.getAllRadios();\n const oldValue = this.value;\n\n if (target.disabled) {\n return;\n }\n\n this.value = target.value;\n radios.forEach(radio => (radio.checked = radio === target));\n\n if (this.value !== oldValue) {\n this.emit('nile-change', { value: this.value });\n this.emit('input');\n }\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = this.disabled;\n });\n }\n\n private handleInitialDisabledState() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = radio.hasAttribute('disabled')\n ? radio.disabled\n : this.disabled;\n });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (\n !['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(\n event.key\n )\n ) {\n return;\n }\n\n const radios = this.getAllRadios().filter(radio => !radio.disabled);\n const checkedRadio = radios.find(radio => radio.checked) ?? radios[0];\n const incr =\n event.key === ' '\n ? 0\n : ['ArrowUp', 'ArrowLeft'].includes(event.key)\n ? -1\n : 1;\n const oldValue = this.value;\n let index = radios.indexOf(checkedRadio) + incr;\n\n if (index < 0) {\n index = radios.length - 1;\n }\n\n if (index > radios.length - 1) {\n index = 0;\n }\n\n this.getAllRadios().forEach(radio => {\n radio.checked = false;\n\n if (!this.hasButtonGroup) {\n radio.tabIndex = -1;\n }\n });\n\n this.value = radios[index].value;\n radios[index].checked = true;\n\n if (!this.hasButtonGroup) {\n radios[index].tabIndex = 0;\n radios[index].focus();\n } else {\n radios[index].shadowRoot!.querySelector('button')!.focus();\n }\n\n if (this.value !== oldValue) {\n this.emit('change');\n this.emit('input');\n }\n\n event.preventDefault();\n }\n\n private handleLabelClick() {\n const radios = this.getAllRadios();\n const checked = radios.find(radio => radio.checked);\n const radioToFocus = checked || radios[0];\n\n // Move focus to the checked radio (or the first one if none are checked) when clicking the label\n if (radioToFocus) {\n radioToFocus.focus();\n }\n }\n\n private handleSlotChange() {\n const radios = this.getAllRadios();\n\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n\n this.hasButtonGroup = radios.some(\n radio => radio.tagName.toLowerCase() === 'nile-radio-button'\n );\n\n if (!radios.some(radio => radio.checked)) {\n if (this.hasButtonGroup) {\n const buttonRadio = radios[0].shadowRoot!.querySelector('button')!;\n buttonRadio.tabIndex = 0;\n } else {\n radios[0].tabIndex = 0;\n }\n }\n\n if (this.hasButtonGroup) {\n const buttonGroup = this.shadowRoot?.querySelector('nile-button-group');\n }\n\n const slottedElements = [\n ...this.defaultSlot.assignedElements({ flatten: true }),\n ] as HTMLElement[];\n\n // console.log(slottedElements);\n\n slottedElements.forEach(el => {\n const index = slottedElements.indexOf(el);\n const button = this.findButton(el);\n\n if (button !== null) {\n button.classList.toggle('nile-radio-button--first', index === 0);\n button.classList.toggle(\n 'nile-radio-button--inner',\n index > 0 && index < slottedElements.length - 1\n );\n button.classList.toggle(\n 'nile-radio-button--last',\n index === slottedElements.length - 1\n );\n }\n });\n }\n\n private findButton(el: HTMLElement) {\n const selector = 'nile-radio-button';\n\n return el.closest(selector) ?? el.querySelector(selector);\n }\n\n private updateCheckedRadio() {\n const radios = this.getAllRadios();\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n }\n\n @watch('value')\n handleValueChange() {\n if (this.hasUpdated) {\n this.updateCheckedRadio();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n const defaultSlot = html`\n <slot\n @click=${this.handleRadioClick}\n @keydown=${this.handleKeyDown}\n @slotchange=${this.handleSlotChange}\n role=\"presentation\"\n ></slot>\n `;\n\n return html`\n <fieldset\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--radio-group': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n })}\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-describedby=\"help-text\"\n aria-errormessage=\"error-message\"\n >\n <label\n part=\"form-control-label\"\n id=\"label\"\n class=\"form-control__label\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n @click=${this.handleLabelClick}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div class=\"visually-hidden\">\n <label class=\"radio-group__validation\">\n <input\n type=\"text\"\n class=\"radio-group__validation-input\"\n ?required=${this.required}\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ${this.hasButtonGroup\n ? html` ${defaultSlot} `\n : html`\n <div\n class=\"${this.labelInline\n ? `form-control--inline-radio`\n : ``}\"\n >\n ${defaultSlot}\n </div>\n `}\n </div>\n\n ${hasHelpText\n ? html` <nile-form-help-text>${this.helpText}</nile-form-help-text> `\n : ``}\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}\n </fieldset>\n `;\n }\n}\n\nexport default NileRadioButtonGroup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio-button-group': NileRadioButtonGroup;\n }\n}\n"],"names":["NileRadioButtonGroup","_h","_inherits","c","_super","_createSuper","this","hasSlotController","HasSlotController","customValidityMessage","hasButtonGroup","defaultValue","label","name","value","form","required","labelInline","disabled","helpText","errorMessage","_this","_createClass","key","connectedCallback","super","handleInitialDisabledState","getAllRadios","_toConsumableArray","querySelectorAll","handleRadioClick","event","target","closest","radios","oldValue","forEach","radio","checked","emit","handleDisabledChange","hasAttribute","handleKeyDown","includes","filter","checkedRadio","find","incr","index","indexOf","length","tabIndex","shadowRoot","querySelector","focus","preventDefault","handleLabelClick","radioToFocus","handleSlotChange","some","tagName","toLowerCase","slottedElements","defaultSlot","assignedElements","flatten","el","button","findButton","classList","toggle","selector","_t$closest","updateCheckedRadio","handleValueChange","hasUpdated","render","hasLabelSlot","test","hasLabel","hasHelpText","hasErrorMessage","html","_templateObject","_taggedTemplateLiteral","_templateObject2","classMap","_templateObject3","_templateObject4","_templateObject5","_templateObject6","NileElement","styles","__decorate","query","prototype","state","property","reflect","type","Boolean","attribute","watch","waitUntilFirstUpdate","_export","customElement"],"mappings":"4uLA0BaA,CAAN,uBAAAC,EAAA,EAAAC,SAAA,CAAAC,CAAA,CAAA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I,SAAW,CAAA,eAAA,CAAA,CAAA,CAAA,CAAqCrG,EAAA+F,SAAA,CAAA,cAAA,CAAA,IAAA,EAiC5DF,CAAAA,CAAAA,CAAAA,CAAA,CADCS,CAAAA,CAAM,UAAY,CAAA,CAAEC,sBAAsB,CAK1CvG,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA+F,SAAA,CAAA,sBAAA,CAAA,IAqIDF,CAAAA,CAAAA,CAAAA,CAAA,CADCS,CAAAA,CAAM,UAKNtG,CAAA+F,CAAAA,SAAAA,CAAA,mBAAA,CAAA,IAAA,CAAA,CAAAS,OAAA,KA5NUxG,CAAoB6F,CAAAA,CAAAA,CAAA,CADhCY,CAAAA,CAAc,4BACFzG"}
@@ -0,0 +1,2 @@
1
+ System.register(["../index-0da7021a.cjs.js"],function(_export,_context){"use strict";var o,_templateObject,r;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){o=_index001CjsJs.i;}],execute:function(){_export("s",r=[o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: block;\n }\n\n .form-control {\n border: none;\n padding: 0;\n margin: 0;\n }\n\n .form-control__label {\n padding: 0;\n font-size: 14px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .radio-group--required .radio-group__label::after {\n content: '*';\n margin-inline-start: -2px;\n }\n\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n .form-control-input {\n display: flex;\n flex-wrap: nowrap;\n }\n\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 12px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n"])))]);}};});
2
+ //# sourceMappingURL=nile-radio-button-group.css.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-radio-button-group.css.cjs.js","sources":["../../../src/nile-radio-button-group/nile-radio-button-group.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * RadioButtonGroup CSS\n */\nexport const styles = css`\n :host {\n display: block;\n }\n\n .form-control {\n border: none;\n padding: 0;\n margin: 0;\n }\n\n .form-control__label {\n padding: 0;\n font-size: 14px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .radio-group--required .radio-group__label::after {\n content: '*';\n margin-inline-start: -2px;\n }\n\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n .form-control-input {\n display: flex;\n flex-wrap: nowrap;\n }\n\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: inherit;\n margin-bottom: 12px;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n`;\n\nexport default [styles];\n"],"names":["styles$1","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAuEeA,CAAA,CAAA,CA3DOC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -0,0 +1,58 @@
1
+ import{i as o}from"../index-cd2f9c12.esm.js";var r=[o`
2
+ :host {
3
+ display: block;
4
+ }
5
+
6
+ .form-control {
7
+ border: none;
8
+ padding: 0;
9
+ margin: 0;
10
+ }
11
+
12
+ .form-control__label {
13
+ padding: 0;
14
+ font-size: 14px;
15
+ color: var(--nile-colors-dark-900);
16
+ font-family: Colfax-regular;
17
+ font-size: 14px;
18
+ font-style: normal;
19
+ font-weight: 400;
20
+ line-height: 14px;
21
+ letter-spacing: 0.2px;
22
+ }
23
+
24
+ .radio-group--required .radio-group__label::after {
25
+ content: '*';
26
+ margin-inline-start: -2px;
27
+ }
28
+
29
+ .visually-hidden {
30
+ position: absolute;
31
+ width: 1px;
32
+ height: 1px;
33
+ padding: 0;
34
+ margin: -1px;
35
+ overflow: hidden;
36
+ clip: rect(0, 0, 0, 0);
37
+ white-space: nowrap;
38
+ border: 0;
39
+ }
40
+
41
+ .form-control-input {
42
+ display: flex;
43
+ flex-wrap: nowrap;
44
+ }
45
+
46
+ .form-control--has-label .form-control__label {
47
+ display: inline-block;
48
+ color: inherit;
49
+ margin-bottom: 12px;
50
+ color: var(--nile-colors-dark-900);
51
+ font-family: Colfax-regular;
52
+ font-size: 14px;
53
+ font-style: normal;
54
+ font-weight: 400;
55
+ line-height: 14px;
56
+ letter-spacing: 0.2px;
57
+ }
58
+ `];export{r as s};
@@ -0,0 +1,56 @@
1
+ import{__decorate as t}from"tslib";import{classMap as i}from"lit/directives/class-map.js";import{query as e,state as o,property as s,customElement as l}from"lit/decorators.js";import{H as r}from"../internal/slot.esm.js";import{html as a}from"lit";import{w as n}from"../internal/watch.esm.js";import{N as h}from"../internal/nile-element.esm.js";import{s as d}from"./nile-radio-button-group.css.esm.js";import"../index-cd2f9c12.esm.js";let c=class extends h{constructor(){super(...arguments),this.hasSlotController=new r(this,"help-text","label"),this.customValidityMessage="",this.hasButtonGroup=!1,this.defaultValue="",this.label="",this.name="option",this.value="",this.form="",this.required=!1,this.labelInline=!1,this.disabled=!1,this.helpText="",this.errorMessage=""}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value,this.handleInitialDisabledState()}getAllRadios(){return[...this.querySelectorAll("nile-radio-button")]}handleRadioClick(t){const i=t.target.closest("nile-radio-button"),e=this.getAllRadios(),o=this.value;i.disabled||(this.value=i.value,e.forEach((t=>t.checked=t===i)),this.value!==o&&(this.emit("nile-change",{value:this.value}),this.emit("input")))}handleDisabledChange(){this.getAllRadios().forEach((t=>{t.disabled=this.disabled}))}handleInitialDisabledState(){this.getAllRadios().forEach((t=>{t.disabled=t.hasAttribute("disabled")?t.disabled:this.disabled}))}handleKeyDown(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;const i=this.getAllRadios().filter((t=>!t.disabled)),e=i.find((t=>t.checked))??i[0],o=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,s=this.value;let l=i.indexOf(e)+o;l<0&&(l=i.length-1),l>i.length-1&&(l=0),this.getAllRadios().forEach((t=>{t.checked=!1,this.hasButtonGroup||(t.tabIndex=-1)})),this.value=i[l].value,i[l].checked=!0,this.hasButtonGroup?i[l].shadowRoot.querySelector("button").focus():(i[l].tabIndex=0,i[l].focus()),this.value!==s&&(this.emit("change"),this.emit("input")),t.preventDefault()}handleLabelClick(){const t=this.getAllRadios(),i=t.find((t=>t.checked))||t[0];i&&i.focus()}handleSlotChange(){const t=this.getAllRadios();if(t.forEach((t=>t.checked=t.value===this.value)),this.hasButtonGroup=t.some((t=>"nile-radio-button"===t.tagName.toLowerCase())),!t.some((t=>t.checked)))if(this.hasButtonGroup){t[0].shadowRoot.querySelector("button").tabIndex=0}else t[0].tabIndex=0;this.hasButtonGroup&&this.shadowRoot?.querySelector("nile-button-group");const i=[...this.defaultSlot.assignedElements({flatten:!0})];i.forEach((t=>{const e=i.indexOf(t),o=this.findButton(t);null!==o&&(o.classList.toggle("nile-radio-button--first",0===e),o.classList.toggle("nile-radio-button--inner",e>0&&e<i.length-1),o.classList.toggle("nile-radio-button--last",e===i.length-1))}))}findButton(t){const i="nile-radio-button";return t.closest(i)??t.querySelector(i)}updateCheckedRadio(){this.getAllRadios().forEach((t=>t.checked=t.value===this.value))}handleValueChange(){this.hasUpdated&&this.updateCheckedRadio()}render(){const t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");const e=!!this.label||!!t,o=!!this.helpText,s=!!this.errorMessage,l=a`
2
+ <slot
3
+ @click=${this.handleRadioClick}
4
+ @keydown=${this.handleKeyDown}
5
+ @slotchange=${this.handleSlotChange}
6
+ role="presentation"
7
+ ></slot>
8
+ `;return a`
9
+ <fieldset
10
+ part="form-control"
11
+ class=${i({"form-control":!0,"form-control--medium":!0,"form-control--radio-group":!0,"form-control--has-label":e,"form-control--has-help-text":o})}
12
+ role="radiogroup"
13
+ aria-labelledby="label"
14
+ aria-describedby="help-text"
15
+ aria-errormessage="error-message"
16
+ >
17
+ <label
18
+ part="form-control-label"
19
+ id="label"
20
+ class="form-control__label"
21
+ aria-hidden=${e?"false":"true"}
22
+ @click=${this.handleLabelClick}
23
+ >
24
+ <slot name="label">${this.label}</slot>
25
+ </label>
26
+
27
+ <div part="form-control-input" class="form-control-input">
28
+ <div class="visually-hidden">
29
+ <label class="radio-group__validation">
30
+ <input
31
+ type="text"
32
+ class="radio-group__validation-input"
33
+ ?required=${this.required}
34
+ tabindex="-1"
35
+ hidden
36
+ />
37
+ </label>
38
+ </div>
39
+
40
+ ${this.hasButtonGroup?a` ${l} `:a`
41
+ <div
42
+ class="${this.labelInline?"form-control--inline-radio":""}"
43
+ >
44
+ ${l}
45
+ </div>
46
+ `}
47
+ </div>
48
+
49
+ ${o?a` <nile-form-help-text>${this.helpText}</nile-form-help-text> `:""}
50
+ ${s?a`
51
+ <nile-form-error-message
52
+ >${this.errorMessage}</nile-form-error-message
53
+ >
54
+ `:""}
55
+ </fieldset>
56
+ `}};c.styles=d,t([e("slot:not([name])")],c.prototype,"defaultSlot",void 0),t([o()],c.prototype,"hasButtonGroup",void 0),t([o()],c.prototype,"defaultValue",void 0),t([s()],c.prototype,"label",void 0),t([s()],c.prototype,"name",void 0),t([s({reflect:!0})],c.prototype,"value",void 0),t([s({reflect:!0})],c.prototype,"form",void 0),t([s({type:Boolean,reflect:!0})],c.prototype,"required",void 0),t([s({type:Boolean,reflect:!0})],c.prototype,"labelInline",void 0),t([s({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([s({attribute:"help-text"})],c.prototype,"helpText",void 0),t([s({attribute:"error-message"})],c.prototype,"errorMessage",void 0),t([n("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",null),t([n("value")],c.prototype,"handleValueChange",null),c=t([l("nile-radio-button-group")],c);export{c as N};