Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: UI components #8

Closed
wants to merge 3 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,253 changes: 1,056 additions & 197 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/fsevents-patch-6b67494872-10.zip
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ms-npm-2.1.3-81ff3cfac1-aa92de6080.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
compressionLevel: mixed

defaultSemverRangePrefix: ''
defaultSemverRangePrefix: ""

enableGlobalCache: false

Expand Down
17 changes: 17 additions & 0 deletions app/entrypoints/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { join } from 'path'
import { dirname } from 'path'

import { fileURLToPath } from 'url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

/** @type {import('next').NextConfig} */
export default {
experimental: {
externalDir: true,
outputFileTracingRoot: join(__dirname, './'),
esmExternals: 'loose',
},
output: 'standalone',
}
23 changes: 23 additions & 0 deletions app/entrypoints/renderer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@identity/renderer-entrypoint",
"version": "0.0.1",
"license": "BSD-3-Clause",
"type": "module",
"scripts": {
"build": "yarn next build src --no-lint && rm ./src/.next/standalone/package.json ; cp -r ./src/.next/standalone ./dist && cp -r ./src/.next/static ./dist/src/.next/static && mv ./dist/src/server.js ./dist/src/index.cjs",
"dev": "yarn next dev src",
"prepack": "run build",
"start": "node dist/src/index.cjs"
},
"dependencies": {
"next": "14.1.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "20.11.5",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"typescript": "5.2.2"
}
}
13 changes: 13 additions & 0 deletions app/entrypoints/renderer/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";

export default function RootLayout({children,}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>{children}
<p>This is Layout</p>
</body>
</html>
)
}
10 changes: 10 additions & 0 deletions app/entrypoints/renderer/src/app/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @ts-check

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */
}

export default nextConfig
6 changes: 6 additions & 0 deletions app/entrypoints/renderer/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";

export default function Page() {
return

<h1>Team management</h1>}
5 changes: 5 additions & 0 deletions app/entrypoints/renderer/src/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
34 changes: 34 additions & 0 deletions app/entrypoints/renderer/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
]
},
"include": [
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "template",
"name": "team-management",
"private": true,
"license": "BSD 3-Clause",
"scripts": {
"prepare": "husky"
},
"workspaces": [
"app/**/*",
"ui/**/*"
],
"devDependencies": {
"@atls/code-service": "0.1.4",
"@atls/config-eslint": "0.0.12",
Expand All @@ -14,10 +15,18 @@
"@types/eslint": "^8",
"@types/jest": "29.5.12",
"@types/node": "20.12.8",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"eslint": "8.57.0",
"husky": "9.0.11",
"prettier": "3.1.1",
"typescript": "5.2.2"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"linterIgnorePatterns": [
"**/next.config.js"
],
"typecheckIgnorePatterns": [
"**/next-env.d.ts"
]
}
43 changes: 43 additions & 0 deletions ui/avatar/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@atls-ui-proto/avatar",
"version": "0.1.1",
"license": "BSD-3-Clause",
"main": "src/index.ts",
"files": [
"dist"
],
"scripts": {
"build": "yarn library build",
"prepack": "yarn run build",
"postpack": "rm -rf dist"
},
"dependencies": {
"@atls-ui-proto/core": "workspace:*",
"@radix-ui/react-avatar": "1.0.3",
"@stitches/react": "1.2.8"
},
"devDependencies": {
"@atls-ui-parts/text-transform": "workspace:*",
"@emotion/styled": "11.11.0",
"@types/node": "20.5.7",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"@types/styled-system": "5.1.22",
"react": "18.2.0",
"react-dom": "18.2.0",
"styled-system": "5.1.5",
"styled-tools": "1.7.2"
},
"peerDependencies": {
"@emotion/styled": "11.11.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"styled-system": "5.1.5",
"styled-tools": "1.7.2"
},
"publishConfig": {
"access": "public",
"main": "dist/index.js",
"typings": "dist/index.d.ts"
}
}
35 changes: 35 additions & 0 deletions ui/avatar/src/avatar-fallback.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Fallback } from '@radix-ui/react-avatar'

import { styled } from '@atls-ui-proto/core'
import { theme } from '@atls-ui-proto/core'

export const AvatarFallback = styled(Fallback, {
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontFamily: theme.fonts.primary,
color: theme.colors.white,

variants: {
size: {
small: {
fontWeight: theme.fontWeights.bold,
fontSize: 18,
},
normal: {
fontWeight: theme.fontWeights.bold,
fontSize: 20,
},
large: {
fontWeight: theme.fontWeights.bold,
fontSize: 22,
},
},
},

defaultVariants: {
size: 'normal',
},
})
10 changes: 10 additions & 0 deletions ui/avatar/src/avatar-image.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Image } from '@radix-ui/react-avatar'

import { styled } from '@atls-ui-proto/core'

export const AvatarImage = styled(Image, {
width: '100%',
height: '100%',
objectFit: 'cover',
borderRadius: 'inherit',
})
45 changes: 45 additions & 0 deletions ui/avatar/src/avatar.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Root } from '@radix-ui/react-avatar'

import { styled } from '@atls-ui-proto/core'
import { theme } from '@atls-ui-proto/core'

export const Avatar = styled(Root, {
alignItems: 'center',
display: 'flex',
justifyContent: 'center',
verticalAlign: 'middle',
overflow: 'hidden',
boxSizing: 'border-box',
userSelect: 'none',
backgroundColor: theme.colors.black,

variants: {
shape: {
circle: {
borderRadius: '100%',
},
square: {
borderRadius: 4,
},
},
size: {
small: {
width: 40,
height: 40,
},
normal: {
width: 48,
height: 48,
},
large: {
height: 56,
width: 56,
},
},
},

defaultVariants: {
shape: 'circle',
size: 'normal',
},
})
68 changes: 68 additions & 0 deletions ui/avatar/src/avatar.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import React from 'react'

import { TextTransform } from '@atls-ui-parts/text-transform'

import { AvatarFallback } from './avatar-fallback.component'
import { AvatarImage } from './avatar-image.component'
import { Avatar as AvatarRoot } from './avatar.component'

export default {
title: 'Components/Avatar',
}

export const Avatar = ({ size, shape, image, fallback }) => (
<AvatarRoot shape={shape} size={size}>
<AvatarImage src={image} />
<AvatarFallback size={size}>
<TextTransform firstLetter upperCase>
{fallback}
</TextTransform>
</AvatarFallback>
</AvatarRoot>
)

Avatar.args = {
image: 'https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80',
fallback: 'Аватар',
size: 'normal',
shape: 'circle',
}

Avatar.argTypes = {
image: {
name: 'Изображение',
description: 'Основной контент, изображение',
table: {
category: 'Наполнение',
},
},
fallback: {
name: 'Контент',
description: 'Основной контент, описание',
table: {
category: 'Наполнение',
},
},
size: {
name: 'Размер',
description: 'Размер',
control: {
type: 'radio',
options: ['small', 'normal', 'large'],
},
table: {
category: 'Форма',
},
},
shape: {
name: 'Форма',
description: 'Форма кнопки',
table: {
category: 'Форма',
},
control: {
type: 'inline-radio',
options: ['square', 'circle'],
},
},
}
3 changes: 3 additions & 0 deletions ui/avatar/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './avatar-fallback.component'
export * from './avatar-image.component'
export * from './avatar.component'
9 changes: 9 additions & 0 deletions ui/button/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

## BREAKING CHANGE 0.0.18

Для отсутствия ошибки `Warning: Received `true` for a non-boolean attribute ...` используются
[`transient-props`](https://styled-components.com/docs/api#transient-props)

- пропс `fill` => `$fill`
- пропс `inverted` => `$inverted`
Loading
Loading