@ukic/canary-react 3.0.0-canary.3 → 3.0.0-canary.30

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/README.md CHANGED
@@ -2,10 +2,11 @@
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)
5
+ [![npm](https://img.shields.io/npm/v/@ukic/canary-react.svg)](https://npmjs.com/package/@ukic/canary-react)
5
6
 
6
7
  The [Intelligence Community Design System](https://design.sis.gov.uk) helps the United Kingdom's Intelligence Community (MI6, GCHQ, MI5, and partners) to quickly build powerful capabilities that are accessible and easy to use.
7
8
 
8
- This is a joint project led by [MI6](https://www.sis.gov.uk), working with [GCHQ](https://www.gchq.gov.uk) and [MI5](https://www.mi5.gov.uk).
9
+ This is a joint project led by [MI6](https://www.sis.gov.uk), working with [GCHQ](https://www.gchq.gov.uk), [MI5](https://www.mi5.gov.uk) and [HMGCC](https://www.hmgcc.gov.uk) (our national security partner).
9
10
 
10
11
  ## Installing
11
12
 
@@ -16,10 +17,10 @@ To install the components:
16
17
  In the root of your project:
17
18
 
18
19
  ```shell
19
- // using npm
20
+ # using npm
20
21
  npm install @ukic/canary-react @ukic/fonts
21
22
 
22
- // using yarn
23
+ # using yarn
23
24
  rm package-lock.json
24
25
  yarn add @ukic/canary-react @ukic/fonts
25
26
  ```
@@ -37,7 +38,7 @@ Add the following into the top level CSS file for your project.
37
38
 
38
39
  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/).
39
40
 
40
- 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.
41
+ If you would like to import these styles in order 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.
41
42
 
42
43
  ```css
43
44
  @import "@ukic/canary-react/dist/core/normalize.css";
@@ -57,6 +58,28 @@ The `@ukic/canary-react` package will need to be transformed before you can use
57
58
 
58
59
  Add a `transformIgnorePatterns` field with the value `["/node_modules/(?!@ukic/canary-react)"]` to your Jest config.
59
60
 
61
+ ## Typescript
62
+
63
+ If your project is making use of Typescript, you can import the custom types used in the ICDS component library. For details on the types implemented in each component, refer to the Props table on the Code page for each Component on the [Design System Guidance site](https://design.sis.gov.uk/components/select/code)
64
+
65
+ Types can be imported from the @ukic/canary-web-components package as per the below example.
66
+
67
+ > [!NOTE]
68
+ > You do not have to install this package into your project, it is already installed as a dependency of @ukic/canary-react.
69
+
70
+ ```ts
71
+ import { IcPaginationBarOptions } from '@ukic/canary-web-components';
72
+
73
+ let paginationConfig: IcPaginationBarOptions = {
74
+ itemsPerPageOptions: [
75
+ { label: "5", value: "5" },
76
+ { label: "10", value: "10" },
77
+ ],
78
+ showItemsPerPageControl: true,
79
+ selectedItemsPerPage: 5,
80
+ }
81
+ ```
82
+
60
83
  ## Security
61
84
 
62
85
  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.
@@ -5,5 +5,7 @@ export declare const IcDataTableTitleBar: import("react").ForwardRefExoticCompon
5
5
  export declare const IcDateInput: import("react").ForwardRefExoticComponent<JSX.IcDateInput & Omit<import("react").HTMLAttributes<HTMLIcDateInputElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDateInputElement>>;
6
6
  export declare const IcDatePicker: import("react").ForwardRefExoticComponent<JSX.IcDatePicker & Omit<import("react").HTMLAttributes<HTMLIcDatePickerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDatePickerElement>>;
7
7
  export declare const IcPaginationBar: import("react").ForwardRefExoticComponent<JSX.IcPaginationBar & Omit<import("react").HTMLAttributes<HTMLIcPaginationBarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcPaginationBarElement>>;
8
+ export declare const IcTableOfContents: import("react").ForwardRefExoticComponent<JSX.IcTableOfContents & Omit<import("react").HTMLAttributes<HTMLIcTableOfContentsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTableOfContentsElement>>;
9
+ export declare const IcTimeInput: import("react").ForwardRefExoticComponent<JSX.IcTimeInput & Omit<import("react").HTMLAttributes<HTMLIcTimeInputElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTimeInputElement>>;
8
10
  export declare const IcTreeItem: import("react").ForwardRefExoticComponent<JSX.IcTreeItem & Omit<import("react").HTMLAttributes<HTMLIcTreeItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTreeItemElement>>;
9
11
  export declare const IcTreeView: import("react").ForwardRefExoticComponent<JSX.IcTreeView & Omit<import("react").HTMLAttributes<HTMLIcTreeViewElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcTreeViewElement>>;
@@ -10,5 +10,7 @@ export var IcDataTableTitleBar = /*@__PURE__*/ createReactComponent('ic-data-tab
10
10
  export var IcDateInput = /*@__PURE__*/ createReactComponent('ic-date-input');
11
11
  export var IcDatePicker = /*@__PURE__*/ createReactComponent('ic-date-picker');
12
12
  export var IcPaginationBar = /*@__PURE__*/ createReactComponent('ic-pagination-bar');
13
+ export var IcTableOfContents = /*@__PURE__*/ createReactComponent('ic-table-of-contents');
14
+ export var IcTimeInput = /*@__PURE__*/ createReactComponent('ic-time-input');
13
15
  export var IcTreeItem = /*@__PURE__*/ createReactComponent('ic-tree-item');
14
16
  export var IcTreeView = /*@__PURE__*/ createReactComponent('ic-tree-view');