oneslash-design-system 1.1.13 → 1.1.14
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/components/menuItem.tsx +4 -4
- package/components/tab.tsx +6 -6
- package/components/tabsContainer.tsx +23 -0
- package/dist/components/menuItem.d.ts +4 -2
- package/dist/components/menuItem.jsx +4 -3
- package/dist/components/tab.jsx +5 -5
- package/dist/components/tabsContainer.d.ts +6 -0
- package/dist/components/tabsContainer.jsx +9 -0
- package/dist/output.css +22 -15
- package/package.json +1 -1
package/components/menuItem.tsx
CHANGED
|
@@ -64,10 +64,10 @@ export default function MenuItem({
|
|
|
64
64
|
>
|
|
65
65
|
{/* render userImage. render dynamic icon if userImage is not available */}
|
|
66
66
|
{userImgUrl || userHandle ? (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
<UserImage userHandle={userHandle || ''} userImgUrl={userImgUrl || ''} />
|
|
68
|
+
) : (
|
|
69
|
+
IconLeft && <IconLeft className="w-6 h-6" />
|
|
70
|
+
)}
|
|
71
71
|
|
|
72
72
|
{/* label */}
|
|
73
73
|
<span className="whitespace-nowrap text-body1 px-2 text-light-text-primary dark:text-dark-text-primary">
|
package/components/tab.tsx
CHANGED
|
@@ -64,20 +64,20 @@ export default function Tab({
|
|
|
64
64
|
return (
|
|
65
65
|
<div
|
|
66
66
|
className={`
|
|
67
|
-
flex items-center space-x-1
|
|
67
|
+
flex items-center space-x-1 py-1 px-[6px] rounded-[8px] cursor-pointer justify-start transition-all duration-300 ease-in-out
|
|
68
68
|
${isSelected
|
|
69
|
-
? 'bg-light-primary-
|
|
70
|
-
: '
|
|
69
|
+
? 'bg-light-primary-dark dark:bg-dark-primary-dark text-light-text-contrast dark:text-dark-text-contrast'
|
|
70
|
+
: 'hover:bg-light-background-accent200 dark:hover:bg-dark-background-accent200'}
|
|
71
71
|
`}
|
|
72
72
|
onClick={handleClick}
|
|
73
73
|
>
|
|
74
|
-
{IconLeft && <IconLeft className="w-
|
|
75
|
-
<span className="whitespace-nowrap text-body1 px-
|
|
74
|
+
{IconLeft && <IconLeft className="w-6 h-6" />}
|
|
75
|
+
<span className="whitespace-nowrap text-body1 px-[6px]">
|
|
76
76
|
{label}
|
|
77
77
|
</span>
|
|
78
78
|
{IconRight && (
|
|
79
79
|
<div onClick={onClickActionIcon} className="cursor-pointer">
|
|
80
|
-
<IconRight className="w-
|
|
80
|
+
<IconRight className="w-6 h-6" />
|
|
81
81
|
</div>
|
|
82
82
|
)}
|
|
83
83
|
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface TabsContainerProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function TabsContainer({
|
|
9
|
+
children,
|
|
10
|
+
}: TabsContainerProps) {
|
|
11
|
+
const tabCount = React.Children.count(children);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
className={`
|
|
16
|
+
flex space-x-2 p-1 rounded-[12px]
|
|
17
|
+
${tabCount > 0 ? 'bg-light-background-accent200 dark:bg-dark-background-accent200' : 'bg-transparent'}
|
|
18
|
+
`}
|
|
19
|
+
>
|
|
20
|
+
{children}
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -2,9 +2,11 @@ import React from 'react';
|
|
|
2
2
|
interface MenuItemProps {
|
|
3
3
|
href?: string;
|
|
4
4
|
iconName?: string;
|
|
5
|
+
userHandle?: string;
|
|
6
|
+
userImgUrl?: string;
|
|
5
7
|
label: string;
|
|
6
8
|
isSelected?: boolean;
|
|
7
|
-
onClick
|
|
9
|
+
onClick?: any;
|
|
8
10
|
}
|
|
9
|
-
export default function MenuItem({ href, iconName, label, isSelected, onClick, }: MenuItemProps): React.JSX.Element;
|
|
11
|
+
export default function MenuItem({ href, iconName, userHandle, userImgUrl, label, isSelected, onClick, }: MenuItemProps): React.JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -37,10 +37,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
import React, { useState, useEffect, useCallback } from 'react';
|
|
39
39
|
import NextLink from 'next/link';
|
|
40
|
+
import UserImage from './userImage';
|
|
40
41
|
export default function MenuItem(_a) {
|
|
41
42
|
var _this = this;
|
|
42
|
-
var _b = _a.href, href = _b === void 0 ? '#' : _b, iconName = _a.iconName, label = _a.label, isSelected = _a.isSelected, onClick = _a.onClick;
|
|
43
|
-
var _c = useState(null),
|
|
43
|
+
var _b = _a.href, href = _b === void 0 ? '#' : _b, iconName = _a.iconName, userHandle = _a.userHandle, userImgUrl = _a.userImgUrl, label = _a.label, isSelected = _a.isSelected, onClick = _a.onClick;
|
|
44
|
+
var _c = useState(null), IconLeft = _c[0], setIconLeft = _c[1];
|
|
44
45
|
// Import icon dynamically
|
|
45
46
|
var loadIcon = useCallback(function (iconName) { return __awaiter(_this, void 0, void 0, function () {
|
|
46
47
|
var module_1, IconComponent, error_1;
|
|
@@ -72,7 +73,7 @@ export default function MenuItem(_a) {
|
|
|
72
73
|
switch (_b.label) {
|
|
73
74
|
case 0:
|
|
74
75
|
if (!iconName) return [3 /*break*/, 2];
|
|
75
|
-
_a =
|
|
76
|
+
_a = setIconLeft;
|
|
76
77
|
return [4 /*yield*/, loadIcon(iconName)];
|
|
77
78
|
case 1:
|
|
78
79
|
_a.apply(void 0, [_b.sent()]);
|
package/dist/components/tab.jsx
CHANGED
|
@@ -99,15 +99,15 @@ export default function Tab(_a) {
|
|
|
99
99
|
router.push(href);
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
-
return (<div className={"\n flex items-center space-x-1
|
|
102
|
+
return (<div className={"\n flex items-center space-x-1 py-1 px-[6px] rounded-[8px] cursor-pointer justify-start transition-all duration-300 ease-in-out\n ".concat(isSelected
|
|
103
103
|
? 'bg-light-primary-dark dark:bg-dark-primary-dark text-light-text-contrast dark:text-dark-text-contrast'
|
|
104
|
-
: '
|
|
105
|
-
{IconLeft && <IconLeft className="w-
|
|
106
|
-
<span className="whitespace-nowrap text-body1 px-
|
|
104
|
+
: 'hover:bg-light-background-accent200 dark:hover:bg-dark-background-accent200', "\n ")} onClick={handleClick}>
|
|
105
|
+
{IconLeft && <IconLeft className="w-6 h-6"/>}
|
|
106
|
+
<span className="whitespace-nowrap text-body1 px-[6px]">
|
|
107
107
|
{label}
|
|
108
108
|
</span>
|
|
109
109
|
{IconRight && (<div onClick={onClickActionIcon} className="cursor-pointer">
|
|
110
|
-
<IconRight className="w-
|
|
110
|
+
<IconRight className="w-6 h-6"/>
|
|
111
111
|
</div>)}
|
|
112
112
|
</div>);
|
|
113
113
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export default function TabsContainer(_a) {
|
|
4
|
+
var children = _a.children;
|
|
5
|
+
var tabCount = React.Children.count(children);
|
|
6
|
+
return (<div className={"\n flex space-x-2 p-1 rounded-[12px]\n ".concat(tabCount > 0 ? 'bg-light-background-accent200 dark:bg-dark-background-accent200' : 'bg-transparent', "\n ")}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>);
|
|
9
|
+
}
|
package/dist/output.css
CHANGED
|
@@ -698,6 +698,9 @@ video {
|
|
|
698
698
|
.rounded {
|
|
699
699
|
border-radius: 0.25rem;
|
|
700
700
|
}
|
|
701
|
+
.rounded-\[12px\] {
|
|
702
|
+
border-radius: 12px;
|
|
703
|
+
}
|
|
701
704
|
.rounded-\[8px\] {
|
|
702
705
|
border-radius: 8px;
|
|
703
706
|
}
|
|
@@ -755,10 +758,6 @@ video {
|
|
|
755
758
|
--tw-bg-opacity: 1;
|
|
756
759
|
background-color: rgb(238 174 3 / var(--tw-bg-opacity));
|
|
757
760
|
}
|
|
758
|
-
.bg-light-action-selected {
|
|
759
|
-
--tw-bg-opacity: 1;
|
|
760
|
-
background-color: rgb(227 227 227 / var(--tw-bg-opacity));
|
|
761
|
-
}
|
|
762
761
|
.bg-light-actionBackground-disabled {
|
|
763
762
|
--tw-bg-opacity: 1;
|
|
764
763
|
background-color: rgb(238 238 238 / var(--tw-bg-opacity));
|
|
@@ -783,6 +782,10 @@ video {
|
|
|
783
782
|
--tw-bg-opacity: 1;
|
|
784
783
|
background-color: rgb(0 135 212 / var(--tw-bg-opacity));
|
|
785
784
|
}
|
|
785
|
+
.bg-light-primary-dark {
|
|
786
|
+
--tw-bg-opacity: 1;
|
|
787
|
+
background-color: rgb(38 38 38 / var(--tw-bg-opacity));
|
|
788
|
+
}
|
|
786
789
|
.bg-light-primary-main {
|
|
787
790
|
--tw-bg-opacity: 1;
|
|
788
791
|
background-color: rgb(69 69 69 / var(--tw-bg-opacity));
|
|
@@ -824,6 +827,10 @@ video {
|
|
|
824
827
|
padding-left: 0.5rem;
|
|
825
828
|
padding-right: 0.5rem;
|
|
826
829
|
}
|
|
830
|
+
.px-\[6px\] {
|
|
831
|
+
padding-left: 6px;
|
|
832
|
+
padding-right: 6px;
|
|
833
|
+
}
|
|
827
834
|
.py-1 {
|
|
828
835
|
padding-top: 0.25rem;
|
|
829
836
|
padding-bottom: 0.25rem;
|
|
@@ -988,14 +995,14 @@ body {
|
|
|
988
995
|
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
|
989
996
|
}
|
|
990
997
|
|
|
991
|
-
.hover\:bg-light-background-
|
|
998
|
+
.hover\:bg-light-background-accent200:hover {
|
|
992
999
|
--tw-bg-opacity: 1;
|
|
993
|
-
background-color: rgb(
|
|
1000
|
+
background-color: rgb(250 250 250 / var(--tw-bg-opacity));
|
|
994
1001
|
}
|
|
995
1002
|
|
|
996
|
-
.hover\:bg-light-background-
|
|
1003
|
+
.hover\:bg-light-background-accent300:hover {
|
|
997
1004
|
--tw-bg-opacity: 1;
|
|
998
|
-
background-color: rgb(
|
|
1005
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
999
1006
|
}
|
|
1000
1007
|
|
|
1001
1008
|
.hover\:bg-light-primary-dark:hover {
|
|
@@ -1034,11 +1041,6 @@ body {
|
|
|
1034
1041
|
background-color: rgb(255 205 41 / var(--tw-bg-opacity));
|
|
1035
1042
|
}
|
|
1036
1043
|
|
|
1037
|
-
.dark\:bg-dark-action-selected {
|
|
1038
|
-
--tw-bg-opacity: 1;
|
|
1039
|
-
background-color: rgb(78 78 78 / var(--tw-bg-opacity));
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
1044
|
.dark\:bg-dark-actionBackground-disabled {
|
|
1043
1045
|
--tw-bg-opacity: 1;
|
|
1044
1046
|
background-color: rgb(56 56 56 / var(--tw-bg-opacity));
|
|
@@ -1069,6 +1071,11 @@ body {
|
|
|
1069
1071
|
background-color: rgb(0 175 255 / var(--tw-bg-opacity));
|
|
1070
1072
|
}
|
|
1071
1073
|
|
|
1074
|
+
.dark\:bg-dark-primary-dark {
|
|
1075
|
+
--tw-bg-opacity: 1;
|
|
1076
|
+
background-color: rgb(233 233 233 / var(--tw-bg-opacity));
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1072
1079
|
.dark\:bg-dark-primary-main {
|
|
1073
1080
|
--tw-bg-opacity: 1;
|
|
1074
1081
|
background-color: rgb(213 213 213 / var(--tw-bg-opacity));
|
|
@@ -1138,9 +1145,9 @@ body {
|
|
|
1138
1145
|
background-color: rgb(78 78 78 / var(--tw-bg-opacity));
|
|
1139
1146
|
}
|
|
1140
1147
|
|
|
1141
|
-
.dark\:hover\:bg-dark-
|
|
1148
|
+
.dark\:hover\:bg-dark-background-accent200:hover {
|
|
1142
1149
|
--tw-bg-opacity: 1;
|
|
1143
|
-
background-color: rgb(
|
|
1150
|
+
background-color: rgb(69 69 69 / var(--tw-bg-opacity));
|
|
1144
1151
|
}
|
|
1145
1152
|
|
|
1146
1153
|
.dark\:hover\:bg-dark-background-accent300:hover {
|