@itwin/itwinui-react 2.5.1 → 2.6.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.md +36 -0
- package/cjs/core/ComboBox/ComboBox.js +4 -1
- package/cjs/core/FileUpload/FileEmptyCard.d.ts +29 -0
- package/cjs/core/FileUpload/FileEmptyCard.js +50 -0
- package/cjs/core/FileUpload/FileUploadCard.d.ts +116 -0
- package/cjs/core/FileUpload/FileUploadCard.js +144 -0
- package/cjs/core/FileUpload/FileUploadTemplate.d.ts +1 -1
- package/cjs/core/FileUpload/FileUploadTemplate.js +4 -3
- package/cjs/core/FileUpload/index.d.ts +4 -0
- package/cjs/core/FileUpload/index.js +5 -1
- package/cjs/core/Header/HeaderLogo.d.ts +8 -11
- package/cjs/core/Header/HeaderLogo.js +7 -12
- package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +12 -2
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +2 -2
- package/cjs/core/index.d.ts +2 -2
- package/cjs/core/index.js +5 -3
- package/cjs/core/utils/hooks/index.d.ts +1 -0
- package/cjs/core/utils/hooks/index.js +1 -0
- package/cjs/core/utils/hooks/useId.d.ts +5 -0
- package/cjs/core/utils/hooks/useId.js +20 -0
- package/cjs/core/utils/hooks/useTheme.js +5 -0
- package/cjs/core/utils/icons/SvgDocument.d.ts +2 -0
- package/cjs/core/utils/icons/SvgDocument.js +36 -0
- package/cjs/core/utils/icons/index.d.ts +1 -0
- package/cjs/core/utils/icons/index.js +1 -0
- package/esm/core/ComboBox/ComboBox.js +4 -1
- package/esm/core/FileUpload/FileEmptyCard.d.ts +29 -0
- package/esm/core/FileUpload/FileEmptyCard.js +44 -0
- package/esm/core/FileUpload/FileUploadCard.d.ts +116 -0
- package/esm/core/FileUpload/FileUploadCard.js +138 -0
- package/esm/core/FileUpload/FileUploadTemplate.d.ts +1 -1
- package/esm/core/FileUpload/FileUploadTemplate.js +4 -3
- package/esm/core/FileUpload/index.d.ts +4 -0
- package/esm/core/FileUpload/index.js +2 -0
- package/esm/core/Header/HeaderLogo.d.ts +8 -11
- package/esm/core/Header/HeaderLogo.js +7 -11
- package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +12 -2
- package/esm/core/ToggleSwitch/ToggleSwitch.js +2 -2
- package/esm/core/index.d.ts +2 -2
- package/esm/core/index.js +1 -1
- package/esm/core/utils/hooks/index.d.ts +1 -0
- package/esm/core/utils/hooks/index.js +1 -0
- package/esm/core/utils/hooks/useId.d.ts +5 -0
- package/esm/core/utils/hooks/useId.js +14 -0
- package/esm/core/utils/hooks/useTheme.js +5 -0
- package/esm/core/utils/icons/SvgDocument.d.ts +2 -0
- package/esm/core/utils/icons/SvgDocument.js +9 -0
- package/esm/core/utils/icons/index.d.ts +1 -0
- package/esm/core/utils/icons/index.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
var _a;
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { getRandomValue } from '../functions/numbers';
|
|
8
|
+
/**
|
|
9
|
+
* Return custom useId function as a fallback for React.useId
|
|
10
|
+
*/
|
|
11
|
+
export const useId = (_a = React.useId) !== null && _a !== void 0 ? _a : (() => {
|
|
12
|
+
const [id] = React.useState(() => `iui-${getRandomValue(10)}`);
|
|
13
|
+
return id;
|
|
14
|
+
});
|
|
@@ -24,6 +24,11 @@ export const useTheme = (theme, themeOptions) => {
|
|
|
24
24
|
if (!ownerDocument || isThemeAlreadySet.current) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
+
// do nothing if using v1 for the main page (incremental migration)
|
|
28
|
+
if (ownerDocument.documentElement.className.includes('iui-theme-') ||
|
|
29
|
+
ownerDocument.body.classList.contains('iui-body')) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
27
32
|
ownerDocument.body.classList.toggle('iui-root', true);
|
|
28
33
|
switch (theme) {
|
|
29
34
|
case 'light':
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
export const SvgDocument = (props) => {
|
|
7
|
+
return (React.createElement("svg", { viewBox: '0 0 16 16', ...props },
|
|
8
|
+
React.createElement("path", { d: 'M10 0H2v16h12V4h-4zm1 0v3h3z' })));
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/itwinui-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"author": "Bentley Systems",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"dev:types": "concurrently \"tsc -p tsconfig.cjs.json --emitDeclarationOnly --watch --preserveWatchOutput\" \"tsc -p tsconfig.esm.json --emitDeclarationOnly --watch --preserveWatchOutput\""
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@itwin/itwinui-css": "^1.
|
|
65
|
+
"@itwin/itwinui-css": "^1.7.0",
|
|
66
66
|
"@itwin/itwinui-illustrations-react": "^2.0.0",
|
|
67
67
|
"@itwin/itwinui-variables": "^2.0.0",
|
|
68
68
|
"@tippyjs/react": "^4.2.6",
|