@tylertech/forge 3.3.6 → 3.4.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.
- package/custom-elements.json +48 -27
- package/dist/app-bar/forge-app-bar.css +2 -1
- package/dist/forge.css +12 -0
- package/dist/icon-button/forge-icon-button.css +1 -0
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +3 -3
- package/dist/toolbar/forge-toolbar.css +2 -1
- package/dist/typography/forge-typography.css +12 -0
- package/dist/vscode.css-custom-data.json +15 -15
- package/dist/vscode.html-custom-data.json +6 -6
- package/esm/app-bar/app-bar/app-bar.d.ts +1 -0
- package/esm/app-bar/app-bar/app-bar.js +2 -1
- package/esm/calendar/calendar-core.d.ts +1 -1
- package/esm/calendar/calendar-core.js +1 -1
- package/esm/checkbox/checkbox.js +1 -1
- package/esm/deprecated/icon-button/deprecated-icon-button.js +1 -1
- package/esm/icon-button/icon-button.d.ts +1 -0
- package/esm/icon-button/icon-button.js +2 -1
- package/esm/popover/popover-adapter.js +3 -1
- package/esm/radio/radio/radio.js +1 -1
- package/esm/switch/switch.js +1 -1
- package/esm/tabs/tab/tab-adapter.d.ts +3 -0
- package/esm/tabs/tab/tab-adapter.js +5 -0
- package/esm/tabs/tab/tab-core.d.ts +3 -0
- package/esm/tabs/tab/tab-core.js +5 -0
- package/esm/tabs/tab/tab.d.ts +6 -4
- package/esm/tabs/tab/tab.js +6 -5
- package/esm/tabs/tab-bar/tab-bar-core.js +1 -1
- package/esm/tabs/tab-bar/tab-bar.d.ts +4 -2
- package/esm/tabs/tab-bar/tab-bar.js +3 -3
- package/esm/toolbar/toolbar.d.ts +1 -0
- package/esm/toolbar/toolbar.js +2 -1
- package/package.json +1 -1
- package/sass/app-bar/app-bar/_core.scss +1 -1
- package/sass/checkbox/_core.scss +1 -1
- package/sass/core/styles/tokens/app-bar/app-bar/_tokens.scss +1 -0
- package/sass/core/styles/tokens/icon-button/_tokens.scss +1 -0
- package/sass/core/styles/tokens/tabs/tab/_tokens.scss +6 -6
- package/sass/core/styles/tokens/toolbar/_tokens.scss +2 -1
- package/sass/core/styles/tokens/typography/_tokens.label.scss +10 -0
- package/sass/icon-button/_core.scss +1 -0
- package/sass/radio/radio/_core.scss +1 -1
- package/sass/switch/_core.scss +1 -1
- package/sass/tabs/tab/_core.scss +4 -19
- package/sass/tabs/tab/tab.scss +1 -25
- package/sass/tabs/tab-bar/_core.scss +1 -0
- package/sass/toolbar/_core.scss +1 -1
package/esm/radio/radio/radio.js
CHANGED
|
@@ -19,7 +19,7 @@ import { RadioAdapter } from './radio-adapter';
|
|
|
19
19
|
import { RADIO_CONSTANTS, tryCheck } from './radio-constants';
|
|
20
20
|
import { RadioCore } from './radio-core';
|
|
21
21
|
const template = '<template><div id=\"radio\" class=\"forge-radio\" part=\"root\"><div id=\"container\" class=\"container\" aria-hidden=\"true\"><div id=\"background\" class=\"background\" part=\"background\"></div><forge-focus-indicator target=\":host\" part=\"focus-indicator\"></forge-focus-indicator><forge-state-layer exportparts=\"surface:state-layer\"></forge-state-layer></div><span id=\"label\" class=\"label\" for=\"input\" part=\"label\"><slot></slot></span></div></template>';
|
|
22
|
-
const styles = ':host{display:inline-block;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}:host(:focus){outline:0}.forge-radio{--_radio-primary-color:var(--forge-radio-primary-color, var(--forge-theme-tertiary, #3d5afe));--_radio-inactive-color:var(--forge-radio-inactive-color, var(--forge-theme-surface-container-high, #9e9e9e));--_radio-size:var(--forge-radio-size, 20px);--_radio-mark-size:var(--forge-radio-mark-size, 12px);--_radio-state-layer-size:var(--forge-radio-state-layer-size, 40px);--_radio-state-layer-dense-size:var(--forge-radio-state-layer-dense-size, 24px);--_radio-width:var(--forge-radio-width, var(--_radio-size));--_radio-height:var(--forge-radio-height, var(--_radio-size));--_radio-border-width:var(--forge-radio-border-width, var(--forge-border-medium, 2px));--_radio-unchecked-border-color:var(--forge-radio-unchecked-border-color, var(--_radio-inactive-color));--_radio-checked-border-color:var(--forge-radio-checked-border-color, var(--_radio-primary-color));--_radio-background:var(--forge-radio-background, transparent);--_radio-shape:var(--forge-radio-shape, calc(var(--forge-shape-round, 50%) * var(--forge-shape-factor, 1)));--_radio-mark-width:var(--forge-radio-mark-width, var(--_radio-mark-size));--_radio-mark-height:var(--forge-radio-mark-height, var(--_radio-mark-size));--_radio-mark-unchecked-color:var(--forge-radio-mark-unchecked-color, var(--_radio-inactive-color));--_radio-mark-checked-color:var(--forge-radio-mark-checked-color, var(--_radio-primary-color));--_radio-mark-unchecked-background:var(--forge-radio-mark-unchecked-background, transparent);--_radio-mark-checked-background:var(--forge-radio-mark-checked-background, transparent);--_radio-gap:var(--forge-radio-gap, 0);--_radio-justify:var(--forge-radio-justify, start);--_radio-direction:var(--forge-radio-direction, initial);--_radio-state-layer-width:var(--forge-radio-state-layer-width, var(--_radio-state-layer-size));--_radio-state-layer-height:var(--forge-radio-state-layer-height, var(--_radio-state-layer-size));--_radio-state-layer-unchecked-color:var(--forge-radio-state-layer-unchecked-color, var(--_radio-color));--_radio-state-layer-checked-color:var(--forge-radio-state-layer-checked-color, var(--_radio-primary-color));--_radio-state-layer-shape:var(--forge-radio-state-layer-shape, var(--_radio-shape));--_radio-state-layer-dense-width:var(--forge-radio-state-layer-dense-width, var(--_radio-state-layer-dense-size));--_radio-state-layer-dense-height:var(--forge-radio-state-layer-dense-height, var(--_radio-state-layer-dense-size));--_radio-disabled-opacity:var(--forge-radio-disabled-opacity, 0.38);--_radio-animation-duration:var(--forge-radio-animation-duration, var(--forge-animation-duration-short4, 200ms));--_radio-animation-timing-function:var(--forge-radio-animation-timing-function, var(--forge-animation-easing-decelerate, cubic-bezier(0, 0, 0, 1)));--_radio-animation-delay:var(--forge-radio-animation-delay, 0ms)}.forge-radio{position:relative;flex-direction:var(--_radio-direction);flex-shrink:0;align-items:center;justify-content:var(--_radio-justify);gap:var(--_radio-gap);display:flex}.forge-radio .container{position:relative;align-items:center;justify-content:center;display:flex;border-radius:var(--_radio-shape);inline-size:var(--_radio-state-layer-width);block-size:var(--_radio-state-layer-height);cursor:pointer}.forge-radio .background{position:relative;align-items:center;justify-content:center;display:flex;overflow:hidden;transition-duration:var(--_radio-animation-duration);transition-delay:var(--_radio-animation-delay);transition-timing-function:var(--_radio-animation-timing-function);transition-property:border-color;box-sizing:border-box;border-radius:var(--_radio-shape);border-width:var(--_radio-border-width);border-style:solid;border-color:var(--_radio-unchecked-border-color);inline-size:var(--_radio-width);block-size:var(--_radio-height);background:var(--_radio-background)}.forge-radio .background::after{content:\"\";position:absolute;contain:strict;transition-duration:var(--_radio-animation-duration);transition-delay:var(--_radio-animation-delay);transition-timing-function:var(--_radio-animation-timing-function);transition-property:inline-size,block-size,border-color;border-radius:var(--_radio-shape);border-width:calc(var(--_radio-mark-height)/ 2) calc(var(--_radio-mark-width)/ 2);border-color:var(--_radio-mark-unchecked-color);border-style:solid;inline-size:calc(var(--_radio-width) - 2 * var(--_radio-border-width));block-size:calc(var(--_radio-height) - 2 * var(--_radio-border-width));background:var(--_radio-mark-unchecked-background)}.forge-radio .label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-
|
|
22
|
+
const styles = ':host{display:inline-block;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}:host(:focus){outline:0}.forge-radio{--_radio-primary-color:var(--forge-radio-primary-color, var(--forge-theme-tertiary, #3d5afe));--_radio-inactive-color:var(--forge-radio-inactive-color, var(--forge-theme-surface-container-high, #9e9e9e));--_radio-size:var(--forge-radio-size, 20px);--_radio-mark-size:var(--forge-radio-mark-size, 12px);--_radio-state-layer-size:var(--forge-radio-state-layer-size, 40px);--_radio-state-layer-dense-size:var(--forge-radio-state-layer-dense-size, 24px);--_radio-width:var(--forge-radio-width, var(--_radio-size));--_radio-height:var(--forge-radio-height, var(--_radio-size));--_radio-border-width:var(--forge-radio-border-width, var(--forge-border-medium, 2px));--_radio-unchecked-border-color:var(--forge-radio-unchecked-border-color, var(--_radio-inactive-color));--_radio-checked-border-color:var(--forge-radio-checked-border-color, var(--_radio-primary-color));--_radio-background:var(--forge-radio-background, transparent);--_radio-shape:var(--forge-radio-shape, calc(var(--forge-shape-round, 50%) * var(--forge-shape-factor, 1)));--_radio-mark-width:var(--forge-radio-mark-width, var(--_radio-mark-size));--_radio-mark-height:var(--forge-radio-mark-height, var(--_radio-mark-size));--_radio-mark-unchecked-color:var(--forge-radio-mark-unchecked-color, var(--_radio-inactive-color));--_radio-mark-checked-color:var(--forge-radio-mark-checked-color, var(--_radio-primary-color));--_radio-mark-unchecked-background:var(--forge-radio-mark-unchecked-background, transparent);--_radio-mark-checked-background:var(--forge-radio-mark-checked-background, transparent);--_radio-gap:var(--forge-radio-gap, 0);--_radio-justify:var(--forge-radio-justify, start);--_radio-direction:var(--forge-radio-direction, initial);--_radio-state-layer-width:var(--forge-radio-state-layer-width, var(--_radio-state-layer-size));--_radio-state-layer-height:var(--forge-radio-state-layer-height, var(--_radio-state-layer-size));--_radio-state-layer-unchecked-color:var(--forge-radio-state-layer-unchecked-color, var(--_radio-color));--_radio-state-layer-checked-color:var(--forge-radio-state-layer-checked-color, var(--_radio-primary-color));--_radio-state-layer-shape:var(--forge-radio-state-layer-shape, var(--_radio-shape));--_radio-state-layer-dense-width:var(--forge-radio-state-layer-dense-width, var(--_radio-state-layer-dense-size));--_radio-state-layer-dense-height:var(--forge-radio-state-layer-dense-height, var(--_radio-state-layer-dense-size));--_radio-disabled-opacity:var(--forge-radio-disabled-opacity, 0.38);--_radio-animation-duration:var(--forge-radio-animation-duration, var(--forge-animation-duration-short4, 200ms));--_radio-animation-timing-function:var(--forge-radio-animation-timing-function, var(--forge-animation-easing-decelerate, cubic-bezier(0, 0, 0, 1)));--_radio-animation-delay:var(--forge-radio-animation-delay, 0ms)}.forge-radio{position:relative;flex-direction:var(--_radio-direction);flex-shrink:0;align-items:center;justify-content:var(--_radio-justify);gap:var(--_radio-gap);display:flex}.forge-radio .container{position:relative;align-items:center;justify-content:center;display:flex;border-radius:var(--_radio-shape);inline-size:var(--_radio-state-layer-width);block-size:var(--_radio-state-layer-height);cursor:pointer}.forge-radio .background{position:relative;align-items:center;justify-content:center;display:flex;overflow:hidden;transition-duration:var(--_radio-animation-duration);transition-delay:var(--_radio-animation-delay);transition-timing-function:var(--_radio-animation-timing-function);transition-property:border-color;box-sizing:border-box;border-radius:var(--_radio-shape);border-width:var(--_radio-border-width);border-style:solid;border-color:var(--_radio-unchecked-border-color);inline-size:var(--_radio-width);block-size:var(--_radio-height);background:var(--_radio-background)}.forge-radio .background::after{content:\"\";position:absolute;contain:strict;transition-duration:var(--_radio-animation-duration);transition-delay:var(--_radio-animation-delay);transition-timing-function:var(--_radio-animation-timing-function);transition-property:inline-size,block-size,border-color;border-radius:var(--_radio-shape);border-width:calc(var(--_radio-mark-height)/ 2) calc(var(--_radio-mark-width)/ 2);border-color:var(--_radio-mark-unchecked-color);border-style:solid;inline-size:calc(var(--_radio-width) - 2 * var(--_radio-border-width));block-size:calc(var(--_radio-height) - 2 * var(--_radio-border-width));background:var(--_radio-mark-unchecked-background)}.forge-radio .label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label2-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-label2-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .8125)));font-weight:var(--forge-typography-label2-font-weight,400);line-height:var(--forge-typography-label2-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label2-letter-spacing, .0096153846em);text-transform:var(--forge-typography-label2-text-transform,inherit);text-decoration:var(--forge-typography-label2-text-decoration,inherit);cursor:default}.forge-radio .label:empty{display:none}:host([checked]) .forge-radio .background{border-color:var(--_radio-checked-border-color)}:host([checked]) .forge-radio .background::after{border-color:var(--_radio-mark-checked-color);inline-size:0px;block-size:0px;background:var(--_radio-mark-checked-background)}:host([checked]) forge-state-layer{--forge-state-layer-color:var(--_radio-state-layer-checked-color)}:host([dense]) .forge-radio .container{inline-size:var(--_radio-state-layer-dense-width);block-size:var(--_radio-state-layer-dense-height)}:host([disabled]) .forge-radio .container{opacity:var(--_radio-disabled-opacity);cursor:not-allowed}:host([readonly]) .forge-radio .container{cursor:not-allowed}forge-focus-indicator{--forge-focus-indicator-color:var(--_radio-primary-color);--forge-focus-indicator-outward-offset:0px;--forge-focus-indicator-shape:var(--_radio-state-layer-shape)}forge-state-layer{--forge-state-layer-color:var(--_radio-state-layer-unchecked-color)}';
|
|
23
23
|
/**
|
|
24
24
|
* @tag forge-radio
|
|
25
25
|
*
|
package/esm/switch/switch.js
CHANGED
|
@@ -18,7 +18,7 @@ import { SwitchAdapter } from './switch-adapter';
|
|
|
18
18
|
import { SWITCH_CONSTANTS } from './switch-constants';
|
|
19
19
|
import { SwitchCore } from './switch-core';
|
|
20
20
|
const template = '<template><div class=\"forge-switch\" part=\"switch\"><div id=\"container\" class=\"container\"><div class=\"track\" part=\"track\"></div><div class=\"handle\" part=\"handle\"><div id=\"icon-off\" class=\"icon icon__off\" part=\"icon-off\"><slot name=\"icon-off\"><svg aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M20 13H4v-2h16v2z\"/></svg></slot></div><div id=\"icon-on\" class=\"icon icon__on\" part=\"icon-on\"><slot name=\"icon-on\"><svg aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z\"/></svg></slot></div><forge-state-layer target=\":host\" exportparts=\"surface:state-layer\"></forge-state-layer></div><forge-focus-indicator target=\":host\" part=\"focus-indicator\"></forge-focus-indicator></div><label id=\"label\" class=\"label\" part=\"label\"><slot></slot></label></div></template>';
|
|
21
|
-
const styles = ':host{display:inline-block;outline:0;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}.forge-switch{--_switch-handle-size:var(--forge-switch-handle-size, 20px);--_switch-handle-scale:var(--forge-switch-handle-scale, 1);--_switch-handle-elevation:var(--forge-switch-handle-elevation, 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12));--_switch-track-border-width:var(--forge-switch-track-border-width, 0);--_switch-track-border-color:var(--forge-switch-track-border-color, transparent);--_switch-icon-color:var(--forge-switch-icon-color, var(--forge-theme-on-tertiary, #ffffff));--_switch-icon-size:var(--forge-switch-icon-size, 16px);--_switch-icon-scale:var(--forge-switch-icon-scale, 1);--_switch-state-layer-size:var(--forge-switch-state-layer-size, 40px);--_switch-state-layer-dense-size:var(--forge-switch-state-layer-dense-size, 28px);--_switch-handle-on-color:var(--forge-switch-handle-on-color, var(--forge-theme-tertiary, #3d5afe));--_switch-handle-off-color:var(--forge-switch-handle-off-color, var(--forge-theme-surface-container-high, #9e9e9e));--_switch-handle-width:var(--forge-switch-handle-width, var(--_switch-handle-size));--_switch-handle-height:var(--forge-switch-handle-height, var(--_switch-handle-size));--_switch-handle-on-scale:var(--forge-switch-handle-on-scale, var(--_switch-handle-scale));--_switch-handle-off-scale:var(--forge-switch-handle-off-scale, var(--_switch-handle-scale));--_switch-handle-shape:var(--forge-switch-handle-shape, calc(var(--forge-shape-round, 50%) * var(--forge-shape-factor, 1)));--_switch-handle-on-elevation:var(--forge-switch-handle-on-elevation, var(--_switch-handle-elevation));--_switch-handle-off-elevation:var(--forge-switch-handle-off-elevation, var(--_switch-handle-elevation));--_switch-track-on-color:var(--forge-switch-track-on-color, var(--forge-theme-tertiary-container, #d0d7ff));--_switch-track-off-color:var(--forge-switch-track-off-color, var(--forge-theme-surface-container, #e0e0e0));--_switch-track-width:var(--forge-switch-track-width, 36px);--_switch-track-height:var(--forge-switch-track-height, 14px);--_switch-track-shape:var(--forge-switch-track-shape, calc(var(--forge-shape-full, 9999px) * var(--forge-shape-factor, 1)));--_switch-track-on-border-width:var(--forge-switch-track-on-border-width, var(--_switch-track-border-width));--_switch-track-off-border-width:var(--forge-switch-track-off-border-width, var(--_switch-track-border-width));--_switch-track-on-border-color:var(--forge-switch-track-on-border-color, var(--_switch-track-border-color));--_switch-track-off-border-color:var(--forge-switch-track-off-border-color, var(--_switch-track-border-color));--_switch-icon-on-color:var(--forge-switch-icon-on-color, var(--_switch-icon-color));--_switch-icon-off-color:var(--forge-switch-icon-off-color, var(--_switch-icon-color));--_switch-icon-on-size:var(--forge-switch-icon-on-size, var(--_switch-icon-size));--_switch-icon-off-size:var(--forge-switch-icon-off-size, var(--_switch-icon-size));--_switch-icon-on-scale:var(--forge-switch-icon-on-scale, var(--_switch-icon-scale));--_switch-icon-off-scale:var(--forge-switch-icon-off-scale, var(--_switch-icon-scale));--_switch-gap:var(--forge-switch-gap, 0);--_switch-justify:var(--forge-switch-justify, start);--_switch-direction:var(--forge-switch-direction, initial);--_switch-state-layer-width:var(--forge-switch-state-layer-width, var(--_switch-state-layer-size));--_switch-state-layer-height:var(--forge-switch-state-layer-height, var(--_switch-state-layer-size));--_switch-state-layer-on-color:var(--forge-switch-state-layer-on-color, var(--_switch-handle-on-color));--_switch-state-layer-off-color:var(--forge-switch-state-layer-off-color, var(--_switch-color));--_switch-state-layer-dense-width:var(--forge-switch-state-layer-dense-width, var(--_switch-state-layer-dense-size));--_switch-state-layer-dense-height:var(--forge-switch-state-layer-dense-height, var(--_switch-state-layer-dense-size));--_switch-disabled-opacity:var(--forge-switch-disabled-opacity, 0.38);--_switch-handle-active-on-color:var(--forge-switch-handle-active-on-color, var(--_switch-handle-on-color));--_switch-handle-active-off-color:var(--forge-switch-handle-active-off-color, var(--_switch-handle-off-color));--_switch-handle-active-scale:var(--forge-switch-handle-active-scale, 1.2);--_switch-handle-active-on-scale:var(--forge-switch-handle-active-on-scale, var(--_switch-handle-active-scale));--_switch-handle-active-off-scale:var(--forge-switch-handle-active-off-scale, var(--_switch-handle-active-scale));--_switch-handle-active-elevation:var(--forge-switch-handle-active-elevation, var(--_switch-handle-elevation));--_switch-handle-active-on-elevation:var(--forge-switch-handle-active-on-elevation, var(--_switch-handle-active-elevation));--_switch-handle-active-off-elevation:var(--forge-switch-handle-active-off-elevation, var(--_switch-handle-active-elevation));--_switch-track-active-on-color:var(--forge-switch-track-active-on-color, var(--_switch-track-on-color));--_switch-track-active-off-color:var(--forge-switch-track-active-off-color, var(--_switch-track-off-color));--_switch-track-active-on-border-width:var(--forge-switch-track-active-on-border-width, var(--_switch-track-on-border-width));--_switch-track-active-off-border-width:var(--forge-switch-track-active-off-border-width, var(--_switch-track-off-border-width));--_switch-track-active-on-border-color:var(--forge-switch-track-active-on-border-color, var(--_switch-track-on-border-color));--_switch-track-active-off-border-color:var(--forge-switch-track-active-off-border-color, var(--_switch-track-off-border-color));--_switch-icon-active-on-color:var(--forge-switch-icon-active-on-color, var(--_switch-icon-on-color));--_switch-icon-active-off-color:var(--forge-switch-icon-active-off-color, var(--_switch-icon-off-color));--_switch-icon-active-on-scale:var(--forge-switch-icon-active-on-scale, var(--_switch-icon-on-scale));--_switch-icon-active-off-scale:var(--forge-switch-icon-active-off-scale, var(--_switch-icon-off-scale));--_switch-animation-duration:var(--forge-switch-animation-duration, var(--forge-animation-duration-short2, 100ms));--_switch-animation-timing:var(--forge-switch-animation-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_switch-active-animation-timing:var(--forge-switch-active-animation-timing, var(--forge-animation-easing-linear, cubic-bezier(0, 0, 1, 1)))}.forge-switch{display:flex;position:relative;flex-direction:var(--_switch-direction);flex-shrink:0;align-items:center;justify-content:var(--_switch-justify);gap:var(--_switch-gap);--_switch-current-state-layer-width:var(--_switch-state-layer-width);--_switch-current-state-layer-height:var(--_switch-state-layer-height)}.forge-switch .container{position:relative;align-items:center;display:flex;block-size:max(var(--_switch-handle-height),var(--_switch-track-height),var(--_switch-current-state-layer-height));cursor:pointer}.forge-switch .input{position:absolute;z-index:1;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}.forge-switch .track{transition-property:background-color,border-color,border-width;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);box-sizing:border-box;margin-inline:calc(max(var(--_switch-handle-width),var(--_switch-current-state-layer-width))/ 2 - calc(var(--_switch-track-height)/ 2));border-width:var(--_switch-track-off-border-width);border-color:var(--_switch-track-off-border-color);border-style:solid;border-radius:var(--_switch-track-shape);inline-size:var(--_switch-track-width);block-size:var(--_switch-track-height);background-color:var(--_switch-track-off-color)}.forge-switch .handle{position:absolute;justify-content:center;align-items:center;display:flex;transition-property:translate;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-current-state-layer-width);block-size:var(--_switch-current-state-layer-height)}.forge-switch .handle::before{content:\"\";position:relative;display:block;scale:var(--_switch-handle-off-scale);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing);box-shadow:var(--_switch-handle-off-elevation);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-handle-width);block-size:var(--_switch-handle-height);background-color:var(--_switch-handle-off-color)}.forge-switch .icon{position:absolute;align-items:center;justify-content:center;display:flex;transition-property:opacity,scale;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);inline-size:var(--_switch-icon-off-size);block-size:var(--_switch-icon-off-size);color:var(--_switch-icon-off-color);fill:var(--_switch-icon-off-color);font-size:var(--_switch-icon-off-size);--forge-icon-font-size:var(--_switch-icon-off-size)}.forge-switch .icon__on{--forge-icon-font-size:var(--_switch-icon-on-size);inline-size:var(--_switch-icon-on-size);block-size:var(--_switch-icon-on-size);color:var(--_switch-icon-on-color);fill:var(--_switch-icon-on-color);font-size:var(--_switch-icon-on-size);opacity:0;scale:0.4}.forge-switch .icon__off{opacity:1;scale:var(--_switch-icon-off-scale)}.forge-switch .label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label1-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-label1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .75)));font-weight:var(--forge-typography-label1-font-weight,400);line-height:var(--forge-typography-label1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label1-letter-spacing, .0357142857em);text-transform:var(--forge-typography-label1-text-transform,inherit);text-decoration:var(--forge-typography-label1-text-decoration,inherit)}.forge-switch .label:empty{display:none}.forge-switch .hidden{display:none}.forge-switch ::slotted([slot=input]){position:absolute;z-index:1;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}:host([on]) .track{border-width:var(--_switch-track-on-border-width);border-color:var(--_switch-track-on-border-color);background-color:var(--_switch-track-on-color)}:host([on]) .handle{translate:calc(var(--_switch-track-width) - calc(var(--_switch-track-height)/ 2) * 2)}:host([on]) .handle::before{scale:var(--_switch-handle-on-scale);box-shadow:var(--_switch-handle-on-elevation);background-color:var(--_switch-handle-on-color)}:host([on]) .handle .icon__on{opacity:1;scale:var(--_switch-icon-on-scale)}:host([on]) .handle .icon__off{opacity:0;scale:0.4}:host([on]) forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-on-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .track{border-width:var(--_switch-track-active-off-border-width);border-color:var(--_switch-track-active-off-border-color);background-color:var(--_switch-track-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-off-scale);box-shadow:var(--_switch-handle-active-off-elevation);background-color:var(--_switch-handle-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-off-scale);color:var(--_switch-icon-active-off-color);fill:var(--_switch-icon-active-off-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .track{border-width:var(--_switch-track-active-on-border-width);border-color:var(--_switch-track-active-on-border-color);background-color:var(--_switch-track-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-on-scale);box-shadow:var(--_switch-handle-active-on-elevation);background-color:var(--_switch-handle-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-on-scale);color:var(--_switch-icon-active-on-color);fill:var(--_switch-icon-active-on-color)}:host([dense]) .forge-switch{--_switch-current-state-layer-width:var(--_switch-state-layer-dense-width);--_switch-current-state-layer-height:var(--_switch-state-layer-dense-height)}:host([disabled]) .forge-switch .container{opacity:var(--_switch-disabled-opacity);cursor:not-allowed}:host([disabled]) .forge-switch .handle::before{box-shadow:none}:host([readonly]) .forge-switch .container{cursor:not-allowed}@media (prefers-reduced-motion){.switch{--_switch-animation-duration:var(--forge-switch-animation-duration, 0s)}}forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-off-color)}forge-focus-indicator{--forge-focus-indicator-shape:var(--_switch-track-shape);--forge-focus-indicator-outward-offset:0px}';
|
|
21
|
+
const styles = ':host{display:inline-block;outline:0;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}.forge-switch{--_switch-handle-size:var(--forge-switch-handle-size, 20px);--_switch-handle-scale:var(--forge-switch-handle-scale, 1);--_switch-handle-elevation:var(--forge-switch-handle-elevation, 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12));--_switch-track-border-width:var(--forge-switch-track-border-width, 0);--_switch-track-border-color:var(--forge-switch-track-border-color, transparent);--_switch-icon-color:var(--forge-switch-icon-color, var(--forge-theme-on-tertiary, #ffffff));--_switch-icon-size:var(--forge-switch-icon-size, 16px);--_switch-icon-scale:var(--forge-switch-icon-scale, 1);--_switch-state-layer-size:var(--forge-switch-state-layer-size, 40px);--_switch-state-layer-dense-size:var(--forge-switch-state-layer-dense-size, 28px);--_switch-handle-on-color:var(--forge-switch-handle-on-color, var(--forge-theme-tertiary, #3d5afe));--_switch-handle-off-color:var(--forge-switch-handle-off-color, var(--forge-theme-surface-container-high, #9e9e9e));--_switch-handle-width:var(--forge-switch-handle-width, var(--_switch-handle-size));--_switch-handle-height:var(--forge-switch-handle-height, var(--_switch-handle-size));--_switch-handle-on-scale:var(--forge-switch-handle-on-scale, var(--_switch-handle-scale));--_switch-handle-off-scale:var(--forge-switch-handle-off-scale, var(--_switch-handle-scale));--_switch-handle-shape:var(--forge-switch-handle-shape, calc(var(--forge-shape-round, 50%) * var(--forge-shape-factor, 1)));--_switch-handle-on-elevation:var(--forge-switch-handle-on-elevation, var(--_switch-handle-elevation));--_switch-handle-off-elevation:var(--forge-switch-handle-off-elevation, var(--_switch-handle-elevation));--_switch-track-on-color:var(--forge-switch-track-on-color, var(--forge-theme-tertiary-container, #d0d7ff));--_switch-track-off-color:var(--forge-switch-track-off-color, var(--forge-theme-surface-container, #e0e0e0));--_switch-track-width:var(--forge-switch-track-width, 36px);--_switch-track-height:var(--forge-switch-track-height, 14px);--_switch-track-shape:var(--forge-switch-track-shape, calc(var(--forge-shape-full, 9999px) * var(--forge-shape-factor, 1)));--_switch-track-on-border-width:var(--forge-switch-track-on-border-width, var(--_switch-track-border-width));--_switch-track-off-border-width:var(--forge-switch-track-off-border-width, var(--_switch-track-border-width));--_switch-track-on-border-color:var(--forge-switch-track-on-border-color, var(--_switch-track-border-color));--_switch-track-off-border-color:var(--forge-switch-track-off-border-color, var(--_switch-track-border-color));--_switch-icon-on-color:var(--forge-switch-icon-on-color, var(--_switch-icon-color));--_switch-icon-off-color:var(--forge-switch-icon-off-color, var(--_switch-icon-color));--_switch-icon-on-size:var(--forge-switch-icon-on-size, var(--_switch-icon-size));--_switch-icon-off-size:var(--forge-switch-icon-off-size, var(--_switch-icon-size));--_switch-icon-on-scale:var(--forge-switch-icon-on-scale, var(--_switch-icon-scale));--_switch-icon-off-scale:var(--forge-switch-icon-off-scale, var(--_switch-icon-scale));--_switch-gap:var(--forge-switch-gap, 0);--_switch-justify:var(--forge-switch-justify, start);--_switch-direction:var(--forge-switch-direction, initial);--_switch-state-layer-width:var(--forge-switch-state-layer-width, var(--_switch-state-layer-size));--_switch-state-layer-height:var(--forge-switch-state-layer-height, var(--_switch-state-layer-size));--_switch-state-layer-on-color:var(--forge-switch-state-layer-on-color, var(--_switch-handle-on-color));--_switch-state-layer-off-color:var(--forge-switch-state-layer-off-color, var(--_switch-color));--_switch-state-layer-dense-width:var(--forge-switch-state-layer-dense-width, var(--_switch-state-layer-dense-size));--_switch-state-layer-dense-height:var(--forge-switch-state-layer-dense-height, var(--_switch-state-layer-dense-size));--_switch-disabled-opacity:var(--forge-switch-disabled-opacity, 0.38);--_switch-handle-active-on-color:var(--forge-switch-handle-active-on-color, var(--_switch-handle-on-color));--_switch-handle-active-off-color:var(--forge-switch-handle-active-off-color, var(--_switch-handle-off-color));--_switch-handle-active-scale:var(--forge-switch-handle-active-scale, 1.2);--_switch-handle-active-on-scale:var(--forge-switch-handle-active-on-scale, var(--_switch-handle-active-scale));--_switch-handle-active-off-scale:var(--forge-switch-handle-active-off-scale, var(--_switch-handle-active-scale));--_switch-handle-active-elevation:var(--forge-switch-handle-active-elevation, var(--_switch-handle-elevation));--_switch-handle-active-on-elevation:var(--forge-switch-handle-active-on-elevation, var(--_switch-handle-active-elevation));--_switch-handle-active-off-elevation:var(--forge-switch-handle-active-off-elevation, var(--_switch-handle-active-elevation));--_switch-track-active-on-color:var(--forge-switch-track-active-on-color, var(--_switch-track-on-color));--_switch-track-active-off-color:var(--forge-switch-track-active-off-color, var(--_switch-track-off-color));--_switch-track-active-on-border-width:var(--forge-switch-track-active-on-border-width, var(--_switch-track-on-border-width));--_switch-track-active-off-border-width:var(--forge-switch-track-active-off-border-width, var(--_switch-track-off-border-width));--_switch-track-active-on-border-color:var(--forge-switch-track-active-on-border-color, var(--_switch-track-on-border-color));--_switch-track-active-off-border-color:var(--forge-switch-track-active-off-border-color, var(--_switch-track-off-border-color));--_switch-icon-active-on-color:var(--forge-switch-icon-active-on-color, var(--_switch-icon-on-color));--_switch-icon-active-off-color:var(--forge-switch-icon-active-off-color, var(--_switch-icon-off-color));--_switch-icon-active-on-scale:var(--forge-switch-icon-active-on-scale, var(--_switch-icon-on-scale));--_switch-icon-active-off-scale:var(--forge-switch-icon-active-off-scale, var(--_switch-icon-off-scale));--_switch-animation-duration:var(--forge-switch-animation-duration, var(--forge-animation-duration-short2, 100ms));--_switch-animation-timing:var(--forge-switch-animation-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_switch-active-animation-timing:var(--forge-switch-active-animation-timing, var(--forge-animation-easing-linear, cubic-bezier(0, 0, 1, 1)))}.forge-switch{display:flex;position:relative;flex-direction:var(--_switch-direction);flex-shrink:0;align-items:center;justify-content:var(--_switch-justify);gap:var(--_switch-gap);--_switch-current-state-layer-width:var(--_switch-state-layer-width);--_switch-current-state-layer-height:var(--_switch-state-layer-height)}.forge-switch .container{position:relative;align-items:center;display:flex;block-size:max(var(--_switch-handle-height),var(--_switch-track-height),var(--_switch-current-state-layer-height));cursor:pointer}.forge-switch .input{position:absolute;z-index:1;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}.forge-switch .track{transition-property:background-color,border-color,border-width;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);box-sizing:border-box;margin-inline:calc(max(var(--_switch-handle-width),var(--_switch-current-state-layer-width))/ 2 - calc(var(--_switch-track-height)/ 2));border-width:var(--_switch-track-off-border-width);border-color:var(--_switch-track-off-border-color);border-style:solid;border-radius:var(--_switch-track-shape);inline-size:var(--_switch-track-width);block-size:var(--_switch-track-height);background-color:var(--_switch-track-off-color)}.forge-switch .handle{position:absolute;justify-content:center;align-items:center;display:flex;transition-property:translate;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-current-state-layer-width);block-size:var(--_switch-current-state-layer-height)}.forge-switch .handle::before{content:\"\";position:relative;display:block;scale:var(--_switch-handle-off-scale);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing);box-shadow:var(--_switch-handle-off-elevation);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-handle-width);block-size:var(--_switch-handle-height);background-color:var(--_switch-handle-off-color)}.forge-switch .icon{position:absolute;align-items:center;justify-content:center;display:flex;transition-property:opacity,scale;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);inline-size:var(--_switch-icon-off-size);block-size:var(--_switch-icon-off-size);color:var(--_switch-icon-off-color);fill:var(--_switch-icon-off-color);font-size:var(--_switch-icon-off-size);--forge-icon-font-size:var(--_switch-icon-off-size)}.forge-switch .icon__on{--forge-icon-font-size:var(--_switch-icon-on-size);inline-size:var(--_switch-icon-on-size);block-size:var(--_switch-icon-on-size);color:var(--_switch-icon-on-color);fill:var(--_switch-icon-on-color);font-size:var(--_switch-icon-on-size);opacity:0;scale:0.4}.forge-switch .icon__off{opacity:1;scale:var(--_switch-icon-off-scale)}.forge-switch .label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label2-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-label2-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .8125)));font-weight:var(--forge-typography-label2-font-weight,400);line-height:var(--forge-typography-label2-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label2-letter-spacing, .0096153846em);text-transform:var(--forge-typography-label2-text-transform,inherit);text-decoration:var(--forge-typography-label2-text-decoration,inherit)}.forge-switch .label:empty{display:none}.forge-switch .hidden{display:none}.forge-switch ::slotted([slot=input]){position:absolute;z-index:1;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}:host([on]) .track{border-width:var(--_switch-track-on-border-width);border-color:var(--_switch-track-on-border-color);background-color:var(--_switch-track-on-color)}:host([on]) .handle{translate:calc(var(--_switch-track-width) - calc(var(--_switch-track-height)/ 2) * 2)}:host([on]) .handle::before{scale:var(--_switch-handle-on-scale);box-shadow:var(--_switch-handle-on-elevation);background-color:var(--_switch-handle-on-color)}:host([on]) .handle .icon__on{opacity:1;scale:var(--_switch-icon-on-scale)}:host([on]) .handle .icon__off{opacity:0;scale:0.4}:host([on]) forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-on-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .track{border-width:var(--_switch-track-active-off-border-width);border-color:var(--_switch-track-active-off-border-color);background-color:var(--_switch-track-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-off-scale);box-shadow:var(--_switch-handle-active-off-elevation);background-color:var(--_switch-handle-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-off-scale);color:var(--_switch-icon-active-off-color);fill:var(--_switch-icon-active-off-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .track{border-width:var(--_switch-track-active-on-border-width);border-color:var(--_switch-track-active-on-border-color);background-color:var(--_switch-track-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-on-scale);box-shadow:var(--_switch-handle-active-on-elevation);background-color:var(--_switch-handle-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-on-scale);color:var(--_switch-icon-active-on-color);fill:var(--_switch-icon-active-on-color)}:host([dense]) .forge-switch{--_switch-current-state-layer-width:var(--_switch-state-layer-dense-width);--_switch-current-state-layer-height:var(--_switch-state-layer-dense-height)}:host([disabled]) .forge-switch .container{opacity:var(--_switch-disabled-opacity);cursor:not-allowed}:host([disabled]) .forge-switch .handle::before{box-shadow:none}:host([readonly]) .forge-switch .container{cursor:not-allowed}@media (prefers-reduced-motion){.switch{--_switch-animation-duration:var(--forge-switch-animation-duration, 0s)}}forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-off-color)}forge-focus-indicator{--forge-focus-indicator-shape:var(--_switch-track-shape);--forge-focus-indicator-outward-offset:0px}';
|
|
22
22
|
/**
|
|
23
23
|
* @tag forge-switch
|
|
24
24
|
*
|
|
@@ -7,6 +7,7 @@ import { BaseAdapter, IBaseAdapter } from '../../core/base/base-adapter';
|
|
|
7
7
|
import type { ITabComponent } from './tab';
|
|
8
8
|
export interface ITabAdapter extends IBaseAdapter {
|
|
9
9
|
initialize(): void;
|
|
10
|
+
activateFocusIndicator(): void;
|
|
10
11
|
addInteractionListener(type: string, listener: EventListener): void;
|
|
11
12
|
setDisabled(value: boolean): void;
|
|
12
13
|
setSelected(value: boolean): void;
|
|
@@ -15,9 +16,11 @@ export interface ITabAdapter extends IBaseAdapter {
|
|
|
15
16
|
}
|
|
16
17
|
export declare class TabAdapter extends BaseAdapter<ITabComponent> implements ITabAdapter {
|
|
17
18
|
private readonly _tabIndicatorElement;
|
|
19
|
+
private readonly _focusIndicatorElement;
|
|
18
20
|
private readonly _stateLayerElement;
|
|
19
21
|
constructor(component: ITabComponent);
|
|
20
22
|
initialize(): void;
|
|
23
|
+
activateFocusIndicator(): void;
|
|
21
24
|
addInteractionListener(type: string, listener: EventListener): void;
|
|
22
25
|
setDisabled(value: boolean): void;
|
|
23
26
|
setSelected(value: boolean): void;
|
|
@@ -8,10 +8,12 @@ import { STATE_LAYER_CONSTANTS } from '../../state-layer';
|
|
|
8
8
|
import { BaseAdapter } from '../../core/base/base-adapter';
|
|
9
9
|
import { TAB_BAR_CONSTANTS } from '../tab-bar/tab-bar-constants';
|
|
10
10
|
import { TAB_CONSTANTS } from './tab-constants';
|
|
11
|
+
import { FOCUS_INDICATOR_CONSTANTS } from '../../focus-indicator';
|
|
11
12
|
export class TabAdapter extends BaseAdapter {
|
|
12
13
|
constructor(component) {
|
|
13
14
|
super(component);
|
|
14
15
|
this._tabIndicatorElement = getShadowElement(this._component, TAB_CONSTANTS.selectors.INDICATOR);
|
|
16
|
+
this._focusIndicatorElement = getShadowElement(this._component, FOCUS_INDICATOR_CONSTANTS.elementName);
|
|
15
17
|
this._stateLayerElement = getShadowElement(this._component, STATE_LAYER_CONSTANTS.elementName);
|
|
16
18
|
}
|
|
17
19
|
initialize() {
|
|
@@ -19,6 +21,9 @@ export class TabAdapter extends BaseAdapter {
|
|
|
19
21
|
this._component.setAttribute('role', 'tab');
|
|
20
22
|
this._component.setAttribute('aria-selected', this._component.selected ? 'true' : 'false');
|
|
21
23
|
}
|
|
24
|
+
activateFocusIndicator() {
|
|
25
|
+
this._focusIndicatorElement.active = true;
|
|
26
|
+
}
|
|
22
27
|
addInteractionListener(type, listener) {
|
|
23
28
|
this._component.addEventListener(type, listener);
|
|
24
29
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { ExperimentalFocusOptions } from '../../constants';
|
|
6
7
|
import { ITabAdapter } from './tab-adapter';
|
|
7
8
|
export interface ITabCore {
|
|
8
9
|
disabled: boolean;
|
|
@@ -11,6 +12,7 @@ export interface ITabCore {
|
|
|
11
12
|
stacked: boolean;
|
|
12
13
|
secondary: boolean;
|
|
13
14
|
inverted: boolean;
|
|
15
|
+
setFocus(options?: ExperimentalFocusOptions): void;
|
|
14
16
|
}
|
|
15
17
|
export declare class TabCore implements ITabCore {
|
|
16
18
|
private _adapter;
|
|
@@ -24,6 +26,7 @@ export declare class TabCore implements ITabCore {
|
|
|
24
26
|
private _keydownListener;
|
|
25
27
|
constructor(_adapter: ITabAdapter);
|
|
26
28
|
initialize(): void;
|
|
29
|
+
setFocus(options?: ExperimentalFocusOptions): void;
|
|
27
30
|
private _onClick;
|
|
28
31
|
private _onKeydown;
|
|
29
32
|
private _dispatchSelectEvent;
|
package/esm/tabs/tab/tab-core.js
CHANGED
|
@@ -22,6 +22,11 @@ export class TabCore {
|
|
|
22
22
|
this._adapter.addInteractionListener('click', this._clickListener);
|
|
23
23
|
this._adapter.addInteractionListener('keydown', this._keydownListener);
|
|
24
24
|
}
|
|
25
|
+
setFocus(options) {
|
|
26
|
+
if (options?.focusVisible) {
|
|
27
|
+
this._adapter.activateFocusIndicator();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
25
30
|
_onClick() {
|
|
26
31
|
if (this._disabled || this._selected) {
|
|
27
32
|
return;
|
package/esm/tabs/tab/tab.d.ts
CHANGED
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { BaseComponent, IBaseComponent } from '../../core/base/base-component';
|
|
7
|
+
import { ExperimentalFocusOptions } from '../../constants';
|
|
7
8
|
export interface ITabComponent extends IBaseComponent {
|
|
8
9
|
disabled: boolean;
|
|
9
10
|
selected: boolean;
|
|
10
11
|
vertical: boolean;
|
|
11
12
|
stacked: boolean;
|
|
13
|
+
/** @deprecated This will be removed in a future version */
|
|
12
14
|
secondary: boolean;
|
|
13
15
|
inverted: boolean;
|
|
16
|
+
focus(options?: ExperimentalFocusOptions): void;
|
|
14
17
|
}
|
|
15
18
|
declare global {
|
|
16
19
|
interface HTMLElementTagNameMap {
|
|
@@ -37,7 +40,7 @@ declare global {
|
|
|
37
40
|
* @attribute [selected=false] - The selected state of the tab.
|
|
38
41
|
* @attribute [vertical=false] - Controls whether the tab is vertical or horizontal.
|
|
39
42
|
* @attribute [stacked=false] - Controls whether the tab is taller to allow for slotted leading/trailing elements.
|
|
40
|
-
* @attribute [secondary=false] - Controls whether the tab is styled as secondary tab navigation.
|
|
43
|
+
* @attribute [secondary=false] - Deprecated. Controls whether the tab is styled as secondary tab navigation.
|
|
41
44
|
* @attribute [inverted=false] - Controls whether the tab indicator is rendered on the opposite side of the tab.
|
|
42
45
|
*
|
|
43
46
|
* @event {CustomEvent<void>} forge-tab-select - Dispatched when the tab is selected. This event bubbles and it can be useful to capture it on the `<forge-tab-bar>` element.
|
|
@@ -53,8 +56,6 @@ declare global {
|
|
|
53
56
|
* @cssproperty --forge-tab-indicator-height - The height of the active tab indicator.
|
|
54
57
|
* @cssproperty --forge-tab-indicator-shape - The shape of the active tab indicator.
|
|
55
58
|
* @cssproperty --forge-tab-vertical-indicator-shape - The shape of the active tab indicator when vertical.
|
|
56
|
-
* @cssproperty --forge-tab-secondary-indicator-height - The height of the secondary tab indicator.
|
|
57
|
-
* @cssproperty --forge-tab-secondary-indicator-shape - The shape of the secondary tab indicator.
|
|
58
59
|
* @cssproperty --forge-tab-inverted-indicator-shape - The shape of the active tab indicator when inverted.
|
|
59
60
|
* @cssproperty --forge-tab-vertical-inverted-indicator-shape - The shape of the active tab indicator when vertical and inverted.
|
|
60
61
|
* @cssproperty --forge-tab-container-color - The color of the tab container.
|
|
@@ -65,7 +66,6 @@ declare global {
|
|
|
65
66
|
* @cssproperty --forge-tab-content-padding - The padding value for both block and inline of the tab content.
|
|
66
67
|
* @cssproperty --forge-tab-content-padding-block - The block padding of the tab content.
|
|
67
68
|
* @cssproperty --forge-tab-content-padding-inline - The inline padding of the tab content.
|
|
68
|
-
* @cssproperty --forge-tab-content-padding-inline-secondary - The inline padding of the tab content when secondary.
|
|
69
69
|
* @cssproperty --forge-tab-active-focus-icon-color - The color of the icon when the tab is active and focused.
|
|
70
70
|
* @cssproperty --forge-tab-active-hover-icon-color - The color of the icon when the tab is active and hovered.
|
|
71
71
|
* @cssproperty --forge-tab-active-icon-color - The color of the icon when the tab is active.
|
|
@@ -103,6 +103,8 @@ export declare class TabComponent extends BaseComponent implements ITabComponent
|
|
|
103
103
|
selected: boolean;
|
|
104
104
|
vertical: boolean;
|
|
105
105
|
stacked: boolean;
|
|
106
|
+
/** @deprecated This will be removed in a future version */
|
|
106
107
|
secondary: boolean;
|
|
107
108
|
inverted: boolean;
|
|
109
|
+
focus(options?: ExperimentalFocusOptions): void;
|
|
108
110
|
}
|
package/esm/tabs/tab/tab.js
CHANGED
|
@@ -12,7 +12,7 @@ import { BaseComponent } from '../../core/base/base-component';
|
|
|
12
12
|
import { FocusIndicatorComponent } from '../../focus-indicator/focus-indicator';
|
|
13
13
|
import { StateLayerComponent } from '../../state-layer/state-layer';
|
|
14
14
|
const template = '<template><div class=\"forge-tab\" part=\"container\"><span class=\"content\" part=\"content\"><slot name=\"start\"><slot name=\"leading\"></slot></slot><span class=\"label\" part=\"label\"><slot></slot></span><slot name=\"end\"><slot name=\"trailing\"></slot></slot><span class=\"indicator\" part=\"indicator\"></span></span><forge-state-layer exportparts=\"surface:state-layer\" target=\":host\"></forge-state-layer><forge-focus-indicator part=\"focus-indicator\" target=\":host\" inward></forge-focus-indicator></div></template>';
|
|
15
|
-
const styles = ':host{display:inline-flex;outline:0;-webkit-tap-highlight-color:transparent;vertical-align:middle}:host([hidden]){display:none}.forge-tab{--_tab-active-color:var(--forge-tab-active-color, var(--forge-theme-primary, #3f51b5));--_tab-inactive-color:var(--forge-tab-inactive-color, var(--forge-theme-text-medium, rgba(0, 0, 0, 0.6)));--_tab-height:var(--forge-tab-height, 48px);--_tab-stacked-height:var(--forge-tab-stacked-height, 64px);--_tab-padding-block:var(--forge-tab-padding-block, 0);--_tab-padding-inline:var(--forge-tab-padding-inline,
|
|
15
|
+
const styles = ':host{display:inline-flex;outline:0;-webkit-tap-highlight-color:transparent;vertical-align:middle}:host([hidden]){display:none}.forge-tab{--_tab-active-color:var(--forge-tab-active-color, var(--forge-theme-primary, #3f51b5));--_tab-inactive-color:var(--forge-tab-inactive-color, var(--forge-theme-text-medium, rgba(0, 0, 0, 0.6)));--_tab-height:var(--forge-tab-height, 48px);--_tab-stacked-height:var(--forge-tab-stacked-height, 64px);--_tab-padding-block:var(--forge-tab-padding-block, 0);--_tab-padding-inline:var(--forge-tab-padding-inline, 0);--_tab-disabled-opacity:var(--forge-tab-disabled-opacity, 0.38);--_tab-indicator-color:var(--forge-tab-indicator-color, var(--_tab-active-color));--_tab-indicator-height:var(--forge-tab-indicator-height, 3px);--_tab-indicator-shape:var(--forge-tab-indicator-shape, 3px 3px 0 0);--_tab-vertical-indicator-shape:var(--forge-tab-vertical-indicator-shape, 3px 0 0 3px);--_tab-secondary-indicator-height:var(--forge-tab-secondary-indicator-height, 2px);--_tab-secondary-indicator-shape:var(--forge-tab-secondary-indicator-shape, 0);--_tab-inverted-indicator-shape:var(--forge-tab-inverted-indicator-shape, 0 0 3px 3px);--_tab-vertical-inverted-indicator-shape:var(--forge-tab-vertical-inverted-indicator-shape, 0 3px 3px 0);--_tab-container-color:var(--forge-tab-container-color, transparent);--_tab-container-height:var(--forge-tab-container-height, var(--_tab-height));--_tab-container-shape:var(--forge-tab-container-shape, 0);--_tab-content-height:var(--forge-tab-content-height, var(--_tab-height));--_tab-content-spacing:var(--forge-tab-content-spacing, var(--forge-spacing-xsmall, 8px));--_tab-content-padding:var(--forge-tab-content-padding, var(--forge-spacing-xxsmall, 4px));--_tab-content-padding-block:var(--forge-tab-content-padding-block, var(--_tab-content-padding));--_tab-content-padding-inline:var(--forge-tab-content-padding-inline, var(--forge-spacing-medium, 16px));--_tab-content-padding-inline-secondary:var(--forge-tab-content-padding-inline-secondary, var(--forge-spacing-medium, 16px));--_tab-active-focus-icon-color:var(--forge-tab-active-focus-icon-color, var(--_tab-active-color));--_tab-active-hover-icon-color:var(--forge-tab-active-hover-icon-color, var(--_tab-active-color));--_tab-active-icon-color:var(--forge-tab-active-icon-color, var(--_tab-active-color));--_tab-active-pressed-icon-color:var(--forge-tab-active-pressed-icon-color, var(--_tab-active-color));--_tab-icon-size:var(--forge-tab-icon-size, 24px);--_tab-focus-icon-color:var(--forge-tab-focus-icon-color, var(--_tab-inactive-color));--_tab-hover-icon-color:var(--forge-tab-hover-icon-color, var(--_tab-inactive-color));--_tab-icon-color:var(--forge-tab-icon-color, var(--_tab-inactive-color));--_tab-pressed-icon-color:var(--forge-tab-pressed-icon-color, var(--_tab-inactive-color));--_tab-active-focus-label-text-color:var(--forge-tab-active-focus-label-text-color, var(--_tab-active-color));--_tab-active-hover-label-text-color:var(--forge-tab-active-hover-label-text-color, var(--_tab-active-color));--_tab-active-label-text-color:var(--forge-tab-active-label-text-color, var(--_tab-active-color));--_tab-active-pressed-label-text-color:var(--forge-tab-active-pressed-label-text-color, var(--_tab-active-color));--_tab-focus-label-text-color:var(--forge-tab-focus-label-text-color, var(--_tab-inactive-color));--_tab-hover-label-text-color:var(--forge-tab-hover-label-text-color, var(--_tab-inactive-color));--_tab-label-text-color:var(--forge-tab-label-text-color, var(--_tab-inactive-color));--_tab-pressed-label-text-color:var(--forge-tab-pressed-label-text-color, var(--_tab-inactive-color))}.forge-tab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-button-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-button-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-button-font-size-scale, .875)));font-weight:var(--forge-typography-button-font-weight,500);line-height:var(--forge-typography-button-line-height, normal);letter-spacing:var(--forge-typography-button-letter-spacing, .0714285714em);text-transform:var(--forge-typography-button-text-transform,inherit);text-decoration:var(--forge-typography-button-text-decoration,inherit);display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:none;outline:0;user-select:none;-webkit-appearance:none;vertical-align:middle;background:0 0;text-decoration:none;width:100%;position:relative;padding-block:var(--_tab-padding-block);padding-inline:var(--_tab-padding-inline);margin:0;z-index:0;background-color:var(--_tab-container-color);color:var(--_tab-label-text-color);min-height:var(--_tab-container-height)}.forge-tab::-moz-focus-inner{padding:0;border:0}.forge-tab ::slotted([slot=leading]),.forge-tab ::slotted([slot=trailing]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;color:var(--_tab-icon-color);font-size:var(--_tab-icon-size);width:var(--_tab-icon-size);height:var(--_tab-icon-size)}.forge-tab:hover{color:var(--_tab-hover-label-text-color);cursor:pointer}.forge-tab:hover ::slotted([slot=leading]),.forge-tab:hover ::slotted([slot=trailing]){color:var(--_tab-hover-icon-color)}.forge-tab .content{position:relative;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;justify-content:center;white-space:nowrap;transition:150ms color linear;max-height:calc(var(--_tab-content-height) + 2 * var(--_tab-content-padding-block));min-height:var(--_tab-content-height);width:100%;padding-block:var(--_tab-content-padding-block);padding-inline:var(--_tab-content-padding-inline);gap:var(--_tab-content-spacing)}.forge-tab .content .label{display:inline-block;line-height:1}.forge-tab .indicator{position:absolute;box-sizing:border-box;z-index:-1;transform-origin:bottom left;background:var(--_tab-indicator-color);border-radius:var(--_tab-indicator-shape);height:var(--_tab-indicator-height);min-width:100%;inset:auto 0 0;opacity:0}::slotted(*),:host{white-space:nowrap}forge-focus-indicator{--forge-focus-indicator-color:var(--_tab-active-color);--forge-focus-indicator-shape:8px}forge-state-layer{--forge-state-layer-color:var(--_tab-inactive-color)}:host(:focus) .forge-tab{color:var(--_tab-focus-label-text-color)}:host(:focus) .forge-tab ::slotted([slot=leading]),:host(:focus) .forge-tab ::slotted([slot=trailing]){color:var(--_tab-focus-icon-color)}:host(:active) .forge-tab{color:var(--_tab-pressed-label-text-color);outline:0}:host(:active) .forge-tab ::slotted([slot=leading]),:host(:active) .forge-tab ::slotted([slot=trailing]){color:var(--_tab-pressed-icon-color)}:host([disabled]){cursor:not-allowed}:host([disabled]) .forge-tab{opacity:var(--_tab-disabled-opacity);pointer-events:none}:host([selected]) .forge-tab{color:var(--_tab-active-label-text-color)}:host([selected]) .forge-tab ::slotted([slot=end]),:host([selected]) .forge-tab ::slotted([slot=leading]),:host([selected]) .forge-tab ::slotted([slot=start]),:host([selected]) .forge-tab ::slotted([slot=trailing]){color:var(--_tab-active-icon-color)}:host([selected]) .forge-tab:hover{color:var(--_tab-active-hover-label-text-color)}:host([selected]) .forge-tab:hover ::slotted([slot=end]),:host([selected]) .forge-tab:hover ::slotted([slot=leading]),:host([selected]) .forge-tab:hover ::slotted([slot=start]),:host([selected]) .forge-tab:hover ::slotted([slot=trailing]){color:var(--_tab-active-hover-icon-color)}:host([selected]) .forge-tab .indicator{opacity:1}:host([selected]) forge-state-layer{--forge-state-layer-color:var(--_tab-active-color)}:host([selected]:not([vertical])) forge-focus-indicator{--forge-focus-indicator-offset-block:0 calc(var(--_tab-indicator-height) + 1px)}:host([selected]:focus) .forge-tab{color:var(--_tab-active-focus-label-text-color)}:host([selected]:focus) .forge-tab ::slotted([slot=leading]),:host([selected]:focus) .forge-tab ::slotted([slot=trailing]){color:var(--_tab-active-focus-icon-color)}:host([selected]:active) .forge-tab{color:var(--_tab-active-pressed-label-text-color)}:host([selected]:active) .forge-tab ::slotted([slot=leading]),:host([selected]:active) .forge-tab ::slotted([slot=trailing]){color:var(--_tab-active-pressed-icon-color)}:host([stacked]) .forge-tab{--_tab-height:var(--_tab-stacked-height)}:host([stacked]) .forge-tab .content{max-height:none;flex-direction:column;height:100%}:host([vertical]) .forge-tab{--_tab-padding-inline:var(--forge-tab-padding-inline, 0);width:100%;flex-direction:row;border-bottom:none}:host([vertical]) .forge-tab .content{width:100%;min-height:100%}:host([vertical]) .forge-tab .indicator{height:100%;min-width:var(--_tab-indicator-height);inset:0 0 0 auto}:host([vertical]) forge-focus-indicator{--forge-focus-indicator-offset-inline:0 calc(var(--_tab-indicator-height) + 1px)}:host([vertical]) .forge-tab{--_tab-indicator-shape:var(--_tab-vertical-indicator-shape)}:host([inverted]) .forge-tab{--_tab-indicator-shape:var(--_tab-inverted-indicator-shape)}:host([inverted]) .indicator{inset:0 0 auto;transform-origin:top left}:host([inverted][vertical]) .forge-tab{--_tab-indicator-shape:var(--_tab-vertical-inverted-indicator-shape)}:host([inverted][vertical]) .indicator{inset:0 auto 0 0}';
|
|
16
16
|
/**
|
|
17
17
|
* @tag forge-tab
|
|
18
18
|
*
|
|
@@ -30,7 +30,7 @@ const styles = ':host{display:inline-flex;outline:0;-webkit-tap-highlight-color:
|
|
|
30
30
|
* @attribute [selected=false] - The selected state of the tab.
|
|
31
31
|
* @attribute [vertical=false] - Controls whether the tab is vertical or horizontal.
|
|
32
32
|
* @attribute [stacked=false] - Controls whether the tab is taller to allow for slotted leading/trailing elements.
|
|
33
|
-
* @attribute [secondary=false] - Controls whether the tab is styled as secondary tab navigation.
|
|
33
|
+
* @attribute [secondary=false] - Deprecated. Controls whether the tab is styled as secondary tab navigation.
|
|
34
34
|
* @attribute [inverted=false] - Controls whether the tab indicator is rendered on the opposite side of the tab.
|
|
35
35
|
*
|
|
36
36
|
* @event {CustomEvent<void>} forge-tab-select - Dispatched when the tab is selected. This event bubbles and it can be useful to capture it on the `<forge-tab-bar>` element.
|
|
@@ -46,8 +46,6 @@ const styles = ':host{display:inline-flex;outline:0;-webkit-tap-highlight-color:
|
|
|
46
46
|
* @cssproperty --forge-tab-indicator-height - The height of the active tab indicator.
|
|
47
47
|
* @cssproperty --forge-tab-indicator-shape - The shape of the active tab indicator.
|
|
48
48
|
* @cssproperty --forge-tab-vertical-indicator-shape - The shape of the active tab indicator when vertical.
|
|
49
|
-
* @cssproperty --forge-tab-secondary-indicator-height - The height of the secondary tab indicator.
|
|
50
|
-
* @cssproperty --forge-tab-secondary-indicator-shape - The shape of the secondary tab indicator.
|
|
51
49
|
* @cssproperty --forge-tab-inverted-indicator-shape - The shape of the active tab indicator when inverted.
|
|
52
50
|
* @cssproperty --forge-tab-vertical-inverted-indicator-shape - The shape of the active tab indicator when vertical and inverted.
|
|
53
51
|
* @cssproperty --forge-tab-container-color - The color of the tab container.
|
|
@@ -58,7 +56,6 @@ const styles = ':host{display:inline-flex;outline:0;-webkit-tap-highlight-color:
|
|
|
58
56
|
* @cssproperty --forge-tab-content-padding - The padding value for both block and inline of the tab content.
|
|
59
57
|
* @cssproperty --forge-tab-content-padding-block - The block padding of the tab content.
|
|
60
58
|
* @cssproperty --forge-tab-content-padding-inline - The inline padding of the tab content.
|
|
61
|
-
* @cssproperty --forge-tab-content-padding-inline-secondary - The inline padding of the tab content when secondary.
|
|
62
59
|
* @cssproperty --forge-tab-active-focus-icon-color - The color of the icon when the tab is active and focused.
|
|
63
60
|
* @cssproperty --forge-tab-active-hover-icon-color - The color of the icon when the tab is active and hovered.
|
|
64
61
|
* @cssproperty --forge-tab-active-icon-color - The color of the icon when the tab is active.
|
|
@@ -120,6 +117,10 @@ let TabComponent = class TabComponent extends BaseComponent {
|
|
|
120
117
|
break;
|
|
121
118
|
}
|
|
122
119
|
}
|
|
120
|
+
focus(options) {
|
|
121
|
+
super.focus(options);
|
|
122
|
+
this._core.setFocus(options);
|
|
123
|
+
}
|
|
123
124
|
};
|
|
124
125
|
__decorate([
|
|
125
126
|
coreProperty()
|
|
@@ -94,7 +94,7 @@ export class TabBarCore {
|
|
|
94
94
|
this._selectTab(this._tabs[index]);
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
|
-
this._tabs[index].focus({ preventScroll: true });
|
|
97
|
+
this._tabs[index].focus({ preventScroll: true, focusVisible: true });
|
|
98
98
|
await this._adapter.tryScrollTabIntoView(this._tabs[index]);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -11,6 +11,7 @@ export interface ITabBarComponent extends IBaseComponent {
|
|
|
11
11
|
vertical: boolean;
|
|
12
12
|
clustered: boolean;
|
|
13
13
|
stacked: boolean;
|
|
14
|
+
/** @deprecated This will be removed in a future version */
|
|
14
15
|
secondary: boolean;
|
|
15
16
|
inverted: boolean;
|
|
16
17
|
autoActivate: boolean;
|
|
@@ -43,7 +44,7 @@ declare global {
|
|
|
43
44
|
* @property {boolean} [vertical=false] - Controls whether the tab bar is vertical or horizontal.
|
|
44
45
|
* @property {boolean} [clustered=false] - Controls whether the tabs stretch the full width of their container or cluster together at their minimum width.
|
|
45
46
|
* @property {boolean} [stacked=false] - Controls whether the tabs are taller to allow for slotted leading/trailing elements.
|
|
46
|
-
* @property {boolean} [secondary=false] - Controls whether the tabs are styled as secondary tab navigation.
|
|
47
|
+
* @property {boolean} [secondary=false] - Deprecated. Controls whether the tabs are styled as secondary tab navigation.
|
|
47
48
|
* @property {boolean} [inverted=false] - Controls whether the tabs are rendered inverted (tab indicator at top instead of bottom).
|
|
48
49
|
* @property {boolean} [autoActivate=false] - Controls whether the tabs are automatically activated when receiving focus.
|
|
49
50
|
* @property {boolean} [scrollButtons=false] - Controls whether scroll buttons are displayed when the tabs overflow their container.
|
|
@@ -53,7 +54,7 @@ declare global {
|
|
|
53
54
|
* @attribute {boolean} [vertical=false] - Controls whether the tab bar is vertical or horizontal.
|
|
54
55
|
* @attribute {boolean} [clustered=false] - Controls whether the tabs stretch the full width of their container or cluster together at their minimum width.
|
|
55
56
|
* @attribute {boolean} [stacked=false] - Controls whether the tabs are taller to allow for slotted leading/trailing elements.
|
|
56
|
-
* @attribute {boolean} [secondary=false] - Controls whether the tabs are styled as secondary tab navigation.
|
|
57
|
+
* @attribute {boolean} [secondary=false] - Deprecated. Controls whether the tabs are styled as secondary tab navigation.
|
|
57
58
|
* @attribute {boolean} [auto-activate=false] - Controls whether the tabs are automatically activated when receiving focus.
|
|
58
59
|
* @attribute {boolean} [scroll-buttons=false] - Controls whether scroll buttons are displayed when the tabs overflow their container.
|
|
59
60
|
* @attribute {string} [data-aria-label] - The ARIA label to forward to the internal tablist element.
|
|
@@ -80,6 +81,7 @@ export declare class TabBarComponent extends BaseComponent implements ITabBarCom
|
|
|
80
81
|
vertical: boolean;
|
|
81
82
|
clustered: boolean;
|
|
82
83
|
stacked: boolean;
|
|
84
|
+
/** @deprecated This will be removed in a future version */
|
|
83
85
|
secondary: boolean;
|
|
84
86
|
inverted: boolean;
|
|
85
87
|
autoActivate: boolean;
|
|
@@ -14,7 +14,7 @@ import { TAB_BAR_CONSTANTS } from './tab-bar-constants';
|
|
|
14
14
|
import { TabBarCore } from './tab-bar-core';
|
|
15
15
|
import { tylIconKeyboardArrowLeft, tylIconKeyboardArrowRight, tylIconKeyboardArrowUp, tylIconKeyboardArrowDown } from '@tylertech/tyler-icons/standard';
|
|
16
16
|
const template = '<template><div class=\"forge-tab-bar\" part=\"container\"><div role=\"tablist\" class=\"scroll-container\" part=\"scroll-container\"><slot></slot></div></div></template>';
|
|
17
|
-
const styles = ':host{position:relative;display:block}:host([hidden]){display:none}.forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, space-between);--_tab-bar-stretch:var(--forge-tab-bar-stretch, 1);--_tab-bar-divider-color:var(--forge-tab-bar-divider-color, var(--forge-theme-outline, #e0e0e0));--_tab-bar-divider-thickness:var(--forge-tab-bar-divider-thickness, 1px)}.forge-tab-bar{position:relative;display:grid;grid-template-columns:auto 1fr auto;max-width:100%;max-height:100%;align-items:center;border-bottom:var(--_tab-bar-divider-thickness) solid var(--_tab-bar-divider-color)}.scroll-container{position:relative;display:flex;justify-content:var(--_tab-bar-justify);align-items:flex-end;box-sizing:border-box;overflow:auto;scroll-behavior:smooth;scrollbar-width:none;grid-column:2}.scroll-container::-webkit-scrollbar{display:none}::slotted(*){flex:var(--_tab-bar-stretch)}::slotted([selected]){z-index:1}forge-icon-button{--forge-icon-button-shape-squared:0px}:host([vertical]) .forge-tab-bar{grid-template-columns:none;grid-template-rows:auto 1fr auto;align-items:initial;border-bottom:none;border-right:var(--_tab-bar-divider-thickness) solid var(--_tab-bar-divider-color);height:100%}:host([vertical]) .scroll-container{display:inline-flex;flex-direction:column;align-items:stretch;gap:0;grid-column:auto;grid-row:2}:host([vertical]) .scroll-button{justify-self:center}:host([inverted]:not([vertical])) .forge-tab-bar{border-bottom:none;border-top:variale(divider-thickness) solid var(--_tab-bar-divider-color)}:host([inverted][vertical]) .forge-tab-bar{border-bottom:none;border-top:var(--_tab-bar-divider-thickness) solid var(--_tab-bar-divider-color)}:host([clustered]) .forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, flex-start);--_tab-bar-stretch:var(--forge-tab-bar-stretch, 0)}:host([clustered=start]) .forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, flex-start)}:host([clustered=center]) .forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, center)}:host([clustered=end]) .forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, flex-end)}';
|
|
17
|
+
const styles = ':host{position:relative;display:block}:host([hidden]){display:none}.forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, space-between);--_tab-bar-stretch:var(--forge-tab-bar-stretch, 1);--_tab-bar-divider-color:var(--forge-tab-bar-divider-color, var(--forge-theme-outline, #e0e0e0));--_tab-bar-divider-thickness:var(--forge-tab-bar-divider-thickness, 1px)}.forge-tab-bar{position:relative;display:grid;grid-template-columns:auto 1fr auto;max-width:100%;max-height:100%;align-items:center;border-bottom:var(--_tab-bar-divider-thickness) solid var(--_tab-bar-divider-color)}.scroll-container{position:relative;display:flex;justify-content:var(--_tab-bar-justify);align-items:flex-end;box-sizing:border-box;overflow:auto;scroll-behavior:smooth;scrollbar-width:none;grid-column:2}.scroll-container::-webkit-scrollbar{display:none}::slotted(*){flex:var(--_tab-bar-stretch);align-self:stretch}::slotted([selected]){z-index:1}forge-icon-button{--forge-icon-button-shape-squared:0px}:host([vertical]) .forge-tab-bar{grid-template-columns:none;grid-template-rows:auto 1fr auto;align-items:initial;border-bottom:none;border-right:var(--_tab-bar-divider-thickness) solid var(--_tab-bar-divider-color);height:100%}:host([vertical]) .scroll-container{display:inline-flex;flex-direction:column;align-items:stretch;gap:0;grid-column:auto;grid-row:2}:host([vertical]) .scroll-button{justify-self:center}:host([inverted]:not([vertical])) .forge-tab-bar{border-bottom:none;border-top:variale(divider-thickness) solid var(--_tab-bar-divider-color)}:host([inverted][vertical]) .forge-tab-bar{border-bottom:none;border-top:var(--_tab-bar-divider-thickness) solid var(--_tab-bar-divider-color)}:host([clustered]) .forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, flex-start);--_tab-bar-stretch:var(--forge-tab-bar-stretch, 0)}:host([clustered=start]) .forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, flex-start)}:host([clustered=center]) .forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, center)}:host([clustered=end]) .forge-tab-bar{--_tab-bar-justify:var(--forge-tab-bar-justify, flex-end)}';
|
|
18
18
|
/**
|
|
19
19
|
* @tag forge-tab-bar
|
|
20
20
|
*
|
|
@@ -34,7 +34,7 @@ const styles = ':host{position:relative;display:block}:host([hidden]){display:no
|
|
|
34
34
|
* @property {boolean} [vertical=false] - Controls whether the tab bar is vertical or horizontal.
|
|
35
35
|
* @property {boolean} [clustered=false] - Controls whether the tabs stretch the full width of their container or cluster together at their minimum width.
|
|
36
36
|
* @property {boolean} [stacked=false] - Controls whether the tabs are taller to allow for slotted leading/trailing elements.
|
|
37
|
-
* @property {boolean} [secondary=false] - Controls whether the tabs are styled as secondary tab navigation.
|
|
37
|
+
* @property {boolean} [secondary=false] - Deprecated. Controls whether the tabs are styled as secondary tab navigation.
|
|
38
38
|
* @property {boolean} [inverted=false] - Controls whether the tabs are rendered inverted (tab indicator at top instead of bottom).
|
|
39
39
|
* @property {boolean} [autoActivate=false] - Controls whether the tabs are automatically activated when receiving focus.
|
|
40
40
|
* @property {boolean} [scrollButtons=false] - Controls whether scroll buttons are displayed when the tabs overflow their container.
|
|
@@ -44,7 +44,7 @@ const styles = ':host{position:relative;display:block}:host([hidden]){display:no
|
|
|
44
44
|
* @attribute {boolean} [vertical=false] - Controls whether the tab bar is vertical or horizontal.
|
|
45
45
|
* @attribute {boolean} [clustered=false] - Controls whether the tabs stretch the full width of their container or cluster together at their minimum width.
|
|
46
46
|
* @attribute {boolean} [stacked=false] - Controls whether the tabs are taller to allow for slotted leading/trailing elements.
|
|
47
|
-
* @attribute {boolean} [secondary=false] - Controls whether the tabs are styled as secondary tab navigation.
|
|
47
|
+
* @attribute {boolean} [secondary=false] - Deprecated. Controls whether the tabs are styled as secondary tab navigation.
|
|
48
48
|
* @attribute {boolean} [auto-activate=false] - Controls whether the tabs are automatically activated when receiving focus.
|
|
49
49
|
* @attribute {boolean} [scroll-buttons=false] - Controls whether scroll buttons are displayed when the tabs overflow their container.
|
|
50
50
|
* @attribute {string} [data-aria-label] - The ARIA label to forward to the internal tablist element.
|
package/esm/toolbar/toolbar.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ declare global {
|
|
|
41
41
|
* @cssproperty --forge-toolbar-padding - Controls the left and right padding using the padding-inline style.
|
|
42
42
|
* @cssproperty --forge-toolbar-padding-block - Controls the top and bottom padding using the padding-block style.
|
|
43
43
|
* @cssproperty --forge-toolbar-padding-inline - Controls the left and right padding using the padding-block style.
|
|
44
|
+
* @cssproperty --forge-toolbar-columns - The grid column track sizes.
|
|
44
45
|
*
|
|
45
46
|
* @csspart root - The root container element wrapping all slots and content.
|
|
46
47
|
* @csspart inner - The internal container element for the start, center, and end slots.
|
package/esm/toolbar/toolbar.js
CHANGED
|
@@ -8,7 +8,7 @@ import { customElement, attachShadowTemplate, coerceBoolean } from '@tylertech/f
|
|
|
8
8
|
import { BaseComponent } from '../core/base/base-component';
|
|
9
9
|
import { TOOLBAR_CONSTANTS } from './toolbar-constants';
|
|
10
10
|
const template = '<template><div class=\"forge-toolbar\" part=\"root\"><div class=\"section\" part=\"before-section-start\"><slot name=\"before-start\"></slot></div><div class=\"inner center\" part=\"inner\"><div class=\"section\" part=\"section-start\"><slot name=\"start\"></slot><slot></slot></div><div class=\"section center\" part=\"section-center\"><slot name=\"center\"></slot></div><div class=\"section end\" part=\"section-end\"><slot name=\"end\"></slot></div></div><div class=\"section end\" part=\"after-section-end\"><slot name=\"after-end\"></slot></div></div></template>';
|
|
11
|
-
const styles = ':host{display:block;contain:layout}:host([hidden]){display:none}.forge-toolbar{--_toolbar-background:var(--forge-toolbar-background, var(--forge-theme-surface, #ffffff));--_toolbar-height:var(--forge-toolbar-height, 56px);--_toolbar-min-height:var(--forge-toolbar-min-height, var(--_toolbar-height));--_toolbar-divider-width:var(--forge-toolbar-divider-width, var(--forge-border-thin, 1px));--_toolbar-divider-style:var(--forge-toolbar-divider-style, solid);--_toolbar-divider-color:var(--forge-toolbar-divider-color, var(--forge-theme-outline, #e0e0e0));--_toolbar-shape:var(--forge-toolbar-shape, calc(var(--forge-shape-medium, 4px) * var(--forge-shape-factor, 1)));--_toolbar-start-start-shape:var(--forge-toolbar-start-start-shape, var(--_toolbar-shape));--_toolbar-start-end-shape:var(--forge-toolbar-start-end-shape, var(--_toolbar-shape));--_toolbar-end-start-shape:var(--forge-toolbar-end-start-shape, 0);--_toolbar-end-end-shape:var(--forge-toolbar-end-end-shape, 0);--_toolbar-padding:var(--forge-toolbar-padding, var(--forge-spacing-medium, 16px));--_toolbar-padding-block:var(--forge-toolbar-padding-block, 0);--_toolbar-padding-inline:var(--forge-toolbar-padding-inline, var(--_toolbar-padding))}.forge-toolbar{display:grid;grid-template-columns:
|
|
11
|
+
const styles = ':host{display:block;contain:layout}:host([hidden]){display:none}.forge-toolbar{--_toolbar-background:var(--forge-toolbar-background, var(--forge-theme-surface, #ffffff));--_toolbar-height:var(--forge-toolbar-height, 56px);--_toolbar-min-height:var(--forge-toolbar-min-height, var(--_toolbar-height));--_toolbar-divider-width:var(--forge-toolbar-divider-width, var(--forge-border-thin, 1px));--_toolbar-divider-style:var(--forge-toolbar-divider-style, solid);--_toolbar-divider-color:var(--forge-toolbar-divider-color, var(--forge-theme-outline, #e0e0e0));--_toolbar-shape:var(--forge-toolbar-shape, calc(var(--forge-shape-medium, 4px) * var(--forge-shape-factor, 1)));--_toolbar-start-start-shape:var(--forge-toolbar-start-start-shape, var(--_toolbar-shape));--_toolbar-start-end-shape:var(--forge-toolbar-start-end-shape, var(--_toolbar-shape));--_toolbar-end-start-shape:var(--forge-toolbar-end-start-shape, 0);--_toolbar-end-end-shape:var(--forge-toolbar-end-end-shape, 0);--_toolbar-padding:var(--forge-toolbar-padding, var(--forge-spacing-medium, 16px));--_toolbar-padding-block:var(--forge-toolbar-padding-block, 0);--_toolbar-padding-inline:var(--forge-toolbar-padding-inline, var(--_toolbar-padding));--_toolbar-columns:var(--forge-toolbar-columns, auto 1fr auto)}.forge-toolbar{display:grid;grid-template-columns:var(--_toolbar-columns);height:var(--_toolbar-height);min-height:var(--_toolbar-min-height);box-sizing:border-box;padding-inline:0;border-block-end-width:var(--_toolbar-divider-width);border-block-end-style:var(--_toolbar-divider-style);border-block-end-color:var(--_toolbar-divider-color);border-start-start-radius:var(--_toolbar-start-start-shape);border-start-end-radius:var(--_toolbar-start-end-shape);border-end-start-radius:var(--_toolbar-end-start-shape);border-end-end-radius:var(--_toolbar-end-end-shape);background:var(--_toolbar-background)}.inner{display:grid;grid-template-columns:var(--_toolbar-columns);padding-inline:var(--_toolbar-padding-inline);padding-block:var(--_toolbar-padding-block);box-sizing:border-box}.section{display:flex;align-items:center;width:100%;box-sizing:border-box}.section.center{justify-content:center}.section.end{justify-content:end}:host([inverted]) .forge-toolbar{--_toolbar-start-start-shape:var(--forge-toolbar-start-start-shape, 0);--_toolbar-start-end-shape:var(--forge-toolbar-start-end-shape, 0);--_toolbar-end-start-shape:var(--_toolbar-shape);--_toolbar-end-end-shape:var(--_toolbar-shape);border-block-end:none;border-block-start-width:var(--_toolbar-divider-width);border-block-start-style:var(--_toolbar-divider-style);border-block-start-color:var(--_toolbar-divider-color)}:host(:is([no-divider],[no-border])) .forge-toolbar{border:none}:host([no-padding]) .forge-toolbar{--_toolbar-padding:var(--forge-toolbar-padding, 0)}:host([auto-height]) .forge-toolbar{--_toolbar-height:var(--forge-toolbar-height, auto)}::slotted(:is(h1,h2,h3,h4,h5,h6,p)){margin:0}';
|
|
12
12
|
/**
|
|
13
13
|
* @tag forge-toolbar
|
|
14
14
|
*
|
|
@@ -38,6 +38,7 @@ const styles = ':host{display:block;contain:layout}:host([hidden]){display:none}
|
|
|
38
38
|
* @cssproperty --forge-toolbar-padding - Controls the left and right padding using the padding-inline style.
|
|
39
39
|
* @cssproperty --forge-toolbar-padding-block - Controls the top and bottom padding using the padding-block style.
|
|
40
40
|
* @cssproperty --forge-toolbar-padding-inline - Controls the left and right padding using the padding-block style.
|
|
41
|
+
* @cssproperty --forge-toolbar-columns - The grid column track sizes.
|
|
41
42
|
*
|
|
42
43
|
* @csspart root - The root container element wrapping all slots and content.
|
|
43
44
|
* @csspart inner - The internal container element for the start, center, and end slots.
|
package/package.json
CHANGED
package/sass/checkbox/_core.scss
CHANGED
|
@@ -21,6 +21,7 @@ $tokens: (
|
|
|
21
21
|
logo-gap: utils.module-val(app-bar, logo-gap, spacing.variable(medium)),
|
|
22
22
|
logo-font-size: utils.module-val(app-bar, logo-font-size, typography.font-size-relative('2500')),
|
|
23
23
|
title-padding: utils.module-val(app-bar, title-padding, spacing.variable(xsmall)),
|
|
24
|
+
columns: utils.module-val(app-bar, columns, 1fr 1fr 1fr),
|
|
24
25
|
transition-duration: utils.module-val(app-bar, transition-duration, animation.variable(duration-short4)),
|
|
25
26
|
transition-timing: utils.module-val(app-bar, transition-timing, animation.variable(easing-standard))
|
|
26
27
|
) !default;
|
|
@@ -59,6 +59,7 @@ $tokens: (
|
|
|
59
59
|
// Density - large (default)
|
|
60
60
|
density-large-size: utils.module-ref(icon-button, density-large-size, size),
|
|
61
61
|
// Toggle (on)
|
|
62
|
+
toggle-on-background-color: utils.module-val(icon-button, toggle-on-background-color, theme.variable(primary-container)),
|
|
62
63
|
toggle-on-icon-color: utils.module-val(icon-button, toggle-on-icon-color, theme.variable(primary)),
|
|
63
64
|
// Toggle (on) outlined
|
|
64
65
|
outlined-toggle-on-background-color: utils.module-val(icon-button, outlined-toggle-on-background-color, theme.variable(primary-container)),
|
|
@@ -15,7 +15,7 @@ $tokens: (
|
|
|
15
15
|
height: utils.module-val(tab, height, 48px),
|
|
16
16
|
stacked-height: utils.module-val(tab, stacked-height, 64px),
|
|
17
17
|
padding-block: utils.module-val(tab, padding-block, 0),
|
|
18
|
-
padding-inline: utils.module-val(tab, padding-inline,
|
|
18
|
+
padding-inline: utils.module-val(tab, padding-inline, 0),
|
|
19
19
|
// Disabled
|
|
20
20
|
disabled-opacity: utils.module-val(tab, disabled-opacity, 0.38),
|
|
21
21
|
// Indicator
|
|
@@ -25,8 +25,8 @@ $tokens: (
|
|
|
25
25
|
// Indicator (vertical)
|
|
26
26
|
vertical-indicator-shape: utils.module-val(tab, vertical-indicator-shape, 3px 0 0 3px),
|
|
27
27
|
// Indicator (secondary)
|
|
28
|
-
secondary-indicator-height: utils.module-val(tab, secondary-indicator-height, 2px),
|
|
29
|
-
secondary-indicator-shape: utils.module-val(tab, secondary-indicator-shape, 0),
|
|
28
|
+
/** @deprecated */ secondary-indicator-height: utils.module-val(tab, secondary-indicator-height, 2px),
|
|
29
|
+
/** @deprecated */ secondary-indicator-shape: utils.module-val(tab, secondary-indicator-shape, 0),
|
|
30
30
|
// Indicator (inverted)
|
|
31
31
|
inverted-indicator-shape: utils.module-val(tab, inverted-indicator-shape, 0 0 3px 3px),
|
|
32
32
|
vertical-inverted-indicator-shape: utils.module-val(tab, vertical-inverted-indicator-shape, 0 3px 3px 0),
|
|
@@ -36,11 +36,11 @@ $tokens: (
|
|
|
36
36
|
container-shape: utils.module-val(tab, container-shape, 0),
|
|
37
37
|
// Content
|
|
38
38
|
content-height: utils.module-ref(tab, content-height, height),
|
|
39
|
-
content-spacing: utils.module-val(tab, content-spacing, spacing.variable(
|
|
39
|
+
content-spacing: utils.module-val(tab, content-spacing, spacing.variable(xsmall)),
|
|
40
40
|
content-padding: utils.module-val(tab, content-padding, spacing.variable(xxsmall)),
|
|
41
41
|
content-padding-block: utils.module-ref(tab, content-padding-block, content-padding),
|
|
42
|
-
content-padding-inline: utils.module-
|
|
43
|
-
content-padding-inline-secondary: utils.module-val(tab, content-padding-inline-secondary, spacing.variable(medium)),
|
|
42
|
+
content-padding-inline: utils.module-val(tab, content-padding-inline, spacing.variable(medium)),
|
|
43
|
+
/** @deprecated */ content-padding-inline-secondary: utils.module-val(tab, content-padding-inline-secondary, spacing.variable(medium)),
|
|
44
44
|
// Icon
|
|
45
45
|
active-focus-icon-color: utils.module-ref(tab, active-focus-icon-color, active-color),
|
|
46
46
|
active-hover-icon-color: utils.module-ref(tab, active-hover-icon-color, active-color),
|
|
@@ -29,7 +29,8 @@ $tokens: (
|
|
|
29
29
|
// Spacing
|
|
30
30
|
padding: utils.module-val(toolbar, padding, spacing.variable(medium)),
|
|
31
31
|
padding-block: utils.module-val(toolbar, padding-block, 0),
|
|
32
|
-
padding-inline: utils.module-ref(toolbar, padding-inline, padding)
|
|
32
|
+
padding-inline: utils.module-ref(toolbar, padding-inline, padding),
|
|
33
|
+
columns: utils.module-val(toolbar, columns, auto 1fr auto)
|
|
33
34
|
) !default;
|
|
34
35
|
|
|
35
36
|
@function get($key) {
|
|
@@ -27,6 +27,15 @@ $label2: utils.inherit-map(
|
|
|
27
27
|
)
|
|
28
28
|
) !default;
|
|
29
29
|
|
|
30
|
+
$label3: utils.inherit-map(
|
|
31
|
+
core.$base,
|
|
32
|
+
(
|
|
33
|
+
font-size: type-utils.font-size-relative(label, font-size, '0875'),
|
|
34
|
+
line-height: type-utils.font-size-relative(label, line-height, '1250'),
|
|
35
|
+
letter-spacing: type-utils.calc-letter-spacing(0.125, scale.value('0875'))
|
|
36
|
+
)
|
|
37
|
+
) !default;
|
|
38
|
+
|
|
30
39
|
$button: utils.inherit-map(
|
|
31
40
|
core.$base,
|
|
32
41
|
(
|
|
@@ -50,6 +59,7 @@ $overline: utils.inherit-map(
|
|
|
50
59
|
$tokens: (
|
|
51
60
|
label1: $label1,
|
|
52
61
|
label2: $label2,
|
|
62
|
+
label3: $label3,
|
|
53
63
|
button: $button,
|
|
54
64
|
overline: $overline
|
|
55
65
|
) !default;
|
package/sass/switch/_core.scss
CHANGED