@equinor/eds-core-react 0.18.0-envis.1 → 0.19.0-dev.20220404
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 +2321 -1964
- package/dist/esm/components/Accordion/Accordion.js +9 -9
- package/dist/esm/components/Accordion/Accordion.tokens.js +6 -1
- package/dist/esm/components/Accordion/AccordionHeader.js +61 -49
- 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 +17 -18
- package/dist/esm/components/Button/InnerFullWidth.js +5 -4
- package/dist/esm/components/Button/tokens/button.js +15 -25
- 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 +11 -6
- 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/Checkbox.tokens.js +9 -4
- package/dist/esm/components/Checkbox/Input.js +72 -46
- package/dist/esm/components/Chip/Chip.js +46 -30
- package/dist/esm/components/Chip/Chip.tokens.js +7 -2
- 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 +16 -4
- package/dist/esm/components/Menu/Menu.js +71 -30
- package/dist/esm/components/Menu/MenuItem.js +38 -25
- package/dist/esm/components/Menu/MenuList.js +18 -11
- 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 +43 -50
- 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/Radio/Radio.tokens.js +9 -4
- package/dist/esm/components/Scrim/Scrim.js +16 -20
- 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 +81 -38
- package/dist/esm/components/Slider/Slider.tokens.js +7 -2
- 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/Switch.tokens.js +6 -1
- 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 +15 -14
- package/dist/esm/components/Table/DataCell/DataCell.tokens.js +19 -9
- 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/HeaderCell/HeaderCell.tokens.js +18 -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 +8 -2
- 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 +23 -24
- 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/components/Typography/Typography.tokens.js +7 -2
- 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/Accordion/AccordionHeader.d.ts +2 -2
- 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.context.d.ts +3 -0
- package/dist/types/components/Menu/Menu.d.ts +1 -6
- package/dist/types/components/Menu/MenuList.d.ts +0 -2
- 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,11 +1,11 @@
|
|
|
1
|
-
import { forwardRef, useState, useRef } from 'react';
|
|
1
|
+
import { forwardRef, useState, useEffect, useRef } 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
8
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
8
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
11
|
entities: {
|
|
@@ -23,29 +23,56 @@ const wrapperGrid = css(["display:grid;grid-template-rows:max-content 24px;grid-
|
|
|
23
23
|
const RangeWrapper = styled.div.withConfig({
|
|
24
24
|
displayName: "Slider__RangeWrapper",
|
|
25
25
|
componentId: "sc-n1grrg-0"
|
|
26
|
-
})(["--a:", ";--b:", ";--min:", ";--max:", ";--dif:calc(var(--max) - var(--min));--realWidth:calc(100% - 12px);", " ", " &::before,&::after{", " background:", ";}&::before{margin-left:calc( calc(", " / 2) + (var(--a) - var(--min)) / var(--dif) * var(--realWidth) );width:calc((var(--b) - var(--a)) / var(--dif) * var(--realWidth));}&::after{margin-left:calc( calc(", " / 2) + (var(--b) - var(--min)) / var(--dif) * var(--realWidth) );width:calc((var(--a) - var(--b)) / var(--dif) * var(--realWidth));}@media (hover:hover) and (pointer:fine){&:hover:not([disabled]){", " &::before,&::after{background:", ";}}}"],
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}
|
|
26
|
+
})(["--a:", ";--b:", ";--min:", ";--max:", ";--dif:calc(var(--max) - var(--min));--realWidth:calc(100% - 12px);", " ", " &::before,&::after{", " background:", ";}&::before{margin-left:calc( calc(", " / 2) + (var(--a) - var(--min)) / var(--dif) * var(--realWidth) );width:calc((var(--b) - var(--a)) / var(--dif) * var(--realWidth));}&::after{margin-left:calc( calc(", " / 2) + (var(--b) - var(--min)) / var(--dif) * var(--realWidth) );width:calc((var(--a) - var(--b)) / var(--dif) * var(--realWidth));}@media (hover:hover) and (pointer:fine){&:hover:not([disabled]){", " &::before,&::after{background:", ";}}}"], _ref => {
|
|
27
|
+
let {
|
|
28
|
+
valA
|
|
29
|
+
} = _ref;
|
|
30
|
+
return valA;
|
|
31
|
+
}, _ref2 => {
|
|
32
|
+
let {
|
|
33
|
+
valB
|
|
34
|
+
} = _ref2;
|
|
35
|
+
return valB;
|
|
36
|
+
}, _ref3 => {
|
|
37
|
+
let {
|
|
38
|
+
min
|
|
39
|
+
} = _ref3;
|
|
40
|
+
return min;
|
|
41
|
+
}, _ref4 => {
|
|
42
|
+
let {
|
|
43
|
+
max
|
|
44
|
+
} = _ref4;
|
|
45
|
+
return max;
|
|
46
|
+
}, wrapperGrid, fakeTrackBg, trackFill, _ref5 => {
|
|
47
|
+
let {
|
|
48
|
+
disabled
|
|
49
|
+
} = _ref5;
|
|
50
|
+
return disabled ? track.entities.indicator.states.disabled.background : track.entities.indicator.background;
|
|
51
|
+
}, handle.width, handle.width, fakeTrackBgHover, track.entities.indicator.states.hover.background);
|
|
37
52
|
const Wrapper = styled.div.withConfig({
|
|
38
53
|
displayName: "Slider__Wrapper",
|
|
39
54
|
componentId: "sc-n1grrg-1"
|
|
40
|
-
})(["--min:", ";--max:", ";--dif:calc(var(--max) - var(--min));--value:", ";--realWidth:calc(100% - 12px);", " ", " &::after{", " background:", "}&::after{margin-right:calc( (var(--max) - var(--value)) / var(--dif) * var(--realWidth) );margin-left:3px;}@media (hover:hover) and (pointer:fine){&:hover:not([disabled]){", " &::after{background:", ";}}}"],
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
55
|
+
})(["--min:", ";--max:", ";--dif:calc(var(--max) - var(--min));--value:", ";--realWidth:calc(100% - 12px);", " ", " &::after{", " background:", "}&::after{margin-right:calc( (var(--max) - var(--value)) / var(--dif) * var(--realWidth) );margin-left:3px;}@media (hover:hover) and (pointer:fine){&:hover:not([disabled]){", " &::after{background:", ";}}}"], _ref6 => {
|
|
56
|
+
let {
|
|
57
|
+
min
|
|
58
|
+
} = _ref6;
|
|
59
|
+
return min;
|
|
60
|
+
}, _ref7 => {
|
|
61
|
+
let {
|
|
62
|
+
max
|
|
63
|
+
} = _ref7;
|
|
64
|
+
return max;
|
|
65
|
+
}, _ref8 => {
|
|
66
|
+
let {
|
|
67
|
+
value
|
|
68
|
+
} = _ref8;
|
|
69
|
+
return value;
|
|
70
|
+
}, wrapperGrid, fakeTrackBg, trackFill, _ref9 => {
|
|
71
|
+
let {
|
|
72
|
+
disabled
|
|
73
|
+
} = _ref9;
|
|
74
|
+
return disabled ? track.entities.indicator.states.disabled.background : track.entities.indicator.background;
|
|
75
|
+
}, fakeTrackBgHover, track.entities.indicator.states.hover.background);
|
|
49
76
|
const WrapperGroupLabel = styled.div.withConfig({
|
|
50
77
|
displayName: "Slider__WrapperGroupLabel",
|
|
51
78
|
componentId: "sc-n1grrg-2"
|
|
@@ -58,22 +85,38 @@ const SrOnlyLabel = styled.label.withConfig({
|
|
|
58
85
|
displayName: "Slider__SrOnlyLabel",
|
|
59
86
|
componentId: "sc-n1grrg-4"
|
|
60
87
|
})(["position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;"]);
|
|
61
|
-
const Slider = /*#__PURE__*/forwardRef(function Slider({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
88
|
+
const Slider = /*#__PURE__*/forwardRef(function Slider(_ref10, ref) {
|
|
89
|
+
let {
|
|
90
|
+
min = 0,
|
|
91
|
+
max = 100,
|
|
92
|
+
value = [40, 60],
|
|
93
|
+
outputFunction,
|
|
94
|
+
onChange,
|
|
95
|
+
onChangeCommitted,
|
|
96
|
+
minMaxDots = true,
|
|
97
|
+
minMaxValues = true,
|
|
98
|
+
step = 1,
|
|
99
|
+
disabled,
|
|
100
|
+
ariaLabelledby,
|
|
101
|
+
...rest
|
|
102
|
+
} = _ref10;
|
|
75
103
|
const isRangeSlider = Array.isArray(value);
|
|
76
|
-
const
|
|
104
|
+
const parsedValue = isRangeSlider ? value : [value];
|
|
105
|
+
const [initalValue, setInitalValue] = useState(parsedValue);
|
|
106
|
+
const [sliderValue, setSliderValue] = useState(parsedValue);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (isRangeSlider) {
|
|
109
|
+
if (value[0] !== initalValue[0] || value[1] !== initalValue[1]) {
|
|
110
|
+
setInitalValue(value);
|
|
111
|
+
setSliderValue(value);
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
if (value !== initalValue[0]) {
|
|
115
|
+
setInitalValue([value]);
|
|
116
|
+
setSliderValue([value]);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}, [value, initalValue, isRangeSlider]);
|
|
77
120
|
const minRange = useRef(null);
|
|
78
121
|
const maxRange = useRef(null);
|
|
79
122
|
|
|
@@ -103,7 +146,7 @@ const Slider = /*#__PURE__*/forwardRef(function Slider({
|
|
|
103
146
|
};
|
|
104
147
|
|
|
105
148
|
const handleKeyUp = event => {
|
|
106
|
-
if (event.
|
|
149
|
+
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
107
150
|
handleCommitedValue(event);
|
|
108
151
|
}
|
|
109
152
|
};
|
|
@@ -41,6 +41,11 @@ const {
|
|
|
41
41
|
},
|
|
42
42
|
typography: {
|
|
43
43
|
paragraph
|
|
44
|
+
},
|
|
45
|
+
interactions: {
|
|
46
|
+
focused: {
|
|
47
|
+
width: focusOutlineWidth
|
|
48
|
+
}
|
|
44
49
|
}
|
|
45
50
|
} = tokens;
|
|
46
51
|
const slider = {
|
|
@@ -93,9 +98,9 @@ const slider = {
|
|
|
93
98
|
outline: {
|
|
94
99
|
type: 'outline',
|
|
95
100
|
color: focusOutlineColor,
|
|
96
|
-
width:
|
|
101
|
+
width: focusOutlineWidth,
|
|
97
102
|
style: 'dashed',
|
|
98
|
-
offset: '
|
|
103
|
+
offset: '3px'
|
|
99
104
|
}
|
|
100
105
|
},
|
|
101
106
|
hover: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { slider } from './Slider.tokens.js';
|
|
4
|
+
import { bordersTemplate, outlineTemplate } from '@equinor/eds-utils';
|
|
4
5
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
6
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
7
6
|
|
|
8
7
|
const {
|
|
9
8
|
entities: {
|
|
@@ -24,18 +23,19 @@ const StyledSliderInput = styled.input.attrs(() => ({
|
|
|
24
23
|
displayName: "SliderInput__StyledSliderInput",
|
|
25
24
|
componentId: "sc-17orw4f-0"
|
|
26
25
|
})(["&::-webkit-slider-runnable-track,&::-webkit-slider-thumb,&{-webkit-appearance:none;}::-moz-focus-outer{border:0;}width:100%;background:transparent;background:none;grid-column:1 / -1;grid-row:2;font:inherit;margin:0;z-index:2;outline:none;&[data-focus-visible-added]:focus{z-index:2;&::-webkit-slider-thumb{", ";}&::-moz-range-thumb{", ";}}&:focus-visible{z-index:2;&::-webkit-slider-thumb{", ";}&::-moz-range-thumb{", ";}}&:hover,&:active{&::-webkit-slider-thumb{", "}&::-moz-range-thumb{", "}}&:disabled{&::-webkit-slider-thumb{", "}&::-moz-range-thumb{", "}}&:disabled:hover,&:disabled:active{&::-webkit-slider-thumb{", "}&::-moz-range-thumb{", "}&::-webkit-slider-runnable-track{cursor:not-allowed;}&::-moz-range-track{cursor:not-allowed;}}&:before,&:after{}&:after{right:0;}&::-webkit-slider-thumb{", " margin-top:6px;}&::-moz-range-thumb{", " height:8px;width:8px;}&::-webkit-slider-runnable-track{", "}&::-moz-range-track{", "}"], outlineTemplate(handle.states.focus.outline), outlineTemplate(handle.states.focus.outline), outlineTemplate(handle.states.focus.outline), outlineTemplate(handle.states.focus.outline), thumbHover, thumbHover, thumbDisabled, thumbDisabled, thumbHoverAndDisabled, thumbHoverAndDisabled, thumb, thumb, track, track);
|
|
27
|
-
const SliderInput = /*#__PURE__*/forwardRef(function SliderInput({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
const SliderInput = /*#__PURE__*/forwardRef(function SliderInput(_ref, ref) {
|
|
27
|
+
let {
|
|
28
|
+
value,
|
|
29
|
+
min,
|
|
30
|
+
max,
|
|
31
|
+
id,
|
|
32
|
+
step,
|
|
33
|
+
onChange,
|
|
34
|
+
onMouseUp,
|
|
35
|
+
onKeyUp,
|
|
36
|
+
disabled,
|
|
37
|
+
...restProps
|
|
38
|
+
} = _ref;
|
|
39
39
|
return /*#__PURE__*/jsx(StyledSliderInput, { ...restProps,
|
|
40
40
|
value: value,
|
|
41
41
|
ref: ref,
|
|
@@ -2,21 +2,20 @@ import { forwardRef, useState, useRef, useEffect } from 'react';
|
|
|
2
2
|
import * as ReactDom from 'react-dom';
|
|
3
3
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
4
4
|
import { snackbar } from './Snackbar.tokens.js';
|
|
5
|
+
import { spacingsTemplate, bordersTemplate, typographyTemplate, useToken } from '@equinor/eds-utils';
|
|
5
6
|
import { jsx } from 'react/jsx-runtime';
|
|
6
7
|
import { Paper } from '../Paper/Paper.js';
|
|
7
|
-
import { spacingsTemplate, typographyTemplate } from '../../utils/templates/index.js';
|
|
8
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
9
8
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
10
|
-
import { useToken } from '../../hooks/useToken.js';
|
|
11
9
|
|
|
12
10
|
const StyledSnackbar = styled(Paper).withConfig({
|
|
13
11
|
displayName: "Snackbar__StyledSnackbar",
|
|
14
12
|
componentId: "sc-ac6no8-0"
|
|
15
|
-
})(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
})(_ref => {
|
|
14
|
+
let {
|
|
15
|
+
theme,
|
|
16
|
+
placement
|
|
17
|
+
} = _ref;
|
|
18
|
+
return css(["position:fixed;background-color:", ";", " ", " ", " min-height:", ";box-sizing:border-box;z-index:1400;", " a,button{color:", ";}"], theme.background, spacingsTemplate(theme.spacings), bordersTemplate(theme.border), typographyTemplate(theme.typography), theme.minHeight, {
|
|
20
19
|
top: placement.includes('top') ? theme.spacings.top : placement === 'left' || placement === 'right' ? '50%' : undefined,
|
|
21
20
|
bottom: placement.includes('bottom') ? theme.spacings.bottom : undefined,
|
|
22
21
|
right: placement.includes('right') ? theme.spacings.right : undefined,
|
|
@@ -24,20 +23,17 @@ const StyledSnackbar = styled(Paper).withConfig({
|
|
|
24
23
|
transform: placement === 'left' || placement === 'right' ? 'translateY(-50%)' : placement === 'top' || placement === 'bottom' ? 'translateX(-50%)' : undefined
|
|
25
24
|
}, theme.entities.button.typography.color);
|
|
26
25
|
});
|
|
27
|
-
const Snackbar = /*#__PURE__*/forwardRef(function Snackbar({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
const Snackbar = /*#__PURE__*/forwardRef(function Snackbar(_ref2, ref) {
|
|
27
|
+
let {
|
|
28
|
+
open = false,
|
|
29
|
+
autoHideDuration = 7000,
|
|
30
|
+
onClose,
|
|
31
|
+
placement = 'bottom',
|
|
32
|
+
children,
|
|
33
|
+
...rest
|
|
34
|
+
} = _ref2;
|
|
35
35
|
const [visible, setVisible] = useState(open);
|
|
36
36
|
const timer = useRef();
|
|
37
|
-
const {
|
|
38
|
-
setTimeout,
|
|
39
|
-
clearTimeout
|
|
40
|
-
} = window;
|
|
41
37
|
useEffect(() => {
|
|
42
38
|
setVisible(open);
|
|
43
39
|
timer.current = setTimeout(() => {
|
|
@@ -48,7 +44,7 @@ const Snackbar = /*#__PURE__*/forwardRef(function Snackbar({
|
|
|
48
44
|
}
|
|
49
45
|
}, autoHideDuration);
|
|
50
46
|
return () => clearTimeout(timer.current);
|
|
51
|
-
}, [open, autoHideDuration, setVisible, onClose
|
|
47
|
+
}, [open, autoHideDuration, setVisible, onClose]);
|
|
52
48
|
const props = {
|
|
53
49
|
ref,
|
|
54
50
|
placement,
|
|
@@ -5,15 +5,17 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
5
5
|
const StyledSnackbarAction = styled.div.withConfig({
|
|
6
6
|
displayName: "SnackbarAction__StyledSnackbarAction",
|
|
7
7
|
componentId: "sc-1v5mjvd-0"
|
|
8
|
-
})(
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
})(_ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme
|
|
11
|
+
} = _ref;
|
|
11
12
|
return css(["display:inline-flex;margin-left:", ";margin-top:", ";margin-bottom:", ";"], theme.entities.actions.spacings.left, theme.entities.actions.spacings.top, theme.entities.actions.spacings.bottom);
|
|
12
13
|
});
|
|
13
|
-
const SnackbarAction = /*#__PURE__*/forwardRef(function SnackbarAction({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const SnackbarAction = /*#__PURE__*/forwardRef(function SnackbarAction(_ref2, ref) {
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
...rest
|
|
18
|
+
} = _ref2;
|
|
17
19
|
const props = { ...rest,
|
|
18
20
|
ref
|
|
19
21
|
};
|
|
@@ -3,30 +3,36 @@ import styled, { css, ThemeProvider } from 'styled-components';
|
|
|
3
3
|
import { SwitchSmall } from './SwitchSmall.js';
|
|
4
4
|
import { SwitchDefault } from './SwitchDefault.js';
|
|
5
5
|
import { comfortable } from './Switch.tokens.js';
|
|
6
|
+
import { typographyTemplate, useToken } from '@equinor/eds-utils';
|
|
6
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
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 StyledLabel = styled.label.withConfig({
|
|
12
11
|
displayName: "Switch__StyledLabel",
|
|
13
12
|
componentId: "sc-sdaahx-0"
|
|
14
|
-
})(["cursor:", ";border:none;background-color:transparent;vertical-align:middle;display:inline-flex;align-items:center;position:relative;"],
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
})(["cursor:", ";border:none;background-color:transparent;vertical-align:middle;display:inline-flex;align-items:center;position:relative;"], _ref => {
|
|
14
|
+
let {
|
|
15
|
+
isDisabled
|
|
16
|
+
} = _ref;
|
|
17
|
+
return isDisabled ? 'not-allowed' : 'pointer';
|
|
18
|
+
});
|
|
17
19
|
const Label = styled.span.withConfig({
|
|
18
20
|
displayName: "Switch__Label",
|
|
19
21
|
componentId: "sc-sdaahx-1"
|
|
20
|
-
})(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
})(_ref2 => {
|
|
23
|
+
let {
|
|
24
|
+
theme
|
|
25
|
+
} = _ref2;
|
|
26
|
+
return css(["", " margin-left:", ";"], typographyTemplate(theme.typography), theme.entities.label.spacings.left);
|
|
27
|
+
});
|
|
28
|
+
const Switch = /*#__PURE__*/forwardRef(function Switch(_ref3, ref) {
|
|
29
|
+
let {
|
|
30
|
+
size = 'default',
|
|
31
|
+
disabled,
|
|
32
|
+
label,
|
|
33
|
+
className,
|
|
34
|
+
...rest
|
|
35
|
+
} = _ref3;
|
|
30
36
|
const {
|
|
31
37
|
density
|
|
32
38
|
} = useEds(); // TODO Temporary workaround untill we can deprecate "size" property (controlled by EdsProvider in the future)
|
|
@@ -1,31 +1,38 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { outlineTemplate } from '
|
|
2
|
+
import { outlineTemplate } from '@equinor/eds-utils';
|
|
3
3
|
|
|
4
4
|
const BaseInputWrapper = styled.span.withConfig({
|
|
5
5
|
displayName: "Switchstyles__BaseInputWrapper",
|
|
6
6
|
componentId: "sc-x39lde-0"
|
|
7
|
-
})(
|
|
8
|
-
theme: {
|
|
9
|
-
clickbound,
|
|
10
|
-
width,
|
|
11
|
-
height
|
|
12
|
-
}
|
|
13
|
-
}) => {
|
|
7
|
+
})(_ref => {
|
|
14
8
|
var _clickbound$offset, _clickbound$offset2;
|
|
15
9
|
|
|
10
|
+
let {
|
|
11
|
+
theme: {
|
|
12
|
+
clickbound,
|
|
13
|
+
width,
|
|
14
|
+
height
|
|
15
|
+
}
|
|
16
|
+
} = _ref;
|
|
16
17
|
return css(["width:", ";height:", ";border-radius:50%;position:relative;grid-area:input;pointer-events:none;&::before{position:absolute;top:0;left:0;width:auto;min-height:auto;content:'';}&::after{position:absolute;top:-", ";left:-", ";width:", ";height:", ";content:'';}"], width, height, clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset = clickbound.offset) === null || _clickbound$offset === void 0 ? void 0 : _clickbound$offset.top, clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset2 = clickbound.offset) === null || _clickbound$offset2 === void 0 ? void 0 : _clickbound$offset2.left, clickbound === null || clickbound === void 0 ? void 0 : clickbound.width, clickbound === null || clickbound === void 0 ? void 0 : clickbound.height);
|
|
17
18
|
});
|
|
18
|
-
const BaseInput = styled.input.attrs(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const BaseInput = styled.input.attrs(_ref2 => {
|
|
20
|
+
let {
|
|
21
|
+
type = 'checkbox'
|
|
22
|
+
} = _ref2;
|
|
23
|
+
return {
|
|
24
|
+
type
|
|
25
|
+
};
|
|
26
|
+
}).withConfig({
|
|
23
27
|
displayName: "Switchstyles__BaseInput",
|
|
24
28
|
componentId: "sc-x39lde-1"
|
|
25
|
-
})(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
})(_ref3 => {
|
|
30
|
+
let {
|
|
31
|
+
disabled,
|
|
32
|
+
theme
|
|
33
|
+
} = _ref3;
|
|
34
|
+
return css(["appearance:none;width:100%;height:100%;grid-area:input;margin:0;cursor:", ";&:focus{outline:none;}&[data-focus-visible-added]:focus + span{", "}&:focus-visible + span{", "}"], disabled ? 'not-allowed' : 'pointer', outlineTemplate(theme.states.focus.outline), outlineTemplate(theme.states.focus.outline));
|
|
35
|
+
});
|
|
29
36
|
const GridWrapper = styled.span.withConfig({
|
|
30
37
|
displayName: "Switchstyles__GridWrapper",
|
|
31
38
|
componentId: "sc-x39lde-2"
|
|
@@ -57,6 +57,11 @@ const {
|
|
|
57
57
|
icon_button: compactIconButton
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
},
|
|
61
|
+
interactions: {
|
|
62
|
+
focused: {
|
|
63
|
+
width: focusOutlineWidth
|
|
64
|
+
}
|
|
60
65
|
}
|
|
61
66
|
} = tokens;
|
|
62
67
|
const comfortable = {
|
|
@@ -148,7 +153,7 @@ const comfortable = {
|
|
|
148
153
|
},
|
|
149
154
|
focus: {
|
|
150
155
|
outline: {
|
|
151
|
-
width:
|
|
156
|
+
width: focusOutlineWidth,
|
|
152
157
|
type: 'outline',
|
|
153
158
|
style: 'dashed',
|
|
154
159
|
color: focusOutlineColor
|
|
@@ -1,48 +1,58 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
+
import { bordersTemplate } from '@equinor/eds-utils';
|
|
3
4
|
import { BaseInput, GridWrapper, BaseInputWrapper } from './Switch.styles.js';
|
|
4
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
6
6
|
|
|
7
7
|
const Input = styled(BaseInput).withConfig({
|
|
8
8
|
displayName: "SwitchDefault__Input",
|
|
9
9
|
componentId: "sc-16ym5pn-0"
|
|
10
|
-
})(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
})(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
disabled,
|
|
13
|
+
theme
|
|
14
|
+
} = _ref;
|
|
15
|
+
return css(["&:checked + span > span{background-color:", ";}&:checked + span > span:last-child{transform:translate(105%,-50%);background-color:", ";}&:hover + span{background-color:", ";}&:hover + span > span:last-child{background-color:", ";}"], disabled ? theme.states.disabled.background : theme.entities.track.states.active.background, disabled ? theme.states.disabled.background : theme.entities.handle.states.active.background, disabled ? 'transparent' : theme.states.hover.background, disabled ? theme.states.disabled.background : theme.states.hover.entities.handle.background);
|
|
16
|
+
});
|
|
14
17
|
const Track = styled.span.withConfig({
|
|
15
18
|
displayName: "SwitchDefault__Track",
|
|
16
19
|
componentId: "sc-16ym5pn-1"
|
|
17
|
-
})(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
})(_ref2 => {
|
|
21
|
+
let {
|
|
22
|
+
isDisabled,
|
|
23
|
+
theme: {
|
|
24
|
+
states,
|
|
25
|
+
entities: {
|
|
26
|
+
track
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
29
|
+
} = _ref2;
|
|
30
|
+
return css(["", " border:none;width:", ";height:", ";background-color:", ";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);transition:background 0.36s;", ""], bordersTemplate(track.border), track.width, track.height, track.background, isDisabled && {
|
|
31
|
+
backgroundColor: states.disabled.background
|
|
32
|
+
});
|
|
33
|
+
});
|
|
28
34
|
const Handle = styled.span.withConfig({
|
|
29
35
|
displayName: "SwitchDefault__Handle",
|
|
30
36
|
componentId: "sc-16ym5pn-2"
|
|
31
|
-
})(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
})(_ref3 => {
|
|
38
|
+
let {
|
|
39
|
+
isDisabled,
|
|
40
|
+
theme: {
|
|
41
|
+
states,
|
|
42
|
+
entities: {
|
|
43
|
+
handle
|
|
44
|
+
}
|
|
37
45
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, handle.boxShadow, handle.width, handle.height)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
} = _ref3;
|
|
47
|
+
return css(["background-color:", ";", " box-shadow:", ";width:", ";height:", ";border-radius:50%;display:inline-block;position:absolute;top:50%;transform:translate(0,-50%);left:4px;transition:transform 0.36s cubic-bezier(0.78,0.14,0.15,0.86);"], handle.background, isDisabled && {
|
|
48
|
+
backgroundColor: states.disabled.background
|
|
49
|
+
}, handle.boxShadow, handle.width, handle.height);
|
|
50
|
+
});
|
|
51
|
+
const SwitchDefault = /*#__PURE__*/forwardRef(function SwitchDefault(_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,
|
|
@@ -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'
|