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

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.4",
4
4
  "description": "React component for context selector",
5
5
  "keywords": [
6
6
  "contextselector",
@@ -34,8 +34,8 @@
34
34
  "dependencies": {
35
35
  "@equinor/fusion-wc-icon": "^2.4.1",
36
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",
37
+ "@equinor/fusion-react-searchable-dropdown": "^2.0.4",
38
+ "@equinor/fusion-react-styles": "^2.1.4",
39
39
  "@equinor/fusion-react-utils": "^3.0.2"
40
40
  },
41
41
  "devDependencies": {