Skip to content

Commit

Permalink
Refactor icon file structure (#11825)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasEng authored Dec 11, 2023
1 parent 646a5bc commit ecbbd7f
Show file tree
Hide file tree
Showing 29 changed files with 26 additions and 108 deletions.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion frontend/libs/studio-icons/src/components/Group/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion frontend/libs/studio-icons/src/components/Likert/index.ts

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion frontend/libs/studio-icons/src/components/NavBar/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion frontend/libs/studio-icons/src/components/Select/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion frontend/libs/studio-icons/src/components/Title/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/libs/studio-icons/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Re-export all icons from @navikt/aksel-icons to make them available for consumers of studio/icons
export * from '@navikt/aksel-icons';

export * from './components';
export * from './types/IconProps';
export * from './react/icons';
export * from './react/types';
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { Accordion } from '@studio/icons';
*/
export const Accordion = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { Checkbox } from '@studio/icons';
*/
export const Checkbox = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { Group } from '@studio/icons';
*/
export const Group = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { Likert } from '@studio/icons';
*/
export const Likert = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { LongText } from '@studio/icons';
*/
export const LongText = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { NavBar } from '@studio/icons';
*/
export const NavBar = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { Paragraph } from '@studio/icons';
*/
export const Paragraph = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { RadioButton } from '@studio/icons';
*/
export const RadioButton = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { Select } from '@studio/icons';
*/
export const Select = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { ShortText } from '@studio/icons';
*/
export const ShortText = ({ ...props }: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';

/**
* @param {SvgTemplateProps} props the SvgTemplate props
* @returns {JSX.Element} template for svg icons
*/
import { IconProps } from '../types';

type SvgTemplateProps = IconProps & { children: React.ReactNode };
export const SvgTemplate = ({ title, children, ...rest }: SvgTemplateProps): JSX.Element => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react';
import { IconProps } from '../../types/IconProps';
import { SvgTemplate } from '../SvgTemplate';
import { IconProps } from '../types';
import { SvgTemplate } from './SvgTemplate';

/**
* @param {IconProps} props the icon props
* @returns {JSX.Element} the icon as a react component
* @example
* import { Title } from '@studio/icons';
*/
export const Title = (props: IconProps): JSX.Element => {
return (
<SvgTemplate {...props}>
Expand Down
1 change: 1 addition & 0 deletions frontend/libs/studio-icons/src/react/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type { IconProps } from './IconProps';

0 comments on commit ecbbd7f

Please sign in to comment.