@brickclay-org/ui 0.0.41 → 0.0.42

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/package.json CHANGED
@@ -1,13 +1,22 @@
1
1
  {
2
2
  "name": "@brickclay-org/ui",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
+ "schematics": "./schematics/collection.json",
5
+ "ng-add": {
6
+ "save": "dependencies"
7
+ },
4
8
  "peerDependencies": {
5
- "@angular/common": ">=17.0.0 <=21.0.0",
6
- "@angular/core": ">=17.0.0 <=21.0.0",
7
- "@angular/cdk": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
9
+ "@angular/common": ">=17.0.0 <22.0.0",
10
+ "@angular/core": ">=17.0.0 <22.0.0",
11
+ "@angular/cdk": ">=17.0.0 <22.0.0",
8
12
  "moment": "^2.29.0",
9
13
  "ngx-mask": "^20.0.3"
10
14
  },
15
+ "peerDependenciesMeta": {
16
+ "@angular/cdk": {
17
+ "optional": true
18
+ }
19
+ },
11
20
  "dependencies": {
12
21
  "tslib": "^2.3.0"
13
22
  },
@@ -22,5 +31,6 @@
22
31
  "types": "./index.d.ts",
23
32
  "default": "./fesm2022/brickclay-org-ui.mjs"
24
33
  }
25
- }
34
+ },
35
+ "description": "A comprehensive Angular UI component library with calendar, checkbox, radio, and toggle components"
26
36
  }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "ng-add": {
5
+ "description": "Add @brickclay-org/ui library to an Angular project and install matching Angular CDK version",
6
+ "factory": "./ng-add/index",
7
+ "schema": "./ng-add/schema.json"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,60 @@
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 @brickclay-org/ui 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(`❌ @brickclay-org/ui 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. Schedule npm install
51
+ context.addTask(new tasks_1.NodePackageInstallTask());
52
+ context.logger.info('');
53
+ context.logger.info('🎉 Brickclay library has been successfully configured!');
54
+ context.logger.info('');
55
+ context.logger.info('📚 Next steps:');
56
+ context.logger.info(' 1. Import components from "@brickclay-org/ui" in your modules or standalone components');
57
+ context.logger.info('');
58
+ return tree;
59
+ };
60
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "NgAddBrickclaySchema",
4
+ "title": "Brickclay Library ng-add Schematic",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "",
10
+ "$default": {
11
+ "$source": "projectName"
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,102 @@
1
+ /*
2
+ * Dialog Container Styles (CDK-based)
3
+ *
4
+ * All class names use the `bk-` prefix to avoid collisions when
5
+ * published as an npm package.
6
+ *
7
+ * CDK Overlay manages the overlay container, backdrop, pane sizing, and
8
+ * z-index stacking. We only style:
9
+ *
10
+ * 1. The container host (`:host`) — this IS the visual panel.
11
+ * 2. `.bk-dialog-content` and `.bk-dialog-actions` — drop-in
12
+ * replacements for `<mat-dialog-content>` and `<mat-dialog-actions>`.
13
+ */
14
+
15
+ /* ══════════════════════════════════════════════════════════════════════
16
+ Panel — the container host IS the dialog box
17
+ ══════════════════════════════════════════════════════════════════════ */
18
+ :host {
19
+ display: flex;
20
+ flex-direction: column;
21
+ flex: 1; /* fill the CDK overlay pane */
22
+ min-height: 0;
23
+ max-height: inherit; /* respect CDK pane's max-height */
24
+
25
+ background: var(--bk-dialog-panel-bg, #ffffff);
26
+ border-radius: var(--bk-dialog-panel-radius, 8px);
27
+ box-shadow:
28
+ var(
29
+ --bk-dialog-panel-shadow,
30
+ 0 11px 15px -7px rgba(0, 0, 0, 0.2),
31
+ 0 24px 38px 3px rgba(0, 0, 0, 0.14),
32
+ 0 9px 46px 8px rgba(0, 0, 0, 0.12)
33
+ );
34
+ outline: 0;
35
+ box-sizing: border-box;
36
+ overflow: hidden;
37
+ will-change: transform, opacity;
38
+ }
39
+
40
+ /* ══════════════════════════════════════════════════════════════════════
41
+ Dynamic component host
42
+ ──────────────────────
43
+ CdkPortalOutlet creates the user's component as a direct child of
44
+ :host. Angular's emulated view encapsulation prevents scoped CSS
45
+ from reaching dynamically-created elements, so we use ::ng-deep.
46
+ ══════════════════════════════════════════════════════════════════════ */
47
+
48
+ :host ::ng-deep > :first-child {
49
+ display: flex;
50
+ flex-direction: column;
51
+ flex: 1 1 auto;
52
+ min-height: 0;
53
+ overflow: hidden;
54
+ }
55
+
56
+ /* ══════════════════════════════════════════════════════════════════════
57
+ Drop-in replacements for Material dialog layout directives
58
+ ──────────────────────────────────────────────────────────
59
+ Use these CSS classes inside your dialog component templates:
60
+ <div class="bk-dialog-content"> → replaces <mat-dialog-content>
61
+ <div class="bk-dialog-actions"> → replaces <mat-dialog-actions>
62
+ ══════════════════════════════════════════════════════════════════════ */
63
+
64
+ :host ::ng-deep .bk-dialog-content {
65
+ flex: 1 1 auto;
66
+ overflow: auto; /* ← only layer that scrolls */
67
+ min-height: 0; /* allow shrinking in flex col */
68
+ display: block;
69
+ -webkit-overflow-scrolling: touch;
70
+ }
71
+
72
+ :host ::ng-deep .bk-dialog-actions {
73
+ flex: 0 0 auto; /* ← never shrinks, pinned */
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: flex-end;
77
+ flex-wrap: wrap;
78
+ min-height: 52px;
79
+ }
80
+
81
+ /* ══════════════════════════════════════════════════════════════════════
82
+ Title — stays pinned at the top (like mat-dialog-title)
83
+ ══════════════════════════════════════════════════════════════════════ */
84
+
85
+ :host ::ng-deep .bk-dialog-title {
86
+ flex: 0 0 auto; /* ← never shrinks, pinned */
87
+ margin: 0;
88
+ }
89
+
90
+ /* ══════════════════════════════════════════════════════════════════════
91
+ Action alignment variants (set via BkDialogActions.align input)
92
+ ══════════════════════════════════════════════════════════════════════ */
93
+
94
+ :host ::ng-deep .bk-dialog-actions-align-start {
95
+ justify-content: flex-start;
96
+ }
97
+
98
+ :host ::ng-deep .bk-dialog-actions-align-center {
99
+ justify-content: center;
100
+ }
101
+
102
+ /* align-end is the default (already flex-end above) */
package/src/styles.css CHANGED
@@ -14,3 +14,4 @@
14
14
  @import './lib/input/input.css';
15
15
  @import './lib/chips/chips.css';
16
16
  @import './lib/tabs/tabs.css';
17
+ @import './lib/dialog/dialog-container.css';