chore: maintenance
This commit is contained in:
56
.fleet/settings.json
Normal file
56
.fleet/settings.json
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.ai"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.css"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.diff"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.emmet"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.git.frontend"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.xml"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.intellij"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.javascript"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.lsp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.smartMode"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.tailwindcss"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "add",
|
||||||
|
"pluginName": "fleet.vim"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -37,3 +37,5 @@ testem.log
|
|||||||
# System Files
|
# System Files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
.nx/cache
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
# Add files here to ignore them from prettier formatting
|
# Add files here to ignore them from prettier formatting
|
||||||
/dist
|
/dist
|
||||||
/coverage
|
/coverage
|
||||||
|
/.nx/cache
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../../dist/out-tsc",
|
|
||||||
"declaration": true,
|
|
||||||
"types": ["node"]
|
|
||||||
},
|
|
||||||
"include": ["../../../../libs/_internal/directives/src/**/*.ts"],
|
|
||||||
"exclude": [
|
|
||||||
"../../../../libs/_internal/directives/jest.config.ts",
|
|
||||||
"../../../../libs/_internal/directives/src/**/*.spec.ts",
|
|
||||||
"../../../../libs/_internal/directives/src/**/*.test.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../dist/out-tsc",
|
|
||||||
"declaration": true,
|
|
||||||
"types": ["node"]
|
|
||||||
},
|
|
||||||
"include": ["../../../libs/tooltip/src/**/*.ts"],
|
|
||||||
"exclude": [
|
|
||||||
"../../../libs/tooltip/jest.config.ts",
|
|
||||||
"../../../libs/tooltip/src/**/*.spec.ts",
|
|
||||||
"../../../libs/tooltip/src/**/*.test.ts",
|
|
||||||
"../../../libs/tooltip/**/*.stories.ts",
|
|
||||||
"../../../libs/tooltip/**/*.stories.js"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -2,16 +2,10 @@
|
|||||||
|
|
||||||
This library was generated with [Nx](https://nx.dev).
|
This library was generated with [Nx](https://nx.dev).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Run `nx build _internal-controllers` to build the library.
|
Run `nx build _internal-controllers` to build the library.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Running unit tests
|
## Running unit tests
|
||||||
|
|
||||||
Run `nx test _internal-controllers` to execute the unit tests via [Jest](https://jestjs.io).
|
Run `nx test _internal-controllers` to execute the unit tests via [Jest](https://jestjs.io).
|
||||||
|
|||||||
@@ -6,17 +6,23 @@
|
|||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@nx/js:tsc",
|
"executor": "@nx/js:tsc",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": [
|
||||||
|
"{options.outputPath}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/libs/_internal/styles",
|
"outputPath": "dist/libs/_internal/styles",
|
||||||
"main": "libs/_internal/styles/src/index.ts",
|
"main": "libs/_internal/styles/src/index.ts",
|
||||||
"tsConfig": "libs/_internal/styles/tsconfig.lib.json",
|
"tsConfig": "libs/_internal/styles/tsconfig.lib.json",
|
||||||
"assets": ["libs/_internal/styles/*.md"]
|
"assets": [
|
||||||
|
"libs/_internal/styles/*.md"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"executor": "@nx/linter:eslint",
|
"executor": "@nx/linter:eslint",
|
||||||
"outputs": ["{options.outputFile}"],
|
"outputs": [
|
||||||
|
"{options.outputFile}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": [
|
"lintFilePatterns": [
|
||||||
"libs/_internal/styles/**/*.ts",
|
"libs/_internal/styles/**/*.ts",
|
||||||
@@ -26,7 +32,9 @@
|
|||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"executor": "@nx/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
"outputs": [
|
||||||
|
"{workspaceRoot}/coverage/{projectRoot}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "libs/_internal/styles/jest.config.ts",
|
"jestConfig": "libs/_internal/styles/jest.config.ts",
|
||||||
"passWithNoTests": true
|
"passWithNoTests": true
|
||||||
|
|||||||
@@ -6,18 +6,24 @@
|
|||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@nx/vite:build",
|
"executor": "@nx/vite:build",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": [
|
||||||
|
"{options.outputPath}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/libs/accordion"
|
"outputPath": "dist/libs/accordion"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"publish": {
|
"publish": {
|
||||||
"command": "node tools/scripts/publish.mjs accordion {args.ver} {args.tag}",
|
"command": "node tools/scripts/publish.mjs accordion {args.ver} {args.tag}",
|
||||||
"dependsOn": ["build"]
|
"dependsOn": [
|
||||||
|
"build"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"executor": "@nx/linter:eslint",
|
"executor": "@nx/linter:eslint",
|
||||||
"outputs": ["{options.outputFile}"],
|
"outputs": [
|
||||||
|
"{options.outputFile}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": [
|
"lintFilePatterns": [
|
||||||
"libs/accordion/**/*.ts",
|
"libs/accordion/**/*.ts",
|
||||||
@@ -27,7 +33,9 @@
|
|||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"executor": "@nx/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
"outputs": [
|
||||||
|
"{workspaceRoot}/coverage/{projectRoot}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "libs/accordion/jest.config.ts",
|
"jestConfig": "libs/accordion/jest.config.ts",
|
||||||
"passWithNoTests": true
|
"passWithNoTests": true
|
||||||
@@ -40,5 +48,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tags": ["type:component", ""]
|
"tags": [
|
||||||
|
"type:component",
|
||||||
|
""
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { LitElement, TemplateResult, html } from 'lit';
|
import { LitElement, TemplateResult, html } from 'lit';
|
||||||
import { customElement, queryAssignedElements } from 'lit/decorators.js';
|
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
||||||
|
|
||||||
import AccordionComponent from './accordion.component';
|
import AccordionComponent from './accordion.component';
|
||||||
|
|
||||||
@customElement('z-accordion.group')
|
@customElement('z-accordion.group')
|
||||||
@@ -7,22 +8,19 @@ export default class AccordionGroupComponent extends LitElement {
|
|||||||
@queryAssignedElements({ selector: 'z-accordion' })
|
@queryAssignedElements({ selector: 'z-accordion' })
|
||||||
public items!: NodeListOf<AccordionComponent>;
|
public items!: NodeListOf<AccordionComponent>;
|
||||||
|
|
||||||
|
@property({ type: Boolean })
|
||||||
|
public closeOthers: boolean = false;
|
||||||
|
|
||||||
protected override firstUpdated() {
|
protected override firstUpdated() {
|
||||||
this.items.forEach((item) => {
|
this.items.forEach((item) => {
|
||||||
item.addEventListener('open', () => {
|
item.addEventListener('open', () => {
|
||||||
this.items.forEach((i) => {
|
if (this.closeOthers) {
|
||||||
if (i !== item) {
|
this.items.forEach((i: AccordionComponent) => {
|
||||||
i.open = false;
|
if (i !== item) {
|
||||||
}
|
i.open = false;
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
item.addEventListener('close', () => {
|
|
||||||
this.items.forEach((i) => {
|
|
||||||
if (i !== item) {
|
|
||||||
i.open = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,38 @@
|
|||||||
{
|
{
|
||||||
"extends": ["../../.eslintrc.json"],
|
"extends": [
|
||||||
"ignorePatterns": ["!**/*"],
|
"../../.eslintrc.json"
|
||||||
|
],
|
||||||
|
"ignorePatterns": [
|
||||||
|
"!**/*"
|
||||||
|
],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": [
|
||||||
|
"*.ts",
|
||||||
|
"*.tsx",
|
||||||
|
"*.js",
|
||||||
|
"*.jsx"
|
||||||
|
],
|
||||||
"rules": {}
|
"rules": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx"],
|
"files": [
|
||||||
|
"*.ts",
|
||||||
|
"*.tsx"
|
||||||
|
],
|
||||||
"rules": {}
|
"rules": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.js", "*.jsx"],
|
"files": [
|
||||||
|
"*.js",
|
||||||
|
"*.jsx"
|
||||||
|
],
|
||||||
"rules": {}
|
"rules": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.json"],
|
"files": [
|
||||||
|
"*.json"
|
||||||
|
],
|
||||||
"parser": "jsonc-eslint-parser",
|
"parser": "jsonc-eslint-parser",
|
||||||
"rules": {
|
"rules": {
|
||||||
"@nx/dependency-checks": "error"
|
"@nx/dependency-checks": "error"
|
||||||
|
|||||||
35
libs/container/.storybook/main.ts
Normal file
35
libs/container/.storybook/main.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import type { StorybookConfig } from '@storybook/web-components-vite';
|
||||||
|
|
||||||
|
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
||||||
|
import { mergeConfig } from 'vite';
|
||||||
|
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
|
stories: [
|
||||||
|
|
||||||
|
'../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'
|
||||||
|
],
|
||||||
|
addons: ['@storybook/addon-essentials' , '@storybook/addon-interactions' ],
|
||||||
|
framework: {
|
||||||
|
name: '@storybook/web-components-vite',
|
||||||
|
options: {
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
viteFinal: async (config) =>
|
||||||
|
mergeConfig(config, {
|
||||||
|
plugins: [nxViteTsPaths()],
|
||||||
|
}),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// To customize your Vite configuration you can use the viteFinal field.
|
||||||
|
// Check https://storybook.js.org/docs/react/builders/vite#configuration
|
||||||
|
// and https://nx.dev/packages/storybook/documents/custom-builder-configs
|
||||||
|
|
||||||
0
libs/container/.storybook/preview.ts
Normal file
0
libs/container/.storybook/preview.ts
Normal file
@@ -6,17 +6,23 @@
|
|||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@nx/js:tsc",
|
"executor": "@nx/js:tsc",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": [
|
||||||
|
"{options.outputPath}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/libs/container",
|
"outputPath": "dist/libs/container",
|
||||||
"main": "libs/container/src/index.ts",
|
"main": "libs/container/src/index.ts",
|
||||||
"tsConfig": "libs/container/tsconfig.lib.json",
|
"tsConfig": "libs/container/tsconfig.lib.json",
|
||||||
"assets": ["libs/container/*.md"]
|
"assets": [
|
||||||
|
"libs/container/*.md"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"executor": "@nx/linter:eslint",
|
"executor": "@nx/linter:eslint",
|
||||||
"outputs": ["{options.outputFile}"],
|
"outputs": [
|
||||||
|
"{options.outputFile}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": [
|
"lintFilePatterns": [
|
||||||
"libs/container/**/*.ts",
|
"libs/container/**/*.ts",
|
||||||
@@ -26,7 +32,9 @@
|
|||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"executor": "@nx/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
"outputs": [
|
||||||
|
"{workspaceRoot}/coverage/{projectRoot}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "libs/container/jest.config.ts",
|
"jestConfig": "libs/container/jest.config.ts",
|
||||||
"passWithNoTests": true
|
"passWithNoTests": true
|
||||||
@@ -37,6 +45,39 @@
|
|||||||
"codeCoverage": true
|
"codeCoverage": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"storybook": {
|
||||||
|
"executor": "@nx/storybook:storybook",
|
||||||
|
"options": {
|
||||||
|
"port": 4400,
|
||||||
|
"configDir": "libs/container/.storybook"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"ci": {
|
||||||
|
"quiet": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"build-storybook": {
|
||||||
|
"executor": "@nx/storybook:build",
|
||||||
|
"outputs": [
|
||||||
|
"{options.outputDir}"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"outputDir": "dist/storybook/container",
|
||||||
|
"configDir": "libs/container/.storybook"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"ci": {
|
||||||
|
"quiet": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c libs/container/.storybook --url=http://localhost:4400"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export * from './lib/container';
|
export * from './lib/container.component';
|
||||||
|
|||||||
45
libs/container/src/lib/container.component.stories.ts
Normal file
45
libs/container/src/lib/container.component.stories.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import { Meta, StoryObj } from '@storybook/web-components';
|
||||||
|
|
||||||
|
import { html } from 'lit';
|
||||||
|
|
||||||
|
import './container.component';
|
||||||
|
import { Container } from './container.component';
|
||||||
|
|
||||||
|
const meta: Meta<Container> = {
|
||||||
|
title: 'Design System/Atoms/Container',
|
||||||
|
component: 'z-container',
|
||||||
|
args: {
|
||||||
|
conditionalRadius: true,
|
||||||
|
radius: '12px',
|
||||||
|
},
|
||||||
|
render: (args) => html`
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
background-color: #e2e2e2;
|
||||||
|
--container--background-color: #fff;
|
||||||
|
--container--max-width: 80rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<z-container radius="${args['radius']}" ?conditional-radius="${args['conditionalRadius']}">
|
||||||
|
<div style="display: flex; column-gap: 3.5rem; padding-left: 3.5rem;">
|
||||||
|
<p style="margin: 0; padding-block: 3.5rem">
|
||||||
|
Incididunt voluptate non ea reprehenderit quis nostrud proident pariatur enim mollit esse nulla. Ex mollit mollit occaecat esse
|
||||||
|
consequat. Tempor dolor irure qui dolor proident esse voluptate excepteur dolor. Pariatur aliqua exercitation Lorem Lorem irure
|
||||||
|
occaecat amet est in nulla eu.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<img src="https://placeholder.co/350" alt="" />
|
||||||
|
</div>
|
||||||
|
</z-container>
|
||||||
|
`,
|
||||||
|
parameters: {
|
||||||
|
layout: 'fullscreen',
|
||||||
|
},
|
||||||
|
} satisfies Meta;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
|
||||||
|
type Story = StoryObj<unknown>;
|
||||||
|
|
||||||
|
export const Primary: Story = {};
|
||||||
99
libs/container/src/lib/container.component.ts
Normal file
99
libs/container/src/lib/container.component.ts
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
import { LitElement, PropertyValues, css, html, unsafeCSS } from 'lit';
|
||||||
|
import { customElement, property } from 'lit/decorators.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A container element that centers its content and has a max-width.
|
||||||
|
*
|
||||||
|
* @slot - The default slot.
|
||||||
|
* @slot img - The slot for the image.
|
||||||
|
*
|
||||||
|
* @cssproperty --container--max-width - The max-width of the container.
|
||||||
|
* @cssproperty --container--background-color - The background color of the container.
|
||||||
|
*/
|
||||||
|
@customElement('z-container')
|
||||||
|
export class Container extends LitElement {
|
||||||
|
/// Private variables ///
|
||||||
|
|
||||||
|
/// Protected variables ///
|
||||||
|
|
||||||
|
/// Public variables ///
|
||||||
|
@property() public radius: string | undefined;
|
||||||
|
@property({ type: Boolean, attribute: 'conditional-radius' }) public conditionalRadius: boolean = false;
|
||||||
|
|
||||||
|
/// constructor & lifecycle ///
|
||||||
|
protected override willUpdate(_changedProperties: PropertyValues): void {
|
||||||
|
super.willUpdate(_changedProperties);
|
||||||
|
|
||||||
|
this.updateBorderRadius();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Public methods ///
|
||||||
|
|
||||||
|
/// Protected methods ///
|
||||||
|
protected override render(): unknown {
|
||||||
|
return html`
|
||||||
|
<section>
|
||||||
|
<slot></slot>
|
||||||
|
<slot name="img"></slot>
|
||||||
|
</section>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Private methods ///
|
||||||
|
private updateBorderRadius(): void {
|
||||||
|
const hasRadius = !!this.radius;
|
||||||
|
const isConditional = this.conditionalRadius;
|
||||||
|
|
||||||
|
switch (true) {
|
||||||
|
case !hasRadius:
|
||||||
|
this.removeBorderRadius();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case hasRadius && isConditional:
|
||||||
|
this.setConditionRadius();
|
||||||
|
break;
|
||||||
|
case hasRadius && !isConditional:
|
||||||
|
this.setRadius();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private removeBorderRadius(): void {
|
||||||
|
this.style.removeProperty(Container.CSS_PROPERTY_NAMES.RADIUS);
|
||||||
|
}
|
||||||
|
|
||||||
|
private setConditionRadius(): void {
|
||||||
|
if (this.radius) {
|
||||||
|
this.style.setProperty(Container.CSS_PROPERTY_NAMES.RADIUS, `max(0px, min(${this.radius}, calc((100vw - 4px - 100%) * 9999)))`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private setRadius(): void {
|
||||||
|
if (this.radius) {
|
||||||
|
this.style.setProperty(Container.CSS_PROPERTY_NAMES.RADIUS, this.radius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Statics ///
|
||||||
|
static CSS_PROPERTY_NAMES = {
|
||||||
|
RADIUS: '--container--radius',
|
||||||
|
BACKGROUND_COLOR: '--container--background-color',
|
||||||
|
MAX_WIDTH: '--container--max-width',
|
||||||
|
};
|
||||||
|
|
||||||
|
static override get styles() {
|
||||||
|
return [
|
||||||
|
css`
|
||||||
|
:host {
|
||||||
|
width: 100%;
|
||||||
|
max-width: var(${unsafeCSS(Container.CSS_PROPERTY_NAMES.MAX_WIDTH)}, 80rem);
|
||||||
|
margin-inline: auto;
|
||||||
|
display: flex;
|
||||||
|
background-color: var(${unsafeCSS(Container.CSS_PROPERTY_NAMES.BACKGROUND_COLOR)});
|
||||||
|
border-radius: var(${unsafeCSS(Container.CSS_PROPERTY_NAMES.RADIUS)}, 0px);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export function container(): string {
|
|
||||||
return 'container';
|
|
||||||
}
|
|
||||||
@@ -17,6 +17,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "./tsconfig.spec.json"
|
"path": "./tsconfig.spec.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.storybook.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,18 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../dist/out-tsc",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"types": ["node"]
|
"types": [
|
||||||
|
"node"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts"],
|
"include": [
|
||||||
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
"src/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"jest.config.ts",
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/**/*.test.ts",
|
||||||
|
"**/*.stories.ts",
|
||||||
|
"**/*.stories.js"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
19
libs/container/tsconfig.storybook.json
Normal file
19
libs/container/tsconfig.storybook.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"emitDecoratorMetadata": true
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/**/*.test.ts"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"src/**/*.stories.ts",
|
||||||
|
"src/**/*.stories.js",
|
||||||
|
"src/**/*.stories.jsx",
|
||||||
|
"src/**/*.stories.tsx",
|
||||||
|
"src/**/*.stories.mdx",
|
||||||
|
".storybook/*.js",
|
||||||
|
".storybook/*.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"test": {
|
"test": {
|
||||||
"executor": "@nx/vite:test",
|
"executor": "@nx/vite:test",
|
||||||
"outputs": [
|
"outputs": [
|
||||||
"coverage/libs/panels/bottom-panel"
|
"{workspaceRoot}/coverage/libs/panels/bottom-panel"
|
||||||
],
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"passWithNoTests": true,
|
"passWithNoTests": true,
|
||||||
|
|||||||
@@ -6,17 +6,23 @@
|
|||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@nx/js:tsc",
|
"executor": "@nx/js:tsc",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": [
|
||||||
|
"{options.outputPath}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/libs/panels/side-panel",
|
"outputPath": "dist/libs/panels/side-panel",
|
||||||
"main": "libs/panels/side-panel/src/index.ts",
|
"main": "libs/panels/side-panel/src/index.ts",
|
||||||
"tsConfig": "libs/panels/side-panel/tsconfig.lib.json",
|
"tsConfig": "libs/panels/side-panel/tsconfig.lib.json",
|
||||||
"assets": ["libs/panels/side-panel/*.md"]
|
"assets": [
|
||||||
|
"libs/panels/side-panel/*.md"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"executor": "@nx/linter:eslint",
|
"executor": "@nx/linter:eslint",
|
||||||
"outputs": ["{options.outputFile}"],
|
"outputs": [
|
||||||
|
"{options.outputFile}"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": [
|
"lintFilePatterns": [
|
||||||
"libs/panels/side-panel/**/*.ts",
|
"libs/panels/side-panel/**/*.ts",
|
||||||
@@ -26,7 +32,9 @@
|
|||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"executor": "@nx/vite:test",
|
"executor": "@nx/vite:test",
|
||||||
"outputs": ["coverage/libs/panels/side-panel"],
|
"outputs": [
|
||||||
|
"{workspaceRoot}/coverage/libs/panels/side-panel"
|
||||||
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"passWithNoTests": true,
|
"passWithNoTests": true,
|
||||||
"reportsDirectory": "../../../coverage/libs/panels/side-panel"
|
"reportsDirectory": "../../../coverage/libs/panels/side-panel"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { panelsSidePanel } from './panels-side-panel';
|
import { SidePanel } from './panels-side-panel';
|
||||||
|
|
||||||
describe('panelsSidePanel', () => {
|
describe('panelsSidePanel', () => {
|
||||||
it('should work', () => {
|
it('should work', () => {
|
||||||
expect(panelsSidePanel()).toEqual('panels-side-panel');
|
expect(SidePanel()).toEqual('panels-side-panel');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { LitElement } from 'lit';
|
|||||||
import { customElement } from 'lit/decorators.js';
|
import { customElement } from 'lit/decorators.js';
|
||||||
|
|
||||||
@customElement('z-panels.side')
|
@customElement('z-panels.side')
|
||||||
export default class SidePanel extends LitElement {
|
export class SidePanel extends LitElement {
|
||||||
static override get styles() {
|
static override get styles() {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
"test": {
|
"test": {
|
||||||
"executor": "@nx/vite:test",
|
"executor": "@nx/vite:test",
|
||||||
"outputs": [
|
"outputs": [
|
||||||
"coverage/libs/tooltip"
|
"{workspaceRoot}/coverage/libs/tooltip"
|
||||||
],
|
],
|
||||||
"options": {
|
"options": {
|
||||||
"passWithNoTests": true,
|
"passWithNoTests": true,
|
||||||
|
|||||||
108
migrations.json
Normal file
108
migrations.json
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
{
|
||||||
|
"migrations": [
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.8.0-beta.3",
|
||||||
|
"description": "Escape $ in env variables",
|
||||||
|
"implementation": "./src/migrations/update-16-8-0/escape-dollar-sign-env-variables",
|
||||||
|
"package": "nx",
|
||||||
|
"name": "16.8.0-escape-dollar-sign-env"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "17.0.0-beta.1",
|
||||||
|
"description": "Updates the default cache directory to .nx/cache",
|
||||||
|
"implementation": "./src/migrations/update-17-0-0/move-cache-directory",
|
||||||
|
"package": "nx",
|
||||||
|
"name": "17.0.0-move-cache-directory"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "17.0.0-beta.3",
|
||||||
|
"description": "Use minimal config for tasksRunnerOptions",
|
||||||
|
"implementation": "./src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options",
|
||||||
|
"package": "nx",
|
||||||
|
"name": "17.0.0-use-minimal-config-for-tasks-runner-options"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "17.0.0-rc.1",
|
||||||
|
"description": "Migration for v17.0.0-rc.1",
|
||||||
|
"implementation": "./src/migrations/update-17-0-0/rm-default-collection-npm-scope",
|
||||||
|
"package": "nx",
|
||||||
|
"name": "rm-default-collection-npm-scope"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "17.1.0-beta.2",
|
||||||
|
"description": "Move target defaults",
|
||||||
|
"implementation": "./src/migrations/update-17-1-0/move-target-defaults",
|
||||||
|
"package": "@nx/vite",
|
||||||
|
"name": "move-target-defaults"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "17.2.0-beta.10",
|
||||||
|
"description": "Update vite config.",
|
||||||
|
"implementation": "./src/migrations/update-17-2-0/update-vite-config",
|
||||||
|
"package": "@nx/vite",
|
||||||
|
"name": "update-vite-config"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.8.2-beta.0",
|
||||||
|
"description": "Remove invalid options (strict, noInterop) for ES6 type modules.",
|
||||||
|
"factory": "./src/migrations/update-16-8-2/update-swcrc",
|
||||||
|
"package": "@nx/js",
|
||||||
|
"name": "16-8-2-update-swcrc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "17.0.2",
|
||||||
|
"description": "Remove deprecated build options",
|
||||||
|
"implementation": "./src/migrations/update-17-0-0/remove-deprecated-build-options",
|
||||||
|
"package": "@nx/js",
|
||||||
|
"name": "update-17-0-0-remove-deprecated-build-options"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "17-2-6-beta.1",
|
||||||
|
"description": "Rename workspace rules from @nx/workspace/name to @nx/workspace-name",
|
||||||
|
"implementation": "./src/migrations/update-17-2-6-rename-workspace-rules/rename-workspace-rules",
|
||||||
|
"package": "@nx/eslint-plugin",
|
||||||
|
"name": "update-17-2-6-rename-workspace-rules"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "16.8.0",
|
||||||
|
"description": "update-16-8-0-add-ignored-files",
|
||||||
|
"implementation": "./src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files",
|
||||||
|
"package": "@nx/linter",
|
||||||
|
"name": "update-16-8-0-add-ignored-files"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "17.0.0-beta.7",
|
||||||
|
"description": "update-17-0-0-rename-to-eslint",
|
||||||
|
"implementation": "./src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint",
|
||||||
|
"package": "@nx/linter",
|
||||||
|
"name": "update-17-0-0-rename-to-eslint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "17.1.0-beta.1",
|
||||||
|
"description": "Updates for @typescript-utils/utils v6.9.1+",
|
||||||
|
"implementation": "./src/migrations/update-17-1-0/update-typescript-eslint",
|
||||||
|
"package": "@nx/linter",
|
||||||
|
"name": "update-typescript-eslint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "17.2.0-beta.0",
|
||||||
|
"description": "Simplify eslintFilePatterns",
|
||||||
|
"implementation": "./src/migrations/update-17-2-0/simplify-eslint-patterns",
|
||||||
|
"package": "@nx/linter",
|
||||||
|
"name": "simplify-eslint-patterns"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "17.1.0-beta.2",
|
||||||
|
"description": "Move jest executor options to nx.json targetDefaults",
|
||||||
|
"implementation": "./src/migrations/update-17-1-0/move-options-to-target-defaults",
|
||||||
|
"package": "@nx/jest",
|
||||||
|
"name": "move-options-to-target-defaults"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
29
nx.json
29
nx.json
@@ -1,19 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
||||||
"tasksRunnerOptions": {
|
|
||||||
"default": {
|
|
||||||
"runner": "nx/tasks-runners/default",
|
|
||||||
"options": {
|
|
||||||
"cacheableOperations": [
|
|
||||||
"build",
|
|
||||||
"lint",
|
|
||||||
"test",
|
|
||||||
"e2e",
|
|
||||||
"build-storybook"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"targetDefaults": {
|
"targetDefaults": {
|
||||||
"build": {
|
"build": {
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
@@ -22,21 +8,24 @@
|
|||||||
"inputs": [
|
"inputs": [
|
||||||
"production",
|
"production",
|
||||||
"^production"
|
"^production"
|
||||||
]
|
],
|
||||||
|
"cache": true
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"inputs": [
|
"inputs": [
|
||||||
"default",
|
"default",
|
||||||
"^production",
|
"^production",
|
||||||
"{workspaceRoot}/jest.preset.js"
|
"{workspaceRoot}/jest.preset.js"
|
||||||
]
|
],
|
||||||
|
"cache": true
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"inputs": [
|
"inputs": [
|
||||||
"default",
|
"default",
|
||||||
"{workspaceRoot}/.eslintrc.json",
|
"{workspaceRoot}/.eslintrc.json",
|
||||||
"{workspaceRoot}/.eslintignore"
|
"{workspaceRoot}/.eslintignore"
|
||||||
]
|
],
|
||||||
|
"cache": true
|
||||||
},
|
},
|
||||||
"build-storybook": {
|
"build-storybook": {
|
||||||
"inputs": [
|
"inputs": [
|
||||||
@@ -44,7 +33,11 @@
|
|||||||
"^production",
|
"^production",
|
||||||
"{projectRoot}/.storybook/**/*",
|
"{projectRoot}/.storybook/**/*",
|
||||||
"{projectRoot}/tsconfig.storybook.json"
|
"{projectRoot}/tsconfig.storybook.json"
|
||||||
]
|
],
|
||||||
|
"cache": true
|
||||||
|
},
|
||||||
|
"e2e": {
|
||||||
|
"cache": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"namedInputs": {
|
"namedInputs": {
|
||||||
|
|||||||
79
package.json
79
package.json
@@ -5,51 +5,52 @@
|
|||||||
"scripts": {},
|
"scripts": {},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lit": "^2.8.0",
|
"lit": "^3.1.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"tslib": "^2.6.2"
|
"tslib": "^2.6.2",
|
||||||
|
"zod": "^3.22.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/plugin-proposal-decorators": "^7.22.10",
|
"@babel/plugin-proposal-decorators": "^7.23.7",
|
||||||
"@nx/eslint-plugin": "16.7.4",
|
"@nx/eslint-plugin": "17.2.8",
|
||||||
"@nx/jest": "16.7.4",
|
"@nx/jest": "17.2.8",
|
||||||
"@nx/js": "16.7.4",
|
"@nx/js": "17.2.8",
|
||||||
"@nx/linter": "16.7.4",
|
"@nx/linter": "17.2.8",
|
||||||
"@nx/storybook": "^16.7.4",
|
"@nx/storybook": "17.2.8",
|
||||||
"@nx/vite": "16.7.4",
|
"@nx/vite": "17.2.8",
|
||||||
"@nx/web": "^16.7.4",
|
"@nx/web": "17.2.8",
|
||||||
"@nx/workspace": "16.7.4",
|
"@nx/workspace": "17.2.8",
|
||||||
"@storybook/addon-essentials": "^7.3.2",
|
"@storybook/addon-essentials": "7.6.7",
|
||||||
"@storybook/addon-interactions": "^7.3.2",
|
"@storybook/addon-interactions": "7.6.7",
|
||||||
"@storybook/core-server": "^7.3.2",
|
"@storybook/core-server": "7.6.7",
|
||||||
"@storybook/jest": "~0.2.1",
|
"@storybook/jest": "0.2.3",
|
||||||
"@storybook/test-runner": "^0.13.0",
|
"@storybook/test-runner": "0.16.0",
|
||||||
"@storybook/testing-library": "~0.2.0",
|
"@storybook/testing-library": "0.2.2",
|
||||||
"@storybook/web-components": "^7.3.2",
|
"@storybook/web-components": "^7.6.7",
|
||||||
"@storybook/web-components-vite": "^7.3.2",
|
"@storybook/web-components-vite": "7.6.7",
|
||||||
"@storybook/web-components-webpack5": "7.3.2",
|
"@storybook/web-components-webpack5": "7.6.7",
|
||||||
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
||||||
"@types/jest": "^29.5.4",
|
"@types/jest": "^29.5.11",
|
||||||
"@types/node": "20.5.6",
|
"@types/node": "20.10.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
"@typescript-eslint/eslint-plugin": "6.17.0",
|
||||||
"@typescript-eslint/parser": "^6.4.1",
|
"@typescript-eslint/parser": "6.17.0",
|
||||||
"@vitest/coverage-c8": "~0.32.4",
|
"@vitest/coverage-c8": "~0.33.0",
|
||||||
"@vitest/ui": "~0.34.3",
|
"@vitest/ui": "1.1.3",
|
||||||
"eslint": "~8.48.0",
|
"eslint": "8.56.0",
|
||||||
"eslint-config-prettier": "9.0.0",
|
"eslint-config-prettier": "9.1.0",
|
||||||
"jest": "^29.6.4",
|
"jest": "^29.7.0",
|
||||||
"jest-environment-node": "^29.6.4",
|
"jest-environment-node": "^29.7.0",
|
||||||
"nx": "16.7.4",
|
"nx": "17.2.8",
|
||||||
"prettier": "^3.0.2",
|
"prettier": "^3.1.1",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"ts-jest": "^29.1.1",
|
"ts-jest": "^29.1.1",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.2",
|
||||||
"typescript": "~5.2.2",
|
"typescript": "~5.3.3",
|
||||||
"verdaccio": "^5.26.1",
|
"verdaccio": "^5.29.0",
|
||||||
"vite": "~4.4.9",
|
"vite": "5.0.11",
|
||||||
"vite-plugin-dts": "~3.5.2",
|
"vite-plugin-dts": "~3.7.0",
|
||||||
"vitest": "~0.34.3"
|
"vitest": "1.1.3"
|
||||||
},
|
},
|
||||||
"nx": {
|
"nx": {
|
||||||
"includedScripts": []
|
"includedScripts": []
|
||||||
|
|||||||
5923
pnpm-lock.yaml
generated
5923
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@z-elements/source",
|
"name": "@z-elements/source",
|
||||||
"$schema": "node_modules/nx/schemas/project-schema.json",
|
"$schema": "node_modules/nx/schemas/project-schema.json",
|
||||||
"targets": {
|
"targets": {}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user