Skip to content

Commit

Permalink
Feat(web-react): Mark all components as Client components
Browse files Browse the repository at this point in the history
- Adding support for React Server Components
@see https://react.dev/reference/rsc/use-client

solve #DS-1392
  • Loading branch information
pavelklibani committed Aug 6, 2024
1 parent 217a330 commit 2e8551b
Show file tree
Hide file tree
Showing 172 changed files with 344 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/web-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![minified + gzip](https://badgen.net/bundlephobia/minzip/@lmc-eu/spirit-web-react)](https://bundlephobia.com/package/@lmc-eu/spirit-web-react)
[![dependency count](https://badgen.net/bundlephobia/dependency-count/@lmc-eu/spirit-web-react)](https://bundlephobia.com/package/@lmc-eu/spirit-web-react)
[![tree shaking](https://badgen.net/bundlephobia/tree-shaking/@lmc-eu/spirit-web-react)](https://bundlephobia.com/package/@lmc-eu/spirit-web-react)
[![client components](https://badgen.net/badge/client%20components/supported/green)](https://bundlephobia.com/package/@lmc-eu/spirit-web-react)

> React implementation of Spirit Design System components.
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { createContext, useContext } from 'react';
import { AccordionHandlingProps } from '../../types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Accordion/AccordionItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { createContext, useContext } from 'react';
import { AccordionItemContextProps } from '../../types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import React from 'react';
import { UncontrolledAccordionProps } from '../../types';
import Accordion from './Accordion';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Accordion/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './Accordion';
export * from './AccordionItem';
export * from './AccordionHeader';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { ElementType } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Alert/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './Alert';
export * from './useAlertStyleProps';
export { default as Alert } from './Alert';
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { ElementType, Fragment } from 'react';
import { useStyleProps } from '../../hooks/styleProps';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Breadcrumbs/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './Breadcrumbs';
export { default as Breadcrumbs } from './Breadcrumbs';
export * from './BreadcrumbsItem';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { ElementType, ForwardedRef, forwardRef } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Button/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './Button';
export * from './useButtonAriaProps';
export * from './useButtonStyleProps';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/ButtonLink/ButtonLink.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { ElementType, ForwardedRef, forwardRef } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/ButtonLink/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './ButtonLink';
export * from './useButtonLinkAriaProps';
export * from './useButtonLinkStyleProps';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { forwardRef, ForwardedRef } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Checkbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './Checkbox';
export * from './useCheckboxStyleProps';
export { default as Checkbox } from './Checkbox';
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Collapse/Collapse.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { MutableRefObject, useRef } from 'react';
import { Transition, TransitionStatus } from 'react-transition-group';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import React from 'react';
import { SpiritUncontrolledCollapseProps } from '../../types';
import Collapse from './Collapse';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Collapse/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './Collapse';
export { default as Collapse } from './Collapse';
export * from './UncontrolledCollapse';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Container/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks/styleProps';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Container/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
'use client';

export * from './Container';
export { default as Container } from './Container';
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import React, { useRef, MutableRefObject, Children, cloneElement, forwardRef, ReactElement, ForwardedRef } from 'react';
import { useCancelEvent, useClickOutside } from '../../hooks';
import { DialogProps } from '../../types';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Dialog/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './Dialog';
export { default as Dialog } from './Dialog';
export * from './useDialog';
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Divider/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Divider/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './Divider';
export * from './useDividerStyleProps';
export { default as Divider } from './Divider';
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { useRef } from 'react';
import { useClickOutside, useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Dropdown/DropdownContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { MutableRefObject, createContext, useContext } from 'react';
import { Placements } from '../../constants';
import { ClickEvent, PlacementDictionaryType } from '../../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { ElementType } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { useRef } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Dropdown/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export { default as Dropdown } from './Dropdown';
export { default as DropdownTrigger } from './DropdownTrigger';
export { default as DropdownPopover } from './DropdownPopover';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Field/HelperText.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import React, { ElementType, useEffect } from 'react';
import { HelperTextProps } from './types';

Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Field/ValidationText.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import React, { ElementType, useEffect } from 'react';
import { ValidationTextProps } from './types';

Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Field/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './HelperText';
export * from './useAriaIds';
export * from './ValidationText';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/FieldGroup/FieldGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/FieldGroup/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
'use client';

export * from './FieldGroup';
export { default as FieldGroup } from './FieldGroup';
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import React from 'react';
import { FileMetadata } from '../../types/fileUploader';
import { IMAGE_DIMENSION } from './constants';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { MouseEvent, RefObject, useRef, useState } from 'react';
import { useClassNamePrefix, useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { createContext, useContext } from 'react';
import { FileUploaderHandlingProps, FileUploaderErrorMessagesProps } from '../../types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useDeprecationMessage, useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { useMemo } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import React, { useEffect } from 'react';
import { SpiritUncontrolledFileUploaderProps } from '../../types';
import FileUploader from './FileUploader';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/FileUploader/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export { default as FileUploader } from './FileUploader';
export { default as FileUploaderInput } from './FileUploaderInput';
export { default as FileUploaderList } from './FileUploaderList';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Grid/Grid.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { ElementType } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Grid/GridItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { ElementType } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Grid/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export * from './Grid';
export * from './GridItem';
export * from './useGridStyleProps';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Header/HeaderButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Header/HeaderDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps, useLastActiveFocus } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { createContext, useContext } from 'react';
import { ClickEvent } from '../../types';

Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Header/HeaderDialogLink.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { ElementType, forwardRef } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Header/HeaderDialogNav.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Header/HeaderDialogText.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
2 changes: 2 additions & 0 deletions packages/web-react/src/components/Header/HeaderLink.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import classNames from 'classnames';
import React, { ElementType, forwardRef } from 'react';
import { useStyleProps } from '../../hooks';
Expand Down
Loading

0 comments on commit 2e8551b

Please sign in to comment.