Skip to content

Commit

Permalink
fix: remove ngi-core
Browse files Browse the repository at this point in the history
  • Loading branch information
KarineBrandelli committed May 7, 2024
1 parent d10b6d2 commit 377707c
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 303 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nginformatica-styleguide",
"version": "1.0.3",
"version": "1.0.4",
"description": "The Design System for the NG Saas Products",
"main": "lib/index.js",
"author": "void",
Expand Down Expand Up @@ -40,7 +40,7 @@
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"amazing-react-charts": "^1.0.8",
"amazing-react-charts": "1.0.8",
"babel-loader": "9.1.3",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
Expand All @@ -50,7 +50,6 @@
"eslint-plugin-react": "7.34.1",
"flipper-ui": "0.31.5",
"fs-extra": "11.2.0",
"ngi-core": "git+ssh://git@ssh.dev.azure.com:v3/nginformatica/Pesquisa%20e%20Desenvolvimento/frontend-core#release/0.4.3",
"prettier": "3.2.5",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand Down
3 changes: 0 additions & 3 deletions src/web/docs/Introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ Entre os projetos desenvolvidos, encontram-se:
<div style={{ display: "flex", justifyContent: "space-between" }}>
<div style={{ width: "35%", textAlign: "justify", margin: "auto 0" }}>
O **[frontend-core](https://frontend.ngi.com.br/)** é uma biblioteca interna que atende apenas as especifidades em comum das aplicações SaaS da NG, como por exemplo, regras de negócio específicas necessárias para o funcionamento das aplicações, sejam elas inputs de pesquisa, calendários, sistemas de notificação, inputs de senha, entre outros.


Caso você tenha acesso, aqui se encontra o repositório no [Azure](https://dev.azure.com/nginformatica/Pesquisa%20e%20Desenvolvimento/_git/frontend-core).
</div>
<div style={{ width: "55%" }}>
<img src={frontendcore} width="100%" />
Expand Down
56 changes: 0 additions & 56 deletions src/web/docs/UsageGuide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import * as UsageStories from './UsageGuide.stories';
[amazing-react-charts](#amazing-react-charts)
&nbsp;|&nbsp;
[flipper-ui](#flipper-ui)
&nbsp;|&nbsp;
[frontend-core](#frontend-core)

## Usage Guide

Expand Down Expand Up @@ -154,57 +152,3 @@ const App = () => (
<Canvas of={UsageStories.flipperIcon} />
</div>
</div>

### frontend-core

**1.** Instale o pacote via ssh do azure, onde o número seguido do `#/release` é a versão atual do pacote:

```sh
"ngi-core": "git+ssh://git@ssh.dev.azure.com:v3/nginformatica/Pesquisa%20e%20Desenvolvimento/frontend-core#release/0.4.3",
```

**2.** Importe o componente desejado e utilize conforme estipulado:

<div style={{ display: "flex", justifyContent: "space-between" }}>
<div style={{ width: "51%"}}>
```tsx
import React from 'react'
import { Button } from 'flipper-ui'
import { Notification, useNotification } from 'ngi-core'
import { theme } from 'flipper-ui/theme'

const { primary } = theme.colors

const messageExtractor = (arg: Error | string) =>
typeof arg === 'string' ? arg : arg.message

const Notification = () => {
const [notify] = useNotification()

const variants: TNotificationType[] = [
'error',
'info',
'success',
'warning'
]

return (
<Notification messageExtractor={messageExtractor}>
{variants.map(variant => (
<Button
key={variant}
onClick={
() => notify(variant, 'message')}>
{variant}
</Button>
))}
</Notification>
)
}
```
</div>

<div style={{ width: "48%"}}>
<Canvas of={UsageStories.notification} />
</div>
</div>
41 changes: 0 additions & 41 deletions src/web/docs/UsageGuide.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import React from 'react'
import { DonutChart } from 'amazing-react-charts'
import { Button } from 'flipper-ui'
import { PhotoCamera } from 'flipper-ui/icons'
import { Notification, useNotification } from 'ngi-core'
import type { Meta } from '@storybook/react'
import type { TNotificationType } from 'ngi-core/components/notification/useNotification'
import { WrapperButton, WrapperNotification } from '../../styles'
import { theme } from 'flipper-ui/theme'

const { primary } = theme.colors
Expand Down Expand Up @@ -64,41 +61,3 @@ export const flipperIcon = {
layout: 'centered'
}
}

const messageExtractor = (arg: Error | string) =>
typeof arg === 'string' ? arg : arg.message

const NotificationWrapper = () => {
const [notify] = useNotification()
const variants: TNotificationType[] = [
'error',
'info',
'success',
'warning'
]

return (
<WrapperNotification>
{variants.map(variant => (
<WrapperButton
key={variant}
onClick={() => notify(variant, 'message')}>
{variant}
</WrapperButton>
))}
</WrapperNotification>
)
}

export const notification = {
render: () => {
return (
<Notification messageExtractor={messageExtractor}>
<NotificationWrapper />
</Notification>
)
},
parameters: {
layout: 'centered'
}
}
Loading

0 comments on commit 377707c

Please sign in to comment.