@@ -112,7 +111,6 @@ export default function DemoControls({
);
}
- // For select type
if (control.type === 'select') {
const selectValue =
propValue !== undefined && propValue !== null
@@ -150,7 +148,6 @@ export default function DemoControls({
);
}
- // For text and number types
return (
- {/* Render index item first */}
{renderNode(node.index, pathname)}
- {/* Recursively render all children */}
{node.children.map(child => renderNode(child, pathname))}
);
}
- // Handle folders with index but no children
if (
node.type === 'folder' &&
node.index &&
@@ -52,7 +48,6 @@ function renderNode(node: Node, pathname: string): ReactNode {
return renderNode(node.index, pathname);
}
- // Handle folders normally
if (node.type === 'folder') {
return (
;
}
- // Handle separators (if needed)
if (node.type === 'separator') {
return null;
}
diff --git a/apps/www/src/components/mdx/mdx-components.tsx b/apps/www/src/components/mdx/mdx-components.tsx
index 383dbfa2c..c53d4df9b 100644
--- a/apps/www/src/components/mdx/mdx-components.tsx
+++ b/apps/www/src/components/mdx/mdx-components.tsx
@@ -125,11 +125,4 @@ const mdxComponents = {
Demo
};
-// export const createRelativeLink: typeof import('./mdx.server').createRelativeLink =
-// () => {
-// throw new Error(
-// '`createRelativeLink` is only supported in Node.js environment',
-// );
-// };
-
export { mdxComponents };
diff --git a/apps/www/src/components/playground/skeleton-examples.tsx b/apps/www/src/components/playground/skeleton-examples.tsx
index 0647d5c62..16e3aca73 100644
--- a/apps/www/src/components/playground/skeleton-examples.tsx
+++ b/apps/www/src/components/playground/skeleton-examples.tsx
@@ -7,13 +7,10 @@ export function SkeletonExamples() {
return (
- {/* Basic Usage */}
- {/* Multiple Lines */}
- {/* Custom Colors */}
- {/* Animation Control */}
- {/* Card Layout Example */}
{/* Image placeholder */}
{/* Title placeholder */}
diff --git a/apps/www/src/components/toc/toc.tsx b/apps/www/src/components/toc/toc.tsx
index 70ce2f1cf..099d5f147 100644
--- a/apps/www/src/components/toc/toc.tsx
+++ b/apps/www/src/components/toc/toc.tsx
@@ -306,8 +306,6 @@ export default function TableOfContents({
style={{
// Center label vertically on tick (label height ~12px, so offset by half)
top: `${h.yPosition - 6}px`,
- // Indent based on heading level (h2 furthest right, h4 closest to bar)
- // right: `${(3 - h.level) * 4 + 28}px`,
right: '24px',
zIndex: 10 * (h.level < 4 ? 1 : 0),
transitionDelay: `${50 * i}ms`
diff --git a/apps/www/src/lib/ai.ts b/apps/www/src/lib/ai.ts
index aef6849ff..88fd099a9 100644
--- a/apps/www/src/lib/ai.ts
+++ b/apps/www/src/lib/ai.ts
@@ -1,11 +1,11 @@
import { promises as fs } from 'fs';
-import path from 'path';
-import { docs } from '@/lib/source';
import type { InferPageType } from 'fumadocs-core/source';
import { remarkAutoTypeTable } from 'fumadocs-typescript';
+import path from 'path';
import { remark } from 'remark';
import remarkGfm from 'remark-gfm';
import remarkMdx from 'remark-mdx';
+import { docs } from '@/lib/source';
import { remarkTypeTableToMd } from './remark';
const processor = remark()
@@ -21,7 +21,6 @@ const REGEX = {
PLAYGROUND: /export const playground\s*=\s*{/g
};
-// Inline the demo examples into the content
function inlineDemoComponents(content: string, demo: string): string {
const demoMap: Record = {};
const formattedDemo = removePlaygroundExportBlock(demo);
@@ -69,11 +68,10 @@ function inlineDemoComponents(content: string, demo: string): string {
return result;
}
-// Remove the playground export block from the demo file
function removePlaygroundExportBlock(content: string): string {
const match = REGEX.PLAYGROUND.exec(content);
- if (!match) return content; // nothing to remove
+ if (!match) return content;
const start = match.index;
let i = REGEX.PLAYGROUND.lastIndex - 1; // start at opening `{`
@@ -95,7 +93,6 @@ function removePlaygroundExportBlock(content: string): string {
// Remove the frontmatter, import statements, and code blocks from the content
function formatContent(content: string) {
- // remove frontmatter values
let processedContent = content.replace(REGEX.FRONTMATTER, '');
// remove import statements outside of code blocks
diff --git a/apps/www/src/lib/prettier.ts b/apps/www/src/lib/prettier.ts
index 6cb83ae44..afcce4abc 100644
--- a/apps/www/src/lib/prettier.ts
+++ b/apps/www/src/lib/prettier.ts
@@ -11,11 +11,11 @@ export const getFormattedCode = (code: string) => {
return prettier
.format(`(${code})`, prettierOptions)
.trim()
- .replace(/;\s*$/, ''); //remove trailing semicolon
+ .replace(/;\s*$/, '');
} catch (e) {
return prettier
.format(`${code}`, prettierOptions)
.trim()
- .replace(/;\s*$/, ''); //remove trailing semicolon
+ .replace(/;\s*$/, '');
}
};
diff --git a/apps/www/src/lib/remark.ts b/apps/www/src/lib/remark.ts
index f44044187..c7562d41e 100644
--- a/apps/www/src/lib/remark.ts
+++ b/apps/www/src/lib/remark.ts
@@ -73,7 +73,6 @@ export function remarkTypeTableToMd() {
entry.description || ''
]);
- // Build MDAST table node with correct types
const tableNode: Table = {
type: 'table',
align: [],
diff --git a/apps/www/src/lib/utils.ts b/apps/www/src/lib/utils.ts
index 1c41ea836..1bf87cfc0 100644
--- a/apps/www/src/lib/utils.ts
+++ b/apps/www/src/lib/utils.ts
@@ -39,7 +39,6 @@ export function isActiveUrl(
* Format: /docs/folder-name/file-name or docs/folder-name/file-name
*/
export const getFolderFromUrl = (url: string): string => {
- // Remove leading slash if present and split by "/"
const parts = url.replace(/^\//, '').split('/').filter(Boolean);
// Expected structure: ["docs", folderName?, fileName]
diff --git a/packages/raystack/components/amount/amount.tsx b/packages/raystack/components/amount/amount.tsx
index c30f1e2ac..b66027256 100644
--- a/packages/raystack/components/amount/amount.tsx
+++ b/packages/raystack/components/amount/amount.tsx
@@ -10,11 +10,7 @@ export interface AmountProps extends ComponentProps<'span'> {
* - a `bigint` — integer-only; treated as already in major units, so
* `valueInMinorUnits` is ignored when value is a bigint
* @default 0
- * @example
- * valueInMinorUnits=true: 1299 => "$12.99"
- * valueInMinorUnits=false: 12.99 => "$12.99"
- * Large strings: "999999999999999" => "$9,999,999,999,999.99"
- * BigInt: 1299n => "$1,299.00" (always major units)
+ * @example 1299 => "$12.99"
*/
value: number | string | bigint;
@@ -29,10 +25,7 @@ export interface AmountProps extends ComponentProps<'span'> {
* If true, the value will be converted based on the currency's decimal places
* If false, the value will be used as is
* @default true
- * @example
- * USD: 1299 => $12.99 (2 decimals)
- * JPY: 1299 => ¥1,299 (0 decimals)
- * BHD: 1299 => BHD 1.299 (3 decimals)
+ * @example USD: 1299 => $12.99, JPY: 1299 => ¥1,299
*/
valueInMinorUnits?: boolean;
@@ -85,9 +78,6 @@ export interface AmountProps extends ComponentProps<'span'> {
hideCurrency?: boolean;
}
-/**
- * Get the number of decimal places for a currency
- */
function getCurrencyDecimals(currency: string): number {
try {
const formatter = new Intl.NumberFormat('en', {
@@ -95,19 +85,14 @@ function getCurrencyDecimals(currency: string): number {
currency: currency.toUpperCase()
});
- // Format a number and count the decimal places
- const formatted = formatter.format(1); // Get string representation of 1 unit with currency symbol
- const match = formatted.match(/\.([\d]+)/); // Extract the decimal part
+ const formatted = formatter.format(1);
+ const match = formatted.match(/\.([\d]+)/);
return match ? match[1].length : 0;
} catch {
- // Default to 2 decimal places
return 2;
}
}
-/**
- * Check if a currency is valid
- */
function isValidCurrency(currency: string): boolean {
try {
new Intl.NumberFormat('en', {
@@ -126,37 +111,7 @@ function isValidCurrency(currency: string): boolean {
* Inherits styling from parent Text component.
*
* @example
- * ```tsx
- * // Basic usage
- *
- * Total: // Shows as "$12.99"
- *
- *
- * // With different currency and locale
- *
- * Prix: // Shows as "12,99 €"
- *
- *
- * // Without decimals
- *
- * Price: // Shows as "$12"
- *
- *
- * // With currency code
- *
- * Amount: // Shows as "USD 12.99"
- *
- *
- * // With value in major units
- *
- * Amount: // Shows as "$12.99"
- *
- *
- * // With groupDigits (default is true)
- *
- * Amount: // Shows as "$129,999,999.99"
- *
- * ```
+ * // Shows as "$12.99"
*/
export const Amount = ({
value = 0,
diff --git a/packages/raystack/components/calendar/__tests__/calendar.test.tsx b/packages/raystack/components/calendar/__tests__/calendar.test.tsx
index 4e33ae419..a8f74c3f5 100644
--- a/packages/raystack/components/calendar/__tests__/calendar.test.tsx
+++ b/packages/raystack/components/calendar/__tests__/calendar.test.tsx
@@ -146,7 +146,6 @@ describe('Calendar', () => {
/>
);
- // The component should be rendered in the calendar
expect(
container.querySelector('[data-testid="custom-date-info"]')
).toBeInTheDocument();
@@ -178,7 +177,6 @@ describe('Calendar', () => {
/>
);
- // Should only have one date with info
const dateInfos = container.querySelectorAll('[data-testid="date-info"]');
expect(dateInfos.length).toBeGreaterThanOrEqual(0);
});
@@ -206,7 +204,6 @@ describe('Calendar', () => {
const { container } = render(
{
- // Show info only on Sundays
if (date.getDay() === 0) {
return Sunday
;
}
@@ -228,7 +225,6 @@ describe('Calendar', () => {
const { container } = render(
{
- // Show info only for today
if (
date.getDate() === today.getDate() &&
date.getMonth() === today.getMonth() &&
diff --git a/packages/raystack/components/code-block/code-block-code.tsx b/packages/raystack/components/code-block/code-block-code.tsx
index 162bbb019..4af48b6ed 100644
--- a/packages/raystack/components/code-block/code-block-code.tsx
+++ b/packages/raystack/components/code-block/code-block-code.tsx
@@ -31,9 +31,7 @@ export const CodeBlockCode = ({
const content = children.trim();
useIsomorphicLayoutEffect(() => {
- // if value is not defined, set the value
if (!isContextValueDefined) setValue(language);
- // if should render, store the code
if (shouldRender) setCode(content);
}, [
content,
diff --git a/packages/raystack/components/color-picker/__tests__/color-picker.test.tsx b/packages/raystack/components/color-picker/__tests__/color-picker.test.tsx
index b002ceaac..96c2a32c1 100644
--- a/packages/raystack/components/color-picker/__tests__/color-picker.test.tsx
+++ b/packages/raystack/components/color-picker/__tests__/color-picker.test.tsx
@@ -7,20 +7,6 @@ vi.mock('~/hooks/useCopyToClipboard', () => ({
useCopyToClipboard: () => ({ copy: mockCopy })
}));
-// // Mock ResizeObserver for tests
-// const originalResizeObserver = global.ResizeObserver;
-// beforeAll(() => {
-// global.ResizeObserver = vi.fn().mockImplementation(() => ({
-// observe: vi.fn(),
-// unobserve: vi.fn(),
-// disconnect: vi.fn()
-// }));
-// });
-
-// afterAll(() => {
-// global.ResizeObserver = originalResizeObserver;
-// });
-
describe('ColorPicker', () => {
describe('ColorPicker Root', () => {
it('renders color picker root with children', () => {
@@ -173,7 +159,6 @@ describe('ColorPicker', () => {
const hueSlider = screen.getByTestId('hue-slider');
expect(hueSlider).toBeInTheDocument();
- // Check that the slider has child elements (track and thumb)
expect(hueSlider.children.length).toBeGreaterThan(0);
});
});
@@ -214,7 +199,6 @@ describe('ColorPicker', () => {
const alphaSlider = screen.getByTestId('alpha-slider');
expect(alphaSlider).toBeInTheDocument();
- // Check that the slider has child elements (track and thumb)
expect(alphaSlider.children.length).toBeGreaterThan(0);
});
});
@@ -435,7 +419,6 @@ describe('ColorPicker', () => {
);
- // All components should render without errors
expect(screen.getByTestId('area')).toBeInTheDocument();
expect(screen.getByTestId('hue')).toBeInTheDocument();
expect(screen.getByTestId('alpha')).toBeInTheDocument();
@@ -454,7 +437,6 @@ describe('ColorPicker', () => {
);
- // All components should render without errors
expect(screen.getByTestId('area')).toBeInTheDocument();
expect(screen.getByTestId('hue')).toBeInTheDocument();
expect(screen.getByTestId('alpha')).toBeInTheDocument();
diff --git a/packages/raystack/components/color-picker/color-picker-area.tsx b/packages/raystack/components/color-picker/color-picker-area.tsx
index b414c4f7f..2f8a6cb80 100644
--- a/packages/raystack/components/color-picker/color-picker-area.tsx
+++ b/packages/raystack/components/color-picker/color-picker-area.tsx
@@ -177,10 +177,10 @@ const OklchArea = ({ className, ...props }: ColorPickerAreaProps) => {
y += STEP_LARGE;
break;
case 'Home':
- x = 0; // no chroma
+ x = 0;
break;
case 'End':
- x = 1; // max chroma
+ x = 1;
break;
default:
return; // let other keys (Tab, etc.) pass through
diff --git a/packages/raystack/components/color-picker/utils.ts b/packages/raystack/components/color-picker/utils.ts
index b85395e43..0a8d57239 100644
--- a/packages/raystack/components/color-picker/utils.ts
+++ b/packages/raystack/components/color-picker/utils.ts
@@ -70,27 +70,17 @@ const formatOklchString = (color: ColorObject): string => {
};
/**
- * Convert any CSS color string to the requested format.
+ * Convert any CSS color string to the requested format. Returns `null` for
+ * unparseable input.
*
* Wide-gamut OKLCH inputs are gamut-mapped into sRGB for `hex`/`rgb`/`hsl`
- * outputs (chroma reduced, lightness and hue preserved), so the result is
- * the closest sRGB representation of the requested color rather than a
- * per-channel-clipped one that would distort hue. `oklch` output preserves
- * the full color, since OKLCH can express the wide gamut natively.
- *
- * Hex is uppercase; uses 8-digit form when alpha < 1. RGB/HSL produce
- * `rgb()`/`rgba()` and `hsl()`/`hsla()`. OKLCH matches the design system's
- * token format (4-decimal L/C, 2-decimal H, hue pinned to 0 when achromatic).
- *
- * Returns `null` for unparseable input.
+ * outputs (chroma reduced, lightness and hue preserved), so the result is the
+ * closest sRGB color rather than a per-channel-clipped one that would distort
+ * hue. `oklch` output preserves the full color, since OKLCH expresses the wide
+ * gamut natively.
*
* @example
- * formatColor('oklch(0.5438 0.191 267.01)', 'hex') // '#3E63DD'
- * formatColor('oklch(0.7 0.32 30)', 'hex') // '#FF5843'
- * formatColor('red', 'rgb') // 'rgb(255, 0, 0)'
- * formatColor('rgba(255, 0, 0, 0.5)', 'hsl') // 'hsla(0, 100%, 50%, 0.5)'
- * formatColor('#FF0000', 'oklch') // 'oklch(0.6279 0.2577 29.23)'
- * formatColor('not a color', 'hex') // null
+ * formatColor('red', 'rgb') // 'rgb(255, 0, 0)'
*/
export const formatColor = (
value: string,
diff --git a/packages/raystack/components/data-table/__tests__/data-table.test.tsx b/packages/raystack/components/data-table/__tests__/data-table.test.tsx
index f1b6d83d3..27c485676 100644
--- a/packages/raystack/components/data-table/__tests__/data-table.test.tsx
+++ b/packages/raystack/components/data-table/__tests__/data-table.test.tsx
@@ -60,7 +60,6 @@ describe('DataTable', () => {
);
- // Table should be rendered
expect(screen.getByRole('table')).toBeInTheDocument();
});
@@ -109,7 +108,6 @@ describe('DataTable', () => {
);
- // Check if data is displayed
expect(screen.getByText('John Doe')).toBeInTheDocument();
expect(screen.getByText('john@example.com')).toBeInTheDocument();
expect(screen.getByText('Jane Smith')).toBeInTheDocument();
@@ -304,11 +302,9 @@ describe('DataTable', () => {
);
- // After applying filter with no matches, empty state should show
expect(screen.getByTestId('empty-state')).toBeInTheDocument();
expect(screen.getByText(emptyStateText)).toBeInTheDocument();
expect(screen.queryByTestId('zero-state')).not.toBeInTheDocument();
- // Data should not be visible
expect(screen.queryByText('John Doe')).not.toBeInTheDocument();
});
@@ -405,7 +401,6 @@ describe('DataTable', () => {
);
- // Should show emptyState as fallback
expect(screen.getByTestId('empty-state')).toBeInTheDocument();
expect(screen.getByText(emptyStateText)).toBeInTheDocument();
});
@@ -422,7 +417,6 @@ describe('DataTable', () => {
);
- // Should show default empty state
expect(screen.getByText('No Data')).toBeInTheDocument();
});
@@ -444,7 +438,6 @@ describe('DataTable', () => {
);
- // Should show matching data, not empty state
expect(screen.getByText('John Doe')).toBeInTheDocument();
expect(screen.queryByTestId('empty-state')).not.toBeInTheDocument();
expect(screen.queryByTestId('zero-state')).not.toBeInTheDocument();
@@ -570,11 +563,9 @@ describe('DataTable', () => {
);
- // Open Display popover and click reset
await user.click(screen.getByText('Display'));
await user.click(screen.getByText('Reset to default'));
- // Verify onTableQueryChange was called with default sort and no group
expect(onTableQueryChange).toHaveBeenLastCalledWith(
expect.objectContaining({
sort: [{ name: 'name', order: 'asc' }],
@@ -602,7 +593,6 @@ describe('DataTable', () => {
);
- // Data should still be visible, not zero/empty state
expect(screen.getByText('John Doe')).toBeInTheDocument();
expect(screen.queryByTestId('zero-state')).not.toBeInTheDocument();
expect(screen.queryByTestId('empty-state')).not.toBeInTheDocument();
diff --git a/packages/raystack/components/data-table/data-table.tsx b/packages/raystack/components/data-table/data-table.tsx
index adb714634..5ea02d7c6 100644
--- a/packages/raystack/components/data-table/data-table.tsx
+++ b/packages/raystack/components/data-table/data-table.tsx
@@ -166,10 +166,8 @@ function DataTableRoot({
}
}, [searchQuery]);
- // Determine if filters should be visible
- // Filters should be visible if there is data OR if filters are applied (empty state)
- // Filters should NOT be visible if no data AND no filters (zero state)
- // Note: Search alone does not show the filter bar
+ // Show filters when there is data or filters are applied; hide in the zero state.
+ // Search alone does not show the filter bar.
const shouldShowFilters = useMemo(() => {
const hasFilters = tableQuery?.filters && tableQuery.filters.length > 0;
@@ -178,8 +176,7 @@ function DataTableRoot({
const hasData = (rowModel?.rows?.length ?? 0) > 0;
return hasData || hasFilters;
} catch {
- // If table is not ready yet, check if we have initial data
- // If no filters and no data, don't show filters
+ // Table not ready yet, so fall back to the initial data.
return hasFilters || data.length > 0;
}
}, [table, tableQuery, data.length]);
diff --git a/packages/raystack/components/data-table/utils/__tests__/index.test.tsx b/packages/raystack/components/data-table/utils/__tests__/index.test.tsx
index 7fa39325b..7d738e10d 100644
--- a/packages/raystack/components/data-table/utils/__tests__/index.test.tsx
+++ b/packages/raystack/components/data-table/utils/__tests__/index.test.tsx
@@ -24,7 +24,6 @@ import {
transformToDataTableQuery
} from '../index';
-// Mock data for tests
const mockColumns: DataTableColumnDef[] = [
{
accessorKey: 'name',
diff --git a/packages/raystack/components/data-table/utils/filter-operations.tsx b/packages/raystack/components/data-table/utils/filter-operations.tsx
index 169e74d9c..c0c794aa7 100644
--- a/packages/raystack/components/data-table/utils/filter-operations.tsx
+++ b/packages/raystack/components/data-table/utils/filter-operations.tsx
@@ -270,7 +270,6 @@ export const getFilterValue = ({
return { numberValue: value as number, value };
}
- // Handle string-based types
return handleStringBasedTypes(filterType, value, operator);
};
diff --git a/packages/raystack/components/data-table/utils/index.tsx b/packages/raystack/components/data-table/utils/index.tsx
index 299093d42..e440b0d07 100644
--- a/packages/raystack/components/data-table/utils/index.tsx
+++ b/packages/raystack/components/data-table/utils/index.tsx
@@ -250,8 +250,7 @@ export function transformToDataTableQuery(
};
}
-// Transform DataTableQuery to InternalQuery
-// This reverses the transformation done by transformToDataTableQuery
+// Reverses the transformation done by transformToDataTableQuery.
export function dataTableQueryToInternal(query: DataTableQuery): InternalQuery {
const { filters, ...rest } = query;
@@ -259,7 +258,6 @@ export function dataTableQueryToInternal(query: DataTableQuery): InternalQuery {
return rest;
}
- // Convert DataTableFilter[] to InternalFilter[]
const internalFilters: InternalFilter[] = filters.map(filter => {
const {
operator,
@@ -284,17 +282,17 @@ export function dataTableQueryToInternal(query: DataTableQuery): InternalQuery {
if (stringValue.startsWith('%') && stringValue.endsWith('%')) {
transformedFilter = {
operator: 'contains',
- value: stringValue.slice(1, -1) // Remove % from both ends
+ value: stringValue.slice(1, -1)
};
} else if (stringValue.endsWith('%')) {
transformedFilter = {
operator: 'starts_with',
- value: stringValue.slice(0, -1) // Remove % from end
+ value: stringValue.slice(0, -1)
};
} else if (stringValue.startsWith('%')) {
transformedFilter = {
operator: 'ends_with',
- value: stringValue.slice(1) // Remove % from start
+ value: stringValue.slice(1)
};
} else {
// Default to contains if no wildcards (shouldn't happen normally)
@@ -348,7 +346,6 @@ export function getDefaultTableQuery(
defaultSort?: DataTableSort,
oldQuery: DataTableQuery = {}
): InternalQuery {
- // Convert DataTableQuery to InternalQuery
const internalQuery = dataTableQueryToInternal(oldQuery);
return {
diff --git a/packages/raystack/components/data-view/__tests__/data-view.test.tsx b/packages/raystack/components/data-view/__tests__/data-view.test.tsx
index 011df6145..0fcc02f46 100644
--- a/packages/raystack/components/data-view/__tests__/data-view.test.tsx
+++ b/packages/raystack/components/data-view/__tests__/data-view.test.tsx
@@ -363,9 +363,7 @@ describe('DataView', () => {
);
- // Search input
expect(screen.getByRole('textbox')).toBeInTheDocument();
- // Filter button
expect(
screen.getByRole('button', { name: /filter/i })
).toBeInTheDocument();
@@ -476,7 +474,6 @@ describe('DataView', () => {
);
- // Two active rows visible in table
expect(screen.getByText('John Doe')).toBeInTheDocument();
expect(screen.queryByText('Jane Smith')).not.toBeInTheDocument();
diff --git a/packages/raystack/components/data-view/__tests__/debug.test.tsx b/packages/raystack/components/data-view/__tests__/debug.test.tsx
index 14ba18061..4bab3e54a 100644
--- a/packages/raystack/components/data-view/__tests__/debug.test.tsx
+++ b/packages/raystack/components/data-view/__tests__/debug.test.tsx
@@ -1,6 +1,6 @@
import { describe, it } from 'vitest';
-// placeholder — was used for bisecting Filter trigger render issue.
+// placeholder
describe.skip('debug', () => {
it('noop', () => {});
});
diff --git a/packages/raystack/components/theme-provider/theme.tsx b/packages/raystack/components/theme-provider/theme.tsx
index 12e42ed85..800a1e72b 100644
--- a/packages/raystack/components/theme-provider/theme.tsx
+++ b/packages/raystack/components/theme-provider/theme.tsx
@@ -127,7 +127,6 @@ const Scoped = ({
}
}, [isPersistent, storageKey, stored]);
- // Cross-tab sync.
useEffect(() => {
if (!isPersistent) return;
const onStorage = (e: StorageEvent) => {
@@ -234,7 +233,6 @@ const Root = ({
let resolved = theme;
if (!resolved) return;
- // If theme is system, resolve it before setting theme
if (theme === 'system' && enableSystem) {
resolved = getSystemTheme();
}
@@ -291,11 +289,10 @@ const Root = ({
if (theme === undefined) return;
setThemeState(theme);
- // Save to storage
try {
localStorage.setItem(storageKey, theme);
} catch (e) {
- // Unsupported
+ // unsupported (private mode, quota exceeded)
}
},
[storageKey]
@@ -313,7 +310,6 @@ const Root = ({
[theme, forcedTheme, enableSystem, applyTheme]
);
- // Always listen to System preference
useEffect(() => {
const media = window.matchMedia(MEDIA);
@@ -323,7 +319,6 @@ const Root = ({
return () => media.removeEventListener('change', handleMediaQuery);
}, [handleMediaQuery]);
- // localStorage event handling
useEffect(() => {
const handleStorage = (e: StorageEvent) => {
if (e.key !== storageKey) {
@@ -548,14 +543,13 @@ const ThemeScript = memo(
() => true
);
-// Helpers
const getTheme = (key: string, fallback?: string) => {
if (isServer) return undefined;
let theme;
try {
theme = localStorage.getItem(key) || undefined;
} catch (e) {
- // Unsupported
+ // unsupported (private mode, quota exceeded)
}
return theme || fallback;
};
diff --git a/packages/raystack/components/tour-beta/tour-backdrop.tsx b/packages/raystack/components/tour-beta/tour-backdrop.tsx
index 3a54a7736..5f13ffec1 100644
--- a/packages/raystack/components/tour-beta/tour-backdrop.tsx
+++ b/packages/raystack/components/tour-beta/tour-backdrop.tsx
@@ -1,5 +1,4 @@
-// Superseded by tour-overlay.tsx (the part is named Tour.Overlay now that
-// the API sticks to the "overlay" term). Safe to delete this file.
+// Back-compat alias: the part was renamed Tour.Overlay.
export {
TourOverlay as TourBackdrop,
type TourOverlayProps as TourBackdropProps
diff --git a/packages/raystack/hooks/useCopyToClipboard.tsx b/packages/raystack/hooks/useCopyToClipboard.tsx
index 71444f7db..72dd0c483 100644
--- a/packages/raystack/hooks/useCopyToClipboard.tsx
+++ b/packages/raystack/hooks/useCopyToClipboard.tsx
@@ -1,24 +1,23 @@
-import { useState } from "react";
+import { useState } from 'react';
type CopyFn = (text: string) => Promise; // Return success
export const useCopyToClipboard = () => {
- const [copiedText, setCopiedText] = useState("");
+ const [copiedText, setCopiedText] = useState('');
- const copy: CopyFn = async (text) => {
+ const copy: CopyFn = async text => {
if (!navigator?.clipboard) {
- console.warn("Clipboard not supported");
+ console.warn('Clipboard not supported');
return false;
}
- // Try to save to clipboard then save it in the state if worked
try {
await navigator.clipboard.writeText(text);
setCopiedText(text);
return true;
} catch (error) {
- console.warn("Copy failed", error);
- setCopiedText("");
+ console.warn('Copy failed', error);
+ setCopiedText('');
return false;
}
};
diff --git a/packages/raystack/hooks/useMouse.tsx b/packages/raystack/hooks/useMouse.tsx
index 5d9020d63..3d54755e5 100644
--- a/packages/raystack/hooks/useMouse.tsx
+++ b/packages/raystack/hooks/useMouse.tsx
@@ -22,7 +22,6 @@ export function useMouse(
const [value, setValue] = useState(null);
const elementRef = useRef(null);
- // Handle mouse movement using native MouseEvent
const handleMouseMove = useCallback(
(event: MouseEvent) => {
if (!enabled) return;
diff --git a/packages/raystack/styles/typography.css b/packages/raystack/styles/typography.css
index 3142c03b8..30d2a96e3 100644
--- a/packages/raystack/styles/typography.css
+++ b/packages/raystack/styles/typography.css
@@ -96,10 +96,8 @@
}
body {
- /* Default Font */
font-family: var(--rs-font-body);
- /* Font Smoothing */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@@ -137,7 +135,6 @@ h4 {
text-wrap: balance;
}
-/* CSS for the text cursor */
input,
textarea {
caret-color: var(--rs-color-border-accent-emphasis);
diff --git a/packages/raystack/types/filters.tsx b/packages/raystack/types/filters.tsx
index 29702fe86..80895799a 100644
--- a/packages/raystack/types/filters.tsx
+++ b/packages/raystack/types/filters.tsx
@@ -12,9 +12,7 @@ export type FilterValueType = 'string' | 'number' | 'boolean';
export interface FilterValue {
value?: FilterValueType;
- // values?: Array;
date?: Date;
- // dateRange?: DateRange;
}
export type FilterOperation = {