@fluentui/web-components 3.0.0-alpha.28 → 3.0.0-alpha.29
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/CHANGELOG.md +11 -2
- package/README.md +4 -0
- package/dist/dts/helpers.tests.d.ts +8 -0
- package/dist/dts/utils/apply-mixins.d.ts +11 -0
- package/dist/esm/badge/badge.js +3 -1
- package/dist/esm/badge/badge.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.js +3 -1
- package/dist/esm/counter-badge/counter-badge.js.map +1 -1
- package/dist/esm/helpers.tests.js +29 -0
- package/dist/esm/helpers.tests.js.map +1 -0
- package/dist/esm/utils/apply-mixins.js +26 -0
- package/dist/esm/utils/apply-mixins.js.map +1 -0
- package/dist/storybook/108.78b731e00015540915a8.manager.bundle.js +1 -0
- package/dist/storybook/108.b31ec3a1.iframe.bundle.js +1 -0
- package/dist/storybook/316.bc4aabd3.iframe.bundle.js +2 -0
- package/dist/storybook/316.bc4aabd3.iframe.bundle.js.LICENSE.txt +17 -0
- package/dist/storybook/391.ad71b32f.iframe.bundle.js +462 -0
- package/dist/storybook/391.ad71b32f.iframe.bundle.js.LICENSE.txt +46 -0
- package/dist/storybook/391.ad71b32f.iframe.bundle.js.map +1 -0
- package/dist/storybook/401.7edec720.iframe.bundle.js +2 -0
- package/dist/storybook/401.7edec720.iframe.bundle.js.LICENSE.txt +12 -0
- package/dist/storybook/401.c9bdfaf0dda8b194127f.manager.bundle.js +2 -0
- package/dist/storybook/401.c9bdfaf0dda8b194127f.manager.bundle.js.LICENSE.txt +12 -0
- package/dist/storybook/491.77b24750.iframe.bundle.js +1 -0
- package/dist/storybook/709.22096ad4.iframe.bundle.js +2 -0
- package/dist/storybook/709.22096ad4.iframe.bundle.js.LICENSE.txt +8 -0
- package/dist/storybook/709.b131e33993a6b94d7ad8.manager.bundle.js +2 -0
- package/dist/storybook/709.b131e33993a6b94d7ad8.manager.bundle.js.LICENSE.txt +8 -0
- package/dist/storybook/721.46fa9f53.iframe.bundle.js +2 -0
- package/dist/storybook/721.46fa9f53.iframe.bundle.js.LICENSE.txt +31 -0
- package/dist/storybook/721.c225c101a0a55a8f98eb.manager.bundle.js +2 -0
- package/dist/storybook/721.c225c101a0a55a8f98eb.manager.bundle.js.LICENSE.txt +31 -0
- package/dist/storybook/761.21909e5ef44f985ae0d4.manager.bundle.js +2 -0
- package/dist/storybook/761.21909e5ef44f985ae0d4.manager.bundle.js.LICENSE.txt +94 -0
- package/dist/storybook/858.da40ed98.iframe.bundle.js +1 -0
- package/dist/storybook/858.e08e25a6901d2e21e9d8.manager.bundle.js +1 -0
- package/dist/storybook/950.674e7934b4a26a022608.manager.bundle.js +1 -0
- package/dist/storybook/954.630c5748.iframe.bundle.js +1 -0
- package/dist/storybook/954.7f985e2fdf9f15a7748b.manager.bundle.js +1 -0
- package/dist/storybook/SegoeUI-VF.ttf +0 -0
- package/dist/storybook/favicon.ico +0 -0
- package/dist/storybook/favicon.png +0 -0
- package/dist/storybook/iframe.html +364 -0
- package/dist/storybook/index.html +165 -0
- package/dist/storybook/main.18c2c615e57574af12cd.manager.bundle.js +1 -0
- package/dist/storybook/main.b5c2945a.iframe.bundle.js +1 -0
- package/dist/storybook/project.json +1 -0
- package/dist/storybook/runtime~main.5d918fe7.iframe.bundle.js +1 -0
- package/dist/storybook/runtime~main.8db883e762072830487f.manager.bundle.js +1 -0
- package/dist/storybook/shell.css +83 -0
- package/dist/storybook/theme-switch.ts +13 -0
- package/dist/web-components.js +96 -28
- package/dist/web-components.min.js +179 -179
- package/package.json +7 -37
- package/playwright.config.ts +25 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"generatedAt":1692072921100,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":true,"hasStorybookEslint":false,"refCount":0,"monorepo":"Nx","packageManager":{"type":"yarn","version":"1.23.34"},"storybookVersion":"6.5.15","language":"typescript","storybookPackages":{"@storybook/html":{"version":null}},"framework":{"name":"html"},"addons":{"@storybook/addon-docs":{"version":"6.5.15"},"@storybook/addon-essentials":{"options":{"backgrounds":false,"viewport":false,"toolbars":false,"actions":false},"version":"6.5.15"}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var deferred,leafPrototypes,getProto,inProgress,__webpack_modules__={},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.m=__webpack_modules__,deferred=[],__webpack_require__.O=(result,chunkIds,fn,priority)=>{if(!chunkIds){var notFulfilled=1/0;for(i=0;i<deferred.length;i++){for(var[chunkIds,fn,priority]=deferred[i],fulfilled=!0,j=0;j<chunkIds.length;j++)(!1&priority||notFulfilled>=priority)&&Object.keys(__webpack_require__.O).every((key=>__webpack_require__.O[key](chunkIds[j])))?chunkIds.splice(j--,1):(fulfilled=!1,priority<notFulfilled&&(notFulfilled=priority));if(fulfilled){deferred.splice(i--,1);var r=fn();void 0!==r&&(result=r)}}return result}priority=priority||0;for(var i=deferred.length;i>0&&deferred[i-1][2]>priority;i--)deferred[i]=deferred[i-1];deferred[i]=[chunkIds,fn,priority]},__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},getProto=Object.getPrototypeOf?obj=>Object.getPrototypeOf(obj):obj=>obj.__proto__,__webpack_require__.t=function(value,mode){if(1&mode&&(value=this(value)),8&mode)return value;if("object"==typeof value&&value){if(4&mode&&value.__esModule)return value;if(16&mode&&"function"==typeof value.then)return value}var ns=Object.create(null);__webpack_require__.r(ns);var def={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var current=2&mode&&value;"object"==typeof current&&!~leafPrototypes.indexOf(current);current=getProto(current))Object.getOwnPropertyNames(current).forEach((key=>def[key]=()=>value[key]));return def.default=()=>value,__webpack_require__.d(ns,def),ns},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.f={},__webpack_require__.e=chunkId=>Promise.all(Object.keys(__webpack_require__.f).reduce(((promises,key)=>(__webpack_require__.f[key](chunkId,promises),promises)),[])),__webpack_require__.u=chunkId=>chunkId+"."+{108:"b31ec3a1",316:"bc4aabd3",401:"7edec720",491:"77b24750",709:"22096ad4",721:"46fa9f53",858:"da40ed98",954:"630c5748"}[chunkId]+".iframe.bundle.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=module=>((module=Object.create(module)).children||(module.children=[]),Object.defineProperty(module,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+module.id)}}),module),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),inProgress={},__webpack_require__.l=(url,done,key,chunkId)=>{if(inProgress[url])inProgress[url].push(done);else{var script,needAttach;if(void 0!==key)for(var scripts=document.getElementsByTagName("script"),i=0;i<scripts.length;i++){var s=scripts[i];if(s.getAttribute("src")==url||s.getAttribute("data-webpack")=="@fluentui/web-components:"+key){script=s;break}}script||(needAttach=!0,(script=document.createElement("script")).charset="utf-8",script.timeout=120,__webpack_require__.nc&&script.setAttribute("nonce",__webpack_require__.nc),script.setAttribute("data-webpack","@fluentui/web-components:"+key),script.src=url),inProgress[url]=[done];var onScriptComplete=(prev,event)=>{script.onerror=script.onload=null,clearTimeout(timeout);var doneFns=inProgress[url];if(delete inProgress[url],script.parentNode&&script.parentNode.removeChild(script),doneFns&&doneFns.forEach((fn=>fn(event))),prev)return prev(event)},timeout=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:script}),12e4);script.onerror=onScriptComplete.bind(null,script.onerror),script.onload=onScriptComplete.bind(null,script.onload),needAttach&&document.head.appendChild(script)}},__webpack_require__.r=exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),__webpack_require__.p="",(()=>{var installedChunks={303:0};__webpack_require__.f.j=(chunkId,promises)=>{var installedChunkData=__webpack_require__.o(installedChunks,chunkId)?installedChunks[chunkId]:void 0;if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(303!=chunkId){var promise=new Promise(((resolve,reject)=>installedChunkData=installedChunks[chunkId]=[resolve,reject]));promises.push(installedChunkData[2]=promise);var url=__webpack_require__.p+__webpack_require__.u(chunkId),error=new Error;__webpack_require__.l(url,(event=>{if(__webpack_require__.o(installedChunks,chunkId)&&(0!==(installedChunkData=installedChunks[chunkId])&&(installedChunks[chunkId]=void 0),installedChunkData)){var errorType=event&&("load"===event.type?"missing":event.type),realSrc=event&&event.target&&event.target.src;error.message="Loading chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,installedChunkData[1](error)}}),"chunk-"+chunkId,chunkId)}else installedChunks[chunkId]=0},__webpack_require__.O.j=chunkId=>0===installedChunks[chunkId];var webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{var moduleId,chunkId,[chunkIds,moreModules,runtime]=data,i=0;if(chunkIds.some((id=>0!==installedChunks[id]))){for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);if(runtime)var result=runtime(__webpack_require__)}for(parentChunkLoadingFunction&&parentChunkLoadingFunction(data);i<chunkIds.length;i++)chunkId=chunkIds[i],__webpack_require__.o(installedChunks,chunkId)&&installedChunks[chunkId]&&installedChunks[chunkId][0](),installedChunks[chunkId]=0;return __webpack_require__.O(result)},chunkLoadingGlobal=self.webpackChunk_fluentui_web_components=self.webpackChunk_fluentui_web_components||[];chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null,0)),chunkLoadingGlobal.push=webpackJsonpCallback.bind(null,chunkLoadingGlobal.push.bind(chunkLoadingGlobal))})(),__webpack_require__.nc=void 0})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var deferred,leafPrototypes,getProto,inProgress,__webpack_modules__={},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.m=__webpack_modules__,deferred=[],__webpack_require__.O=(result,chunkIds,fn,priority)=>{if(!chunkIds){var notFulfilled=1/0;for(i=0;i<deferred.length;i++){for(var[chunkIds,fn,priority]=deferred[i],fulfilled=!0,j=0;j<chunkIds.length;j++)(!1&priority||notFulfilled>=priority)&&Object.keys(__webpack_require__.O).every((key=>__webpack_require__.O[key](chunkIds[j])))?chunkIds.splice(j--,1):(fulfilled=!1,priority<notFulfilled&&(notFulfilled=priority));if(fulfilled){deferred.splice(i--,1);var r=fn();void 0!==r&&(result=r)}}return result}priority=priority||0;for(var i=deferred.length;i>0&&deferred[i-1][2]>priority;i--)deferred[i]=deferred[i-1];deferred[i]=[chunkIds,fn,priority]},__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},getProto=Object.getPrototypeOf?obj=>Object.getPrototypeOf(obj):obj=>obj.__proto__,__webpack_require__.t=function(value,mode){if(1&mode&&(value=this(value)),8&mode)return value;if("object"==typeof value&&value){if(4&mode&&value.__esModule)return value;if(16&mode&&"function"==typeof value.then)return value}var ns=Object.create(null);__webpack_require__.r(ns);var def={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var current=2&mode&&value;"object"==typeof current&&!~leafPrototypes.indexOf(current);current=getProto(current))Object.getOwnPropertyNames(current).forEach((key=>def[key]=()=>value[key]));return def.default=()=>value,__webpack_require__.d(ns,def),ns},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.f={},__webpack_require__.e=chunkId=>Promise.all(Object.keys(__webpack_require__.f).reduce(((promises,key)=>(__webpack_require__.f[key](chunkId,promises),promises)),[])),__webpack_require__.u=chunkId=>chunkId+"."+{108:"78b731e00015540915a8",401:"c9bdfaf0dda8b194127f",709:"b131e33993a6b94d7ad8",721:"c225c101a0a55a8f98eb",858:"e08e25a6901d2e21e9d8",950:"674e7934b4a26a022608",954:"7f985e2fdf9f15a7748b"}[chunkId]+".manager.bundle.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),inProgress={},__webpack_require__.l=(url,done,key,chunkId)=>{if(inProgress[url])inProgress[url].push(done);else{var script,needAttach;if(void 0!==key)for(var scripts=document.getElementsByTagName("script"),i=0;i<scripts.length;i++){var s=scripts[i];if(s.getAttribute("src")==url||s.getAttribute("data-webpack")=="@fluentui/web-components:"+key){script=s;break}}script||(needAttach=!0,(script=document.createElement("script")).charset="utf-8",script.timeout=120,__webpack_require__.nc&&script.setAttribute("nonce",__webpack_require__.nc),script.setAttribute("data-webpack","@fluentui/web-components:"+key),script.src=url),inProgress[url]=[done];var onScriptComplete=(prev,event)=>{script.onerror=script.onload=null,clearTimeout(timeout);var doneFns=inProgress[url];if(delete inProgress[url],script.parentNode&&script.parentNode.removeChild(script),doneFns&&doneFns.forEach((fn=>fn(event))),prev)return prev(event)},timeout=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:script}),12e4);script.onerror=onScriptComplete.bind(null,script.onerror),script.onload=onScriptComplete.bind(null,script.onload),needAttach&&document.head.appendChild(script)}},__webpack_require__.r=exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),__webpack_require__.p="",(()=>{var installedChunks={303:0};__webpack_require__.f.j=(chunkId,promises)=>{var installedChunkData=__webpack_require__.o(installedChunks,chunkId)?installedChunks[chunkId]:void 0;if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(303!=chunkId){var promise=new Promise(((resolve,reject)=>installedChunkData=installedChunks[chunkId]=[resolve,reject]));promises.push(installedChunkData[2]=promise);var url=__webpack_require__.p+__webpack_require__.u(chunkId),error=new Error;__webpack_require__.l(url,(event=>{if(__webpack_require__.o(installedChunks,chunkId)&&(0!==(installedChunkData=installedChunks[chunkId])&&(installedChunks[chunkId]=void 0),installedChunkData)){var errorType=event&&("load"===event.type?"missing":event.type),realSrc=event&&event.target&&event.target.src;error.message="Loading chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,installedChunkData[1](error)}}),"chunk-"+chunkId,chunkId)}else installedChunks[chunkId]=0},__webpack_require__.O.j=chunkId=>0===installedChunks[chunkId];var webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{var moduleId,chunkId,[chunkIds,moreModules,runtime]=data,i=0;if(chunkIds.some((id=>0!==installedChunks[id]))){for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);if(runtime)var result=runtime(__webpack_require__)}for(parentChunkLoadingFunction&&parentChunkLoadingFunction(data);i<chunkIds.length;i++)chunkId=chunkIds[i],__webpack_require__.o(installedChunks,chunkId)&&installedChunks[chunkId]&&installedChunks[chunkId][0](),installedChunks[chunkId]=0;return __webpack_require__.O(result)},chunkLoadingGlobal=self.webpackChunk_fluentui_web_components=self.webpackChunk_fluentui_web_components||[];chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null,0)),chunkLoadingGlobal.push=webpackJsonpCallback.bind(null,chunkLoadingGlobal.push.bind(chunkLoadingGlobal))})(),__webpack_require__.nc=void 0})();
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HEADS UP!
|
|
3
|
+
* This file is used by both React v9 and Web Components Storybooks.
|
|
4
|
+
* All CSS must apply to both implementations.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* sidebar logo (React uses an SVG, Web Components uses text) */
|
|
8
|
+
.sidebar-header > div:first-of-type {
|
|
9
|
+
font-size: 20px; /* for Web Components */
|
|
10
|
+
white-space: break-spaces; /* allow line breaks "\n" in Storybook theme */
|
|
11
|
+
margin-right: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* remove sidebar shortcuts menu */
|
|
15
|
+
.sidebar-header > div:last-child {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Add left side background color splash */
|
|
20
|
+
/* colors become distracting in mobile layout so scoped to where sidebar is visible */
|
|
21
|
+
@media (min-width: 600px) {
|
|
22
|
+
#root > div:before {
|
|
23
|
+
content: '';
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: -200px;
|
|
26
|
+
left: -200px;
|
|
27
|
+
width: 400px;
|
|
28
|
+
height: 400px;
|
|
29
|
+
background: #c989e8;
|
|
30
|
+
opacity: 0.5;
|
|
31
|
+
filter: blur(150px);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Add right side background color splash */
|
|
35
|
+
#root > div:after {
|
|
36
|
+
content: '';
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: -200px;
|
|
39
|
+
right: -200px;
|
|
40
|
+
width: 400px;
|
|
41
|
+
height: 400px;
|
|
42
|
+
background: #b3d4ff;
|
|
43
|
+
opacity: 0.5;
|
|
44
|
+
filter: blur(150px);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Give sidebar a transparent white background to match design */
|
|
49
|
+
.sidebar-container {
|
|
50
|
+
background: rgba(255, 255, 255, 0.6);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* remove background preventing color splash from showing */
|
|
54
|
+
#storybook-preview-wrapper {
|
|
55
|
+
background: transparent;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* remove Storybook's 10px top on the main (right hand side) of the docs */
|
|
59
|
+
/* this affects only whitespace in React v9 docs, but the theme switcher in Web Components */
|
|
60
|
+
[role='main'] {
|
|
61
|
+
top: 0 !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* remove box shadow style from storybooks wrapper div */
|
|
65
|
+
[role='main'] > div {
|
|
66
|
+
box-shadow: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* permanently hide toolbar so animation never appears on page load */
|
|
70
|
+
[role='main'] .os-host {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* stop offset from changing page dimensions when 't' is pressed and toolbar opened */
|
|
75
|
+
[role='main'] > div > div > div {
|
|
76
|
+
top: 0 !important;
|
|
77
|
+
height: 100% !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Remove 'Published on Chromatic' banner */
|
|
81
|
+
#back-to-chromatic {
|
|
82
|
+
display: none !important;
|
|
83
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { teamsDarkTheme, teamsLightTheme, webDarkTheme, webLightTheme } from '@fluentui/tokens';
|
|
2
|
+
import { setTheme } from '@fluentui/web-components';
|
|
3
|
+
|
|
4
|
+
const themes = {
|
|
5
|
+
'web-light': webLightTheme,
|
|
6
|
+
'web-dark': webDarkTheme,
|
|
7
|
+
'teams-light': teamsLightTheme,
|
|
8
|
+
'teams-dark': teamsDarkTheme,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function switchTheme(themeName: keyof typeof themes) {
|
|
12
|
+
setTheme(themes[themeName]);
|
|
13
|
+
}
|
package/dist/web-components.js
CHANGED
|
@@ -526,7 +526,7 @@ const SourceLifetime = Object.freeze({
|
|
|
526
526
|
*/
|
|
527
527
|
const Observable = FAST.getById(KernelServiceId.observable, () => {
|
|
528
528
|
const queueUpdate = Updates.enqueue;
|
|
529
|
-
const volatileRegex = /(:|&&|\|\||if)/;
|
|
529
|
+
const volatileRegex = /(:|&&|\|\||if|\?\.)/;
|
|
530
530
|
const notifierLookup = new WeakMap();
|
|
531
531
|
let watcher = void 0;
|
|
532
532
|
let createArrayObserver = array => {
|
|
@@ -1978,6 +1978,9 @@ const Compiler = {
|
|
|
1978
1978
|
} else {
|
|
1979
1979
|
template = html;
|
|
1980
1980
|
}
|
|
1981
|
+
if (!template.content.firstChild && !template.content.lastChild) {
|
|
1982
|
+
template.content.appendChild(document.createComment(""));
|
|
1983
|
+
}
|
|
1981
1984
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1111864
|
|
1982
1985
|
const fragment = document.adoptNode(template.content);
|
|
1983
1986
|
const context = new CompilationContext(fragment, factories, policy);
|
|
@@ -2239,17 +2242,24 @@ HTMLDirective.define(RefDirective);
|
|
|
2239
2242
|
*/
|
|
2240
2243
|
const ref = propertyName => new RefDirective(propertyName);
|
|
2241
2244
|
|
|
2245
|
+
const noTemplate = () => null;
|
|
2246
|
+
function normalizeBinding(value) {
|
|
2247
|
+
return value === undefined ? noTemplate : isFunction(value) ? value : () => value;
|
|
2248
|
+
}
|
|
2242
2249
|
/**
|
|
2243
2250
|
* A directive that enables basic conditional rendering in a template.
|
|
2244
2251
|
* @param condition - The condition to test for rendering.
|
|
2245
2252
|
* @param templateOrTemplateBinding - The template or a binding that gets
|
|
2246
2253
|
* the template to render when the condition is true.
|
|
2254
|
+
* @param elseTemplateOrTemplateBinding - Optional template or binding that that
|
|
2255
|
+
* gets the template to render when the conditional is false.
|
|
2247
2256
|
* @public
|
|
2248
2257
|
*/
|
|
2249
|
-
function when(condition, templateOrTemplateBinding) {
|
|
2258
|
+
function when(condition, templateOrTemplateBinding, elseTemplateOrTemplateBinding) {
|
|
2250
2259
|
const dataBinding = isFunction(condition) ? condition : () => condition;
|
|
2251
|
-
const templateBinding =
|
|
2252
|
-
|
|
2260
|
+
const templateBinding = normalizeBinding(templateOrTemplateBinding);
|
|
2261
|
+
const elseBinding = normalizeBinding(elseTemplateOrTemplateBinding);
|
|
2262
|
+
return (source, context) => dataBinding(source, context) ? templateBinding(source, context) : elseBinding(source, context);
|
|
2253
2263
|
}
|
|
2254
2264
|
|
|
2255
2265
|
const selectElements = value => value.nodeType === 1;
|
|
@@ -2934,7 +2944,7 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
2934
2944
|
styles.removeStylesFrom(source);
|
|
2935
2945
|
if (sourceBehaviors !== null) {
|
|
2936
2946
|
for (let i = 0, ii = sourceBehaviors.length; i < ii; ++i) {
|
|
2937
|
-
this.
|
|
2947
|
+
this.removeBehavior(sourceBehaviors[i]);
|
|
2938
2948
|
}
|
|
2939
2949
|
}
|
|
2940
2950
|
}
|
|
@@ -3121,13 +3131,10 @@ class AdoptedStyleSheetsStrategy {
|
|
|
3121
3131
|
});
|
|
3122
3132
|
}
|
|
3123
3133
|
addStylesTo(target) {
|
|
3124
|
-
|
|
3125
|
-
t.adoptedStyleSheets = [...t.adoptedStyleSheets, ...this.sheets];
|
|
3134
|
+
addAdoptedStyleSheets(normalizeStyleTarget(target), this.sheets);
|
|
3126
3135
|
}
|
|
3127
3136
|
removeStylesFrom(target) {
|
|
3128
|
-
|
|
3129
|
-
const sheets = this.sheets;
|
|
3130
|
-
t.adoptedStyleSheets = t.adoptedStyleSheets.filter(x => sheets.indexOf(x) === -1);
|
|
3137
|
+
removeAdoptedStyleSheets(normalizeStyleTarget(target), this.sheets);
|
|
3131
3138
|
}
|
|
3132
3139
|
}
|
|
3133
3140
|
AdoptedStyleSheetsStrategy.styleSheetCache = new Map();
|
|
@@ -3163,7 +3170,40 @@ class StyleElementStrategy {
|
|
|
3163
3170
|
}
|
|
3164
3171
|
}
|
|
3165
3172
|
}
|
|
3166
|
-
|
|
3173
|
+
let addAdoptedStyleSheets = (target, sheets) => {
|
|
3174
|
+
target.adoptedStyleSheets = [...target.adoptedStyleSheets, ...sheets];
|
|
3175
|
+
};
|
|
3176
|
+
let removeAdoptedStyleSheets = (target, sheets) => {
|
|
3177
|
+
target.adoptedStyleSheets = target.adoptedStyleSheets.filter(x => sheets.indexOf(x) === -1);
|
|
3178
|
+
};
|
|
3179
|
+
if (ElementStyles.supportsAdoptedStyleSheets) {
|
|
3180
|
+
try {
|
|
3181
|
+
// Test if browser implementation uses FrozenArray.
|
|
3182
|
+
// If not, use push / splice to alter the stylesheets
|
|
3183
|
+
// in place. This circumvents a bug in Safari 16.4 where
|
|
3184
|
+
// periodically, assigning the array would previously
|
|
3185
|
+
// cause sheets to be removed.
|
|
3186
|
+
document.adoptedStyleSheets.push();
|
|
3187
|
+
document.adoptedStyleSheets.splice();
|
|
3188
|
+
addAdoptedStyleSheets = (target, sheets) => {
|
|
3189
|
+
target.adoptedStyleSheets.push(...sheets);
|
|
3190
|
+
};
|
|
3191
|
+
removeAdoptedStyleSheets = (target, sheets) => {
|
|
3192
|
+
for (const sheet of sheets) {
|
|
3193
|
+
const index = target.adoptedStyleSheets.indexOf(sheet);
|
|
3194
|
+
if (index !== -1) {
|
|
3195
|
+
target.adoptedStyleSheets.splice(index, 1);
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
};
|
|
3199
|
+
} catch (e) {
|
|
3200
|
+
// Do nothing if an error is thrown, the default
|
|
3201
|
+
// case handles FrozenArray.
|
|
3202
|
+
}
|
|
3203
|
+
ElementStyles.setDefaultStrategy(AdoptedStyleSheetsStrategy);
|
|
3204
|
+
} else {
|
|
3205
|
+
ElementStyles.setDefaultStrategy(StyleElementStrategy);
|
|
3206
|
+
}
|
|
3167
3207
|
|
|
3168
3208
|
/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */
|
|
3169
3209
|
function createFASTElement(BaseType) {
|
|
@@ -3472,9 +3512,9 @@ function uniqueId(prefix = "") {
|
|
|
3472
3512
|
/**
|
|
3473
3513
|
* Apply mixins to a constructor.
|
|
3474
3514
|
* Sourced from {@link https://www.typescriptlang.org/docs/handbook/mixins.html | TypeScript Documentation }.
|
|
3475
|
-
* @
|
|
3515
|
+
* @internal
|
|
3476
3516
|
*/
|
|
3477
|
-
function applyMixins(derivedCtor, ...baseCtors) {
|
|
3517
|
+
function applyMixins$1(derivedCtor, ...baseCtors) {
|
|
3478
3518
|
const derivedAttributes = AttributeConfiguration.locate(derivedCtor);
|
|
3479
3519
|
baseCtors.forEach(baseCtor => {
|
|
3480
3520
|
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
|
|
@@ -3566,7 +3606,7 @@ __decorate([attr({
|
|
|
3566
3606
|
mode: "boolean"
|
|
3567
3607
|
})], FASTAccordionItem.prototype, "disabled", void 0);
|
|
3568
3608
|
__decorate([attr], FASTAccordionItem.prototype, "id", void 0);
|
|
3569
|
-
applyMixins(FASTAccordionItem, StartEnd);
|
|
3609
|
+
applyMixins$1(FASTAccordionItem, StartEnd);
|
|
3570
3610
|
|
|
3571
3611
|
/**
|
|
3572
3612
|
* Expand mode for {@link FASTAccordion}
|
|
@@ -3830,8 +3870,8 @@ class DelegatesARIALink {}
|
|
|
3830
3870
|
__decorate([attr({
|
|
3831
3871
|
attribute: "aria-expanded"
|
|
3832
3872
|
})], DelegatesARIALink.prototype, "ariaExpanded", void 0);
|
|
3833
|
-
applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties);
|
|
3834
|
-
applyMixins(FASTAnchor, StartEnd, DelegatesARIALink);
|
|
3873
|
+
applyMixins$1(DelegatesARIALink, ARIAGlobalStatesAndProperties);
|
|
3874
|
+
applyMixins$1(FASTAnchor, StartEnd, DelegatesARIALink);
|
|
3835
3875
|
|
|
3836
3876
|
/**
|
|
3837
3877
|
* The template for the {@link @microsoft/fast-foundation#(FASTAnchor:class)} component.
|
|
@@ -4451,8 +4491,8 @@ __decorate([attr({
|
|
|
4451
4491
|
__decorate([attr({
|
|
4452
4492
|
attribute: "aria-pressed"
|
|
4453
4493
|
})], DelegatesARIAButton.prototype, "ariaPressed", void 0);
|
|
4454
|
-
applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
|
|
4455
|
-
applyMixins(FASTButton, StartEnd, DelegatesARIAButton);
|
|
4494
|
+
applyMixins$1(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
|
|
4495
|
+
applyMixins$1(FASTButton, StartEnd, DelegatesARIAButton);
|
|
4456
4496
|
|
|
4457
4497
|
/**
|
|
4458
4498
|
* The template for the {@link @microsoft/fast-foundation#(FASTButton:class)} component.
|
|
@@ -6703,7 +6743,7 @@ const DividerOrientation = Orientation;
|
|
|
6703
6743
|
* @public
|
|
6704
6744
|
*/
|
|
6705
6745
|
function dividerTemplate() {
|
|
6706
|
-
return html`<template role="${x => x.role}" aria-orientation="${x => x.orientation}"><slot></slot></template>`;
|
|
6746
|
+
return html`<template role="${x => x.role}" aria-orientation="${x => x.role !== DividerRole.presentation ? x.orientation : void 0}"><slot></slot></template>`;
|
|
6707
6747
|
}
|
|
6708
6748
|
|
|
6709
6749
|
/**
|
|
@@ -7028,7 +7068,7 @@ __decorate([attr({
|
|
|
7028
7068
|
})], FASTMenuItem.prototype, "hidden", void 0);
|
|
7029
7069
|
__decorate([observable], FASTMenuItem.prototype, "slottedSubmenu", void 0);
|
|
7030
7070
|
__decorate([observable], FASTMenuItem.prototype, "submenu", void 0);
|
|
7031
|
-
applyMixins(FASTMenuItem, StartEnd);
|
|
7071
|
+
applyMixins$1(FASTMenuItem, StartEnd);
|
|
7032
7072
|
|
|
7033
7073
|
/**
|
|
7034
7074
|
* The template for the {@link @microsoft/fast-foundation#FASTMenu} component.
|
|
@@ -7492,8 +7532,8 @@ __decorate([observable], FASTTextField.prototype, "defaultSlottedNodes", void 0)
|
|
|
7492
7532
|
* @public
|
|
7493
7533
|
*/
|
|
7494
7534
|
class DelegatesARIATextbox {}
|
|
7495
|
-
applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);
|
|
7496
|
-
applyMixins(FASTTextField, StartEnd, DelegatesARIATextbox);
|
|
7535
|
+
applyMixins$1(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);
|
|
7536
|
+
applyMixins$1(FASTTextField, StartEnd, DelegatesARIATextbox);
|
|
7497
7537
|
|
|
7498
7538
|
/**
|
|
7499
7539
|
* A base class for progress components.
|
|
@@ -7567,7 +7607,7 @@ const progressSegments = 44;
|
|
|
7567
7607
|
* @public
|
|
7568
7608
|
*/
|
|
7569
7609
|
function progressRingTemplate(options = {}) {
|
|
7570
|
-
return html`<template role="progressbar" aria-valuenow="${x => x.value}" aria-valuemin="${x => x.min}" aria-valuemax="${x => x.max}">${when(x => typeof x.value === "number", html`<svg class="progress" part="progress" viewBox="0 0 16 16" slot="determinate"><circle class="background" part="background" cx="8px" cy="8px" r="7px"></circle><circle class="determinate" part="determinate" style="stroke-dasharray: ${x => progressSegments * x.percentComplete / 100}px ${progressSegments}px" cx="8px" cy="8px" r="7px"></circle></svg
|
|
7610
|
+
return html`<template role="progressbar" aria-valuenow="${x => x.value}" aria-valuemin="${x => x.min}" aria-valuemax="${x => x.max}">${when(x => typeof x.value === "number", html`<svg class="progress" part="progress" viewBox="0 0 16 16" slot="determinate"><circle class="background" part="background" cx="8px" cy="8px" r="7px"></circle><circle class="determinate" part="determinate" style="stroke-dasharray: ${x => progressSegments * x.percentComplete / 100}px ${progressSegments}px" cx="8px" cy="8px" r="7px"></circle></svg>`, html`<slot name="indeterminate">${staticallyCompose(options.indeterminateIndicator)}</slot>`)}</template>`;
|
|
7571
7611
|
}
|
|
7572
7612
|
|
|
7573
7613
|
/**
|
|
@@ -7588,7 +7628,7 @@ class FASTProgress extends FASTBaseProgress {}
|
|
|
7588
7628
|
* @public
|
|
7589
7629
|
*/
|
|
7590
7630
|
function progressTemplate(options = {}) {
|
|
7591
|
-
return html`<template role="progressbar" aria-valuenow="${x => x.value}" aria-valuemin="${x => x.min}" aria-valuemax="${x => x.max}">${when(x => typeof x.value === "number", html`<div class="progress" part="progress" slot="determinate"><div class="determinate" part="determinate" style="width: ${x => x.percentComplete}%"></div></div
|
|
7631
|
+
return html`<template role="progressbar" aria-valuenow="${x => x.value}" aria-valuemin="${x => x.min}" aria-valuemax="${x => x.max}">${when(x => typeof x.value === "number", html`<div class="progress" part="progress" slot="determinate"><div class="determinate" part="determinate" style="width: ${x => x.percentComplete}%"></div></div>`, html`<div class="progress" part="progress" slot="indeterminate"><slot name="indeterminate">${staticallyCompose(options.indeterminateIndicator1)} ${staticallyCompose(options.indeterminateIndicator2)}</slot></div>`)}</template>`;
|
|
7592
7632
|
}
|
|
7593
7633
|
|
|
7594
7634
|
/**
|
|
@@ -8630,7 +8670,7 @@ class FASTTab extends FASTElement {}
|
|
|
8630
8670
|
__decorate([attr({
|
|
8631
8671
|
mode: "boolean"
|
|
8632
8672
|
})], FASTTab.prototype, "disabled", void 0);
|
|
8633
|
-
applyMixins(FASTTab, StartEnd);
|
|
8673
|
+
applyMixins$1(FASTTab, StartEnd);
|
|
8634
8674
|
|
|
8635
8675
|
/**
|
|
8636
8676
|
* The orientation of the {@link @microsoft/fast-foundation#(FASTTabs:class)} component
|
|
@@ -8677,8 +8717,11 @@ class FASTTabs extends FASTElement {
|
|
|
8677
8717
|
this.isDisabledElement = el => {
|
|
8678
8718
|
return el.getAttribute("aria-disabled") === "true";
|
|
8679
8719
|
};
|
|
8720
|
+
this.isHiddenElement = el => {
|
|
8721
|
+
return el.hasAttribute("hidden");
|
|
8722
|
+
};
|
|
8680
8723
|
this.isFocusableElement = el => {
|
|
8681
|
-
return !this.isDisabledElement(el);
|
|
8724
|
+
return !this.isDisabledElement(el) && !this.isHiddenElement(el);
|
|
8682
8725
|
};
|
|
8683
8726
|
this.setTabs = () => {
|
|
8684
8727
|
const gridHorizontalProperty = "gridColumn";
|
|
@@ -8698,6 +8741,7 @@ class FASTTabs extends FASTElement {
|
|
|
8698
8741
|
tab.setAttribute("tabindex", isActiveTab ? "0" : "-1");
|
|
8699
8742
|
if (isActiveTab) {
|
|
8700
8743
|
this.activetab = tab;
|
|
8744
|
+
this.activeid = tabId;
|
|
8701
8745
|
}
|
|
8702
8746
|
}
|
|
8703
8747
|
// If the original property isn't emptied out,
|
|
@@ -8883,7 +8927,7 @@ class FASTTabs extends FASTElement {
|
|
|
8883
8927
|
* This method allows the active index to be adjusted by numerical increments
|
|
8884
8928
|
*/
|
|
8885
8929
|
adjust(adjustment) {
|
|
8886
|
-
const focusableTabs = this.tabs.filter(t =>
|
|
8930
|
+
const focusableTabs = this.tabs.filter(t => this.isFocusableElement(t));
|
|
8887
8931
|
const currentActiveTabIndex = focusableTabs.indexOf(this.activetab);
|
|
8888
8932
|
const nextTabIndex = limit(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment);
|
|
8889
8933
|
// the index of the next focusable tab within the context of all available tabs
|
|
@@ -8909,7 +8953,7 @@ __decorate([attr], FASTTabs.prototype, "orientation", void 0);
|
|
|
8909
8953
|
__decorate([attr], FASTTabs.prototype, "activeid", void 0);
|
|
8910
8954
|
__decorate([observable], FASTTabs.prototype, "tabs", void 0);
|
|
8911
8955
|
__decorate([observable], FASTTabs.prototype, "tabpanels", void 0);
|
|
8912
|
-
applyMixins(FASTTabs, StartEnd);
|
|
8956
|
+
applyMixins$1(FASTTabs, StartEnd);
|
|
8913
8957
|
|
|
8914
8958
|
/**
|
|
8915
8959
|
* The template for the {@link @microsoft/fast-foundation#(FASTTextField:class)} component.
|
|
@@ -10438,6 +10482,30 @@ const definition$n = Avatar.compose({
|
|
|
10438
10482
|
styles: styles$l
|
|
10439
10483
|
});
|
|
10440
10484
|
|
|
10485
|
+
/**
|
|
10486
|
+
* Apply mixins to a constructor.
|
|
10487
|
+
* Sourced from {@link https://www.typescriptlang.org/docs/handbook/mixins.html | TypeScript Documentation }.
|
|
10488
|
+
*
|
|
10489
|
+
* TODO: Remove with https://github.com/microsoft/fast/pull/6797
|
|
10490
|
+
* This was used for Badge where start/end was not yet implemented.
|
|
10491
|
+
* The method itself was deprecated as it was largely intended to be "internals" for Fast Foundation.
|
|
10492
|
+
* Adding here to avoid breaking of the existing API.
|
|
10493
|
+
* @internal
|
|
10494
|
+
*/
|
|
10495
|
+
function applyMixins(derivedCtor, ...baseCtors) {
|
|
10496
|
+
const derivedAttributes = AttributeConfiguration.locate(derivedCtor);
|
|
10497
|
+
baseCtors.forEach(baseCtor => {
|
|
10498
|
+
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
|
|
10499
|
+
if (name !== 'constructor') {
|
|
10500
|
+
Object.defineProperty(derivedCtor.prototype, name, /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
|
|
10501
|
+
Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
|
|
10502
|
+
}
|
|
10503
|
+
});
|
|
10504
|
+
const baseAttributes = AttributeConfiguration.locate(baseCtor);
|
|
10505
|
+
baseAttributes.forEach(x => derivedAttributes.push(x));
|
|
10506
|
+
});
|
|
10507
|
+
}
|
|
10508
|
+
|
|
10441
10509
|
/**
|
|
10442
10510
|
* BadgeAppearance constants
|
|
10443
10511
|
* @public
|