@designcrowd/fe-shared-lib 1.1.10 → 1.1.12-ast-disabled-1

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.
@@ -84,6 +84,7 @@
84
84
  <script>
85
85
  import ButtonOutline from './variants/ButtonOutline.vue';
86
86
  import ButtonPrimary from './variants/ButtonPrimary.vue';
87
+ import ButtonOutlinePrimary from './variants/ButtonOutlinePrimary.vue';
87
88
  import ButtonWarning from './variants/ButtonWarning.vue';
88
89
  import ButtonSecondary from './variants/ButtonSecondary.vue';
89
90
  import ButtonInfoFilled from './variants/ButtonInfoFilled.vue';
@@ -107,6 +108,7 @@ export default {
107
108
  name: 'Button',
108
109
  components: {
109
110
  'button-crazyDomains-primary': ButtonCrazyDomainsPrimary,
111
+ 'button-crazyDomains-outline-primary': ButtonOutlinePrimary,
110
112
  'button-crazyDomains-outline': ButtonCrazyDomainsOutline,
111
113
  'button-crazyDomains-secondary': ButtonSecondary,
112
114
  'button-crazyDomains-primary-with-icon': ButtonPrimaryWithIcon,
@@ -118,6 +120,7 @@ export default {
118
120
  'button-crazyDomains-pill': ButtonPill,
119
121
 
120
122
  'button-brandCrowd-primary': ButtonPrimary,
123
+ 'button-brandCrowd-outline-primary': ButtonOutlinePrimary,
121
124
  'button-brandCrowd-warning': ButtonWarning,
122
125
  'button-brandCrowd-info-filled': ButtonInfoFilled,
123
126
  'button-brandCrowd-outline': ButtonOutline,
@@ -278,6 +278,30 @@ export const PrimarySamples = (args, { argTypes }) => {
278
278
  PrimarySamples.args = controlArgs;
279
279
  PrimarySamples.argTypes = controlArgTypes;
280
280
 
281
+ export const OutlinePrimarySamples = (args, { argTypes }) => {
282
+ return {
283
+ components: {
284
+ StorybookButtonComponent,
285
+ },
286
+ props: Object.keys(argTypes),
287
+ data() {
288
+ return {
289
+ variants: generateSampleButtonVariants('outline-primary'),
290
+ };
291
+ },
292
+ template: `
293
+ <StorybookButtonComponent
294
+ :disabled="disabled"
295
+ :full-width="fullWidth"
296
+ :grey-out-left="greyOutLeft"
297
+ :justify="justify"
298
+ :variants="variants"/>
299
+ `,
300
+ };
301
+ };
302
+ OutlinePrimarySamples.args = controlArgs;
303
+ OutlinePrimarySamples.argTypes = controlArgTypes;
304
+
281
305
  export const SecondarySamples = (args, { argTypes }) => {
282
306
  return {
283
307
  components: {
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <button
3
+ v-if="!url"
4
+ class="tw-font-sans tw-border-2 tw-border-solid tw-font-bold tw-text-primary-500 tw-uppercase tw-transition-colors tw-duration-300"
5
+ :class="[
6
+ classes,
7
+ computedClasses,
8
+ {
9
+ 'tw-border-grayscale-500 tw-bg-grayscale-400 tw-text-grayscale-600 tw-cursor-not-allowed': disabled,
10
+ 'tw-cursor-pointer': !disabled,
11
+ 'tw-border-primary-500 tw-bg-white hover:tw-bg-primary-100 tw-text-primary-500': !isBusy && !disabled,
12
+ 'tw-border-grayscale-500 tw-bg-grayscale-400 hover:tw-bg-grayscale-300 hover:tw-border-grayscale-400 tw-text-grayscale-600':
13
+ isBusy,
14
+ },
15
+ ]"
16
+ :disabled="disabled"
17
+ :type="type"
18
+ v-bind="attrs"
19
+ @click="onClick"
20
+ >
21
+ <slot />
22
+ </button>
23
+ <a
24
+ v-else
25
+ :href="computedUrl"
26
+ class="tw-justify-center tw-font-sans tw-inline-flex tw-border-2 tw-border-solid tw-font-bold tw-uppercase tw-transition-colors tw-duration-300"
27
+ :class="[
28
+ commonUrlButtonClasses,
29
+ classes,
30
+ computedClasses,
31
+ {
32
+ 'tw-cursor-wait': disabled,
33
+ 'tw-cursor-pointer': !disabled,
34
+ 'tw-border-primary-500 tw-bg-white hover:tw-bg-primary-100 tw-text-primary-500': !isBusy,
35
+ 'tw-border-grayscale-500 tw-bg-grayscale-400 hover:tw-bg-grayscale-300 hover:tw-border-grayscale-400 tw-text-grayscale-600':
36
+ isBusy,
37
+ },
38
+ ]"
39
+ :download="download"
40
+ v-bind="attrs"
41
+ :target="target"
42
+ @click="onClick"
43
+ >
44
+ <slot />
45
+ </a>
46
+ </template>
47
+ <script>
48
+ import ButtonVariant from '../ButtonVariant.mixin.vue';
49
+
50
+ export default {
51
+ mixins: [ButtonVariant],
52
+ };
53
+ </script>
@@ -21,6 +21,7 @@ export const Sample = () => {
21
21
  {
22
22
  label: 'Medium',
23
23
  value: 'medium',
24
+ disabled: true,
24
25
  },
25
26
  {
26
27
  label: 'Large',
@@ -10,11 +10,14 @@
10
10
  <button
11
11
  class="button-group-item tw-text-xs tw-shadow-inner tw-w-full tw-py-2"
12
12
  :class="{
13
- '!tw-shadow-[0_0_0_2px] !tw-shadow-info-500': option.isSelected,
14
- '!tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200 hover:!tw-shadow-info-500': !option.isSelected,
13
+ '!tw-shadow-[0_0_0_2px] !tw-shadow-info-500': option.isSelected && !option.disabled,
14
+ '!tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200': !option.isSelected && !option.disabled,
15
+ 'hover:!tw-shadow-info-500': !option.isSelected && !option.disabled,
16
+ 'tw-opacity-50 !tw-cursor-not-allowed !tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200': option.disabled,
15
17
  }"
18
+ :disabled="option.disabled"
16
19
  v-bind="option.dataAttribute ? { [option.dataAttribute]: '' } : {}"
17
- @click="$emit('on-select', option)"
20
+ @click="!option.disabled && $emit('on-select', option)"
18
21
  >
19
22
  <slot name="content" :option="option"></slot>
20
23
  </button>
@@ -35,8 +38,10 @@
35
38
  <button
36
39
  v-if="variant === 'icon'"
37
40
  :class="{
38
- '!tw-shadow-[0_0_0_2px] !tw-shadow-info-500': option.isSelected,
39
- '!tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200 hover:!tw-shadow-info-500': !option.isSelected,
41
+ '!tw-shadow-[0_0_0_2px] !tw-shadow-info-500': option.isSelected && !option.disabled,
42
+ '!tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200': !option.isSelected && !option.disabled,
43
+ 'hover:!tw-shadow-info-500': !option.isSelected && !option.disabled,
44
+ 'tw-opacity-50 !tw-cursor-not-allowed !tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200': option.disabled,
40
45
  'tw-px-2': !option.iconViewBox,
41
46
  'tw-px-px':
42
47
  option.iconViewBox && !option.isSelected && !option.iconName.includes('display-style') && btnStyleVariant, // TODO - move style logic to computed prop
@@ -45,9 +50,10 @@
45
50
  'tw-px-0 tw-py-0': option.iconName.includes('display-style') || btnStyleVariant === 'compressed',
46
51
  }"
47
52
  :style="option.iconName.includes('display-style') ? { lineHeight: 0 } : {}"
53
+ :disabled="option.disabled"
48
54
  class="tw-text-xs button-group-icon-button tw-shadow-inner"
49
55
  v-bind="option.dataAttribute ? { [option.dataAttribute]: '' } : {}"
50
- @click="$emit('on-select', option)"
56
+ @click="!option.disabled && $emit('on-select', option)"
51
57
  >
52
58
  <div
53
59
  :class="{
@@ -67,12 +73,15 @@
67
73
  <button
68
74
  v-else
69
75
  :class="{
70
- '!tw-shadow-[0_0_0_2px] !tw-shadow-info-500': option.isSelected,
71
- '!tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200 hover:!tw-shadow-info-500': !option.isSelected,
76
+ '!tw-shadow-[0_0_0_2px] !tw-shadow-info-500': option.isSelected && !option.disabled,
77
+ '!tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200': !option.isSelected && !option.disabled,
78
+ 'hover:!tw-shadow-info-500': !option.isSelected && !option.disabled,
79
+ 'tw-opacity-50 !tw-cursor-not-allowed !tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200': option.disabled,
72
80
  }"
81
+ :disabled="option.disabled"
73
82
  class="tw-text-xs button-group-image-button tw-shadow-inner"
74
83
  v-bind="option.dataAttribute ? { [option.dataAttribute]: '' } : {}"
75
- @click="$emit('on-select', option)"
84
+ @click="!option.disabled && $emit('on-select', option)"
76
85
  >
77
86
  <img :src="option.src" :alt="option.alt" class="tw-w-full tw-h-full" />
78
87
  </button>
@@ -90,11 +99,14 @@
90
99
  :key="`button-${option.value}`"
91
100
  :class="{
92
101
  'tw-ml-2': idx > 0 && !columns,
93
- '!tw-shadow-[0_0_0_2px] !tw-shadow-info-500': option.isSelected,
94
- '!tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200 hover:!tw-shadow-info-500': !option.isSelected,
102
+ '!tw-shadow-[0_0_0_2px] !tw-shadow-info-500': option.isSelected && !option.disabled,
103
+ '!tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200': !option.isSelected && !option.disabled,
104
+ 'hover:!tw-shadow-info-500': !option.isSelected && !option.disabled,
105
+ 'tw-opacity-50 !tw-cursor-not-allowed !tw-shadow-[0_0_0_1px] !tw-shadow-secondary-200': option.disabled,
95
106
  }"
107
+ :disabled="option.disabled"
96
108
  class="tw-text-xs button-group-button tw-shadow-inner"
97
- @click="$emit('on-select', option)"
109
+ @click="!option.disabled && $emit('on-select', option)"
98
110
  >
99
111
  {{ option.label }}
100
112
  </button>
@@ -138,6 +138,7 @@
138
138
  :element-classes="{
139
139
  'tw-h-12': true,
140
140
  }"
141
+ menu-element-classes="tw-w-full"
141
142
  :disabled="domainTypeValue === DOMAIN_TYPES.slug"
142
143
  :class="{
143
144
  'tw-text-grayscale-600 tw-font-normal': !selectedCustomDomain,