Skip to content

feat: add components to examples folder and its style files #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { useState } from "react";

import { DeleteIcon, EditIcon } from "../../src/components/icons";
import { MultiLevelTable } from "../../src/components/MultiLevelTable";
import { Popup } from "../../src/components/Popup";
import { RowDetailsPopup } from "../../src/components/RowDetailsPopup";
import { SidePanel } from "../../src/components/SidePanel";
import { Popup } from "./components/Popup";
import { RowDetailsPopup } from "./components/RowDetailsPopup";
import { SidePanel } from "./components/SidePanel";
import { getStatusStyle, tableRowTypography } from "../../src/styles/style";
import { darkTheme, lightTheme } from "../../src/themes";
import type { ThemeProps } from "../../src/types/theme";
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, { useEffect } from 'react';

import { DetailRow } from './DetailRow';
import { getStatusStyle, tableRowTypography } from '../styles/style';
import type { ThemeProps } from '../types/theme';
import type { DataItem } from '../types/types';

import type { ThemeProps } from '../types/theme';
import { getStatusStyle, tableRowTypography } from '../styles/style';
import '../styles/RowDetailsPopup.css';

interface RowDetailsPopupProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, { useEffect, useState } from 'react';
import React, { useState, useEffect } from 'react';

import { SidePanelInput } from './SidePanelInput';
import { createComponentStyles } from '../styles/componentStyles';
import { getStatusStyle } from '../styles/style';
import type { ThemeProps } from '../types/theme';
import type { DataItem } from '../types/types';

import type { ThemeProps } from '../types/theme';
import { componentStyles, getStatusStyle } from '../styles/style';
import '../styles/SidePanel.css';

interface SidePanelProps {
Expand All @@ -31,7 +29,6 @@ export const SidePanel: React.FC<SidePanelProps> = ({
isStatusEditable = false, // Status is typically not editable
}) => {
const [formData, setFormData] = useState<Partial<DataItem>>({});
const styles = createComponentStyles(theme);

// Prevent body scroll when side panel is open
useEffect(() => {
Expand Down Expand Up @@ -89,7 +86,7 @@ export const SidePanel: React.FC<SidePanelProps> = ({

return (
<span style={{
...styles.statusBadge.base,
...componentStyles.statusBadge.base,
...style
}}>
{status}
Expand All @@ -104,22 +101,22 @@ export const SidePanel: React.FC<SidePanelProps> = ({
const firstLetter = value.charAt(0).toUpperCase();

return (
<div style={styles.resourceTypeDisplay.container}>
<div style={componentStyles.resourceTypeDisplay.container}>
<div style={{
...styles.resourceTypeDisplay.icon,
...(imageURL ? styles.resourceTypeDisplay.iconWithImage : styles.resourceTypeDisplay.iconWithoutImage)
...componentStyles.resourceTypeDisplay.icon,
...(imageURL ? componentStyles.resourceTypeDisplay.iconWithImage : componentStyles.resourceTypeDisplay.iconWithoutImage)
}}>
{imageURL ? (
<img
src={imageURL}
alt={value}
style={styles.resourceTypeDisplay.image}
style={componentStyles.resourceTypeDisplay.image}
/>
) : (
firstLetter
)}
</div>
<span style={styles.resourceTypeDisplay.text}>{value}</span>
<span style={componentStyles.resourceTypeDisplay.text}>{value}</span>
</div>
);
};
Expand All @@ -130,36 +127,36 @@ export const SidePanel: React.FC<SidePanelProps> = ({
<div
className="side-panel-overlay"
onClick={onClose}
style={styles.sidePanel.overlay}
style={componentStyles.sidePanel.overlay}
/>

{/* Side Panel */}
<div
className="side-panel"
style={{
...styles.sidePanel.container,
...componentStyles.sidePanel.container,
transform: isOpen ? 'translateX(0)' : 'translateX(100%)',
transition: 'transform 0.3s ease-in-out',
}}
>
{/* Header */}
<div style={styles.sidePanel.header}>
<h2 style={styles.sidePanel.title}>
<div style={componentStyles.sidePanel.header}>
<h2 style={componentStyles.sidePanel.title}>
Resource Details
</h2>
<button
onClick={onClose}
style={styles.sidePanel.closeButton}
style={componentStyles.sidePanel.closeButton}
>
×
</button>
</div>

{/* Content */}
<div style={styles.sidePanel.content}>
<div style={componentStyles.sidePanel.content}>
{/* Resource Type */}
<div style={styles.sidePanel.fieldContainer}>
<label style={styles.sidePanel.label}>
<div style={componentStyles.sidePanel.fieldContainer}>
<label style={componentStyles.sidePanel.label}>
Resource Type
</label>
<ResourceTypeDisplay
Expand All @@ -169,11 +166,11 @@ export const SidePanel: React.FC<SidePanelProps> = ({
</div>

{/* ID */}
<div style={styles.sidePanel.fieldContainer}>
<label style={styles.sidePanel.label}>
<div style={componentStyles.sidePanel.fieldContainer}>
<label style={componentStyles.sidePanel.label}>
ID *
</label>
<div style={styles.sidePanel.idField}>
<div style={componentStyles.sidePanel.idField}>
{item.id}
</div>
</div>
Expand All @@ -199,8 +196,8 @@ export const SidePanel: React.FC<SidePanelProps> = ({
/>

{/* Status */}
<div style={styles.sidePanel.fieldContainer}>
<label style={styles.sidePanel.label}>
<div style={componentStyles.sidePanel.fieldContainer}>
<label style={componentStyles.sidePanel.label}>
Status
</label>
{isStatusEditable ? (
Expand Down Expand Up @@ -229,13 +226,13 @@ export const SidePanel: React.FC<SidePanelProps> = ({
</div>

{/* Footer with Save Changes Button */}
<div style={styles.sidePanel.footer}>
<div style={componentStyles.sidePanel.footer}>
<button
onClick={handleSaveChanges}
disabled={!hasChanges}
style={{
...styles.sidePanel.saveButton,
...(hasChanges ? styles.sidePanel.saveButtonEnabled : styles.sidePanel.saveButtonDisabled),
...componentStyles.sidePanel.saveButton,
...(hasChanges ? componentStyles.sidePanel.saveButtonEnabled : componentStyles.sidePanel.saveButtonDisabled),
}}
onMouseEnter={(e) => {
if (hasChanges)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';

import type { ThemeProps } from '../types/theme';

import '../styles/SidePanelInput.css';

interface SidePanelInputProps {
Expand Down
43 changes: 43 additions & 0 deletions example/src/styles/ExportDropdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.export-dropdown {
position: absolute;
top: calc(100% + 8px);
right: 0;
min-width: 180px;
background-color: #ffffff;
border: 1px solid #F0F0F0;
border-radius: 8px;
box-shadow: 0px 0px 1px 0px #00000033, 0px 8px 24px -6px #00000014;
z-index: 1000;
overflow: hidden;
font-family: 'DM Sans', sans-serif;
}

.export-dropdown-content {
padding: 8px 0;
}

.export-option {
display: flex;
align-items: center;
width: 100%;
padding: 12px 16px;
background: none;
border: none;
cursor: pointer;
gap: 12px;
transition: background-color 0.2s ease;
font-family: 'DM Sans', sans-serif;
font-size: 14px;
font-weight: 500;
text-align: left;
}

.export-option:hover {
background-color: #f5f5f5;
}

.export-icon {
font-size: 16px;
width: 20px;
text-align: center;
}
Loading
Loading