@itwin/itwinui-react 3.14.1 → 3.14.2

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.14.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2217](https://github.com/iTwin/iTwinUI/pull/2217): Fixed the `Footer`'s `translatedTitles` prop's type to allow passing partial translations.
8
+ - [#2218](https://github.com/iTwin/iTwinUI/pull/2218): Fixed a `Table` bug where custom `Cell` content was not taking up the entire available width in some cases.
9
+ - [#2216](https://github.com/iTwin/iTwinUI/pull/2216): Fixed the fallback CSS logic in `ThemeProvider` to load the correct stylesheet version.
10
+
3
11
  ## 3.14.1
4
12
 
5
13
  ### Patch Changes
@@ -26,7 +26,7 @@ const _FooterItem = require('./FooterItem.js');
26
26
  const _FooterSeparator = require('./FooterSeparator.js');
27
27
  const _FooterList = require('./FooterList.js');
28
28
  const _Anchor = require('../Typography/Anchor.js');
29
- const footerTranslations = {
29
+ const defaultTranslatedTitles = {
30
30
  cookies: 'Cookies',
31
31
  legalNotices: 'Legal notices',
32
32
  privacy: 'Privacy',
@@ -40,27 +40,27 @@ const defaultFooterElements = [
40
40
  },
41
41
  {
42
42
  key: 'termsOfService',
43
- title: footerTranslations.termsOfService,
43
+ title: defaultTranslatedTitles.termsOfService,
44
44
  url: 'https://connect-agreementportal.bentley.com/AgreementApp/Home/Eula/view/readonly/BentleyConnect',
45
45
  },
46
46
  {
47
47
  key: 'privacy',
48
- title: footerTranslations.privacy,
48
+ title: defaultTranslatedTitles.privacy,
49
49
  url: 'https://www.bentley.com/en/privacy-policy',
50
50
  },
51
51
  {
52
52
  key: 'termsOfUse',
53
- title: footerTranslations.termsOfUse,
53
+ title: defaultTranslatedTitles.termsOfUse,
54
54
  url: 'https://www.bentley.com/en/terms-of-use-and-select-online-agreement',
55
55
  },
56
56
  {
57
57
  key: 'cookies',
58
- title: footerTranslations.cookies,
58
+ title: defaultTranslatedTitles.cookies,
59
59
  url: 'https://www.bentley.com/en/cookie-policy',
60
60
  },
61
61
  {
62
62
  key: 'legalNotices',
63
- title: footerTranslations.legalNotices,
63
+ title: defaultTranslatedTitles.legalNotices,
64
64
  url: 'https://connect.bentley.com/Legal',
65
65
  },
66
66
  ];
@@ -69,7 +69,7 @@ const Footer = Object.assign(
69
69
  let { children, customElements, translatedTitles, className, ...rest } =
70
70
  props;
71
71
  let titles = {
72
- ...footerTranslations,
72
+ ...defaultTranslatedTitles,
73
73
  ...translatedTitles,
74
74
  };
75
75
  let translatedElements = defaultFooterElements.map((element) => {
@@ -514,7 +514,7 @@ const Table = (props) => {
514
514
  return _react.createElement(
515
515
  _utils.TableColumnsContext.Provider,
516
516
  {
517
- value: columns,
517
+ value: instance.columns,
518
518
  },
519
519
  _react.createElement(
520
520
  _index.Box,
@@ -11,17 +11,17 @@ Object.defineProperty(exports, 'DefaultCell', {
11
11
  const _interop_require_default = require('@swc/helpers/_/_interop_require_default');
12
12
  const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildcard');
13
13
  const _react = _interop_require_wildcard._(require('react'));
14
+ const _reacttable = require('react-table');
14
15
  const _classnames = _interop_require_default._(require('classnames'));
15
16
  const _index = require('../../../utils/index.js');
16
17
  const _utils = require('../utils.js');
17
18
  const DefaultCell = (props) => {
18
- let columnsProp = _react.useContext(_utils.TableColumnsContext);
19
+ let instanceColumns = _react.useContext(_utils.TableColumnsContext);
19
20
  let isCustomCell = _react.useMemo(
20
21
  () =>
21
- columnsProp
22
- .find(({ id }) => props.cellProps.column.id === id)
23
- ?.hasOwnProperty('Cell'),
24
- [props.cellProps.column.id, columnsProp],
22
+ instanceColumns.find(({ id }) => props.cellProps.column.id === id)
23
+ ?.Cell !== _reacttable.defaultColumn.Cell,
24
+ [instanceColumns, props.cellProps.column.id],
25
25
  );
26
26
  let {
27
27
  cellElementProps: {
@@ -247,7 +247,7 @@ const FallbackStyles = ({ root }) => {
247
247
  } catch (error) {
248
248
  console.log('Error loading styles.css locally', error);
249
249
  let css = await (0, _index.importCss)(
250
- 'https://cdn.jsdelivr.net/npm/@itwin/itwinui-react@3/styles.css',
250
+ `https://cdn.jsdelivr.net/npm/@itwin/itwinui-react@${_meta.meta.version}/styles.css`,
251
251
  );
252
252
  document.adoptedStyleSheets = [
253
253
  ...document.adoptedStyleSheets,
package/DEV-cjs/styles.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
- const e = '3.14.1';
3
+ const e = '3.14.2';
4
4
  const u = new Proxy(
5
5
  {},
6
6
  {
@@ -5,7 +5,7 @@ import { FooterItem } from './FooterItem.js';
5
5
  import { FooterSeparator } from './FooterSeparator.js';
6
6
  import { FooterList } from './FooterList.js';
7
7
  import { Anchor } from '../Typography/Anchor.js';
8
- let footerTranslations = {
8
+ let defaultTranslatedTitles = {
9
9
  cookies: 'Cookies',
10
10
  legalNotices: 'Legal notices',
11
11
  privacy: 'Privacy',
@@ -19,27 +19,27 @@ export const defaultFooterElements = [
19
19
  },
20
20
  {
21
21
  key: 'termsOfService',
22
- title: footerTranslations.termsOfService,
22
+ title: defaultTranslatedTitles.termsOfService,
23
23
  url: 'https://connect-agreementportal.bentley.com/AgreementApp/Home/Eula/view/readonly/BentleyConnect',
24
24
  },
25
25
  {
26
26
  key: 'privacy',
27
- title: footerTranslations.privacy,
27
+ title: defaultTranslatedTitles.privacy,
28
28
  url: 'https://www.bentley.com/en/privacy-policy',
29
29
  },
30
30
  {
31
31
  key: 'termsOfUse',
32
- title: footerTranslations.termsOfUse,
32
+ title: defaultTranslatedTitles.termsOfUse,
33
33
  url: 'https://www.bentley.com/en/terms-of-use-and-select-online-agreement',
34
34
  },
35
35
  {
36
36
  key: 'cookies',
37
- title: footerTranslations.cookies,
37
+ title: defaultTranslatedTitles.cookies,
38
38
  url: 'https://www.bentley.com/en/cookie-policy',
39
39
  },
40
40
  {
41
41
  key: 'legalNotices',
42
- title: footerTranslations.legalNotices,
42
+ title: defaultTranslatedTitles.legalNotices,
43
43
  url: 'https://connect.bentley.com/Legal',
44
44
  },
45
45
  ];
@@ -48,7 +48,7 @@ export const Footer = Object.assign(
48
48
  let { children, customElements, translatedTitles, className, ...rest } =
49
49
  props;
50
50
  let titles = {
51
- ...footerTranslations,
51
+ ...defaultTranslatedTitles,
52
52
  ...translatedTitles,
53
53
  };
54
54
  let translatedElements = defaultFooterElements.map((element) => {
@@ -524,7 +524,7 @@ export const Table = (props) => {
524
524
  return React.createElement(
525
525
  TableColumnsContext.Provider,
526
526
  {
527
- value: columns,
527
+ value: instance.columns,
528
528
  },
529
529
  React.createElement(
530
530
  Box,
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
+ import { defaultColumn } from 'react-table';
2
3
  import cx from 'classnames';
3
4
  import { Box, LineClamp, ShadowRoot } from '../../../utils/index.js';
4
5
  import { TableColumnsContext } from '../utils.js';
5
6
  export const DefaultCell = (props) => {
6
- let columnsProp = React.useContext(TableColumnsContext);
7
+ let instanceColumns = React.useContext(TableColumnsContext);
7
8
  let isCustomCell = React.useMemo(
8
9
  () =>
9
- columnsProp
10
- .find(({ id }) => props.cellProps.column.id === id)
11
- ?.hasOwnProperty('Cell'),
12
- [props.cellProps.column.id, columnsProp],
10
+ instanceColumns.find(({ id }) => props.cellProps.column.id === id)
11
+ ?.Cell !== defaultColumn.Cell,
12
+ [instanceColumns, props.cellProps.column.id],
13
13
  );
14
14
  let {
15
15
  cellElementProps: {
@@ -234,7 +234,7 @@ let FallbackStyles = ({ root }) => {
234
234
  } catch (error) {
235
235
  console.log('Error loading styles.css locally', error);
236
236
  let css = await importCss(
237
- 'https://cdn.jsdelivr.net/npm/@itwin/itwinui-react@3/styles.css',
237
+ `https://cdn.jsdelivr.net/npm/@itwin/itwinui-react@${meta.version}/styles.css`,
238
238
  );
239
239
  document.adoptedStyleSheets = [
240
240
  ...document.adoptedStyleSheets,
package/DEV-esm/styles.js CHANGED
@@ -1,4 +1,4 @@
1
- const t = '3.14.1';
1
+ const t = '3.14.2';
2
2
  const u = new Proxy(
3
3
  {},
4
4
  {
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import type { CommonProps } from '../../utils/index.js';
3
3
  export type TitleTranslations = {
4
- termsOfService: string;
5
- privacy: string;
6
- termsOfUse: string;
7
- cookies: string;
8
- legalNotices: string;
4
+ termsOfService?: string;
5
+ privacy?: string;
6
+ termsOfUse?: string;
7
+ cookies?: string;
8
+ legalNotices?: string;
9
9
  };
10
10
  type FooterProps = {
11
11
  /**
@@ -26,7 +26,7 @@ const _FooterItem = require('./FooterItem.js');
26
26
  const _FooterSeparator = require('./FooterSeparator.js');
27
27
  const _FooterList = require('./FooterList.js');
28
28
  const _Anchor = require('../Typography/Anchor.js');
29
- const footerTranslations = {
29
+ const defaultTranslatedTitles = {
30
30
  cookies: 'Cookies',
31
31
  legalNotices: 'Legal notices',
32
32
  privacy: 'Privacy',
@@ -40,27 +40,27 @@ const defaultFooterElements = [
40
40
  },
41
41
  {
42
42
  key: 'termsOfService',
43
- title: footerTranslations.termsOfService,
43
+ title: defaultTranslatedTitles.termsOfService,
44
44
  url: 'https://connect-agreementportal.bentley.com/AgreementApp/Home/Eula/view/readonly/BentleyConnect',
45
45
  },
46
46
  {
47
47
  key: 'privacy',
48
- title: footerTranslations.privacy,
48
+ title: defaultTranslatedTitles.privacy,
49
49
  url: 'https://www.bentley.com/en/privacy-policy',
50
50
  },
51
51
  {
52
52
  key: 'termsOfUse',
53
- title: footerTranslations.termsOfUse,
53
+ title: defaultTranslatedTitles.termsOfUse,
54
54
  url: 'https://www.bentley.com/en/terms-of-use-and-select-online-agreement',
55
55
  },
56
56
  {
57
57
  key: 'cookies',
58
- title: footerTranslations.cookies,
58
+ title: defaultTranslatedTitles.cookies,
59
59
  url: 'https://www.bentley.com/en/cookie-policy',
60
60
  },
61
61
  {
62
62
  key: 'legalNotices',
63
- title: footerTranslations.legalNotices,
63
+ title: defaultTranslatedTitles.legalNotices,
64
64
  url: 'https://connect.bentley.com/Legal',
65
65
  },
66
66
  ];
@@ -69,7 +69,7 @@ const Footer = Object.assign(
69
69
  let { children, customElements, translatedTitles, className, ...rest } =
70
70
  props;
71
71
  let titles = {
72
- ...footerTranslations,
72
+ ...defaultTranslatedTitles,
73
73
  ...translatedTitles,
74
74
  };
75
75
  let translatedElements = defaultFooterElements.map((element) => {
@@ -510,7 +510,7 @@ const Table = (props) => {
510
510
  return _react.createElement(
511
511
  _utils.TableColumnsContext.Provider,
512
512
  {
513
- value: columns,
513
+ value: instance.columns,
514
514
  },
515
515
  _react.createElement(
516
516
  _index.Box,
@@ -11,17 +11,17 @@ Object.defineProperty(exports, 'DefaultCell', {
11
11
  const _interop_require_default = require('@swc/helpers/_/_interop_require_default');
12
12
  const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildcard');
13
13
  const _react = _interop_require_wildcard._(require('react'));
14
+ const _reacttable = require('react-table');
14
15
  const _classnames = _interop_require_default._(require('classnames'));
15
16
  const _index = require('../../../utils/index.js');
16
17
  const _utils = require('../utils.js');
17
18
  const DefaultCell = (props) => {
18
- let columnsProp = _react.useContext(_utils.TableColumnsContext);
19
+ let instanceColumns = _react.useContext(_utils.TableColumnsContext);
19
20
  let isCustomCell = _react.useMemo(
20
21
  () =>
21
- columnsProp
22
- .find(({ id }) => props.cellProps.column.id === id)
23
- ?.hasOwnProperty('Cell'),
24
- [props.cellProps.column.id, columnsProp],
22
+ instanceColumns.find(({ id }) => props.cellProps.column.id === id)
23
+ ?.Cell !== _reacttable.defaultColumn.Cell,
24
+ [instanceColumns, props.cellProps.column.id],
25
25
  );
26
26
  let {
27
27
  cellElementProps: {
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ColumnInstance, Column } from '../../react-table/react-table.js';
2
+ import type { ColumnInstance } from '../../react-table/react-table.js';
3
3
  export declare const getCellStyle: <T extends Record<string, unknown>>(column: ColumnInstance<T>, isTableResizing: boolean) => React.CSSProperties | undefined;
4
4
  export declare const getStickyStyle: <T extends Record<string, unknown>>(column: ColumnInstance<T>, columnList: ColumnInstance<T>[]) => React.CSSProperties;
5
5
  export declare const getSubRowStyle: ({ density, depth }: {
@@ -8,4 +8,4 @@ export declare const getSubRowStyle: ({ density, depth }: {
8
8
  }) => {
9
9
  paddingInlineStart: number;
10
10
  };
11
- export declare const TableColumnsContext: React.Context<Column<Record<string, unknown>>[]>;
11
+ export declare const TableColumnsContext: React.Context<ColumnInstance<{}>[]>;
@@ -246,7 +246,7 @@ const FallbackStyles = ({ root }) => {
246
246
  } catch (error) {
247
247
  console.log('Error loading styles.css locally', error);
248
248
  let css = await (0, _index.importCss)(
249
- 'https://cdn.jsdelivr.net/npm/@itwin/itwinui-react@3/styles.css',
249
+ `https://cdn.jsdelivr.net/npm/@itwin/itwinui-react@${_meta.meta.version}/styles.css`,
250
250
  );
251
251
  document.adoptedStyleSheets = [
252
252
  ...document.adoptedStyleSheets,
package/cjs/styles.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
- const e = '3.14.1';
3
+ const e = '3.14.2';
4
4
  const u = new Proxy(
5
5
  {},
6
6
  {
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import type { CommonProps } from '../../utils/index.js';
3
3
  export type TitleTranslations = {
4
- termsOfService: string;
5
- privacy: string;
6
- termsOfUse: string;
7
- cookies: string;
8
- legalNotices: string;
4
+ termsOfService?: string;
5
+ privacy?: string;
6
+ termsOfUse?: string;
7
+ cookies?: string;
8
+ legalNotices?: string;
9
9
  };
10
10
  type FooterProps = {
11
11
  /**
@@ -5,7 +5,7 @@ import { FooterItem } from './FooterItem.js';
5
5
  import { FooterSeparator } from './FooterSeparator.js';
6
6
  import { FooterList } from './FooterList.js';
7
7
  import { Anchor } from '../Typography/Anchor.js';
8
- let footerTranslations = {
8
+ let defaultTranslatedTitles = {
9
9
  cookies: 'Cookies',
10
10
  legalNotices: 'Legal notices',
11
11
  privacy: 'Privacy',
@@ -19,27 +19,27 @@ export const defaultFooterElements = [
19
19
  },
20
20
  {
21
21
  key: 'termsOfService',
22
- title: footerTranslations.termsOfService,
22
+ title: defaultTranslatedTitles.termsOfService,
23
23
  url: 'https://connect-agreementportal.bentley.com/AgreementApp/Home/Eula/view/readonly/BentleyConnect',
24
24
  },
25
25
  {
26
26
  key: 'privacy',
27
- title: footerTranslations.privacy,
27
+ title: defaultTranslatedTitles.privacy,
28
28
  url: 'https://www.bentley.com/en/privacy-policy',
29
29
  },
30
30
  {
31
31
  key: 'termsOfUse',
32
- title: footerTranslations.termsOfUse,
32
+ title: defaultTranslatedTitles.termsOfUse,
33
33
  url: 'https://www.bentley.com/en/terms-of-use-and-select-online-agreement',
34
34
  },
35
35
  {
36
36
  key: 'cookies',
37
- title: footerTranslations.cookies,
37
+ title: defaultTranslatedTitles.cookies,
38
38
  url: 'https://www.bentley.com/en/cookie-policy',
39
39
  },
40
40
  {
41
41
  key: 'legalNotices',
42
- title: footerTranslations.legalNotices,
42
+ title: defaultTranslatedTitles.legalNotices,
43
43
  url: 'https://connect.bentley.com/Legal',
44
44
  },
45
45
  ];
@@ -48,7 +48,7 @@ export const Footer = Object.assign(
48
48
  let { children, customElements, translatedTitles, className, ...rest } =
49
49
  props;
50
50
  let titles = {
51
- ...footerTranslations,
51
+ ...defaultTranslatedTitles,
52
52
  ...translatedTitles,
53
53
  };
54
54
  let translatedElements = defaultFooterElements.map((element) => {
@@ -520,7 +520,7 @@ export const Table = (props) => {
520
520
  return React.createElement(
521
521
  TableColumnsContext.Provider,
522
522
  {
523
- value: columns,
523
+ value: instance.columns,
524
524
  },
525
525
  React.createElement(
526
526
  Box,
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
+ import { defaultColumn } from 'react-table';
2
3
  import cx from 'classnames';
3
4
  import { Box, LineClamp, ShadowRoot } from '../../../utils/index.js';
4
5
  import { TableColumnsContext } from '../utils.js';
5
6
  export const DefaultCell = (props) => {
6
- let columnsProp = React.useContext(TableColumnsContext);
7
+ let instanceColumns = React.useContext(TableColumnsContext);
7
8
  let isCustomCell = React.useMemo(
8
9
  () =>
9
- columnsProp
10
- .find(({ id }) => props.cellProps.column.id === id)
11
- ?.hasOwnProperty('Cell'),
12
- [props.cellProps.column.id, columnsProp],
10
+ instanceColumns.find(({ id }) => props.cellProps.column.id === id)
11
+ ?.Cell !== defaultColumn.Cell,
12
+ [instanceColumns, props.cellProps.column.id],
13
13
  );
14
14
  let {
15
15
  cellElementProps: {
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ColumnInstance, Column } from '../../react-table/react-table.js';
2
+ import type { ColumnInstance } from '../../react-table/react-table.js';
3
3
  export declare const getCellStyle: <T extends Record<string, unknown>>(column: ColumnInstance<T>, isTableResizing: boolean) => React.CSSProperties | undefined;
4
4
  export declare const getStickyStyle: <T extends Record<string, unknown>>(column: ColumnInstance<T>, columnList: ColumnInstance<T>[]) => React.CSSProperties;
5
5
  export declare const getSubRowStyle: ({ density, depth }: {
@@ -8,4 +8,4 @@ export declare const getSubRowStyle: ({ density, depth }: {
8
8
  }) => {
9
9
  paddingInlineStart: number;
10
10
  };
11
- export declare const TableColumnsContext: React.Context<Column<Record<string, unknown>>[]>;
11
+ export declare const TableColumnsContext: React.Context<ColumnInstance<{}>[]>;
@@ -233,7 +233,7 @@ let FallbackStyles = ({ root }) => {
233
233
  } catch (error) {
234
234
  console.log('Error loading styles.css locally', error);
235
235
  let css = await importCss(
236
- 'https://cdn.jsdelivr.net/npm/@itwin/itwinui-react@3/styles.css',
236
+ `https://cdn.jsdelivr.net/npm/@itwin/itwinui-react@${meta.version}/styles.css`,
237
237
  );
238
238
  document.adoptedStyleSheets = [
239
239
  ...document.adoptedStyleSheets,
package/esm/styles.js CHANGED
@@ -1,4 +1,4 @@
1
- const t = '3.14.1';
1
+ const t = '3.14.2';
2
2
  const u = new Proxy(
3
3
  {},
4
4
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/itwinui-react",
3
- "version": "3.14.1",
3
+ "version": "3.14.2",
4
4
  "author": "Bentley Systems",
5
5
  "license": "MIT",
6
6
  "type": "module",