@equinor/eds-core-react 2.3.3 → 2.3.4
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
CHANGED
|
@@ -9566,8 +9566,15 @@ const UnstyledInput = styled__default.default.input.withConfig({
|
|
|
9566
9566
|
const ChipContainer = styled__default.default.div.withConfig({
|
|
9567
9567
|
displayName: "MultipleInput__ChipContainer",
|
|
9568
9568
|
componentId: "sc-1evc1aa-1"
|
|
9569
|
-
})(["display:flex;flex-wrap:wrap;
|
|
9569
|
+
})(["display:flex;flex-wrap:wrap;align-items:center;align-content:center;min-height:100%;gap:", ";margin:", ";"], ({
|
|
9570
|
+
$density
|
|
9571
|
+
}) => $density === 'compact' ? '2px' : '0.5rem', ({
|
|
9572
|
+
$density
|
|
9573
|
+
}) => $density === 'compact' ? '-2px 0' : '0');
|
|
9570
9574
|
const MultipleInput = () => {
|
|
9575
|
+
const {
|
|
9576
|
+
density
|
|
9577
|
+
} = useEds();
|
|
9571
9578
|
const {
|
|
9572
9579
|
selectedItems,
|
|
9573
9580
|
selectionDisplay,
|
|
@@ -9602,23 +9609,31 @@ const MultipleInput = () => {
|
|
|
9602
9609
|
e.stopPropagation();
|
|
9603
9610
|
handleChipRemove(item, index, false);
|
|
9604
9611
|
};
|
|
9612
|
+
const minHeight = density === 'compact' ? '24px' : '36px';
|
|
9605
9613
|
return /*#__PURE__*/jsxRuntime.jsx(Input$4, {
|
|
9606
9614
|
as: 'div',
|
|
9607
9615
|
variant: variant,
|
|
9608
9616
|
rightAdornmentsWidth: hideClearButton ? 24 + 8 : 24 * 2 + 8,
|
|
9609
9617
|
rightAdornments: /*#__PURE__*/jsxRuntime.jsx(RightAdornments, {}),
|
|
9610
9618
|
readOnly: readOnly,
|
|
9611
|
-
style: {
|
|
9619
|
+
style: selectionDisplay === 'chips' ? {
|
|
9612
9620
|
height: 'auto',
|
|
9613
|
-
minHeight
|
|
9614
|
-
},
|
|
9621
|
+
minHeight
|
|
9622
|
+
} : undefined,
|
|
9623
|
+
"data-density": density,
|
|
9615
9624
|
children: /*#__PURE__*/jsxRuntime.jsxs(ChipContainer, {
|
|
9625
|
+
$density: density,
|
|
9616
9626
|
children: [selectionDisplay === 'chips' && selectedItems.map((item, index) => /*#__PURE__*/jsxRuntime.jsx(Chip, {
|
|
9617
9627
|
ref: el => {
|
|
9618
9628
|
if (el) chipRefs.current.set(getLabel(item), el);else chipRefs.current.delete(getLabel(item));
|
|
9619
9629
|
},
|
|
9620
9630
|
style: {
|
|
9621
|
-
outline: '1px solid var(--eds-color-accent-12)'
|
|
9631
|
+
outline: '1px solid var(--eds-color-accent-12)',
|
|
9632
|
+
...(density === 'compact' && {
|
|
9633
|
+
height: '16px',
|
|
9634
|
+
fontSize: '12px',
|
|
9635
|
+
gridGap: '0px'
|
|
9636
|
+
})
|
|
9622
9637
|
},
|
|
9623
9638
|
onDelete: handleChipDelete(item, index),
|
|
9624
9639
|
onClick: handleChipClick(item, index),
|
|
@@ -4,6 +4,7 @@ import { useAutocompleteContext } from './AutocompleteContext.mjs';
|
|
|
4
4
|
import { RightAdornments } from './RightAdornments.mjs';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
import { Chip } from '../Chip/Chip.mjs';
|
|
7
|
+
import { useEds } from '../EdsProvider/eds.context.mjs';
|
|
7
8
|
import { Input } from '../Input/Input.mjs';
|
|
8
9
|
|
|
9
10
|
const UnstyledInput = styled.input.withConfig({
|
|
@@ -13,8 +14,15 @@ const UnstyledInput = styled.input.withConfig({
|
|
|
13
14
|
const ChipContainer = styled.div.withConfig({
|
|
14
15
|
displayName: "MultipleInput__ChipContainer",
|
|
15
16
|
componentId: "sc-1evc1aa-1"
|
|
16
|
-
})(["display:flex;flex-wrap:wrap;
|
|
17
|
+
})(["display:flex;flex-wrap:wrap;align-items:center;align-content:center;min-height:100%;gap:", ";margin:", ";"], ({
|
|
18
|
+
$density
|
|
19
|
+
}) => $density === 'compact' ? '2px' : '0.5rem', ({
|
|
20
|
+
$density
|
|
21
|
+
}) => $density === 'compact' ? '-2px 0' : '0');
|
|
17
22
|
const MultipleInput = () => {
|
|
23
|
+
const {
|
|
24
|
+
density
|
|
25
|
+
} = useEds();
|
|
18
26
|
const {
|
|
19
27
|
selectedItems,
|
|
20
28
|
selectionDisplay,
|
|
@@ -49,23 +57,31 @@ const MultipleInput = () => {
|
|
|
49
57
|
e.stopPropagation();
|
|
50
58
|
handleChipRemove(item, index, false);
|
|
51
59
|
};
|
|
60
|
+
const minHeight = density === 'compact' ? '24px' : '36px';
|
|
52
61
|
return /*#__PURE__*/jsx(Input, {
|
|
53
62
|
as: 'div',
|
|
54
63
|
variant: variant,
|
|
55
64
|
rightAdornmentsWidth: hideClearButton ? 24 + 8 : 24 * 2 + 8,
|
|
56
65
|
rightAdornments: /*#__PURE__*/jsx(RightAdornments, {}),
|
|
57
66
|
readOnly: readOnly,
|
|
58
|
-
style: {
|
|
67
|
+
style: selectionDisplay === 'chips' ? {
|
|
59
68
|
height: 'auto',
|
|
60
|
-
minHeight
|
|
61
|
-
},
|
|
69
|
+
minHeight
|
|
70
|
+
} : undefined,
|
|
71
|
+
"data-density": density,
|
|
62
72
|
children: /*#__PURE__*/jsxs(ChipContainer, {
|
|
73
|
+
$density: density,
|
|
63
74
|
children: [selectionDisplay === 'chips' && selectedItems.map((item, index) => /*#__PURE__*/jsx(Chip, {
|
|
64
75
|
ref: el => {
|
|
65
76
|
if (el) chipRefs.current.set(getLabel(item), el);else chipRefs.current.delete(getLabel(item));
|
|
66
77
|
},
|
|
67
78
|
style: {
|
|
68
|
-
outline: '1px solid var(--eds-color-accent-12)'
|
|
79
|
+
outline: '1px solid var(--eds-color-accent-12)',
|
|
80
|
+
...(density === 'compact' && {
|
|
81
|
+
height: '16px',
|
|
82
|
+
fontSize: '12px',
|
|
83
|
+
gridGap: '0px'
|
|
84
|
+
})
|
|
69
85
|
},
|
|
70
86
|
onDelete: handleChipDelete(item, index),
|
|
71
87
|
onClick: handleChipClick(item, index),
|
|
@@ -6,3 +6,4 @@ export type { TypographyNextProps } from './Typography.new.types';
|
|
|
6
6
|
export type { HeadingProps } from './Heading.types';
|
|
7
7
|
export type { ParagraphProps } from './Paragraph.types';
|
|
8
8
|
export type { FontFamily, FontSize, LineHeight, BaselineAlignment, FontWeight, Tracking, } from './types';
|
|
9
|
+
export type { TypographyVariants, ColorVariants, TypographyGroups, } from './Typography.tokens';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/eds-core-react",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.4",
|
|
4
4
|
"description": "The React implementation of the Equinor Design System",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
"downshift": "9.0.10",
|
|
99
99
|
"react-aria": "^3.44.0",
|
|
100
100
|
"@equinor/eds-icons": "^1.2.1",
|
|
101
|
-
"@equinor/eds-
|
|
102
|
-
"@equinor/eds-
|
|
101
|
+
"@equinor/eds-tokens": "^2.1.1",
|
|
102
|
+
"@equinor/eds-utils": "^2.0.0"
|
|
103
103
|
},
|
|
104
104
|
"scripts": {
|
|
105
105
|
"build": "rollup -c && tsc -p tsconfig.build.json",
|