@equinor/fusion-react-context-selector 2.0.3 → 2.0.5

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.
@@ -1,5 +1,8 @@
1
1
  import type { PropsWithChildren, ReactElement } from 'react';
2
2
  import type { ContextProviderProps } from './types';
3
- export declare const ContextProvider: ({ children, ...props }: PropsWithChildren<ContextProviderProps>) => ReactElement;
3
+ export declare const ContextProvider: {
4
+ ({ children, ...props }: PropsWithChildren<ContextProviderProps>): ReactElement;
5
+ displayName: string;
6
+ };
4
7
  export default ContextProvider;
5
8
  //# sourceMappingURL=ContextProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../src/ContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,eAAe,GAAI,wBAG7B,iBAAiB,CAAC,oBAAoB,CAAC,KAAG,YAG5C,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../src/ContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,eAAe;6BAGzB,iBAAiB,CAAC,oBAAoB,CAAC,GAAG,YAAY;;CAGxD,CAAC;AAIF,eAAe,eAAe,CAAC"}
@@ -4,4 +4,5 @@ export const ContextProvider = ({ children, ...props }) => {
4
4
  const contextResolverRef = useDropdownProviderRef(props.resolver);
5
5
  return _jsx(DropdownProvider, { ref: contextResolverRef, children: children });
6
6
  };
7
+ ContextProvider.displayName = 'ContextProvider';
7
8
  export default ContextProvider;
@@ -11,6 +11,9 @@ export type ContextSearchProps = ContextSelectorProps & {
11
11
  previewItem?: ContextResultItem;
12
12
  onClearContext?: (e: Event) => void;
13
13
  };
14
- export declare const ContextSearch: ({ children, onSelect, previewItem, onClearContext, ...props }: PropsWithChildren<ContextSearchProps>) => ReactElement;
14
+ export declare const ContextSearch: {
15
+ ({ children, onSelect, previewItem, onClearContext, ...props }: PropsWithChildren<ContextSearchProps>): ReactElement;
16
+ displayName: string;
17
+ };
15
18
  export default ContextSearch;
16
19
  //# sourceMappingURL=ContextSearch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextSearch.d.ts","sourceRoot":"","sources":["../src/ContextSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAsB,MAAM,SAAS,CAAC;AAQ3F,UAAU,wBAAwB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,wBAAwB,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,SAAS,wBAAyB;gBACtC,OAAO,EAAE,wBAAwB;CAO9C;AAED,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CACrC,CAAC;AAUF,eAAO,MAAM,aAAa,GAAI,+DAM3B,iBAAiB,CAAC,kBAAkB,CAAC,KAAG,YA4K1C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ContextSearch.d.ts","sourceRoot":"","sources":["../src/ContextSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAsB,MAAM,SAAS,CAAC;AAQ3F,UAAU,wBAAwB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,wBAAwB,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,SAAS,wBAAyB;gBACtC,OAAO,EAAE,wBAAwB;CAO9C;AAED,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CACrC,CAAC;AAUF,eAAO,MAAM,aAAa;oEAMvB,iBAAiB,CAAC,kBAAkB,CAAC,GAAG,YAAY;;CA8KtD,CAAC;AAIF,eAAe,aAAa,CAAC"}
@@ -38,7 +38,9 @@ export const ContextSearch = ({ children, onSelect, previewItem, onClearContext,
38
38
  const toggleGettingCtx = useCallback(() => {
39
39
  setGettingCtx(!gettingCtx);
40
40
  }, [gettingCtx]);
41
- const keyUpGettingCtx = useCallback((e) => {
41
+ const keyUpGettingCtx = useCallback(
42
+ // biome-ignore lint/suspicious/noExplicitAny: fix typing later
43
+ (e) => {
42
44
  if (e.key === 'Enter' || e.key === ' ') {
43
45
  toggleGettingCtx();
44
46
  }
@@ -54,7 +56,9 @@ export const ContextSearch = ({ children, onSelect, previewItem, onClearContext,
54
56
  }
55
57
  }, [onSelect]);
56
58
  /* Clear context button handler */
57
- const handleClearContext = useCallback((event) => {
59
+ const handleClearContext = useCallback(
60
+ // biome-ignore lint/suspicious/noExplicitAny: fix typing later
61
+ (event) => {
58
62
  setCtx(defaultInitialItem);
59
63
  /* Clean SearchableDropdown */
60
64
  if (sdd) {
@@ -132,4 +136,5 @@ export const ContextSearch = ({ children, onSelect, previewItem, onClearContext,
132
136
  // biome-ignore lint/a11y/noNoninteractiveTabindex: will fix later
133
137
  tabIndex: 0, className: styles.titleBlock, onClick: toggleGettingCtx, onKeyDown: (e) => keyUpGettingCtx(e), children: [_jsx("span", { className: styles.title, children: ctx?.title }), _jsx("span", { className: styles.subTitle, children: ctx?.subTitle })] }), _jsx("div", { className: styles.icon, children: ctx && !ctx.isDisabled && (_jsx("button", { type: "button", className: clsx(styles.closeBtn), onClick: handleClearContext, children: _jsx("fwc-icon", { icon: "close" }) })) })] }) }), _jsx("div", { className: clsx(styles.ctxSelector, !gettingCtx ? styles.hidden : 'active'), children: gettingCtx && (_jsx(ContextSelector, { autofocus: true, ...props, onSelect: handleSelect, children: children })) })] }));
134
138
  };
139
+ ContextSearch.displayName = 'ContextSearch';
135
140
  export default ContextSearch;
@@ -1,5 +1,8 @@
1
1
  import type { ContextSelectorProps } from './types';
2
2
  import type { ReactElement, PropsWithChildren } from 'react';
3
- export declare const ContextSelector: ({ children, ...props }: PropsWithChildren<ContextSelectorProps>) => ReactElement;
3
+ export declare const ContextSelector: {
4
+ ({ children, ...props }: PropsWithChildren<ContextSelectorProps>): ReactElement;
5
+ displayName: string;
6
+ };
4
7
  export default ContextSelector;
5
8
  //# sourceMappingURL=ContextSelector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextSelector.d.ts","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,eAAO,MAAM,eAAe,GAAI,wBAG7B,iBAAiB,CAAC,oBAAoB,CAAC,KAAG,YAE5C,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ContextSelector.d.ts","sourceRoot":"","sources":["../src/ContextSelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,eAAO,MAAM,eAAe;6BAGzB,iBAAiB,CAAC,oBAAoB,CAAC,GAAG,YAAY;;CAExD,CAAC;AAIF,eAAe,eAAe,CAAC"}
@@ -3,4 +3,5 @@ import { Dropdown } from '@equinor/fusion-react-searchable-dropdown';
3
3
  export const ContextSelector = ({ children, ...props }) => {
4
4
  return _jsx(Dropdown, { ...props, children: children });
5
5
  };
6
+ ContextSelector.displayName = 'ContextSelector';
6
7
  export default ContextSelector;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-react-context-selector",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "React component for context selector",
5
5
  "keywords": [
6
6
  "contextselector",
@@ -28,15 +28,21 @@
28
28
  "url": "git+https://github.com/equinor/fusion-react-components.git",
29
29
  "directory": "packages/context-selector"
30
30
  },
31
+ "scripts": {
32
+ "build": "tsc -b",
33
+ "lint": "biome lint",
34
+ "format": "biome format",
35
+ "prepack": "npm run build"
36
+ },
31
37
  "bugs": {
32
38
  "url": "https://github.com/equinor/fusion-react-components/issues"
33
39
  },
34
40
  "dependencies": {
41
+ "@equinor/fusion-react-searchable-dropdown": "2.0.4",
42
+ "@equinor/fusion-react-styles": "2.1.4",
43
+ "@equinor/fusion-react-utils": "3.0.2",
35
44
  "@equinor/fusion-wc-icon": "^2.4.1",
36
- "@equinor/fusion-wc-searchable-dropdown": "^4.1.1",
37
- "@equinor/fusion-react-searchable-dropdown": "^2.0.2",
38
- "@equinor/fusion-react-styles": "^2.1.2",
39
- "@equinor/fusion-react-utils": "^3.0.2"
45
+ "@equinor/fusion-wc-searchable-dropdown": "^4.1.1"
40
46
  },
41
47
  "devDependencies": {
42
48
  "@types/react": "^19.2.14",
@@ -44,10 +50,5 @@
44
50
  },
45
51
  "peerDependencies": {
46
52
  "react": "^18 || ^19"
47
- },
48
- "scripts": {
49
- "build": "tsc -b",
50
- "lint": "biome lint",
51
- "format": "biome format"
52
53
  }
53
- }
54
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Equinor
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.