@fluentui/react-migration-v8-v9 1.0.1

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 ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@fluentui/react-migration-v8-v9",
3
+ "entries": [
4
+ {
5
+ "date": "Tue, 25 Oct 2022 07:42:24 GMT",
6
+ "tag": "@fluentui/react-migration-v8-v9_v1.0.1",
7
+ "version": "1.0.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "gcox@microsoft.com",
12
+ "package": "@fluentui/react-migration-v8-v9",
13
+ "commit": "0467df35d2d95e7d782e48755f811af576490795",
14
+ "comment": "publishing migration package"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-migration-v8-v9",
19
+ "comment": "Bump @fluentui/react to v8.98.7",
20
+ "commit": "a1c97799460396fc90984176eeb4eb65851062eb"
21
+ }
22
+ ]
23
+ }
24
+ }
25
+ ]
26
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # Change Log - @fluentui/react-migration-v8-v9
2
+
3
+ This log was last generated on Tue, 25 Oct 2022 07:42:24 GMT and should not be manually modified.
4
+
5
+ <!-- Start content -->
6
+
7
+ ## [1.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-migration-v8-v9_v1.0.1)
8
+
9
+ Tue, 25 Oct 2022 07:42:24 GMT
10
+
11
+ ### Patches
12
+
13
+ - publishing migration package ([PR #25354](https://github.com/microsoft/fluentui/pull/25354) by gcox@microsoft.com)
14
+ - Bump @fluentui/react to v8.98.7 ([commit](https://github.com/microsoft/fluentui/commit/a1c97799460396fc90984176eeb4eb65851062eb) by beachball)
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ @fluentui/react-migration-v8-v9
2
+
3
+ Copyright (c) Microsoft Corporation
4
+
5
+ All rights reserved.
6
+
7
+ MIT License
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+
15
+ Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # @fluentui/react-migration-v8-v9
2
+
3
+ **React Migration v8 to v9 [Fluent UI React](https://react.fluentui.dev/)**
4
+
5
+ This package contains component shims that provide the props interface of a v8 component and render a v9 component.
6
+
7
+ Our recommendation is to avoid using shims and instead migrate from using v8 components to using v9 components in your codebase. Shims provide a convienient way to start migrating to v9 while defering the cost of updating a multitude of call points.
8
+
9
+ Shims depend on both v8 and v9, so carefully consider the impact using a shim may have on bundle size and render performance vs. migrating to v9 directly.
@@ -0,0 +1,200 @@
1
+ /// <reference types="react" />
2
+
3
+ import { BrandVariants } from '@fluentui/react-components';
4
+ import type { ButtonProps } from '@fluentui/react-components';
5
+ import type { IBaseButtonProps } from '@fluentui/react';
6
+ import type { IButtonProps } from '@fluentui/react';
7
+ import type { IContextualMenuItem } from '@fluentui/react';
8
+ import type { IContextualMenuProps } from '@fluentui/react';
9
+ import type { IPalette } from '@fluentui/react';
10
+ import { IStackItemProps } from '@fluentui/react';
11
+ import type { IStackProps } from '@fluentui/react';
12
+ import type { MenuProps } from '@fluentui/react-menu';
13
+ import * as React_2 from 'react';
14
+ import { Theme } from '@fluentui/react-components';
15
+ import { Theme as Theme_2 } from '@fluentui/react';
16
+
17
+ /**
18
+ * Shims a v8 ActionButton to render a v9 Button
19
+ */
20
+ declare const ActionButtonShim: React_2.ForwardRefExoticComponent<IButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
21
+ export { ActionButtonShim }
22
+ export { ActionButtonShim as CommandButtonShim }
23
+
24
+ export declare type AlphaColors = 5 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90;
25
+
26
+ export declare const black = "#000000";
27
+
28
+ export declare const blackAlpha: Record<AlphaColors, string>;
29
+
30
+ export declare const brandWeb: BrandVariants;
31
+
32
+ export declare const ButtonShim: React_2.ForwardRefExoticComponent<IBaseButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
33
+
34
+ /**
35
+ * Possible color variant values
36
+ */
37
+ export declare type ColorVariants = {
38
+ shade50: string;
39
+ shade40: string;
40
+ shade30: string;
41
+ shade20: string;
42
+ shade10: string;
43
+ primary: string;
44
+ tint10: string;
45
+ tint20: string;
46
+ tint30: string;
47
+ tint40: string;
48
+ tint50: string;
49
+ tint60: string;
50
+ };
51
+
52
+ /**
53
+ * Shims v8 CompoundButton to render a v9 CompoundButton
54
+ */
55
+ export declare const CompoundButtonShim: React_2.ForwardRefExoticComponent<IButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
56
+
57
+ /**
58
+ * Creates v9 brand colors from a v8 palette using interpolation
59
+ * A v8 palette has nine colors and v9 has sixteen colors.
60
+ */
61
+ export declare const createBrandVariants: (palette: IPalette, interpolation?: Interpolation) => BrandVariants;
62
+
63
+ /**
64
+ * Creates a v8 theme from v9 brand colors and theme.
65
+ * You can optionally pass a v8 base theme.
66
+ * Otherwise the default v8 theme is used.
67
+ *
68
+ * The v9 colors, fonts, and effects are applied on top of the v8 theme
69
+ * to allow v8 components to look as much like v9 components as possible.
70
+ */
71
+ export declare const createV8Theme: (brandColors: BrandVariants, themeV9: Theme, isDarkTheme?: boolean, themeV8?: Theme_2 | undefined) => Theme_2;
72
+
73
+ /**
74
+ * Creates a v9 theme from a v8 theme.
75
+ * You can optional pass a base v9 theme; otherwise webLightTheme is used.
76
+ */
77
+ export declare const createV9Theme: (themeV8: Theme_2, baseThemeV9?: Theme | undefined) => Theme;
78
+
79
+ /**
80
+ * Shims a v8 DefaultButton to render a v9 Button
81
+ */
82
+ export declare const DefaultButtonShim: React_2.ForwardRefExoticComponent<IButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
83
+
84
+ /**
85
+ * All the global shared colors and their shade/tint variants
86
+ */
87
+ export declare type GlobalSharedColors = {
88
+ darkRed: ColorVariants;
89
+ burgundy: ColorVariants;
90
+ cranberry: ColorVariants;
91
+ red: ColorVariants;
92
+ darkOrange: ColorVariants;
93
+ bronze: ColorVariants;
94
+ pumpkin: ColorVariants;
95
+ orange: ColorVariants;
96
+ peach: ColorVariants;
97
+ marigold: ColorVariants;
98
+ yellow: ColorVariants;
99
+ gold: ColorVariants;
100
+ brass: ColorVariants;
101
+ brown: ColorVariants;
102
+ darkBrown: ColorVariants;
103
+ lime: ColorVariants;
104
+ forest: ColorVariants;
105
+ seafoam: ColorVariants;
106
+ lightGreen: ColorVariants;
107
+ green: ColorVariants;
108
+ darkGreen: ColorVariants;
109
+ lightTeal: ColorVariants;
110
+ teal: ColorVariants;
111
+ darkTeal: ColorVariants;
112
+ cyan: ColorVariants;
113
+ steel: ColorVariants;
114
+ lightBlue: ColorVariants;
115
+ blue: ColorVariants;
116
+ royalBlue: ColorVariants;
117
+ darkBlue: ColorVariants;
118
+ cornflower: ColorVariants;
119
+ navy: ColorVariants;
120
+ lavender: ColorVariants;
121
+ purple: ColorVariants;
122
+ darkPurple: ColorVariants;
123
+ orchid: ColorVariants;
124
+ grape: ColorVariants;
125
+ berry: ColorVariants;
126
+ lilac: ColorVariants;
127
+ pink: ColorVariants;
128
+ hotPink: ColorVariants;
129
+ magenta: ColorVariants;
130
+ plum: ColorVariants;
131
+ beige: ColorVariants;
132
+ mink: ColorVariants;
133
+ silver: ColorVariants;
134
+ platinum: ColorVariants;
135
+ anchor: ColorVariants;
136
+ charcoal: ColorVariants;
137
+ };
138
+
139
+ export declare const grey: Record<Greys, string>;
140
+
141
+ export declare const grey14Alpha: Record<AlphaColors, string>;
142
+
143
+ export declare type Greys = 0 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 44 | 46 | 48 | 50 | 52 | 54 | 56 | 58 | 60 | 62 | 64 | 66 | 68 | 70 | 72 | 74 | 76 | 78 | 80 | 82 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100;
144
+
145
+ export declare const hcButtonFace = "#ffffff";
146
+
147
+ export declare const hcButtonText = "#000000";
148
+
149
+ export declare const hcCanvas = "#000000";
150
+
151
+ export declare const hcCanvasText = "#ffffff";
152
+
153
+ export declare const hcDisabled = "#3ff23f";
154
+
155
+ export declare const hcHighlight = "#1aebff";
156
+
157
+ export declare const hcHighlightText = "#000000";
158
+
159
+ export declare const hcHyperlink = "#ffff00";
160
+
161
+ declare type Interpolation = 'pairs' | 'primaryAndEnds';
162
+
163
+ export declare const MenuButtonShim: React_2.ForwardRefExoticComponent<IButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
164
+
165
+ export declare const MenuItemShim: (props: IContextualMenuItem) => JSX.Element;
166
+
167
+ /**
168
+ * Shims v8 PrimaryButton to render a v9 Button
169
+ */
170
+ export declare const PrimaryButtonShim: React_2.ForwardRefExoticComponent<IButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
171
+
172
+ export declare const sharedColors: GlobalSharedColors;
173
+
174
+ export declare const shimButtonProps: (props: IBaseButtonProps & React_2.RefAttributes<HTMLButtonElement>) => ButtonProps;
175
+
176
+ export declare const shimMenuProps: (props: IContextualMenuProps) => Partial<MenuProps>;
177
+
178
+ export declare const StackItemShim: (props: IStackItemProps) => JSX.Element;
179
+
180
+ export declare const StackShim: (props: IStackProps) => JSX.Element;
181
+
182
+ export declare type TextAlignment = 'inherit' | 'initial' | 'revert' | 'unset' | 'center' | 'end' | 'start' | 'justify' | 'left' | 'match-parent' | 'right';
183
+
184
+ export declare type TextAlignments = {
185
+ start: TextAlignment;
186
+ center: TextAlignment;
187
+ end: TextAlignment;
188
+ justify: TextAlignment;
189
+ };
190
+
191
+ /**
192
+ * Shims v8 ToggleButton to render a v9 ToggleButton
193
+ */
194
+ export declare const ToggleButtonShim: React_2.ForwardRefExoticComponent<IButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
195
+
196
+ export declare const white = "#ffffff";
197
+
198
+ export declare const whiteAlpha: Record<AlphaColors, string>;
199
+
200
+ export { }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@fluentui/react-migration-v8-v9",
3
+ "version": "1.0.1",
4
+ "description": "Migration shim components and methods for hybrid v8/v9 applications building on Fluent UI React.",
5
+ "main": "lib-commonjs/index.js",
6
+ "module": "lib/index.js",
7
+ "typings": "./dist/index.d.ts",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/microsoft/fluentui"
12
+ },
13
+ "license": "MIT",
14
+ "scripts": {
15
+ "build": "just-scripts build",
16
+ "clean": "just-scripts clean",
17
+ "code-style": "just-scripts code-style",
18
+ "just": "just-scripts",
19
+ "lint": "just-scripts lint",
20
+ "test": "jest --passWithNoTests",
21
+ "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor",
22
+ "type-check": "tsc -b tsconfig.json"
23
+ },
24
+ "devDependencies": {
25
+ "@fluentui/eslint-plugin": "*",
26
+ "@fluentui/react-conformance": "*",
27
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.16",
28
+ "@fluentui/scripts": "^1.0.0"
29
+ },
30
+ "dependencies": {
31
+ "@ctrl/tinycolor": "3.3.4",
32
+ "@fluentui/react": "^8.98.7",
33
+ "@fluentui/react-components": "^9.5.3",
34
+ "@fluentui/react-theme": "^9.1.1",
35
+ "@fluentui/react-utilities": "^9.1.2",
36
+ "@griffel/react": "^1.4.1",
37
+ "tslib": "^2.1.0"
38
+ },
39
+ "peerDependencies": {
40
+ "@types/react": ">=16.8.0 <19.0.0",
41
+ "@types/react-dom": ">=16.8.0 <19.0.0",
42
+ "react": ">=16.8.0 <19.0.0",
43
+ "react-dom": ">=16.8.0 <19.0.0"
44
+ },
45
+ "beachball": {
46
+ "disallowedChangeTypes": [
47
+ "major"
48
+ ]
49
+ },
50
+ "exports": {
51
+ ".": {
52
+ "types": "./dist/index.d.ts",
53
+ "import": "./lib/index.js",
54
+ "require": "./lib-commonjs/index.js"
55
+ },
56
+ "./package.json": "./package.json"
57
+ }
58
+ }