Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ICON_PARTNERS } from '#site/next.partners.constants';
import type { PartnerCategory } from '#site/types';

import PartnerIcon from '../PartnerIcon';

import style from './index.module.css';

type PartnersIconListProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { LOGO_PARTNERS } from '#site/next.partners.constants';
import type { PartnerCategory } from '#site/types';

import PartnerLogo from '../PartnerLogo';

import style from './index.module.css';

type PartnersLogoListProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useScrollableContainer } from '@orama/ui/hooks/useScrollableContainer';
import { useTranslations } from 'next-intl';

import { ChatMessage } from '../ChatMessage';

import styles from './index.module.css';

export const ChatInteractionsContainer = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ChatInteractions } from '@orama/ui/components';
import type { FC } from 'react';

import ChatSources from '../ChatSources';

import styles from './index.module.css';

type ChatMessageProps = {
Expand Down
3 changes: 2 additions & 1 deletion apps/site/components/Common/Searchbox/ChatSources/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import type { Interaction, AnyObject } from '@orama/core';
import { ChatInteractions } from '@orama/ui/components';
import type { FC } from 'react';

import styles from './index.module.css';
import type { Document } from '../DocumentLink';
import { DocumentLink } from '../DocumentLink';

import styles from './index.module.css';

type ChatSourcesProps = {
interaction: Interaction;
};
Expand Down
3 changes: 2 additions & 1 deletion apps/site/components/Common/Searchbox/SearchItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import type { FC } from 'react';

import { DocumentLink } from '../DocumentLink';
import type { Document } from '../DocumentLink';
import styles from './index.module.css';
import { getFormattedPath } from './utils';

import styles from './index.module.css';

type SearchItemProps = {
document: Document;
mode?: 'search' | 'chat';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { SlidingPanel } from '@orama/ui/components';
import { useTranslations } from 'next-intl';
import type { FC, PropsWithChildren } from 'react';

import styles from './index.module.css';
import { ChatInteractionsContainer } from '../ChatInteractions';

import styles from './index.module.css';

type SlidingChatPanelProps = PropsWithChildren<{
open: boolean;
onClose: () => void;
Expand Down
3 changes: 2 additions & 1 deletion apps/site/components/Common/Searchbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import { DEFAULT_ORAMA_QUERY_PARAMS } from '#site/next.constants.mjs';

import type { Document } from './DocumentLink';
import { Footer } from './Footer';
import styles from './index.module.css';
import { oramaClient } from './orama-client';
import { SearchItem } from './SearchItem';
import { SlidingChatPanel } from './SlidingChatPanel';

import styles from './index.module.css';

const Searchbox: FC = () => {
const t = useTranslations();
const [mode, setMode] = useState<'chat' | 'search'>('search');
Expand Down
3 changes: 2 additions & 1 deletion apps/site/components/EOL/EOLReleaseTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import provideReleaseData from '#site/next-data/providers/releaseData';
import provideVulnerabilities from '#site/next-data/providers/vulnerabilities';
import { EOL_VERSION_IDENTIFIER } from '#site/next.constants.mjs';

import styles from './index.module.css';
import EOLReleaseTableBody from './TableBody';

import styles from './index.module.css';

const EOLReleaseTable: FC = async () => {
const releaseData = await provideReleaseData();
const vulnerabilities = await provideVulnerabilities();
Expand Down
3 changes: 2 additions & 1 deletion apps/site/components/Releases/ReleaseOverview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import type { FC } from 'react';
import FormattedTime from '#site/components/Common/FormattedTime';
import type { NodeRelease } from '#site/types';

import styles from './index.module.css';
import ReleaseOverviewItem from './ReleaseOverviewItem';

import styles from './index.module.css';

type ReleaseOverviewProps = {
release: NodeRelease;
};
Expand Down
1 change: 1 addition & 0 deletions docs/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ We use [PostCSS](https://postcss.org/) and [Tailwind CSS](https://tailwindcss.co
- Prefix prop types with the component name
- Always use default exports for React components
- Avoid direct DOM/Web API access in components - use hooks or utilities instead
- CSS imports should always be the last import in the file

### Example Component Structure

Expand Down
3 changes: 3 additions & 0 deletions docs/creating-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Generic UI components should be placed in `@node-core/ui-components`:
```tsx
// @node-core/ui-components/src/Common/Button/index.tsx
import type { FC, ButtonHTMLAttributes } from 'react';

import styles from './index.module.css';

type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
Expand Down Expand Up @@ -108,6 +109,7 @@ ComponentName/

```tsx
import type { FC } from 'react';

import styles from './index.module.css';

type MyComponentProps = {
Expand Down Expand Up @@ -138,6 +140,7 @@ export default MyComponent;

```tsx
import type { FC, PropsWithChildren } from 'react';

import styles from './index.module.css';

type CardProps = PropsWithChildren<{
Expand Down
20 changes: 19 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import js from '@eslint/js';
import * as importX from 'eslint-plugin-import-x';
import tseslint from 'typescript-eslint';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
js.configs.recommended,
Expand Down Expand Up @@ -54,6 +54,24 @@ export default tseslint.config(
'index',
'unknown',
],
pathGroups: [
{
pattern: '{.,..}/**/*.css',
group: 'sibling',
position: 'after',
},
{
pattern: './**/*.css',
group: 'sibling',
position: 'after',
},
{
pattern: '../**/*.css',
group: 'sibling',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['type'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
Expand Down
3 changes: 2 additions & 1 deletion packages/ui-components/src/Common/BaseLinkTabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import type { FC, PropsWithChildren } from 'react';

import type { LinkLike } from '#ui/types';

import styles from './index.module.css';
import StatelessSelect from '../Select/StatelessSelect';

import styles from './index.module.css';

type LinkTab = { key: string; label: string; link: string };

export type LinkTabsProps = PropsWithChildren<{
Expand Down
6 changes: 3 additions & 3 deletions packages/ui-components/src/Common/Switch/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

.label {
@apply cursor-pointer
select-none
text-sm
font-medium
text-neutral-800
select-none
dark:text-neutral-200;
}

Expand All @@ -19,10 +19,10 @@
}

.root {
@apply w-10.5
relative
@apply relative
inline-flex
h-6
w-10.5
cursor-pointer
items-center
rounded-full
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import type { FC } from 'react';
import BaseActiveLink from '#ui/Common/BaseActiveLink';
import type { FormattedMessage, LinkLike } from '#ui/types';

import styles from './index.module.css';
import ProgressionIcon from '../ProgressionIcon';

import styles from './index.module.css';

type SidebarItemProps = {
label: FormattedMessage;
link: string;
Expand Down
Loading