@azure/communication-react 1.8.1-alpha-202309300012 → 1.8.1-alpha-202310040013
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/dist/communication-react.d.ts +5 -6
- package/dist/dist-cjs/communication-react/index.js +883 -434
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +5 -7
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionMenu.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionMenu.js +5 -22
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionMenu.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionsFlyout.js +2 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionsFlyout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +2 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +0 -5
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +17 -13
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +9 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +79 -20
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +9 -8
- package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +15 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js +114 -93
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/SystemMessage.js +1 -1
- package/dist/dist-esm/react-components/src/components/SystemMessage.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +4 -4
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.d.ts +5 -7
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js +24 -9
- package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.d.ts +3 -2
- package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js +10 -6
- package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js +8 -2
- package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +10 -19
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +129 -119
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +8 -2
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SystemMessage.styles.js +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SystemMessage.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/v8StyleShim.d.ts +12 -0
- package/dist/dist-esm/react-components/src/components/styles/v8StyleShim.js +37 -0
- package/dist/dist-esm/react-components/src/components/styles/v8StyleShim.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils/Datetime.d.ts +7 -8
- package/dist/dist-esm/react-components/src/components/utils/Datetime.js +9 -31
- package/dist/dist-esm/react-components/src/components/utils/Datetime.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +1 -1
- package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.d.ts +3 -4
- package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js +40 -52
- package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.d.ts +22 -0
- package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js +29 -0
- package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js.map +1 -0
- package/dist/dist-esm/react-components/src/theming/themeDuplicates.d.ts +29 -0
- package/dist/dist-esm/react-components/src/theming/themeDuplicates.js +121 -0
- package/dist/dist-esm/react-components/src/theming/themeDuplicates.js.map +1 -0
- package/dist/dist-esm/react-components/src/theming/v9ThemeShim.d.ts +12 -0
- package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js +206 -0
- package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js.map +1 -0
- package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +2 -2
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +30 -27
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +22 -17
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +5 -5
- package/package.json +12 -11
- package/dist/dist-esm/northstar-wrapper/src/index.js +0 -2
- package/dist/dist-esm/northstar-wrapper/src/index.js.LICENSE.txt +0 -41
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { IStyle } from '@fluentui/react';
|
3
|
+
import { ComponentSlotStyle } from '../../types';
|
4
|
+
/**
|
5
|
+
* Function to create a React.CSSProperties object from a v8 style object.
|
6
|
+
* This function is still not ideal
|
7
|
+
* as v8Style can use pseudo-class selectors that style objects can't process correctly.
|
8
|
+
*
|
9
|
+
* @private
|
10
|
+
*/
|
11
|
+
export declare function createStyleFromV8Style(v8Style: IStyle | ComponentSlotStyle): React.CSSProperties | undefined;
|
12
|
+
//# sourceMappingURL=v8StyleShim.d.ts.map
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
/**
|
4
|
+
* Function to create a React.CSSProperties object from a v8 style object.
|
5
|
+
* This function is still not ideal
|
6
|
+
* as v8Style can use pseudo-class selectors that style objects can't process correctly.
|
7
|
+
*
|
8
|
+
* @private
|
9
|
+
*/
|
10
|
+
export function createStyleFromV8Style(v8Style) {
|
11
|
+
const result = {};
|
12
|
+
if (v8Style === undefined || v8Style === null || typeof v8Style === 'boolean' || typeof v8Style === 'string') {
|
13
|
+
return undefined;
|
14
|
+
}
|
15
|
+
else if (typeof v8Style === 'object') {
|
16
|
+
// v8Style is a style object
|
17
|
+
for (const record in v8Style) {
|
18
|
+
if (typeof v8Style[record] === 'string') {
|
19
|
+
// v8Style[record] is just a simple style
|
20
|
+
const msSuffix = 'MS';
|
21
|
+
if (record.startsWith(msSuffix)) {
|
22
|
+
// React.CSSProperties uses camelCase for MS properties but v8Style uses PascalCase
|
23
|
+
const newRecord = record.substring(0, msSuffix.length).toLowerCase + record.substring(msSuffix.length);
|
24
|
+
result[newRecord] = v8Style[record];
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
result[record] = v8Style[record];
|
28
|
+
}
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
result[record] = createStyleFromV8Style(v8Style[record]);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
return result;
|
36
|
+
}
|
37
|
+
//# sourceMappingURL=v8StyleShim.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"v8StyleShim.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/v8StyleShim.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAoC;IACzE,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC5G,OAAO,SAAS,CAAC;KAClB;SAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QACtC,4BAA4B;QAC5B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,IAAI,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE;gBACvC,yCAAyC;gBACzC,MAAM,QAAQ,GAAG,IAAI,CAAC;gBACtB,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;oBAC/B,mFAAmF;oBACnF,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;oBACvG,MAAM,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;iBACrC;qBAAM;oBACL,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;iBAClC;aACF;iBAAM;gBACL,MAAM,CAAC,MAAM,CAAC,GAAG,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;aAC1D;SACF;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IStyle } from '@fluentui/react';\nimport { ComponentSlotStyle } from '../../types';\n\n/**\n * Function to create a React.CSSProperties object from a v8 style object.\n * This function is still not ideal\n * as v8Style can use pseudo-class selectors that style objects can't process correctly.\n *\n * @private\n */\nexport function createStyleFromV8Style(v8Style: IStyle | ComponentSlotStyle): React.CSSProperties | undefined {\n const result = {};\n if (v8Style === undefined || v8Style === null || typeof v8Style === 'boolean' || typeof v8Style === 'string') {\n return undefined;\n } else if (typeof v8Style === 'object') {\n // v8Style is a style object\n for (const record in v8Style) {\n if (typeof v8Style[record] === 'string') {\n // v8Style[record] is just a simple style\n const msSuffix = 'MS';\n if (record.startsWith(msSuffix)) {\n // React.CSSProperties uses camelCase for MS properties but v8Style uses PascalCase\n const newRecord = record.substring(0, msSuffix.length).toLowerCase + record.substring(msSuffix.length);\n result[newRecord] = v8Style[record];\n } else {\n result[record] = v8Style[record];\n }\n } else {\n result[record] = createStyleFromV8Style(v8Style[record]);\n }\n }\n }\n\n return result;\n}\n"]}
|
@@ -8,16 +8,15 @@ export declare const formatTimeForChatMessage: (messageDate: Date) => string;
|
|
8
8
|
*/
|
9
9
|
export declare const formatDateForChatMessage: (messageDate: Date) => string;
|
10
10
|
/**
|
11
|
-
* Given a message date object in ISO8601 and a current date object, generates a user friendly timestamp text
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
* 2021-01-10 1:30 p.m.
|
11
|
+
* Given a message date object in ISO8601 and a current date object, generates a user friendly timestamp text
|
12
|
+
* using the system locale.
|
13
|
+
* <time in locale format>.
|
14
|
+
* Yesterday <time in locale format>.
|
15
|
+
* <dateStrings day of week> <time in locale format>.
|
16
|
+
* <date in locale format> <time in locale format>.
|
18
17
|
*
|
19
18
|
* If message is after yesterday, then only show the time.
|
20
|
-
* If message is before
|
19
|
+
* If message is before yesterday and after day before yesterday, then show 'Yesterday' plus the time.
|
21
20
|
* If message is before day before yesterday and within the current week, then show 'Monday/Tuesday/etc' plus the time.
|
22
21
|
* - We consider start of the week as Sunday. If current day is Sunday, then any time before that is in previous week.
|
23
22
|
* If message is in previous or older weeks, then show date string plus the time.
|
@@ -4,46 +4,24 @@
|
|
4
4
|
* @private
|
5
5
|
*/
|
6
6
|
export const formatTimeForChatMessage = (messageDate) => {
|
7
|
-
|
8
|
-
let minutes = messageDate.getMinutes().toString();
|
9
|
-
const isAm = hours < 12;
|
10
|
-
if (hours > 12) {
|
11
|
-
hours = hours - 12;
|
12
|
-
}
|
13
|
-
if (hours === 0) {
|
14
|
-
hours = 12;
|
15
|
-
}
|
16
|
-
if (minutes.length < 2) {
|
17
|
-
minutes = '0' + minutes;
|
18
|
-
}
|
19
|
-
return hours.toString() + ':' + minutes + ' ' + (isAm ? 'a.m.' : 'p.m.');
|
7
|
+
return messageDate.toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });
|
20
8
|
};
|
21
9
|
/**
|
22
10
|
* @private
|
23
11
|
*/
|
24
12
|
export const formatDateForChatMessage = (messageDate) => {
|
25
|
-
|
26
|
-
let month = (messageDate.getMonth() + 1).toString();
|
27
|
-
let day = messageDate.getDate().toString();
|
28
|
-
if (month.length === 1) {
|
29
|
-
month = '0' + month;
|
30
|
-
}
|
31
|
-
if (day.length === 1) {
|
32
|
-
day = '0' + day;
|
33
|
-
}
|
34
|
-
return year + '-' + month + '-' + day;
|
13
|
+
return messageDate.toLocaleDateString();
|
35
14
|
};
|
36
15
|
/**
|
37
|
-
* Given a message date object in ISO8601 and a current date object, generates a user friendly timestamp text
|
38
|
-
*
|
39
|
-
*
|
40
|
-
*
|
41
|
-
*
|
42
|
-
*
|
43
|
-
* 2021-01-10 1:30 p.m.
|
16
|
+
* Given a message date object in ISO8601 and a current date object, generates a user friendly timestamp text
|
17
|
+
* using the system locale.
|
18
|
+
* <time in locale format>.
|
19
|
+
* Yesterday <time in locale format>.
|
20
|
+
* <dateStrings day of week> <time in locale format>.
|
21
|
+
* <date in locale format> <time in locale format>.
|
44
22
|
*
|
45
23
|
* If message is after yesterday, then only show the time.
|
46
|
-
* If message is before
|
24
|
+
* If message is before yesterday and after day before yesterday, then show 'Yesterday' plus the time.
|
47
25
|
* If message is before day before yesterday and within the current week, then show 'Monday/Tuesday/etc' plus the time.
|
48
26
|
* - We consider start of the week as Sunday. If current day is Sunday, then any time before that is in previous week.
|
49
27
|
* If message is in previous or older weeks, then show date string plus the time.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Datetime.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/Datetime.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,WAAiB,EAAU,EAAE;IACpE,
|
1
|
+
{"version":3,"file":"Datetime.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/Datetime.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,WAAiB,EAAU,EAAE;IACpE,OAAO,WAAW,CAAC,kBAAkB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AACpF,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,WAAiB,EAAU,EAAE;IACpE,OAAO,WAAW,CAAC,kBAAkB,EAAE,CAAC;AAC1C,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,WAAiB,EACjB,SAAe,EACf,WAAiC,EACzB,EAAE;IACV,qFAAqF;IACrF,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAChG,IAAI,WAAW,GAAG,UAAU,EAAE;QAC5B,OAAO,wBAAwB,CAAC,WAAW,CAAC,CAAC;KAC9C;IAED,qFAAqF;IACrF,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACvG,IAAI,WAAW,GAAG,aAAa,EAAE;QAC/B,OAAO,WAAW,CAAC,SAAS,GAAG,GAAG,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;KAC5E;IAED,iGAAiG;IACjG,0BAA0B;IAC1B,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;IACnC,IAAI,OAAO,KAAK,CAAC,EAAE;QACjB,OAAO,wBAAwB,CAAC,WAAW,CAAC,GAAG,GAAG,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;KAC5F;IAED,6FAA6F;IAC7F,MAAM,qBAAqB,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC;IACrH,IAAI,WAAW,GAAG,qBAAqB,EAAE;QACvC,OAAO,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,WAAW,CAAC,GAAG,GAAG,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;KACtG;IAED,mGAAmG;IACnG,OAAO,wBAAwB,CAAC,WAAW,CAAC,GAAG,GAAG,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;AAC7F,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,WAAiC,EAAU,EAAE;IAC9E,QAAQ,GAAG,EAAE;QACX,KAAK,CAAC;YACJ,OAAO,WAAW,CAAC,MAAM,CAAC;QAC5B,KAAK,CAAC;YACJ,OAAO,WAAW,CAAC,MAAM,CAAC;QAC5B,KAAK,CAAC;YACJ,OAAO,WAAW,CAAC,OAAO,CAAC;QAC7B,KAAK,CAAC;YACJ,OAAO,WAAW,CAAC,SAAS,CAAC;QAC/B,KAAK,CAAC;YACJ,OAAO,WAAW,CAAC,QAAQ,CAAC;QAC9B,KAAK,CAAC;YACJ,OAAO,WAAW,CAAC,MAAM,CAAC;QAC5B,KAAK,CAAC;YACJ,OAAO,WAAW,CAAC,QAAQ,CAAC;QAC9B;YACE,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,UAAU,CAAC,CAAC;KAClD;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageThreadStrings } from '../MessageThread';\n\n/**\n * @private\n */\nexport const formatTimeForChatMessage = (messageDate: Date): string => {\n return messageDate.toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });\n};\n\n/**\n * @private\n */\nexport const formatDateForChatMessage = (messageDate: Date): string => {\n return messageDate.toLocaleDateString();\n};\n\n/**\n * Given a message date object in ISO8601 and a current date object, generates a user friendly timestamp text\n * using the system locale.\n * <time in locale format>.\n * Yesterday <time in locale format>.\n * <dateStrings day of week> <time in locale format>.\n * <date in locale format> <time in locale format>.\n *\n * If message is after yesterday, then only show the time.\n * If message is before yesterday and after day before yesterday, then show 'Yesterday' plus the time.\n * If message is before day before yesterday and within the current week, then show 'Monday/Tuesday/etc' plus the time.\n * - We consider start of the week as Sunday. If current day is Sunday, then any time before that is in previous week.\n * If message is in previous or older weeks, then show date string plus the time.\n *\n * @param messageDate - date of message\n * @param currentDate - date used as offset to create the user friendly timestamp (e.g. to create 'Yesterday' instead of an absolute date)\n *\n * @private\n */\nexport const formatTimestampForChatMessage = (\n messageDate: Date,\n todayDate: Date,\n dateStrings: MessageThreadStrings\n): string => {\n // If message was in the same day timestamp string is just the time like '1:30 p.m.'.\n const startOfDay = new Date(todayDate.getFullYear(), todayDate.getMonth(), todayDate.getDate());\n if (messageDate > startOfDay) {\n return formatTimeForChatMessage(messageDate);\n }\n\n // If message was yesterday then timestamp string is like this 'Yesterday 1:30 p.m.'.\n const yesterdayDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), todayDate.getDate() - 1);\n if (messageDate > yesterdayDate) {\n return dateStrings.yesterday + ' ' + formatTimeForChatMessage(messageDate);\n }\n\n // If message was before Sunday and today is Sunday (start of week) then timestamp string is like\n // '2021-01-10 1:30 p.m.'.\n const weekDay = todayDate.getDay();\n if (weekDay === 0) {\n return formatDateForChatMessage(messageDate) + ' ' + formatTimeForChatMessage(messageDate);\n }\n\n // If message was before first day of the week then timestamp string is like Monday 1:30 p.m.\n const firstDayOfTheWeekDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), todayDate.getDate() - weekDay);\n if (messageDate > firstDayOfTheWeekDate) {\n return dayToDayName(messageDate.getDay(), dateStrings) + ' ' + formatTimeForChatMessage(messageDate);\n }\n\n // If message date is in previous or older weeks then timestamp string is like 2021-01-10 1:30 p.m.\n return formatDateForChatMessage(messageDate) + ' ' + formatTimeForChatMessage(messageDate);\n};\n\nconst dayToDayName = (day: number, dateStrings: MessageThreadStrings): string => {\n switch (day) {\n case 0:\n return dateStrings.sunday;\n case 1:\n return dateStrings.monday;\n case 2:\n return dateStrings.tuesday;\n case 3:\n return dateStrings.wednesday;\n case 4:\n return dateStrings.thursday;\n case 5:\n return dateStrings.friday;\n case 6:\n return dateStrings.saturday;\n default:\n throw new Error(`Invalid day [${day}] passed`);\n }\n};\n"]}
|
@@ -147,7 +147,7 @@
|
|
147
147
|
"newMessagesIndicator": "New messages",
|
148
148
|
"noDisplayNameSub": "No name",
|
149
149
|
"editBoxCancelButton": "Cancel",
|
150
|
-
"editBoxSubmitButton": "
|
150
|
+
"editBoxSubmitButton": "Done",
|
151
151
|
"messageReadCount": "Read by {messageReadByCount} of {remoteParticipantsCount}",
|
152
152
|
"actionMenuMoreOptions": "More Options",
|
153
153
|
"downloadFile": "Download file",
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import { PartialTheme, Theme } from '@fluentui/react';
|
3
3
|
/**
|
4
4
|
* Props for {@link FluentThemeProvider}.
|
5
5
|
*
|
@@ -20,9 +20,8 @@ export interface FluentThemeProviderProps {
|
|
20
20
|
* Provider to apply a Fluent theme across this library's react components.
|
21
21
|
*
|
22
22
|
* @remarks Components in this library are composed primarily from [Fluent UI](https://developer.microsoft.com/fluentui#/controls/web),
|
23
|
-
* controls,
|
24
|
-
* This provider handles applying any theme provided to
|
25
|
-
*
|
23
|
+
* controls, mixing v8 and v9 controls.
|
24
|
+
* This provider handles applying any theme provided to the underlying Fluent UI controls. *
|
26
25
|
* @public
|
27
26
|
*/
|
28
27
|
export declare const FluentThemeProvider: (props: FluentThemeProviderProps) => JSX.Element;
|
@@ -2,73 +2,55 @@
|
|
2
2
|
// Licensed under the MIT License.
|
3
3
|
import React, { createContext, useContext } from 'react';
|
4
4
|
import { ThemeProvider, getTheme, mergeThemes, mergeStyles } from '@fluentui/react';
|
5
|
-
import { mergeThemes as mergeNorthstarThemes, Provider, teamsTheme } from "../../../northstar-wrapper/src";
|
6
5
|
import { lightTheme } from './themes';
|
7
6
|
const wrapper = mergeStyles({
|
8
7
|
height: '100%',
|
9
8
|
width: '100%',
|
10
|
-
overflow: 'auto'
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
const ThemeContext = createContext(defaultTheme);
|
15
|
-
const initialFluentNorthstarTheme = mergeNorthstarThemes(teamsTheme, {
|
16
|
-
componentStyles: {
|
17
|
-
ChatMessage: {
|
18
|
-
root: {
|
19
|
-
lineHeight: '1.4286'
|
20
|
-
}
|
21
|
-
}
|
9
|
+
overflow: 'auto',
|
10
|
+
// Add NorthStar styling used previously in the library
|
11
|
+
'*': {
|
12
|
+
boxSizing: 'border-box'
|
22
13
|
},
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
14
|
+
'*:before': {
|
15
|
+
boxSizing: 'border-box'
|
16
|
+
},
|
17
|
+
'*:after': {
|
18
|
+
boxSizing: 'border-box'
|
19
|
+
},
|
20
|
+
/* Adding priority for HTML `hidden` attribute to be applied correctly */
|
21
|
+
'[hidden]': {
|
22
|
+
display: 'none!important'
|
32
23
|
}
|
33
24
|
});
|
25
|
+
const defaultTheme = Object.assign({}, mergeThemes(getTheme(), lightTheme));
|
26
|
+
/** Theme context for library's react components */
|
27
|
+
const ThemeContext = createContext(defaultTheme);
|
28
|
+
const SingleUsageCheckContext = createContext(false);
|
34
29
|
/**
|
35
30
|
* Provider to apply a Fluent theme across this library's react components.
|
36
31
|
*
|
37
32
|
* @remarks Components in this library are composed primarily from [Fluent UI](https://developer.microsoft.com/fluentui#/controls/web),
|
38
|
-
* controls,
|
39
|
-
* This provider handles applying any theme provided to
|
40
|
-
*
|
33
|
+
* controls, mixing v8 and v9 controls.
|
34
|
+
* This provider handles applying any theme provided to the underlying Fluent UI controls. *
|
41
35
|
* @public
|
42
36
|
*/
|
43
37
|
export const FluentThemeProvider = (props) => {
|
44
38
|
const { fluentTheme, rtl, children } = props;
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
componentStyles: {
|
61
|
-
ChatMessage: {
|
62
|
-
timestamp: {
|
63
|
-
WebkitTextFillColor: fluentUITheme.palette.neutralSecondary
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
// add more northstar components to align with Fluent UI theme
|
68
|
-
});
|
69
|
-
return (React.createElement(ThemeContext.Provider, { value: fluentUITheme },
|
70
|
-
React.createElement(ThemeProvider, { theme: fluentUITheme, className: wrapper },
|
71
|
-
React.createElement(Provider, { theme: fluentNorthstarTheme, className: wrapper, rtl: rtl }, children))));
|
39
|
+
/**
|
40
|
+
* Pass only the children if we previously wrapped.
|
41
|
+
* This is to prevent the provider from being applied
|
42
|
+
* multiple times and wiping out configuration like RTL
|
43
|
+
* FluentThemeProvider
|
44
|
+
*/
|
45
|
+
const alreadyWrapped = useSingleUsageCheck();
|
46
|
+
if (alreadyWrapped) {
|
47
|
+
return React.createElement(React.Fragment, null, children);
|
48
|
+
}
|
49
|
+
let fluentV8Theme = mergeThemes(defaultTheme, fluentTheme);
|
50
|
+
fluentV8Theme = mergeThemes(fluentV8Theme, { rtl });
|
51
|
+
return (React.createElement(SingleUsageCheckContext.Provider, { value: true },
|
52
|
+
React.createElement(ThemeContext.Provider, { value: fluentV8Theme },
|
53
|
+
React.createElement(ThemeProvider, { theme: fluentV8Theme, className: wrapper }, children))));
|
72
54
|
};
|
73
55
|
/**
|
74
56
|
* React hook to access theme
|
@@ -76,4 +58,10 @@ export const FluentThemeProvider = (props) => {
|
|
76
58
|
* @public
|
77
59
|
*/
|
78
60
|
export const useTheme = () => useContext(ThemeContext);
|
61
|
+
/**
|
62
|
+
* This is used to prevent the provider from being applied multiple times.
|
63
|
+
*
|
64
|
+
* @private
|
65
|
+
*/
|
66
|
+
const useSingleUsageCheck = () => useContext(SingleUsageCheckContext);
|
79
67
|
//# sourceMappingURL=FluentThemeProvider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FluentThemeProvider.js","sourceRoot":"","sources":["../../../../../../react-components/src/theming/FluentThemeProvider.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,aAAa,EAAuB,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"FluentThemeProvider.js","sourceRoot":"","sources":["../../../../../../react-components/src/theming/FluentThemeProvider.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,aAAa,EAAuB,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAmBtC,MAAM,OAAO,GAAG,WAAW,CAAC;IAC1B,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,uDAAuD;IACvD,GAAG,EAAE;QACH,SAAS,EAAE,YAAY;KACxB;IACD,UAAU,EAAE;QACV,SAAS,EAAE,YAAY;KACxB;IACD,SAAS,EAAE;QACT,SAAS,EAAE,YAAY;KACxB;IACD,yEAAyE;IACzE,UAAU,EAAE;QACV,OAAO,EAAE,gBAAgB;KAC1B;CACF,CAAC,CAAC;AAEH,MAAM,YAAY,qBACb,WAAW,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,CACvC,CAAC;AAEF,mDAAmD;AACnD,MAAM,YAAY,GAAG,aAAa,CAAQ,YAAY,CAAC,CAAC;AACxD,MAAM,uBAAuB,GAAG,aAAa,CAAU,KAAK,CAAC,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAA+B,EAAe,EAAE;IAClF,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE7C;;;;;OAKG;IACH,MAAM,cAAc,GAAG,mBAAmB,EAAE,CAAC;IAC7C,IAAI,cAAc,EAAE;QAClB,OAAO,0CAAG,QAAQ,CAAI,CAAC;KACxB;IAED,IAAI,aAAa,GAAU,WAAW,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAClE,aAAa,GAAG,WAAW,CAAC,aAAa,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAEpD,OAAO,CACL,oBAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI;QAC3C,oBAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa;YACzC,oBAAC,aAAa,IAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,IACpD,QAAQ,CACK,CACM,CACS,CACpC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAU,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,GAAY,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { createContext, useContext } from 'react';\nimport { ThemeProvider, PartialTheme, Theme, getTheme, mergeThemes, mergeStyles } from '@fluentui/react';\nimport { lightTheme } from './themes';\n\n/**\n * Props for {@link FluentThemeProvider}.\n *\n * @public\n */\nexport interface FluentThemeProviderProps {\n /** Children to be themed. */\n children: React.ReactNode;\n /** Theme for components. Defaults to a light theme if not provided. */\n fluentTheme?: PartialTheme | Theme;\n /**\n * Whether components are displayed right-to-left\n * @defaultValue `false`\n */\n rtl?: boolean;\n}\n\nconst wrapper = mergeStyles({\n height: '100%',\n width: '100%',\n overflow: 'auto',\n // Add NorthStar styling used previously in the library\n '*': {\n boxSizing: 'border-box'\n },\n '*:before': {\n boxSizing: 'border-box'\n },\n '*:after': {\n boxSizing: 'border-box'\n },\n /* Adding priority for HTML `hidden` attribute to be applied correctly */\n '[hidden]': {\n display: 'none!important'\n }\n});\n\nconst defaultTheme: Theme = {\n ...mergeThemes(getTheme(), lightTheme)\n};\n\n/** Theme context for library's react components */\nconst ThemeContext = createContext<Theme>(defaultTheme);\nconst SingleUsageCheckContext = createContext<boolean>(false);\n\n/**\n * Provider to apply a Fluent theme across this library's react components.\n *\n * @remarks Components in this library are composed primarily from [Fluent UI](https://developer.microsoft.com/fluentui#/controls/web),\n * controls, mixing v8 and v9 controls.\n * This provider handles applying any theme provided to the underlying Fluent UI controls. *\n * @public\n */\nexport const FluentThemeProvider = (props: FluentThemeProviderProps): JSX.Element => {\n const { fluentTheme, rtl, children } = props;\n\n /**\n * Pass only the children if we previously wrapped.\n * This is to prevent the provider from being applied\n * multiple times and wiping out configuration like RTL\n * FluentThemeProvider\n */\n const alreadyWrapped = useSingleUsageCheck();\n if (alreadyWrapped) {\n return <>{children}</>;\n }\n\n let fluentV8Theme: Theme = mergeThemes(defaultTheme, fluentTheme);\n fluentV8Theme = mergeThemes(fluentV8Theme, { rtl });\n\n return (\n <SingleUsageCheckContext.Provider value={true}>\n <ThemeContext.Provider value={fluentV8Theme}>\n <ThemeProvider theme={fluentV8Theme} className={wrapper}>\n {children}\n </ThemeProvider>\n </ThemeContext.Provider>\n </SingleUsageCheckContext.Provider>\n );\n};\n\n/**\n * React hook to access theme\n *\n * @public\n */\nexport const useTheme = (): Theme => useContext(ThemeContext);\n\n/**\n * This is used to prevent the provider from being applied multiple times.\n *\n * @private\n */\nconst useSingleUsageCheck = (): boolean => useContext(SingleUsageCheckContext);\n"]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Theme as ThemeV8 } from '@fluentui/react';
|
3
|
+
/**
|
4
|
+
* Props for {@link FluentThemeProvider}.
|
5
|
+
*
|
6
|
+
* @private
|
7
|
+
*/
|
8
|
+
export interface FluentV9ThemeProviderProps {
|
9
|
+
/** Children to be themed. */
|
10
|
+
children: React.ReactNode;
|
11
|
+
/** FluentUI v8 theme to be mapped to FluentUI v9 theme */
|
12
|
+
v8Theme: ThemeV8;
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* @private
|
16
|
+
*/
|
17
|
+
export declare const useFluentV9Wrapper: () => Record<"body", string>;
|
18
|
+
/**
|
19
|
+
* @private
|
20
|
+
*/
|
21
|
+
export declare const FluentV9ThemeProvider: (props: FluentV9ThemeProviderProps) => JSX.Element;
|
22
|
+
//# sourceMappingURL=FluentV9ThemeProvider.d.ts.map
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
import React from 'react';
|
4
|
+
import { makeStyles, shorthands, FluentProvider } from '@fluentui/react-components';
|
5
|
+
import { createV9Theme } from './v9ThemeShim';
|
6
|
+
import { TextDirectionProvider } from '@griffel/react';
|
7
|
+
/**
|
8
|
+
* @private
|
9
|
+
*/
|
10
|
+
export const useFluentV9Wrapper = makeStyles({
|
11
|
+
body: Object.assign(Object.assign(Object.assign(Object.assign({ height: '100%' }, shorthands.margin(0)), shorthands.overflow('hidden')), shorthands.padding(0)), { width: '100%' })
|
12
|
+
});
|
13
|
+
/**
|
14
|
+
* @private
|
15
|
+
*/
|
16
|
+
export const FluentV9ThemeProvider = (props) => {
|
17
|
+
const { v8Theme, children } = props;
|
18
|
+
const v9Theme = createV9Theme(v8Theme);
|
19
|
+
const dir = v8Theme.rtl ? 'rtl' : 'ltr';
|
20
|
+
return (
|
21
|
+
// TextDirectionProvider is needed to fix issue with direction value update in FluentProvider
|
22
|
+
React.createElement(TextDirectionProvider, { dir: dir },
|
23
|
+
React.createElement(FluentProviderWithStylesOverrides, { theme: v9Theme, dir: dir }, children)));
|
24
|
+
};
|
25
|
+
const FluentProviderWithStylesOverrides = (props) => {
|
26
|
+
const classes = useFluentV9Wrapper();
|
27
|
+
return React.createElement(FluentProvider, Object.assign({}, props, { className: classes.body }));
|
28
|
+
};
|
29
|
+
//# sourceMappingURL=FluentV9ThemeProvider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FluentV9ThemeProvider.js","sourceRoot":"","sources":["../../../../../../react-components/src/theming/FluentV9ThemeProvider.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAuB,MAAM,4BAA4B,CAAC;AAEzG,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAcvD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;IAC3C,IAAI,4DACF,MAAM,EAAE,MAAM,IACX,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,GACpB,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAC7B,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,KACxB,KAAK,EAAE,MAAM,GACd;CACF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAiC,EAAe,EAAE;IACtF,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IAExC,OAAO;IACL,6FAA6F;IAC7F,oBAAC,qBAAqB,IAAC,GAAG,EAAE,GAAG;QAE7B,oBAAC,iCAAiC,IAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IACxD,QAAQ,CACyB,CACd,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,iCAAiC,GAAkC,CAAC,KAAK,EAAE,EAAE;IACjF,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,oBAAC,cAAc,oBAAK,KAAK,IAAE,SAAS,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC;AAChE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { makeStyles, shorthands, FluentProvider, FluentProviderProps } from '@fluentui/react-components';\nimport { Theme as ThemeV8 } from '@fluentui/react';\nimport { createV9Theme } from './v9ThemeShim';\nimport { TextDirectionProvider } from '@griffel/react';\n\n/**\n * Props for {@link FluentThemeProvider}.\n *\n * @private\n */\nexport interface FluentV9ThemeProviderProps {\n /** Children to be themed. */\n children: React.ReactNode;\n /** FluentUI v8 theme to be mapped to FluentUI v9 theme */\n v8Theme: ThemeV8;\n}\n\n/**\n * @private\n */\nexport const useFluentV9Wrapper = makeStyles({\n body: {\n height: '100%',\n ...shorthands.margin(0),\n ...shorthands.overflow('hidden'),\n ...shorthands.padding(0),\n width: '100%'\n }\n});\n\n/**\n * @private\n */\nexport const FluentV9ThemeProvider = (props: FluentV9ThemeProviderProps): JSX.Element => {\n const { v8Theme, children } = props;\n const v9Theme = createV9Theme(v8Theme);\n const dir = v8Theme.rtl ? 'rtl' : 'ltr';\n\n return (\n // TextDirectionProvider is needed to fix issue with direction value update in FluentProvider\n <TextDirectionProvider dir={dir}>\n {/* Wrapper is required to call \"useClasses\" hook with proper context values */}\n <FluentProviderWithStylesOverrides theme={v9Theme} dir={dir}>\n {children}\n </FluentProviderWithStylesOverrides>\n </TextDirectionProvider>\n );\n};\n\nconst FluentProviderWithStylesOverrides: React.FC<FluentProviderProps> = (props) => {\n const classes = useFluentV9Wrapper();\n\n return <FluentProvider {...props} className={classes.body} />;\n};\n"]}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/**
|
2
|
+
* @private
|
3
|
+
*/
|
4
|
+
export declare const grey: Record<Greys, string>;
|
5
|
+
/**
|
6
|
+
* @private
|
7
|
+
*/
|
8
|
+
export declare const whiteAlpha: Record<AlphaColors, string>;
|
9
|
+
/**
|
10
|
+
* @private
|
11
|
+
*/
|
12
|
+
export declare const blackAlpha: Record<AlphaColors, string>;
|
13
|
+
/**
|
14
|
+
* @private
|
15
|
+
*/
|
16
|
+
export declare const grey10Alpha: Record<AlphaColors, string>;
|
17
|
+
/**
|
18
|
+
* @private
|
19
|
+
*/
|
20
|
+
export declare const grey12Alpha: Record<AlphaColors, string>;
|
21
|
+
/**
|
22
|
+
* @private
|
23
|
+
*/
|
24
|
+
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;
|
25
|
+
/**
|
26
|
+
* @private
|
27
|
+
*/
|
28
|
+
export declare type AlphaColors = 5 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90;
|
29
|
+
//# sourceMappingURL=themeDuplicates.d.ts.map
|
@@ -0,0 +1,121 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT License.
|
3
|
+
// These color records are required for createV9Theme
|
4
|
+
// For more info, check https://react.fluentui.dev/iframe.html?viewMode=docs&id=concepts-migration-from-v8-components-theme-migration--page#compatible-themes
|
5
|
+
/**
|
6
|
+
* @private
|
7
|
+
*/
|
8
|
+
export const grey = {
|
9
|
+
'0': '#000000',
|
10
|
+
'2': '#050505',
|
11
|
+
'4': '#0a0a0a',
|
12
|
+
'6': '#0f0f0f',
|
13
|
+
'8': '#141414',
|
14
|
+
'10': '#1a1a1a',
|
15
|
+
'12': '#1f1f1f',
|
16
|
+
'14': '#242424',
|
17
|
+
'16': '#292929',
|
18
|
+
'18': '#2e2e2e',
|
19
|
+
'20': '#333333',
|
20
|
+
'22': '#383838',
|
21
|
+
'24': '#3d3d3d',
|
22
|
+
'26': '#424242',
|
23
|
+
'28': '#474747',
|
24
|
+
'30': '#4d4d4d',
|
25
|
+
'32': '#525252',
|
26
|
+
'34': '#575757',
|
27
|
+
'36': '#5c5c5c',
|
28
|
+
'38': '#616161',
|
29
|
+
'40': '#666666',
|
30
|
+
'42': '#6b6b6b',
|
31
|
+
'44': '#707070',
|
32
|
+
'46': '#757575',
|
33
|
+
'48': '#7a7a7a',
|
34
|
+
'50': '#808080',
|
35
|
+
'52': '#858585',
|
36
|
+
'54': '#8a8a8a',
|
37
|
+
'56': '#8f8f8f',
|
38
|
+
'58': '#949494',
|
39
|
+
'60': '#999999',
|
40
|
+
'62': '#9e9e9e',
|
41
|
+
'64': '#a3a3a3',
|
42
|
+
'66': '#a8a8a8',
|
43
|
+
'68': '#adadad',
|
44
|
+
'70': '#b3b3b3',
|
45
|
+
'72': '#b8b8b8',
|
46
|
+
'74': '#bdbdbd',
|
47
|
+
'76': '#c2c2c2',
|
48
|
+
'78': '#c7c7c7',
|
49
|
+
'80': '#cccccc',
|
50
|
+
'82': '#d1d1d1',
|
51
|
+
'84': '#d6d6d6',
|
52
|
+
'86': '#dbdbdb',
|
53
|
+
'88': '#e0e0e0',
|
54
|
+
'90': '#e6e6e6',
|
55
|
+
'92': '#ebebeb',
|
56
|
+
'94': '#f0f0f0',
|
57
|
+
'96': '#f5f5f5',
|
58
|
+
'98': '#fafafa',
|
59
|
+
'100': '#ffffff'
|
60
|
+
};
|
61
|
+
/**
|
62
|
+
* @private
|
63
|
+
*/
|
64
|
+
export const whiteAlpha = {
|
65
|
+
'5': 'rgba(255, 255, 255, 0.05)',
|
66
|
+
'10': 'rgba(255, 255, 255, 0.1)',
|
67
|
+
'20': 'rgba(255, 255, 255, 0.2)',
|
68
|
+
'30': 'rgba(255, 255, 255, 0.3)',
|
69
|
+
'40': 'rgba(255, 255, 255, 0.4)',
|
70
|
+
'50': 'rgba(255, 255, 255, 0.5)',
|
71
|
+
'60': 'rgba(255, 255, 255, 0.6)',
|
72
|
+
'70': 'rgba(255, 255, 255, 0.7)',
|
73
|
+
'80': 'rgba(255, 255, 255, 0.8)',
|
74
|
+
'90': 'rgba(255, 255, 255, 0.9)'
|
75
|
+
};
|
76
|
+
/**
|
77
|
+
* @private
|
78
|
+
*/
|
79
|
+
export const blackAlpha = {
|
80
|
+
'5': 'rgba(0, 0, 0, 0.05)',
|
81
|
+
'10': 'rgba(0, 0, 0, 0.1)',
|
82
|
+
'20': 'rgba(0, 0, 0, 0.2)',
|
83
|
+
'30': 'rgba(0, 0, 0, 0.3)',
|
84
|
+
'40': 'rgba(0, 0, 0, 0.4)',
|
85
|
+
'50': 'rgba(0, 0, 0, 0.5)',
|
86
|
+
'60': 'rgba(0, 0, 0, 0.6)',
|
87
|
+
'70': 'rgba(0, 0, 0, 0.7)',
|
88
|
+
'80': 'rgba(0, 0, 0, 0.8)',
|
89
|
+
'90': 'rgba(0, 0, 0, 0.9)'
|
90
|
+
};
|
91
|
+
/**
|
92
|
+
* @private
|
93
|
+
*/
|
94
|
+
export const grey10Alpha = {
|
95
|
+
'5': 'rgba(26, 26, 26, 0.05)',
|
96
|
+
'10': 'rgba(26, 26, 26, 0.1)',
|
97
|
+
'20': 'rgba(26, 26, 26, 0.2)',
|
98
|
+
'30': 'rgba(26, 26, 26, 0.3)',
|
99
|
+
'40': 'rgba(26, 26, 26, 0.4)',
|
100
|
+
'50': 'rgba(26, 26, 26, 0.5)',
|
101
|
+
'60': 'rgba(26, 26, 26, 0.6)',
|
102
|
+
'70': 'rgba(26, 26, 26, 0.7)',
|
103
|
+
'80': 'rgba(26, 26, 26, 0.8)',
|
104
|
+
'90': 'rgba(26, 26, 26, 0.9)'
|
105
|
+
};
|
106
|
+
/**
|
107
|
+
* @private
|
108
|
+
*/
|
109
|
+
export const grey12Alpha = {
|
110
|
+
'5': 'rgba(31, 31, 31, 0.05)',
|
111
|
+
'10': 'rgba(31, 31, 31, 0.1)',
|
112
|
+
'20': 'rgba(31, 31, 31, 0.2)',
|
113
|
+
'30': 'rgba(31, 31, 31, 0.3)',
|
114
|
+
'40': 'rgba(31, 31, 31, 0.4)',
|
115
|
+
'50': 'rgba(31, 31, 31, 0.5)',
|
116
|
+
'60': 'rgba(31, 31, 31, 0.6)',
|
117
|
+
'70': 'rgba(31, 31, 31, 0.7)',
|
118
|
+
'80': 'rgba(31, 31, 31, 0.8)',
|
119
|
+
'90': 'rgba(31, 31, 31, 0.9)'
|
120
|
+
};
|
121
|
+
//# sourceMappingURL=themeDuplicates.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"themeDuplicates.js","sourceRoot":"","sources":["../../../../../../react-components/src/theming/themeDuplicates.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// These color records are required for createV9Theme\n// For more info, check https://react.fluentui.dev/iframe.html?viewMode=docs&id=concepts-migration-from-v8-components-theme-migration--page#compatible-themes\n\n/**\n * @private\n */\nexport const grey: Record<Greys, string> = {\n '0': '#000000',\n '2': '#050505',\n '4': '#0a0a0a',\n '6': '#0f0f0f',\n '8': '#141414',\n '10': '#1a1a1a',\n '12': '#1f1f1f',\n '14': '#242424',\n '16': '#292929',\n '18': '#2e2e2e',\n '20': '#333333',\n '22': '#383838',\n '24': '#3d3d3d',\n '26': '#424242',\n '28': '#474747',\n '30': '#4d4d4d',\n '32': '#525252',\n '34': '#575757',\n '36': '#5c5c5c',\n '38': '#616161',\n '40': '#666666',\n '42': '#6b6b6b',\n '44': '#707070',\n '46': '#757575',\n '48': '#7a7a7a',\n '50': '#808080',\n '52': '#858585',\n '54': '#8a8a8a',\n '56': '#8f8f8f',\n '58': '#949494',\n '60': '#999999',\n '62': '#9e9e9e',\n '64': '#a3a3a3',\n '66': '#a8a8a8',\n '68': '#adadad',\n '70': '#b3b3b3',\n '72': '#b8b8b8',\n '74': '#bdbdbd',\n '76': '#c2c2c2',\n '78': '#c7c7c7',\n '80': '#cccccc',\n '82': '#d1d1d1',\n '84': '#d6d6d6',\n '86': '#dbdbdb',\n '88': '#e0e0e0',\n '90': '#e6e6e6',\n '92': '#ebebeb',\n '94': '#f0f0f0',\n '96': '#f5f5f5',\n '98': '#fafafa',\n '100': '#ffffff'\n};\n\n/**\n * @private\n */\nexport const whiteAlpha: Record<AlphaColors, string> = {\n '5': 'rgba(255, 255, 255, 0.05)',\n '10': 'rgba(255, 255, 255, 0.1)',\n '20': 'rgba(255, 255, 255, 0.2)',\n '30': 'rgba(255, 255, 255, 0.3)',\n '40': 'rgba(255, 255, 255, 0.4)',\n '50': 'rgba(255, 255, 255, 0.5)',\n '60': 'rgba(255, 255, 255, 0.6)',\n '70': 'rgba(255, 255, 255, 0.7)',\n '80': 'rgba(255, 255, 255, 0.8)',\n '90': 'rgba(255, 255, 255, 0.9)'\n};\n\n/**\n * @private\n */\nexport const blackAlpha: Record<AlphaColors, string> = {\n '5': 'rgba(0, 0, 0, 0.05)',\n '10': 'rgba(0, 0, 0, 0.1)',\n '20': 'rgba(0, 0, 0, 0.2)',\n '30': 'rgba(0, 0, 0, 0.3)',\n '40': 'rgba(0, 0, 0, 0.4)',\n '50': 'rgba(0, 0, 0, 0.5)',\n '60': 'rgba(0, 0, 0, 0.6)',\n '70': 'rgba(0, 0, 0, 0.7)',\n '80': 'rgba(0, 0, 0, 0.8)',\n '90': 'rgba(0, 0, 0, 0.9)'\n};\n\n/**\n * @private\n */\nexport const grey10Alpha: Record<AlphaColors, string> = {\n '5': 'rgba(26, 26, 26, 0.05)',\n '10': 'rgba(26, 26, 26, 0.1)',\n '20': 'rgba(26, 26, 26, 0.2)',\n '30': 'rgba(26, 26, 26, 0.3)',\n '40': 'rgba(26, 26, 26, 0.4)',\n '50': 'rgba(26, 26, 26, 0.5)',\n '60': 'rgba(26, 26, 26, 0.6)',\n '70': 'rgba(26, 26, 26, 0.7)',\n '80': 'rgba(26, 26, 26, 0.8)',\n '90': 'rgba(26, 26, 26, 0.9)'\n};\n\n/**\n * @private\n */\nexport const grey12Alpha: Record<AlphaColors, string> = {\n '5': 'rgba(31, 31, 31, 0.05)',\n '10': 'rgba(31, 31, 31, 0.1)',\n '20': 'rgba(31, 31, 31, 0.2)',\n '30': 'rgba(31, 31, 31, 0.3)',\n '40': 'rgba(31, 31, 31, 0.4)',\n '50': 'rgba(31, 31, 31, 0.5)',\n '60': 'rgba(31, 31, 31, 0.6)',\n '70': 'rgba(31, 31, 31, 0.7)',\n '80': 'rgba(31, 31, 31, 0.8)',\n '90': 'rgba(31, 31, 31, 0.9)'\n};\n\n/**\n * @private\n */\nexport type Greys =\n | 0\n | 2\n | 4\n | 6\n | 8\n | 10\n | 12\n | 14\n | 16\n | 18\n | 20\n | 22\n | 24\n | 26\n | 28\n | 30\n | 32\n | 34\n | 36\n | 38\n | 40\n | 42\n | 44\n | 46\n | 48\n | 50\n | 52\n | 54\n | 56\n | 58\n | 60\n | 62\n | 64\n | 66\n | 68\n | 70\n | 72\n | 74\n | 76\n | 78\n | 80\n | 82\n | 84\n | 86\n | 88\n | 90\n | 92\n | 94\n | 96\n | 98\n | 100;\n\n/**\n * @private\n */\nexport type AlphaColors = 5 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90;\n"]}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Theme as ThemeV8 } from '@fluentui/react';
|
2
|
+
import { Theme as ThemeV9 } from '@fluentui/react-components';
|
3
|
+
/**
|
4
|
+
* Creates a v9 theme from a v8 theme and base v9 theme.
|
5
|
+
* FluentUI webLightTheme is used in case if no baseThemeV9 is provided.
|
6
|
+
*
|
7
|
+
* @private
|
8
|
+
*/
|
9
|
+
export declare const createV9Theme: (themeV8: ThemeV8, baseThemeV9?: ThemeV9 | undefined) => ThemeV9 & {
|
10
|
+
errorText: string;
|
11
|
+
};
|
12
|
+
//# sourceMappingURL=v9ThemeShim.d.ts.map
|