@cranberry-money/shared-constants 3.0.0 → 3.0.1

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,15 @@
1
+ /**
2
+ * Asset allocation-related constants for the MyPortfolio platform.
3
+ *
4
+ * These constants define rules and defaults used in portfolio asset allocation
5
+ * across web and mobile applications.
6
+ */
7
+ export declare const DEFAULT_ALLOCATION_PERCENTAGE = 10;
8
+ export declare const PERCENTAGE_PRECISION = 0.01;
9
+ export declare const TARGET_ALLOCATION_TOTAL = 100;
10
+ export declare const MIN_ALLOCATION_PERCENTAGE = 0.01;
11
+ export declare const MAX_ALLOCATION_PERCENTAGE = 100;
12
+ export declare const MAX_ALLOCATIONS_PER_PORTFOLIO = 20;
13
+ export declare const ALLOCATION_STEP_PERCENTAGE = 1;
14
+ export declare const ALLOCATION_QUICK_STEPS: readonly [5, 10, 15, 20, 25];
15
+ //# sourceMappingURL=allocation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allocation.d.ts","sourceRoot":"","sources":["../src/allocation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAChD,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAG3C,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAC7C,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAGhD,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,sBAAsB,8BAA+B,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Asset allocation-related constants for the MyPortfolio platform.
3
+ *
4
+ * These constants define rules and defaults used in portfolio asset allocation
5
+ * across web and mobile applications.
6
+ */
7
+ // Asset allocation defaults
8
+ export const DEFAULT_ALLOCATION_PERCENTAGE = 10;
9
+ export const PERCENTAGE_PRECISION = 0.01;
10
+ export const TARGET_ALLOCATION_TOTAL = 100;
11
+ // Allocation limits
12
+ export const MIN_ALLOCATION_PERCENTAGE = 0.01;
13
+ export const MAX_ALLOCATION_PERCENTAGE = 100;
14
+ export const MAX_ALLOCATIONS_PER_PORTFOLIO = 20;
15
+ // Allocation adjustment
16
+ export const ALLOCATION_STEP_PERCENTAGE = 1;
17
+ export const ALLOCATION_QUICK_STEPS = [5, 10, 15, 20, 25];
package/dist/index.d.ts CHANGED
@@ -5,5 +5,7 @@ export * from './common';
5
5
  export * from './time';
6
6
  export * from './currency';
7
7
  export * from './http';
8
+ export * from './validation';
9
+ export * from './allocation';
8
10
  export * from './ui';
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AAGvB,cAAc,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAG7B,cAAc,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -6,5 +6,7 @@ export * from './common';
6
6
  export * from './time';
7
7
  export * from './currency';
8
8
  export * from './http';
9
+ export * from './validation';
10
+ export * from './allocation';
9
11
  // Re-export UI constants
10
12
  export * from './ui';
@@ -28,4 +28,14 @@ export declare const STATUS_COLORS: {
28
28
  readonly error: "#EF4444";
29
29
  readonly neutral: "#6B7280";
30
30
  };
31
+ export declare const STATUS_COLOR_PENDING = "text-warning-600";
32
+ export declare const STATUS_COLOR_AWAITING = "text-warning-600";
33
+ export declare const STATUS_COLOR_PROCESSING = "text-primary-600";
34
+ export declare const STATUS_COLOR_IN_PROGRESS = "text-primary-600";
35
+ export declare const STATUS_COLOR_APPROVED = "text-success-600";
36
+ export declare const STATUS_COLOR_COMPLETED = "text-success-700";
37
+ export declare const STATUS_COLOR_REJECTED = "text-error-600";
38
+ export declare const STATUS_COLOR_FAILED = "text-error-700";
39
+ export declare const STATUS_COLOR_CANCELLED = "text-content-subtle";
40
+ export declare const STATUS_COLOR_DEFAULT = "text-content-subtle";
31
41
  //# sourceMappingURL=status.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/ui/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAGpF,eAAO,MAAM,aAAa;;;;;;;;;;;CAoBhB,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/ui/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAGpF,eAAO,MAAM,aAAa;;;;;;;;;;;CAoBhB,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAKX,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAGxD,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAC1D,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAG3D,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AACxD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAGzD,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AACtD,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAGpD,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAC5D,eAAO,MAAM,oBAAoB,wBAAwB,CAAC"}
package/dist/ui/status.js CHANGED
@@ -34,3 +34,20 @@ export const STATUS_COLORS = {
34
34
  error: '#EF4444', // Red/Error
35
35
  neutral: '#6B7280', // Gray/Neutral
36
36
  };
37
+ // Web-specific Tailwind class mappings
38
+ // These are for Blueberry web application use
39
+ // Pending/Waiting states
40
+ export const STATUS_COLOR_PENDING = 'text-warning-600';
41
+ export const STATUS_COLOR_AWAITING = 'text-warning-600';
42
+ // Active/Processing states
43
+ export const STATUS_COLOR_PROCESSING = 'text-primary-600';
44
+ export const STATUS_COLOR_IN_PROGRESS = 'text-primary-600';
45
+ // Success states
46
+ export const STATUS_COLOR_APPROVED = 'text-success-600';
47
+ export const STATUS_COLOR_COMPLETED = 'text-success-700';
48
+ // Error states
49
+ export const STATUS_COLOR_REJECTED = 'text-error-600';
50
+ export const STATUS_COLOR_FAILED = 'text-error-700';
51
+ // Neutral states
52
+ export const STATUS_COLOR_CANCELLED = 'text-content-subtle';
53
+ export const STATUS_COLOR_DEFAULT = 'text-content-subtle';
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Validation-related constants for the MyPortfolio platform.
3
+ *
4
+ * These constants define validation rules and limits used across
5
+ * web and mobile applications.
6
+ */
7
+ export declare const PASSWORD_MIN_LENGTH = 8;
8
+ export declare const PASSWORD_MAX_LENGTH = 128;
9
+ export declare const TOKEN_MIN_LENGTH = 6;
10
+ export declare const TOKEN_MAX_LENGTH = 20;
11
+ export declare const EMAIL_MAX_LENGTH = 254;
12
+ export declare const NAME_MIN_LENGTH = 1;
13
+ export declare const NAME_MAX_LENGTH = 50;
14
+ export declare const FULL_NAME_MAX_LENGTH = 100;
15
+ export declare const PHONE_MIN_LENGTH = 10;
16
+ export declare const PHONE_MAX_LENGTH = 15;
17
+ export declare const ADDRESS_MIN_LENGTH = 5;
18
+ export declare const ADDRESS_MAX_LENGTH = 200;
19
+ export declare const POSTAL_CODE_MAX_LENGTH = 10;
20
+ export declare const AMOUNT_MIN_VALUE = 0.01;
21
+ export declare const AMOUNT_MAX_VALUE = 999999999.99;
22
+ export declare const PERCENTAGE_MIN_VALUE = 0;
23
+ export declare const PERCENTAGE_MAX_VALUE = 100;
24
+ export declare const TEXT_SHORT_MAX_LENGTH = 50;
25
+ export declare const TEXT_MEDIUM_MAX_LENGTH = 200;
26
+ export declare const TEXT_LONG_MAX_LENGTH = 1000;
27
+ /**
28
+ * Consolidated validation rules object for convenience
29
+ * @deprecated Use individual constants instead for better tree-shaking
30
+ */
31
+ export declare const VALIDATION_RULES: {
32
+ readonly PASSWORD_MIN_LENGTH: 8;
33
+ readonly PASSWORD_MAX_LENGTH: 128;
34
+ readonly TOKEN_MIN_LENGTH: 6;
35
+ readonly TOKEN_MAX_LENGTH: 20;
36
+ readonly EMAIL_MAX_LENGTH: 254;
37
+ readonly NAME_MIN_LENGTH: 1;
38
+ readonly NAME_MAX_LENGTH: 50;
39
+ readonly FULL_NAME_MAX_LENGTH: 100;
40
+ readonly PHONE_MIN_LENGTH: 10;
41
+ readonly PHONE_MAX_LENGTH: 15;
42
+ readonly ADDRESS_MIN_LENGTH: 5;
43
+ readonly ADDRESS_MAX_LENGTH: 200;
44
+ readonly POSTAL_CODE_MAX_LENGTH: 10;
45
+ readonly AMOUNT_MIN_VALUE: 0.01;
46
+ readonly AMOUNT_MAX_VALUE: 999999999.99;
47
+ readonly PERCENTAGE_MIN_VALUE: 0;
48
+ readonly PERCENTAGE_MAX_VALUE: 100;
49
+ readonly TEXT_SHORT_MAX_LENGTH: 50;
50
+ readonly TEXT_MEDIUM_MAX_LENGTH: 200;
51
+ readonly TEXT_LONG_MAX_LENGTH: 1000;
52
+ };
53
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAGvC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAGnC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAGpC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAGxC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAGnC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAGzC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAGxC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CAqBnB,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Validation-related constants for the MyPortfolio platform.
3
+ *
4
+ * These constants define validation rules and limits used across
5
+ * web and mobile applications.
6
+ */
7
+ // Password validation rules
8
+ export const PASSWORD_MIN_LENGTH = 8;
9
+ export const PASSWORD_MAX_LENGTH = 128;
10
+ // Token validation rules
11
+ export const TOKEN_MIN_LENGTH = 6;
12
+ export const TOKEN_MAX_LENGTH = 20;
13
+ // Email validation
14
+ export const EMAIL_MAX_LENGTH = 254; // RFC 5321
15
+ // Name validation
16
+ export const NAME_MIN_LENGTH = 1;
17
+ export const NAME_MAX_LENGTH = 50;
18
+ export const FULL_NAME_MAX_LENGTH = 100;
19
+ // Phone validation
20
+ export const PHONE_MIN_LENGTH = 10;
21
+ export const PHONE_MAX_LENGTH = 15;
22
+ // Address validation
23
+ export const ADDRESS_MIN_LENGTH = 5;
24
+ export const ADDRESS_MAX_LENGTH = 200;
25
+ export const POSTAL_CODE_MAX_LENGTH = 10;
26
+ // Financial validation
27
+ export const AMOUNT_MIN_VALUE = 0.01;
28
+ export const AMOUNT_MAX_VALUE = 999999999.99;
29
+ export const PERCENTAGE_MIN_VALUE = 0;
30
+ export const PERCENTAGE_MAX_VALUE = 100;
31
+ // Generic text validation
32
+ export const TEXT_SHORT_MAX_LENGTH = 50;
33
+ export const TEXT_MEDIUM_MAX_LENGTH = 200;
34
+ export const TEXT_LONG_MAX_LENGTH = 1000;
35
+ /**
36
+ * Consolidated validation rules object for convenience
37
+ * @deprecated Use individual constants instead for better tree-shaking
38
+ */
39
+ export const VALIDATION_RULES = {
40
+ PASSWORD_MIN_LENGTH,
41
+ PASSWORD_MAX_LENGTH,
42
+ TOKEN_MIN_LENGTH,
43
+ TOKEN_MAX_LENGTH,
44
+ EMAIL_MAX_LENGTH,
45
+ NAME_MIN_LENGTH,
46
+ NAME_MAX_LENGTH,
47
+ FULL_NAME_MAX_LENGTH,
48
+ PHONE_MIN_LENGTH,
49
+ PHONE_MAX_LENGTH,
50
+ ADDRESS_MIN_LENGTH,
51
+ ADDRESS_MAX_LENGTH,
52
+ POSTAL_CODE_MAX_LENGTH,
53
+ AMOUNT_MIN_VALUE,
54
+ AMOUNT_MAX_VALUE,
55
+ PERCENTAGE_MIN_VALUE,
56
+ PERCENTAGE_MAX_VALUE,
57
+ TEXT_SHORT_MAX_LENGTH,
58
+ TEXT_MEDIUM_MAX_LENGTH,
59
+ TEXT_LONG_MAX_LENGTH,
60
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cranberry-money/shared-constants",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Shared constants for MyPortfolio platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",