chore: добавить frontend правила и шаблоны SLM
- добавлены frontend инструкции AGENTS и локальный style guide - актуализированы SLM templates под Vite React и слой infra - добавлены шаблоны component, infra и factory-based business - нормализованы примеры документации под alias infra
This commit is contained in:
2
.templates/widget/{{name.kebabCase}}/index.ts
Normal file
2
.templates/widget/{{name.kebabCase}}/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { {{name.pascalCase}}Widget } from './{{name.kebabCase}}'
|
||||
export type { {{name.pascalCase}}WidgetProps } from './types/{{name.kebabCase}}.type'
|
||||
@@ -0,0 +1,2 @@
|
||||
.root {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { ComponentPropsWithoutRef, ReactNode } from 'react'
|
||||
|
||||
/**
|
||||
* Параметры виджета {{name.pascalCase}}.
|
||||
*/
|
||||
export type {{name.pascalCase}}WidgetParams = {
|
||||
/** Содержимое виджета. */
|
||||
children?: ReactNode
|
||||
}
|
||||
|
||||
/** Атрибуты корневого элемента без children. */
|
||||
type RootAttrs = Omit<ComponentPropsWithoutRef<'div'>, 'children'>
|
||||
|
||||
export type {{name.pascalCase}}WidgetProps = RootAttrs & {{name.pascalCase}}WidgetParams
|
||||
20
.templates/widget/{{name.kebabCase}}/{{name.kebabCase}}.tsx
Normal file
20
.templates/widget/{{name.kebabCase}}/{{name.kebabCase}}.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import cl from 'clsx'
|
||||
import type { {{name.pascalCase}}WidgetProps } from './types/{{name.kebabCase}}.type'
|
||||
import styles from './styles/{{name.kebabCase}}.module.css'
|
||||
|
||||
/**
|
||||
* <Назначение виджета {{name.pascalCase}} в 1 строке>.
|
||||
*
|
||||
* Используется для:
|
||||
* - <сценарий 1>
|
||||
* - <сценарий 2>
|
||||
*/
|
||||
export const {{name.pascalCase}}Widget = (props: {{name.pascalCase}}WidgetProps) => {
|
||||
const { children, className, ...rootAttrs } = props
|
||||
|
||||
return (
|
||||
<div {...rootAttrs} className={cl(styles.root, className)}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user