@equinor/fusion-react-context-selector 0.1.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.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ <!--prettier-ignore-start-->
2
+ # @equinor/fusion-react-context-selector
3
+
4
+ [![Published on npm](https://img.shields.io/npm/v/@equinor/fusion-react-context-selector.svg)](https://www.npmjs.com/package/@equinor/fusion-react-context-selector)
5
+
6
+ [Storybook](https://equinor.github.io/fusion-react-components/?path=/docs/data-searchabledropdown)
7
+
8
+ [Fusion Web Component](https://github.com/equinor/fusion-web-components/tree/main/packages/searchable-dropdown)
9
+
10
+ ### Installation
11
+
12
+ ```sh
13
+ npm install @equinor/fusion-react-context-selector
14
+ ```
15
+
16
+ ### Methods
17
+
18
+ | Name | Description
19
+ | -------- | -------------
20
+ | `select() => SearchableDropdownResult` | Returns `SearchableDropdownResult` of selected items.
21
+
22
+ <!--prettier-ignore-end-->
@@ -0,0 +1,9 @@
1
+ import { DropdownProps, SearchableDropdownResolver } from '@equinor/fusion-react-searchable-dropdown';
2
+ declare type ElementResolver = {
3
+ resolver?: SearchableDropdownResolver;
4
+ };
5
+ export { SearchableDropdownResult, SearchableDropdownResultItem } from '@equinor/fusion-react-searchable-dropdown';
6
+ export declare type ContextSelectorProps = DropdownProps & ElementResolver;
7
+ export declare const ContextSelector: ({ children, ...props }: React.PropsWithChildren<ContextSelectorProps>) => JSX.Element;
8
+ export default ContextSelector;
9
+ //# sourceMappingURL=ContextSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextSelector.d.ts","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,aAAa,EACb,0BAA0B,EAC3B,MAAM,2CAA2C,CAAC;AAEnD,aAAK,eAAe,GAAG;IACrB,QAAQ,CAAC,EAAE,0BAA0B,CAAC;CACvC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAEnH,oBAAY,oBAAoB,GAAG,aAAa,GAAG,eAAe,CAAC;AAEnE,eAAO,MAAM,eAAe,2BAA4B,MAAM,iBAAiB,CAAC,oBAAoB,CAAC,KAAG,WAOvG,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /* eslint-disable react/no-multi-comp */
3
+ import { DropdownProvider, Dropdown, useDropdownProviderRef, } from '@equinor/fusion-react-searchable-dropdown';
4
+ export const ContextSelector = ({ children, ...props }) => {
5
+ const providerRef = useDropdownProviderRef(props.resolver);
6
+ return (_jsx(DropdownProvider, { ref: providerRef, children: _jsx(Dropdown, { ...props, children: children }) }));
7
+ };
8
+ export default ContextSelector;
9
+ //# sourceMappingURL=ContextSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextSelector.js","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,sBAAsB,GAGvB,MAAM,2CAA2C,CAAC;AAUnD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiD,EAAe,EAAE;IACpH,MAAM,WAAW,GAAG,sBAAsB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3D,OAAO,CACL,KAAC,gBAAgB,IAAC,GAAG,EAAE,WAAW,YAChC,KAAC,QAAQ,OAAK,KAAK,YAAG,QAAQ,GAAY,GACzB,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './ContextSelector';
2
+ export { ContextSelector as default } from './ContextSelector';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './ContextSelector';
2
+ export { ContextSelector as default } from './ContextSelector';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@equinor/fusion-react-context-selector",
3
+ "version": "0.1.0",
4
+ "description": "React component for context selector",
5
+ "keywords": [
6
+ "contextselector",
7
+ "searchabledropdown",
8
+ "textinput",
9
+ "list",
10
+ "react",
11
+ "fusion",
12
+ "equinor"
13
+ ],
14
+ "homepage": "https://github.com/equinor/fusion-react-components/tree/master/packages/context-selector#readme",
15
+ "license": "ISC",
16
+ "main": "dist/index.js",
17
+ "directories": {
18
+ "dist": "dist"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/equinor/fusion-react-components.git"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc -b",
32
+ "lint": "eslint --ext .ts,.tsx,.js src/",
33
+ "lint:fix": "eslint --ext .ts,.tsx,.js src/ --fix",
34
+ "prepack": "npm run build"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/equinor/fusion-react-components/issues"
38
+ },
39
+ "dependencies": {
40
+ "@equinor/fusion-react-searchable-dropdown": "^0.1.1",
41
+ "@equinor/fusion-react-utils": "^2.0.3"
42
+ },
43
+ "gitHead": "d1886a078a274136a23507da46d8de297713af73"
44
+ }