@scality/core-ui 0.207.0 → 0.208.0

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.
@@ -14,6 +14,8 @@ jobs:
14
14
  with:
15
15
  node-version: 20
16
16
  - run: npm ci
17
+ - name: Configure git credentials
18
+ run: git config --global url."https://x-access-token:${{ github.token }}@github.com/".insteadOf "https://github.com/"
17
19
  - run: npm run storybook:deploy
18
20
  env:
19
21
  STORYBOOK_DISABLE_TELEMETRY: 1
@@ -39,19 +39,11 @@ jobs:
39
39
  body: ''
40
40
  });
41
41
  core.setOutput('pull-request-number', String(pr.data.number));
42
- - uses: actions/github-script@v5
43
- if: ${{ steps.cpr.outputs.pull-request-number }}
44
- with:
45
- script: |
46
- github.rest.issues.createComment({
47
- issue_number: '${{ steps.cpr.outputs.pull-request-number }}',
48
- owner: context.repo.owner,
49
- repo: context.repo.repo,
50
- body: '/approve'
51
- })
52
- - uses: actions/github-script@v5
42
+ - name: Merge Pull Request
43
+ uses: actions/github-script@v5
53
44
  if: ${{ steps.cpr.outputs.pull-request-number }}
54
45
  with:
46
+ github-token: ${{ secrets.GIT_ACCESS_TOKEN }}
55
47
  script: |
56
48
  await github.rest.pulls.merge({
57
49
  owner: context.repo.owner,
@@ -1,6 +1,6 @@
1
- import { SizeProp } from '@fortawesome/fontawesome-svg-core';
2
- import { CSSProperties } from 'react';
3
- import { CoreUITheme } from '../../style/theme';
1
+ import type { SizeProp } from '@fortawesome/fontawesome-svg-core';
2
+ import { type CSSProperties } from 'react';
3
+ import type { CoreUITheme } from '../../style/theme';
4
4
  import { iconTable } from './iconTable';
5
5
  type IconProps = {
6
6
  'aria-label'?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/icon/Icon.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EACL,aAAa,EAKd,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AiBF,eAAO,MAAM,WAAW;UAAsB,QAAQ;SAiCrD,CAAC;AAsEF,iBAAS,IAAI,CAAC,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,2CAU7C;AAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC"}
@@ -60,8 +60,8 @@ export const IconWrapper = styled.div `
60
60
  height: 1.5rem;
61
61
  `
62
62
  : `
63
- width: ${parseInt(props.size.replace('x', '')) * 2}rem;
64
- height: ${parseInt(props.size.replace('x', '')) * 2}rem;
63
+ width: ${parseInt(props.size.replace('x', ''), 10) * 2}rem;
64
+ height: ${parseInt(props.size.replace('x', ''), 10) * 2}rem;
65
65
  `}
66
66
  `;
67
67
  }}
@@ -92,9 +92,12 @@ function NonWrappedIcon({ name, size = '1x', color, ariaLabel, title, ...rest })
92
92
  // Handle FontAwesome icons with dynamic import
93
93
  import(
94
94
  /* webpackExclude: /import\.macro\.js$/ */
95
- `@fortawesome/${fontAwesomeType}/${iconClass}.js`).then((module) => {
95
+ /* webpackInclude: /\.js$/ */
96
+ `@fortawesome/${fontAwesomeType}/${iconClass}`).then((module) => {
96
97
  setIcon(module[iconClass]);
97
98
  iconCache[cacheKey] = module[iconClass];
99
+ }).catch((err) => {
100
+ console.warn(`Icon ${iconClass} could not be loaded:`, err.message);
98
101
  });
99
102
  return () => setIcon(undefined);
100
103
  }, [name, iconInfo]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scality/core-ui",
3
- "version": "0.207.0",
3
+ "version": "0.208.0",
4
4
  "description": "Scality common React component library",
5
5
  "author": "Scality Engineering",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1,14 +1,14 @@
1
- import { SizeProp } from '@fortawesome/fontawesome-svg-core';
1
+ import type { SizeProp } from '@fortawesome/fontawesome-svg-core';
2
2
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
3
  import {
4
- CSSProperties,
5
- HTMLProps,
6
- PropsWithChildren,
4
+ type CSSProperties,
5
+ type HTMLProps,
6
+ type PropsWithChildren,
7
7
  useEffect,
8
8
  useState,
9
9
  } from 'react';
10
10
  import styled, { css } from 'styled-components';
11
- import { CoreUITheme } from '../../style/theme';
11
+ import type { CoreUITheme } from '../../style/theme';
12
12
  import { Loader } from '../loader/Loader.component';
13
13
  import { Bucket, Buckets, RemoteGroup, RemoteUser } from './CustomsIcons';
14
14
  import { iconTable } from './iconTable';
@@ -114,8 +114,8 @@ export const IconWrapper = styled.div<{ size: SizeProp }>`
114
114
  height: 1.5rem;
115
115
  `
116
116
  : `
117
- width: ${parseInt(props.size.replace('x', '')) * 2}rem;
118
- height: ${parseInt(props.size.replace('x', '')) * 2}rem;
117
+ width: ${parseInt(props.size.replace('x', ''), 10) * 2}rem;
118
+ height: ${parseInt(props.size.replace('x', ''), 10) * 2}rem;
119
119
  `}
120
120
  `;
121
121
  }}
@@ -157,9 +157,12 @@ function NonWrappedIcon({
157
157
  // Handle FontAwesome icons with dynamic import
158
158
  import(
159
159
  /* webpackExclude: /import\.macro\.js$/ */
160
- `@fortawesome/${fontAwesomeType}/${iconClass}.js`).then((module) => {
160
+ /* webpackInclude: /\.js$/ */
161
+ `@fortawesome/${fontAwesomeType}/${iconClass}`).then((module) => {
161
162
  setIcon(module[iconClass]);
162
163
  iconCache[cacheKey] = module[iconClass];
164
+ }).catch((err) => {
165
+ console.warn(`Icon ${iconClass} could not be loaded:`, err.message);
163
166
  });
164
167
  return () => setIcon(undefined);
165
168
  }, [name, iconInfo]);