@automattic/vip-design-system 2.10.0 → 2.10.2
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/babel.config.js +23 -19
- package/build/declaration.d.js +0 -1
- package/build/system/Accordion/Accordion.js +28 -33
- package/build/system/Accordion/Accordion.stories.js +34 -35
- package/build/system/Accordion/Accordion.test.js +35 -34
- package/build/system/Accordion/index.js +5 -8
- package/build/system/Avatar/Avatar.js +13 -17
- package/build/system/Avatar/Avatar.stories.js +10 -12
- package/build/system/Avatar/Avatar.test.js +15 -14
- package/build/system/Avatar/index.js +4 -6
- package/build/system/Badge/Badge.js +9 -14
- package/build/system/Badge/Badge.stories.js +23 -23
- package/build/system/Badge/Badge.test.js +15 -14
- package/build/system/Badge/index.js +4 -6
- package/build/system/Box/Box.js +9 -13
- package/build/system/Box/Box.stories.js +5 -8
- package/build/system/Breadcrumbs/Breadcrumbs.js +34 -38
- package/build/system/Breadcrumbs/Breadcrumbs.stories.js +18 -21
- package/build/system/Breadcrumbs/Breadcrumbs.test.js +28 -30
- package/build/system/Breadcrumbs/styles.js +5 -9
- package/build/system/Button/Button.js +11 -17
- package/build/system/Button/Button.stories.js +34 -33
- package/build/system/Button/Button.test.js +17 -16
- package/build/system/Button/ButtonSubmit.js +12 -16
- package/build/system/Button/ButtonSubmit.stories.js +12 -16
- package/build/system/Button/ButtonSubmit.test.js +15 -14
- package/build/system/Button/index.js +5 -8
- package/build/system/Card/Card.js +12 -14
- package/build/system/Card/Card.stories.js +21 -24
- package/build/system/Card/Card.test.js +19 -18
- package/build/system/Card/index.js +4 -6
- package/build/system/Code/Code.js +19 -23
- package/build/system/Code/Code.stories.js +16 -18
- package/build/system/Code/Code.test.js +20 -19
- package/build/system/Code/index.js +4 -6
- package/build/system/Drawer/Drawer.js +25 -30
- package/build/system/Drawer/Drawer.stories.js +38 -39
- package/build/system/Drawer/Drawer.test.js +19 -18
- package/build/system/Drawer/styles.js +9 -11
- package/build/system/Dropdown/Dropdown.js +23 -26
- package/build/system/Dropdown/Dropdown.test.js +16 -18
- package/build/system/Dropdown/DropdownContent.js +14 -20
- package/build/system/Dropdown/DropdownItem.js +19 -25
- package/build/system/Dropdown/DropdownLabel.js +10 -16
- package/build/system/Dropdown/DropdownSeparator.js +10 -16
- package/build/system/Dropdown/index.js +20 -23
- package/build/system/FilterDropdown/FilterDropdown.js +23 -29
- package/build/system/FilterDropdown/FilterDropdown.stories.js +9 -11
- package/build/system/FilterDropdown/FilterDropdown.test.js +7 -10
- package/build/system/Flex/Flex.js +7 -10
- package/build/system/Flex/Flex.stories.js +6 -10
- package/build/system/Flex/index.js +4 -6
- package/build/system/Footer/Footer.d.ts +33 -0
- package/build/system/Footer/Footer.js +82 -0
- package/build/system/Footer/Footer.stories.d.ts +41 -0
- package/build/system/Footer/Footer.stories.js +53 -0
- package/build/system/Footer/Footer.test.d.ts +1 -0
- package/build/system/Footer/Footer.test.js +36 -0
- package/build/system/Form/Checkbox/Checkbox.js +14 -18
- package/build/system/Form/Checkbox/Checkbox.stories.js +47 -48
- package/build/system/Form/Checkbox/Checkbox.test.js +23 -21
- package/build/system/Form/Checkbox/styles.js +7 -10
- package/build/system/Form/Input.js +19 -18
- package/build/system/Form/Input.stories.js +16 -18
- package/build/system/Form/Input.styles.js +5 -9
- package/build/system/Form/Label.js +14 -16
- package/build/system/Form/Label.stories.js +15 -15
- package/build/system/Form/Radio/Radio.js +13 -18
- package/build/system/Form/Radio/Radio.stories.js +43 -43
- package/build/system/Form/Radio/Radio.test.js +19 -18
- package/build/system/Form/Radio/RadioOption.js +22 -23
- package/build/system/Form/Radio/styles.js +7 -10
- package/build/system/Form/RadioGroupChip.js +26 -29
- package/build/system/Form/RadioGroupChip.stories.js +12 -15
- package/build/system/Form/RadioGroupChip.test.js +12 -11
- package/build/system/Form/RequiredLabel.js +3 -7
- package/build/system/Form/Toggle.js +11 -16
- package/build/system/Form/Toggle.stories.js +25 -27
- package/build/system/Form/Toggle.test.js +12 -11
- package/build/system/Form/Validation.js +10 -12
- package/build/system/Form/index.d.ts +2 -1
- package/build/system/Form/index.js +2 -0
- package/build/system/Grid/Grid.js +7 -10
- package/build/system/Grid/Grid.stories.js +6 -10
- package/build/system/Grid/index.js +4 -6
- package/build/system/Heading/Heading.js +9 -14
- package/build/system/Heading/Heading.stories.js +13 -16
- package/build/system/Hr/Hr.js +3 -7
- package/build/system/Hr/Hr.stories.js +10 -11
- package/build/system/Hr/Hr.test.js +14 -14
- package/build/system/Link/Link.js +11 -14
- package/build/system/Link/Link.stories.js +11 -14
- package/build/system/Link/index.js +4 -6
- package/build/system/LinkExternal/LinkExternal.d.ts +23 -3
- package/build/system/LinkExternal/LinkExternal.js +17 -23
- package/build/system/LinkExternal/LinkExternal.stories.d.ts +1 -8
- package/build/system/LinkExternal/LinkExternal.stories.js +4 -9
- package/build/system/LinkExternal/LinkExternal.test.js +14 -15
- package/build/system/MobileMenu/MobileMenu.js +24 -29
- package/build/system/MobileMenu/MobileMenu.stories.js +66 -67
- package/build/system/MobileMenu/MobileMenu.test.js +21 -22
- package/build/system/Nav/Nav.js +26 -32
- package/build/system/Nav/Nav.stories.js +97 -99
- package/build/system/Nav/Nav.test.js +32 -28
- package/build/system/Nav/NavItem.js +40 -45
- package/build/system/Nav/NavItemGroup.js +34 -39
- package/build/system/Nav/NavItemGroup.test.js +26 -23
- package/build/system/Nav/styles/variants/breadcrumbs.js +4 -7
- package/build/system/Nav/styles/variants/menu.js +8 -12
- package/build/system/Nav/styles/variants/menugroup.js +7 -11
- package/build/system/Nav/styles/variants/primary.js +4 -8
- package/build/system/Nav/styles/variants/tabs.js +3 -7
- package/build/system/Nav/styles/variants/toolbar.js +5 -8
- package/build/system/Nav/styles.js +26 -29
- package/build/system/NewDialog/DialogClose.js +14 -18
- package/build/system/NewDialog/DialogClose.test.js +11 -14
- package/build/system/NewDialog/DialogDescription.js +9 -15
- package/build/system/NewDialog/DialogOverlay.js +11 -13
- package/build/system/NewDialog/DialogTitle.js +7 -15
- package/build/system/NewDialog/NewDialog.js +24 -29
- package/build/system/NewDialog/index.js +7 -11
- package/build/system/NewDialog/styles.js +1 -5
- package/build/system/NewForm/Fieldset.js +13 -17
- package/build/system/NewForm/Form.js +8 -13
- package/build/system/NewForm/FormAutocomplete.js +2 -2
- package/build/system/NewForm/Legend.js +11 -15
- package/build/system/Notice/Notice.js +22 -25
- package/build/system/Notice/Notice.stories.js +41 -43
- package/build/system/Notice/index.js +5 -5
- package/build/system/Page/Page.js +4 -8
- package/build/system/Page/Page.test.js +14 -14
- package/build/system/Progress/Progress.js +21 -24
- package/build/system/Progress/Progress.stories.js +9 -15
- package/build/system/Progress/Progress.test.js +14 -13
- package/build/system/Progress/index.js +4 -6
- package/build/system/ScreenReaderText/ScreenReaderText.js +9 -9
- package/build/system/Spinner/Spinner.js +9 -14
- package/build/system/Spinner/Spinner.stories.js +6 -10
- package/build/system/Spinner/Spinner.test.js +14 -13
- package/build/system/Spinner/index.js +1 -6
- package/build/system/Table/Table.js +20 -22
- package/build/system/Table/Table.stories.js +29 -30
- package/build/system/Table/TableCell.js +9 -11
- package/build/system/Table/TableRow.js +10 -11
- package/build/system/Table/index.js +6 -10
- package/build/system/Text/Text.js +9 -14
- package/build/system/Text/Text.stories.js +24 -25
- package/build/system/Text/index.js +4 -6
- package/build/system/Toolbar/Logo.js +11 -15
- package/build/system/Toolbar/Toolbar.js +12 -17
- package/build/system/Toolbar/Toolbar.stories.js +47 -50
- package/build/system/Toolbar/Toolbar.test.js +26 -24
- package/build/system/Toolbar/ToolbarUtilNav.js +9 -16
- package/build/system/Toolbar/index.js +10 -15
- package/build/system/Tooltip/Tooltip.js +9 -14
- package/build/system/Tooltip/Tooltip.stories.js +29 -31
- package/build/system/Tooltip/index.js +5 -5
- package/build/system/Wizard/Wizard.js +11 -18
- package/build/system/Wizard/Wizard.stories.js +37 -38
- package/build/system/Wizard/WizardStep.js +26 -32
- package/build/system/Wizard/index.js +6 -7
- package/build/system/assets/a8cLogo.d.ts +2 -0
- package/build/system/assets/a8cLogo.js +39 -0
- package/build/system/index.d.ts +2 -1
- package/build/system/index.js +2 -0
- package/build/system/theme/breakpoints.js +1 -5
- package/build/system/utils/stories/CustomLink.js +7 -13
- package/package.json +1 -1
- package/src/system/Footer/Footer.stories.tsx +46 -0
- package/src/system/Footer/Footer.test.tsx +40 -0
- package/src/system/Footer/Footer.tsx +120 -0
- package/src/system/Form/index.js +2 -0
- package/src/system/LinkExternal/LinkExternal.tsx +27 -8
- package/src/system/NewForm/FormAutocomplete.js +2 -2
- package/src/system/assets/a8cLogo.tsx +30 -0
- package/src/system/index.js +2 -0
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
12
|
-
var _default = exports["default"] = {
|
|
1
|
+
import { AiOutlineLock } from 'react-icons/ai';
|
|
2
|
+
import { BiBulb, BiCodeAlt, BiData, BiHistory, BiGridAlt, BiTachometer, BiWindows, BiBell } from 'react-icons/bi';
|
|
3
|
+
import { MdOutlinePhotoLibrary } from 'react-icons/md';
|
|
4
|
+
import { Nav } from './Nav';
|
|
5
|
+
import { NavItem } from './NavItem';
|
|
6
|
+
import { CustomLink } from '../utils/stories/CustomLink';
|
|
7
|
+
import { jsx as _jsx } from "theme-ui/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
9
|
+
import { Fragment as _Fragment } from "theme-ui/jsx-runtime";
|
|
10
|
+
export default {
|
|
13
11
|
title: 'Navigation/Nav',
|
|
14
|
-
component:
|
|
12
|
+
component: Nav,
|
|
15
13
|
parameters: {
|
|
16
14
|
docs: {
|
|
17
15
|
description: {
|
|
@@ -20,34 +18,34 @@ var _default = exports["default"] = {
|
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
};
|
|
23
|
-
var Default =
|
|
21
|
+
export var Default = {
|
|
24
22
|
render: function render() {
|
|
25
|
-
return (
|
|
26
|
-
children: [(
|
|
27
|
-
children: (
|
|
23
|
+
return _jsxs(_Fragment, {
|
|
24
|
+
children: [_jsx("p", {
|
|
25
|
+
children: _jsx("strong", {
|
|
28
26
|
children: "Variant: Primary"
|
|
29
27
|
})
|
|
30
|
-
}), (
|
|
28
|
+
}), _jsxs(Nav.Primary, {
|
|
31
29
|
sx: {
|
|
32
30
|
mb: 4
|
|
33
31
|
},
|
|
34
32
|
label: "Nav Primary",
|
|
35
|
-
children: [(
|
|
33
|
+
children: [_jsx(NavItem.Primary, {
|
|
36
34
|
active: true,
|
|
37
|
-
as:
|
|
35
|
+
as: CustomLink,
|
|
38
36
|
href: "https://random-website.com/",
|
|
39
37
|
children: "PHP"
|
|
40
|
-
}), (
|
|
41
|
-
as:
|
|
38
|
+
}), _jsx(NavItem.Primary, {
|
|
39
|
+
as: CustomLink,
|
|
42
40
|
href: "https://wordpress.com",
|
|
43
41
|
children: "WordPress"
|
|
44
|
-
}), (
|
|
45
|
-
as:
|
|
42
|
+
}), _jsx(NavItem.Primary, {
|
|
43
|
+
as: CustomLink,
|
|
46
44
|
href: "https://newrelic.com/",
|
|
47
45
|
children: "New Relic"
|
|
48
|
-
}), (
|
|
46
|
+
}), _jsx(NavItem.Primary, {
|
|
49
47
|
disabled: true,
|
|
50
|
-
as:
|
|
48
|
+
as: CustomLink,
|
|
51
49
|
href: "https://google.com/",
|
|
52
50
|
children: "Not accessible"
|
|
53
51
|
})]
|
|
@@ -55,46 +53,46 @@ var Default = exports.Default = {
|
|
|
55
53
|
});
|
|
56
54
|
}
|
|
57
55
|
};
|
|
58
|
-
var Tab =
|
|
56
|
+
export var Tab = {
|
|
59
57
|
render: function render() {
|
|
60
|
-
return (
|
|
61
|
-
children: [(
|
|
62
|
-
children: (
|
|
58
|
+
return _jsxs(_Fragment, {
|
|
59
|
+
children: [_jsx("p", {
|
|
60
|
+
children: _jsx("strong", {
|
|
63
61
|
children: "Variant: Tab"
|
|
64
62
|
})
|
|
65
|
-
}), (
|
|
63
|
+
}), _jsxs(Nav.Tab, {
|
|
66
64
|
sx: {
|
|
67
65
|
mb: 4
|
|
68
66
|
},
|
|
69
67
|
label: "Nav Tab",
|
|
70
|
-
children: [(
|
|
71
|
-
as:
|
|
68
|
+
children: [_jsx(NavItem.Tab, {
|
|
69
|
+
as: CustomLink,
|
|
72
70
|
href: "#!",
|
|
73
71
|
children: "PHP"
|
|
74
|
-
}), (
|
|
75
|
-
as:
|
|
72
|
+
}), _jsx(NavItem.Tab, {
|
|
73
|
+
as: CustomLink,
|
|
76
74
|
href: "#2!",
|
|
77
75
|
children: "WordPress"
|
|
78
|
-
}), (
|
|
76
|
+
}), _jsx(NavItem.Tab, {
|
|
79
77
|
active: true,
|
|
80
|
-
as:
|
|
78
|
+
as: CustomLink,
|
|
81
79
|
href: "#3!",
|
|
82
80
|
children: "New Relic"
|
|
83
|
-
}), (
|
|
84
|
-
as:
|
|
81
|
+
}), _jsx(NavItem.Tab, {
|
|
82
|
+
as: CustomLink,
|
|
85
83
|
href: "#4!",
|
|
86
84
|
children: "Datadog"
|
|
87
|
-
}), (
|
|
88
|
-
as:
|
|
85
|
+
}), _jsx(NavItem.Tab, {
|
|
86
|
+
as: CustomLink,
|
|
89
87
|
href: "#4!",
|
|
90
88
|
children: "OnePlus"
|
|
91
|
-
}), (
|
|
92
|
-
as:
|
|
89
|
+
}), _jsx(NavItem.Tab, {
|
|
90
|
+
as: CustomLink,
|
|
93
91
|
href: "#5!",
|
|
94
92
|
children: "Rollbar"
|
|
95
|
-
}), (
|
|
93
|
+
}), _jsx(NavItem.Tab, {
|
|
96
94
|
disabled: true,
|
|
97
|
-
as:
|
|
95
|
+
as: CustomLink,
|
|
98
96
|
href: "#6!",
|
|
99
97
|
children: "Not accessible"
|
|
100
98
|
})]
|
|
@@ -102,129 +100,129 @@ var Tab = exports.Tab = {
|
|
|
102
100
|
});
|
|
103
101
|
}
|
|
104
102
|
};
|
|
105
|
-
var Menu =
|
|
103
|
+
export var Menu = {
|
|
106
104
|
render: function render() {
|
|
107
|
-
return (
|
|
108
|
-
children: [(
|
|
109
|
-
children: [(
|
|
105
|
+
return _jsxs(_Fragment, {
|
|
106
|
+
children: [_jsxs("p", {
|
|
107
|
+
children: [_jsx("strong", {
|
|
110
108
|
children: "Variant: Menu"
|
|
111
109
|
}), ". This menu takes full width by default. You can put it in a container with constrained width.."]
|
|
112
|
-
}), (
|
|
110
|
+
}), _jsxs(Nav.Menu, {
|
|
113
111
|
sx: {
|
|
114
112
|
mb: 4
|
|
115
113
|
},
|
|
116
114
|
label: "Nav Menu",
|
|
117
|
-
children: [(
|
|
115
|
+
children: [_jsx(NavItem.Menu, {
|
|
118
116
|
href: "https://wordpress.com",
|
|
119
117
|
renderIcon: function renderIcon(size) {
|
|
120
|
-
return (
|
|
118
|
+
return _jsx(BiGridAlt, {
|
|
121
119
|
size: size
|
|
122
120
|
});
|
|
123
121
|
},
|
|
124
|
-
as:
|
|
122
|
+
as: CustomLink,
|
|
125
123
|
children: "Overview"
|
|
126
|
-
}), (
|
|
127
|
-
as:
|
|
124
|
+
}), _jsx(NavItem.Menu, {
|
|
125
|
+
as: CustomLink,
|
|
128
126
|
href: "https://random-website.com/",
|
|
129
127
|
renderIcon: function renderIcon(size) {
|
|
130
|
-
return (
|
|
128
|
+
return _jsx(BiWindows, {
|
|
131
129
|
size: size
|
|
132
130
|
});
|
|
133
131
|
},
|
|
134
132
|
children: "Network Sites"
|
|
135
|
-
}), (
|
|
136
|
-
as:
|
|
133
|
+
}), _jsx(NavItem.Menu, {
|
|
134
|
+
as: CustomLink,
|
|
137
135
|
href: "https://random-website.com/",
|
|
138
136
|
renderIcon: function renderIcon(size) {
|
|
139
|
-
return (
|
|
137
|
+
return _jsx(AiOutlineLock, {
|
|
140
138
|
size: size
|
|
141
139
|
});
|
|
142
140
|
},
|
|
143
141
|
children: "Domains & TLS"
|
|
144
|
-
}), (
|
|
142
|
+
}), _jsxs(NavItem.MenuGroup, {
|
|
145
143
|
active: true,
|
|
146
144
|
activeChildren: true,
|
|
147
145
|
label: "Logs",
|
|
148
146
|
renderIcon: function renderIcon(size) {
|
|
149
|
-
return (
|
|
147
|
+
return _jsx(BiHistory, {
|
|
150
148
|
size: size
|
|
151
149
|
});
|
|
152
150
|
},
|
|
153
|
-
children: [(
|
|
151
|
+
children: [_jsx(NavItem.Menu, {
|
|
154
152
|
active: true,
|
|
155
|
-
as:
|
|
153
|
+
as: CustomLink,
|
|
156
154
|
href: "https://google.com/",
|
|
157
155
|
children: "Audit"
|
|
158
|
-
}), (
|
|
159
|
-
as:
|
|
156
|
+
}), _jsx(NavItem.Menu, {
|
|
157
|
+
as: CustomLink,
|
|
160
158
|
href: "https://wpvip.com/",
|
|
161
159
|
children: "Runtime"
|
|
162
|
-
}), (
|
|
163
|
-
as:
|
|
160
|
+
}), _jsx(NavItem.Menu, {
|
|
161
|
+
as: CustomLink,
|
|
164
162
|
href: "https://dashboard.wpvip.com/",
|
|
165
163
|
children: "Slow Query"
|
|
166
164
|
})]
|
|
167
|
-
}), (
|
|
165
|
+
}), _jsxs(NavItem.MenuGroup, {
|
|
168
166
|
label: "Performance",
|
|
169
167
|
renderIcon: function renderIcon(size) {
|
|
170
|
-
return (
|
|
168
|
+
return _jsx(BiTachometer, {
|
|
171
169
|
size: size
|
|
172
170
|
});
|
|
173
171
|
},
|
|
174
|
-
children: [(
|
|
175
|
-
as:
|
|
172
|
+
children: [_jsx(NavItem.Menu, {
|
|
173
|
+
as: CustomLink,
|
|
176
174
|
href: "https://random-website.com/",
|
|
177
175
|
children: "Metrics"
|
|
178
|
-
}), (
|
|
179
|
-
as:
|
|
176
|
+
}), _jsx(NavItem.Menu, {
|
|
177
|
+
as: CustomLink,
|
|
180
178
|
href: "https://random-website.com/",
|
|
181
179
|
children: "Monitor"
|
|
182
|
-
}), (
|
|
183
|
-
as:
|
|
180
|
+
}), _jsx(NavItem.Menu, {
|
|
181
|
+
as: CustomLink,
|
|
184
182
|
href: "https://random-website.com/",
|
|
185
183
|
children: "Cache"
|
|
186
184
|
})]
|
|
187
|
-
}), (
|
|
188
|
-
as:
|
|
185
|
+
}), _jsx(NavItem.Menu, {
|
|
186
|
+
as: CustomLink,
|
|
189
187
|
href: "https://random-website.com/",
|
|
190
188
|
renderIcon: function renderIcon(size) {
|
|
191
|
-
return (
|
|
189
|
+
return _jsx(BiCodeAlt, {
|
|
192
190
|
size: size
|
|
193
191
|
});
|
|
194
192
|
},
|
|
195
193
|
children: "Code [v]"
|
|
196
|
-
}), (
|
|
197
|
-
as:
|
|
194
|
+
}), _jsx(NavItem.Menu, {
|
|
195
|
+
as: CustomLink,
|
|
198
196
|
href: "https://random-website.com/",
|
|
199
197
|
renderIcon: function renderIcon(size) {
|
|
200
|
-
return (
|
|
198
|
+
return _jsx(BiData, {
|
|
201
199
|
size: size
|
|
202
200
|
});
|
|
203
201
|
},
|
|
204
202
|
children: "Database [v]"
|
|
205
|
-
}), (
|
|
206
|
-
as:
|
|
203
|
+
}), _jsx(NavItem.Menu, {
|
|
204
|
+
as: CustomLink,
|
|
207
205
|
href: "https://random-website.com/",
|
|
208
206
|
renderIcon: function renderIcon(size) {
|
|
209
|
-
return (
|
|
207
|
+
return _jsx(MdOutlinePhotoLibrary, {
|
|
210
208
|
size: size
|
|
211
209
|
});
|
|
212
210
|
},
|
|
213
211
|
children: "Media [v]"
|
|
214
|
-
}), (
|
|
215
|
-
as:
|
|
212
|
+
}), _jsx(NavItem.Menu, {
|
|
213
|
+
as: CustomLink,
|
|
216
214
|
href: "https://random-website.com/",
|
|
217
215
|
renderIcon: function renderIcon(size) {
|
|
218
|
-
return (
|
|
216
|
+
return _jsx(BiBell, {
|
|
219
217
|
size: size
|
|
220
218
|
});
|
|
221
219
|
},
|
|
222
220
|
children: "Notifications"
|
|
223
|
-
}), (
|
|
224
|
-
as:
|
|
221
|
+
}), _jsx(NavItem.Menu, {
|
|
222
|
+
as: CustomLink,
|
|
225
223
|
href: "https://random-website.com/",
|
|
226
224
|
renderIcon: function renderIcon(size) {
|
|
227
|
-
return (
|
|
225
|
+
return _jsx(BiBulb, {
|
|
228
226
|
size: size
|
|
229
227
|
});
|
|
230
228
|
},
|
|
@@ -234,24 +232,24 @@ var Menu = exports.Menu = {
|
|
|
234
232
|
});
|
|
235
233
|
}
|
|
236
234
|
};
|
|
237
|
-
var MenuInverse =
|
|
235
|
+
export var MenuInverse = {
|
|
238
236
|
render: function render() {
|
|
239
|
-
return (
|
|
240
|
-
children: [(
|
|
241
|
-
children: [(
|
|
237
|
+
return _jsxs(_Fragment, {
|
|
238
|
+
children: [_jsxs("p", {
|
|
239
|
+
children: [_jsx("strong", {
|
|
242
240
|
children: "Variant: Menu"
|
|
243
241
|
}), ". This menu takes full width by default. You can put it in a container with constrained width.."]
|
|
244
|
-
}), (
|
|
242
|
+
}), _jsxs(Nav.Toolbar, {
|
|
245
243
|
label: "Main",
|
|
246
244
|
orientation: "vertical",
|
|
247
|
-
children: [(
|
|
245
|
+
children: [_jsx(NavItem.MenuInverse, {
|
|
248
246
|
active: true,
|
|
249
247
|
href: "https://googles.com",
|
|
250
|
-
as:
|
|
248
|
+
as: CustomLink,
|
|
251
249
|
children: "My Applications"
|
|
252
|
-
}), (
|
|
250
|
+
}), _jsx(NavItem.MenuInverse, {
|
|
253
251
|
href: "https://google.com",
|
|
254
|
-
as:
|
|
252
|
+
as: CustomLink,
|
|
255
253
|
children: "Custom Link"
|
|
256
254
|
})]
|
|
257
255
|
})]
|
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = require("@testing-library/react");
|
|
4
|
-
var _jestAxe = require("jest-axe");
|
|
5
|
-
var _themeUi = require("theme-ui");
|
|
6
|
-
var _Nav = require("./Nav");
|
|
7
|
-
var _NavItem = require("./NavItem");
|
|
8
|
-
var _ = require("../");
|
|
9
|
-
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
10
1
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
11
2
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
|
+
/** @jsxImportSource theme-ui */
|
|
5
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
6
|
+
// @ts-nocheck
|
|
13
7
|
/**
|
|
14
8
|
* External dependencies
|
|
15
|
-
*/
|
|
9
|
+
*/
|
|
10
|
+
import { render, screen } from '@testing-library/react';
|
|
11
|
+
import { axe } from 'jest-axe';
|
|
12
|
+
import { ThemeUIProvider } from 'theme-ui';
|
|
13
|
+
|
|
14
|
+
/**
|
|
16
15
|
* Internal dependencies
|
|
17
16
|
*/
|
|
17
|
+
import { Nav } from './Nav';
|
|
18
|
+
import { NavItem } from './NavItem';
|
|
19
|
+
import { Link, theme } from '../';
|
|
20
|
+
import { jsx as _jsx } from "theme-ui/jsx-runtime";
|
|
21
|
+
import { jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
18
22
|
var renderWithTheme = function renderWithTheme(children) {
|
|
19
|
-
return
|
|
20
|
-
theme:
|
|
23
|
+
return render(_jsx(ThemeUIProvider, {
|
|
24
|
+
theme: theme,
|
|
21
25
|
children: children
|
|
22
26
|
}));
|
|
23
27
|
};
|
|
24
28
|
var renderComponent = function renderComponent() {
|
|
25
|
-
return renderWithTheme((
|
|
29
|
+
return renderWithTheme(_jsxs(Nav.Primary, {
|
|
26
30
|
variant: "primary",
|
|
27
31
|
label: "Main",
|
|
28
|
-
children: [(
|
|
29
|
-
as:
|
|
32
|
+
children: [_jsx(NavItem.Primary, {
|
|
33
|
+
as: Link,
|
|
30
34
|
href: "#",
|
|
31
35
|
children: "PHP"
|
|
32
|
-
}), (
|
|
33
|
-
as:
|
|
36
|
+
}), _jsx(NavItem.Primary, {
|
|
37
|
+
as: Link,
|
|
34
38
|
href: "https://wordpress.com",
|
|
35
39
|
children: "WordPress"
|
|
36
|
-
}), (
|
|
37
|
-
as:
|
|
40
|
+
}), _jsx(NavItem.Primary, {
|
|
41
|
+
as: Link,
|
|
38
42
|
active: true,
|
|
39
43
|
href: "https://newrelic.com/",
|
|
40
44
|
children: "New Relic"
|
|
41
|
-
}), (
|
|
42
|
-
as:
|
|
45
|
+
}), _jsx(NavItem.Primary, {
|
|
46
|
+
as: Link,
|
|
43
47
|
disabled: true,
|
|
44
48
|
href: "https://google.com/",
|
|
45
49
|
children: "Not accessible"
|
|
@@ -53,18 +57,18 @@ describe('<Nav />', function () {
|
|
|
53
57
|
while (1) switch (_context.prev = _context.next) {
|
|
54
58
|
case 0:
|
|
55
59
|
_renderComponent = renderComponent(), container = _renderComponent.container; // Should find the nav label
|
|
56
|
-
expect(
|
|
60
|
+
expect(screen.getByLabelText('Main')).toBeInTheDocument();
|
|
57
61
|
|
|
58
62
|
// Should find all links
|
|
59
|
-
expect(
|
|
60
|
-
expect(
|
|
61
|
-
expect(
|
|
62
|
-
expect(
|
|
63
|
+
expect(screen.queryByText('PHP')).toBeInTheDocument();
|
|
64
|
+
expect(screen.queryByText('WordPress')).toBeInTheDocument();
|
|
65
|
+
expect(screen.queryByText('New Relic')).toBeInTheDocument();
|
|
66
|
+
expect(screen.queryByText('Not accessible')).toHaveAttribute('aria-disabled', 'true');
|
|
63
67
|
|
|
64
68
|
// Check for accessibility issues
|
|
65
69
|
_context.t0 = expect;
|
|
66
70
|
_context.next = 9;
|
|
67
|
-
return
|
|
71
|
+
return axe(container);
|
|
68
72
|
case 9:
|
|
69
73
|
_context.t1 = _context.sent;
|
|
70
74
|
(0, _context.t0)(_context.t1).toHaveNoViolations();
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.NavRawLink = exports.NavItem = exports.NAV_ITEM_ICON_SIZE = exports.ItemToolbar = exports.ItemTab = exports.ItemPrimary = exports.ItemMenuInverse = exports.ItemMenu = exports.ItemBreadcrumb = void 0;
|
|
5
|
-
var NavigationMenu = _interopRequireWildcard(require("@radix-ui/react-navigation-menu"));
|
|
6
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _Nav = require("./Nav");
|
|
9
|
-
var _NavItemGroup = require("./NavItemGroup");
|
|
10
|
-
var _styles = require("./styles");
|
|
11
|
-
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
12
1
|
var _excluded = ["children", "sx", "active", "orientation", "variant", "className"],
|
|
13
2
|
_excluded2 = ["className", "children", "active", "variant", "orientation"],
|
|
14
3
|
_excluded3 = ["children", "as", "renderIcon", "href", "active", "disabled", "variant", "sx"];
|
|
15
|
-
/** @jsxImportSource theme-ui */
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
19
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
20
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
/** @jsxImportSource theme-ui */
|
|
7
|
+
|
|
8
|
+
import * as NavigationMenu from '@radix-ui/react-navigation-menu';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import { forwardRef } from 'react';
|
|
11
|
+
import { VIP_NAV } from './Nav';
|
|
12
|
+
import { IconContainer, ItemGroupMenu } from './NavItemGroup';
|
|
13
|
+
import { navItemLinkStyles, navItemStyles } from './styles';
|
|
14
|
+
import { jsx as _jsx } from "theme-ui/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
16
|
+
export var NAV_ITEM_ICON_SIZE = 20;
|
|
17
|
+
var NavItemBase = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
23
18
|
var children = _ref.children,
|
|
24
19
|
_ref$sx = _ref.sx,
|
|
25
20
|
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
@@ -28,16 +23,16 @@ var NavItemBase = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
28
23
|
variant = _ref.variant,
|
|
29
24
|
className = _ref.className,
|
|
30
25
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
31
|
-
return (
|
|
32
|
-
className: (
|
|
26
|
+
return _jsx(NavigationMenu.Item, _extends({
|
|
27
|
+
className: classNames(VIP_NAV + "-item", className)
|
|
33
28
|
}, rest, {
|
|
34
29
|
"data-active": active || undefined,
|
|
35
|
-
sx: _extends({},
|
|
30
|
+
sx: _extends({}, navItemStyles(orientation, variant), sx),
|
|
36
31
|
ref: ref,
|
|
37
32
|
children: children
|
|
38
33
|
}));
|
|
39
34
|
});
|
|
40
|
-
var NavItemRoot = /*#__PURE__*/
|
|
35
|
+
var NavItemRoot = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
41
36
|
var className = _ref2.className,
|
|
42
37
|
children = _ref2.children,
|
|
43
38
|
active = _ref2.active,
|
|
@@ -45,12 +40,12 @@ var NavItemRoot = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
45
40
|
variant = _ref2$variant === void 0 ? 'primary' : _ref2$variant,
|
|
46
41
|
orientation = _ref2.orientation,
|
|
47
42
|
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
48
|
-
return (
|
|
43
|
+
return _jsx(NavItemBase, {
|
|
49
44
|
className: className,
|
|
50
45
|
orientation: orientation,
|
|
51
46
|
active: active,
|
|
52
47
|
variant: variant,
|
|
53
|
-
children: (
|
|
48
|
+
children: _jsx(NavLink, _extends({
|
|
54
49
|
variant: variant,
|
|
55
50
|
ref: ref,
|
|
56
51
|
active: active
|
|
@@ -59,14 +54,14 @@ var NavItemRoot = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
59
54
|
}))
|
|
60
55
|
});
|
|
61
56
|
});
|
|
62
|
-
var NavRawLink =
|
|
57
|
+
export var NavRawLink = /*#__PURE__*/forwardRef(
|
|
63
58
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
64
59
|
function (props, ref) {
|
|
65
|
-
return (
|
|
60
|
+
return _jsx("a", _extends({}, props, {
|
|
66
61
|
ref: ref
|
|
67
62
|
}));
|
|
68
63
|
});
|
|
69
|
-
var NavLink = /*#__PURE__*/
|
|
64
|
+
var NavLink = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
70
65
|
var children = _ref3.children,
|
|
71
66
|
_ref3$as = _ref3.as,
|
|
72
67
|
LinkComponent = _ref3$as === void 0 ? NavRawLink : _ref3$as,
|
|
@@ -79,64 +74,64 @@ var NavLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
|
|
|
79
74
|
_ref3$sx = _ref3.sx,
|
|
80
75
|
sx = _ref3$sx === void 0 ? {} : _ref3$sx,
|
|
81
76
|
rest = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
82
|
-
return (
|
|
83
|
-
className: (
|
|
77
|
+
return _jsx(NavigationMenu.Link, _extends({
|
|
78
|
+
className: classNames(VIP_NAV + "-item-link"),
|
|
84
79
|
ref: ref,
|
|
85
|
-
sx: _extends({},
|
|
80
|
+
sx: _extends({}, navItemLinkStyles(variant), sx),
|
|
86
81
|
href: href,
|
|
87
82
|
"data-active": active || undefined,
|
|
88
83
|
"aria-current": active ? 'page' : undefined,
|
|
89
84
|
"aria-disabled": disabled,
|
|
90
85
|
asChild: true
|
|
91
86
|
}, rest, {
|
|
92
|
-
children: (
|
|
93
|
-
children: [renderIcon ? (
|
|
87
|
+
children: _jsxs(LinkComponent, {
|
|
88
|
+
children: [renderIcon ? _jsx(IconContainer, {
|
|
94
89
|
children: renderIcon(NAV_ITEM_ICON_SIZE)
|
|
95
90
|
}) : null, children]
|
|
96
91
|
})
|
|
97
92
|
}));
|
|
98
93
|
});
|
|
99
|
-
var ItemPrimary =
|
|
100
|
-
return (
|
|
94
|
+
export var ItemPrimary = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
95
|
+
return _jsx(NavItemRoot, _extends({
|
|
101
96
|
variant: "primary",
|
|
102
97
|
ref: ref
|
|
103
98
|
}, props));
|
|
104
99
|
});
|
|
105
|
-
var ItemBreadcrumb =
|
|
106
|
-
return (
|
|
100
|
+
export var ItemBreadcrumb = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
101
|
+
return _jsx(NavItemRoot, _extends({
|
|
107
102
|
variant: "breadcrumbs",
|
|
108
103
|
ref: ref
|
|
109
104
|
}, props));
|
|
110
105
|
});
|
|
111
|
-
var ItemTab =
|
|
112
|
-
return (
|
|
106
|
+
export var ItemTab = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
107
|
+
return _jsx(NavItemRoot, _extends({
|
|
113
108
|
variant: "tabs",
|
|
114
109
|
ref: ref
|
|
115
110
|
}, props));
|
|
116
111
|
});
|
|
117
|
-
var ItemToolbar =
|
|
118
|
-
return (
|
|
112
|
+
export var ItemToolbar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
113
|
+
return _jsx(NavItemRoot, _extends({
|
|
119
114
|
variant: "toolbar",
|
|
120
115
|
ref: ref
|
|
121
116
|
}, props));
|
|
122
117
|
});
|
|
123
|
-
var ItemMenu =
|
|
124
|
-
return (
|
|
118
|
+
export var ItemMenu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
119
|
+
return _jsx(NavItemRoot, _extends({
|
|
125
120
|
variant: "menu",
|
|
126
121
|
ref: ref
|
|
127
122
|
}, props));
|
|
128
123
|
});
|
|
129
|
-
var ItemMenuInverse =
|
|
130
|
-
return (
|
|
124
|
+
export var ItemMenuInverse = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
125
|
+
return _jsx(NavItemRoot, _extends({
|
|
131
126
|
variant: "menu-inverse",
|
|
132
127
|
ref: ref
|
|
133
128
|
}, props));
|
|
134
129
|
});
|
|
135
|
-
var NavItem =
|
|
130
|
+
export var NavItem = {
|
|
136
131
|
Primary: ItemPrimary,
|
|
137
132
|
Tab: ItemTab,
|
|
138
133
|
Toolbar: ItemToolbar,
|
|
139
134
|
Menu: ItemMenu,
|
|
140
|
-
MenuGroup:
|
|
135
|
+
MenuGroup: ItemGroupMenu,
|
|
141
136
|
MenuInverse: ItemMenuInverse
|
|
142
137
|
};
|