@fluid-topics/ft-select 0.1.3 → 0.1.7

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.
@@ -25,10 +25,11 @@ export declare const FtSelectCssVariables: {
25
25
  labelSize: FtCssVariable;
26
26
  selectedOptionSize: FtCssVariable;
27
27
  verticalSpacing: FtCssVariable;
28
+ selectedOptionColor: FtCssVariable;
28
29
  helperColor: FtCssVariable;
30
+ optionsColor: FtCssVariable;
29
31
  optionsZIndex: FtCssVariable;
30
32
  colorSurface: FtCssVariable;
31
- colorOnSurface: FtCssVariable;
32
33
  colorOnSurfaceDisabled: FtCssVariable;
33
34
  colorPrimary: FtCssVariable;
34
35
  borderRadiusS: FtCssVariable;
@@ -11,7 +11,7 @@ import { repeat } from "lit/directives/repeat.js";
11
11
  import { customElement, designSystemVariables, FtCssVariable, FtLitElement, setVariable } from "@fluid-topics/ft-wc-utils";
12
12
  import { FtTypography, FtTypographyBody1CssVariables, FtTypographyBody2, FtTypographyCaption } from "@fluid-topics/ft-typography";
13
13
  import { FtInputLabel, FtInputLabelCssVariables } from "@fluid-topics/ft-input-label";
14
- import { FtRipple } from "@fluid-topics/ft-ripple";
14
+ import { FtRipple, FtRippleCssVariables } from "@fluid-topics/ft-ripple";
15
15
  import { Icon } from "@material/mwc-icon";
16
16
  let FtSelectOption = class FtSelectOption extends FtLitElement {
17
17
  constructor() {
@@ -46,10 +46,11 @@ export const FtSelectCssVariables = {
46
46
  labelSize: FtCssVariable.create("--ft-select-label-size", "SIZE", "11px"),
47
47
  selectedOptionSize: FtCssVariable.create("--ft-select-selected-option-size", "SIZE", "14px"),
48
48
  verticalSpacing: FtCssVariable.create("--ft-select-vertical-spacing", "SIZE", "4px"),
49
+ selectedOptionColor: FtCssVariable.extend("--ft-select-selected-option-color", designSystemVariables.colorOnSurface),
49
50
  helperColor: FtCssVariable.extend("--ft-select-helper-color", designSystemVariables.colorOnSurfaceMedium),
51
+ optionsColor: FtCssVariable.extend("--ft-select-options-color", designSystemVariables.colorOnSurface),
50
52
  optionsZIndex: FtCssVariable.create("--ft-select-options-z-index", "NUMBER", "2"),
51
53
  colorSurface: FtCssVariable.external(designSystemVariables.colorSurface, "Design system"),
52
- colorOnSurface: FtCssVariable.external(designSystemVariables.colorOnSurface, "Design system"),
53
54
  colorOnSurfaceDisabled: FtCssVariable.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
54
55
  colorPrimary: FtCssVariable.external(designSystemVariables.colorPrimary, "Design system"),
55
56
  borderRadiusS: FtCssVariable.external(designSystemVariables.borderRadiusS, "Design system"),
@@ -98,13 +99,14 @@ let FtSelect = class FtSelect extends FtLitElement {
98
99
  padding-left: 16px;
99
100
  padding-right: 8px;
100
101
  gap: 8px;
102
+ color: ${FtSelectCssVariables.selectedOptionColor};
103
+ ${setVariable(FtRippleCssVariables.color, FtSelectCssVariables.selectedOptionColor)};
101
104
  }
102
105
 
103
106
  .ft-select--input-panel,
104
107
  .ft-select--option {
105
- color: ${FtSelectCssVariables.colorOnSurface};
106
- --ft-opacity-color-content-on-surface-hover: 0.08;
107
- --ft-opacity-color-content-on-surface-dragged: 0.04;
108
+ ${setVariable(FtRippleCssVariables.opacityContentOnSurfaceHover, "0.08")};
109
+ ${setVariable(FtRippleCssVariables.opacityContentOnSurfaceDragged, "0.04")};
108
110
  }
109
111
 
110
112
  .ft-select--disabled .ft-select--input-panel,
@@ -169,6 +171,7 @@ let FtSelect = class FtSelect extends FtLitElement {
169
171
  top: 100%;
170
172
  left: 0;
171
173
  right: 0;
174
+ color: ${FtSelectCssVariables.optionsColor};
172
175
  background: ${FtSelectCssVariables.colorSurface};
173
176
  z-index: ${FtSelectCssVariables.optionsZIndex};
174
177
  box-shadow: ${FtSelectCssVariables.elevation02};
@@ -218,14 +221,15 @@ let FtSelect = class FtSelect extends FtLitElement {
218
221
  <div class="ft-select--input-panel"
219
222
  part="selected-value"
220
223
  tabindex="${disabled ? "-1" : "0"}"
221
- @click=${() => this.optionsDisplayed = !this.optionsDisplayed}
224
+ @click=${() => {
225
+ this.optionsDisplayed = !this.optionsDisplayed;
226
+ this.focusOptions = this.optionsDisplayed;
227
+ }}
222
228
  @keydown=${this.onMainPanelKeyDown}
223
229
  aria-label="${this.label}"
224
230
  aria-haspopup="listbox"
225
231
  aria-expanded="${optionsDisplayed}">
226
- ${this.outlined ? null : html `
227
- <ft-ripple ?disabled=${disabled} activated></ft-ripple>
228
- `}
232
+ <ft-ripple ?disabled=${disabled} ?activated=${!this.outlined}></ft-ripple>
229
233
  <ft-typography variant="body1" class="ft-select--selected-option">
230
234
  ${((_c = this.selectedOption) === null || _c === void 0 ? void 0 : _c.value) != null ? (_e = (_d = this.selectedOption) === null || _d === void 0 ? void 0 : _d.label) !== null && _e !== void 0 ? _e : "" : ""}
231
235
  </ft-typography>