cja-phoenix 0.3.4 → 0.3.6
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 +26 -10
- package/dist/cja-phoenix.es.js +3386 -3218
- package/dist/style.css +1 -1
- package/dist/types/components/composite/CheckoutCrossSell.vue.d.ts +31 -24
- package/dist/types/components/composite/CheckoutLayout.vue.d.ts +11 -14
- package/dist/types/components/composite/CheckoutMilestones.vue.d.ts +10 -13
- package/dist/types/components/composite/CjaMenuBar.vue.d.ts +25 -32
- package/dist/types/components/composite/FunnelLayout.vue.d.ts +23 -20
- package/dist/types/components/composite/FunnelSubmit.vue.d.ts +15 -16
- package/dist/types/components/composite/FunnelSummary.vue.d.ts +54 -55
- package/dist/types/components/composite/FunnelTitle.vue.d.ts +22 -17
- package/dist/types/components/composite/InfoShowcase.vue.d.ts +24 -21
- package/dist/types/components/composite/JourneyMacroSteps.vue.d.ts +10 -13
- package/dist/types/components/forms/CheckboxInput.vue.d.ts +33 -32
- package/dist/types/components/forms/CurrencyInput.vue.d.ts +80 -53
- package/dist/types/components/forms/FileInput.vue.d.ts +92 -67
- package/dist/types/components/forms/NumberInput.vue.d.ts +63 -48
- package/dist/types/components/forms/PhoneInput.vue.d.ts +92 -57
- package/dist/types/components/forms/RadioInput.vue.d.ts +53 -38
- package/dist/types/components/forms/SelectInput.vue.d.ts +108 -67
- package/dist/types/components/forms/SelectionTiles.vue.d.ts +54 -41
- package/dist/types/components/forms/TextInput.vue.d.ts +104 -61
- package/dist/types/components/forms/TileCheckboxInput.vue.d.ts +31 -20
- package/dist/types/components/forms/ToggleInput.vue.d.ts +63 -44
- package/dist/types/components/forms/structure/InputContainer.vue.d.ts +9 -14
- package/dist/types/components/forms/structure/InputError.vue.d.ts +10 -13
- package/dist/types/components/forms/structure/InputTitle.vue.d.ts +22 -17
- package/dist/types/components/structural/CjaButton.vue.d.ts +47 -42
- package/dist/types/components/structural/CollapseContainer.vue.d.ts +22 -33
- package/dist/types/components/structural/ContentTabs.vue.d.ts +20 -17
- package/dist/types/components/structural/FixedContainer.vue.d.ts +56 -55
- package/dist/types/components/structural/GridContainer.vue.d.ts +11 -26
- package/dist/types/components/structural/GridItem.vue.d.ts +21 -18
- package/dist/types/components/structural/InfoMessage.vue.d.ts +29 -20
- package/dist/types/components/structural/LoadingSpinner.vue.d.ts +15 -16
- package/dist/types/components/structural/Modal.vue.d.ts +10 -15
- package/dist/types/utils/formValidations.d.ts +20 -2
- package/dist/types/utils/getFromUrl.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/composite/CheckoutCrossSell.vue +50 -52
- package/src/components/structural/CjaButton.vue +1 -1
- package/src/stories/CjaButton.story.vue +2 -1
- package/src/stories/ContentTabs.story.vue +1 -1
- package/src/stories/Modal.story.vue +1 -1
- package/src/utils/cjaStore.ts +9 -6
- package/src/utils/formValidations.ts +67 -10
- package/src/utils/getFromUrl.ts +14 -6
- /package/src/utils/{getI18nMessages.ts → GetI18nMessages.ts} +0 -0
- /package/src/utils/{jsonReviver.ts → JsonReviver.ts} +0 -0
package/README.md
CHANGED
|
@@ -23,18 +23,18 @@ npm run docs:serve
|
|
|
23
23
|
|
|
24
24
|
## Develop and test locally
|
|
25
25
|
|
|
26
|
-
The best way to develop and test your component is by creating
|
|
26
|
+
The best way to develop and test your component is by creating stories in `src/stories` folder.
|
|
27
27
|
|
|
28
28
|
If you want to test the library in your Vue3 app locally:
|
|
29
29
|
|
|
30
|
-
- In the root folder of this library, run `npm link`. This will create a symbolic link to the library.
|
|
31
|
-
- In the
|
|
30
|
+
- In the root folder of this library, run `npm run build:link`. This will build the library for development and create a symbolic link to the library.
|
|
31
|
+
- In the `package.json` of the client app add the script: `reload: npm link cja-phoenix && npm run serve`, this will grab the symbolic link created by running `npm run build:link`.
|
|
32
32
|
- You can now import `cja-phoenix` in your client app.
|
|
33
|
-
- The library can be installed on your app with the `App.use()` function
|
|
33
|
+
- The library can be installed on your app with the `App.use()` function
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
In order to expedite this process, the `npm run build:link` can be used on Phoenix's side to build and link the library
|
|
36
36
|
|
|
37
|
-
If you made changes to the library, you will need to
|
|
37
|
+
If you made changes to the library, you will need to run `npm run build:link`
|
|
38
38
|
|
|
39
39
|
## Publishing
|
|
40
40
|
|
|
@@ -58,7 +58,21 @@ module.exports = {
|
|
|
58
58
|
};
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
>
|
|
61
|
+
> :warning: **When developing components, always import library resources directly from their source files.**
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
// Do this
|
|
65
|
+
import CjaButton from "../components/structural/CjaButton.vue";
|
|
66
|
+
|
|
67
|
+
// Instead of this
|
|
68
|
+
import { CjaButton } from "../components";
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This is due to the **07/2023 Histoire Incident**, during which `histoire build` would fail during action runtime on github due to an unclear compiler error:
|
|
72
|
+
|
|
73
|
+
> Failed to load "./jsonReviver" imported from /home/runner/work/phoenix/phoenix/src/utils/index.ts
|
|
74
|
+
|
|
75
|
+
If you feel confident enough to try and resolve this issue be aware that the error may change its starting point. Good luck! :star:
|
|
62
76
|
|
|
63
77
|
### Utilities and constants
|
|
64
78
|
|
|
@@ -87,16 +101,18 @@ export default {
|
|
|
87
101
|
|
|
88
102
|
Individual components have styles defined in its `.vue` file. They will be processed, combined and minified into `dist/style.css`, which is included in the `exports` list in [package.json](package.json).
|
|
89
103
|
|
|
90
|
-
If you have library level styles shared by all components in the library, you may add them to [src/assets/main.scss](src/assets/main.scss). This file is imported in [index.ts](src/index.ts), the processed styles are also included into `dist/style.css`.
|
|
104
|
+
If you have library level styles shared by all components in the library, you may add them to [src/assets/main.scss](src/assets/main.scss). This file is imported in [index.ts](src/index.ts), the processed styles are also included into `dist/style.css`.
|
|
91
105
|
|
|
92
106
|
If you have your own special set of SVG icons, you may create a font file (`.woff` format) using tools like [Icomoon](https://icomoon.io/) or [Fontello](https://fontello.com/). Vite will include the font file into the build, see [https://vitejs.dev/guide/assets.html](https://vitejs.dev/guide/assets.html).
|
|
93
107
|
|
|
94
|
-
The client app
|
|
108
|
+
The client app must import `style.css` in its entry file:
|
|
95
109
|
|
|
96
110
|
```js
|
|
97
|
-
import "cja-phoenix/
|
|
111
|
+
import "cja-phoenix/style.css";
|
|
98
112
|
```
|
|
99
113
|
|
|
114
|
+
Any additional styles (such as Tippy's or intl-tel-input) must be imported manually in the consuming app's entry file
|
|
115
|
+
|
|
100
116
|
### Third-party dependencies
|
|
101
117
|
|
|
102
118
|
Third-party libraries used by you library may bloat up the size of your library, if you simply add them to the `dependencies` in [package.json](package.json).
|