Skip to content

Commit c5f8b44

Browse files
authored
fix: datatable loader and sidebar style issues (#303)
* fix: skeleton loading color * fix: remove profile from sidebar * refactor: use forwaredRef in sidebar * fix: remove icon heigth and width * fix: example
1 parent f3fbc30 commit c5f8b44

File tree

4 files changed

+197
-223
lines changed

4 files changed

+197
-223
lines changed

apps/www/examples/shield-ts/shield.tsx

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
TimerIcon,
1515
} from "@radix-ui/react-icons";
1616
import { useRouter } from "next/navigation";
17-
import { Flex, Image, Sidebar } from "@raystack/apsara/v1";
17+
import { Avatar, Flex, Image, Sidebar } from "@raystack/apsara/v1";
1818
import { Assets } from "./assets";
1919

2020
import "@raystack/apsara/style.css";
@@ -26,40 +26,58 @@ export const Shield = () => {
2626
return (
2727
<>
2828
<Flex style={{ height: "100vh" }}>
29-
<div style={{ position: 'relative' }}>
29+
<div style={{ position: "relative" }}>
3030
<Sidebar
31-
open={sidebarOpen}
32-
onOpenChange={setSidebarOpen}
31+
open={sidebarOpen}
32+
onOpenChange={setSidebarOpen}
3333
position="left"
34-
profile={{
35-
icon: <DotsVerticalIcon />,
36-
37-
href: "#"
38-
}}
3934
>
4035
<Sidebar.Header
41-
logo={<Image radius="small" src="/thenorthface-logo.svg" width={24} height={24} />}
36+
logo={
37+
<Image
38+
radius="small"
39+
src="/thenorthface-logo.svg"
40+
width={24}
41+
height={24}
42+
/>
43+
}
4244
title="THE NORTH FACE"
4345
onLogoClick={() => console.log("Logo clicked")}
4446
/>
4547
<Sidebar.Main>
4648
<Sidebar.Group name="Navigation" className="">
47-
<Sidebar.Item href="#" icon={<GitHubLogoIcon />} active>Explore</Sidebar.Item>
48-
<Sidebar.Item href="#" icon={<ImageIcon />}>AOIs</Sidebar.Item>
49-
<Sidebar.Item href="#" icon={<BookmarkFilledIcon />}>Workflows</Sidebar.Item>
50-
<Sidebar.Item href="#" icon={<MaskOnIcon />}>Marketplace</Sidebar.Item>
51-
<Sidebar.Item href="#" icon={<LinkedInLogoIcon />}>Activity</Sidebar.Item>
49+
<Sidebar.Item href="#" icon={<Avatar fallback="RM" size={3} />}>
50+
Explore
51+
</Sidebar.Item>
52+
<Sidebar.Item href="#" icon={<ImageIcon />}>
53+
AOIs
54+
</Sidebar.Item>
55+
<Sidebar.Item href="#" icon={<BookmarkFilledIcon />}>
56+
Workflows
57+
</Sidebar.Item>
58+
<Sidebar.Item href="#" icon={<MaskOnIcon />}>
59+
Marketplace
60+
</Sidebar.Item>
61+
<Sidebar.Item href="#" icon={<LinkedInLogoIcon />}>
62+
Activity
63+
</Sidebar.Item>
5264
</Sidebar.Group>
5365
</Sidebar.Main>
5466
<Sidebar.Footer>
5567
<Sidebar.Group name="Help & Support">
56-
<Sidebar.Item href="#" icon={<GlobeIcon />}>Feedback</Sidebar.Item>
57-
<Sidebar.Item href="#" icon={<LapTimerIcon />}>Support</Sidebar.Item>
58-
<Sidebar.Item href="#" icon={<InfoCircledIcon />}>Documentation</Sidebar.Item>
68+
<Sidebar.Item href="#" icon={<GlobeIcon />}>
69+
Feedback
70+
</Sidebar.Item>
71+
<Sidebar.Item href="#" icon={<LapTimerIcon />}>
72+
Support
73+
</Sidebar.Item>
74+
<Sidebar.Item href="#" icon={<InfoCircledIcon />}>
75+
Documentation
76+
</Sidebar.Item>
5977
</Sidebar.Group>
6078
</Sidebar.Footer>
6179
</Sidebar>
62-
80+
6381
{/* <button
6482
onClick={() => setSidebarOpen(!sidebarOpen)}
6583
style={{

packages/raystack/v1/components/data-table/components/content.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ function LoaderRows({
7878
<Table.Row key={"loading-row-" + rowIndex}>
7979
{columns.map((_, colIndex) => (
8080
<Table.Cell key={"loading-column-" + colIndex}>
81-
<Skeleton />
81+
<Skeleton
82+
highlightColor="var(--rs-color-background-base-primary)"
83+
baseColor="var(--rs-color-background-base-primary-hover)"
84+
/>
8285
</Table.Cell>
8386
))}
8487
</Table.Row>

packages/raystack/v1/components/sidebar/sidebar.module.css

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
display: flex;
33
width: 220px;
44
height: 100%;
5-
padding: var(--rs-space-1) var(--rs-space-3) var(--rs-space-5) var(--rs-space-3);;
5+
padding: var(--rs-space-1) var(--rs-space-3) var(--rs-space-5)
6+
var(--rs-space-3);
67
flex-direction: column;
78
justify-content: space-between;
89
align-items: flex-start;
@@ -12,19 +13,19 @@
1213
transition: width 0.2s ease;
1314
}
1415

15-
.root[data-position='left'] {
16+
.root[data-position="left"] {
1617
border-right: 1px solid var(--rs-color-border-base-primary);
1718
}
1819

19-
.root[data-position='right'] {
20+
.root[data-position="right"] {
2021
border-left: 1px solid var(--rs-color-border-base-primary);
2122
}
2223

23-
.root[data-state='expanded'] {
24+
.root[data-state="expanded"] {
2425
width: 240px;
2526
}
2627

27-
.root[data-state='collapsed'] {
28+
.root[data-state="collapsed"] {
2829
width: 48px;
2930
}
3031

@@ -90,7 +91,7 @@
9091
transition: all 0.2s ease;
9192
}
9293

93-
.root[data-state='collapsed'] .nav-item {
94+
.root[data-state="collapsed"] .nav-item {
9495
justify-content: center;
9596
}
9697

@@ -99,7 +100,7 @@
99100
color: var(--rs-color-foreground-base-primary);
100101
}
101102

102-
.nav-item[data-active='true'] {
103+
.nav-item[data-active="true"] {
103104
display: flex;
104105
padding: var(--rs-space-3);
105106
align-items: center;
@@ -110,7 +111,7 @@
110111
color: var(--rs-color-foreground-base-primary);
111112
}
112113

113-
.nav-item[data-disabled='true'] {
114+
.nav-item[data-disabled="true"] {
114115
opacity: 0.6;
115116
cursor: not-allowed;
116117
pointer-events: none;
@@ -121,8 +122,8 @@
121122
align-items: center;
122123
gap: var(--rs-space-3);
123124
align-self: stretch;
124-
width: 16px;
125-
height: 16px;
125+
width: fit-content;
126+
height: auto;
126127
flex-shrink: 0;
127128
}
128129

@@ -140,8 +141,8 @@
140141
transition: opacity 0.2s ease;
141142
}
142143

143-
.root[data-state='collapsed'] .nav-text,
144-
.root[data-state='collapsed'] .title {
144+
.root[data-state="collapsed"] .nav-text,
145+
.root[data-state="collapsed"] .title {
145146
width: 0;
146147
opacity: 0;
147148
display: none;
@@ -161,7 +162,7 @@
161162
background-color: 0.5px solid var(--rs-color-border-base-primary);
162163
}
163164

164-
.root[data-position='right'] .resizeHandle {
165+
.root[data-position="right"] .resizeHandle {
165166
left: 0;
166167
right: auto;
167168
cursor: col-resize;
@@ -186,7 +187,7 @@
186187
color: var(--rs-color-foreground-base-primary);
187188
}
188189

189-
.root[data-state='collapsed'] .account .nav-text {
190+
.root[data-state="collapsed"] .account .nav-text {
190191
opacity: 0;
191192
display: none;
192193
}
@@ -218,7 +219,7 @@
218219
gap: var(--rs-space-2);
219220
}
220221

221-
.root[data-state='collapsed'] .nav-group-name {
222+
.root[data-state="collapsed"] .nav-group-name {
222223
width: 0;
223224
opacity: 0;
224225
display: none;

0 commit comments

Comments
 (0)