minahil 0.1.10 → 0.1.11

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @brickclay-org/ui
1
+ # Minahil - Angular UI Component Library
2
2
 
3
3
  A comprehensive Angular UI component library featuring a rich collection of customizable, accessible components. Built with modern Angular standards, this library provides everything you need to build beautiful and functional user interfaces.
4
4
 
@@ -6,11 +6,12 @@ A comprehensive Angular UI component library featuring a rich collection of cust
6
6
 
7
7
  - 📦 **Comprehensive Component Library** - Rich set of UI components for common use cases
8
8
  - ♿ **Accessible by Default** - WCAG compliant components with keyboard navigation and screen reader support
9
- - 🚀 **Angular 20+ Ready** - Built with latest Angular features and standalone components
9
+ - 🚀 **Angular 17-21 Support** - Built with modern Angular features and standalone components
10
10
  - 📱 **Responsive Design** - Mobile-first components that work on all screen sizes
11
11
  - 🎯 **Type-Safe** - Full TypeScript support with comprehensive type definitions
12
12
  - ⚡ **Lightweight** - Tree-shakeable and optimized for performance
13
13
  - 🎛️ **Highly Customizable** - Extensive configuration options for every component
14
+ - 🔧 **Easy Setup** - One-command installation with automatic dependency management
14
15
 
15
16
  ## 📚 Available Components
16
17
 
@@ -32,20 +33,49 @@ A fully accessible radio button component with Angular forms integration. Featur
32
33
 
33
34
  _More components coming soon..._
34
35
 
35
- ## Installation
36
+ ## 🚀 Quick Start
37
+
38
+ ### Automatic Installation (Recommended)
39
+
40
+ The easiest way to install Minahil is using Angular CLI's `ng add` command. This automatically installs the library along with matching versions of Angular CDK and other dependencies:
36
41
 
37
42
  ```bash
38
- npm i @brickclay-org/ui@0.0.6
43
+ ng add minahil
39
44
  ```
40
45
 
41
- ### Peer Dependencies
46
+ This will:
47
+
48
+ - ✅ Detect your Angular version (17, 18, 19, 20, or 21)
49
+ - ✅ Install Minahil library
50
+ - ✅ Install matching @angular/cdk version
51
+ - ✅ Install moment.js dependency
52
+ - ✅ Configure everything automatically
53
+
54
+ ### Manual Installation
55
+
56
+ If you prefer manual installation:
57
+
58
+ ```bash
59
+ npm install minahil
60
+ ```
42
61
 
43
- This library requires Angular 20.3.0 or higher:
62
+ **Important:** You must also install peer dependencies that match your Angular version:
44
63
 
45
64
  ```bash
46
- npm install @angular/common@^20.3.0 @angular/core@^20.3.0 moment
65
+ # For Angular 19 projects
66
+ npm install @angular/cdk@^19.0.0 moment@^2.29.0
67
+
68
+ # For Angular 17 projects
69
+ npm install @angular/cdk@^17.0.0 moment@^2.29.0
70
+
71
+ # For Angular 21 projects
72
+ npm install @angular/cdk@^21.0.0 moment@^2.29.0
47
73
  ```
48
74
 
75
+ ### Supported Angular Versions
76
+
77
+ Minahil supports Angular versions **17 through 21**. The library will automatically work with any Angular version in this range.
78
+
49
79
  ### Asset Configuration (Required)
50
80
 
51
81
  After installing the library, you need to configure your `angular.json` to include the library's assets (icons, etc.). Add the following to your project's `assets` array in the `build` options:
package/package.json CHANGED
@@ -1,12 +1,25 @@
1
1
  {
2
2
  "name": "minahil",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
+ "description": "A comprehensive Angular UI component library with calendar, checkbox, radio, and toggle components",
5
+ "schematics": "./schematics/collection.json",
6
+ "ng-add": {
7
+ "save": "dependencies"
8
+ },
4
9
  "peerDependencies": {
5
10
  "@angular/cdk": ">=17.0.0 <22.0.0",
6
11
  "@angular/common": ">=17.0.0 <22.0.0",
7
12
  "@angular/core": ">=17.0.0 <22.0.0",
8
13
  "moment": "^2.29.0"
9
14
  },
15
+ "peerDependenciesMeta": {
16
+ "@angular/cdk": {
17
+ "optional": true
18
+ },
19
+ "moment": {
20
+ "optional": true
21
+ }
22
+ },
10
23
  "dependencies": {
11
24
  "tslib": "^2.3.0"
12
25
  },
@@ -21,10 +34,5 @@
21
34
  "types": "./index.d.ts",
22
35
  "default": "./fesm2022/minahil.mjs"
23
36
  }
24
- },
25
- "schematics": "./schematics/collection.json",
26
- "description": "A comprehensive Angular UI component library with calendar, checkbox, radio, and toggle components",
27
- "ng-add": {
28
- "save": "dependencies"
29
37
  }
30
38
  }
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- const tasks_1 = require("@angular-devkit/schematics/tasks");
5
- const dependencies_1 = require("@schematics/angular/utility/dependencies");
6
- function default_1(options) {
7
- return (tree, context) => {
8
- context.logger.info('🚀 Setting up Minahil library...');
9
- // 1. Read user's Angular version from package.json
10
- const angularCore = (0, dependencies_1.getPackageJsonDependency)(tree, '@angular/core');
11
- if (!angularCore) {
12
- throw new Error('❌ Cannot find @angular/core in package.json. Make sure this is an Angular project.');
13
- }
14
- // 2. Extract major version (e.g., "^19.0.0" -> "19" or "~18.2.0" -> "18")
15
- const angularVersion = angularCore.version;
16
- const majorVersionMatch = angularVersion.match(/(\d+)/);
17
- if (!majorVersionMatch) {
18
- throw new Error(`❌ Could not determine Angular version from ${angularVersion}`);
19
- }
20
- const majorVersion = parseInt(majorVersionMatch[0], 10);
21
- // 3. Validate Angular version is in supported range (17-21)
22
- if (majorVersion < 17 || majorVersion > 21) {
23
- throw new Error(`❌ Minahil library supports Angular versions 17-21, but found Angular ${majorVersion}.\n` +
24
- `Please upgrade or downgrade your Angular version.`);
25
- }
26
- context.logger.info(`✅ Detected Angular version: ${majorVersion}`);
27
- // 4. Check if user already has CDK installed
28
- const existingCdk = (0, dependencies_1.getPackageJsonDependency)(tree, '@angular/cdk');
29
- if (existingCdk) {
30
- const existingCdkMajor = existingCdk.version.match(/(\d+)/)?.[0];
31
- // Check if existing CDK version matches Angular version
32
- if (existingCdkMajor && parseInt(existingCdkMajor) === majorVersion) {
33
- context.logger.info(`✅ Using existing @angular/cdk@${existingCdk.version}`);
34
- }
35
- else {
36
- context.logger.warn(`⚠️ Found @angular/cdk@${existingCdk.version} but you have Angular ${majorVersion}.\n` +
37
- ` Consider updating CDK to match your Angular version: npm install @angular/cdk@^${majorVersion}.0.0`);
38
- }
39
- }
40
- else {
41
- // Install matching CDK version
42
- const cdkVersion = `^${majorVersion}.0.0`;
43
- (0, dependencies_1.addPackageJsonDependency)(tree, {
44
- type: dependencies_1.NodeDependencyType.Default,
45
- name: '@angular/cdk',
46
- version: cdkVersion,
47
- });
48
- context.logger.info(`✅ Installing @angular/cdk@${cdkVersion} to match Angular ${majorVersion}`);
49
- }
50
- // 5. Check if moment is installed (it's a peer dependency)
51
- const existingMoment = (0, dependencies_1.getPackageJsonDependency)(tree, 'moment');
52
- if (!existingMoment) {
53
- (0, dependencies_1.addPackageJsonDependency)(tree, {
54
- type: dependencies_1.NodeDependencyType.Default,
55
- name: 'moment',
56
- version: '^2.29.0',
57
- });
58
- context.logger.info('✅ Installing moment@^2.29.0');
59
- }
60
- else {
61
- context.logger.info(`✅ Using existing moment@${existingMoment.version}`);
62
- }
63
- // 6. Schedule npm install
64
- context.addTask(new tasks_1.NodePackageInstallTask());
65
- context.logger.info('');
66
- context.logger.info('🎉 Minahil library has been successfully configured!');
67
- context.logger.info('');
68
- context.logger.info('📚 Next steps:');
69
- context.logger.info(' 1. Import components from "minahil" in your modules or standalone components');
70
- context.logger.info(' 2. Check the documentation for available components');
71
- context.logger.info('');
72
- return tree;
73
- };
74
- }