@equinor/cpl-compact-autocomplete 0.0.4 → 0.0.6

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/dist/index.d.mts CHANGED
@@ -1,12 +1,14 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { AutocompleteProps } from '@equinor/eds-core-react';
3
+ import * as react from 'react';
4
+ import { ForwardedRef } from 'react';
3
5
  import * as styled_components_dist_types from 'styled-components/dist/types';
4
6
  import * as styled_components from 'styled-components';
5
- import * as react from 'react';
6
7
 
7
8
  interface CompactAutocompleteProps<T> extends Omit<AutocompleteProps<T>, 'ref'> {
9
+ autocompleteRef?: ForwardedRef<HTMLDivElement>;
8
10
  }
9
- declare function CompactAutocomplete<T>({ id, label, ...props }: CompactAutocompleteProps<T>): react_jsx_runtime.JSX.Element;
11
+ declare function CompactAutocomplete<T>({ id, label, autocompleteRef, ...props }: CompactAutocompleteProps<T>): react_jsx_runtime.JSX.Element;
10
12
 
11
13
  declare const CompactAutocompleteLabel: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
12
14
 
package/dist/index.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { AutocompleteProps } from '@equinor/eds-core-react';
3
+ import * as react from 'react';
4
+ import { ForwardedRef } from 'react';
3
5
  import * as styled_components_dist_types from 'styled-components/dist/types';
4
6
  import * as styled_components from 'styled-components';
5
- import * as react from 'react';
6
7
 
7
8
  interface CompactAutocompleteProps<T> extends Omit<AutocompleteProps<T>, 'ref'> {
9
+ autocompleteRef?: ForwardedRef<HTMLDivElement>;
8
10
  }
9
- declare function CompactAutocomplete<T>({ id, label, ...props }: CompactAutocompleteProps<T>): react_jsx_runtime.JSX.Element;
11
+ declare function CompactAutocomplete<T>({ id, label, autocompleteRef, ...props }: CompactAutocompleteProps<T>): react_jsx_runtime.JSX.Element;
10
12
 
11
13
  declare const CompactAutocompleteLabel: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
12
14
 
package/dist/index.js CHANGED
@@ -105,7 +105,15 @@ var CompactAutocompleteWrapper = import_styled_components2.default.div`
105
105
  // src/CompactAutocomplete.tsx
106
106
  var import_jsx_runtime = require("react/jsx-runtime");
107
107
  function CompactAutocomplete(_a) {
108
- var _b = _a, { id, label } = _b, props = __objRest(_b, ["id", "label"]);
108
+ var _b = _a, {
109
+ id,
110
+ label,
111
+ autocompleteRef
112
+ } = _b, props = __objRest(_b, [
113
+ "id",
114
+ "label",
115
+ "autocompleteRef"
116
+ ]);
109
117
  const autocompleteId = (0, import_react.useMemo)(() => id != null ? id : crypto.randomUUID(), [id]);
110
118
  const labelId = (0, import_react.useMemo)(() => crypto.randomUUID(), []);
111
119
  const { multiple, optionLabel, selectedOptions } = props;
@@ -124,7 +132,8 @@ function CompactAutocomplete(_a) {
124
132
  id: autocompleteId,
125
133
  label: null,
126
134
  "aria-labelledby": labelId,
127
- placeholder
135
+ placeholder,
136
+ ref: autocompleteRef
128
137
  }, props)
129
138
  ) })
130
139
  ] });
package/dist/index.mjs CHANGED
@@ -70,7 +70,15 @@ var CompactAutocompleteWrapper = styled2.div`
70
70
  // src/CompactAutocomplete.tsx
71
71
  import { jsx, jsxs } from "react/jsx-runtime";
72
72
  function CompactAutocomplete(_a) {
73
- var _b = _a, { id, label } = _b, props = __objRest(_b, ["id", "label"]);
73
+ var _b = _a, {
74
+ id,
75
+ label,
76
+ autocompleteRef
77
+ } = _b, props = __objRest(_b, [
78
+ "id",
79
+ "label",
80
+ "autocompleteRef"
81
+ ]);
74
82
  const autocompleteId = useMemo(() => id != null ? id : crypto.randomUUID(), [id]);
75
83
  const labelId = useMemo(() => crypto.randomUUID(), []);
76
84
  const { multiple, optionLabel, selectedOptions } = props;
@@ -89,7 +97,8 @@ function CompactAutocomplete(_a) {
89
97
  id: autocompleteId,
90
98
  label: null,
91
99
  "aria-labelledby": labelId,
92
- placeholder
100
+ placeholder,
101
+ ref: autocompleteRef
93
102
  }, props)
94
103
  ) })
95
104
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/cpl-compact-autocomplete",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -14,8 +14,7 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@equinor/eds-core-react": "^0.42.5",
17
- "@storybook/react": "^8.5.2",
18
- "@storybook/test": "^8.5.2",
17
+ "@storybook/react": "^9.0.12",
19
18
  "@types/react": "^18.3.18",
20
19
  "@types/react-dom": "^18.3.5",
21
20
  "@types/styled-components": "^5.1.34",
@@ -24,8 +23,8 @@
24
23
  "react-dom": "^18.2.0",
25
24
  "styled-components": "^6.1.14",
26
25
  "tsup": "^8.3.6",
27
- "eslint-config-custom": "0.0.7",
28
- "tsconfig": "0.0.1"
26
+ "@equinor/cpl-eslint-config": "0.0.8",
27
+ "@equinor/cpl-typescript-config": "0.0.2"
29
28
  },
30
29
  "peerDependencies": {
31
30
  "@equinor/eds-core-react": ">=0.42.1",
@@ -40,6 +39,7 @@
40
39
  "build": "tsup src/index.ts --format esm,cjs --dts --external react",
41
40
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
42
41
  "dev": "tsup src/index.ts --format esm,cjs --watch --dts --external react",
43
- "lint": "TIMING=1 eslint . --fix"
42
+ "lint": "TIMING=1 eslint . --fix",
43
+ "typecheck": "tsc --noEmit"
44
44
  }
45
45
  }