@designcrowd/fe-shared-lib 1.0.9-ast-card-5 → 1.0.9-ast-card-7

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
@@ -17,6 +17,7 @@ export { default as SellDomainNameListModal } from './src/experiences/components
17
17
  export { default as SellDomainNameList } from './src/experiences/components/SellDomainNameList/SellDomainNameList.vue';
18
18
  export { default as SellDomainNameWidget } from './src/experiences/components/SellDomainNameWidget/SellDomainNameWidget.vue';
19
19
  export { default as PublishBrandPageModal } from './src/experiences/components/PublishBrandPageModal/PublishBrandPageModal.vue';
20
+ export { default as PublishBrandPageCard } from './src/experiences/components/PublishBrandPageModal/PublishBrandPageCard.vue';
20
21
 
21
22
  export { default as Button } from './src/atoms/components/Button/Button.vue';
22
23
  export { default as ButtonGroup } from './src/atoms/components/ButtonGroup/ButtonGroup.vue';
@@ -36,7 +37,6 @@ export { default as TextInput } from './src/atoms/components/TextInput/TextInput
36
37
  export { default as TextCopyField } from './src/atoms/components/TextCopyField/TextCopyField.vue';
37
38
  export { default as Textarea } from './src/atoms/components/Textarea/Textarea.vue';
38
39
  export { default as Toggle } from './src/atoms/components/Toggle/Toggle.vue';
39
- export { default as Card } from './src/atoms/components/Card/Card.vue';
40
40
  export { default as Checkbox } from './src/atoms/components/Checkbox/Checkbox.vue';
41
41
  export { default as ColorPicker } from './src/atoms/components/ColorPicker/ColorPicker.vue';
42
42
  export { default as Carousel } from './src/atoms/components/Carousel/Carousel.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.0.9-ast-card-5",
3
+ "version": "1.0.9-ast-card-7",
4
4
  "scripts": {
5
5
  "start": "npm run storybook",
6
6
  "build": "npm run build:css --production",
@@ -2308,9 +2308,6 @@ video {
2308
2308
  .theme-brandCrowd .md\:tw-text-left {
2309
2309
  text-align: left;
2310
2310
  }
2311
- .theme-brandCrowd .md\:tw-text-center {
2312
- text-align: center;
2313
- }
2314
2311
  .theme-brandCrowd .md\:tw-text-sm {
2315
2312
  font-size: 0.875rem;
2316
2313
  line-height: 1.25rem;
@@ -1996,9 +1996,6 @@ video {
1996
1996
  .theme-brandPage .md\:tw-text-left {
1997
1997
  text-align: left;
1998
1998
  }
1999
- .theme-brandPage .md\:tw-text-center {
2000
- text-align: center;
2001
- }
2002
1999
  .theme-brandPage .md\:tw-text-sm {
2003
2000
  font-size: 0.875rem;
2004
2001
  line-height: 1.25rem;
@@ -2308,9 +2308,6 @@ video {
2308
2308
  .theme-crazyDomains .md\:tw-text-left {
2309
2309
  text-align: left;
2310
2310
  }
2311
- .theme-crazyDomains .md\:tw-text-center {
2312
- text-align: center;
2313
- }
2314
2311
  .theme-crazyDomains .md\:tw-text-sm {
2315
2312
  font-size: 0.875rem;
2316
2313
  line-height: 1.25rem;
@@ -2308,9 +2308,6 @@ video {
2308
2308
  .theme-designCom .md\:tw-text-left {
2309
2309
  text-align: left;
2310
2310
  }
2311
- .theme-designCom .md\:tw-text-center {
2312
- text-align: center;
2313
- }
2314
2311
  .theme-designCom .md\:tw-text-sm {
2315
2312
  font-size: 0.875rem;
2316
2313
  line-height: 1.25rem;
@@ -2308,9 +2308,6 @@ video {
2308
2308
  .theme-designCrowd .md\:tw-text-left {
2309
2309
  text-align: left;
2310
2310
  }
2311
- .theme-designCrowd .md\:tw-text-center {
2312
- text-align: center;
2313
- }
2314
2311
  .theme-designCrowd .md\:tw-text-sm {
2315
2312
  font-size: 0.875rem;
2316
2313
  line-height: 1.25rem;
@@ -0,0 +1,115 @@
1
+ <template>
2
+ <div class="tw-bg-white tw-border tw-border-grayscale-500 tw-rounded tw-p-4">
3
+ <div class="tw-flex tw-flex-row tw-items-center">
4
+ <div class="tw-flex tw-flex-col tw-mx-auto tw-max-w-1/3 tw-text-center tw-align-top tw-px-2">
5
+ <img :src="imgUrl" alt="icon" class="md:tw-max-w-full" />
6
+ </div>
7
+ <div class="tw-flex tw-flex-col tw-px-2 tw-w-full">
8
+ <div class="tw-flex tw-flex-col md:tw-flex-row tw-text-center md:tw-text-left tw-items-center">
9
+ <div class="tw-flex tw-flex-col tw-w-full md:tw-grow tw-text-left">
10
+ <div class="tw-flex tw-flex-col md:tw-flex-row tw-gap-2">
11
+ <p class="tw-font-bold tw-text-sm" :class="{ 'tw-text-grayscale-800': isDesignCom }">
12
+ {{ title }}
13
+ </p>
14
+ <span
15
+ v-if="showLabel"
16
+ class="tw-text-xs tw-h-4 tw-w-fit tw-text-primary-500 tw-border tw-border-solid tw-border-primary-500 tw-rounded-full tw-px-2 tw-font-sans tw-uppercase"
17
+ >
18
+ Recommended
19
+ </span>
20
+ </div>
21
+ <p class="tw-mt-2 md:tw-mt-0 tw-text-grayscale-600 tw-text-sm">
22
+ {{ description }}
23
+ </p>
24
+ <div class="desktop-cta tw-mt-2">
25
+ <slot name="slug" />
26
+ </div>
27
+ </div>
28
+ <div v-if="hasSearchButton" class="tw-w-full md:tw-w-auto md:tw-justify-end md:tw-pl-4 desktop-cta">
29
+ <Button
30
+ label="Search"
31
+ class="tw-flex tw-items-center tw-justify-center md:tw-ml-2 tw-mt-2 md:tw-mt-0 tw-font-sans tw-font-bold tw-transition-colors tw-duration-300 tw-text-sm tw-w-full tw-rounded tw-cursor-pointer tw-w-full md:tw-w-24"
32
+ data-test-brand-page-publish-button
33
+ variant="primary"
34
+ size="small-medium"
35
+ @on-click="onClick"
36
+ :class="{
37
+ 'tw-uppercase': !isDesignCom,
38
+ }"
39
+ />
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <div class="tw-mt-2 tw-px-2 tw-flex tw-flex-col tw-w-full">
45
+ <div class="mobile-cta">
46
+ <slot name="slug" />
47
+ </div>
48
+ <div v-if="hasSearchButton" class="tw-w-full md:tw-w-auto md:tw-justify-end md:tw-pl-4 mobile-cta tw-mt-2">
49
+ <Button
50
+ label="Search"
51
+ class="tw-flex tw-items-center tw-justify-center md:tw-ml-2 tw-mt-2 md:tw-mt-0 tw-font-sans tw-font-bold tw-transition-colors tw-duration-300 tw-text-sm tw-w-full tw-rounded tw-cursor-pointer tw-w-full md:tw-w-24"
52
+ data-test-brand-page-search-button
53
+ variant="primary"
54
+ size="small-medium"
55
+ :full-width="true"
56
+ @on-click="onClick"
57
+ :class="{
58
+ 'tw-uppercase': !isDesignCom,
59
+ }"
60
+ />
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </template>
65
+ <script setup lang="ts">
66
+ import Button from '../../../../src/atoms/components/Button/Button.vue';
67
+
68
+ const props = defineProps({
69
+ title: {
70
+ type: String,
71
+ default: '',
72
+ },
73
+ description: {
74
+ type: String,
75
+ default: '',
76
+ },
77
+ imgUrl: {
78
+ type: Boolean,
79
+ default: true,
80
+ },
81
+ isDesignCom: {
82
+ type: Boolean,
83
+ default: false,
84
+ },
85
+ hasSearchButton: {
86
+ type: Boolean,
87
+ default: true,
88
+ },
89
+ showLabel: {
90
+ type: Boolean,
91
+ default: false,
92
+ },
93
+ });
94
+
95
+ const emit = defineEmits(['on-show-domain-list-modal']);
96
+ const onClick = () => {
97
+ emit('on-show-domain-list-modal');
98
+ };
99
+ </script>
100
+
101
+ <style scoped>
102
+ @media (max-width: 640px) {
103
+ .desktop-cta {
104
+ display: none;
105
+ width: 100%;
106
+ }
107
+ }
108
+
109
+ @media (min-width: 640px) {
110
+ .mobile-cta {
111
+ display: none;
112
+ width: 100%;
113
+ }
114
+ }
115
+ </style>
@@ -1,4 +1,4 @@
1
- import Card from '../../../atoms/components/Card/Card.vue';
1
+ import Card from './PublishBrandPageCard.vue';
2
2
  import PublishBrandPageModal from './PublishBrandPageModal.vue';
3
3
  import { domains } from './__fixtures__/data';
4
4
 
@@ -48,7 +48,7 @@
48
48
  </label>
49
49
  </div>
50
50
  <div v-if="isNotPublished || isSlugEditMode" class="tw-mt-4">
51
- <Card
51
+ <PublishBrandPageCard
52
52
  v-if="!hasPurchasedDomains"
53
53
  :imgUrl="iconUrl"
54
54
  title="Free Address"
@@ -64,8 +64,8 @@
64
64
  element-classes="tw-mb-0 !tw-rounded-l-none tw-text-md tw-w-1/3"
65
65
  :prefix-text="`${brandPageBaseUrl}/`"
66
66
  :error="!!slugValidationError"
67
- :disabled="isPublishing || domainTypeValue === DOMAIN_TYPES.purchased"
68
- :placeholder="isBrandContact ? 'your-name' : 'your-business-name'"
67
+ :disabled="isInputEnabled"
68
+ :placeholder="getPlaceHolder(brandPageType)"
69
69
  data-test-brand-page-slug-input
70
70
  :attrs="{ 'data-test-set-url-text-field': '' }"
71
71
  @input="onSlugChanged"
@@ -77,27 +77,30 @@
77
77
  {{ slugErrorMessage }}
78
78
  </div>
79
79
  </div>
80
- <button
81
- class="md:tw-ml-2 tw-mt-2 md:tw-mt-0 tw-font-sans tw-font-bold tw-transition-colors tw-duration-300 tw-text-sm tw-py-2 tw-px-4 tw-w-full tw-rounded tw-cursor-pointer tw-w-full md:tw-w-24 tw-text-white tw-bg-primary-500"
82
- @click="onPublish"
80
+ <Button
81
+ label="Publish"
82
+ :disabled="isPublishAllowed"
83
+ class="tw-flex tw-items-center tw-justify-center md:tw-ml-2 tw-mt-2 md:tw-mt-0 tw-font-sans tw-font-bold tw-transition-colors tw-duration-300 tw-text-sm tw-w-full tw-rounded tw-cursor-pointer tw-w-full md:tw-w-24"
83
84
  data-test-brand-page-publish-button
85
+ variant="primary"
86
+ size="small-medium"
87
+ @on-click="onPublish"
88
+ :full-width="isMobile"
84
89
  :class="{
85
- 'tw-uppercase': !isDesignCom
90
+ 'tw-uppercase': !isDesignCom,
86
91
  }"
87
- >
88
- Publish
89
- </button>
92
+ />
90
93
  </div>
91
94
  </template>
92
- </Card>
95
+ </PublishBrandPageCard>
93
96
  <div v-else>
94
97
  <TextInput
95
98
  v-model="internalSlug"
96
99
  element-classes="tw-mb-0 !tw-rounded-l-none tw-text-lg"
97
100
  :prefix-text="`${brandPageBaseUrl}/`"
98
101
  :error="!!slugValidationError"
99
- :disabled="isPublishing || domainTypeValue === DOMAIN_TYPES.purchased"
100
- :placeholder="your - brand - name"
102
+ :disabled="isInputEnabled"
103
+ :placeholder="getPlaceHolder(brandPageType)"
101
104
  data-test-brand-page-slug-input
102
105
  :attrs="{ 'data-test-set-url-text-field': '' }"
103
106
  @input="onSlugChanged"
@@ -166,7 +169,7 @@
166
169
  :label="isSlugEditMode ? 'Set URL' : 'Publish'"
167
170
  :variant="isDesignCom ? 'primary' : 'primary-with-icon'"
168
171
  icon="chevron-right-wide"
169
- :disabled="!allowPublish || isPublishing"
172
+ :disabled="isPublishAllowed"
170
173
  class="tw-my-4"
171
174
  :full-width="isMobile"
172
175
  data-test-brand-page-publish-button
@@ -242,7 +245,7 @@
242
245
  </template>
243
246
  <script>
244
247
  import Modal from '../../../../src/atoms/components/Modal/Modal.vue';
245
- import Card from '../../../../src/atoms/components/Card/Card.vue';
248
+ import PublishBrandPageCard from './PublishBrandPageCard.vue';
246
249
  import TextInput from '../../../../src/atoms/components/TextInput/TextInput.vue';
247
250
  import Dropdown from '../../../../src/atoms/components/Dropdown/Dropdown.vue';
248
251
  import DropdownItem from '../../../../src/atoms/components/Dropdown/DropdownItem.vue';
@@ -262,6 +265,9 @@ const DOMAIN_TYPES = {
262
265
  purchased: 'purchased',
263
266
  };
264
267
 
268
+ const DCOM_IMG_FREE = 'https://brandcrowd-cdn.s3.amazonaws.com/public/assets/images/icons/publish/dcom-free-url.svg';
269
+ const BC_IMG_FREE = 'https://brandcrowd-cdn.s3.amazonaws.com/public/assets/images/icons/publish/bc-free-url.svg';
270
+
265
271
  export default {
266
272
  components: {
267
273
  Modal,
@@ -272,7 +278,7 @@ export default {
272
278
  TextCopyField,
273
279
  SellDomainNameSearchWithResults,
274
280
  SellDomainNameListModal,
275
- Card,
281
+ PublishBrandPageCard,
276
282
  },
277
283
  mixins: [mediaQueryMixin],
278
284
  props: {
@@ -389,8 +395,8 @@ export default {
389
395
  required: false,
390
396
  default: undefined,
391
397
  },
392
- isBrandContact: {
393
- type: Boolean,
398
+ brandPageType: {
399
+ type: String,
394
400
  required: true,
395
401
  default: false,
396
402
  },
@@ -441,9 +447,13 @@ export default {
441
447
  return this.isPublished && this.shouldPublish && this.isBrandPageSlugEditMode;
442
448
  },
443
449
  iconUrl() {
444
- return this.isDesignCom
445
- ? 'https://brandcrowd-cdn.s3.amazonaws.com/public/assets/images/icons/publish/dcom-free-url.svg'
446
- : 'https://brandcrowd-cdn.s3.amazonaws.com/public/assets/images/icons/publish/bc-free-url.svg';
450
+ return this.isDesignCom ? DCOM_IMG_FREE : BC_IMG_FREE;
451
+ },
452
+ isInputEnabled() {
453
+ return this.isPublishing || this.domainTypeValue === DOMAIN_TYPES.purchased;
454
+ },
455
+ isPublishAllowed() {
456
+ return !this.allowPublish || this.isPublishing;
447
457
  },
448
458
  },
449
459
  watch: {
@@ -546,6 +556,9 @@ export default {
546
556
  const cleanedText = inputText.replace(/[^\p{L}\p{N}\-.]+/gu, '');
547
557
  return cleanedText.toLowerCase();
548
558
  },
559
+ getPlaceHolder(type) {
560
+ return type === 'brandContact' ? 'your-name' : 'your-business-name';
561
+ },
549
562
  },
550
563
  };
551
564
  </script>
@@ -1,40 +0,0 @@
1
- import Card from './Card.vue';
2
-
3
- export default {
4
- title: 'Components/Card',
5
- component: Card,
6
- };
7
-
8
- const data = {
9
- components: {
10
- Card,
11
- },
12
- };
13
-
14
- export const Sample = () => {
15
- return {
16
- ...data,
17
- template: `
18
- <Card
19
- :imgUrl="'https://brandcrowd-cdn.s3.amazonaws.com/public/assets/images/icons/publish/dcom-free-url.svg'"
20
- title="Purchase Domain"
21
- description="Find the perfect domain name for your brand"
22
- is-design-com="true"
23
- >
24
- <template #slug>
25
- test
26
- </template>
27
- </Card>
28
-
29
- <Card
30
- imgUrl="https://brandcrowd-cdn.s3.amazonaws.com/public/assets/images/icons/addon/add-ons-domain-name.svg"
31
- title="Custom Domain"
32
- description="Make it easy for customers to find you with a domain that matches your business"
33
- :is-design-com="isDesignCom"
34
- :has-search-button="true"
35
- :show-label="true"
36
- @on-show-domain-list-modal="onShowDomainListModal"
37
- />
38
- `,
39
- };
40
- };
@@ -1,114 +0,0 @@
1
- <template>
2
- <div class="tw-bg-white tw-border tw-border-grayscale-500 tw-rounded tw-p-4">
3
- <div class="tw-flex tw-flex-row tw-items-center">
4
- <div class="tw-flex tw-flex-col tw-mx-auto tw-max-w-1/3 tw-text-center tw-align-top tw-px-2">
5
- <img :src="imgUrl" alt="icon" class="md:tw-max-w-full" />
6
- </div>
7
- <div class="tw-flex tw-flex-col tw-px-2 tw-w-full">
8
- <div class="tw-flex tw-flex-col md:tw-flex-row tw-text-center md:tw-text-left tw-items-center">
9
- <div class="tw-flex tw-flex-col tw-w-full md:tw-grow tw-text-left">
10
- <div class="tw-flex tw-flex-col md:tw-flex-row">
11
- <p class="tw-font-bold tw-text-sm" :class="{ 'tw-text-grayscale-800': isDesignCom }">
12
- {{ title }}
13
- </p>
14
- <span
15
- v-if="showLabel"
16
- class="md:tw-ml-2 tw-text-xs tw-h-4 tw-w-fit tw-text-primary-500 tw-border tw-border-solid tw-border-primary-500 tw-rounded-full tw-px-2 tw-font-sans tw-uppercase"
17
- >Recommended</span
18
- >
19
- </div>
20
- <p class="tw-text-grayscale-600 tw-text-sm">
21
- {{ description }}
22
- </p>
23
- <div class="desktop-cta tw-mt-2">
24
- <slot name="slug" />
25
- </div>
26
- </div>
27
- <div v-if="hasSearchButton" class="tw-w-full md:tw-w-auto md:tw-justify-end md:tw-pl-4 desktop-cta">
28
- <button
29
- class="tw-font-sans tw-font-bold tw-transition-colors tw-duration-300 tw-text-sm tw-py-2 tw-px-4 tw-w-full tw-rounded tw-cursor-pointer tw-w-full md:tw-w-24 tw-text-white tw-bg-primary-500"
30
- @click="onClick"
31
- :class="{
32
- 'tw-uppercase': !isDesignCom,
33
- }"
34
- >
35
- Search
36
- </button>
37
- </div>
38
- </div>
39
- </div>
40
- </div>
41
- <div class="tw-mt-2 tw-px-2 tw-flex tw-flex-col tw-w-full">
42
- <div class="mobile-cta">
43
- <slot name="slug" />
44
- </div>
45
- <div v-if="hasSearchButton" class="tw-w-full md:tw-w-auto md:tw-justify-end md:tw-pl-4 mobile-cta tw-mt-2">
46
- <button
47
- class="tw-font-sans tw-font-bold tw-transition-colors tw-duration-300 tw-text-sm tw-py-2 tw-px-4 tw-w-full tw-rounded tw-cursor-pointer tw-w-full md:tw-w-24 tw-text-white tw-bg-primary-500"
48
- @click="onClick"
49
- :class="{
50
- 'tw-uppercase': !isDesignCom,
51
- }"
52
- >
53
- Search
54
- </button>
55
- </div>
56
- </div>
57
- </div>
58
- </template>
59
- <script>
60
- import Icon from '../Icon/Icon.vue';
61
-
62
- export default {
63
- components: {
64
- Icon,
65
- },
66
- props: {
67
- title: {
68
- type: String,
69
- default: '',
70
- },
71
- description: {
72
- type: String,
73
- default: '',
74
- },
75
- imgUrl: {
76
- type: Boolean,
77
- default: true,
78
- },
79
- isDesignCom: {
80
- type: Boolean,
81
- default: false,
82
- },
83
- hasSearchButton: {
84
- type: Boolean,
85
- default: true,
86
- },
87
- showLabel: {
88
- type: Boolean,
89
- default: false,
90
- },
91
- },
92
- methods: {
93
- onClick() {
94
- this.$emit('on-show-domain-list-modal');
95
- },
96
- },
97
- };
98
- </script>
99
-
100
- <style scoped>
101
- @media (max-width: 640px) {
102
- .desktop-cta {
103
- display: none;
104
- width: 100%;
105
- }
106
- }
107
-
108
- @media (min-width: 640px) {
109
- .mobile-cta {
110
- display: none;
111
- width: 100%;
112
- }
113
- }
114
- </style>