diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b7a611 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +apps/web/presets/** linguist-vendored \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7865801..c397395 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,5 @@ name: CI + on: push: branches: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..8c3fa4c --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,38 @@ +name: Release + +on: + push: + branches: + - main + +jobs: + release: + permissions: + contents: write + issues: write + pull-requests: write + runs-on: ubuntu-22.04 + strategy: + matrix: + node-version: [20] + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install dependencies + run: pnpm add -g semantic-release @semantic-release/git @semantic-release/github + + - name: Release + run: pnpm exec semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index cc1a759..8ae51a1 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Henshi is a webapp based on microservices architecture, it uses Vue.js as its pr - [PostgreSQL](https://postgresql.org) as its SQL database - [Redis](https://redis.io) as cache and key-value database - [Nginx](https://nginx.org) as a reverse proxy -- [gRPC](https://grpc.io) as an synchronous method of communication between the services (🚧 **In progress**) +- [gRPC](https://grpc.io) as a synchronous method of communication between the services - [RabbitMQ](https://rabbitmq.com) as an asynchronous method of communication between the services (🚧 **In progress**) - [Docker](https://docker.com) as its container management tool - [Kubernetes](https://kubernetes.io) as its container orchestration tool (🚧 **In progress**) @@ -31,6 +31,7 @@ flowchart LR FE(fa:fa-twitter Frontend) LB(Reverse proxy) A(Auth API) + A-R[(Redis)] U(Users API) U-P[(PostgreSQL)] N(Notification API) @@ -48,7 +49,7 @@ flowchart LR RMQ <-.->|AMQP| AS subgraph AS [Auth service] direction LR - A + A --> A-R end subgraph US [Users service] direction LR diff --git a/apps/auth-service/nest-cli.json b/apps/auth-service/nest-cli.json index f9aa683..d685b71 100644 --- a/apps/auth-service/nest-cli.json +++ b/apps/auth-service/nest-cli.json @@ -3,6 +3,8 @@ "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { - "deleteOutDir": true + "deleteOutDir": true, + "assets": ["**/*.proto"], + "watchAssets": true } } diff --git a/apps/auth-service/package.json b/apps/auth-service/package.json index 1780f67..dc44148 100644 --- a/apps/auth-service/package.json +++ b/apps/auth-service/package.json @@ -20,6 +20,8 @@ "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { + "@grpc/grpc-js": "^1.10.8", + "@grpc/proto-loader": "^0.7.13", "@henshi/types": "workspace:*", "@nestjs/cache-manager": "^2.2.2", "@nestjs/common": "^10.3.8", diff --git a/apps/auth-service/src/auth/auth.grpc.controller.ts b/apps/auth-service/src/auth/auth.grpc.controller.ts new file mode 100644 index 0000000..6eb9e0e --- /dev/null +++ b/apps/auth-service/src/auth/auth.grpc.controller.ts @@ -0,0 +1,15 @@ +import { Controller } from '@nestjs/common'; +import { AuthServiceController, AuthServiceControllerMethods, JwtUserOrUndefined, MeRequest } from '@henshi/types'; +import { AuthService } from './auth.service'; + +@Controller() +@AuthServiceControllerMethods() +export class AuthGrpcController implements AuthServiceController { + constructor(private readonly authService: AuthService) {} + + me({ jwt }: MeRequest): JwtUserOrUndefined { + if (!jwt) return { user: undefined }; + + return this.authService.getTokenPayload(jwt); + } +} diff --git a/apps/auth-service/src/auth/auth.module.ts b/apps/auth-service/src/auth/auth.module.ts index 4235de9..016bee0 100644 --- a/apps/auth-service/src/auth/auth.module.ts +++ b/apps/auth-service/src/auth/auth.module.ts @@ -1,29 +1,44 @@ import { Module } from '@nestjs/common'; import { AuthService } from './auth.service'; -import { AuthController } from './auth.controller'; import { JwtModule } from '@nestjs/jwt'; import { AccessTokenStrategy } from './strategies/accessToken.strategy'; import { RefreshTokenStrategy } from './strategies/refreshToken.strategy'; -import { UserModule } from '../users/users.module'; -import { UsersService } from '../users/users.service'; import { ClientsModule, Transport } from '@nestjs/microservices'; +import { ConfigService } from '@nestjs/config'; +import { USERS_PACKAGE_NAME, USERS_SERVICE_NAME } from '@henshi/types'; +import { AuthRestController } from './auth.rest.controller'; +import { AuthGrpcController } from './auth.grpc.controller'; +import { join } from 'node:path/win32'; @Module({ imports: [ - ClientsModule.register([ - { - name: 'USERS_SERVICE', - transport: Transport.TCP, - options: { - host: 'localhost', - port: 4010, + ClientsModule.registerAsync({ + clients: [ + { + name: USERS_SERVICE_NAME, + useFactory: (configService: ConfigService) => { + return { + transport: Transport.GRPC, + options: { + package: USERS_PACKAGE_NAME, + protoPath: join( + __dirname, + '../../node_modules/@henshi/types/src/lib/proto/users.proto', + ), + url: + configService.get('microservices.users.host') + + ':' + + configService.get('microservices.users.port'), + }, + }; + }, + inject: [ConfigService], }, - }, - ]), + ], + }), JwtModule.register({}), - UserModule, ], - controllers: [AuthController], - providers: [AuthService, AccessTokenStrategy, RefreshTokenStrategy, UsersService], + controllers: [AuthRestController, AuthGrpcController], + providers: [AuthService, AccessTokenStrategy, RefreshTokenStrategy], }) export class AuthModule {} diff --git a/apps/auth-service/src/auth/auth.controller.ts b/apps/auth-service/src/auth/auth.rest.controller.ts similarity index 92% rename from apps/auth-service/src/auth/auth.controller.ts rename to apps/auth-service/src/auth/auth.rest.controller.ts index 35c38cd..1d9cc7d 100644 --- a/apps/auth-service/src/auth/auth.controller.ts +++ b/apps/auth-service/src/auth/auth.rest.controller.ts @@ -5,11 +5,10 @@ import { AuthDto } from './dto/auth.dto'; import { AccessTokenGuard } from '../shared/guards/accessToken.guard'; import { RefreshTokenGuard } from '../shared/guards/refreshToken.guard'; import { accessTokenCookieOptions, refreshTokenCookieOptions } from './utils/cookieOptions'; -import { MessagePattern } from '@nestjs/microservices'; import { SignUpDto, SignUpResponse } from '@henshi/types'; @Controller('/api/auth') -export class AuthController { +export class AuthRestController { constructor(private readonly authService: AuthService) {} @Post('signup') @@ -87,11 +86,4 @@ export class AuthController { async me(@Req() req: Request) { return req.user; } - - @MessagePattern('me') - async isLoggedIn({ jwt }: { jwt?: string }) { - if (!jwt) return false; - - return this.authService.getTokenPayload(jwt); - } } diff --git a/apps/auth-service/src/auth/auth.service.ts b/apps/auth-service/src/auth/auth.service.ts index b1f9ec6..2dae2ad 100644 --- a/apps/auth-service/src/auth/auth.service.ts +++ b/apps/auth-service/src/auth/auth.service.ts @@ -1,29 +1,38 @@ -import { BadRequestException, ForbiddenException, Inject, Injectable } from '@nestjs/common'; +import { BadRequestException, ForbiddenException, Inject, Injectable, OnModuleInit } from '@nestjs/common'; import * as argon2 from 'argon2'; import { AuthDto } from './dto/auth.dto'; -import { UsersService } from '../users/users.service'; import { JwtService } from '@nestjs/jwt'; -import { SignUpDto, User } from '@henshi/types'; +import { SignUpDto, User, USERS_SERVICE_NAME, UsersServiceClient } from '@henshi/types'; import { ConfigService } from '@nestjs/config'; import { CACHE_MANAGER } from '@nestjs/cache-manager'; import { Cache } from 'cache-manager'; import * as crypto from 'node:crypto'; +import { ClientGrpc } from '@nestjs/microservices'; +import { firstValueFrom } from 'rxjs'; // import { emailTransporter } from '../mail/transport'; // import { getEmailConfirmationBody } from '../mail/body'; @Injectable() -export class AuthService { +export class AuthService implements OnModuleInit { + private usersService: UsersServiceClient; + constructor( @Inject(CACHE_MANAGER) private readonly cacheManager: Cache, - private readonly usersService: UsersService, + @Inject(USERS_SERVICE_NAME) private readonly client: ClientGrpc, private readonly jwtService: JwtService, private readonly configService: ConfigService, ) {} - async signUp(signUpDto: SignUpDto): Promise { - const userExists = await this.usersService.findOne({ - email: signUpDto.email, - }); + onModuleInit() { + this.usersService = this.client.getService(USERS_SERVICE_NAME); + } + + async signUp(signUpDto: SignUpDto) { + const { user: userExists } = await firstValueFrom( + this.usersService.findOne({ + email: signUpDto.email, + }), + ); if (userExists) { throw new BadRequestException('User already exists'); @@ -31,10 +40,13 @@ export class AuthService { const hash = await this.hashData(signUpDto.password); - const newUser = await this.usersService.create({ - ...signUpDto, - password: hash, - }); + const { user: newUser } = await firstValueFrom( + this.usersService.create({ + ...signUpDto, + password: hash, + }), + ); + const tokens = await this.getTokens(newUser); await this.updateRefreshToken(newUser.id, tokens.refreshToken); @@ -43,7 +55,7 @@ export class AuthService { } async signIn(data: AuthDto) { - const user = await this.usersService.findOne({ email: data.email }); + const { user } = await firstValueFrom(this.usersService.findOne({ email: data.email })); if (!user) throw new BadRequestException('The credentials are invalid'); @@ -59,7 +71,7 @@ export class AuthService { } async logout(userId: string) { - return this.usersService.update(userId, { refreshToken: null }); + return this.usersService.update({ id: userId, refreshToken: null }); } hashData(data: string) { @@ -68,9 +80,12 @@ export class AuthService { async updateRefreshToken(userId: string, refreshToken: string) { const hashedRefreshToken = await this.hashData(refreshToken); - await this.usersService.update(userId, { - refreshToken: hashedRefreshToken, - }); + await firstValueFrom( + this.usersService.update({ + id: userId, + refreshToken: hashedRefreshToken, + }), + ); } async getTokens(user: User) { @@ -114,7 +129,7 @@ export class AuthService { } async refreshTokens(userId: string, refreshToken: string) { - const user = await this.usersService.findOne({ id: userId }); + const { user } = await firstValueFrom(this.usersService.findOne({ id: userId })); if (!user || !user.refreshToken) throw new ForbiddenException('Access Denied'); @@ -133,9 +148,10 @@ export class AuthService { async emailConfirmed(userId: string) { await this.cacheManager.del('emailConfirmationToken:' + userId); - await this.usersService.update(userId, { emailConfirmed: true }); + await firstValueFrom(this.usersService.update({ id: userId, emailConfirmed: true })); } + // eslint-disable-next-line @typescript-eslint/no-unused-vars async sendEmailConfirmation(userId: string, userName: string, userEmail: string) { const A_DAY_IN_SECONDS = 86_400; const verificationToken = crypto.randomBytes(64).toString('hex'); @@ -144,6 +160,7 @@ export class AuthService { ttl: A_DAY_IN_SECONDS, } as any); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const url = `${this.configService.get('client.url')}/verify-account?token=${verificationToken}`; // await emailTransporter.sendMail({ diff --git a/apps/auth-service/src/configuration/config.ts b/apps/auth-service/src/configuration/config.ts index f372655..62fd9cd 100644 --- a/apps/auth-service/src/configuration/config.ts +++ b/apps/auth-service/src/configuration/config.ts @@ -4,7 +4,7 @@ import * as process from 'process'; export default () => ({ env: process.env.NODE_ENV, port: parseInt(process.env.PORT, 10) || 3000, - microservice: { + microservices: { auth: { host: process.env.AUTH_MICROSERVICE_HOST || 'localhost', port: parseInt(process.env.AUTH_MICROSERVICE_PORT) || 4000, diff --git a/apps/auth-service/src/main.ts b/apps/auth-service/src/main.ts index 337d858..474362b 100644 --- a/apps/auth-service/src/main.ts +++ b/apps/auth-service/src/main.ts @@ -4,6 +4,8 @@ import { Transport } from '@nestjs/microservices'; import { ConfigService } from '@nestjs/config'; import * as cookieParser from 'cookie-parser'; import helmet from 'helmet'; +import { join } from 'node:path/win32'; +import { AUTH_PACKAGE_NAME } from '@henshi/types'; async function bootstrap() { const app = await NestFactory.create(AppModule); @@ -17,10 +19,11 @@ async function bootstrap() { app.use(helmet()); app.connectMicroservice({ - transport: Transport.TCP, + transport: Transport.GRPC, options: { - host: configService.get('microservices.auth.host'), - port: configService.get('microservice.auth.port'), + package: AUTH_PACKAGE_NAME, + protoPath: join(__dirname, '../node_modules/@henshi/types/src/lib/proto/auth.proto'), + url: configService.get('microservices.auth.host') + ':' + configService.get('microservices.auth.port'), }, }); diff --git a/apps/auth-service/src/users/dto/create-user.dto.ts b/apps/auth-service/src/users/dto/create-user.dto.ts deleted file mode 100644 index 98241dd..0000000 --- a/apps/auth-service/src/users/dto/create-user.dto.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { UserRole } from '@henshi/types'; -import { - IsBoolean, - IsEmail, - IsEnum, - IsOptional, - IsString, - IsStrongPassword, - MaxLength, - MinLength, -} from 'class-validator'; - -export class CreateUserDto { - @MinLength(3) - @MaxLength(255) - @IsString() - name: string; - - @IsEmail() - email: string; - - @IsStrongPassword({ - minLength: 8, - minLowercase: 1, - minUppercase: 1, - minNumbers: 1, - minSymbols: 1, - }) - password: string; - - @IsOptional() - @IsEnum(UserRole) - role: UserRole; - - @IsOptional() - @IsString() - refreshToken?: string; - - @IsOptional() - @IsBoolean() - emailConfirmed?: boolean; -} diff --git a/apps/auth-service/src/users/dto/update-user.dto.ts b/apps/auth-service/src/users/dto/update-user.dto.ts deleted file mode 100644 index dfd37fb..0000000 --- a/apps/auth-service/src/users/dto/update-user.dto.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { PartialType } from '@nestjs/mapped-types'; -import { CreateUserDto } from './create-user.dto'; - -export class UpdateUserDto extends PartialType(CreateUserDto) {} diff --git a/apps/auth-service/src/users/users.module.ts b/apps/auth-service/src/users/users.module.ts deleted file mode 100644 index 328fb75..0000000 --- a/apps/auth-service/src/users/users.module.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Module } from '@nestjs/common'; -import { UsersService } from './users.service'; -import { ClientsModule, Transport } from '@nestjs/microservices'; -import { ConfigService } from '@nestjs/config'; - -@Module({ - imports: [ - ClientsModule.registerAsync({ - clients: [ - { - name: 'USERS_SERVICE', - useFactory: (configService: ConfigService) => { - return { - transport: Transport.TCP, - options: { - host: configService.get('microservices.users.host'), - port: configService.get('microservices.users.port'), - }, - }; - }, - inject: [ConfigService], - }, - ], - }), - ], - controllers: [], - providers: [UsersService], -}) -export class UserModule {} diff --git a/apps/auth-service/src/users/users.service.ts b/apps/auth-service/src/users/users.service.ts deleted file mode 100644 index aab2fb4..0000000 --- a/apps/auth-service/src/users/users.service.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Inject, Injectable } from '@nestjs/common'; -import { ClientProxy } from '@nestjs/microservices'; -import { firstValueFrom } from 'rxjs'; -import { User } from '@henshi/types'; - -@Injectable() -export class UsersService { - constructor(@Inject('USERS_SERVICE') private readonly usersClient: ClientProxy) {} - - findOne(query: Record) { - return firstValueFrom(this.usersClient.send('findOne', query)); - } - - create(data: Record) { - return firstValueFrom(this.usersClient.send('create', data)); - } - - update(userId: string, data: Record) { - return firstValueFrom(this.usersClient.send('update', { userId, data })); - } -} diff --git a/apps/users-service/nest-cli.json b/apps/users-service/nest-cli.json index f9aa683..d685b71 100644 --- a/apps/users-service/nest-cli.json +++ b/apps/users-service/nest-cli.json @@ -3,6 +3,8 @@ "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { - "deleteOutDir": true + "deleteOutDir": true, + "assets": ["**/*.proto"], + "watchAssets": true } } diff --git a/apps/users-service/package.json b/apps/users-service/package.json index 2e778ff..e048fba 100644 --- a/apps/users-service/package.json +++ b/apps/users-service/package.json @@ -25,6 +25,8 @@ "migration:revert": "npx typeorm-ts-node-commonjs migration:revert -d ./src/database/data-source.ts" }, "dependencies": { + "@grpc/grpc-js": "^1.10.8", + "@grpc/proto-loader": "^0.7.13", "@henshi/decorators": "workspace:*", "@henshi/guards": "workspace:*", "@henshi/types": "workspace:*", @@ -35,6 +37,7 @@ "@nestjs/microservices": "^10.3.8", "@nestjs/platform-express": "^10.0.0", "@nestjs/typeorm": "^10.0.2", + "class-transformer": "^0.5.1", "class-validator": "^0.14.1", "cookie-parser": "^1.4.6", "dotenv": "^16.4.5", @@ -65,6 +68,7 @@ "ts-jest": "^29.1.0", "ts-loader": "^9.4.3", "ts-node": "^10.9.1", + "ts-proto": "^1.156.2", "tsconfig-paths": "^4.2.0", "typescript": "^5.1.3" }, diff --git a/apps/users-service/src/main.ts b/apps/users-service/src/main.ts index 30dd232..194867f 100644 --- a/apps/users-service/src/main.ts +++ b/apps/users-service/src/main.ts @@ -4,6 +4,8 @@ import { Transport } from '@nestjs/microservices'; import { ConfigService } from '@nestjs/config'; import * as cookieParser from 'cookie-parser'; import helmet from 'helmet'; +import { join } from 'node:path/win32'; +import { USERS_PACKAGE_NAME } from '@henshi/types'; async function bootstrap() { const app = await NestFactory.create(AppModule); @@ -17,10 +19,11 @@ async function bootstrap() { app.use(helmet()); app.connectMicroservice({ - transport: Transport.TCP, + transport: Transport.GRPC, options: { - host: configService.get('microservices.users.host'), - port: configService.get('microservices.users.port'), + package: USERS_PACKAGE_NAME, + protoPath: join(__dirname, '../node_modules/@henshi/types/src/lib/proto/users.proto'), + url: configService.get('microservices.users.host') + ':' + configService.get('microservices.users.port'), }, }); diff --git a/apps/users-service/src/users/dto/create-user.dto.ts b/apps/users-service/src/users/dto/create-user.dto.ts index 98241dd..e663ca1 100644 --- a/apps/users-service/src/users/dto/create-user.dto.ts +++ b/apps/users-service/src/users/dto/create-user.dto.ts @@ -30,7 +30,7 @@ export class CreateUserDto { @IsOptional() @IsEnum(UserRole) - role: UserRole; + role?: UserRole; @IsOptional() @IsString() diff --git a/apps/users-service/src/users/entities/user.entity.ts b/apps/users-service/src/users/entities/user.entity.ts index f505323..3deff02 100644 --- a/apps/users-service/src/users/entities/user.entity.ts +++ b/apps/users-service/src/users/entities/user.entity.ts @@ -1,4 +1,5 @@ import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, Index } from 'typeorm'; +import { Exclude } from 'class-transformer'; export enum UserRole { FREE_USER = 'FREE_USER', @@ -18,6 +19,7 @@ export class User { email: string; @Column() + @Exclude() password: string; @Column({ type: 'varchar', enum: UserRole, default: UserRole.FREE_USER }) @@ -27,7 +29,7 @@ export class User { emailConfirmed: boolean; @Column({ nullable: true }) - refreshToken: string; + refreshToken?: string; @CreateDateColumn() createdAt: Date; diff --git a/apps/users-service/src/users/users.controller.ts b/apps/users-service/src/users/users.controller.ts deleted file mode 100644 index 1bc723c..0000000 --- a/apps/users-service/src/users/users.controller.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Controller, Get, Body, UseGuards, Req } from '@nestjs/common'; -import { UsersService } from './users.service'; -import { CreateUserDto } from './dto/create-user.dto'; -import { Request } from 'express'; -import { MessagePattern } from '@nestjs/microservices'; -import { AuthGuard } from '@henshi/guards'; -import { User } from './entities/user.entity'; - -@Controller('/api/users') -export class UsersController { - constructor(private readonly usersService: UsersService) {} - - @UseGuards(AuthGuard) - @Get('me') - async me(@Req() req: Request) { - const user = await this.usersService.findOne(req.user['sub']); - delete user.password; - return user; - } - - @MessagePattern('create') - create(@Body() createUserDto: CreateUserDto) { - return this.usersService.create(createUserDto); - } - - @MessagePattern('findOne') - findOne(query: Partial) { - return this.usersService.findOne(query); - } - - @MessagePattern('update') - update({ userId, data }: { userId: string; data: Partial }) { - return this.usersService.update(userId, data); - } -} diff --git a/apps/users-service/src/users/users.grpc.controller.ts b/apps/users-service/src/users/users.grpc.controller.ts new file mode 100644 index 0000000..7b056d7 --- /dev/null +++ b/apps/users-service/src/users/users.grpc.controller.ts @@ -0,0 +1,27 @@ +import { UsersService } from './users.service'; +import { Controller } from '@nestjs/common'; +import { + CreateUserRequest, + UsersServiceController, + UsersServiceControllerMethods, + OptionalUser, + UserOrUndefined, +} from '@henshi/types'; + +@Controller() +@UsersServiceControllerMethods() +export class UsersGrpcController implements UsersServiceController { + constructor(private readonly usersService: UsersService) {} + + async create(request: CreateUserRequest): Promise { + return { user: await this.usersService.create(request) }; + } + + async findOne(request: OptionalUser): Promise { + return { user: await this.usersService.findOne(request) }; + } + + async update(request: OptionalUser): Promise { + await this.usersService.update(request); + } +} diff --git a/apps/users-service/src/users/users.module.ts b/apps/users-service/src/users/users.module.ts index 490f7b0..706a404 100644 --- a/apps/users-service/src/users/users.module.ts +++ b/apps/users-service/src/users/users.module.ts @@ -1,23 +1,30 @@ import { Module } from '@nestjs/common'; import { UsersService } from './users.service'; -import { UsersController } from './users.controller'; +import { UsersRestController } from './users.rest.controller'; import { TypeOrmModule } from '@nestjs/typeorm'; import { ClientsModule, Transport } from '@nestjs/microservices'; import { ConfigService } from '@nestjs/config'; import { User } from './entities/user.entity'; +import { UsersGrpcController } from './users.grpc.controller'; +import { AUTH_PACKAGE_NAME, AUTH_SERVICE_NAME } from '@henshi/types'; +import { join } from 'node:path/win32'; @Module({ imports: [ ClientsModule.registerAsync({ clients: [ { - name: 'AUTH_SERVICE', + name: AUTH_SERVICE_NAME, useFactory: (configService: ConfigService) => { return { - transport: Transport.TCP, + transport: Transport.GRPC, options: { - host: configService.get('microservices.auth.host'), - port: configService.get('microservices.auth.port'), + package: AUTH_PACKAGE_NAME, + protoPath: join(__dirname, '../../node_modules/@henshi/types/src/lib/proto/auth.proto'), + url: + configService.get('microservices.auth.host') + + ':' + + configService.get('microservices.auth.port'), }, }; }, @@ -27,7 +34,7 @@ import { User } from './entities/user.entity'; }), TypeOrmModule.forFeature([User]), ], - controllers: [UsersController], + controllers: [UsersRestController, UsersGrpcController], providers: [UsersService], }) export class UserModule {} diff --git a/apps/users-service/src/users/users.rest.controller.ts b/apps/users-service/src/users/users.rest.controller.ts new file mode 100644 index 0000000..1f85982 --- /dev/null +++ b/apps/users-service/src/users/users.rest.controller.ts @@ -0,0 +1,17 @@ +import { Controller, Get, UseGuards, Req } from '@nestjs/common'; +import { UsersService } from './users.service'; +import { Request } from 'express'; +import { AuthGuard } from '@henshi/guards'; + +@Controller('/api/users') +export class UsersRestController { + constructor(private readonly usersService: UsersService) {} + + @UseGuards(AuthGuard) + @Get('me') + async me(@Req() req: Request) { + const user = await this.usersService.findOne({ id: req.user['sub'] }); + delete user.password; + return user; + } +} diff --git a/apps/users-service/src/users/users.service.ts b/apps/users-service/src/users/users.service.ts index a9ab983..379b586 100644 --- a/apps/users-service/src/users/users.service.ts +++ b/apps/users-service/src/users/users.service.ts @@ -1,10 +1,10 @@ import { Injectable } from '@nestjs/common'; import { CreateUserDto } from './dto/create-user.dto'; -import { UpdateUserDto } from './dto/update-user.dto'; import { Repository } from 'typeorm'; import { InjectRepository } from '@nestjs/typeorm'; import { paginate, Paginated, PaginateQuery } from 'nestjs-paginate'; import { User } from './entities/user.entity'; +import { OptionalUser } from '@henshi/types'; @Injectable() export class UsersService { @@ -29,8 +29,9 @@ export class UsersService { return this.usersRepository.findOneBy(query); } - update(id: string, updateUserDto: UpdateUserDto) { - return this.usersRepository.update({ id }, updateUserDto); + update(data: OptionalUser) { + const { id, ...rest } = data; + return this.usersRepository.update({ id }, rest); } remove(id: string) { diff --git a/apps/web/layouts/app.vue b/apps/web/layouts/app.vue index 74e0ebd..c4ce903 100644 --- a/apps/web/layouts/app.vue +++ b/apps/web/layouts/app.vue @@ -12,7 +12,7 @@ const sidebarItems = [ }, ]; -const { user } = useAuthStore(); +const { user, setAuthUser } = useAuthStore(); const toast = useToast(); const route = useRoute(); const viewport = useViewport(); @@ -40,6 +40,7 @@ const logout = async () => { return errorToast(toast, error); } + setAuthUser(null); await navigateTo('/'); }; diff --git a/apps/web/package.json b/apps/web/package.json index d31df5d..15102b5 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -4,10 +4,9 @@ "type": "module", "scripts": { "build": "nuxt build", - "dev": "nuxt dev", + "dev": "nuxt prepare && nuxt dev", "generate": "nuxt generate", - "preview": "nuxt preview", - "postinstall": "nuxt prepare" + "preview": "nuxt preview" }, "dependencies": { "@henshi/types": "workspace:*", diff --git a/apps/web/pages/auth/login.vue b/apps/web/pages/auth/login.vue index 281ebf1..2e01cc1 100644 --- a/apps/web/pages/auth/login.vue +++ b/apps/web/pages/auth/login.vue @@ -23,7 +23,7 @@ const isLoading = ref(false); const onSubmit = handleSubmit(async (values: LoginForm) => { isLoading.value = true; - const { data, pending, error } = await useApi<{ accessToken: string }>('/auth/login', { + const { data, error } = await useApi<{ accessToken: string }>('/auth/login', { method: 'POST', body: values, }); diff --git a/apps/web/presets/lara/accordion/index.js b/apps/web/presets/lara/accordion/index.js deleted file mode 100644 index 24fcb50..0000000 --- a/apps/web/presets/lara/accordion/index.js +++ /dev/null @@ -1,78 +0,0 @@ -export default { - accordiontab: { - root: { - class: 'mb-1' - }, - header: ({ props }) => ({ - class: [ - // State - { 'select-none pointer-events-none cursor-default opacity-60': props?.disabled } - ] - }), - headerAction: ({ context }) => ({ - class: [ - //Font - 'font-bold', - 'leading-none', - - // Alignments - 'flex items-center', - 'relative', - - // Sizing - 'p-5', - - // Shape - 'rounded-t-md', - { 'rounded-br-md rounded-bl-md': !context.active, 'rounded-br-0 rounded-bl-0': context.active }, - - // Color - 'border border-surface-200 dark:border-surface-700', - 'bg-surface-50 dark:bg-surface-800', - 'text-surface-600 dark:text-surface-0/80', - { 'text-surface-900': context.active }, - - // Transition - 'transition duration-200 ease-in-out', - 'transition-shadow duration-200', - - // States - 'hover:bg-surface-100 dark:hover:bg-surface-700/40', - 'hover:text-surface-900', - 'focus:outline-none focus:outline-offset-0 focus-visible:ring focus-visible:ring-primary-400/50 ring-inset dark:focus-visible:ring-primary-300/50', // Focus - - // Misc - 'cursor-pointer no-underline select-none' - ] - }), - headerIcon: { - class: 'inline-block mr-2' - }, - headerTitle: { - class: 'leading-none' - }, - content: { - class: [ - // Spacing - 'p-5', - - //Shape - 'rounded-tl-none rounded-tr-none rounded-br-lg rounded-bl-lg', - 'border-t-0', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'border border-surface-200 dark:border-surface-700', - 'text-surface-700 dark:text-surface-0/80' - ] - }, - transition: { - enterFromClass: 'max-h-0', - enterActiveClass: 'overflow-hidden transition-[max-height] duration-1000 ease-[cubic-bezier(0.42,0,0.58,1)]', - enterToClass: 'max-h-[1000px]', - leaveFromClass: 'max-h-[1000px]', - leaveActiveClass: 'overflow-hidden transition-[max-height] duration-[450ms] ease-[cubic-bezier(0,1,0,1)]', - leaveToClass: 'max-h-0' - } - } -}; diff --git a/apps/web/presets/lara/autocomplete/index.js b/apps/web/presets/lara/autocomplete/index.js deleted file mode 100644 index f2e521c..0000000 --- a/apps/web/presets/lara/autocomplete/index.js +++ /dev/null @@ -1,261 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'relative', - - // Flex - 'inline-flex', - - // Size - { 'w-full': props.multiple }, - - // Color - 'text-surface-900 dark:text-surface-0', - - //States - { - 'opacity-60 select-none pointer-events-none cursor-default': props.disabled - } - ] - }), - container: ({ props, state }) => ({ - class: [ - // Font - 'text-base leading-[normal]', - - // Flex - 'flex items-center flex-wrap', - 'gap-2', - - // Spacing - 'm-0 list-none', - 'px-3 py-1.5', - - // Size - 'w-full', - 'min-h-[2.877rem]', - - // Shape - 'appearance-none rounded-md', - - // Color - 'text-surface-700 dark:text-white/80', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { 'hover:border-primary': !props.invalid }, - 'focus:outline-none focus:outline-offset-0', - { 'ring ring-primary-400/50 dark:ring-primary-300/50': state.focused }, - { 'ring ring-primary-400/50 dark:ring-primary-300/50': state.hovered }, - // Transition - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-text overflow-hidden' - ] - }), - inputtoken: { - class: ['py-1.5 px-0', 'inline-flex flex-auto'] - }, - input: ({ props, parent }) => ({ - class: [ - // Font - 'text-base leading-[normal]', - - // Shape - 'appearance-none rounded-md', - { 'rounded-tr-none rounded-br-none': props.dropdown }, - { 'outline-none shadow-none rounded-none': props.multiple }, - - // Size - { 'w-full': props.multiple }, - - // Spacing - 'm-0', - { 'p-3': !props.multiple, 'p-0': props.multiple }, - - // Colors - 'text-surface-700 dark:text-white/80', - 'border', - { - 'bg-surface-0 dark:bg-surface-900': !props.multiple, - ' border-surface-300 dark:border-surface-700': !props.multiple && !props.invalid, - 'border-0 bg-transparent': props.multiple - }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50': !props.multiple }, - - // Filled State *for FloatLabel - { filled: parent.instance?.$name == 'FloatLabel' && props.modelValue !== '' }, - - // Transition - 'transition-colors duration-200' - ] - }), - token: { - class: [ - // Flex - 'inline-flex items-center', - - // Spacings - 'py-1.5 px-3', - - // Shape - 'rounded-[1.14rem]', - - // Colors - 'bg-surface-200 dark:bg-surface-700', - 'text-surface-700 dark:text-white/70', - - // Misc - 'cursor-default' - ] - }, - label: { - class: 'leading-[normal]' - }, - removeTokenIcon: { - class: [ - // Shape - 'rounded-md leading-6', - - // Spacing - 'ml-2', - - // Size - 'w-4 h-4', - - // Transition - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer' - ] - }, - dropdownbutton: { - root: { - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom', - - // Shape - 'rounded-r-md', - - // Size - 'px-4 py-3 leading-[normal]', - - // Colors - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50' - ] - } - }, - loadingicon: { - class: ['text-surface-500 dark:text-surface-0/70', 'absolute top-[50%] right-[0.5rem] -mt-2 animate-spin'] - }, - panel: { - class: [ - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-white/80', - - // Shape - 'border-0', - 'rounded-md', - 'shadow-md', - - // Size - 'max-h-[200px] overflow-auto' - ] - }, - list: { - class: 'py-3 px-0 list-none m-0' - }, - item: ({ context }) => ({ - class: [ - 'relative', - - // Font - 'font-normal text-base leading-[normal]', - - // Spacing - 'm-0 px-5 py-3', - - // Shape - 'border-0 rounded-none', - - // Colors - { - 'text-surface-700 dark:text-white/80': !context.focused && !context.selected, - 'bg-surface-200 dark:bg-surface-600/60': context.focused && !context.selected, - 'text-surface-700 dark:text-white/80': context.focused && !context.selected, - - 'text-primary-highlight-inverse': context.selected, - 'bg-primary-highlight': context.selected - }, - - //States - { 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.focused && !context.selected }, - { 'hover:bg-primary-highlight-hover': context.selected }, - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transition - 'transition-shadow duration-200', - - // Misc - 'cursor-pointer overflow-hidden whitespace-nowrap' - ] - }), - itemgroup: { - class: [ - 'font-bold', - - // Spacing - 'm-0 p-3', - - // Colors - 'bg-surface-0 dark:bg-surface-700', - 'text-surface-800 dark:text-white/80', - - // Misc - 'cursor-auto' - ] - }, - emptymessage: { - class: [ - // Font - 'leading-[normal]', - - // Spacing - 'py-3 px-5', - - // Color - 'text-surface-800 dark:text-white/80', - 'bg-transparent' - ] - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/avatar/index.js b/apps/web/presets/lara/avatar/index.js deleted file mode 100644 index 9c77beb..0000000 --- a/apps/web/presets/lara/avatar/index.js +++ /dev/null @@ -1,43 +0,0 @@ -export default { - root: ({ props, parent }) => ({ - class: [ - // Font - { - 'text-xl': props.size == 'large', - 'text-2xl': props.size == 'xlarge' - }, - - // Alignments - 'inline-flex items-center justify-center', - 'relative', - - // Sizes - { - 'h-8 w-8': props.size == null || props.size == 'normal', - 'w-12 h-12': props.size == 'large', - 'w-16 h-16': props.size == 'xlarge' - }, - { '-ml-4': parent.instance.$style?.name == 'avatargroup' }, - - // Shapes - { - 'rounded-lg': props.shape == 'square', - 'rounded-full': props.shape == 'circle' - }, - { 'border-2': parent.instance.$style?.name == 'avatargroup' }, - - // Colors - 'bg-surface-300 dark:bg-surface-700', - { 'border-white dark:border-surface-800': parent.instance.$style?.name == 'avatargroup' } - ] - }), - image: ({ props }) => ({ - class: [ - 'h-full w-full', - { - 'rounded-lg': props.shape == 'square', - 'rounded-full': props.shape == 'circle' - } - ] - }) -}; diff --git a/apps/web/presets/lara/avatargroup/index.js b/apps/web/presets/lara/avatargroup/index.js deleted file mode 100644 index d267e06..0000000 --- a/apps/web/presets/lara/avatargroup/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - root: { - class: 'flex items-center' - } -}; diff --git a/apps/web/presets/lara/badge/index.js b/apps/web/presets/lara/badge/index.js deleted file mode 100644 index c9e3505..0000000 --- a/apps/web/presets/lara/badge/index.js +++ /dev/null @@ -1,43 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Font - 'font-bold', - - { - 'text-xs leading-[1.5rem]': props.size == null, - 'text-lg leading-[2.25rem]': props.size == 'large', - 'text-2xl leading-[3rem]': props.size == 'xlarge' - }, - - // Alignment - 'text-center inline-block', - - // Size - 'p-0 px-1', - { - 'min-w-[1.5rem] h-[1.5rem]': props.size == null, - 'min-w-[2.25rem] h-[2.25rem]': props.size == 'large', - 'min-w-[3rem] h-[3rem]': props.size == 'xlarge' - }, - - // Shape - { - 'rounded-full': props.value.length == 1, - 'rounded-[0.71rem]': props.value.length !== 1 - }, - - // Color - 'text-primary-inverse', - { - 'bg-primary': props.severity == null || props.severity == 'primary', - 'bg-surface-500 dark:bg-surface-400': props.severity == 'secondary', - 'bg-green-500 dark:bg-green-400': props.severity == 'success', - 'bg-blue-500 dark:bg-blue-400': props.severity == 'info', - 'bg-orange-500 dark:bg-orange-400': props.severity == 'warning', - 'bg-purple-500 dark:bg-purple-400': props.severity == 'help', - 'bg-red-500 dark:bg-red-400': props.severity == 'danger' - } - ] - }) -}; diff --git a/apps/web/presets/lara/badgedirective/index.js b/apps/web/presets/lara/badgedirective/index.js deleted file mode 100644 index 0e5721b..0000000 --- a/apps/web/presets/lara/badgedirective/index.js +++ /dev/null @@ -1,43 +0,0 @@ -export default { - root: ({ context }) => ({ - class: [ - // Font - 'font-bold', - 'text-xs leading-[normal]', - - // Alignment - 'flex items-center justify-center', - 'text-center', - - // Position - 'absolute top-0 right-0 transform translate-x-1/2 -translate-y-1/2 origin-top-right', - - // Size - 'm-0', - { - 'p-0': context.nogutter || context.dot, - 'px-2': !context.nogutter && !context.dot, - 'min-w-[0.5rem] w-2 h-2': context.dot, - 'min-w-[1.5rem] h-6': !context.dot - }, - - // Shape - { - 'rounded-full': context.nogutter || context.dot, - 'rounded-[10px]': !context.nogutter && !context.dot - }, - - // Color - 'text-primary-inverse', - { - 'bg-primary': !context.info && !context.success && !context.warning && !context.danger && !context.help && !context.secondary, - 'bg-surface-500 dark:bg-surface-400': context.secondary, - 'bg-green-500 dark:bg-green-400': context.success, - 'bg-blue-500 dark:bg-blue-400': context.info, - 'bg-orange-500 dark:bg-orange-400': context.warning, - 'bg-purple-500 dark:bg-purple-400': context.help, - 'bg-red-500 dark:bg-red-400': context.danger - } - ] - }) -}; diff --git a/apps/web/presets/lara/blockui/index.js b/apps/web/presets/lara/blockui/index.js deleted file mode 100644 index 0c81a0c..0000000 --- a/apps/web/presets/lara/blockui/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export default { - root: { - class: 'relative' - }, - mask: { - class: 'bg-black/40' - } -}; diff --git a/apps/web/presets/lara/breadcrumb/index.js b/apps/web/presets/lara/breadcrumb/index.js deleted file mode 100644 index 81b23fd..0000000 --- a/apps/web/presets/lara/breadcrumb/index.js +++ /dev/null @@ -1,64 +0,0 @@ -export default { - root: { - class: [ - // Shape - 'rounded-md', - - // Spacing - 'p-4', - - // Color - 'bg-surface-0 dark:bg-surface-700', - 'border border-surface-200 dark:border-surface-700', - - // Misc - 'overflow-x-auto' - ] - }, - menu: { - class: [ - // Flex & Alignment - 'flex items-center flex-nowrap', - - // Spacing - 'm-0 p-0 list-none leading-none' - ] - }, - action: { - class: [ - // Flex & Alignment - 'flex items-center', - - // Shape - 'rounded-md', - - // Color - 'text-surface-600 dark:text-white/70', - - // States - 'focus-visible:outline-none focus-visible:outline-offset-0', - 'focus-visible:ring focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transitions - 'transition-shadow duration-200', - - // Misc - 'text-decoration-none' - ] - }, - icon: { - class: 'text-surface-600 dark:text-white/70' - }, - separator: { - class: [ - // Flex & Alignment - 'flex items-center', - - // Spacing - ' mx-2', - - // Color - 'text-surface-600 dark:text-white/70' - ] - } -}; diff --git a/apps/web/presets/lara/button/index.js b/apps/web/presets/lara/button/index.js deleted file mode 100644 index 95e6a56..0000000 --- a/apps/web/presets/lara/button/index.js +++ /dev/null @@ -1,234 +0,0 @@ -export default { - root: ({ props, context, parent }) => ({ - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'leading-[normal]', - { - 'px-4 py-3': props.size === null, - 'text-sm py-2 px-3': props.size === 'small', - 'text-xl py-3 px-4': props.size === 'large' - }, - { - 'w-12 p-0 py-3': props.label == null && props.icon !== null - }, - - // Shapes - { 'shadow-lg': props.raised }, - { 'rounded-md': !props.rounded, 'rounded-full': props.rounded }, - { 'rounded-none first:rounded-l-md last:rounded-r-md': parent.instance.$name == 'InputGroup' }, - - // Link Button - { 'text-primary-600 bg-transparent border-transparent': props.link }, - - // Plain Button - { 'text-white bg-gray-500 border border-gray-500': props.plain && !props.outlined && !props.text }, - // Plain Text Button - { 'text-surface-500': props.plain && props.text }, - // Plain Outlined Button - { 'text-surface-500 border border-gray-500': props.plain && props.outlined }, - - // Text Button - { 'bg-transparent border-transparent': props.text && !props.plain }, - - // Outlined Button - { 'bg-transparent border': props.outlined && !props.plain }, - - // --- Severity Buttons --- - - // Primary Button - { - 'text-primary-inverse': !props.link && props.severity === null && !props.text && !props.outlined && !props.plain, - 'bg-primary': !props.link && props.severity === null && !props.text && !props.outlined && !props.plain, - 'border border-primary': !props.link && props.severity === null && !props.text && !props.outlined && !props.plain - }, - // Primary Text Button - { 'text-primary': props.text && props.severity === null && !props.plain }, - // Primary Outlined Button - { 'text-primary border border-primary': props.outlined && props.severity === null && !props.plain }, - - // Secondary Button - { - 'text-white dark:text-surface-900': props.severity === 'secondary' && !props.text && !props.outlined && !props.plain, - 'bg-surface-500 dark:bg-surface-400': props.severity === 'secondary' && !props.text && !props.outlined && !props.plain, - 'border border-surface-500 dark:border-surface-400': props.severity === 'secondary' && !props.text && !props.outlined && !props.plain - }, - // Secondary Text Button - { 'text-surface-500 dark:text-surface-300': props.text && props.severity === 'secondary' && !props.plain }, - // Secondary Outlined Button - { 'text-surface-500 dark:text-surface-300 border border-surface-500 hover:bg-surface-300/20': props.outlined && props.severity === 'secondary' && !props.plain }, - - // Success Button - { - 'text-white dark:text-green-900': props.severity === 'success' && !props.text && !props.outlined && !props.plain, - 'bg-green-500 dark:bg-green-400': props.severity === 'success' && !props.text && !props.outlined && !props.plain, - 'border border-green-500 dark:border-green-400': props.severity === 'success' && !props.text && !props.outlined && !props.plain - }, - // Success Text Button - { 'text-green-500 dark:text-green-400': props.text && props.severity === 'success' && !props.plain }, - // Success Outlined Button - { 'text-green-500 border border-green-500 hover:bg-green-300/20': props.outlined && props.severity === 'success' && !props.plain }, - - // Info Button - { - 'text-white dark:text-surface-900': props.severity === 'info' && !props.text && !props.outlined && !props.plain, - 'bg-blue-500 dark:bg-blue-400': props.severity === 'info' && !props.text && !props.outlined && !props.plain, - 'border border-blue-500 dark:border-blue-400': props.severity === 'info' && !props.text && !props.outlined && !props.plain - }, - // Info Text Button - { 'text-blue-500 dark:text-blue-400': props.text && props.severity === 'info' && !props.plain }, - // Info Outlined Button - { 'text-blue-500 border border-blue-500 hover:bg-blue-300/20 ': props.outlined && props.severity === 'info' && !props.plain }, - - // Warning Button - { - 'text-white dark:text-surface-900': props.severity === 'warning' && !props.text && !props.outlined && !props.plain, - 'bg-orange-500 dark:bg-orange-400': props.severity === 'warning' && !props.text && !props.outlined && !props.plain, - 'border border-orange-500 dark:border-orange-400': props.severity === 'warning' && !props.text && !props.outlined && !props.plain - }, - // Warning Text Button - { 'text-orange-500 dark:text-orange-400': props.text && props.severity === 'warning' && !props.plain }, - // Warning Outlined Button - { 'text-orange-500 border border-orange-500 hover:bg-orange-300/20': props.outlined && props.severity === 'warning' && !props.plain }, - - // Help Button - { - 'text-white dark:text-surface-900': props.severity === 'help' && !props.text && !props.outlined && !props.plain, - 'bg-purple-500 dark:bg-purple-400': props.severity === 'help' && !props.text && !props.outlined && !props.plain, - 'border border-purple-500 dark:border-purple-400': props.severity === 'help' && !props.text && !props.outlined && !props.plain - }, - // Help Text Button - { 'text-purple-500 dark:text-purple-400': props.text && props.severity === 'help' && !props.plain }, - // Help Outlined Button - { 'text-purple-500 border border-purple-500 hover:bg-purple-300/20': props.outlined && props.severity === 'help' && !props.plain }, - - // Danger Button - { - 'text-white dark:text-surface-900': props.severity === 'danger' && !props.text && !props.outlined && !props.plain, - 'bg-red-500 dark:bg-red-400': props.severity === 'danger' && !props.text && !props.outlined && !props.plain, - 'border border-red-500 dark:border-red-400': props.severity === 'danger' && !props.text && !props.outlined && !props.plain - }, - // Danger Text Button - { 'text-red-500 dark:text-red-400': props.text && props.severity === 'danger' && !props.plain }, - // Danger Outlined Button - { 'text-red-500 border border-red-500 hover:bg-red-300/20': props.outlined && props.severity === 'danger' && !props.plain }, - // Contrast Button - { - 'text-white dark:text-surface-900': props.severity === 'contrast' && !props.text && !props.outlined && !props.plain, - 'bg-surface-900 dark:bg-surface-0': props.severity === 'contrast' && !props.text && !props.outlined && !props.plain, - 'border border-surface-900 dark:border-surface-0': props.severity === 'contrast' && !props.text && !props.outlined && !props.plain - }, - // Contrast Text Button - { 'text-surface-900 dark:text-surface-0': props.text && props.severity === 'contrast' && !props.plain }, - // Contrast Outlined Button - { 'text-surface-900 dark:text-surface-0 border border-surface-900 dark:border-surface-0': props.outlined && props.severity === 'contrast' && !props.plain }, - - // --- Severity Button States --- - 'focus:outline-none focus:outline-offset-0 focus:ring', - - // Link - { 'focus:ring-primary': props.link }, - - // Plain - { 'hover:bg-gray-600 hover:border-gray-600': props.plain && !props.outlined && !props.text }, - // Text & Outlined Button - { 'hover:bg-surface-300/20': props.plain && (props.text || props.outlined) }, - - // Primary - { 'hover:bg-primary-hover hover:border-primary-hover': !props.link && props.severity === null && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-primary': props.severity === null }, - // Text & Outlined Button - { 'hover:bg-primary-300/20': (props.text || props.outlined) && props.severity === null && !props.plain }, - - // Secondary - { 'hover:bg-surface-600 dark:hover:bg-surface-300 hover:border-surface-600 dark:hover:border-surface-300': props.severity === 'secondary' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-surface-400/50 dark:focus:ring-surface-300/50': props.severity === 'secondary' }, - // Text & Outlined Button - { 'hover:bg-surface-300/20': (props.text || props.outlined) && props.severity === 'secondary' && !props.plain }, - - // Success - { 'hover:bg-green-600 dark:hover:bg-green-300 hover:border-green-600 dark:hover:border-green-300': props.severity === 'success' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-green-400/50 dark:focus:ring-green-300/50': props.severity === 'success' }, - // Text & Outlined Button - { 'hover:bg-green-300/20': (props.text || props.outlined) && props.severity === 'success' && !props.plain }, - - // Info - { 'hover:bg-blue-600 dark:hover:bg-blue-300 hover:border-blue-600 dark:hover:border-blue-300': props.severity === 'info' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-blue-400/50 dark:focus:ring-blue-300/50': props.severity === 'info' }, - // Text & Outlined Button - { 'hover:bg-blue-300/20': (props.text || props.outlined) && props.severity === 'info' && !props.plain }, - - // Warning - { 'hover:bg-orange-600 dark:hover:bg-orange-300 hover:border-orange-600 dark:hover:border-orange-300': props.severity === 'warning' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-orange-400/50 dark:focus:ring-orange-300/50': props.severity === 'warning' }, - // Text & Outlined Button - { 'hover:bg-orange-300/20': (props.text || props.outlined) && props.severity === 'warning' && !props.plain }, - - // Help - { 'hover:bg-purple-600 dark:hover:bg-purple-300 hover:border-purple-600 dark:hover:border-purple-300': props.severity === 'help' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-purple-400/50 dark:focus:ring-purple-300/50': props.severity === 'help' }, - // Text & Outlined Button - { 'hover:bg-purple-300/20': (props.text || props.outlined) && props.severity === 'help' && !props.plain }, - - // Danger - { 'hover:bg-red-600 dark:hover:bg-red-300 hover:border-red-600 dark:hover:border-red-300': props.severity === 'danger' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-red-400/50 dark:focus:ring-red-300/50': props.severity === 'danger' }, - // Text & Outlined Button - { 'hover:bg-red-300/20': (props.text || props.outlined) && props.severity === 'danger' && !props.plain }, - // Contrast - { 'hover:bg-surface-800 dark:hover:bg-surface-100 hover:border-surface-800 dark:hover:border-surface-100': props.severity === 'contrast' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-surface-500 dark:focus:ring-surface-400': props.severity === 'contrast' }, - // Text & Outlined Button - { 'hover:bg-surface-900/10 dark:hover:bg-[rgba(255,255,255,0.03)]': (props.text || props.outlined) && props.severity === 'contrast' && !props.plain }, - // Disabled - { 'opacity-60 pointer-events-none cursor-default': context.disabled }, - - // Transitions - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer overflow-hidden select-none' - ] - }), - label: ({ props }) => ({ - class: [ - 'duration-200', - 'font-bold', - { - 'hover:underline': props.link - }, - { 'flex-1': props.label !== null, 'invisible w-0': props.label == null } - ] - }), - icon: ({ props }) => ({ - class: [ - 'mx-0', - { - 'mr-2': props.iconPos == 'left' && props.label != null, - 'ml-2 order-1': props.iconPos == 'right' && props.label != null, - 'mb-2': props.iconPos == 'top' && props.label != null, - 'mt-2': props.iconPos == 'bottom' && props.label != null - } - ] - }), - loadingicon: ({ props }) => ({ - class: [ - 'h-4 w-4', - 'mx-0', - { - 'mr-2': props.iconPos == 'left' && props.label != null, - 'ml-2 order-1': props.iconPos == 'right' && props.label != null, - 'mb-2': props.iconPos == 'top' && props.label != null, - 'mt-2': props.iconPos == 'bottom' && props.label != null - }, - 'animate-spin' - ] - }), - badge: ({ props }) => ({ - class: [{ 'ml-2 w-4 h-4 leading-none flex items-center justify-center': props.badge }] - }) -}; diff --git a/apps/web/presets/lara/calendar/index.js b/apps/web/presets/lara/calendar/index.js deleted file mode 100644 index 7af8997..0000000 --- a/apps/web/presets/lara/calendar/index.js +++ /dev/null @@ -1,646 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Display and Position - 'inline-flex', - 'max-w-full', - 'relative', - - // Misc - { 'opacity-60 select-none pointer-events-none cursor-default': props.disabled } - ] - }), - input: ({ props, parent }) => ({ - class: [ - // Display - 'flex flex-auto', - - // Font - 'leading-none', - - // Colors - 'text-surface-600 dark:text-surface-200', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // Spacing - 'm-0 p-3', - - // Shape - 'appearance-none', - { 'rounded-md': !props.showIcon || props.iconDisplay == 'input' }, - { 'rounded-l-md flex-1 pr-9': props.showIcon && props.iconDisplay !== 'input' }, - { 'rounded-md flex-1 pr-9': props.showIcon && props.iconDisplay === 'input' }, - - // Transitions - 'transition-colors', - 'duration-200', - - // States - { 'hover:border-primary-hover': !props.invalid }, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50', - - // Filled State *for FloatLabel - { filled: parent.instance?.$name == 'FloatLabel' && props.modelValue !== null } - ] - }), - inputicon: { - class: ['absolute top-[50%] -mt-2', 'text-surface-600 dark:text-surface-200', 'right-[.75rem]'] - }, - dropdownbutton: { - root: { - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom', - - // Shape - 'rounded-r-md', - - // Size - 'px-4 py-3 leading-none', - - // Colors - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50' - ] - } - }, - panel: ({ props }) => ({ - class: [ - // Display & Position - { - absolute: !props.inline, - 'inline-block': props.inline - }, - - // Size - { 'w-auto p-2 ': !props.inline }, - { 'min-w-[80vw] w-auto p-2 ': props.touchUI }, - { 'p-2 min-w-full': props.inline }, - - // Shape - 'border rounded-lg', - { - 'shadow-md': !props.inline - }, - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700', - - //misc - { 'overflow-x-auto': props.inline } - ] - }), - datepickerMask: { - class: ['fixed top-0 left-0 w-full h-full', 'flex items-center justify-center', 'bg-black bg-opacity-90'] - }, - header: { - class: [ - //Font - 'font-semibold', - - // Flexbox and Alignment - 'flex items-center justify-between', - - // Spacing - 'p-2', - 'm-0', - - // Shape - 'border-b', - 'rounded-t-md', - - // Colors - 'text-surface-700 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700' - ] - }, - previousbutton: { - class: [ - 'relative', - - // Flexbox and Alignment - 'inline-flex items-center justify-center', - - // Size - 'w-8 h-8', - 'p-0 m-0', - - // Shape - 'rounded-full', - - // Colors - 'text-surface-600 dark:text-white/70', - 'border-0', - 'bg-transparent', - - // Transitions - 'transition-colors duration-200 ease-in-out', - - // States - 'hover:text-surface-700 dark:hover:text-white/80', - 'hover:bg-surface-100 dark:hover:bg-surface-800/80', - - // Misc - 'cursor-pointer overflow-hidden' - ] - }, - title: { - class: [ - // Text - 'leading-8', - 'mx-auto my-0' - ] - }, - monthTitle: { - class: [ - // Font - 'text-base leading-[normal]', - 'font-semibold', - - // Colors - 'text-surface-700 dark:text-white/80', - - // Transitions - 'transition duration-200', - - // Spacing - 'p-2', - 'm-0 mr-2', - - // States - 'hover:text-primary-500 dark:hover:text-primary-400', - - // Misc - 'cursor-pointer' - ] - }, - yearTitle: { - class: [ - // Font - 'text-base leading-[normal]', - 'font-semibold', - - // Colors - 'text-surface-700 dark:text-white/80', - - // Transitions - 'transition duration-200', - - // Spacing - 'p-2', - 'm-0', - - // States - 'hover:text-primary-500 dark:hover:text-primary-400', - - // Misc - 'cursor-pointer' - ] - }, - nextbutton: { - class: [ - 'relative', - - // Flexbox and Alignment - 'inline-flex items-center justify-center', - - // Size - 'w-8 h-8', - 'p-0 m-0', - - // Shape - 'rounded-full', - - // Colors - 'text-surface-600 dark:text-white/70', - 'border-0', - 'bg-transparent', - - // Transitions - 'transition-colors duration-200 ease-in-out', - - // States - 'hover:text-surface-700 dark:hover:text-white/80', - 'hover:bg-surface-100 dark:hover:bg-surface-800/80', - - // Misc - 'cursor-pointer overflow-hidden' - ] - }, - table: { - class: [ - // Font - 'text-base leading-none', - // Size & Shape - 'border-collapse', - 'w-full', - - // Spacing - 'm-0 my-2' - ] - }, - tableheadercell: { - class: [ - // Spacing - 'p-0 md:p-2' - ] - }, - weekheader: { - class: ['leading-[normal]', 'text-surface-600 dark:text-white/70', 'opacity-60 cursor-default'] - }, - weeknumber: { - class: ['text-surface-600 dark:text-white/70', 'opacity-60 cursor-default'] - }, - weekday: { - class: [ - // Colors - 'text-surface-500 dark:text-white/60' - ] - }, - day: { - class: [ - // Spacing - 'p-0 md:p-2' - ] - }, - weeklabelcontainer: ({ context }) => ({ - class: [ - // Flexbox and Alignment - 'flex items-center justify-center', - 'mx-auto', - - // Shape & Size - 'w-10 h-10', - 'rounded-full', - 'border-transparent border', - - // Colors - { - 'text-surface-600 dark:text-white/70 bg-transparent': !context.selected && !context.disabled, - 'text-primary-highlight-inverse bg-primary-highlight': context.selected && !context.disabled - }, - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - { - 'hover:bg-surface-100 dark:hover:bg-surface-800/80': !context.selected && !context.disabled, - 'hover:bg-primary-highlight-hover': context.selected && !context.disabled - }, - { - 'opacity-60 cursor-default': context.disabled, - 'cursor-pointer': !context.disabled - } - ] - }), - daylabel: ({ context }) => ({ - class: [ - // Flexbox and Alignment - 'flex items-center justify-center', - 'mx-auto', - - // Shape & Size - 'w-10 h-10', - 'rounded-full', - 'border-transparent border', - - // Colors - { - 'text-primary': context.date.today, - 'text-surface-600 dark:text-white/70 bg-transparent': !context.selected && !context.disabled && !context.date.today, - 'text-primary-highlight-inverse bg-primary-highlight': context.selected && !context.disabled - }, - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - { - 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.selected && !context.disabled, - 'hover:bg-primary-highlight-hover': context.selected && !context.disabled - }, - { - 'opacity-60 cursor-default': context.disabled, - 'cursor-pointer': !context.disabled - } - ] - }), - monthpicker: { - class: [ - // Spacing - 'my-2' - ] - }, - month: ({ context }) => ({ - class: [ - // Flexbox and Alignment - 'inline-flex items-center justify-center', - - // Size - 'w-1/3', - 'p-2', - - // Shape - 'rounded-md', - - // Colors - { - 'text-surface-600 dark:text-white/70 bg-transparent': !context.selected && !context.disabled, - 'text-primary-highlight-inverse bg-primary-highlight': context.selected && !context.disabled - }, - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - { - 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.selected && !context.disabled, - 'hover:bg-primary-highlight-hover': context.selected && !context.disabled - }, - - // Misc - 'cursor-pointer' - ] - }), - yearpicker: { - class: [ - // Spacing - 'my-2' - ] - }, - year: ({ context }) => ({ - class: [ - // Flexbox and Alignment - 'inline-flex items-center justify-center', - - // Size - 'w-1/3', - 'p-2', - - // Shape - 'rounded-md', - - // Colors - { - 'text-surface-600 dark:text-white/70 bg-transparent': !context.selected && !context.disabled, - 'text-primary-highlight-inverse bg-primary-highlight': context.selected && !context.disabled - }, - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - { - 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.selected && !context.disabled, - 'hover:bg-primary-highlight-hover': context.selected && !context.disabled - }, - - // Misc - 'cursor-pointer' - ] - }), - timepicker: { - class: [ - // Flexbox - 'flex', - 'justify-center items-center', - - // Borders - 'border-t-1', - 'border-solid border-surface-200', - - // Spacing - 'p-2' - ] - }, - separatorcontainer: { - class: [ - // Flexbox and Alignment - 'flex', - 'items-center', - 'flex-col', - - // Spacing - 'px-2' - ] - }, - separator: { - class: [ - // Text - 'text-xl' - ] - }, - hourpicker: { - class: [ - // Flexbox and Alignment - 'flex', - 'items-center', - 'flex-col', - - // Spacing - 'px-2' - ] - }, - minutepicker: { - class: [ - // Flexbox and Alignment - 'flex', - 'items-center', - 'flex-col', - - // Spacing - 'px-2' - ] - }, - secondPicker: { - class: [ - // Flexbox and Alignment - 'flex', - 'items-center', - 'flex-col', - - // Spacing - 'px-2' - ] - }, - ampmpicker: { - class: [ - // Flexbox and Alignment - 'flex', - 'items-center', - 'flex-col', - - // Spacing - 'px-2' - ] - }, - incrementbutton: { - class: [ - 'relative', - - // Flexbox and Alignment - 'inline-flex items-center justify-center', - - // Size - 'w-8 h-8', - 'p-0 m-0', - - // Shape - 'rounded-full', - - // Colors - 'text-surface-600 dark:text-white/70', - 'border-0', - 'bg-transparent', - - // Transitions - 'transition-colors duration-200 ease-in-out', - - // States - 'hover:text-surface-700 dark:hover:text-white/80', - 'hover:bg-surface-100 dark:hover:bg-surface-800/80', - - // Misc - 'cursor-pointer overflow-hidden' - ] - }, - decrementbutton: { - class: [ - 'relative', - - // Flexbox and Alignment - 'inline-flex items-center justify-center', - - // Size - 'w-8 h-8', - 'p-0 m-0', - - // Shape - 'rounded-full', - - // Colors - 'text-surface-600 dark:text-white/70', - 'border-0', - 'bg-transparent', - - // Transitions - 'transition-colors duration-200 ease-in-out', - - // States - 'hover:text-surface-700 dark:hover:text-white/80', - 'hover:bg-surface-100 dark:hover:bg-surface-800/80', - - // Misc - 'cursor-pointer overflow-hidden' - ] - }, - groupcontainer: { - class: [ - // Flexbox - 'flex' - ] - }, - group: { - class: [ - // Flexbox and Sizing - 'flex-1', - - // Borders - 'border-l', - 'border-surface-200', - - // Spacing - 'pr-0.5', - 'pl-0.5', - 'pt-0', - 'pb-0', - - // Pseudo-Classes - 'first:pl-0', - 'first:border-l-0' - ] - }, - buttonbar: { - class: [ - // Flexbox - 'flex justify-between items-center', - - // Spacing - 'py-3 px-0', - - // Shape - 'border-t border-surface-200 dark:border-surface-700' - ] - }, - todaybutton: { - root: { - class: [ - // Flexbox and Alignment - 'inline-flex items-center justify-center', - - // Spacing - 'px-4 py-3 leading-none', - - // Shape - 'rounded-md', - - // Colors - 'bg-transparent border-transparent', - 'text-primary', - - // Transitions - 'transition-colors duration-200 ease-in-out', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'hover:bg-primary-300/20', - - // Misc - 'cursor-pointer' - ] - } - }, - clearbutton: { - root: { - class: [ - // Flexbox and Alignment - 'inline-flex items-center justify-center', - - // Spacing - 'px-4 py-3 leading-none', - - // Shape - 'rounded-md', - - // Colors - 'bg-transparent border-transparent', - 'text-primary', - - // Transitions - 'transition-colors duration-200 ease-in-out', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'hover:bg-primary-300/20', - - // Misc - 'cursor-pointer' - ] - } - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/card/index.js b/apps/web/presets/lara/card/index.js deleted file mode 100644 index d4832f6..0000000 --- a/apps/web/presets/lara/card/index.js +++ /dev/null @@ -1,37 +0,0 @@ -export default { - root: { - class: [ - //Shape - 'rounded-md', - 'shadow-md', - - //Color - 'bg-surface-0 dark:bg-surface-900', - 'text-surface-700 dark:text-surface-0' - ] - }, - body: { - class: 'p-5' - }, - title: { - class: 'text-2xl font-bold mb-2' - }, - subtitle: { - class: [ - //Font - 'font-normal', - - //Spacing - 'mb-2', - - //Color - 'text-surface-600 dark:text-surface-0/60' - ] - }, - content: { - class: 'py-5' // Vertical padding. - }, - footer: { - class: 'pt-5' // Top padding. - } -}; diff --git a/apps/web/presets/lara/carousel/index.js b/apps/web/presets/lara/carousel/index.js deleted file mode 100644 index 3ebd9a8..0000000 --- a/apps/web/presets/lara/carousel/index.js +++ /dev/null @@ -1,149 +0,0 @@ -export default { - root: { - class: [ - // Flexbox - 'flex flex-col' - ] - }, - content: { - class: [ - // Flexbox & Overflow - 'flex flex-col overflow-auto' - ] - }, - container: ({ props }) => ({ - class: [ - // Flexbox - 'flex', - - // Orientation - { - 'flex-row': props.orientation !== 'vertical', - 'flex-col': props.orientation == 'vertical' - } - ] - }), - previousbutton: { - class: [ - // Flexbox & Alignment - 'flex justify-center items-center self-center', - - // Sizing & Overflow - 'overflow-hidden w-8 h-8', - - // Spacing - 'mx-2', - - // Shape - 'rounded-full', - - // Border & Background - 'border-0 bg-transparent', - - // Color - 'text-surface-600', - - // Transitions - 'transition duration-200 ease-in-out' - ] - }, - nextbutton: { - class: [ - // Flexbox & Alignment - 'flex justify-center items-center self-center', - - // Sizing & Overflow - 'overflow-hidden w-8 h-8', - - // Spacing - 'mx-2', - - // Shape - 'rounded-full', - - // Border & Background - 'border-0 bg-transparent', - - // Color - 'text-surface-600', - - // Transitions - 'transition duration-200 ease-in-out' - ] - }, - itemscontent: { - class: [ - // Overflow & Width - 'overflow-hidden w-full' - ] - }, - itemscontainer: ({ props }) => ({ - class: [ - // Flexbox - 'flex', - - // Orientation & Sizing - { - 'flex-row': props.orientation !== 'vertical', - 'flex-col h-full': props.orientation == 'vertical' - } - ] - }), - item: ({ props }) => ({ - class: [ - // Flexbox - 'flex shrink-0 grow ', - - // Size - { - 'w-full sm:w-[50%] md:w-[33.333333333333336%]': props.orientation !== 'vertical', - - 'w-full h-full': props.orientation == 'vertical' - } - ] - }), - itemcloned: ({ props }) => ({ - class: [ - // Flexbox - 'flex shrink-0 grow', - 'unvisible', - - // Size - { - 'w-full sm:w-[50%] md:w-[33.333333333333336%]': props.orientation !== 'vertical', - - 'w-full h-full': props.orientation == 'vertical' - } - ] - }), - indicators: { - class: [ - // Flexbox & Alignment - 'flex flex-row justify-center flex-wrap' - ] - }, - indicator: { - class: [ - // Spacing - 'mr-2 mb-2' - ] - }, - indicatorbutton: ({ context }) => ({ - class: [ - // Sizing & Shape - 'w-8 h-2 rounded-0', - - // Transitions - 'transition duration-200', - - // Focus Styles - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Color & Background - { - 'bg-surface-200 hover:bg-surface-300 dark:bg-surface-700 dark:hover:bg-surface-600': !context.highlighted, - 'bg-primary hover:bg-primary-hover': context.highlighted - } - ] - }) -}; diff --git a/apps/web/presets/lara/cascadeselect/index.js b/apps/web/presets/lara/cascadeselect/index.js deleted file mode 100644 index 1a5b4fc..0000000 --- a/apps/web/presets/lara/cascadeselect/index.js +++ /dev/null @@ -1,207 +0,0 @@ -export default { - root: ({ props, state }) => ({ - class: [ - // Display and Position - 'inline-flex', - 'relative', - - // Shape - 'rounded-md', - - // Color and Background - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // Transitions - 'transition-all', - 'duration-200', - - // States - { 'hover:border-primary': !props.invalid }, - { 'outline-none outline-offset-0 ring ring-primary-400/50 dark:ring-primary-300/50': state.focused }, - - // Misc - 'cursor-pointer', - 'select-none', - { 'opacity-60': props.disabled, 'pointer-events-none': props.disabled, 'cursor-default': props.disabled } - ] - }), - label: ({ props }) => ({ - class: [ - //Font - 'leading-[normal]', - - // Flex & Alignment - ' flex flex-auto', - - // Sizing and Spacing - 'w-[1%]', - 'p-3', - - //Shape - 'rounded-none', - - // Color and Background - 'bg-transparent', - 'border-0', - { 'text-surface-800 dark:text-white/80': props.modelValue, 'text-surface-400 dark:text-surface-500': !props.modelValue }, - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - - // Transitions - 'transition', - 'duration-200', - - // States - 'focus:outline-none focus:shadow-none', - - // Misc - 'relative', - 'cursor-pointer', - 'overflow-hidden overflow-ellipsis', - 'whitespace-nowrap', - 'appearance-none' - ] - }), - dropdownbutton: { - class: [ - // Flexbox - 'flex items-center justify-center', - 'shrink-0', - - // Color and Background - 'bg-transparent', - 'text-surface-500', - - // Size - 'w-12', - - // Shape - 'rounded-tr-md', - 'rounded-br-md' - ] - }, - panel: { - class: [ - // Position - 'absolute top-0 left-0', - - // Shape - 'border-0 dark:border', - 'rounded-md', - 'shadow-md', - - // Color - 'bg-surface-0 dark:bg-surface-700', - 'text-surface-800 dark:text-white/80', - 'dark:border-surface-700' - ] - }, - wrapper: { - class: [ - // Sizing - 'max-h-[200px]', - - // Misc - 'overflow-auto' - ] - }, - list: { - class: 'py-3 list-none m-0' - }, - item: ({ context }) => ({ - class: [ - // Font - 'font-normal', - 'leading-none', - - // Shape - 'border-0', - 'rounded-none', - - // Spacing - 'm-0', - - // Colors - { - 'text-surface-500 dark:text-white/70': !context.focused && !context.active, - 'text-surface-500 dark:text-white/70 bg-surface-200 dark:bg-surface-600/90': context.focused && !context.active, - 'text-primary-highlight-inverse bg-primary-highlight': (context.focused && context.active) || context.active || (!context.focused && context.active) - }, - - // Hover States - { - 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.active, - 'hover:bg-primary-highlight-hover text-primary-highlight-inverse': context.active - }, - - // Transitions - 'transition-shadow', - 'duration-200', - - // Misc - 'cursor-pointer', - 'overflow-hidden', - 'whitespace-nowrap' - ] - }), - content: { - class: [ - 'relative', - - // Flexbox - 'flex', - 'items-center', - - // Spacing - 'py-3', - 'px-5', - - // Misc - 'no-underline', - 'overflow-hidden', - 'cursor-pointer', - 'select-none' - ] - }, - groupicon: { - class: [ - // Alignment - 'ml-auto' - ] - }, - sublist: { - class: [ - // Size - 'w-full', - - // Spacing - 'py-1', - 'm-0', - 'list-none', - - // Shape - 'shadow-none sm:shadow-md', - 'border-0', - - // Position - 'static sm:absolute', - 'z-10', - - // Color - 'bg-surface-0 dark:bg-surface-700' - ] - }, - separator: { - class: 'border-t border-surface-200 dark:border-surface-600 my-1' - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/checkbox/index.js b/apps/web/presets/lara/checkbox/index.js deleted file mode 100644 index df3490e..0000000 --- a/apps/web/presets/lara/checkbox/index.js +++ /dev/null @@ -1,101 +0,0 @@ -export default { - root: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-6', - 'h-6', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: ({ props, context }) => ({ - class: [ - // Alignment - 'flex', - 'items-center', - 'justify-center', - - // Size - 'w-6', - 'h-6', - - // Shape - 'rounded-md', - 'border-2', - - // Colors - { - 'border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked && !props.invalid, - 'border-primary bg-primary': context.checked - }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { - 'peer-hover:border-primary': !props.disabled && !context.checked && !props.invalid, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': !props.disabled && context.checked, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'cursor-default opacity-60': props.disabled - }, - - // Transitions - 'transition-colors', - 'duration-200' - ] - }), - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - 'text-white dark:text-surface-900', - - // Transitions - 'transition-all', - 'duration-200' - ] - } -}; diff --git a/apps/web/presets/lara/chip/index.js b/apps/web/presets/lara/chip/index.js deleted file mode 100644 index c6ff879..0000000 --- a/apps/web/presets/lara/chip/index.js +++ /dev/null @@ -1,45 +0,0 @@ -export default { - root: { - class: [ - // Flexbox - 'inline-flex items-center', - - // Spacing - 'px-3', - - // Shape - 'rounded-[1.14rem]', - - // Colors - 'text-surface-700 dark:text-white/70', - 'bg-surface-200 dark:bg-surface-700' - ] - }, - label: { - class: 'leading-6 my-1.5 mx-0' - }, - icon: { - class: 'leading-6 mr-2' - }, - image: { - class: ['w-9 h-9 -ml-3 mr-2', 'rounded-full'] - }, - removeIcon: { - class: [ - // Shape - 'rounded-md leading-6', - - // Spacing - 'ml-2', - - // Size - 'w-4 h-4', - - // Transition - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer' - ] - } -}; diff --git a/apps/web/presets/lara/chips/index.js b/apps/web/presets/lara/chips/index.js deleted file mode 100644 index c4329f3..0000000 --- a/apps/web/presets/lara/chips/index.js +++ /dev/null @@ -1,117 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'flex', - { - 'opacity-60 select-none pointer-events-none cursor-default': props.disabled - } - ] - }), - container: ({ state, props, parent }) => ({ - class: [ - // Font - 'text-base leading-none', - - // Flex - 'flex items-center flex-wrap gap-2', - - // Spacing - 'm-0 py-[0.375rem] px-3', - - // Size - 'w-full', - 'min-h-[2.877rem]', - - // Shape - 'list-none', - 'rounded-md', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { 'hover:border-primary': !props.invalid }, - 'focus:outline-none focus:outline-offset-0', - { 'ring ring-primary-400/50 dark:ring-primary-300/50': state.focused }, - { 'ring ring-primary-400/50 dark:ring-primary-300/50': state.hovered }, - - // Filled State *for FloatLabel - { filled: parent.instance?.$name == 'FloatLabel' && props.modelValue !== null && props.modelValue?.length !== 0 }, - - // Transition - 'transition-colors duration-200', - - // Misc - 'cursor-text overflow-hidden', - 'appearance-none' - ] - }), - - inputtoken: { - class: ['py-1.5 px-0', 'inline-flex flex-auto'] - }, - input: { - class: [ - // Font - 'text-base leading-[normal]', - - // Size - 'w-full', - - // Spacing - 'p-0 m-0', - - // Shape - 'appearance-none rounded-none', - 'border-0 outline-none', - 'shadow-none', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-transparent' - ] - }, - token: { - class: [ - // Flexbox - 'inline-flex items-center', - - // Spacing - 'py-1.5 px-3', - - // Shape - 'rounded-[1.14rem]', - - // Colors - 'text-surface-700 dark:text-white/70', - 'bg-surface-200 dark:bg-surface-700' - ] - }, - label: { - class: 'leading-[normal]' - }, - removeTokenIcon: { - class: [ - // Shape - 'rounded-md leading-6', - - // Spacing - 'ml-2', - - // Size - 'w-4 h-4', - - // Transition - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer' - ] - } -}; diff --git a/apps/web/presets/lara/colorpicker/index.js b/apps/web/presets/lara/colorpicker/index.js deleted file mode 100644 index ef46c15..0000000 --- a/apps/web/presets/lara/colorpicker/index.js +++ /dev/null @@ -1,123 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Display - 'inline-block', - - // Misc - { 'opacity-60 select-none pointer-events-none cursor-default': props.disabled } - ] - }), - input: { - class: [ - // Font - 'text-base ', - - // Spacing - 'm-0', - 'p-3', - - // Size & Shape - 'rounded-lg w-8 h-8', - - // Colors - 'bg-surface-0 dark:bg-surface-900', - 'border border-surface-300 dark:border-surface-700', - - // States - 'hover:border-primary', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transition - 'transition-colors duration-200', - - // Misc - 'cursor-pointer' - ] - }, - panel: ({ props }) => ({ - class: [ - // Position & Size - { - 'relative h-[166px] w-[193px]': props.inline, - 'absolute h-[166px] w-[193px]': !props.inline - }, - - // Shape - 'shadow-md border', - - // Colors - 'bg-surface-800 border-surface-900 dark:border-surface-600' - ] - }), - selector: { - class: [ - // Position - 'absolute top-[8px] left-[8px]', - - // Size - 'h-[150px] w-[150px]' - ] - }, - color: { - class: [ - // Size - 'h-[150px] w-[150px]' - ], - style: 'background: linear-gradient(to top, #000 0%, rgb(0 0 0 / 0) 100%), linear-gradient(to right, #fff 0%, rgb(255 255 255 / 0) 100%)' - }, - colorhandle: { - class: [ - 'absolute', - - // Shape - 'rounded-full border border-solid', - - // Size - 'h-[10px] w-[10px]', - - // Spacing - '-ml-[5px] -mt-[5px]', - - // Colors - 'border-white', - - // Misc - 'cursor-pointer opacity-85' - ] - }, - hue: { - class: [ - // Position - 'absolute top-[8px] left-[167px]', - - // Size - 'h-[150px] w-[17px]', - - // Opacity - 'opacity-85' - ], - style: 'background: linear-gradient(0deg, red 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, red)' - }, - huehandle: { - class: [ - // Position - 'absolute left-0 -ml-[2px] -mt-[5px]', - - // Size - 'h-[10px] w-[21px]', - - // Shape - 'border-solid border-2', - - // Misc - 'cursor-pointer opacity-85' - ] - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/confirmpopup/index.js b/apps/web/presets/lara/confirmpopup/index.js deleted file mode 100644 index 61692de..0000000 --- a/apps/web/presets/lara/confirmpopup/index.js +++ /dev/null @@ -1,106 +0,0 @@ -export default { - root: { - class: [ - // Shape - 'rounded-lg', - 'shadow-lg', - 'border-0', - - // Positioning - 'z-40 transform origin-center', - 'mt-3 absolute left-0 top-0', - - // Color - 'dark:border', - 'dark:border-surface-700', - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-surface-0/80', - - // Before: Arrow - 'before:absolute before:w-0 before:-top-3 before:h-0 before:border-transparent before:border-solid before:ml-6 before:border-x-[0.75rem] before:border-b-[0.75rem] before:border-t-0 before:border-b-surface-0 dark:before:border-b-surface-800' - ] - }, - content: { - class: 'p-5 items-center flex' - }, - icon: { - class: 'text-2xl mr-4' - }, - footer: { - class: [ - // Flexbox and Alignment - 'flex items-center justify-end', - 'shrink-0', - 'text-right', - 'gap-2', - - // Spacing - 'px-6', - 'pb-6', - - // Shape - 'border-t-0', - 'rounded-b-lg', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-surface-0/80' - ] - }, - rejectbutton: { - root: { - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'px-4 py-3 leading-none', - - // Shape - 'rounded-md', - - // Color - 'text-primary', - - // States - 'hover:bg-primary-300/20', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50' - ] - } - }, - acceptbutton: { - root: { - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'px-4 py-3 leading-none', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // States - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50' - ] - } - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/contextmenu/index.js b/apps/web/presets/lara/contextmenu/index.js deleted file mode 100644 index 0fd9239..0000000 --- a/apps/web/presets/lara/contextmenu/index.js +++ /dev/null @@ -1,124 +0,0 @@ -export default { - root: { - class: [ - // Sizing and Shape - 'min-w-[12rem]', - 'rounded-md', - 'shadow-md', - - // Spacing - 'py-2', - - // Colors - 'bg-surface-0 dark:bg-surface-700', - 'text-surface-700 dark:text-white/80', - 'dark:border dark:border-surface-700' - ] - }, - menu: { - class: [ - // Spacings and Shape - 'list-none', - 'm-0', - 'p-0', - 'outline-none' - ] - }, - menuitem: { - class: 'relative' - }, - content: ({ context }) => ({ - class: [ - //Shape - 'rounded-none', - // Colors - 'text-surface-700 dark:text-white/80', - { - 'text-surface-500 dark:text-white/70': !context.focused && !context.active, - 'text-surface-500 dark:text-white/70 bg-surface-200 dark:bg-surface-600/90': context.focused && !context.active, - 'text-primary-highlight-inverse bg-primary-highlight': (context.focused && context.active) || context.active || (!context.focused && context.active) - }, - - // Transitions - 'transition-shadow', - 'duration-200', - - // States - { - 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.active, - 'hover:bg-primary-highlight-hover text-primary-highlight-inverse': context.active - }, - - // Disabled - { 'opacity-60 pointer-events-none cursor-default': context.disabled } - ] - }), - action: { - class: [ - 'relative', - // Flexbox - - 'flex', - 'items-center', - - // Spacing - 'py-3', - 'px-5', - - // Color - 'text-surface-700 dark:text-white/80', - - // Misc - 'no-underline', - 'overflow-hidden', - 'cursor-pointer', - 'select-none' - ] - }, - icon: { - class: [ - // Spacing - 'mr-2', - - // Color - 'text-surface-600 dark:text-white/70' - ] - }, - label: { - class: ['leading-none'] - }, - submenu: ({ props }) => ({ - class: [ - // Size - 'w-full sm:w-48', - - // Spacing - 'py-1', - 'm-0', - 'list-none', - - // Shape - 'shadow-md', - 'rounded-md', - 'dark:border dark:border-surface-700', - - // Position - 'static sm:absolute', - 'z-10', - { 'sm:absolute sm:left-full sm:top-0': props.level > 1 }, - - // Color - 'bg-surface-0 dark:bg-surface-700' - ] - }), - submenuicon: { - class: ['ml-auto'] - }, - separator: { - class: 'border-t border-surface-200 dark:border-surface-600 my-1' - }, - transition: { - enterFromClass: 'opacity-0', - enterActiveClass: 'transition-opacity duration-250' - } -}; diff --git a/apps/web/presets/lara/datatable/index.js b/apps/web/presets/lara/datatable/index.js deleted file mode 100644 index faf4f22..0000000 --- a/apps/web/presets/lara/datatable/index.js +++ /dev/null @@ -1,1166 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'relative', - - // Flex & Alignment - { 'flex flex-col': props.scrollable && props.scrollHeight === 'flex' }, - - // Size - { 'h-full': props.scrollable && props.scrollHeight === 'flex' } - ] - }), - loadingoverlay: { - class: [ - // Position - 'absolute', - 'top-0 left-0', - 'z-20', - - // Flex & Alignment - 'flex items-center justify-center', - - // Size - 'w-full h-full', - - // Color - 'bg-surface-100/40 dark:bg-surface-800/40', - - // Transition - 'transition duration-200' - ] - }, - loadingicon: { - class: 'w-8 h-8 animate-spin' - }, - wrapper: ({ props }) => ({ - class: [ - { relative: props.scrollable, 'flex flex-col grow': props.scrollable && props.scrollHeight === 'flex' }, - - // Size - { 'h-full': props.scrollable && props.scrollHeight === 'flex' } - ] - }), - header: ({ props }) => ({ - class: [ - 'font-bold', - - // Shape - props.showGridlines ? 'border-x border-t border-b-0' : 'border-y border-x-0', - - // Spacing - 'p-4', - - // Color - 'bg-surface-50 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700', - 'text-surface-700 dark:text-white/80' - ] - }), - table: { - class: 'w-full border-spacing-0 border-separate' - }, - thead: ({ context }) => ({ - class: [ - { - 'bg-surface-50 dark:bg-surface-800 top-0 z-40 sticky': context.scrollable - } - ] - }), - tbody: ({ instance, context }) => ({ - class: [ - { - 'sticky z-20': instance.frozenRow && context.scrollable - }, - 'bg-surface-50 dark:bg-surface-800' - ] - }), - tfoot: ({ context }) => ({ - class: [ - { - 'bg-surface-50 bottom-0 z-0': context.scrollable - } - ] - }), - footer: { - class: [ - 'font-bold', - - // Shape - 'border-t-0 border-b border-x-0', - - // Spacing - 'p-4', - - // Color - 'bg-surface-50 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700', - 'text-surface-700 dark:text-white/80' - ] - }, - column: { - headercell: ({ context, props }) => ({ - class: [ - 'font-bold', - - // Position - { 'sticky z-20 border-b': props.frozen || props.frozen === '' }, - - { relative: context.resizable }, - - // Alignment - 'text-left', - - // Shape - { 'first:border-l border-y border-r': context?.showGridlines }, - 'border-0 border-b border-solid', - - // Spacing - context?.size === 'small' ? 'p-2' : context?.size === 'large' ? 'p-5' : 'p-4', - - // Color - (props.sortable === '' || props.sortable) && context.sorted ? 'bg-primary-highlight text-primary-highlight-inverse' : 'bg-surface-50 text-surface-700 dark:text-white/80 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700 ', - - // States - { 'hover:bg-surface-100 dark:hover:bg-surface-400/30': (props.sortable === '' || props.sortable) && !context?.sorted }, - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transition - { 'transition duration-200': props.sortable === '' || props.sortable }, - - // Misc - { 'cursor-pointer': props.sortable === '' || props.sortable }, - { - 'overflow-hidden space-nowrap border-y bg-clip-padding': context.resizable // Resizable - } - ] - }), - headercontent: { - class: 'flex items-center' - }, - sort: ({ context }) => ({ - class: [context.sorted ? 'text-primary-500' : 'text-surface-700', context.sorted ? 'dark:text-primary-400' : 'dark:text-white/80'] - }), - bodycell: ({ props, context, state, parent }) => ({ - class: [ - //Position - { 'sticky box-border border-b': parent.instance.frozenRow }, - { 'sticky box-border border-b z-20': props.frozen || props.frozen === '' }, - - // Alignment - 'text-left', - - // Shape - 'border-0 border-b border-solid', - { 'first:border-l border-r border-b': context?.showGridlines }, - { 'bg-surface-0 dark:bg-surface-800': parent.instance.frozenRow || props.frozen || props.frozen === '' }, - - // Spacing - { 'p-2': context?.size === 'small' && !state['d_editing'] }, - { 'p-5': context?.size === 'large' && !state['d_editing'] }, - { 'p-4': context?.size !== 'large' && context?.size !== 'small' && !state['d_editing'] }, - { 'py-[0.6rem] px-2': state['d_editing'] }, - - // Color - 'border-surface-200 dark:border-surface-700' - ] - }), - footercell: ({ context }) => ({ - class: [ - // Font - 'font-bold', - - // Alignment - 'text-left', - - // Shape - 'border-0 border-b border-solid', - { 'border-x border-y': context?.showGridlines }, - - // Spacing - context?.size === 'small' ? 'p-2' : context?.size === 'large' ? 'p-5' : 'p-4', - - // Color - 'border-surface-200 dark:border-surface-700', - 'text-surface-700 dark:text-white/80', - 'bg-surface-50 dark:bg-surface-800' - ] - }), - sorticon: ({ context }) => ({ - class: ['ml-2', context.sorted ? 'text-primary-highlight-inverse' : 'text-surface-700 dark:text-white/70'] - }), - sortbadge: { - class: [ - // Flex & Alignment - 'flex items-center justify-center align-middle', - - // Shape - 'rounded-full', - - // Size - 'w-[1.143rem] leading-[1.143rem]', - - // Spacing - 'ml-2', - - // Color - 'text-primary-highlight-inverse', - 'bg-primary-highlight' - ] - }, - columnfilter: { - class: 'inline-flex items-center ml-auto' - }, - filteroverlay: { - class: [ - // Position - 'absolute top-0 left-0', - - // Shape - 'border-0 dark:border', - 'rounded-md', - 'shadow-md', - - // Size - 'min-w-[12.5rem]', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-800 dark:text-white/80', - 'dark:border-surface-700' - ] - }, - filtermatchmodedropdown: { - root: ({ state }) => ({ - class: [ - // Display and Position - 'flex', - 'relative', - - // Spacing - 'my-2', - - // Shape - 'w-full', - 'rounded-md', - - // Color and Background - 'bg-surface-0 dark:bg-surface-900', - 'border border-surface-300 dark:border-surface-700', - 'text-surface-800 dark:text-white/80', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - - // Transitions - 'transition-all', - 'duration-200', - - // States - 'hover:border-primary', - { 'outline-none outline-offset-0 ring ring-primary-400/50 dark:ring-primary-300/50': state.focused }, - - // Misc - 'cursor-pointer', - 'select-none' - ] - }) - }, - filterrowitems: { - class: 'm-0 p-0 py-3 list-none' - }, - filterrowitem: ({ context }) => ({ - class: [ - // Font - 'font-normal', - 'leading-none', - - // Position - 'relative', - - // Shape - 'border-0', - 'rounded-none', - - // Spacing - 'm-0', - 'py-3 px-5', - - // Color - { 'bg-surface-0 dark:bg-surface-800 text-surface-700 dark:text-white/80': !context?.highlighted }, - { 'bg-primary-highlight text-primary-highlight-inverse': context?.highlighted }, - - //States - { 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context?.highlighted }, - { 'hover:text-surface-700 hover:bg-surface-100 dark:hover:text-white dark:hover:bg-surface-600/80': !context?.highlighted }, - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transitions - 'transition-shadow', - 'duration-200', - - // Misc - 'cursor-pointer', - 'overflow-hidden', - 'whitespace-nowrap' - ] - }), - filteroperator: { - class: [ - // Spacing - 'px-5 py-3', - - // Shape - 'border-b border-solid', - 'rounded-t-md', - - // Color - 'text-surface-700 dark:text-white/80', - 'border-surface-200 dark:border-surface-800', - 'bg-surface-0 dark:bg-surface-700' - ] - }, - filteroperatordropdown: { - root: ({ state }) => ({ - class: [ - // Display and Position - 'inline-flex', - 'relative', - - // Shape - 'w-full', - 'rounded-md', - - // Color and Background - 'bg-surface-0 dark:bg-surface-900', - 'border border-surface-300 dark:border-surface-700', - - // Transitions - 'transition-all', - 'duration-200', - - // States - 'hover:border-primary', - { 'outline-none outline-offset-0 ring ring-primary-400/50 dark:ring-primary-300/50': state.focused }, - - // Misc - 'cursor-pointer', - 'select-none' - ] - }), - input: ({ props }) => ({ - class: [ - //Font - 'leading-[normal]', - - // Display - 'block', - 'flex-auto', - - // Color and Background - 'bg-transparent', - 'border-0', - { 'text-surface-800 dark:text-white/80': props.modelValue, 'text-surface-400 dark:text-surface-500': !props.modelValue }, - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - - // Sizing and Spacing - 'w-[1%]', - 'p-3', - - //Shape - 'rounded-none', - - // Transitions - 'transition', - 'duration-200', - - // States - 'focus:outline-none focus:shadow-none', - - // Misc - 'relative', - 'cursor-pointer', - 'overflow-hidden overflow-ellipsis', - 'whitespace-nowrap', - 'appearance-none' - ] - }), - trigger: { - class: [ - // Flexbox - 'flex items-center justify-center', - 'shrink-0', - - // Color and Background - 'bg-transparent', - 'text-surface-500', - - // Size - 'w-12', - - // Shape - 'rounded-tr-md', - 'rounded-br-md' - ] - }, - panel: { - class: [ - // Position - 'absolute top-0 left-0', - - // Shape - 'border-0 dark:border', - 'rounded-md', - 'shadow-md', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-800 dark:text-white/80', - 'dark:border-surface-700' - ] - }, - item: ({ context }) => ({ - class: [ - // Font - 'font-normal', - 'leading-none', - - // Position - 'relative', - - // Shape - 'border-0', - 'rounded-none', - - // Spacing - 'm-0', - 'py-3 px-5', - - // Color - { 'text-surface-700 dark:text-white/80': !context.focused && !context.selected }, - { 'bg-surface-50 dark:bg-surface-600/60 text-surface-700 dark:text-white/80': context.focused && !context.selected }, - { 'bg-primary-highlight text-primary-highlight-inverse': !context.focused && context.selected }, - - //States - { 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.focused && !context.selected }, - { 'hover:text-surface-700 hover:bg-surface-100 dark:hover:text-white dark:hover:bg-surface-600/80': context.focused && !context.selected }, - - // Transitions - 'transition-shadow', - 'duration-200', - - // Misc - 'cursor-pointer', - 'overflow-hidden', - 'whitespace-nowrap' - ] - }) - }, - filterconstraint: { - class: [ - // Spacing - 'py-3 px-5', - - // Shape - 'border-b border-solid', - - // Color - 'border-surface-200 dark:border-surface-700' - ] - }, - filteraddrule: { - class: 'py-3 px-5' - }, - filteraddrulebutton: { - root: { - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'text-sm py-2 px-3 w-full', - - // Shape - 'rounded-md', - - 'bg-transparent border-transparent', - 'text-primary', - 'hover:bg-primary-300/20', - - // Transitions - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer overflow-hidden select-none' - ] - }, - label: { - class: 'flex-auto grow-0' - }, - icon: { - class: 'mr-2' - } - }, - filterremovebutton: { - root: { - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'text-sm py-2 px-3 w-full mt-2', - - // Shape - 'rounded-md', - - 'bg-transparent border-transparent', - 'text-red-500 dark:text-red-400', - 'hover:bg-red-300/20', - - // Transitions - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer overflow-hidden select-none' - ] - }, - label: { - class: 'flex-auto grow-0' - }, - icon: { - class: 'mr-2' - } - }, - filterbuttonbar: { - class: [ - // Flex & Alignment - 'flex items-center justify-between', - - // Space - 'py-3 px-5' - ] - }, - filterclearbutton: { - root: { - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'text-sm py-2 px-3', - - // Shape - 'rounded-md', - - 'text-primary-500 border border-primary', - 'hover:bg-primary-300/20', - - // Transitions - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer overflow-hidden select-none' - ] - } - }, - filterapplybutton: { - root: { - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'text-sm py-2 px-3', - - // Shape - 'rounded-md', - - 'text-primary-inverse', - 'bg-primary', - 'hover:bg-primary-hover hover:border-primary-hover', - - // Transitions - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer overflow-hidden select-none' - ] - } - }, - filtermenubutton: ({ context }) => ({ - class: [ - 'relative', - // Flex & Alignment - 'inline-flex items-center justify-center', - - // Size - 'w-8 h-8', - - // Spacing - 'ml-2', - - // Shape - 'rounded-full', - - // Color - { 'bg-primary-highlight text-highlight-inverse': context.active }, - 'dark:text-white/70 dark:hover:text-white/80 dark:bg-surface-800', - - // States - 'hover:text-surface-700 hover:bg-surface-300/20', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transition - 'transition duration-200', - - // Misc - 'cursor-pointer no-underline overflow-hidden' - ] - }), - headerfilterclearbutton: ({ context }) => ({ - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - 'text-left', - - // Shape - 'border-none', - - // Spacing - 'm-0 p-0 ml-2', - - // Color - 'bg-transparent', - - // Misc - 'cursor-pointer no-underline overflow-hidden select-none', - { - invisible: !context.hidden - } - ] - }), - rowtoggler: { - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - 'text-left', - - // Spacing - 'm-0 p-0', - - // Size - 'w-8 h-8', - - // Shape - 'border-0 rounded-full', - - // Color - 'text-surface-500 dark:text-white/70', - 'bg-transparent', - 'focus-visible:outline-none focus-visible:outline-offset-0', - 'focus-visible:ring focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transition - 'transition duration-200', - - // Misc - 'overflow-hidden', - 'cursor-pointer select-none' - ] - }, - columnresizer: { - class: [ - 'block', - - // Position - 'absolute top-0 right-0', - - // Sizing - 'w-2 h-full', - - // Spacing - 'm-0 p-0', - - // Color - 'border border-transparent', - - // Misc - 'cursor-col-resize' - ] - }, - rowreordericon: { - class: 'cursor-move' - }, - roweditorinitbutton: { - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - 'text-left', - - // Size - 'w-8 h-8', - - // Shape - 'border-0 rounded-full', - - // Color - 'text-surface-700 dark:text-white/70', - 'border-transparent', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - 'hover:text-surface-700 hover:bg-surface-300/20', - - // Transition - 'transition duration-200', - - // Misc - 'overflow-hidden', - 'cursor-pointer select-none' - ] - }, - roweditorsavebutton: { - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - 'text-left', - - // Size - 'w-8 h-8', - - // Shape - 'border-0 rounded-full', - - // Color - 'text-surface-700 dark:text-white/70', - 'border-transparent', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - 'hover:text-surface-700 hover:bg-surface-300/20', - - // Transition - 'transition duration-200', - - // Misc - 'overflow-hidden', - 'cursor-pointer select-none' - ] - }, - roweditorcancelbutton: { - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - 'text-left', - - // Size - 'w-8 h-8', - - // Shape - 'border-0 rounded-full', - - // Color - 'text-surface-700 dark:text-white/70', - 'border-transparent', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - 'hover:text-surface-700 hover:bg-surface-300/20', - - // Transition - 'transition duration-200', - - // Misc - 'overflow-hidden', - 'cursor-pointer select-none' - ] - }, - rowRadiobutton: { - root: { - class: [ - 'relative', - - // Flexbox & Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-[1.571rem] h-[1.571rem]', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: ({ props }) => ({ - class: [ - // Flexbox - 'flex justify-center items-center', - - // Size - 'w-[1.571rem] h-[1.571rem]', - - // Shape - 'border-2', - 'rounded-full', - - // Transition - 'transition duration-200 ease-in-out', - - // Colors - { - 'text-surface-700 dark:text-white/80': !props.modelValue, - 'bg-surface-0 dark:bg-surface-900': !props.modelValue, - 'border-surface-300 dark:border-surface-700': !props.modelValue, - 'border-primary dark:border-primary': props.modelValue, - 'bg-primary dark:bg-primary': props.modelValue - }, - - // States - { - 'peer-hover:border-primary': !props.disabled, - 'peer-hover:border-primary-hover peer-hover:bg-primary-hover': !props.disabled && props.modelValue, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'opacity-60 cursor-default': props.disabled - } - ] - }), - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: ({ props }) => ({ - class: [ - 'block', - - // Shape - 'rounded-full', - - // Size - 'w-[0.857rem] h-[0.857rem]', - - // Colors - 'bg-surface-0 dark:bg-surface-900', - - // Conditions - { - 'backface-hidden scale-10 invisible': !props.modelValue, - 'transform visible scale-[1.1]': props.modelValue - }, - - // Transition - 'transition duration-200' - ] - }) - }, - headercheckbox: { - root: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-6', - 'h-6', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: ({ props, context }) => ({ - class: [ - // Alignment - 'flex', - 'items-center', - 'justify-center', - - // Size - 'w-6', - 'h-6', - - // Shape - 'rounded-md', - 'border-2', - - // Colors - { - 'border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked, - 'border-primary bg-primary': context.checked - }, - - // States - { - 'peer-hover:border-primary': !props.disabled && !context.checked, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': !props.disabled && context.checked, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'cursor-default opacity-60': props.disabled - }, - - // Transitions - 'transition-colors', - 'duration-200' - ] - }), - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - 'text-white dark:text-surface-900', - - // Transitions - 'transition-all', - 'duration-200' - ] - } - }, - rowCheckbox: { - root: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-6', - 'h-6', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: ({ props, context }) => ({ - class: [ - // Alignment - 'flex', - 'items-center', - 'justify-center', - - // Size - 'w-6', - 'h-6', - - // Shape - 'rounded-md', - 'border-2', - - // Colors - { - 'border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked, - 'border-primary bg-primary': context.checked - }, - - // States - { - 'peer-hover:border-primary': !props.disabled && !context.checked, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': !props.disabled && context.checked, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'cursor-default opacity-60': props.disabled - }, - - // Transitions - 'transition-colors', - 'duration-200' - ] - }), - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - 'text-white dark:text-surface-900', - - // Transitions - 'transition-all', - 'duration-200' - ] - } - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } - }, - bodyrow: ({ context, props }) => ({ - class: [ - // Color - 'dark:text-white/80', - { 'bg-primary-highlight text-primary-highlight-inverse': context.selected }, - { 'bg-surface-0 text-surface-600 dark:bg-surface-800': !context.selected }, - { 'font-bold bg-surface-0 dark:bg-surface-800 z-20': props.frozenRow }, - { 'odd:bg-surface-0 odd:text-surface-600 dark:odd:bg-surface-800 even:bg-surface-50 even:text-surface-600 dark:even:bg-surface-900/50': context.stripedRows }, - - // State - { 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 ring-inset dark:focus:ring-primary-300/50': context.selectable }, - { 'hover:bg-surface-300/20 hover:text-surface-600': props.selectionMode && !context.selected }, - - // Transition - { 'transition duration-200': (props.selectionMode && !context.selected) || props.rowHover }, - - // Misc - { 'cursor-pointer': props.selectionMode } - ] - }), - rowexpansion: { - class: 'bg-surface-0 dark:bg-surface-800 text-surface-600 dark:text-white/80' - }, - rowgroupheader: { - class: ['sticky z-20', 'bg-surface-0 text-surface-600 dark:text-white/70', 'dark:bg-surface-800'] - }, - rowgroupfooter: { - class: ['sticky z-20', 'bg-surface-0 text-surface-600 dark:text-white/70', 'dark:bg-surface-800'] - }, - rowgrouptoggler: { - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - 'text-left', - - // Spacing - 'm-0 p-0', - - // Size - 'w-8 h-8', - - // Shape - 'border-0 rounded-full', - - // Color - 'text-surface-500 dark:text-white/70', - 'bg-transparent', - 'focus-visible:outline-none focus-visible:outline-offset-0', - 'focus-visible:ring focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transition - 'transition duration-200', - - // Misc - 'overflow-hidden', - 'cursor-pointer select-none' - ] - }, - rowgrouptogglericon: { - class: 'inline-block w-4 h-4' - }, - resizehelper: { - class: 'absolute hidden w-[2px] z-20 bg-primary' - } -}; diff --git a/apps/web/presets/lara/dataview/index.js b/apps/web/presets/lara/dataview/index.js deleted file mode 100644 index 2eed11b..0000000 --- a/apps/web/presets/lara/dataview/index.js +++ /dev/null @@ -1,40 +0,0 @@ -export default { - content: { - class: [ - // Spacing - 'p-0', - - // Shape - 'border-0', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-800' - ] - }, - grid: { - class: [ - // flex - 'flex flex-wrap', - - // Spacing - 'ml-0 mr-0 mt-0', - - // Color - 'bg-surface-0 dark:bg-surface-800' - ] - }, - header: { - class: [ - 'font-bold', - - // Spacing - 'p-4', - - // Color - 'text-surface-800 dark:text-white/80', - 'bg-surface-50 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700 border-y' - ] - } -}; diff --git a/apps/web/presets/lara/dataviewlayoutoptions/index.js b/apps/web/presets/lara/dataviewlayoutoptions/index.js deleted file mode 100644 index bbfa6d2..0000000 --- a/apps/web/presets/lara/dataviewlayoutoptions/index.js +++ /dev/null @@ -1,58 +0,0 @@ -export default { - listbutton: ({ props }) => ({ - class: [ - // Font - 'leading-none', - - // Flex Alignment - 'inline-flex items-center align-bottom text-center', - - // Shape - 'border rounded-md rounded-r-none', - - // Spacing - 'px-4 py-3', - - // Color - props.modelValue === 'list' ? 'bg-primary border-primary text-primary-inverse' : 'bg-surface-0 dark:bg-surface-900 border-surface-200 dark:border-surface-700 text-surface-700 dark:text-white/80', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - props.modelValue === 'list' ? 'hover:bg-primary-hover' : 'hover:bg-surface-50 dark:hover:bg-surface-800/80', - - // Transition - 'transition duration-200', - - // Misc - 'cursor-pointer select-none overflow-hidden' - ] - }), - gridbutton: ({ props }) => ({ - class: [ - // Font - 'leading-none', - - // Flex Alignment - 'inline-flex items-center align-bottom text-center', - - // Shape - 'border rounded-md rounded-l-none', - - // Spacing - 'px-4 py-3', - - // Color - props.modelValue === 'grid' ? 'bg-primary border-primary text-primary-inverse' : 'bg-surface-0 dark:bg-surface-900 border-surface-200 dark:border-surface-700 text-surface-700 dark:text-white/80', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - props.modelValue === 'grid' ? 'hover:bg-primary-hover' : 'hover:bg-surface-50 dark:hover:bg-surface-800/80', - - // Transition - 'transition duration-200', - - // Misc - 'cursor-pointer select-none overflow-hidden' - ] - }) -}; diff --git a/apps/web/presets/lara/deferred/index.js b/apps/web/presets/lara/deferred/index.js deleted file mode 100644 index 2064371..0000000 --- a/apps/web/presets/lara/deferred/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - root: {} -}; diff --git a/apps/web/presets/lara/dialog/index.js b/apps/web/presets/lara/dialog/index.js deleted file mode 100644 index adb8f1e..0000000 --- a/apps/web/presets/lara/dialog/index.js +++ /dev/null @@ -1,235 +0,0 @@ -export default { - root: ({ state }) => ({ - class: [ - // Shape - 'rounded-lg', - 'shadow-lg', - 'border-0', - - // Size - 'max-h-[90vh]', - 'w-[50vw]', - 'm-0', - - // Color - 'dark:border', - 'dark:border-surface-700', - - // Transitions - 'transform', - 'scale-100', - - // Maximized State - { - 'transition-none': state.maximized, - 'transform-none': state.maximized, - '!w-screen': state.maximized, - '!h-screen': state.maximized, - '!max-h-full': state.maximized, - '!top-0': state.maximized, - '!left-0': state.maximized - } - ] - }), - header: { - class: [ - // Flexbox and Alignment - 'flex items-center justify-between', - 'shrink-0', - - // Spacing - 'p-6', - - // Shape - 'border-t-0', - 'rounded-tl-lg', - 'rounded-tr-lg', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-surface-0/80' - ] - }, - title: { - class: ['font-bold text-lg'] - }, - icons: { - class: ['flex items-center'] - }, - closeButton: { - class: [ - 'relative', - - // Flexbox and Alignment - 'flex items-center justify-center', - - // Size and Spacing - 'mr-2', - 'last:mr-0', - 'w-8 h-8', - - // Shape - 'border-0', - 'rounded-full', - - // Colors - 'text-surface-500', - 'bg-transparent', - - // Transitions - 'transition duration-200 ease-in-out', - - // States - 'hover:text-surface-700 dark:hover:text-white/80', - 'hover:bg-surface-100 dark:hover:bg-surface-800/80', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-inset', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Misc - 'overflow-hidden' - ] - }, - maximizablebutton: { - class: [ - 'relative', - - // Flexbox and Alignment - 'flex items-center justify-center', - - // Size and Spacing - 'mr-2', - 'last:mr-0', - 'w-8 h-8', - - // Shape - 'border-0', - 'rounded-full', - - // Colors - 'text-surface-500', - 'bg-transparent', - - // Transitions - 'transition duration-200 ease-in-out', - - // States - 'hover:text-surface-700 dark:hover:text-white/80', - 'hover:bg-surface-100 dark:hover:bg-surface-800/80', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-inset', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Misc - 'overflow-hidden' - ] - }, - closeButtonIcon: { - class: [ - // Display - 'inline-block', - - // Size - 'w-4', - 'h-4' - ] - }, - maximizableicon: { - class: [ - // Display - 'inline-block', - - // Size - 'w-4', - 'h-4' - ] - }, - content: ({ state, instance }) => ({ - class: [ - // Spacing - 'px-6', - 'pb-8', - 'pt-0', - - // Shape - { - grow: state.maximized, - 'rounded-bl-lg': !instance.$slots.footer, - 'rounded-br-lg': !instance.$slots.footer - }, - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-surface-0/80', - - // Misc - 'overflow-y-auto' - ] - }), - footer: { - class: [ - // Flexbox and Alignment - 'flex items-center justify-end', - 'shrink-0', - 'text-right', - 'gap-2', - - // Spacing - 'px-6', - 'pb-6', - - // Shape - 'border-t-0', - 'rounded-b-lg', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-surface-0/80' - ] - }, - mask: ({ props }) => ({ - class: [ - // Transitions - 'transition-all', - 'duration-300', - { 'p-5': !props.position == 'full' }, - - // Background and Effects - { 'has-[.mask-active]:bg-transparent bg-black/40': props.modal, 'has-[.mask-active]:backdrop-blur-none backdrop-blur-sm': props.modal } - ] - }), - transition: ({ props }) => { - return props.position === 'top' - ? { - enterFromClass: 'opacity-0 scale-75 translate-x-0 -translate-y-full translate-z-0 mask-active', - enterActiveClass: 'transition-all duration-200 ease-out', - leaveActiveClass: 'transition-all duration-200 ease-out', - leaveToClass: 'opacity-0 scale-75 translate-x-0 -translate-y-full translate-z-0 mask-active' - } - : props.position === 'bottom' - ? { - enterFromClass: 'opacity-0 scale-75 translate-y-full mask-active', - enterActiveClass: 'transition-all duration-200 ease-out', - leaveActiveClass: 'transition-all duration-200 ease-out', - leaveToClass: 'opacity-0 scale-75 translate-x-0 translate-y-full translate-z-0 mask-active' - } - : props.position === 'left' || props.position === 'topleft' || props.position === 'bottomleft' - ? { - enterFromClass: 'opacity-0 scale-75 -translate-x-full translate-y-0 translate-z-0 mask-active', - enterActiveClass: 'transition-all duration-200 ease-out', - leaveActiveClass: 'transition-all duration-200 ease-out', - leaveToClass: 'opacity-0 scale-75 -translate-x-full translate-y-0 translate-z-0 mask-active' - } - : props.position === 'right' || props.position === 'topright' || props.position === 'bottomright' - ? { - enterFromClass: 'opacity-0 scale-75 translate-x-full translate-y-0 translate-z-0 mask-active', - enterActiveClass: 'transition-all duration-200 ease-out', - leaveActiveClass: 'transition-all duration-200 ease-out', - leaveToClass: 'opacity-0 scale-75 translate-x-full translate-y-0 translate-z-0 mask-active' - } - : { - enterFromClass: 'opacity-0 scale-75 mask-active', - enterActiveClass: 'transition-all duration-200 ease-out', - leaveActiveClass: 'transition-all duration-200 ease-out', - leaveToClass: 'opacity-0 scale-75 mask-active' - }; - } -}; diff --git a/apps/web/presets/lara/divider/index.js b/apps/web/presets/lara/divider/index.js deleted file mode 100644 index b440697..0000000 --- a/apps/web/presets/lara/divider/index.js +++ /dev/null @@ -1,67 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Flex and Position - 'flex relative', - { 'justify-center': props.layout == 'vertical' }, - { 'items-center': props.layout == 'vertical' }, - { - 'justify-start': props?.align == 'left' && props.layout == 'horizontal', - 'justify-center': props?.align == 'center' && props.layout == 'horizontal', - 'justify-end': props?.align == 'right' && props.layout == 'horizontal', - 'items-center': props?.align == 'top' && props.layout == 'vertical', - 'items-start': props?.align == 'center' && props.layout == 'vertical', - 'items-end': props?.align == 'bottom' && props.layout == 'vertical' - }, - - // Spacing - { - 'my-5 mx-0 py-0 px-5': props.layout == 'horizontal', - 'mx-4 md:mx-5 py-5': props.layout == 'vertical' - }, - - // Size - { - 'w-full': props.layout == 'horizontal', - 'min-h-full': props.layout == 'vertical' - }, - - // Before: Line - 'before:block', - - // Position - { - 'before:absolute before:left-0 before:top-1/2': props.layout == 'horizontal', - 'before:absolute before:left-1/2 before:top-0 before:transform before:-translate-x-1/2': props.layout == 'vertical' - }, - - // Size - { - 'before:w-full': props.layout == 'horizontal', - 'before:min-h-full': props.layout == 'vertical' - }, - - // Shape - { - 'before:border-solid': props.type == 'solid', - 'before:border-dotted': props.type == 'dotted', - 'before:border-dashed': props.type == 'dashed' - }, - - // Color - { - 'before:border-t before:border-surface-200 before:dark:border-surface-600': props.layout == 'horizontal', - 'before:border-l before:border-surface-200 before:dark:border-surface-600': props.layout == 'vertical' - } - ] - }), - content: { - class: [ - // Space and Position - 'px-1 z-10', - - // Color - 'bg-surface-0 dark:bg-surface-800' - ] - } -}; diff --git a/apps/web/presets/lara/dock/index.js b/apps/web/presets/lara/dock/index.js deleted file mode 100644 index 5a33ade..0000000 --- a/apps/web/presets/lara/dock/index.js +++ /dev/null @@ -1,93 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Positioning - 'absolute z-1', - { - 'left-0 bottom-0 w-full': props.position == 'bottom', - 'left-0 top-0 w-full': props.position == 'top', - 'left-0 top-0 h-full': props.position == 'left', - 'right-0 top-0 h-full': props.position == 'right' - }, - - // Flexbox & Alignment - 'flex justify-center items-center', - - // Interactivity - 'pointer-events-none' - ] - }), - container: { - class: [ - // Flexbox - 'flex', - - // Shape & Border - 'rounded-md', - - // Color - 'bg-surface-0/10 dark:bg-surface-900/20 border border-surface-0/20', - 'backdrop-blur-sm', - - // Spacing - 'p-2', - - // Misc - 'pointer-events-auto' - ] - }, - menu: ({ props }) => ({ - class: [ - // Flexbox & Alignment - 'flex items-center justify-center', - { - 'flex-col': props.position == 'left' || props.position == 'right' - }, - - // List Style - 'm-0 p-0 list-none', - - // Shape - 'outline-none' - ] - }), - menuitem: ({ props, context, instance }) => ({ - class: [ - // Spacing & Shape - 'p-2 rounded-md', - - // Conditional Scaling - { - 'hover:scale-150': instance.currentIndex === context.index, - 'scale-125': instance.currentIndex - 1 === context.index || instance.currentIndex + 1 === context.index, - 'scale-110': instance.currentIndex - 2 === context.index || instance.currentIndex + 2 === context.index - }, - - // Positioning & Hover States - { - 'origin-bottom hover:mx-6': props.position == 'bottom', - 'origin-top hover:mx-6': props.position == 'top', - 'origin-left hover:my-6': props.position == 'left', - 'origin-right hover:my-6': props.position == 'right' - }, - - // Transitions & Transform - 'transition-all duration-200 ease-cubic-bezier-will-change-transform transform' - ] - }), - action: { - class: [ - // Flexbox & Alignment - 'flex flex-col items-center justify-center', - - // Position - 'relative', - - // Size - 'w-16 h-16', - - // Misc - 'cursor-default overflow-hidden' - ] - } -}; diff --git a/apps/web/presets/lara/dropdown/index.js b/apps/web/presets/lara/dropdown/index.js deleted file mode 100644 index 4578ccb..0000000 --- a/apps/web/presets/lara/dropdown/index.js +++ /dev/null @@ -1,278 +0,0 @@ -export default { - root: ({ props, state, parent }) => ({ - class: [ - // Display and Position - 'inline-flex', - 'relative', - - // Shape - { 'rounded-md': parent.instance.$name !== 'InputGroup' }, - { 'first:rounded-l-md rounded-none last:rounded-r-md': parent.instance.$name == 'InputGroup' }, - { 'border-0 border-y border-l last:border-r': parent.instance.$name == 'InputGroup' }, - { 'first:ml-0 ml-[-1px]': parent.instance.$name == 'InputGroup' && !props.showButtons }, - - // Color and Background - 'bg-surface-0 dark:bg-surface-900', - - 'border border-surface-300', - { 'dark:border-surface-700': parent.instance.$name != 'InputGroup' }, - { 'dark:border-surface-600': parent.instance.$name == 'InputGroup' }, - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // Transitions - 'transition-all', - 'duration-200', - - // States - { 'hover:border-primary': !props.invalid }, - { 'outline-none outline-offset-0 ring ring-primary-400/50 dark:ring-primary-300/50': state.focused }, - - // Misc - 'cursor-pointer', - 'select-none', - { 'opacity-60': props.disabled, 'pointer-events-none': props.disabled, 'cursor-default': props.disabled } - ] - }), - input: ({ props, parent }) => ({ - class: [ - //Font - 'leading-[normal]', - - // Display - 'block', - 'flex-auto', - - // Color and Background - 'bg-transparent', - 'border-0', - { 'text-surface-800 dark:text-white/80': props.modelValue != undefined, 'text-surface-400 dark:text-surface-500': props.modelValue == undefined }, - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - - // Sizing and Spacing - 'w-[1%]', - 'p-3', - { 'pr-7': props.showClear }, - - //Shape - 'rounded-none', - - // Transitions - 'transition', - 'duration-200', - - // States - 'focus:outline-none focus:shadow-none', - - // Filled State *for FloatLabel - { filled: parent.instance?.$name == 'FloatLabel' && props.modelValue !== null }, - - // Misc - 'relative', - 'cursor-pointer', - 'overflow-hidden overflow-ellipsis', - 'whitespace-nowrap', - 'appearance-none' - ] - }), - trigger: { - class: [ - // Flexbox - 'flex items-center justify-center', - 'shrink-0', - - // Color and Background - 'bg-transparent', - 'text-surface-500', - - // Size - 'w-12', - - // Shape - 'rounded-tr-md', - 'rounded-br-md' - ] - }, - panel: { - class: [ - // Position - 'absolute top-0 left-0', - - // Shape - 'border-0 dark:border', - 'rounded-md', - 'shadow-md', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-800 dark:text-white/80', - 'dark:border-surface-700' - ] - }, - wrapper: { - class: [ - // Sizing - 'max-h-[200px]', - - // Misc - 'overflow-auto' - ] - }, - list: { - class: 'py-3 list-none m-0' - }, - item: ({ context }) => ({ - class: [ - // Font - 'font-normal', - 'leading-none', - - // Position - 'relative', - - // Shape - 'border-0', - 'rounded-none', - - // Spacing - 'm-0', - 'py-3 px-5', - - // Colors - { - 'text-surface-700 dark:text-white/80': !context.focused && !context.selected, - 'bg-surface-200 dark:bg-surface-600/60': context.focused && !context.selected, - 'text-surface-700 dark:text-white/80': context.focused && !context.selected, - - 'text-primary-highlight-inverse': context.selected, - 'bg-primary-highlight': context.selected - }, - - //States - { 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.focused && !context.selected }, - { 'hover:bg-primary-highlight-hover': context.selected }, - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transitions - 'transition-shadow', - 'duration-200', - - // Misc - { 'pointer-events-none cursor-default': context.disabled }, - { 'cursor-pointer': !context.disabled }, - 'overflow-hidden', - 'whitespace-nowrap' - ] - }), - itemgroup: { - class: [ - //Font - 'font-bold', - - // Spacing - 'm-0', - 'py-3 px-5', - - // Color - 'text-surface-800 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-600/80', - - // Misc - 'cursor-auto' - ] - }, - emptymessage: { - class: [ - // Font - 'leading-none', - - // Spacing - 'py-3 px-5', - - // Color - 'text-surface-800 dark:text-white/80', - 'bg-transparent' - ] - }, - header: { - class: [ - // Spacing - 'py-3 px-5', - 'm-0', - - //Shape - 'border-b', - 'rounded-tl-md', - 'rounded-tr-md', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-100 dark:bg-surface-800', - 'border-surface-300 dark:border-surface-700' - ] - }, - filtercontainer: { - class: 'relative' - }, - filterinput: { - class: [ - // Font - 'leading-[normal]', - - // Sizing - 'pr-7 py-3 px-3', - '-mr-7', - 'w-full', - - //Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-900', - 'border-surface-200 dark:border-surface-700', - - // Shape - 'border', - 'rounded-lg', - 'appearance-none', - - // Transitions - 'transition', - 'duration-200', - - // States - 'hover:border-primary', - 'focus:ring focus:outline-none focus:outline-offset-0', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Misc - 'appearance-none' - ] - }, - filtericon: { - class: ['absolute', 'top-1/2 right-3', '-mt-2'] - }, - clearicon: { - class: [ - // Color - 'text-surface-500', - - // Position - 'absolute', - 'top-1/2', - 'right-12', - - // Spacing - '-mt-2' - ] - }, - loadingicon: { - class: 'text-surface-400 dark:text-surface-500 animate-spin' - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/fieldset/index.js b/apps/web/presets/lara/fieldset/index.js deleted file mode 100644 index 3b70c80..0000000 --- a/apps/web/presets/lara/fieldset/index.js +++ /dev/null @@ -1,84 +0,0 @@ -export default { - root: { - class: [ - 'block', - - // Spacing - 'px-4 pt-2 py-3', - 'inline-size-min', - - // Shape - 'rounded-md', - // Color - 'border border-surface-200 dark:border-surface-700', - 'bg-surface-0 dark:bg-surface-900', - 'text-surface-700 dark:text-surface-0/80' - ] - }, - legend: ({ props }) => ({ - class: [ - // Font - 'font-bold', - 'leading-none', - - //Spacing - { 'p-0': props.toggleable, 'p-5': !props.toggleable }, - - // Shape - 'rounded-md', - - // Color - 'text-surface-700 dark:text-surface-0/80', - 'border border-surface-200 dark:border-surface-700', - 'bg-surface-50 dark:bg-surface-900', - - // Transition - 'transition-none', - - // States - { 'hover:bg-surface-100 hover:border-surface-200 hover:text-surface-900 dark:hover:text-surface-0/80 dark:hover:bg-surface-800/80': props.toggleable } - ] - }), - toggler: ({ props }) => ({ - class: [ - // Alignments - 'flex items-center justify-center', - 'relative', - - //Spacing - { 'p-5': props.toggleable }, - - // Shape - { 'rounded-md': props.toggleable }, - - // Color - { 'text-surface-700 dark:text-surface-200 hover:text-surface-900': props.toggleable }, - - // States - { 'hover:text-surface-900 dark:hover:text-surface-100': props.toggleable }, - { 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50': props.toggleable }, - - // Misc - { - 'transition-none cursor-pointer overflow-hidden select-none': props.toggleable - } - ] - }), - togglerIcon: { - class: 'mr-2 inline-block' - }, - legendTitle: { - class: 'flex items-center justify-center leading-none' - }, - content: { - class: 'p-5' - }, - transition: { - enterFromClass: 'max-h-0', - enterActiveClass: 'overflow-hidden transition-[max-height] duration-1000 ease-[cubic-bezier(0.42,0,0.58,1)]', - enterToClass: 'max-h-[1000px]', - leaveFromClass: 'max-h-[1000px]', - leaveActiveClass: 'overflow-hidden transition-[max-height] duration-[450ms] ease-[cubic-bezier(0,1,0,1)]', - leaveToClass: 'max-h-0' - } -}; diff --git a/apps/web/presets/lara/fileupload/index.js b/apps/web/presets/lara/fileupload/index.js deleted file mode 100644 index 4a75972..0000000 --- a/apps/web/presets/lara/fileupload/index.js +++ /dev/null @@ -1,173 +0,0 @@ -export default { - input: { - class: 'hidden' - }, - buttonbar: { - class: [ - // Flexbox - 'flex', - 'flex-wrap', - - // Colors - 'bg-surface-50', - 'dark:bg-surface-800', - 'text-surface-700', - 'dark:text-white/80', - - // Spacing - 'p-5', - 'gap-2', - - // Borders - 'border', - 'border-solid', - 'border-surface-200', - 'dark:border-surface-700', - 'border-b-0', - - // Shape - 'rounded-tr-lg', - 'rounded-tl-lg' - ] - }, - chooseButton: { - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Spacing - 'px-4 py-3', - - // Shape - 'rounded-md', - - // Font - 'leading-[normal]', - 'font-bold', - - // Colors - 'text-primary-inverse', - 'bg-primary', - 'border-primary', - - // States - 'hover:bg-primary-hover', - - // Misc - 'overflow-hidden', - 'cursor-pointer' - ] - }, - chooseIcon: { - class: ['mr-2', 'inline-block'] - }, - chooseButtonLabel: { - class: ['flex-1', 'font-bold'] - }, - uploadbutton: { - icon: { - class: 'mr-2' - } - }, - cancelbutton: { - icon: { - class: 'mr-2' - } - }, - content: { - class: [ - // Position - 'relative', - - // Colors - 'bg-surface-0', - 'dark:bg-surface-900', - 'text-surface-700', - 'dark:text-white/80', - - // Spacing - 'p-8', - - // Borders - 'border', - 'border-surface-200', - 'dark:border-surface-700', - - // Shape - 'rounded-b-lg' - ] - }, - file: { - class: [ - // Flexbox - 'flex', - 'items-center', - 'flex-wrap', - - // Spacing - 'p-4', - 'mb-2', - 'last:mb-0', - - // Borders - 'border', - 'border-surface-200', - 'dark:border-surface-700', - 'gap-2', - - // Shape - 'rounded' - ] - }, - thumbnail: { - class: 'shrink-0' - }, - fileName: { - class: 'mb-2 break-all' - }, - fileSize: { - class: 'mr-2' - }, - uploadicon: { - class: 'mr-2' - }, - progressbar: { - root: { - class: [ - // Position and Overflow - 'overflow-hidden', - 'absolute top-0 left-0', - - // Shape and Size - 'border-0', - 'h-2', - 'rounded-md', - 'w-full', - - // Colors - 'bg-surface-100 dark:bg-surface-700' - ] - }, - value: { - class: [ - // Flexbox & Overflow & Position - 'absolute flex items-center justify-center overflow-hidden', - - // Colors - 'bg-primary', - - // Spacing & Sizing - 'm-0', - 'h-full w-0', - - // Shape - 'border-0', - - // Transitions - 'transition-width duration-1000 ease-in-out' - ] - } - } -}; diff --git a/apps/web/presets/lara/floatlabel/index.js b/apps/web/presets/lara/floatlabel/index.js deleted file mode 100644 index 557808f..0000000 --- a/apps/web/presets/lara/floatlabel/index.js +++ /dev/null @@ -1,26 +0,0 @@ -export default { - root: { - class: [ - 'block relative', - - // Base Label Appearance - '[&>*:last-child]:text-surface-900/60 dark:[&>*:last-child]:text-white/60', - '[&>*:last-child]:absolute', - '[&>*:last-child]:top-1/2', - '[&>*:last-child]:-translate-y-1/2', - '[&>*:last-child]:left-3', - '[&>*:last-child]:pointer-events-none', - '[&>*:last-child]:transition-all', - '[&>*:last-child]:duration-200', - '[&>*:last-child]:ease', - - // Focus Label Appearance - '[&>*:last-child]:has-[:focus]:-top-3', - '[&>*:last-child]:has-[:focus]:text-sm', - - // Filled Input Label Appearance - '[&>*:last-child]:has-[.filled]:-top-3', - '[&>*:last-child]:has-[.filled]:text-sm' - ] - } -}; diff --git a/apps/web/presets/lara/galleria/index.js b/apps/web/presets/lara/galleria/index.js deleted file mode 100644 index 014b1b0..0000000 --- a/apps/web/presets/lara/galleria/index.js +++ /dev/null @@ -1,308 +0,0 @@ -export default { - content: ({ parent, props }) => ({ - class: [ - 'flex', - { - 'flex-col': props.fullScreen - }, - { - 'flex-col': parent.props.thumbnailsPosition === 'top' || parent.props.thumbnailsPosition === 'bottom', - 'flex-row': parent.props.thumbnailsPosition === 'right' || parent.props.thumbnailsPosition === 'left' - } - ] - }), - itemwrapper: ({ parent, props }) => ({ - class: [ - 'group', - 'flex relative', - { - 'grow shrink w-0 justify-center': props.fullScreen - }, - { - 'flex-col': parent.props.indicatorsPosition === 'bottom' || parent.props.indicatorsPosition === 'top', - 'flex-row items-center': parent.props.indicatorsPosition === 'left' || parent.props.indicatorsPosition === 'right' - }, - { - 'order-2': parent.props.thumbnailsPosition === 'top' || parent.props.thumbnailsPosition === 'left', - 'flex-row': parent.props.thumbnailsPosition === 'right' - } - ] - }), - - itemcontainer: ({ parent }) => ({ - class: [ - 'flex h-full relative', - { - 'order-1': parent.props.indicatorsPosition === 'bottom' || parent.props.indicatorsPosition === 'right', - 'order-2': parent.props.indicatorsPosition === 'top' || parent.props.indicatorsPosition === 'left' - } - ] - }), - item: { - class: [ - // Flex - 'flex justify-center items-center h-full w-full', - - // Sizing - 'h-full w-full' - ] - }, - thumbnailwrapper: ({ parent }) => ({ - class: [ - // Flex - 'flex flex-col shrink-0', - - { - 'order-1': parent.props.thumbnailsPosition === 'top' || parent.props.thumbnailsPosition === 'left' - }, - - // Misc - 'overflow-auto' - ] - }), - thumbnailcontainer: ({ parent }) => ({ - class: [ - // Flex - 'flex', - - // Spacing - 'p-4', - - // Colors - 'bg-black/90', - - { - 'flex-row': parent.props.thumbnailsPosition === 'top' || parent.props.thumbnailsPosition === 'bottom', - 'flex-col grow': parent.props.thumbnailsPosition === 'right' || parent.props.thumbnailsPosition === 'left' - } - ] - }), - previousthumbnailbutton: { - class: [ - // Positioning - 'self-center relative', - - // Display & Flexbox - 'flex shrink-0 justify-center items-center overflow-hidden', - - // Spacing - 'm-2', - - // Appearance - 'bg-transparent text-white w-8 h-8 rounded-full transition duration-200 ease-in-out', - - // Hover Effects - 'hover:bg-surface-0/10 hover:text-white', - - // Focus Effects - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50' - ] - }, - thumbnailitemscontainer: { - class: 'overflow-hidden w-full' - }, - thumbnailitems: ({ parent }) => ({ - class: [ - 'flex', - { - 'flex-col h-full': parent.props.thumbnailsPosition === 'right' || parent.props.thumbnailsPosition === 'left' - } - ] - }), - thumbnailitem: ({ parent }) => ({ - class: [ - // Flexbox - 'flex items-center justify-center', - 'grow shrink-0', - - // Sizing - { - 'w-full md:w-[25%] lg:w-[20%]': parent.props.thumbnailsPosition === 'top' || parent.props.thumbnailsPosition === 'bottom' - }, - - // Misc - 'overflow-auto', - 'cursor-pointer', - 'opacity-50', - - // States - '[&[data-p-active="true"]]:opacity-100', - 'hover:opacity-100', - - // Transitions - 'transition-opacity duration-300' - ] - }), - nextthumbnailbutton: { - class: [ - // Positioning - 'self-center relative', - - // Display & Flexbox - 'flex shrink-0 justify-center items-center overflow-hidden', - - // Spacing - 'm-2', - - // Appearance - 'bg-transparent text-white w-8 h-8 rounded-full transition duration-200 ease-in-out', - - // Hover Effects - 'hover:bg-surface-0/10 hover:text-white', - - // Focus Effects - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50' - ] - }, - indicators: ({ parent }) => ({ - class: [ - // flex - 'flex items-center justify-center', - - // Spacing - 'p-4', - - // Indicators Position - { - 'order-2': parent.props.indicatorsPosition == 'bottom', - 'order-1': parent.props.indicatorsPosition == 'top', - 'order-1 flex-col': parent.props.indicatorsPosition == 'left', - 'flex-col order-2': parent.props.indicatorsPosition == 'right' - }, - { - 'absolute z-10 bg-black/50': parent.props.showIndicatorsOnItem - }, - - { - 'bottom-0 left-0 w-full items-start': parent.props.indicatorsPosition == 'bottom' && parent.props.showIndicatorsOnItem, - 'top-0 left-0 w-full items-start': parent.props.indicatorsPosition == 'top' && parent.props.showIndicatorsOnItem, - 'left-0 top-0 h-full items-start': parent.props.indicatorsPosition == 'left' && parent.props.showIndicatorsOnItem, - 'right-0 top-0 h-full items-start': parent.props.indicatorsPosition == 'right' && parent.props.showIndicatorsOnItem - } - ] - }), - indicator: ({ parent }) => ({ - class: [ - { - 'mr-2': parent.props.indicatorsPosition == 'bottom' || parent.props.indicatorsPosition == 'top', - 'mb-2': parent.props.indicatorsPosition == 'left' || parent.props.indicatorsPosition == 'right' - } - ] - }), - indicatorbutton: ({ context }) => ({ - class: [ - // Size - 'w-4 h-4', - - // Appearance - 'rounded-full transition duration-200', - - // Focus Effects - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Conditional Appearance: Not Highlighted - { 'bg-surface-200 hover:bg-surface-300 dark:bg-surface-700 dark:hover:bg-surface-600': !context.highlighted }, - - // Conditional Appearance: Highlighted - { 'bg-primary hover:bg-primary-hover': context.highlighted } - ] - }), - mask: { - class: ['fixed top-0 left-0 w-full h-full', 'flex items-center justify-center', 'bg-black/90'] - }, - closebutton: { - class: [ - // Positioning - '!absolute top-0 right-0', - - // Display & Flexbox - 'flex justify-center items-center overflow-hidden', - - // Spacing - 'm-2', - - // Appearance - 'text-white bg-transparent w-12 h-12 rounded-full transition duration-200 ease-in-out', - - // Hover Effect - 'hover:text-white hover:bg-surface-0/10', - - // Focus Effects - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50' - ] - }, - closeicon: { - class: 'w-6 h-6' - }, - previousitembutton: ({ parent }) => ({ - class: [ - // Display & Flexbox - 'inline-flex justify-center items-center overflow-hidden', - - // Appearance - 'bg-transparent text-white w-16 h-16 transition duration-200 ease-in-out rounded-md', - { - 'opacity-0 group-hover:opacity-100': parent.props.showItemNavigatorsOnHover - }, - - // Spacing - 'mx-2', - - // Positioning - 'top-1/2 mt-[-0.5rem] left-0', - { - '!absolute': parent.props.showItemNavigators, - '!fixed': !parent.props.showItemNavigators - }, - - // Hover Effect - 'hover:bg-surface-0/10 hover:text-white', - - // Focus Effects - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50' - ] - }), - nextitembutton: ({ parent }) => ({ - class: [ - // Display & Flexbox - 'inline-flex justify-center items-center overflow-hidden', - - // Appearance - 'bg-transparent text-white w-16 h-16 transition duration-200 ease-in-out rounded-md', - { - 'opacity-0 group-hover:opacity-100': parent.props.showItemNavigatorsOnHover - }, - - // Spacing - 'mx-2', - - // Positioning - 'top-1/2 mt-[-0.5rem] right-0', - { - '!absolute': parent.props.showItemNavigators, - '!fixed': !parent.props.showItemNavigators - }, - - // Hover Effect - 'hover:bg-surface-0/10 hover:text-white', - - // Focus Effects - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50' - ] - }), - caption: { - class: [ - // Positioning - 'absolute bottom-0 left-0 w-full', - - // Appearance - 'bg-black/50 text-white p-4' - ] - }, - transition: { - enterFromClass: 'opacity-0 scale-75', - enterActiveClass: 'transition-all duration-150 ease-in-out', - leaveActiveClass: 'transition-all duration-150 ease-in', - leaveToClass: 'opacity-0 scale-75' - } -}; diff --git a/apps/web/presets/lara/global.js b/apps/web/presets/lara/global.js deleted file mode 100644 index 42552db..0000000 --- a/apps/web/presets/lara/global.js +++ /dev/null @@ -1,90 +0,0 @@ -export default { - css: ` - *[data-pd-ripple="true"]{ - overflow: hidden; - position: relative; - } - span[data-p-ink-active="true"]{ - animation: ripple 0.4s linear; - } - @keyframes ripple { - 100% { - opacity: 0; - transform: scale(2.5); - } - } - - .progress-spinner-circle { - stroke-dasharray: 89, 200; - stroke-dashoffset: 0; - animation: p-progress-spinner-dash 1.5s ease-in-out infinite, p-progress-spinner-color 6s ease-in-out infinite; - stroke-linecap: round; - } - - @keyframes p-progress-spinner-dash{ - 0% { - stroke-dasharray: 1, 200; - stroke-dashoffset: 0; - } - - 50% { - stroke-dasharray: 89, 200; - stroke-dashoffset: -35px; - } - 100% { - stroke-dasharray: 89, 200; - stroke-dashoffset: -124px; - } - } - @keyframes p-progress-spinner-color { - 100%, 0% { - stroke: #ff5757; - } - 40% { - stroke: #696cff; - } - 66% { - stroke: #1ea97c; - } - 80%, 90% { - stroke: #cc8925; - } - } - - .progressbar-value-animate::after { - will-change: left, right; - animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; - } - .progressbar-value-animate::before { - will-change: left, right; - animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; - } - @keyframes p-progressbar-indeterminate-anim { - 0% { - left: -35%; - right: 100%; - } - 60% { - left: 100%; - right: -90%; - } - 100% { - left: 100%; - right: -90%; - } - } - - .p-fadein { - animation: p-fadein 250ms linear; - } - - @keyframes p-fadein { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } - } -` -}; diff --git a/apps/web/presets/lara/iconfield/index.js b/apps/web/presets/lara/iconfield/index.js deleted file mode 100644 index 73afd18..0000000 --- a/apps/web/presets/lara/iconfield/index.js +++ /dev/null @@ -1,22 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'relative', - '[&>input]:w-full', - - '[&>*:first-child]:absolute', - '[&>*:first-child]:top-1/2', - '[&>*:first-child]:-mt-2', - '[&>*:first-child]:leading-[normal]', - '[&>*:first-child]:text-surface-900/60 dark:[&>*:first-child]:text-white/60', - { - '[&>*:first-child]:right-3': props.iconPosition === 'right', - '[&>*:first-child]:left-3': props.iconPosition === 'left' - }, - { - '[&>*:last-child]:pr-10': props.iconPosition === 'right', - '[&>*:last-child]:pl-10': props.iconPosition === 'left' - } - ] - }) -}; diff --git a/apps/web/presets/lara/image/index.js b/apps/web/presets/lara/image/index.js deleted file mode 100644 index e6d6f9f..0000000 --- a/apps/web/presets/lara/image/index.js +++ /dev/null @@ -1,206 +0,0 @@ -export default { - root: { - class: 'relative inline-block' - }, - button: { - class: [ - // Flexbox & Alignment - 'flex items-center justify-center', - - // Positioning - 'absolute', - - // Shape - 'inset-0 opacity-0 transition-opacity duration-300', - - // Color - 'bg-transparent text-surface-100', - - // States - 'hover:opacity-100 hover:cursor-pointer hover:bg-black/50 hover:bg-opacity-50' - ] - }, - mask: { - class: [ - // Flexbox & Alignment - 'flex items-center justify-center', - - // Positioning - 'fixed top-0 left-0', - - // Sizing - 'w-full h-full', - - // Color - 'bg-black/90' - ] - }, - toolbar: { - class: [ - // Flexbox - 'flex', - - // Positioning - 'absolute top-0 right-0', - - // Spacing - 'p-4' - ] - }, - rotaterightbutton: { - class: [ - 'z-20', - - // Flexbox & Alignment - 'flex justify-center items-center', - - // Size - 'w-12 h-12', - - // Spacing - 'mr-2', - - // Shape - 'rounded-full', - - // Color - 'text-white bg-transparent', - - // States - 'hover:text-white hover:bg-surface-0/10', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transition - 'transition duration-200 ease-in-out' - ] - }, - rotaterighticon: { - class: 'w-6 h-6' - }, - rotateleftbutton: { - class: [ - 'z-20', - - // Flexbox & Alignment - 'flex justify-center items-center', - - // Size - 'w-12 h-12', - - // Spacing - 'mr-2', - - // Shape - 'rounded-full', - - // Color - 'text-white bg-transparent', - - // States - 'hover:text-white hover:bg-surface-0/10', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transition - 'transition duration-200 ease-in-out' - ] - }, - rotatelefticon: { - class: 'w-6 h-6' - }, - zoomoutbutton: { - class: [ - 'z-20', - - // Flexbox & Alignment - 'flex justify-center items-center', - - // Size - 'w-12 h-12', - - // Spacing - 'mr-2', - - // Shape - 'rounded-full', - - // Color - 'text-white bg-transparent', - - // States - 'hover:text-white hover:bg-surface-0/10', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transition - 'transition duration-200 ease-in-out' - ] - }, - zoomouticon: { - class: 'w-6 h-6' - }, - zoominbutton: { - class: [ - 'z-20', - - // Flexbox & Alignment - 'flex justify-center items-center', - - // Size - 'w-12 h-12', - - // Spacing - 'mr-2', - - // Shape - 'rounded-full', - - // Color - 'text-white bg-transparent', - - // States - 'hover:text-white hover:bg-surface-0/10', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transition - 'transition duration-200 ease-in-out' - ] - }, - zoominicon: { - class: 'w-6 h-6' - }, - closebutton: { - class: [ - 'z-20', - - // Flexbox & Alignment - 'flex justify-center items-center', - - // Size - 'w-12 h-12', - - // Spacing - 'mr-2', - - // Shape - 'rounded-full', - - // Color - 'text-white bg-transparent', - - // States - 'hover:text-white hover:bg-surface-0/10', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transition - 'transition duration-200 ease-in-out' - ] - }, - closeicon: { - class: 'w-6 h-6' - }, - transition: { - enterFromClass: 'opacity-0 scale-75', - enterActiveClass: 'transition-all duration-150 ease-in-out', - leaveActiveClass: 'transition-all duration-150 ease-in', - leaveToClass: 'opacity-0 scale-75' - } -}; diff --git a/apps/web/presets/lara/index.js b/apps/web/presets/lara/index.js deleted file mode 100644 index 49eb5e7..0000000 --- a/apps/web/presets/lara/index.js +++ /dev/null @@ -1,207 +0,0 @@ -import accordion from './accordion'; -import autocomplete from './autocomplete'; -import avatar from './avatar'; -import avatargroup from './avatargroup'; -import badge from './badge'; -import badgedirective from './badgedirective'; -import blockui from './blockui'; -import breadcrumb from './breadcrumb'; -import button from './button'; -import calendar from './calendar'; -import card from './card'; -import carousel from './carousel'; -import cascadeselect from './cascadeselect'; -import checkbox from './checkbox'; -import chip from './chip'; -import chips from './chips'; -import colorpicker from './colorpicker'; -import confirmpopup from './confirmpopup'; -import contextmenu from './contextmenu'; -import datatable from './datatable'; -import dataview from './dataview'; -import dataviewlayoutoptions from './dataviewlayoutoptions'; -import deferred from './deferred'; -import dialog from './dialog'; -import divider from './divider'; -import dock from './dock'; -import dropdown from './dropdown'; -import fieldset from './fieldset'; -import fileupload from './fileupload'; -import floatlabel from './floatlabel'; -import galleria from './galleria'; -import global from './global'; -import iconfield from './iconfield'; -import image from './image'; -import inlinemessage from './inlinemessage'; -import inplace from './inplace'; -import inputgroup from './inputgroup'; -import inputgroupaddon from './inputgroupaddon'; -import inputmask from './inputmask'; -import inputnumber from './inputnumber'; -import inputotp from './inputotp'; -import inputswitch from './inputswitch'; -import inputtext from './inputtext'; -import knob from './knob'; -import listbox from './listbox'; -import megamenu from './megamenu'; -import menu from './menu'; -import menubar from './menubar'; -import message from './message'; -import metergroup from './metergroup'; -import multiselect from './multiselect'; -import orderlist from './orderlist'; -import organizationchart from './organizationchart'; -import overlaypanel from './overlaypanel'; -import paginator from './paginator'; -import panel from './panel'; -import panelmenu from './panelmenu'; -import password from './password'; -import picklist from './picklist'; -import progressbar from './progressbar'; -import progressspinner from './progressspinner'; -import radiobutton from './radiobutton'; -import rating from './rating'; -import ripple from './ripple'; -import scrollpanel from './scrollpanel'; -import scrolltop from './scrolltop'; -import selectbutton from './selectbutton'; -import sidebar from './sidebar'; -import skeleton from './skeleton'; -import slider from './slider'; -import speeddial from './speeddial'; -import splitbutton from './splitbutton'; -import splitter from './splitter'; -import splitterpanel from './splitterpanel'; -import stepper from './stepper'; -import steps from './steps'; -import tabmenu from './tabmenu'; -import tabview from './tabview'; -import tag from './tag'; -import terminal from './terminal'; -import textarea from './textarea'; -import tieredmenu from './tieredmenu'; -import timeline from './timeline'; -import toast from './toast'; -import togglebutton from './togglebutton'; -import toolbar from './toolbar'; -import tooltip from './tooltip'; -import tree from './tree'; -import treeselect from './treeselect'; -import treetable from './treetable'; -import tristatecheckbox from './tristatecheckbox'; - -export default { - global, - directives: { - badge: badgedirective, - ripple, - tooltip - }, - - //forms - autocomplete, - dropdown, - inputnumber, - inputtext, - calendar, - checkbox, - radiobutton, - inputswitch, - selectbutton, - slider, - chips, - rating, - multiselect, - togglebutton, - cascadeselect, - listbox, - colorpicker, - inputgroup, - inputgroupaddon, - inputmask, - knob, - treeselect, - tristatecheckbox, - textarea, - password, - iconfield, - floatlabel, - inputotp, - - //buttons - button, - splitbutton, - speeddial, - - //data - paginator, - datatable, - tree, - dataview, - dataviewlayoutoptions, - organizationchart, - orderlist, - picklist, - treetable, - timeline, - - //panels - accordion, - panel, - fieldset, - card, - tabview, - divider, - toolbar, - scrollpanel, - splitter, - splitterpanel, - stepper, - deferred, - - //file - fileupload, - - //menu - contextmenu, - menu, - menubar, - steps, - tieredmenu, - breadcrumb, - panelmenu, - megamenu, - dock, - tabmenu, - - //overlays - dialog, - overlaypanel, - sidebar, - confirmpopup, - - //messages - message, - inlinemessage, - toast, - - //media - carousel, - galleria, - image, - - //misc - badge, - avatar, - avatargroup, - tag, - chip, - progressbar, - skeleton, - scrolltop, - terminal, - blockui, - metergroup, - inplace, - progressspinner -}; diff --git a/apps/web/presets/lara/inlinemessage/index.js b/apps/web/presets/lara/inlinemessage/index.js deleted file mode 100644 index 5e0faf7..0000000 --- a/apps/web/presets/lara/inlinemessage/index.js +++ /dev/null @@ -1,36 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'inline-flex items-center justify-center align-top gap-2', - 'p-3 m-0 rounded-md dark:border', - { - 'bg-blue-100/70 dark:bg-blue-500/20': props.severity == 'info', - 'bg-green-100/70 dark:bg-green-500/20': props.severity == 'success', - 'bg-orange-100/70 dark:bg-orange-500/20': props.severity == 'warn', - 'bg-red-100/70 dark:bg-red-500/20': props.severity == 'error' - }, - { - 'dark:border-blue-400': props.severity == 'info', - 'dark:border-green-400': props.severity == 'success', - 'dark:border-orange-400': props.severity == 'warn', - 'dark:border-red-400': props.severity == 'error' - }, - { - 'text-blue-700 dark:text-blue-300': props.severity == 'info', - 'text-green-700 dark:text-green-300': props.severity == 'success', - 'text-orange-700 dark:text-orange-300': props.severity == 'warn', - 'text-red-700 dark:text-red-300': props.severity == 'error' - } - ] - }), - icon: { - class: 'text-base' - }, - text: { - class: [ - // Font and Text - 'text-base leading-none', - 'font-medium' - ] - } -}; diff --git a/apps/web/presets/lara/inplace/index.js b/apps/web/presets/lara/inplace/index.js deleted file mode 100644 index ef7bf37..0000000 --- a/apps/web/presets/lara/inplace/index.js +++ /dev/null @@ -1,27 +0,0 @@ -export default { - display: { - class: [ - // Display - 'inline', - - // Spacing - 'p-3', - - // Shape - 'rounded-md', - - // Colors - 'text-surface-700 dark:text-white/80', - - // States - 'hover:bg-surface-100 hover:text-surface-700 dark:hover:bg-surface-700/80 dark:hover:text-white/80', - - // Transitions - 'transition', - 'duration-200', - - // Misc - 'cursor-pointer' - ] - } -}; diff --git a/apps/web/presets/lara/inputgroup/index.js b/apps/web/presets/lara/inputgroup/index.js deleted file mode 100644 index cce7111..0000000 --- a/apps/web/presets/lara/inputgroup/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - root: { - class: ['flex items-stretch', 'w-full'] - } -}; diff --git a/apps/web/presets/lara/inputgroupaddon/index.js b/apps/web/presets/lara/inputgroupaddon/index.js deleted file mode 100644 index 5ed52fb..0000000 --- a/apps/web/presets/lara/inputgroupaddon/index.js +++ /dev/null @@ -1,28 +0,0 @@ -export default { - root: { - class: [ - // Flex - 'flex items-center justify-center', - - // Shape - 'first:rounded-l-md', - 'last:rounded-r-md', - 'border-y', - - 'last:border-r', - 'border-l', - 'border-r-0', - - // Space - 'p-3', - - // Size - 'min-w-[3rem]', - - // Color - 'bg-surface-50 dark:bg-surface-800', - 'text-surface-600 dark:text-surface-400', - 'border-surface-300 dark:border-surface-600' - ] - } -}; diff --git a/apps/web/presets/lara/inputmask/index.js b/apps/web/presets/lara/inputmask/index.js deleted file mode 100644 index f94f9ec..0000000 --- a/apps/web/presets/lara/inputmask/index.js +++ /dev/null @@ -1,39 +0,0 @@ -export default { - root: ({ context, props, parent }) => ({ - class: [ - // Font - 'leading-[normal]', - - // Spacing - 'm-0 p-3', - - // Colors - 'text-surface-600 dark:text-surface-200', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - 'invalid:focus:ring-red-200', - 'invalid:hover:border-red-500', - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { - 'hover:border-primary': !context.disabled && !props.invalid, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50': !context.disabled, - 'opacity-60 select-none pointer-events-none cursor-default': context.disabled - }, - - // Filled State *for FloatLabel - { filled: parent.instance?.$name == 'FloatLabel' && props.modelValue !== null && props.modelValue?.length !== 0 }, - - // Misc - 'rounded-md', - 'appearance-none', - 'transition-colors duration-200' - ] - }) -}; diff --git a/apps/web/presets/lara/inputnumber/index.js b/apps/web/presets/lara/inputnumber/index.js deleted file mode 100644 index 28949b3..0000000 --- a/apps/web/presets/lara/inputnumber/index.js +++ /dev/null @@ -1,165 +0,0 @@ -export default { - root: ({ props, parent }) => ({ - class: [ - // Flex - 'inline-flex', - { 'flex-col': props.showButtons && props.buttonLayout == 'vertical' }, - { 'flex-1 w-[1%]': parent.instance.$name == 'InputGroup' }, - - // Shape - { 'first:rounded-l-md rounded-none last:rounded-r-md': parent.instance.$name == 'InputGroup' && !props.showButtons }, - { 'border-0 border-y border-l last:border-r border-surface-300 dark:border-surface-600': parent.instance.$name == 'InputGroup' && !props.showButtons }, - { 'first:ml-0 -ml-px': parent.instance.$name == 'InputGroup' && !props.showButtons }, - - //Sizing - { '!w-16': props.showButtons && props.buttonLayout == 'vertical' } - ] - }), - input: { - root: ({ parent, context }) => ({ - class: [ - // Display - 'flex flex-auto', - - // Font - 'leading-[normal]', - - //Text - { 'text-center': parent.props.showButtons && parent.props.buttonLayout == 'vertical' }, - - // Spacing - 'p-3', - 'm-0', - - // Shape - 'rounded-lg', - { 'rounded-tr-none rounded-br-none': parent.props.showButtons }, - { 'rounded-tl-none rounded-bl-none': parent.props.showButtons && parent.props.buttonLayout == 'horizontal' }, - { 'rounded-none': parent.props.showButtons && parent.props.buttonLayout == 'vertical' }, - - { 'border-0': parent.instance.$parentInstance?.$name == 'InputGroup' && !parent.props.showButtons }, - - // Colors - 'text-surface-800 dark:text-white/80', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !parent.props.invalid }, - - // Invalid State - 'invalid:focus:ring-red-200', - 'invalid:hover:border-red-500', - { 'border-red-500 dark:border-red-400': parent.props.invalid }, - - // States - { 'hover:border-primary': !parent.props.invalid }, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50 focus:z-10', - { 'opacity-60 select-none pointer-events-none cursor-default': context.disabled }, - - // Filled State *for FloatLabel - { filled: parent.instance?.$parentInstance?.$name == 'FloatLabel' && parent.state.d_modelValue !== null }, - - //Position - { 'order-2': parent.props.buttonLayout == 'horizontal' || parent.props.buttonLayout == 'vertical' } - ] - }) - }, - buttongroup: ({ props }) => ({ - class: [ - // Flex - 'flex', - 'flex-col' - ] - }), - - incrementbutton: { - root: ({ parent }) => ({ - class: [ - // Display - 'flex flex-auto', - - // Alignment - 'items-center', - 'justify-center', - 'text-center align-bottom', - - //Position - 'relative', - { 'order-3': parent.props.showButtons && parent.props.buttonLayout == 'horizontal' }, - { 'order-1': parent.props.showButtons && parent.props.buttonLayout == 'vertical' }, - - // Colors - 'text-primary-inverse', - 'bg-primary', - 'border-primary', - - // Sizing - 'w-[3rem]', - { 'px-4 py-3': parent.props.showButtons && parent.props.buttonLayout !== 'stacked' }, - { 'p-0': parent.props.showButtons && parent.props.buttonLayout == 'stacked' }, - { 'w-full': parent.props.showButtons && parent.props.buttonLayout == 'vertical' }, - - // Shape - 'rounded-md', - { 'rounded-tl-none rounded-br-none rounded-bl-none': parent.props.showButtons && parent.props.buttonLayout == 'stacked' }, - { 'rounded-bl-none rounded-tl-none': parent.props.showButtons && parent.props.buttonLayout == 'horizontal' }, - { 'rounded-bl-none rounded-br-none': parent.props.showButtons && parent.props.buttonLayout == 'vertical' }, - - //States - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'hover:bg-primary-hover hover:border-primary-hover', - - //Misc - 'cursor-pointer overflow-hidden select-none' - ] - }), - label: { - class: 'h-0 w-0' - } - }, - decrementbutton: { - root: ({ parent }) => ({ - class: [ - // Display - 'flex flex-auto', - - // Alignment - 'items-center', - 'justify-center', - 'text-center align-bottom', - - //Position - 'relative', - { 'order-1': parent.props.showButtons && parent.props.buttonLayout == 'horizontal' }, - { 'order-3': parent.props.showButtons && parent.props.buttonLayout == 'vertical' }, - - // Colors - 'text-primary-inverse', - 'bg-primary', - 'border-primary', - - // Sizing - 'w-[3rem]', - { 'px-4 py-3': parent.props.showButtons && parent.props.buttonLayout !== 'stacked' }, - { 'p-0': parent.props.showButtons && parent.props.buttonLayout == 'stacked' }, - { 'w-full': parent.props.showButtons && parent.props.buttonLayout == 'vertical' }, - - // Shape - 'rounded-md', - { 'rounded-tr-none rounded-tl-none rounded-bl-none': parent.props.showButtons && parent.props.buttonLayout == 'stacked' }, - { 'rounded-tr-none rounded-br-none ': parent.props.showButtons && parent.props.buttonLayout == 'horizontal' }, - { 'rounded-tr-none rounded-tl-none ': parent.props.showButtons && parent.props.buttonLayout == 'vertical' }, - - //States - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'hover:bg-primary-hover hover:border-primary-hover', - - //Misc - 'cursor-pointer overflow-hidden select-none' - ] - }), - label: { - class: 'h-0 w-0' - } - } -}; diff --git a/apps/web/presets/lara/inputotp/index.js b/apps/web/presets/lara/inputotp/index.js deleted file mode 100644 index 37c9161..0000000 --- a/apps/web/presets/lara/inputotp/index.js +++ /dev/null @@ -1,62 +0,0 @@ -export default { - root: { - class: [ - // Alignment - 'flex items-center', - 'gap-2' - ] - }, - input: { - root: ({ props, context, parent }) => ({ - class: [ - // Font - 'leading-[normal]', - - // Flex & Alignment - { 'flex-1 w-[1%]': parent.instance.$name == 'InputGroup' }, - 'text-center', - - // Spacing - 'm-0', - { - 'p-3': props.size == null - }, - - // Size - 'w-10', - - // Shape - { 'rounded-md': parent.instance.$name !== 'InputGroup' }, - { 'first:rounded-l-md rounded-none last:rounded-r-md': parent.instance.$name == 'InputGroup' }, - { 'border-0 border-y border-l last:border-r': parent.instance.$name == 'InputGroup' }, - { 'first:ml-0 ml-[-1px]': parent.instance.$name == 'InputGroup' && !props.showButtons }, - - // Colors - 'text-surface-800 dark:text-white/80', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - 'invalid:focus:ring-red-200', - 'invalid:hover:border-red-500', - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { - 'hover:border-primary': !context.disabled && !props.invalid, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50 focus:z-10': !context.disabled, - 'opacity-60 select-none pointer-events-none cursor-default': context.disabled - }, - - // Filled State *for FloatLabel - { filled: parent.instance?.$name == 'FloatLabel' && context.filled }, - - // Misc - 'appearance-none', - 'transition-colors duration-200' - ] - }) - } -}; diff --git a/apps/web/presets/lara/inputswitch/index.js b/apps/web/presets/lara/inputswitch/index.js deleted file mode 100644 index e602c3f..0000000 --- a/apps/web/presets/lara/inputswitch/index.js +++ /dev/null @@ -1,80 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'inline-block relative', - 'w-12 h-7', - 'rounded-2xl', - { - 'opacity-60 select-none pointer-events-none cursor-default': props.disabled - } - ] - }), - slider: ({ props }) => ({ - class: [ - // Position - 'absolute top-0 left-0 right-0 bottom-0', - { 'before:transform before:translate-x-5': props.modelValue == props.trueValue }, - - // Shape - 'rounded-2xl', - - // Before: - 'before:absolute before:top-1/2 before:left-1', - 'before:-mt-2.5', - 'before:h-5 before:w-5', - 'before:rounded-full', - 'before:duration-200', - 'before:bg-surface-0 before:dark:bg-surface-900', - - // Colors - 'border', - { - 'bg-surface-200 dark:bg-surface-700': !(props.modelValue == props.trueValue), - 'bg-primary': props.modelValue == props.trueValue - }, - - { 'border-transparent': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { 'peer-hover:bg-surface-300 dark:peer-hover:bg-surface-600 ': !(props.modelValue == props.trueValue) && !props.disabled }, - { 'peer-hover:bg-primary-hover ': props.modelValue == props.trueValue && !props.disabled }, - 'peer-focus-visible:ring peer-focus-visible:ring-primary-400/50 dark:peer-focus-visible:ring-primary-300/50', - - // Transition - 'transition-colors duration-200', - - // Misc - 'cursor-pointer' - ] - }), - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-[2.5rem]', - 'outline-none', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - } -}; diff --git a/apps/web/presets/lara/inputtext/index.js b/apps/web/presets/lara/inputtext/index.js deleted file mode 100644 index e743636..0000000 --- a/apps/web/presets/lara/inputtext/index.js +++ /dev/null @@ -1,51 +0,0 @@ -export default { - root: ({ props, context, parent }) => ({ - class: [ - // Font - 'leading-[normal]', - - // Flex - { 'flex-1 w-[1%]': parent.instance.$name == 'InputGroup' }, - - // Spacing - 'm-0', - { - 'px-4 py-4': props.size == 'large', - 'px-2 py-2': props.size == 'small', - 'p-3': props.size == null - }, - - // Shape - { 'rounded-md': parent.instance.$name !== 'InputGroup' }, - { 'first:rounded-l-md rounded-none last:rounded-r-md': parent.instance.$name == 'InputGroup' }, - { 'border-0 border-y border-l last:border-r': parent.instance.$name == 'InputGroup' }, - { 'first:ml-0 -ml-px': parent.instance.$name == 'InputGroup' && !props.showButtons }, - - // Colors - 'text-surface-800 dark:text-white/80', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - 'invalid:focus:ring-red-200', - 'invalid:hover:border-red-500', - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { - 'hover:border-primary': !context.disabled && !props.invalid, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50 focus:z-10': !context.disabled, - 'opacity-60 select-none pointer-events-none cursor-default': context.disabled - }, - - // Filled State *for FloatLabel - { filled: parent.instance?.$name == 'FloatLabel' && context.filled }, - - // Misc - 'appearance-none', - 'transition-colors duration-200' - ] - }) -}; diff --git a/apps/web/presets/lara/knob/index.js b/apps/web/presets/lara/knob/index.js deleted file mode 100644 index 21d2c61..0000000 --- a/apps/web/presets/lara/knob/index.js +++ /dev/null @@ -1,44 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Misc - { 'opacity-60 select-none pointer-events-none cursor-default': props.disabled } - ] - }), - range: { - class: [ - // Stroke - 'stroke-current', - - // Color - 'stroke-surface-200 dark:stroke-surface-700', - - // Fill - 'fill-none', - - // Transition - 'transition duration-100 ease-in' - ] - }, - value: { - class: [ - // Animation - 'animate-dash-frame', - - // Color - 'stroke-primary', - - // Fill - 'fill-none' - ] - }, - label: { - class: [ - // Text Style - 'text-center text-xl', - - // Color - 'fill-surface-600 dark:fill-surface-200' - ] - } -}; diff --git a/apps/web/presets/lara/listbox/index.js b/apps/web/presets/lara/listbox/index.js deleted file mode 100644 index 94a18ae..0000000 --- a/apps/web/presets/lara/listbox/index.js +++ /dev/null @@ -1,155 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Sizing and Shape - 'min-w-[12rem]', - 'rounded-md', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-white/80', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid } - ] - }), - wrapper: { - class: [ - // Overflow - 'overflow-auto' - ] - }, - list: { - class: 'py-3 list-none m-0 outline-none' - }, - item: ({ context }) => ({ - class: [ - // Font - 'font-normal', - 'leading-none', - - // Position - 'relative', - - // Shape - 'border-0', - 'rounded-none', - - // Spacing - 'm-0', - 'py-3 px-5', - - // Colors - { - 'text-surface-700 dark:text-white/80': !context.focused && !context.selected, - 'bg-surface-200 dark:bg-surface-600/60': context.focused && !context.selected, - 'text-surface-700 dark:text-white/80': context.focused && !context.selected, - - 'text-primary-highlight-inverse': context.selected, - 'bg-primary-highlight': context.selected - }, - - //States - { 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.focused && !context.selected }, - { 'hover:bg-primary-highlight-hover': context.selected }, - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transitions - 'transition-shadow', - 'duration-200', - - // Misc - 'cursor-pointer', - 'overflow-hidden', - 'whitespace-nowrap' - ] - }), - itemgroup: { - class: [ - //Font - 'font-bold', - - // Spacing - 'm-0', - 'py-3 px-5', - - // Color - 'text-surface-800 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-600/80', - - // Misc - 'cursor-auto' - ] - }, - header: { - class: [ - // Spacing - 'py-3 px-5', - 'm-0', - - //Shape - 'border-b', - 'rounded-tl-md', - 'rounded-tr-md', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-100 dark:bg-surface-800', - 'border-surface-300 dark:border-surface-600' - ] - }, - filtercontainer: { - class: 'relative' - }, - filterinput: { - class: [ - // Font - 'leading-none', - - // Sizing - 'pr-7 py-3 px-3', - '-mr-7', - 'w-full', - - //Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-900', - 'border-surface-200 dark:border-surface-700', - - // Shape - 'border', - 'rounded-lg', - 'appearance-none', - - // Transitions - 'transition', - 'duration-200', - - // States - 'hover:border-primary', - 'focus:ring focus:outline-none focus:outline-offset-0', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Misc - 'appearance-none' - ] - }, - filtericon: { - class: ['absolute', 'top-1/2 right-3', '-mt-2'] - }, - emptymessage: { - class: [ - // Font - 'leading-none', - - // Spacing - 'py-3 px-5', - - // Color - 'text-surface-800 dark:text-white/80', - 'bg-transparent' - ] - } -}; diff --git a/apps/web/presets/lara/megamenu/index.js b/apps/web/presets/lara/megamenu/index.js deleted file mode 100644 index 3770b2d..0000000 --- a/apps/web/presets/lara/megamenu/index.js +++ /dev/null @@ -1,198 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'relative', - - // Flexbox - 'flex', - - // Shape & Size - 'rounded-md', - - // Color - 'bg-surface-50 dark:bg-surface-700', - 'border border-surface-200 dark:border-surface-700', - { 'p-2 items-center': props.orientation == 'horizontal', 'flex-col sm:w-48 p-0 py-1': props.orientation !== 'horizontal' } - ] - }), - menu: ({ props }) => ({ - class: [ - // Flexbox - 'sm:flex', - 'items-center', - 'flex-wrap', - 'flex-col sm:flex-row', - { hidden: !props?.mobileActive, flex: props?.mobileActive }, - - // Position - 'absolute sm:relative', - 'top-full left-0', - 'sm:top-auto sm:left-auto', - - // Size - 'w-full sm:w-auto', - - // Spacing - 'm-0', - 'py-1 sm:py-0 sm:p-0', - 'list-none', - - // Shape - 'shadow-md sm:shadow-none', - 'border-0', - - // Color - 'bg-surface-0 dark:bg-surface-700 sm:bg-transparent dark:sm:bg-transparent', - - // Misc - 'outline-none' - ] - }), - menuitem: ({ props }) => ({ - class: [ - 'sm:relative static', - { - 'sm:w-auto w-full': props.horizontal, - 'w-full': !props.horizontal - } - ] - }), - content: ({ props, context }) => ({ - class: [ - // Shape - { 'rounded-md': props.level < 1 && props.horizontal }, - - // Colors - { - 'text-surface-500 dark:text-white/70': !context.focused && !context.active, - 'text-surface-500 dark:text-white/70 bg-surface-200 dark:bg-surface-600/90': context.focused && !context.active, - 'text-primary-highlight-inverse bg-primary-highlight': (context.focused && context.active) || context.active || (!context.focused && context.active) - }, - - // Hover States - { - 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.active, - 'hover:bg-primary-highlight-hover text-primary-highlight-inverse': context.active - }, - - // Transitions - 'transition-all', - 'duration-200' - ] - }), - action: { - class: [ - 'relative', - - // Flexbox - 'flex', - 'items-center', - - // Spacing - 'py-3', - 'px-5', - - // Size - 'py-3 pr-5 pl-9 sm:pl-5', - 'leading-none', - - // Misc - 'select-none', - 'cursor-pointer', - 'no-underline ', - 'overflow-hidden' - ] - }, - icon: { - class: 'mr-2' - }, - submenuicon: ({ props }) => ({ - class: [ - { - 'ml-auto sm:ml-2': props.horizontal, - 'ml-auto': !props.horizontal - } - ] - }), - panel: ({ props }) => ({ - class: [ - // Size - 'w-auto', - - // Spacing - 'py-1', - 'm-0', - - // Shape - 'shadow-none sm:shadow-md', - 'border-0', - - // Color - 'bg-surface-0 dark:bg-surface-700', - - // Position - 'static sm:absolute', - 'z-10', - { - 'sm:left-full top-0': !props.horizontal - } - ] - }), - grid: { - class: 'flex flex-wrap sm:flex-nowrap' - }, - column: { - class: 'w-full sm:w-1/2' - }, - submenu: { - class: ['m-0 list-none', 'py-1 px-2 w-full sm:min-w-[14rem]'] - }, - submenuheader: { - class: [ - 'font-semibold', - - // Spacing - 'py-3 px-5', - 'm-0', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-700' - ] - }, - separator: { - class: 'border-t border-surface-200 dark:border-surface-600 my-1' - }, - menubutton: { - class: [ - // Flexbox - 'flex sm:hidden', - 'items-center justify-center', - - // Size - 'w-8', - 'h-8', - - // Shape - 'rounded-full', - // Color - 'text-surface-500 dark:text-white/80', - - // States - 'hover:text-surface-600 dark:hover:text-white/60', - 'hover:bg-surface-100 dark:hover:bg-surface-600/80', - 'focus:outline-none focus:outline-offset-0', - 'focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transitions - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer', - 'no-underline' - ] - }, - end: { - class: 'ml-auto self-center' - } -}; diff --git a/apps/web/presets/lara/menu/index.js b/apps/web/presets/lara/menu/index.js deleted file mode 100644 index fc971da..0000000 --- a/apps/web/presets/lara/menu/index.js +++ /dev/null @@ -1,96 +0,0 @@ -export default { - root: { - class: [ - // Sizing and Shape - 'min-w-[12rem]', - 'rounded-md', - // Spacing - 'py-2', - // Colors - 'bg-surface-0 dark:bg-surface-700', - 'text-surface-700 dark:text-white/80', - 'border border-surface-200 dark:border-surface-700' - ] - }, - menu: { - class: [ - // Spacings and Shape - 'list-none', - 'm-0', - 'p-0', - 'outline-none' - ] - }, - content: ({ context }) => ({ - class: [ - //Shape - 'rounded-none', - // Colors - 'text-surface-700 dark:text-white/80', - { - 'bg-surface-200 text-surface-700 dark:bg-surface-300/10 dark:text-white': context.focused - }, - // Transitions - 'transition-shadow', - 'duration-200', - // States - 'hover:text-surface-700 dark:hover:text-white/80', - 'hover:bg-surface-100 dark:bg-surface-700 dark:hover:bg-surface-400/10' - ] - }), - action: { - class: [ - 'relative', - // Flexbox - - 'flex', - 'items-center', - - // Spacing - 'py-3', - 'px-5', - - // Color - 'text-surface-700 dark:text-white/80', - - // Misc - 'no-underline', - 'overflow-hidden', - 'cursor-pointer', - 'select-none' - ] - }, - icon: { - class: [ - // Spacing - 'mr-2', - - // Color - 'text-surface-600 dark:text-white/70' - ] - }, - label: { - class: ['leading-none'] - }, - submenuheader: { - class: [ - // Font - 'font-bold', - // Spacing - 'm-0', - 'py-3 px-5', - // Shape - 'rounded-tl-none', - 'rounded-tr-none', - // Colors - 'bg-surface-0 dark:bg-surface-700', - 'text-surface-700 dark:text-white' - ] - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/menubar/index.js b/apps/web/presets/lara/menubar/index.js deleted file mode 100644 index f7cb63a..0000000 --- a/apps/web/presets/lara/menubar/index.js +++ /dev/null @@ -1,175 +0,0 @@ -export default { - root: { - class: [ - 'relative', - - // Flexbox - 'flex', - 'items-center', - - // Spacing - 'p-2', - - // Shape - 'rounded-md', - - // Color - 'bg-surface-50 dark:bg-surface-700', - 'border border-surface-200 dark:border-surface-700' - ] - }, - menu: ({ props }) => ({ - class: [ - // Flexbox - 'sm:flex', - 'items-center', - 'flex-wrap', - 'flex-col sm:flex-row', - { hidden: !props?.mobileActive, flex: props?.mobileActive }, - - // Position - 'absolute sm:relative', - 'top-full left-0', - 'sm:top-auto sm:left-auto', - - // Size - 'w-full sm:w-auto', - - // Spacing - 'm-0', - 'py-1 sm:py-0 sm:p-0', - 'list-none', - - // Shape - 'shadow-md sm:shadow-none', - 'border-0', - - // Color - 'bg-surface-0 dark:bg-surface-700 sm:bg-transparent', - - // Misc - 'outline-none' - ] - }), - menuitem: { - class: 'sm:relative sm:w-auto w-full static' - }, - content: ({ props, context }) => ({ - class: [ - // Shape - { 'rounded-md': props.root }, - - // Colors - { - 'text-surface-500 dark:text-white/70': !context.focused && !context.active, - 'text-surface-500 dark:text-white/70 bg-surface-200 dark:bg-surface-600/90': context.focused && !context.active, - 'text-primary-highlight-inverse bg-primary-highlight': (context.focused && context.active) || context.active || (!context.focused && context.active) - }, - - // Hover States - { - 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.active, - 'hover:bg-primary-highlight-hover text-primary-highlight-inverse': context.active - }, - - // Transitions - 'transition-all', - 'duration-200' - ] - }), - action: ({ context }) => ({ - class: [ - 'relative', - - // Flexbox - 'flex', - 'items-center', - - // Spacing - 'py-3', - 'px-5', - - // Size - { - 'pl-9 sm:pl-5': context.level === 1, - 'pl-14 sm:pl-5': context.level === 2 - }, - 'leading-none', - - // Misc - 'select-none', - 'cursor-pointer', - 'no-underline ', - 'overflow-hidden' - ] - }), - icon: { - class: 'mr-2' - }, - submenuicon: ({ props }) => ({ - class: [ - { - 'ml-auto sm:ml-2': props.root, - 'ml-auto': !props.root - } - ] - }), - submenu: ({ props }) => ({ - class: [ - // Size - 'w-full sm:w-48', - - // Spacing - 'py-1', - 'm-0', - 'list-none', - - // Shape - 'shadow-none sm:shadow-md', - 'border-0', - - // Position - 'static sm:absolute', - 'z-10', - { 'sm:absolute sm:left-full sm:top-0': props.level > 1 }, - - // Color - 'bg-surface-0 dark:bg-surface-700' - ] - }), - separator: { - class: 'border-t border-surface-200 dark:border-surface-600 my-1' - }, - button: { - class: [ - // Flexbox - 'flex sm:hidden', - 'items-center justify-center', - - // Size - 'w-8', - 'h-8', - - // Shape - 'rounded-full', - // Color - 'text-surface-500 dark:text-white/80', - - // States - 'hover:text-surface-600 dark:hover:text-white/60', - 'hover:bg-surface-100 dark:hover:bg-surface-600/80', - 'focus:outline-none focus:outline-offset-0', - 'focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transitions - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer', - 'no-underline' - ] - }, - end: { - class: 'ml-auto self-center' - } -}; diff --git a/apps/web/presets/lara/message/index.js b/apps/web/presets/lara/message/index.js deleted file mode 100644 index 18bef54..0000000 --- a/apps/web/presets/lara/message/index.js +++ /dev/null @@ -1,87 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Spacing and Shape - 'my-4 mx-0', - 'rounded-md', - 'border-solid border-0 border-l-[6px]', - - // Colors - { - 'bg-blue-100/70 dark:bg-blue-500/20': props.severity == 'info', - 'bg-green-100/70 dark:bg-green-500/20': props.severity == 'success', - 'bg-orange-100/70 dark:bg-orange-500/20': props.severity == 'warn', - 'bg-red-100/70 dark:bg-red-500/20': props.severity == 'error' - }, - { - 'border-blue-500 dark:border-blue-400': props.severity == 'info', - 'border-green-500 dark:border-green-400': props.severity == 'success', - 'border-orange-500 dark:border-orange-400': props.severity == 'warn', - 'border-red-500 dark:border-red-400': props.severity == 'error' - }, - { - 'text-blue-700 dark:text-blue-300': props.severity == 'info', - 'text-green-700 dark:text-green-300': props.severity == 'success', - 'text-orange-700 dark:text-orange-300': props.severity == 'warn', - 'text-red-700 dark:text-red-300': props.severity == 'error' - } - ] - }), - wrapper: { - class: [ - // Flexbox - 'flex items-center', - - // Spacing - 'py-5 px-7' - ] - }, - icon: { - class: [ - // Sizing and Spacing - 'w-6 h-6', - 'text-lg leading-none mr-2 shrink-0' - ] - }, - text: { - class: [ - // Font and Text - 'text-base leading-none', - 'font-medium' - ] - }, - button: { - class: [ - // Flexbox - 'flex items-center justify-center', - - // Size - 'w-8 h-8', - - // Spacing and Misc - 'ml-auto relative', - - // Shape - 'rounded-full', - - // Colors - 'bg-transparent', - - // Transitions - 'transition duration-200 ease-in-out', - - // States - 'hover:bg-surface-0/50 dark:hover:bg-surface-0/10', - - // Misc - 'overflow-hidden' - ] - }, - transition: { - enterFromClass: 'opacity-0', - enterActiveClass: 'transition-opacity duration-300', - leaveFromClass: 'max-h-40', - leaveActiveClass: 'overflow-hidden transition-all duration-300 ease-in', - leaveToClass: 'max-h-0 opacity-0 !m-0' - } -}; diff --git a/apps/web/presets/lara/metergroup/index.js b/apps/web/presets/lara/metergroup/index.js deleted file mode 100644 index 2269682..0000000 --- a/apps/web/presets/lara/metergroup/index.js +++ /dev/null @@ -1,97 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Flexbox - 'flex gap-4', - - { 'flex-col': props.orientation == 'horizontal', 'flex-row': props.orientation == 'vertical' } - ] - }), - metercontainer: ({ props }) => ({ - class: [ - // Flexbox - 'flex', - - { 'flex-col': props.orientation === 'vertical' }, - - // Sizing - { 'w-2 h-full': props.orientation === 'vertical' }, - { 'h-2': props.orientation === 'horizontal' }, - - // Colors - 'bg-gray-200 dark:bg-gray-700', - - // Border Radius - 'rounded-lg' - ] - }), - meter: ({ props }) => ({ - class: [ - // Shape - 'border-0', - - // Rounded Corners - Horizontal - { - 'first:rounded-l-lg last:rounded-r-lg': props.orientation === 'horizontal' - }, - - // Rounded Corners - Vertical - { - 'first:rounded-t-lg last:rounded-b-lg': props.orientation === 'vertical' - }, - - // Colors - 'bg-primary' - ] - }), - labellist: ({ props }) => ({ - class: [ - // Display & Flexbox - 'flex flex-wrap', - - { 'gap-4': props.labelOrientation === 'horizontal' }, - - { 'gap-2': props.labelOrientation === 'vertical' }, - - { 'flex-col': props.labelOrientation === 'vertical' }, - - // Conditional Alignment - Horizontal - { - 'align-end': props.labelOrientation === 'horizontal' && props.labelPosition === 'end', - 'align-start': props.labelOrientation === 'horizontal' && props.labelPosition === 'start' - }, - - // Conditional Alignment - Vertical - { - 'justify-end': props.labelOrientation === 'vertical' && props.labelPosition === 'end', - 'justify-start': props.labelOrientation === 'vertical' && props.labelPosition === 'start' - }, - - // List Styling - 'm-0 p-0 list-none' - ] - }), - labellistitem: { - class: [ - // Flexbox - 'inline-flex', - 'items-center', - 'gap-2' - ] - }, - labellisttype: { - class: [ - // Display - 'inline-flex', - - // Background Color - 'bg-primary', - - // Size - 'w-2 h-2', - - // Rounded Shape - 'rounded-full' - ] - } -}; diff --git a/apps/web/presets/lara/multiselect/index.js b/apps/web/presets/lara/multiselect/index.js deleted file mode 100644 index c7061e8..0000000 --- a/apps/web/presets/lara/multiselect/index.js +++ /dev/null @@ -1,544 +0,0 @@ -export default { - root: ({ props, state }) => ({ - class: [ - // Display and Position - 'inline-flex', - 'relative', - - // Shape - 'rounded-md', - - // Color and Background - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // Transitions - 'transition-all', - 'duration-200', - - // States - { 'hover:border-primary': !props.invalid }, - { 'outline-none outline-offset-0 ring ring-primary-400/50 dark:ring-primary-300/50': state.focused }, - - // Misc - 'cursor-pointer', - 'select-none', - { 'opacity-60': props.disabled, 'pointer-events-none': props.disabled, 'cursor-default': props.disabled } - ] - }), - labelContainer: { - class: 'overflow-hidden flex flex-auto cursor-pointer ' - }, - label: ({ props }) => ({ - class: [ - 'leading-[normal]', - 'block ', - - // Spacing - { - 'p-3': props.display !== 'chip', - 'py-3 px-3': props.display === 'chip' && !props?.modelValue?.length, - 'py-[0.375rem] px-3': props.display === 'chip' && props?.modelValue?.length > 0 - }, - - // Color - { 'text-surface-800 dark:text-white/80': props.modelValue?.length, 'text-surface-400 dark:text-surface-500': !props.modelValue?.length }, - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - - // Transitions - 'transition duration-200', - - // Misc - 'overflow-hidden whitespace-nowrap cursor-pointer overflow-ellipsis' - ] - }), - token: { - class: [ - // Flex - 'inline-flex items-center', - - // Spacings - 'py-1.5 px-3 mr-2', - - // Shape - 'rounded-[1.14rem]', - - // Colors - 'bg-surface-200 dark:bg-surface-700', - 'text-surface-700 dark:text-white/70', - - // Misc - 'cursor-default' - ] - }, - removeTokenIcon: { - class: [ - // Shape - 'rounded-md leading-6', - - // Spacing - 'ml-2', - - // Size - 'w-4 h-4', - - // Transition - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer' - ] - }, - trigger: { - class: [ - // Flexbox - 'flex items-center justify-center', - 'shrink-0', - - // Color and Background - 'bg-transparent', - 'text-surface-500', - - // Size - 'w-12', - - // Shape - 'rounded-tr-md', - 'rounded-br-md' - ] - }, - panel: { - class: [ - // Position - 'absolute top-0 left-0', - - // Shape - 'border-0 dark:border', - 'rounded-md', - 'shadow-md', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-800 dark:text-white/80', - 'dark:border-surface-700' - ] - }, - header: { - class: [ - 'flex items-center justify-between', - // Spacing - 'py-3 px-5', - 'm-0', - - //Shape - 'border-b', - 'rounded-tl-md', - 'rounded-tr-md', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-100 dark:bg-surface-800', - 'border-surface-300 dark:border-surface-700' - ] - }, - headerCheckboxContainer: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-6', - 'h-6', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - headerCheckbox: { - root: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-6', - 'h-6', - - // Spacing - 'mr-2', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: ({ props, context }) => ({ - class: [ - // Alignment - 'flex', - 'items-center', - 'justify-center', - - // Size - 'w-6', - 'h-6', - - // Shape - 'rounded-md', - 'border-2', - - // Colors - { - 'border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked, - 'border-primary bg-primary': context.checked - }, - - // States - { - 'peer-hover:border-primary': !props.disabled && !context.checked, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': !props.disabled && context.checked, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'cursor-default opacity-60': props.disabled - }, - - // Transitions - 'transition-colors', - 'duration-200' - ] - }), - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - 'text-white dark:text-surface-900', - - // Transitions - 'transition-all', - 'duration-200' - ] - } - }, - itemCheckbox: { - root: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-6', - 'h-6', - - // Spacing - 'mr-2', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: ({ props, context }) => ({ - class: [ - // Alignment - 'flex', - 'items-center', - 'justify-center', - - // Size - 'w-6', - 'h-6', - - // Shape - 'rounded-md', - 'border-2', - - // Colors - { - 'border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked, - 'border-primary bg-primary': context.checked - }, - - // States - { - 'peer-hover:border-primary': !props.disabled && !context.checked, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': !props.disabled && context.checked, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'cursor-default opacity-60': props.disabled - }, - - // Transitions - 'transition-colors', - 'duration-200' - ] - }), - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - 'text-white dark:text-surface-900', - - // Transitions - 'transition-all', - 'duration-200' - ] - } - }, - closeButton: { - class: [ - 'relative', - - // Flexbox and Alignment - 'flex items-center justify-center', - - // Size and Spacing - 'mr-2', - 'last:mr-0', - 'w-8 h-8', - - // Shape - 'border-0', - 'rounded-full', - - // Colors - 'text-surface-500', - 'bg-transparent', - - // Transitions - 'transition duration-200 ease-in-out', - - // States - 'hover:text-surface-700 dark:hover:text-white/80', - 'hover:bg-surface-100 dark:hover:bg-surface-800/80', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-inset', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Misc - 'overflow-hidden' - ] - }, - closeButtonIcon: { - class: 'w-4 h-4 inline-block' - }, - wrapper: { - class: [ - // Sizing - 'max-h-[200px]', - - // Misc - 'overflow-auto' - ] - }, - list: { - class: 'py-3 list-none m-0' - }, - item: ({ context }) => ({ - class: [ - // Font - 'font-normal', - 'leading-none', - - // Flexbox - 'flex items-center', - - // Position - 'relative', - - // Shape - 'border-0', - 'rounded-none', - - // Spacing - 'm-0', - 'py-3 px-5', - - // Color - { 'text-surface-700 dark:text-white/80': !context.focused && !context.selected }, - { 'bg-surface-200 dark:bg-surface-600/60 text-surface-700 dark:text-white/80': context.focused && !context.selected }, - { 'bg-primary-highlight text-primary-highlight-inverse': context.selected }, - - //States - { 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.focused && !context.selected }, - { 'hover:text-surface-700 hover:bg-surface-100 dark:hover:text-white dark:hover:bg-surface-600/80': context.focused && !context.selected }, - - // Transitions - 'transition-shadow', - 'duration-200', - - // Misc - 'cursor-pointer', - 'overflow-hidden', - 'whitespace-nowrap' - ] - }), - itemgroup: { - class: [ - //Font - 'font-bold', - - // Spacing - 'm-0', - 'p-3 px-5', - - // Color - 'text-surface-800 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-600/80', - - // Misc - 'cursor-auto' - ] - }, - filtercontainer: { - class: 'relative w-full mx-2' - }, - filterinput: { - class: [ - // Font - 'leading-[normal]', - - // Sizing - 'pr-7 py-3 px-3', - '-mr-7', - 'w-full', - - //Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-900', - 'border-surface-200 dark:border-surface-700', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - - // Shape - 'border', - 'rounded-lg', - 'appearance-none', - - // Transitions - 'transition', - 'duration-200', - - // States - 'hover:border-primary', - 'focus:ring focus:outline-none focus:outline-offset-0', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Misc - 'appearance-none' - ] - }, - filtericon: { - class: ['absolute', 'top-1/2 right-3', '-mt-2'] - }, - clearicon: { - class: [ - // Color - 'text-surface-500', - - // Position - 'absolute', - 'top-1/2', - 'right-12', - - // Spacing - '-mt-2' - ] - }, - emptymessage: { - class: [ - // Font - 'leading-none', - - // Spacing - 'py-3 px-5', - - // Color - 'text-surface-800 dark:text-white/80', - 'bg-transparent' - ] - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/orderlist/index.js b/apps/web/presets/lara/orderlist/index.js deleted file mode 100644 index a63d23f..0000000 --- a/apps/web/presets/lara/orderlist/index.js +++ /dev/null @@ -1,258 +0,0 @@ -export default { - root: { - class: [ - // Flexbox - 'flex' - ] - }, - controls: { - class: [ - // Flexbox & Alignment - 'flex flex-col justify-center gap-2', - - // Spacing - 'p-5' - ] - }, - moveupbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - movedownbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - movetopbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - movebottombutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - container: { - class: ['flex-auto'] - }, - header: { - class: [ - 'font-bold', - - // Shape - 'border-b-0 rounded-t-md', - - // Spacing - 'p-5', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-50 dark:bg-surface-800', - 'border border-surface-200 dark:border-surface-700' - ] - }, - list: { - class: [ - // Spacing - 'list-none m-0 p-0', - - // Size - 'min-h-[12rem] max-h-[24rem]', - - // Shape - 'rounded-b-md', - - // Color - 'text-surface-600 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-800', - 'border border-surface-200 dark:border-surface-700', - - // Spacing - 'py-3 px-0', - - // Focus & Outline - 'outline-none', - - // Misc - 'overflow-auto' - ] - }, - item: ({ context }) => ({ - class: [ - // Position - 'relative', - - // Spacing - 'py-3 px-5 m-0', - - // Shape - 'border-none', - - // Transition - 'transition duration-200', - - // Color - { 'text-surface-700 dark:text-white/80 bg-surface-0 dark:bg-surface-900': !context.active }, - { 'text-primary-highlight-inverse bg-primary-highlight': context.active }, - - // State - { - 'hover:bg-surface-100 dark:hover:bg-surface-700': !context.active, - 'hover:bg-primary-highlight-hover': context.active - }, - - // Misc - 'cursor-pointer overflow-hidden' - ] - }) -}; diff --git a/apps/web/presets/lara/organizationchart/index.js b/apps/web/presets/lara/organizationchart/index.js deleted file mode 100644 index 08ce724..0000000 --- a/apps/web/presets/lara/organizationchart/index.js +++ /dev/null @@ -1,138 +0,0 @@ -export default { - table: { - class: [ - // Spacing & Position - 'mx-auto my-0', - - // Table Style - 'border-spacing-0 border-separate' - ] - }, - cell: { - class: [ - // Alignment - 'text-center align-top', - - // Spacing - 'py-0 px-3' - ] - }, - node: ({ props, context }) => ({ - class: [ - 'relative inline-block', - - // Spacing - 'p-5', - - // Shape - 'border', - - // Color - { - 'text-surface-600 dark:text-white/80': !context?.selected, - 'bg-surface-0 dark:bg-surface-800': !context?.selected, - 'border-surface-200 dark:border-surface-700': !context?.selected, - 'text-primary-highlight-inverse': context?.selected, - 'bg-primary-highlight': context?.selected, - 'border-primary-200 dark:border-primary-600': context?.selected - }, - - // States - { - 'hover:bg-surface-100 dark:hover:bg-surface-700': context?.selectable && !context?.selected, - 'hover:bg-primary-highlight-hover': context?.selectable && context?.selected - }, - - { 'cursor-pointer': context?.selectable } - ] - }), - linecell: { - class: [ - // Alignment - 'text-center align-top', - - // Spacing - 'py-0 px-3' - ] - }, - linedown: { - class: [ - // Spacing - 'mx-auto my-0', - - // Size - 'w-px h-[20px]', - - // Color - 'bg-surface-200 dark:bg-surface-700' - ] - }, - lineleft: ({ context }) => ({ - class: [ - // Alignment - 'text-center align-top', - - // Spacing - 'py-0 px-3', - - // Shape - 'rounded-none border-r', - { 'border-t': context.lineTop }, - - // Color - 'border-surface-200 dark:border-surface-700' - ] - }), - lineright: ({ context }) => ({ - class: [ - // Alignment - 'text-center align-top', - - // Spacing - 'py-0 px-3', - - // Shape - 'rounded-none', - - // Color - { 'border-t border-surface-200 dark:border-surface-700': context.lineTop } - ] - }), - nodecell: { - class: 'text-center align-top py-0 px-3' - }, - nodetoggler: { - class: [ - // Position - 'absolute bottom-[-0.75rem] left-2/4 -ml-3', - 'z-20', - - // Flexbox - 'flex items-center justify-center', - - // Size - 'w-6 h-6', - - // Shape - 'rounded-full', - - // Color - 'bg-inherit text-inherit', - - // Focus - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Misc - 'cursor-pointer no-underline select-none' - ] - }, - nodetogglericon: { - class: [ - // Position - 'relative inline-block', - - // Size - 'w-4 h-4' - ] - } -}; diff --git a/apps/web/presets/lara/overlaypanel/index.js b/apps/web/presets/lara/overlaypanel/index.js deleted file mode 100644 index f67d2ff..0000000 --- a/apps/web/presets/lara/overlaypanel/index.js +++ /dev/null @@ -1,40 +0,0 @@ -export default { - root: { - class: [ - // Shape - 'rounded-md shadow-lg', - 'border-0 dark:border', - - // Position - 'absolute left-0 top-0 mt-2', - 'z-40 transform origin-center', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-surface-0/80', - 'dark:border-surface-700', - - // Before: Triangle - 'before:absolute before:-top-[9px] before:-ml-[9px] before:left-[calc(var(--overlayArrowLeft,0)+1.25rem)] z-0', - 'before:w-0 before:h-0', - 'before:border-transparent before:border-solid', - 'before:border-x-[8px] before:border-[8px]', - 'before:border-t-0 before:border-b-surface-300/10 dark:before:border-b-surface-700', - - 'after:absolute after:-top-2 after:-ml-[8px] after:left-[calc(var(--overlayArrowLeft,0)+1.25rem)]', - 'after:w-0 after:h-0', - 'after:border-transparent after:border-solid', - 'after:border-x-[0.5rem] after:border-[0.5rem]', - 'after:border-t-0 after:border-b-surface-0 dark:after:border-b-surface-800' - ] - }, - content: { - class: 'p-5 items-center flex' - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/paginator/index.js b/apps/web/presets/lara/paginator/index.js deleted file mode 100644 index 46bf702..0000000 --- a/apps/web/presets/lara/paginator/index.js +++ /dev/null @@ -1,528 +0,0 @@ -export default { - root: { - class: [ - // Flex & Alignment - 'flex items-center justify-center flex-wrap', - - // Spacing - 'px-4 py-2', - - // Shape - 'border-0', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-500 dark:text-white/60' - ] - }, - firstpagebutton: ({ context }) => ({ - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - - // Shape - 'border-0 rounded-full dark:rounded-md', - - // Size - 'min-w-[3rem] h-12 m-[0.143rem]', - 'leading-none', - - // Color - 'text-surface-500 dark:text-white/60', - - // State - { - 'hover:bg-surface-50 dark:hover:bg-surface-700/70': !context.disabled, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50': !context.disabled - }, - - // Transition - 'transition duration-200', - - // Misc - 'user-none overflow-hidden', - { 'cursor-default pointer-events-none opacity-60': context.disabled } - ] - }), - previouspagebutton: ({ context }) => ({ - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - - // Shape - 'border-0 rounded-full dark:rounded-md', - - // Size - 'min-w-[3rem] h-12 m-[0.143rem]', - 'leading-none', - - // Color - 'text-surface-500 dark:text-white/60', - - // State - { - 'hover:bg-surface-50 dark:hover:bg-surface-700/70': !context.disabled, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50': !context.disabled - }, - - // Transition - 'transition duration-200', - - // Misc - 'user-none overflow-hidden', - { 'cursor-default pointer-events-none opacity-60': context.disabled } - ] - }), - nextpagebutton: ({ context }) => ({ - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - - // Shape - 'border-0 rounded-full dark:rounded-md', - - // Size - 'min-w-[3rem] h-12 m-[0.143rem]', - 'leading-none', - - // Color - 'text-surface-500 dark:text-white/60', - - // State - { - 'hover:bg-surface-50 dark:hover:bg-surface-700/70': !context.disabled, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50': !context.disabled - }, - - // Transition - 'transition duration-200', - - // Misc - 'user-none overflow-hidden', - { 'cursor-default pointer-events-none opacity-60': context.disabled } - ] - }), - lastpagebutton: ({ context }) => ({ - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - - // Shape - 'border-0 rounded-full dark:rounded-md', - - // Size - 'min-w-[3rem] h-12 m-[0.143rem]', - 'leading-none', - - // Color - 'text-surface-500 dark:text-white/60', - - // State - { - 'hover:bg-surface-50 dark:hover:bg-surface-700/70': !context.disabled, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50': !context.disabled - }, - - // Transition - 'transition duration-200', - - // Misc - 'user-none overflow-hidden', - { 'cursor-default pointer-events-none opacity-60': context.disabled } - ] - }), - pagebutton: ({ context }) => ({ - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - - // Shape - 'border-0 rounded-full dark:rounded-md', - - // Size - 'min-w-[3rem] h-12 m-[0.143rem]', - 'leading-none', - - // Color - 'text-surface-500 dark:text-white/80', - { - 'bg-primary-highlight border-primary-highlight text-primary-highlight-inverse': context.active - }, - - // State - { - 'hover:bg-surface-50 dark:hover:bg-surface-700/70': !context.disabled && !context.active, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50': !context.disabled - }, - - // Transition - 'transition duration-200', - - // Misc - 'user-none overflow-hidden', - { 'cursor-default pointer-events-none opacity-60': context.disabled } - ] - }), - rowperpagedropdown: { - root: ({ props, state }) => ({ - class: [ - // Display and Position - 'inline-flex', - 'relative', - - // Shape - 'h-12', - 'rounded-md', - - // Spacing - 'mx-2', - - // Color and Background - 'bg-surface-0 dark:bg-surface-900', - 'border border-surface-300 dark:border-surface-700', - - // Transitions - 'transition-all', - 'duration-200', - - // States - 'hover:border-primary', - { 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50': !state.focused }, - - // Misc - 'cursor-pointer', - 'select-none', - { 'opacity-60': props.disabled, 'pointer-events-none': props.disabled, 'cursor-default': props.disabled } - ] - }), - input: { - class: [ - //Font - 'leading-[normal]', - - // Display - 'block', - 'flex-auto', - - // Color and Background - 'bg-transparent', - 'border-0', - 'text-surface-800 dark:text-white/80', - - // Sizing and Spacing - 'w-[1%]', - 'p-3 pr-0', - - //Shape - 'rounded-none', - - // Transitions - 'transition', - 'duration-200', - - // States - 'focus:outline-none focus:shadow-none', - - // Misc - 'relative', - 'cursor-pointer', - 'overflow-hidden overflow-ellipsis', - 'whitespace-nowrap', - 'appearance-none' - ] - }, - trigger: { - class: [ - // Flexbox - 'flex items-center justify-center', - 'shrink-0', - - // Color and Background - 'bg-transparent', - 'text-surface-500', - - // Size - 'w-12', - - // Shape - 'rounded-tr-md', - 'rounded-br-md' - ] - }, - panel: { - class: [ - // Position - 'absolute top-0 left-0', - - // Shape - 'border-0 dark:border', - 'rounded-md', - 'shadow-md', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-800 dark:text-white/80', - 'dark:border-surface-700' - ] - }, - wrapper: { - class: [ - // Sizing - 'max-h-[200px]', - - // Misc - 'overflow-auto' - ] - }, - list: { - class: 'py-3 list-none m-0' - }, - item: ({ context }) => ({ - class: [ - // Font - 'font-normal', - 'leading-none', - - // Position - 'relative', - - // Shape - 'border-0', - 'rounded-none', - - // Spacing - 'm-0', - 'py-3 px-5', - - // Color - { 'text-surface-700 dark:text-white/80': !context.focused && !context.selected }, - { 'bg-surface-50 dark:bg-surface-600/60 text-surface-700 dark:text-white/80': context.focused && !context.selected }, - { 'bg-primary-highlight text-primary-highlight-inverse': context.selected }, - - //States - { 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.focused && !context.selected }, - { 'hover:text-surface-700 hover:bg-surface-100 dark:hover:text-white dark:hover:bg-surface-600/80': context.focused && !context.selected }, - - // Transitions - 'transition-shadow', - 'duration-200', - - // Misc - 'cursor-pointer', - 'overflow-hidden', - 'whitespace-nowrap' - ] - }) - }, - jumptopageinput: { - root: { - class: 'inline-flex mx-2' - }, - input: { - root: { - class: [ - 'relative', - - //Font - 'leading-none', - - // Display - 'block', - 'flex-auto', - - // Colors - 'text-surface-600 dark:text-surface-200', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border border-surface-300 dark:border-surface-600', - - // Sizing and Spacing - 'w-[1%] max-w-[3rem]', - 'p-3 m-0', - - //Shape - 'rounded-md', - - // Transitions - 'transition', - 'duration-200', - - // States - 'hover:border-primary', - 'focus:outline-none focus:shadow-none', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50', - - // Misc - 'cursor-pointer', - 'overflow-hidden overflow-ellipsis', - 'whitespace-nowrap', - 'appearance-none' - ] - } - } - }, - jumptopagedropdown: { - root: ({ props, state }) => ({ - class: [ - // Display and Position - 'inline-flex', - 'relative', - - // Shape - 'h-12', - 'rounded-md', - - // Color and Background - 'bg-surface-0 dark:bg-surface-900', - 'border border-surface-300 dark:border-surface-700', - - // Transitions - 'transition-all', - 'duration-200', - - // States - 'hover:border-primary', - { 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50': !state.focused }, - - // Misc - 'cursor-pointer', - 'select-none', - { 'opacity-60': props.disabled, 'pointer-events-none': props.disabled, 'cursor-default': props.disabled } - ] - }), - input: { - class: [ - //Font - 'leading-none', - - // Display - 'block', - 'flex-auto', - - // Color and Background - 'bg-transparent', - 'border-0', - 'text-surface-800 dark:text-white/80', - - // Sizing and Spacing - 'w-[1%]', - 'p-3', - - //Shape - 'rounded-none', - - // Transitions - 'transition', - 'duration-200', - - // States - 'focus:outline-none focus:shadow-none', - - // Misc - 'relative', - 'cursor-pointer', - 'overflow-hidden overflow-ellipsis', - 'whitespace-nowrap', - 'appearance-none' - ] - }, - trigger: { - class: [ - // Flexbox - 'flex items-center justify-center', - 'shrink-0', - - // Color and Background - 'bg-transparent', - 'text-surface-500', - - // Size - 'w-12', - - // Shape - 'rounded-tr-md', - 'rounded-br-md' - ] - }, - panel: { - class: [ - // Position - 'absolute top-0 left-0', - - // Shape - 'border-0 dark:border', - 'rounded-md', - 'shadow-md', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-800 dark:text-white/80', - 'dark:border-surface-700' - ] - }, - wrapper: { - class: [ - // Sizing - 'max-h-[200px]', - - // Misc - 'overflow-auto' - ] - }, - list: { - class: 'py-3 list-none m-0' - }, - item: ({ context }) => ({ - class: [ - // Font - 'font-normal', - 'leading-none', - - // Position - 'relative', - - // Shape - 'border-0', - 'rounded-none', - - // Spacing - 'm-0', - 'py-3 px-5', - - // Color - { 'text-surface-700 dark:text-white/80': !context.focused && !context.selected }, - { 'bg-surface-50 dark:bg-surface-600/60 text-surface-700 dark:text-white/80': context.focused && !context.selected }, - { 'bg-primary-highlight text-primary-highlight-inverse': context.selected }, - - //States - { 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.focused && !context.selected }, - { 'hover:text-surface-700 hover:bg-surface-100 dark:hover:text-white dark:hover:bg-surface-600/80': context.focused && !context.selected }, - - // Transitions - 'transition-shadow', - 'duration-200', - - // Misc - 'cursor-pointer', - 'overflow-hidden', - 'whitespace-nowrap' - ] - }) - }, - start: { - class: 'mr-auto' - }, - end: { - class: 'ml-auto' - } -}; diff --git a/apps/web/presets/lara/panel/index.js b/apps/web/presets/lara/panel/index.js deleted file mode 100644 index d42820b..0000000 --- a/apps/web/presets/lara/panel/index.js +++ /dev/null @@ -1,91 +0,0 @@ -export default { - header: ({ props }) => ({ - class: [ - // Flex - 'flex items-center justify-between', - - // Colors - 'text-surface-700 dark:text-surface-0/80', - 'bg-surface-50 dark:bg-surface-900', - 'border border-surface-200 dark:border-surface-700', - - //Shape - 'rounded-tl-lg rounded-tr-lg', - - // Conditional Spacing - { 'p-5': !props.toggleable, 'py-3 px-5': props.toggleable } - ] - }), - title: { - class: 'leading-none font-bold' - }, - toggler: { - class: [ - // Alignments - 'inline-flex items-center justify-center', - 'relative', - - // Sized - 'w-8 h-8', - 'm-0 p-0', - - //Shape - 'border-0 rounded-full', - - //Color - 'bg-transparent', - 'text-surface-600 dark:text-surface-0/80', - - // States - 'hover:text-surface-800 dark:hover:text-surface-0/80', - 'hover:bg-surface-100 dark:hover:bg-surface-800/80', - 'focus:outline-none focus:outline-offset-0 focus-visible:ring focus-visible:ring-primary-400/50 focus-visible:ring-inset dark:focus-visible:ring-primary-300/50', - - // Transitions - 'transition-all duration-200 ease-in-out', - - // Misc - 'overflow-hidden no-underline', - 'cursor-pointer' - ] - }, - togglerIcon: { - class: 'inline-block' - }, - content: { - class: [ - // Spacing - 'p-5', - - // Shape - 'border border-t-0 last:rounded-br-lg last:rounded-bl-lg', - - //Color - 'border-surface-200 dark:border-surface-700', - 'bg-surface-0 dark:bg-surface-900', - 'text-surface-700 dark:text-surface-0/80' - ] - }, - footer: { - class: [ - // Spacing - 'py-3 p-5', - - // Shape - 'border border-t-0 rounded-br-lg rounded-bl-lg', - - //Color - 'border-surface-200 dark:border-surface-700', - 'bg-surface-0 dark:bg-surface-900', - 'text-surface-700 dark:text-surface-0/80' - ] - }, - transition: { - enterFromClass: 'max-h-0', - enterActiveClass: 'overflow-hidden transition-[max-height] duration-1000 ease-[cubic-bezier(0.42,0,0.58,1)]', - enterToClass: 'max-h-[1000px]', - leaveFromClass: 'max-h-[1000px]', - leaveActiveClass: 'overflow-hidden transition-[max-height] duration-[450ms] ease-[cubic-bezier(0,1,0,1)]', - leaveToClass: 'max-h-0' - } -}; diff --git a/apps/web/presets/lara/panelmenu/index.js b/apps/web/presets/lara/panelmenu/index.js deleted file mode 100644 index e6072e8..0000000 --- a/apps/web/presets/lara/panelmenu/index.js +++ /dev/null @@ -1,127 +0,0 @@ -export default { - panel: { - class: 'mb-1' - }, - header: { - class: ['rounded-md', 'outline-none', 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50'] - }, - headercontent: ({ context, instance }) => ({ - class: [ - // Shape - 'rounded-t-md', - { 'rounded-br-md rounded-bl-md': !context.active || instance.activeItem?.items === undefined, 'rounded-br-0 rounded-bl-0': context.active && instance.activeItem?.items !== undefined }, - - // Color - 'border border-surface-200 dark:border-surface-700', - 'bg-surface-50 dark:bg-surface-800', - 'text-surface-600 dark:text-surface-0/80', - { 'text-surface-900': context.active }, - - // States - 'hover:bg-surface-100 dark:hover:bg-surface-700/80', - 'hover:text-surface-900', - - // Transition - 'transition duration-200 ease-in-out', - 'transition-shadow duration-200' - ] - }), - headeraction: { - class: [ - 'relative', - - // Font - 'font-bold', - 'leading-none', - - // Flex & Alignments - 'flex items-center', - - // Spacing - 'p-5', - - // Misc - 'select-none cursor-pointer no-underline' - ] - }, - headerlabel: { - class: 'leading-none' - }, - headerIcon: { - class: 'mr-2' - }, - submenuicon: { - class: 'mr-2' - }, - menucontent: { - class: [ - // Spacing - 'py-2', - - // Shape - 'border border-t-0', - 'rounded-t-none rounded-br-md rounded-bl-md', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700' - ] - }, - menu: { - class: ['outline-none', 'm-0 p-0 list-none'] - }, - content: { - class: [ - // Shape - 'border-none rounded-none', - - // Color - 'text-surface-700 dark:text-white/80', - - // Transition - 'transition-shadow duration-200' - ] - }, - action: ({ context }) => ({ - class: [ - 'relative', - - // Font - 'leading-none', - - // Flex & Alignments - 'flex items-center', - - // Spacing - 'py-3 px-5', - - // Color - 'text-surface-700 dark:text-white/80', - - // States - 'hover:bg-surface-100 dark:hover:bg-surface-700/80 hover:text-surface-700 dark:hover:text-white/80', - { - 'bg-surface-200 text-surface-700 dark:text-white/80 dark:bg-surface-600/90': context.focused - }, - - // Misc - 'cursor-pointer no-underline', - 'select-none overflow-hidden' - ] - }), - icon: { - class: 'mr-2' - }, - submenu: { - class: 'p-0 pl-4 m-0 list-none' - }, - transition: { - enterFromClass: 'max-h-0', - enterActiveClass: 'overflow-hidden transition-[max-height] duration-1000 ease-[cubic-bezier(0.42,0,0.58,1)]', - enterToClass: 'max-h-[1000px]', - leaveFromClass: 'max-h-[1000px]', - leaveActiveClass: 'overflow-hidden transition-[max-height] duration-[450ms] ease-[cubic-bezier(0,1,0,1)]', - leaveToClass: 'max-h-0' - } -}; diff --git a/apps/web/presets/lara/password/index.js b/apps/web/presets/lara/password/index.js deleted file mode 100644 index d3988b2..0000000 --- a/apps/web/presets/lara/password/index.js +++ /dev/null @@ -1,121 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'inline-flex relative', - { - 'opacity-60 select-none pointer-events-none cursor-default': props.disabled - }, - { '[&>input]:pr-10': props.toggleMask } - ] - }), - panel: { - class: [ - // Spacing - 'p-5', - - // Shape - 'border-0 dark:border', - 'shadow-md rounded-md', - - // Colors - 'bg-surface-0 dark:bg-surface-900', - 'text-surface-700 dark:text-white/80', - 'dark:border-surface-700' - ] - }, - meter: { - class: [ - // Position and Overflow - 'overflow-hidden', - 'relative', - - // Shape and Size - 'border-0', - 'h-3', - - // Spacing - 'mb-2', - - // Colors - 'bg-surface-100 dark:bg-surface-700' - ] - }, - meterlabel: ({ instance }) => ({ - class: [ - // Size - 'h-full', - - // Colors - { - 'bg-red-500 dark:bg-red-400/50': instance?.meter?.strength == 'weak', - 'bg-orange-500 dark:bg-orange-400/50': instance?.meter?.strength == 'medium', - 'bg-green-500 dark:bg-green-400/50': instance?.meter?.strength == 'strong' - }, - - // Transitions - 'transition-all duration-1000 ease-in-out' - ] - }), - showicon: { - class: ['absolute top-1/2 right-3 -mt-2 z-10', 'text-surface-600 dark:text-white/70'] - }, - hideicon: { - class: ['absolute top-1/2 right-3 -mt-2 z-10', 'text-surface-600 dark:text-white/70'] - }, - input: { - root: ({ props, context, parent }) => ({ - class: [ - // Font - 'leading-[normal]', - - // Flex - { 'flex-1 w-[1%]': parent.instance.$name == 'InputGroup' }, - - // Spacing - 'm-0', - { - 'px-4 py-4': props.size == 'large', - 'px-2 py-2': props.size == 'small', - 'p-3': props.size == null - }, - 'w-full', - - // Shape - { 'rounded-md': parent.instance.$name !== 'InputGroup' }, - { 'first:rounded-l-md rounded-none last:rounded-r-md': parent.instance.$name == 'InputGroup' }, - { 'border-0 border-y border-l last:border-r': parent.instance.$name == 'InputGroup' }, - { 'first:ml-0 -ml-px': parent.instance.$name == 'InputGroup' && !props.showButtons }, - - // Colors - 'text-surface-600 dark:text-surface-200', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !parent.props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': parent.props.invalid }, - - // States - { - 'hover:border-primary': !context.disabled && !parent.props.invalid, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50 focus:z-10': !context.disabled, - 'opacity-60 select-none pointer-events-none cursor-default': context.disabled - }, - - // Filled State *for FloatLabel - { filled: parent.instance?.$parentInstance?.$name == 'FloatLabel' && parent.props.modelValue !== null && parent.props.modelValue?.length !== 0 }, - - // Misc - 'appearance-none', - 'transition-colors duration-200' - ] - }) - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/picklist/index.js b/apps/web/presets/lara/picklist/index.js deleted file mode 100644 index b04df40..0000000 --- a/apps/web/presets/lara/picklist/index.js +++ /dev/null @@ -1,651 +0,0 @@ -export default { - root: { - class: [ - // Flexbox - 'flex lg:flex-row flex-col' - ] - }, - sourcecontrols: { - class: [ - // Flexbox & Alignment - 'flex lg:flex-col justify-center gap-2', - - // Spacing - 'p-5' - ] - }, - sourcemoveupbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - sourcemovetopbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - sourcemovedownbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - sourcemovebottombutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - sourcewrapper: { - class: 'grow shrink basis-2/4' - }, - sourceheader: { - class: [ - 'font-bold', - - // Shape - 'border-b-0 rounded-t-md', - - // Spacing - 'p-5', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-50 dark:bg-surface-800', - 'border border-surface-200 dark:border-surface-700' - ] - }, - sourcelist: { - class: [ - // Spacing - 'list-none m-0 p-0', - - // Size - 'min-h-[12rem] max-h-[24rem]', - - // Shape - 'rounded-b-md', - - // Color - 'text-surface-600 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-800', - 'border border-surface-200 dark:border-surface-700', - - // Spacing - 'py-3 px-0', - - // Focus & Outline - 'outline-none', - - // Misc - 'overflow-auto' - ] - }, - item: ({ context }) => ({ - class: [ - // Position - 'relative', - - // Spacing - 'py-3 px-5 m-0', - - // Shape - 'border-none', - - // Transition - 'transition duration-200', - - // Color - { 'text-surface-700 dark:text-white/80 bg-surface-0 dark:bg-surface-900': !context.active }, - { 'text-primary-highlight-inverse bg-primary-highlight': context.active }, - - // State - { - 'hover:bg-surface-100 dark:hover:bg-surface-700': !context.active, - 'hover:bg-primary-highlight-hover': context.active - }, - - // Misc - 'cursor-pointer overflow-hidden' - ] - }), - buttons: { - class: 'flex lg:flex-col justify-center gap-2 p-5' - }, - movetotargetbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - movealltotargetbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - movetosourcebutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - movealltosourcebutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - targetcontrols: { - class: 'flex lg:flex-col justify-center gap-2 p-5' - }, - targetmoveupbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - targetmovetopbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - targetmovedownbutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - targetmovebottombutton: { - root: ({ context }) => ({ - class: [ - // Flexbox & Alignment - 'relative inline-flex items-center justify-center', - - // Shape - 'rounded-md', - - // Color - 'text-primary-inverse', - 'bg-primary', - 'border border-primary', - - // Spacing & Size - 'w-12', - 'm-0', - 'px-0 py-3', - - // Transitions - 'transition duration-200 ease-in-out', - - // State - 'hover:bg-primary-hover hover:border-primary-hover', - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary/50', - { 'cursor-default pointer-events-none opacity-60': context.disabled }, - - // Interactivity - 'cursor-pointer user-select-none' - ] - }), - label: { - class: [ - // Flexbox - 'flex-initial', - - // Size - 'w-0' - ] - } - }, - targetwrapper: { - class: 'grow shrink basis-2/4' - }, - targetheader: { - class: [ - 'font-bold', - - // Shape - 'border-b-0 rounded-t-md', - - // Spacing - 'p-5', - - // Color - 'text-surface-700 dark:text-white/80', - 'bg-surface-50 dark:bg-surface-800', - 'border border-surface-200 dark:border-surface-700' - ] - }, - targetlist: { - class: [ - // Spacing - 'list-none m-0 p-0', - - // Size - 'min-h-[12rem] max-h-[24rem]', - - // Shape - 'rounded-b-md', - - // Color - 'text-surface-600 dark:text-white/80', - 'bg-surface-0 dark:bg-surface-800', - 'border border-surface-200 dark:border-surface-700', - - // Spacing - 'py-3 px-0', - - // Focus & Outline - 'outline-none', - - // Misc - 'overflow-auto' - ] - }, - transition: { - enterFromClass: '!transition-none', - enterActiveClass: '!transition-none', - leaveActiveClass: '!transition-none', - leaveToClass: '!transition-none' - } -}; diff --git a/apps/web/presets/lara/progressbar/index.js b/apps/web/presets/lara/progressbar/index.js deleted file mode 100644 index bd0f701..0000000 --- a/apps/web/presets/lara/progressbar/index.js +++ /dev/null @@ -1,55 +0,0 @@ -export default { - root: { - class: [ - // Position and Overflow - 'overflow-hidden', - 'relative', - - // Shape and Size - 'border-0', - 'h-6', - 'rounded-md', - - // Colors - 'bg-surface-100 dark:bg-surface-700' - ] - }, - value: ({ props }) => ({ - class: [ - // Flexbox & Overflow & Position - { 'absolute flex items-center justify-center overflow-hidden': props.mode !== 'indeterminate' }, - - // Colors - 'bg-primary', - - // Spacing & Sizing - 'm-0', - { 'h-full w-0': props.mode !== 'indeterminate' }, - - // Shape - 'border-0', - - // Transitions - { - 'transition-width duration-1000 ease-in-out': props.mode !== 'indeterminate', - 'progressbar-value-animate': props.mode == 'indeterminate' - }, - - // Before & After (indeterminate) - { - 'before:absolute before:top-0 before:left-0 before:bottom-0 before:bg-inherit ': props.mode == 'indeterminate', - 'after:absolute after:top-0 after:left-0 after:bottom-0 after:bg-inherit after:delay-1000': props.mode == 'indeterminate' - } - ] - }), - label: { - class: [ - // Flexbox - 'inline-flex', - - // Font and Text - 'text-white dark:text-surface-900', - 'leading-6' - ] - } -}; diff --git a/apps/web/presets/lara/progressspinner/index.js b/apps/web/presets/lara/progressspinner/index.js deleted file mode 100644 index 4e1faec..0000000 --- a/apps/web/presets/lara/progressspinner/index.js +++ /dev/null @@ -1,51 +0,0 @@ -export default { - root: { - class: [ - // Position - 'relative', - 'mx-auto', - - // Sizing - 'w-28', - 'h-28', - - // Flexbox - 'inline-block', - - // Pseudo-Elements - 'before:block', - 'before:pt-full' - ] - }, - spinner: { - class: [ - // Position - 'absolute', - 'top-0', - 'bottom-0', - 'left-0', - 'right-0', - 'm-auto', - - // Sizing - 'w-full', - 'h-full', - - // Transformations - 'transform', - 'origin-center', - - // Animations - 'animate-spin' - ] - }, - circle: { - class: [ - // Colors - 'text-red-500', - - // Misc - 'progress-spinner-circle' - ] - } -}; diff --git a/apps/web/presets/lara/radiobutton/index.js b/apps/web/presets/lara/radiobutton/index.js deleted file mode 100644 index 3d5f126..0000000 --- a/apps/web/presets/lara/radiobutton/index.js +++ /dev/null @@ -1,104 +0,0 @@ -export default { - root: { - class: [ - 'relative', - - // Flexbox & Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-[1.571rem] h-[1.571rem]', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: ({ props }) => ({ - class: [ - // Flexbox - 'flex justify-center items-center', - - // Size - 'w-[1.571rem] h-[1.571rem]', - - // Shape - 'border-2', - 'rounded-full', - - // Transition - 'transition duration-200 ease-in-out', - - // Colors - { - 'text-surface-700 dark:text-white/80': props.value !== props.modelValue && props.value !== undefined, - 'bg-surface-0 dark:bg-surface-900': props.value !== props.modelValue && props.value !== undefined, - 'border-surface-300 dark:border-surface-700': props.value !== props.modelValue && props.value !== undefined && !props.invalid, - 'border-primary': props.value == props.modelValue && props.value !== undefined, - 'bg-primary': props.value == props.modelValue && props.value !== undefined - }, - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { - 'peer-hover:border-primary dark:peer-hover:border-primary': !props.disabled && !props.invalid, - 'peer-hover:border-primary-hover peer-hover:bg-primary-hover': !props.disabled && props.value == props.modelValue && props.value !== undefined, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'opacity-60 cursor-default': props.disabled - } - ] - }), - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: ({ props }) => ({ - class: [ - 'block', - - // Shape - 'rounded-full', - - // Size - 'w-[0.857rem] h-[0.857rem]', - - // Colors - 'bg-surface-0 dark:bg-surface-900', - - // Conditions - { - 'backface-hidden scale-10 invisible': props.value !== props.modelValue, - 'transform visible scale-[1.1]': props.value == props.modelValue - }, - - // Transition - 'transition duration-200' - ] - }) -}; diff --git a/apps/web/presets/lara/rating/index.js b/apps/web/presets/lara/rating/index.js deleted file mode 100644 index 7ad0350..0000000 --- a/apps/web/presets/lara/rating/index.js +++ /dev/null @@ -1,92 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'relative', - - // Flex & Alignment - 'flex items-center', - 'gap-2', - - // Misc - { - 'opacity-60 select-none pointer-events-none cursor-default': props.disabled - } - ] - }), - cancelitem: ({ context }) => ({ - class: [ - // Flex & Alignment - 'inline-flex items-center', - - //State - { - 'outline-none ring ring-primary-500/50 dark:ring-primary-400/50': context.focused - }, - - // Misc - 'cursor-pointer' - ] - }), - cancelicon: { - class: [ - // Size - 'w-5 h-5', - - // Color - 'text-red-500 dark:text-red-400', - - // State - 'hover:text-red-600 dark:hover:text-red-300', - - // Transition - 'transition duration-200 ease-in' - ] - }, - item: ({ props, context }) => ({ - class: [ - // Flex & Alignment - 'inline-flex items-center', - - // State - { - 'outline-none ring ring-primary-500/50 dark:ring-primary-400/50': context.focused - }, - - // Misc - { - 'cursor-pointer': !props.readonly, - 'cursor-default': props.readonly - } - ] - }), - officon: ({ props }) => ({ - class: [ - // Size - 'w-5 h-5', - - // Color - 'text-surface-700 dark:text-surface-0/80', - - // State - { 'hover:text-primary-500 dark:hover:text-primary-400': !props.readonly }, - - // Transition - 'transition duration-200 ease-in' - ] - }), - onicon: ({ props }) => ({ - class: [ - // Size - 'w-5 h-5', - - // Color - 'text-primary', - - // State - { 'hover:text-primary-600 dark:hover:text-primary-300': !props.readonly }, - - // Transition - 'transition duration-200 ease-in' - ] - }) -}; diff --git a/apps/web/presets/lara/ripple/index.js b/apps/web/presets/lara/ripple/index.js deleted file mode 100644 index 429c249..0000000 --- a/apps/web/presets/lara/ripple/index.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - root: { - class: ['block absolute bg-surface-0/50 rounded-full pointer-events-none'], - style: 'transform: scale(0)' - } -}; diff --git a/apps/web/presets/lara/scrollpanel/index.js b/apps/web/presets/lara/scrollpanel/index.js deleted file mode 100644 index d41e690..0000000 --- a/apps/web/presets/lara/scrollpanel/index.js +++ /dev/null @@ -1,77 +0,0 @@ -export default { - wrapper: { - class: [ - // Size & Position - 'h-full w-full', - - // Layering - 'z-[1]', - - // Spacing - 'overflow-hidden', - - // Misc - 'relative float-left' - ] - }, - content: { - class: [ - // Size & Spacing - 'h-[calc(100%+18px)] w-[calc(100%+18px)] pr-[18px] pb-[18px] pl-0 pt-0', - - // Overflow & Scrollbar - 'overflow-scroll scrollbar-none', - - // Box Model - 'box-border', - - // Position - 'relative', - - // Webkit Specific - '[&::-webkit-scrollbar]:hidden' - ] - }, - barX: { - class: [ - // Size & Position - 'h-[9px] bottom-0', - - // Appearance - 'bg-surface-50 dark:bg-surface-700 rounded', - - // Interactivity - 'cursor-pointer', - - // Visibility & Layering - 'invisible z-20', - - // Transition - 'transition duration-[250ms] ease-linear', - - // Misc - 'relative' - ] - }, - barY: { - class: [ - // Size & Position - 'w-[9px] top-0', - - // Appearance - 'bg-surface-50 dark:bg-surface-700 rounded', - - // Interactivity - 'cursor-pointer', - - // Visibility & Layering - 'z-20', - - // Transition - 'transition duration-[250ms] ease-linear', - - // Misc - 'relative' - ] - } -}; diff --git a/apps/web/presets/lara/scrolltop/index.js b/apps/web/presets/lara/scrolltop/index.js deleted file mode 100644 index 3273286..0000000 --- a/apps/web/presets/lara/scrolltop/index.js +++ /dev/null @@ -1,40 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Flex & Alignment - 'flex items-center justify-center', - - // Positioning - { - sticky: props.target === 'parent', - fixed: props.target === 'window' - }, - 'bottom-[20px] right-[20px]', - 'ml-auto', - - // Shape & Size - { - 'rounded-md h-8 w-8': props.target === 'parent', - 'h-12 w-12 rounded-full shadow-md': props.target === 'window' - }, - - // Color - { - 'text-primary-inverse bg-primary': props.target === 'parent', - 'text-white dark:text-surface-900 bg-surface-500 dark:bg-surface-400': props.target === 'window' - }, - - // States - { - 'hover:bg-primary-hover': props.target === 'parent', - 'hover:bg-surface-600 dark:hover:bg-surface-300': props.target === 'window' - } - ] - }), - transition: { - enterFromClass: 'opacity-0', - enterActiveClass: 'transition-opacity duration-150', - leaveActiveClass: 'transition-opacity duration-150', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/selectbutton/index.js b/apps/web/presets/lara/selectbutton/index.js deleted file mode 100644 index 436628a..0000000 --- a/apps/web/presets/lara/selectbutton/index.js +++ /dev/null @@ -1,49 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [{ 'opacity-60 select-none pointer-events-none cursor-default': props.disabled }] - }), - button: ({ context, props }) => ({ - class: [ - 'relative', - // Font - 'leading-none', - - // Flex Alignment - 'inline-flex items-center align-bottom text-center', - - // Spacing - 'px-4 py-3', - - // Shape - 'border border-r-0', - 'first:rounded-l-md first:rounded-tr-none first:rounded-br-none', - 'last:border-r last:rounded-tl-none last:rounded-bl-none last:rounded-r-md', - - // Color - { - 'bg-surface-0 dark:bg-surface-900': !context.active, - 'text-surface-700 dark:text-white/80': !context.active, - 'border-surface-200 dark:border-surface-700': !context.active && !props.invalid, - 'bg-primary border-primary text-primary-inverse': context.active - }, - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50 focus:z-10', - { - 'hover:bg-surface-50 dark:hover:bg-surface-800/80': !context.active && !props.invalid, - 'hover:bg-primary-hover': context.active - }, - { 'opacity-60 select-none pointer-events-none cursor-default': context.disabled }, - // Transition - 'transition duration-200', - - // Misc - 'cursor-pointer select-none overflow-hidden' - ] - }), - label: { - class: 'font-bold' - } -}; diff --git a/apps/web/presets/lara/sidebar/index.js b/apps/web/presets/lara/sidebar/index.js deleted file mode 100644 index 27b4160..0000000 --- a/apps/web/presets/lara/sidebar/index.js +++ /dev/null @@ -1,149 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Flexbox - 'flex flex-col', - - // Position - 'relative', - { '!transition-none !transform-none !w-screen !h-screen !max-h-full !top-0 !left-0': props.position == 'full' }, - - // Size - { - 'h-full w-80': props.position == 'left' || props.position == 'right', - 'h-auto w-full': props.position == 'top' || props.position == 'bottom' - }, - - // Shape - 'border-0 dark:border', - 'shadow-lg', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-white/80', - 'dark:border-surface-700', - - // Transitions - 'transition-transform', - 'duration-300', - - // Misc - 'pointer-events-auto' - ] - }), - header: { - class: [ - // Flexbox and Alignment - 'flex items-center justify-between', - 'shrink-0', - - // Spacing - 'p-5', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-surface-0/80' - ] - }, - title: { - class: ['font-bold text-lg'] - }, - icons: { - class: ['flex items-center'] - }, - closeButton: { - class: [ - 'relative', - - // Flexbox and Alignment - 'flex items-center justify-center', - - // Size and Spacing - 'mr-2', - 'last:mr-0', - 'w-8 h-8', - - // Shape - 'border-0', - 'rounded-full', - - // Colors - 'text-surface-500', - 'bg-transparent', - - // Transitions - 'transition duration-200 ease-in-out', - - // States - 'hover:text-surface-700 dark:hover:text-white/80', - 'hover:bg-surface-100 dark:hover:bg-surface-800/80', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-inset', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Misc - 'overflow-hidden' - ] - }, - closeButtonIcon: { - class: [ - // Display - 'inline-block', - - // Size - 'w-4', - 'h-4' - ] - }, - content: { - class: [ - // Spacing and Size - 'p-5', - 'pt-0', - 'h-full', - 'w-full', - - // Growth and Overflow - 'grow', - 'overflow-y-auto' - ] - }, - mask: ({ props }) => ({ - class: [ - // Transitions - 'transition-all', - 'duration-300', - { 'p-5': !props.position == 'full' }, - - // Background and Effects - { 'has-[.mask-active]:bg-transparent bg-black/40': props.modal, 'has-[.mask-active]:backdrop-blur-none backdrop-blur-sm': props.modal } - ] - }), - transition: ({ props }) => { - return props.position === 'top' - ? { - enterFromClass: 'translate-x-0 -translate-y-full translate-z-0 mask-active', - leaveToClass: 'translate-x-0 -translate-y-full translate-z-0 mask-active' - } - : props.position === 'bottom' - ? { - enterFromClass: 'translate-x-0 translate-y-full translate-z-0 mask-active', - leaveToClass: 'translate-x-0 translate-y-full translate-z-0 mask-active' - } - : props.position === 'left' - ? { - enterFromClass: '-translate-x-full translate-y-0 translate-z-0 mask-active', - leaveToClass: '-translate-x-full translate-y-0 translate-z-0 mask-active' - } - : props.position === 'right' - ? { - enterFromClass: 'translate-x-full translate-y-0 translate-z-0 mask-active', - leaveToClass: 'translate-x-full translate-y-0 translate-z-0 mask-active' - } - : { - enterFromClass: 'opacity-0 mask-active', - enterActiveClass: 'transition-opacity duration-400 ease-in', - leaveActiveClass: 'transition-opacity duration-400 ease-in', - leaveToClass: 'opacity-0 mask-active' - }; - } -}; diff --git a/apps/web/presets/lara/skeleton/index.js b/apps/web/presets/lara/skeleton/index.js deleted file mode 100644 index d459aaa..0000000 --- a/apps/web/presets/lara/skeleton/index.js +++ /dev/null @@ -1,16 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'overflow-hidden', - { - 'animate-pulse': props.animation !== 'none' - }, - - // Round - { 'rounded-full': props.shape === 'circle', 'rounded-md': props.shape !== 'circle' }, - - // Colors - 'bg-surface-200 dark:bg-surface-700' - ] - }) -}; diff --git a/apps/web/presets/lara/slider/index.js b/apps/web/presets/lara/slider/index.js deleted file mode 100644 index 684acd8..0000000 --- a/apps/web/presets/lara/slider/index.js +++ /dev/null @@ -1,137 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'relative', - - // Size - { 'h-1 w-60': props.orientation == 'horizontal', 'w-1 h-56': props.orientation == 'vertical' }, - - // Shape - 'border-0', - - // Colors - 'bg-surface-100 dark:bg-surface-700', - - // States - { 'opacity-60 select-none pointer-events-none cursor-default': props.disabled } - ] - }), - range: ({ props }) => ({ - class: [ - // Position - 'block absolute', - { - 'top-0 left-0': props.orientation == 'horizontal', - 'bottom-0 left-0': props.orientation == 'vertical' - }, - - //Size - { - 'h-full': props.orientation == 'horizontal', - 'w-full': props.orientation == 'vertical' - }, - - // Colors - 'bg-primary' - ] - }), - handle: ({ props }) => ({ - class: [ - 'block', - - // Size - 'h-[1.143rem]', - 'w-[1.143rem]', - { - 'top-[50%] mt-[-0.5715rem] ml-[-0.5715rem]': props.orientation == 'horizontal', - 'left-[50%] mb-[-0.5715rem] ml-[-0.5715rem]': props.orientation == 'vertical' - }, - - // Shape - 'rounded-full', - 'border-2', - - // Colors - 'bg-surface-0 dark:bg-surface-600', - 'border-primary', - - // States - 'hover:bg-primary-hover', - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring', - 'ring-primary-400/50 dark:ring-primary-300/50', - - // Transitions - 'transition duration-200', - - // Misc - 'cursor-grab', - 'touch-action-none' - ] - }), - starthandler: ({ props }) => ({ - class: [ - 'block', - - // Size - 'h-[1.143rem]', - 'w-[1.143rem]', - { - 'top-[50%] mt-[-0.5715rem] ml-[-0.5715rem]': props.orientation == 'horizontal', - 'left-[50%] mb-[-0.5715rem] ml-[-0.4715rem]': props.orientation == 'vertical' - }, - - // Shape - 'rounded-full', - 'border-2', - - // Colors - 'bg-surface-0 dark:bg-surface-600', - 'border-primary', - - // States - 'hover:bg-primary-hover', - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring', - 'focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transitions - 'transition duration-200', - - // Misc - 'cursor-grab', - 'touch-action-none' - ] - }), - endhandler: ({ props }) => ({ - class: [ - 'block', - - // Size - 'h-[1.143rem]', - 'w-[1.143rem]', - { - 'top-[50%] mt-[-0.5715rem] ml-[-0.5715rem]': props.orientation == 'horizontal', - 'left-[50%] mb-[-0.5715rem] ml-[-0.4715rem]': props.orientation == 'vertical' - }, - - // Shape - 'rounded-full', - 'border-2', - - // Colors - 'bg-surface-0 dark:bg-surface-600', - 'border-primary', - - // States - 'hover:bg-primary-hover', - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring', - 'focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transitions - 'transition duration-200', - - // Misc - 'cursor-grab', - 'touch-action-none' - ] - }) -}; diff --git a/apps/web/presets/lara/speeddial/index.js b/apps/web/presets/lara/speeddial/index.js deleted file mode 100644 index 3d12876..0000000 --- a/apps/web/presets/lara/speeddial/index.js +++ /dev/null @@ -1,297 +0,0 @@ -export default { - root: { - class: 'absolute flex' - }, - button: { - root: ({ props, context, parent }) => ({ - class: [ - 'relative', - 'z-20', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'leading-[normal]', - 'w-16 h-16 p-0 py-3', - - // Shapes - 'rounded-full', - 'shadow-md', - - // Link Button - { 'text-primary-600 bg-transparent border-transparent': props.link }, - - // Plain Button - { 'text-white bg-gray-500 border border-gray-500': props.plain && !props.outlined && !props.text }, - // Plain Text Button - { 'text-surface-500': props.plain && props.text }, - // Plain Outlined Button - { 'text-surface-500 border border-gray-500': props.plain && props.outlined }, - - // Text Button - { 'bg-transparent border-transparent': props.text && !props.plain }, - - // Outlined Button - { 'bg-transparent border': props.outlined && !props.plain }, - - // --- Severity Buttons --- - - // Primary Button - { - 'text-primary-inverse': !props.link && props.severity === null && !props.text && !props.outlined && !props.plain, - 'bg-primary': !props.link && props.severity === null && !props.text && !props.outlined && !props.plain, - 'border border-primary': !props.link && props.severity === null && !props.text && !props.outlined && !props.plain - }, - // Primary Text Button - { 'text-primary': props.text && props.severity === null && !props.plain }, - // Primary Outlined Button - { 'text-primary border border-primary': props.outlined && props.severity === null && !props.plain }, - - // Secondary Button - { - 'text-white dark:text-surface-900': props.severity === 'secondary' && !props.text && !props.outlined && !props.plain, - 'bg-surface-500 dark:bg-surface-400': props.severity === 'secondary' && !props.text && !props.outlined && !props.plain, - 'border border-surface-500 dark:border-surface-400': props.severity === 'secondary' && !props.text && !props.outlined && !props.plain - }, - // Secondary Text Button - { 'text-surface-500 dark:text-surface-300': props.text && props.severity === 'secondary' && !props.plain }, - // Secondary Outlined Button - { 'text-surface-500 dark:text-surface-300 border border-surface-500 hover:bg-surface-300/20': props.outlined && props.severity === 'secondary' && !props.plain }, - - // Success Button - { - 'text-white dark:text-green-900': props.severity === 'success' && !props.text && !props.outlined && !props.plain, - 'bg-green-500 dark:bg-green-400': props.severity === 'success' && !props.text && !props.outlined && !props.plain, - 'border border-green-500 dark:border-green-400': props.severity === 'success' && !props.text && !props.outlined && !props.plain - }, - // Success Text Button - { 'text-green-500 dark:text-green-400': props.text && props.severity === 'success' && !props.plain }, - // Success Outlined Button - { 'text-green-500 border border-green-500 hover:bg-green-300/20': props.outlined && props.severity === 'success' && !props.plain }, - - // Info Button - { - 'text-white dark:text-surface-900': props.severity === 'info' && !props.text && !props.outlined && !props.plain, - 'bg-blue-500 dark:bg-blue-400': props.severity === 'info' && !props.text && !props.outlined && !props.plain, - 'border border-blue-500 dark:border-blue-400': props.severity === 'info' && !props.text && !props.outlined && !props.plain - }, - // Info Text Button - { 'text-blue-500 dark:text-blue-400': props.text && props.severity === 'info' && !props.plain }, - // Info Outlined Button - { 'text-blue-500 border border-blue-500 hover:bg-blue-300/20 ': props.outlined && props.severity === 'info' && !props.plain }, - - // Warning Button - { - 'text-white dark:text-surface-900': props.severity === 'warning' && !props.text && !props.outlined && !props.plain, - 'bg-orange-500 dark:bg-orange-400': props.severity === 'warning' && !props.text && !props.outlined && !props.plain, - 'border border-orange-500 dark:border-orange-400': props.severity === 'warning' && !props.text && !props.outlined && !props.plain - }, - // Warning Text Button - { 'text-orange-500 dark:text-orange-400': props.text && props.severity === 'warning' && !props.plain }, - // Warning Outlined Button - { 'text-orange-500 border border-orange-500 hover:bg-orange-300/20': props.outlined && props.severity === 'warning' && !props.plain }, - - // Help Button - { - 'text-white dark:text-surface-900': props.severity === 'help' && !props.text && !props.outlined && !props.plain, - 'bg-purple-500 dark:bg-purple-400': props.severity === 'help' && !props.text && !props.outlined && !props.plain, - 'border border-purple-500 dark:border-purple-400': props.severity === 'help' && !props.text && !props.outlined && !props.plain - }, - // Help Text Button - { 'text-purple-500 dark:text-purple-400': props.text && props.severity === 'help' && !props.plain }, - // Help Outlined Button - { 'text-purple-500 border border-purple-500 hover:bg-purple-300/20': props.outlined && props.severity === 'help' && !props.plain }, - - // Danger Button - { - 'text-white dark:text-surface-900': props.severity === 'danger' && !props.text && !props.outlined && !props.plain, - 'bg-red-500 dark:bg-red-400': props.severity === 'danger' && !props.text && !props.outlined && !props.plain, - 'border border-red-500 dark:border-red-400': props.severity === 'danger' && !props.text && !props.outlined && !props.plain - }, - // Danger Text Button - { 'text-red-500 dark:text-red-400': props.text && props.severity === 'danger' && !props.plain }, - // Danger Outlined Button - { 'text-red-500 border border-red-500 hover:bg-red-300/20': props.outlined && props.severity === 'danger' && !props.plain }, - // Contrast Button - { - 'text-white dark:text-surface-900': props.severity === 'contrast' && !props.text && !props.outlined && !props.plain, - 'bg-surface-900 dark:bg-surface-0': props.severity === 'contrast' && !props.text && !props.outlined && !props.plain, - 'border border-surface-900 dark:border-surface-0': props.severity === 'contrast' && !props.text && !props.outlined && !props.plain - }, - // Contrast Text Button - { 'text-surface-900 dark:text-surface-0': props.text && props.severity === 'contrast' && !props.plain }, - // Contrast Outlined Button - { 'text-surface-900 dark:text-surface-0 border border-surface-900 dark:border-surface-0': props.outlined && props.severity === 'contrast' && !props.plain }, - - // --- Severity Button States --- - 'focus:outline-none focus:outline-offset-0 focus:ring', - - // Link - { 'focus:ring-primary': props.link }, - - // Plain - { 'hover:bg-gray-600 hover:border-gray-600': props.plain && !props.outlined && !props.text }, - // Text & Outlined Button - { 'hover:bg-surface-300/20': props.plain && (props.text || props.outlined) }, - - // Primary - { 'hover:bg-primary-hover hover:border-primary-hover': !props.link && props.severity === null && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-primary': props.severity === null }, - // Text & Outlined Button - { 'hover:bg-primary-300/20': (props.text || props.outlined) && props.severity === null && !props.plain }, - - // Secondary - { 'hover:bg-surface-600 dark:hover:bg-surface-300 hover:border-surface-600 dark:hover:border-surface-300': props.severity === 'secondary' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-surface-400/50 dark:focus:ring-surface-300/50': props.severity === 'secondary' }, - // Text & Outlined Button - { 'hover:bg-surface-300/20': (props.text || props.outlined) && props.severity === 'secondary' && !props.plain }, - - // Success - { 'hover:bg-green-600 dark:hover:bg-green-300 hover:border-green-600 dark:hover:border-green-300': props.severity === 'success' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-green-400/50 dark:focus:ring-green-300/50': props.severity === 'success' }, - // Text & Outlined Button - { 'hover:bg-green-300/20': (props.text || props.outlined) && props.severity === 'success' && !props.plain }, - - // Info - { 'hover:bg-blue-600 dark:hover:bg-blue-300 hover:border-blue-600 dark:hover:border-blue-300': props.severity === 'info' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-blue-400/50 dark:focus:ring-blue-300/50': props.severity === 'info' }, - // Text & Outlined Button - { 'hover:bg-blue-300/20': (props.text || props.outlined) && props.severity === 'info' && !props.plain }, - - // Warning - { 'hover:bg-orange-600 dark:hover:bg-orange-300 hover:border-orange-600 dark:hover:border-orange-300': props.severity === 'warning' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-orange-400/50 dark:focus:ring-orange-300/50': props.severity === 'warning' }, - // Text & Outlined Button - { 'hover:bg-orange-300/20': (props.text || props.outlined) && props.severity === 'warning' && !props.plain }, - - // Help - { 'hover:bg-purple-600 dark:hover:bg-purple-300 hover:border-purple-600 dark:hover:border-purple-300': props.severity === 'help' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-purple-400/50 dark:focus:ring-purple-300/50': props.severity === 'help' }, - // Text & Outlined Button - { 'hover:bg-purple-300/20': (props.text || props.outlined) && props.severity === 'help' && !props.plain }, - - // Danger - { 'hover:bg-red-600 dark:hover:bg-red-300 hover:border-red-600 dark:hover:border-red-300': props.severity === 'danger' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-red-400/50 dark:focus:ring-red-300/50': props.severity === 'danger' }, - // Text & Outlined Button - { 'hover:bg-red-300/20': (props.text || props.outlined) && props.severity === 'danger' && !props.plain }, - // Contrast - { 'hover:bg-surface-800 dark:hover:bg-surface-100 hover:border-surface-800 dark:hover:border-surface-100': props.severity === 'contrast' && !props.text && !props.outlined && !props.plain }, - { 'focus:ring-surface-500 dark:focus:ring-surface-400': props.severity === 'contrast' }, - // Text & Outlined Button - { 'hover:bg-surface-900/10 dark:hover:bg-[rgba(255,255,255,0.03)]': (props.text || props.outlined) && props.severity === 'contrast' && !props.plain }, - // Disabled - { 'opacity-60 pointer-events-none cursor-default': context.disabled }, - - // Transitions - 'transition duration-200 ease-in-out', - parent.state.d_visible ? 'rotate-45' : 'rotate-0', - - // Misc - 'cursor-pointer overflow-hidden select-none' - ] - }), - label: ({ props }) => ({ - class: [ - 'duration-200', - 'font-bold', - { - 'hover:underline': props.link - }, - { 'flex-1': props.label !== null, 'invisible w-0': props.label == null } - ] - }), - icon: ({ props }) => ({ - class: [ - 'mx-0', - { - 'mr-2': props.iconPos == 'left' && props.label != null, - 'ml-2 order-1': props.iconPos == 'right' && props.label != null, - 'mb-2': props.iconPos == 'top' && props.label != null, - 'mt-2': props.iconPos == 'bottom' && props.label != null - } - ] - }), - loadingicon: ({ props }) => ({ - class: [ - 'h-4 w-4', - 'mx-0', - { - 'mr-2': props.iconPos == 'left' && props.label != null, - 'ml-2 order-1': props.iconPos == 'right' && props.label != null, - 'mb-2': props.iconPos == 'top' && props.label != null, - 'mt-2': props.iconPos == 'bottom' && props.label != null - }, - 'animate-spin' - ] - }), - badge: ({ props }) => ({ - class: [{ 'ml-2 w-4 h-4 leading-none flex items-center justify-center': props.badge }] - }) - }, - menu: { - class: [ - // Spacing - 'm-0 p-0', - - // Layout & Flexbox - 'list-none flex items-center justify-center', - - // Transitions - 'transition delay-200', - - // Z-Index (Positioning) - 'z-20' - ] - }, - menuitem: ({ props, context }) => ({ - class: [ - 'transform transition-transform duration-200 ease-out transition-opacity duration-800', - - // Conditional Appearance - context.hidden ? 'opacity-0 scale-0' : 'opacity-100 scale-100', - - // Conditional Spacing - { - 'my-1 first:mb-2': props.direction == 'up' && props.type == 'linear', - 'my-1 first:mt-2': props.direction == 'down' && props.type == 'linear', - 'mx-1 first:mr-2': props.direction == 'left' && props.type == 'linear', - 'mx-1 first:ml-2': props.direction == 'right' && props.type == 'linear' - }, - - // Conditional Positioning - { absolute: props.type !== 'linear' } - ] - }), - action: { - class: [ - // Flexbox & Alignment - 'flex items-center justify-center', - - // Size - 'w-12 h-12', - - // Shape - 'rounded-full relative overflow-hidden', - - // Appearance - 'bg-surface-600 dark:bg-surface-0/80 text-white dark:text-surface-900/80', - - // Hover Effects - 'hover:bg-surface-700 dark:hover:bg-surface-200/80' - ] - }, - mask: ({ state }) => ({ - class: [ - // Base Styles - 'absolute left-0 top-0 w-full h-full transition-opacity duration-250 ease-in-out bg-black/40 z-0', - - // Conditional Appearance - { - 'opacity-0 pointer-events-none': !state.d_visible, - 'opacity-100 transition-opacity duration-400 ease-in-out': state.d_visible - } - ] - }) -}; diff --git a/apps/web/presets/lara/splitbutton/index.js b/apps/web/presets/lara/splitbutton/index.js deleted file mode 100644 index 7a7c3f4..0000000 --- a/apps/web/presets/lara/splitbutton/index.js +++ /dev/null @@ -1,530 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - // Flexbox and Position - 'inline-flex', - 'relative', - - // Shape - 'rounded-md', - { 'shadow-lg': props.raised } - ] - }), - button: { - root: ({ parent, props }) => ({ - class: [ - 'relative', - - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'leading-[normal]', - { - 'px-4 py-3': parent.props.size === null, - 'text-sm py-2 px-3': parent.props.size === 'small', - 'text-xl py-3 px-4': parent.props.size === 'large' - }, - { - 'min-w-12 p-0 py-3': parent.props.label == null && parent.props.icon !== null - }, - - // Shape - 'rounded-r-none', - 'border-r-0', - { 'rounded-l-full': parent.props.rounded }, - { 'rounded-md': !parent.props.rounded, 'rounded-full': parent.props.rounded }, - - // Link Button - { 'text-primary-600 bg-transparent border-transparent': parent.props.link }, - - // Plain Button - { 'text-white bg-gray-500 border border-gray-500': parent.props.plain && !parent.props.outlined && !parent.props.text }, - // Plain Text Button - { 'text-surface-500': parent.props.plain && parent.props.text }, - // Plain Outlined Button - { 'text-surface-500 border border-gray-500': parent.props.plain && parent.props.outlined }, - - // Text Button - { 'bg-transparent border-transparent': parent.props.text && !parent.props.plain }, - - // Outlined Button - { 'bg-transparent border': parent.props.outlined && !parent.props.plain }, - - // --- Severity Buttons --- - - // Primary Button - { - 'text-primary-inverse': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-primary': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-primary': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Primary Text Button - { 'text-primary': props.text && props.severity === null && !props.plain }, - // Primary Outlined Button - { 'text-primary border border-primary': props.outlined && props.severity === null && !props.plain }, - - // Secondary Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'secondary' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-surface-500 dark:bg-surface-400': parent.props.severity === 'secondary' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-surface-500 dark:border-surface-400': parent.props.severity === 'secondary' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Secondary Text Button - { 'text-surface-500 dark:text-surface-400': parent.props.text && parent.props.severity === 'secondary' && !parent.props.plain }, - // Secondary Outlined Button - { 'text-surface-500 border border-surface-500 hover:bg-surface-300/20': parent.props.outlined && parent.props.severity === 'secondary' && !parent.props.plain }, - - // Success Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'success' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-green-500 dark:bg-green-400': parent.props.severity === 'success' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-green-500 dark:border-green-400': parent.props.severity === 'success' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Success Text Button - { 'text-surface-500 dark:text-surface-400': parent.props.text && parent.props.severity === 'secondary' && !parent.props.plain }, - // Success Outlined Button - { 'text-green-500 border border-green-500 hover:bg-green-300/20': parent.props.outlined && parent.props.severity === 'success' && !parent.props.plain }, - - // Info Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'info' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-blue-500 dark:bg-blue-400': parent.props.severity === 'info' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-blue-500 dark:border-blue-400': parent.props.severity === 'info' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Info Text Button - { 'text-blue-500 dark:text-blue-400': parent.props.text && parent.props.severity === 'info' && !parent.props.plain }, - // Info Outlined Button - { 'text-blue-500 border border-blue-500 hover:bg-blue-300/20 ': parent.props.outlined && parent.props.severity === 'info' && !parent.props.plain }, - - // Warning Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'warning' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-orange-500 dark:bg-orange-400': parent.props.severity === 'warning' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-orange-500 dark:border-orange-400': parent.props.severity === 'warning' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Warning Text Button - { 'text-orange-500 dark:text-orange-400': parent.props.text && parent.props.severity === 'warning' && !parent.props.plain }, - // Warning Outlined Button - { 'text-orange-500 border border-orange-500 hover:bg-orange-300/20': parent.props.outlined && parent.props.severity === 'warning' && !parent.props.plain }, - - // Help Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'help' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-purple-500 dark:bg-purple-400': parent.props.severity === 'help' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-purple-500 dark:border-purple-400': parent.props.severity === 'help' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Help Text Button - { 'text-purple-500 dark:text-purple-400': parent.props.text && parent.props.severity === 'help' && !parent.props.plain }, - // Help Outlined Button - { 'text-purple-500 border border-purple-500 hover:bg-purple-300/20': parent.props.outlined && parent.props.severity === 'help' && !parent.props.plain }, - - // Danger Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'danger' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-red-500 dark:bg-red-400': parent.props.severity === 'danger' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-red-500 dark:border-red-400': parent.props.severity === 'danger' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Danger Text Button - { 'text-red-500 dark:text-red-400': parent.props.text && parent.props.severity === 'danger' && !parent.props.plain }, - // Danger Outlined Button - { 'text-red-500 border border-red-500 hover:bg-red-300/20': parent.props.outlined && parent.props.severity === 'danger' && !parent.props.plain }, - // Contrast Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'contrast' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-surface-900 dark:bg-surface-0': parent.props.severity === 'contrast' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-surface-900 dark:border-surface-0': parent.props.severity === 'contrast' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Contrast Text Button - { 'text-surface-900 dark:text-surface-0': props.text && props.severity === 'contrast' && !props.plain }, - // Contrast Outlined Button - { 'text-surface-900 dark:text-surface-0 border border-surface-900 dark:border-surface-0': props.outlined && props.severity === 'contrast' && !props.plain }, - // --- Severity Button States --- - 'focus:outline-none focus:outline-offset-0 focus:ring', - - // Link - { 'focus:ring-primary/50': parent.props.link }, - - // Plain - { 'hover:bg-gray-600 hover:border-gray-600': parent.props.plain && !parent.props.outlined && !parent.props.text }, - // Text & Outlined Button - { 'hover:bg-surface-300/20': parent.props.plain && (parent.props.text || parent.props.outlined) }, - - // Primary - { 'hover:bg-primary-hover hover:border-primary-hover': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-primary/50': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - // Text & Outlined Button - { 'hover:bg-primary-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === null && !parent.props.plain }, - - // Secondary - { 'hover:bg-surface-600 dark:hover:bg-surface-300 hover:border-surface-600 dark:hover:border-surface-300': parent.props.severity === 'secondary' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-surface-400/50 dark:focus:ring-surface-300/50': parent.props.severity === 'secondary' }, - // Text & Outlined Button - { 'hover:bg-surface-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'secondary' && !parent.props.plain }, - - // Success - { 'hover:bg-green-600 dark:hover:bg-green-300 hover:border-green-600 dark:hover:border-green-300': parent.props.severity === 'success' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-green-400/50 dark:focus:ring-green-300/50': parent.props.severity === 'success' }, - // Text & Outlined Button - { 'hover:bg-green-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'success' && !parent.props.plain }, - - // Info - { 'hover:bg-blue-600 dark:hover:bg-blue-300 hover:border-blue-600 dark:hover:border-blue-300': parent.props.severity === 'info' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-blue-400/50 dark:focus:ring-blue-300/50': parent.props.severity === 'info' }, - // Text & Outlined Button - { 'hover:bg-blue-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'info' && !parent.props.plain }, - - // Warning - { 'hover:bg-orange-600 dark:hover:bg-orange-300 hover:border-orange-600 dark:hover:border-orange-300': parent.props.severity === 'warning' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-orange-400/50 dark:focus:ring-orange-300/50': parent.props.severity === 'warning' }, - // Text & Outlined Button - { 'hover:bg-orange-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'warning' && !parent.props.plain }, - - // Help - { 'hover:bg-purple-600 dark:hover:bg-purple-300 hover:border-purple-600 dark:hover:border-purple-300': parent.props.severity === 'help' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-purple-400/50 dark:focus:ring-purple-300/50': parent.props.severity === 'help' }, - // Text & Outlined Button - { 'hover:bg-purple-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'help' && !parent.props.plain }, - - // Danger - { 'hover:bg-red-600 dark:hover:bg-red-300 hover:border-red-600 dark:hover:border-red-300': parent.props.severity === 'danger' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-red-400/50 dark:focus:ring-red-300/50': parent.props.severity === 'danger' }, - // Text & Outlined Button - { 'hover:bg-red-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'danger' && !parent.props.plain }, - - // Contrast - { 'hover:bg-surface-800 dark:hover:bg-surface-100 hover:border-surface-800 dark:hover:border-surface-100': parent.props.severity === 'contrast' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-surface-500 dark:focus:ring-surface-400': parent.props.severity === 'contrast' }, - // Text & Outlined Button - { 'hover:bg-surface-900/10 dark:hover:bg-[rgba(255,255,255,0.03)]': (parent.props.text || parent.props.outlined) && parent.props.severity === 'contrast' && !parent.props.plain }, - // Transitions - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer overflow-hidden select-none' - ] - }), - icon: { - class: [ - // Margins - 'mr-2' - ] - } - }, - menubutton: { - root: ({ parent, props }) => ({ - class: [ - 'relative', - // Alignments - 'items-center inline-flex text-center align-bottom justify-center', - - // Sizes & Spacing - 'leading-[normal]', - { - 'px-4 py-3': parent.props.size === null, - 'text-sm py-2 px-3': parent.props.size === 'small', - 'text-xl py-3 px-4': parent.props.size === 'large' - }, - { - 'min-w-12 p-0 py-3': parent.props.label == null && parent.props.icon !== null - }, - - // Shape - 'rounded-l-none', - { 'rounded-l-full': parent.props.rounded }, - { 'rounded-md': !parent.props.rounded, 'rounded-full': parent.props.rounded }, - - // Link Button - { 'text-primary-600 bg-transparent border-transparent': parent.props.link }, - - // Plain Button - { 'text-white bg-gray-500 border border-gray-500': parent.props.plain && !parent.props.outlined && !parent.props.text }, - // Plain Text Button - { 'text-surface-500': parent.props.plain && parent.props.text }, - // Plain Outlined Button - { 'text-surface-500 border border-gray-500': parent.props.plain && parent.props.outlined }, - - // Text Button - { 'bg-transparent border-transparent': parent.props.text && !parent.props.plain }, - - // Outlined Button - { 'bg-transparent border': parent.props.outlined && !parent.props.plain }, - - // --- Severity Buttons --- - - // Primary Button - { - 'text-primary-inverse': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-primary': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-primary': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Primary Text Button - { 'text-primary': props.text && props.severity === null && !props.plain }, - // Primary Outlined Button - { 'text-primary border border-primary': props.outlined && props.severity === null && !props.plain }, - - // Secondary Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'secondary' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-surface-500 dark:bg-surface-400': parent.props.severity === 'secondary' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-surface-500 dark:border-surface-400': parent.props.severity === 'secondary' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Secondary Text Button - { 'text-surface-500 dark:text-surface-400': parent.props.text && parent.props.severity === 'secondary' && !parent.props.plain }, - // Secondary Outlined Button - { 'text-surface-500 border border-surface-500 hover:bg-surface-300/20': parent.props.outlined && parent.props.severity === 'secondary' && !parent.props.plain }, - - // Success Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'success' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-green-500 dark:bg-green-400': parent.props.severity === 'success' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-green-500 dark:border-green-400': parent.props.severity === 'success' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Success Text Button - { 'text-surface-500 dark:text-surface-400': parent.props.text && parent.props.severity === 'secondary' && !parent.props.plain }, - // Success Outlined Button - { 'text-green-500 border border-green-500 hover:bg-green-300/20': parent.props.outlined && parent.props.severity === 'success' && !parent.props.plain }, - - // Info Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'info' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-blue-500 dark:bg-blue-400': parent.props.severity === 'info' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-blue-500 dark:border-blue-400': parent.props.severity === 'info' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Info Text Button - { 'text-blue-500 dark:text-blue-400': parent.props.text && parent.props.severity === 'info' && !parent.props.plain }, - // Info Outlined Button - { 'text-blue-500 border border-blue-500 hover:bg-blue-300/20 ': parent.props.outlined && parent.props.severity === 'info' && !parent.props.plain }, - - // Warning Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'warning' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-orange-500 dark:bg-orange-400': parent.props.severity === 'warning' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-orange-500 dark:border-orange-400': parent.props.severity === 'warning' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Warning Text Button - { 'text-orange-500 dark:text-orange-400': parent.props.text && parent.props.severity === 'warning' && !parent.props.plain }, - // Warning Outlined Button - { 'text-orange-500 border border-orange-500 hover:bg-orange-300/20': parent.props.outlined && parent.props.severity === 'warning' && !parent.props.plain }, - - // Help Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'help' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-purple-500 dark:bg-purple-400': parent.props.severity === 'help' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-purple-500 dark:border-purple-400': parent.props.severity === 'help' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Help Text Button - { 'text-purple-500 dark:text-purple-400': parent.props.text && parent.props.severity === 'help' && !parent.props.plain }, - // Help Outlined Button - { 'text-purple-500 border border-purple-500 hover:bg-purple-300/20': parent.props.outlined && parent.props.severity === 'help' && !parent.props.plain }, - - // Danger Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'danger' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-red-500 dark:bg-red-400': parent.props.severity === 'danger' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-red-500 dark:border-red-400': parent.props.severity === 'danger' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Danger Text Button - { 'text-red-500 dark:text-red-400': parent.props.text && parent.props.severity === 'danger' && !parent.props.plain }, - // Danger Outlined Button - { 'text-red-500 border border-red-500 hover:bg-red-300/20': parent.props.outlined && parent.props.severity === 'danger' && !parent.props.plain }, - // Contrast Button - { - 'text-white dark:text-surface-900': parent.props.severity === 'contrast' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'bg-surface-900 dark:bg-surface-0': parent.props.severity === 'contrast' && !parent.props.text && !parent.props.outlined && !parent.props.plain, - 'border border-surface-900 dark:border-surface-0': parent.props.severity === 'contrast' && !parent.props.text && !parent.props.outlined && !parent.props.plain - }, - // Contrast Text Button - { 'text-surface-900 dark:text-surface-0': props.text && props.severity === 'contrast' && !props.plain }, - // Contrast Outlined Button - { 'text-surface-900 dark:text-surface-0 border border-surface-900 dark:border-surface-0': props.outlined && props.severity === 'contrast' && !props.plain }, - // --- Severity Button States --- - 'focus:outline-none focus:outline-offset-0 focus:ring', - - // Link - { 'focus:ring-primary/50': parent.props.link }, - - // Plain - { 'hover:bg-gray-600 hover:border-gray-600': parent.props.plain && !parent.props.outlined && !parent.props.text }, - // Text & Outlined Button - { 'hover:bg-surface-300/20': parent.props.plain && (parent.props.text || parent.props.outlined) }, - - // Primary - { 'hover:bg-primary-hover hover:border-primary-hover': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-primary/50': !parent.props.link && parent.props.severity === null && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - // Text & Outlined Button - { 'hover:bg-primary-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === null && !parent.props.plain }, - - // Secondary - { 'hover:bg-surface-600 dark:hover:bg-surface-300 hover:border-surface-600 dark:hover:border-surface-300': parent.props.severity === 'secondary' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-surface-400/50 dark:focus:ring-surface-300/50': parent.props.severity === 'secondary' }, - // Text & Outlined Button - { 'hover:bg-surface-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'secondary' && !parent.props.plain }, - - // Success - { 'hover:bg-green-600 dark:hover:bg-green-300 hover:border-green-600 dark:hover:border-green-300': parent.props.severity === 'success' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-green-400/50 dark:focus:ring-green-300/50': parent.props.severity === 'success' }, - // Text & Outlined Button - { 'hover:bg-green-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'success' && !parent.props.plain }, - - // Info - { 'hover:bg-blue-600 dark:hover:bg-blue-300 hover:border-blue-600 dark:hover:border-blue-300': parent.props.severity === 'info' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-blue-400/50 dark:focus:ring-blue-300/50': parent.props.severity === 'info' }, - // Text & Outlined Button - { 'hover:bg-blue-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'info' && !parent.props.plain }, - - // Warning - { 'hover:bg-orange-600 dark:hover:bg-orange-300 hover:border-orange-600 dark:hover:border-orange-300': parent.props.severity === 'warning' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-orange-400/50 dark:focus:ring-orange-300/50': parent.props.severity === 'warning' }, - // Text & Outlined Button - { 'hover:bg-orange-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'warning' && !parent.props.plain }, - - // Help - { 'hover:bg-purple-600 dark:hover:bg-purple-300 hover:border-purple-600 dark:hover:border-purple-300': parent.props.severity === 'help' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-purple-400/50 dark:focus:ring-purple-300/50': parent.props.severity === 'help' }, - // Text & Outlined Button - { 'hover:bg-purple-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'help' && !parent.props.plain }, - - // Danger - { 'hover:bg-red-600 dark:hover:bg-red-300 hover:border-red-600 dark:hover:border-red-300': parent.props.severity === 'danger' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-red-400/50 dark:focus:ring-red-300/50': parent.props.severity === 'danger' }, - // Text & Outlined Button - { 'hover:bg-red-300/20': (parent.props.text || parent.props.outlined) && parent.props.severity === 'danger' && !parent.props.plain }, - - // Contrast - { 'hover:bg-surface-800 dark:hover:bg-surface-100 hover:border-surface-800 dark:hover:border-surface-100': parent.props.severity === 'contrast' && !parent.props.text && !parent.props.outlined && !parent.props.plain }, - { 'focus:ring-surface-500 dark:focus:ring-surface-400': parent.props.severity === 'contrast' }, - // Text & Outlined Button - { 'hover:bg-surface-900/10 dark:hover:bg-[rgba(255,255,255,0.03)]': (parent.props.text || parent.props.outlined) && parent.props.severity === 'contrast' && !parent.props.plain }, - - // Transitions - 'transition duration-200 ease-in-out', - - // Misc - 'cursor-pointer overflow-hidden select-none' - ] - }), - label: { - class: ['hidden'] - } - }, - menu: { - root: { - class: [ - // Shape - 'rounded-md', - - // Size - 'min-w-[12rem]', - 'py-1', - - // Colors - 'bg-surface-0 dark:bg-surface-700', - 'border border-surface-200 dark:border-surface-700' - ] - }, - menu: { - class: [ - // Spacings and Shape - 'list-none', - 'm-0', - 'p-0', - 'outline-none' - ] - }, - menuitem: { - class: [ - // Position - 'relative' - ] - }, - content: ({ context }) => ({ - class: [ - //Shape - 'rounded-none', - - // Colors - { - 'text-surface-500 dark:text-white/70': !context.focused && !context.active, - 'text-surface-500 dark:text-white/70 bg-surface-200 dark:bg-surface-600/90': context.focused && !context.active, - 'text-primary-highlight-inverse bg-primary-highlight': (context.focused && context.active) || context.active || (!context.focused && context.active) - }, - - // Hover States - { - 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.active, - 'hover:bg-primary-highlight-hover text-primary-highlight-inverse': context.active - }, - - // Transitions - 'transition-shadow', - 'duration-200' - ] - }), - action: { - class: [ - 'relative', - // Flexbox - - 'flex', - 'items-center', - - // Spacing - 'py-3', - 'px-5', - - // Color - 'text-surface-700 dark:text-white/80', - - // Misc - 'no-underline', - 'overflow-hidden', - 'cursor-pointer', - 'select-none' - ] - }, - icon: { - class: [ - // Spacing - 'mr-2', - - // Color - 'text-surface-600 dark:text-white/70' - ] - }, - label: { - class: ['leading-none'] - }, - submenuicon: { - class: [ - // Position - 'ml-auto' - ] - }, - submenu: { - class: [ - // Size - 'w-full sm:w-48', - - // Spacing - 'py-1', - 'm-0', - 'list-none', - - // Shape - 'shadow-none sm:shadow-md', - 'border-0', - - // Position - 'static sm:absolute', - 'z-10', - - // Color - 'bg-surface-0 dark:bg-surface-700' - ] - }, - separator: { - class: 'border-t border-surface-200 dark:border-surface-600 my-1' - } - } -}; diff --git a/apps/web/presets/lara/splitter/index.js b/apps/web/presets/lara/splitter/index.js deleted file mode 100644 index 877c805..0000000 --- a/apps/web/presets/lara/splitter/index.js +++ /dev/null @@ -1,61 +0,0 @@ -export default { - root: ({ context }) => ({ - class: [ - // Colors - 'bg-surface-0', - 'dark:bg-surface-900', - 'text-surface-700', - 'dark:text-surface-0/80', - - // Shape - 'rounded-lg', - - // Borders (Conditional) - { 'border border-solid border-surface-50 dark:border-surface-700': !context.nested }, - - // Nested - { 'flex grow border-0': context.nested } - ] - }), - - gutter: ({ props }) => ({ - class: [ - // Flexbox - 'flex', - 'items-center', - 'justify-center', - 'shrink-0', - - // Colors - 'bg-surface-50', - 'dark:bg-surface-800', - - // Transitions - 'transition-all', - 'duration-200', - - // Misc - { - 'cursor-col-resize': props.layout == 'horizontal', - 'cursor-row-resize': props.layout !== 'horizontal' - } - ] - }), - gutterhandler: ({ props }) => ({ - class: [ - // Colors - 'bg-surface-100', - 'dark:bg-surface-600', - - // Transitions - 'transition-all', - 'duration-200', - - // Sizing (Conditional) - { - 'h-7': props.layout == 'horizontal', - 'w-7 h-2': props.layout !== 'horizontal' - } - ] - }) -}; diff --git a/apps/web/presets/lara/splitterpanel/index.js b/apps/web/presets/lara/splitterpanel/index.js deleted file mode 100644 index 6a21cd3..0000000 --- a/apps/web/presets/lara/splitterpanel/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - root: ({ context }) => ({ - class: ['grow', { flex: context.nested }] - }) -}; diff --git a/apps/web/presets/lara/stepper/index.js b/apps/web/presets/lara/stepper/index.js deleted file mode 100644 index 03bf376..0000000 --- a/apps/web/presets/lara/stepper/index.js +++ /dev/null @@ -1,161 +0,0 @@ -export default { - root: ({ props }) => ({ - class: ['flex-1', props.orientation === 'vertical' ? 'flex-col' : 'flex-row'] - }), - nav: { - class: [ - // Flexbox - 'flex', - 'justify-between', - 'items-center', - - // Spacing - 'm-0', - 'p-0', - - // Positioning - 'relative', - - // Lists - 'list-none', - - // Overflow - 'overflow-x-auto' - ] - }, - stepperpanel: { - panel: ({ context, parent }) => ({ - class: [context.active ? 'flex-1' : '', parent.props.orientation === 'vertical' ? 'flex flex-col flex-initial' : ''] - }), - header: ({ parent, context }) => ({ - class: [ - // Position - 'relative', - - // Flexbox - 'flex', - 'items-center', - context.last ? 'flex-initial' : 'flex-1', - parent.props.orientation === 'vertical' ? 'flex-initial' : '', - - // Spacing - 'p-2' - ] - }), - action: { - class: [ - // Borders - 'border-0', - 'border-none', - - // Flexbox - 'inline-flex', - 'items-center', - - // Text - 'text-decoration-none', - - // Transitions - 'transition', - 'transition-shadow', - 'duration-200', - - // Shape - 'rounded-md', - - // Backgrounds - 'bg-transparent', - - // Focus - 'outline-none' - ] - }, - number: ({ context }) => ({ - class: [ - // Flexbox - 'flex', - 'items-center', - 'justify-center', - - // Colors (Conditional) - context.active ? 'bg-primary text-primary-inverse' : 'border border-surface-200 dark:border-surface-700 text-surface-900 dark:text-surface-0', // Adjust colors as needed - - // Size and Shape - 'min-w-[2rem]', - 'h-[2rem]', - 'line-height-[2rem]', - 'rounded-full', - - // Text - 'text-lg', - - // Borders - context.active ? 'border-0 border-none' : 'border-solid border-2', - - // Transitions - 'transition', - 'transition-colors', - 'transition-shadow', - 'duration-200' - ] - }), - title: ({ context }) => ({ - class: [ - // Layout - 'block', - 'whitespace-nowrap', - 'overflow-hidden', - 'text-ellipsis', - 'max-w-full', - - // Spacing - 'ml-2', - - // Text - context.active ? 'text-surface-900 dark:text-surface-0' : 'text-surface-700 dark:text-surface-0/80', - 'font-bold', - - // Transitions - 'transition', - 'transition-colors', - 'transition-shadow', - 'duration-200' - ] - }), - separator: ({ context, state, parent }) => ({ - class: [ - // Colors (Conditional for active step) - state.d_activeStep <= context.index ? 'bg-surface-200 dark:bg-surface-700' : 'bg-primary', - - // Conditional for Vertical Orientation - parent.props.orientation === 'vertical' ? ['flex-none', 'w-[2px]', 'h-auto', 'ml-[calc(1.29rem+2px)]'] : ['flex-1', 'w-full', 'h-[2px]', 'ml-4'], - - // Transitions - 'transition-shadow', - 'duration-200' - ] - }), - transition: { - class: ['flex flex-1', 'bg-surface-0 dark:bg-surface-800', 'text-surface-900 dark:text-surface-0'], - enterFromClass: 'max-h-0', - enterActiveClass: 'overflow-hidden transition-[max-height] duration-1000 ease-[cubic-bezier(0.42,0,0.58,1)]', - enterToClass: 'max-h-[1000px]', - leaveFromClass: 'max-h-[1000px]', - leaveActiveClass: 'overflow-hidden transition-[max-height] duration-[450ms] ease-[cubic-bezier(0,1,0,1)]', - leaveToClass: 'max-h-0' - }, - content: ({ parent }) => ({ - class: [parent.props.orientation === 'vertical' ? 'w-full pl-4' : ''] - }) - }, - panelcontainer: { - class: [ - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-900 dark:text-surface-0', - - // Spacing - 'p-4' - ] - } -}; diff --git a/apps/web/presets/lara/steps/index.js b/apps/web/presets/lara/steps/index.js deleted file mode 100644 index 997cd00..0000000 --- a/apps/web/presets/lara/steps/index.js +++ /dev/null @@ -1,111 +0,0 @@ -export default { - root: { - class: 'relative' - }, - menu: { - class: 'p-0 m-0 list-none flex' - }, - menuitem: { - class: [ - // Flexbox and Position - 'relative', - 'flex', - 'justify-center', - 'flex-1', - 'overflow-hidden', - - // Before - 'before:border-t', - 'before:border-surface-200', - 'before:dark:border-surface-700', - 'before:w-full', - 'before:absolute', - 'before:top-1/2', - 'before:left-0', - 'before:transform', - 'before:-mt-4' - ] - }, - action: ({ props }) => ({ - class: [ - // Flexbox - 'inline-flex items-center', - 'flex-col', - - // Transitions and Shape - 'transition-shadow', - 'rounded-md', - - // Colors - 'bg-surface-0', - 'dark:bg-transparent', - - // States - 'focus:outline-none focus:outline-offset-0 focus:ring', - 'focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Misc - 'overflow-hidden', - { 'cursor-pointer': !props.readonly } - ] - }), - step: ({ context, props }) => ({ - class: [ - // Flexbox - 'flex items-center justify-center', - - // Position - 'z-20', - - // Shape - 'rounded-full', - 'border', - - // Size - 'w-[2rem]', - 'h-[2rem]', - 'text-sm', - 'leading-[2rem]', - - // Colors - { - 'text-surface-400 dark:text-white/60': !context.active, - 'border-surface-100 dark:border-surface-700': !context.active, - 'bg-surface-0 dark:bg-surface-800': !context.active, - 'bg-primary': context.active, - 'border-primary': context.active, - 'text-primary-inverse': context.active - }, - - // States - { - 'hover:border-surface-300 dark:hover:border-surface-500': !context.active && !props.readonly - }, - - // Transition - 'transition-colors duration-200 ease-in-out' - ] - }), - label: ({ context }) => ({ - class: [ - // Font - 'leading-[normal]', - { 'font-bold': context.active }, - - // Display - 'block', - - // Spacing - 'mt-2', - - // Colors - { 'text-surface-400 dark:text-white/60': !context.active, 'text-surface-800 dark:text-white/80': context.active }, - - // Text and Overflow - 'whitespace-nowrap', - 'overflow-hidden', - 'overflow-ellipsis', - 'max-w-full' - ] - }) -}; diff --git a/apps/web/presets/lara/tabmenu/index.js b/apps/web/presets/lara/tabmenu/index.js deleted file mode 100644 index b6a21ec..0000000 --- a/apps/web/presets/lara/tabmenu/index.js +++ /dev/null @@ -1,73 +0,0 @@ -export default { - root: { - class: 'overflow-x-auto' - }, - menu: { - class: [ - // Flexbox - 'flex flex-1', - - // Spacing - 'list-none', - 'p-0 m-0', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'border-b-2 border-surface-200 dark:border-surface-700', - 'text-surface-900 dark:text-surface-0/80' - ] - }, - menuitem: { - class: 'mr-0' - }, - action: ({ context, state }) => ({ - class: [ - 'relative', - - // Font - 'font-bold', - - // Flexbox and Alignment - 'flex items-center', - - // Spacing - 'p-5', - '-mb-[2px]', - - // Shape - 'border-b-2', - 'rounded-t-md', - - // Colors and Conditions - { - 'border-surface-200 dark:border-surface-700': state.d_activeIndex !== context.index, - 'bg-surface-0 dark:bg-surface-800': state.d_activeIndex !== context.index, - 'text-surface-700 dark:text-surface-0/80': state.d_activeIndex !== context.index, - - 'bg-surface-0 dark:bg-surface-800': state.d_activeIndex === context.index, - 'border-primary': state.d_activeIndex === context.index, - 'text-primary': state.d_activeIndex === context.index - }, - - // States - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset', - 'focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - { - 'hover:bg-surface-0 dark:hover:bg-surface-800/80': state.d_activeIndex !== context.index, - 'hover:border-surface-400 dark:hover:border-primary-400': state.d_activeIndex !== context.index, - 'hover:text-surface-900 dark:hover:text-surface-0': state.d_activeIndex !== context.index - }, - - // Transitions - 'transition-all duration-200', - - // Misc - 'cursor-pointer select-none text-decoration-none', - 'overflow-hidden', - 'user-select-none' - ] - }), - icon: { - class: 'mr-2' - } -}; diff --git a/apps/web/presets/lara/tabview/index.js b/apps/web/presets/lara/tabview/index.js deleted file mode 100644 index 9c754f2..0000000 --- a/apps/web/presets/lara/tabview/index.js +++ /dev/null @@ -1,156 +0,0 @@ -export default { - navContainer: ({ props }) => ({ - class: [ - // Position - 'relative', - - // Misc - { 'overflow-hidden': props.scrollable } - ] - }), - navContent: { - class: [ - // Overflow and Scrolling - 'overflow-y-hidden overscroll-contain', - 'overscroll-auto', - 'scroll-smooth', - '[&::-webkit-scrollbar]:hidden' - ] - }, - previousButton: { - class: [ - // Flexbox and Alignment - 'flex items-center justify-center', - - // Position - '!absolute', - 'top-0 left-0', - 'z-20', - - // Size and Shape - 'h-full w-12', - 'rounded-none', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-primary', - 'shadow-md' - ] - }, - nextButton: { - class: [ - // Flexbox and Alignment - 'flex items-center justify-center', - - // Position - '!absolute', - 'top-0 right-0', - 'z-20', - - // Size and Shape - 'h-full w-12', - 'rounded-none', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-primary', - 'shadow-md' - ] - }, - nav: { - class: [ - // Flexbox - 'flex flex-1', - - // Spacing - 'list-none', - 'p-0 m-0', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'border-b-2 border-surface-200 dark:border-surface-700', - 'text-surface-900 dark:text-surface-0/80' - ] - }, - tabpanel: { - header: ({ props }) => ({ - class: [ - // Spacing - 'mr-0', - - // Misc - { - 'opacity-60 cursor-default user-select-none select-none pointer-events-none': props?.disabled - } - ] - }), - headerAction: ({ parent, context }) => ({ - class: [ - 'relative', - - // Font - 'font-bold', - - // Flexbox and Alignment - 'flex items-center', - - // Spacing - 'p-5', - '-mb-[2px]', - - // Shape - 'border-b-2', - 'rounded-t-md', - - // Colors and Conditions - { - 'border-surface-200 dark:border-surface-700': parent.state.d_activeIndex !== context.index, - 'bg-surface-0 dark:bg-surface-800': parent.state.d_activeIndex !== context.index, - 'text-surface-700 dark:text-surface-0/80': parent.state.d_activeIndex !== context.index, - - 'bg-surface-0 dark:bg-surface-800': parent.state.d_activeIndex === context.index, - 'border-primary': parent.state.d_activeIndex === context.index, - 'text-primary': parent.state.d_activeIndex === context.index - }, - - // States - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset', - 'focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - { - 'hover:bg-surface-0 dark:hover:bg-surface-800/80': parent.state.d_activeIndex !== context.index, - 'hover:border-surface-400 dark:hover:border-primary-400': parent.state.d_activeIndex !== context.index, - 'hover:text-surface-900 dark:hover:text-surface-0': parent.state.d_activeIndex !== context.index - }, - - // Transitions - 'transition-all duration-200', - - // Misc - 'cursor-pointer select-none text-decoration-none', - 'overflow-hidden', - 'user-select-none' - ] - }), - headerTitle: { - class: [ - // Text - 'leading-none', - 'whitespace-nowrap' - ] - }, - content: { - class: [ - // Spacing - 'p-5', - - // Shape - 'rounded-b-md', - - // Colors - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-surface-0/80', - 'border-0' - ] - } - } -}; diff --git a/apps/web/presets/lara/tag/index.js b/apps/web/presets/lara/tag/index.js deleted file mode 100644 index a774a23..0000000 --- a/apps/web/presets/lara/tag/index.js +++ /dev/null @@ -1,36 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - //Font - 'text-xs font-bold', - - //Alignments - 'inline-flex items-center justify-center', - - //Spacing - 'px-2 py-1', - - //Shape - { - 'rounded-md': !props.rounded, - 'rounded-full': props.rounded - }, - - //Colors - 'text-primary-inverse', - { - 'bg-primary dark:bg-primary': props.severity == null || props.severity == 'primary', - 'bg-green-500 dark:bg-green-400': props.severity == 'success', - 'bg-blue-500 dark:bg-blue-400': props.severity == 'info', - 'bg-orange-500 dark:bg-orange-400': props.severity == 'warning', - 'bg-red-500 dark:bg-red-400': props.severity == 'danger' - } - ] - }), - value: { - class: 'leading-normal' - }, - icon: { - class: 'mr-1 text-sm' - } -}; diff --git a/apps/web/presets/lara/terminal/index.js b/apps/web/presets/lara/terminal/index.js deleted file mode 100644 index 3fbd652..0000000 --- a/apps/web/presets/lara/terminal/index.js +++ /dev/null @@ -1,60 +0,0 @@ -export default { - root: { - class: [ - // Spacing - 'p-5', - - // Shape - 'rounded-md', - - // Color - 'bg-surface-900 text-white', - 'border border-surface-700', - - // Sizing & Overflow - 'h-72 overflow-auto' - ] - }, - container: { - class: [ - // Flexbox - 'flex items-center' - ] - }, - prompt: { - class: [ - // Color - 'text-surface-400' - ] - }, - response: { - class: [ - // Color - 'text-primary-400' - ] - }, - command: { - class: [ - // Color - 'text-primary-400' - ] - }, - commandtext: { - class: [ - // Flexbox - 'flex-1 shrink grow-0', - - // Shape - 'border-0', - - // Spacing - 'p-0', - - // Color - 'bg-transparent text-inherit', - - // Outline - 'outline-none' - ] - } -}; diff --git a/apps/web/presets/lara/textarea/index.js b/apps/web/presets/lara/textarea/index.js deleted file mode 100644 index 756e988..0000000 --- a/apps/web/presets/lara/textarea/index.js +++ /dev/null @@ -1,39 +0,0 @@ -export default { - root: ({ context, props, parent }) => ({ - class: [ - // Font - 'leading-[normal]', - - // Spacing - 'm-0', - 'p-3', - - // Shape - 'rounded-md', - - // Colors - 'text-surface-600 dark:text-surface-200', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { - 'hover:border-primary': !context.disabled && !props.invalid, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50': !context.disabled, - 'opacity-60 select-none pointer-events-none cursor-default': context.disabled - }, - - // Filled State *for FloatLabel - { filled: parent.instance?.$name == 'FloatLabel' && props.modelValue !== null && props.modelValue?.length !== 0 }, - - // Misc - 'appearance-none', - 'transition-colors duration-200' - ] - }) -}; diff --git a/apps/web/presets/lara/tieredmenu/index.js b/apps/web/presets/lara/tieredmenu/index.js deleted file mode 100644 index e0344ef..0000000 --- a/apps/web/presets/lara/tieredmenu/index.js +++ /dev/null @@ -1,119 +0,0 @@ -export default { - root: { - class: [ - // Shape - 'rounded-md', - - // Size - 'min-w-[12rem]', - 'py-1', - - // Colors - 'bg-surface-0 dark:bg-surface-700', - 'border border-surface-200 dark:border-surface-700' - ] - }, - menu: { - class: [ - // Spacings and Shape - 'list-none', - 'm-0', - 'p-0', - 'outline-none' - ] - }, - menuitem: { - class: [ - // Position - 'relative' - ] - }, - content: ({ context }) => ({ - class: [ - //Shape - 'rounded-none', - - // Colors - { - 'text-surface-500 dark:text-white/70': !context.focused && !context.active, - 'text-surface-500 dark:text-white/70 bg-surface-200 dark:bg-surface-600/90': context.focused && !context.active, - 'text-primary-highlight-inverse bg-primary-highlight': (context.focused && context.active) || context.active || (!context.focused && context.active) - }, - - // Hover States - { - 'hover:bg-surface-100 dark:hover:bg-surface-600/80': !context.active, - 'hover:bg-primary-highlight-hover text-primary-highlight-inverse': context.active - }, - - // Transitions - 'transition-shadow', - 'duration-200' - ] - }), - action: { - class: [ - 'relative', - // Flexbox - - 'flex', - 'items-center', - - // Spacing - 'py-3', - 'px-5', - - // Color - 'text-surface-700 dark:text-white/80', - - // Misc - 'no-underline', - 'overflow-hidden', - 'cursor-pointer', - 'select-none' - ] - }, - icon: { - class: [ - // Spacing - 'mr-2', - - // Color - 'text-surface-600 dark:text-white/70' - ] - }, - label: { - class: ['leading-none'] - }, - submenuicon: { - class: [ - // Position - 'ml-auto' - ] - }, - submenu: { - class: [ - // Size - 'w-full sm:w-48', - - // Spacing - 'py-1', - 'm-0', - 'list-none', - - // Shape - 'shadow-none sm:shadow-md', - 'border-0', - - // Position - 'static sm:absolute', - 'z-10', - - // Color - 'bg-surface-0 dark:bg-surface-700' - ] - }, - separator: { - class: 'border-t border-surface-200 dark:border-surface-600 my-1' - } -}; diff --git a/apps/web/presets/lara/timeline/index.js b/apps/web/presets/lara/timeline/index.js deleted file mode 100644 index 155ba2e..0000000 --- a/apps/web/presets/lara/timeline/index.js +++ /dev/null @@ -1,81 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'flex grow', - { - 'flex-col': props.layout === 'vertical', - 'flex-row flex-1': props.layout === 'horizontal' - } - ] - }), - event: ({ props, context }) => ({ - class: [ - 'flex relative min-h-[70px]', - { - 'flex-row-reverse': props.align === 'right' || (props.layout === 'vertical' && props.align === 'alternate' && context.index % 2 === 1), - 'flex-col flex-1': props.layout === 'horizontal', - 'flex-col-reverse ': props.align === 'bottom' || (props.layout === 'horizontal' && props.align === 'alternate' && context.index % 2 === 1) - } - ] - }), - opposite: ({ props, context }) => ({ - class: [ - 'flex-1', - { - 'px-4': props.layout === 'vertical', - 'py-4': props.layout === 'horizontal' - }, - { - 'text-right': props.align === 'left' || (props.layout === 'vertical' && props.align === 'alternate' && context.index % 2 === 0), - 'text-left': props.align === 'right' || (props.layout === 'vertical' && props.align === 'alternate' && context.index % 2 === 1) - } - ] - }), - separator: ({ props }) => ({ - class: [ - 'flex items-center flex-initial', - { - 'flex-col': props.layout === 'vertical', - 'flex-row': props.layout === 'horizontal' - } - ] - }), - marker: { - class: [ - // Display & Flexbox - 'flex self-baseline', - - // Size - 'w-4 h-4', - - // Appearance - 'rounded-full border-2 border-primary bg-surface-0 dark:bg-surface-900/40' - ] - }, - connector: ({ props }) => ({ - class: [ - 'grow bg-surface-300 dark:bg-surface-700', - { - 'w-[2px]': props.layout === 'vertical', - 'w-full h-[2px]': props.layout === 'horizontal' - } - ] - }), - content: ({ props, context }) => ({ - class: [ - 'flex-1', - { - 'px-4': props.layout === 'vertical', - 'py-4': props.layout === 'horizontal' - }, - { - 'text-left': props.align === 'left' || (props.layout === 'vertical' && props.align === 'alternate' && context.index % 2 === 0), - 'text-right': props.align === 'right' || (props.layout === 'vertical' && props.align === 'alternate' && context.index % 2 === 1) - }, - { - 'min-h-0': props.layout === 'vertical' && context.index === context.count - 1, - 'grow-0': props.layout === 'horizontal' && context.index === context.count - 1 - } - ] - }) -}; diff --git a/apps/web/presets/lara/toast/index.js b/apps/web/presets/lara/toast/index.js deleted file mode 100644 index 01a4e07..0000000 --- a/apps/web/presets/lara/toast/index.js +++ /dev/null @@ -1,102 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - //Size and Shape - 'w-96 rounded-md', - - // Positioning - { '-translate-x-2/4': props.position == 'top-center' || props.position == 'bottom-center' } - ] - }), - container: ({ props }) => ({ - class: [ - 'my-4 rounded-md w-full', - 'border-solid border-0 border-l-[6px]', - 'backdrop-blur-[10px] shadow-md', - - // Colors - { - 'bg-blue-100/70 dark:bg-blue-500/20': props.message.severity == 'info', - 'bg-green-100/70 dark:bg-green-500/20': props.message.severity == 'success', - 'bg-orange-100/70 dark:bg-orange-500/20': props.message.severity == 'warn', - 'bg-red-100/70 dark:bg-red-500/20': props.message.severity == 'error' - }, - { - 'border-blue-500 dark:border-blue-400': props.message.severity == 'info', - 'border-green-500 dark:border-green-400': props.message.severity == 'success', - 'border-orange-500 dark:border-orange-400': props.message.severity == 'warn', - 'border-red-500 dark:border-red-400': props.message.severity == 'error' - }, - { - 'text-blue-700 dark:text-blue-300': props.message.severity == 'info', - 'text-green-700 dark:text-green-300': props.message.severity == 'success', - 'text-orange-700 dark:text-orange-300': props.message.severity == 'warn', - 'text-red-700 dark:text-red-300': props.message.severity == 'error' - } - ] - }), - content: ({ props }) => ({ - class: [ - 'flex p-4', - { - 'items-start': props.message.summary, - 'items-center': !props.message.summary, - }, - ], - }), - icon: { - class: [ - // Sizing and Spacing - 'w-6 h-6', - 'text-lg leading-none mr-2 shrink-0' - ] - }, - text: { - class: [ - // Font and Text - 'text-base leading-none', - 'ml-2', - 'flex-1' - ] - }, - summary: { - class: 'font-bold block' - }, - detail: ({ props }) => ({ - class: ['block', { 'mt-2': props.message.summary }], - }), - closebutton: { - class: [ - // Flexbox - 'flex items-center justify-center', - - // Size - 'w-8 h-8', - - // Spacing and Misc - 'ml-auto relative', - - // Shape - 'rounded-full', - - // Colors - 'bg-transparent', - - // Transitions - 'transition duration-200 ease-in-out', - - // States - 'hover:bg-surface-0/50 dark:hover:bg-surface-0/10', - - // Misc - 'overflow-hidden' - ] - }, - transition: { - enterFromClass: 'opacity-0 translate-y-2/4', - enterActiveClass: 'transition-[transform,opacity] duration-300', - leaveFromClass: 'max-h-[1000px]', - leaveActiveClass: '!transition-[max-height_.45s_cubic-bezier(0,1,0,1),opacity_.3s,margin-bottom_.3s] overflow-hidden', - leaveToClass: 'max-h-0 opacity-0 mb-0' - } -}; diff --git a/apps/web/presets/lara/togglebutton/index.js b/apps/web/presets/lara/togglebutton/index.js deleted file mode 100644 index 14a8d80..0000000 --- a/apps/web/presets/lara/togglebutton/index.js +++ /dev/null @@ -1,91 +0,0 @@ -export default { - root: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-bottom', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: ({ props }) => ({ - class: [ - // Alignments - 'items-center inline-flex flex-1 text-center align-bottom justify-center', - - // Sizes & Spacing - 'px-4 py-3 leading-none', - - // Shapes - 'rounded-md border', - - // Colors - { - 'bg-surface-0 dark:bg-surface-900 ': !props.modelValue, - 'border-surface-200 dark:border-surface-700 ': !props.modelValue && !props.invalid, - 'text-surface-700 dark:text-white/80': !props.modelValue, - 'bg-primary border-primary text-primary-inverse': props.modelValue - }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // States - { - 'peer-hover:bg-surface-50 dark:peer-hover:bg-surface-800/80 peer-hover:border-surface-200 dark:peer-hover:bg-surface-700 peer-hover:text-surface-700 dark:peer-hover:text-white/80': !props.modelValue && !props.invalid, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': props.modelValue, - 'peer-focus-visible:ring peer-focus-visible:ring-primary-400/50 dark:peer-focus-visible:ring-primary-300/50': !props.disabled - }, - - // Transitions - 'transition-all duration-200', - - // Misc - { 'cursor-pointer': !props.disabled, 'opacity-60 select-none pointer-events-none cursor-default': props.disabled } - ] - }), - label: { - class: 'font-bold text-center w-full' - }, - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: ({ props }) => ({ - class: [ - ' mr-2', - { - 'text-surface-600 dark:text-white/70': !props.modelValue, - 'text-white dark:text-surface-900': props.modelValue - } - ] - }) -}; diff --git a/apps/web/presets/lara/toolbar/index.js b/apps/web/presets/lara/toolbar/index.js deleted file mode 100644 index 4232baa..0000000 --- a/apps/web/presets/lara/toolbar/index.js +++ /dev/null @@ -1,28 +0,0 @@ -export default { - root: { - class: [ - // Flex & Alignment - 'flex items-center justify-between flex-wrap', - 'gap-2', - - // Spacing - 'p-5', - - // Shape - 'rounded-md', - - // Color - 'bg-surface-50 dark:bg-surface-800', - 'border border-surface-200 dark:border-surface-700' - ] - }, - start: { - class: 'flex items-center' - }, - center: { - class: 'flex items-center' - }, - end: { - class: 'flex items-center' - } -}; diff --git a/apps/web/presets/lara/tooltip/index.js b/apps/web/presets/lara/tooltip/index.js deleted file mode 100644 index 2856bf3..0000000 --- a/apps/web/presets/lara/tooltip/index.js +++ /dev/null @@ -1,46 +0,0 @@ -export default { - root: ({ context, props }) => ({ - class: [ - // Position and Shadows - 'absolute', - 'shadow-md', - 'p-fadein', - // Spacing - { - 'py-0 px-1': context?.right || context?.left || (!context?.right && !context?.left && !context?.top && !context?.bottom), - 'py-1 px-0': context?.top || context?.bottom - } - ] - }), - arrow: ({ context, props }) => ({ - class: [ - // Position - - 'absolute', - - // Size - 'w-0', - 'h-0', - - // Shape - 'border-transparent', - 'border-solid', - { - 'border-y-[0.25rem] border-r-[0.25rem] border-l-0 border-r-surface-600': context?.right || (!context?.right && !context?.left && !context?.top && !context?.bottom), - 'border-y-[0.25rem] border-l-[0.25rem] border-r-0 border-l-surface-600': context?.left, - 'border-x-[0.25rem] border-t-[0.25rem] border-b-0 border-t-surface-600': context?.top, - 'border-x-[0.25rem] border-b-[0.25rem] border-t-0 border-b-surface-600': context?.bottom - }, - - // Spacing - { - '-mt-1 ': context?.right || (!context?.right && !context?.left && !context?.top && !context?.bottom), - '-mt-1': context?.left, - '-ml-1': context?.top || context?.bottom - } - ] - }), - text: { - class: ['p-3', 'bg-surface-600 dark:bg-surface-700', 'text-white', 'leading-none', 'rounded-md', 'whitespace-pre-line', 'break-words'] - } -}; diff --git a/apps/web/presets/lara/tree/index.js b/apps/web/presets/lara/tree/index.js deleted file mode 100644 index c7347db..0000000 --- a/apps/web/presets/lara/tree/index.js +++ /dev/null @@ -1,258 +0,0 @@ -export default { - root: { - class: [ - // Space - 'p-5', - - // Shape - 'rounded-md', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-700 dark:text-white/80', - 'border border-solid border-surface-200 dark:border-surface-700' - ] - }, - wrapper: { - class: ['overflow-auto'] - }, - container: { - class: [ - // Spacing - 'm-0 p-0', - - // Misc - 'list-none overflow-auto' - ] - }, - node: { - class: ['p-1', 'rounded-md', 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-inset focus:ring-primary-400/50 dark:focus:ring-primary-300/50'] - }, - content: ({ context, props }) => ({ - class: [ - // Flex and Alignment - 'flex items-center', - - // Shape - 'rounded-md', - - // Spacing - 'p-2', - - // Colors - 'text-surface-600 dark:text-white/70', - { 'bg-primary-highlight text-primary-highlight-inverse': context.selected }, - - // States - { 'hover:bg-surface-50 dark:hover:bg-surface-700/40': (props.selectionMode == 'single' || props.selectionMode == 'multiple') && !context.selected }, - - // Transition - 'transition-shadow duration-200', - - { 'cursor-pointer select-none': props.selectionMode == 'single' || props.selectionMode == 'multiple' } - ] - }), - toggler: ({ context }) => ({ - class: [ - // Flex and Alignment - 'inline-flex items-center justify-center', - - // Shape - 'border-0 rounded-full', - - // Size - 'w-8 h-8', - - // Spacing - 'mr-2', - - // Colors - 'bg-transparent', - { - 'text-surface-500 dark:text-white': !context.selected, - 'text-primary-600 dark:text-white': context.selected, - invisible: context.leaf - }, - - // States - 'hover:bg-surface-200/20 dark:hover:bg-surface-500/20', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transition - 'transition duration-200', - - // Misc - 'cursor-pointer select-none' - ] - }), - nodeCheckbox: ({ props, context, instance }) => ({ - root: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-6', - 'h-6', - - // Spacing - 'mr-2', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: { - class: [ - // Alignment - 'flex', - 'items-center', - 'justify-center', - - // Size - 'w-6', - 'h-6', - - // Shape - 'rounded-md', - 'border-2', - - // Colors - { - 'border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked, - 'border-primary bg-primary': context.checked - }, - - // States - { - 'peer-hover:border-primary': !props.disabled && !context.checked, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': !props.disabled && context.checked, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'cursor-default opacity-60': props.disabled - }, - - // Transitions - 'transition-colors', - 'duration-200' - ] - }, - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - { - 'text-white dark:text-surface-900': !instance.partialChecked, - 'text-gray dark:text-white': instance.partialChecked - }, - - // Transitions - 'transition-all', - 'duration-200' - ] - } - }), - nodeicon: { - class: [ - // Space - 'mr-2', - - // Color - 'text-surface-600 dark:text-white/70' - ] - }, - subgroup: { - class: ['m-0 list-none p-0 pl-2 mt-1'] - }, - filtercontainer: { - class: [ - 'relative block', - - // Space - 'mb-2', - - // Size - 'w-full' - ] - }, - input: { - class: [ - 'relative', - // Font - 'leading-none', - - // Spacing - 'm-0', - 'p-3 pr-10', - - // Size - 'w-full', - - // Shape - 'rounded-md', - - // Colors - 'text-surface-600 dark:text-surface-200', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border border-surface-300 dark:border-surface-600', - - // States - 'hover:border-primary', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50', - - // Transition & Misc - 'appearance-none', - 'transition-colors duration-200' - ] - }, - loadingicon: { - class: ['text-surface-500 dark:text-surface-0/70', 'absolute top-[50%] right-[50%] -mt-2 -mr-2 animate-spin'] - }, - searchicon: { - class: [ - // Position - 'absolute top-1/2 -mt-2 right-3', - - // Color - 'text-surface-600 dark:hover:text-white/70' - ] - } -}; diff --git a/apps/web/presets/lara/treeselect/index.js b/apps/web/presets/lara/treeselect/index.js deleted file mode 100644 index 2a36abf..0000000 --- a/apps/web/presets/lara/treeselect/index.js +++ /dev/null @@ -1,352 +0,0 @@ -export default { - root: ({ props, state }) => ({ - class: [ - // Display and Position - 'inline-flex', - 'relative', - - // Shape - 'rounded-md', - - // Color and Background - 'bg-surface-0 dark:bg-surface-900', - 'border', - { 'border-surface-300 dark:border-surface-600': !props.invalid }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // Transitions - 'transition-all', - 'duration-200', - - // States - { 'hover:border-primary': !props.invalid }, - { 'outline-none outline-offset-0 ring ring-primary-400/50 dark:ring-primary-300/50': state.focused }, - - // Misc - 'cursor-pointer', - 'select-none', - { 'opacity-60': props.disabled, 'pointer-events-none': props.disabled, 'cursor-default': props.disabled } - ] - }), - labelContainer: { - class: ['overflow-hidden flex flex-auto cursor-pointer'] - }, - label: { - class: [ - 'block leading-[normal]', - - // Space - 'p-3', - - // Color - 'text-surface-800 dark:text-white/80', - - // Transition - 'transition duration-200', - - // Misc - 'overflow-hidden whitespace-nowrap cursor-pointer overflow-ellipsis' - ] - }, - trigger: { - class: [ - // Flexbox - 'flex items-center justify-center', - 'shrink-0', - - // Color and Background - 'bg-transparent', - 'text-surface-500', - - // Size - 'w-12', - - // Shape - 'rounded-tr-md', - 'rounded-br-md' - ] - }, - panel: { - class: [ - // Position - 'absolute top-0 left-0', - - // Shape - 'border-0 dark:border', - 'rounded-md', - 'shadow-md', - - // Color - 'bg-surface-0 dark:bg-surface-800', - 'text-surface-800 dark:text-white/80', - 'dark:border-surface-700' - ] - }, - wrapper: { - class: [ - // Sizing - 'max-h-[200px]', - - // Misc - 'overflow-auto' - ] - }, - tree: { - root: { - class: [ - // Space - 'p-5' - ] - }, - wrapper: { - class: ['overflow-auto'] - }, - container: { - class: [ - // Spacing - 'm-0 p-0', - - // Misc - 'list-none overflow-auto' - ] - }, - node: { - class: ['p-1', 'rounded-md', 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-inset focus:ring-primary-400/50 dark:focus:ring-primary-300/50'] - }, - content: ({ context, props }) => ({ - class: [ - // Flex and Alignment - 'flex items-center', - - // Shape - 'rounded-md', - - // Spacing - 'p-2', - - // Colors - 'text-surface-600 dark:text-white/70', - { 'bg-primary-highlight text-primary-highlight-inverse': context.selected }, - - // States - { 'hover:bg-surface-50 dark:hover:bg-surface-700/40': (props.selectionMode == 'single' || props.selectionMode == 'multiple') && !context.selected }, - - // Transition - 'transition-shadow duration-200', - - { 'cursor-pointer select-none': props.selectionMode == 'single' || props.selectionMode == 'multiple' } - ] - }), - toggler: ({ context }) => ({ - class: [ - // Flex and Alignment - 'inline-flex items-center justify-center', - - // Shape - 'border-0 rounded-full', - - // Size - 'w-8 h-8', - - // Spacing - 'mr-2', - - // Colors - 'bg-transparent', - { - 'text-surface-500 dark:text-white': !context.selected, - 'text-primary-600 dark:text-white': context.selected, - invisible: context.leaf - }, - - // States - 'hover:bg-surface-200/20 dark:hover:bg-surface-500/20', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 dark:focus:ring-primary-300/50', - - // Transition - 'transition duration-200', - - // Misc - 'cursor-pointer select-none' - ] - }), - nodeCheckbox: ({ props, context, instance }) => ({ - root: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-bottom', - - // Size - 'w-6', - 'h-6', - - // Spacing - 'mr-2', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: { - class: [ - // Alignment - 'flex', - 'items-center', - 'justify-center', - - // Size - 'w-6', - 'h-6', - - // Shape - 'rounded-md', - 'border-2', - - // Colors - { - 'border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked, - 'border-primary bg-primary': context.checked - }, - - // States - { - 'peer-hover:border-primary': !props.disabled && !context.checked, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': !props.disabled && context.checked, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'cursor-default opacity-60': props.disabled - }, - - // Transitions - 'transition-colors', - 'duration-200' - ] - }, - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - { - 'text-white dark:text-surface-900': !instance.partialChecked, - 'text-gray dark:text-white': instance.partialChecked - }, - - // Transitions - 'transition-all', - 'duration-200' - ] - } - }), - nodeicon: { - class: [ - // Space - 'mr-2', - - // Color - 'text-surface-600 dark:text-white/70' - ] - }, - subgroup: { - class: ['m-0 list-none p-0 pl-2 mt-1'] - }, - filtercontainer: { - class: [ - 'relative block', - - // Space - 'mb-2', - - // Size - 'w-full' - ] - }, - input: { - class: [ - 'relative', - // Font - 'leading-none', - - // Spacing - 'm-0', - 'p-3 pr-10', - - // Size - 'w-full', - - // Shape - 'rounded-md', - - // Colors - 'text-surface-600 dark:text-surface-200', - 'placeholder:text-surface-400 dark:placeholder:text-surface-500', - 'bg-surface-0 dark:bg-surface-900', - 'border border-surface-300 dark:border-surface-600', - - // States - 'hover:border-primary', - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-500/50 dark:focus:ring-primary-400/50', - - // Transition & Misc - 'appearance-none', - 'transition-colors duration-200' - ] - }, - loadingicon: { - class: ['text-surface-500 dark:text-surface-0/70', 'absolute top-[50%] right-[50%] -mt-2 -mr-2 animate-spin'] - }, - searchicon: { - class: [ - // Position - 'absolute top-1/2 -mt-2 right-3', - - // Color - 'text-surface-600 dark:hover:text-white/70' - ] - } - }, - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } -}; diff --git a/apps/web/presets/lara/treetable/index.js b/apps/web/presets/lara/treetable/index.js deleted file mode 100644 index 9098dd3..0000000 --- a/apps/web/presets/lara/treetable/index.js +++ /dev/null @@ -1,427 +0,0 @@ -export default { - root: ({ props }) => ({ - class: [ - 'relative', - { - 'flex flex-col h-full': props.scrollHeight === 'flex' - } - ] - }), - loadingoverlay: { - class: [ - // Position - 'absolute', - 'top-0 left-0', - 'z-20', - - // Flex & Alignment - 'flex items-center justify-center', - - // Size - 'w-full h-full', - - // Color - 'bg-surface-100/40 dark:bg-surface-800/40', - - // Transition - 'transition duration-200' - ] - }, - loadingicon: { - class: 'w-8 h-8 animate-spin' - }, - wrapper: ({ props }) => ({ - class: [ - // Overflow - { - 'relative overflow-auto': props.scrollable, - 'overflow-x-auto': props.resizableColumns - } - ] - }), - header: ({ props }) => ({ - class: [ - 'font-bold', - - // Shape - props.showGridlines ? 'border-x border-t border-b-0' : 'border-y border-x-0', - - // Spacing - 'p-4', - - // Color - 'bg-surface-50 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700', - 'text-surface-700 dark:text-white/80' - ] - }), - footer: { - class: [ - // Background, Border & Text - 'bg-slate-50 text-slate-700', - 'border border-x-0 border-t-0 border-surface-50', - // Padding & Font - 'p-4 font-bold', - // Dark Mode - 'dark:bg-surface-900 dark:text-white/70 dark:border-surface-700' - ] - }, - table: { - class: [ - // Table & Width - 'border-collapse table-fixed w-full ' - ] - }, - thead: ({ props }) => ({ - class: [ - // Position & Z-index - { - 'top-0 z-40 sticky': props.scrollable - } - ] - }), - tbody: ({ props }) => ({ - class: [ - // Block Display - { - block: props.scrollable - } - ] - }), - tfoot: ({ props }) => ({ - class: [ - // Block Display - { - block: props.scrollable - } - ] - }), - headerrow: ({ props }) => ({ - class: [ - // Flexbox & Width - { - 'flex flex-nowrap w-full': props.scrollable - } - ] - }), - row: ({ context, props }) => ({ - class: [ - // Flex - { 'flex flex-nowrap w-full': context.scrollable }, - - // Color - 'dark:text-white/80', - { 'bg-primary-highlight text-primary-highlight-inverse': context.selected }, - { 'bg-surface-0 text-surface-600 dark:bg-surface-800': !context.selected }, - - // Hover & Flexbox - { - 'hover:bg-surface-300/20 hover:text-surface-600': context.selectable && !context.selected - }, - 'focus:outline-none focus:outline-offset-0 focus:ring focus:ring-primary-400/50 ring-inset dark:focus:ring-primary-300/50', - - // Transition - { 'transition duration-200': (props.selectionMode && !context.selected) || props.rowHover } - ] - }), - headercell: ({ context, props }) => ({ - class: [ - 'font-bold', - - // Position - { 'sticky z-40': context.scrollable && context.scrollDirection === 'both' && context.frozen }, - - // Flex & Alignment - { - 'flex flex-1 items-center': context.scrollable, - 'flex-initial shrink-0': context.scrollable && context.scrollDirection === 'both' && !context.frozen - }, - 'text-left', - - // Shape - { 'first:border-l border-y border-r': context?.showGridlines }, - 'border-0 border-b border-solid', - - // Spacing - context?.size === 'small' ? 'p-2' : context?.size === 'large' ? 'p-5' : 'p-4', - - // Color - (props.sortable === '' || props.sortable) && context.sorted ? 'bg-primary-highlight text-primary-highlight-inverse' : 'bg-surface-50 text-surface-700 dark:text-white/80 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700', - - // States - { 'hover:bg-surface-100 dark:hover:bg-surface-400/30': (props.sortable === '' || props.sortable) && !context?.sorted }, - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transition - { 'transition duration-200': props.sortable === '' || props.sortable }, - - // Misc - { - 'overflow-hidden relative bg-clip-padding': context.resizable && !context.frozen - } - ] - }), - column: { - headercell: ({ context, props }) => ({ - class: [ - 'font-bold', - - // Position - { 'sticky z-40': context.scrollable && context.scrollDirection === 'both' && context.frozen }, - - // Flex & Alignment - { - 'flex flex-1 items-center': context.scrollable, - 'flex-initial shrink-0': context.scrollable && context.scrollDirection === 'both' && !context.frozen - }, - 'text-left', - - // Shape - { 'first:border-l border-y border-r': context?.showGridlines }, - 'border-0 border-b border-solid', - - // Spacing - context?.size === 'small' ? 'p-2' : context?.size === 'large' ? 'p-5' : 'p-4', - - // Color - (props.sortable === '' || props.sortable) && context.sorted ? 'bg-primary-highlight text-primary-highlight-inverse' : 'bg-surface-50 text-surface-700 dark:text-white/80 dark:bg-surface-800', - 'border-surface-200 dark:border-surface-700', - - // States - { 'hover:bg-surface-100 dark:hover:bg-surface-400/30': (props.sortable === '' || props.sortable) && !context?.sorted }, - 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring focus-visible:ring-inset focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transition - { 'transition duration-200': props.sortable === '' || props.sortable }, - - // Misc - { - 'overflow-hidden relative bg-clip-padding': context.resizable && !context.frozen - } - ] - }), - bodycell: ({ context }) => ({ - class: [ - // Position - { - sticky: context.scrollable && context.scrollDirection === 'both' && context.frozen - }, - - // Flex & Alignment - { - 'flex flex-1 items-center': context.scrollable, - 'flex-initial shrink-0': context.scrollable && context.scrollDirection === 'both' && !context.frozen - }, - 'text-left', - - // Shape - 'border-0 border-b border-solid', - 'border-surface-200 dark:border-surface-700', - { - 'border-x-0 border-l-0': !context.showGridlines - }, - { 'first:border-l border-r border-b': context?.showGridlines }, - - // Spacing - context?.size === 'small' ? 'p-2' : context?.size === 'large' ? 'p-5' : 'p-4', - - // Misc - { - 'cursor-pointer': context.selectable, - sticky: context.scrollable && context.scrollDirection === 'both' && context.frozen, - 'border-x-0 border-l-0': !context.showGridlines - } - ] - }), - rowtoggler: { - class: [ - 'relative', - - // Flex & Alignment - 'inline-flex items-center justify-center', - 'text-left align-middle', - - // Spacing - 'm-0 mr-2 p-0', - - // Size - 'w-8 h-8', - - // Shape - 'border-0 rounded-full', - - // Color - 'text-surface-500 dark:text-white/70', - 'bg-transparent', - - // States - 'hover:bg-surface-50 dark:hover:bg-surface-700', - 'focus-visible:outline-none focus-visible:outline-offset-0', - 'focus-visible:ring focus-visible:ring-primary-400/50 dark:focus-visible:ring-primary-300/50', - - // Transition - 'transition duration-200', - - // Misc - 'overflow-hidden', - 'cursor-pointer select-none' - ] - }, - sorticon: ({ context }) => ({ - class: ['ml-2 inline-block', context.sorted ? 'fill-primary-highlight-inverse' : 'fill-surface-700 dark:fill-white/70'] - }), - sortbadge: { - class: [ - // Flex & Alignment - 'inline-flex items-center justify-center align-middle', - - // Shape - 'rounded-full', - - // Size - 'w-[1.143rem] leading-[1.143rem]', - - // Spacing - 'ml-2', - - // Color - 'text-primary-highlight-inverse bg-primary-highlight' - ] - }, - columnresizer: { - class: [ - 'block', - - // Position - 'absolute top-0 right-0', - - // Sizing - 'w-2 h-full', - - // Spacing - 'm-0 p-0', - - // Color - 'border border-transparent', - - // Misc - 'cursor-col-resize' - ] - }, - rowCheckbox: ({ props, context, instance }) => ({ - root: { - class: [ - 'relative', - - // Alignment - 'inline-flex', - 'align-middle', - - // Size - 'w-6', - 'h-6', - - // Spacing - 'mr-2', - - // Misc - 'cursor-pointer', - 'select-none' - ] - }, - box: { - class: [ - // Alignment - 'flex', - 'items-center', - 'justify-center', - - // Size - 'w-6', - 'h-6', - - // Shape - 'rounded-md', - 'border-2', - - // Colors - { - 'border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked, - 'border-primary bg-primary': context.checked - }, - - // States - { - 'peer-hover:border-primary': !props.disabled && !context.checked, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': !props.disabled && context.checked, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'cursor-default opacity-60': props.disabled - }, - - // Transitions - 'transition-colors', - 'duration-200' - ] - }, - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - icon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - { - 'text-white dark:text-surface-900': !instance.partialChecked, - 'text-gray dark:text-white': instance.partialChecked - }, - - // Transitions - 'transition-all', - 'duration-200' - ] - } - }), - - transition: { - enterFromClass: 'opacity-0 scale-y-[0.8]', - enterActiveClass: 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]', - leaveActiveClass: 'transition-opacity duration-100 ease-linear', - leaveToClass: 'opacity-0' - } - }, - resizehelper: { - class: 'absolute hidden w-[2px] z-20 bg-primary' - } -}; diff --git a/apps/web/presets/lara/tristatecheckbox/index.js b/apps/web/presets/lara/tristatecheckbox/index.js deleted file mode 100644 index 99cd349..0000000 --- a/apps/web/presets/lara/tristatecheckbox/index.js +++ /dev/null @@ -1,104 +0,0 @@ -export default { - root: { - class: ['cursor-pointer inline-flex relative select-none align-bottom', 'w-6 h-6'] - }, - input: { - class: [ - 'peer', - - // Size - 'w-full ', - 'h-full', - - // Position - 'absolute', - 'top-0 left-0', - 'z-10', - - // Spacing - 'p-0', - 'm-0', - - // Shape - 'opacity-0', - 'rounded-md', - 'outline-none', - 'border-2 border-surface-200 dark:border-surface-700', - - // Misc - 'appearance-none', - 'cursor-pointer' - ] - }, - box: ({ props, context }) => ({ - class: [ - // Alignment - 'flex', - 'items-center', - 'justify-center', - - // Size - 'w-6', - 'h-6', - - // Shape - 'rounded-md', - 'border-2', - - // Colors - { - 'border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked, - 'border-primary bg-primary': context.checked - }, - - // States - { - 'peer-hover:border-primary': !props.disabled && !context.checked, - 'peer-hover:bg-primary-hover peer-hover:border-primary-hover': !props.disabled && context.checked, - 'peer-focus-visible:border-primary-500 dark:peer-focus-visible:border-primary-400 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-400/20 dark:peer-focus-visible:ring-primary-300/20': !props.disabled, - 'cursor-default opacity-60': props.disabled - }, - - // Invalid State - { 'border-red-500 dark:border-red-400': props.invalid }, - - // Transitions - 'transition-colors', - 'duration-200' - ] - }), - checkicon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - 'text-white dark:text-surface-900', - - // Transitions - 'transition-all', - 'duration-200' - ] - }, - uncheckicon: { - class: [ - // Font - 'text-base leading-none', - - // Size - 'w-4', - 'h-4', - - // Colors - 'text-white dark:text-surface-900', - - // Transitions - 'transition-all', - 'duration-200' - ] - } -}; diff --git a/infra/nginx/nginx.conf b/infra/nginx/nginx.conf index 6bbb695..63d9f09 100644 --- a/infra/nginx/nginx.conf +++ b/infra/nginx/nginx.conf @@ -1,4 +1,4 @@ -upstream ui { +upstream web { server $WEB:$WEB_PORT; } @@ -16,7 +16,7 @@ server { listen 80; location / { - proxy_pass http://ui; + proxy_pass http://web; } location /api/auth { diff --git a/libs/guards/src/lib/auth.guard.ts b/libs/guards/src/lib/auth.guard.ts index 122c890..41b1eff 100644 --- a/libs/guards/src/lib/auth.guard.ts +++ b/libs/guards/src/lib/auth.guard.ts @@ -1,22 +1,29 @@ -import { CanActivate, ExecutionContext, Inject, Injectable } from '@nestjs/common'; -import { ClientProxy } from '@nestjs/microservices'; +import { CanActivate, ExecutionContext, Inject, Injectable, OnModuleInit } from '@nestjs/common'; +import { ClientGrpc } from '@nestjs/microservices'; import { firstValueFrom } from 'rxjs'; import { Request } from 'express'; +import { AUTH_SERVICE_NAME, AuthServiceClient } from '@henshi/types'; @Injectable() -export class AuthGuard implements CanActivate { +export class AuthGuard implements OnModuleInit, CanActivate { + private authService: AuthServiceClient; + constructor( - @Inject('AUTH_SERVICE') - private readonly authClient: ClientProxy, + @Inject(AUTH_SERVICE_NAME) + private readonly authClient: ClientGrpc, ) {} + onModuleInit() { + this.authService = this.authClient.getService(AUTH_SERVICE_NAME); + } + async canActivate(context: ExecutionContext): Promise { const req: Request = context.switchToHttp().getRequest(); try { - const user = await firstValueFrom(this.authClient.send('me', { jwt: req.cookies.access_token })); + const { user } = await firstValueFrom(this.authService.me({ jwt: req.cookies.access_token })); req.user = user; - return user; + return true; } catch (err) { return false; } diff --git a/libs/types/package.json b/libs/types/package.json index a65c79a..357a96a 100644 --- a/libs/types/package.json +++ b/libs/types/package.json @@ -2,13 +2,19 @@ "name": "@henshi/types", "version": "0.0.1", "scripts": { - "build": "rm -rf dist && tsc" + "build": "rm -rf dist && tsc", + "proto": "protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=nestJs=true --ts_proto_opt=oneof=unions --ts_proto_opt=unrecognizedEnum=false --ts_proto_opt=stringEnums=true --ts_proto_opt=useDate=true --ts_proto_opt=exportCommonSymbols=false --ts_proto_out=./src/lib/proto/generated ./src/lib/proto/*.proto && pnpm build" }, "dependencies": { - "class-validator": "^0.14.1" + "class-validator": "^0.14.1", + "protobufjs": "^7.3.0" }, "type": "commonjs", "main": "dist/index.js", "typings": "dist/index.d.ts", - "private": true + "private": true, + "devDependencies": { + "@types/protobufjs": "^6.0.0", + "ts-proto": "^1.156.2" + } } \ No newline at end of file diff --git a/libs/types/src/index.ts b/libs/types/src/index.ts index aee4542..f0ddeaa 100644 --- a/libs/types/src/index.ts +++ b/libs/types/src/index.ts @@ -1,3 +1,2 @@ export * from './lib/dtos'; -export * from './lib/models'; -export * from './lib/enums'; +export * from './lib/proto'; diff --git a/libs/types/src/lib/enums/index.ts b/libs/types/src/lib/enums/index.ts index 7c94d49..e69de29 100644 --- a/libs/types/src/lib/enums/index.ts +++ b/libs/types/src/lib/enums/index.ts @@ -1 +0,0 @@ -export * from './user-role.enum'; diff --git a/libs/types/src/lib/enums/user-role.enum.ts b/libs/types/src/lib/enums/user-role.enum.ts deleted file mode 100644 index 509dced..0000000 --- a/libs/types/src/lib/enums/user-role.enum.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum UserRole { - FREE_USER = 'FREE_USER', - ADMIN = 'ADMIN', -} diff --git a/libs/types/src/lib/models/index.ts b/libs/types/src/lib/models/index.ts index 5a670ce..e69de29 100644 --- a/libs/types/src/lib/models/index.ts +++ b/libs/types/src/lib/models/index.ts @@ -1 +0,0 @@ -export * from './user.model'; diff --git a/libs/types/src/lib/models/user.model.ts b/libs/types/src/lib/models/user.model.ts deleted file mode 100644 index 031a315..0000000 --- a/libs/types/src/lib/models/user.model.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { UserRole } from '../enums/user-role.enum'; - -export class User { - id: string; - name: string; - email: string; - password: string; - role: UserRole; - emailConfirmed: boolean; - refreshToken?: string; - createdAt: Date; - updatedAt: Date; -} diff --git a/libs/types/src/lib/proto/auth.proto b/libs/types/src/lib/proto/auth.proto new file mode 100644 index 0000000..f522810 --- /dev/null +++ b/libs/types/src/lib/proto/auth.proto @@ -0,0 +1,25 @@ +syntax = 'proto3'; + +package auth; + +service AuthService { + rpc Me(MeRequest) returns (JwtUserOrUndefined) {} +} + +message MeRequest { + optional string jwt = 1; +} + +message JwtUser { + string id = 1; + string name = 2; + string email = 3; + string role = 4; + bool emailConfirmed = 5; + uint32 iat = 6; + uint32 exp = 7; +} + +message JwtUserOrUndefined { + optional JwtUser user = 1; +} \ No newline at end of file diff --git a/libs/types/src/lib/proto/generated/google/protobuf/empty.ts b/libs/types/src/lib/proto/generated/google/protobuf/empty.ts new file mode 100644 index 0000000..2277702 --- /dev/null +++ b/libs/types/src/lib/proto/generated/google/protobuf/empty.ts @@ -0,0 +1,15 @@ +/* eslint-disable */ + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + */ +export interface Empty { +} + +export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf"; diff --git a/libs/types/src/lib/proto/generated/google/protobuf/struct.ts b/libs/types/src/lib/proto/generated/google/protobuf/struct.ts new file mode 100644 index 0000000..c03a677 --- /dev/null +++ b/libs/types/src/lib/proto/generated/google/protobuf/struct.ts @@ -0,0 +1,155 @@ +/* eslint-disable */ +import { wrappers } from "protobufjs"; + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + */ +export enum NullValue { + /** NULL_VALUE - Null value. */ + NULL_VALUE = "NULL_VALUE", +} + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + */ +export interface Struct { + /** Unordered map of dynamically typed values. */ + fields: { [key: string]: any | undefined }; +} + +export interface Struct_FieldsEntry { + key: string; + value: any | undefined; +} + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of these + * variants. Absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + */ +export interface Value { + kind?: + | { $case: "nullValue"; nullValue: NullValue } + | { $case: "numberValue"; numberValue: number } + | { $case: "stringValue"; stringValue: string } + | { $case: "boolValue"; boolValue: boolean } + | { $case: "structValue"; structValue: { [key: string]: any } | undefined } + | { $case: "listValue"; listValue: Array | undefined } + | undefined; +} + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + */ +export interface ListValue { + /** Repeated field of dynamically typed values. */ + values: any[]; +} + +export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf"; + +function createBaseStruct(): Struct { + return { fields: {} }; +} + +export const Struct = { + wrap(object: { [key: string]: any } | undefined): Struct { + const struct = createBaseStruct(); + if (object !== undefined) { + Object.keys(object).forEach((key) => { + struct.fields[key] = Value.wrap(object[key]); + }); + } + return struct; + }, + + unwrap(message: Struct): { [key: string]: any } { + const object: { [key: string]: any } = {}; + if (message.fields) { + Object.keys(message.fields).forEach((key) => { + object[key] = Value.unwrap(message.fields[key]); + }); + } + return object; + }, +}; + +function createBaseValue(): Value { + return { kind: undefined }; +} + +export const Value = { + wrap(value: any): Value { + const result = {} as any; + if (value === null) { + result.nullValue = NullValue.NULL_VALUE; + } else if (typeof value === "boolean") { + result.boolValue = value; + } else if (typeof value === "number") { + result.numberValue = value; + } else if (typeof value === "string") { + result.stringValue = value; + } else if (Array.isArray(value)) { + result.listValue = ListValue.wrap(value); + } else if (typeof value === "object") { + result.structValue = Struct.wrap(value); + } else if (typeof value !== "undefined") { + throw new Error("Unsupported any value type: " + typeof value); + } + return result; + }, + + unwrap(message: any): string | number | boolean | Object | null | Array | undefined { + if (message?.hasOwnProperty("stringValue") && message.stringValue !== undefined) { + return message.stringValue; + } else if (message?.hasOwnProperty("numberValue") && message?.numberValue !== undefined) { + return message.numberValue; + } else if (message?.hasOwnProperty("boolValue") && message?.boolValue !== undefined) { + return message.boolValue; + } else if (message?.hasOwnProperty("structValue") && message?.structValue !== undefined) { + return Struct.unwrap(message.structValue as any); + } else if (message?.hasOwnProperty("listValue") && message?.listValue !== undefined) { + return ListValue.unwrap(message.listValue); + } else if (message?.hasOwnProperty("nullValue") && message?.nullValue !== undefined) { + return null; + } + return undefined; + }, +}; + +function createBaseListValue(): ListValue { + return { values: [] }; +} + +export const ListValue = { + wrap(array: Array | undefined): ListValue { + const result = createBaseListValue(); + result.values = (array ?? []).map(Value.wrap); + return result; + }, + + unwrap(message: ListValue): Array { + if (message?.hasOwnProperty("values") && Array.isArray(message.values)) { + return message.values.map(Value.unwrap); + } else { + return message as any; + } + }, +}; + +wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any; diff --git a/libs/types/src/lib/proto/generated/google/protobuf/timestamp.ts b/libs/types/src/lib/proto/generated/google/protobuf/timestamp.ts new file mode 100644 index 0000000..eb4d14c --- /dev/null +++ b/libs/types/src/lib/proto/generated/google/protobuf/timestamp.ts @@ -0,0 +1,110 @@ +/* eslint-disable */ + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: number; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} + +export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf"; diff --git a/libs/types/src/lib/proto/generated/src/lib/proto/auth.ts b/libs/types/src/lib/proto/generated/src/lib/proto/auth.ts new file mode 100644 index 0000000..8c9df9a --- /dev/null +++ b/libs/types/src/lib/proto/generated/src/lib/proto/auth.ts @@ -0,0 +1,48 @@ +/* eslint-disable */ +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; +import { Observable } from "rxjs"; + +export interface MeRequest { + jwt?: string | undefined; +} + +export interface JwtUser { + id: string; + name: string; + email: string; + role: string; + emailConfirmed: boolean; + iat: number; + exp: number; +} + +export interface JwtUserOrUndefined { + user?: JwtUser | undefined; +} + +export const AUTH_PACKAGE_NAME = "auth"; + +export interface AuthServiceClient { + me(request: MeRequest): Observable; +} + +export interface AuthServiceController { + me(request: MeRequest): Promise | Observable | JwtUserOrUndefined; +} + +export function AuthServiceControllerMethods() { + return function (constructor: Function) { + const grpcMethods: string[] = ["me"]; + for (const method of grpcMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor); + } + const grpcStreamMethods: string[] = []; + for (const method of grpcStreamMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor); + } + }; +} + +export const AUTH_SERVICE_NAME = "AuthService"; diff --git a/libs/types/src/lib/proto/generated/src/lib/proto/users.ts b/libs/types/src/lib/proto/generated/src/lib/proto/users.ts new file mode 100644 index 0000000..380805d --- /dev/null +++ b/libs/types/src/lib/proto/generated/src/lib/proto/users.ts @@ -0,0 +1,87 @@ +/* eslint-disable */ +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; +import { wrappers } from "protobufjs"; +import { Observable } from "rxjs"; +import { Empty } from "../../../google/protobuf/empty"; + +export enum UserRole { + FREE_USER = "FREE_USER", + ADMIN = "ADMIN", +} + +export interface OptionalUser { + id?: string | undefined; + name?: string | undefined; + email?: string | undefined; + role?: UserRole | undefined; + emailConfirmed?: boolean | undefined; + refreshToken?: string | undefined; + createdAt?: Date | undefined; + updatedAt?: Date | undefined; +} + +export interface CreateUserRequest { + name: string; + email: string; + password: string; +} + +export interface User { + id: string; + name: string; + email: string; + password: string; + role: UserRole; + emailConfirmed: boolean; + refreshToken?: string | undefined; + createdAt: Date | undefined; + updatedAt: Date | undefined; +} + +export interface UserOrUndefined { + user?: User | undefined; +} + +export const USERS_PACKAGE_NAME = "users"; + +wrappers[".google.protobuf.Timestamp"] = { + fromObject(value: Date) { + return { seconds: value.getTime() / 1000, nanos: (value.getTime() % 1000) * 1e6 }; + }, + toObject(message: { seconds: number; nanos: number }) { + return new Date(message.seconds * 1000 + message.nanos / 1e6); + }, +} as any; + +export interface UsersServiceClient { + findOne(request: OptionalUser): Observable; + + create(request: CreateUserRequest): Observable; + + update(request: OptionalUser): Observable; +} + +export interface UsersServiceController { + findOne(request: OptionalUser): Promise | Observable | UserOrUndefined; + + create(request: CreateUserRequest): Promise | Observable | UserOrUndefined; + + update(request: OptionalUser): void; +} + +export function UsersServiceControllerMethods() { + return function (constructor: Function) { + const grpcMethods: string[] = ["findOne", "create", "update"]; + for (const method of grpcMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor); + } + const grpcStreamMethods: string[] = []; + for (const method of grpcStreamMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor); + } + }; +} + +export const USERS_SERVICE_NAME = "UsersService"; diff --git a/libs/types/src/lib/proto/index.ts b/libs/types/src/lib/proto/index.ts new file mode 100644 index 0000000..ba2edcb --- /dev/null +++ b/libs/types/src/lib/proto/index.ts @@ -0,0 +1,2 @@ +export * from './generated/src/lib/proto/auth'; +export * from './generated/src/lib/proto/users'; diff --git a/libs/types/src/lib/proto/users.proto b/libs/types/src/lib/proto/users.proto new file mode 100644 index 0000000..f40e676 --- /dev/null +++ b/libs/types/src/lib/proto/users.proto @@ -0,0 +1,50 @@ +syntax = 'proto3'; + +package users; + +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +service UsersService { + rpc FindOne(OptionalUser) returns (UserOrUndefined) {} + rpc Create(CreateUserRequest) returns (UserOrUndefined) {} + rpc Update(OptionalUser) returns (google.protobuf.Empty) {} +} + +message OptionalUser { + optional string id = 1; + optional string name = 2; + optional string email = 3; + optional UserRole role = 4; + optional bool emailConfirmed = 5; + optional string refreshToken = 6; + optional google.protobuf.Timestamp createdAt = 7; + optional google.protobuf.Timestamp updatedAt = 8; +} + +message CreateUserRequest { + string name = 1; + string email = 2; + string password = 3; +} + +enum UserRole { + FREE_USER = 0; + ADMIN = 1; +} + +message User { + string id = 1; + string name = 2; + string email = 3; + string password = 4; + UserRole role = 5; + bool emailConfirmed = 6; + optional string refreshToken = 7; + google.protobuf.Timestamp createdAt = 8; + google.protobuf.Timestamp updatedAt = 9; +} + +message UserOrUndefined { + optional User user = 1; +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7eaaaec..f3beb27 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,36 +26,42 @@ importers: apps/auth-service: dependencies: + '@grpc/grpc-js': + specifier: ^1.10.8 + version: 1.10.8 + '@grpc/proto-loader': + specifier: ^0.7.13 + version: 0.7.13 '@henshi/types': specifier: workspace:* version: link:../../libs/types '@nestjs/cache-manager': specifier: ^2.2.2 - version: 2.2.2(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.5.3)(rxjs@7.8.1) + version: 2.2.2(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.5.3)(rxjs@7.8.1) '@nestjs/common': specifier: ^10.3.8 - version: 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/config': specifier: ^3.2.2 - version: 3.2.2(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(rxjs@7.8.1) + version: 3.2.2(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(rxjs@7.8.1) '@nestjs/core': specifier: ^10.0.0 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/jwt': specifier: ^10.2.0 - version: 10.2.0(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)) + version: 10.2.0(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)) '@nestjs/mapped-types': specifier: ^2.0.5 - version: 2.0.5(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-validator@0.14.1)(reflect-metadata@0.2.2) + version: 2.0.5(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2) '@nestjs/microservices': specifier: ^10.3.8 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(@grpc/grpc-js@1.10.8)(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/passport': specifier: ^10.0.3 - version: 10.0.3(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(passport@0.7.0) + version: 10.0.3(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(passport@0.7.0) '@nestjs/platform-express': specifier: ^10.0.0 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8) + version: 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8) argon2: specifier: ^0.40.3 version: 0.40.3 @@ -95,7 +101,7 @@ importers: version: 10.1.1(chokidar@3.6.0)(typescript@5.4.5) '@nestjs/testing': specifier: ^10.0.0 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)) + version: 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8(@grpc/grpc-js@1.10.8)(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)) '@types/cache-manager': specifier: ^4.0.6 version: 4.0.6 @@ -165,6 +171,12 @@ importers: apps/users-service: dependencies: + '@grpc/grpc-js': + specifier: ^1.10.8 + version: 1.10.8 + '@grpc/proto-loader': + specifier: ^0.7.13 + version: 0.7.13 '@henshi/decorators': specifier: workspace:* version: link:../../libs/decorators @@ -176,25 +188,28 @@ importers: version: link:../../libs/types '@nestjs/common': specifier: ^10.0.0 - version: 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/config': specifier: ^3.2.2 - version: 3.2.2(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(rxjs@7.8.1) + version: 3.2.2(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(rxjs@7.8.1) '@nestjs/core': specifier: ^10.0.0 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/mapped-types': specifier: ^2.0.5 - version: 2.0.5(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-validator@0.14.1)(reflect-metadata@0.2.2) + version: 2.0.5(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2) '@nestjs/microservices': specifier: ^10.3.8 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(@grpc/grpc-js@1.10.8)(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/platform-express': specifier: ^10.0.0 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8) + version: 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8) '@nestjs/typeorm': specifier: ^10.0.2 - version: 10.0.2(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.11.5)(redis@4.6.14)(ts-node@10.9.2(@types/node@20.13.0)(typescript@5.4.5))) + version: 10.0.2(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.11.5)(redis@4.6.14)(ts-node@10.9.2(@types/node@20.13.0)(typescript@5.4.5))) + class-transformer: + specifier: ^0.5.1 + version: 0.5.1 class-validator: specifier: ^0.14.1 version: 0.14.1 @@ -209,7 +224,7 @@ importers: version: 7.1.0 nestjs-paginate: specifier: ^8.6.2 - version: 8.6.2(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/swagger@7.3.1(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-validator@0.14.1)(reflect-metadata@0.2.2))(express@4.19.2)(fastify@4.27.0)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.11.5)(redis@4.6.14)(ts-node@10.9.2(@types/node@20.13.0)(typescript@5.4.5))) + version: 8.6.2(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/swagger@7.3.1(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2))(express@4.19.2)(fastify@4.27.0)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.11.5)(redis@4.6.14)(ts-node@10.9.2(@types/node@20.13.0)(typescript@5.4.5))) pg: specifier: ^8.11.5 version: 8.11.5 @@ -231,7 +246,7 @@ importers: version: 10.1.1(chokidar@3.6.0)(typescript@5.4.5) '@nestjs/testing': specifier: ^10.0.0 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)) + version: 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8(@grpc/grpc-js@1.10.8)(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)) '@types/express': specifier: ^4.17.17 version: 4.17.21 @@ -280,6 +295,9 @@ importers: ts-node: specifier: ^10.9.1 version: 10.9.2(@types/node@20.13.0)(typescript@5.4.5) + ts-proto: + specifier: ^1.156.2 + version: 1.156.2 tsconfig-paths: specifier: ^4.2.0 version: 4.2.0 @@ -352,7 +370,7 @@ importers: version: link:../types '@nestjs/common': specifier: ^10.0.2 - version: 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) libs/guards: dependencies: @@ -364,13 +382,13 @@ importers: version: link:../types '@nestjs/common': specifier: ^10.3.8 - version: 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/core': specifier: ^10.0.0 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/microservices': specifier: ^10.3.8 - version: 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + version: 10.3.8(@grpc/grpc-js@1.10.8)(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) express: specifier: ^4.19.2 version: 4.19.2 @@ -383,6 +401,16 @@ importers: class-validator: specifier: ^0.14.1 version: 0.14.1 + protobufjs: + specifier: ^7.3.0 + version: 7.3.0 + devDependencies: + '@types/protobufjs': + specifier: ^6.0.0 + version: 6.0.0 + ts-proto: + specifier: ^1.156.2 + version: 1.156.2 packages: @@ -878,6 +906,15 @@ packages: '@floating-ui/utils@0.2.2': resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==} + '@grpc/grpc-js@1.10.8': + resolution: {integrity: sha512-vYVqYzHicDqyKB+NQhAc54I1QWCBLCrYG6unqOIcBTHx+7x8C9lcoLj3KVJXs2VB4lUbpWY+Kk9NipcbXYWmvg==} + engines: {node: '>=12.10.0'} + + '@grpc/proto-loader@0.7.13': + resolution: {integrity: sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==} + engines: {node: '>=6'} + hasBin: true + '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} @@ -1004,6 +1041,9 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + '@js-sdsl/ordered-map@4.4.2': + resolution: {integrity: sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==} + '@koa/router@12.0.1': resolution: {integrity: sha512-ribfPYfHb+Uw3b27Eiw6NPqjhIhTpVFzEWLwyc/1Xp+DCdwRRyIlAUODX+9bPARF6aQtUu1+/PHzdNvRzcs/+Q==} engines: {node: '>= 12'} @@ -1485,6 +1525,36 @@ packages: '@polka/url@1.0.0-next.25': resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==} + '@protobufjs/aspromise@1.1.2': + resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} + + '@protobufjs/base64@1.1.2': + resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} + + '@protobufjs/codegen@2.0.4': + resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==} + + '@protobufjs/eventemitter@1.1.0': + resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==} + + '@protobufjs/fetch@1.1.0': + resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==} + + '@protobufjs/float@1.0.2': + resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} + + '@protobufjs/inquire@1.1.0': + resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==} + + '@protobufjs/path@1.1.2': + resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} + + '@protobufjs/pool@1.1.0': + resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} + + '@protobufjs/utf8@1.1.0': + resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} + '@redis/bloom@1.2.0': resolution: {integrity: sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==} peerDependencies: @@ -1836,6 +1906,10 @@ packages: '@types/passport@1.0.16': resolution: {integrity: sha512-FD0qD5hbPWQzaM0wHUnJ/T0BBCJBxCeemtnCwc/ThhTg3x9jfrAcRUmj5Dopza+MfFS9acTe3wk7rcVnRIp/0A==} + '@types/protobufjs@6.0.0': + resolution: {integrity: sha512-A27RDExpAf3rdDjIrHKiJK6x8kqqJ4CmoChwtipfhVAn1p7+wviQFFP7dppn8FslSbHtQeVPvi8wNKkDjSYjHw==} + deprecated: This is a stub types definition for protobufjs (https://github.com/dcodeIO/ProtoBuf.js). protobufjs provides its own type definitions, so you don't need @types/protobufjs installed! + '@types/qs@6.9.15': resolution: {integrity: sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==} @@ -2651,6 +2725,10 @@ packages: caniuse-lite@1.0.30001625: resolution: {integrity: sha512-4KE9N2gcRH+HQhpeiRZXd+1niLB/XNLAhSy4z7fI8EzcbcPoAqjNInxVHTiTwWfTIV4w096XG8OtCOCQQKPv3w==} + case-anything@2.1.13: + resolution: {integrity: sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==} + engines: {node: '>=12.13'} + chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -2696,6 +2774,9 @@ packages: cjs-module-lexer@1.3.1: resolution: {integrity: sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==} + class-transformer@0.5.1: + resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==} + class-validator@0.14.1: resolution: {integrity: sha512-2VEG9JICxIqTpoK1eMzZqaV+u/EiwEJkMGzTrZf6sU/fwsnOITVgYJ8yojSy6CaXtO9V0Cc6ZQZ8h8m4UBuLwQ==} @@ -3168,6 +3249,9 @@ packages: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} + dprint-node@1.0.8: + resolution: {integrity: sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg==} + duplexer@0.1.2: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} @@ -4388,6 +4472,9 @@ packages: lodash-es@4.17.21: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + lodash.clonedeep@4.5.0: resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} @@ -4434,6 +4521,9 @@ packages: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} + long@5.2.3: + resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==} + lru-cache@10.2.2: resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} engines: {node: 14 || >=16.14} @@ -5424,6 +5514,10 @@ packages: property-expr@2.0.6: resolution: {integrity: sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==} + protobufjs@7.3.0: + resolution: {integrity: sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==} + engines: {node: '>=12.0.0'} + protocols@2.0.1: resolution: {integrity: sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==} @@ -6129,6 +6223,16 @@ packages: '@swc/wasm': optional: true + ts-poet@6.9.0: + resolution: {integrity: sha512-roe6W6MeZmCjRmppyfOURklO5tQFQ6Sg7swURKkwYJvV7dbGCrK28um5+51iW3twdPRKtwarqFAVMU6G1mvnuQ==} + + ts-proto-descriptors@1.15.0: + resolution: {integrity: sha512-TYyJ7+H+7Jsqawdv+mfsEpZPTIj9siDHS6EMCzG/z3b/PZiphsX+mWtqFfFVe5/N0Th6V3elK9lQqjnrgTOfrg==} + + ts-proto@1.156.2: + resolution: {integrity: sha512-0ZAbGmfvB2R79QJfpTIk56T8xM4k9ZS+z77517HDpuFZFizCMceCIE3IhdYQWbmP1oSYLzw0AeVbVHi2PIigKQ==} + hasBin: true + tsconfig-paths-webpack-plugin@4.1.0: resolution: {integrity: sha512-xWFISjviPydmtmgeUAuXp4N1fky+VCtfhOkDUFIv5ea7p4wuTomI4QTrXvFBX2S4jZsmyTSrStQl+E+4w+RzxA==} engines: {node: '>=10.13.0'} @@ -7279,6 +7383,18 @@ snapshots: '@floating-ui/utils@0.2.2': {} + '@grpc/grpc-js@1.10.8': + dependencies: + '@grpc/proto-loader': 0.7.13 + '@js-sdsl/ordered-map': 4.4.2 + + '@grpc/proto-loader@0.7.13': + dependencies: + lodash.camelcase: 4.3.0 + long: 5.2.3 + protobufjs: 7.3.0 + yargs: 17.7.2 + '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 @@ -7517,6 +7633,8 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.4.15 + '@js-sdsl/ordered-map@4.4.2': {} + '@koa/router@12.0.1': dependencies: debug: 4.3.5 @@ -7558,10 +7676,10 @@ snapshots: '@microsoft/tsdoc@0.14.2': {} - '@nestjs/cache-manager@2.2.2(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.5.3)(rxjs@7.8.1)': + '@nestjs/cache-manager@2.2.2(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.5.3)(rxjs@7.8.1)': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) cache-manager: 5.5.3 rxjs: 7.8.1 @@ -7594,7 +7712,7 @@ snapshots: - uglify-js - webpack-cli - '@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)': + '@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)': dependencies: iterare: 1.2.1 reflect-metadata: 0.2.2 @@ -7602,20 +7720,21 @@ snapshots: tslib: 2.6.2 uid: 2.0.2 optionalDependencies: + class-transformer: 0.5.1 class-validator: 0.14.1 - '@nestjs/config@3.2.2(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(rxjs@7.8.1)': + '@nestjs/config@3.2.2(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(rxjs@7.8.1)': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) dotenv: 16.4.5 dotenv-expand: 10.0.0 lodash: 4.17.21 rxjs: 7.8.1 uuid: 9.0.1 - '@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1)': + '@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1)': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nuxtjs/opencollective': 0.3.2(encoding@0.1.13) fast-safe-stringify: 2.1.1 iterare: 1.2.1 @@ -7625,45 +7744,47 @@ snapshots: tslib: 2.6.2 uid: 2.0.2 optionalDependencies: - '@nestjs/microservices': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/platform-express': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8) + '@nestjs/microservices': 10.3.8(@grpc/grpc-js@1.10.8)(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/platform-express': 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8) transitivePeerDependencies: - encoding - '@nestjs/jwt@10.2.0(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))': + '@nestjs/jwt@10.2.0(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@types/jsonwebtoken': 9.0.5 jsonwebtoken: 9.0.2 - '@nestjs/mapped-types@2.0.5(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-validator@0.14.1)(reflect-metadata@0.2.2)': + '@nestjs/mapped-types@2.0.5(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) reflect-metadata: 0.2.2 optionalDependencies: + class-transformer: 0.5.1 class-validator: 0.14.1 - '@nestjs/microservices@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)': + '@nestjs/microservices@10.3.8(@grpc/grpc-js@1.10.8)(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) iterare: 1.2.1 reflect-metadata: 0.2.2 rxjs: 7.8.1 tslib: 2.6.2 optionalDependencies: + '@grpc/grpc-js': 1.10.8 cache-manager: 5.5.3 ioredis: 5.4.1 - '@nestjs/passport@10.0.3(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(passport@0.7.0)': + '@nestjs/passport@10.0.3(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(passport@0.7.0)': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) passport: 0.7.0 - '@nestjs/platform-express@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)': + '@nestjs/platform-express@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) body-parser: 1.20.2 cors: 2.8.5 express: 4.19.2 @@ -7694,33 +7815,34 @@ snapshots: transitivePeerDependencies: - chokidar - '@nestjs/swagger@7.3.1(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-validator@0.14.1)(reflect-metadata@0.2.2)': + '@nestjs/swagger@7.3.1(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)': dependencies: '@microsoft/tsdoc': 0.14.2 - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/mapped-types': 2.0.5(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-validator@0.14.1)(reflect-metadata@0.2.2) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/mapped-types': 2.0.5(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2) js-yaml: 4.1.0 lodash: 4.17.21 path-to-regexp: 3.2.0 reflect-metadata: 0.2.2 swagger-ui-dist: 5.11.2 optionalDependencies: + class-transformer: 0.5.1 class-validator: 0.14.1 - '@nestjs/testing@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8))': + '@nestjs/testing@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8(@grpc/grpc-js@1.10.8)(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8))': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) tslib: 2.6.2 optionalDependencies: - '@nestjs/microservices': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/platform-express': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8) + '@nestjs/microservices': 10.3.8(@grpc/grpc-js@1.10.8)(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8)(cache-manager@5.5.3)(ioredis@5.4.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/platform-express': 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8) - '@nestjs/typeorm@10.0.2(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.11.5)(redis@4.6.14)(ts-node@10.9.2(@types/node@20.13.0)(typescript@5.4.5)))': + '@nestjs/typeorm@10.0.2(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.11.5)(redis@4.6.14)(ts-node@10.9.2(@types/node@20.13.0)(typescript@5.4.5)))': dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/core': 10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) reflect-metadata: 0.2.2 rxjs: 7.8.1 typeorm: 0.3.20(ioredis@5.4.1)(pg@8.11.5)(redis@4.6.14)(ts-node@10.9.2(@types/node@20.13.0)(typescript@5.4.5)) @@ -8256,6 +8378,29 @@ snapshots: '@polka/url@1.0.0-next.25': {} + '@protobufjs/aspromise@1.1.2': {} + + '@protobufjs/base64@1.1.2': {} + + '@protobufjs/codegen@2.0.4': {} + + '@protobufjs/eventemitter@1.1.0': {} + + '@protobufjs/fetch@1.1.0': + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/inquire': 1.1.0 + + '@protobufjs/float@1.0.2': {} + + '@protobufjs/inquire@1.1.0': {} + + '@protobufjs/path@1.1.2': {} + + '@protobufjs/pool@1.1.0': {} + + '@protobufjs/utf8@1.1.0': {} + '@redis/bloom@1.2.0(@redis/client@1.5.16)': dependencies: '@redis/client': 1.5.16 @@ -8597,6 +8742,10 @@ snapshots: dependencies: '@types/express': 4.17.21 + '@types/protobufjs@6.0.0': + dependencies: + protobufjs: 7.3.0 + '@types/qs@6.9.15': {} '@types/range-parser@1.2.7': {} @@ -9738,6 +9887,8 @@ snapshots: caniuse-lite@1.0.30001625: {} + case-anything@2.1.13: {} + chalk@2.4.2: dependencies: ansi-styles: 3.2.1 @@ -9781,6 +9932,8 @@ snapshots: cjs-module-lexer@1.3.1: {} + class-transformer@0.5.1: {} + class-validator@0.14.1: dependencies: '@types/validator': 13.11.10 @@ -10191,6 +10344,10 @@ snapshots: dotenv@16.4.5: {} + dprint-node@1.0.8: + dependencies: + detect-libc: 1.0.3 + duplexer@0.1.2: {} eastasianwidth@0.2.0: {} @@ -11824,6 +11981,8 @@ snapshots: lodash-es@4.17.21: {} + lodash.camelcase@4.3.0: {} + lodash.clonedeep@4.5.0: {} lodash.defaults@4.2.0: {} @@ -11857,6 +12016,8 @@ snapshots: chalk: 4.1.2 is-unicode-supported: 0.1.0 + long@5.2.3: {} + lru-cache@10.2.2: {} lru-cache@5.1.1: @@ -12085,10 +12246,10 @@ snapshots: neo-async@2.6.2: {} - nestjs-paginate@8.6.2(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/swagger@7.3.1(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-validator@0.14.1)(reflect-metadata@0.2.2))(express@4.19.2)(fastify@4.27.0)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.11.5)(redis@4.6.14)(ts-node@10.9.2(@types/node@20.13.0)(typescript@5.4.5))): + nestjs-paginate@8.6.2(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/swagger@7.3.1(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2))(express@4.19.2)(fastify@4.27.0)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.11.5)(redis@4.6.14)(ts-node@10.9.2(@types/node@20.13.0)(typescript@5.4.5))): dependencies: - '@nestjs/common': 10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) - '@nestjs/swagger': 7.3.1(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-validator@0.14.1)(reflect-metadata@0.2.2) + '@nestjs/common': 10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/swagger': 7.3.1(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.8(@nestjs/common@10.3.8(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/microservices@10.3.8)(@nestjs/platform-express@10.3.8)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2) express: 4.19.2 fastify: 4.27.0 lodash: 4.17.21 @@ -13012,6 +13173,21 @@ snapshots: property-expr@2.0.6: {} + protobufjs@7.3.0: + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/base64': 1.1.2 + '@protobufjs/codegen': 2.0.4 + '@protobufjs/eventemitter': 1.1.0 + '@protobufjs/fetch': 1.1.0 + '@protobufjs/float': 1.0.2 + '@protobufjs/inquire': 1.1.0 + '@protobufjs/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.0 + '@types/node': 20.13.0 + long: 5.2.3 + protocols@2.0.1: {} proxy-addr@2.0.7: @@ -13761,6 +13937,22 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + ts-poet@6.9.0: + dependencies: + dprint-node: 1.0.8 + + ts-proto-descriptors@1.15.0: + dependencies: + long: 5.2.3 + protobufjs: 7.3.0 + + ts-proto@1.156.2: + dependencies: + case-anything: 2.1.13 + protobufjs: 7.3.0 + ts-poet: 6.9.0 + ts-proto-descriptors: 1.15.0 + tsconfig-paths-webpack-plugin@4.1.0: dependencies: chalk: 4.1.2 diff --git a/release.config.js b/release.config.js new file mode 100644 index 0000000..854ed1d --- /dev/null +++ b/release.config.js @@ -0,0 +1,16 @@ +const config = { + branches: ['main'], + plugins: [ + '@semantic-release/commit-analyzer', + '@semantic-release/release-notes-generator', + [ + '@semantic-release/git', + { + assets: ['package.json'], + }, + ], + '@semantic-release/github', + ], +}; + +module.exports = config;