@designcrowd/fe-shared-lib 1.2.2 → 1.2.3-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.2.2",
3
+ "version": "1.2.3-ast-disabled-1",
4
4
  "scripts": {
5
5
  "start": "run-p storybook watch:translation",
6
6
  "build": "npm run build:css --production",
@@ -719,6 +719,9 @@ video {
719
719
  .theme-brandCrowd .tw-ml-auto {
720
720
  margin-left: auto;
721
721
  }
722
+ .theme-brandCrowd .tw-mr-1 {
723
+ margin-right: 0.25rem;
724
+ }
722
725
  .theme-brandCrowd .tw-mr-2 {
723
726
  margin-right: 0.5rem;
724
727
  }
@@ -827,6 +830,10 @@ video {
827
830
  .theme-brandCrowd .tw-h-auto {
828
831
  height: auto;
829
832
  }
833
+ .theme-brandCrowd .tw-h-fit {
834
+ height: -moz-fit-content;
835
+ height: fit-content;
836
+ }
830
837
  .theme-brandCrowd .tw-h-full {
831
838
  height: 100%;
832
839
  }
@@ -1013,6 +1020,9 @@ video {
1013
1020
  .theme-brandCrowd .tw-animate-spin {
1014
1021
  animation: tw-spin 1s linear infinite;
1015
1022
  }
1023
+ .\!tw-cursor-not-allowed {
1024
+ cursor: not-allowed !important;
1025
+ }
1016
1026
  .theme-brandCrowd .tw-cursor-not-allowed {
1017
1027
  cursor: not-allowed;
1018
1028
  }
@@ -1446,6 +1456,17 @@ video {
1446
1456
  .theme-brandCrowd .tw-bg-opacity-80 {
1447
1457
  --tw-bg-opacity: 0.8;
1448
1458
  }
1459
+ .theme-brandCrowd .tw-bg-gradient-to-t {
1460
+ background-image: linear-gradient(to top, var(--tw-gradient-stops));
1461
+ }
1462
+ .theme-brandCrowd .tw-from-\[\#d946ef\] {
1463
+ --tw-gradient-from: #d946ef var(--tw-gradient-from-position);
1464
+ --tw-gradient-to: rgb(217 70 239 / 0) var(--tw-gradient-to-position);
1465
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
1466
+ }
1467
+ .theme-brandCrowd .tw-to-\[\#8b5cf6\] {
1468
+ --tw-gradient-to: #8b5cf6 var(--tw-gradient-to-position);
1469
+ }
1449
1470
  .theme-brandCrowd .tw-bg-no-repeat {
1450
1471
  background-repeat: no-repeat;
1451
1472
  }
@@ -2087,6 +2108,10 @@ video {
2087
2108
  --tw-shadow-color: #0097D7 !important;
2088
2109
  --tw-shadow: var(--tw-shadow-colored) !important;
2089
2110
  }
2111
+ .theme-brandCrowd .hover\:tw-brightness-\[0\.85\]:hover {
2112
+ --tw-brightness: brightness(0.85);
2113
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2114
+ }
2090
2115
  .theme-brandCrowd .focus\:tw-border-error-600:focus {
2091
2116
  --tw-border-opacity: 1;
2092
2117
  border-color: rgb(194 22 50 / var(--tw-border-opacity));
@@ -719,6 +719,9 @@ video {
719
719
  .theme-brandPage .tw-ml-auto {
720
720
  margin-left: auto;
721
721
  }
722
+ .theme-brandPage .tw-mr-1 {
723
+ margin-right: 0.25rem;
724
+ }
722
725
  .theme-brandPage .tw-mr-2 {
723
726
  margin-right: 0.5rem;
724
727
  }
@@ -827,6 +830,10 @@ video {
827
830
  .theme-brandPage .tw-h-auto {
828
831
  height: auto;
829
832
  }
833
+ .theme-brandPage .tw-h-fit {
834
+ height: -moz-fit-content;
835
+ height: fit-content;
836
+ }
830
837
  .theme-brandPage .tw-h-full {
831
838
  height: 100%;
832
839
  }
@@ -1013,6 +1020,9 @@ video {
1013
1020
  .theme-brandPage .tw-animate-spin {
1014
1021
  animation: tw-spin 1s linear infinite;
1015
1022
  }
1023
+ .\!tw-cursor-not-allowed {
1024
+ cursor: not-allowed !important;
1025
+ }
1016
1026
  .theme-brandPage .tw-cursor-not-allowed {
1017
1027
  cursor: not-allowed;
1018
1028
  }
@@ -1294,6 +1304,17 @@ video {
1294
1304
  .theme-brandPage .tw-bg-opacity-80 {
1295
1305
  --tw-bg-opacity: 0.8;
1296
1306
  }
1307
+ .theme-brandPage .tw-bg-gradient-to-t {
1308
+ background-image: linear-gradient(to top, var(--tw-gradient-stops));
1309
+ }
1310
+ .theme-brandPage .tw-from-\[\#d946ef\] {
1311
+ --tw-gradient-from: #d946ef var(--tw-gradient-from-position);
1312
+ --tw-gradient-to: rgb(217 70 239 / 0) var(--tw-gradient-to-position);
1313
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
1314
+ }
1315
+ .theme-brandPage .tw-to-\[\#8b5cf6\] {
1316
+ --tw-gradient-to: #8b5cf6 var(--tw-gradient-to-position);
1317
+ }
1297
1318
  .theme-brandPage .tw-bg-no-repeat {
1298
1319
  background-repeat: no-repeat;
1299
1320
  }
@@ -1791,6 +1812,10 @@ video {
1791
1812
  --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
1792
1813
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1793
1814
  }
1815
+ .theme-brandPage .hover\:tw-brightness-\[0\.85\]:hover {
1816
+ --tw-brightness: brightness(0.85);
1817
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1818
+ }
1794
1819
  .theme-brandPage .focus\:tw-border-grayscale-600:focus {
1795
1820
  --tw-border-opacity: 1;
1796
1821
  border-color: rgb(94 94 94 / var(--tw-border-opacity));
@@ -719,6 +719,9 @@ video {
719
719
  .theme-crazyDomains .tw-ml-auto {
720
720
  margin-left: auto;
721
721
  }
722
+ .theme-crazyDomains .tw-mr-1 {
723
+ margin-right: 0.25rem;
724
+ }
722
725
  .theme-crazyDomains .tw-mr-2 {
723
726
  margin-right: 0.5rem;
724
727
  }
@@ -827,6 +830,10 @@ video {
827
830
  .theme-crazyDomains .tw-h-auto {
828
831
  height: auto;
829
832
  }
833
+ .theme-crazyDomains .tw-h-fit {
834
+ height: -moz-fit-content;
835
+ height: fit-content;
836
+ }
830
837
  .theme-crazyDomains .tw-h-full {
831
838
  height: 100%;
832
839
  }
@@ -1013,6 +1020,9 @@ video {
1013
1020
  .theme-crazyDomains .tw-animate-spin {
1014
1021
  animation: tw-spin 1s linear infinite;
1015
1022
  }
1023
+ .\!tw-cursor-not-allowed {
1024
+ cursor: not-allowed !important;
1025
+ }
1016
1026
  .theme-crazyDomains .tw-cursor-not-allowed {
1017
1027
  cursor: not-allowed;
1018
1028
  }
@@ -1446,6 +1456,17 @@ video {
1446
1456
  .theme-crazyDomains .tw-bg-opacity-80 {
1447
1457
  --tw-bg-opacity: 0.8;
1448
1458
  }
1459
+ .theme-crazyDomains .tw-bg-gradient-to-t {
1460
+ background-image: linear-gradient(to top, var(--tw-gradient-stops));
1461
+ }
1462
+ .theme-crazyDomains .tw-from-\[\#d946ef\] {
1463
+ --tw-gradient-from: #d946ef var(--tw-gradient-from-position);
1464
+ --tw-gradient-to: rgb(217 70 239 / 0) var(--tw-gradient-to-position);
1465
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
1466
+ }
1467
+ .theme-crazyDomains .tw-to-\[\#8b5cf6\] {
1468
+ --tw-gradient-to: #8b5cf6 var(--tw-gradient-to-position);
1469
+ }
1449
1470
  .theme-crazyDomains .tw-bg-no-repeat {
1450
1471
  background-repeat: no-repeat;
1451
1472
  }
@@ -2087,6 +2108,10 @@ video {
2087
2108
  --tw-shadow-color: #00A1EF !important;
2088
2109
  --tw-shadow: var(--tw-shadow-colored) !important;
2089
2110
  }
2111
+ .theme-crazyDomains .hover\:tw-brightness-\[0\.85\]:hover {
2112
+ --tw-brightness: brightness(0.85);
2113
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2114
+ }
2090
2115
  .theme-crazyDomains .focus\:tw-border-error-600:focus {
2091
2116
  --tw-border-opacity: 1;
2092
2117
  border-color: rgb(186 24 79 / var(--tw-border-opacity));
@@ -719,6 +719,9 @@ video {
719
719
  .theme-designCom .tw-ml-auto {
720
720
  margin-left: auto;
721
721
  }
722
+ .theme-designCom .tw-mr-1 {
723
+ margin-right: 0.25rem;
724
+ }
722
725
  .theme-designCom .tw-mr-2 {
723
726
  margin-right: 0.5rem;
724
727
  }
@@ -827,6 +830,10 @@ video {
827
830
  .theme-designCom .tw-h-auto {
828
831
  height: auto;
829
832
  }
833
+ .theme-designCom .tw-h-fit {
834
+ height: -moz-fit-content;
835
+ height: fit-content;
836
+ }
830
837
  .theme-designCom .tw-h-full {
831
838
  height: 100%;
832
839
  }
@@ -1013,6 +1020,9 @@ video {
1013
1020
  .theme-designCom .tw-animate-spin {
1014
1021
  animation: tw-spin 1s linear infinite;
1015
1022
  }
1023
+ .\!tw-cursor-not-allowed {
1024
+ cursor: not-allowed !important;
1025
+ }
1016
1026
  .theme-designCom .tw-cursor-not-allowed {
1017
1027
  cursor: not-allowed;
1018
1028
  }
@@ -1446,6 +1456,17 @@ video {
1446
1456
  .theme-designCom .tw-bg-opacity-80 {
1447
1457
  --tw-bg-opacity: 0.8;
1448
1458
  }
1459
+ .theme-designCom .tw-bg-gradient-to-t {
1460
+ background-image: linear-gradient(to top, var(--tw-gradient-stops));
1461
+ }
1462
+ .theme-designCom .tw-from-\[\#d946ef\] {
1463
+ --tw-gradient-from: #d946ef var(--tw-gradient-from-position);
1464
+ --tw-gradient-to: rgb(217 70 239 / 0) var(--tw-gradient-to-position);
1465
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
1466
+ }
1467
+ .theme-designCom .tw-to-\[\#8b5cf6\] {
1468
+ --tw-gradient-to: #8b5cf6 var(--tw-gradient-to-position);
1469
+ }
1449
1470
  .theme-designCom .tw-bg-no-repeat {
1450
1471
  background-repeat: no-repeat;
1451
1472
  }
@@ -2087,6 +2108,10 @@ video {
2087
2108
  --tw-shadow-color: #3f59f6 !important;
2088
2109
  --tw-shadow: var(--tw-shadow-colored) !important;
2089
2110
  }
2111
+ .theme-designCom .hover\:tw-brightness-\[0\.85\]:hover {
2112
+ --tw-brightness: brightness(0.85);
2113
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2114
+ }
2090
2115
  .theme-designCom .focus\:tw-border-error-600:focus {
2091
2116
  --tw-border-opacity: 1;
2092
2117
  border-color: rgb(182 58 42 / var(--tw-border-opacity));
@@ -719,6 +719,9 @@ video {
719
719
  .theme-designCrowd .tw-ml-auto {
720
720
  margin-left: auto;
721
721
  }
722
+ .theme-designCrowd .tw-mr-1 {
723
+ margin-right: 0.25rem;
724
+ }
722
725
  .theme-designCrowd .tw-mr-2 {
723
726
  margin-right: 0.5rem;
724
727
  }
@@ -827,6 +830,10 @@ video {
827
830
  .theme-designCrowd .tw-h-auto {
828
831
  height: auto;
829
832
  }
833
+ .theme-designCrowd .tw-h-fit {
834
+ height: -moz-fit-content;
835
+ height: fit-content;
836
+ }
830
837
  .theme-designCrowd .tw-h-full {
831
838
  height: 100%;
832
839
  }
@@ -1013,6 +1020,9 @@ video {
1013
1020
  .theme-designCrowd .tw-animate-spin {
1014
1021
  animation: tw-spin 1s linear infinite;
1015
1022
  }
1023
+ .\!tw-cursor-not-allowed {
1024
+ cursor: not-allowed !important;
1025
+ }
1016
1026
  .theme-designCrowd .tw-cursor-not-allowed {
1017
1027
  cursor: not-allowed;
1018
1028
  }
@@ -1446,6 +1456,17 @@ video {
1446
1456
  .theme-designCrowd .tw-bg-opacity-80 {
1447
1457
  --tw-bg-opacity: 0.8;
1448
1458
  }
1459
+ .theme-designCrowd .tw-bg-gradient-to-t {
1460
+ background-image: linear-gradient(to top, var(--tw-gradient-stops));
1461
+ }
1462
+ .theme-designCrowd .tw-from-\[\#d946ef\] {
1463
+ --tw-gradient-from: #d946ef var(--tw-gradient-from-position);
1464
+ --tw-gradient-to: rgb(217 70 239 / 0) var(--tw-gradient-to-position);
1465
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
1466
+ }
1467
+ .theme-designCrowd .tw-to-\[\#8b5cf6\] {
1468
+ --tw-gradient-to: #8b5cf6 var(--tw-gradient-to-position);
1469
+ }
1449
1470
  .theme-designCrowd .tw-bg-no-repeat {
1450
1471
  background-repeat: no-repeat;
1451
1472
  }
@@ -2087,6 +2108,10 @@ video {
2087
2108
  --tw-shadow-color: #1197EB !important;
2088
2109
  --tw-shadow: var(--tw-shadow-colored) !important;
2089
2110
  }
2111
+ .theme-designCrowd .hover\:tw-brightness-\[0\.85\]:hover {
2112
+ --tw-brightness: brightness(0.85);
2113
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2114
+ }
2090
2115
  .theme-designCrowd .focus\:tw-border-error-600:focus {
2091
2116
  --tw-border-opacity: 1;
2092
2117
  border-color: rgb(195 50 48 / var(--tw-border-opacity));
@@ -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>
@@ -97,11 +97,20 @@ export default {
97
97
  required: false,
98
98
  default: false,
99
99
  },
100
+ requiredMessage: {
101
+ type: String,
102
+ required: false,
103
+ default: 'Please fill in this field.',
104
+ },
100
105
  },
101
106
  methods: {
102
- input(modelValue) {
107
+ input(modelValue, event) {
103
108
  this.$emit('update:modelValue', modelValue);
104
109
  this.$emit('input', modelValue);
110
+
111
+ if (event?.target) {
112
+ event.target.setCustomValidity('');
113
+ }
105
114
  },
106
115
  keyup(modelValue) {
107
116
  this.$emit('keyup', modelValue);
@@ -73,7 +73,8 @@
73
73
  },
74
74
  ]"
75
75
  class="tw-text-grayscale-600 tw-box-border tw-w-full tw-text-base tw-px-4 tw-border tw-border-solid focus:tw-outline-none tw-transition-colors tw-duration-300 tw-ease-out tw-shadow-inner"
76
- @input.stop="input($event.target.value)"
76
+ @invalid="setValidationMessage"
77
+ @input.stop="input($event.target.value, $event)"
77
78
  @keyup.stop="keyup($event.target.value)"
78
79
  @keydown.stop="keydown($event.target.value, $event)"
79
80
  @focus="focus($event.target.value)"
@@ -151,6 +152,9 @@ export default {
151
152
  this.$emit('on-clear-confirmation');
152
153
  }
153
154
  },
155
+ setValidationMessage(event) {
156
+ event.target.setCustomValidity(this.requiredMessage);
157
+ },
154
158
  },
155
159
  };
156
160
  </script>