osi-cards-lib 1.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.
Files changed (114) hide show
  1. package/README.md +763 -0
  2. package/esm2022/lib/components/ai-card-renderer/ai-card-renderer.component.mjs +911 -0
  3. package/esm2022/lib/components/card-preview/card-preview.component.mjs +74 -0
  4. package/esm2022/lib/components/card-skeleton/card-skeleton.component.mjs +24 -0
  5. package/esm2022/lib/components/masonry-grid/masonry-grid.component.mjs +330 -0
  6. package/esm2022/lib/components/section-renderer/section-renderer.component.mjs +166 -0
  7. package/esm2022/lib/components/sections/analytics-section/analytics-section.component.mjs +70 -0
  8. package/esm2022/lib/components/sections/base-section.component.mjs +335 -0
  9. package/esm2022/lib/components/sections/brand-colors-section/brand-colors-section.component.mjs +89 -0
  10. package/esm2022/lib/components/sections/chart-section/chart-section.component.mjs +92 -0
  11. package/esm2022/lib/components/sections/contact-card-section/contact-card-section.component.mjs +70 -0
  12. package/esm2022/lib/components/sections/event-section/event-section.component.mjs +32 -0
  13. package/esm2022/lib/components/sections/fallback-section/fallback-section.component.mjs +16 -0
  14. package/esm2022/lib/components/sections/financials-section/financials-section.component.mjs +53 -0
  15. package/esm2022/lib/components/sections/info-section.component.mjs +68 -0
  16. package/esm2022/lib/components/sections/list-section/list-section.component.mjs +36 -0
  17. package/esm2022/lib/components/sections/map-section/map-section.component.mjs +52 -0
  18. package/esm2022/lib/components/sections/network-card-section/network-card-section.component.mjs +41 -0
  19. package/esm2022/lib/components/sections/news-section/news-section.component.mjs +44 -0
  20. package/esm2022/lib/components/sections/overview-section/overview-section.component.mjs +47 -0
  21. package/esm2022/lib/components/sections/product-section/product-section.component.mjs +129 -0
  22. package/esm2022/lib/components/sections/quotation-section/quotation-section.component.mjs +39 -0
  23. package/esm2022/lib/components/sections/social-media-section/social-media-section.component.mjs +45 -0
  24. package/esm2022/lib/components/sections/solutions-section/solutions-section.component.mjs +29 -0
  25. package/esm2022/lib/components/sections/text-reference-section/text-reference-section.component.mjs +42 -0
  26. package/esm2022/lib/icons/index.mjs +2 -0
  27. package/esm2022/lib/icons/lucide-icons.module.mjs +91 -0
  28. package/esm2022/lib/models/card.model.mjs +111 -0
  29. package/esm2022/lib/models/index.mjs +2 -0
  30. package/esm2022/lib/services/icon.service.mjs +148 -0
  31. package/esm2022/lib/services/index.mjs +5 -0
  32. package/esm2022/lib/services/magnetic-tilt.service.mjs +224 -0
  33. package/esm2022/lib/services/section-normalization.service.mjs +243 -0
  34. package/esm2022/lib/services/section-utils.service.mjs +122 -0
  35. package/esm2022/lib/utils/card-diff.util.mjs +327 -0
  36. package/esm2022/lib/utils/index.mjs +3 -0
  37. package/esm2022/lib/utils/responsive.util.mjs +14 -0
  38. package/esm2022/osi-cards-lib.mjs +5 -0
  39. package/esm2022/public-api.mjs +57 -0
  40. package/fesm2022/osi-cards-lib.mjs +3960 -0
  41. package/index.d.ts +5 -0
  42. package/lib/components/ai-card-renderer/ai-card-renderer.component.d.ts +163 -0
  43. package/lib/components/card-preview/card-preview.component.d.ts +52 -0
  44. package/lib/components/card-skeleton/card-skeleton.component.d.ts +8 -0
  45. package/lib/components/masonry-grid/masonry-grid.component.d.ts +72 -0
  46. package/lib/components/section-renderer/section-renderer.component.d.ts +25 -0
  47. package/lib/components/sections/analytics-section/analytics-section.component.d.ts +32 -0
  48. package/lib/components/sections/base-section.component.d.ts +138 -0
  49. package/lib/components/sections/brand-colors-section/brand-colors-section.component.d.ts +28 -0
  50. package/lib/components/sections/chart-section/chart-section.component.d.ts +30 -0
  51. package/lib/components/sections/contact-card-section/contact-card-section.component.d.ts +35 -0
  52. package/lib/components/sections/event-section/event-section.component.d.ts +17 -0
  53. package/lib/components/sections/fallback-section/fallback-section.component.d.ts +7 -0
  54. package/lib/components/sections/financials-section/financials-section.component.d.ts +27 -0
  55. package/lib/components/sections/info-section.component.d.ts +33 -0
  56. package/lib/components/sections/list-section/list-section.component.d.ts +21 -0
  57. package/lib/components/sections/map-section/map-section.component.d.ts +22 -0
  58. package/lib/components/sections/network-card-section/network-card-section.component.d.ts +18 -0
  59. package/lib/components/sections/news-section/news-section.component.d.ts +16 -0
  60. package/lib/components/sections/overview-section/overview-section.component.d.ts +19 -0
  61. package/lib/components/sections/product-section/product-section.component.d.ts +57 -0
  62. package/lib/components/sections/quotation-section/quotation-section.component.d.ts +23 -0
  63. package/lib/components/sections/social-media-section/social-media-section.component.d.ts +11 -0
  64. package/lib/components/sections/solutions-section/solutions-section.component.d.ts +19 -0
  65. package/lib/components/sections/text-reference-section/text-reference-section.component.d.ts +25 -0
  66. package/lib/icons/index.d.ts +1 -0
  67. package/lib/icons/lucide-icons.module.d.ts +7 -0
  68. package/lib/models/card.model.d.ts +289 -0
  69. package/lib/models/index.d.ts +1 -0
  70. package/lib/services/icon.service.d.ts +9 -0
  71. package/lib/services/index.d.ts +4 -0
  72. package/lib/services/magnetic-tilt.service.d.ts +34 -0
  73. package/lib/services/section-normalization.service.d.ts +38 -0
  74. package/lib/services/section-utils.service.d.ts +46 -0
  75. package/lib/utils/card-diff.util.d.ts +52 -0
  76. package/lib/utils/index.d.ts +2 -0
  77. package/lib/utils/responsive.util.d.ts +2 -0
  78. package/package.json +63 -0
  79. package/public-api.d.ts +50 -0
  80. package/styles/_styles.scss +95 -0
  81. package/styles/components/cards/_ai-card.scss +743 -0
  82. package/styles/components/sections/_analytics.scss +280 -0
  83. package/styles/components/sections/_brand-colors.scss +280 -0
  84. package/styles/components/sections/_chart.scss +494 -0
  85. package/styles/components/sections/_contact.scss +250 -0
  86. package/styles/components/sections/_design-system.scss +540 -0
  87. package/styles/components/sections/_event.scss +246 -0
  88. package/styles/components/sections/_fallback.scss +172 -0
  89. package/styles/components/sections/_financials.scss +258 -0
  90. package/styles/components/sections/_global-enforcement.scss +648 -0
  91. package/styles/components/sections/_info.scss +224 -0
  92. package/styles/components/sections/_list.scss +216 -0
  93. package/styles/components/sections/_map.scss +186 -0
  94. package/styles/components/sections/_network.scss +115 -0
  95. package/styles/components/sections/_news.scss +81 -0
  96. package/styles/components/sections/_overview.scss +159 -0
  97. package/styles/components/sections/_product.scss +906 -0
  98. package/styles/components/sections/_quotation.scss +151 -0
  99. package/styles/components/sections/_section-shell.scss +385 -0
  100. package/styles/components/sections/_section-types.scss +290 -0
  101. package/styles/components/sections/_sections-base.scss +332 -0
  102. package/styles/components/sections/_social-media.scss +88 -0
  103. package/styles/components/sections/_solutions.scss +205 -0
  104. package/styles/components/sections/_text-reference.scss +158 -0
  105. package/styles/components/sections/_unified-cards.scss +124 -0
  106. package/styles/core/_animations.scss +766 -0
  107. package/styles/core/_global.scss +66 -0
  108. package/styles/core/_mixins.scss +140 -0
  109. package/styles/core/_surface-layers.scss +76 -0
  110. package/styles/core/_utilities.scss +193 -0
  111. package/styles/core/_variables.scss +462 -0
  112. package/styles/core/variables/_colors.scss +212 -0
  113. package/styles/layout/_masonry.scss +60 -0
  114. package/styles/layout/_tilt.scss +214 -0
@@ -0,0 +1,46 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Status values that can be used in sections
4
+ */
5
+ export type StatusValue = 'active' | 'completed' | 'success' | 'pending' | 'warning' | 'in-progress' | 'inactive' | 'error' | 'cancelled' | 'blocked' | 'delayed' | string;
6
+ /**
7
+ * Priority values that can be used in sections
8
+ */
9
+ export type PriorityValue = 'high' | 'medium' | 'low' | string;
10
+ /**
11
+ * Trend values for analytics
12
+ */
13
+ export type TrendValue = 'up' | 'down' | 'stable' | 'neutral';
14
+ /**
15
+ * Utility service for section components
16
+ * Provides consistent status, trend, and icon handling across all sections
17
+ */
18
+ export declare class SectionUtilsService {
19
+ /**
20
+ * Get CSS classes for status badges/tags
21
+ * Returns consistent classes across all section types
22
+ */
23
+ getStatusClasses(status?: StatusValue): string;
24
+ /**
25
+ * Get CSS classes for priority badges/tags
26
+ */
27
+ getPriorityClasses(priority?: PriorityValue): string;
28
+ /**
29
+ * Get icon name for trend indicators
30
+ */
31
+ getTrendIcon(trend?: TrendValue | string): string;
32
+ /**
33
+ * Get CSS classes for trend indicators
34
+ */
35
+ getTrendClass(trend?: TrendValue | string | number): string;
36
+ /**
37
+ * Calculate trend from change value
38
+ */
39
+ calculateTrend(change?: number): TrendValue;
40
+ /**
41
+ * Format change value with sign
42
+ */
43
+ formatChange(change?: number): string;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<SectionUtilsService, never>;
45
+ static ɵprov: i0.ɵɵInjectableDeclaration<SectionUtilsService>;
46
+ }
@@ -0,0 +1,52 @@
1
+ import { AICardConfig } from '../models';
2
+ export type CardChangeType = 'content' | 'structural';
3
+ export interface CardDiffResult {
4
+ card: AICardConfig;
5
+ changeType: CardChangeType;
6
+ }
7
+ /**
8
+ * Deep comparison utility for card objects
9
+ * Uses content hashing instead of JSON.stringify for better performance
10
+ */
11
+ export declare class CardDiffUtil {
12
+ /**
13
+ * Creates an updated card with only changed sections/fields updated
14
+ * Preserves references to unchanged sections for optimal performance
15
+ */
16
+ static mergeCardUpdates(oldCard: AICardConfig, newCard: AICardConfig): CardDiffResult;
17
+ private static didStructureChange;
18
+ /**
19
+ * Merges sections array, preserving references to unchanged sections
20
+ */
21
+ private static mergeSections;
22
+ /**
23
+ * Merges a single section, preserving references to unchanged fields/items
24
+ */
25
+ private static mergeSection;
26
+ /**
27
+ * Merges fields array, preserving references to unchanged fields
28
+ * Uses content hashing instead of JSON.stringify for better performance
29
+ */
30
+ private static mergeFields;
31
+ /**
32
+ * Merges items array, preserving references to unchanged items
33
+ * Uses content hashing instead of JSON.stringify for better performance
34
+ */
35
+ private static mergeItems;
36
+ /**
37
+ * Fast equality check for cards
38
+ */
39
+ private static areCardsEqual;
40
+ /**
41
+ * Fast equality check for sections arrays
42
+ */
43
+ private static areSectionsEqual;
44
+ /**
45
+ * Fast equality check for fields arrays
46
+ */
47
+ private static areFieldsEqual;
48
+ /**
49
+ * Fast equality check for items arrays
50
+ */
51
+ private static areItemsEqual;
52
+ }
@@ -0,0 +1,2 @@
1
+ export * from './card-diff.util';
2
+ export * from './responsive.util';
@@ -0,0 +1,2 @@
1
+ export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
2
+ export declare function getBreakpointFromWidth(width: number): Breakpoint;
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "osi-cards-lib",
3
+ "version": "1.0.0",
4
+ "description": "Standalone OSI Cards library for Angular applications",
5
+ "keywords": [
6
+ "angular",
7
+ "cards",
8
+ "ui",
9
+ "components"
10
+ ],
11
+ "author": "",
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/Inutilepat83/OSI-Cards.git"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/Inutilepat83/OSI-Cards/issues"
19
+ },
20
+ "homepage": "https://github.com/Inutilepat83/OSI-Cards#readme",
21
+ "peerDependencies": {
22
+ "@angular/core": "^20.0.0",
23
+ "@angular/common": "^20.0.0",
24
+ "@angular/forms": "^20.0.0",
25
+ "@angular/router": "^20.0.0",
26
+ "@angular/platform-browser": "^20.0.0",
27
+ "@ngrx/store": "^18.0.0",
28
+ "@ngrx/effects": "^18.0.0",
29
+ "@ngrx/entity": "^18.0.0",
30
+ "rxjs": "~7.8.0",
31
+ "zone.js": "~0.15.0"
32
+ },
33
+ "dependencies": {
34
+ "lucide-angular": "^0.548.0",
35
+ "lucide": "^0.548.0",
36
+ "tslib": "^2.3.0"
37
+ },
38
+ "optionalDependencies": {
39
+ "chart.js": "^4.4.0",
40
+ "leaflet": "^1.9.4"
41
+ },
42
+ "exports": {
43
+ "./package.json": {
44
+ "default": "./package.json"
45
+ },
46
+ ".": {
47
+ "types": "./index.d.ts",
48
+ "esm2022": "./esm2022/osi-cards-lib.mjs",
49
+ "esm": "./esm2022/osi-cards-lib.mjs",
50
+ "default": "./fesm2022/osi-cards-lib.mjs"
51
+ },
52
+ "./styles/_styles": {
53
+ "default": "./styles/_styles.scss"
54
+ },
55
+ "./styles/_styles.scss": {
56
+ "default": "./styles/_styles.scss"
57
+ }
58
+ },
59
+ "main": "./fesm2022/osi-cards-lib.mjs",
60
+ "module": "./fesm2022/osi-cards-lib.mjs",
61
+ "typings": "./index.d.ts",
62
+ "sideEffects": false
63
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Public API Surface of OSI Cards Library
3
+ *
4
+ * This file exports all public APIs that can be imported by other Angular projects.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { AICardRendererComponent, CardDataService } from '@osi/cards-lib';
9
+ * ```
10
+ */
11
+ export * from './lib/models';
12
+ export * from './lib/services';
13
+ export * from './lib/services/section-utils.service';
14
+ export * from './lib/utils';
15
+ export * from './lib/icons';
16
+ export * from './lib/components/ai-card-renderer/ai-card-renderer.component';
17
+ export * from './lib/components/section-renderer/section-renderer.component';
18
+ export * from './lib/components/masonry-grid/masonry-grid.component';
19
+ export * from './lib/components/card-skeleton/card-skeleton.component';
20
+ export * from './lib/components/card-preview/card-preview.component';
21
+ export * from './lib/components/sections/base-section.component';
22
+ export * from './lib/components/sections/analytics-section/analytics-section.component';
23
+ export * from './lib/components/sections/brand-colors-section/brand-colors-section.component';
24
+ export * from './lib/components/sections/chart-section/chart-section.component';
25
+ export * from './lib/components/sections/contact-card-section/contact-card-section.component';
26
+ export * from './lib/components/sections/event-section/event-section.component';
27
+ export * from './lib/components/sections/fallback-section/fallback-section.component';
28
+ export * from './lib/components/sections/financials-section/financials-section.component';
29
+ export * from './lib/components/sections/info-section.component';
30
+ export * from './lib/components/sections/list-section/list-section.component';
31
+ export * from './lib/components/sections/map-section/map-section.component';
32
+ export * from './lib/components/sections/network-card-section/network-card-section.component';
33
+ export * from './lib/components/sections/news-section/news-section.component';
34
+ export * from './lib/components/sections/overview-section/overview-section.component';
35
+ export * from './lib/components/sections/product-section/product-section.component';
36
+ export * from './lib/components/sections/quotation-section/quotation-section.component';
37
+ export * from './lib/components/sections/social-media-section/social-media-section.component';
38
+ export * from './lib/components/sections/solutions-section/solutions-section.component';
39
+ export * from './lib/components/sections/text-reference-section/text-reference-section.component';
40
+ /**
41
+ * Note: For full functionality including:
42
+ * - CardDataService and other core services
43
+ * - NgRx store (actions, selectors, reducers, effects)
44
+ * - Additional utilities and providers
45
+ *
46
+ * You may need to import from the main application source or
47
+ * extend the library exports. See integration documentation for details.
48
+ *
49
+ * Styles entry point: '@osi/cards-lib/styles/_styles.scss'
50
+ */
@@ -0,0 +1,95 @@
1
+ // Core variables and mixins (must come first)
2
+ @import 'core/variables';
3
+ @import 'core/mixins';
4
+ @import 'core/surface-layers';
5
+ @import 'core/global';
6
+ @import 'core/utilities';
7
+ @import 'core/animations';
8
+
9
+ // Layout styles
10
+ @import 'layout/tilt';
11
+ @import 'layout/masonry';
12
+
13
+ // Component styles
14
+ @import 'components/cards/ai-card';
15
+ @import 'components/sections/design-system'; /* Master design system - must import first */
16
+ @import 'components/sections/sections-base';
17
+ @import 'components/sections/section-types';
18
+ @import 'components/sections/section-shell';
19
+ @import 'components/sections/overview';
20
+ @import 'components/sections/analytics';
21
+ @import 'components/sections/news';
22
+ @import 'components/sections/social-media';
23
+ @import 'components/sections/info';
24
+ @import 'components/sections/map';
25
+ @import 'components/sections/list';
26
+ @import 'components/sections/contact';
27
+ @import 'components/sections/network';
28
+ @import 'components/sections/product';
29
+ @import 'components/sections/chart';
30
+ @import 'components/sections/event';
31
+ @import 'components/sections/financials';
32
+ @import 'components/sections/solutions';
33
+ @import 'components/sections/quotation';
34
+ @import 'components/sections/text-reference';
35
+ @import 'components/sections/brand-colors';
36
+ @import 'components/sections/fallback';
37
+ @import 'components/sections/unified-cards'; /* Must be last to override all section-specific styles */
38
+ @import 'components/sections/global-enforcement'; /* GLOBAL ENFORCEMENT - MUST BE ABSOLUTELY LAST to enforce all settings */
39
+ @import 'components/ai-card-renderer';
40
+
41
+ /* FINAL OVERRIDE - ABSOLUTELY NO BORDERS OR BORDER-LIKE EFFECTS */
42
+ h1.ai-card-title,
43
+ .ai-card-title,
44
+ article.ai-card-surface h1,
45
+ .ai-card-surface > h1,
46
+ .ai-card-surface .ai-card-title {
47
+ border: 0 !important;
48
+ border-width: 0 !important;
49
+ border-style: none !important;
50
+ border-top-width: 0 !important;
51
+ border-right-width: 0 !important;
52
+ border-bottom-width: 0 !important;
53
+ border-left-width: 0 !important;
54
+ box-shadow: none !important;
55
+ outline: 0 !important;
56
+ outline-width: 0 !important;
57
+ text-decoration: none !important;
58
+ background-image: none !important;
59
+
60
+ &::before,
61
+ &::after {
62
+ display: none !important;
63
+ content: none !important;
64
+ border: 0 !important;
65
+ box-shadow: none !important;
66
+ background: none !important;
67
+ }
68
+ }
69
+
70
+ /* Remove all styling from parent container */
71
+ .relative.h-full,
72
+ div[class*="relative"][class*="h-full"] {
73
+ position: static !important;
74
+ height: auto !important;
75
+ padding: 0 !important;
76
+ margin: 0 !important;
77
+ border: 0 !important;
78
+ background: none !important;
79
+ box-shadow: none !important;
80
+ }
81
+
82
+ /* Also ensure article itself has no borders */
83
+ article.ai-card-surface,
84
+ .ai-card-surface {
85
+ border: 0 !important;
86
+ border-width: 0 !important;
87
+ outline: 0 !important;
88
+ }
89
+
90
+
91
+
92
+
93
+
94
+
95
+