@occmundial/occ-atomic 3.0.0-beta.6 → 3.0.0-beta.61
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +484 -0
- package/build/Avatar/Avatar.js +69 -21
- package/build/Avatar/Avatar.test.js +15 -8
- package/build/Avatar/AvatarContent/AvatarContent.js +61 -21
- package/build/Avatar/AvatarContent/AvatarContent.test.js +4 -18
- package/build/Avatar/AvatarContent/__snapshots__/AvatarContent.test.js.snap +75 -15
- package/build/Avatar/AvatarContent/styles.js +88 -21
- package/build/Avatar/__snapshots__/Avatar.test.js.snap +11 -2
- package/build/Avatar/styles.js +18 -7
- package/build/Banner/Banner.js +30 -40
- package/build/Banner/Banner.test.js +64 -17
- package/build/Banner/__snapshots__/Banner.test.js.snap +0 -28
- package/build/Banner/index.js +1 -6
- package/build/Button/Button.js +1 -1
- package/build/Button/Button.test.js +0 -11
- package/build/Button/__snapshots__/Button.test.js.snap +54 -58
- package/build/Button/styles.js +42 -75
- package/build/Checkbox/Checkbox.js +48 -3
- package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +81 -49
- package/build/Checkbox/styles.js +91 -48
- package/build/Fab/__snapshots__/Fab.test.js.snap +2 -2
- package/build/Footer/Footer.js +81 -87
- package/build/Footer/List/List.js +89 -124
- package/build/Footer/List/styles.js +85 -31
- package/build/Footer/__snapshots__/Footer.test.js.snap +109 -59
- package/build/Footer/styles.js +116 -51
- package/build/Grid/Col/__snapshots__/Col.test.js.snap +16 -2
- package/build/Grid/Col/styles.js +12 -6
- package/build/Grid/Row/__snapshots__/Row.test.js.snap +18 -2
- package/build/Grid/Row/styles.js +15 -5
- package/build/Grid/styles.js +26 -9
- package/build/Menu/Menu.js +111 -0
- package/build/Menu/index.js +34 -0
- package/build/Menu/styles.js +28 -0
- package/build/MenuDivider/MenuDivider.js +47 -0
- package/build/MenuDivider/index.js +18 -0
- package/build/MenuDivider/styles.js +21 -0
- package/build/MenuItem/MenuItem.js +160 -0
- package/build/{Header/Menu → MenuItem}/index.js +2 -2
- package/build/MenuItem/styles.js +25 -0
- package/build/MenuItemBase/MenuItemBase.js +98 -0
- package/build/MenuItemBase/index.js +18 -0
- package/build/MenuItemBase/styles.js +57 -0
- package/build/MenuList/MenuList.js +71 -0
- package/build/{Header → MenuList}/index.js +2 -2
- package/build/MenuList/styles.js +54 -0
- package/build/MenuUser/MenuUser.js +153 -0
- package/build/MenuUser/index.js +18 -0
- package/build/MenuUser/styles.js +22 -0
- package/build/Modal/Modal.js +94 -66
- package/build/Modal/Modal.test.js +14 -7
- package/build/Modal/__snapshots__/Modal.test.js.snap +155 -100
- package/build/Modal/styles.js +165 -143
- package/build/NavAvatarButton/NavAvatarButton.js +125 -0
- package/build/{NavIcon → NavAvatarButton}/index.js +2 -2
- package/build/NavAvatarButton/styles.js +30 -0
- package/build/NavButton/NavButton.js +73 -0
- package/build/{Header/Nav → NavButton}/index.js +2 -2
- package/build/NavButton/styles.js +79 -0
- package/build/NavItem/styles.js +4 -4
- package/build/NavTab/NavTab.js +47 -32
- package/build/NavTab/styles.js +63 -28
- package/build/NavTop/styles.js +6 -6
- package/build/OrderBy/OrderBy.js +2 -1
- package/build/Pager/Page/Page.js +11 -6
- package/build/Pager/Page/Page.test.js +13 -9
- package/build/Pager/Page/__snapshots__/Page.test.js.snap +34 -10
- package/build/Pager/Page/styles.js +48 -14
- package/build/Pager/Pager.js +144 -235
- package/build/Pager/Pager.test.js +81 -36
- package/build/Pager/__snapshots__/Pager.test.js.snap +3 -36
- package/build/Pager/styles.js +5 -40
- package/build/Pill/Choice/Choice.js +6 -4
- package/build/Pill/Choice/styles.js +13 -10
- package/build/Pill/Group/styles.js +5 -5
- package/build/Pill/Stack/Stack.js +2 -2
- package/build/Pill/Stack/styles.js +5 -8
- package/build/Placeholder/Placeholder.js +29 -12
- package/build/Placeholder/Placeholder.test.js +4 -4
- package/build/Placeholder/__snapshots__/Placeholder.test.js.snap +81 -38
- package/build/Placeholder/styles.js +86 -42
- package/build/Provider/MenuListProvider.js +38 -0
- package/build/Provider/usePrevious.js +1 -1
- package/build/Radio/Radio.js +42 -6
- package/build/Radio/__snapshots__/Radio.test.js.snap +81 -80
- package/build/Radio/styles.js +93 -85
- package/build/SlideDown/SlideDown.js +162 -169
- package/build/SlideDown/SlideDown.test.js +49 -44
- package/build/SlideDown/__snapshots__/SlideDown.test.js.snap +44 -15
- package/build/SlideDown/styles.js +51 -20
- package/build/SlideToggle/SlideToggle.js +38 -6
- package/build/SlideToggle/SlideToggle.test.js +2 -2
- package/build/SlideToggle/__snapshots__/SlideToggle.test.js.snap +52 -37
- package/build/SlideToggle/styles.js +64 -45
- package/build/Tabs/Tab/Tab.js +73 -0
- package/build/Tabs/Tab/index.js +34 -0
- package/build/Tabs/Tab/index.test.js +132 -0
- package/build/Tabs/Tab/styles.js +74 -0
- package/build/Tabs/TabContent/TabContent.js +76 -0
- package/build/Tabs/TabContent/index.js +34 -0
- package/build/Tabs/TabContent/index.test.js +68 -0
- package/build/Tabs/TabContent/styles.js +23 -0
- package/build/Tabs/TabIndicator/TabIndicator.js +158 -0
- package/build/Tabs/TabIndicator/index.js +34 -0
- package/build/Tabs/TabIndicator/styles.js +24 -0
- package/build/Tabs/TabList/TabList.js +108 -0
- package/build/Tabs/TabList/index.js +34 -0
- package/build/{Pager/Break → Tabs/TabList}/styles.js +3 -2
- package/build/Tabs/Tabs.js +74 -0
- package/build/Tabs/context.js +94 -0
- package/build/Tabs/index.js +34 -0
- package/build/Tabs/index.test.js +157 -0
- package/build/Tabs/styles.js +19 -0
- package/build/Tag/Tag.js +2 -2
- package/build/Tag/__snapshots__/Tag.test.js.snap +40 -43
- package/build/Tag/styles.js +76 -82
- package/build/Text/Text.js +2 -1
- package/build/TextField/TextField.js +7 -6
- package/build/TextField/__snapshots__/TextField.test.js.snap +3 -0
- package/build/TextField/styles.js +3 -0
- package/build/Tip/Tip.js +62 -95
- package/build/Tip/Tip.test.js +29 -6
- package/build/Tip/TipText/index.js +32 -0
- package/build/Tip/__snapshots__/Tip.test.js.snap +127 -15
- package/build/Tip/styles.js +125 -31
- package/build/Toaster/Toast/Toast.js +76 -64
- package/build/Toaster/Toast/styles.js +118 -46
- package/build/Toaster/Toaster.js +3 -2
- package/build/Toaster/Toaster.test.js +5 -2
- package/build/Toaster/__snapshots__/Toaster.test.js.snap +1 -1
- package/build/Toaster/functions.js +4 -0
- package/build/Toaster/styles.js +3 -3
- package/build/Tooltip/Tooltip.js +73 -22
- package/build/Tooltip/__snapshots__/Tooltip.test.js.snap +22 -6
- package/build/Tooltip/styles.js +32 -10
- package/build/index.js +30 -16
- package/build/plugin/babel.js +0 -2
- package/build/subatomic/grid.js +5 -5
- package/build/tokens/colors.json +35 -3
- package/package.json +5 -2
- package/build/Banner/styles.js +0 -41
- package/build/Header/Header.js +0 -163
- package/build/Header/Header.test.js +0 -118
- package/build/Header/Menu/Menu.js +0 -135
- package/build/Header/Menu/Menu.test.js +0 -107
- package/build/Header/Menu/__snapshots__/Menu.test.js.snap +0 -113
- package/build/Header/Menu/styles.js +0 -123
- package/build/Header/Nav/Nav.js +0 -95
- package/build/Header/Nav/Nav.test.js +0 -81
- package/build/Header/Nav/__snapshots__/Nav.test.js.snap +0 -101
- package/build/Header/Nav/styles.js +0 -110
- package/build/Header/__snapshots__/Header.test.js.snap +0 -79
- package/build/Header/styles.js +0 -94
- package/build/NavIcon/NavIcon.js +0 -112
- package/build/NavIcon/styles.js +0 -81
- package/build/Pager/Break/Break.js +0 -27
- package/build/Pager/Break/Break.test.js +0 -53
- package/build/Pager/Break/__snapshots__/Break.test.js.snap +0 -13
- package/build/Pager/Break/index.js +0 -18
- /package/build/Button/{Loading.js → Loading/index.js} +0 -0
@@ -12,6 +12,38 @@ Object {
|
|
12
12
|
"transform": "translate3d(100%, 0, 0)",
|
13
13
|
},
|
14
14
|
},
|
15
|
+
"bodyLarge": Object {
|
16
|
+
"height": 18,
|
17
|
+
"margin": "4.5px 0",
|
18
|
+
},
|
19
|
+
"bodyLargeStrong": Object {
|
20
|
+
"height": 18,
|
21
|
+
"margin": "4.5px 0",
|
22
|
+
},
|
23
|
+
"bodyRegular": Object {
|
24
|
+
"height": 16,
|
25
|
+
"margin": "4px 0",
|
26
|
+
},
|
27
|
+
"bodyRegularStrong": Object {
|
28
|
+
"height": 16,
|
29
|
+
"margin": "4px 0",
|
30
|
+
},
|
31
|
+
"bodySmall": Object {
|
32
|
+
"height": 14,
|
33
|
+
"margin": "3.5px 0",
|
34
|
+
},
|
35
|
+
"bodySmallStrong": Object {
|
36
|
+
"height": 14,
|
37
|
+
"margin": "3.5px 0",
|
38
|
+
},
|
39
|
+
"bodyXLarge": Object {
|
40
|
+
"height": 20,
|
41
|
+
"margin": "5px 0",
|
42
|
+
},
|
43
|
+
"bodyXSmall": Object {
|
44
|
+
"height": 12,
|
45
|
+
"margin": "3px 0",
|
46
|
+
},
|
15
47
|
"bottombase": Object {
|
16
48
|
"marginBottom": 24,
|
17
49
|
},
|
@@ -33,40 +65,67 @@ Object {
|
|
33
65
|
"bottomxTiny": Object {
|
34
66
|
"marginBottom": 4,
|
35
67
|
},
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
68
|
+
"dark": Object {
|
69
|
+
"&:after": Object {
|
70
|
+
"background": "linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.1) , rgba(255,255,255,0) )",
|
39
71
|
},
|
40
|
-
"
|
72
|
+
"background": "rgba(255,255,255,0.1)",
|
73
|
+
"overflow": "hidden",
|
41
74
|
},
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"height":
|
75
|
+
"display": Object {
|
76
|
+
"@media screen and (min-width:768px)": Object {
|
77
|
+
"height": 72,
|
78
|
+
"margin": "3.6px 0",
|
45
79
|
},
|
46
80
|
"height": 48,
|
81
|
+
"margin": "2.4px 0",
|
82
|
+
},
|
83
|
+
"h1": Object {
|
84
|
+
"@media screen and (min-width:768px)": Object {
|
85
|
+
"height": 48,
|
86
|
+
"margin": "2.4px 0",
|
87
|
+
},
|
88
|
+
"height": 32,
|
89
|
+
"margin": "1.6px 0",
|
47
90
|
},
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"height":
|
91
|
+
"h2": Object {
|
92
|
+
"@media screen and (min-width:768px)": Object {
|
93
|
+
"height": 40,
|
94
|
+
"margin": "2px 0",
|
51
95
|
},
|
52
|
-
"height":
|
96
|
+
"height": 28,
|
97
|
+
"margin": "1.4px 0",
|
53
98
|
},
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"height":
|
99
|
+
"h3": Object {
|
100
|
+
"@media screen and (min-width:768px)": Object {
|
101
|
+
"height": 30.8,
|
102
|
+
"margin": "1.4px 0",
|
57
103
|
},
|
58
104
|
"height": 24,
|
105
|
+
"margin": "1.2px 0",
|
59
106
|
},
|
60
|
-
"
|
61
|
-
"
|
62
|
-
"height":
|
107
|
+
"h4": Object {
|
108
|
+
"@media screen and (min-width:768px)": Object {
|
109
|
+
"height": 24,
|
110
|
+
"padding": "1.2px 0",
|
63
111
|
},
|
64
|
-
"height":
|
112
|
+
"height": 20,
|
113
|
+
"margin": "1px 0",
|
114
|
+
},
|
115
|
+
"h5": Object {
|
116
|
+
"height": 18,
|
117
|
+
"margin": "0.9px 0",
|
118
|
+
},
|
119
|
+
"light": Object {
|
120
|
+
"&:after": Object {
|
121
|
+
"background": "linear-gradient(90deg, rgba(0,0,0,0.0) , rgba(0,0,0,0.05) , rgba(0,0,0,0.0) )",
|
122
|
+
},
|
123
|
+
"background": "rgba(0,0,0,0.05)",
|
124
|
+
"overflow": "hidden",
|
65
125
|
},
|
66
126
|
"placeholder": Object {
|
67
127
|
"&:after": Object {
|
68
128
|
"animation": "progress 2s ease-in-out infinite",
|
69
|
-
"background": "linear-gradient(90deg, rgba(204, 204, 204, 0), rgba(204, 204, 204, 0.7), rgba(204, 204, 204, 0))",
|
70
129
|
"content": "\\"\\"",
|
71
130
|
"height": "100%",
|
72
131
|
"left": 0,
|
@@ -74,10 +133,8 @@ Object {
|
|
74
133
|
"top": 0,
|
75
134
|
"width": "100%",
|
76
135
|
},
|
77
|
-
"background": "#f2f2f2",
|
78
136
|
"borderRadius": 4,
|
79
137
|
"height": [Function],
|
80
|
-
"mixBlendMode": "multiply",
|
81
138
|
"overflow": "hidden",
|
82
139
|
"position": "relative",
|
83
140
|
"width": [Function],
|
@@ -85,23 +142,9 @@ Object {
|
|
85
142
|
"round": Object {
|
86
143
|
"borderRadius": "50%",
|
87
144
|
},
|
88
|
-
"
|
89
|
-
"
|
90
|
-
|
91
|
-
},
|
92
|
-
"height": 16,
|
93
|
-
},
|
94
|
-
"standard": Object {
|
95
|
-
"& $placeholder": Object {
|
96
|
-
"height": 15,
|
97
|
-
},
|
98
|
-
"height": 24,
|
99
|
-
},
|
100
|
-
"subheading": Object {
|
101
|
-
"& $placeholder": Object {
|
102
|
-
"height": 17,
|
103
|
-
},
|
104
|
-
"height": 24,
|
145
|
+
"tag": Object {
|
146
|
+
"height": 10,
|
147
|
+
"margin": "2.5px 0",
|
105
148
|
},
|
106
149
|
"topbase": Object {
|
107
150
|
"marginTop": 24,
|
@@ -7,8 +7,14 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
|
9
9
|
|
10
|
+
var _grid = _interopRequireDefault(require("../subatomic/grid"));
|
11
|
+
|
12
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
13
|
+
|
10
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
15
|
|
16
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
17
|
+
|
12
18
|
var _default = {
|
13
19
|
'@keyframes progress': {
|
14
20
|
'0%': {
|
@@ -20,16 +26,14 @@ var _default = {
|
|
20
26
|
},
|
21
27
|
placeholder: {
|
22
28
|
width: function width(props) {
|
23
|
-
return props.width ? props.width :
|
29
|
+
return props.width ? props.width : null;
|
24
30
|
},
|
25
31
|
height: function height(props) {
|
26
|
-
return props.height ? props.height : 14;
|
32
|
+
return props.height ? props.height : !props.textSize ? 14 : null;
|
27
33
|
},
|
28
34
|
borderRadius: _spacing["default"].xTiny,
|
29
35
|
position: 'relative',
|
30
36
|
overflow: 'hidden',
|
31
|
-
background: '#f2f2f2',
|
32
|
-
mixBlendMode: 'multiply',
|
33
37
|
'&:after': {
|
34
38
|
content: '""',
|
35
39
|
position: 'absolute',
|
@@ -37,60 +41,100 @@ var _default = {
|
|
37
41
|
left: 0,
|
38
42
|
width: '100%',
|
39
43
|
height: '100%',
|
40
|
-
background: "linear-gradient(90deg, rgba(204, 204, 204, 0), rgba(204, 204, 204, 0.7), rgba(204, 204, 204, 0))",
|
41
44
|
animation: 'progress 2s ease-in-out infinite'
|
42
45
|
}
|
43
46
|
},
|
47
|
+
light: {
|
48
|
+
background: _colors["default"].skeleton.bg["default"]["default"],
|
49
|
+
overflow: 'hidden',
|
50
|
+
'&:after': {
|
51
|
+
background: _colors["default"].skeleton.bg["default"].gradient
|
52
|
+
}
|
53
|
+
},
|
54
|
+
dark: {
|
55
|
+
background: _colors["default"].skeleton.bg.inverse["default"],
|
56
|
+
overflow: 'hidden',
|
57
|
+
'&:after': {
|
58
|
+
background: _colors["default"].skeleton.bg.inverse.gradient
|
59
|
+
}
|
60
|
+
},
|
44
61
|
round: {
|
45
62
|
borderRadius: '50%'
|
46
63
|
},
|
47
|
-
|
64
|
+
display: _defineProperty({
|
65
|
+
height: 48,
|
66
|
+
margin: '2.4px 0'
|
67
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
48
68
|
height: 72,
|
49
|
-
'
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
69
|
+
margin: '3.6px 0'
|
70
|
+
}),
|
71
|
+
h1: _defineProperty({
|
72
|
+
height: 32,
|
73
|
+
margin: '1.6px 0'
|
74
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
54
75
|
height: 48,
|
55
|
-
'
|
56
|
-
|
57
|
-
|
76
|
+
margin: '2.4px 0'
|
77
|
+
}),
|
78
|
+
h2: _defineProperty({
|
79
|
+
height: 28,
|
80
|
+
margin: '1.4px 0'
|
81
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
82
|
+
height: 40,
|
83
|
+
margin: '2px 0'
|
84
|
+
}),
|
85
|
+
h3: _defineProperty({
|
86
|
+
height: 24,
|
87
|
+
margin: '1.2px 0'
|
88
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
89
|
+
height: 30.8,
|
90
|
+
margin: '1.4px 0'
|
91
|
+
}),
|
92
|
+
h4: _defineProperty({
|
93
|
+
height: 20,
|
94
|
+
margin: '1px 0'
|
95
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
96
|
+
height: 24,
|
97
|
+
padding: '1.2px 0'
|
98
|
+
}),
|
99
|
+
h5: {
|
100
|
+
height: 18,
|
101
|
+
margin: '0.9px 0'
|
58
102
|
},
|
59
|
-
|
60
|
-
height:
|
61
|
-
'
|
62
|
-
height: 22
|
63
|
-
}
|
103
|
+
tag: {
|
104
|
+
height: 10,
|
105
|
+
margin: '2.5px 0'
|
64
106
|
},
|
65
|
-
|
66
|
-
height:
|
67
|
-
'
|
68
|
-
height: 17
|
69
|
-
}
|
107
|
+
bodyXLarge: {
|
108
|
+
height: 20,
|
109
|
+
margin: '5px 0'
|
70
110
|
},
|
71
|
-
|
72
|
-
height:
|
73
|
-
'
|
74
|
-
height: 17
|
75
|
-
}
|
111
|
+
bodyLargeStrong: {
|
112
|
+
height: 18,
|
113
|
+
margin: '4.5px 0'
|
76
114
|
},
|
77
|
-
|
78
|
-
height:
|
79
|
-
'
|
80
|
-
height: 15
|
81
|
-
}
|
115
|
+
bodyLarge: {
|
116
|
+
height: 18,
|
117
|
+
margin: '4.5px 0'
|
82
118
|
},
|
83
|
-
|
119
|
+
bodyRegularStrong: {
|
84
120
|
height: 16,
|
85
|
-
'
|
86
|
-
height: 13
|
87
|
-
}
|
121
|
+
margin: '4px 0'
|
88
122
|
},
|
89
|
-
|
123
|
+
bodyRegular: {
|
90
124
|
height: 16,
|
91
|
-
'
|
92
|
-
|
93
|
-
|
125
|
+
margin: '4px 0'
|
126
|
+
},
|
127
|
+
bodySmallStrong: {
|
128
|
+
height: 14,
|
129
|
+
margin: '3.5px 0'
|
130
|
+
},
|
131
|
+
bodySmall: {
|
132
|
+
height: 14,
|
133
|
+
margin: '3.5px 0'
|
134
|
+
},
|
135
|
+
bodyXSmall: {
|
136
|
+
height: 12,
|
137
|
+
margin: '3px 0'
|
94
138
|
},
|
95
139
|
topxTiny: {
|
96
140
|
marginTop: _spacing["default"].xTiny
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = MenuListProvider;
|
9
|
+
exports.useMenuListContext = exports.MenuListContext = void 0;
|
10
|
+
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
12
|
+
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
14
|
+
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
16
|
+
|
17
|
+
var MenuListContext = /*#__PURE__*/(0, _react.createContext)({
|
18
|
+
dense: false
|
19
|
+
});
|
20
|
+
exports.MenuListContext = MenuListContext;
|
21
|
+
|
22
|
+
var useMenuListContext = function useMenuListContext() {
|
23
|
+
return (0, _react.useContext)(MenuListContext);
|
24
|
+
}; // eslint-disable-next-line react/prop-types
|
25
|
+
|
26
|
+
|
27
|
+
exports.useMenuListContext = useMenuListContext;
|
28
|
+
|
29
|
+
function MenuListProvider(_ref) {
|
30
|
+
var children = _ref.children,
|
31
|
+
_ref$dense = _ref.dense,
|
32
|
+
dense = _ref$dense === void 0 ? false : _ref$dense;
|
33
|
+
return /*#__PURE__*/_react["default"].createElement(MenuListContext.Provider, {
|
34
|
+
value: {
|
35
|
+
dense: dense
|
36
|
+
}
|
37
|
+
}, children);
|
38
|
+
}
|
package/build/Radio/Radio.js
CHANGED
@@ -13,6 +13,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
|
14
14
|
var _Text = _interopRequireDefault(require("../Text"));
|
15
15
|
|
16
|
+
var _Tag = _interopRequireDefault(require("../Tag"));
|
17
|
+
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
17
19
|
|
18
20
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
@@ -52,6 +54,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
52
54
|
selected: props.selected
|
53
55
|
};
|
54
56
|
_this.onChange = _this.onChange.bind(_assertThisInitialized(_this));
|
57
|
+
_this.handleKeyUp = _this.handleKeyUp.bind(_assertThisInitialized(_this));
|
55
58
|
return _this;
|
56
59
|
}
|
57
60
|
|
@@ -75,6 +78,20 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
75
78
|
if (onChange) onChange(option.value);
|
76
79
|
}
|
77
80
|
}
|
81
|
+
}, {
|
82
|
+
key: "handleKeyDown",
|
83
|
+
value: function handleKeyDown(e) {
|
84
|
+
if (e.keyCode == 13 || e.keyCode == 32) {
|
85
|
+
e.preventDefault();
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}, {
|
89
|
+
key: "handleKeyUp",
|
90
|
+
value: function handleKeyUp(e, option) {
|
91
|
+
if (e.keyCode == 13 || e.keyCode == 32) {
|
92
|
+
this.onChange(option);
|
93
|
+
}
|
94
|
+
}
|
78
95
|
}, {
|
79
96
|
key: "render",
|
80
97
|
value: function render() {
|
@@ -87,6 +104,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
87
104
|
id = _this$props.id,
|
88
105
|
textOverflow = _this$props.textOverflow,
|
89
106
|
className = _this$props.className,
|
107
|
+
alignLeft = _this$props.alignLeft,
|
90
108
|
style = _this$props.style;
|
91
109
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
92
110
|
id: id
|
@@ -94,7 +112,11 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
94
112
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
95
113
|
id: option.trk,
|
96
114
|
key: option.value,
|
97
|
-
tabIndex: -1,
|
115
|
+
tabIndex: option.disabled ? -1 : 0,
|
116
|
+
onKeyDown: _this2.handleKeyDown,
|
117
|
+
onKeyUp: function onKeyUp(e) {
|
118
|
+
return _this2.handleKeyUp(e, option);
|
119
|
+
},
|
98
120
|
"data-testid": option.testId
|
99
121
|
}, option.testId && {
|
100
122
|
'data-value': selected == option.value ? 1 : 0
|
@@ -105,16 +127,26 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
105
127
|
},
|
106
128
|
style: style
|
107
129
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
108
|
-
className: classes.
|
109
|
-
|
110
|
-
|
130
|
+
className: classes.radioWrap
|
131
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
132
|
+
className: classes.radio
|
133
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
134
|
+
className: classes.radioOuter
|
135
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
136
|
+
className: classes.radioInner
|
137
|
+
}))), !!(option.label || option.right || option.tag) && /*#__PURE__*/_react["default"].createElement("div", {
|
138
|
+
className: classes.labelWrap
|
139
|
+
}, option.label && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
111
140
|
tag: "label",
|
112
|
-
className: "".concat(classes.label).concat(textOverflow ? " ".concat(classes.overflow) : '')
|
141
|
+
className: "".concat(classes.label).concat(textOverflow ? " ".concat(classes.overflow) : '').concat(alignLeft ? " ".concat(classes.alignLeft) : '')
|
113
142
|
}, option.label), option.right && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
114
143
|
tag: "label",
|
115
144
|
corpSecondary: true,
|
116
145
|
className: classes.right
|
117
|
-
}, option.right)
|
146
|
+
}, option.right), option.tag && /*#__PURE__*/_react["default"].createElement(_Tag["default"], {
|
147
|
+
theme: "link",
|
148
|
+
className: classes.tag
|
149
|
+
}, option.tag)));
|
118
150
|
}));
|
119
151
|
}
|
120
152
|
}]);
|
@@ -139,6 +171,7 @@ Radio.propTypes = {
|
|
139
171
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
140
172
|
label: _propTypes["default"].string,
|
141
173
|
right: _propTypes["default"].string,
|
174
|
+
tag: _propTypes["default"].string,
|
142
175
|
trk: _propTypes["default"].string,
|
143
176
|
|
144
177
|
/** The testId property adds the data attribute data-testid to
|
@@ -146,6 +179,9 @@ Radio.propTypes = {
|
|
146
179
|
testId: _propTypes["default"].string
|
147
180
|
})),
|
148
181
|
|
182
|
+
/** Align the content to the left */
|
183
|
+
alignLeft: _propTypes["default"].bool,
|
184
|
+
|
149
185
|
/** Use this prop to overflow the text of the label, adding '...' and the end. */
|
150
186
|
textOverflow: _propTypes["default"].bool,
|
151
187
|
|