@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,57 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { CSSResultArray, TemplateResult } from 'lit-element';
8
+ import NileElement from '../internal/nile-element';
9
+ /**
10
+ * Nile icon component.
11
+ *
12
+ * @tag nile-radio-button
13
+ *
14
+ */
15
+ export declare class NileRadioButton extends NileElement {
16
+ /**
17
+ * The styles for RadioButton
18
+ * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
19
+ */
20
+ static get styles(): CSSResultArray;
21
+ private readonly hasSlotController;
22
+ input: HTMLInputElement;
23
+ hiddenInput: HTMLInputElement;
24
+ protected hasFocus: boolean;
25
+ /**
26
+ * @internal The radio button's checked state. This is exposed as an "internal" attribute so we can reflect it, making
27
+ * it easier to style in button groups.
28
+ */
29
+ checked: boolean;
30
+ /** The radio's value. When selected, the radio group will receive this value. */
31
+ value: string;
32
+ /** Disables the radio button. */
33
+ disabled: boolean;
34
+ /**
35
+ * The radio button's size. When used inside a radio group, the size will be determined by the radio group's size so
36
+ * this attribute can typically be omitted.
37
+ */
38
+ size: 'small' | 'medium' | 'large';
39
+ /** Draws a pill-style radio button with rounded edges. */
40
+ pill: boolean;
41
+ connectedCallback(): void;
42
+ private handleBlur;
43
+ private handleClick;
44
+ private handleFocus;
45
+ handleDisabledChange(): void;
46
+ /** Sets focus on the radio button. */
47
+ focus(options?: FocusOptions): void;
48
+ /** Removes focus from the radio button. */
49
+ blur(): void;
50
+ render(): TemplateResult<1>;
51
+ }
52
+ export default NileRadioButton;
53
+ declare global {
54
+ interface HTMLElementTagNameMap {
55
+ 'nile-radio-button': NileRadioButton;
56
+ }
57
+ }
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { __decorate } from "tslib";
8
+ import { html, property, } from 'lit-element';
9
+ import { customElement, query, state } from 'lit/decorators.js';
10
+ import { styles } from './nile-radio-button.css';
11
+ import NileElement from '../internal/nile-element';
12
+ import { HasSlotController } from '../slot';
13
+ import { classMap } from 'lit/directives/class-map.js';
14
+ import { ifDefined } from 'lit/directives/if-defined.js';
15
+ import { watch } from '../internal/watch';
16
+ /**
17
+ * Nile icon component.
18
+ *
19
+ * @tag nile-radio-button
20
+ *
21
+ */
22
+ let NileRadioButton = class NileRadioButton extends NileElement {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');
26
+ this.hasFocus = false;
27
+ /**
28
+ * @internal The radio button's checked state. This is exposed as an "internal" attribute so we can reflect it, making
29
+ * it easier to style in button groups.
30
+ */
31
+ this.checked = false;
32
+ /** Disables the radio button. */
33
+ this.disabled = false;
34
+ /**
35
+ * The radio button's size. When used inside a radio group, the size will be determined by the radio group's size so
36
+ * this attribute can typically be omitted.
37
+ */
38
+ this.size = 'medium';
39
+ /** Draws a pill-style radio button with rounded edges. */
40
+ this.pill = false;
41
+ }
42
+ /**
43
+ * The styles for RadioButton
44
+ * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
45
+ */
46
+ static get styles() {
47
+ return [styles];
48
+ }
49
+ connectedCallback() {
50
+ super.connectedCallback();
51
+ this.setAttribute('role', 'presentation');
52
+ }
53
+ handleBlur() {
54
+ this.hasFocus = false;
55
+ this.emit('nile-blur');
56
+ }
57
+ handleClick(e) {
58
+ if (this.disabled) {
59
+ e.preventDefault();
60
+ e.stopPropagation();
61
+ return;
62
+ }
63
+ this.checked = true;
64
+ }
65
+ handleFocus() {
66
+ this.hasFocus = true;
67
+ this.emit('nile-focus');
68
+ }
69
+ handleDisabledChange() {
70
+ this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');
71
+ }
72
+ /** Sets focus on the radio button. */
73
+ focus(options) {
74
+ this.input.focus(options);
75
+ }
76
+ /** Removes focus from the radio button. */
77
+ blur() {
78
+ this.input.blur();
79
+ }
80
+ render() {
81
+ return html `
82
+ <div part="base" role="presentation">
83
+ <button
84
+ part="${`button${this.checked ? ' button--checked' : ''}`}"
85
+ role="radio"
86
+ aria-checked="${this.checked}"
87
+ class=${classMap({
88
+ button: true,
89
+ 'button--default': true,
90
+ 'button--checked': this.checked,
91
+ 'button--disabled': this.disabled,
92
+ 'button--focused': this.hasFocus,
93
+ 'button--has-label': this.hasSlotController.test('[default]'),
94
+ 'button--has-prefix': this.hasSlotController.test('prefix'),
95
+ 'button--has-suffix': this.hasSlotController.test('suffix'),
96
+ })}
97
+ aria-disabled=${this.disabled}
98
+ type="button"
99
+ value=${ifDefined(this.value)}
100
+ tabindex="${this.checked ? '0' : '-1'}"
101
+ @blur=${this.handleBlur}
102
+ @focus=${this.handleFocus}
103
+ @click=${this.handleClick}
104
+ >
105
+ <slot name="prefix" part="prefix" class="button__prefix"></slot>
106
+ <slot part="label" class="button__label"></slot>
107
+ <slot name="suffix" part="suffix" class="button__suffix"></slot>
108
+ </button>
109
+ </div>
110
+ `;
111
+ }
112
+ };
113
+ __decorate([
114
+ query('.button')
115
+ ], NileRadioButton.prototype, "input", void 0);
116
+ __decorate([
117
+ query('.hidden-input')
118
+ ], NileRadioButton.prototype, "hiddenInput", void 0);
119
+ __decorate([
120
+ state()
121
+ ], NileRadioButton.prototype, "hasFocus", void 0);
122
+ __decorate([
123
+ property({ type: Boolean, reflect: true })
124
+ ], NileRadioButton.prototype, "checked", void 0);
125
+ __decorate([
126
+ property()
127
+ ], NileRadioButton.prototype, "value", void 0);
128
+ __decorate([
129
+ property({ type: Boolean, reflect: true })
130
+ ], NileRadioButton.prototype, "disabled", void 0);
131
+ __decorate([
132
+ property({ reflect: true })
133
+ ], NileRadioButton.prototype, "size", void 0);
134
+ __decorate([
135
+ property({ type: Boolean, reflect: true })
136
+ ], NileRadioButton.prototype, "pill", void 0);
137
+ __decorate([
138
+ watch('disabled', { waitUntilFirstUpdate: true })
139
+ ], NileRadioButton.prototype, "handleDisabledChange", null);
140
+ NileRadioButton = __decorate([
141
+ customElement('nile-radio-button')
142
+ ], NileRadioButton);
143
+ export { NileRadioButton };
144
+ export default NileRadioButton;
145
+ //# sourceMappingURL=nile-radio-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-radio-button.js","sourceRoot":"","sources":["../../../src/nile-radio-button/nile-radio-button.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;;;;GAKG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,WAAW;IAAzC;;QAQY,sBAAiB,GAAG,IAAI,iBAAiB,CACxD,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QAAQ,CACT,CAAC;QAKiB,aAAQ,GAAG,KAAK,CAAC;QAEpC;;;WAGG;QACyC,YAAO,GAAG,KAAK,CAAC;QAK5D,iCAAiC;QACW,aAAQ,GAAG,KAAK,CAAC;QAE7D;;;WAGG;QAC0B,SAAI,GAAiC,QAAQ,CAAC;QAE3E,0DAA0D;QACd,SAAI,GAAG,KAAK,CAAC;IA0E3D,CAAC;IAhHC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,C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cesContent":["/**\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 {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-radio-button.css';\nimport NileElement from '../internal/nile-element';\nimport { HasSlotController } from '../slot';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { watch } from '../internal/watch';\n\n/**\n * Nile icon component.\n *\n * @tag nile-radio-button\n *\n */\n@customElement('nile-radio-button')\nexport class NileRadioButton extends NileElement {\n /**\n * The styles for RadioButton\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n private readonly hasSlotController = new HasSlotController(\n this,\n '[default]',\n 'prefix',\n 'suffix'\n );\n\n @query('.button') input: HTMLInputElement;\n @query('.hidden-input') hiddenInput: HTMLInputElement;\n\n @state() protected hasFocus = false;\n\n /**\n * @internal The radio button's checked state. This is exposed as an \"internal\" attribute so we can reflect it, making\n * it easier to style in button groups.\n */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** The radio's value. When selected, the radio group will receive this value. */\n @property() value: string;\n\n /** Disables the radio button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * The radio button's size. When used inside a radio group, the size will be determined by the radio group's size so\n * this attribute can typically be omitted.\n */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Draws a pill-style radio button with rounded edges. */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'presentation');\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleClick(e: MouseEvent) {\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n this.checked = true;\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n /** Sets focus on the radio button. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the radio button. */\n blur() {\n this.input.blur();\n }\n\n render() {\n return html`\n <div part=\"base\" role=\"presentation\">\n <button\n part=\"${`button${this.checked ? ' button--checked' : ''}`}\"\n role=\"radio\"\n aria-checked=\"${this.checked}\"\n class=${classMap({\n button: true,\n 'button--default': true,\n 'button--checked': this.checked,\n 'button--disabled': this.disabled,\n 'button--focused': this.hasFocus,\n 'button--has-label': this.hasSlotController.test('[default]'),\n 'button--has-prefix': this.hasSlotController.test('prefix'),\n 'button--has-suffix': this.hasSlotController.test('suffix'),\n })}\n aria-disabled=${this.disabled}\n type=\"button\"\n value=${ifDefined(this.value)}\n tabindex=\"${this.checked ? '0' : '-1'}\"\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"button__prefix\"></slot>\n <slot part=\"label\" class=\"button__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"button__suffix\"></slot>\n </button>\n </div>\n `;\n }\n}\n\nexport default NileRadioButton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio-button': NileRadioButton;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export { NileRadioButtonGroup } from './nile-radio-button-group';
@@ -0,0 +1,2 @@
1
+ export { NileRadioButtonGroup } from './nile-radio-button-group';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-radio-button-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["export { NileRadioButtonGroup } from './nile-radio-button-group';\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * RadioButtonGroup CSS
9
+ */
10
+ export declare const styles: import("lit-element").CSSResult;
11
+ declare const _default: import("lit-element").CSSResult[];
12
+ export default _default;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { css } from 'lit-element';
8
+ /**
9
+ * RadioButtonGroup CSS
10
+ */
11
+ export const styles = css `
12
+ :host {
13
+ display: block;
14
+ }
15
+
16
+ .form-control {
17
+ border: none;
18
+ padding: 0;
19
+ margin: 0;
20
+ }
21
+
22
+ .form-control__label {
23
+ padding: 0;
24
+ font-size: 14px;
25
+ color: var(--nile-colors-dark-900);
26
+ font-family: Colfax-regular;
27
+ font-size: 14px;
28
+ font-style: normal;
29
+ font-weight: 400;
30
+ line-height: 14px;
31
+ letter-spacing: 0.2px;
32
+ }
33
+
34
+ .radio-group--required .radio-group__label::after {
35
+ content: '*';
36
+ margin-inline-start: -2px;
37
+ }
38
+
39
+ .visually-hidden {
40
+ position: absolute;
41
+ width: 1px;
42
+ height: 1px;
43
+ padding: 0;
44
+ margin: -1px;
45
+ overflow: hidden;
46
+ clip: rect(0, 0, 0, 0);
47
+ white-space: nowrap;
48
+ border: 0;
49
+ }
50
+
51
+ .form-control-input {
52
+ display: flex;
53
+ flex-wrap: nowrap;
54
+ }
55
+
56
+ .form-control--has-label .form-control__label {
57
+ display: inline-block;
58
+ color: inherit;
59
+ margin-bottom: 12px;
60
+ color: var(--nile-colors-dark-900);
61
+ font-family: Colfax-regular;
62
+ font-size: 14px;
63
+ font-style: normal;
64
+ font-weight: 400;
65
+ line-height: 14px;
66
+ letter-spacing: 0.2px;
67
+ }
68
+ `;
69
+ export default [styles];
70
+ //# sourceMappingURL=nile-radio-button-group.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-radio-button-group.css.js","sourceRoot":"","sources":["../../../src/nile-radio-button-group/nile-radio-button-group.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","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"]}
@@ -0,0 +1,66 @@
1
+ import NileElement from '../internal/nile-element';
2
+ import type { CSSResultGroup } from 'lit';
3
+ /**
4
+ * @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.
5
+ *
6
+ * @dependency nile-button-group
7
+ *
8
+ * @slot - The default slot where `<nile-radio>` or `<nile-radio-button>` elements are placed.
9
+ * @slot label - The radio group's label. Required for proper accessibility. Alternatively, you can use the `label`
10
+ * attribute.
11
+ *
12
+ * @event change - Emitted when the radio group's selected value changes.
13
+ * @event input - Emitted when the radio group receives user input.
14
+ * @event invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.
15
+ * @csspart button-group - The button group that wraps radio buttons.
16
+ * @csspart button-group__base - The button group's `base` part.
17
+ */
18
+ export declare class NileRadioButtonGroup extends NileElement {
19
+ static styles: CSSResultGroup;
20
+ private readonly hasSlotController;
21
+ private customValidityMessage;
22
+ defaultSlot: HTMLSlotElement;
23
+ private hasButtonGroup;
24
+ defaultValue: string;
25
+ /**
26
+ * The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot
27
+ * instead.
28
+ */
29
+ label: string;
30
+ /** The name of the radio group, submitted as a name/value pair with form data. */
31
+ name: string;
32
+ /** The current value of the radio group, submitted as a name/value pair with form data. */
33
+ value: string;
34
+ /**
35
+ * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you
36
+ * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in
37
+ * the same document or shadow root for this to work.
38
+ */
39
+ form: string;
40
+ /** Ensures a child radio is checked before allowing the containing form to submit. */
41
+ required: boolean;
42
+ /** Used to show radio in inline or not */
43
+ labelInline: boolean;
44
+ /** Used to disabled or not */
45
+ disabled: boolean;
46
+ helpText: string;
47
+ errorMessage: string;
48
+ connectedCallback(): void;
49
+ private getAllRadios;
50
+ private handleRadioClick;
51
+ handleDisabledChange(): void;
52
+ private handleInitialDisabledState;
53
+ private handleKeyDown;
54
+ private handleLabelClick;
55
+ private handleSlotChange;
56
+ private findButton;
57
+ private updateCheckedRadio;
58
+ handleValueChange(): void;
59
+ render(): import("lit-html").TemplateResult<1>;
60
+ }
61
+ export default NileRadioButtonGroup;
62
+ declare global {
63
+ interface HTMLElementTagNameMap {
64
+ 'nile-radio-button-group': NileRadioButtonGroup;
65
+ }
66
+ }