@ukic/canary-react 3.0.0-canary.2 → 3.0.0-canary.21

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,6 +2,7 @@
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
 
@@ -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.
@@ -4,8 +4,6 @@ export declare const IcDataTable: import("react").ForwardRefExoticComponent<JSX.
4
4
  export declare const IcDataTableTitleBar: import("react").ForwardRefExoticComponent<JSX.IcDataTableTitleBar & Omit<import("react").HTMLAttributes<HTMLIcDataTableTitleBarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcDataTableTitleBarElement>>;
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
- export declare const IcMenuWithMulti: import("react").ForwardRefExoticComponent<JSX.IcMenuWithMulti & Omit<import("react").HTMLAttributes<HTMLIcMenuWithMultiElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcMenuWithMultiElement>>;
8
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>>;
9
- export declare const IcSelectWithMulti: import("react").ForwardRefExoticComponent<JSX.IcSelectWithMulti & Omit<import("react").HTMLAttributes<HTMLIcSelectWithMultiElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIcSelectWithMultiElement>>;
10
8
  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>>;
11
9
  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>>;
@@ -9,8 +9,6 @@ export var IcDataTable = /*@__PURE__*/ createReactComponent('ic-data-table');
9
9
  export var IcDataTableTitleBar = /*@__PURE__*/ createReactComponent('ic-data-table-title-bar');
10
10
  export var IcDateInput = /*@__PURE__*/ createReactComponent('ic-date-input');
11
11
  export var IcDatePicker = /*@__PURE__*/ createReactComponent('ic-date-picker');
12
- export var IcMenuWithMulti = /*@__PURE__*/ createReactComponent('ic-menu-with-multi');
13
12
  export var IcPaginationBar = /*@__PURE__*/ createReactComponent('ic-pagination-bar');
14
- export var IcSelectWithMulti = /*@__PURE__*/ createReactComponent('ic-select-with-multi');
15
13
  export var IcTreeItem = /*@__PURE__*/ createReactComponent('ic-tree-item');
16
14
  export var IcTreeView = /*@__PURE__*/ createReactComponent('ic-tree-view');