@designcrowd/fe-shared-lib 1.6.4-ast-website-rename-1 → 1.6.4-ast-dbc-2

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/index.js CHANGED
@@ -23,7 +23,6 @@ export { WEBSITE_UPGRADE_CONTEXT_TYPES } from './src/experiences/models/websiteC
23
23
 
24
24
  export { setSharedLibLocaleAsync, tr } from './src/useSharedLibTranslate';
25
25
 
26
- export { default as BrandNameEditor } from './src/atoms/components/BrandNameEditor/BrandNameEditor.vue';
27
26
  export { default as Button } from './src/atoms/components/Button/Button.vue';
28
27
  export { default as ButtonGroup } from './src/atoms/components/ButtonGroup/ButtonGroup.vue';
29
28
  export { default as Dropdown } from './src/atoms/components/Dropdown/Dropdown.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.6.4-ast-website-rename-1",
3
+ "version": "1.6.4-ast-dbc-2",
4
4
  "scripts": {
5
5
  "start": "run-p storybook watch:translation",
6
6
  "build": "npm run build:css --production",
@@ -34,7 +34,8 @@
34
34
  "websiteFriendlyName": "Website",
35
35
  "digitalBusinessCardFriendlyName": "Digital Business Card",
36
36
  "alreadyHaveADomainLabel": "Already have a domain?",
37
- "useExistingDomainLabel": "Use my existing domain"
37
+ "useExistingDomainLabel": "Use my existing domain",
38
+ "createTeamCardsLabel": "Create Team Cards"
38
39
  },
39
40
  "sellDomainNameList": {
40
41
  "freeDomainButtonLabel": "Free Domain",
@@ -1,11 +1,11 @@
1
1
  {
2
- "sharedPaymentConfig": {
3
- "onboardingIncomplete": "Das Onboarding wurde noch nicht abgeschlossen.",
4
- "pendingVerification": "Ausstehende Verifizierung",
5
- "connected": "Verbunden",
6
- "inactive": "Inaktiv",
7
- "addPaymentProvider": "Zahlungsanbieter hinzufügen",
8
- "deletePaymentMethod": "Zahlungsmethode löschen",
9
- "currencyLabel": "Währung"
2
+ "sharedPaymentConfig" : {
3
+ "onboardingIncomplete" : "Das Onboarding wurde noch nicht abgeschlossen.",
4
+ "pendingVerification" : "Ausstehende Verifizierung",
5
+ "connected" : "Verbunden",
6
+ "inactive" : "Inaktiv",
7
+ "addPaymentProvider" : "Zahlungsanbieter hinzufügen",
8
+ "deletePaymentMethod" : "Zahlungsmethode löschen",
9
+ "currencyLabel" : "Währung"
10
10
  }
11
11
  }
@@ -1,11 +1,11 @@
1
1
  {
2
- "sharedPaymentConfig": {
3
- "onboardingIncomplete": "Incorporación incompleta",
4
- "pendingVerification": "Pendiente de verificación",
5
- "connected": "Conectado",
6
- "inactive": "Inactivo",
7
- "addPaymentProvider": "Añadir proveedor de pago",
8
- "deletePaymentMethod": "Eliminar método de pago",
9
- "currencyLabel": "Moneda"
2
+ "sharedPaymentConfig" : {
3
+ "onboardingIncomplete" : "Incorporación incompleta",
4
+ "pendingVerification" : "Pendiente de verificación",
5
+ "connected" : "Conectado",
6
+ "inactive" : "Inactivo",
7
+ "addPaymentProvider" : "Añadir proveedor de pago",
8
+ "deletePaymentMethod" : "Eliminar método de pago",
9
+ "currencyLabel" : "Moneda"
10
10
  }
11
11
  }
@@ -1,11 +1,11 @@
1
1
  {
2
- "sharedPaymentConfig": {
3
- "onboardingIncomplete": "Inscription incomplète",
4
- "pendingVerification": "Vérification en attente",
5
- "connected": "Connecté",
6
- "inactive": "Inactif",
7
- "addPaymentProvider": "Ajouter un fournisseur de paiement",
8
- "deletePaymentMethod": "Supprimer le mode de paiement",
9
- "currencyLabel": "Devise"
2
+ "sharedPaymentConfig" : {
3
+ "onboardingIncomplete" : "Inscription incomplète",
4
+ "pendingVerification" : "Vérification en attente",
5
+ "connected" : "Connecté",
6
+ "inactive" : "Inactif",
7
+ "addPaymentProvider" : "Ajouter un fournisseur de paiement",
8
+ "deletePaymentMethod" : "Supprimer le mode de paiement",
9
+ "currencyLabel" : "Devise"
10
10
  }
11
11
  }
@@ -1,11 +1,11 @@
1
1
  {
2
- "sharedPaymentConfig": {
3
- "onboardingIncomplete": "Inscription incomplète",
4
- "pendingVerification": "Vérification en attente",
5
- "connected": "Connecté",
6
- "inactive": "Inactif",
7
- "addPaymentProvider": "Ajouter un fournisseur de paiement",
8
- "deletePaymentMethod": "Supprimer le mode de paiement",
9
- "currencyLabel": "Devise"
2
+ "sharedPaymentConfig" : {
3
+ "onboardingIncomplete" : "Inscription incomplète",
4
+ "pendingVerification" : "Vérification en attente",
5
+ "connected" : "Connecté",
6
+ "inactive" : "Inactif",
7
+ "addPaymentProvider" : "Ajouter un fournisseur de paiement",
8
+ "deletePaymentMethod" : "Supprimer le mode de paiement",
9
+ "currencyLabel" : "Devise"
10
10
  }
11
11
  }
@@ -1,11 +1,11 @@
1
1
  {
2
- "sharedPaymentConfig": {
3
- "onboardingIncomplete": "Integração incompleta",
4
- "pendingVerification": "Verificação Pendente",
5
- "connected": "Conectado",
6
- "inactive": "Inativo",
7
- "addPaymentProvider": "Adicionar fornecedor de pagamentos",
8
- "deletePaymentMethod": "Excluir método de pagamento",
9
- "currencyLabel": "Moeda"
2
+ "sharedPaymentConfig" : {
3
+ "onboardingIncomplete" : "Integração incompleta",
4
+ "pendingVerification" : "Verificação Pendente",
5
+ "connected" : "Conectado",
6
+ "inactive" : "Inativo",
7
+ "addPaymentProvider" : "Adicionar fornecedor de pagamentos",
8
+ "deletePaymentMethod" : "Excluir método de pagamento",
9
+ "currencyLabel" : "Moeda"
10
10
  }
11
11
  }
@@ -1,11 +1,11 @@
1
1
  {
2
- "sharedPaymentConfig": {
3
- "onboardingIncomplete": "Integração incompleta",
4
- "pendingVerification": "Verificação Pendente",
5
- "connected": "Ligado",
6
- "inactive": "Inativo",
7
- "addPaymentProvider": "Adicionar fornecedor de pagamentos",
8
- "deletePaymentMethod": "Eliminar método de pagamento",
9
- "currencyLabel": "Moeda"
2
+ "sharedPaymentConfig" : {
3
+ "onboardingIncomplete" : "Integração incompleta",
4
+ "pendingVerification" : "Verificação Pendente",
5
+ "connected" : "Ligado",
6
+ "inactive" : "Inativo",
7
+ "addPaymentProvider" : "Adicionar fornecedor de pagamentos",
8
+ "deletePaymentMethod" : "Eliminar método de pagamento",
9
+ "currencyLabel" : "Moeda"
10
10
  }
11
11
  }
@@ -92,11 +92,13 @@
92
92
  :has-purchased-domain="hasPurchasedDomains"
93
93
  :show-upsell-rotation-container="showUpsellRotationContainer"
94
94
  :user-currency="userCurrency"
95
+ :brand-page-type="brandPageType"
95
96
  @copy-url-clicked="onCopyUrlClick"
96
97
  @on-brand-page-url-click="onBrandPageUrlClick"
97
98
  @on-view-more-domains="onViewMore"
98
99
  @on-buy-now-clicked="onBuyNowClick"
99
100
  @on-search-text-changed="onSearchTextChanged"
101
+ @on-create-team-cards-click="onCreateTeamCardsClick"
100
102
  >
101
103
  <template #upsellContainer>
102
104
  <slot name="upsellContainer" />
@@ -289,6 +291,7 @@ export default {
289
291
  'on-slug-changed',
290
292
  'on-show-domain-modal',
291
293
  'on-use-existing-domain',
294
+ 'on-create-team-cards-click',
292
295
  ],
293
296
  setup() {
294
297
  return {
@@ -407,6 +410,9 @@ export default {
407
410
  onBrandPageUrlClick(newVal) {
408
411
  this.$emit('on-brand-page-url-click', newVal);
409
412
  },
413
+ onCreateTeamCardsClick() {
414
+ this.$emit('on-create-team-cards-click');
415
+ },
410
416
  onBuyNow(newVal) {
411
417
  this.$emit('on-buy-now-clicked', newVal);
412
418
  },
@@ -21,6 +21,7 @@
21
21
  "websiteFriendlyName": "Website",
22
22
  "digitalBusinessCardFriendlyName": "Digital Business Card",
23
23
  "alreadyHaveADomainLabel": "Already have a domain?",
24
- "useExistingDomainLabel": "Use my existing domain"
24
+ "useExistingDomainLabel": "Use my existing domain",
25
+ "createTeamCardsLabel": "Create Team Cards"
25
26
  }
26
27
  }
@@ -24,19 +24,28 @@
24
24
  data-test-brand-page-copy-input
25
25
  @on-click="onCopyUrlClick"
26
26
  />
27
- <Button
28
- :label="viewMyWebsiteLabel"
29
- :variant="isDesignCom ? 'primary' : 'primary-with-icon'"
30
- icon="chevron-right-wide"
31
- size="medium"
32
- icon-view-box="0 0 24 24"
33
- class="tw-my-4"
34
- target="_blank"
35
- rel="noopener noreferrer"
36
- :url="brandPageUrl"
37
- :full-width="isMobile"
38
- @on-click="onBrandPageUrlClick"
39
- />
27
+ <div class="tw-flex tw-flex-col sm:tw-flex-row tw-items-center tw-justify-center tw-gap-4 tw-my-4">
28
+ <Button
29
+ v-if="brandPageType === 'brandContact'"
30
+ :label="createTeamCardsLabel"
31
+ variant="outline"
32
+ :size="isDesignCom ? 'medium' : 'large'"
33
+ :full-width="isMobile"
34
+ @on-click="onCreateTeamCardsClick"
35
+ />
36
+ <Button
37
+ :label="viewMyWebsiteLabel"
38
+ :variant="isDesignCom ? 'primary' : 'primary-with-icon'"
39
+ icon="chevron-right-wide"
40
+ size="medium"
41
+ icon-view-box="0 0 24 24"
42
+ target="_blank"
43
+ rel="noopener noreferrer"
44
+ :url="brandPageUrl"
45
+ :full-width="isMobile"
46
+ @on-click="onBrandPageUrlClick"
47
+ />
48
+ </div>
40
49
  </div>
41
50
  <div v-if="showUpsellRotationContainer" class="tw-border-t tw-border-solid tw-border-grayscale-500 tw-p-5">
42
51
  <slot name="upsellContainer" />
@@ -105,6 +114,11 @@ export default {
105
114
  required: true,
106
115
  default: undefined,
107
116
  },
117
+ brandPageType: {
118
+ type: String,
119
+ required: false,
120
+ default: '',
121
+ },
108
122
  },
109
123
  emits: [
110
124
  'copy-url-clicked',
@@ -112,6 +126,7 @@ export default {
112
126
  'on-view-more-domains',
113
127
  'on-buy-now-clicked',
114
128
  'on-search-text-changed',
129
+ 'on-create-team-cards-click',
115
130
  ],
116
131
  setup() {
117
132
  return {
@@ -119,6 +134,7 @@ export default {
119
134
  publishBrandPageModalTr,
120
135
  copyLabel: publishBrandPageModalTr('copyLabel'),
121
136
  copySuccessLabel: publishBrandPageModalTr('copySuccessLabel'),
137
+ createTeamCardsLabel: publishBrandPageModalTr('createTeamCardsLabel'),
122
138
  };
123
139
  },
124
140
  computed: {
@@ -144,6 +160,9 @@ export default {
144
160
  onBuyNowClick() {
145
161
  this.$emit('on-buy-now-clicked');
146
162
  },
163
+ onCreateTeamCardsClick() {
164
+ this.$emit('on-create-team-cards-click');
165
+ },
147
166
  },
148
167
  };
149
168
  </script>
@@ -1,75 +0,0 @@
1
- import BrandNameEditor from './BrandNameEditor.vue';
2
-
3
- export default {
4
- title: 'Components/Brand Name Editor',
5
- component: BrandNameEditor,
6
- };
7
-
8
- const data = {
9
- components: {
10
- BrandNameEditor,
11
- },
12
- data() {
13
- return {
14
- value: 'My Website',
15
- };
16
- },
17
- };
18
-
19
- export const Default = () => {
20
- return {
21
- ...data,
22
- template: `
23
- <div class="tw-bg-gray-800 tw-p-4">
24
- <BrandNameEditor v-model="value" />
25
- </div>
26
- `,
27
- };
28
- };
29
-
30
- export const DarkMode = () => {
31
- return {
32
- ...data,
33
- template: `
34
- <div class="tw-bg-gray-800 tw-p-4">
35
- <BrandNameEditor v-model="value" :dark-mode="true" />
36
- </div>
37
- `,
38
- };
39
- };
40
-
41
- export const WithPlaceholder = () => {
42
- return {
43
- components: {
44
- BrandNameEditor,
45
- },
46
- data() {
47
- return {
48
- value: '',
49
- };
50
- },
51
- template: `
52
- <div class="tw-bg-gray-800 tw-p-4">
53
- <BrandNameEditor v-model="value" :dark-mode="true" placeholder="Enter website name..." />
54
- </div>
55
- `,
56
- };
57
- };
58
-
59
- export const Empty = () => {
60
- return {
61
- components: {
62
- BrandNameEditor,
63
- },
64
- data() {
65
- return {
66
- value: '',
67
- };
68
- },
69
- template: `
70
- <div class="tw-bg-gray-800 tw-p-4">
71
- <BrandNameEditor v-model="value" />
72
- </div>
73
- `,
74
- };
75
- };
@@ -1,150 +0,0 @@
1
- <template>
2
- <div
3
- data-component="brand-name-editor"
4
- class="tw-relative tw-flex tw-flex-grow tw-items-center tw-gap-2"
5
- :class="{
6
- 'tw-text-white': darkMode,
7
- 'tw-text-black': !darkMode,
8
- 'tw-uppercase': uppercase,
9
- }"
10
- >
11
- <div
12
- v-if="displayMode"
13
- class="dynamic-width-input tw-cursor-pointer tw-font-bold"
14
- :class="{ 'tw-normal-case': uppercase && !!modelValue?.trim() }"
15
- @click="onEditClick"
16
- >
17
- {{ modelValue?.trim() || templateTypeName || placeholder }}
18
- </div>
19
- <input
20
- v-if="!displayMode"
21
- ref="brandNameInput"
22
- :value="modelValue"
23
- type="text"
24
- :maxlength="maxLength"
25
- class="dynamic-width-input tw-px-2 tw-border-white"
26
- :class="{
27
- 'focus:tw-shadow-md': darkMode,
28
- 'tw-normal-case': uppercase,
29
- }"
30
- :placeholder="placeholder"
31
- @input="onInput"
32
- @blur="save"
33
- @focus="focus"
34
- @keyup.enter="($event.target as HTMLInputElement).blur()"
35
- @keyup.esc="revert"
36
- />
37
- <span
38
- ref="textWidthSpan"
39
- class="tw-absolute tw-invisible tw-max-w-full -tw-z-50 tw-top-4 tw-left-4 tw-whitespace-nowrap tw-pointer-events-none dynamic-width-input"
40
- >
41
- {{ modelValue.replace(/ /g, '&nbsp;') }}
42
- </span>
43
- <Button
44
- class="tw-flex tw-items-center"
45
- icon="Edit"
46
- variant="no-border"
47
- :white="darkMode"
48
- icon-size="sm"
49
- @on-click="onPencilIconClick"
50
- />
51
- </div>
52
- </template>
53
-
54
- <script setup lang="ts">
55
- import { ref, computed, watch, nextTick, onMounted } from 'vue';
56
- import Button from '../Button/Button.vue';
57
-
58
- const props = withDefaults(
59
- defineProps<{
60
- modelValue: string;
61
- darkMode?: boolean;
62
- placeholder?: string;
63
- maxLength?: number;
64
- templateTypeName?: string;
65
- uppercase?: boolean;
66
- }>(),
67
- {
68
- darkMode: false,
69
- placeholder: '',
70
- maxLength: 100,
71
- templateTypeName: '',
72
- uppercase: false,
73
- },
74
- );
75
-
76
- const emit = defineEmits<{
77
- 'update:model-value': [value: string];
78
- save: [];
79
- }>();
80
-
81
- const brandNameInput = ref<HTMLInputElement | null>(null);
82
- const textWidthSpan = ref<HTMLSpanElement | null>(null);
83
- const displayMode = ref(true);
84
- const revertValue = ref(props.modelValue);
85
- const inputOffsetPx = 22;
86
-
87
- function resizeInput() {
88
- nextTick(() => {
89
- if (props.modelValue && brandNameInput.value && textWidthSpan.value) {
90
- brandNameInput.value.style.width = `${textWidthSpan.value.offsetWidth + inputOffsetPx}px`;
91
- } else if (brandNameInput.value) {
92
- brandNameInput.value.style.width = 'auto';
93
- }
94
- });
95
- }
96
-
97
- watch(() => displayMode.value, resizeInput);
98
- watch(() => props.modelValue, resizeInput);
99
-
100
- onMounted(() => {
101
- nextTick(() => {
102
- revertValue.value = props.modelValue;
103
- resizeInput();
104
- });
105
- });
106
-
107
- function focus() {
108
- displayMode.value = false;
109
- }
110
-
111
- function save() {
112
- displayMode.value = true;
113
- if (props.modelValue.trim() === '' || props.modelValue !== revertValue.value) {
114
- emit('save');
115
- revertValue.value = props.modelValue;
116
- }
117
- }
118
-
119
- function revert() {
120
- emit('update:model-value', revertValue.value);
121
- brandNameInput.value?.blur();
122
- }
123
-
124
- function onInput(event: Event) {
125
- emit('update:model-value', (event.target as HTMLInputElement).value);
126
- }
127
-
128
- function onEditClick() {
129
- displayMode.value = !displayMode.value;
130
- if (!displayMode.value) {
131
- nextTick(() => {
132
- brandNameInput.value?.focus();
133
- });
134
- }
135
- }
136
-
137
- function onPencilIconClick() {
138
- onEditClick();
139
- }
140
- </script>
141
- <style scoped>
142
- .dynamic-width-input {
143
- @apply tw-border tw-bg-transparent tw-outline-none tw-truncate tw-rounded tw-w-auto tw-my-auto tw-text-base tw-text-white tw-max-w-xs;
144
- }
145
-
146
- input.dynamic-width-input:focus {
147
- -webkit-box-shadow: 0 0 5px #d1d1d1;
148
- box-shadow: 0 0 5px #d1d1d1;
149
- }
150
- </style>