@capillarytech/blaze-ui 5.0.9 → 5.0.10

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 (39) hide show
  1. package/.npmrc +2 -0
  2. package/CapCondition/messages.d.ts +85 -0
  3. package/CapCondition/messages.d.ts.map +1 -0
  4. package/CapConditionPreview/MIGRATION_ANALYSIS.md +70 -0
  5. package/CapConditionPreview/README.md +40 -0
  6. package/CapConditionPreview/constants.d.ts +24 -0
  7. package/CapConditionPreview/constants.d.ts.map +1 -0
  8. package/CapConditionPreview/index.d.ts +7 -0
  9. package/CapConditionPreview/index.d.ts.map +1 -0
  10. package/CapConditionPreview/index.js +132 -184
  11. package/CapConditionPreview/index.js.map +1 -1
  12. package/CapConditionPreview/tests/USE_CASES_CapConditionPreview.md +65 -0
  13. package/CapConditionPreview/types.d.ts +82 -0
  14. package/CapConditionPreview/types.d.ts.map +1 -0
  15. package/CapNavigation/index.js +24081 -45909
  16. package/CapNavigation/index.js.map +1 -1
  17. package/CapTopBar/index.js +28663 -44982
  18. package/CapTopBar/index.js.map +1 -1
  19. package/index.d.ts +2 -2
  20. package/index.d.ts.map +1 -1
  21. package/index.js +721 -1042
  22. package/index.js.map +1 -1
  23. package/package.json +1 -1
  24. package/.DS_Store +0 -0
  25. package/CapTopBar/CapOrgSelect.d.ts +0 -12
  26. package/CapTopBar/CapOrgSelect.d.ts.map +0 -1
  27. package/CapTopBar/CapOrgSelectUtils.d.ts +0 -38
  28. package/CapTopBar/CapOrgSelectUtils.d.ts.map +0 -1
  29. package/CapTopBar/README.md +0 -146
  30. package/CapTopBar/constants.d.ts +0 -2
  31. package/CapTopBar/constants.d.ts.map +0 -1
  32. package/CapTopBar/index.d.ts +0 -11
  33. package/CapTopBar/index.d.ts.map +0 -1
  34. package/CapTopBar/themeConfig.d.ts +0 -6
  35. package/CapTopBar/themeConfig.d.ts.map +0 -1
  36. package/CapTopBar/types.d.ts +0 -106
  37. package/CapTopBar/types.d.ts.map +0 -1
  38. package/CapTopBar/utils.d.ts +0 -8
  39. package/CapTopBar/utils.d.ts.map +0 -1
package/.npmrc ADDED
@@ -0,0 +1,2 @@
1
+ npm config set scope capillarytech
2
+ //registry.npmjs.org/:_authToken=${NPM_TOKEN}
@@ -0,0 +1,85 @@
1
+ export declare const scope = "app.commonUtils.capUiLibrary.CapCondition";
2
+ declare const _default: {
3
+ selectPossibleValue: {
4
+ id: string;
5
+ defaultMessage: string;
6
+ };
7
+ searchPossibleValue: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ };
11
+ maxPossibleValues: {
12
+ id: string;
13
+ defaultMessage: string;
14
+ };
15
+ title: {
16
+ id: string;
17
+ defaultMessage: string;
18
+ };
19
+ selectTriggerEventAttribute: {
20
+ id: string;
21
+ defaultMessage: string;
22
+ };
23
+ entryTriggerEventAttribute: {
24
+ id: string;
25
+ defaultMessage: string;
26
+ };
27
+ selectDateAttribute: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ };
31
+ search: {
32
+ id: string;
33
+ defaultMessage: string;
34
+ };
35
+ noResultsFound: {
36
+ id: string;
37
+ defaultMessage: string;
38
+ };
39
+ more: {
40
+ id: string;
41
+ defaultMessage: string;
42
+ };
43
+ onMsg: {
44
+ id: string;
45
+ defaultMessage: string;
46
+ };
47
+ beforeMsg: {
48
+ id: string;
49
+ defaultMessage: string;
50
+ };
51
+ afterMsg: {
52
+ id: string;
53
+ defaultMessage: string;
54
+ };
55
+ betweenMsg: {
56
+ id: string;
57
+ defaultMessage: string;
58
+ };
59
+ daysAfterMsg: {
60
+ id: string;
61
+ defaultMessage: string;
62
+ };
63
+ daysBeforeMsg: {
64
+ id: string;
65
+ defaultMessage: string;
66
+ };
67
+ andMsg: {
68
+ id: string;
69
+ defaultMessage: string;
70
+ };
71
+ endDate: {
72
+ id: string;
73
+ defaultMessage: string;
74
+ };
75
+ of: {
76
+ id: string;
77
+ defaultMessage: string;
78
+ };
79
+ profileNameMessage: {
80
+ id: string;
81
+ defaultMessage: string;
82
+ };
83
+ };
84
+ export default _default;
85
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../components/CapCondition/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,8CAA8C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjE,wBAiFG"}
@@ -0,0 +1,70 @@
1
+ # Stage 1: Pre-Analysis Report for CapConditionPreview
2
+
3
+ ## 1. Antd Style Overrides Found
4
+
5
+ | Line # | Old Override | Can Tokenize? | Token Path | Token Value | Override Reason |
6
+ |--------|-------------|---------------|------------|-------------|-----------------|
7
+ | — | — | — | — | — | — |
8
+
9
+ **Tokenizable overrides**: 0
10
+ **Non-tokenizable overrides**: 0
11
+ **No antd overrides found - will skip theme config update.**
12
+
13
+ CapConditionPreview does not use any Ant Design components. It uses only Cap UI primitives (CapRow, CapColumn, CapLabel, CapIcon, CapTruncateList) and react-intl FormattedMessage. `styles.scss` contains only BEM class `.capConditionPreview__string` (text-overflow/ellipsis) with no `:global` or `.ant-` usage.
14
+
15
+ ---
16
+
17
+ ## 2. API Breaking Changes
18
+
19
+ | Old API | New API | Affected Props |
20
+ |---------|---------|----------------|
21
+ | — | — | None |
22
+
23
+ No Antd components are used; no v3→v6 API changes apply to this component.
24
+
25
+ ---
26
+
27
+ ## 3. Backward Compatibility Plan
28
+
29
+ | Deprecated Prop | Fallback Logic |
30
+ |----------------|----------------|
31
+ | — | — |
32
+
33
+ No deprecated props in this component.
34
+
35
+ ---
36
+
37
+ ## 4. Type Definitions Needed
38
+
39
+ - **CapConditionPreviewProps** – Main props interface (all current props with TypeScript types).
40
+ - **LinkedConditionExpression** – Shape for `additionalFields[key].expression` (operator, operand, storeSource, isStoreUploadFailed, isStoreUploadInvalid, storeUploadIsInProgress).
41
+ - **AdditionalFieldEntry** – Shape for `additionalFields[key]` (description, factId, expression).
42
+ - **DateTypeData** – Shape for `dateTypeData` (dateType, startDate, endDate, date, days, contextData with profileName).
43
+ - **DstData** – Shape for `dstData` (e.g. couponSeriesNames); optional/minimal for type safety.
44
+ - **ViewMoreLinkComponent** – React component type for `ViewMoreLink` (e.g. `React.ComponentType<{ onClick: () => void; children: React.ReactNode }>`).
45
+
46
+ Complex types: `operand` and `listData` are polymorphic (number, string, string[], etc.) depending on `type`; we will use union types or careful typing to avoid `any`.
47
+
48
+ ---
49
+
50
+ ## 5. PropTypes Removal
51
+
52
+ - [x] Component uses PropTypes: **YES**
53
+ - [x] PropTypes file exists: **NO** (PropTypes live in index.tsx)
54
+ - [x] PropTypes imports found: **YES** (`import PropTypes from 'prop-types'` in index.tsx)
55
+ - [x] Component.propTypes assignments found: **YES** (`CapConditionPreview.propTypes = { ... }` in index.tsx)
56
+ - **Action**: Remove all PropTypes and replace with TypeScript types from `types.ts`.
57
+
58
+ ---
59
+
60
+ ## 6. DefaultProps Removal
61
+
62
+ - [x] Component uses defaultProps: **NO**
63
+ - [x] Component.defaultProps assignments found: **NO**
64
+ - [x] Old function syntax with props parameter: **NO** (already uses destructuring `({ ... })`)
65
+ - [x] Default values assigned inside function body: **NO** (only `listData = null` and `hideNumberAndProductFields = false` in destructuring)
66
+ - **Action**: No defaultProps to remove. Keep destructuring defaults as-is; ensure any other optional props that need defaults get them in destructuring in index.tsx.
67
+
68
+ ---
69
+
70
+ **STAGE 1 COMPLETE. Proceeding to Stage 2 (skip theme config) and Stage 3 (implementation).**
@@ -0,0 +1,40 @@
1
+ # CapConditionPreview
2
+
3
+ Preview block for condition configuration (e.g. "Include whose [condition name] is [operator] [operand]").
4
+
5
+ ## Migration (Antd v3 → v6)
6
+
7
+ - **Antd usage**: This component does **not** use any Ant Design components. It uses only Cap UI primitives (CapRow, CapColumn, CapLabel, CapIcon, CapTruncateList) and `react-intl` FormattedMessage. No theme config or antd API changes apply.
8
+ - **PropTypes removed**: All runtime PropTypes were removed and replaced with TypeScript types from `types.ts`.
9
+ - **defaultProps**: None were present; default values use destructuring in the component signature (`listData = null`, `hideNumberAndProductFields = false`).
10
+ - **Styles**: `styles.scss` has no `:global` or `.ant-` overrides. A single BEM-style class is used for the string truncation state, applied via CSS Modules (`styles.capConditionPreview__string`).
11
+
12
+ ## Props
13
+
14
+ See `types.ts` for full interfaces. Main props:
15
+
16
+ | Prop | Type | Description |
17
+ |------|------|-------------|
18
+ | `type` | `string` | Data type: NUMBER, STRING, LIST, MULTI_SELECT, STRING_LIST, DATE, entryTriggerEventAttribute, etc. |
19
+ | `operand` | `number \| string \| string[]` | Value(s) for the condition. |
20
+ | `operator` | `string` | Operator key (EQ, GT, LT, IN, NOT_IN, IS_EXACT_DATE, etc.). |
21
+ | `conditionName` | `string` | Label for the condition (e.g. "Extended fields in the transaction"). |
22
+ | `isExcluded` | `boolean` | When true, shows "Exclude" instead of "Include". |
23
+ | `listData` | `string[] \| null` | List of values for MULTI_SELECT (e.g. SKU list). Default `null`. |
24
+ | `additionalFields` | `Record<string, AdditionalFieldEntry>` | Extra condition entries (EXTENDED_FIELD, CUSTOM_FIELD, STORE_FILTER, etc.). |
25
+ | `hideNumberAndProductFields` | `boolean` | When true, hides operand/operator block (e.g. journey context). Default `false`. |
26
+ | `dateTypeData` | `DateTypeData \| null` | For DATE type: RANGE, SINGLE, DAYS_AFTER, DAYS_BEFORE. |
27
+ | `ViewMoreLink` | `ComponentType<ViewMoreLinkProps>` | Custom link component for "View more" (e.g. store filter). |
28
+ | `onClickConfigure` | `(blockId: string) => void` | Called when "View more" is clicked. |
29
+ | `setPopoverVisible` | `(visible: boolean) => void` | Called to close popover when "View more" is used. |
30
+
31
+ Message props (`includeMsg`, `excludeMsg`, `whoseMsg`, `equalMsg`, etc.) are typically provided by `LocaleHoc` from translations.
32
+
33
+ ## Breaking changes
34
+
35
+ None. This component did not use antd or deprecated APIs.
36
+
37
+ ## Dependencies
38
+
39
+ - `classnames`, `lodash`, `react-intl` (already in blaze-ui dependencies).
40
+ - No new package.json entries required for this migration.
@@ -0,0 +1,24 @@
1
+ export declare const LIST = "LIST";
2
+ export declare const MULTI_SELECT = "MULTI_SELECT";
3
+ export declare const NUMBER = "NUMBER";
4
+ export declare const STRING = "STRING";
5
+ export declare const DATE_TYPE = "DATE";
6
+ export declare const PRODUCT_ATTRIBUTE = "PRODUCT_ATTRIBUTE";
7
+ export declare const CUSTOM_FIELD = "CUSTOM_FIELD";
8
+ export declare const EXTENDED_FIELD = "EXTENDED_FIELD";
9
+ export declare const SKU = "SKU";
10
+ export declare const CATEGORY = "CATEGORY";
11
+ export declare const UPLOAD = "UPLOAD";
12
+ export declare const ENTRY_TRIGGER_EVENT_ATTRIBUTE = "entryTriggerEventAttribute";
13
+ export declare const STRING_LIST = "STRING_LIST";
14
+ export declare const TEXT_ON_MSG = "onMsg";
15
+ export declare const TEXT_BEFORE_MSG = "beforeMsg";
16
+ export declare const TEXT_AFTER_MSG = "afterMsg";
17
+ export declare const TEXT_BETWEEN_MSG = "betweenMsg";
18
+ export declare const TEXT_DAYS_BEFORE_MSG = "daysBeforeMsg";
19
+ export declare const TEXT_DAYS_AFTER_MSG = "daysAfterMsg";
20
+ export declare const DATE_TYPE_RANGE = "RANGE";
21
+ export declare const DATE_TYPE_SINGLE = "SINGLE";
22
+ export declare const DATE_TYPE_DAYS_AFTER = "DAYS_AFTER";
23
+ export declare const DATE_TYPE_DAYS_BEFORE = "DAYS_BEFORE";
24
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../components/CapConditionPreview/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,SAAS,SAAS,CAAC;AAChC,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAC1E,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAGzC,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AACpD,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAGlD,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,qBAAqB,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { CapConditionPreviewProps } from './types';
3
+ declare const _default: React.FC<import("react-intl").WithIntlProps<CapConditionPreviewProps & import("react-intl").WrappedComponentProps>> & {
4
+ WrappedComponent: React.ComponentType<CapConditionPreviewProps & import("react-intl").WrappedComponentProps>;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapConditionPreview/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoC1B,OAAO,KAAK,EAAE,wBAAwB,EAA6B,MAAM,SAAS,CAAC;;;;AA8anF,wBAA8E"}