@ni/ok-components 1.14.0 → 1.16.0

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 (37) hide show
  1. package/dist/all-components-bundle.js +1015 -422
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +531 -329
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/custom-elements.json +241 -0
  6. package/dist/custom-elements.md +34 -0
  7. package/dist/esm/fv/all-fv.d.ts +1 -0
  8. package/dist/esm/fv/all-fv.js +1 -0
  9. package/dist/esm/fv/all-fv.js.map +1 -1
  10. package/dist/esm/fv/multi-select/index.d.ts +100 -0
  11. package/dist/esm/fv/multi-select/index.js +367 -0
  12. package/dist/esm/fv/multi-select/index.js.map +1 -0
  13. package/dist/esm/fv/multi-select/models/form-associated.d.ts +16 -0
  14. package/dist/esm/fv/multi-select/models/form-associated.js +17 -0
  15. package/dist/esm/fv/multi-select/models/form-associated.js.map +1 -0
  16. package/dist/esm/fv/multi-select/styles.d.ts +1 -0
  17. package/dist/esm/fv/multi-select/styles.js +241 -0
  18. package/dist/esm/fv/multi-select/styles.js.map +1 -0
  19. package/dist/esm/fv/multi-select/template.d.ts +2 -0
  20. package/dist/esm/fv/multi-select/template.js +171 -0
  21. package/dist/esm/fv/multi-select/template.js.map +1 -0
  22. package/dist/esm/fv/multi-select/types.d.ts +8 -0
  23. package/dist/esm/fv/multi-select/types.js +2 -0
  24. package/dist/esm/fv/multi-select/types.js.map +1 -0
  25. package/dist/esm/fv/split-button/styles.js +45 -5
  26. package/dist/esm/fv/split-button/styles.js.map +1 -1
  27. package/dist/esm/fv/split-button/template.js +3 -1
  28. package/dist/esm/fv/split-button/template.js.map +1 -1
  29. package/dist/esm/fv/split-button-anchor/index.d.ts +2 -2
  30. package/dist/esm/fv/split-button-anchor/index.js +4 -4
  31. package/dist/esm/fv/split-button-anchor/index.js.map +1 -1
  32. package/dist/esm/fv/split-button-anchor/styles.d.ts +1 -1
  33. package/dist/esm/fv/split-button-anchor/styles.js +1 -227
  34. package/dist/esm/fv/split-button-anchor/styles.js.map +1 -1
  35. package/dist/esm/fv/split-button-anchor/template.js +9 -4
  36. package/dist/esm/fv/split-button-anchor/template.js.map +1 -1
  37. package/package.json +1 -1
@@ -0,0 +1,241 @@
1
+ import { css } from '@ni/fast-element';
2
+ import { applicationBackgroundColor, bodyDisabledFontColor, bodyFont, bodyFontColor, borderHoverColor, borderRgbPartialColor, borderWidth, controlHeight, controlSlimHeight, controlLabelFont, controlLabelFontColor, elevation2BoxShadow, fillHoverColor, fillHoverSelectedColor, fillSelectedColor, iconColor, mediumPadding, placeholderFontColor, popupBorderColor, smallDelay, smallPadding, standardPadding } from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';
3
+ import { Theme } from '@ni/nimble-components/dist/esm/theme-provider/types';
4
+ import { focusVisible } from '@ni/nimble-components/dist/esm/utilities/style/focus';
5
+ import { themeBehavior } from '@ni/nimble-components/dist/esm/utilities/style/theme';
6
+ import { display } from '../../utilities/style/display';
7
+ export const styles = css `
8
+ ${display('inline-block')}
9
+
10
+ :host {
11
+ width: 300px;
12
+ max-width: 100%;
13
+ font: ${bodyFont};
14
+ color: ${bodyFontColor};
15
+ }
16
+
17
+ .label {
18
+ display: block;
19
+ margin-bottom: ${smallPadding};
20
+ font: ${controlLabelFont};
21
+ color: ${controlLabelFontColor};
22
+ }
23
+
24
+ .control-field {
25
+ position: relative;
26
+ display: flex;
27
+ align-items: center;
28
+ gap: ${smallPadding};
29
+ width: 100%;
30
+ height: ${controlHeight};
31
+ box-sizing: border-box;
32
+ padding: 0 ${standardPadding};
33
+ border: ${borderWidth} solid transparent;
34
+ border-bottom-color: rgba(${borderRgbPartialColor}, 0.3);
35
+ border-radius: 0;
36
+ font: inherit;
37
+ color: inherit;
38
+ background: transparent;
39
+ text-align: start;
40
+ cursor: pointer;
41
+ }
42
+
43
+ .control {
44
+ display: flex;
45
+ align-items: center;
46
+ flex: 1;
47
+ min-width: 0;
48
+ height: 100%;
49
+ padding: 0;
50
+ border: none;
51
+ font: inherit;
52
+ color: inherit;
53
+ background: transparent;
54
+ text-align: start;
55
+ cursor: inherit;
56
+ outline: none;
57
+ }
58
+
59
+ .clear-button {
60
+ flex: none;
61
+ height: ${controlSlimHeight};
62
+ }
63
+
64
+ :host([appearance='outline']) .control-field {
65
+ border-color: rgba(${borderRgbPartialColor}, 0.3);
66
+ }
67
+
68
+ :host([appearance='block']) .control-field {
69
+ background: rgba(${borderRgbPartialColor}, 0.1);
70
+ border-color: transparent;
71
+ }
72
+
73
+ :host([appearance='frameless']) .control-field {
74
+ border-color: transparent;
75
+ }
76
+
77
+ :host([open]:not(:hover)) .control-field {
78
+ border-bottom-color: ${borderHoverColor};
79
+ }
80
+
81
+ .control-field::before,
82
+ .control-field::after {
83
+ content: '';
84
+ position: absolute;
85
+ left: 50%;
86
+ transform: translateX(-50%);
87
+ width: 0;
88
+ height: 0;
89
+ pointer-events: none;
90
+ transition: width ${smallDelay} ease-in;
91
+ }
92
+
93
+ .control-field::before {
94
+ bottom: calc(${borderWidth} + 1px);
95
+ border-bottom: 1px solid ${borderHoverColor};
96
+ }
97
+
98
+ .control-field::after {
99
+ bottom: calc(-1 * ${borderWidth});
100
+ border-bottom: calc(${borderWidth} + 1px) solid ${borderHoverColor};
101
+ }
102
+
103
+ :host(:not([disabled], :disabled)) .control-field:has(.control${focusVisible})::before {
104
+ width: calc(100% - 8px);
105
+ }
106
+
107
+ :host(:not([disabled], :disabled)) .control-field:hover::after,
108
+ :host(:not([disabled], :disabled)) .control-field:has(.control${focusVisible})::after {
109
+ width: 100%;
110
+ }
111
+
112
+ @media (prefers-reduced-motion) {
113
+ .control-field::before,
114
+ .control-field::after {
115
+ transition-duration: 0s;
116
+ }
117
+ }
118
+
119
+ .selected-value {
120
+ flex: 1;
121
+ min-width: 0;
122
+ overflow: hidden;
123
+ text-overflow: ellipsis;
124
+ white-space: nowrap;
125
+ }
126
+
127
+ .placeholder,
128
+ .empty {
129
+ color: ${placeholderFontColor};
130
+ }
131
+
132
+ .anchored-region.bottom {
133
+ padding-top: ${smallPadding};
134
+ }
135
+
136
+ .anchored-region.top {
137
+ padding-bottom: ${smallPadding};
138
+ }
139
+
140
+ .popup {
141
+ display: flex;
142
+ flex-direction: column;
143
+ width: 100%;
144
+ max-height: max(0px, calc(var(--ok-fv-multi-select-available-height, 100vh) - ${smallPadding}));
145
+ box-sizing: border-box;
146
+ border: ${borderWidth} solid ${popupBorderColor};
147
+ background: ${applicationBackgroundColor};
148
+ box-shadow: ${elevation2BoxShadow};
149
+ }
150
+
151
+ .filter-field {
152
+ flex-shrink: 0;
153
+ display: flex;
154
+ align-items: center;
155
+ height: ${controlHeight};
156
+ background: transparent;
157
+ box-shadow: 0 2px rgba(${borderRgbPartialColor}, 0.1);
158
+ }
159
+
160
+ .filter-icon {
161
+ flex-shrink: 0;
162
+ margin-left: ${smallPadding};
163
+ ${iconColor.cssCustomProperty}: ${placeholderFontColor};
164
+ }
165
+
166
+ .filter-input {
167
+ width: 100%;
168
+ min-width: 0;
169
+ height: ${controlHeight};
170
+ padding: 0 ${smallPadding} 0 ${mediumPadding};
171
+ border: none;
172
+ outline: none;
173
+ font: inherit;
174
+ color: inherit;
175
+ background: transparent;
176
+ }
177
+
178
+ .filter-input::placeholder {
179
+ color: ${placeholderFontColor};
180
+ }
181
+
182
+ .listbox {
183
+ min-height: 0;
184
+ max-height: 240px;
185
+ overflow-y: auto;
186
+ outline: none;
187
+ }
188
+
189
+ .option {
190
+ display: flex;
191
+ align-items: center;
192
+ gap: ${smallPadding};
193
+ min-height: ${controlHeight};
194
+ padding: 0 ${standardPadding};
195
+ cursor: pointer;
196
+ }
197
+
198
+ .option-label {
199
+ overflow: hidden;
200
+ text-overflow: ellipsis;
201
+ white-space: nowrap;
202
+ }
203
+
204
+ .option nimble-checkbox {
205
+ flex: none;
206
+ pointer-events: none;
207
+ }
208
+
209
+ .option:not([aria-disabled='true']):hover {
210
+ background: ${fillHoverColor};
211
+ }
212
+
213
+ .keyboard-navigation .option.active {
214
+ background: ${fillSelectedColor};
215
+ }
216
+
217
+ .keyboard-navigation .option.active:hover {
218
+ background: ${fillHoverSelectedColor};
219
+ }
220
+
221
+ :host(:is([disabled], :disabled)) .control-field,
222
+ :host(:is([disabled], :disabled)) .label,
223
+ .option[aria-disabled='true'] {
224
+ color: ${bodyDisabledFontColor};
225
+ cursor: default;
226
+ }
227
+
228
+ :host(:is([disabled], :disabled)) .control-field {
229
+ ${iconColor.cssCustomProperty}: ${bodyDisabledFontColor};
230
+ }
231
+
232
+ .empty {
233
+ flex-shrink: 0;
234
+ padding: ${standardPadding};
235
+ }
236
+ `.withBehaviors(themeBehavior(Theme.color, css `
237
+ .filter-field {
238
+ background: rgba(255, 255, 255, 0.15);
239
+ }
240
+ `));
241
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/multi-select/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,0BAA0B,EAC1B,qBAAqB,EACrB,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,eAAe,EAClB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,qDAAqD,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,cAAc,CAAC;;;;;gBAKb,QAAQ;iBACP,aAAa;;;;;yBAKL,YAAY;gBACrB,gBAAgB;iBACf,qBAAqB;;;;;;;eAOvB,YAAY;;kBAET,aAAa;;qBAEV,eAAe;kBAClB,WAAW;oCACO,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2BvC,iBAAiB;;;;6BAIN,qBAAqB;;;;2BAIvB,qBAAqB;;;;;;;;;+BASjB,gBAAgB;;;;;;;;;;;;4BAYnB,UAAU;;;;uBAIf,WAAW;mCACC,gBAAgB;;;;4BAIvB,WAAW;8BACT,WAAW,iBAAiB,gBAAgB;;;oEAGN,YAAY;;;;;oEAKZ,YAAY;;;;;;;;;;;;;;;;;;;;;iBAqB/D,oBAAoB;;;;uBAId,YAAY;;;;0BAIT,YAAY;;;;;;;wFAOkD,YAAY;;kBAElF,WAAW,UAAU,gBAAgB;sBACjC,0BAA0B;sBAC1B,mBAAmB;;;;;;;kBAOvB,aAAa;;iCAEE,qBAAqB;;;;;uBAK/B,YAAY;UACzB,SAAS,CAAC,iBAAiB,KAAK,oBAAoB;;;;;;kBAM5C,aAAa;qBACV,YAAY,MAAM,aAAa;;;;;;;;;iBASnC,oBAAoB;;;;;;;;;;;;;eAatB,YAAY;sBACL,aAAa;qBACd,eAAe;;;;;;;;;;;;;;;;sBAgBd,cAAc;;;;sBAId,iBAAiB;;;;sBAIjB,sBAAsB;;;;;;iBAM3B,qBAAqB;;;;;UAK5B,SAAS,CAAC,iBAAiB,KAAK,qBAAqB;;;;;mBAK5C,eAAe;;CAEjC,CAAC,aAAa,CACX,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;;;SAIF,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n applicationBackgroundColor,\n bodyDisabledFontColor,\n bodyFont,\n bodyFontColor,\n borderHoverColor,\n borderRgbPartialColor,\n borderWidth,\n controlHeight,\n controlSlimHeight,\n controlLabelFont,\n controlLabelFontColor,\n elevation2BoxShadow,\n fillHoverColor,\n fillHoverSelectedColor,\n fillSelectedColor,\n iconColor,\n mediumPadding,\n placeholderFontColor,\n popupBorderColor,\n smallDelay,\n smallPadding,\n standardPadding\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { Theme } from '@ni/nimble-components/dist/esm/theme-provider/types';\nimport { focusVisible } from '@ni/nimble-components/dist/esm/utilities/style/focus';\nimport { themeBehavior } from '@ni/nimble-components/dist/esm/utilities/style/theme';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n ${display('inline-block')}\n\n :host {\n width: 300px;\n max-width: 100%;\n font: ${bodyFont};\n color: ${bodyFontColor};\n }\n\n .label {\n display: block;\n margin-bottom: ${smallPadding};\n font: ${controlLabelFont};\n color: ${controlLabelFontColor};\n }\n\n .control-field {\n position: relative;\n display: flex;\n align-items: center;\n gap: ${smallPadding};\n width: 100%;\n height: ${controlHeight};\n box-sizing: border-box;\n padding: 0 ${standardPadding};\n border: ${borderWidth} solid transparent;\n border-bottom-color: rgba(${borderRgbPartialColor}, 0.3);\n border-radius: 0;\n font: inherit;\n color: inherit;\n background: transparent;\n text-align: start;\n cursor: pointer;\n }\n\n .control {\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 0;\n height: 100%;\n padding: 0;\n border: none;\n font: inherit;\n color: inherit;\n background: transparent;\n text-align: start;\n cursor: inherit;\n outline: none;\n }\n\n .clear-button {\n flex: none;\n height: ${controlSlimHeight};\n }\n\n :host([appearance='outline']) .control-field {\n border-color: rgba(${borderRgbPartialColor}, 0.3);\n }\n\n :host([appearance='block']) .control-field {\n background: rgba(${borderRgbPartialColor}, 0.1);\n border-color: transparent;\n }\n\n :host([appearance='frameless']) .control-field {\n border-color: transparent;\n }\n\n :host([open]:not(:hover)) .control-field {\n border-bottom-color: ${borderHoverColor};\n }\n\n .control-field::before,\n .control-field::after {\n content: '';\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n width: 0;\n height: 0;\n pointer-events: none;\n transition: width ${smallDelay} ease-in;\n }\n\n .control-field::before {\n bottom: calc(${borderWidth} + 1px);\n border-bottom: 1px solid ${borderHoverColor};\n }\n\n .control-field::after {\n bottom: calc(-1 * ${borderWidth});\n border-bottom: calc(${borderWidth} + 1px) solid ${borderHoverColor};\n }\n\n :host(:not([disabled], :disabled)) .control-field:has(.control${focusVisible})::before {\n width: calc(100% - 8px);\n }\n\n :host(:not([disabled], :disabled)) .control-field:hover::after,\n :host(:not([disabled], :disabled)) .control-field:has(.control${focusVisible})::after {\n width: 100%;\n }\n\n @media (prefers-reduced-motion) {\n .control-field::before,\n .control-field::after {\n transition-duration: 0s;\n }\n }\n\n .selected-value {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .placeholder,\n .empty {\n color: ${placeholderFontColor};\n }\n\n .anchored-region.bottom {\n padding-top: ${smallPadding};\n }\n\n .anchored-region.top {\n padding-bottom: ${smallPadding};\n }\n\n .popup {\n display: flex;\n flex-direction: column;\n width: 100%;\n max-height: max(0px, calc(var(--ok-fv-multi-select-available-height, 100vh) - ${smallPadding}));\n box-sizing: border-box;\n border: ${borderWidth} solid ${popupBorderColor};\n background: ${applicationBackgroundColor};\n box-shadow: ${elevation2BoxShadow};\n }\n\n .filter-field {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n height: ${controlHeight};\n background: transparent;\n box-shadow: 0 2px rgba(${borderRgbPartialColor}, 0.1);\n }\n\n .filter-icon {\n flex-shrink: 0;\n margin-left: ${smallPadding};\n ${iconColor.cssCustomProperty}: ${placeholderFontColor};\n }\n\n .filter-input {\n width: 100%;\n min-width: 0;\n height: ${controlHeight};\n padding: 0 ${smallPadding} 0 ${mediumPadding};\n border: none;\n outline: none;\n font: inherit;\n color: inherit;\n background: transparent;\n }\n\n .filter-input::placeholder {\n color: ${placeholderFontColor};\n }\n\n .listbox {\n min-height: 0;\n max-height: 240px;\n overflow-y: auto;\n outline: none;\n }\n\n .option {\n display: flex;\n align-items: center;\n gap: ${smallPadding};\n min-height: ${controlHeight};\n padding: 0 ${standardPadding};\n cursor: pointer;\n }\n\n .option-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .option nimble-checkbox {\n flex: none;\n pointer-events: none;\n }\n\n .option:not([aria-disabled='true']):hover {\n background: ${fillHoverColor};\n }\n\n .keyboard-navigation .option.active {\n background: ${fillSelectedColor};\n }\n\n .keyboard-navigation .option.active:hover {\n background: ${fillHoverSelectedColor};\n }\n\n :host(:is([disabled], :disabled)) .control-field,\n :host(:is([disabled], :disabled)) .label,\n .option[aria-disabled='true'] {\n color: ${bodyDisabledFontColor};\n cursor: default;\n }\n\n :host(:is([disabled], :disabled)) .control-field {\n ${iconColor.cssCustomProperty}: ${bodyDisabledFontColor};\n }\n\n .empty {\n flex-shrink: 0;\n padding: ${standardPadding};\n }\n`.withBehaviors(\n themeBehavior(\n Theme.color,\n css`\n .filter-field {\n background: rgba(255, 255, 255, 0.15);\n }\n `\n )\n);\n"]}
@@ -0,0 +1,2 @@
1
+ import type { FvMultiSelect } from '.';
2
+ export declare const template: import("@ni/fast-element").ViewTemplate<FvMultiSelect, any>;
@@ -0,0 +1,171 @@
1
+ import { html, ref, repeat, when } from '@ni/fast-element';
2
+ import { anchoredRegionTag } from '@ni/nimble-components/dist/esm/anchored-region';
3
+ import { checkboxTag } from '@ni/nimble-components/dist/esm/checkbox';
4
+ import { buttonTag } from '@ni/nimble-components/dist/esm/button';
5
+ import { iconArrowExpanderDownTag } from '@ni/nimble-components/dist/esm/icons/arrow-expander-down';
6
+ import { iconMagnifyingGlassTag } from '@ni/nimble-components/dist/esm/icons/magnifying-glass';
7
+ import { iconTimesTag } from '@ni/nimble-components/dist/esm/icons/times';
8
+ import { filterNoResultsLabel, filterSearchLabel } from '@ni/nimble-components/dist/esm/label-provider/core/label-tokens';
9
+ export const template = html `
10
+ <template
11
+ @focusout="${(x, c) => x.handleFocusout(c.event)}"
12
+ @click="${(x, c) => {
13
+ if (c.event.composedPath()[0] === x && !x.effectiveDisabled) {
14
+ x.control.focus();
15
+ }
16
+ return true;
17
+ }}"
18
+ >
19
+ ${when(x => x.label.length > 0, html `
20
+ <label class="label" id="${x => `${x.controlId}-label`}" for="${x => x.controlId}">${x => x.label}</label>
21
+ `)}
22
+ <div ${ref('controlField')} class="control-field"
23
+ @keypress="${(_, c) => {
24
+ c.event.stopPropagation();
25
+ return true;
26
+ }}"
27
+ @click="${x => {
28
+ x.open = !x.open;
29
+ }}"
30
+ @pointerdown="${x => {
31
+ x.keyboardNavigation = false;
32
+ return true;
33
+ }}">
34
+ <button
35
+ ${ref('control')}
36
+ id="${x => x.controlId}"
37
+ class="control"
38
+ part="control"
39
+ type="button"
40
+ ?disabled="${x => x.effectiveDisabled}"
41
+ aria-labelledby="${x => `${x.label ? `${x.controlId}-label ` : ''}${x.controlId}-value`}"
42
+ aria-haspopup="listbox"
43
+ aria-expanded="${x => x.open}"
44
+ aria-controls="${x => x.listboxId}"
45
+ @keydown="${(x, c) => x.handleControlKeydown(c.event)}"
46
+ >
47
+ <span class="selected-value ${x => (x.selectedValues.length === 0 ? 'placeholder' : '')}"
48
+ id="${x => `${x.controlId}-value`}"
49
+ part="selected-value" title="${x => x.displayValue || null}">
50
+ ${x => x.displayValue || x.placeholder}
51
+ </span>
52
+ </button>
53
+ ${when(x => x.clearable && !x.effectiveDisabled && x.selectedValues.length > 0, html `
54
+ <${buttonTag}
55
+ class="clear-button"
56
+ part="clear-button"
57
+ tabindex="-1"
58
+ appearance="ghost"
59
+ content-hidden
60
+ aria-label="Clear selection"
61
+ @click="${(x, c) => {
62
+ c.event.stopPropagation();
63
+ x.clearSelection();
64
+ }}"
65
+ >
66
+ <${iconTimesTag} slot="start"></${iconTimesTag}>
67
+ </${buttonTag}>
68
+ `)}
69
+ <${iconArrowExpanderDownTag} aria-hidden="true"></${iconArrowExpanderDownTag}>
70
+ </div>
71
+ <${anchoredRegionTag}
72
+ ${ref('region')}
73
+ class="anchored-region"
74
+ fixed-placement
75
+ auto-update-mode="auto"
76
+ vertical-default-position="bottom"
77
+ vertical-positioning-mode="dynamic"
78
+ horizontal-default-position="center"
79
+ horizontal-positioning-mode="locktodefault"
80
+ horizontal-scaling="anchor"
81
+ ?hidden="${x => !x.open}"
82
+ @loaded="${x => x.focusPopup()}"
83
+ >
84
+ <div class="popup ${x => (x.keyboardNavigation ? 'keyboard-navigation' : '')}"
85
+ @keypress="${(_, c) => {
86
+ c.event.stopPropagation();
87
+ return true;
88
+ }}"
89
+ @pointerdown="${x => {
90
+ x.keyboardNavigation = false;
91
+ return true;
92
+ }}"
93
+ @keydown="${(x, c) => x.handlePopupKeydown(c.event)}">
94
+ ${when(x => x.filterable, html `
95
+ <div class="filter-field">
96
+ <${iconMagnifyingGlassTag} class="filter-icon" aria-hidden="true"></${iconMagnifyingGlassTag}>
97
+ <input
98
+ ${ref('filterInput')}
99
+ class="filter-input"
100
+ type="text"
101
+ role="combobox"
102
+ autocomplete="off"
103
+ aria-autocomplete="list"
104
+ aria-expanded="${x => x.open}"
105
+ aria-controls="${x => x.listboxId}"
106
+ aria-activedescendant="${x => x.activeOptionId}"
107
+ aria-label="${x => filterSearchLabel.getValueFor(x)}"
108
+ placeholder="${x => filterSearchLabel.getValueFor(x)}"
109
+ :value="${x => x.filter}"
110
+ @input="${(x, c) => {
111
+ x.handleInput(c.event);
112
+ return true;
113
+ }}"
114
+ @change="${(_, c) => {
115
+ c.event.stopPropagation();
116
+ return true;
117
+ }}"
118
+ />
119
+ </div>
120
+ `)}
121
+ <div ${ref('listbox')}
122
+ id="${x => x.listboxId}"
123
+ class="listbox"
124
+ part="listbox"
125
+ role="listbox"
126
+ aria-label="${x => x.label || x.placeholder || null}"
127
+ aria-multiselectable="true"
128
+ aria-required="${x => x.required}"
129
+ aria-activedescendant="${x => (!x.filterable ? x.activeOptionId : null)}"
130
+ tabindex="${x => (x.filterable ? '-1' : '0')}"
131
+ >
132
+ ${repeat(x => x.visibleOptions, html `
133
+ <div
134
+ id="${(_, c) => `${c.parent.listboxId}-${c.index}`}"
135
+ class="option ${(_, c) => (c.parent.activeIndex === c.index ? 'active' : '')}"
136
+ part="option"
137
+ role="option"
138
+ aria-selected="${(x, c) => c.parent.selectedValues.includes(x.value)}"
139
+ aria-disabled="${x => !!x.disabled}"
140
+ @mousedown="${() => false}"
141
+ @click="${(x, c) => {
142
+ if (!x.disabled) {
143
+ c.parent.keyboardNavigation = false;
144
+ c.parent.activeIndex = c.index;
145
+ c.parent.toggleOption(x);
146
+ }
147
+ }}"
148
+ >
149
+ <${checkboxTag}
150
+ inert
151
+ aria-hidden="true"
152
+ tabindex="-1"
153
+ :checked="${(x, c) => c.parent.selectedValues.includes(x.value)}"
154
+ ?disabled="${x => !!x.disabled}"
155
+ @change="${(_, c) => {
156
+ c.event.stopPropagation();
157
+ return true;
158
+ }}"
159
+ ></${checkboxTag}>
160
+ <span class="option-label" title="${x => x.label}">${x => x.label}</span>
161
+ </div>
162
+ `, { positioning: true })}
163
+ </div>
164
+ ${when(x => x.visibleOptions.length === 0, html `
165
+ <div class="empty" role="status">${x => filterNoResultsLabel.getValueFor(x)}</div>
166
+ `)}
167
+ </div>
168
+ </${anchoredRegionTag}>
169
+ </template>
170
+ `;
171
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/fv/multi-select/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,wB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,CAAC,EAAE,CAAC,EAAE,EAAE;IACf,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACd,CAAC,CAAC,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC;QACpC,CAAC,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC;QAC/B,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;AACL,CAAC;;+BAEE,WAAW;;;;4CAIE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;6CAClD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ;2CACnB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;IAChB,CAAC,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;IAC1B,OAAO,IAAI,CAAC;AAChB,CAAC;iCACA,WAAW;gEACoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;;qBAExE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;;kBAE3B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,IAAI,CAAe;uDACvB,CAAC,CAAC,EAAE,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC;iBAC9E,CAAC;;YAEN,iBAAiB;;CAE5B,CAAC","sourcesContent":["import { html, ref, repeat, when } from '@ni/fast-element';\nimport { anchoredRegionTag } from '@ni/nimble-components/dist/esm/anchored-region';\nimport { checkboxTag } from '@ni/nimble-components/dist/esm/checkbox';\nimport { buttonTag } from '@ni/nimble-components/dist/esm/button';\nimport { iconArrowExpanderDownTag } from '@ni/nimble-components/dist/esm/icons/arrow-expander-down';\nimport { iconMagnifyingGlassTag } from '@ni/nimble-components/dist/esm/icons/magnifying-glass';\nimport { iconTimesTag } from '@ni/nimble-components/dist/esm/icons/times';\nimport { filterNoResultsLabel, filterSearchLabel } from '@ni/nimble-components/dist/esm/label-provider/core/label-tokens';\nimport type { FvMultiSelect } from '.';\nimport type { FvMultiSelectOption } from './types';\n\nexport const template = html<FvMultiSelect>`\n <template\n @focusout=\"${(x, c) => x.handleFocusout(c.event as FocusEvent)}\"\n @click=\"${(x, c) => {\n if (c.event.composedPath()[0] === x && !x.effectiveDisabled) {\n x.control.focus();\n }\n return true;\n }}\"\n >\n ${when(x => x.label.length > 0, html<FvMultiSelect>`\n <label class=\"label\" id=\"${x => `${x.controlId}-label`}\" for=\"${x => x.controlId}\">${x => x.label}</label>\n `)}\n <div ${ref('controlField')} class=\"control-field\"\n @keypress=\"${(_, c) => {\n c.event.stopPropagation();\n return true;\n }}\"\n @click=\"${x => {\n x.open = !x.open;\n }}\"\n @pointerdown=\"${x => {\n x.keyboardNavigation = false;\n return true;\n }}\">\n <button\n ${ref('control')}\n id=\"${x => x.controlId}\"\n class=\"control\"\n part=\"control\"\n type=\"button\"\n ?disabled=\"${x => x.effectiveDisabled}\"\n aria-labelledby=\"${x => `${x.label ? `${x.controlId}-label ` : ''}${x.controlId}-value`}\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${x => x.open}\"\n aria-controls=\"${x => x.listboxId}\"\n @keydown=\"${(x, c) => x.handleControlKeydown(c.event as KeyboardEvent)}\"\n >\n <span class=\"selected-value ${x => (x.selectedValues.length === 0 ? 'placeholder' : '')}\"\n id=\"${x => `${x.controlId}-value`}\"\n part=\"selected-value\" title=\"${x => x.displayValue || null}\">\n ${x => x.displayValue || x.placeholder}\n </span>\n </button>\n ${when(x => x.clearable && !x.effectiveDisabled && x.selectedValues.length > 0, html<FvMultiSelect>`\n <${buttonTag}\n class=\"clear-button\"\n part=\"clear-button\"\n tabindex=\"-1\"\n appearance=\"ghost\"\n content-hidden\n aria-label=\"Clear selection\"\n @click=\"${(x, c) => {\n c.event.stopPropagation();\n x.clearSelection();\n }}\"\n >\n <${iconTimesTag} slot=\"start\"></${iconTimesTag}>\n </${buttonTag}>\n `)}\n <${iconArrowExpanderDownTag} aria-hidden=\"true\"></${iconArrowExpanderDownTag}>\n </div>\n <${anchoredRegionTag}\n ${ref('region')}\n class=\"anchored-region\"\n fixed-placement\n auto-update-mode=\"auto\"\n vertical-default-position=\"bottom\"\n vertical-positioning-mode=\"dynamic\"\n horizontal-default-position=\"center\"\n horizontal-positioning-mode=\"locktodefault\"\n horizontal-scaling=\"anchor\"\n ?hidden=\"${x => !x.open}\"\n @loaded=\"${x => x.focusPopup()}\"\n >\n <div class=\"popup ${x => (x.keyboardNavigation ? 'keyboard-navigation' : '')}\"\n @keypress=\"${(_, c) => {\n c.event.stopPropagation();\n return true;\n }}\"\n @pointerdown=\"${x => {\n x.keyboardNavigation = false;\n return true;\n }}\"\n @keydown=\"${(x, c) => x.handlePopupKeydown(c.event as KeyboardEvent)}\">\n ${when(x => x.filterable, html<FvMultiSelect>`\n <div class=\"filter-field\">\n <${iconMagnifyingGlassTag} class=\"filter-icon\" aria-hidden=\"true\"></${iconMagnifyingGlassTag}>\n <input\n ${ref('filterInput')}\n class=\"filter-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n aria-expanded=\"${x => x.open}\"\n aria-controls=\"${x => x.listboxId}\"\n aria-activedescendant=\"${x => x.activeOptionId}\"\n aria-label=\"${x => filterSearchLabel.getValueFor(x)}\"\n placeholder=\"${x => filterSearchLabel.getValueFor(x)}\"\n :value=\"${x => x.filter}\"\n @input=\"${(x, c) => {\n x.handleInput(c.event);\n return true;\n }}\"\n @change=\"${(_, c) => {\n c.event.stopPropagation();\n return true;\n }}\"\n />\n </div>\n `)}\n <div ${ref('listbox')}\n id=\"${x => x.listboxId}\"\n class=\"listbox\"\n part=\"listbox\"\n role=\"listbox\"\n aria-label=\"${x => x.label || x.placeholder || null}\"\n aria-multiselectable=\"true\"\n aria-required=\"${x => x.required}\"\n aria-activedescendant=\"${x => (!x.filterable ? x.activeOptionId : null)}\"\n tabindex=\"${x => (x.filterable ? '-1' : '0')}\"\n >\n ${repeat(x => x.visibleOptions, html<FvMultiSelectOption, FvMultiSelect>`\n <div\n id=\"${(_, c) => `${c.parent.listboxId}-${c.index}`}\"\n class=\"option ${(_, c) => (c.parent.activeIndex === c.index ? 'active' : '')}\"\n part=\"option\"\n role=\"option\"\n aria-selected=\"${(x, c) => c.parent.selectedValues.includes(x.value)}\"\n aria-disabled=\"${x => !!x.disabled}\"\n @mousedown=\"${() => false}\"\n @click=\"${(x, c) => {\n if (!x.disabled) {\n c.parent.keyboardNavigation = false;\n c.parent.activeIndex = c.index;\n c.parent.toggleOption(x);\n }\n }}\"\n >\n <${checkboxTag}\n inert\n aria-hidden=\"true\"\n tabindex=\"-1\"\n :checked=\"${(x, c) => c.parent.selectedValues.includes(x.value)}\"\n ?disabled=\"${x => !!x.disabled}\"\n @change=\"${(_, c) => {\n c.event.stopPropagation();\n return true;\n }}\"\n ></${checkboxTag}>\n <span class=\"option-label\" title=\"${x => x.label}\">${x => x.label}</span>\n </div>\n `, { positioning: true })}\n </div>\n ${when(x => x.visibleOptions.length === 0, html<FvMultiSelect>`\n <div class=\"empty\" role=\"status\">${x => filterNoResultsLabel.getValueFor(x)}</div>\n `)}\n </div>\n </${anchoredRegionTag}>\n </template>\n`;\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An option in an FV multi-select. Values must be unique.
3
+ */
4
+ export interface FvMultiSelectOption {
5
+ value: string;
6
+ label: string;
7
+ disabled?: boolean;
8
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/fv/multi-select/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * An option in an FV multi-select. Values must be unique.\n */\nexport interface FvMultiSelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n"]}
@@ -109,9 +109,32 @@ export const styles = css `
109
109
  }
110
110
 
111
111
  .split-button-primary {
112
+ display: inline-flex;
113
+ align-items: center;
114
+ justify-content: center;
112
115
  padding: 0 ${standardPadding};
113
116
  padding-inline-end: ${mediumPadding};
114
117
  white-space: nowrap;
118
+ text-decoration: none;
119
+ }
120
+
121
+ slot[name='start']::slotted(*),
122
+ slot[name='end']::slotted(*) {
123
+ flex-shrink: 0;
124
+ color: currentColor;
125
+ ${iconColor.cssCustomProperty}: currentColor;
126
+ }
127
+
128
+ slot[name='start']::slotted(*) {
129
+ margin-inline-end: ${smallPadding};
130
+ }
131
+
132
+ slot[name='end']::slotted(*) {
133
+ margin-inline-start: ${smallPadding};
134
+ }
135
+
136
+ .split-button-primary-disabled {
137
+ cursor: default;
115
138
  }
116
139
 
117
140
  .split-button-toggle {
@@ -145,21 +168,21 @@ export const styles = css `
145
168
  }
146
169
 
147
170
  @layer hover {
148
- .split-button-primary:enabled:hover,
171
+ .split-button-primary:is(:enabled, [href]):hover,
149
172
  .split-button-toggle:enabled:hover {
150
173
  border-color: ${borderHoverColor};
151
174
  box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;
152
175
  z-index: 1;
153
176
  }
154
177
 
155
- .split-button-primary:enabled:hover + .split-button-toggle::after,
178
+ .split-button-primary:is(:enabled, [href]):hover + .split-button-toggle::after,
156
179
  .split-button-toggle:enabled:hover::after {
157
180
  visibility: hidden;
158
181
  }
159
182
  }
160
183
 
161
184
  @layer focusVisible {
162
- .split-button-primary:enabled:focus-visible,
185
+ .split-button-primary:is(:enabled, [href]):focus-visible,
163
186
  .split-button-toggle:enabled:focus-visible {
164
187
  border-color: ${borderHoverColor};
165
188
  box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;
@@ -178,7 +201,7 @@ export const styles = css `
178
201
  }
179
202
 
180
203
  @layer active {
181
- .split-button-primary:enabled:active,
204
+ .split-button-primary:is(:enabled, [href]):active,
182
205
  .split-button-toggle:enabled:active,
183
206
  :host([open]) .split-button-toggle {
184
207
  border-color: ${borderHoverColor};
@@ -196,7 +219,7 @@ export const styles = css `
196
219
  visibility: hidden;
197
220
  }
198
221
 
199
- :host([appearance='block']) .split-button-primary:enabled:active,
222
+ :host([appearance='block']) .split-button-primary:is(:enabled, [href]):active,
200
223
  :host([appearance='block']) .split-button-toggle:enabled:active,
201
224
  :host([appearance='block'][open]) .split-button-toggle {
202
225
  background-color: ${applicationBackgroundColor};
@@ -214,6 +237,14 @@ export const styles = css `
214
237
  --ni-private-ok-fv-split-button-color: ${buttonLabelDisabledFontColor};
215
238
  }
216
239
 
240
+ :host([disabled][appearance='block']) {
241
+ --ni-private-ok-fv-split-button-background-image: linear-gradient(
242
+ rgba(${borderRgbPartialColor}, 0.1),
243
+ rgba(${borderRgbPartialColor}, 0.1)
244
+ );
245
+ --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.1);
246
+ }
247
+
217
248
  :host([disabled][appearance='outline']) {
218
249
  --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.3);
219
250
  }
@@ -222,6 +253,15 @@ export const styles = css `
222
253
  :host([disabled]) .split-button-toggle {
223
254
  cursor: default;
224
255
  box-shadow: none;
256
+ background-image: none;
257
+ background-size: 100% 100%;
258
+ }
259
+
260
+ :host([disabled]) slot[name='start']::slotted(*),
261
+ :host([disabled]) slot[name='end']::slotted(*),
262
+ :host([disabled]) .split-button-toggle > * {
263
+ opacity: 0.3;
264
+ ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};
225
265
  }
226
266
 
227
267
  :host([disabled][appearance='ghost']) .split-button-primary,
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/split-button/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,qBAAqB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4BAahC,gBAAgB;;gDAEI,iBAAiB,KAAK,iBAAiB;;;;;iCAKtD,2BAA2B;;;;;;;;;;;gCAW5B,0BAA0B;;;;;;qBAMrC,4BAA4B;;;;;;qDAMI,4BAA4B;;;;2DAItB,qBAAqB;;;;;;;;;;;;;;;;CAgB/E,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n actionRgbPartialColor,\n applicationBackgroundColor,\n borderHoverColor,\n borderRgbPartialColor,\n borderWidth,\n buttonAccentBlockFontColor,\n buttonAccentOutlineFontColor,\n buttonBorderAccentOutlineColor,\n buttonFillAccentColor,\n buttonFillPrimaryColor,\n buttonLabelDisabledFontColor,\n buttonLabelFont,\n buttonLabelFontColor,\n buttonPrimaryFontColor,\n controlHeight,\n fillSelectedColor,\n fillSelectedRgbPartialColor,\n iconColor,\n mediumPadding,\n smallDelay,\n smallPadding,\n standardPadding\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('inline-block')}\n\n :host {\n --ni-private-ok-fv-split-button-background-image: none;\n --ni-private-ok-fv-split-button-border: rgba(${actionRgbPartialColor}, 0.3);\n --ni-private-ok-fv-split-button-color: ${buttonLabelFontColor};\n position: relative;\n height: ${controlHeight};\n vertical-align: middle;\n }\n\n :host([appearance='ghost']) {\n --ni-private-ok-fv-split-button-border: transparent;\n }\n\n :host([appearance='block']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n rgba(${borderRgbPartialColor}, 0.1),\n rgba(${borderRgbPartialColor}, 0.1)\n );\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([appearance='outline'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-border: rgb(${actionRgbPartialColor});\n }\n\n :host([appearance='outline'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-border: ${buttonBorderAccentOutlineColor};\n --ni-private-ok-fv-split-button-color: ${buttonAccentOutlineFontColor};\n }\n\n :host([appearance='block'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n ${buttonFillPrimaryColor},\n ${buttonFillPrimaryColor}\n );\n --ni-private-ok-fv-split-button-border: ${buttonFillPrimaryColor};\n --ni-private-ok-fv-split-button-color: ${buttonPrimaryFontColor};\n }\n\n :host([appearance='block'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n ${buttonFillAccentColor},\n ${buttonFillAccentColor}\n );\n --ni-private-ok-fv-split-button-border: ${buttonFillAccentColor};\n --ni-private-ok-fv-split-button-color: ${buttonAccentBlockFontColor};\n }\n\n .split-button-container {\n position: relative;\n display: inline-flex;\n align-items: stretch;\n height: 100%;\n }\n\n .split-button-container::before {\n content: '';\n position: absolute;\n inset: 0;\n border: ${borderWidth} solid var(--ni-private-ok-fv-split-button-border);\n background-image: var(--ni-private-ok-fv-split-button-background-image);\n background-repeat: no-repeat;\n pointer-events: none;\n }\n\n .split-button-primary,\n .split-button-toggle {\n appearance: none;\n position: relative;\n z-index: 0;\n height: 100%;\n box-sizing: border-box;\n margin: 0;\n border: ${borderWidth} solid transparent;\n background-color: transparent;\n background-position: center;\n background-repeat: no-repeat;\n background-origin: border-box;\n background-size: 100% 100%;\n color: var(--ni-private-ok-fv-split-button-color);\n fill: currentcolor;\n font: ${buttonLabelFont};\n cursor: pointer;\n outline: none;\n transition:\n box-shadow ${smallDelay} ease-in-out,\n border-color ${smallDelay} ease-in-out,\n background-size ${smallDelay} ease-in-out;\n }\n\n .split-button-primary::before,\n .split-button-toggle::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n outline: 0px solid transparent;\n outline-offset: -3px;\n transition: outline ${smallDelay} ease-in-out;\n }\n\n .split-button-primary {\n padding: 0 ${standardPadding};\n padding-inline-end: ${mediumPadding};\n white-space: nowrap;\n }\n\n .split-button-toggle {\n width: ${controlHeight};\n min-width: ${controlHeight};\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n }\n\n .split-button-toggle::after {\n content: '';\n position: absolute;\n inset-block: ${smallPadding};\n inset-inline-start: calc(-1 * ${borderWidth});\n width: calc(2 * ${borderWidth});\n background: rgba(${borderRgbPartialColor}, 0.1);\n pointer-events: none;\n }\n\n .split-button-toggle > * {\n color: currentColor;\n ${iconColor.cssCustomProperty}: currentColor;\n }\n\n slot[name='menu']::slotted(*) {\n min-width: 100%;\n margin: ${smallPadding} 0 0;\n }\n }\n\n @layer hover {\n .split-button-primary:enabled:hover,\n .split-button-toggle:enabled:hover {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n z-index: 1;\n }\n\n .split-button-primary:enabled:hover + .split-button-toggle::after,\n .split-button-toggle:enabled:hover::after {\n visibility: hidden;\n }\n }\n\n @layer focusVisible {\n .split-button-primary:enabled:focus-visible,\n .split-button-toggle:enabled:focus-visible {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n z-index: 1;\n }\n\n .split-button-primary:focus-visible::before,\n .split-button-toggle:focus-visible::before {\n outline: ${borderWidth} solid ${borderHoverColor};\n }\n\n .split-button-primary:focus-visible + .split-button-toggle::after,\n .split-button-toggle:focus-visible::after {\n visibility: hidden;\n }\n }\n\n @layer active {\n .split-button-primary:enabled:active,\n .split-button-toggle:enabled:active,\n :host([open]) .split-button-toggle {\n border-color: ${borderHoverColor};\n box-shadow: none;\n background-image: linear-gradient(${fillSelectedColor}, ${fillSelectedColor});\n background-size: calc(100% - 2px) calc(100% - 2px);\n }\n\n :host([open]) .split-button-toggle {\n border-color: rgba(${fillSelectedRgbPartialColor}, 0.3);\n background-size: 100% 100%;\n }\n\n :host([open]) .split-button-toggle::after {\n visibility: hidden;\n }\n\n :host([appearance='block']) .split-button-primary:enabled:active,\n :host([appearance='block']) .split-button-toggle:enabled:active,\n :host([appearance='block'][open]) .split-button-toggle {\n background-color: ${applicationBackgroundColor};\n }\n\n :host([appearance='outline'][appearance-variant='accent']) .split-button-primary:active,\n :host([appearance='outline'][appearance-variant='accent']) .split-button-toggle:active,\n :host([appearance='outline'][appearance-variant='accent'][open]) .split-button-toggle {\n color: ${buttonAccentOutlineFontColor};\n }\n }\n\n @layer disabled {\n :host([disabled]) {\n --ni-private-ok-fv-split-button-color: ${buttonLabelDisabledFontColor};\n }\n\n :host([disabled][appearance='outline']) {\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.3);\n }\n\n :host([disabled]) .split-button-primary,\n :host([disabled]) .split-button-toggle {\n cursor: default;\n box-shadow: none;\n }\n\n :host([disabled][appearance='ghost']) .split-button-primary,\n :host([disabled][appearance='ghost']) .split-button-toggle {\n border-color: transparent;\n }\n }\n\n @layer top {}\n`;"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/split-button/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,2BAA2B,EAC3B,SAAS,EACT,aAAa,EACb,UAAU,EACV,YAAY,EACZ,eAAe,EAClB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;UAIf,OAAO,CAAC,cAAc,CAAC;;;;2DAI0B,qBAAqB;qDAC3B,oBAAoB;;sBAEnD,aAAa;;;;;;;;;;uBAUZ,qBAAqB;uBACrB,qBAAqB;;2DAEe,qBAAqB;;;;0DAItB,qBAAqB;;;;sDAIzB,8BAA8B;qDAC/B,4BAA4B;;;;;kBAK/D,sBAAsB;kBACtB,sBAAsB;;sDAEc,sBAAsB;qDACvB,sBAAsB;;;;;kBAKzD,qBAAqB;kBACrB,qBAAqB;;sDAEe,qBAAqB;qDACtB,0BAA0B;;;;;;;;;;;;;;sBAczD,WAAW;;;;;;;;;;;;;;sBAcX,WAAW;;;;;;;;oBAQb,eAAe;;;;6BAIN,UAAU;+BACR,UAAU;kCACP,UAAU;;;;;;;;;;;kCAWV,UAAU;;;;;;;yBAOnB,eAAe;kCACN,aAAa;;;;;;;;;cASjC,SAAS,CAAC,iBAAiB;;;;iCAIR,YAAY;;;;mCAIV,YAAY;;;;;;;;qBAQ1B,aAAa;yBACT,aAAa;;;;;;;;;;2BAUX,YAAY;4CACK,WAAW;8BACzB,WAAW;+BACV,qBAAqB;;;;;;cAMtC,SAAS,CAAC,iBAAiB;;;;;sBAKnB,YAAY;;;;;;;4BAON,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;;;;;;;;4BAanC,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;uBAMxC,WAAW,UAAU,gBAAgB;;;;;;;;;;;;;4BAahC,gBAAgB;;gDAEI,iBAAiB,KAAK,iBAAiB;;;;;iCAKtD,2BAA2B;;;;;;;;;;;gCAW5B,0BAA0B;;;;;;qBAMrC,4BAA4B;;;;;;qDAMI,4BAA4B;;;;;uBAK1D,qBAAqB;uBACrB,qBAAqB;;2DAEe,qBAAqB;;;;2DAIrB,qBAAqB;;;;;;;;;;;;;;;cAelE,SAAS,CAAC,iBAAiB,KAAK,oBAAoB;;;;;;;;;;CAUjE,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n actionRgbPartialColor,\n applicationBackgroundColor,\n borderHoverColor,\n borderRgbPartialColor,\n borderWidth,\n buttonAccentBlockFontColor,\n buttonAccentOutlineFontColor,\n buttonBorderAccentOutlineColor,\n buttonFillAccentColor,\n buttonFillPrimaryColor,\n buttonLabelDisabledFontColor,\n buttonLabelFont,\n buttonLabelFontColor,\n buttonPrimaryFontColor,\n controlHeight,\n fillSelectedColor,\n fillSelectedRgbPartialColor,\n iconColor,\n mediumPadding,\n smallDelay,\n smallPadding,\n standardPadding\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('inline-block')}\n\n :host {\n --ni-private-ok-fv-split-button-background-image: none;\n --ni-private-ok-fv-split-button-border: rgba(${actionRgbPartialColor}, 0.3);\n --ni-private-ok-fv-split-button-color: ${buttonLabelFontColor};\n position: relative;\n height: ${controlHeight};\n vertical-align: middle;\n }\n\n :host([appearance='ghost']) {\n --ni-private-ok-fv-split-button-border: transparent;\n }\n\n :host([appearance='block']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n rgba(${borderRgbPartialColor}, 0.1),\n rgba(${borderRgbPartialColor}, 0.1)\n );\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([appearance='outline'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-border: rgb(${actionRgbPartialColor});\n }\n\n :host([appearance='outline'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-border: ${buttonBorderAccentOutlineColor};\n --ni-private-ok-fv-split-button-color: ${buttonAccentOutlineFontColor};\n }\n\n :host([appearance='block'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n ${buttonFillPrimaryColor},\n ${buttonFillPrimaryColor}\n );\n --ni-private-ok-fv-split-button-border: ${buttonFillPrimaryColor};\n --ni-private-ok-fv-split-button-color: ${buttonPrimaryFontColor};\n }\n\n :host([appearance='block'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n ${buttonFillAccentColor},\n ${buttonFillAccentColor}\n );\n --ni-private-ok-fv-split-button-border: ${buttonFillAccentColor};\n --ni-private-ok-fv-split-button-color: ${buttonAccentBlockFontColor};\n }\n\n .split-button-container {\n position: relative;\n display: inline-flex;\n align-items: stretch;\n height: 100%;\n }\n\n .split-button-container::before {\n content: '';\n position: absolute;\n inset: 0;\n border: ${borderWidth} solid var(--ni-private-ok-fv-split-button-border);\n background-image: var(--ni-private-ok-fv-split-button-background-image);\n background-repeat: no-repeat;\n pointer-events: none;\n }\n\n .split-button-primary,\n .split-button-toggle {\n appearance: none;\n position: relative;\n z-index: 0;\n height: 100%;\n box-sizing: border-box;\n margin: 0;\n border: ${borderWidth} solid transparent;\n background-color: transparent;\n background-position: center;\n background-repeat: no-repeat;\n background-origin: border-box;\n background-size: 100% 100%;\n color: var(--ni-private-ok-fv-split-button-color);\n fill: currentcolor;\n font: ${buttonLabelFont};\n cursor: pointer;\n outline: none;\n transition:\n box-shadow ${smallDelay} ease-in-out,\n border-color ${smallDelay} ease-in-out,\n background-size ${smallDelay} ease-in-out;\n }\n\n .split-button-primary::before,\n .split-button-toggle::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n outline: 0px solid transparent;\n outline-offset: -3px;\n transition: outline ${smallDelay} ease-in-out;\n }\n\n .split-button-primary {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0 ${standardPadding};\n padding-inline-end: ${mediumPadding};\n white-space: nowrap;\n text-decoration: none;\n }\n\n slot[name='start']::slotted(*),\n slot[name='end']::slotted(*) {\n flex-shrink: 0;\n color: currentColor;\n ${iconColor.cssCustomProperty}: currentColor;\n }\n\n slot[name='start']::slotted(*) {\n margin-inline-end: ${smallPadding};\n }\n\n slot[name='end']::slotted(*) {\n margin-inline-start: ${smallPadding};\n }\n\n .split-button-primary-disabled {\n cursor: default;\n }\n\n .split-button-toggle {\n width: ${controlHeight};\n min-width: ${controlHeight};\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n }\n\n .split-button-toggle::after {\n content: '';\n position: absolute;\n inset-block: ${smallPadding};\n inset-inline-start: calc(-1 * ${borderWidth});\n width: calc(2 * ${borderWidth});\n background: rgba(${borderRgbPartialColor}, 0.1);\n pointer-events: none;\n }\n\n .split-button-toggle > * {\n color: currentColor;\n ${iconColor.cssCustomProperty}: currentColor;\n }\n\n slot[name='menu']::slotted(*) {\n min-width: 100%;\n margin: ${smallPadding} 0 0;\n }\n }\n\n @layer hover {\n .split-button-primary:is(:enabled, [href]):hover,\n .split-button-toggle:enabled:hover {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n z-index: 1;\n }\n\n .split-button-primary:is(:enabled, [href]):hover + .split-button-toggle::after,\n .split-button-toggle:enabled:hover::after {\n visibility: hidden;\n }\n }\n\n @layer focusVisible {\n .split-button-primary:is(:enabled, [href]):focus-visible,\n .split-button-toggle:enabled:focus-visible {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n z-index: 1;\n }\n\n .split-button-primary:focus-visible::before,\n .split-button-toggle:focus-visible::before {\n outline: ${borderWidth} solid ${borderHoverColor};\n }\n\n .split-button-primary:focus-visible + .split-button-toggle::after,\n .split-button-toggle:focus-visible::after {\n visibility: hidden;\n }\n }\n\n @layer active {\n .split-button-primary:is(:enabled, [href]):active,\n .split-button-toggle:enabled:active,\n :host([open]) .split-button-toggle {\n border-color: ${borderHoverColor};\n box-shadow: none;\n background-image: linear-gradient(${fillSelectedColor}, ${fillSelectedColor});\n background-size: calc(100% - 2px) calc(100% - 2px);\n }\n\n :host([open]) .split-button-toggle {\n border-color: rgba(${fillSelectedRgbPartialColor}, 0.3);\n background-size: 100% 100%;\n }\n\n :host([open]) .split-button-toggle::after {\n visibility: hidden;\n }\n\n :host([appearance='block']) .split-button-primary:is(:enabled, [href]):active,\n :host([appearance='block']) .split-button-toggle:enabled:active,\n :host([appearance='block'][open]) .split-button-toggle {\n background-color: ${applicationBackgroundColor};\n }\n\n :host([appearance='outline'][appearance-variant='accent']) .split-button-primary:active,\n :host([appearance='outline'][appearance-variant='accent']) .split-button-toggle:active,\n :host([appearance='outline'][appearance-variant='accent'][open]) .split-button-toggle {\n color: ${buttonAccentOutlineFontColor};\n }\n }\n\n @layer disabled {\n :host([disabled]) {\n --ni-private-ok-fv-split-button-color: ${buttonLabelDisabledFontColor};\n }\n\n :host([disabled][appearance='block']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n rgba(${borderRgbPartialColor}, 0.1),\n rgba(${borderRgbPartialColor}, 0.1)\n );\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([disabled][appearance='outline']) {\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.3);\n }\n\n :host([disabled]) .split-button-primary,\n :host([disabled]) .split-button-toggle {\n cursor: default;\n box-shadow: none;\n background-image: none;\n background-size: 100% 100%;\n }\n\n :host([disabled]) slot[name='start']::slotted(*),\n :host([disabled]) slot[name='end']::slotted(*),\n :host([disabled]) .split-button-toggle > * {\n opacity: 0.3;\n ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};\n }\n\n :host([disabled][appearance='ghost']) .split-button-primary,\n :host([disabled][appearance='ghost']) .split-button-toggle {\n border-color: transparent;\n }\n }\n\n @layer top {}\n`;"]}
@@ -14,7 +14,9 @@ export const template = html `
14
14
  return true;
15
15
  }}"
16
16
  >
17
- ${x => x.label}
17
+ <slot name="start"></slot>
18
+ <span>${x => x.label}</span>
19
+ <slot name="end"></slot>
18
20
  </button>
19
21
  <button
20
22
  class="split-button-toggle"