@equinor/eds-core-react 0.17.0 → 0.18.0-envis.1

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
@@ -3,7 +3,7 @@
3
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!
4
4
 
5
5
  Make sure to check out our [Storybook](https://eds-storybook-react.azurewebsites.net/) for more examples!
6
- Read the [changelog](https://github.com/equinor/design-system/blob/develop/libraries/core-react/CHANGELOG.md) for details on specific releases.
6
+ Read the [changelog](https://github.com/equinor/design-system/blob/develop/packages/eds-core-react/CHANGELOG.md) for details on specific releases.
7
7
 
8
8
  ## Installation
9
9
 
@@ -83,20 +83,29 @@ const {
83
83
  } = edsTokens.tokens;
84
84
  const button = {
85
85
  background: 'transparent',
86
- height: buttonHeight,
86
+ // height: buttonHeight,
87
87
  typography: { ...buttonTypography,
88
- textAlign: 'center'
88
+ textAlign: 'center',
89
+ fontSize: '0.875rem' // 14px - 14/16
90
+
89
91
  },
90
92
  border: {
91
93
  type: 'border',
92
94
  width: '1px',
93
95
  color: 'transparent',
94
- radius: buttonBorderRadius$2,
96
+ //radius: buttonBorderRadius,
97
+ radius: '0.2857em',
98
+ // 4px - 4/14
95
99
  style: 'solid'
96
100
  },
97
101
  spacings: {
98
- left: medium$6,
99
- right: medium$6
102
+ top: 'calc(0.7142em - 1px)',
103
+ // calc(10px - 1px) - 10/14 (line-height er 1.143em = 16.002px)
104
+ bottom: 'calc(0.7142em - 1px)',
105
+ left: '1.1428em',
106
+ right: '1.1428em' // left: medium,
107
+ // right: medium,
108
+
100
109
  },
101
110
  clickbound: {
102
111
  height: clicboundHeight$1,
@@ -118,7 +127,9 @@ const button = {
118
127
  type: 'border',
119
128
  width: '1px',
120
129
  color: 'transparent',
121
- radius: buttonBorderRadius$2,
130
+ //radius: buttonBorderRadius,
131
+ radius: '0.2857em',
132
+ // 4px - 4/14
122
133
  style: 'solid'
123
134
  }
124
135
  },
@@ -147,7 +158,13 @@ const button = {
147
158
  },
148
159
  modes: {
149
160
  compact: {
150
- height: compactButtonHeight,
161
+ minHeight: '1.7142em',
162
+ // 24px
163
+ spacings: {
164
+ top: 'calc(0.2857em - 1px)',
165
+ // calc(4px - 1px) - 4/14
166
+ bottom: 'calc(0.2857em - 1px)'
167
+ },
151
168
  clickbound: {
152
169
  height: compactClickboundHeight$1,
153
170
  width: '100%',
@@ -1147,7 +1164,7 @@ const FullWidthCenterContent = styled__default['default'].span.withConfig({
1147
1164
  const FullWidthInner = styled__default['default'].span.withConfig({
1148
1165
  displayName: "InnerFullWidth__FullWidthInner",
1149
1166
  componentId: "sc-qeawkb-1"
1150
- })(["height:100%;display:flex;align-items:center;> img:first-child,> svg:first-child{margin-right:8px;}> img:last-child,> svg:last-child{margin-left:8px;}> img:only-child,> svg:only-child{margin-left:auto;margin-right:auto;}> span:first-child{margin-left:32px;}> span:last-child{margin-right:32px;}> span:only-child{margin-right:0;margin-left:0;}"]);
1167
+ })(["height:100%;display:flex;align-items:center;>:is(svg,img){margin-top:-4px;margin-bottom:-4px;}>:is(svg,img):first-child{margin-right:0.5714em;}>:is(svg,img):last-child{margin-left:0.5714em;}>:is(svg,img):only-child{margin-left:auto;margin-right:auto;}> span:first-child{margin-left:2.2857em;}> span:last-child{margin-right:2.2857em;}> span:only-child{margin-right:0;margin-left:0;}"]);
1151
1168
  const InnerFullWidth = /*#__PURE__*/react.forwardRef(function InnerFullWidth({
1152
1169
  children
1153
1170
  }, ref) {
@@ -1226,7 +1243,7 @@ const getToken$1 = (variant, color) => {
1226
1243
  const Inner = styled__default['default'].span.withConfig({
1227
1244
  displayName: "Button__Inner",
1228
1245
  componentId: "sc-1hs0myn-0"
1229
- })(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;height:100%;justify-content:center;"]);
1246
+ })(["display:grid;grid-gap:0.5714em;grid-auto-flow:column;align-items:center;height:100%;justify-content:center;& >:is(svg,img){margin-top:-4px;margin-bottom:-4px;}"]);
1230
1247
  const ButtonBase = styled__default['default'].button.withConfig({
1231
1248
  displayName: "Button__ButtonBase",
1232
1249
  componentId: "sc-1hs0myn-1"
@@ -9386,6 +9403,7 @@ exports.Menu = Menu;
9386
9403
  exports.MultiSelect = MultiSelect;
9387
9404
  exports.NativeSelect = NativeSelect;
9388
9405
  exports.Pagination = Pagination;
9406
+ exports.Paper = Paper;
9389
9407
  exports.Popover = Popover;
9390
9408
  exports.Progress = Progress;
9391
9409
  exports.Radio = Radio;
@@ -43,7 +43,7 @@ const getToken = (variant, color) => {
43
43
  const Inner = styled.span.withConfig({
44
44
  displayName: "Button__Inner",
45
45
  componentId: "sc-1hs0myn-0"
46
- })(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;height:100%;justify-content:center;"]);
46
+ })(["display:grid;grid-gap:0.5714em;grid-auto-flow:column;align-items:center;height:100%;justify-content:center;& >:is(svg,img){margin-top:-4px;margin-bottom:-4px;}"]);
47
47
  const ButtonBase = styled.button.withConfig({
48
48
  displayName: "Button__ButtonBase",
49
49
  componentId: "sc-1hs0myn-1"
@@ -9,7 +9,7 @@ const FullWidthCenterContent = styled.span.withConfig({
9
9
  const FullWidthInner = styled.span.withConfig({
10
10
  displayName: "InnerFullWidth__FullWidthInner",
11
11
  componentId: "sc-qeawkb-1"
12
- })(["height:100%;display:flex;align-items:center;> img:first-child,> svg:first-child{margin-right:8px;}> img:last-child,> svg:last-child{margin-left:8px;}> img:only-child,> svg:only-child{margin-left:auto;margin-right:auto;}> span:first-child{margin-left:32px;}> span:last-child{margin-right:32px;}> span:only-child{margin-right:0;margin-left:0;}"]);
12
+ })(["height:100%;display:flex;align-items:center;>:is(svg,img){margin-top:-4px;margin-bottom:-4px;}>:is(svg,img):first-child{margin-right:0.5714em;}>:is(svg,img):last-child{margin-left:0.5714em;}>:is(svg,img):only-child{margin-left:auto;margin-right:auto;}> span:first-child{margin-left:2.2857em;}> span:last-child{margin-right:2.2857em;}> span:only-child{margin-right:0;margin-left:0;}"]);
13
13
  const InnerFullWidth = /*#__PURE__*/forwardRef(function InnerFullWidth({
14
14
  children
15
15
  }, ref) {
@@ -47,20 +47,29 @@ const {
47
47
  } = tokens;
48
48
  const button = {
49
49
  background: 'transparent',
50
- height: buttonHeight,
50
+ // height: buttonHeight,
51
51
  typography: { ...buttonTypography,
52
- textAlign: 'center'
52
+ textAlign: 'center',
53
+ fontSize: '0.875rem' // 14px - 14/16
54
+
53
55
  },
54
56
  border: {
55
57
  type: 'border',
56
58
  width: '1px',
57
59
  color: 'transparent',
58
- radius: buttonBorderRadius,
60
+ //radius: buttonBorderRadius,
61
+ radius: '0.2857em',
62
+ // 4px - 4/14
59
63
  style: 'solid'
60
64
  },
61
65
  spacings: {
62
- left: medium,
63
- right: medium
66
+ top: 'calc(0.7142em - 1px)',
67
+ // calc(10px - 1px) - 10/14 (line-height er 1.143em = 16.002px)
68
+ bottom: 'calc(0.7142em - 1px)',
69
+ left: '1.1428em',
70
+ right: '1.1428em' // left: medium,
71
+ // right: medium,
72
+
64
73
  },
65
74
  clickbound: {
66
75
  height: clicboundHeight,
@@ -82,7 +91,9 @@ const button = {
82
91
  type: 'border',
83
92
  width: '1px',
84
93
  color: 'transparent',
85
- radius: buttonBorderRadius,
94
+ //radius: buttonBorderRadius,
95
+ radius: '0.2857em',
96
+ // 4px - 4/14
86
97
  style: 'solid'
87
98
  }
88
99
  },
@@ -111,7 +122,13 @@ const button = {
111
122
  },
112
123
  modes: {
113
124
  compact: {
114
- height: compactButtonHeight,
125
+ minHeight: '1.7142em',
126
+ // 24px
127
+ spacings: {
128
+ top: 'calc(0.2857em - 1px)',
129
+ // calc(4px - 1px) - 4/14
130
+ bottom: 'calc(0.2857em - 1px)'
131
+ },
115
132
  clickbound: {
116
133
  height: compactClickboundHeight,
117
134
  width: '100%',
package/dist/esm/index.js CHANGED
@@ -38,3 +38,4 @@ export { Checkbox } from './components/Checkbox/Checkbox.js';
38
38
  export { Radio } from './components/Radio/Radio.js';
39
39
  export { Switch } from './components/Switch/Switch.js';
40
40
  export { EdsProvider, useEds } from './components/EdsProvider/eds.context.js';
41
+ export { Paper } from './components/Paper/Paper.js';
@@ -32,3 +32,4 @@ export * from './components/Checkbox';
32
32
  export * from './components/Radio';
33
33
  export * from './components/Switch';
34
34
  export * from './components/EdsProvider';
35
+ export * from './components/Paper';
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@equinor/eds-core-react",
3
- "version": "0.17.0",
3
+ "version": "0.18.0-envis.1",
4
4
  "description": "The React implementation of the Equinor Design System",
5
5
  "sideEffects": [
6
6
  "**/*.css"
7
7
  ],
8
- "main": "dist/core-react.cjs.js",
8
+ "main": "dist/eds-core-react.cjs.js",
9
9
  "publishConfig": {
10
- "main": "dist/core-react.cjs.js",
10
+ "main": "dist/eds-core-react.cjs.js",
11
11
  "module": "dist/esm/index.js"
12
12
  },
13
13
  "types": "dist/types/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "https://github.com/equinor/design-system",
23
- "directory": "libraries/core-react"
23
+ "directory": "packages/eds-core-react"
24
24
  },
25
25
  "bugs": {
26
26
  "url": "https://github.com/equinor/design-system/issues"
@@ -64,8 +64,8 @@
64
64
  "jest": "^27.0.6",
65
65
  "jest-styled-components": "^7.0.5",
66
66
  "js-file-download": "^0.4.12",
67
- "ramda": "^0.27.1",
68
67
  "postcss": "^8.4.4",
68
+ "ramda": "^0.27.1",
69
69
  "react": "^17.0.2",
70
70
  "react-dom": "^17.0.2",
71
71
  "react-hook-form": "^7.11.1",
@@ -104,5 +104,5 @@
104
104
  "build:storybook": "build-storybook -o storybook-build"
105
105
  },
106
106
  "module": "dist/esm/index.js",
107
- "readme": "# @equinor/eds-core-react\n\nAvailable components to help style your React application as an Equinor application. We publish new components regularly so make sure to check back often!\n\nMake sure to check out our [Storybook](https://eds-storybook-react.azurewebsites.net/) for more examples!\nRead the [changelog](https://github.com/equinor/design-system/blob/develop/libraries/core-react/CHANGELOG.md) for details on specific releases.\n\n## Installation\n\n```sh\nnpm install @equinor/eds-core-react styled-components\n```\nIf you use Typescript, make sure you have typescript >= 3.8 as a devDependency:\n```sh\nnpm install typescript --save-dev\n```\n\n## Usage\n\n```jsx\nimport * as React from 'react'\nimport { render } from 'react-dom'\nimport { Button, Typography } from '@equinor/eds-core-react'\n\nconst App = () => (\n <>\n <Typography variant=\"h1\" bold>Buttons</Typography>\n\n <Typography variant=\"h2\">Contained (default)</Typography>\n\n <Button>Primary</Button>\n <Button color=\"secondary\">Secondary</Button>\n <Button color=\"danger\">Danger</Button>\n <Button disabled>Disabled</Button>\n\n <Typography variant=\"h2\">Outlined</Typography>\n\n <Button variant=\"outlined\">Primary</Button>\n <Button variant=\"outlined\" color=\"secondary\">Secondary</Button>\n <Button variant=\"outlined\" color=\"danger\">Danger</Button>\n <Button variant=\"outlined\" disabled>Disabled</Button>\n\n <Typography variant=\"h2\">Ghost</Typography>\n\n <Button variant=\"ghost\">Primary</Button>\n <Button variant=\"ghost\" color=\"secondary\">Secondary</Button>\n <Button variant=\"ghost\" color=\"danger\">Danger</Button>\n <Button variant=\"ghost\" disabled>Disabled</Button>\n </>\n)\n\nrender(<App />, document.getElementById('root'))\n```\n\n\n## Components\n\n### Available ✅\n\n- Accordion\n- Banner\n- Breadcrumbs\n- Button\n- Cards\n- Chips\n- Dialog\n- Divider\n- Icon\n- List\n- Menu\n- Pagination\n- Popover\n- Progress indicators\n- Scrim\n- Search\n- Select (Native Select)\n- Single Select\n- Multi Select\n- Selection Controls\n- Side Sheet\n- Slider\n- Snackbar\n- Table\n- Table of contents\n- Tabs\n- TextField\n- Tooltip\n- TopBar\n- Typography\n\n### In progress 👷‍♀️\n\n- Navigation Drawer\n\n### TODO 🛠️\n\n- App launcher\n- Stepper\n\n"
107
+ "readme": "# @equinor/eds-core-react\n\nAvailable components to help style your React application as an Equinor application. We publish new components regularly so make sure to check back often!\n\nMake sure to check out our [Storybook](https://eds-storybook-react.azurewebsites.net/) for more examples!\nRead the [changelog](https://github.com/equinor/design-system/blob/develop/packages/eds-core-react/CHANGELOG.md) for details on specific releases.\n\n## Installation\n\n```sh\nnpm install @equinor/eds-core-react styled-components\n```\nIf you use Typescript, make sure you have typescript >= 3.8 as a devDependency:\n```sh\nnpm install typescript --save-dev\n```\n\n## Usage\n\n```jsx\nimport * as React from 'react'\nimport { render } from 'react-dom'\nimport { Button, Typography } from '@equinor/eds-core-react'\n\nconst App = () => (\n <>\n <Typography variant=\"h1\" bold>Buttons</Typography>\n\n <Typography variant=\"h2\">Contained (default)</Typography>\n\n <Button>Primary</Button>\n <Button color=\"secondary\">Secondary</Button>\n <Button color=\"danger\">Danger</Button>\n <Button disabled>Disabled</Button>\n\n <Typography variant=\"h2\">Outlined</Typography>\n\n <Button variant=\"outlined\">Primary</Button>\n <Button variant=\"outlined\" color=\"secondary\">Secondary</Button>\n <Button variant=\"outlined\" color=\"danger\">Danger</Button>\n <Button variant=\"outlined\" disabled>Disabled</Button>\n\n <Typography variant=\"h2\">Ghost</Typography>\n\n <Button variant=\"ghost\">Primary</Button>\n <Button variant=\"ghost\" color=\"secondary\">Secondary</Button>\n <Button variant=\"ghost\" color=\"danger\">Danger</Button>\n <Button variant=\"ghost\" disabled>Disabled</Button>\n </>\n)\n\nrender(<App />, document.getElementById('root'))\n```\n\n\n## Components\n\n### Available ✅\n\n- Accordion\n- Banner\n- Breadcrumbs\n- Button\n- Cards\n- Chips\n- Dialog\n- Divider\n- Icon\n- List\n- Menu\n- Pagination\n- Popover\n- Progress indicators\n- Scrim\n- Search\n- Select (Native Select)\n- Single Select\n- Multi Select\n- Selection Controls\n- Side Sheet\n- Slider\n- Snackbar\n- Table\n- Table of contents\n- Tabs\n- TextField\n- Tooltip\n- TopBar\n- Typography\n\n### In progress 👷‍♀️\n\n- Navigation Drawer\n\n### TODO 🛠️\n\n- App launcher\n- Stepper\n\n"
108
108
  }
@@ -1,55 +0,0 @@
1
- import { SelectHTMLAttributes } from 'react';
2
- export declare type ComboboxChanges = {
3
- selectedItems: string[];
4
- inputValue: string;
5
- };
6
- export declare type ComboboxProps = {
7
- /** List of options to choose from */
8
- items: string[];
9
- /** Label for the select element */
10
- label: string;
11
- /** Array of initial selected items */
12
- initialSelectedItems?: string[];
13
- /** Meta text, for instance unit */
14
- meta?: string;
15
- /** Disabled state */
16
- disabled?: boolean;
17
- /** Read Only */
18
- readOnly?: boolean;
19
- /** If this prop is used, the select will become a controlled component. Use an empty
20
- * array [] if there will be no initial selected items
21
- * Note that this prop replaces the need for ```initialSelectedItems```
22
- * The items that should be selected. */
23
- selectedOptions?: string[];
24
- /** Callback for the selected item change
25
- * changes.selectedItem gives the selected item
26
- */
27
- handleSelectedItemsChange?: (changes: ComboboxChanges) => void;
28
- /** Enable multiselect */
29
- multiple?: boolean;
30
- } & SelectHTMLAttributes<HTMLSelectElement>;
31
- export declare const Combobox: import("react").ForwardRefExoticComponent<{
32
- /** List of options to choose from */
33
- items: string[];
34
- /** Label for the select element */
35
- label: string;
36
- /** Array of initial selected items */
37
- initialSelectedItems?: string[];
38
- /** Meta text, for instance unit */
39
- meta?: string;
40
- /** Disabled state */
41
- disabled?: boolean;
42
- /** Read Only */
43
- readOnly?: boolean;
44
- /** If this prop is used, the select will become a controlled component. Use an empty
45
- * array [] if there will be no initial selected items
46
- * Note that this prop replaces the need for ```initialSelectedItems```
47
- * The items that should be selected. */
48
- selectedOptions?: string[];
49
- /** Callback for the selected item change
50
- * changes.selectedItem gives the selected item
51
- */
52
- handleSelectedItemsChange?: (changes: ComboboxChanges) => void;
53
- /** Enable multiselect */
54
- multiple?: boolean;
55
- } & SelectHTMLAttributes<HTMLSelectElement> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,3 +0,0 @@
1
- import type { ComponentToken } from '@equinor/eds-tokens';
2
- export declare const selectTokens: ComponentToken;
3
- export declare const multiSelect: ComponentToken;
@@ -1 +0,0 @@
1
- export * from './Combobox';