@soul-refiner/design-system 0.2.133 → 0.2.134
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
import Link from 'next/link';
|
|
4
5
|
import { Box } from '../../';
|
|
5
6
|
import { ChevronLeft, ChevronRight } from '../../../icons';
|
|
6
7
|
const Breadcrumb = ({ children, previous }) => {
|
|
@@ -28,14 +29,14 @@ const Breadcrumb = ({ children, previous }) => {
|
|
|
28
29
|
})));
|
|
29
30
|
};
|
|
30
31
|
const BreadcrumbItem = ({ avatar, children, href, icon, iconColor = 'blue', onClick, }) => {
|
|
31
|
-
return (React.createElement(Item, {
|
|
32
|
+
return (React.createElement(Item, { href: href || '#', onClick: onClick, "$type": icon ? 'icon' : avatar ? 'avatar' : 'text', "$iconColor": `hue-${iconColor}-1`, scroll: false },
|
|
32
33
|
icon && (React.createElement(IconWrapper, { "$color": iconColor }, React.cloneElement(icon, { color: `hue-${iconColor}-1`, size: 24 }))),
|
|
33
34
|
avatar,
|
|
34
35
|
children));
|
|
35
36
|
};
|
|
36
37
|
Breadcrumb.Item = BreadcrumbItem;
|
|
37
38
|
BreadcrumbItem.displayName = 'Breadcrumb.Item';
|
|
38
|
-
const Item = styled
|
|
39
|
+
const Item = styled(Link) `
|
|
39
40
|
display: flex;
|
|
40
41
|
flex-flow: row nowrap;
|
|
41
42
|
align-items: center;
|
|
@@ -9,7 +9,7 @@ declare const InnerNav: {
|
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
|
11
11
|
Dropdown: {
|
|
12
|
-
({ children,
|
|
12
|
+
({ children, icon, label, open, sx, onClick, }: InnerNavDropdownProps): React.JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
BackButton: {
|
|
@@ -63,7 +63,6 @@ export interface InnerNavItemProps {
|
|
|
63
63
|
* Dropdown
|
|
64
64
|
*/
|
|
65
65
|
export interface InnerNavDropdownProps extends React.PropsWithChildren {
|
|
66
|
-
href?: string;
|
|
67
66
|
icon?: React.ReactElement;
|
|
68
67
|
label: React.ReactNode;
|
|
69
68
|
open: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import Link from 'next/link';
|
|
3
4
|
import { Button } from '../../../components/actions/button';
|
|
4
5
|
import { Drawer } from '../../../components/surfaces/drawer';
|
|
5
6
|
import { ChevronDown, ChevronLeft, ChevronUp, Plus } from '../../../icons';
|
|
@@ -53,12 +54,11 @@ const NavWrapper = styled.nav `
|
|
|
53
54
|
border-right: 1px solid var(--color-grey-9);
|
|
54
55
|
`;
|
|
55
56
|
const InnerNavItem = ({ active, href, icon, label, sx }) => {
|
|
56
|
-
|
|
57
|
-
return (React.createElement(Item, { "$active": active, "$sx": sx, as: isAnchor ? 'a' : 'button', href: href },
|
|
57
|
+
return (React.createElement(Item, { "$active": active, "$sx": sx, href: href || '#', scroll: false },
|
|
58
58
|
icon,
|
|
59
59
|
label));
|
|
60
60
|
};
|
|
61
|
-
const Item = styled
|
|
61
|
+
const Item = styled(Link) `
|
|
62
62
|
padding: 14px 16px;
|
|
63
63
|
display: flex;
|
|
64
64
|
gap: 16px;
|
|
@@ -85,10 +85,9 @@ const Item = styled.button `
|
|
|
85
85
|
`;
|
|
86
86
|
InnerNav.Item = InnerNavItem;
|
|
87
87
|
InnerNavItem.displayName = 'InnerNav.Item';
|
|
88
|
-
const InnerNavDropdown = ({ children,
|
|
89
|
-
const isAnchor = !!href;
|
|
88
|
+
const InnerNavDropdown = ({ children, icon, label, open, sx, onClick, }) => {
|
|
90
89
|
return (React.createElement(React.Fragment, null,
|
|
91
|
-
React.createElement(
|
|
90
|
+
React.createElement(DropdownItem, { "$active": false, "$sx": sx, onClick: onClick },
|
|
92
91
|
icon,
|
|
93
92
|
React.createElement(DropdownTriggerWrapper, null,
|
|
94
93
|
label,
|
|
@@ -108,15 +107,40 @@ const DropdownTriggerWrapper = styled.div `
|
|
|
108
107
|
align-items: center;
|
|
109
108
|
flex: 1;
|
|
110
109
|
`;
|
|
110
|
+
const DropdownItem = styled.a `
|
|
111
|
+
padding: 14px 16px;
|
|
112
|
+
display: flex;
|
|
113
|
+
gap: 16px;
|
|
114
|
+
align-items: center;
|
|
115
|
+
border-radius: 8px;
|
|
116
|
+
font-family: var(--font-inter);
|
|
117
|
+
font-weight: 500;
|
|
118
|
+
font-size: 16px;
|
|
119
|
+
line-height: 24px;
|
|
120
|
+
color: var(--color-blue-2);
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
svg {
|
|
123
|
+
fill: var(--color-blue-2);
|
|
124
|
+
}
|
|
125
|
+
${({ $active }) => $active
|
|
126
|
+
? `
|
|
127
|
+
background-color: var(--color-primary-blue-3);`
|
|
128
|
+
: `
|
|
129
|
+
&:hover {
|
|
130
|
+
background-color: var(--color-primary-blue-4);
|
|
131
|
+
}`}
|
|
132
|
+
|
|
133
|
+
${({ $sx }) => ($sx ? $sx : '')}
|
|
134
|
+
`;
|
|
111
135
|
InnerNav.Dropdown = InnerNavDropdown;
|
|
112
136
|
InnerNavDropdown.displayName = 'InnerNav.Dropdown';
|
|
113
137
|
const InnerNavBackButton = ({ href, label, sx }) => {
|
|
114
|
-
return (React.createElement(BackButton, { href: href, "$sx": sx },
|
|
138
|
+
return (React.createElement(BackButton, { href: href, "$sx": sx, scroll: false },
|
|
115
139
|
React.createElement("div", null,
|
|
116
140
|
React.createElement(ChevronLeft, { size: 24 })),
|
|
117
141
|
label));
|
|
118
142
|
};
|
|
119
|
-
const BackButton = styled
|
|
143
|
+
const BackButton = styled(Link) `
|
|
120
144
|
display: flex;
|
|
121
145
|
align-items: center;
|
|
122
146
|
gap: 8px;
|