@designcrowd/fe-shared-lib 1.5.0-jj-4 → 1.5.1-icontranslation

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 (180) hide show
  1. package/.claude/settings.local.json +17 -0
  2. package/.claude/skills/publishing-test-versions.md +285 -0
  3. package/.eslintrc.js +1 -0
  4. package/.storybook/image-1.png +0 -0
  5. package/.storybook/image-2.png +0 -0
  6. package/.storybook/image.png +0 -0
  7. package/.storybook/test.md +3 -0
  8. package/APasking.md +9 -0
  9. package/CLAUDE.md +227 -65
  10. package/GT-8753.md +127 -0
  11. package/docs/plans/2025-11-03-typescript-declarations-design.md +222 -0
  12. package/package.json +1 -1
  13. package/public/css/tailwind-brandCrowd.css +3 -6
  14. package/public/css/tailwind-brandPage.css +3 -6
  15. package/public/css/tailwind-crazyDomains.css +3 -6
  16. package/public/css/tailwind-designCom.css +3 -6
  17. package/public/css/tailwind-designCrowd.css +3 -6
  18. package/src/atoms/components/SparkleIcon/SparkleIcon.stories.js +207 -3
  19. package/src/atoms/components/SparkleIcon/SparkleIcon.vue +46 -7
  20. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-01.svg +5 -0
  21. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-02.svg +14 -0
  22. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-03.svg +14 -0
  23. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-04.svg +14 -0
  24. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-05.svg +14 -0
  25. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-06.svg +14 -0
  26. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-07.svg +14 -0
  27. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-08.svg +14 -0
  28. package/src/atoms/components/SparkleIcon/sparkle-paths.ts +1 -0
  29. package/src/atoms/components/SparkleIcon/sparkle-with-spinner-paths.ts +61 -0
  30. package/src/atoms/components/design-com/Icon/Icon.stories.js +62 -0
  31. package/src/atoms/components/design-com/Icon/Icon.vue +7 -2
  32. package/src/experiences/components/PublishBrandPageModal/PublishBrandPageModal.stories.js +0 -36
  33. package/src/experiences/components/PublishBrandPageModal/PublishBrandPageModal.vue +297 -100
  34. package/.storybook-static/assets/Auth-CV5AmoX8.css +0 -1
  35. package/.storybook-static/assets/Auth.stories-CX3sjxh5.js +0 -490
  36. package/.storybook-static/assets/AuthCrazyDomains.stories-Didj_VFa.js +0 -73
  37. package/.storybook-static/assets/Button-5UzSGUF6.css +0 -1
  38. package/.storybook-static/assets/Button-DtVlr_q3.js +0 -1
  39. package/.storybook-static/assets/ButtonGroup-Dfr7bNL2.css +0 -1
  40. package/.storybook-static/assets/ButtonGroup.stories-4EQk-ktb.js +0 -503
  41. package/.storybook-static/assets/ButtonPrimary-Bu6bXb_c.css +0 -1
  42. package/.storybook-static/assets/ButtonPrimary-DG9wNod9.js +0 -1
  43. package/.storybook-static/assets/Buttons.stories-B_KpeCzt.js +0 -761
  44. package/.storybook-static/assets/ButtonsCrazyDomains.stories-oZtahAmR.js +0 -199
  45. package/.storybook-static/assets/Checkbox.mixin-DkHpdvGa.js +0 -1
  46. package/.storybook-static/assets/Checkbox.stories-C67RL0ut.js +0 -203
  47. package/.storybook-static/assets/Checktile.stories-DN2wfzd6.js +0 -88
  48. package/.storybook-static/assets/CollapsiblePanel.stories-BkzrqfVG.js +0 -39
  49. package/.storybook-static/assets/ColorPicker.stories-85BQwpyF.js +0 -73
  50. package/.storybook-static/assets/CopyToClipboardText.stories-Csh5nVRs.js +0 -32
  51. package/.storybook-static/assets/Dropdown.stories-NNlxNopk.js +0 -159
  52. package/.storybook-static/assets/DropdownItem-CDX_V6Mi.js +0 -1
  53. package/.storybook-static/assets/DropdownItem-CLNmWtKh.css +0 -1
  54. package/.storybook-static/assets/FormControl.mixin-_gXRExB7.js +0 -1
  55. package/.storybook-static/assets/HashRouteModal.stories-Dy1_nLTJ.js +0 -64
  56. package/.storybook-static/assets/HelloBar-z54fob0q.js +0 -1
  57. package/.storybook-static/assets/HelloBar.stories-ClJ9_KRK.js +0 -342
  58. package/.storybook-static/assets/Icon-8mZGP41G.js +0 -144
  59. package/.storybook-static/assets/Icon.stories-BcXMvpuh.js +0 -126
  60. package/.storybook-static/assets/Icon.stories-D6ECVMta.js +0 -751
  61. package/.storybook-static/assets/Loader-D61Ki9P1.js +0 -1
  62. package/.storybook-static/assets/LogoBusinessBrandColours-B1_8hw0H.js +0 -1
  63. package/.storybook-static/assets/LogoBusinessBrandColours-DEFhAyxR.css +0 -1
  64. package/.storybook-static/assets/LogoBusinessBrandColours.stories-CIWe9ndn.js +0 -36
  65. package/.storybook-static/assets/Masonry-C2MNiGg0.css +0 -1
  66. package/.storybook-static/assets/Masonry.stories-CDT8kZCv.js +0 -71
  67. package/.storybook-static/assets/Modal-BQrpXSGA.js +0 -1
  68. package/.storybook-static/assets/Modal-BvVMN71n.css +0 -1
  69. package/.storybook-static/assets/Modal.stories-BycF7YL6.js +0 -345
  70. package/.storybook-static/assets/Notice.stories-BufkrC1b.js +0 -222
  71. package/.storybook-static/assets/NumberStepper-Blffv09R.css +0 -1
  72. package/.storybook-static/assets/NumberStepper.stories-6_y_lEgC.js +0 -64
  73. package/.storybook-static/assets/PaymentConfigList-wI1eTv5x.css +0 -1
  74. package/.storybook-static/assets/PaymentConfigList.stories-BlzzKrzz.js +0 -126
  75. package/.storybook-static/assets/Picture-Cq76CaoK.js +0 -1
  76. package/.storybook-static/assets/Picture.stories-BDqRm9_g.js +0 -119
  77. package/.storybook-static/assets/Pill-BsMeJhV9.js +0 -1
  78. package/.storybook-static/assets/Pill.stories-DUvzbtnS.js +0 -18
  79. package/.storybook-static/assets/PillBar-os4mJV3M.css +0 -1
  80. package/.storybook-static/assets/PillBar.stories-BUMLXBij.js +0 -41
  81. package/.storybook-static/assets/Price-DKOwLeD0.js +0 -1
  82. package/.storybook-static/assets/Price.stories-DlqrNUWI.js +0 -221
  83. package/.storybook-static/assets/PublishBrandPageModal-CLU8-If3.css +0 -1
  84. package/.storybook-static/assets/PublishBrandPageModal.stories-Dqobvq-n.js +0 -273
  85. package/.storybook-static/assets/SearchBar.stories-_wPX3-Rl.js +0 -12
  86. package/.storybook-static/assets/Select-Dw-zvSUg.css +0 -1
  87. package/.storybook-static/assets/Select.stories-BWINGxdY.js +0 -108
  88. package/.storybook-static/assets/SellDomainNameList.fixtures-LC6fjr_b.js +0 -1
  89. package/.storybook-static/assets/SellDomainNameListModal-ByK_ak0A.js +0 -1
  90. package/.storybook-static/assets/SellDomainNameListModal-CdfyEX1a.css +0 -1
  91. package/.storybook-static/assets/SellDomainNameListModal.stories-DrL8w2AY.js +0 -71
  92. package/.storybook-static/assets/SellDomainNameListSearchResult-1WuAKfzI.css +0 -1
  93. package/.storybook-static/assets/SellDomainNameListSearchResult-By0IpIM_.js +0 -1
  94. package/.storybook-static/assets/SellDomainNameSearchWithResults-BttjI4PH.js +0 -1
  95. package/.storybook-static/assets/SellDomainNameSearchWithResults.stories-Dm1Q8Cza.js +0 -37
  96. package/.storybook-static/assets/SellDomainNameWidget.stories-CKoz3WnZ.js +0 -36
  97. package/.storybook-static/assets/SignIn-DNYeJu86.css +0 -1
  98. package/.storybook-static/assets/SignIn-Dt8OJr0J.js +0 -1
  99. package/.storybook-static/assets/Slider-Cog2FFdj.css +0 -1
  100. package/.storybook-static/assets/Slider.stories-08DN2SFB.js +0 -141
  101. package/.storybook-static/assets/StarRating-BtKh7pzm.css +0 -1
  102. package/.storybook-static/assets/StarRating.stories-BEIj9ufA.js +0 -45
  103. package/.storybook-static/assets/TabMenu.stories-D9f0pyZI.js +0 -47
  104. package/.storybook-static/assets/TextCopyField-B04vTGbG.js +0 -1
  105. package/.storybook-static/assets/TextCopyField.stories-KD0WUWzA.js +0 -47
  106. package/.storybook-static/assets/TextInput-JK1M0hv6.js +0 -1
  107. package/.storybook-static/assets/TextInput.stories-BO0eQqBY.js +0 -233
  108. package/.storybook-static/assets/Textarea.stories-Bcn4sCkV.js +0 -207
  109. package/.storybook-static/assets/Toggle.stories-CuTFLoNh.js +0 -161
  110. package/.storybook-static/assets/Tooltip-DcSbUh5f.js +0 -1
  111. package/.storybook-static/assets/Tooltip-DyXIgFQH.css +0 -1
  112. package/.storybook-static/assets/Tooltip.stories-B0I_PBGG.js +0 -953
  113. package/.storybook-static/assets/UploadYourLogoApplication-EyTEQx-x.css +0 -9
  114. package/.storybook-static/assets/UploadYourLogoApplication.stories-Dixp1ynI.js +0 -194
  115. package/.storybook-static/assets/UploadYourLogoDropzone-DQqACf-e.css +0 -1
  116. package/.storybook-static/assets/UploadYourLogoDropzone-DouZtNvi.js +0 -24
  117. package/.storybook-static/assets/UploadYourLogoDropzone.stories-BHYeu4gz.js +0 -55
  118. package/.storybook-static/assets/UploadedLogoSearchResultCard.stories-D1KR63O4.js +0 -79
  119. package/.storybook-static/assets/_commonjsHelpers-D6-XlEtG.js +0 -1
  120. package/.storybook-static/assets/_plugin-vue_export-helper-DlAUqK2U.js +0 -1
  121. package/.storybook-static/assets/api-lSJGRrF2.js +0 -1
  122. package/.storybook-static/assets/axe-nGVJxRof.js +0 -30
  123. package/.storybook-static/assets/brand-crowd-api.client-DiPM1Wo-.js +0 -1
  124. package/.storybook-static/assets/bundled-translations-BZ57czTo.js +0 -1
  125. package/.storybook-static/assets/bundled-translations.de-DE-DXggTXB2.js +0 -1
  126. package/.storybook-static/assets/bundled-translations.es-ES-DtMmvicd.js +0 -1
  127. package/.storybook-static/assets/bundled-translations.fr-FR-BrQqbieG.js +0 -1
  128. package/.storybook-static/assets/bundled-translations.pt-PT-CpiWEAtr.js +0 -1
  129. package/.storybook-static/assets/carousel-CMMZ5MZ-.css +0 -1
  130. package/.storybook-static/assets/carousel.stories-o3eu2Qyc.js +0 -374
  131. package/.storybook-static/assets/event-constants-CMO9VQVu.js +0 -1
  132. package/.storybook-static/assets/iframe-C86bI_2U.js +0 -1126
  133. package/.storybook-static/assets/index-Bw-gCGc_.js +0 -6
  134. package/.storybook-static/assets/index-DhkYCT1V.js +0 -29
  135. package/.storybook-static/assets/matchers-7Z3WT2CE-T3xScrR7.js +0 -14
  136. package/.storybook-static/assets/tracking-ATsLLehC.js +0 -1
  137. package/.storybook-static/css/tailwind-brandCrowd.css +0 -2404
  138. package/.storybook-static/css/tailwind-brandPage.css +0 -2088
  139. package/.storybook-static/css/tailwind-crazyDomains.css +0 -2404
  140. package/.storybook-static/css/tailwind-designCom.css +0 -2404
  141. package/.storybook-static/css/tailwind-designCrowd.css +0 -2404
  142. package/.storybook-static/favicon.svg +0 -1
  143. package/.storybook-static/iframe.html +0 -694
  144. package/.storybook-static/index.html +0 -156
  145. package/.storybook-static/index.json +0 -1
  146. package/.storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  147. package/.storybook-static/nunito-sans-bold.woff2 +0 -0
  148. package/.storybook-static/nunito-sans-italic.woff2 +0 -0
  149. package/.storybook-static/nunito-sans-regular.woff2 +0 -0
  150. package/.storybook-static/project.json +0 -1
  151. package/.storybook-static/sb-addons/a11y-1/manager-bundle.js +0 -5
  152. package/.storybook-static/sb-addons/links-2/manager-bundle.js +0 -3
  153. package/.storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -188
  154. package/.storybook-static/sb-addons/themes-3/manager-bundle.js +0 -3
  155. package/.storybook-static/sb-common-assets/favicon.svg +0 -1
  156. package/.storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  157. package/.storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  158. package/.storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  159. package/.storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  160. package/.storybook-static/sb-manager/globals-module-info.js +0 -797
  161. package/.storybook-static/sb-manager/globals-runtime.js +0 -72062
  162. package/.storybook-static/sb-manager/globals.js +0 -34
  163. package/.storybook-static/sb-manager/runtime.js +0 -13002
  164. package/dist/css/tailwind-brandCrowd.css +0 -2419
  165. package/dist/css/tailwind-brandPage.css +0 -2107
  166. package/dist/css/tailwind-crazyDomains.css +0 -2419
  167. package/dist/css/tailwind-designCom.css +0 -2419
  168. package/dist/css/tailwind-designCrowd.css +0 -2419
  169. package/src/experiences/components/PublishBrandPageModal/views/PublishWhenHasDomainsView.vue +0 -271
  170. package/src/experiences/components/PublishBrandPageModal/views/PublishWhenNoDomainsView.vue +0 -168
  171. package/src/experiences/components/PublishBrandPageModal/views/PublishedView.vue +0 -149
  172. package/src/experiences/components/PublishBrandPageModal/views/SetUrlView.vue +0 -155
  173. /package/src/atoms/components/SparkleIcon/assets/animations/{state-01.svg → sparkle/state-01.svg} +0 -0
  174. /package/src/atoms/components/SparkleIcon/assets/animations/{state-02.svg → sparkle/state-02.svg} +0 -0
  175. /package/src/atoms/components/SparkleIcon/assets/animations/{state-03.svg → sparkle/state-03.svg} +0 -0
  176. /package/src/atoms/components/SparkleIcon/assets/animations/{state-04.svg → sparkle/state-04.svg} +0 -0
  177. /package/src/atoms/components/SparkleIcon/assets/animations/{state-05.svg → sparkle/state-05.svg} +0 -0
  178. /package/src/atoms/components/SparkleIcon/assets/animations/{state-06.svg → sparkle/state-06.svg} +0 -0
  179. /package/src/atoms/components/SparkleIcon/assets/animations/{state-07.svg → sparkle/state-07.svg} +0 -0
  180. /package/src/atoms/components/SparkleIcon/assets/animations/{state-08.svg → sparkle/state-08.svg} +0 -0
@@ -80,3 +80,65 @@ export const IconSample = () => {
80
80
  IconSample.story = {
81
81
  name: 'Dcom Icon Library',
82
82
  };
83
+
84
+ export const IconInternationalization = () => {
85
+ return {
86
+ components: {
87
+ Icon,
88
+ },
89
+ data() {
90
+ return {
91
+ languages: [
92
+ { code: 'en', name: 'English' },
93
+ { code: 'fr', name: 'French' },
94
+ { code: 'es', name: 'Spanish' },
95
+ { code: 'pt', name: 'Portuguese' },
96
+ { code: 'de', name: 'German' },
97
+ ],
98
+ };
99
+ },
100
+ template: `
101
+ <div>
102
+ <h3 class="tw-font-sans tw-mb-4 tw-text-lg tw-font-bold">Internationalization (i18n) Support</h3>
103
+ <p class="tw-font-sans tw-mb-4">The <code>lang</code> prop allows you to specify the language code for screen readers. This is crucial for proper accessibility in internationalized applications.</p>
104
+
105
+ <table class="tw-w-full tw-mb-6">
106
+ <thead>
107
+ <tr>
108
+ <th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Language</th>
109
+ <th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Icon</th>
110
+ <th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Code</th>
111
+ </tr>
112
+ </thead>
113
+ <tr v-for="(language, i) in languages" :key="i" :class="{'tw-bg-grayscale-200': i % 2 !== 0}">
114
+ <td class="tw-p-4 tw-font-sans">{{ language.name }} ({{ language.code }})</td>
115
+ <td class="tw-p-4">
116
+ <Icon name="heart" size="md" :lang="language.code" />
117
+ </td>
118
+ <td class="tw-p-4">
119
+ <code class="tw-bg-info-100 tw-p-2 tw-rounded tw-bg-gray-400 tw-border tw-border-solid tw-border-info-300 tw-text-info-900">
120
+ &lt;Icon name="heart" size="md" lang="{{ language.code }}" /&gt;
121
+ </code>
122
+ </td>
123
+ </tr>
124
+ </table>
125
+
126
+ <div class="tw-font-sans tw-bg-blue-50 tw-p-4 tw-rounded tw-border tw-border-blue-200">
127
+ <h4 class="tw-font-bold tw-mb-2">Usage in i18n Applications:</h4>
128
+ <p class="tw-mb-2">In Vue applications with i18n, you can dynamically pass the current locale:</p>
129
+ <pre class="tw-bg-gray-100 tw-p-3 tw-rounded tw-text-sm tw-overflow-x-auto"><code>&lt;Icon
130
+ name="feature.iconName"
131
+ size="md"
132
+ :lang="$i18n.locale.split('-')[0]"
133
+ :alt-text="$t('icons.heart.title')"
134
+ /&gt;</code></pre>
135
+ <p class="tw-mt-2 tw-text-sm tw-text-gray-600">Note: The lang prop defaults to 'en' for backward compatibility.</p>
136
+ </div>
137
+ </div>
138
+ `,
139
+ };
140
+ };
141
+
142
+ IconInternationalization.story = {
143
+ name: 'Internationalization (lang prop)',
144
+ };
@@ -18,8 +18,8 @@
18
18
  aria-labelledby="title"
19
19
  aria-describedby="desc"
20
20
  >
21
- <title :id="`${name}-${id}-title`" lang="en">{{ title }}</title>
22
- <desc :id="`${name}-${id}-desc`" lang="en">{{ description }}</desc>
21
+ <title :id="`${name}-${id}-title`" :lang="lang">{{ title }}</title>
22
+ <desc :id="`${name}-${id}-desc`" :lang="lang">{{ description }}</desc>
23
23
  <component :is="`icon-${iconName}`"></component>
24
24
  </svg>
25
25
  </div>
@@ -118,6 +118,11 @@ export default {
118
118
  required: false,
119
119
  default: '',
120
120
  },
121
+ lang: {
122
+ type: String,
123
+ required: false,
124
+ default: 'en',
125
+ },
121
126
  },
122
127
  data() {
123
128
  return {
@@ -174,42 +174,6 @@ export const PublishedNoDomains = () => {
174
174
 
175
175
  PublishedNoDomains.loaders = [loadTranslationAsync];
176
176
 
177
- export const PublishedWithContent = () => {
178
- return {
179
- components: {
180
- PublishBrandPageModal,
181
- },
182
- data() {
183
- return {
184
- domains,
185
- };
186
- },
187
- methods: {},
188
- template: `
189
- <PublishBrandPageModal
190
- visible
191
- is-design-com
192
- is-published
193
- should-publish
194
- :domains="domains"
195
- isSubsequentPublish="true"
196
- showUpsellRotation="true"
197
- brand-page-display-name='Website'
198
- brand-page-slug='test-slug'
199
- brand-page-base-url="https://brand.site"
200
- radio-value="slug"
201
- brand-page-url="https://brand.site/test-slug"
202
- >
203
- <template #upsell>
204
- <div>Upsell container goes here 111111</div>
205
- </template>
206
- </PublishBrandPageModal>
207
- `,
208
- };
209
- };
210
-
211
- PublishedWithContent.loaders = [loadTranslationAsync];
212
-
213
177
  export const Free = () => {
214
178
  return {
215
179
  components: {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="publish-bp--container">
3
3
  <Modal
4
- classes="publish-bp--modal tw-p-4"
4
+ classes="publish-bp--modal tw-pt-4"
5
5
  close-on-esc
6
6
  :visible="visible"
7
7
  :hide-scrollbar="false"
@@ -30,77 +30,211 @@
30
30
  </div>
31
31
  </template>
32
32
  <template #default>
33
- <PublishWhenNoDomainsView
34
- v-if="isNotPublished && !hasPurchasedDomains"
35
- :brand-page-base-url="brandPageBaseUrl"
36
- :brand-page-slug="brandPageSlug"
37
- :slug-validation-error="slugValidationError"
38
- :error-message="errorMessage"
39
- :publish-error-message="publishErrorMessage"
40
- :is-publishing="isPublishing"
41
- :is-design-com="isDesignCom"
42
- :brand-page-type="brandPageType"
43
- @on-slug-changed="onSlugChanged"
44
- @internal-publish-brand-page="onInternalPublishBrandPage"
45
- >
46
- <template #recommended>
47
- <slot name="recommended" />
48
- </template>
49
- </PublishWhenNoDomainsView>
50
- <PublishWhenHasDomainsView
51
- v-if="isNotPublished && showRadioButtons && hasPurchasedDomains"
52
- :radio-value="radioValue"
53
- :domains="domains"
54
- :brand-page-base-url="brandPageBaseUrl"
55
- :brand-page-slug="brandPageSlug"
56
- :custom-domain="customDomain"
57
- :slug-validation-error="slugValidationError"
58
- :error-message="errorMessage"
59
- :publish-error-message="publishErrorMessage"
60
- :is-publishing="isPublishing"
61
- :is-design-com="isDesignCom"
62
- :brand-page-type="brandPageType"
63
- @close-modal="onCloseModal"
64
- @on-slug-changed="onSlugChanged"
65
- @radio-button-changed="onRadioButtonChanged"
66
- @on-select-domain="onSelectDomain"
67
- @internal-publish-brand-page="onInternalPublishBrandPage"
68
- />
69
- <SetUrlView
70
- v-if="isSlugEditMode"
71
- :brand-page-base-url="brandPageBaseUrl"
72
- :brand-page-slug="brandPageSlug"
73
- :slug-validation-error="slugValidationError"
74
- :error-message="errorMessage"
75
- :publish-error-message="publishErrorMessage"
76
- :is-publishing="isPublishing"
77
- :is-design-com="isDesignCom"
78
- :brand-page-type="brandPageType"
79
- @close-modal="onCloseModal"
80
- @on-slug-changed="onSlugChanged"
81
- @internal-publish-brand-page="onInternalPublishBrandPage"
82
- />
83
- <PublishedView
84
- v-if="!isNotPublished && !isSlugEditMode"
85
- :brand-page-url="brandPageUrl"
86
- :is-design-com="isDesignCom"
87
- :show-upsell-rotation="showUpsellRotation"
88
- :is-subsequent-publish="isSubsequentPublish"
89
- :search-text="searchText"
90
- :brand-page-display-name="brandPageDisplayName"
91
- :has-purchased-domain="hasPurchasedDomains"
92
- :show-upsell-rotation-container="showUpsellRotationContainer"
93
- :user-currency="userCurrency"
94
- @copy-url-clicked="onCopyUrlClick"
95
- @on-brand-page-url-click="onBrandPageUrlClick"
96
- @on-view-more-domains="onViewMore"
97
- @on-buy-now-clicked="onBuyNowClick"
98
- @on-search-text-changed="onSearchTextChanged"
99
- >
100
- <template #upsellContainer>
33
+ <div v-if="isNotPublished || isSlugEditMode" :class="{ 'tw-mb-8': !hasPurchasedDomains }">
34
+ <div
35
+ v-if="!isSlugEditMode"
36
+ class="tw-flex tw-items-center tw-mr-2 tw-mb-1"
37
+ @click="onDomainTypeRadioButtonClick(DOMAIN_TYPES.slug)"
38
+ >
39
+ <input
40
+ v-if="showRadioButtons"
41
+ type="radio"
42
+ class="tw-w-6 tw-h-8 tw-cursor-pointer tw-mb-0"
43
+ :style="{ 'accent-color': 'rgb(242 27 63)' }"
44
+ name="domainTypeValue"
45
+ :checked="domainTypeValue === DOMAIN_TYPES.slug"
46
+ :value="domainTypeValue === DOMAIN_TYPES.slug"
47
+ />
48
+ <label
49
+ v-if="!isPublished && hasPurchasedDomains"
50
+ for="domain-type"
51
+ class="tw-font-sans tw-w-full tw-text-grayscale-600 tw-text-sm tw-cursor-pointer tw-ml-2"
52
+ >
53
+ <span class="tw-inline-block tw-rounded-full">{{ freeDomainLabel }}</span>
54
+ </label>
55
+ </div>
56
+ <div v-if="isNotPublished || isSlugEditMode" class="tw-mt-4">
57
+ <PublishBrandPageCard
58
+ v-if="!hasPurchasedDomains"
59
+ :img-url="iconUrl"
60
+ :title="freePublishCardTitleLabel"
61
+ :description="freePublishCardDescriptionLabel"
62
+ :is-design-com="isDesignCom"
63
+ :has-search-button="false"
64
+ >
65
+ <template #slug>
66
+ <div class="tw-flex tw-flex-col md:tw-flex-row tw-justify-between">
67
+ <div class="tw-grow md:tw-mr-2">
68
+ <TextInput
69
+ v-model="internalSlug"
70
+ element-classes="tw-mb-0 !tw-rounded-l-none tw-text-md"
71
+ :prefix-text="`${brandPageBaseUrlWithoutHttps}/`"
72
+ :error="!!slugValidationError"
73
+ :disabled="isInputEnabled"
74
+ :placeholder="getPlaceHolder"
75
+ data-test-brand-page-slug-input
76
+ :attrs="{ 'data-test-set-url-text-field': '' }"
77
+ @input="onSlugChanged"
78
+ />
79
+ <div
80
+ v-if="slugErrorMessage"
81
+ class="tw-mt-2 tw-text-sm tw-text-left tw-text-error-500 tw-font-normal"
82
+ >
83
+ {{ slugErrorMessage }}
84
+ </div>
85
+ </div>
86
+ <Button
87
+ :label="publishLabel"
88
+ :disabled="isPublishingDisabled"
89
+ class="tw-flex tw-items-center tw-justify-center tw-mt-2 md:tw-mt-0 tw-font-bold tw-transition-colors tw-duration-300"
90
+ data-test-brand-page-publish-button
91
+ variant="primary"
92
+ size="small-medium"
93
+ :full-width="isMobile"
94
+ :class="{
95
+ 'tw-uppercase': !isDesignCom,
96
+ }"
97
+ @on-click="onPublish"
98
+ />
99
+ </div>
100
+ </template>
101
+ </PublishBrandPageCard>
102
+ <div v-else>
103
+ <TextInput
104
+ v-model="internalSlug"
105
+ element-classes="tw-mb-0 !tw-rounded-l-none tw-text-lg"
106
+ :prefix-text="`${brandPageBaseUrlWithoutHttps}/`"
107
+ :error="!!slugValidationError"
108
+ :disabled="isInputEnabled"
109
+ :placeholder="getPlaceHolder"
110
+ data-test-brand-page-slug-input
111
+ :attrs="{ 'data-test-set-url-text-field': '' }"
112
+ @input="onSlugChanged"
113
+ />
114
+ <div v-if="slugErrorMessage" class="tw-mt-2 tw-text-sm tw-text-left tw-text-error-500 tw-font-normal">
115
+ {{ slugErrorMessage }}
116
+ </div>
117
+ </div>
118
+ </div>
119
+ <div v-if="isNotPublished || !isSlugEditMode" class="tw-mt-4">
120
+ <div v-if="showRadioButtons">
121
+ <div
122
+ class="tw-flex tw-items-center tw-mr-2 tw-mb-1"
123
+ @click="onDomainTypeRadioButtonClick(DOMAIN_TYPES.purchased)"
124
+ >
125
+ <input
126
+ type="radio"
127
+ class="tw-w-6 tw-h-8 tw-cursor-pointer tw-mb-0"
128
+ :style="{ 'accent-color': 'rgb(242 27 63)' }"
129
+ name="domainTypeValue"
130
+ :checked="domainTypeValue === DOMAIN_TYPES.purchased"
131
+ :value="domainTypeValue === DOMAIN_TYPES.purchased"
132
+ />
133
+ <label
134
+ for="domain-type"
135
+ class="tw-font-sans tw-w-full tw-text-grayscale-600 tw-text-sm tw-cursor-pointer tw-ml-2"
136
+ >
137
+ <span class="tw-inline-block tw-rounded-full">{{ purchasedDomainLabel }}</span>
138
+ </label>
139
+ </div>
140
+ <div class="tw-mt-4 domain-dropdown">
141
+ <Dropdown
142
+ v-if="domains"
143
+ ref="dropdown"
144
+ :element-classes="{
145
+ 'tw-h-12': true,
146
+ }"
147
+ menu-element-classes="tw-w-full"
148
+ :disabled="domainTypeValue === DOMAIN_TYPES.slug"
149
+ :class="{
150
+ 'tw-text-grayscale-600 tw-font-normal': !selectedCustomDomain,
151
+ }"
152
+ :title="(selectedCustomDomain && selectedCustomDomain.domainName) || selectDomainDropdownPlaceholder"
153
+ >
154
+ <DropdownItem
155
+ v-for="purchasedDomain of domains"
156
+ :key="purchasedDomain.domainName"
157
+ class="tw-font-bold tw-break-all tw-flex tw-gap-2 tw-text-black"
158
+ @click="onSelectPurchasedDomain(purchasedDomain)"
159
+ >
160
+ {{ purchasedDomain.domainName }}
161
+ </DropdownItem>
162
+ </Dropdown>
163
+ </div>
164
+ <div v-if="errorMessage" class="tw-mt-2 tw-text-sm tw-text-left tw-text-error-500 tw-font-normal">
165
+ {{ errorMessage }}
166
+ </div>
167
+ </div>
168
+ <slot v-if="!hasPurchasedDomains" name="recommended" />
169
+ </div>
170
+ <div
171
+ v-if="hasPurchasedDomains"
172
+ class="tw-font-sans tw-text-center"
173
+ :style="isMobile ? 'padding-left: 1.5rem; padding-right: 1.5rem;' : ''"
174
+ >
175
+ <Button
176
+ :label="isSlugEditMode ? setUrlLabel : publishLabel"
177
+ :variant="isDesignCom ? 'primary' : 'primary-with-icon'"
178
+ icon="chevron-right-wide"
179
+ :disabled="isPublishingDisabled"
180
+ class="tw-my-4"
181
+ :full-width="isMobile"
182
+ data-test-brand-page-publish-button
183
+ @on-click="onPublish"
184
+ />
185
+ <Button
186
+ :label="hasAlreadyPurchasedDomainCloseButtonLabel"
187
+ variant="no-border"
188
+ size="large"
189
+ class="tw-my-4"
190
+ :full-width="isMobile"
191
+ @on-click="onCloseModal"
192
+ />
193
+ </div>
194
+ </div>
195
+ <div v-else class="tw-font-sans">
196
+ <div v-if="!showUpsellRotationContainer" class="tw-mb-6 tw-text-left">
197
+ <div class="tw-mb-6">
198
+ <SellDomainNameSearchWithResults
199
+ :is-design-com="isDesignCom"
200
+ :initial-search-term="searchText"
201
+ :currency="userCurrency"
202
+ :display-result-limit="4"
203
+ :domain-search-location="sitePublishedModal"
204
+ show-view-more-button
205
+ @on-change-search="onSearchTextChanged"
206
+ @on-buy-now-click="onBuyNowClick"
207
+ @on-view-more="onViewMore"
208
+ />
209
+ </div>
210
+ </div>
211
+ <div class="tw-px-4 tw-text-center" :class="{ 'lg:tw-px-20': hasPurchasedDomains }">
212
+ <TextCopyField
213
+ button-variant="secondary"
214
+ :text="brandPageUrl"
215
+ :default-copy-button-text="copyLabel"
216
+ :copied-button-text="copySuccessLabel"
217
+ data-test-brand-page-copy-input
218
+ @on-click="onCopyUrlClick"
219
+ />
220
+ <Button
221
+ :label="viewMyWebsiteLabel"
222
+ :variant="isDesignCom ? 'primary' : 'primary-with-icon'"
223
+ icon="chevron-right-wide"
224
+ size="medium"
225
+ icon-view-box="0 0 24 24"
226
+ class="tw-my-4"
227
+ target="_blank"
228
+ rel="noopener noreferrer"
229
+ :url="brandPageUrl"
230
+ :full-width="isMobile"
231
+ @on-click="onBrandPageUrlClick"
232
+ />
233
+ </div>
234
+ <div v-if="showUpsellRotationContainer" class="tw-border-t tw-border-solid tw-border-grayscale-500 tw-p-5">
101
235
  <slot name="upsellContainer" />
102
- </template>
103
- </PublishedView>
236
+ </div>
237
+ </div>
104
238
  </template>
105
239
  </Modal>
106
240
  <SellDomainNameListModal
@@ -119,32 +253,41 @@
119
253
  </template>
120
254
  <script>
121
255
  import Modal from '../../../atoms/components/Modal/Modal.vue';
256
+ import PublishBrandPageCard from './PublishBrandPageCard.vue';
257
+ import TextInput from '../../../atoms/components/TextInput/TextInput.vue';
258
+ import Dropdown from '../../../atoms/components/Dropdown/Dropdown.vue';
259
+ import DropdownItem from '../../../atoms/components/Dropdown/DropdownItem.vue';
260
+ import Button from '../../../atoms/components/Button/Button.vue';
261
+ import TextCopyField from '../../../atoms/components/TextCopyField/TextCopyField.vue';
262
+
263
+ import SellDomainNameSearchWithResults from '../SellDomainNameSearchWithResults/SellDomainNameSearchWithResults.vue';
122
264
  import SellDomainNameListModal from '../SellDomainNameListModal/SellDomainNameListModal.vue';
123
265
  import brandCrowdApiClient from '../../clients/brand-crowd-api.client';
124
266
  import Events, { sitePublishedModal } from '../../constants/event-constants';
125
267
  import mediaQueryMixin from '../../mixins/mediaQueryMixin';
126
268
  import { publishBrandPageModalTr } from '../../../useSharedLibTranslate';
127
- import PublishedView from './views/PublishedView.vue';
128
- import SetUrlView from './views/SetUrlView.vue';
129
- import PublishWhenNoDomainsView from './views/PublishWhenNoDomainsView.vue';
130
- import PublishWhenHasDomainsView from './views/PublishWhenHasDomainsView.vue';
131
269
 
132
270
  const DOMAIN_TYPES = {
133
271
  slug: 'slug',
134
272
  purchased: 'purchased',
135
273
  };
136
274
 
275
+ const DCOM_IMG_FREE = 'https://brandcrowd-cdn.s3.amazonaws.com/public/assets/images/icons/publish/dcom-free-url.svg';
276
+ const BC_IMG_FREE = 'https://brandcrowd-cdn.s3.amazonaws.com/public/assets/images/icons/publish/bc-free-url.svg';
137
277
  const WEBSITE_FRIENDLY_NAME = 'Website';
138
278
  export const DIGITAL_BUSINESS_CARD = 'Digital Business Card';
139
279
 
140
280
  export default {
141
281
  components: {
142
282
  Modal,
283
+ TextInput,
284
+ Dropdown,
285
+ DropdownItem,
286
+ Button,
287
+ TextCopyField,
288
+ SellDomainNameSearchWithResults,
143
289
  SellDomainNameListModal,
144
- PublishedView,
145
- SetUrlView,
146
- PublishWhenNoDomainsView,
147
- PublishWhenHasDomainsView,
290
+ PublishBrandPageCard,
148
291
  },
149
292
  mixins: [mediaQueryMixin],
150
293
  props: {
@@ -280,19 +423,31 @@ export default {
280
423
  emits: [
281
424
  'close-modal',
282
425
  'radio-button-changed',
283
- 'copy-url-clicked',
426
+ 'copy-url-click',
284
427
  'internal-publish-brand-page',
285
428
  'on-select-domain',
286
429
  'on-brand-page-url-click',
287
430
  'on-view-more-domains',
288
431
  'on-slug-changed',
289
- 'on-show-domain-modal',
290
432
  ],
291
433
  setup() {
292
434
  return {
293
435
  publishBrandPageModalTr,
294
436
  sitePublishedLabel: publishBrandPageModalTr('sitePublishedLabel'),
437
+ freePublishCardTitleLabel: publishBrandPageModalTr('freePublishCardTitleLabel'),
438
+ freePublishCardDescriptionLabel: publishBrandPageModalTr('freePublishCardDescriptionLabel'),
439
+ slugInputPlaceholderYourNameLabel: publishBrandPageModalTr('slugInputPlaceholderYourNameLabel'),
440
+ slugInputPlaceholderYourBusinessNameLabel: publishBrandPageModalTr('slugInputPlaceholderYourBusinessNameLabel'),
441
+ freeDomainLabel: publishBrandPageModalTr('freeDomainLabel'),
442
+ purchasedDomainLabel: publishBrandPageModalTr('purchasedDomainLabel'),
443
+ setUrlLabel: publishBrandPageModalTr('setUrlLabel'),
444
+ publishLabel: publishBrandPageModalTr('publishLabel'),
445
+ viewMoreDomainLabel: publishBrandPageModalTr('viewMoreDomainLabel'),
446
+ copyLabel: publishBrandPageModalTr('copyLabel'),
447
+ copySuccessLabel: publishBrandPageModalTr('copySuccessLabel'),
448
+ hasAlreadyPurchasedDomainCloseButtonLabel: publishBrandPageModalTr('hasAlreadyPurchasedDomainCloseButtonLabel'),
295
449
  publishedSuccessDescriptionLabel: publishBrandPageModalTr('publishedSuccessDescriptionLabel'),
450
+ selectDomainDropdownPlaceholder: publishBrandPageModalTr('selectDomainDropdownPlaceholder'),
296
451
  };
297
452
  },
298
453
  data() {
@@ -311,6 +466,9 @@ export default {
311
466
  };
312
467
  },
313
468
  computed: {
469
+ brandPageBaseUrlWithoutHttps() {
470
+ return this.brandPageBaseUrl.replace('https://', '');
471
+ },
314
472
  firstTimePublishHeaderLabel() {
315
473
  const translatedBrandPageName = this.getLanguageAwareBrandPageDisplayName(this.brandPageDisplayName);
316
474
  return this.publishBrandPageModalTr('firstTimePublishHeaderLabel', {
@@ -322,15 +480,43 @@ export default {
322
480
  brandPageDisplayName: this.brandPageDisplayName,
323
481
  });
324
482
  },
483
+ viewMyWebsiteLabel() {
484
+ return this.publishBrandPageModalTr('viewMyWebsiteLabel', {
485
+ brandPageDisplayName: this.brandPageDisplayName,
486
+ });
487
+ },
488
+ allowPublish() {
489
+ if (this.domainTypeValue === DOMAIN_TYPES.slug) {
490
+ return this.internalSlug && !this.slugValidationError;
491
+ }
492
+ return this.selectedCustomDomain;
493
+ },
325
494
  hasPurchasedDomains() {
326
495
  return this.domains && this.domains.length > 0;
327
496
  },
497
+ slugErrorMessage() {
498
+ return this.slugValidationError ? this.slugValidationError : this.publishErrorMessage;
499
+ },
328
500
  isNotPublished() {
329
501
  return !this.isPublished || !this.shouldPublish;
330
502
  },
331
503
  isSlugEditMode() {
332
504
  return this.isPublished && this.shouldPublish && this.isBrandPageSlugEditMode;
333
505
  },
506
+ iconUrl() {
507
+ return this.isDesignCom ? DCOM_IMG_FREE : BC_IMG_FREE;
508
+ },
509
+ isInputEnabled() {
510
+ return this.isPublishing || this.domainTypeValue === DOMAIN_TYPES.purchased;
511
+ },
512
+ isPublishingDisabled() {
513
+ return !this.allowPublish || this.isPublishing;
514
+ },
515
+ getPlaceHolder() {
516
+ return this.brandPageType === 'brandContact'
517
+ ? this.slugInputPlaceholderYourNameLabel
518
+ : this.slugInputPlaceholderYourBusinessNameLabel;
519
+ },
334
520
  showUpsellRotationContainer() {
335
521
  if (!this.isSubsequentPublish) {
336
522
  return false;
@@ -367,10 +553,28 @@ export default {
367
553
  return brandPageName;
368
554
  }
369
555
  },
556
+ onDomainTypeRadioButtonClick(domain) {
557
+ this.domainTypeValue = domain;
558
+ this.closePurchasedDomainDropdown();
559
+ this.$emit('radio-button-changed', domain);
560
+ },
370
561
  onCloseModal() {
371
562
  this.$emit('close-modal');
372
563
  this.$emit('on-hide-domain-modal');
373
564
  },
565
+ onCopyUrlClick() {
566
+ this.$emit('copy-url-clicked');
567
+ },
568
+ onSlugChanged(e) {
569
+ this.searchText = e;
570
+ this.$emit('on-slug-changed', e);
571
+ },
572
+ onPublish() {
573
+ this.$emit('internal-publish-brand-page', this.internalSlug, this.selectedCustomDomain);
574
+ },
575
+ onBrandPageUrlClick() {
576
+ this.$emit('on-brand-page-url-click');
577
+ },
374
578
  onViewMore() {
375
579
  this.$emit('on-show-domain-modal');
376
580
  if (this.searchText) {
@@ -381,29 +585,22 @@ export default {
381
585
  this.searchText = val;
382
586
  this.$emit('on-change-search', val);
383
587
  },
384
- onSellDomainNameListCloseModal() {
385
- this.$emit('on-hide-domain-modal');
386
- },
387
- onSlugChanged(e) {
388
- this.$emit('on-slug-changed', e);
389
- },
390
- onInternalPublishBrandPage(slug, customdomain) {
391
- this.$emit('internal-publish-brand-page', slug, customdomain);
392
- },
393
- onRadioButtonChanged(domain) {
394
- this.$emit('radio-button-changed', domain);
395
- },
396
- onSelectDomain(newVal) {
588
+ onSelectPurchasedDomain(newVal) {
589
+ this.selectedCustomDomain = newVal;
397
590
  this.$emit('on-select-domain', newVal);
591
+ this.closePurchasedDomainDropdown();
398
592
  },
399
- onCopyUrlClick(newVal) {
400
- this.$emit('copy-url-clicked', newVal);
593
+
594
+ closePurchasedDomainDropdown() {
595
+ if (this.$refs.dropdown?.hideMenu) {
596
+ this.$refs.dropdown.hideMenu();
597
+ }
401
598
  },
402
- onBrandPageUrlClick(newVal) {
403
- this.$emit('on-brand-page-url-click', newVal);
599
+ onSellDomainNameListCloseModal() {
600
+ this.$emit('on-hide-domain-modal');
404
601
  },
405
- onBuyNow(newVal) {
406
- this.$emit('on-buy-now-clicked', newVal);
602
+ onBuyNowClick() {
603
+ this.$emit('on-buy-now-clicked');
407
604
  },
408
605
  async searchDomainName(isUserTriggered) {
409
606
  this.isLoading = true;
@@ -1 +0,0 @@
1
- .email-input[data-v-bb7289b6]{background-image:url(https://dcstatic.com/images/icons/forms/forms-email-58207f9a5c.svg);background-position:top 50% left .5rem}.password-input[data-v-bb7289b6]{background-image:url(https://dcstatic.com/images/icons/forms/forms-password-ff538cd5e4.svg);background-position:top 50% left .5rem}.tw-pl-10-important[data-v-bb7289b6]{padding-left:2.5rem!important}.email-input[data-v-965d0268]{background-image:url(https://dcstatic.com/images/icons/forms/forms-email-58207f9a5c.svg);background-position:top 50% left .5rem}.tw-pl-10-important[data-v-965d0268]{padding-left:2.5rem!important}.password-input[data-v-da12bb42]{background-image:url(https://dcstatic.com/images/icons/forms/forms-password-ff538cd5e4.svg);background-position:top 50% left .5rem}.tw-pl-10-important[data-v-da12bb42]{padding-left:2.5rem!important}