@ni/nimble-components 1.0.0-beta.12 → 1.0.0-beta.123
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/README.md +42 -4
- package/dist/esm/button/behaviors.js.map +1 -1
- package/dist/esm/button/index.d.ts +10 -0
- package/dist/esm/button/index.js +19 -10
- package/dist/esm/button/index.js.map +1 -1
- package/dist/esm/button/styles.js +125 -49
- package/dist/esm/button/styles.js.map +1 -1
- package/dist/esm/button/types.d.ts +3 -0
- package/dist/esm/button/types.js +0 -4
- package/dist/esm/button/types.js.map +1 -1
- package/dist/esm/checkbox/index.d.ts +12 -0
- package/dist/esm/checkbox/index.js +18 -0
- package/dist/esm/checkbox/index.js.map +1 -0
- package/dist/esm/checkbox/styles.d.ts +1 -0
- package/dist/esm/checkbox/styles.js +92 -0
- package/dist/esm/checkbox/styles.js.map +1 -0
- package/dist/esm/drawer/animations.d.ts +14 -0
- package/dist/esm/drawer/animations.js +52 -0
- package/dist/esm/drawer/animations.js.map +1 -0
- package/dist/esm/drawer/index.d.ts +43 -0
- package/dist/esm/drawer/index.js +189 -0
- package/dist/esm/drawer/index.js.map +1 -0
- package/dist/esm/drawer/styles.d.ts +1 -0
- package/dist/esm/drawer/styles.js +116 -0
- package/dist/esm/drawer/styles.js.map +1 -0
- package/dist/esm/drawer/types.d.ts +12 -0
- package/dist/esm/drawer/types.js +13 -0
- package/dist/esm/drawer/types.js.map +1 -0
- package/dist/esm/icon-base/index.d.ts +12 -0
- package/dist/esm/icon-base/index.js +22 -0
- package/dist/esm/icon-base/index.js.map +1 -0
- package/dist/esm/icon-base/styles.d.ts +1 -0
- package/dist/esm/icon-base/styles.js +38 -0
- package/dist/esm/icon-base/styles.js.map +1 -0
- package/dist/esm/icon-base/template.d.ts +2 -0
- package/dist/esm/icon-base/template.js +7 -0
- package/dist/esm/icon-base/template.js.map +1 -0
- package/dist/esm/icon-base/types.d.ts +11 -0
- package/dist/esm/icon-base/types.js +8 -0
- package/dist/esm/icon-base/types.js.map +1 -0
- package/dist/esm/icons/access-control.d.ts +12 -0
- package/dist/esm/icons/access-control.js +12 -0
- package/dist/esm/icons/access-control.js.map +1 -0
- package/dist/esm/icons/admin.d.ts +12 -0
- package/dist/esm/icons/admin.js +12 -0
- package/dist/esm/icons/admin.js.map +1 -0
- package/dist/esm/icons/administration.d.ts +12 -0
- package/dist/esm/icons/administration.js +12 -0
- package/dist/esm/icons/administration.js.map +1 -0
- package/dist/esm/icons/all-icons.d.ts +15 -0
- package/dist/esm/icons/all-icons.js +16 -0
- package/dist/esm/icons/all-icons.js.map +1 -0
- package/dist/esm/icons/check.d.ts +12 -0
- package/dist/esm/icons/check.js +12 -0
- package/dist/esm/icons/check.js.map +1 -0
- package/dist/esm/icons/custom-applications.d.ts +12 -0
- package/dist/esm/icons/custom-applications.js +12 -0
- package/dist/esm/icons/custom-applications.js.map +1 -0
- package/dist/esm/icons/delete.d.ts +12 -0
- package/dist/esm/icons/delete.js +12 -0
- package/dist/esm/icons/delete.js.map +1 -0
- package/dist/esm/icons/fail.d.ts +12 -0
- package/dist/esm/icons/fail.js +12 -0
- package/dist/esm/icons/fail.js.map +1 -0
- package/dist/esm/icons/login.d.ts +12 -0
- package/dist/esm/icons/login.js +12 -0
- package/dist/esm/icons/login.js.map +1 -0
- package/dist/esm/icons/logout.d.ts +12 -0
- package/dist/esm/icons/logout.js +12 -0
- package/dist/esm/icons/logout.js.map +1 -0
- package/dist/esm/icons/managed-systems.d.ts +12 -0
- package/dist/esm/icons/managed-systems.js +12 -0
- package/dist/esm/icons/managed-systems.js.map +1 -0
- package/dist/esm/icons/measurement-data-analysis.d.ts +12 -0
- package/dist/esm/icons/measurement-data-analysis.js +12 -0
- package/dist/esm/icons/measurement-data-analysis.js.map +1 -0
- package/dist/esm/icons/settings.d.ts +12 -0
- package/dist/esm/icons/settings.js +12 -0
- package/dist/esm/icons/settings.js.map +1 -0
- package/dist/esm/icons/succeeded.d.ts +12 -0
- package/dist/esm/icons/succeeded.js +12 -0
- package/dist/esm/icons/succeeded.js.map +1 -0
- package/dist/esm/icons/test-insights.d.ts +12 -0
- package/dist/esm/icons/test-insights.js +12 -0
- package/dist/esm/icons/test-insights.js.map +1 -0
- package/dist/esm/icons/utilities.d.ts +12 -0
- package/dist/esm/icons/utilities.js +12 -0
- package/dist/esm/icons/utilities.js.map +1 -0
- package/dist/esm/listbox-option/index.d.ts +15 -0
- package/dist/esm/listbox-option/index.js +31 -0
- package/dist/esm/listbox-option/index.js.map +1 -0
- package/dist/esm/listbox-option/styles.d.ts +1 -0
- package/dist/esm/listbox-option/styles.js +60 -0
- package/dist/esm/listbox-option/styles.js.map +1 -0
- package/dist/esm/menu/index.d.ts +12 -0
- package/dist/esm/menu/index.js +25 -0
- package/dist/esm/menu/index.js.map +1 -0
- package/dist/esm/menu/styles.d.ts +1 -0
- package/dist/esm/menu/styles.js +40 -0
- package/dist/esm/menu/styles.js.map +1 -0
- package/dist/esm/menu-item/index.d.ts +12 -0
- package/dist/esm/menu-item/index.js +25 -0
- package/dist/esm/menu-item/index.js.map +1 -0
- package/dist/esm/menu-item/styles.d.ts +1 -0
- package/dist/esm/menu-item/styles.js +64 -0
- package/dist/esm/menu-item/styles.js.map +1 -0
- package/dist/esm/nimble-components/src/button/behaviors.d.ts +12 -0
- package/dist/esm/nimble-components/src/button/index.d.ts +24 -0
- package/dist/esm/nimble-components/src/button/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/button/types.d.ts +12 -0
- package/dist/esm/nimble-components/src/checkbox/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/checkbox/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/drawer/animations.d.ts +14 -0
- package/dist/esm/nimble-components/src/drawer/index.d.ts +43 -0
- package/dist/esm/nimble-components/src/drawer/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/drawer/types.d.ts +12 -0
- package/dist/esm/nimble-components/src/icon-base/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/icon-base/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/icon-base/template.d.ts +2 -0
- package/dist/esm/nimble-components/src/icon-base/types.d.ts +11 -0
- package/dist/esm/nimble-components/src/icons/access-control.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/admin.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/administration.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/all-icons.d.ts +15 -0
- package/dist/esm/nimble-components/src/icons/check.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/custom-applications.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/delete.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/fail.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/login.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/logout.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/managed-systems.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/measurement-data-analysis.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/settings.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/succeeded.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/test-insights.d.ts +12 -0
- package/dist/esm/nimble-components/src/icons/utilities.d.ts +12 -0
- package/dist/esm/nimble-components/src/listbox-option/index.d.ts +15 -0
- package/dist/esm/nimble-components/src/listbox-option/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/menu/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/menu/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/menu-item/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/menu-item/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/number-field/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/number-field/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/select/index.d.ts +16 -0
- package/dist/esm/nimble-components/src/select/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tab/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/tab/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tab-panel/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/tab-panel/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tabs/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/tabs/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tabs-toolbar/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/tabs-toolbar/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tabs-toolbar/template.d.ts +1 -0
- package/dist/esm/nimble-components/src/testing/async-helpers.d.ts +10 -0
- package/dist/esm/nimble-components/src/text-field/index.d.ts +12 -0
- package/dist/esm/nimble-components/src/text-field/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/text-field/types.d.ts +3 -0
- package/dist/esm/nimble-components/src/theme-provider/design-tokens.d.ts +48 -0
- package/dist/esm/nimble-components/src/theme-provider/index.d.ts +17 -0
- package/dist/esm/nimble-components/src/theme-provider/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/theme-provider/template.d.ts +2 -0
- package/dist/esm/nimble-components/src/theme-provider/types.d.ts +7 -0
- package/dist/esm/nimble-components/src/tree-item/index.d.ts +34 -0
- package/dist/esm/nimble-components/src/tree-item/styles.d.ts +3 -0
- package/dist/esm/nimble-components/src/tree-view/index.d.ts +22 -0
- package/dist/esm/nimble-components/src/tree-view/styles.d.ts +1 -0
- package/dist/esm/nimble-components/src/tree-view/types.d.ts +7 -0
- package/dist/esm/nimble-components/src/utilities/style/focus.d.ts +11 -0
- package/dist/esm/nimble-components/src/utilities/style/prefers-reduced-motion.d.ts +8 -0
- package/dist/esm/number-field/index.d.ts +12 -1
- package/dist/esm/number-field/index.js +11 -8
- package/dist/esm/number-field/index.js.map +1 -1
- package/dist/esm/number-field/styles.js +114 -87
- package/dist/esm/number-field/styles.js.map +1 -1
- package/dist/esm/select/index.d.ts +16 -0
- package/dist/esm/select/index.js +50 -0
- package/dist/esm/select/index.js.map +1 -0
- package/dist/esm/select/styles.d.ts +1 -0
- package/dist/esm/select/styles.js +141 -0
- package/dist/esm/select/styles.js.map +1 -0
- package/dist/esm/tab/index.d.ts +12 -0
- package/dist/esm/tab/index.js +16 -0
- package/dist/esm/tab/index.js.map +1 -0
- package/dist/esm/tab/styles.d.ts +1 -0
- package/dist/esm/tab/styles.js +53 -0
- package/dist/esm/tab/styles.js.map +1 -0
- package/dist/esm/tab-panel/index.d.ts +12 -0
- package/dist/esm/tab-panel/index.js +16 -0
- package/dist/esm/tab-panel/index.js.map +1 -0
- package/dist/esm/tab-panel/styles.d.ts +1 -0
- package/dist/esm/tab-panel/styles.js +15 -0
- package/dist/esm/tab-panel/styles.js.map +1 -0
- package/dist/esm/tabs/index.d.ts +12 -0
- package/dist/esm/tabs/index.js +16 -0
- package/dist/esm/tabs/index.js.map +1 -0
- package/dist/esm/tabs/styles.d.ts +1 -0
- package/dist/esm/tabs/styles.js +43 -0
- package/dist/esm/tabs/styles.js.map +1 -0
- package/dist/esm/tabs-toolbar/index.d.ts +12 -0
- package/dist/esm/tabs-toolbar/index.js +15 -0
- package/dist/esm/tabs-toolbar/index.js.map +1 -0
- package/dist/esm/tabs-toolbar/styles.d.ts +1 -0
- package/dist/esm/tabs-toolbar/styles.js +23 -0
- package/dist/esm/tabs-toolbar/styles.js.map +1 -0
- package/dist/esm/tabs-toolbar/template.d.ts +1 -0
- package/dist/esm/tabs-toolbar/template.js +8 -0
- package/dist/esm/tabs-toolbar/template.js.map +1 -0
- package/dist/esm/testing/async-helpers.d.ts +10 -0
- package/dist/esm/testing/async-helpers.js +12 -0
- package/dist/esm/testing/async-helpers.js.map +1 -0
- package/dist/esm/text-field/index.d.ts +12 -1
- package/dist/esm/text-field/index.js +11 -2
- package/dist/esm/text-field/index.js.map +1 -1
- package/dist/esm/text-field/styles.js +139 -63
- package/dist/esm/text-field/styles.js.map +1 -1
- package/dist/esm/text-field/types.d.ts +3 -0
- package/dist/esm/text-field/types.js +3 -0
- package/dist/esm/text-field/types.js.map +1 -0
- package/dist/esm/theme-provider/design-tokens.d.ts +34 -3
- package/dist/esm/theme-provider/design-tokens.js +128 -15
- package/dist/esm/theme-provider/design-tokens.js.map +1 -1
- package/dist/esm/theme-provider/index.d.ts +17 -1
- package/dist/esm/theme-provider/index.js +18 -32
- package/dist/esm/theme-provider/index.js.map +1 -1
- package/dist/esm/theme-provider/styles.d.ts +1 -0
- package/dist/esm/theme-provider/styles.js +7 -0
- package/dist/esm/theme-provider/styles.js.map +1 -0
- package/dist/esm/theme-provider/template.d.ts +2 -0
- package/dist/esm/theme-provider/template.js +3 -0
- package/dist/esm/theme-provider/template.js.map +1 -0
- package/dist/esm/theme-provider/types.d.ts +7 -0
- package/dist/esm/theme-provider/types.js +8 -0
- package/dist/esm/theme-provider/types.js.map +1 -0
- package/dist/esm/tree-item/index.d.ts +34 -0
- package/dist/esm/tree-item/index.js +117 -0
- package/dist/esm/tree-item/index.js.map +1 -0
- package/dist/esm/tree-item/styles.d.ts +3 -0
- package/dist/esm/tree-item/styles.js +195 -0
- package/dist/esm/tree-item/styles.js.map +1 -0
- package/dist/esm/tree-view/index.d.ts +22 -0
- package/dist/esm/tree-view/index.js +35 -0
- package/dist/esm/tree-view/index.js.map +1 -0
- package/dist/esm/tree-view/styles.d.ts +1 -0
- package/dist/esm/tree-view/styles.js +17 -0
- package/dist/esm/tree-view/styles.js.map +1 -0
- package/dist/esm/tree-view/types.d.ts +7 -0
- package/dist/esm/tree-view/types.js +8 -0
- package/dist/esm/tree-view/types.js.map +1 -0
- package/dist/esm/utilities/style/focus.d.ts +11 -0
- package/dist/esm/utilities/style/focus.js +14 -0
- package/dist/esm/utilities/style/focus.js.map +1 -0
- package/dist/esm/utilities/style/prefers-reduced-motion.d.ts +8 -0
- package/dist/esm/utilities/style/prefers-reduced-motion.js +11 -0
- package/dist/esm/utilities/style/prefers-reduced-motion.js.map +1 -0
- package/package.json +41 -28
- package/dist/esm/button/tests/button.spec.d.ts +0 -1
- package/dist/esm/button/tests/button.spec.js +0 -39
- package/dist/esm/button/tests/button.spec.js.map +0 -1
- package/dist/esm/button/tests/button.stories.d.ts +0 -81
- package/dist/esm/button/tests/button.stories.js +0 -59
- package/dist/esm/button/tests/button.stories.js.map +0 -1
- package/dist/esm/number-field/tests/number-field.stories.d.ts +0 -33
- package/dist/esm/number-field/tests/number-field.stories.js +0 -26
- package/dist/esm/number-field/tests/number-field.stories.js.map +0 -1
- package/dist/esm/shared/icon-font.d.ts +0 -3
- package/dist/esm/shared/icon-font.js +0 -6
- package/dist/esm/shared/icon-font.js.map +0 -1
- package/dist/esm/stories/icons.stories.d.ts +0 -14
- package/dist/esm/stories/icons.stories.js +0 -52
- package/dist/esm/stories/icons.stories.js.map +0 -1
- package/dist/esm/tests/utilities/fixture.d.ts +0 -89
- package/dist/esm/tests/utilities/fixture.js +0 -90
- package/dist/esm/tests/utilities/fixture.js.map +0 -1
- package/dist/esm/tests/utilities/fixture.spec.d.ts +0 -1
- package/dist/esm/tests/utilities/fixture.spec.js +0 -73
- package/dist/esm/tests/utilities/fixture.spec.js.map +0 -1
- package/dist/esm/tests/utilities/setup.d.ts +0 -2
- package/dist/esm/tests/utilities/setup.js +0 -7
- package/dist/esm/tests/utilities/setup.js.map +0 -1
- package/dist/esm/text-field/tests/text-field.stories.d.ts +0 -42
- package/dist/esm/text-field/tests/text-field.stories.js +0 -30
- package/dist/esm/text-field/tests/text-field.stories.js.map +0 -1
- package/dist/esm/theme-provider/themes.d.ts +0 -5
- package/dist/esm/theme-provider/themes.js +0 -7
- package/dist/esm/theme-provider/themes.js.map +0 -1
|
@@ -1,66 +1,142 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
|
-
import {
|
|
2
|
+
import { display } from '@microsoft/fast-foundation';
|
|
3
|
+
import { borderColorRgb, borderColorHover, borderWidth, contentFontColor, contentFontColorDisabled, contentFontSize, controlHeight, failColor, fillColorSelectedRgb, fontFamily, iconSize, labelFontColor, labelFontFamily, labelFontSize, labelFontWeight, labelHeight, labelTextTransform, passwordRevealFilter, smallDelay } from '../theme-provider/design-tokens';
|
|
3
4
|
export const styles = css `
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
5
|
+
${display('inline-block')}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
font-family: ${fontFamily};
|
|
9
|
+
font-size: ${contentFontSize};
|
|
10
|
+
outline: none;
|
|
11
|
+
user-select: none;
|
|
12
|
+
color: ${contentFontColor};
|
|
13
|
+
height: calc(${labelHeight} + ${controlHeight});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([disabled]) {
|
|
17
|
+
color: ${contentFontColorDisabled};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.root {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: row;
|
|
25
|
+
border-radius: 0px;
|
|
26
|
+
font-family: ${fontFamily};
|
|
27
|
+
border-bottom: ${borderWidth} solid rgba(${borderColorRgb}, 0.3);
|
|
28
|
+
padding-bottom: 1px;
|
|
29
|
+
transition: border-bottom ${smallDelay}, padding-bottom ${smallDelay};
|
|
30
|
+
align-items: flex-end;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (prefers-reduced-motion) {
|
|
34
|
+
.root {
|
|
35
|
+
transition-duration: 0s;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.root:hover {
|
|
40
|
+
border-bottom: 2px solid ${borderColorHover};
|
|
41
|
+
padding-bottom: 0px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host(.invalid) .root {
|
|
45
|
+
border-bottom: ${borderWidth} solid ${failColor};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host(.invalid) .root:hover {
|
|
49
|
+
border-bottom: 2px solid ${failColor};
|
|
50
|
+
padding-bottom: 0px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([disabled]) .root,
|
|
54
|
+
:host([disabled]) .root:hover {
|
|
55
|
+
border-bottom: ${borderWidth} solid ${contentFontColorDisabled};
|
|
56
|
+
padding-bottom: 1px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([readonly]) .root,
|
|
60
|
+
:host([readonly]) .root:hover {
|
|
61
|
+
border: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.control {
|
|
65
|
+
-webkit-appearance: none;
|
|
66
|
+
font: inherit;
|
|
67
|
+
background: transparent;
|
|
68
|
+
color: inherit;
|
|
69
|
+
height: 28px;
|
|
70
|
+
width: 100%;
|
|
71
|
+
margin-top: auto;
|
|
72
|
+
margin-bottom: auto;
|
|
73
|
+
border: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.control::-ms-reveal {
|
|
77
|
+
filter: ${passwordRevealFilter};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.control:hover,
|
|
81
|
+
.control:focus,
|
|
82
|
+
.control:disabled,
|
|
83
|
+
.control:active {
|
|
84
|
+
outline: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.control::selection {
|
|
88
|
+
color: ${labelFontColor};
|
|
89
|
+
background: rgba(${fillColorSelectedRgb}, 0.3);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.control::placeholder {
|
|
93
|
+
color: ${labelFontColor};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.control:not([readonly]):focus-within::placeholder {
|
|
97
|
+
opacity: 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.control[readonly] {
|
|
101
|
+
cursor: default;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.control[disabled]::placeholder {
|
|
105
|
+
color: ${contentFontColorDisabled};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.label {
|
|
109
|
+
display: flex;
|
|
110
|
+
color: ${labelFontColor};
|
|
111
|
+
font-family: ${labelFontFamily};
|
|
112
|
+
font-size: ${labelFontSize};
|
|
113
|
+
font-weight: ${labelFontWeight};
|
|
114
|
+
line-height: ${labelHeight};
|
|
115
|
+
text-transform: ${labelTextTransform};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host [part='end'] {
|
|
119
|
+
display: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host(.invalid) [part='end'] {
|
|
123
|
+
align-self: center;
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
padding-left: 8px;
|
|
126
|
+
padding-right: 8px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host(.invalid) [part='end'] svg {
|
|
130
|
+
height: ${iconSize};
|
|
131
|
+
width: ${iconSize};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:host(.invalid) [part='end'] path {
|
|
135
|
+
fill: ${failColor};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([disabled]) [part='end'] path {
|
|
139
|
+
fill: ${contentFontColorDisabled};
|
|
140
|
+
}
|
|
141
|
+
`;
|
|
66
142
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/text-field/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/text-field/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACb,MAAM,iCAAiC,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,cAAc,CAAC;;;uBAGN,UAAU;qBACZ,eAAe;;;iBAGnB,gBAAgB;uBACV,WAAW,MAAM,aAAa;;;;iBAIpC,wBAAwB;;;;;;;;;uBASlB,UAAU;yBACR,WAAW,eAAe,cAAc;;oCAE7B,UAAU,oBAAoB,UAAU;;;;;;;;;;;mCAWzC,gBAAgB;;;;;yBAK1B,WAAW,UAAU,SAAS;;;;mCAIpB,SAAS;;;;;;yBAMnB,WAAW,UAAU,wBAAwB;;;;;;;;;;;;;;;;;;;;;;kBAsBpD,oBAAoB;;;;;;;;;;;iBAWrB,cAAc;2BACJ,oBAAoB;;;;iBAI9B,cAAc;;;;;;;;;;;;iBAYd,wBAAwB;;;;;iBAKxB,cAAc;uBACR,eAAe;qBACjB,aAAa;uBACX,eAAe;uBACf,WAAW;0BACR,kBAAkB;;;;;;;;;;;;;;;kBAe1B,QAAQ;iBACT,QAAQ;;;;gBAIT,SAAS;;;;gBAIT,wBAAwB;;CAEvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/text-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,17 +1,48 @@
|
|
|
1
1
|
import { DesignToken } from '@microsoft/fast-foundation';
|
|
2
|
-
import { NimbleTheme } from './
|
|
2
|
+
import { NimbleTheme } from './types';
|
|
3
3
|
export declare const theme: DesignToken<NimbleTheme>;
|
|
4
|
+
export declare const actionColorRgb: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
4
5
|
export declare const applicationBackgroundColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
5
6
|
export declare const fillColorSelected: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
6
7
|
export declare const fillColorSelectedRgb: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
8
|
+
export declare const fillColorSelectedHover: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
9
|
+
export declare const fillColorHover: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
7
10
|
export declare const borderColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
8
11
|
export declare const borderColorRgb: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
12
|
+
export declare const failColorTheme: (element: HTMLElement) => string;
|
|
13
|
+
export declare const failColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
14
|
+
export declare const warningColorTheme: (element: HTMLElement) => string;
|
|
15
|
+
export declare const warningColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
16
|
+
export declare const passColorTheme: (element: HTMLElement) => string;
|
|
17
|
+
export declare const passColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
9
18
|
export declare const borderColorHover: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
19
|
+
export declare const popupBoxShadowColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
20
|
+
export declare const popupBorderColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
10
21
|
export declare const controlHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
11
22
|
export declare const standardPadding: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
23
|
+
export declare const labelHeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
24
|
+
export declare const borderWidth: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
25
|
+
export declare const iconSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
26
|
+
export declare const drawerWidth: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
12
27
|
export declare const fontFamily: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
13
28
|
export declare const labelFontFamily: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
29
|
+
export declare const groupLabelFontFamily: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
30
|
+
export declare const drawerHeaderFontFamily: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
14
31
|
export declare const labelFontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
15
32
|
export declare const contentFontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
33
|
+
export declare const groupLabelFontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
34
|
+
export declare const drawerHeaderFontSize: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
35
|
+
export declare const groupLabelFontWeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
36
|
+
export declare const labelFontWeight: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
37
|
+
export declare const labelFontColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
38
|
+
export declare const groupLabelFontColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
39
|
+
export declare const contentFontColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
40
|
+
export declare const buttonContentFontColor: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
41
|
+
export declare const labelFontColorDisabled: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
42
|
+
export declare const labelTextTransform: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
43
|
+
export declare const groupLabelTextTransform: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
44
|
+
export declare const contentFontColorDisabled: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
45
|
+
export declare const smallDelay: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
46
|
+
export declare const mediumDelay: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
47
|
+
export declare const drawerAnimationDurationMs: import("@microsoft/fast-foundation").CSSDesignToken<number>;
|
|
48
|
+
export declare const passwordRevealFilter: import("@microsoft/fast-foundation").CSSDesignToken<string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DesignToken } from '@microsoft/fast-foundation';
|
|
2
2
|
import hexRgb from 'hex-rgb';
|
|
3
|
-
import { Black91, Black85, Black15, White, Enterprise, Selection100, BodyFamily,
|
|
4
|
-
import { NimbleTheme } from './
|
|
3
|
+
import { Black91, Black88, Black85, Black15, Black75, White, Enterprise, Selection100, SlLegacyBlue, Fail100LightUi, SmallDelay, MediumDelay, Fail100DarkUi, BodyFamily, BodySize, ControlLabel1Family, ControlLabel1Size, ControlLabel1Weight, Warning100LightUi, Warning100DarkUi, Pass100LightUi, Pass100DarkUi, Title2Size, Title2Family, GroupLabel1Family, GroupLabel1Size, GroupLabel1Weight, LegacyContentFamily } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
|
|
4
|
+
import { NimbleTheme } from './types';
|
|
5
5
|
function rgbString(hexValue) {
|
|
6
6
|
const { red, green, blue } = hexRgb(hexValue);
|
|
7
7
|
return `${red}, ${green}, ${blue}`;
|
|
@@ -11,8 +11,11 @@ function hexToRgba(hexValue, alpha) {
|
|
|
11
11
|
return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
|
|
12
12
|
}
|
|
13
13
|
const { create } = DesignToken;
|
|
14
|
-
export const theme = create({
|
|
15
|
-
|
|
14
|
+
export const theme = create({
|
|
15
|
+
name: 'theme',
|
|
16
|
+
cssCustomPropertyName: null
|
|
17
|
+
}).withDefault(NimbleTheme.Light);
|
|
18
|
+
function getColorForTheme(element, lightThemeColor, darkThemeColor, colorThemeColor, legacyBlueThemeColor) {
|
|
16
19
|
switch (theme.getValueFor(element)) {
|
|
17
20
|
case NimbleTheme.Light:
|
|
18
21
|
return lightThemeColor;
|
|
@@ -20,6 +23,8 @@ function getColorForTheme(element, lightThemeColor, darkThemeColor, colorThemeCo
|
|
|
20
23
|
return darkThemeColor;
|
|
21
24
|
case NimbleTheme.Color:
|
|
22
25
|
return colorThemeColor;
|
|
26
|
+
case NimbleTheme.LegacyBlue:
|
|
27
|
+
return legacyBlueThemeColor;
|
|
23
28
|
default:
|
|
24
29
|
return lightThemeColor;
|
|
25
30
|
}
|
|
@@ -32,28 +37,136 @@ function getDefaultLineColorForTheme(element) {
|
|
|
32
37
|
return Black15;
|
|
33
38
|
case NimbleTheme.Color:
|
|
34
39
|
return White;
|
|
40
|
+
case NimbleTheme.LegacyBlue:
|
|
41
|
+
return Black91;
|
|
35
42
|
default:
|
|
36
43
|
return Black91;
|
|
37
44
|
}
|
|
38
45
|
}
|
|
46
|
+
function getDefaultFontColorForTheme(element) {
|
|
47
|
+
switch (theme.getValueFor(element)) {
|
|
48
|
+
case NimbleTheme.Light:
|
|
49
|
+
return Black91;
|
|
50
|
+
case NimbleTheme.Dark:
|
|
51
|
+
return Black15;
|
|
52
|
+
case NimbleTheme.Color:
|
|
53
|
+
return White;
|
|
54
|
+
case NimbleTheme.LegacyBlue:
|
|
55
|
+
return Black75;
|
|
56
|
+
default:
|
|
57
|
+
return Black91;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function getFontForTheme(element) {
|
|
61
|
+
switch (theme.getValueFor(element)) {
|
|
62
|
+
case NimbleTheme.LegacyBlue:
|
|
63
|
+
return `${LegacyContentFamily}`;
|
|
64
|
+
default:
|
|
65
|
+
return `${BodyFamily}`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function getLabelFontForTheme(element) {
|
|
69
|
+
switch (theme.getValueFor(element)) {
|
|
70
|
+
case NimbleTheme.LegacyBlue:
|
|
71
|
+
return `${LegacyContentFamily}`;
|
|
72
|
+
default:
|
|
73
|
+
return `${ControlLabel1Family}, ${BodyFamily}`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function getGroupLabelFontForTheme(element) {
|
|
77
|
+
switch (theme.getValueFor(element)) {
|
|
78
|
+
case NimbleTheme.LegacyBlue:
|
|
79
|
+
return `${LegacyContentFamily}`;
|
|
80
|
+
default:
|
|
81
|
+
return `${GroupLabel1Family}, ${BodyFamily}`;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function getGroupLabelTextTransform(element) {
|
|
85
|
+
switch (theme.getValueFor(element)) {
|
|
86
|
+
case NimbleTheme.LegacyBlue:
|
|
87
|
+
return 'none';
|
|
88
|
+
default:
|
|
89
|
+
return 'uppercase';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function getLabelTextTransform(element) {
|
|
93
|
+
switch (theme.getValueFor(element)) {
|
|
94
|
+
case NimbleTheme.LegacyBlue:
|
|
95
|
+
return 'none';
|
|
96
|
+
default:
|
|
97
|
+
return 'none';
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function getLabelTextSize(element) {
|
|
101
|
+
switch (theme.getValueFor(element)) {
|
|
102
|
+
case NimbleTheme.LegacyBlue:
|
|
103
|
+
return '13px';
|
|
104
|
+
default:
|
|
105
|
+
return ControlLabel1Size;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function getPasswordRevealFilter(element) {
|
|
109
|
+
switch (theme.getValueFor(element)) {
|
|
110
|
+
case NimbleTheme.Color:
|
|
111
|
+
case NimbleTheme.Dark:
|
|
112
|
+
return 'invert(100%)';
|
|
113
|
+
default:
|
|
114
|
+
return 'invert(0%)';
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const fillColorSelectedTheme = (element) => getColorForTheme(element, Selection100, Selection100, White, SlLegacyBlue);
|
|
118
|
+
const fillColorHoverTheme = (element) => getColorForTheme(element, Black91, Black15, White, SlLegacyBlue);
|
|
39
119
|
// Color Tokens
|
|
40
|
-
export const
|
|
41
|
-
const
|
|
120
|
+
export const actionColorRgb = create('action-color-rgb').withDefault((element) => rgbString(getColorForTheme(element, Black91, Black15, White, SlLegacyBlue)));
|
|
121
|
+
export const applicationBackgroundColor = create('application-background-color').withDefault((element) => getColorForTheme(element, White, Black85, Enterprise, White));
|
|
42
122
|
export const fillColorSelected = create('fill-color-selected').withDefault((element) => hexToRgba(fillColorSelectedTheme(element), 0.3));
|
|
43
123
|
export const fillColorSelectedRgb = create('fill-color-selected-rgb').withDefault((element) => rgbString(fillColorSelectedTheme(element)));
|
|
44
|
-
export const
|
|
45
|
-
export const
|
|
46
|
-
export const
|
|
124
|
+
export const fillColorSelectedHover = create('fill-color-selected-hover').withDefault((element) => hexToRgba(fillColorSelectedTheme(element), 0.15));
|
|
125
|
+
export const fillColorHover = create('fill-color-hover').withDefault((element) => hexToRgba(fillColorHoverTheme(element), 0.1));
|
|
126
|
+
export const borderColor = create('border-color').withDefault((element) => getDefaultLineColorForTheme(element));
|
|
127
|
+
export const borderColorRgb = create('border-color-rgb').withDefault((element) => rgbString(getDefaultLineColorForTheme(element)));
|
|
128
|
+
export const failColorTheme = (element) => getColorForTheme(element, Fail100LightUi, Fail100DarkUi, Fail100DarkUi, Fail100LightUi);
|
|
129
|
+
export const failColor = create('fail-color').withDefault((element) => failColorTheme(element));
|
|
130
|
+
export const warningColorTheme = (element) => getColorForTheme(element, Warning100LightUi, Warning100DarkUi, Warning100DarkUi, Warning100LightUi);
|
|
131
|
+
export const warningColor = create('warning-color').withDefault((element) => warningColorTheme(element));
|
|
132
|
+
export const passColorTheme = (element) => getColorForTheme(element, Pass100LightUi, Pass100DarkUi, Pass100DarkUi, Pass100LightUi);
|
|
133
|
+
export const passColor = create('pass-color').withDefault((element) => passColorTheme(element));
|
|
134
|
+
export const borderColorHover = create('border-color-hover').withDefault((element) => getColorForTheme(element, Selection100, Selection100, White, hexToRgba(SlLegacyBlue, 0.9)));
|
|
135
|
+
export const popupBoxShadowColor = create('popup-box-shadow-color').withDefault((element) => hexToRgba(getColorForTheme(element, Black75, Black85, Black85, Black75), 0.3));
|
|
136
|
+
export const popupBorderColor = create('popup-border-color').withDefault((element) => hexToRgba(getColorForTheme(element, Black91, Black15, White, Black91), 0.3));
|
|
47
137
|
// Component Sizing Tokens
|
|
48
138
|
export const controlHeight = create('control-height').withDefault('32px');
|
|
49
139
|
export const standardPadding = create('standard-padding').withDefault('16px');
|
|
140
|
+
export const labelHeight = create('label-height').withDefault('16px');
|
|
141
|
+
export const borderWidth = create('border-width').withDefault('1px');
|
|
142
|
+
export const iconSize = create('icon-size').withDefault('16px');
|
|
143
|
+
export const drawerWidth = create('drawer-width').withDefault('784px');
|
|
50
144
|
// Font Family Tokens
|
|
51
|
-
export const fontFamily = create('font-family').withDefault(
|
|
52
|
-
export const labelFontFamily = create('label-font-family').withDefault(
|
|
145
|
+
export const fontFamily = create('font-family').withDefault((element) => getFontForTheme(element));
|
|
146
|
+
export const labelFontFamily = create('label-font-family').withDefault((element) => getLabelFontForTheme(element));
|
|
147
|
+
export const groupLabelFontFamily = create('group-label-font-family').withDefault((element) => getGroupLabelFontForTheme(element));
|
|
148
|
+
export const drawerHeaderFontFamily = create('drawer-header-font-family').withDefault(Title2Family);
|
|
53
149
|
// Font Sizing Tokens
|
|
54
|
-
export const labelFontSize = create('label-font-size').withDefault(
|
|
55
|
-
export const contentFontSize = create('content-font-size').withDefault(
|
|
150
|
+
export const labelFontSize = create('label-font-size').withDefault((element) => getLabelTextSize(element));
|
|
151
|
+
export const contentFontSize = create('content-font-size').withDefault(BodySize);
|
|
152
|
+
export const groupLabelFontSize = create('group-label-font-size').withDefault(GroupLabel1Size);
|
|
153
|
+
export const drawerHeaderFontSize = create('drawer-header-font-size').withDefault(Title2Size);
|
|
154
|
+
// Font Weight Tokens
|
|
155
|
+
export const groupLabelFontWeight = create('group-label-font-weight').withDefault(GroupLabel1Weight);
|
|
156
|
+
export const labelFontWeight = create('label-font-weight').withDefault(ControlLabel1Weight);
|
|
56
157
|
// Font Color Tokens
|
|
57
|
-
export const
|
|
58
|
-
export const
|
|
158
|
+
export const labelFontColor = create('label-font-color').withDefault((element) => hexToRgba(getDefaultFontColorForTheme(element), 0.6));
|
|
159
|
+
export const groupLabelFontColor = create('group-label-font-color').withDefault((element) => getDefaultFontColorForTheme(element));
|
|
160
|
+
export const contentFontColor = create('content-font-color').withDefault((element) => getColorForTheme(element, Black91, Black15, White, Black88));
|
|
161
|
+
export const buttonContentFontColor = create('button-content-font-color').withDefault((element) => getColorForTheme(element, Black91, Black15, White, SlLegacyBlue));
|
|
162
|
+
export const labelFontColorDisabled = create('label-font-color-disabled').withDefault((element) => hexToRgba(getDefaultLineColorForTheme(element), 0.3));
|
|
163
|
+
export const labelTextTransform = create('label-text-transform').withDefault((element) => getLabelTextTransform(element));
|
|
164
|
+
export const groupLabelTextTransform = create('group-label-text-transform').withDefault((element) => getGroupLabelTextTransform(element));
|
|
165
|
+
export const contentFontColorDisabled = create('content-font-color-disabled').withDefault((element) => hexToRgba(getColorForTheme(element, Black91, Black15, White, Black88), 0.3));
|
|
166
|
+
// Animation Tokens
|
|
167
|
+
export const smallDelay = create('small-delay').withDefault(SmallDelay);
|
|
168
|
+
export const mediumDelay = create('medium-delay').withDefault(MediumDelay);
|
|
169
|
+
export const drawerAnimationDurationMs = create('drawer-animation-duration-ms').withDefault(250);
|
|
170
|
+
// Filter Tokens
|
|
171
|
+
export const passwordRevealFilter = create('password-reveal-filter').withDefault((element) => getPasswordRevealFilter(element));
|
|
59
172
|
//# sourceMappingURL=design-tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-tokens.js","sourceRoot":"","sources":["../../../src/theme-provider/design-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EACH,OAAO,EACP,OAAO,EACP,OAAO,EACP,KAAK,EACL,UAAU,EACV,YAAY,EACZ,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"design-tokens.js","sourceRoot":"","sources":["../../../src/theme-provider/design-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EACH,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,KAAK,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACtB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,SAAS,SAAS,CAAC,QAAgB;IAC/B,MAAM,EAAE,GAAG,EAAE,KAAK,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UAAU,GAAG,MAAM,CAAS,aAAa,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAS,cAAc,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AACnF,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAC3C,8BAA8B,CACjC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAEnB,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CACtC,wBAAwB,CAC3B,CAAC,WAAW,CAAC,CAAC,OAAoB,EAAE,EAAE,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
|
+
import type { NimbleTheme } from './types';
|
|
3
|
+
export type { NimbleThemeProvider };
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'nimble-theme-provider': NimbleThemeProvider;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The NimbleThemeProvider implementation. Add this component to the page and set its `theme` attribute to control
|
|
11
|
+
* the values of design tokens that provide colors and fonts as CSS custom properties to any descendant components.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
declare class NimbleThemeProvider extends FoundationElement {
|
|
15
|
+
theme: NimbleTheme;
|
|
16
|
+
themeChanged(_prev: NimbleTheme | undefined, next: NimbleTheme | undefined): void;
|
|
17
|
+
}
|
|
@@ -1,49 +1,35 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';
|
|
3
|
-
import { attr
|
|
3
|
+
import { attr } from '@microsoft/fast-element';
|
|
4
|
+
import { template } from './template';
|
|
5
|
+
import { styles } from './styles';
|
|
4
6
|
import { theme } from './design-tokens';
|
|
5
|
-
function designToken(token) {
|
|
6
|
-
return (source, key) => {
|
|
7
|
-
source[`${key}Changed`] = function keyChanged(_prev, next) {
|
|
8
|
-
if (next !== undefined && next !== null) {
|
|
9
|
-
token.setValueFor(this, next);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
token.deleteValueFor(this);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
7
|
/**
|
|
18
|
-
* The NimbleThemeProvider implementation
|
|
8
|
+
* The NimbleThemeProvider implementation. Add this component to the page and set its `theme` attribute to control
|
|
9
|
+
* the values of design tokens that provide colors and fonts as CSS custom properties to any descendant components.
|
|
19
10
|
* @internal
|
|
20
11
|
*/
|
|
21
12
|
class NimbleThemeProvider extends FoundationElement {
|
|
22
|
-
|
|
13
|
+
themeChanged(_prev, next) {
|
|
14
|
+
if (next !== undefined && next !== null) {
|
|
15
|
+
theme.setValueFor(this, next);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
theme.deleteValueFor(this);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
23
21
|
}
|
|
24
22
|
__decorate([
|
|
25
23
|
attr({
|
|
26
|
-
attribute: 'theme'
|
|
27
|
-
})
|
|
28
|
-
designToken(theme)
|
|
24
|
+
attribute: 'theme'
|
|
25
|
+
})
|
|
29
26
|
], NimbleThemeProvider.prototype, "theme", void 0);
|
|
30
|
-
const styles = css `
|
|
31
|
-
:host {
|
|
32
|
-
display: inline-block;
|
|
33
|
-
}`;
|
|
34
|
-
const template = html `
|
|
35
|
-
<slot></slot>
|
|
36
|
-
`;
|
|
37
|
-
/**
|
|
38
|
-
A function that returns a registration for configuring the component with a DesignSystem. *
|
|
39
|
-
* @public
|
|
40
|
-
* @remarks
|
|
41
|
-
* Generates HTML Element: \<nimble-theme-provider\>
|
|
42
|
-
*/
|
|
43
27
|
const nimbleDesignSystemProvider = NimbleThemeProvider.compose({
|
|
44
28
|
baseName: 'theme-provider',
|
|
45
29
|
styles,
|
|
46
30
|
template
|
|
47
31
|
});
|
|
48
|
-
DesignSystem.getOrCreate()
|
|
32
|
+
DesignSystem.getOrCreate()
|
|
33
|
+
.withPrefix('nimble')
|
|
34
|
+
.register(nimbleDesignSystemProvider());
|
|
49
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme-provider/index.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme-provider/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,YAAY,EAEZ,iBAAiB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAWxC;;;;GAIG;AACH,MAAM,mBAAoB,SAAQ,iBAAiB;IAMxC,YAAY,CACf,KAA8B,EAC9B,IAA6B;QAE7B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE;YACrC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,IAAqC,CAAC,CAAC;SAClE;aAAM;YACH,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;SAC9B;IACL,CAAC;CACJ;AAZG;IAHC,IAAI,CAAC;QACF,SAAS,EAAE,OAAO;KACrB,CAAC;kDACyB;AAc/B,MAAM,0BAA0B,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC3D,QAAQ,EAAE,gBAAgB;IAC1B,MAAM;IACN,QAAQ;CACX,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,0BAA0B,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/theme-provider/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAE9C,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;CAIxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/theme-provider/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAqB,eAAe,CAAC"}
|