@uni-design-system/uni-angular 0.1.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.
@@ -0,0 +1,24 @@
1
+ import type { StorybookConfig } from '@analogjs/storybook-angular';
2
+ import { dirname } from "path"
3
+ import { fileURLToPath } from "url"
4
+
5
+ function getAbsolutePath(value: string) {
6
+ return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)))
7
+ }
8
+
9
+ const config: StorybookConfig = {
10
+ "stories": [
11
+ "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
12
+ ],
13
+ "addons": [
14
+ getAbsolutePath('@storybook/addon-a11y'),
15
+ getAbsolutePath('@storybook/addon-docs')
16
+ ],
17
+ "framework": {
18
+ // Switch this to the Analog framework to fix the 'undefined' error
19
+ name: getAbsolutePath('@analogjs/storybook-angular'),
20
+ options: {}
21
+ }
22
+ };
23
+
24
+ export default config;
@@ -0,0 +1,14 @@
1
+ import type { Preview } from '@storybook/angular'
2
+
3
+ const preview: Preview = {
4
+ parameters: {
5
+ controls: {
6
+ matchers: {
7
+ color: /(background|color)$/i,
8
+ date: /Date$/i,
9
+ },
10
+ },
11
+ },
12
+ };
13
+
14
+ export default preview;
@@ -0,0 +1,21 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "moduleResolution": "bundler",
5
+ "module": "ESNext",
6
+ "esModuleInterop": true,
7
+ "types": ["node"],
8
+ "allowSyntheticDefaultImports": true,
9
+ "resolveJsonModule": true,
10
+ "experimentalDecorators": true,
11
+ "emitDecoratorMetadata": true
12
+ },
13
+ "exclude": ["../src/test.ts", "../src/**/*.spec.ts"],
14
+ "include": [
15
+ "../src/**/*.ts", // Added: includes your actual components
16
+ "../src/**/*.stories.ts", // Updated: specifically target TS stories
17
+ "./preview.ts",
18
+ "./main.ts" // Added: includes the config itself
19
+ ],
20
+ "files": ["./typings.d.ts"]
21
+ }
@@ -0,0 +1,4 @@
1
+ declare module '*.md' {
2
+ const content: string;
3
+ export default content;
4
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite';
2
+ import tsconfigPaths from 'vite-tsconfig-paths';
3
+ import angular from '@analogjs/vite-plugin-angular';
4
+
5
+ export default defineConfig({
6
+ plugins: [angular(), tsconfigPaths()],
7
+ });
@@ -0,0 +1,23 @@
1
+
2
+ $ pnpm ng-packagr -p ng-package.json
3
+ Building Angular Package
4
+ 
5
+ ------------------------------------------------------------------------------
6
+ Building entry point '@uni-design-system/uni-angular'
7
+ ------------------------------------------------------------------------------
8
+ [?2026hâ ‹ Compiling with Angular sources in partial compilation mode.[?2026l[?2026hâ ™ Compiling with Angular sources in partial compilation mode.[?2026l[?2026hâ ą Compiling with Angular sources in partial compilation mode.[?2026lâś” Compiling with Angular sources in partial compilation mode.
9
+ [?2026hâ ‹ Writing FESM and DTS bundles[?2026lâś” Writing FESM and DTS bundles
10
+ [?2026hâ ‹ Copying assets[?2026lâś” Copying assets
11
+ [?2026h⠋ Writing package manifest[?2026lℹ Removing scripts section in package.json as it's considered a potential security vulnerability.
12
+ ℹ Removing devDependencies section in package.json.
13
+ âś” Writing package manifest
14
+ âś” Built @uni-design-system/uni-angular
15
+ 
16
+ ------------------------------------------------------------------------------
17
+ Built Angular Package
18
+ - from: /Users/george/git/gaenglish/uni/packages/angular
19
+ - to: /Users/george/git/gaenglish/uni/packages/angular/dist
20
+ ------------------------------------------------------------------------------
21
+ 
22
+ Build at: 2026-05-11T20:45:52.333Z - Time: 723ms
23
+ 
package/angular.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "../../node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "@uni-design-system/uni-angular": {
7
+ "projectType": "library",
8
+ "root": "",
9
+ "sourceRoot": "src",
10
+ "prefix": "uni",
11
+ "architect": {
12
+ "build": {
13
+ "builder": "@angular-devkit/build-angular:ng-packagr",
14
+ "options": {
15
+ "project": "ng-package.json"
16
+ }
17
+ },
18
+ "test": {
19
+ "builder": "@angular-devkit/build-angular:karma",
20
+ "options": {
21
+ "main": "src/test.ts",
22
+ "tsConfig": "tsconfig.spec.json",
23
+ "karmaConfig": "karma.conf.js"
24
+ }
25
+ },
26
+ "storybook": {
27
+ "builder": "@storybook/angular:start-storybook",
28
+ "options": {
29
+ "configDir": ".storybook",
30
+ "browserTarget": "@uni-design-system/uni-angular:build",
31
+ "compodoc": false,
32
+ "port": 6007
33
+ }
34
+ },
35
+ "build-storybook": {
36
+ "builder": "@storybook/angular:build-storybook",
37
+ "options": {
38
+ "configDir": ".storybook",
39
+ "browserTarget": "@uni-design-system/uni-angular:build",
40
+ "compodoc": false,
41
+ "outputDir": "storybook-static"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,28 @@
1
+ [14:23:36.870] [INFO] storybook v10.3.6
2
+ [14:23:37.740] [DEBUG] Getting package.json info for /Users/george/git/gaenglish/uni/packages/angular/package.json...
3
+ [14:23:38.002] [INFO] Starting...
4
+ [14:23:38.138] [DEBUG] Starting preview..
5
+ [14:23:38.145] [INFO] Addon-docs: using MDX3
6
+ [14:23:38.157] [INFO] Using implicit CSS loaders
7
+ [14:23:38.465] [ERROR] Failed to build the preview
8
+ [14:23:38.466] [ERROR] SB_FRAMEWORK_ANGULAR_0001 (AngularLegacyBuildOptionsError): Your Storybook startup script uses a solution that is not supported anymore.
9
+ You must use Angular builder to have an explicit configuration on the project used in angular.json.
10
+
11
+ Please run 'npx storybook automigrate' to automatically fix your config.
12
+
13
+ More info:
14
+ - https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#angular-drop-support-for-calling-storybook-directly
15
+ - https://github.com/storybookjs/storybook/tree/next/code/frameworks/angular#how-do-i-migrate-to-an-angular-storybook-builder
16
+ 
17
+ at checkForLegacyBuildOptions (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/@storybook+angular@10.3.6_51f2ba54bcdf51a50f118aadc673eb3e/node_modules/@storybook/angular/dist/server/framework-preset-angular-cli.js:159:11)
18
+ at Object.webpackFinal (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/@storybook+angular@10.3.6_51f2ba54bcdf51a50f118aadc673eb3e/node_modules/@storybook/angular/dist/server/framework-preset-angular-cli.js:93:3)
19
+ at async Object.webpack (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/@storybook+builder-webpack5@10.3.6_esbuild@0.27.7_storybook@10.3.6_@testing-library+dom_db6b670199b912be7a72b23934922527/node_modules/@storybook/builder-webpack5/dist/presets/custom-webpack-preset.js:282:28)
20
+ at async starter (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/@storybook+builder-webpack5@10.3.6_esbuild@0.27.7_storybook@10.3.6_@testing-library+dom_db6b670199b912be7a72b23934922527/node_modules/@storybook/builder-webpack5/dist/index.js:753:16)
21
+ at async Module.start (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/@storybook+builder-webpack5@10.3.6_esbuild@0.27.7_storybook@10.3.6_@testing-library+dom_db6b670199b912be7a72b23934922527/node_modules/@storybook/builder-webpack5/dist/index.js:857:14)
22
+ at async storybookDevServer (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/storybook@10.3.6_@testing-library+dom@10.4.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/storybook/dist/core-server/index.js:7503:83)
23
+ at async buildOrThrow (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/storybook@10.3.6_@testing-library+dom@10.4.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/storybook/dist/core-server/index.js:4508:12)
24
+ at async buildDevStandalone (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/storybook@10.3.6_@testing-library+dom@10.4.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/storybook/dist/core-server/index.js:8033:41)
25
+ at async withTelemetry (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/storybook@10.3.6_@testing-library+dom@10.4.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/storybook/dist/_node-chunks/chunk-UYONHJJP.js:225:12)
26
+ at async dev (file:///Users/george/git/gaenglish/uni/node_modules/.pnpm/storybook@10.3.6_@testing-library+dom@10.4.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/storybook/dist/bin/core.js:2736:3)
27
+ [14:23:38.472] [WARN] Broken build, fix the error above.
28
+ You may need to refresh the browser.
@@ -0,0 +1,32 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Input, Component } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
+
5
+ class UniButtonComponent {
6
+ label = 'Button';
7
+ bgColor = "#000000";
8
+ textColor = "#fff";
9
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
10
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.12", type: UniButtonComponent, isStandalone: true, selector: "uni-button", inputs: { label: "label" }, ngImport: i0, template: `
11
+ <button [style.background-color]="bgColor" [style.color]="textColor">
12
+ {{ label }}
13
+ </button>
14
+ `, isInline: true, styles: ["button{padding:12px 24px;border-radius:4px;border:none;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
15
+ }
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniButtonComponent, decorators: [{
17
+ type: Component,
18
+ args: [{ selector: 'uni-button', standalone: true, imports: [CommonModule], template: `
19
+ <button [style.background-color]="bgColor" [style.color]="textColor">
20
+ {{ label }}
21
+ </button>
22
+ `, styles: ["button{padding:12px 24px;border-radius:4px;border:none;cursor:pointer}\n"] }]
23
+ }], propDecorators: { label: [{
24
+ type: Input
25
+ }] } });
26
+
27
+ /**
28
+ * Generated bundle index. Do not edit.
29
+ */
30
+
31
+ export { UniButtonComponent };
32
+ //# sourceMappingURL=uni-design-system-uni-angular.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uni-design-system-uni-angular.mjs","sources":["../../src/lib/button.component.ts","../../src/uni-design-system-uni-angular.ts"],"sourcesContent":["import { Component, Input } from '@angular/core';\nimport { CommonModule } from '@angular/common'; // Still useful for pipes/directives\n\n@Component({\n selector: 'uni-button',\n standalone: true, // Optional but explicit\n imports: [CommonModule],\n template: `\n <button [style.background-color]=\"bgColor\" [style.color]=\"textColor\">\n {{ label }}\n </button>\n `,\n styles: [`\n button { padding: 12px 24px; border-radius: 4px; border: none; cursor: pointer; }\n `]\n})\nexport class UniButtonComponent {\n @Input() label: string = 'Button';\n bgColor = \"#000000\";\n textColor = \"#fff\";\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAgBa,kBAAkB,CAAA;IACpB,KAAK,GAAW,QAAQ;IACjC,OAAO,GAAG,SAAS;IACnB,SAAS,GAAG,MAAM;wGAHP,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EATnB;;;;AAIT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,0EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EALS,YAAY,EAAA,CAAA,EAAA,CAAA;;4FAUX,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAb9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,cACV,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,CAAC,EAAA,QAAA,EACb;;;;AAIT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,0EAAA,CAAA,EAAA;;sBAMA;;;ACjBH;;AAEG;;;;"}
@@ -0,0 +1,11 @@
1
+ import * as i0 from '@angular/core';
2
+
3
+ declare class UniButtonComponent {
4
+ label: string;
5
+ bgColor: string;
6
+ textColor: string;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<UniButtonComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<UniButtonComponent, "uni-button", never, { "label": { "alias": "label"; "required": false; }; }, {}, never, never, true, never>;
9
+ }
10
+
11
+ export { UniButtonComponent };
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/.pnpm/ng-packagr@21.2.3_@angular+compiler-cli@21.2.11_@angular+compiler@21.2.11_typescript@6.0.3__tslib@2.8.1_typescript@6.0.3/node_modules/ng-packagr/ng-package.schema.json",
3
+ "lib": {
4
+ "entryFile": "src/public-api.ts"
5
+ },
6
+ "dest": "dist"
7
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@uni-design-system/uni-angular",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "scripts": {
9
+ "build": "pnpm ng-packagr -p ng-package.json",
10
+ "storybook": "ng run @uni-design-system/uni-angular:storybook",
11
+ "build-storybook": "ng run @uni-design-system/uni-angular:build-storybook",
12
+ "release": "pnpm build && pnpm changeset publish"
13
+ },
14
+ "peerDependencies": {
15
+ "@angular/common": "21.2.12",
16
+ "@angular/core": "21.2.12",
17
+ "@uni-design-system/uni-core": "workspace:*"
18
+ },
19
+ "devDependencies": {
20
+ "@analogjs/storybook-angular": "^2.5.0",
21
+ "@analogjs/vite-plugin-angular": "^2.5.0",
22
+ "@angular-devkit/architect": "^0.2102.10",
23
+ "@angular-devkit/build-angular": "^21.2.10",
24
+ "@angular-devkit/core": "21.2.10",
25
+ "@angular/compiler": "21.2.12",
26
+ "@angular/compiler-cli": "21.2.12",
27
+ "@angular/platform-browser-dynamic": "21.2.12",
28
+ "@storybook/addon-a11y": "^10.3.6",
29
+ "@storybook/addon-docs": "^10.3.6",
30
+ "@storybook/addon-interactions": "^8.6.14",
31
+ "@storybook/angular": "^10.3.6",
32
+ "@uni-design-system/tsconfig": "workspace:*",
33
+ "ng-packagr": "^21.0.0",
34
+ "storybook": "^10.3.6",
35
+ "tslib": "^2.8.1",
36
+ "typescript": "5.9.3",
37
+ "vite": "^8.0.10",
38
+ "vite-tsconfig-paths": "^6.1.1"
39
+ }
40
+ }
@@ -0,0 +1,21 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import { CommonModule } from '@angular/common'; // Still useful for pipes/directives
3
+
4
+ @Component({
5
+ selector: 'uni-button',
6
+ standalone: true, // Optional but explicit
7
+ imports: [CommonModule],
8
+ template: `
9
+ <button [style.background-color]="bgColor" [style.color]="textColor">
10
+ {{ label }}
11
+ </button>
12
+ `,
13
+ styles: [`
14
+ button { padding: 12px 24px; border-radius: 4px; border: none; cursor: pointer; }
15
+ `]
16
+ })
17
+ export class UniButtonComponent {
18
+ @Input() label: string = 'Button';
19
+ bgColor = "#000000";
20
+ textColor = "#fff";
21
+ }
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/angular';
2
+ import { UniButtonComponent } from './button.component';
3
+
4
+ const meta: Meta<UniButtonComponent> = {
5
+ title: 'Components/UniButton',
6
+ component: UniButtonComponent, // Storybook 11+ handles standalone components automatically here
7
+ render: (args) => ({
8
+ props: args,
9
+ // We don't need 'template' if we just want to render the component as is
10
+ }),
11
+ };
12
+
13
+ export default meta;
14
+ type Story = StoryObj<UniButtonComponent>;
15
+
16
+ export const Primary: Story = {
17
+ args: {
18
+ label: 'My Angular Component',
19
+ },
20
+ };
@@ -0,0 +1 @@
1
+ export * from './lib/button.component';
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "@uni-design-system/tsconfig/base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src",
6
+ "module": "ESNext",
7
+ "target": "ES2022",
8
+ "esModuleInterop": true,
9
+ "types": ["node", "vite/client"],
10
+ "emitDecoratorMetadata": true,
11
+ "experimentalDecorators": true,
12
+ "useDefineForClassFields": false,
13
+ "ignoreDeprecations": "6.0",
14
+ },
15
+ "include": ["src/**/*", "vite.config.ts"],
16
+ "exclude": ["node_modules", "dist", "**/*.spec.ts", "**/*.stories.ts"]
17
+ }