@ukic/canary-react 2.0.0-canary.0 → 2.0.0-canary.1

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [Canary]: The UK Intelligence Community React UI Kit
1
+ # The UK Intelligence Community React UI Kit
2
2
 
3
3
  [![OGL V3 License](https://img.shields.io/badge/license-OGLv3-blue.svg)](https://github.com/mi6/ic-design-system/tree/main/LICENSE)
4
4
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mi6/ic-design-system/tree/main/LICENSE)
@@ -17,11 +17,11 @@ In the root of your project:
17
17
 
18
18
  ```shell
19
19
  // using npm
20
- npm install @ukic/canary-react @ukic/fonts
20
+ npm install @ukic/react @ukic/fonts
21
21
 
22
22
  // using yarn
23
23
  rm package-lock.json
24
- yarn add @ukic/canary-react @ukic/fonts
24
+ yarn add @ukic/react @ukic/fonts
25
25
  ```
26
26
 
27
27
  ### Step two
@@ -29,7 +29,7 @@ yarn add @ukic/canary-react @ukic/fonts
29
29
  Import the component(s) in your React files.
30
30
 
31
31
  ```jsx
32
- import { IcUnstableComponent } from "@ukic/canary-react";
32
+ import { IcComponent } from "@ukic/react";
33
33
  ```
34
34
 
35
35
  ### Step three
@@ -40,7 +40,7 @@ Add the following into the top level CSS file for your project.
40
40
 
41
41
  ```css
42
42
  @import "@ukic/fonts/dist/fonts.css";
43
- @import "@ukic/canary-react/dist/core/core.css";
43
+ @import "@ukic/react/dist/core/core.css";
44
44
  ```
45
45
 
46
46
  In order to be rendered consistently across browsers and in line with modern standards, each of the ICDS components uses styles from a global CSS file based on [Normalize.css](https://necolas.github.io/normalize.css/).
@@ -48,15 +48,23 @@ In order to be rendered consistently across browsers and in line with modern sta
48
48
  If you would like to import these styles to apply them to the rest of your project and slotted elements used within any of the ICDS components, add the following into the top level CSS file as well.
49
49
 
50
50
  ```css
51
- @import "@ukic/canary-react/dist/core/normalize.css";
51
+ @import "@ukic/react/dist/core/normalize.css";
52
52
  ```
53
53
 
54
54
  ### Step four
55
55
 
56
- The `@ukic/canary-react` package will need to be transformed before you can use these components in Jest tests.
56
+ The `@ukic/react` package will need to be transformed before you can use these components in Jest tests.
57
57
 
58
- Add a `transformIgnorePatterns` field with the value `["/node_modules/(?!@ukic/canary-react)"]` to your Jest config.
58
+ Add a `transformIgnorePatterns` field with the value `["/node_modules/(?!@ukic/react)"]` to your Jest config.
59
59
 
60
+ ## Contributing
61
+
62
+ We have a couple of resources to help you with contributing.
63
+
64
+ - To find out more about the different types of contributions, the criteria, raising issues or our release roadmap, read [how to contribute to the Design System and UI Kit](https://design.sis.gov.uk/community/contribute).
65
+ - Make sure to also read our [coding standards and technical instructions](https://github.com/mi6/ic-ui-kit/blob/main/CONTRIBUTING.md).
66
+ - [IC Design System guidance site repository](https://github.com/mi6/ic-design-system) contains the code and content for the Design System guidance site.
67
+ - [IC UI Kit repository](https://github.com/mi6/ic-ui-kit) contains the code and content for the web components.
60
68
 
61
69
  ## Changelog
62
70
 
@@ -66,6 +74,16 @@ For a comprehensive changelog of the React components, please read the web compo
66
74
 
67
75
  If you've found a vulnerability, we want to know so that we can fix it. [Our security policy](https://github.com/mi6/ic-ui-kit/blob/main/SECURITY.md) tells you how to do this.
68
76
 
77
+ ## Questions about the departments
78
+
79
+ The team is only able to talk about the projects we've put on GitHub 🕵️. We unfortunately can't talk about the work of our departments 😢.
80
+
81
+ Visit our websites to learn more about:
82
+
83
+ - The [Secret Intelligence Service (MI6)](https://www.sis.gov.uk).
84
+ - The [Government Communications Headquarters (GCHQ)](https://www.gchq.gov.uk).
85
+ - The [Security Service (MI5)](https://www.mi5.gov.uk).
86
+
69
87
  ## License
70
88
 
71
89
  Unless stated otherwise, the codebase is released under the [MIT License](https://opensource.org/licenses/MIT). This covers both the codebase and any sample code in the documentation. The documentation is and available under the terms of the [Open Government License v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).
@@ -12,8 +12,10 @@ export declare const IcChip: import("react").ForwardRefExoticComponent<JSX.IcChi
12
12
  export declare const IcClassificationBanner: import("react").ForwardRefExoticComponent<JSX.IcClassificationBanner & Omit<import("react").HTMLAttributes<HTMLIcClassificationBannerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcClassificationBannerElement>>;
13
13
  export declare const IcDataEntity: import("react").ForwardRefExoticComponent<JSX.IcDataEntity & Omit<import("react").HTMLAttributes<HTMLIcDataEntityElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDataEntityElement>>;
14
14
  export declare const IcDataRow: import("react").ForwardRefExoticComponent<JSX.IcDataRow & Omit<import("react").HTMLAttributes<HTMLIcDataRowElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDataRowElement>>;
15
+ export declare const IcDataTable: import("react").ForwardRefExoticComponent<JSX.IcDataTable & Omit<import("react").HTMLAttributes<HTMLIcDataTableElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDataTableElement>>;
15
16
  export declare const IcDialog: import("react").ForwardRefExoticComponent<JSX.IcDialog & Omit<import("react").HTMLAttributes<HTMLIcDialogElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDialogElement>>;
16
17
  export declare const IcDivider: import("react").ForwardRefExoticComponent<JSX.IcDivider & Omit<import("react").HTMLAttributes<HTMLIcDividerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDividerElement>>;
18
+ export declare const IcEmptyState: import("react").ForwardRefExoticComponent<JSX.IcEmptyState & Omit<import("react").HTMLAttributes<HTMLIcEmptyStateElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcEmptyStateElement>>;
17
19
  export declare const IcFooter: import("react").ForwardRefExoticComponent<JSX.IcFooter & Omit<import("react").HTMLAttributes<HTMLIcFooterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcFooterElement>>;
18
20
  export declare const IcFooterLink: import("react").ForwardRefExoticComponent<JSX.IcFooterLink & Omit<import("react").HTMLAttributes<HTMLIcFooterLinkElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcFooterLinkElement>>;
19
21
  export declare const IcFooterLinkGroup: import("react").ForwardRefExoticComponent<JSX.IcFooterLinkGroup & Omit<import("react").HTMLAttributes<HTMLIcFooterLinkGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcFooterLinkGroupElement>>;
@@ -59,4 +61,3 @@ export declare const IcToastRegion: import("react").ForwardRefExoticComponent<JS
59
61
  export declare const IcTooltip: import("react").ForwardRefExoticComponent<JSX.IcTooltip & Omit<import("react").HTMLAttributes<HTMLIcTooltipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTooltipElement>>;
60
62
  export declare const IcTopNavigation: import("react").ForwardRefExoticComponent<JSX.IcTopNavigation & Omit<import("react").HTMLAttributes<HTMLIcTopNavigationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTopNavigationElement>>;
61
63
  export declare const IcTypography: import("react").ForwardRefExoticComponent<JSX.IcTypography & Omit<import("react").HTMLAttributes<HTMLIcTypographyElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTypographyElement>>;
62
- export declare const IcUnstableDataTable: import("react").ForwardRefExoticComponent<JSX.IcUnstableDataTable & Omit<import("react").HTMLAttributes<HTMLIcUnstableDataTableElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcUnstableDataTableElement>>;
@@ -16,8 +16,10 @@ export const IcChip = /*@__PURE__*/ createReactComponent('ic-chip');
16
16
  export const IcClassificationBanner = /*@__PURE__*/ createReactComponent('ic-classification-banner');
17
17
  export const IcDataEntity = /*@__PURE__*/ createReactComponent('ic-data-entity');
18
18
  export const IcDataRow = /*@__PURE__*/ createReactComponent('ic-data-row');
19
+ export const IcDataTable = /*@__PURE__*/ createReactComponent('ic-data-table');
19
20
  export const IcDialog = /*@__PURE__*/ createReactComponent('ic-dialog');
20
21
  export const IcDivider = /*@__PURE__*/ createReactComponent('ic-divider');
22
+ export const IcEmptyState = /*@__PURE__*/ createReactComponent('ic-empty-state');
21
23
  export const IcFooter = /*@__PURE__*/ createReactComponent('ic-footer');
22
24
  export const IcFooterLink = /*@__PURE__*/ createReactComponent('ic-footer-link');
23
25
  export const IcFooterLinkGroup = /*@__PURE__*/ createReactComponent('ic-footer-link-group');
@@ -63,4 +65,3 @@ export const IcToastRegion = /*@__PURE__*/ createReactComponent('ic-toast-region
63
65
  export const IcTooltip = /*@__PURE__*/ createReactComponent('ic-tooltip');
64
66
  export const IcTopNavigation = /*@__PURE__*/ createReactComponent('ic-top-navigation');
65
67
  export const IcTypography = /*@__PURE__*/ createReactComponent('ic-typography');
66
- export const IcUnstableDataTable = /*@__PURE__*/ createReactComponent('ic-unstable-data-table');
@@ -90,12 +90,15 @@ html{font-family:var(--ic-font-body-family);color:var(--ic-color-primary-text)}a
90
90
  );--ic-theme-primary-divide-calc:calc(var(--ic-theme-primary-sum-calc) / 1000);--ic-theme-primary-subtract-calc:calc(
91
91
  var(--ic-theme-primary-divide-calc) - var(--ic-theme-dark-mode-threshold)
92
92
  );--ic-theme-primary-calc:calc(var(--ic-theme-primary-subtract-calc) * -10000);--ic-theme-calc:max(0, var(--ic-theme-primary-calc));--ic-theme-text:rgb(
93
- calc(var(--ic-theme-calc) + 11) calc(var(--ic-theme-calc) + 12)
94
- calc(var(--ic-theme-calc) + 12) / var(--ic-theme-primary-a)
93
+ min(255, calc(var(--ic-theme-calc) + 11))
94
+ min(255, calc(var(--ic-theme-calc) + 12))
95
+ min(255, calc(var(--ic-theme-calc) + 12)) / var(--ic-theme-primary-a)
95
96
  );--ic-theme-hover:rgb(
96
- calc(var(--ic-theme-calc) + 65) calc(var(--ic-theme-calc) + 70)
97
- calc(var(--ic-theme-calc) + 77) / 10%
97
+ min(255, calc(var(--ic-theme-calc) + 65))
98
+ min(255, calc(var(--ic-theme-calc) + 70))
99
+ min(255, calc(var(--ic-theme-calc) + 77)) / 10%
98
100
  );--ic-theme-active:rgb(
99
- calc(var(--ic-theme-calc) + 65) calc(var(--ic-theme-calc) + 70)
100
- calc(var(--ic-theme-calc) + 77) / 20%
101
- );--ic-hyperlink:#1759bc;--ic-hyperlink-visited:#330072;--ic-hyperlink-hover:#7c2855;--ic-hyperlink-contrast:#5c98f2;--ic-hyperlink-contrast-visited:#bc75ff;--ic-hyperlink-contrast-hover:#db76ac;--ic-focus-blue:#0044d7;--ic-focus-glow:#80a1e8;--ic-hc-focus-outline:3px solid transparent;--ic-table-row-selected:#c7d7ef;--ic-breakpoint-xs:0;--ic-breakpoint-sm:576px;--ic-breakpoint-md:768px;--ic-breakpoint-lg:992px;--ic-breakpoint-xl:1200px;--ic-space-1px:0.063rem;--ic-space-xxxs:0.125rem;--ic-space-xxs:0.25rem;--ic-space-xs:0.5rem;--ic-space-sm:0.75rem;--ic-space-md:1rem;--ic-space-lg:1.5rem;--ic-space-xl:2rem;--ic-space-xxl:3rem;--ic-z-index-base-value:0;--ic-z-index-page-header:calc(var(--ic-z-index-base-value) + 10);--ic-z-index-back-to-top:calc(var(--ic-z-index-base-value) + 20);--ic-z-index-menu:calc(var(--ic-z-index-base-value) + 50);--ic-z-index-popover:calc(var(--ic-z-index-base-value) + 50);--ic-z-index-navigation-item:calc(var(--ic-z-index-base-value) + 50);--ic-z-index-navigation-menu:calc(var(--ic-z-index-base-value) + 60);--ic-z-index-sticky-page-header:calc(var(--ic-z-index-base-value) + 60);--ic-z-index-side-navigation:calc(var(--ic-z-index-base-value) + 60);--ic-z-index-dialog:calc(var(--ic-z-index-base-value) + 100);--ic-z-index-toast:calc(var(--ic-z-index-base-value) + 110);--ic-z-index-tooltip:calc(var(--ic-z-index-base-value) + 110);--ic-z-index-classification-banner:calc(var(--ic-z-index-base-value) + 200)}
101
+ min(255, calc(var(--ic-theme-calc) + 65))
102
+ min(255, calc(var(--ic-theme-calc) + 70))
103
+ min(255, calc(var(--ic-theme-calc) + 77)) / 20%
104
+ );--ic-hyperlink:#1759bc;--ic-hyperlink-visited:#330072;--ic-hyperlink-hover:#7c2855;--ic-hyperlink-contrast:#5c98f2;--ic-hyperlink-contrast-visited:#bc75ff;--ic-hyperlink-contrast-hover:#db76ac;--ic-focus-blue:#0044d7;--ic-focus-glow:#80a1e8;--ic-hc-focus-outline:3px solid transparent;--ic-table-row-selected:#c7d7ef;--ic-breakpoint-xs:0;--ic-breakpoint-sm:576px;--ic-breakpoint-md:768px;--ic-breakpoint-lg:992px;--ic-breakpoint-xl:1200px;--ic-space-1px:0.063rem;--ic-space-xxxs:0.125rem;--ic-space-xxs:0.25rem;--ic-space-xs:0.5rem;--ic-space-sm:0.75rem;--ic-space-md:1rem;--ic-space-lg:1.5rem;--ic-space-xl:2rem;--ic-space-xxl:3rem;--ic-z-index-base-value:0;--ic-z-index-page-header:calc(var(--ic-z-index-base-value) + 10);--ic-z-index-back-to-top:calc(var(--ic-z-index-base-value) + 20);--ic-z-index-menu:calc(var(--ic-z-index-base-value) + 70);--ic-z-index-popover:calc(var(--ic-z-index-base-value) + 50);--ic-z-index-navigation-item:calc(var(--ic-z-index-base-value) + 50);--ic-z-index-navigation-menu:calc(var(--ic-z-index-base-value) + 60);--ic-z-index-sticky-page-header:calc(var(--ic-z-index-base-value) + 60);--ic-z-index-side-navigation:calc(var(--ic-z-index-base-value) + 60);--ic-z-index-dialog:calc(var(--ic-z-index-base-value) + 100);--ic-z-index-toast:calc(var(--ic-z-index-base-value) + 110);--ic-z-index-tooltip:calc(var(--ic-z-index-base-value) + 110);--ic-z-index-classification-banner:calc(var(--ic-z-index-base-value) + 200)}
@@ -1,5 +1,9 @@
1
1
  export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
2
2
  export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
3
+ /**
4
+ * Transforms a React event name to a browser event name.
5
+ */
6
+ export declare const transformReactEventName: (eventNameSuffix: string) => string;
3
7
  /**
4
8
  * Checks if an event is supported in the current execution environment.
5
9
  * @license Modernizr 3.0.0pre (Custom Build) | MIT
@@ -57,6 +57,16 @@ export const getClassName = (classList, newProps, oldProps) => {
57
57
  incomingPropClasses.forEach((s) => finalClassNames.push(s));
58
58
  return finalClassNames.join(' ');
59
59
  };
60
+ /**
61
+ * Transforms a React event name to a browser event name.
62
+ */
63
+ export const transformReactEventName = (eventNameSuffix) => {
64
+ switch (eventNameSuffix) {
65
+ case 'doubleclick':
66
+ return 'dblclick';
67
+ }
68
+ return eventNameSuffix;
69
+ };
60
70
  /**
61
71
  * Checks if an event is supported in the current execution environment.
62
72
  * @license Modernizr 3.0.0pre (Custom Build) | MIT
@@ -66,7 +76,7 @@ export const isCoveredByReact = (eventNameSuffix) => {
66
76
  return true;
67
77
  }
68
78
  else {
69
- const eventName = 'on' + eventNameSuffix;
79
+ const eventName = 'on' + transformReactEventName(eventNameSuffix);
70
80
  let isSupported = eventName in document;
71
81
  if (!isSupported) {
72
82
  const element = document.createElement('div');
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@ukic/canary-react",
3
- "sideEffects": false,
4
- "version": "2.0.0-canary.0",
3
+ "sideEffects": [
4
+ "*.css"
5
+ ],
6
+ "version": "2.0.0-canary.1",
5
7
  "description": "React-wrapped web components compiled using StencilJS",
6
8
  "scripts": {
7
9
  "build": "npm run clean && npm run compile && npm run copy:core-css && npm run copy:normalize-css",
@@ -15,9 +17,6 @@
15
17
  "copy:core-css": "echo 'Copy core.css from: @ukic/canary-web-components' && mkdirp -p ./dist/core && ncp ../web-components/dist/core/core.css ./dist/core/core.css",
16
18
  "copy:normalize-css": "echo 'Copy normalize.css from: @ukic/canary-web-components' && ncp ../web-components/dist/core/normalize.css ./dist/core/normalize.css"
17
19
  },
18
- "publishConfig": {
19
- "access": "public"
20
- },
21
20
  "main": "./dist/index.js",
22
21
  "module": "./dist/index.js",
23
22
  "types": "./dist/index.d.ts",
@@ -25,12 +24,13 @@
25
24
  "dist/"
26
25
  ],
27
26
  "dependencies": {
28
- "@ukic/canary-web-components": "^2.0.0-canary.0",
29
- "@ukic/fonts": "^2.2.0"
27
+ "@ukic/canary-web-components": "^2.0.0-canary.1",
28
+ "@ukic/fonts": "^2.3.0"
30
29
  },
31
30
  "devDependencies": {
32
31
  "@babel/core": "^7.16.0",
33
- "@stencil/react-output-target": "^0.4.0",
32
+ "@mdi/js": "^7.2.96",
33
+ "@stencil/react-output-target": "^0.5.3",
34
34
  "@storybook/addon-a11y": "^6.4.8",
35
35
  "@storybook/addon-actions": "^6.4.8",
36
36
  "@storybook/addon-docs": "^6.4.8",
@@ -39,12 +39,13 @@
39
39
  "@storybook/addon-postcss": "^2.0.0",
40
40
  "@storybook/builder-webpack5": "^6.5.14",
41
41
  "@storybook/manager-webpack5": "^6.5.14",
42
- "@storybook/react": "6.5.15",
42
+ "@storybook/react": "^6.5.15",
43
43
  "@types/jest": "27.0.3",
44
44
  "@types/node": "^16.11.11",
45
45
  "@types/react": "^17.0.37",
46
46
  "@types/react-dom": "^17.0.11",
47
47
  "babel-loader": "^8.2.3",
48
+ "github-markdown-css": "^5.2.0",
48
49
  "jest": "^27.4.1",
49
50
  "jest-dom": "^4.0.0",
50
51
  "mkdirp": "^1.0.4",
@@ -52,13 +53,12 @@
52
53
  "react": "^16.7.0",
53
54
  "react-dom": "^16.7.0",
54
55
  "react-hook-form": "^7.38.0",
56
+ "react-markdown": "^8.0.7",
55
57
  "react-router-dom": "^6.3.0",
58
+ "remark-gfm": "^3.0.1",
56
59
  "typescript": "^4.5.2",
57
60
  "webpack": "^5.76.0"
58
61
  },
59
- "overrides": {
60
- "webpack": "^5.76.0"
61
- },
62
62
  "peerDependencies": {
63
63
  "react": "^16.7.0 || ^17.0.2 || ^18.2.0",
64
64
  "react-dom": "^16.7.0 || ^17.0.2 || ^18.2.0"
@@ -72,5 +72,5 @@
72
72
  ]
73
73
  },
74
74
  "license": "MIT",
75
- "gitHead": "7c98878b286939f371e498b79cfac7c8617b4a70"
75
+ "gitHead": "f8c6ba22e6f4c75e192812ca44ffa3495c003dee"
76
76
  }