@equinor/eds-core-react 2.1.0 → 2.2.1-beta.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 CHANGED
@@ -1,17 +1,43 @@
1
1
  # @equinor/eds-core-react
2
2
 
3
- Available components to help style your React application as an Equinor application. We publish new components regularly so make sure to check back often!
3
+ React implementation of the Equinor Design System (EDS). Use it to build applications that follow the EDS guidelines and stay up to date with the latest components.
4
4
 
5
5
  Make sure to check out our [Storybook](https://storybook.eds.equinor.com/) for more examples!
6
6
  Read the [changelog](https://github.com/equinor/design-system/blob/main/packages/eds-core-react/CHANGELOG.md) for details on specific releases.
7
7
 
8
8
  ## Installation
9
9
 
10
- ```sh
10
+ ### Stable Release (Recommended)
11
+
12
+ ```bash
11
13
  npm install @equinor/eds-core-react styled-components
12
14
  ```
13
- If you use Typescript, make sure you have typescript >= 3.8 as a devDependency:
14
- ```sh
15
+
16
+ ```typescript
17
+ import { Button, Typography } from '@equinor/eds-core-react'
18
+ ```
19
+
20
+ ### Beta Release (EDS 2.0)
21
+
22
+ ⚠️ **Experimental** – For testing and feedback only. Not production-ready.
23
+
24
+ ```bash
25
+ npm install @equinor/eds-core-react@beta
26
+ ```
27
+
28
+ ```typescript
29
+ import { Button, Typography } from '@equinor/eds-core-react/next'
30
+ ```
31
+
32
+ **Learn more:**
33
+ - [Complete Beta Release Guide](../../documentation/how-to/BETA_RELEASE_GUIDE.md)
34
+ - [Preview EDS 2.0 components in Storybook](https://storybook.eds.equinor.com)
35
+
36
+ ### Additional Setup
37
+
38
+ If you use TypeScript, make sure you have TypeScript >= 3.8 as a devDependency:
39
+
40
+ ```bash
15
41
  npm install typescript --save-dev
16
42
  ```
17
43
 
@@ -116,3 +142,22 @@ render(<App />, document.getElementById('root'))
116
142
  - Tooltip
117
143
  - TopBar
118
144
  - Typography
145
+
146
+ ## Documentation
147
+
148
+ - **Storybook**: https://storybook.eds.equinor.com
149
+ - **Design System Docs**: https://eds.equinor.com
150
+ - **Contributing**: [CONTRIBUTING.md](../../CONTRIBUTING.md)
151
+
152
+ ## Changelogs
153
+
154
+ - **Stable**: [CHANGELOG.md](./CHANGELOG.md)
155
+ - **Beta**: [CHANGELOG.md](./src/components/next/CHANGELOG.md)
156
+
157
+ ## Package Structure
158
+
159
+ ```
160
+ @equinor/eds-core-react
161
+ ├── / # Stable components (EDS 1.0)
162
+ └── /next # Beta components (EDS 2.0)
163
+ ```
@@ -0,0 +1,17 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ /**
4
+ * Placeholder component for testing the /next entry point.
5
+ * This component should be removed once real EDS 2.0 components are added.
6
+ */
7
+
8
+ const Placeholder = ({
9
+ text = 'EDS 2.0 Placeholder'
10
+ }) => {
11
+ return /*#__PURE__*/jsx("div", {
12
+ "data-testid": "eds-placeholder",
13
+ children: text
14
+ });
15
+ };
16
+
17
+ export { Placeholder };
@@ -0,0 +1 @@
1
+ export { Placeholder } from './components/next/Placeholder/Placeholder.js';
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ /**
6
+ * Placeholder component for testing the /next entry point.
7
+ * This component should be removed once real EDS 2.0 components are added.
8
+ */
9
+
10
+ const Placeholder = ({
11
+ text = 'EDS 2.0 Placeholder'
12
+ }) => {
13
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
14
+ "data-testid": "eds-placeholder",
15
+ children: text
16
+ });
17
+ };
18
+
19
+ exports.Placeholder = Placeholder;
@@ -3,7 +3,7 @@ import { Variants } from '../types';
3
3
  export type AutocompleteChanges<T> = {
4
4
  selectedItems: T[];
5
5
  };
6
- export type AutocompleteProps<T> = {
6
+ export type AutocompleteProps<T = string> = {
7
7
  /** List of options in dropdown */
8
8
  options: readonly T[];
9
9
  /** Total number of options */
@@ -61,8 +61,6 @@ export type AutocompleteProps<T> = {
61
61
  multiple?: boolean;
62
62
  /** Add select-all option. Throws an error if true while multiple = false */
63
63
  allowSelectAll?: boolean;
64
- /** Custom option label. NOTE: This is required when option is an object */
65
- optionLabel?: (option: T) => string;
66
64
  /** Custom option template */
67
65
  optionComponent?: (option: T, isSelected: boolean) => ReactNode;
68
66
  /** Disable option
@@ -100,9 +98,18 @@ export type AutocompleteProps<T> = {
100
98
  * Callback for clear all button
101
99
  */
102
100
  onClear?: () => void;
103
- } & HTMLAttributes<HTMLDivElement>;
101
+ } & HTMLAttributes<HTMLDivElement> & (T extends string | number ? {
102
+ /** Custom option label. NOTE: This is required when option is an object */
103
+ optionLabel?: (option: T) => string;
104
+ } : T extends object ? {
105
+ /** Custom option label. NOTE: This is required when option is an object */
106
+ optionLabel: (option: T) => string;
107
+ } : {
108
+ /** Custom option label. NOTE: This is required when option is an object */
109
+ optionLabel?: (option: T) => string;
110
+ });
104
111
  declare function AutocompleteInner<T>(props: AutocompleteProps<T>, ref: React.ForwardedRef<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
105
- export declare const Autocomplete: <T>(props: AutocompleteProps<T> & {
112
+ export declare const Autocomplete: <T = string>(props: AutocompleteProps<T> & {
106
113
  ref?: React.ForwardedRef<HTMLInputElement>;
107
114
  /** @ignore */
108
115
  displayName?: string | undefined;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Placeholder component for testing the /next entry point.
3
+ * This component should be removed once real EDS 2.0 components are added.
4
+ */
5
+ export type PlaceholderProps = {
6
+ /** Text to display */
7
+ text?: string;
8
+ };
9
+ export declare const Placeholder: ({ text, }: PlaceholderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Placeholder } from './Placeholder';
2
+ export type { PlaceholderProps } from './Placeholder';
@@ -0,0 +1,2 @@
1
+ export { Placeholder } from './Placeholder';
2
+ export type { PlaceholderProps } from './Placeholder';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * EDS 2.0 Beta Components
3
+ *
4
+ * These components are experimental and under active development.
5
+ * Breaking changes may occur between beta releases.
6
+ *
7
+ * Install: npm install @equinor/eds-core-react@beta
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+ export * from './components/next';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/eds-core-react",
3
- "version": "2.1.0",
3
+ "version": "2.2.1-beta.0",
4
4
  "description": "The React implementation of the Equinor Design System",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -30,6 +30,11 @@
30
30
  "types": "./dist/types/index.d.ts",
31
31
  "import": "./dist/esm/index.js",
32
32
  "require": "./dist/eds-core-react.cjs"
33
+ },
34
+ "./next": {
35
+ "types": "./dist/types/index.next.d.ts",
36
+ "import": "./dist/esm/index.next.js",
37
+ "require": "./dist/index.next.cjs"
33
38
  }
34
39
  },
35
40
  "keywords": [
@@ -39,7 +44,7 @@
39
44
  "react"
40
45
  ],
41
46
  "devDependencies": {
42
- "@playwright/test": "^1.55.0",
47
+ "@playwright/test": "^1.57.0",
43
48
  "@rollup/plugin-babel": "^6.1.0",
44
49
  "@rollup/plugin-commonjs": "^28.0.8",
45
50
  "@rollup/plugin-node-resolve": "^16.0.3",
@@ -95,9 +100,9 @@
95
100
  "@tanstack/react-virtual": "3.13.12",
96
101
  "downshift": "9.0.10",
97
102
  "react-aria": "^3.44.0",
98
- "@equinor/eds-icons": "^1.0.1",
99
- "@equinor/eds-tokens": "^2.1.0",
100
- "@equinor/eds-utils": "^2.0.0"
103
+ "@equinor/eds-icons": "^1.1.0",
104
+ "@equinor/eds-utils": "^2.0.0",
105
+ "@equinor/eds-tokens": "^2.1.1"
101
106
  },
102
107
  "scripts": {
103
108
  "build": "rollup -c && tsc -p tsconfig.build.json",