@equinor/eds-core-react 0.18.0-envis.2 → 0.18.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/dist/eds-core-react.cjs.js +2106 -1886
- package/dist/esm/components/Accordion/Accordion.js +9 -9
- package/dist/esm/components/Accordion/AccordionHeader.js +45 -38
- package/dist/esm/components/Accordion/AccordionHeaderTitle.js +12 -10
- package/dist/esm/components/Accordion/AccordionItem.js +11 -10
- package/dist/esm/components/Accordion/AccordionPanel.js +22 -18
- package/dist/esm/components/Avatar/Avatar.js +21 -14
- package/dist/esm/components/Banner/Banner.js +12 -11
- package/dist/esm/components/Banner/BannerActions.js +11 -9
- package/dist/esm/components/Banner/BannerIcon.js +12 -10
- package/dist/esm/components/Banner/BannerMessage.js +5 -4
- package/dist/esm/components/Breadcrumbs/Breadcrumb.js +16 -12
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +7 -6
- package/dist/esm/components/Button/Button.js +16 -17
- package/dist/esm/components/Button/InnerFullWidth.js +4 -3
- package/dist/esm/components/Button/tokens/contained.js +5 -5
- package/dist/esm/components/Button/tokens/ghost.js +4 -4
- package/dist/esm/components/Button/tokens/icon.js +4 -4
- package/dist/esm/components/Button/tokens/outlined.js +5 -5
- package/dist/esm/components/Card/Card.js +19 -12
- package/dist/esm/components/Card/CardActions.js +13 -9
- package/dist/esm/components/Card/CardContent.js +5 -4
- package/dist/esm/components/Card/CardHeader.js +5 -4
- package/dist/esm/components/Card/CardHeaderTitle.js +5 -4
- package/dist/esm/components/Card/CardMedia.js +12 -8
- package/dist/esm/components/Checkbox/Checkbox.js +15 -11
- package/dist/esm/components/Checkbox/Input.js +72 -46
- package/dist/esm/components/Chip/Chip.js +46 -30
- package/dist/esm/components/Chip/Icon.js +12 -7
- package/dist/esm/components/Dialog/Dialog.js +44 -20
- package/dist/esm/components/Dialog/Dialog.tokens.js +4 -12
- package/dist/esm/components/Dialog/DialogActions.js +27 -0
- package/dist/esm/components/Dialog/DialogContent.js +44 -0
- package/dist/esm/components/Dialog/DialogHeader.js +37 -0
- package/dist/esm/components/Dialog/DialogTitle.js +31 -0
- package/dist/esm/components/Dialog/index.js +11 -7
- package/dist/esm/components/Divider/Divider.js +6 -5
- package/dist/esm/components/EdsProvider/eds.context.js +5 -4
- package/dist/esm/components/Icon/Icon.js +77 -46
- package/dist/esm/components/Input/Input.js +12 -12
- package/dist/esm/components/Input/Input.tokens.js +4 -4
- package/dist/esm/components/Label/Label.js +7 -4
- package/dist/esm/components/List/List.js +13 -9
- package/dist/esm/components/List/ListItem.js +5 -4
- package/dist/esm/components/Menu/Menu.context.js +5 -4
- package/dist/esm/components/Menu/Menu.js +32 -28
- package/dist/esm/components/Menu/MenuItem.js +38 -25
- package/dist/esm/components/Menu/MenuList.js +7 -6
- package/dist/esm/components/Menu/MenuSection.js +1 -1
- package/dist/esm/components/Pagination/Pagination.js +16 -12
- package/dist/esm/components/Pagination/PaginationItem.js +7 -6
- package/dist/esm/components/Paper/Paper.js +11 -7
- package/dist/esm/components/Popover/Popover.js +37 -49
- package/dist/esm/components/Popover/Popover.tokens.js +2 -12
- package/dist/esm/components/Popover/PopoverActions.js +28 -0
- package/dist/esm/components/Popover/PopoverContent.js +12 -6
- package/dist/esm/components/Popover/PopoverHeader.js +36 -0
- package/dist/esm/components/Popover/PopoverTitle.js +13 -24
- package/dist/esm/components/Popover/index.js +6 -0
- package/dist/esm/components/Progress/Circular/CircularProgress.js +14 -10
- package/dist/esm/components/Progress/Dots/DotProgress.js +12 -8
- package/dist/esm/components/Progress/Linear/LinearProgress.js +6 -5
- package/dist/esm/components/Progress/Star/StarProgress.js +14 -10
- package/dist/esm/components/Radio/Radio.js +84 -52
- package/dist/esm/components/Scrim/Scrim.js +10 -10
- package/dist/esm/components/Search/Search.js +28 -28
- package/dist/esm/components/Select/MultiSelect/MultiSelect.js +27 -22
- package/dist/esm/components/Select/NativeSelect/NativeSelect.js +19 -17
- package/dist/esm/components/Select/Select.tokens.js +2 -2
- package/dist/esm/components/Select/SingleSelect/SingleSelect.js +29 -23
- package/dist/esm/components/Select/commonStyles.js +14 -13
- package/dist/esm/components/SideSheet/SideSheet.js +16 -13
- package/dist/esm/components/Slider/MinMax.js +5 -4
- package/dist/esm/components/Slider/Output.js +13 -9
- package/dist/esm/components/Slider/Slider.js +63 -35
- package/dist/esm/components/Slider/SliderInput.js +14 -14
- package/dist/esm/components/Snackbar/Snackbar.js +17 -21
- package/dist/esm/components/Snackbar/SnackbarAction.js +9 -7
- package/dist/esm/components/Switch/Switch.js +21 -15
- package/dist/esm/components/Switch/Switch.styles.js +24 -17
- package/dist/esm/components/Switch/SwitchDefault.js +39 -29
- package/dist/esm/components/Switch/SwitchSmall.js +38 -28
- package/dist/esm/components/Table/Body.js +5 -4
- package/dist/esm/components/Table/Caption.js +8 -5
- package/dist/esm/components/Table/Cell.js +9 -6
- package/dist/esm/components/Table/DataCell/DataCell.js +12 -12
- package/dist/esm/components/Table/DataCell/DataCell.tokens.js +2 -2
- package/dist/esm/components/Table/Head/Head.js +7 -6
- package/dist/esm/components/Table/HeaderCell/HeaderCell.js +7 -8
- package/dist/esm/components/Table/Row/Row.js +7 -5
- package/dist/esm/components/Table/Table.js +5 -4
- package/dist/esm/components/TableOfContents/LinkItem.js +10 -10
- package/dist/esm/components/TableOfContents/TableOfContents.js +17 -15
- package/dist/esm/components/Tabs/Tab.js +21 -19
- package/dist/esm/components/Tabs/TabList.js +27 -11
- package/dist/esm/components/Tabs/TabPanel.js +8 -7
- package/dist/esm/components/Tabs/TabPanels.js +5 -4
- package/dist/esm/components/Tabs/Tabs.context.js +1 -0
- package/dist/esm/components/Tabs/Tabs.js +45 -15
- package/dist/esm/components/Tabs/Tabs.tokens.js +1 -0
- package/dist/esm/components/TextField/Field.js +49 -38
- package/dist/esm/components/TextField/HelperText/HelperText.js +28 -19
- package/dist/esm/components/TextField/Icon/Icon.js +20 -18
- package/dist/esm/components/TextField/TextField.context.js +4 -3
- package/dist/esm/components/TextField/TextField.js +19 -19
- package/dist/esm/components/Textarea/Textarea.js +16 -16
- package/dist/esm/components/Tooltip/Tooltip.js +16 -23
- package/dist/esm/components/TopBar/Actions.js +5 -4
- package/dist/esm/components/TopBar/CustomContent.js +5 -4
- package/dist/esm/components/TopBar/Header.js +5 -4
- package/dist/esm/components/TopBar/TopBar.js +11 -11
- package/dist/esm/components/Typography/Typography.js +49 -28
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry1.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry2.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry3.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_has.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_isObject.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_isPlaceholder.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeDeepRight.js +2 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeDeepWithKey.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeWithKey.js +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/Checkbox/Input.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +18 -2
- package/dist/types/components/Dialog/DialogActions.d.ts +3 -0
- package/dist/types/components/Dialog/{CustomContent.d.ts → DialogContent.d.ts} +2 -2
- package/dist/types/components/Dialog/DialogHeader.d.ts +3 -0
- package/dist/types/components/Dialog/DialogTitle.d.ts +3 -0
- package/dist/types/components/Dialog/index.d.ts +10 -7
- package/dist/types/components/Icon/Icon.d.ts +2 -2
- package/dist/types/components/Menu/Menu.d.ts +1 -1
- package/dist/types/components/Popover/Popover.d.ts +1 -1
- package/dist/types/components/Popover/PopoverActions.d.ts +3 -0
- package/dist/types/components/Popover/PopoverHeader.d.ts +3 -0
- package/dist/types/components/Popover/index.d.ts +5 -1
- package/dist/types/components/Progress/Circular/CircularProgress.d.ts +1 -1
- package/dist/types/components/Progress/Dots/DotProgress.d.ts +1 -1
- package/dist/types/components/Progress/Star/StarProgress.d.ts +1 -1
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/Switch/Switch.styles.d.ts +2 -1
- package/dist/types/components/Tabs/TabList.d.ts +4 -0
- package/dist/types/components/Tabs/Tabs.context.d.ts +1 -0
- package/dist/types/components/Tabs/Tabs.d.ts +4 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/package.json +37 -38
- package/dist/esm/components/Dialog/Actions.js +0 -26
- package/dist/esm/components/Dialog/CustomContent.js +0 -46
- package/dist/esm/components/Dialog/Title.js +0 -41
- package/dist/esm/hooks/useAutoResize.js +0 -39
- package/dist/esm/hooks/useCombinedRefs.js +0 -14
- package/dist/esm/hooks/useGlobalKeyPress.js +0 -34
- package/dist/esm/hooks/useHideBodyScroll.js +0 -20
- package/dist/esm/hooks/useId.js +0 -14
- package/dist/esm/hooks/useMountedRef.js +0 -12
- package/dist/esm/hooks/useOutsideClick.js +0 -18
- package/dist/esm/hooks/usePopper.js +0 -31
- package/dist/esm/hooks/useToken.js +0 -16
- package/dist/esm/utils/joinHandlers.js +0 -10
- package/dist/esm/utils/setReactInputValue.js +0 -18
- package/dist/esm/utils/templates/borders.js +0 -35
- package/dist/esm/utils/templates/common.js +0 -19
- package/dist/esm/utils/templates/focus.js +0 -35
- package/dist/esm/utils/templates/index.js +0 -52
- package/dist/types/components/Dialog/Actions.d.ts +0 -3
- package/dist/types/components/Dialog/Title.d.ts +0 -3
- package/dist/types/hooks/index.d.ts +0 -9
- package/dist/types/hooks/useAutoResize.d.ts +0 -1
- package/dist/types/hooks/useCombinedRefs.d.ts +0 -3
- package/dist/types/hooks/useGlobalKeyPress.d.ts +0 -10
- package/dist/types/hooks/useHideBodyScroll.d.ts +0 -1
- package/dist/types/hooks/useId.d.ts +0 -1
- package/dist/types/hooks/useMountedRef.d.ts +0 -1
- package/dist/types/hooks/useOutsideClick.d.ts +0 -1
- package/dist/types/hooks/usePopper.d.ts +0 -12
- package/dist/types/hooks/useToken.d.ts +0 -7
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/joinHandlers.d.ts +0 -3
- package/dist/types/utils/setReactInputValue.d.ts +0 -7
- package/dist/types/utils/templates/borders.d.ts +0 -2
- package/dist/types/utils/templates/common.d.ts +0 -9
- package/dist/types/utils/templates/focus.d.ts +0 -2
- package/dist/types/utils/templates/index.d.ts +0 -7
|
@@ -1,48 +1,58 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { BaseInput, GridWrapper, BaseInputWrapper } from './Switch.styles.js';
|
|
4
|
+
import { outlineTemplate } from '@equinor/eds-utils';
|
|
4
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
6
6
|
|
|
7
7
|
const Input = styled(BaseInput).withConfig({
|
|
8
8
|
displayName: "SwitchSmall__Input",
|
|
9
9
|
componentId: "sc-1a99mis-0"
|
|
10
|
-
})(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
})(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
disabled,
|
|
13
|
+
theme: {
|
|
14
|
+
states,
|
|
15
|
+
entities: {
|
|
16
|
+
handle,
|
|
17
|
+
track
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
+
} = _ref;
|
|
21
|
+
return css(["&[data-focus-visible-added]:focus + span{", "}&:focus-visible + span{", "}&:checked + span > span{background-color:", ";}&:checked + span > span:last-child{transform:translate(180%,-50%);background-color:", ";}@media (hover:hover) and (pointer:fine){&:hover + span{background-color:", ";}}"], outlineTemplate(states.focus.outline), outlineTemplate(states.focus.outline), disabled ? states.disabled.background : track.states.active.background, handle.background, disabled ? 'transparent' : states.hover.background);
|
|
22
|
+
});
|
|
20
23
|
const Track = styled.span.withConfig({
|
|
21
24
|
displayName: "SwitchSmall__Track",
|
|
22
25
|
componentId: "sc-1a99mis-1"
|
|
23
|
-
})(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
})(_ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
isDisabled,
|
|
29
|
+
theme: {
|
|
30
|
+
states,
|
|
31
|
+
entities: {
|
|
32
|
+
track
|
|
33
|
+
}
|
|
29
34
|
}
|
|
30
|
-
}
|
|
31
|
-
|
|
35
|
+
} = _ref2;
|
|
36
|
+
return css(["width:", ";height:", ";border-radius:10px;border:none;background-color:", ";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);"], track.width, track.height, isDisabled ? states.disabled.background : track.states.disabled.background);
|
|
37
|
+
});
|
|
32
38
|
const Handle = styled.span.withConfig({
|
|
33
39
|
displayName: "SwitchSmall__Handle",
|
|
34
40
|
componentId: "sc-1a99mis-2"
|
|
35
|
-
})(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
})(_ref3 => {
|
|
42
|
+
let {
|
|
43
|
+
theme: {
|
|
44
|
+
entities: {
|
|
45
|
+
handle
|
|
46
|
+
}
|
|
39
47
|
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
} = _ref3;
|
|
49
|
+
return css(["background-color:", ";width:", ";height:", ";border-radius:50%;display:inline-block;position:absolute;top:50%;transform:translate(11%,-50%);left:7px;transition:transform 0.36s cubic-bezier(0.78,0.14,0.15,0.86);"], handle.background, handle.width, handle.height);
|
|
50
|
+
});
|
|
51
|
+
const SwitchSmall = /*#__PURE__*/forwardRef(function SwitchSmall(_ref4, ref) {
|
|
52
|
+
let {
|
|
53
|
+
disabled,
|
|
54
|
+
...rest
|
|
55
|
+
} = _ref4;
|
|
46
56
|
return /*#__PURE__*/jsxs(GridWrapper, {
|
|
47
57
|
children: [/*#__PURE__*/jsx(Input, { ...rest,
|
|
48
58
|
ref: ref,
|
|
@@ -7,10 +7,11 @@ const TableBase = styled.tbody.withConfig({
|
|
|
7
7
|
displayName: "Body__TableBase",
|
|
8
8
|
componentId: "sc-1pdmiku-0"
|
|
9
9
|
})([""]);
|
|
10
|
-
const Body = /*#__PURE__*/forwardRef(function Body({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const Body = /*#__PURE__*/forwardRef(function Body(_ref, ref) {
|
|
11
|
+
let {
|
|
12
|
+
children,
|
|
13
|
+
...props
|
|
14
|
+
} = _ref;
|
|
14
15
|
return /*#__PURE__*/jsx(InnerContext.Provider, {
|
|
15
16
|
value: {
|
|
16
17
|
variant: 'body'
|
|
@@ -5,11 +5,14 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
5
5
|
const StyledCaption = styled.caption.withConfig({
|
|
6
6
|
displayName: "Caption__StyledCaption",
|
|
7
7
|
componentId: "sc-rtfr07-0"
|
|
8
|
-
})(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
})(_ref => {
|
|
9
|
+
let {
|
|
10
|
+
captionSide = 'top'
|
|
11
|
+
} = _ref;
|
|
12
|
+
return {
|
|
13
|
+
captionSide
|
|
14
|
+
};
|
|
15
|
+
});
|
|
13
16
|
const Caption = /*#__PURE__*/forwardRef(function Caption(props, ref) {
|
|
14
17
|
return /*#__PURE__*/jsx(StyledCaption, { ...props,
|
|
15
18
|
ref: ref
|
|
@@ -4,13 +4,16 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { TableDataCell } from './DataCell/DataCell.js';
|
|
5
5
|
import { TableHeaderCell } from './HeaderCell/HeaderCell.js';
|
|
6
6
|
|
|
7
|
-
const Cell = /*#__PURE__*/forwardRef(function Cell({
|
|
8
|
-
|
|
7
|
+
const Cell = /*#__PURE__*/forwardRef(function Cell(_ref, ref) {
|
|
8
|
+
let { ...rest
|
|
9
|
+
} = _ref;
|
|
9
10
|
return /*#__PURE__*/jsx(InnerContext.Consumer, {
|
|
10
|
-
children:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
children: _ref2 => {
|
|
12
|
+
let {
|
|
13
|
+
variant,
|
|
14
|
+
sticky
|
|
15
|
+
} = _ref2;
|
|
16
|
+
|
|
14
17
|
switch (variant) {
|
|
15
18
|
case 'head':
|
|
16
19
|
return /*#__PURE__*/jsx(TableHeaderCell, {
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
|
+
import { spacingsTemplate, typographyTemplate, bordersTemplate, useToken } from '@equinor/eds-utils';
|
|
3
4
|
import { applyVariant, tableCell } from './DataCell.tokens.js';
|
|
4
5
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { spacingsTemplate, typographyTemplate } from '../../../utils/templates/index.js';
|
|
6
|
-
import { bordersTemplate } from '../../../utils/templates/borders.js';
|
|
7
6
|
import { useEds } from '../../EdsProvider/eds.context.js';
|
|
8
|
-
import { useToken } from '../../../hooks/useToken.js';
|
|
9
7
|
|
|
10
8
|
const StyledTableCell = styled.td.withConfig({
|
|
11
9
|
displayName: "DataCell__StyledTableCell",
|
|
12
10
|
componentId: "sc-15tuitc-0"
|
|
13
|
-
})(
|
|
14
|
-
theme,
|
|
15
|
-
color
|
|
16
|
-
}) => {
|
|
11
|
+
})(_ref => {
|
|
17
12
|
var _theme$validation$err;
|
|
18
13
|
|
|
14
|
+
let {
|
|
15
|
+
theme,
|
|
16
|
+
color
|
|
17
|
+
} = _ref;
|
|
19
18
|
const {
|
|
20
19
|
height,
|
|
21
20
|
typography,
|
|
@@ -27,11 +26,12 @@ const StyledTableCell = styled.td.withConfig({
|
|
|
27
26
|
const base = css(["min-height:", ";height:", ";background:", ";vertical-align:", ";", " ", " ", ""], height, height, backgroundColor, align.vertical, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(border));
|
|
28
27
|
return base;
|
|
29
28
|
});
|
|
30
|
-
const TableDataCell = /*#__PURE__*/forwardRef(function TableDataCell({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const TableDataCell = /*#__PURE__*/forwardRef(function TableDataCell(_ref2, ref) {
|
|
30
|
+
let {
|
|
31
|
+
children,
|
|
32
|
+
variant = 'text',
|
|
33
|
+
...rest
|
|
34
|
+
} = _ref2;
|
|
35
35
|
const {
|
|
36
36
|
density
|
|
37
37
|
} = useEds();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tokens } from '@equinor/eds-tokens';
|
|
2
|
-
import
|
|
2
|
+
import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.27.2/node_modules/ramda/src/mergeDeepRight.js';
|
|
3
3
|
|
|
4
4
|
const {
|
|
5
5
|
typography: {
|
|
@@ -151,7 +151,7 @@ const tableCell = {
|
|
|
151
151
|
const applyVariant = (variant, token) => {
|
|
152
152
|
switch (variant) {
|
|
153
153
|
case 'numeric':
|
|
154
|
-
return
|
|
154
|
+
return mergeDeepRight(token, token.variants.numeric);
|
|
155
155
|
|
|
156
156
|
default:
|
|
157
157
|
return token;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { token } from './Head.tokens.js';
|
|
4
|
+
import { bordersTemplate } from '@equinor/eds-utils';
|
|
4
5
|
import { InnerContext } from '../Inner.context.js';
|
|
5
6
|
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { bordersTemplate } from '../../../utils/templates/borders.js';
|
|
7
7
|
|
|
8
8
|
const StyledTableHead = styled.thead.withConfig({
|
|
9
9
|
displayName: "Head__StyledTableHead",
|
|
10
10
|
componentId: "sc-g9tch7-0"
|
|
11
11
|
})(["", " background:", ";"], bordersTemplate(token.border), token.background);
|
|
12
|
-
const Head = /*#__PURE__*/forwardRef(function Head({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const Head = /*#__PURE__*/forwardRef(function Head(_ref, ref) {
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
sticky,
|
|
16
|
+
...props
|
|
17
|
+
} = _ref;
|
|
17
18
|
return /*#__PURE__*/jsx(InnerContext.Provider, {
|
|
18
19
|
value: {
|
|
19
20
|
variant: 'head',
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
|
+
import { spacingsTemplate, typographyTemplate, bordersTemplate, useToken } from '@equinor/eds-utils';
|
|
3
4
|
import { token } from './HeaderCell.tokens.js';
|
|
4
5
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { spacingsTemplate, typographyTemplate } from '../../../utils/templates/index.js';
|
|
6
|
-
import { bordersTemplate } from '../../../utils/templates/borders.js';
|
|
7
6
|
import { useEds } from '../../EdsProvider/eds.context.js';
|
|
8
|
-
import { useToken } from '../../../hooks/useToken.js';
|
|
9
7
|
|
|
10
8
|
const StyledTableCell = styled.th.withConfig({
|
|
11
9
|
displayName: "HeaderCell__StyledTableCell",
|
|
@@ -40,11 +38,12 @@ const CellInner = styled.div.withConfig({
|
|
|
40
38
|
displayName: "HeaderCell__CellInner",
|
|
41
39
|
componentId: "sc-18w2o3a-1"
|
|
42
40
|
})(["display:flex;align-items:center;"]);
|
|
43
|
-
const TableHeaderCell = /*#__PURE__*/forwardRef(function TableHeaderCell({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
const TableHeaderCell = /*#__PURE__*/forwardRef(function TableHeaderCell(_ref, ref) {
|
|
42
|
+
let {
|
|
43
|
+
children,
|
|
44
|
+
sort,
|
|
45
|
+
...rest
|
|
46
|
+
} = _ref;
|
|
48
47
|
const {
|
|
49
48
|
density
|
|
50
49
|
} = useEds();
|
|
@@ -6,11 +6,12 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
6
6
|
const StyledRow = styled.tr.withConfig({
|
|
7
7
|
displayName: "Row__StyledRow",
|
|
8
8
|
componentId: "sc-12c5lns-0"
|
|
9
|
-
})(
|
|
10
|
-
active
|
|
11
|
-
}) => {
|
|
9
|
+
})(_ref => {
|
|
12
10
|
var _token$states$active, _token$states$hover;
|
|
13
11
|
|
|
12
|
+
let {
|
|
13
|
+
active
|
|
14
|
+
} = _ref;
|
|
14
15
|
return {
|
|
15
16
|
background: active ? (_token$states$active = token.states.active) === null || _token$states$active === void 0 ? void 0 : _token$states$active.background : null,
|
|
16
17
|
'@media (hover: hover) and (pointer: fine)': {
|
|
@@ -20,8 +21,9 @@ const StyledRow = styled.tr.withConfig({
|
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
});
|
|
23
|
-
const Row = /*#__PURE__*/forwardRef(function Row({
|
|
24
|
-
|
|
24
|
+
const Row = /*#__PURE__*/forwardRef(function Row(_ref2, ref) {
|
|
25
|
+
let { ...props
|
|
26
|
+
} = _ref2;
|
|
25
27
|
const {
|
|
26
28
|
children
|
|
27
29
|
} = props;
|
|
@@ -7,10 +7,11 @@ const TableBase = styled.table.withConfig({
|
|
|
7
7
|
displayName: "Table__TableBase",
|
|
8
8
|
componentId: "sc-14kktwc-0"
|
|
9
9
|
})(["border-spacing:0;background:", ";"], tableCell.background);
|
|
10
|
-
const Table = /*#__PURE__*/forwardRef(function Table({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
11
|
+
let {
|
|
12
|
+
children,
|
|
13
|
+
...props
|
|
14
|
+
} = _ref;
|
|
14
15
|
return /*#__PURE__*/jsx(TableBase, { ...props,
|
|
15
16
|
ref: ref,
|
|
16
17
|
children: children
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
+
import { typographyTemplate, spacingsTemplate, outlineTemplate, bordersTemplate } from '@equinor/eds-utils';
|
|
3
4
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { typographyTemplate, spacingsTemplate } from '../../utils/templates/index.js';
|
|
5
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
6
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
7
5
|
|
|
8
6
|
const StyledLinkItem = styled.li.withConfig({
|
|
9
7
|
displayName: "LinkItem__StyledLinkItem",
|
|
10
8
|
componentId: "sc-1tfuad4-0"
|
|
11
|
-
})(
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
})(_ref => {
|
|
10
|
+
let {
|
|
11
|
+
theme
|
|
12
|
+
} = _ref;
|
|
14
13
|
return css(["list-style:none;margin:0;padding:0;a{text-decoration:none;", " ", " height:", ";width:", ";display:block;position:relative;svg{fill:", ";margin-right:", ";vertical-align:text-bottom;}span{max-width:", ";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;vertical-align:text-bottom;display:inline-block;}&:focus{", ";}@media (hover:hover) and (pointer:fine){&:hover{", " background:", ";", " svg{fill:", ";}}}&:active{outline:none;}}"], typographyTemplate(theme.entities.links.typography), spacingsTemplate(theme.entities.links.spacings), theme.entities.links.typography.lineHeight, theme.entities.links.width, theme.entities.icon.background, theme.entities.icon.spacings.right, theme.entities.span.maxWidth, outlineTemplate(theme.states.focus.outline), typographyTemplate(theme.states.hover.typography), theme.states.hover.background, bordersTemplate(theme.states.hover.border), theme.states.hover.entities.icon.background);
|
|
15
14
|
});
|
|
16
|
-
const LinkItem = /*#__PURE__*/forwardRef(function LinkItem({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const LinkItem = /*#__PURE__*/forwardRef(function LinkItem(_ref2, ref) {
|
|
16
|
+
let {
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref2;
|
|
20
20
|
return /*#__PURE__*/jsx(StyledLinkItem, { ...props,
|
|
21
21
|
ref: ref,
|
|
22
22
|
children: children
|
|
@@ -1,20 +1,20 @@
|
|
|
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 { typographyTemplate, useToken } from '@equinor/eds-utils';
|
|
4
5
|
import { tableOfContents } from './TableOfContents.tokens.js';
|
|
5
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
7
|
import { Typography } from '../Typography/Typography.js';
|
|
7
|
-
import { typographyTemplate } from '../../utils/templates/index.js';
|
|
8
8
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
9
|
-
import { useToken } from '../../hooks/useToken.js';
|
|
10
9
|
|
|
11
10
|
const StyledTableOfContents = styled.nav.withConfig({
|
|
12
11
|
displayName: "TableOfContents__StyledTableOfContents",
|
|
13
12
|
componentId: "sc-q23s6y-0"
|
|
14
|
-
})(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
})(_ref => {
|
|
14
|
+
let {
|
|
15
|
+
theme,
|
|
16
|
+
sticky
|
|
17
|
+
} = _ref;
|
|
18
18
|
return css(["margin-top:", ";margin-bottom:", ";", ""], theme.spacings.top, theme.spacings.bottom, sticky && css(["position:fixed;top:", ";right:", ";"], theme.entities.sticky.spacings.top, theme.entities.sticky.spacings.right));
|
|
19
19
|
});
|
|
20
20
|
const TocList = styled(List).withConfig({
|
|
@@ -24,17 +24,19 @@ const TocList = styled(List).withConfig({
|
|
|
24
24
|
const TocLabel = styled(Typography).withConfig({
|
|
25
25
|
displayName: "TableOfContents__TocLabel",
|
|
26
26
|
componentId: "sc-q23s6y-2"
|
|
27
|
-
})(
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
})(_ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
theme
|
|
30
|
+
} = _ref2;
|
|
30
31
|
return css(["", ""], typographyTemplate(theme.typography));
|
|
31
32
|
});
|
|
32
|
-
const TableOfContents = /*#__PURE__*/forwardRef(function TableOfContents({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const TableOfContents = /*#__PURE__*/forwardRef(function TableOfContents(_ref3, ref) {
|
|
34
|
+
let {
|
|
35
|
+
children,
|
|
36
|
+
sticky = false,
|
|
37
|
+
label = '',
|
|
38
|
+
...rest
|
|
39
|
+
} = _ref3;
|
|
38
40
|
const {
|
|
39
41
|
density
|
|
40
42
|
} = useEds();
|
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
+
import { spacingsTemplate, outlineTemplate, bordersTemplate } from '@equinor/eds-utils';
|
|
3
4
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { spacingsTemplate } from '../../utils/templates/index.js';
|
|
5
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
6
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
7
5
|
|
|
8
|
-
const StyledTab = styled.button.attrs(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
const StyledTab = styled.button.attrs(_ref => {
|
|
7
|
+
let {
|
|
8
|
+
active = false,
|
|
9
|
+
disabled = false
|
|
10
|
+
} = _ref;
|
|
11
|
+
return {
|
|
12
|
+
type: 'button',
|
|
13
|
+
role: 'tab',
|
|
14
|
+
'aria-selected': active,
|
|
15
|
+
'aria-disabled': disabled,
|
|
16
|
+
tabIndex: active ? '0' : '-1'
|
|
17
|
+
};
|
|
18
|
+
}).withConfig({
|
|
18
19
|
displayName: "Tab__StyledTab",
|
|
19
20
|
componentId: "sc-scjkct-0"
|
|
20
|
-
})(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
})(_ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
theme,
|
|
24
|
+
active,
|
|
25
|
+
disabled
|
|
26
|
+
} = _ref2;
|
|
25
27
|
const {
|
|
26
28
|
entities: {
|
|
27
29
|
tab
|
|
28
30
|
}
|
|
29
31
|
} = theme;
|
|
30
|
-
return css(["appearance:none;box-sizing:border-box;font-family:inherit;border:none;outline:none;font-size:1rem;height:", ";", " color:", ";background-color:", ";position:relative;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;&:focus{outline:none;}&[data-focus],&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}&::-moz-focus-inner{border:0;}@media (hover:hover) and (pointer:fine){&[data-hover],&:hover{color:", ";", "}}", " ", ""], tab.height, spacingsTemplate(tab.spacings), active ? tab.states.active.typography.color : tab.typography.color, tab.background, outlineTemplate(tab.states.focus.outline), outlineTemplate(tab.states.focus.outline), active ? tab.states.active.states.hover.typography.color : tab.typography.color, disabled ? css(["background:", ";cursor:not-allowed;"], tab.states.disabled.background) : css(["background:", ";cursor:pointer;"], tab.states.hover.background), disabled ? bordersTemplate(tab.states.disabled.border) : bordersTemplate(tab.border), active && bordersTemplate(tab.states.active.border));
|
|
32
|
+
return css(["appearance:none;box-sizing:border-box;font-family:inherit;border:none;outline:none;font-size:1rem;height:", ";", " color:", ";background-color:", ";position:relative;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;scroll-snap-align:end;scroll-snap-stop:always;&:focus{outline:none;}&[data-focus],&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}&::-moz-focus-inner{border:0;}@media (hover:hover) and (pointer:fine){&[data-hover],&:hover{color:", ";", "}}", " ", ""], tab.height, spacingsTemplate(tab.spacings), active ? tab.states.active.typography.color : tab.typography.color, tab.background, outlineTemplate(tab.states.focus.outline), outlineTemplate(tab.states.focus.outline), active ? tab.states.active.states.hover.typography.color : tab.typography.color, disabled ? css(["background:", ";cursor:not-allowed;"], tab.states.disabled.background) : css(["background:", ";cursor:pointer;"], tab.states.hover.background), disabled ? bordersTemplate(tab.states.disabled.border) : bordersTemplate(tab.border), active && bordersTemplate(tab.states.active.border));
|
|
31
33
|
});
|
|
32
34
|
const Tab = /*#__PURE__*/forwardRef(function Tab(props, ref) {
|
|
33
35
|
return /*#__PURE__*/jsx(StyledTab, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { forwardRef, useContext, useRef, useCallback, useEffect, Children, cloneElement } from 'react';
|
|
1
|
+
import { forwardRef, useContext, useRef, useState, useCallback, useEffect, Children, cloneElement } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { useCombinedRefs } from '@equinor/eds-utils';
|
|
3
4
|
import { TabsContext } from './Tabs.context.js';
|
|
4
5
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { useCombinedRefs } from '../../hooks/useCombinedRefs.js';
|
|
6
6
|
|
|
7
7
|
const variants = {
|
|
8
8
|
fullWidth: 'minmax(1%, 360px)',
|
|
@@ -13,26 +13,38 @@ 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:", ";"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
let {
|
|
18
|
+
variant
|
|
19
|
+
} = _ref;
|
|
20
|
+
return variants[variant];
|
|
21
|
+
}, _ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
scrollable
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return scrollable ? 'auto' : 'hidden';
|
|
26
|
+
});
|
|
27
|
+
const TabList = /*#__PURE__*/forwardRef(function TabsList(_ref3, ref) {
|
|
28
|
+
let {
|
|
29
|
+
children = [],
|
|
30
|
+
...props
|
|
31
|
+
} = _ref3;
|
|
23
32
|
const {
|
|
24
33
|
activeTab,
|
|
25
34
|
handleChange,
|
|
26
35
|
tabsId,
|
|
27
36
|
variant = 'minWidth',
|
|
37
|
+
scrollable = false,
|
|
28
38
|
tabsFocused
|
|
29
39
|
} = useContext(TabsContext);
|
|
30
40
|
const currentTab = useRef(activeTab);
|
|
41
|
+
const [arrowNavigating, setArrowNavigating] = useState(false);
|
|
31
42
|
const selectedTabRef = useCallback(node => {
|
|
32
|
-
if (node !== null && tabsFocused) {
|
|
43
|
+
if (node !== null && tabsFocused || node !== null && arrowNavigating) {
|
|
44
|
+
setArrowNavigating(false);
|
|
33
45
|
node.focus();
|
|
34
46
|
}
|
|
35
|
-
}, [tabsFocused]);
|
|
47
|
+
}, [arrowNavigating, tabsFocused]);
|
|
36
48
|
useEffect(() => {
|
|
37
49
|
currentTab.current = activeTab;
|
|
38
50
|
}, [activeTab]);
|
|
@@ -61,6 +73,7 @@ const TabList = /*#__PURE__*/forwardRef(function TabsList({
|
|
|
61
73
|
const handleTabsChange = (direction, fallbackTab) => {
|
|
62
74
|
const i = direction === 'left' ? 1 : -1;
|
|
63
75
|
const nextTab = focusableChildren[focusableChildren.indexOf(currentTab.current) - i];
|
|
76
|
+
setArrowNavigating(true);
|
|
64
77
|
handleChange(nextTab === undefined ? fallbackTab : nextTab);
|
|
65
78
|
};
|
|
66
79
|
|
|
@@ -70,10 +83,12 @@ const TabList = /*#__PURE__*/forwardRef(function TabsList({
|
|
|
70
83
|
} = event;
|
|
71
84
|
|
|
72
85
|
if (key === 'ArrowLeft') {
|
|
86
|
+
event.preventDefault();
|
|
73
87
|
handleTabsChange('left', lastFocusableChild);
|
|
74
88
|
}
|
|
75
89
|
|
|
76
90
|
if (key === 'ArrowRight') {
|
|
91
|
+
event.preventDefault();
|
|
77
92
|
handleTabsChange('right', firstFocusableChild);
|
|
78
93
|
}
|
|
79
94
|
};
|
|
@@ -83,6 +98,7 @@ const TabList = /*#__PURE__*/forwardRef(function TabsList({
|
|
|
83
98
|
ref: ref,
|
|
84
99
|
...props,
|
|
85
100
|
variant: variant,
|
|
101
|
+
scrollable: scrollable,
|
|
86
102
|
children: Tabs
|
|
87
103
|
});
|
|
88
104
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
+
import { spacingsTemplate, outlineTemplate } from '@equinor/eds-utils';
|
|
3
4
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { spacingsTemplate } from '../../utils/templates/index.js';
|
|
5
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
6
5
|
|
|
7
6
|
const StyledTabPanel = styled.div.attrs(() => ({
|
|
8
7
|
tabIndex: 0,
|
|
@@ -10,9 +9,10 @@ const StyledTabPanel = styled.div.attrs(() => ({
|
|
|
10
9
|
})).withConfig({
|
|
11
10
|
displayName: "TabPanel__StyledTabPanel",
|
|
12
11
|
componentId: "sc-e8v1d4-0"
|
|
13
|
-
})(
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
})(_ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
16
16
|
const {
|
|
17
17
|
entities: {
|
|
18
18
|
panel
|
|
@@ -20,8 +20,9 @@ const StyledTabPanel = styled.div.attrs(() => ({
|
|
|
20
20
|
} = theme;
|
|
21
21
|
return css(["", " &:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}"], spacingsTemplate(panel.spacings), outlineTemplate(panel.states.focus.outline), outlineTemplate(panel.states.focus.outline));
|
|
22
22
|
});
|
|
23
|
-
const TabPanel = /*#__PURE__*/forwardRef(function TabPanel({
|
|
24
|
-
|
|
23
|
+
const TabPanel = /*#__PURE__*/forwardRef(function TabPanel(_ref2, ref) {
|
|
24
|
+
let { ...props
|
|
25
|
+
} = _ref2;
|
|
25
26
|
return /*#__PURE__*/jsx(StyledTabPanel, {
|
|
26
27
|
ref: ref,
|
|
27
28
|
...props,
|
|
@@ -2,10 +2,11 @@ import { forwardRef, useContext, Children, cloneElement } from 'react';
|
|
|
2
2
|
import { TabsContext } from './Tabs.context.js';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
const TabPanels = /*#__PURE__*/forwardRef(function TabPanels({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const TabPanels = /*#__PURE__*/forwardRef(function TabPanels(_ref, ref) {
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
...props
|
|
9
|
+
} = _ref;
|
|
9
10
|
const {
|
|
10
11
|
activeTab,
|
|
11
12
|
tabsId
|