genesys-spark-components-react 4.0.0-beta.39 → 4.0.0-beta.41
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 +32 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React Integration
|
|
2
2
|
|
|
3
|
-
This should
|
|
3
|
+
This package generates a set of react wrapper elements which are published in `genesys-spark-components-react` and should be used in favor of directly using the custom elements in a React app.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install `genesys-spark-components-react` with same version as the desired `genesys-spark-components` version. (e.g. `genesys-spark-components-react@X.Y.Z` will install `genesys-spark-components@X.Y.Z`). To avoid version conflicts, remove the direct dependency on `genesys-spark-components` if adding to an existing consumer of the spark components.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Native React elements are imported from `genesys-spark-components-react`, the custom elements still need to be registered as before, (e.g. with `registerElements` imported from `genesys-spark-components`).
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { registerElements } from 'genesys-spark-components';
|
|
17
|
+
import { GuxButton } from 'genesys-spark-components-react';
|
|
18
|
+
registerElements(); // Realistically this would probably be in something like index.tsx
|
|
19
|
+
|
|
20
|
+
const MyReactComponent = () => {
|
|
21
|
+
const [counter, setCounter] = useState(0);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<GuxButton onClick={() => setCounter(x => x + 1)}>
|
|
25
|
+
You have clicked {counter} times
|
|
26
|
+
</GuxButton>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Events
|
|
32
|
+
|
|
33
|
+
If a stencil component defines an event called `eventname`, then the React wrapper element will have a corresponding `onEventname` prop. For example, `<GuxModal>` has `onGuxdismiss` corresponding to the `guxdismiss` event from `<gux-modal>`.
|
package/dist/index.d.ts
CHANGED
|
@@ -103,7 +103,6 @@ export declare const GuxTabList: import("react").ForwardRefExoticComponent<JSX.G
|
|
|
103
103
|
export declare const GuxTabPanel: import("react").ForwardRefExoticComponent<JSX.GuxTabPanel & Omit<import("react").HTMLAttributes<HTMLGuxTabPanelElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxTabPanelElement>>;
|
|
104
104
|
export declare const GuxTable: import("react").ForwardRefExoticComponent<JSX.GuxTable & Omit<import("react").HTMLAttributes<HTMLGuxTableElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxTableElement>>;
|
|
105
105
|
export declare const GuxTableSelectMenu: import("react").ForwardRefExoticComponent<JSX.GuxTableSelectMenu & Omit<import("react").HTMLAttributes<HTMLGuxTableSelectMenuElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxTableSelectMenuElement>>;
|
|
106
|
-
export declare const GuxTableSelectPopover: import("react").ForwardRefExoticComponent<JSX.GuxTableSelectPopover & Omit<import("react").HTMLAttributes<HTMLGuxTableSelectPopoverElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxTableSelectPopoverElement>>;
|
|
107
106
|
export declare const GuxTableToolbar: import("react").ForwardRefExoticComponent<JSX.GuxTableToolbar & Omit<import("react").HTMLAttributes<HTMLGuxTableToolbarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxTableToolbarElement>>;
|
|
108
107
|
export declare const GuxTableToolbarAction: import("react").ForwardRefExoticComponent<JSX.GuxTableToolbarAction & Omit<import("react").HTMLAttributes<HTMLGuxTableToolbarActionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxTableToolbarActionElement>>;
|
|
109
108
|
export declare const GuxTableToolbarCustomAction: import("react").ForwardRefExoticComponent<JSX.GuxTableToolbarCustomAction & Omit<import("react").HTMLAttributes<HTMLGuxTableToolbarCustomActionElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLGuxTableToolbarCustomActionElement>>;
|
package/dist/index.js
CHANGED
|
@@ -105,7 +105,6 @@ export const GuxTabList = /*@__PURE__*/ createReactComponent('gux-tab-list');
|
|
|
105
105
|
export const GuxTabPanel = /*@__PURE__*/ createReactComponent('gux-tab-panel');
|
|
106
106
|
export const GuxTable = /*@__PURE__*/ createReactComponent('gux-table');
|
|
107
107
|
export const GuxTableSelectMenu = /*@__PURE__*/ createReactComponent('gux-table-select-menu');
|
|
108
|
-
export const GuxTableSelectPopover = /*@__PURE__*/ createReactComponent('gux-table-select-popover');
|
|
109
108
|
export const GuxTableToolbar = /*@__PURE__*/ createReactComponent('gux-table-toolbar');
|
|
110
109
|
export const GuxTableToolbarAction = /*@__PURE__*/ createReactComponent('gux-table-toolbar-action');
|
|
111
110
|
export const GuxTableToolbarCustomAction = /*@__PURE__*/ createReactComponent('gux-table-toolbar-custom-action');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genesys-spark-components-react",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.41",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"version-sync": "npm version --no-git-tag-version --allow-same-version"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"genesys-spark-components": "4.0.0-beta.
|
|
22
|
+
"genesys-spark-components": "4.0.0-beta.41"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@types/react": "16 - 18",
|