@aquera/nile-elements 0.0.6-10 → 0.0.6-12

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 (130) 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-button-toggle/index.d.ts +1 -0
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/index.js +2 -0
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/index.js.map +1 -0
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/{nile-radio-button/nile-radio-button.css.d.ts → nile-button-toggle/nile-button-toggle.css.d.ts} +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js +56 -0
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -0
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.d.ts +41 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.js +104 -0
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -0
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/index.d.ts +1 -0
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/index.js +2 -0
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/index.js.map +1 -0
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.d.ts +12 -0
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.js +17 -0
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.js.map +1 -0
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +41 -0
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +99 -0
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -0
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  23. package/demo/index.html +1 -1
  24. package/dist/index.cjs.js +1 -1
  25. package/dist/index.esm.js +1 -1
  26. package/dist/index.iife.js +251 -194
  27. package/dist/nile-button-toggle/index.cjs.js +2 -0
  28. package/dist/nile-button-toggle/index.esm.js +1 -0
  29. package/dist/nile-button-toggle/nile-button-toggle.cjs.js +2 -0
  30. package/dist/nile-button-toggle/nile-button-toggle.cjs.js.map +1 -0
  31. package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js +2 -0
  32. package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js.map +1 -0
  33. package/dist/nile-button-toggle/nile-button-toggle.css.esm.js +44 -0
  34. package/dist/nile-button-toggle/nile-button-toggle.esm.js +6 -0
  35. package/dist/nile-button-toggle-group/index.cjs.js +2 -0
  36. package/dist/nile-button-toggle-group/index.esm.js +1 -0
  37. package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js +2 -0
  38. package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js.map +1 -0
  39. package/dist/nile-button-toggle-group/nile-button-toggle-group.css.cjs.js +2 -0
  40. package/dist/nile-button-toggle-group/nile-button-toggle-group.css.cjs.js.map +1 -0
  41. package/dist/nile-button-toggle-group/nile-button-toggle-group.css.esm.js +5 -0
  42. package/dist/nile-button-toggle-group/nile-button-toggle-group.esm.js +1 -0
  43. package/dist/src/index.d.ts +2 -0
  44. package/dist/src/index.js +2 -0
  45. package/dist/src/index.js.map +1 -1
  46. package/dist/src/nile-button-toggle/index.d.ts +1 -0
  47. package/dist/src/nile-button-toggle/index.js +2 -0
  48. package/dist/src/nile-button-toggle/index.js.map +1 -0
  49. package/dist/src/{nile-radio-button/nile-radio-button.css.d.ts → nile-button-toggle/nile-button-toggle.css.d.ts} +1 -1
  50. package/dist/src/nile-button-toggle/nile-button-toggle.css.js +56 -0
  51. package/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -0
  52. package/dist/src/nile-button-toggle/nile-button-toggle.d.ts +41 -0
  53. package/dist/src/nile-button-toggle/nile-button-toggle.js +104 -0
  54. package/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -0
  55. package/dist/src/nile-button-toggle-group/index.d.ts +1 -0
  56. package/dist/src/nile-button-toggle-group/index.js +2 -0
  57. package/dist/src/nile-button-toggle-group/index.js.map +1 -0
  58. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.d.ts +12 -0
  59. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.js +17 -0
  60. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.js.map +1 -0
  61. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +41 -0
  62. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +99 -0
  63. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -0
  64. package/dist/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +1 -1
  66. package/src/index.ts +3 -1
  67. package/src/nile-button-toggle/index.ts +1 -0
  68. package/src/nile-button-toggle/nile-button-toggle.css.ts +58 -0
  69. package/src/nile-button-toggle/nile-button-toggle.ts +106 -0
  70. package/src/nile-button-toggle-group/index.ts +1 -0
  71. package/src/nile-button-toggle-group/nile-button-toggle-group.css.ts +19 -0
  72. package/src/nile-button-toggle-group/nile-button-toggle-group.ts +115 -0
  73. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/index.d.ts +0 -1
  74. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/index.js +0 -2
  75. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/index.js.map +0 -1
  76. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.css.js +0 -173
  77. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.css.js.map +0 -1
  78. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.d.ts +0 -57
  79. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.js +0 -145
  80. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.js.map +0 -1
  81. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/index.d.ts +0 -1
  82. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/index.js +0 -2
  83. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/index.js.map +0 -1
  84. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.css.d.ts +0 -12
  85. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.css.js +0 -70
  86. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.css.js.map +0 -1
  87. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.d.ts +0 -66
  88. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.js +0 -308
  89. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.js.map +0 -1
  90. package/dist/nile-radio-button/index.cjs.js +0 -2
  91. package/dist/nile-radio-button/index.esm.js +0 -1
  92. package/dist/nile-radio-button/nile-radio-button.cjs.js +0 -2
  93. package/dist/nile-radio-button/nile-radio-button.cjs.js.map +0 -1
  94. package/dist/nile-radio-button/nile-radio-button.css.cjs.js +0 -2
  95. package/dist/nile-radio-button/nile-radio-button.css.cjs.js.map +0 -1
  96. package/dist/nile-radio-button/nile-radio-button.css.esm.js +0 -161
  97. package/dist/nile-radio-button/nile-radio-button.esm.js +0 -21
  98. package/dist/nile-radio-button-group/index.cjs.js +0 -2
  99. package/dist/nile-radio-button-group/index.esm.js +0 -1
  100. package/dist/nile-radio-button-group/nile-radio-button-group.cjs.js +0 -2
  101. package/dist/nile-radio-button-group/nile-radio-button-group.cjs.js.map +0 -1
  102. package/dist/nile-radio-button-group/nile-radio-button-group.css.cjs.js +0 -2
  103. package/dist/nile-radio-button-group/nile-radio-button-group.css.cjs.js.map +0 -1
  104. package/dist/nile-radio-button-group/nile-radio-button-group.css.esm.js +0 -58
  105. package/dist/nile-radio-button-group/nile-radio-button-group.esm.js +0 -56
  106. package/dist/src/nile-radio-button/index.d.ts +0 -1
  107. package/dist/src/nile-radio-button/index.js +0 -2
  108. package/dist/src/nile-radio-button/index.js.map +0 -1
  109. package/dist/src/nile-radio-button/nile-radio-button.css.js +0 -173
  110. package/dist/src/nile-radio-button/nile-radio-button.css.js.map +0 -1
  111. package/dist/src/nile-radio-button/nile-radio-button.d.ts +0 -57
  112. package/dist/src/nile-radio-button/nile-radio-button.js +0 -145
  113. package/dist/src/nile-radio-button/nile-radio-button.js.map +0 -1
  114. package/dist/src/nile-radio-button-group/index.d.ts +0 -1
  115. package/dist/src/nile-radio-button-group/index.js +0 -2
  116. package/dist/src/nile-radio-button-group/index.js.map +0 -1
  117. package/dist/src/nile-radio-button-group/nile-radio-button-group.css.d.ts +0 -12
  118. package/dist/src/nile-radio-button-group/nile-radio-button-group.css.js +0 -70
  119. package/dist/src/nile-radio-button-group/nile-radio-button-group.css.js.map +0 -1
  120. package/dist/src/nile-radio-button-group/nile-radio-button-group.d.ts +0 -66
  121. package/dist/src/nile-radio-button-group/nile-radio-button-group.js +0 -308
  122. package/dist/src/nile-radio-button-group/nile-radio-button-group.js.map +0 -1
  123. package/src/nile-radio-button/index.ts +0 -1
  124. package/src/nile-radio-button/nile-radio-button.css.ts +0 -175
  125. package/src/nile-radio-button/nile-radio-button.ts +0 -151
  126. package/src/nile-radio-button-group/index.ts +0 -1
  127. package/src/nile-radio-button-group/nile-radio-button-group.css.ts +0 -72
  128. package/src/nile-radio-button-group/nile-radio-button-group.ts +0 -337
  129. /package/dist/{nile-radio-button → nile-button-toggle}/index.cjs.js.map +0 -0
  130. /package/dist/{nile-radio-button-group → nile-button-toggle-group}/index.cjs.js.map +0 -0
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "0.0.6-10",
6
+ "version": "0.0.6-12",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
package/src/index.ts CHANGED
@@ -29,6 +29,8 @@ export { NileErrorMessage } from './nile-error-message';
29
29
  export { NileFormErrorMessage } from './nile-form-error-message';
30
30
  export { NileFormHelpText } from './nile-form-help-text';
31
31
  export { NileCalendar } from './nile-calendar';
32
- export { NileLink } from './nile-link';
32
+ export { NileLink} from './nile-link';
33
+ export { NileButtonToggleGroup } from './nile-button-toggle-group';
34
+ export { NileButtonToggle } from './nile-button-toggle';
33
35
  export { NileSwitcher } from './nile-switcher';
34
36
  export { NileContentEditor } from './nile-content-editor';
@@ -0,0 +1 @@
1
+ export { NileButtonToggle } from './nile-button-toggle';
@@ -0,0 +1,58 @@
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
+ import { css } from 'lit-element';
9
+
10
+ /**
11
+ * ButtonToggle CSS
12
+ */
13
+ export const styles = css`
14
+ :host {
15
+ }
16
+
17
+ .nile-button-toggle {
18
+ display: flex;
19
+ padding: 12px;
20
+ border: 1px solid #ccc;
21
+ cursor: pointer;
22
+ border-radius: 4px;
23
+ color: #000;
24
+ text-align: center;
25
+ font-family: Colfax-regular;
26
+ font-size: 14px;
27
+ line-height: 14px;
28
+ letter-spacing: 0.2px;
29
+ justify-content: center;
30
+ align-items: center;
31
+ gap: 10px;
32
+ }
33
+
34
+ .nile-button-toggle__initial {
35
+ border-radius: 4px 0 0 4px;
36
+ }
37
+
38
+ .nile-button-toggle__end {
39
+ border-radius: 0 4px 4px 0;
40
+ }
41
+
42
+ .nile-button-toggle__middle {
43
+ border-width: 1px 0px;
44
+ border-style: solid;
45
+ border-color: #ccc;
46
+ border-radius: 0;
47
+ }
48
+
49
+ .nile-button-toggle__active {
50
+ background-color: #c7ced4;
51
+ }
52
+
53
+ .nile-button-toggle__disabled {
54
+ cursor: not-allowed;
55
+ }
56
+ `;
57
+
58
+ export default [styles];
@@ -0,0 +1,106 @@
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
+ import {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';
9
+ import { customElement } from 'lit/decorators.js';
10
+ import {styles} from './nile-button-toggle.css';
11
+ import NileElement from '../internal/nile-element';
12
+
13
+ /**
14
+ * Nile icon component.
15
+ *
16
+ * @tag nile-button-toggle
17
+ *
18
+ */
19
+ @customElement('nile-button-toggle')
20
+ export class NileButtonToggle extends NileElement {
21
+
22
+ /**
23
+ * The styles for ButtonToggle
24
+ * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
25
+ */
26
+ public static get styles(): CSSResultArray {
27
+ return [styles];
28
+ }
29
+
30
+ @property({ type: Boolean, reflect: true })
31
+ active = false;
32
+
33
+ @property({ type: Boolean, reflect: true })
34
+ initial = false;
35
+
36
+ @property({ type: Boolean, reflect: true })
37
+ middle = false;
38
+
39
+ @property({ type: Boolean, reflect: true })
40
+ end = false;
41
+
42
+ @property({ type: Boolean, reflect: true })
43
+ disabled = false;
44
+
45
+ @property({ type: String })
46
+ value = '';
47
+
48
+ connectedCallback() {
49
+ super.connectedCallback();
50
+ this.addEventListener('click', this.toggle);
51
+ }
52
+
53
+ disconnectedCallback() {
54
+ this.removeEventListener('click', this.toggle);
55
+ super.disconnectedCallback();
56
+ }
57
+
58
+ toggle() {
59
+ if (this.disabled) return;
60
+ this.active = true;
61
+ const eventData = { active: this.active, value: this.value };
62
+ this.dispatchEvent(new CustomEvent('nile-toggle-changed', { detail: eventData, bubbles: true }));
63
+ }
64
+
65
+ /**
66
+ * Render method
67
+ * @slot This is a slot test
68
+ */
69
+ public render(): TemplateResult {
70
+ let classes = ['nile-button-toggle'];
71
+ if (this.active) {
72
+ classes.push('nile-button-toggle__active');
73
+ }
74
+ if (this.initial) {
75
+ classes.push('nile-button-toggle__initial');
76
+ }
77
+ if (this.middle) {
78
+ classes.push('nile-button-toggle__middle');
79
+ }
80
+ if (this.end) {
81
+ classes.push('nile-button-toggle__end');
82
+ }
83
+ if (this.disabled) {
84
+ classes.push('nile-button-toggle__disabled');
85
+ }
86
+
87
+ const classString = classes.join(' ');
88
+
89
+ return html`
90
+ <div class="${classString}">
91
+ <slot name="prefix"></slot>
92
+ <slot> </slot>
93
+ </div>
94
+ `;
95
+ }
96
+
97
+ /* #endregion */
98
+ }
99
+
100
+ export default NileButtonToggle;
101
+
102
+ declare global {
103
+ interface HTMLElementTagNameMap {
104
+ 'nile-button-toggle': NileButtonToggle;
105
+ }
106
+ }
@@ -0,0 +1 @@
1
+ export { NileButtonToggleGroup } from './nile-button-toggle-group';
@@ -0,0 +1,19 @@
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
+ import {css} from 'lit-element';
9
+
10
+ /**
11
+ * ButtonToggleGroup CSS
12
+ */
13
+ export const styles = css`
14
+ :host {
15
+ display: inline-flex;
16
+ }
17
+ `;
18
+
19
+ export default [styles];
@@ -0,0 +1,115 @@
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
+ import {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';
9
+ import { customElement, query, queryAll } from 'lit/decorators.js';
10
+ import {styles} from './nile-button-toggle-group.css';
11
+ import NileButtonToggle from '../nile-button-toggle/nile-button-toggle';
12
+ import NileElement from '../internal/nile-element';
13
+ /**
14
+ * Nile icon component.
15
+ *
16
+ * @tag nile-button-toggle-group
17
+ *
18
+ */
19
+ @customElement('nile-button-toggle-group')
20
+ export class NileButtonToggleGroup extends NileElement {
21
+ /**
22
+ * The styles for ButtonToggleGroup
23
+ * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
24
+ */
25
+ public static get styles(): CSSResultArray {
26
+ return [styles];
27
+ }
28
+
29
+ @queryAll('nile-button-toggle')
30
+ private toggles!: NodeListOf<NileButtonToggle>;
31
+
32
+ @query('slot:not([name])')
33
+ private defaultSlot!: HTMLSlotElement;
34
+
35
+ @property({ type: Boolean, reflect: true })
36
+ public disabled: boolean = false;
37
+
38
+ connectedCallback() {
39
+ super.connectedCallback();
40
+ }
41
+
42
+ firstUpdated() {
43
+ this.defaultSlot.addEventListener('slotchange', () =>
44
+ this.updateTogglePositions()
45
+ );
46
+ this.addEventListener('nile-toggle-changed', this.handleToggle);
47
+ this.updateTogglePositions();
48
+ }
49
+
50
+ updated(changedProperties: Map<string | number | symbol, unknown>) {
51
+ super.updated(changedProperties);
52
+ if (changedProperties.has('disabled')) {
53
+ this.updateDisabledState();
54
+ }
55
+ }
56
+
57
+ private updateDisabledState() {
58
+ const assignedNodes = this.defaultSlot.assignedNodes({ flatten: true });
59
+ const toggles = assignedNodes.filter(
60
+ node => node instanceof NileButtonToggle
61
+ ) as NileButtonToggle[];
62
+
63
+ toggles.forEach(toggle => {
64
+ if (!toggle.disabled) {
65
+ toggle.disabled = this.disabled;
66
+ }
67
+ });
68
+ }
69
+
70
+ updateTogglePositions() {
71
+ const assignedNodes = this.defaultSlot.assignedNodes({ flatten: true });
72
+ const toggles = assignedNodes.filter(
73
+ node => node instanceof NileButtonToggle
74
+ ) as NileButtonToggle[];
75
+
76
+ toggles.forEach((toggle, index) => {
77
+ toggle.initial = index === 0;
78
+ toggle.middle = index > 0 && index < toggles.length - 1;
79
+ toggle.end = index === toggles.length - 1;
80
+ });
81
+ }
82
+
83
+ handleToggle(event: CustomEvent) {
84
+ if (this.disabled) return;
85
+ const toggles = this.querySelectorAll('nile-button-toggle');
86
+
87
+ if (toggles && event.detail.active) {
88
+ toggles.forEach((toggle: any) => {
89
+ if (toggle !== event.target) {
90
+ toggle.active = false;
91
+ }
92
+ });
93
+
94
+ this.emit('nile-change', { value: event.detail.value });
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Render method
100
+ * @slot This is a slot test
101
+ */
102
+ public render(): TemplateResult {
103
+ return html` <slot> </slot> `;
104
+ }
105
+
106
+ /* #endregion */
107
+ }
108
+
109
+ export default NileButtonToggleGroup;
110
+
111
+ declare global {
112
+ interface HTMLElementTagNameMap {
113
+ 'nile-button-toggle-group': NileButtonToggleGroup;
114
+ }
115
+ }
@@ -1 +0,0 @@
1
- export { NileRadioButton } from './nile-radio-button';
@@ -1,2 +0,0 @@
1
- export { NileRadioButton } from './nile-radio-button';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-radio-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { NileRadioButton } from './nile-radio-button';\n"]}
@@ -1,173 +0,0 @@
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
- * RadioButton CSS
10
- */
11
- export const styles = css `
12
- :host {
13
- }
14
-
15
- .button {
16
- display: inline-flex;
17
- align-items: center;
18
- justify-content: center;
19
- width: 100%;
20
- color: var(--color-text-default, #000);
21
- text-align: center;
22
- border-radius: 4px;
23
- font-family: Colfax-regular;
24
- font-size: 14px;
25
- font-style: normal;
26
- font-weight: 400;
27
- line-height: 14px; /* 100% */
28
- letter-spacing: 0.2px;
29
- text-decoration: none;
30
- user-select: none;
31
- white-space: nowrap;
32
- vertical-align: middle;
33
- padding: 12px;
34
- cursor: pointer;
35
- gap: 10px;
36
- }
37
-
38
- .button::-moz-focus-inner {
39
- border: 0;
40
- }
41
-
42
- .button:focus {
43
- outline: none;
44
- }
45
-
46
- .button:focus-visible {
47
- outline: var(--nile-focus-ring);
48
- outline-offset: var(--nile-focus-ring-offset);
49
- }
50
-
51
- .button--disabled {
52
- opacity: 0.5;
53
- cursor: not-allowed;
54
- }
55
-
56
- /* When disabled, prevent mouse events from bubbling up from children */
57
- .button--disabled * {
58
- pointer-events: none;
59
- }
60
-
61
- .button__prefix,
62
- .button__suffix {
63
- flex: 0 0 auto;
64
- display: flex;
65
- align-items: center;
66
- pointer-events: none;
67
- }
68
-
69
- .button__label {
70
- display: inline-block;
71
- }
72
-
73
- .button__label::slotted(nile-icon) {
74
- vertical-align: -2px;
75
- }
76
-
77
- /* Default */
78
- .button--default {
79
- border: 1px solid #c7ced4;
80
- background: #fff;
81
- color: black;
82
- }
83
-
84
- .button--default:hover:not(.button--disabled) {
85
- border: 1px solid #c7ced4;
86
- background: #e5e9eb;
87
- }
88
-
89
- .button--default:active:not(.button--disabled) {
90
- border: 1px solid #c7ced4;
91
- background: #e5e9eb;
92
- }
93
-
94
- .button--checked {
95
- border: 1px solid #c7ced4;
96
- background: #e5e9eb;
97
- }
98
-
99
- .button--has-label.button--medium .button__label {
100
- padding: 0 var(--nile-spacing-medium);
101
- }
102
-
103
- .button--has-prefix.button--medium {
104
- padding-inline-start: var(--nile-spacing-small);
105
- }
106
-
107
- .button--has-prefix.button--medium .button__label {
108
- padding-inline-start: var(--nile-spacing-small);
109
- }
110
-
111
- .button--has-suffix.button--medium,
112
- .button--caret.button--medium {
113
- padding-inline-end: var(--nile-spacing-small);
114
- }
115
-
116
- .button--has-suffix.button--medium .button__label,
117
- .button--caret.button--medium .button__label {
118
- padding-inline-end: var(--nile-spacing-small);
119
- }
120
-
121
- .nile-radio-button--first {
122
- background-color: red;
123
- }
124
-
125
- :host(.nile-radio-button--first:not(.nile-radio-button--last)) .button {
126
- border-start-end-radius: 0;
127
- border-end-end-radius: 0;
128
- }
129
-
130
- :host(.nile-group-button--inner) .button {
131
- border-radius: 0;
132
- }
133
-
134
- :host(.nile-radio-button--last:not(.nile-radio-button--first)) .button {
135
- border-start-start-radius: 0;
136
- border-end-start-radius: 0;
137
- }
138
-
139
- /* All except the first */
140
- :host(.nile-radio-button__button:not(.nile-radio-button__button--first)) {
141
- margin-inline-start: calc(-1 * var(--nile-input-border-width));
142
- }
143
-
144
- :host(.nile-radio-button--inner) .button {
145
- border-radius: 0;
146
- border-left: 0;
147
- border-right: 0;
148
- }
149
-
150
- .button__prefix,
151
- .button__suffix,
152
- .button__label {
153
- display: inline-flex;
154
- position: relative;
155
- align-items: center;
156
- }
157
-
158
- /* We use a hidden input so constraint validation errors work, since they don't appear to show when used with buttons.
159
- We can't actually hide it, though, otherwise the messages will be suppressed by the browser. */
160
- .hidden-input {
161
- all: unset;
162
- position: absolute;
163
- top: 0;
164
- left: 0;
165
- bottom: 0;
166
- right: 0;
167
- outline: dotted 1px red;
168
- opacity: 0;
169
- z-index: -1;
170
- }
171
- `;
172
- export default [styles];
173
- //# sourceMappingURL=nile-radio-button.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nile-radio-button.css.js","sourceRoot":"","sources":["../../../src/nile-radio-button/nile-radio-button.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgKxB,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 * RadioButton CSS\n */\nexport const styles = css`\n :host {\n }\n\n .button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n color: var(--color-text-default, #000);\n text-align: center;\n border-radius: 4px;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px; /* 100% */\n letter-spacing: 0.2px;\n text-decoration: none;\n user-select: none;\n white-space: nowrap;\n vertical-align: middle;\n padding: 12px;\n cursor: pointer;\n gap: 10px;\n }\n\n .button::-moz-focus-inner {\n border: 0;\n }\n\n .button:focus {\n outline: none;\n }\n\n .button:focus-visible {\n outline: var(--nile-focus-ring);\n outline-offset: var(--nile-focus-ring-offset);\n }\n\n .button--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* When disabled, prevent mouse events from bubbling up from children */\n .button--disabled * {\n pointer-events: none;\n }\n\n .button__prefix,\n .button__suffix {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n pointer-events: none;\n }\n\n .button__label {\n display: inline-block;\n }\n\n .button__label::slotted(nile-icon) {\n vertical-align: -2px;\n }\n\n /* Default */\n .button--default {\n border: 1px solid #c7ced4;\n background: #fff;\n color: black;\n }\n\n .button--default:hover:not(.button--disabled) {\n border: 1px solid #c7ced4;\n background: #e5e9eb;\n }\n\n .button--default:active:not(.button--disabled) {\n border: 1px solid #c7ced4;\n background: #e5e9eb;\n }\n\n .button--checked {\n border: 1px solid #c7ced4;\n background: #e5e9eb;\n }\n\n .button--has-label.button--medium .button__label {\n padding: 0 var(--nile-spacing-medium);\n }\n\n .button--has-prefix.button--medium {\n padding-inline-start: var(--nile-spacing-small);\n }\n\n .button--has-prefix.button--medium .button__label {\n padding-inline-start: var(--nile-spacing-small);\n }\n\n .button--has-suffix.button--medium,\n .button--caret.button--medium {\n padding-inline-end: var(--nile-spacing-small);\n }\n\n .button--has-suffix.button--medium .button__label,\n .button--caret.button--medium .button__label {\n padding-inline-end: var(--nile-spacing-small);\n }\n\n .nile-radio-button--first {\n background-color: red;\n }\n\n :host(.nile-radio-button--first:not(.nile-radio-button--last)) .button {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n\n :host(.nile-group-button--inner) .button {\n border-radius: 0;\n }\n\n :host(.nile-radio-button--last:not(.nile-radio-button--first)) .button {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n\n /* All except the first */\n :host(.nile-radio-button__button:not(.nile-radio-button__button--first)) {\n margin-inline-start: calc(-1 * var(--nile-input-border-width));\n }\n\n :host(.nile-radio-button--inner) .button {\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n }\n\n .button__prefix,\n .button__suffix,\n .button__label {\n display: inline-flex;\n position: relative;\n align-items: center;\n }\n\n /* We use a hidden input so constraint validation errors work, since they don't appear to show when used with buttons.\n We can't actually hide it, though, otherwise the messages will be suppressed by the browser. */\n .hidden-input {\n all: unset;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n outline: dotted 1px red;\n opacity: 0;\n z-index: -1;\n }\n`;\n\nexport default [styles];\n"]}
@@ -1,57 +0,0 @@
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
- }