@iarunsaragadam/ngx-tailwind-flex-ui 0.0.1-canary.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/.github/workflows/ci.yml +131 -0
- package/.prettierignore +6 -0
- package/.prettierrc +3 -0
- package/.vscode/extensions.json +9 -0
- package/CODE_OF_CONDUCT.md +130 -0
- package/CONTRIBUTING.md +145 -0
- package/LICENSE +201 -0
- package/README.md +3 -0
- package/documentation.json +405 -0
- package/eslint.config.mjs +42 -0
- package/jest.config.ts +5 -0
- package/jest.preset.js +3 -0
- package/libs/ngx-tailwind-flex-ui/.storybook/main.ts +18 -0
- package/libs/ngx-tailwind-flex-ui/.storybook/preview.ts +0 -0
- package/libs/ngx-tailwind-flex-ui/.storybook/tailwind-imports.scss +3 -0
- package/libs/ngx-tailwind-flex-ui/.storybook/tsconfig.json +18 -0
- package/libs/ngx-tailwind-flex-ui/README.md +7 -0
- package/libs/ngx-tailwind-flex-ui/documentation.json +405 -0
- package/libs/ngx-tailwind-flex-ui/eslint.config.mjs +48 -0
- package/libs/ngx-tailwind-flex-ui/jest.config.ts +21 -0
- package/libs/ngx-tailwind-flex-ui/ng-package.json +7 -0
- package/libs/ngx-tailwind-flex-ui/package.json +9 -0
- package/libs/ngx-tailwind-flex-ui/project.json +90 -0
- package/libs/ngx-tailwind-flex-ui/src/index.ts +1 -0
- package/libs/ngx-tailwind-flex-ui/src/lib/button/button.component.css +0 -0
- package/libs/ngx-tailwind-flex-ui/src/lib/button/button.component.html +3 -0
- package/libs/ngx-tailwind-flex-ui/src/lib/button/button.component.spec.ts +21 -0
- package/libs/ngx-tailwind-flex-ui/src/lib/button/button.component.stories.ts +93 -0
- package/libs/ngx-tailwind-flex-ui/src/lib/button/button.component.ts +34 -0
- package/libs/ngx-tailwind-flex-ui/src/styles.scss +3 -0
- package/libs/ngx-tailwind-flex-ui/src/test-setup.ts +6 -0
- package/libs/ngx-tailwind-flex-ui/tailwind.config.js +14 -0
- package/libs/ngx-tailwind-flex-ui/tsconfig.json +31 -0
- package/libs/ngx-tailwind-flex-ui/tsconfig.lib.json +19 -0
- package/libs/ngx-tailwind-flex-ui/tsconfig.lib.prod.json +9 -0
- package/libs/ngx-tailwind-flex-ui/tsconfig.spec.json +16 -0
- package/nx.json +99 -0
- package/package.json +80 -0
- package/tsconfig.base.json +22 -0
@@ -0,0 +1,93 @@
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/angular';
|
2
|
+
import { ButtonComponent } from './button.component';
|
3
|
+
|
4
|
+
const meta: Meta<ButtonComponent> = {
|
5
|
+
title: 'Components/Button',
|
6
|
+
component: ButtonComponent,
|
7
|
+
tags: ['autodocs'],
|
8
|
+
argTypes: {
|
9
|
+
variant: {
|
10
|
+
control: 'select',
|
11
|
+
options: ['primary', 'accent', 'outline', 'text'],
|
12
|
+
description: 'Button style variant',
|
13
|
+
},
|
14
|
+
disabled: {
|
15
|
+
control: 'boolean',
|
16
|
+
description: 'Disables the button',
|
17
|
+
},
|
18
|
+
class: {
|
19
|
+
control: 'text',
|
20
|
+
description: 'Additional Tailwind CSS classes for customization',
|
21
|
+
},
|
22
|
+
},
|
23
|
+
};
|
24
|
+
|
25
|
+
export default meta;
|
26
|
+
|
27
|
+
type Story = StoryObj<ButtonComponent>;
|
28
|
+
|
29
|
+
export const Primary: Story = {
|
30
|
+
args: {
|
31
|
+
variant: 'primary',
|
32
|
+
disabled: false,
|
33
|
+
},
|
34
|
+
render: (args) => ({
|
35
|
+
props: args,
|
36
|
+
template: `<lib-button [variant]="variant" [disabled]="disabled">Primary Button</lib-button>`,
|
37
|
+
}),
|
38
|
+
};
|
39
|
+
|
40
|
+
export const Accent: Story = {
|
41
|
+
args: {
|
42
|
+
variant: 'accent',
|
43
|
+
disabled: false,
|
44
|
+
},
|
45
|
+
render: (args) => ({
|
46
|
+
props: args,
|
47
|
+
template: `<lib-button [variant]="variant" [disabled]="disabled">Accent Button</lib-button>`,
|
48
|
+
}),
|
49
|
+
};
|
50
|
+
|
51
|
+
export const Outline: Story = {
|
52
|
+
args: {
|
53
|
+
variant: 'outline',
|
54
|
+
disabled: false,
|
55
|
+
},
|
56
|
+
render: (args) => ({
|
57
|
+
props: args,
|
58
|
+
template: `<lib-button [variant]="variant" [disabled]="disabled">Outline Button</lib-button>`,
|
59
|
+
}),
|
60
|
+
};
|
61
|
+
|
62
|
+
export const Text: Story = {
|
63
|
+
args: {
|
64
|
+
variant: 'text',
|
65
|
+
disabled: false,
|
66
|
+
},
|
67
|
+
render: (args) => ({
|
68
|
+
props: args,
|
69
|
+
template: `<lib-button [variant]="variant" [disabled]="disabled">Text Button</lib-button>`,
|
70
|
+
}),
|
71
|
+
};
|
72
|
+
|
73
|
+
export const Disabled: Story = {
|
74
|
+
args: {
|
75
|
+
variant: 'primary',
|
76
|
+
disabled: true,
|
77
|
+
},
|
78
|
+
render: (args) => ({
|
79
|
+
props: args,
|
80
|
+
template: `<lib-button [variant]="variant" [disabled]="disabled">Disabled Button</lib-button>`,
|
81
|
+
}),
|
82
|
+
};
|
83
|
+
|
84
|
+
export const CustomStyled: Story = {
|
85
|
+
args: {
|
86
|
+
variant: 'primary',
|
87
|
+
class: 'text-lg px-6 py-3 bg-green-500 hover:bg-green-600',
|
88
|
+
},
|
89
|
+
render: (args) => ({
|
90
|
+
props: args,
|
91
|
+
template: `<lib-button [variant]="variant" [class]="class">Custom Styled Button</lib-button>`,
|
92
|
+
}),
|
93
|
+
};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { Component, Input, HostBinding } from '@angular/core';
|
2
|
+
|
3
|
+
@Component({
|
4
|
+
selector: 'lib-button',
|
5
|
+
standalone: true,
|
6
|
+
templateUrl: './button.component.html',
|
7
|
+
styles: [], // No inline styles; Tailwind handles it
|
8
|
+
})
|
9
|
+
export class ButtonComponent {
|
10
|
+
@Input() variant: 'primary' | 'accent' | 'outline' | 'text' = 'primary';
|
11
|
+
@Input() disabled = false;
|
12
|
+
@Input() class = ''; // Allow users to pass custom Tailwind classes
|
13
|
+
|
14
|
+
@HostBinding('class') get hostClasses() {
|
15
|
+
const baseClasses =
|
16
|
+
'inline-flex items-center justify-center px-4 py-2 rounded-md font-medium transition-colors duration-200';
|
17
|
+
const variantClasses = {
|
18
|
+
primary:
|
19
|
+
'bg-blue-600 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2',
|
20
|
+
accent:
|
21
|
+
'bg-purple-600 text-white hover:bg-purple-700 focus:ring-2 focus:ring-purple-500 focus:ring-offset-2',
|
22
|
+
outline:
|
23
|
+
'border border-gray-300 text-gray-700 hover:bg-gray-100 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2',
|
24
|
+
text: 'text-gray-700 hover:bg-gray-100 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2',
|
25
|
+
};
|
26
|
+
const disabledClasses = this.disabled
|
27
|
+
? 'opacity-50 cursor-not-allowed'
|
28
|
+
: '';
|
29
|
+
|
30
|
+
return `${baseClasses} ${variantClasses[this.variant]} ${disabledClasses} ${
|
31
|
+
this.class
|
32
|
+
}`.trim();
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind');
|
2
|
+
const { join } = require('path');
|
3
|
+
|
4
|
+
/** @type {import('tailwindcss').Config} */
|
5
|
+
module.exports = {
|
6
|
+
content: [
|
7
|
+
join(__dirname, 'src/**/!(*.stories|*.spec).{ts,html}'),
|
8
|
+
...createGlobPatternsForDependencies(__dirname),
|
9
|
+
],
|
10
|
+
theme: {
|
11
|
+
extend: {},
|
12
|
+
},
|
13
|
+
plugins: [],
|
14
|
+
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "es2022",
|
4
|
+
"forceConsistentCasingInFileNames": true,
|
5
|
+
"strict": true,
|
6
|
+
"noImplicitOverride": true,
|
7
|
+
"noPropertyAccessFromIndexSignature": true,
|
8
|
+
"noImplicitReturns": true,
|
9
|
+
"noFallthroughCasesInSwitch": true
|
10
|
+
},
|
11
|
+
"files": [],
|
12
|
+
"include": [],
|
13
|
+
"references": [
|
14
|
+
{
|
15
|
+
"path": "./tsconfig.lib.json"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"path": "./tsconfig.spec.json"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"path": "./.storybook/tsconfig.json"
|
22
|
+
}
|
23
|
+
],
|
24
|
+
"extends": "../../tsconfig.base.json",
|
25
|
+
"angularCompilerOptions": {
|
26
|
+
"enableI18nLegacyMessageIdFormat": false,
|
27
|
+
"strictInjectionParameters": true,
|
28
|
+
"strictInputAccessModifiers": true,
|
29
|
+
"strictTemplates": true
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"extends": "./tsconfig.json",
|
3
|
+
"compilerOptions": {
|
4
|
+
"outDir": "../../dist/out-tsc",
|
5
|
+
"declaration": true,
|
6
|
+
"declarationMap": true,
|
7
|
+
"inlineSources": true,
|
8
|
+
"types": []
|
9
|
+
},
|
10
|
+
"exclude": [
|
11
|
+
"src/**/*.spec.ts",
|
12
|
+
"src/test-setup.ts",
|
13
|
+
"jest.config.ts",
|
14
|
+
"src/**/*.test.ts",
|
15
|
+
"**/*.stories.ts",
|
16
|
+
"**/*.stories.js"
|
17
|
+
],
|
18
|
+
"include": ["src/**/*.ts"]
|
19
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"extends": "./tsconfig.json",
|
3
|
+
"compilerOptions": {
|
4
|
+
"outDir": "../../dist/out-tsc",
|
5
|
+
"module": "commonjs",
|
6
|
+
"target": "es2016",
|
7
|
+
"types": ["jest", "node"]
|
8
|
+
},
|
9
|
+
"files": ["src/test-setup.ts"],
|
10
|
+
"include": [
|
11
|
+
"jest.config.ts",
|
12
|
+
"src/**/*.test.ts",
|
13
|
+
"src/**/*.spec.ts",
|
14
|
+
"src/**/*.d.ts"
|
15
|
+
]
|
16
|
+
}
|
package/nx.json
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
3
|
+
"namedInputs": {
|
4
|
+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
|
5
|
+
"production": [
|
6
|
+
"default",
|
7
|
+
"!{projectRoot}/.eslintrc.json",
|
8
|
+
"!{projectRoot}/eslint.config.mjs",
|
9
|
+
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
|
10
|
+
"!{projectRoot}/tsconfig.spec.json",
|
11
|
+
"!{projectRoot}/jest.config.[jt]s",
|
12
|
+
"!{projectRoot}/src/test-setup.[jt]s",
|
13
|
+
"!{projectRoot}/test-setup.[jt]s",
|
14
|
+
"!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)",
|
15
|
+
"!{projectRoot}/.storybook/**/*",
|
16
|
+
"!{projectRoot}/tsconfig.storybook.json"
|
17
|
+
],
|
18
|
+
"sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"]
|
19
|
+
},
|
20
|
+
"nxCloudId": "67bd132ff78b9f3620c4d81f",
|
21
|
+
"targetDefaults": {
|
22
|
+
"@angular-devkit/build-angular:application": {
|
23
|
+
"cache": true,
|
24
|
+
"dependsOn": ["^build"],
|
25
|
+
"inputs": ["production", "^production"]
|
26
|
+
},
|
27
|
+
"@nx/eslint:lint": {
|
28
|
+
"cache": true,
|
29
|
+
"inputs": [
|
30
|
+
"default",
|
31
|
+
"{workspaceRoot}/.eslintrc.json",
|
32
|
+
"{workspaceRoot}/.eslintignore",
|
33
|
+
"{workspaceRoot}/eslint.config.mjs"
|
34
|
+
]
|
35
|
+
},
|
36
|
+
"@nx/jest:jest": {
|
37
|
+
"cache": true,
|
38
|
+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
|
39
|
+
"options": {
|
40
|
+
"passWithNoTests": true
|
41
|
+
},
|
42
|
+
"configurations": {
|
43
|
+
"ci": {
|
44
|
+
"ci": true,
|
45
|
+
"codeCoverage": true
|
46
|
+
}
|
47
|
+
}
|
48
|
+
},
|
49
|
+
"e2e-ci--**/*": {
|
50
|
+
"dependsOn": ["^build"]
|
51
|
+
},
|
52
|
+
"@nx/angular:package": {
|
53
|
+
"cache": true,
|
54
|
+
"dependsOn": ["^build"],
|
55
|
+
"inputs": ["production", "^production"]
|
56
|
+
},
|
57
|
+
"build-storybook": {
|
58
|
+
"cache": true
|
59
|
+
}
|
60
|
+
},
|
61
|
+
"plugins": [
|
62
|
+
{
|
63
|
+
"plugin": "@nx/playwright/plugin",
|
64
|
+
"options": {
|
65
|
+
"targetName": "e2e"
|
66
|
+
}
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"plugin": "@nx/eslint/plugin",
|
70
|
+
"options": {
|
71
|
+
"targetName": "lint"
|
72
|
+
}
|
73
|
+
},
|
74
|
+
{
|
75
|
+
"plugin": "@nx/storybook/plugin",
|
76
|
+
"options": {
|
77
|
+
"serveStorybookTargetName": "storybook",
|
78
|
+
"buildStorybookTargetName": "build-storybook",
|
79
|
+
"testStorybookTargetName": "test-storybook",
|
80
|
+
"staticStorybookTargetName": "static-storybook"
|
81
|
+
}
|
82
|
+
}
|
83
|
+
],
|
84
|
+
"generators": {
|
85
|
+
"@nx/angular:application": {
|
86
|
+
"e2eTestRunner": "playwright",
|
87
|
+
"linter": "eslint",
|
88
|
+
"style": "scss",
|
89
|
+
"unitTestRunner": "jest"
|
90
|
+
},
|
91
|
+
"@nx/angular:library": {
|
92
|
+
"linter": "eslint",
|
93
|
+
"unitTestRunner": "jest"
|
94
|
+
},
|
95
|
+
"@nx/angular:component": {
|
96
|
+
"style": "css"
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
package/package.json
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
{
|
2
|
+
"name": "@iarunsaragadam/ngx-tailwind-flex-ui",
|
3
|
+
"version": "0.0.1-canary.0.0",
|
4
|
+
"license": "MIT",
|
5
|
+
"scripts": {
|
6
|
+
"test": "npx nx run-many --target=test",
|
7
|
+
"build": "npx nx run-many --target=build",
|
8
|
+
"lint": "npx nx run-many --target=lint",
|
9
|
+
"e2e": "npx nx run-many --target=e2e"
|
10
|
+
},
|
11
|
+
"private": false,
|
12
|
+
"dependencies": {
|
13
|
+
"@angular/animations": "~19.1.0",
|
14
|
+
"@angular/common": "~19.1.0",
|
15
|
+
"@angular/compiler": "~19.1.0",
|
16
|
+
"@angular/core": "~19.1.0",
|
17
|
+
"@angular/forms": "~19.1.0",
|
18
|
+
"@angular/platform-browser": "~19.1.0",
|
19
|
+
"@angular/platform-browser-dynamic": "~19.1.0",
|
20
|
+
"@angular/router": "~19.1.0",
|
21
|
+
"rxjs": "~7.8.0",
|
22
|
+
"zone.js": "~0.15.0"
|
23
|
+
},
|
24
|
+
"devDependencies": {
|
25
|
+
"@angular-devkit/build-angular": "~19.1.0",
|
26
|
+
"@angular-devkit/core": "~19.1.0",
|
27
|
+
"@angular-devkit/schematics": "~19.1.0",
|
28
|
+
"@angular/cli": "~19.1.0",
|
29
|
+
"@angular/compiler-cli": "~19.1.0",
|
30
|
+
"@angular/language-service": "~19.1.0",
|
31
|
+
"@compodoc/compodoc": "^1.1.26",
|
32
|
+
"@eslint/js": "^9.8.0",
|
33
|
+
"@nx/angular": "20.4.6",
|
34
|
+
"@nx/devkit": "20.4.6",
|
35
|
+
"@nx/eslint": "20.4.6",
|
36
|
+
"@nx/eslint-plugin": "20.4.6",
|
37
|
+
"@nx/jest": "20.4.6",
|
38
|
+
"@nx/js": "20.4.6",
|
39
|
+
"@nx/playwright": "20.4.6",
|
40
|
+
"@nx/storybook": "^20.4.6",
|
41
|
+
"@nx/web": "20.4.6",
|
42
|
+
"@nx/workspace": "20.4.6",
|
43
|
+
"@playwright/test": "^1.36.0",
|
44
|
+
"@schematics/angular": "~19.1.0",
|
45
|
+
"@storybook/addon-essentials": "^8.4.6",
|
46
|
+
"@storybook/addon-interactions": "^8.4.6",
|
47
|
+
"@storybook/angular": "^8.4.6",
|
48
|
+
"@storybook/core-server": "^8.4.6",
|
49
|
+
"@storybook/jest": "^0.2.3",
|
50
|
+
"@storybook/test-runner": "^0.19.0",
|
51
|
+
"@storybook/testing-library": "^0.2.2",
|
52
|
+
"@swc-node/register": "~1.9.1",
|
53
|
+
"@swc/core": "~1.5.7",
|
54
|
+
"@swc/helpers": "~0.5.11",
|
55
|
+
"@types/jest": "^29.5.12",
|
56
|
+
"@types/node": "18.16.9",
|
57
|
+
"@typescript-eslint/utils": "^8.19.0",
|
58
|
+
"angular-eslint": "^19.0.2",
|
59
|
+
"autoprefixer": "^10.4.20",
|
60
|
+
"eslint": "^9.8.0",
|
61
|
+
"eslint-config-prettier": "^9.0.0",
|
62
|
+
"eslint-plugin-playwright": "^1.6.2",
|
63
|
+
"jest": "^29.7.0",
|
64
|
+
"jest-environment-jsdom": "^29.7.0",
|
65
|
+
"jest-preset-angular": "~14.4.0",
|
66
|
+
"jsonc-eslint-parser": "^2.1.0",
|
67
|
+
"ng-packagr": "~19.1.0",
|
68
|
+
"nx": "20.4.6",
|
69
|
+
"postcss": "^8.5.3",
|
70
|
+
"postcss-url": "~10.1.3",
|
71
|
+
"prettier": "^2.6.2",
|
72
|
+
"storybook": "^8.4.6",
|
73
|
+
"tailwindcss": "^3.4.17",
|
74
|
+
"ts-jest": "^29.1.0",
|
75
|
+
"ts-node": "10.9.1",
|
76
|
+
"tslib": "^2.3.0",
|
77
|
+
"typescript": "~5.7.2",
|
78
|
+
"typescript-eslint": "^8.19.0"
|
79
|
+
}
|
80
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"compileOnSave": false,
|
3
|
+
"compilerOptions": {
|
4
|
+
"rootDir": ".",
|
5
|
+
"sourceMap": true,
|
6
|
+
"declaration": false,
|
7
|
+
"moduleResolution": "node",
|
8
|
+
"emitDecoratorMetadata": true,
|
9
|
+
"experimentalDecorators": true,
|
10
|
+
"importHelpers": true,
|
11
|
+
"target": "es2015",
|
12
|
+
"module": "esnext",
|
13
|
+
"lib": ["es2020", "dom"],
|
14
|
+
"skipLibCheck": true,
|
15
|
+
"skipDefaultLibCheck": true,
|
16
|
+
"baseUrl": ".",
|
17
|
+
"paths": {
|
18
|
+
"@ngx-tailwind-flex-ui": ["libs/ngx-tailwind-flex-ui/src/index.ts"]
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"exclude": ["node_modules", "tmp"]
|
22
|
+
}
|