@equinor/eds-core-react 0.19.0 → 0.20.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 +18 -19
- package/dist/eds-core-react.cjs.js +1005 -347
- package/dist/esm/components/Accordion/Accordion.js +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +481 -0
- package/dist/esm/components/Autocomplete/Autocomplete.tokens.js +103 -0
- package/dist/esm/components/Autocomplete/Option.js +52 -0
- package/dist/esm/components/Banner/Banner.js +2 -2
- package/dist/esm/components/Banner/BannerMessage.js +1 -1
- package/dist/esm/components/Breadcrumbs/Breadcrumb.js +2 -2
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/esm/components/Button/Button.js +2 -2
- package/dist/esm/components/Button/InnerFullWidth.js +1 -1
- package/dist/esm/components/Button/tokens/contained.js +1 -1
- package/dist/esm/components/Button/tokens/ghost.js +1 -1
- package/dist/esm/components/Button/tokens/icon.js +1 -1
- package/dist/esm/components/Button/tokens/outlined.js +1 -1
- package/dist/esm/components/Card/Card.js +1 -1
- package/dist/esm/components/Card/CardActions.js +2 -2
- package/dist/esm/components/Card/CardHeader.js +1 -1
- package/dist/esm/components/Checkbox/Input.js +1 -1
- package/dist/esm/components/Dialog/Dialog.js +2 -2
- package/dist/esm/components/Dialog/DialogContent.js +1 -1
- package/dist/esm/components/Dialog/DialogHeader.js +1 -1
- package/dist/esm/components/Input/Input.js +1 -1
- package/dist/esm/components/Input/Input.tokens.js +1 -1
- package/dist/esm/components/Menu/Menu.context.js +1 -1
- package/dist/esm/components/Menu/Menu.js +2 -2
- package/dist/esm/components/Menu/MenuItem.js +3 -3
- package/dist/esm/components/Menu/MenuSection.js +1 -1
- package/dist/esm/components/Pagination/Pagination.js +2 -2
- package/dist/esm/components/Pagination/PaginationItem.js +1 -1
- package/dist/esm/components/Popover/Popover.js +4 -5
- package/dist/esm/components/Popover/PopoverHeader.js +1 -1
- package/dist/esm/components/Progress/Circular/CircularProgress.js +55 -28
- package/dist/esm/components/Progress/Linear/LinearProgress.js +34 -7
- package/dist/esm/components/Radio/Radio.js +1 -1
- package/dist/esm/components/Search/Search.js +4 -4
- package/dist/esm/components/Select/MultiSelect/MultiSelect.js +6 -3
- package/dist/esm/components/Select/NativeSelect/NativeSelect.js +2 -2
- package/dist/esm/components/Select/Select.tokens.js +1 -1
- package/dist/esm/components/Select/SingleSelect/SingleSelect.js +4 -2
- package/dist/esm/components/Select/commonStyles.js +2 -2
- package/dist/esm/components/SideSheet/SideSheet.js +2 -3
- package/dist/esm/components/Slider/Slider.js +34 -9
- package/dist/esm/components/Snackbar/Snackbar.js +1 -1
- package/dist/esm/components/Switch/Switch.js +1 -1
- package/dist/esm/components/Table/Cell.js +2 -2
- package/dist/esm/components/Table/DataCell/DataCell.js +2 -2
- package/dist/esm/components/Table/DataCell/DataCell.tokens.js +1 -1
- package/dist/esm/components/Table/HeaderCell/HeaderCell.js +2 -2
- package/dist/esm/components/Table/index.js +1 -1
- package/dist/esm/components/TableOfContents/TableOfContents.js +2 -2
- package/dist/esm/components/Tabs/TabList.js +1 -1
- package/dist/esm/components/Tabs/Tabs.js +3 -3
- package/dist/esm/components/TextField/Field.js +3 -3
- package/dist/esm/components/TextField/HelperText/HelperText.js +1 -1
- package/dist/esm/components/TextField/TextField.js +3 -3
- package/dist/esm/components/Textarea/Textarea.js +2 -2
- package/dist/esm/components/TopBar/TopBar.js +1 -1
- package/dist/esm/index.js +16 -15
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.2/node_modules/ramda/src → ramda@0.28.0/node_modules/ramda/es}/internal/_curry1.js +2 -5
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.2/node_modules/ramda/src → ramda@0.28.0/node_modules/ramda/es}/internal/_curry2.js +3 -7
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.2/node_modules/ramda/src → ramda@0.28.0/node_modules/ramda/es}/internal/_curry3.js +4 -9
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.2/node_modules/ramda/src → ramda@0.28.0/node_modules/ramda/es}/internal/_has.js +1 -3
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.2/node_modules/ramda/src → ramda@0.28.0/node_modules/ramda/es}/internal/_isObject.js +1 -3
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.2/node_modules/ramda/src → ramda@0.28.0/node_modules/ramda/es}/internal/_isPlaceholder.js +1 -3
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.2/node_modules/ramda/src → ramda@0.28.0/node_modules/ramda/es}/mergeDeepRight.js +3 -8
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.2/node_modules/ramda/src → ramda@0.28.0/node_modules/ramda/es}/mergeDeepWithKey.js +4 -9
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.2/node_modules/ramda/src → ramda@0.28.0/node_modules/ramda/es}/mergeWithKey.js +3 -7
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +82 -0
- package/dist/types/components/Autocomplete/Autocomplete.tokens.d.ts +3 -0
- package/dist/types/components/Autocomplete/Option.d.ts +15 -0
- package/dist/types/components/Autocomplete/index.d.ts +1 -0
- package/dist/types/components/Menu/MenuItem.d.ts +2 -2
- package/dist/types/components/Select/MultiSelect/MultiSelect.d.ts +1 -0
- package/dist/types/components/Select/SingleSelect/SingleSelect.d.ts +1 -0
- package/dist/types/components/Slider/Slider.d.ts +15 -9
- package/dist/types/components/Slider/SliderInput.d.ts +0 -6
- package/dist/types/index.d.ts +1 -0
- package/package.json +47 -42
|
@@ -2,11 +2,11 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { clear } from '@equinor/eds-icons';
|
|
4
4
|
import { bordersTemplate, spacingsTemplate } from '@equinor/eds-utils';
|
|
5
|
+
import { Typography } from '../Typography/Typography.js';
|
|
6
|
+
import { Button } from '../Button/Button.js';
|
|
5
7
|
import { Icon } from '../Icon/index.js';
|
|
6
8
|
import { comfortable, variants } from './SideSheet.tokens.js';
|
|
7
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
-
import { Button } from '../Button/Button.js';
|
|
9
|
-
import { Typography } from '../Typography/Typography.js';
|
|
10
10
|
|
|
11
11
|
const {
|
|
12
12
|
background,
|
|
@@ -41,7 +41,6 @@ const SideSheet = /*#__PURE__*/forwardRef(function SideSheet(_ref2, ref) {
|
|
|
41
41
|
}; // Controller must set open={false} when pressing the close button
|
|
42
42
|
|
|
43
43
|
return open && /*#__PURE__*/jsxs(StyledSideSheet, { ...props,
|
|
44
|
-
id: "side-sheet",
|
|
45
44
|
children: [/*#__PURE__*/jsxs(Header, {
|
|
46
45
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
47
46
|
variant: "h2",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { forwardRef, useState, useEffect, useRef } from 'react';
|
|
1
|
+
import { forwardRef, useState, useEffect, useRef, useCallback } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { slider } from './Slider.tokens.js';
|
|
4
4
|
import { MinMax } from './MinMax.js';
|
|
5
5
|
import { Output } from './Output.js';
|
|
6
6
|
import { SliderInput } from './SliderInput.js';
|
|
7
|
-
import { bordersTemplate } from '@equinor/eds-utils';
|
|
7
|
+
import { bordersTemplate, useId } from '@equinor/eds-utils';
|
|
8
8
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
const {
|
|
@@ -98,6 +98,7 @@ const Slider = /*#__PURE__*/forwardRef(function Slider(_ref10, ref) {
|
|
|
98
98
|
step = 1,
|
|
99
99
|
disabled,
|
|
100
100
|
ariaLabelledby,
|
|
101
|
+
'aria-labelledby': ariaLabelledbyNative,
|
|
101
102
|
...rest
|
|
102
103
|
} = _ref10;
|
|
103
104
|
const isRangeSlider = Array.isArray(value);
|
|
@@ -121,8 +122,7 @@ const Slider = /*#__PURE__*/forwardRef(function Slider(_ref10, ref) {
|
|
|
121
122
|
const maxRange = useRef(null);
|
|
122
123
|
|
|
123
124
|
const onValueChange = (event, valueArrIdx) => {
|
|
124
|
-
const
|
|
125
|
-
const changedValue = parseFloat(target.value);
|
|
125
|
+
const changedValue = parseFloat(event.target.value);
|
|
126
126
|
|
|
127
127
|
if (isRangeSlider) {
|
|
128
128
|
const newValue = sliderValue.slice();
|
|
@@ -187,14 +187,27 @@ const Slider = /*#__PURE__*/forwardRef(function Slider(_ref10, ref) {
|
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
let inputIdA = useId(null, 'inputA');
|
|
191
|
+
let inputIdB = useId(null, 'inputB');
|
|
192
|
+
let inputId = useId(null, 'thumb');
|
|
193
|
+
|
|
194
|
+
if (rest['id']) {
|
|
195
|
+
const overrideId = rest['id'];
|
|
196
|
+
inputIdA = "".concat(overrideId, "-thumb-a");
|
|
197
|
+
inputIdB = "".concat(overrideId, "-thumb-b");
|
|
198
|
+
inputId = "".concat(overrideId, "-thumb");
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const getAriaLabelledby = useCallback(() => {
|
|
202
|
+
if (ariaLabelledbyNative) return ariaLabelledbyNative;
|
|
203
|
+
if (ariaLabelledby) return ariaLabelledby;
|
|
204
|
+
return null;
|
|
205
|
+
}, [ariaLabelledbyNative, ariaLabelledby]);
|
|
193
206
|
return /*#__PURE__*/jsx(Fragment, {
|
|
194
207
|
children: isRangeSlider ? /*#__PURE__*/jsxs(RangeWrapper, { ...rest,
|
|
195
208
|
ref: ref,
|
|
196
209
|
role: "group",
|
|
197
|
-
"aria-labelledby":
|
|
210
|
+
"aria-labelledby": getAriaLabelledby(),
|
|
198
211
|
valA: sliderValue[0],
|
|
199
212
|
valB: sliderValue[1],
|
|
200
213
|
max: max,
|
|
@@ -210,6 +223,10 @@ const Slider = /*#__PURE__*/forwardRef(function Slider(_ref10, ref) {
|
|
|
210
223
|
value: sliderValue[0],
|
|
211
224
|
max: max,
|
|
212
225
|
min: min,
|
|
226
|
+
"aria-valuemax": max,
|
|
227
|
+
"aria-valuemin": min,
|
|
228
|
+
"aria-valuenow": sliderValue[0],
|
|
229
|
+
"aria-valuetext": getFormattedText(sliderValue[0]).toString(),
|
|
213
230
|
id: inputIdA,
|
|
214
231
|
step: step,
|
|
215
232
|
onChange: event => {
|
|
@@ -232,6 +249,10 @@ const Slider = /*#__PURE__*/forwardRef(function Slider(_ref10, ref) {
|
|
|
232
249
|
value: sliderValue[1],
|
|
233
250
|
min: min,
|
|
234
251
|
max: max,
|
|
252
|
+
"aria-valuemax": max,
|
|
253
|
+
"aria-valuemin": min,
|
|
254
|
+
"aria-valuenow": sliderValue[1],
|
|
255
|
+
"aria-valuetext": getFormattedText(sliderValue[1]).toString(),
|
|
235
256
|
id: inputIdB,
|
|
236
257
|
step: step,
|
|
237
258
|
ref: maxRange,
|
|
@@ -259,13 +280,17 @@ const Slider = /*#__PURE__*/forwardRef(function Slider(_ref10, ref) {
|
|
|
259
280
|
value: sliderValue[0],
|
|
260
281
|
min: min,
|
|
261
282
|
max: max,
|
|
283
|
+
"aria-valuemax": max,
|
|
284
|
+
"aria-valuemin": min,
|
|
285
|
+
"aria-valuenow": sliderValue[0],
|
|
286
|
+
"aria-valuetext": getFormattedText(sliderValue[0]).toString(),
|
|
262
287
|
step: step,
|
|
263
288
|
id: inputId,
|
|
264
289
|
onChange: event => {
|
|
265
290
|
onValueChange(event);
|
|
266
291
|
},
|
|
267
292
|
disabled: disabled,
|
|
268
|
-
"aria-labelledby":
|
|
293
|
+
"aria-labelledby": getAriaLabelledby(),
|
|
269
294
|
onMouseUp: event => handleCommitedValue(event),
|
|
270
295
|
onKeyUp: event => handleKeyUp(event)
|
|
271
296
|
}), /*#__PURE__*/jsx(Output, {
|
|
@@ -3,9 +3,9 @@ import * as ReactDom from 'react-dom';
|
|
|
3
3
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
4
4
|
import { snackbar } from './Snackbar.tokens.js';
|
|
5
5
|
import { spacingsTemplate, bordersTemplate, typographyTemplate, useToken } from '@equinor/eds-utils';
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
7
6
|
import { Paper } from '../Paper/Paper.js';
|
|
8
7
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
const StyledSnackbar = styled(Paper).withConfig({
|
|
11
11
|
displayName: "Snackbar__StyledSnackbar",
|
|
@@ -4,8 +4,8 @@ import { SwitchSmall } from './SwitchSmall.js';
|
|
|
4
4
|
import { SwitchDefault } from './SwitchDefault.js';
|
|
5
5
|
import { comfortable } from './Switch.tokens.js';
|
|
6
6
|
import { typographyTemplate, useToken } from '@equinor/eds-utils';
|
|
7
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
7
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
const StyledLabel = styled.label.withConfig({
|
|
11
11
|
displayName: "Switch__StyledLabel",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import { InnerContext } from './Inner.context.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { TableDataCell } from './DataCell/DataCell.js';
|
|
5
3
|
import { TableHeaderCell } from './HeaderCell/HeaderCell.js';
|
|
4
|
+
import { InnerContext } from './Inner.context.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
const Cell = /*#__PURE__*/forwardRef(function Cell(_ref, ref) {
|
|
8
8
|
let { ...rest
|
|
@@ -2,8 +2,8 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
3
|
import { spacingsTemplate, typographyTemplate, bordersTemplate, useToken } from '@equinor/eds-utils';
|
|
4
4
|
import { applyVariant, tableCell } from './DataCell.tokens.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
5
|
import { useEds } from '../../EdsProvider/eds.context.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
const StyledTableCell = styled.td.withConfig({
|
|
9
9
|
displayName: "DataCell__StyledTableCell",
|
|
@@ -23,7 +23,7 @@ const StyledTableCell = styled.td.withConfig({
|
|
|
23
23
|
align
|
|
24
24
|
} = theme;
|
|
25
25
|
const backgroundColor = color === 'error' ? (_theme$validation$err = theme.validation.error) === null || _theme$validation$err === void 0 ? void 0 : _theme$validation$err.background : '';
|
|
26
|
-
const base = css(["min-height:", ";height:", ";background:", ";vertical-align:", ";", " ", " ", ""], height, height, backgroundColor, align.vertical, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(border));
|
|
26
|
+
const base = css(["min-height:", ";height:", ";background:", ";vertical-align:", ";box-sizing:border-box;", " ", " ", ""], height, height, backgroundColor, align.vertical, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(border));
|
|
27
27
|
return base;
|
|
28
28
|
});
|
|
29
29
|
const TableDataCell = /*#__PURE__*/forwardRef(function TableDataCell(_ref2, ref) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tokens } from '@equinor/eds-tokens';
|
|
2
|
-
import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.
|
|
2
|
+
import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.28.0/node_modules/ramda/es/mergeDeepRight.js';
|
|
3
3
|
|
|
4
4
|
const {
|
|
5
5
|
typography: {
|
|
@@ -2,8 +2,8 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
3
|
import { spacingsTemplate, typographyTemplate, bordersTemplate, useToken } from '@equinor/eds-utils';
|
|
4
4
|
import { token } from './HeaderCell.tokens.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
5
|
import { useEds } from '../../EdsProvider/eds.context.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
const StyledTableCell = styled.th.withConfig({
|
|
9
9
|
displayName: "HeaderCell__StyledTableCell",
|
|
@@ -32,7 +32,7 @@ const StyledTableCell = styled.th.withConfig({
|
|
|
32
32
|
sortStylingActive = css(["", ";background:", ";color:", ";"], activeToken.border.type === 'bordergroup' ? css(["border-color:", ";"], activeToken.border.bottom.color) : '', activeToken.background, activeToken.typography.color);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
return css(["min-height:", ";height:", ";background:", ";", " ", " ", " ", " ", " ", ""], height, height, background, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(theme.border), sortStylingHover, sortStylingActive, sticky ? css(["position:sticky;top:0;z-index:1;"]) : '');
|
|
35
|
+
return css(["min-height:", ";height:", ";background:", ";box-sizing:border-box;", " ", " ", " ", " ", " ", ""], height, height, background, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(theme.border), sortStylingHover, sortStylingActive, sticky ? css(["position:sticky;top:0;z-index:1;"]) : '');
|
|
36
36
|
});
|
|
37
37
|
const CellInner = styled.div.withConfig({
|
|
38
38
|
displayName: "HeaderCell__CellInner",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Table as Table$1 } from './Table.js';
|
|
2
2
|
import { Body } from './Body.js';
|
|
3
3
|
import { Cell } from './Cell.js';
|
|
4
|
-
import { Caption } from './Caption.js';
|
|
5
4
|
import { Head } from './Head/Head.js';
|
|
6
5
|
import { Row } from './Row/Row.js';
|
|
6
|
+
import { Caption } from './Caption.js';
|
|
7
7
|
|
|
8
8
|
const Table = Table$1;
|
|
9
9
|
Table.Body = Body;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
3
|
import { List } from '../List/index.js';
|
|
4
|
+
import { Typography } from '../Typography/Typography.js';
|
|
4
5
|
import { typographyTemplate, useToken } from '@equinor/eds-utils';
|
|
5
6
|
import { tableOfContents } from './TableOfContents.tokens.js';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
-
import { Typography } from '../Typography/Typography.js';
|
|
8
7
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
const StyledTableOfContents = styled.nav.withConfig({
|
|
11
11
|
displayName: "TableOfContents__StyledTableOfContents",
|
|
@@ -13,7 +13,7 @@ const StyledTabList = styled.div.attrs(() => ({
|
|
|
13
13
|
})).withConfig({
|
|
14
14
|
displayName: "TabList__StyledTabList",
|
|
15
15
|
componentId: "sc-1g1p5i1-0"
|
|
16
|
-
})(["display:grid;grid-auto-flow:column;grid-auto-columns:", ";overflow-x:", ";scroll-snap-type:x mandatory;overscroll-behavior-x:contain;@media (prefers-reduced-motion:no-preference){scroll-behavior:smooth;}@media (hover:none){overflow-x:scroll;-webkit-overflow-scrolling:touch;scrollbar-width:0
|
|
16
|
+
})(["display:grid;grid-auto-flow:column;grid-auto-columns:", ";overflow-x:", ";scroll-snap-type:x mandatory;overscroll-behavior-x:contain;@media (prefers-reduced-motion:no-preference){scroll-behavior:smooth;}@media (hover:none){overflow-x:scroll;-webkit-overflow-scrolling:touch;scrollbar-width:0;& ::-webkit-scrollbar{width:0;height:0;}}"], _ref => {
|
|
17
17
|
let {
|
|
18
18
|
variant
|
|
19
19
|
} = _ref;
|
|
@@ -3,17 +3,17 @@ import { TabsProvider } from './Tabs.context.js';
|
|
|
3
3
|
import { token } from './Tabs.tokens.js';
|
|
4
4
|
import { useId, useCombinedRefs, useToken } from '@equinor/eds-utils';
|
|
5
5
|
import { ThemeProvider } from 'styled-components';
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
7
6
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
const Tabs = /*#__PURE__*/forwardRef(function Tabs(_ref, ref) {
|
|
10
10
|
let {
|
|
11
11
|
activeTab = 0,
|
|
12
|
-
onChange,
|
|
12
|
+
onChange = () => null,
|
|
13
13
|
onBlur,
|
|
14
14
|
onFocus,
|
|
15
15
|
variant = 'minWidth',
|
|
16
|
-
scrollable,
|
|
16
|
+
scrollable = false,
|
|
17
17
|
id,
|
|
18
18
|
...props
|
|
19
19
|
} = _ref;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import { useTextField } from './TextField.context.js';
|
|
3
|
+
import { Input } from '../Input/Input.js';
|
|
4
|
+
import { Icon as InputIcon } from './Icon/Icon.js';
|
|
3
5
|
import styled, { css } from 'styled-components';
|
|
4
6
|
import { typographyTemplate, outlineTemplate } from '@equinor/eds-utils';
|
|
5
7
|
import * as TextField_tokens from './TextField.tokens.js';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
import { Input } from '../Input/Input.js';
|
|
8
8
|
import { Textarea } from '../Textarea/Textarea.js';
|
|
9
|
-
import { Icon as InputIcon } from './Icon/Icon.js';
|
|
10
9
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
10
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
12
|
const {
|
|
13
13
|
textfield
|
|
@@ -3,8 +3,8 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
import { typographyTemplate } from '@equinor/eds-utils';
|
|
4
4
|
import { helperText } from './HelperText.token.js';
|
|
5
5
|
import { useTextField } from '../TextField.context.js';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
6
|
import { Icon as InputIcon } from '../Icon/Icon.js';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
const Variation = _ref => {
|
|
10
10
|
let {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { ThemeProvider } from 'styled-components';
|
|
3
3
|
import { Field } from './Field.js';
|
|
4
|
+
import { Label } from '../Label/Label.js';
|
|
5
|
+
import { HelperText as TextfieldHelperText } from './HelperText/HelperText.js';
|
|
4
6
|
import { TextFieldProvider } from './TextField.context.js';
|
|
5
7
|
import { textfield } from './TextField.tokens.js';
|
|
6
8
|
import { useId, useToken } from '@equinor/eds-utils';
|
|
7
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
-
import { Label } from '../Label/Label.js';
|
|
9
|
-
import { HelperText as TextfieldHelperText } from './HelperText/HelperText.js';
|
|
10
9
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
12
|
const Container = styled.div.withConfig({
|
|
13
13
|
displayName: "TextField__Container",
|
|
@@ -2,9 +2,9 @@ import { forwardRef, useState } from 'react';
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import * as Input_tokens from '../Input/Input.tokens.js';
|
|
4
4
|
import { input as input$1 } from '../Input/Input.tokens.js';
|
|
5
|
-
import { typographyTemplate,
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { typographyTemplate, spacingsTemplate, outlineTemplate, useAutoResize, useCombinedRefs } from '@equinor/eds-utils';
|
|
7
6
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
const {
|
|
10
10
|
input
|
|
@@ -2,8 +2,8 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
3
|
import { bordersTemplate, spacingsTemplate, typographyTemplate, useToken } from '@equinor/eds-utils';
|
|
4
4
|
import { topbar } from './TopBar.tokens.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
5
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
const StyledTopBar = styled.header.withConfig({
|
|
9
9
|
displayName: "TopBar__StyledTopBar",
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export { Button } from './components/Button/Button.js';
|
|
2
|
+
export { Typography } from './components/Typography/Typography.js';
|
|
1
3
|
export { Table } from './components/Table/index.js';
|
|
4
|
+
export { Divider } from './components/Divider/Divider.js';
|
|
5
|
+
export { TextField } from './components/TextField/TextField.js';
|
|
2
6
|
export { Icon } from './components/Icon/index.js';
|
|
3
7
|
export { List } from './components/List/index.js';
|
|
4
8
|
export { Accordion } from './components/Accordion/index.js';
|
|
@@ -6,28 +10,20 @@ export { Tabs } from './components/Tabs/index.js';
|
|
|
6
10
|
export { Card } from './components/Card/index.js';
|
|
7
11
|
export { TopBar } from './components/TopBar/index.js';
|
|
8
12
|
export { Dialog } from './components/Dialog/index.js';
|
|
9
|
-
export { TableOfContents } from './components/TableOfContents/index.js';
|
|
10
|
-
export { Snackbar } from './components/Snackbar/index.js';
|
|
11
|
-
export { Popover } from './components/Popover/index.js';
|
|
12
|
-
export { Banner } from './components/Banner/index.js';
|
|
13
|
-
export { Progress } from './components/Progress/index.js';
|
|
14
|
-
export { Breadcrumbs } from './components/Breadcrumbs/index.js';
|
|
15
|
-
export { Menu } from './components/Menu/index.js';
|
|
16
|
-
export { Button } from './components/Button/Button.js';
|
|
17
|
-
export { Typography } from './components/Typography/Typography.js';
|
|
18
|
-
export { Divider } from './components/Divider/Divider.js';
|
|
19
|
-
export { TextField } from './components/TextField/TextField.js';
|
|
20
13
|
export { Scrim } from './components/Scrim/Scrim.js';
|
|
14
|
+
export { TableOfContents } from './components/TableOfContents/index.js';
|
|
21
15
|
export { SideSheet } from './components/SideSheet/SideSheet.js';
|
|
22
16
|
export { Chip } from './components/Chip/Chip.js';
|
|
23
17
|
export { Avatar } from './components/Avatar/Avatar.js';
|
|
24
18
|
export { Search } from './components/Search/Search.js';
|
|
25
19
|
export { Slider } from './components/Slider/Slider.js';
|
|
26
20
|
export { Tooltip } from './components/Tooltip/Tooltip.js';
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
21
|
+
export { Snackbar } from './components/Snackbar/index.js';
|
|
22
|
+
export { Popover } from './components/Popover/index.js';
|
|
23
|
+
export { Banner } from './components/Banner/index.js';
|
|
24
|
+
export { Progress } from './components/Progress/index.js';
|
|
25
|
+
export { Breadcrumbs } from './components/Breadcrumbs/index.js';
|
|
26
|
+
export { Menu } from './components/Menu/index.js';
|
|
31
27
|
export { Pagination } from './components/Pagination/Pagination.js';
|
|
32
28
|
export { NativeSelect } from './components/Select/NativeSelect/NativeSelect.js';
|
|
33
29
|
export { SingleSelect } from './components/Select/SingleSelect/SingleSelect.js';
|
|
@@ -39,3 +35,8 @@ export { Radio } from './components/Radio/Radio.js';
|
|
|
39
35
|
export { Switch } from './components/Switch/Switch.js';
|
|
40
36
|
export { EdsProvider, useEds } from './components/EdsProvider/eds.context.js';
|
|
41
37
|
export { Paper } from './components/Paper/Paper.js';
|
|
38
|
+
export { Autocomplete } from './components/Autocomplete/Autocomplete.js';
|
|
39
|
+
export { LinearProgress } from './components/Progress/Linear/LinearProgress.js';
|
|
40
|
+
export { CircularProgress } from './components/Progress/Circular/CircularProgress.js';
|
|
41
|
+
export { StarProgress } from './components/Progress/Star/StarProgress.js';
|
|
42
|
+
export { DotProgress } from './components/Progress/Dots/DotProgress.js';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _isPlaceholder from './_isPlaceholder.js';
|
|
2
2
|
|
|
3
|
-
var _isPlaceholder = _isPlaceholder_1;
|
|
4
3
|
/**
|
|
5
4
|
* Optimized internal one-arity curry function.
|
|
6
5
|
*
|
|
@@ -20,6 +19,4 @@ function _curry1(fn) {
|
|
|
20
19
|
};
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export { _curry1_1 as default };
|
|
22
|
+
export { _curry1 as default };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _curry1 from './_curry1.js';
|
|
2
|
+
import _isPlaceholder from './_isPlaceholder.js';
|
|
3
3
|
|
|
4
|
-
var _curry1 = _curry1_1;
|
|
5
|
-
var _isPlaceholder = _isPlaceholder_1;
|
|
6
4
|
/**
|
|
7
5
|
* Optimized internal two-arity curry function.
|
|
8
6
|
*
|
|
@@ -33,6 +31,4 @@ function _curry2(fn) {
|
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export { _curry2_1 as default };
|
|
34
|
+
export { _curry2 as default };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import _curry1 from './_curry1.js';
|
|
2
|
+
import _curry2 from './_curry2.js';
|
|
3
|
+
import _isPlaceholder from './_isPlaceholder.js';
|
|
4
4
|
|
|
5
|
-
var _curry1 = _curry1_1;
|
|
6
|
-
var _curry2 = _curry2_1;
|
|
7
|
-
var _isPlaceholder = _isPlaceholder_1;
|
|
8
5
|
/**
|
|
9
6
|
* Optimized internal three-arity curry function.
|
|
10
7
|
*
|
|
@@ -52,6 +49,4 @@ function _curry3(fn) {
|
|
|
52
49
|
};
|
|
53
50
|
}
|
|
54
51
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
export { _curry3_1 as default };
|
|
52
|
+
export { _curry3 as default };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _curry2 from './internal/_curry2.js';
|
|
2
|
+
import mergeDeepWithKey from './mergeDeepWithKey.js';
|
|
3
3
|
|
|
4
|
-
var _curry2 = _curry2_1;
|
|
5
|
-
var mergeDeepWithKey = mergeDeepWithKey_1;
|
|
6
4
|
/**
|
|
7
5
|
* Creates a new object with the own properties of the first object merged with
|
|
8
6
|
* the own properties of the second object. If a key exists in both objects:
|
|
@@ -31,7 +29,4 @@ var mergeDeepRight = /*#__PURE__*/_curry2(function mergeDeepRight(lObj, rObj) {
|
|
|
31
29
|
}, lObj, rObj);
|
|
32
30
|
});
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
var mergeDeepRight$1 = mergeDeepRight_1;
|
|
36
|
-
|
|
37
|
-
export { mergeDeepRight$1 as default };
|
|
32
|
+
export { mergeDeepRight as default };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import _curry3 from './internal/_curry3.js';
|
|
2
|
+
import _isObject from './internal/_isObject.js';
|
|
3
|
+
import mergeWithKey from './mergeWithKey.js';
|
|
4
4
|
|
|
5
|
-
var _curry3 = _curry3_1;
|
|
6
|
-
var _isObject = _isObject_1;
|
|
7
|
-
var mergeWithKey = mergeWithKey_1;
|
|
8
5
|
/**
|
|
9
6
|
* Creates a new object with the own properties of the two provided objects.
|
|
10
7
|
* If a key exists in both objects:
|
|
@@ -44,6 +41,4 @@ var mergeDeepWithKey = /*#__PURE__*/_curry3(function mergeDeepWithKey(fn, lObj,
|
|
|
44
41
|
}, lObj, rObj);
|
|
45
42
|
});
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export { mergeDeepWithKey_1 as default };
|
|
44
|
+
export { mergeDeepWithKey as default };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import _curry3 from './internal/_curry3.js';
|
|
2
|
+
import _has from './internal/_has.js';
|
|
3
3
|
|
|
4
|
-
var _curry3 = _curry3_1;
|
|
5
|
-
var _has = _has_1;
|
|
6
4
|
/**
|
|
7
5
|
* Creates a new object with the own properties of the two provided objects. If
|
|
8
6
|
* a key exists in both objects, the provided function is applied to the key
|
|
@@ -48,6 +46,4 @@ var mergeWithKey = /*#__PURE__*/_curry3(function mergeWithKey(fn, l, r) {
|
|
|
48
46
|
return result;
|
|
49
47
|
});
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export { mergeWithKey_1 as default };
|
|
49
|
+
export { mergeWithKey as default };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { UseMultipleSelectionProps } from 'downshift';
|
|
3
|
+
export declare type AutocompleteChanges<T> = UseMultipleSelectionProps<T>;
|
|
4
|
+
export declare type AutocompleteProps<T> = {
|
|
5
|
+
/** List of options to choose from */
|
|
6
|
+
options: T[];
|
|
7
|
+
/** Label for the select element */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Array of initial selected items */
|
|
10
|
+
initialSelectedOptions?: T[];
|
|
11
|
+
/** Meta text, for instance unit */
|
|
12
|
+
meta?: string;
|
|
13
|
+
/** Disabled state */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Read Only */
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
/** If this prop is used, the select will become a controlled component. Use an empty
|
|
18
|
+
* array [] if there will be no initial selected items
|
|
19
|
+
* Note that this prop replaces the need for ```initialSelectedItems```
|
|
20
|
+
* The items that should be selected. */
|
|
21
|
+
selectedOptions?: T[];
|
|
22
|
+
/** Callback for the selected item change
|
|
23
|
+
* changes.selectedItems gives the selected items
|
|
24
|
+
*/
|
|
25
|
+
onOptionsChange?: (changes: AutocompleteChanges<T>) => void;
|
|
26
|
+
/** Enable multiselect */
|
|
27
|
+
multiple?: boolean;
|
|
28
|
+
/** Custom option label */
|
|
29
|
+
optionLabel?: (option: T) => string;
|
|
30
|
+
/** Disable use of react portal for dropdown */
|
|
31
|
+
disablePortal?: boolean;
|
|
32
|
+
/** Disable option */
|
|
33
|
+
optionDisabled?: (option: T) => boolean;
|
|
34
|
+
/** Filter function for options */
|
|
35
|
+
optionsFilter?: (option: T, inputValue: string) => boolean;
|
|
36
|
+
/** If `true` the width of the dropdown will adjust accordingly to width of the input */
|
|
37
|
+
autoWidth?: boolean;
|
|
38
|
+
/** Descriptive text for whats selected or about to be selected */
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
41
|
+
declare function AutocompleteInner<T>(props: AutocompleteProps<T>, ref: React.ForwardedRef<HTMLDivElement>): JSX.Element;
|
|
42
|
+
export declare const Autocomplete: <T>(props: {
|
|
43
|
+
/** List of options to choose from */
|
|
44
|
+
options: T[];
|
|
45
|
+
/** Label for the select element */
|
|
46
|
+
label: string;
|
|
47
|
+
/** Array of initial selected items */
|
|
48
|
+
initialSelectedOptions?: T[];
|
|
49
|
+
/** Meta text, for instance unit */
|
|
50
|
+
meta?: string;
|
|
51
|
+
/** Disabled state */
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
/** Read Only */
|
|
54
|
+
readOnly?: boolean;
|
|
55
|
+
/** If this prop is used, the select will become a controlled component. Use an empty
|
|
56
|
+
* array [] if there will be no initial selected items
|
|
57
|
+
* Note that this prop replaces the need for ```initialSelectedItems```
|
|
58
|
+
* The items that should be selected. */
|
|
59
|
+
selectedOptions?: T[];
|
|
60
|
+
/** Callback for the selected item change
|
|
61
|
+
* changes.selectedItems gives the selected items
|
|
62
|
+
*/
|
|
63
|
+
onOptionsChange?: (changes: AutocompleteChanges<T>) => void;
|
|
64
|
+
/** Enable multiselect */
|
|
65
|
+
multiple?: boolean;
|
|
66
|
+
/** Custom option label */
|
|
67
|
+
optionLabel?: (option: T) => string;
|
|
68
|
+
/** Disable use of react portal for dropdown */
|
|
69
|
+
disablePortal?: boolean;
|
|
70
|
+
/** Disable option */
|
|
71
|
+
optionDisabled?: (option: T) => boolean;
|
|
72
|
+
/** Filter function for options */
|
|
73
|
+
optionsFilter?: (option: T, inputValue: string) => boolean;
|
|
74
|
+
/** If `true` the width of the dropdown will adjust accordingly to width of the input */
|
|
75
|
+
autoWidth?: boolean;
|
|
76
|
+
/** Descriptive text for whats selected or about to be selected */
|
|
77
|
+
placeholder?: string;
|
|
78
|
+
} & HTMLAttributes<HTMLDivElement> & {
|
|
79
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
80
|
+
displayName?: string | undefined;
|
|
81
|
+
}) => ReturnType<typeof AutocompleteInner>;
|
|
82
|
+
export {};
|