@soul-refiner/design-system 0.2.133 → 0.2.135
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/components/navigation/breadcrumb/breadcrumb.js +3 -2
- package/dist/components/navigation/inner/inner.d.ts +1 -2
- package/dist/components/navigation/inner/inner.js +32 -8
- package/dist/components/surfaces/calendar_date/calendar_date.d.ts +2 -1
- package/dist/components/surfaces/calendar_date/calendar_date.js +14 -9
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -6,5 +6,6 @@ export interface CalendarDateProps {
|
|
|
6
6
|
startTime?: string;
|
|
7
7
|
endTime?: string;
|
|
8
8
|
sx?: string;
|
|
9
|
+
size?: 'small' | 'large';
|
|
9
10
|
}
|
|
10
|
-
export declare const CalendarDate: ({ monthAbbreviation, date, dayOfWeek, startTime, endTime, sx, }: CalendarDateProps) => React.JSX.Element;
|
|
11
|
+
export declare const CalendarDate: ({ monthAbbreviation, date, dayOfWeek, startTime, endTime, sx, size, }: CalendarDateProps) => React.JSX.Element;
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { H, P } from '../../atoms/typography';
|
|
5
|
-
export const CalendarDate = ({ monthAbbreviation, date, dayOfWeek, startTime, endTime, sx, }) => {
|
|
5
|
+
export const CalendarDate = ({ monthAbbreviation, date, dayOfWeek, startTime, endTime, sx, size = 'large', }) => {
|
|
6
6
|
return (React.createElement(Container, { "$sx": sx },
|
|
7
|
-
React.createElement(CalendarContainer,
|
|
8
|
-
React.createElement(MonthContainer,
|
|
9
|
-
React.createElement(H.Seven, { "$color": "white", "$textAlign": "center",
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
React.createElement(CalendarContainer, { "$size": size },
|
|
8
|
+
React.createElement(MonthContainer, { "$size": size },
|
|
9
|
+
size === 'large' && (React.createElement(H.Seven, { "$color": "white", "$textAlign": "center", "$semiBold": true }, monthAbbreviation)),
|
|
10
|
+
size === 'small' && (React.createElement(P, { "$color": "white", "$textAlign": "center", "$fontSize": 14 }, monthAbbreviation))),
|
|
11
|
+
React.createElement(DateContainer, { "$size": size },
|
|
12
|
+
size === 'large' && (React.createElement(H.One, { "$textAlign": "center", "$semiBold": true }, date)),
|
|
13
|
+
size === 'small' && (React.createElement(H.Six, { "$color": "grey-2", "$textAlign": "center" }, date)))),
|
|
12
14
|
dayOfWeek && startTime && endTime && (React.createElement(TimeContainer, null,
|
|
13
15
|
React.createElement(P, { as: "span", "$color": "red-5" }, `${dayOfWeek}, ${startTime} -> ${endTime}`)))));
|
|
14
16
|
};
|
|
@@ -22,18 +24,21 @@ const Container = styled.div `
|
|
|
22
24
|
const CalendarContainer = styled.div `
|
|
23
25
|
display: flex;
|
|
24
26
|
flex-direction: column;
|
|
25
|
-
|
|
27
|
+
|
|
28
|
+
${({ $size }) => ($size === 'large' ? 'width: 120px;' : 'width: 64px;')}
|
|
26
29
|
`;
|
|
27
30
|
const MonthContainer = styled.div `
|
|
28
|
-
padding: 8px 16px;
|
|
29
31
|
background-color: var(--color-red-5);
|
|
30
32
|
border-radius: 16px 16px 0 0;
|
|
33
|
+
|
|
34
|
+
${({ $size }) => $size === 'large' ? 'padding: 8px 16px;' : 'padding: 2px 8px;'}
|
|
31
35
|
`;
|
|
32
36
|
const DateContainer = styled.div `
|
|
33
|
-
padding: 8px 16px;
|
|
34
37
|
background-color: white;
|
|
35
38
|
border-radius: 0 0 16px 16px;
|
|
36
39
|
box-shadow: var(--elevation-3);
|
|
40
|
+
|
|
41
|
+
${({ $size }) => $size === 'large' ? 'padding: 8px 16px;' : 'padding: 2px 16px;'}
|
|
37
42
|
`;
|
|
38
43
|
const TimeContainer = styled.div `
|
|
39
44
|
margin-top: 16px;
|