@fluentui/react-migration-v8-v9 1.0.2 → 1.0.4
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.json +37 -1
- package/CHANGELOG.md +21 -2
- package/lib/components/Button/ActionButtonShim.js +18 -0
- package/lib/components/Button/ActionButtonShim.js.map +1 -0
- package/lib/components/Button/ButtonShim.js +25 -0
- package/lib/components/Button/ButtonShim.js.map +1 -0
- package/lib/components/Button/CommandButtonShim.js +5 -0
- package/lib/components/Button/CommandButtonShim.js.map +1 -0
- package/lib/components/Button/CompoundButtonShim.js +21 -0
- package/lib/components/Button/CompoundButtonShim.js.map +1 -0
- package/lib/components/Button/DefaultButtonShim.js +12 -0
- package/lib/components/Button/DefaultButtonShim.js.map +1 -0
- package/lib/components/Button/MenuButtonShim.js +23 -0
- package/lib/components/Button/MenuButtonShim.js.map +1 -0
- package/lib/components/Button/PrimaryButtonShim.js +13 -0
- package/lib/components/Button/PrimaryButtonShim.js.map +1 -0
- package/lib/components/Button/ToggleButtonShim.js +20 -0
- package/lib/components/Button/ToggleButtonShim.js.map +1 -0
- package/lib/components/Button/index.js +10 -0
- package/lib/components/Button/index.js.map +1 -0
- package/lib/components/Button/shimButtonProps.js +24 -0
- package/lib/components/Button/shimButtonProps.js.map +1 -0
- package/lib/components/Menu/MenuShim.js +49 -0
- package/lib/components/Menu/MenuShim.js.map +1 -0
- package/lib/components/Menu/index.js +3 -0
- package/lib/components/Menu/index.js.map +1 -0
- package/lib/components/Menu/shimMenuProps.js +33 -0
- package/lib/components/Menu/shimMenuProps.js.map +1 -0
- package/lib/components/Stack/StackItemShim.js +177 -0
- package/lib/components/Stack/StackItemShim.js.map +1 -0
- package/lib/components/Stack/StackShim.js +260 -0
- package/lib/components/Stack/StackShim.js.map +1 -0
- package/lib/components/Stack/index.js +3 -0
- package/lib/components/Stack/index.js.map +1 -0
- package/lib/components/Stack/stackUtils.js +168 -0
- package/lib/components/Stack/stackUtils.js.map +1 -0
- package/lib/components/Theme/index.js +5 -0
- package/lib/components/Theme/index.js.map +1 -0
- package/lib/components/Theme/themeDuplicates.js +859 -0
- package/lib/components/Theme/themeDuplicates.js.map +1 -0
- package/lib/components/Theme/v8ThemeShim.js +313 -0
- package/lib/components/Theme/v8ThemeShim.js.map +1 -0
- package/lib/components/Theme/v9BrandVariantsShim.js +77 -0
- package/lib/components/Theme/v9BrandVariantsShim.js.map +1 -0
- package/lib/components/Theme/v9ThemeShim.js +195 -0
- package/lib/components/Theme/v9ThemeShim.js.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/stories/DefaultButtonShim/index.js +51 -0
- package/lib/stories/DefaultButtonShim/index.js.map +1 -0
- package/lib-amd/components/Button/ActionButtonShim.js +14 -0
- package/lib-amd/components/Button/ActionButtonShim.js.map +1 -0
- package/lib-amd/components/Button/ButtonShim.js +17 -0
- package/lib-amd/components/Button/ButtonShim.js.map +1 -0
- package/lib-amd/components/Button/CommandButtonShim.js +7 -0
- package/lib-amd/components/Button/CommandButtonShim.js.map +1 -0
- package/lib-amd/components/Button/CompoundButtonShim.js +15 -0
- package/lib-amd/components/Button/CompoundButtonShim.js.map +1 -0
- package/lib-amd/components/Button/DefaultButtonShim.js +12 -0
- package/lib-amd/components/Button/DefaultButtonShim.js.map +1 -0
- package/lib-amd/components/Button/MenuButtonShim.js +20 -0
- package/lib-amd/components/Button/MenuButtonShim.js.map +1 -0
- package/lib-amd/components/Button/PrimaryButtonShim.js +12 -0
- package/lib-amd/components/Button/PrimaryButtonShim.js.map +1 -0
- package/lib-amd/components/Button/ToggleButtonShim.js +14 -0
- package/lib-amd/components/Button/ToggleButtonShim.js.map +1 -0
- package/lib-amd/components/Button/index.js +14 -0
- package/lib-amd/components/Button/index.js.map +1 -0
- package/lib-amd/components/Button/shimButtonProps.js +19 -0
- package/lib-amd/components/Button/shimButtonProps.js.map +1 -0
- package/lib-amd/components/Menu/MenuShim.js +42 -0
- package/lib-amd/components/Menu/MenuShim.js.map +1 -0
- package/lib-amd/components/Menu/index.js +7 -0
- package/lib-amd/components/Menu/index.js.map +1 -0
- package/lib-amd/components/Menu/shimMenuProps.js +30 -0
- package/lib-amd/components/Menu/shimMenuProps.js.map +1 -0
- package/lib-amd/components/Stack/StackItemShim.js +150 -0
- package/lib-amd/components/Stack/StackItemShim.js.map +1 -0
- package/lib-amd/components/Stack/StackShim.js +242 -0
- package/lib-amd/components/Stack/StackShim.js.map +1 -0
- package/lib-amd/components/Stack/index.js +7 -0
- package/lib-amd/components/Stack/index.js.map +1 -0
- package/lib-amd/components/Stack/stackUtils.js +168 -0
- package/lib-amd/components/Stack/stackUtils.js.map +1 -0
- package/lib-amd/components/Theme/index.js +9 -0
- package/lib-amd/components/Theme/index.js.map +1 -0
- package/lib-amd/components/Theme/themeDuplicates.js +864 -0
- package/lib-amd/components/Theme/themeDuplicates.js.map +1 -0
- package/lib-amd/components/Theme/v8ThemeShim.js +140 -0
- package/lib-amd/components/Theme/v8ThemeShim.js.map +1 -0
- package/lib-amd/components/Theme/v9BrandVariantsShim.js +75 -0
- package/lib-amd/components/Theme/v9BrandVariantsShim.js.map +1 -0
- package/lib-amd/components/Theme/v9ThemeShim.js +188 -0
- package/lib-amd/components/Theme/v9ThemeShim.js.map +1 -0
- package/lib-amd/index.js +38 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-amd/stories/DefaultButtonShim/index.js +44 -0
- package/lib-amd/stories/DefaultButtonShim/index.js.map +1 -0
- package/lib-commonjs/components/Button/ActionButtonShim.js +28 -0
- package/lib-commonjs/components/Button/ActionButtonShim.js.map +1 -0
- package/lib-commonjs/components/Button/ButtonShim.js +37 -0
- package/lib-commonjs/components/Button/ButtonShim.js.map +1 -0
- package/lib-commonjs/components/Button/CommandButtonShim.js +19 -0
- package/lib-commonjs/components/Button/CommandButtonShim.js.map +1 -0
- package/lib-commonjs/components/Button/CompoundButtonShim.js +31 -0
- package/lib-commonjs/components/Button/CompoundButtonShim.js.map +1 -0
- package/lib-commonjs/components/Button/DefaultButtonShim.js +21 -0
- package/lib-commonjs/components/Button/DefaultButtonShim.js.map +1 -0
- package/lib-commonjs/components/Button/MenuButtonShim.js +32 -0
- package/lib-commonjs/components/Button/MenuButtonShim.js.map +1 -0
- package/lib-commonjs/components/Button/PrimaryButtonShim.js +22 -0
- package/lib-commonjs/components/Button/PrimaryButtonShim.js.map +1 -0
- package/lib-commonjs/components/Button/ToggleButtonShim.js +30 -0
- package/lib-commonjs/components/Button/ToggleButtonShim.js.map +1 -0
- package/lib-commonjs/components/Button/index.js +26 -0
- package/lib-commonjs/components/Button/index.js.map +1 -0
- package/lib-commonjs/components/Button/shimButtonProps.js +35 -0
- package/lib-commonjs/components/Button/shimButtonProps.js.map +1 -0
- package/lib-commonjs/components/Menu/MenuShim.js +58 -0
- package/lib-commonjs/components/Menu/MenuShim.js.map +1 -0
- package/lib-commonjs/components/Menu/index.js +12 -0
- package/lib-commonjs/components/Menu/index.js.map +1 -0
- package/lib-commonjs/components/Menu/shimMenuProps.js +53 -0
- package/lib-commonjs/components/Menu/shimMenuProps.js.map +1 -0
- package/lib-commonjs/components/Stack/StackItemShim.js +188 -0
- package/lib-commonjs/components/Stack/StackItemShim.js.map +1 -0
- package/lib-commonjs/components/Stack/StackShim.js +273 -0
- package/lib-commonjs/components/Stack/StackShim.js.map +1 -0
- package/lib-commonjs/components/Stack/index.js +12 -0
- package/lib-commonjs/components/Stack/index.js.map +1 -0
- package/lib-commonjs/components/Stack/stackUtils.js +182 -0
- package/lib-commonjs/components/Stack/stackUtils.js.map +1 -0
- package/lib-commonjs/components/Theme/index.js +16 -0
- package/lib-commonjs/components/Theme/index.js.map +1 -0
- package/lib-commonjs/components/Theme/themeDuplicates.js +865 -0
- package/lib-commonjs/components/Theme/themeDuplicates.js.map +1 -0
- package/lib-commonjs/components/Theme/v8ThemeShim.js +324 -0
- package/lib-commonjs/components/Theme/v8ThemeShim.js.map +1 -0
- package/lib-commonjs/components/Theme/v9BrandVariantsShim.js +87 -0
- package/lib-commonjs/components/Theme/v9BrandVariantsShim.js.map +1 -0
- package/lib-commonjs/components/Theme/v9ThemeShim.js +206 -0
- package/lib-commonjs/components/Theme/v9ThemeShim.js.map +1 -0
- package/lib-commonjs/index.js +211 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/stories/DefaultButtonShim/index.js +64 -0
- package/lib-commonjs/stories/DefaultButtonShim/index.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { webLightTheme } from '@fluentui/react-components';
|
|
2
|
+
import { blackAlpha, whiteAlpha, grey } from './themeDuplicates';
|
|
3
|
+
/**
|
|
4
|
+
* Creates v9 color tokens from a v8 palette.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const mapAliasColors = (palette, inverted) => {
|
|
8
|
+
return {
|
|
9
|
+
colorNeutralForeground1: palette.neutralPrimary,
|
|
10
|
+
colorNeutralForeground1Hover: palette.neutralPrimary,
|
|
11
|
+
colorNeutralForeground1Pressed: palette.neutralPrimary,
|
|
12
|
+
colorNeutralForeground1Selected: palette.neutralPrimary,
|
|
13
|
+
colorNeutralForeground2: palette.neutralSecondary,
|
|
14
|
+
colorNeutralForeground2Hover: palette.neutralPrimary,
|
|
15
|
+
colorNeutralForeground2Pressed: palette.neutralPrimary,
|
|
16
|
+
colorNeutralForeground2Selected: palette.neutralPrimary,
|
|
17
|
+
colorNeutralForeground2BrandHover: palette.themePrimary,
|
|
18
|
+
colorNeutralForeground2BrandPressed: palette.themeDarkAlt,
|
|
19
|
+
colorNeutralForeground2BrandSelected: palette.themePrimary,
|
|
20
|
+
colorNeutralForeground3: palette.neutralTertiary,
|
|
21
|
+
colorNeutralForeground3Hover: palette.neutralSecondary,
|
|
22
|
+
colorNeutralForeground3Pressed: palette.neutralSecondary,
|
|
23
|
+
colorNeutralForeground3Selected: palette.neutralSecondary,
|
|
24
|
+
colorNeutralForeground3BrandHover: palette.themePrimary,
|
|
25
|
+
colorNeutralForeground3BrandPressed: palette.themeDarkAlt,
|
|
26
|
+
colorNeutralForeground3BrandSelected: palette.themePrimary,
|
|
27
|
+
colorNeutralForeground4: palette.neutralQuaternary,
|
|
28
|
+
colorNeutralForegroundDisabled: palette.neutralTertiaryAlt,
|
|
29
|
+
colorNeutralForegroundInvertedDisabled: whiteAlpha[40],
|
|
30
|
+
colorBrandForegroundLink: palette.themeDarkAlt,
|
|
31
|
+
colorBrandForegroundLinkHover: palette.themeDark,
|
|
32
|
+
colorBrandForegroundLinkPressed: palette.themeDarker,
|
|
33
|
+
colorBrandForegroundLinkSelected: palette.themeDarkAlt,
|
|
34
|
+
colorNeutralForeground2Link: palette.neutralSecondary,
|
|
35
|
+
colorNeutralForeground2LinkHover: palette.neutralPrimary,
|
|
36
|
+
colorNeutralForeground2LinkPressed: palette.neutralPrimary,
|
|
37
|
+
colorNeutralForeground2LinkSelected: palette.neutralPrimary,
|
|
38
|
+
colorCompoundBrandForeground1: palette.themePrimary,
|
|
39
|
+
colorCompoundBrandForeground1Hover: palette.themeDarkAlt,
|
|
40
|
+
colorCompoundBrandForeground1Pressed: palette.themeDark,
|
|
41
|
+
colorBrandForeground1: palette.themePrimary,
|
|
42
|
+
colorBrandForeground2: palette.themeDarkAlt,
|
|
43
|
+
colorNeutralForeground1Static: palette.neutralPrimary,
|
|
44
|
+
colorNeutralForegroundInverted: palette.white,
|
|
45
|
+
colorNeutralForegroundInvertedHover: palette.white,
|
|
46
|
+
colorNeutralForegroundInvertedPressed: palette.white,
|
|
47
|
+
colorNeutralForegroundInvertedSelected: palette.white,
|
|
48
|
+
colorNeutralForegroundOnBrand: palette.white,
|
|
49
|
+
colorNeutralForegroundStaticInverted: palette.white,
|
|
50
|
+
colorNeutralForegroundInvertedLink: palette.white,
|
|
51
|
+
colorNeutralForegroundInvertedLinkHover: palette.white,
|
|
52
|
+
colorNeutralForegroundInvertedLinkPressed: palette.white,
|
|
53
|
+
colorNeutralForegroundInvertedLinkSelected: palette.white,
|
|
54
|
+
colorNeutralForegroundInverted2: palette.white,
|
|
55
|
+
colorBrandForegroundInverted: palette.themeSecondary,
|
|
56
|
+
colorBrandForegroundInvertedHover: palette.themeTertiary,
|
|
57
|
+
colorBrandForegroundInvertedPressed: palette.themeSecondary,
|
|
58
|
+
colorBrandForegroundOnLight: palette.themePrimary,
|
|
59
|
+
colorBrandForegroundOnLightHover: palette.themeDarkAlt,
|
|
60
|
+
colorBrandForegroundOnLightPressed: palette.themeDark,
|
|
61
|
+
colorBrandForegroundOnLightSelected: palette.themeDark,
|
|
62
|
+
colorNeutralBackground1: palette.white,
|
|
63
|
+
colorNeutralBackground1Hover: palette.neutralLighter,
|
|
64
|
+
colorNeutralBackground1Pressed: palette.neutralQuaternaryAlt,
|
|
65
|
+
colorNeutralBackground1Selected: palette.neutralLight,
|
|
66
|
+
colorNeutralBackground2: palette.neutralLighterAlt,
|
|
67
|
+
colorNeutralBackground2Hover: palette.neutralLighter,
|
|
68
|
+
colorNeutralBackground2Pressed: palette.neutralQuaternaryAlt,
|
|
69
|
+
colorNeutralBackground2Selected: palette.neutralLight,
|
|
70
|
+
colorNeutralBackground3: palette.neutralLighter,
|
|
71
|
+
colorNeutralBackground3Hover: palette.neutralLight,
|
|
72
|
+
colorNeutralBackground3Pressed: palette.neutralQuaternary,
|
|
73
|
+
colorNeutralBackground3Selected: palette.neutralQuaternaryAlt,
|
|
74
|
+
colorNeutralBackground4: palette.neutralLighter,
|
|
75
|
+
colorNeutralBackground4Hover: palette.neutralLighterAlt,
|
|
76
|
+
colorNeutralBackground4Pressed: palette.neutralLighter,
|
|
77
|
+
colorNeutralBackground4Selected: palette.white,
|
|
78
|
+
colorNeutralBackground5: palette.neutralLight,
|
|
79
|
+
colorNeutralBackground5Hover: palette.neutralLighter,
|
|
80
|
+
colorNeutralBackground5Pressed: palette.neutralLighter,
|
|
81
|
+
colorNeutralBackground5Selected: palette.neutralLighterAlt,
|
|
82
|
+
colorNeutralBackground6: palette.neutralLight,
|
|
83
|
+
colorNeutralBackgroundStatic: grey[20],
|
|
84
|
+
colorNeutralBackgroundInverted: palette.neutralSecondary,
|
|
85
|
+
colorSubtleBackground: 'transparent',
|
|
86
|
+
colorSubtleBackgroundHover: palette.neutralLighter,
|
|
87
|
+
colorSubtleBackgroundPressed: palette.neutralQuaternaryAlt,
|
|
88
|
+
colorSubtleBackgroundSelected: palette.neutralLight,
|
|
89
|
+
colorSubtleBackgroundLightAlphaHover: inverted ? whiteAlpha[10] : whiteAlpha[80],
|
|
90
|
+
colorSubtleBackgroundLightAlphaPressed: inverted ? whiteAlpha[5] : whiteAlpha[50],
|
|
91
|
+
colorSubtleBackgroundLightAlphaSelected: 'transparent',
|
|
92
|
+
colorSubtleBackgroundInverted: 'transparent',
|
|
93
|
+
colorSubtleBackgroundInvertedHover: blackAlpha[10],
|
|
94
|
+
colorSubtleBackgroundInvertedPressed: blackAlpha[30],
|
|
95
|
+
colorSubtleBackgroundInvertedSelected: blackAlpha[20],
|
|
96
|
+
colorTransparentBackground: 'transparent',
|
|
97
|
+
colorTransparentBackgroundHover: 'transparent',
|
|
98
|
+
colorTransparentBackgroundPressed: 'transparent',
|
|
99
|
+
colorTransparentBackgroundSelected: 'transparent',
|
|
100
|
+
colorNeutralBackgroundDisabled: palette.neutralLighter,
|
|
101
|
+
colorNeutralBackgroundInvertedDisabled: whiteAlpha[10],
|
|
102
|
+
colorNeutralStencil1: palette.neutralLight,
|
|
103
|
+
colorNeutralStencil2: palette.neutralLighterAlt,
|
|
104
|
+
colorBackgroundOverlay: blackAlpha[10],
|
|
105
|
+
colorScrollbarOverlay: blackAlpha[50],
|
|
106
|
+
colorBrandBackground: palette.themePrimary,
|
|
107
|
+
colorBrandBackgroundHover: palette.themeDarkAlt,
|
|
108
|
+
colorBrandBackgroundPressed: palette.themeDarker,
|
|
109
|
+
colorBrandBackgroundSelected: palette.themeDark,
|
|
110
|
+
colorCompoundBrandBackground: palette.themePrimary,
|
|
111
|
+
colorCompoundBrandBackgroundHover: palette.themeDarkAlt,
|
|
112
|
+
colorCompoundBrandBackgroundPressed: palette.themeDark,
|
|
113
|
+
colorBrandBackgroundStatic: palette.themePrimary,
|
|
114
|
+
colorBrandBackground2: palette.themeLighterAlt,
|
|
115
|
+
colorBrandBackgroundInverted: palette.white,
|
|
116
|
+
colorBrandBackgroundInvertedHover: palette.themeLighterAlt,
|
|
117
|
+
colorBrandBackgroundInvertedPressed: palette.themeLight,
|
|
118
|
+
colorBrandBackgroundInvertedSelected: palette.themeLighter,
|
|
119
|
+
colorNeutralStrokeAccessible: palette.neutralSecondary,
|
|
120
|
+
colorNeutralStrokeAccessibleHover: palette.neutralSecondary,
|
|
121
|
+
colorNeutralStrokeAccessiblePressed: palette.neutralSecondary,
|
|
122
|
+
colorNeutralStrokeAccessibleSelected: palette.themePrimary,
|
|
123
|
+
colorNeutralStroke1: palette.neutralQuaternary,
|
|
124
|
+
colorNeutralStroke1Hover: palette.neutralTertiaryAlt,
|
|
125
|
+
colorNeutralStroke1Pressed: palette.neutralTertiaryAlt,
|
|
126
|
+
colorNeutralStroke1Selected: palette.neutralTertiaryAlt,
|
|
127
|
+
colorNeutralStroke2: palette.neutralQuaternaryAlt,
|
|
128
|
+
colorNeutralStroke3: palette.neutralLighter,
|
|
129
|
+
colorNeutralStrokeOnBrand: palette.white,
|
|
130
|
+
colorNeutralStrokeOnBrand2: palette.white,
|
|
131
|
+
colorNeutralStrokeOnBrand2Hover: palette.white,
|
|
132
|
+
colorNeutralStrokeOnBrand2Pressed: palette.white,
|
|
133
|
+
colorNeutralStrokeOnBrand2Selected: palette.white,
|
|
134
|
+
colorBrandStroke1: palette.themePrimary,
|
|
135
|
+
colorBrandStroke2: palette.themeLight,
|
|
136
|
+
colorCompoundBrandStroke: palette.themePrimary,
|
|
137
|
+
colorCompoundBrandStrokeHover: palette.themeDarkAlt,
|
|
138
|
+
colorCompoundBrandStrokePressed: palette.themeDark,
|
|
139
|
+
colorNeutralStrokeDisabled: palette.neutralQuaternaryAlt,
|
|
140
|
+
colorNeutralStrokeInvertedDisabled: whiteAlpha[40],
|
|
141
|
+
colorTransparentStroke: 'transparent',
|
|
142
|
+
colorTransparentStrokeInteractive: 'transparent',
|
|
143
|
+
colorTransparentStrokeDisabled: 'transparent',
|
|
144
|
+
colorStrokeFocus1: palette.white,
|
|
145
|
+
colorStrokeFocus2: palette.black,
|
|
146
|
+
colorNeutralShadowAmbient: 'rgba(0,0,0,0.12)',
|
|
147
|
+
colorNeutralShadowKey: 'rgba(0,0,0,0.14)',
|
|
148
|
+
colorNeutralShadowAmbientLighter: 'rgba(0,0,0,0.06)',
|
|
149
|
+
colorNeutralShadowKeyLighter: 'rgba(0,0,0,0.07)',
|
|
150
|
+
colorNeutralShadowAmbientDarker: 'rgba(0,0,0,0.20)',
|
|
151
|
+
colorNeutralShadowKeyDarker: 'rgba(0,0,0,0.24)',
|
|
152
|
+
colorBrandShadowAmbient: 'rgba(0,0,0,0.30)',
|
|
153
|
+
colorBrandShadowKey: 'rgba(0,0,0,0.25)'
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Creates v9 shadow tokens from v8 effects.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
const mapShadowTokens = effects => {
|
|
162
|
+
return {
|
|
163
|
+
shadow4: effects.elevation4,
|
|
164
|
+
shadow8: effects.elevation8,
|
|
165
|
+
shadow16: effects.elevation16,
|
|
166
|
+
shadow64: effects.elevation64
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Creates v9 border radius tokens from v8 effects
|
|
171
|
+
*/
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
const mapBorderRadiusTokens = effects => {
|
|
175
|
+
return {
|
|
176
|
+
borderRadiusSmall: effects.roundedCorner2,
|
|
177
|
+
borderRadiusMedium: effects.roundedCorner4,
|
|
178
|
+
borderRadiusLarge: effects.roundedCorner6
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Creates a v9 theme from a v8 theme.
|
|
183
|
+
* You can optional pass a base v9 theme; otherwise webLightTheme is used.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
export const createV9Theme = (themeV8, baseThemeV9) => {
|
|
188
|
+
const baseTheme = baseThemeV9 !== null && baseThemeV9 !== void 0 ? baseThemeV9 : webLightTheme;
|
|
189
|
+
return { ...baseTheme,
|
|
190
|
+
...mapAliasColors(themeV8.palette, themeV8.isInverted),
|
|
191
|
+
...mapShadowTokens(themeV8.effects),
|
|
192
|
+
...mapBorderRadiusTokens(themeV8.effects)
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=v9ThemeShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Theme/v9ThemeShim.ts"],"names":[],"mappings":"AAEA,SAA2B,aAA3B,QAAgD,4BAAhD;AAEA,SAAS,UAAT,EAAqB,UAArB,EAAiC,IAAjC,QAA6C,mBAA7C;AAEA;;AAEG;;AACH,MAAM,cAAc,GAAG,CAAC,OAAD,EAAoB,QAApB,KAAsD;EAC3E,OAAO;IACL,uBAAuB,EAAE,OAAO,CAAC,cAD5B;IAEL,4BAA4B,EAAE,OAAO,CAAC,cAFjC;IAGL,8BAA8B,EAAE,OAAO,CAAC,cAHnC;IAIL,+BAA+B,EAAE,OAAO,CAAC,cAJpC;IAKL,uBAAuB,EAAE,OAAO,CAAC,gBAL5B;IAML,4BAA4B,EAAE,OAAO,CAAC,cANjC;IAOL,8BAA8B,EAAE,OAAO,CAAC,cAPnC;IAQL,+BAA+B,EAAE,OAAO,CAAC,cARpC;IASL,iCAAiC,EAAE,OAAO,CAAC,YATtC;IAUL,mCAAmC,EAAE,OAAO,CAAC,YAVxC;IAWL,oCAAoC,EAAE,OAAO,CAAC,YAXzC;IAYL,uBAAuB,EAAE,OAAO,CAAC,eAZ5B;IAa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aAAjC;EAEA,OAAO,EACL,GAAG,SADE;IAEL,GAAG,cAAc,CAAC,OAAO,CAAC,OAAT,EAAkB,OAAO,CAAC,UAA1B,CAFZ;IAGL,GAAG,eAAe,CAAC,OAAO,CAAC,OAAT,CAHb;IAIL,GAAG,qBAAqB,CAAC,OAAO,CAAC,OAAT;EAJnB,CAAP;AAMD,CATM","sourcesContent":["import { Theme as ThemeV8 } from '@fluentui/react';\nimport type { IEffects, IPalette } from '@fluentui/react';\nimport { Theme as ThemeV9, webLightTheme } from '@fluentui/react-components';\nimport type { BorderRadiusTokens, ColorTokens, ShadowTokens } from '@fluentui/react-components';\nimport { blackAlpha, whiteAlpha, grey } from './themeDuplicates';\n\n/**\n * Creates v9 color tokens from a v8 palette.\n */\nconst mapAliasColors = (palette: IPalette, inverted: boolean): ColorTokens => {\n return {\n colorNeutralForeground1: palette.neutralPrimary,\n colorNeutralForeground1Hover: palette.neutralPrimary,\n colorNeutralForeground1Pressed: palette.neutralPrimary,\n colorNeutralForeground1Selected: palette.neutralPrimary,\n colorNeutralForeground2: palette.neutralSecondary,\n colorNeutralForeground2Hover: palette.neutralPrimary,\n colorNeutralForeground2Pressed: palette.neutralPrimary,\n colorNeutralForeground2Selected: palette.neutralPrimary,\n colorNeutralForeground2BrandHover: palette.themePrimary,\n colorNeutralForeground2BrandPressed: palette.themeDarkAlt,\n colorNeutralForeground2BrandSelected: palette.themePrimary,\n colorNeutralForeground3: palette.neutralTertiary,\n colorNeutralForeground3Hover: palette.neutralSecondary,\n colorNeutralForeground3Pressed: palette.neutralSecondary,\n colorNeutralForeground3Selected: palette.neutralSecondary,\n colorNeutralForeground3BrandHover: palette.themePrimary,\n colorNeutralForeground3BrandPressed: palette.themeDarkAlt,\n colorNeutralForeground3BrandSelected: palette.themePrimary,\n colorNeutralForeground4: palette.neutralQuaternary,\n colorNeutralForegroundDisabled: palette.neutralTertiaryAlt,\n colorNeutralForegroundInvertedDisabled: whiteAlpha[40],\n colorBrandForegroundLink: palette.themeDarkAlt,\n colorBrandForegroundLinkHover: palette.themeDark,\n colorBrandForegroundLinkPressed: palette.themeDarker,\n colorBrandForegroundLinkSelected: palette.themeDarkAlt,\n colorNeutralForeground2Link: palette.neutralSecondary,\n colorNeutralForeground2LinkHover: palette.neutralPrimary,\n colorNeutralForeground2LinkPressed: palette.neutralPrimary,\n colorNeutralForeground2LinkSelected: palette.neutralPrimary,\n colorCompoundBrandForeground1: palette.themePrimary,\n colorCompoundBrandForeground1Hover: palette.themeDarkAlt,\n colorCompoundBrandForeground1Pressed: palette.themeDark,\n colorBrandForeground1: palette.themePrimary,\n colorBrandForeground2: palette.themeDarkAlt,\n colorNeutralForeground1Static: palette.neutralPrimary,\n colorNeutralForegroundInverted: palette.white,\n colorNeutralForegroundInvertedHover: palette.white,\n colorNeutralForegroundInvertedPressed: palette.white,\n colorNeutralForegroundInvertedSelected: palette.white,\n colorNeutralForegroundOnBrand: palette.white,\n colorNeutralForegroundStaticInverted: palette.white,\n colorNeutralForegroundInvertedLink: palette.white,\n colorNeutralForegroundInvertedLinkHover: palette.white,\n colorNeutralForegroundInvertedLinkPressed: palette.white,\n colorNeutralForegroundInvertedLinkSelected: palette.white,\n colorNeutralForegroundInverted2: palette.white,\n colorBrandForegroundInverted: palette.themeSecondary,\n colorBrandForegroundInvertedHover: palette.themeTertiary,\n colorBrandForegroundInvertedPressed: palette.themeSecondary,\n colorBrandForegroundOnLight: palette.themePrimary,\n colorBrandForegroundOnLightHover: palette.themeDarkAlt,\n colorBrandForegroundOnLightPressed: palette.themeDark,\n colorBrandForegroundOnLightSelected: palette.themeDark,\n colorNeutralBackground1: palette.white,\n colorNeutralBackground1Hover: palette.neutralLighter,\n colorNeutralBackground1Pressed: palette.neutralQuaternaryAlt,\n colorNeutralBackground1Selected: palette.neutralLight,\n colorNeutralBackground2: palette.neutralLighterAlt,\n colorNeutralBackground2Hover: palette.neutralLighter,\n colorNeutralBackground2Pressed: palette.neutralQuaternaryAlt,\n colorNeutralBackground2Selected: palette.neutralLight,\n colorNeutralBackground3: palette.neutralLighter,\n colorNeutralBackground3Hover: palette.neutralLight,\n colorNeutralBackground3Pressed: palette.neutralQuaternary,\n colorNeutralBackground3Selected: palette.neutralQuaternaryAlt,\n colorNeutralBackground4: palette.neutralLighter,\n colorNeutralBackground4Hover: palette.neutralLighterAlt,\n colorNeutralBackground4Pressed: palette.neutralLighter,\n colorNeutralBackground4Selected: palette.white,\n colorNeutralBackground5: palette.neutralLight,\n colorNeutralBackground5Hover: palette.neutralLighter,\n colorNeutralBackground5Pressed: palette.neutralLighter,\n colorNeutralBackground5Selected: palette.neutralLighterAlt,\n colorNeutralBackground6: palette.neutralLight,\n colorNeutralBackgroundStatic: grey[20],\n colorNeutralBackgroundInverted: palette.neutralSecondary,\n colorSubtleBackground: 'transparent',\n colorSubtleBackgroundHover: palette.neutralLighter,\n colorSubtleBackgroundPressed: palette.neutralQuaternaryAlt,\n colorSubtleBackgroundSelected: palette.neutralLight,\n colorSubtleBackgroundLightAlphaHover: inverted ? whiteAlpha[10] : whiteAlpha[80],\n colorSubtleBackgroundLightAlphaPressed: inverted ? whiteAlpha[5] : whiteAlpha[50],\n colorSubtleBackgroundLightAlphaSelected: 'transparent',\n colorSubtleBackgroundInverted: 'transparent',\n colorSubtleBackgroundInvertedHover: blackAlpha[10],\n colorSubtleBackgroundInvertedPressed: blackAlpha[30],\n colorSubtleBackgroundInvertedSelected: blackAlpha[20],\n colorTransparentBackground: 'transparent',\n colorTransparentBackgroundHover: 'transparent',\n colorTransparentBackgroundPressed: 'transparent',\n colorTransparentBackgroundSelected: 'transparent',\n colorNeutralBackgroundDisabled: palette.neutralLighter,\n colorNeutralBackgroundInvertedDisabled: whiteAlpha[10],\n colorNeutralStencil1: palette.neutralLight,\n colorNeutralStencil2: palette.neutralLighterAlt,\n colorBackgroundOverlay: blackAlpha[10],\n colorScrollbarOverlay: blackAlpha[50],\n colorBrandBackground: palette.themePrimary,\n colorBrandBackgroundHover: palette.themeDarkAlt,\n colorBrandBackgroundPressed: palette.themeDarker,\n colorBrandBackgroundSelected: palette.themeDark,\n colorCompoundBrandBackground: palette.themePrimary,\n colorCompoundBrandBackgroundHover: palette.themeDarkAlt,\n colorCompoundBrandBackgroundPressed: palette.themeDark,\n colorBrandBackgroundStatic: palette.themePrimary,\n colorBrandBackground2: palette.themeLighterAlt,\n colorBrandBackgroundInverted: palette.white,\n colorBrandBackgroundInvertedHover: palette.themeLighterAlt,\n colorBrandBackgroundInvertedPressed: palette.themeLight,\n colorBrandBackgroundInvertedSelected: palette.themeLighter,\n colorNeutralStrokeAccessible: palette.neutralSecondary,\n colorNeutralStrokeAccessibleHover: palette.neutralSecondary,\n colorNeutralStrokeAccessiblePressed: palette.neutralSecondary,\n colorNeutralStrokeAccessibleSelected: palette.themePrimary,\n colorNeutralStroke1: palette.neutralQuaternary,\n colorNeutralStroke1Hover: palette.neutralTertiaryAlt,\n colorNeutralStroke1Pressed: palette.neutralTertiaryAlt,\n colorNeutralStroke1Selected: palette.neutralTertiaryAlt,\n colorNeutralStroke2: palette.neutralQuaternaryAlt,\n colorNeutralStroke3: palette.neutralLighter,\n colorNeutralStrokeOnBrand: palette.white,\n colorNeutralStrokeOnBrand2: palette.white,\n colorNeutralStrokeOnBrand2Hover: palette.white,\n colorNeutralStrokeOnBrand2Pressed: palette.white,\n colorNeutralStrokeOnBrand2Selected: palette.white,\n colorBrandStroke1: palette.themePrimary,\n colorBrandStroke2: palette.themeLight,\n colorCompoundBrandStroke: palette.themePrimary,\n colorCompoundBrandStrokeHover: palette.themeDarkAlt,\n colorCompoundBrandStrokePressed: palette.themeDark,\n colorNeutralStrokeDisabled: palette.neutralQuaternaryAlt,\n colorNeutralStrokeInvertedDisabled: whiteAlpha[40],\n colorTransparentStroke: 'transparent',\n colorTransparentStrokeInteractive: 'transparent',\n colorTransparentStrokeDisabled: 'transparent',\n colorStrokeFocus1: palette.white,\n colorStrokeFocus2: palette.black,\n colorNeutralShadowAmbient: 'rgba(0,0,0,0.12)',\n colorNeutralShadowKey: 'rgba(0,0,0,0.14)',\n colorNeutralShadowAmbientLighter: 'rgba(0,0,0,0.06)',\n colorNeutralShadowKeyLighter: 'rgba(0,0,0,0.07)',\n colorNeutralShadowAmbientDarker: 'rgba(0,0,0,0.20)',\n colorNeutralShadowKeyDarker: 'rgba(0,0,0,0.24)',\n colorBrandShadowAmbient: 'rgba(0,0,0,0.30)',\n colorBrandShadowKey: 'rgba(0,0,0,0.25)',\n };\n};\n\n/**\n * Creates v9 shadow tokens from v8 effects.\n */\nconst mapShadowTokens = (effects: IEffects): Partial<ShadowTokens> => {\n return {\n shadow4: effects.elevation4,\n shadow8: effects.elevation8,\n shadow16: effects.elevation16,\n shadow64: effects.elevation64,\n };\n};\n\n/**\n * Creates v9 border radius tokens from v8 effects\n */\nconst mapBorderRadiusTokens = (effects: IEffects): Partial<BorderRadiusTokens> => {\n return {\n borderRadiusSmall: effects.roundedCorner2,\n borderRadiusMedium: effects.roundedCorner4,\n borderRadiusLarge: effects.roundedCorner6,\n };\n};\n\n/**\n * Creates a v9 theme from a v8 theme.\n * You can optional pass a base v9 theme; otherwise webLightTheme is used.\n */\nexport const createV9Theme = (themeV8: ThemeV8, baseThemeV9?: ThemeV9): ThemeV9 => {\n const baseTheme = baseThemeV9 ?? webLightTheme;\n\n return {\n ...baseTheme,\n ...mapAliasColors(themeV8.palette, themeV8.isInverted),\n ...mapShadowTokens(themeV8.effects),\n ...mapBorderRadiusTokens(themeV8.effects),\n };\n};\n"],"sourceRoot":"../src/"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ActionButtonShim, ButtonShim, CommandButtonShim, CompoundButtonShim, DefaultButtonShim, MenuButtonShim, PrimaryButtonShim, shimButtonProps, ToggleButtonShim } from './components/Button/index';
|
|
2
|
+
export { MenuItemShim, shimMenuProps } from './components/Menu/index';
|
|
3
|
+
export { StackItemShim, StackShim } from './components/Stack/index';
|
|
4
|
+
export { black, blackAlpha, brandWeb, createBrandVariants, createV8Theme, createV9Theme, grey, grey14Alpha, hcButtonFace, hcButtonText, hcCanvas, hcCanvasText, hcDisabled, hcHighlight, hcHighlightText, hcHyperlink, sharedColors, white, whiteAlpha } from './components/Theme/index';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SACE,gBADF,EAEE,UAFF,EAGE,iBAHF,EAIE,kBAJF,EAKE,iBALF,EAME,cANF,EAOE,iBAPF,EAQE,eARF,EASE,gBATF,QAUO,2BAVP;AAYA,SAAS,YAAT,EAAuB,aAAvB,QAA4C,yBAA5C;AAEA,SAAS,aAAT,EAAwB,SAAxB,QAAyC,0BAAzC;AAEA,SACE,KADF,EAEE,UAFF,EAGE,QAHF,EAIE,mBAJF,EAKE,aALF,EAME,aANF,EAOE,IAPF,EAQE,WARF,EASE,YATF,EAUE,YAVF,EAWE,QAXF,EAYE,YAZF,EAaE,UAbF,EAcE,WAdF,EAeE,eAfF,EAgBE,WAhBF,EAiBE,YAjBF,EAkBE,KAlBF,EAmBE,UAnBF,QAoBO,0BApBP","sourcesContent":["export {\n ActionButtonShim,\n ButtonShim,\n CommandButtonShim,\n CompoundButtonShim,\n DefaultButtonShim,\n MenuButtonShim,\n PrimaryButtonShim,\n shimButtonProps,\n ToggleButtonShim,\n} from './components/Button/index';\n\nexport { MenuItemShim, shimMenuProps } from './components/Menu/index';\n\nexport { StackItemShim, StackShim } from './components/Stack/index';\n\nexport {\n black,\n blackAlpha,\n brandWeb,\n createBrandVariants,\n createV8Theme,\n createV9Theme,\n grey,\n grey14Alpha,\n hcButtonFace,\n hcButtonText,\n hcCanvas,\n hcCanvasText,\n hcDisabled,\n hcHighlight,\n hcHighlightText,\n hcHyperlink,\n sharedColors,\n white,\n whiteAlpha,\n} from './components/Theme/index';\n\nexport type {\n AlphaColors,\n ColorVariants,\n GlobalSharedColors,\n Greys,\n TextAlignment,\n TextAlignments,\n} from './components/Theme/index';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import descriptionMd from './Description.md';
|
|
3
|
+
import { DefaultButton } from '@fluentui/react';
|
|
4
|
+
import { FluentProvider, Button, webLightTheme, __styles, shorthands } from '@fluentui/react-components';
|
|
5
|
+
import { DefaultButtonShim } from '../../components/Button/index';
|
|
6
|
+
|
|
7
|
+
const useStyles = /*#__PURE__*/__styles({
|
|
8
|
+
"root": {
|
|
9
|
+
"mc9l5x": "f13qh94s",
|
|
10
|
+
"Budl1dq": "f1svr4aa",
|
|
11
|
+
"wkccdc": "f1u7ey36",
|
|
12
|
+
"a9b677": "f1acs6jw",
|
|
13
|
+
"Bmliigx": "fxe27oy",
|
|
14
|
+
"Bt984gj": "f122n59",
|
|
15
|
+
"B7hvi0a": "f1oiokrs",
|
|
16
|
+
"i8kkvl": "f18w1nra",
|
|
17
|
+
"Belr9w4": "fd7ph1c"
|
|
18
|
+
},
|
|
19
|
+
"componentName": {
|
|
20
|
+
"Bdqf98w": "f1a7i8kp",
|
|
21
|
+
"B6of3ja": "f1hu3pq6",
|
|
22
|
+
"t21cq0": ["f1pxv85q", "f1oou7ox"],
|
|
23
|
+
"jrapky": "f19f4twv",
|
|
24
|
+
"Frg6f3": ["f1tyq0we", "f11qmguv"]
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
"d": [".f13qh94s{display:grid;}", ".f1svr4aa{grid-template-columns:auto auto auto;}", ".f1u7ey36{grid-template-rows:1fr;}", ".f1acs6jw{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}", ".fxe27oy{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f1oiokrs{justify-items:center;}", ".f18w1nra{-webkit-column-gap:10px;column-gap:10px;}", ".fd7ph1c{row-gap:10px;}", ".f1a7i8kp{justify-self:end;}", ".f1hu3pq6{margin-top:0;}", ".f1pxv85q{margin-right:10px;}", ".f1oou7ox{margin-left:10px;}", ".f19f4twv{margin-bottom:0;}", ".f1tyq0we{margin-left:0;}", ".f11qmguv{margin-right:0;}"]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const Default = () => {
|
|
31
|
+
const styles = useStyles();
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: styles.root
|
|
34
|
+
}, /*#__PURE__*/React.createElement("h3", null, "v8"), /*#__PURE__*/React.createElement("h3", null, "DefaultButtonShim"), /*#__PURE__*/React.createElement("h3", null, "v9"), /*#__PURE__*/React.createElement(DefaultButton, null, "Default"), /*#__PURE__*/React.createElement(FluentProvider, {
|
|
35
|
+
theme: webLightTheme
|
|
36
|
+
}, /*#__PURE__*/React.createElement(DefaultButtonShim, null, "Default")), /*#__PURE__*/React.createElement(FluentProvider, {
|
|
37
|
+
theme: webLightTheme
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Button, null, "Default")));
|
|
39
|
+
};
|
|
40
|
+
export default {
|
|
41
|
+
title: 'Migration Shims/Button/DefaultButtonShim',
|
|
42
|
+
component: DefaultButtonShim,
|
|
43
|
+
parameters: {
|
|
44
|
+
docs: {
|
|
45
|
+
description: {
|
|
46
|
+
component: /*#__PURE__*/[descriptionMd].join('\n')
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["stories/DefaultButtonShim/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,OAAO,aAAP,MAA0B,kBAA1B;AAEA,SAAS,aAAT,QAA8B,iBAA9B;AACA,SAAS,cAAT,EAAyB,MAAzB,EAAiC,aAAjC,YAA4D,UAA5D,QAA8E,4BAA9E;AACA,SAAS,iBAAT,QAAkC,+BAAlC;;AAEA,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;;AAkBA,OAAO,MAAM,OAAO,GAAG,MAAK;EAC1B,MAAM,MAAM,GAAG,SAAS,EAAxB;EAEA,oBACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;IAAK,SAAS,EAAE,MAAM,CAAC;EAAvB,CAAA,eACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAA,IAAA,CADF,eAEE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,CAFF,eAGE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAA,IAAA,CAHF,eAIE,KAAA,CAAA,aAAA,CAAC,aAAD,EAAc,IAAd,EAAc,SAAd,CAJF,eAKE,KAAA,CAAA,aAAA,CAAC,cAAD,EAAe;IAAC,KAAK,EAAE;EAAR,CAAf,eACE,KAAA,CAAA,aAAA,CAAC,iBAAD,EAAkB,IAAlB,EAAkB,SAAlB,CADF,CALF,eAQE,KAAA,CAAA,aAAA,CAAC,cAAD,EAAe;IAAC,KAAK,EAAE;EAAR,CAAf,eACE,KAAA,CAAA,aAAA,CAAC,MAAD,EAAO,IAAP,EAAO,SAAP,CADF,CARF,CADF;AAcD,CAjBM;AAmBP,eAAe;EACb,KAAK,EAAE,0CADM;EAEb,SAAS,EAAE,iBAFE;EAGb,UAAU,EAAE;IACV,IAAI,EAAE;MACJ,WAAW,EAAE;QACX,SAAS,eAAE,CAAC,aAAD,EAAgB,IAAhB,CAAqB,IAArB;MADA;IADT;EADI;AAHC,CAAf","sourcesContent":["import * as React from 'react';\n\nimport descriptionMd from './Description.md';\n\nimport { DefaultButton } from '@fluentui/react';\nimport { FluentProvider, Button, webLightTheme, makeStyles, shorthands } from '@fluentui/react-components';\nimport { DefaultButtonShim } from '../../components/Button/index';\n\nconst useStyles = makeStyles({\n root: {\n display: 'grid',\n gridTemplateColumns: 'auto auto auto',\n gridTemplateRows: '1fr',\n width: 'fit-content',\n alignContent: 'center',\n alignItems: 'center',\n justifyItems: 'center',\n columnGap: '10px',\n rowGap: '10px',\n },\n componentName: {\n justifySelf: 'end',\n ...shorthands.margin(0, '10px', 0, 0),\n },\n});\n\nexport const Default = () => {\n const styles = useStyles();\n\n return (\n <div className={styles.root}>\n <h3>v8</h3>\n <h3>DefaultButtonShim</h3>\n <h3>v9</h3>\n <DefaultButton>Default</DefaultButton>\n <FluentProvider theme={webLightTheme}>\n <DefaultButtonShim>Default</DefaultButtonShim>\n </FluentProvider>\n <FluentProvider theme={webLightTheme}>\n <Button>Default</Button>\n </FluentProvider>\n </div>\n );\n};\n\nexport default {\n title: 'Migration Shims/Button/DefaultButtonShim',\n component: DefaultButtonShim,\n parameters: {\n docs: {\n description: {\n component: [descriptionMd].join('\\n'),\n },\n },\n },\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-components", "./shimButtonProps"], function (require, exports, tslib_1, React, react_components_1, shimButtonProps_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ActionButtonShim = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Shims a v8 ActionButton to render a v9 Button
|
|
7
|
+
*/
|
|
8
|
+
exports.ActionButtonShim = React.forwardRef(function (props, _ref) {
|
|
9
|
+
var variantProps = tslib_1.__assign(tslib_1.__assign({}, props), { variantClassName: 'ms-Button--action ms-Button--command' });
|
|
10
|
+
var shimProps = shimButtonProps_1.shimButtonProps(variantProps);
|
|
11
|
+
return React.createElement(react_components_1.Button, tslib_1.__assign({}, props, shimProps, { appearance: "transparent" }));
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=ActionButtonShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionButtonShim.js","sourceRoot":"../src/","sources":["components/Button/ActionButtonShim.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,gBAAgB,GAEzB,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,IAAI;QAC/B,IAAM,YAAY,yCACb,KAAK,KACR,gBAAgB,EAAE,sCAAsC,GACzD,CAAC;QAEF,IAAM,SAAS,GAAG,iCAAe,CAAC,YAAY,CAAC,CAAC;QAEhD,OAAO,oBAAC,yBAAM,uBAAM,KAAgD,EAAM,SAAS,IAAE,UAAU,EAAC,aAAa,IAAG,CAAC;IACnH,CAAC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\n\nimport { Button } from '@fluentui/react-components';\n\nimport { shimButtonProps } from './shimButtonProps';\n\n/**\n * Shims a v8 ActionButton to render a v9 Button\n */\nexport const ActionButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const variantProps = {\n ...props,\n variantClassName: 'ms-Button--action ms-Button--command',\n };\n\n const shimProps = shimButtonProps(variantProps);\n\n return <Button {...(props as React.RefAttributes<HTMLButtonElement>)} {...shimProps} appearance=\"transparent\" />;\n});\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-components", "./shimButtonProps", "./ToggleButtonShim", "./CompoundButtonShim"], function (require, exports, tslib_1, React, react_components_1, shimButtonProps_1, ToggleButtonShim_1, CompoundButtonShim_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ButtonShim = void 0;
|
|
5
|
+
exports.ButtonShim = React.forwardRef(function (props, _ref) {
|
|
6
|
+
var _a;
|
|
7
|
+
var shimProps = shimButtonProps_1.shimButtonProps(props);
|
|
8
|
+
if (props.toggle) {
|
|
9
|
+
return React.createElement(ToggleButtonShim_1.ToggleButtonShim, tslib_1.__assign({}, props), props.children);
|
|
10
|
+
}
|
|
11
|
+
if (props.secondaryText || ((_a = props.onRenderDescription) === null || _a === void 0 ? void 0 : _a.call(props, props))) {
|
|
12
|
+
return React.createElement(CompoundButtonShim_1.CompoundButtonShim, tslib_1.__assign({}, props));
|
|
13
|
+
}
|
|
14
|
+
return React.createElement(react_components_1.Button, tslib_1.__assign({}, props, shimProps));
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=ButtonShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonShim.js","sourceRoot":"../src/","sources":["components/Button/ButtonShim.tsx"],"names":[],"mappings":";;;;IAUa,QAAA,UAAU,GAEnB,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,IAAI;;QAC/B,IAAM,SAAS,GAAG,iCAAe,CAAC,KAAK,CAAC,CAAC;QAEzC,IAAI,KAAK,CAAC,MAAM,EAAE;YAChB,OAAO,oBAAC,mCAAgB,uBAAK,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAoB,CAAC;SACzE;QACD,IAAI,KAAK,CAAC,aAAa,KAAI,MAAA,KAAK,CAAC,mBAAmB,+CAAzB,KAAK,EAAuB,KAAK,CAAC,CAAA,EAAE;YAC7D,OAAO,oBAAC,uCAAkB,uBAAK,KAAK,EAAI,CAAC;SAC1C;QAED,OAAO,oBAAC,yBAAM,uBAAM,KAAgD,EAAM,SAAS,EAAI,CAAC;IAC1F,CAAC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type { IBaseButtonProps } from '@fluentui/react';\n\nimport { Button } from '@fluentui/react-components';\n\nimport { shimButtonProps } from './shimButtonProps';\nimport { ToggleButtonShim } from './ToggleButtonShim';\nimport { CompoundButtonShim } from './CompoundButtonShim';\n\nexport const ButtonShim: React.ForwardRefExoticComponent<\n IBaseButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const shimProps = shimButtonProps(props);\n\n if (props.toggle) {\n return <ToggleButtonShim {...props}>{props.children}</ToggleButtonShim>;\n }\n if (props.secondaryText || props.onRenderDescription?.(props)) {\n return <CompoundButtonShim {...props} />;\n }\n\n return <Button {...(props as React.RefAttributes<HTMLButtonElement>)} {...shimProps} />;\n});\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
define(["require", "exports", "./ActionButtonShim"], function (require, exports, ActionButtonShim_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CommandButtonShim = void 0;
|
|
5
|
+
Object.defineProperty(exports, "CommandButtonShim", { enumerable: true, get: function () { return ActionButtonShim_1.ActionButtonShim; } });
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=CommandButtonShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandButtonShim.js","sourceRoot":"../src/","sources":["components/Button/CommandButtonShim.tsx"],"names":[],"mappings":";;;;IAGS,qHAAA,gBAAgB,OAAqB","sourcesContent":["/**\n * Shims v8 CommandButtonShim to render a v9 Button\n */\nexport { ActionButtonShim as CommandButtonShim } from './ActionButtonShim';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-components", "./shimButtonProps"], function (require, exports, tslib_1, React, react_components_1, shimButtonProps_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CompoundButtonShim = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Shims v8 CompoundButton to render a v9 CompoundButton
|
|
7
|
+
*/
|
|
8
|
+
exports.CompoundButtonShim = React.forwardRef(function (props, _ref) {
|
|
9
|
+
var _a;
|
|
10
|
+
var variantProps = tslib_1.__assign(tslib_1.__assign({}, props), { variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound' });
|
|
11
|
+
var shimProps = tslib_1.__assign(tslib_1.__assign({}, shimButtonProps_1.shimButtonProps(variantProps)), { secondaryContent: props.secondaryText || ((_a = props.onRenderDescription) === null || _a === void 0 ? void 0 : _a.call(props, props)) });
|
|
12
|
+
return React.createElement(react_components_1.CompoundButton, tslib_1.__assign({}, props, shimProps));
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=CompoundButtonShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompoundButtonShim.js","sourceRoot":"../src/","sources":["components/Button/CompoundButtonShim.tsx"],"names":[],"mappings":";;;;IASA;;OAEG;IACU,QAAA,kBAAkB,GAE3B,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,IAAI;;QAC/B,IAAM,YAAY,yCACb,KAAK,KACR,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,qBAAqB,GACvF,CAAC;QAEF,IAAM,SAAS,yCACV,iCAAe,CAAC,YAAY,CAAC,KAChC,gBAAgB,EAAE,KAAK,CAAC,aAAa,KAAI,MAAA,KAAK,CAAC,mBAAmB,+CAAzB,KAAK,EAAuB,KAAK,CAAC,CAAA,GAC5E,CAAC;QAEF,OAAO,oBAAC,iCAAc,uBAAM,KAAgD,EAAM,SAAS,EAAI,CAAC;IAClG,CAAC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\n\nimport { CompoundButton } from '@fluentui/react-components';\nimport type { CompoundButtonProps } from '@fluentui/react-components';\n\nimport { shimButtonProps } from './shimButtonProps';\n\n/**\n * Shims v8 CompoundButton to render a v9 CompoundButton\n */\nexport const CompoundButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const variantProps = {\n ...props,\n variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound',\n };\n\n const shimProps: CompoundButtonProps = {\n ...shimButtonProps(variantProps),\n secondaryContent: props.secondaryText || props.onRenderDescription?.(props),\n };\n\n return <CompoundButton {...(props as React.RefAttributes<HTMLButtonElement>)} {...shimProps} />;\n});\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "./ButtonShim"], function (require, exports, tslib_1, React, ButtonShim_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DefaultButtonShim = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Shims a v8 DefaultButton to render a v9 Button
|
|
7
|
+
*/
|
|
8
|
+
exports.DefaultButtonShim = React.forwardRef(function (props, _ref) {
|
|
9
|
+
return React.createElement(ButtonShim_1.ButtonShim, tslib_1.__assign({}, props, { variantClassName: props.primary ? 'ms-Button--primary' : 'ms-Button--default' }));
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=DefaultButtonShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultButtonShim.js","sourceRoot":"../src/","sources":["components/Button/DefaultButtonShim.tsx"],"names":[],"mappings":";;;;IAMA;;OAEG;IACU,QAAA,iBAAiB,GAE1B,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,IAAI;QAC/B,OAAO,oBAAC,uBAAU,uBAAK,KAAK,IAAE,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,IAAI,CAAC;IAClH,CAAC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\n\nimport { ButtonShim } from './ButtonShim';\n\n/**\n * Shims a v8 DefaultButton to render a v9 Button\n */\nexport const DefaultButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n return <ButtonShim {...props} variantClassName={props.primary ? 'ms-Button--primary' : 'ms-Button--default'} />;\n});\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-components", "../Menu/index", "./shimButtonProps"], function (require, exports, tslib_1, React, react_components_1, index_1, shimButtonProps_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MenuButtonShim = void 0;
|
|
5
|
+
exports.MenuButtonShim = React.forwardRef(function (props, _ref) {
|
|
6
|
+
var _a;
|
|
7
|
+
var variantProps = tslib_1.__assign(tslib_1.__assign({}, props), { variantClassName: props.primary ? 'ms-Button--primary' : 'ms-Button--default' });
|
|
8
|
+
var shimProps = tslib_1.__assign({}, shimButtonProps_1.shimButtonProps(variantProps));
|
|
9
|
+
var shimmedMenuProps = props.menuProps ? index_1.shimMenuProps(props.menuProps) : {};
|
|
10
|
+
return (React.createElement(react_components_1.Menu, tslib_1.__assign({}, shimmedMenuProps),
|
|
11
|
+
React.createElement(react_components_1.MenuTrigger, null,
|
|
12
|
+
React.createElement(react_components_1.MenuButton, tslib_1.__assign({}, shimProps))),
|
|
13
|
+
React.createElement(react_components_1.MenuPopover, null,
|
|
14
|
+
React.createElement(react_components_1.MenuList, null, (_a = props.menuProps) === null || _a === void 0 ? void 0 : _a.items.map(function (item) { return (
|
|
15
|
+
// key is added through item spread
|
|
16
|
+
// eslint-disable-next-line react/jsx-key
|
|
17
|
+
React.createElement(index_1.MenuItemShim, tslib_1.__assign({}, item))); })))));
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=MenuButtonShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuButtonShim.js","sourceRoot":"../src/","sources":["components/Button/MenuButtonShim.tsx"],"names":[],"mappings":";;;;IASa,QAAA,cAAc,GAEvB,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,IAAI;;QAC/B,IAAM,YAAY,yCACb,KAAK,KACR,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,GAC9E,CAAC;QAEF,IAAM,SAAS,wBACV,iCAAe,CAAC,YAAY,CAAC,CACjC,CAAC;QAEF,IAAM,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAa,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAE/E,OAAO,CACL,oBAAC,uBAAI,uBAAK,gBAAgB;YACxB,oBAAC,8BAAW;gBACV,oBAAC,6BAAU,uBAAK,SAAS,EAAI,CACjB;YACd,oBAAC,8BAAW;gBACV,oBAAC,2BAAQ,QACN,MAAA,KAAK,CAAC,SAAS,0CAAE,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI,IAAI,OAAA;gBAClC,mCAAmC;gBACnC,yCAAyC;gBACzC,oBAAC,oBAAY,uBAAK,IAAI,EAAI,CAC3B,EAJmC,CAInC,CAAC,CACO,CACC,CACT,CACR,CAAC;IACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\nimport { MenuButton, Menu, MenuList, MenuPopover, MenuTrigger } from '@fluentui/react-components';\nimport type { MenuButtonProps } from '@fluentui/react-components';\nimport { MenuItemShim, shimMenuProps } from '../Menu/index';\n\nimport { shimButtonProps } from './shimButtonProps';\n\nexport const MenuButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const variantProps = {\n ...props,\n variantClassName: props.primary ? 'ms-Button--primary' : 'ms-Button--default',\n };\n\n const shimProps: MenuButtonProps = {\n ...shimButtonProps(variantProps),\n };\n\n const shimmedMenuProps = props.menuProps ? shimMenuProps(props.menuProps) : {};\n\n return (\n <Menu {...shimmedMenuProps}>\n <MenuTrigger>\n <MenuButton {...shimProps} />\n </MenuTrigger>\n <MenuPopover>\n <MenuList>\n {props.menuProps?.items.map(item => (\n // key is added through item spread\n // eslint-disable-next-line react/jsx-key\n <MenuItemShim {...item} />\n ))}\n </MenuList>\n </MenuPopover>\n </Menu>\n );\n});\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "./ButtonShim"], function (require, exports, tslib_1, React, ButtonShim_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PrimaryButtonShim = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Shims v8 PrimaryButton to render a v9 Button
|
|
7
|
+
*/
|
|
8
|
+
exports.PrimaryButtonShim = React.forwardRef(function (props, _ref) {
|
|
9
|
+
return React.createElement(ButtonShim_1.ButtonShim, tslib_1.__assign({}, props, { primary: true, variantClassName: "ms-Button--primary" }));
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=PrimaryButtonShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimaryButtonShim.js","sourceRoot":"../src/","sources":["components/Button/PrimaryButtonShim.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACU,QAAA,iBAAiB,GAE1B,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,IAAI;QAC/B,OAAO,oBAAC,uBAAU,uBAAK,KAAK,IAAE,OAAO,QAAC,gBAAgB,EAAC,oBAAoB,IAAG,CAAC;IACjF,CAAC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\nimport { ButtonShim } from './ButtonShim';\n\n/**\n * Shims v8 PrimaryButton to render a v9 Button\n */\nexport const PrimaryButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n return <ButtonShim {...props} primary variantClassName=\"ms-Button--primary\" />;\n});\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-components", "./shimButtonProps"], function (require, exports, tslib_1, React, react_components_1, shimButtonProps_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ToggleButtonShim = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Shims v8 ToggleButton to render a v9 ToggleButton
|
|
7
|
+
*/
|
|
8
|
+
exports.ToggleButtonShim = React.forwardRef(function (props, _ref) {
|
|
9
|
+
var variantProps = tslib_1.__assign(tslib_1.__assign({}, props), { variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound' });
|
|
10
|
+
var shimProps = tslib_1.__assign(tslib_1.__assign({}, shimButtonProps_1.shimButtonProps(variantProps)), { checked: props.checked, defaultChecked: props.defaultChecked });
|
|
11
|
+
return React.createElement(react_components_1.ToggleButton, tslib_1.__assign({}, props, shimProps));
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=ToggleButtonShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleButtonShim.js","sourceRoot":"../src/","sources":["components/Button/ToggleButtonShim.tsx"],"names":[],"mappings":";;;;IASA;;OAEG;IACU,QAAA,gBAAgB,GAEzB,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,IAAI;QAC/B,IAAM,YAAY,yCACb,KAAK,KACR,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,qBAAqB,GACvF,CAAC;QAEF,IAAM,SAAS,yCACV,iCAAe,CAAC,YAAY,CAAC,KAChC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,cAAc,EAAE,KAAK,CAAC,cAAc,GACrC,CAAC;QAEF,OAAO,oBAAC,+BAAY,uBAAM,KAAgD,EAAM,SAAS,EAAI,CAAC;IAChG,CAAC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\n\nimport { ToggleButton } from '@fluentui/react-components';\nimport type { ToggleButtonProps } from '@fluentui/react-components';\n\nimport { shimButtonProps } from './shimButtonProps';\n\n/**\n * Shims v8 ToggleButton to render a v9 ToggleButton\n */\nexport const ToggleButtonShim: React.ForwardRefExoticComponent<\n IButtonProps & React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n const variantProps = {\n ...props,\n variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound',\n };\n\n const shimProps: ToggleButtonProps = {\n ...shimButtonProps(variantProps),\n checked: props.checked,\n defaultChecked: props.defaultChecked,\n };\n\n return <ToggleButton {...(props as React.RefAttributes<HTMLButtonElement>)} {...shimProps} />;\n});\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./ActionButtonShim", "./ButtonShim", "./CommandButtonShim", "./CompoundButtonShim", "./DefaultButtonShim", "./MenuButtonShim", "./PrimaryButtonShim", "./shimButtonProps", "./ToggleButtonShim"], function (require, exports, tslib_1, ActionButtonShim_1, ButtonShim_1, CommandButtonShim_1, CompoundButtonShim_1, DefaultButtonShim_1, MenuButtonShim_1, PrimaryButtonShim_1, shimButtonProps_1, ToggleButtonShim_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(ActionButtonShim_1, exports);
|
|
5
|
+
tslib_1.__exportStar(ButtonShim_1, exports);
|
|
6
|
+
tslib_1.__exportStar(CommandButtonShim_1, exports);
|
|
7
|
+
tslib_1.__exportStar(CompoundButtonShim_1, exports);
|
|
8
|
+
tslib_1.__exportStar(DefaultButtonShim_1, exports);
|
|
9
|
+
tslib_1.__exportStar(MenuButtonShim_1, exports);
|
|
10
|
+
tslib_1.__exportStar(PrimaryButtonShim_1, exports);
|
|
11
|
+
tslib_1.__exportStar(shimButtonProps_1, exports);
|
|
12
|
+
tslib_1.__exportStar(ToggleButtonShim_1, exports);
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Button/index.ts"],"names":[],"mappings":";;;IAAA,kDAAmC;IACnC,4CAA6B;IAC7B,mDAAoC;IACpC,oDAAqC;IACrC,mDAAoC;IACpC,gDAAiC;IACjC,mDAAoC;IACpC,iDAAkC;IAClC,kDAAmC","sourcesContent":["export * from './ActionButtonShim';\nexport * from './ButtonShim';\nexport * from './CommandButtonShim';\nexport * from './CompoundButtonShim';\nexport * from './DefaultButtonShim';\nexport * from './MenuButtonShim';\nexport * from './PrimaryButtonShim';\nexport * from './shimButtonProps';\nexport * from './ToggleButtonShim';\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react"], function (require, exports, tslib_1, React, react_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.shimButtonProps = void 0;
|
|
5
|
+
var shimButtonProps = function (props) {
|
|
6
|
+
var _a;
|
|
7
|
+
//TODO: Icon shim. This still renders the v8 icon.
|
|
8
|
+
var icon = props.onRenderIcon ? (props.onRenderIcon(props)) : props.iconProps ? (React.createElement(react_1.Icon, tslib_1.__assign({}, props.iconProps))) : undefined;
|
|
9
|
+
var variantClassName = ((_a = props.variantClassName) !== null && _a !== void 0 ? _a : props.primary) ? 'ms-Button--primary' : 'ms-Button--default';
|
|
10
|
+
var className = [props.baseClassName, variantClassName, props.className].filter(Boolean).join(' ');
|
|
11
|
+
return tslib_1.__assign(tslib_1.__assign({}, props), { appearance: props.primary ? 'primary' : undefined, className: className, disabled: props.disabled, disabledFocusable: props.allowDisabledFocus, 'aria-hidden': props.ariaHidden, 'aria-label': props.ariaLabel, icon: icon, key: props.key || props.uniqueId, children: props.onRenderChildren
|
|
12
|
+
? props.onRenderChildren(props)
|
|
13
|
+
: props.onRenderText
|
|
14
|
+
? props.onRenderText(props)
|
|
15
|
+
: props.text || props.children });
|
|
16
|
+
};
|
|
17
|
+
exports.shimButtonProps = shimButtonProps;
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=shimButtonProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shimButtonProps.js","sourceRoot":"../src/","sources":["components/Button/shimButtonProps.tsx"],"names":[],"mappings":";;;;IAOO,IAAM,eAAe,GAAG,UAAC,KAAgE;;QAC9F,kDAAkD;QAClD,IAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAChC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAC1B,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CACpB,oBAAC,YAAI,uBAAK,KAAK,CAAC,SAAS,EAAI,CAC9B,CAAC,CAAC,CAAC,SAAS,CAAC;QAEd,IAAM,gBAAgB,GAAG,CAAA,MAAA,KAAK,CAAC,gBAAgB,mCAAI,KAAK,CAAC,OAAO,EAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,CAAC;QAC/G,IAAM,SAAS,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAErG,OAAO,sCAEF,KAAK,KACR,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACjD,SAAS,WAAA,EACT,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,iBAAiB,EAAE,KAAK,CAAC,kBAAkB,EAC3C,aAAa,EAAE,KAAK,CAAC,UAAU,EAC/B,YAAY,EAAE,KAAK,CAAC,SAAS,EAC7B,IAAI,MAAA,EACJ,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,QAAQ,EAChC,QAAQ,EAAE,KAAK,CAAC,gBAAgB;gBAC9B,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC;gBAC/B,CAAC,CAAC,KAAK,CAAC,YAAY;oBACpB,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC;oBAC3B,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,QAAQ,GAClB,CAAC;IACnB,CAAC,CAAC;IA5BW,QAAA,eAAe,mBA4B1B","sourcesContent":["import * as React from 'react';\n\nimport { Icon } from '@fluentui/react';\nimport type { IBaseButtonProps } from '@fluentui/react';\n\nimport type { ButtonProps } from '@fluentui/react-components';\n\nexport const shimButtonProps = (props: IBaseButtonProps & React.RefAttributes<HTMLButtonElement>): ButtonProps => {\n //TODO: Icon shim. This still renders the v8 icon.\n const icon = props.onRenderIcon ? (\n props.onRenderIcon(props)\n ) : props.iconProps ? (\n <Icon {...props.iconProps} />\n ) : undefined;\n\n const variantClassName = props.variantClassName ?? props.primary ? 'ms-Button--primary' : 'ms-Button--default';\n const className = [props.baseClassName, variantClassName, props.className].filter(Boolean).join(' ');\n\n return {\n // spread incoming props to propagate HTML properties not part of IBaseButtonProps\n ...props,\n appearance: props.primary ? 'primary' : undefined,\n className,\n disabled: props.disabled,\n disabledFocusable: props.allowDisabledFocus,\n 'aria-hidden': props.ariaHidden,\n 'aria-label': props.ariaLabel,\n icon,\n key: props.key || props.uniqueId,\n children: props.onRenderChildren\n ? props.onRenderChildren(props)\n : props.onRenderText\n ? props.onRenderText(props)\n : props.text || props.children,\n } as ButtonProps;\n};\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/react-components", "./shimMenuProps"], function (require, exports, tslib_1, React, react_1, react_components_1, shimMenuProps_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MenuItemShim = void 0;
|
|
5
|
+
var MenuItemShim = function (props) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
if (props.itemType === react_1.ContextualMenuItemType.Divider) {
|
|
8
|
+
var shimProps_1 = shimMenuProps_1.shimMenuItemProps(props);
|
|
9
|
+
return React.createElement(react_components_1.MenuDivider, tslib_1.__assign({}, shimProps_1));
|
|
10
|
+
}
|
|
11
|
+
if (props.itemType === react_1.ContextualMenuItemType.Section) {
|
|
12
|
+
var shimProps_2 = shimMenuProps_1.shimMenuHeaderProps(props);
|
|
13
|
+
return (React.createElement(react_components_1.MenuGroup, null,
|
|
14
|
+
React.createElement(react_components_1.MenuGroupHeader, null, shimProps_2.children), (_a = props.subMenuProps) === null || _a === void 0 ? void 0 :
|
|
15
|
+
_a.items.map(function (item) { return (
|
|
16
|
+
// key is added through item spread
|
|
17
|
+
// eslint-disable-next-line react/jsx-key
|
|
18
|
+
React.createElement(exports.MenuItemShim, tslib_1.__assign({}, item))); })));
|
|
19
|
+
}
|
|
20
|
+
if (props.canCheck) {
|
|
21
|
+
var shimProps_3 = shimMenuProps_1.shimMenuItemCheckboxProps(props);
|
|
22
|
+
return React.createElement(react_components_1.MenuItemCheckbox, tslib_1.__assign({}, shimProps_3));
|
|
23
|
+
}
|
|
24
|
+
// Nested Menu to handle submenus
|
|
25
|
+
if (((_b = props.subMenuProps) === null || _b === void 0 ? void 0 : _b.items) && props.subMenuProps.items.length > 0) {
|
|
26
|
+
var shimmedMenuProps = shimMenuProps_1.shimMenuProps(props.subMenuProps);
|
|
27
|
+
var shimmedItemProps = shimMenuProps_1.shimMenuItemProps(props);
|
|
28
|
+
return (React.createElement(react_components_1.Menu, tslib_1.__assign({}, shimmedMenuProps),
|
|
29
|
+
React.createElement(react_components_1.MenuTrigger, null,
|
|
30
|
+
React.createElement(react_components_1.MenuItem, tslib_1.__assign({}, shimmedItemProps, { hasSubmenu: true }))),
|
|
31
|
+
React.createElement(react_components_1.MenuPopover, null,
|
|
32
|
+
React.createElement(react_components_1.MenuList, null, props.subMenuProps.items.map(function (item) { return (
|
|
33
|
+
// key is added through item spread
|
|
34
|
+
// eslint-disable-next-line react/jsx-key
|
|
35
|
+
React.createElement(exports.MenuItemShim, tslib_1.__assign({}, item))); })))));
|
|
36
|
+
}
|
|
37
|
+
var shimProps = shimMenuProps_1.shimMenuItemProps(props);
|
|
38
|
+
return React.createElement(react_components_1.MenuItem, tslib_1.__assign({}, shimProps));
|
|
39
|
+
};
|
|
40
|
+
exports.MenuItemShim = MenuItemShim;
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=MenuShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuShim.js","sourceRoot":"../src/","sources":["components/Menu/MenuShim.tsx"],"names":[],"mappings":";;;;IAmBO,IAAM,YAAY,GAAG,UAAC,KAA0B;;QACrD,IAAI,KAAK,CAAC,QAAQ,KAAK,8BAAsB,CAAC,OAAO,EAAE;YACrD,IAAM,WAAS,GAAG,iCAAiB,CAAC,KAAK,CAAC,CAAC;YAC3C,OAAO,oBAAC,8BAAW,uBAAM,WAA8B,EAAI,CAAC;SAC7D;QAED,IAAI,KAAK,CAAC,QAAQ,KAAK,8BAAsB,CAAC,OAAO,EAAE;YACrD,IAAM,WAAS,GAAG,mCAAmB,CAAC,KAAK,CAAC,CAAC;YAC7C,OAAO,CACL,oBAAC,4BAAS;gBACR,oBAAC,kCAAe,QAAE,WAAS,CAAC,QAAQ,CAAmB,EAEtD,MAAA,KAAK,CAAC,YAAY;mBAAE,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI,IAAI,OAAA;gBACrC,mCAAmC;gBACnC,yCAAyC;gBACzC,oBAAC,oBAAY,uBAAK,IAAI,EAAI,CAC3B,EAJsC,CAItC,CAAC,CACQ,CACb,CAAC;SACH;QAED,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,IAAM,WAAS,GAAG,yCAAyB,CAAC,KAAK,CAAC,CAAC;YACnD,OAAO,oBAAC,mCAAgB,uBAAK,WAAS,EAAI,CAAC;SAC5C;QAED,iCAAiC;QACjC,IAAI,CAAA,MAAA,KAAK,CAAC,YAAY,0CAAE,KAAK,KAAI,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACpE,IAAM,gBAAgB,GAAG,6BAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAC3D,IAAM,gBAAgB,GAAG,iCAAiB,CAAC,KAAK,CAAC,CAAC;YAElD,OAAO,CACL,oBAAC,uBAAI,uBAAK,gBAAgB;gBACxB,oBAAC,8BAAW;oBACV,oBAAC,2BAAQ,uBAAK,gBAAgB,IAAE,UAAU,UAAG,CACjC;gBACd,oBAAC,8BAAW;oBACV,oBAAC,2BAAQ,QACN,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI,IAAI,OAAA;oBACpC,mCAAmC;oBACnC,yCAAyC;oBACzC,oBAAC,oBAAY,uBAAK,IAAI,EAAI,CAC3B,EAJqC,CAIrC,CAAC,CACO,CACC,CACT,CACR,CAAC;SACH;QAED,IAAM,SAAS,GAAG,iCAAiB,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,oBAAC,2BAAQ,uBAAK,SAAS,EAAI,CAAC;IACrC,CAAC,CAAC;IAnDW,QAAA,YAAY,gBAmDvB","sourcesContent":["import * as React from 'react';\n\nimport { ContextualMenuItemType } from '@fluentui/react';\nimport type { IContextualMenuItem } from '@fluentui/react';\nimport {\n MenuItem,\n MenuDivider,\n MenuGroup,\n MenuGroupHeader,\n MenuTrigger,\n Menu,\n MenuList,\n MenuPopover,\n MenuItemCheckbox,\n MenuDividerProps,\n} from '@fluentui/react-components';\n\nimport { shimMenuHeaderProps, shimMenuItemCheckboxProps, shimMenuItemProps, shimMenuProps } from './shimMenuProps';\n\nexport const MenuItemShim = (props: IContextualMenuItem) => {\n if (props.itemType === ContextualMenuItemType.Divider) {\n const shimProps = shimMenuItemProps(props);\n return <MenuDivider {...(shimProps as MenuDividerProps)} />;\n }\n\n if (props.itemType === ContextualMenuItemType.Section) {\n const shimProps = shimMenuHeaderProps(props);\n return (\n <MenuGroup>\n <MenuGroupHeader>{shimProps.children}</MenuGroupHeader>\n {/* //TODO: sectionProps handling */}\n {props.subMenuProps?.items.map(item => (\n // key is added through item spread\n // eslint-disable-next-line react/jsx-key\n <MenuItemShim {...item} />\n ))}\n </MenuGroup>\n );\n }\n\n if (props.canCheck) {\n const shimProps = shimMenuItemCheckboxProps(props);\n return <MenuItemCheckbox {...shimProps} />;\n }\n\n // Nested Menu to handle submenus\n if (props.subMenuProps?.items && props.subMenuProps.items.length > 0) {\n const shimmedMenuProps = shimMenuProps(props.subMenuProps);\n const shimmedItemProps = shimMenuItemProps(props);\n\n return (\n <Menu {...shimmedMenuProps}>\n <MenuTrigger>\n <MenuItem {...shimmedItemProps} hasSubmenu />\n </MenuTrigger>\n <MenuPopover>\n <MenuList>\n {props.subMenuProps.items.map(item => (\n // key is added through item spread\n // eslint-disable-next-line react/jsx-key\n <MenuItemShim {...item} />\n ))}\n </MenuList>\n </MenuPopover>\n </Menu>\n );\n }\n\n const shimProps = shimMenuItemProps(props);\n return <MenuItem {...shimProps} />;\n};\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./MenuShim", "./shimMenuProps"], function (require, exports, tslib_1, MenuShim_1, shimMenuProps_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(MenuShim_1, exports);
|
|
5
|
+
tslib_1.__exportStar(shimMenuProps_1, exports);
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Menu/index.ts"],"names":[],"mappings":";;;IAAA,0CAA2B;IAC3B,+CAAgC","sourcesContent":["export * from './MenuShim';\nexport * from './shimMenuProps';\n"]}
|