@designcrowd/fe-shared-lib 1.5.32-ast-website-rename → 1.5.32-ast-dbc

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.5.32-ast-website-rename",
3
+ "version": "1.5.32-ast-dbc",
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",
@@ -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
  }
@@ -37,6 +37,15 @@
37
37
  :full-width="isMobile"
38
38
  @on-click="onBrandPageUrlClick"
39
39
  />
40
+ <Button
41
+ v-if="brandPageType === 'brandContact'"
42
+ :label="createTeamCardsLabel"
43
+ variant="outline"
44
+ icon-left="group"
45
+ size="medium"
46
+ :full-width="isMobile"
47
+ @on-click="onCreateTeamCardsClick"
48
+ />
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,143 +0,0 @@
1
- <template>
2
- <div
3
- data-component="brand-name-editor"
4
- class="tw-relative tw-flex tw-gap-2 tw-flex-grow tw-items-center"
5
- :class="{
6
- 'tw-text-white': darkMode,
7
- 'tw-text-black': !darkMode,
8
- }"
9
- >
10
- <button
11
- v-if="displayMode"
12
- class="dynamic-width-input tw-truncate tw-border-transparent tw-bg-transparent tw-px-2 tw-font-bold"
13
- @click="onEditClick"
14
- >
15
- {{ modelValue?.trim() || placeholder }}
16
- </button>
17
- <input
18
- v-if="!displayMode"
19
- ref="brandNameInput"
20
- :value="modelValue"
21
- type="text"
22
- maxlength="256"
23
- class="dynamic-width-input tw-px-2 tw-bg-transparent"
24
- :class="{
25
- 'focus:tw-border-white focus:tw-shadow-md': darkMode,
26
- }"
27
- :placeholder="placeholder"
28
- @input="onInput"
29
- @blur="save"
30
- @focus="focus"
31
- @keyup.enter="($event.target as HTMLInputElement).blur()"
32
- @keyup.esc="revert"
33
- />
34
- <span
35
- ref="textWidthSpan"
36
- 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"
37
- >
38
- {{ modelValue.replace(/ /g, '&nbsp;') }}
39
- </span>
40
- <Button
41
- icon="Edit"
42
- variant="no-border"
43
- :white="darkMode"
44
- icon-size="sm"
45
- @on-click="onPencilIconClick"
46
- />
47
- </div>
48
- </template>
49
-
50
- <script setup lang="ts">
51
- import { ref, watch, nextTick, onMounted } from 'vue';
52
- import Button from '../Button/Button.vue';
53
-
54
- const props = withDefaults(
55
- defineProps<{
56
- modelValue: string;
57
- darkMode?: boolean;
58
- placeholder?: string;
59
- }>(),
60
- {
61
- darkMode: false,
62
- placeholder: '',
63
- },
64
- );
65
-
66
- const emit = defineEmits<{
67
- 'update:model-value': [value: string];
68
- save: [];
69
- }>();
70
-
71
- const brandNameInput = ref<HTMLInputElement | null>(null);
72
- const textWidthSpan = ref<HTMLSpanElement | null>(null);
73
- const displayMode = ref(true);
74
- const revertValue = ref(props.modelValue);
75
- const inputOffsetPx = 22;
76
-
77
- function resizeInput() {
78
- nextTick(() => {
79
- if (props.modelValue && brandNameInput.value && textWidthSpan.value) {
80
- brandNameInput.value.style.width = `${textWidthSpan.value.offsetWidth + inputOffsetPx}px`;
81
- } else if (brandNameInput.value) {
82
- brandNameInput.value.style.width = 'auto';
83
- }
84
- });
85
- }
86
-
87
- watch(() => displayMode.value, resizeInput);
88
- watch(() => props.modelValue, resizeInput);
89
-
90
- onMounted(() => {
91
- nextTick(() => {
92
- revertValue.value = props.modelValue;
93
- resizeInput();
94
- });
95
- });
96
-
97
- function focus() {
98
- displayMode.value = false;
99
- }
100
-
101
- function save() {
102
- displayMode.value = true;
103
- if (
104
- props.modelValue.trim() === '' ||
105
- props.modelValue !== revertValue.value
106
- ) {
107
- emit('save');
108
- revertValue.value = props.modelValue;
109
- }
110
- }
111
-
112
- function revert() {
113
- emit('update:model-value', revertValue.value);
114
- brandNameInput.value?.blur();
115
- }
116
-
117
- function onInput(event: Event) {
118
- emit('update:model-value', (event.target as HTMLInputElement).value);
119
- }
120
-
121
- function onEditClick() {
122
- displayMode.value = !displayMode.value;
123
- if (!displayMode.value) {
124
- nextTick(() => {
125
- brandNameInput.value?.focus();
126
- });
127
- }
128
- }
129
-
130
- function onPencilIconClick() {
131
- onEditClick();
132
- }
133
- </script>
134
- <style scoped>
135
- .dynamic-width-input {
136
- @apply tw-border tw-outline-none tw-truncate tw-rounded tw-w-auto tw-py-0.5 tw-my-auto tw-text-base tw-text-white tw-max-w-xs;
137
- }
138
-
139
- input.dynamic-width-input:focus {
140
- -webkit-box-shadow: 0 0 5px #d1d1d1;
141
- box-shadow: 0 0 5px #d1d1d1;
142
- }
143
- </style>