Skip to content

Commit

Permalink
move pando Document react components (frzyc#2355)
Browse files Browse the repository at this point in the history
* move pando Document react components

* no d.ts i guess
  • Loading branch information
frzyc authored Aug 1, 2024
1 parent 5709569 commit 00e5eb2
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 39 deletions.
2 changes: 1 addition & 1 deletion apps/gi-frontend/src/app/teams/[teamId]/CalcWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
} from '@genshin-optimizer/gi/formula'
import type { IWeapon } from '@genshin-optimizer/gi/good'
import { getMainStatValue } from '@genshin-optimizer/gi/util'
import { CalcContext } from '@genshin-optimizer/pando/ui-sheet'
import type { ReactNode } from 'react'
import { useContext, useMemo } from 'react'
import { CalcContext } from './CalcContext'
import { TeamContext } from './TeamContext'
import { TeamLoadoutCharacterToICharacter } from './teamUtil'

Expand Down
2 changes: 1 addition & 1 deletion apps/gi-frontend/src/app/teams/[teamId]/TalentContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { uiSheets } from '@genshin-optimizer/gi/formula-ui'
import { type TalentSheetElementKey } from '@genshin-optimizer/gi/sheets'
import type { UISheetElement } from '@genshin-optimizer/pando/ui-sheet'
import { DocumentDisplay } from '@genshin-optimizer/pando/ui-sheet'
import {
Box,
CardActionArea,
Expand All @@ -27,7 +28,6 @@ import {
import type { ReactNode } from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { DocumentDisplay } from './DocumentDisplay'
import type { TeamLoadoutCharacter } from './getTeam'

const talentSpacing = {
Expand Down
3 changes: 1 addition & 2 deletions apps/gi-frontend/src/app/teams/[teamId]/TeamCharacter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

import { CardThemed } from '@genshin-optimizer/common/ui'
import { convert, selfTag } from '@genshin-optimizer/gi/formula'
import { CalcContext, MemberContext } from '@genshin-optimizer/pando/ui-sheet'
import { CardContent, CardHeader, Stack, Typography } from '@mui/material'
import { useContext, useMemo, useState } from 'react'
import { CalcContext } from './CalcContext'
import { CalcWrapper } from './CalcWrapper'
import { MemberContext } from './MemberContext'
import CharacterTalentPane from './TalentContent'
import { TeamContext } from './TeamContext'
import type { TeamLoadoutCharacter } from './getTeam'
Expand Down
6 changes: 5 additions & 1 deletion apps/gi-frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
"../../apps/gi-frontend/.next/types/**/*.ts",
"../../dist/apps/gi-frontend/.next/types/**/*.ts",
"next-env.d.ts",
".next/types/**/*.ts"
".next/types/**/*.ts",
"../../libs/pando/ui-sheet/src/components/DocumentDisplay.tsx",
"../../libs/pando/ui-sheet/src/components/FieldDisplay.tsx",
"../../libs/pando/ui-sheet/src/context/CalcContext.ts",
"../../libs/pando/ui-sheet/src/MemberContext.ts"
],
"exclude": ["node_modules", "jest.config.ts", "**/*.spec.ts", "**/*.test.ts"]
}
12 changes: 2 additions & 10 deletions libs/pando/ui-sheet/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/pando/ui-sheet/src",
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/pando/ui-sheet/**/*.ts"]
}
}
},
"tags": []
"tags": [],
"targets": {}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
'use client'
import type { CardBackgroundColor } from '@genshin-optimizer/common/ui'
import { CardHeaderCustom, CardThemed } from '@genshin-optimizer/common/ui'
import type {
Document,
FieldsDocument,
Header,
TextDocument,
} from '@genshin-optimizer/pando/ui-sheet'
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'
import { Box, Collapse, Divider } from '@mui/material'
import { useState } from 'react'
import type { Document, FieldsDocument, Header, TextDocument } from '../types'
import { FieldsDisplay } from './FieldDisplay'

export function DocumentDisplay({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@ import {
type CardBackgroundColor,
} from '@genshin-optimizer/common/ui'
import { valueString } from '@genshin-optimizer/common/util'
import type {
Field,
TagField,
TextField,
} from '@genshin-optimizer/pando/ui-sheet'
import GroupsIcon from '@mui/icons-material/Groups'
import type { ListProps, Palette, PaletteColor } from '@mui/material'
import { Box, List, ListItem, Typography, styled } from '@mui/material'
import type { ReactNode } from 'react'
import React, { useContext } from 'react'
import { CalcContext } from './CalcContext'
import { MemberContext } from './MemberContext'
import { CalcContext, MemberContext } from '../context'
import type { Field, TagField, TextField } from '../types'

export function FieldsDisplay({
fields,
Expand Down
2 changes: 2 additions & 0 deletions libs/pando/ui-sheet/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './DocumentDisplay'
export * from './FieldDisplay'
2 changes: 2 additions & 0 deletions libs/pando/ui-sheet/src/context/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './CalcContext'
export * from './MemberContext'
8 changes: 3 additions & 5 deletions libs/pando/ui-sheet/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export * from './conditional'
export * from './document'
export * from './field'
export * from './header'
export * from './sheet'
export * from './components'
export * from './context'
export * from './types'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions libs/pando/ui-sheet/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './conditional'
export * from './document'
export * from './field'
export * from './header'
export * from './sheet'
File renamed without changes.
9 changes: 6 additions & 3 deletions libs/pando/ui-sheet/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"jsx": "react-jsx",
"jsxImportSource": "@emotion/react",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"exactOptionalPropertyTypes": false,
"allowSyntheticDefaultImports": true
},
"files": [],
"include": [],
Expand Down
21 changes: 18 additions & 3 deletions libs/pando/ui-sheet/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,23 @@
"compilerOptions": {
"outDir": "../../../dist/out-tsc",
"declaration": true,
"types": ["node"]
"types": [
"node",
"object-overrides",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
"exclude": [
"jest.config.ts",
"src/**/*.spec.ts",
"src/**/*.test.ts",
"src/**/*.spec.tsx",
"src/**/*.test.tsx",
"src/**/*.spec.js",
"src/**/*.test.js",
"src/**/*.spec.jsx",
"src/**/*.test.jsx"
],
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
}

0 comments on commit 00e5eb2

Please sign in to comment.