lau-ecom-design-system 1.0.20 → 1.0.21
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/dist/lau-ecom-design-system.esm.css +2 -0
- package/dist/lau-ecom-design-system.esm.js +862 -460
- package/dist/lau-ecom-design-system.min.css +2 -0
- package/dist/lau-ecom-design-system.min.js +1 -1
- package/dist/lau-ecom-design-system.ssr.css +2 -0
- package/dist/lau-ecom-design-system.ssr.js +821 -416
- package/dist/style.css +171 -58
- package/package.json +3 -2
- package/src/components/LauEcomDropdown/LauEcomDropdown.vue +10 -5
- package/src/components/LauEcomInput/LauEcomInput.vue +1 -1
- package/src/components/LauEcomInput2/LauEcomInput2.vue +207 -0
- package/src/components/LauEcomInputSearch/LauEcomInputSearch.vue +244 -0
package/dist/style.css
CHANGED
@@ -1115,57 +1115,18 @@ video {
|
|
1115
1115
|
display: none;
|
1116
1116
|
}
|
1117
1117
|
|
1118
|
-
:root {
|
1119
|
-
--primary-60: #e50a17;
|
1120
|
-
--primary-70: #b70812;
|
1121
|
-
--primary-80: #89060e;
|
1122
|
-
--secondary-10: #ede9f3;
|
1123
|
-
--secondary-50: #6d529c;
|
1124
|
-
--secondary-60: #482783;
|
1125
|
-
--secondary-70: #422377;
|
1126
|
-
--secondary-80: #331c5d;
|
1127
|
-
--secondary-tag-soft: #ede9f3;
|
1128
|
-
--tertiary-10: #eff9fb;
|
1129
|
-
--tertiary-30: #e2f4f8;
|
1130
|
-
--tertiary-50: #c2e7f0;
|
1131
|
-
--tertiary-60: #6ac5da;
|
1132
|
-
--tertiary-80: #1f697a;
|
1133
|
-
--tertiary-tag-soft: #eff9fb;
|
1134
|
-
--neutral-gray-10: #ffffff;
|
1135
|
-
--neutral-gray-20: #fafafa;
|
1136
|
-
--neutral-gray-40: #d9d9d9;
|
1137
|
-
--neutral-10: #ffffff;
|
1138
|
-
--neutral-20: #fafafa;
|
1139
|
-
--neutral-30: #f2f2f2;
|
1140
|
-
--neutral-40: #d9d9d9;
|
1141
|
-
--neutral-50: #bfbfbf;
|
1142
|
-
--neutral-60: #a6a6a6;
|
1143
|
-
--neutral-70: #808080;
|
1144
|
-
--neutral-80: #595959;
|
1145
|
-
--neutral-90: #404040;
|
1146
|
-
--neutral-100: #191919;
|
1147
|
-
--feedback-success-30: #b6ffb4;
|
1148
|
-
--feedback-success-60: #359e29;
|
1149
|
-
--feedback-success-80: #205f19;
|
1150
|
-
--feedback-critical-30: #fee7c5;
|
1151
|
-
--feedback-critical-60: #fd6d21;
|
1152
|
-
--feedback-error-30: #fed4d8;
|
1153
|
-
--feedback-error-60: #dc3545;
|
1154
|
-
--feedback-informative-30: #b9d6fe;
|
1155
|
-
--feedback-informative-60: #1762ca;
|
1156
|
-
--social-whatsapp-60: #00ba37;
|
1157
|
-
--social-pink-70: #ff4b4b;
|
1158
|
-
--stroke-secondary-60: #482783;
|
1159
|
-
--stroke-secondary-70: #422377;
|
1160
|
-
--stroke-secondary-80: #331c5d;
|
1161
|
-
--link-60: #0042e9;
|
1162
|
-
--link-80: #0011af;
|
1163
|
-
}
|
1164
|
-
|
1165
1118
|
.dsEcom-pointer-events-none {
|
1166
1119
|
pointer-events: none;
|
1167
1120
|
}
|
1168
1121
|
|
1122
|
+
.dsEcom-invisible {
|
1123
|
+
visibility: hidden;
|
1124
|
+
}
|
1125
|
+
|
1126
|
+
.dsEcom-fixed {
|
1127
|
+
position: fixed;
|
1128
|
+
}
|
1129
|
+
|
1169
1130
|
.dsEcom-absolute {
|
1170
1131
|
position: absolute;
|
1171
1132
|
}
|
@@ -1190,6 +1151,10 @@ video {
|
|
1190
1151
|
left: 2px;
|
1191
1152
|
}
|
1192
1153
|
|
1154
|
+
.dsEcom-right-2 {
|
1155
|
+
right: 0.5rem;
|
1156
|
+
}
|
1157
|
+
|
1193
1158
|
.dsEcom-right-4 {
|
1194
1159
|
right: 1rem;
|
1195
1160
|
}
|
@@ -1218,6 +1183,10 @@ video {
|
|
1218
1183
|
z-index: 20;
|
1219
1184
|
}
|
1220
1185
|
|
1186
|
+
.dsEcom-z-40 {
|
1187
|
+
z-index: 40;
|
1188
|
+
}
|
1189
|
+
|
1221
1190
|
.dsEcom-z-50 {
|
1222
1191
|
z-index: 50;
|
1223
1192
|
}
|
@@ -1301,6 +1270,10 @@ video {
|
|
1301
1270
|
height: 1px !important;
|
1302
1271
|
}
|
1303
1272
|
|
1273
|
+
.dsEcom-h-10 {
|
1274
|
+
height: 2.5rem;
|
1275
|
+
}
|
1276
|
+
|
1304
1277
|
.dsEcom-h-4 {
|
1305
1278
|
height: 1rem;
|
1306
1279
|
}
|
@@ -1365,14 +1338,26 @@ video {
|
|
1365
1338
|
width: 2rem;
|
1366
1339
|
}
|
1367
1340
|
|
1341
|
+
.dsEcom-w-\[250px\] {
|
1342
|
+
width: 250px;
|
1343
|
+
}
|
1344
|
+
|
1368
1345
|
.dsEcom-w-\[284px\] {
|
1369
1346
|
width: 284px;
|
1370
1347
|
}
|
1371
1348
|
|
1349
|
+
.dsEcom-w-\[350px\] {
|
1350
|
+
width: 350px;
|
1351
|
+
}
|
1352
|
+
|
1372
1353
|
.dsEcom-w-\[584px\] {
|
1373
1354
|
width: 584px;
|
1374
1355
|
}
|
1375
1356
|
|
1357
|
+
.dsEcom-w-\[656px\] {
|
1358
|
+
width: 656px;
|
1359
|
+
}
|
1360
|
+
|
1376
1361
|
.dsEcom-w-\[883px\] {
|
1377
1362
|
width: 883px;
|
1378
1363
|
}
|
@@ -1426,6 +1411,10 @@ video {
|
|
1426
1411
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
1427
1412
|
}
|
1428
1413
|
|
1414
|
+
.dsEcom-transform-gpu {
|
1415
|
+
transform: translate3d(var(--tw-translate-x), var(--tw-translate-y), 0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
1416
|
+
}
|
1417
|
+
|
1429
1418
|
.dsEcom-cursor-default {
|
1430
1419
|
cursor: default;
|
1431
1420
|
}
|
@@ -1514,6 +1503,10 @@ video {
|
|
1514
1503
|
border-radius: 9999px;
|
1515
1504
|
}
|
1516
1505
|
|
1506
|
+
.dsEcom-rounded-lg {
|
1507
|
+
border-radius: 0.5rem;
|
1508
|
+
}
|
1509
|
+
|
1517
1510
|
.dsEcom-rounded-sm {
|
1518
1511
|
border-radius: 0.125rem;
|
1519
1512
|
}
|
@@ -1591,6 +1584,16 @@ video {
|
|
1591
1584
|
background-color: var(--primary-60) !important;
|
1592
1585
|
}
|
1593
1586
|
|
1587
|
+
.dsEcom-bg-black {
|
1588
|
+
--tw-bg-opacity: 1;
|
1589
|
+
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
|
1590
|
+
}
|
1591
|
+
|
1592
|
+
.dsEcom-bg-blue-600 {
|
1593
|
+
--tw-bg-opacity: 1;
|
1594
|
+
background-color: rgb(37 99 235 / var(--tw-bg-opacity, 1));
|
1595
|
+
}
|
1596
|
+
|
1594
1597
|
.dsEcom-bg-neutral-10 {
|
1595
1598
|
background-color: var(--neutral-10);
|
1596
1599
|
}
|
@@ -1676,6 +1679,10 @@ video {
|
|
1676
1679
|
fill: #fff;
|
1677
1680
|
}
|
1678
1681
|
|
1682
|
+
.dsEcom-p-2 {
|
1683
|
+
padding: 0.5rem;
|
1684
|
+
}
|
1685
|
+
|
1679
1686
|
.dsEcom-p-4 {
|
1680
1687
|
padding: 1rem;
|
1681
1688
|
}
|
@@ -1694,6 +1701,11 @@ video {
|
|
1694
1701
|
padding-right: 0.75rem;
|
1695
1702
|
}
|
1696
1703
|
|
1704
|
+
.dsEcom-px-4 {
|
1705
|
+
padding-left: 1rem;
|
1706
|
+
padding-right: 1rem;
|
1707
|
+
}
|
1708
|
+
|
1697
1709
|
.dsEcom-px-5 {
|
1698
1710
|
padding-left: 1.25rem;
|
1699
1711
|
padding-right: 1.25rem;
|
@@ -1812,6 +1824,15 @@ video {
|
|
1812
1824
|
font-size: 12px;
|
1813
1825
|
}
|
1814
1826
|
|
1827
|
+
.dsEcom-text-xl {
|
1828
|
+
font-size: 1.25rem;
|
1829
|
+
line-height: 1.75rem;
|
1830
|
+
}
|
1831
|
+
|
1832
|
+
.dsEcom-font-bold {
|
1833
|
+
font-weight: 700;
|
1834
|
+
}
|
1835
|
+
|
1815
1836
|
.dsEcom-font-core-font-weight-extrabold {
|
1816
1837
|
font-weight: 800;
|
1817
1838
|
}
|
@@ -1836,6 +1857,11 @@ video {
|
|
1836
1857
|
color: var(--primary-60) !important;
|
1837
1858
|
}
|
1838
1859
|
|
1860
|
+
.dsEcom-text-blue-600 {
|
1861
|
+
--tw-text-opacity: 1;
|
1862
|
+
color: rgb(37 99 235 / var(--tw-text-opacity, 1));
|
1863
|
+
}
|
1864
|
+
|
1839
1865
|
.dsEcom-text-link-60 {
|
1840
1866
|
color: var(--link-60);
|
1841
1867
|
}
|
@@ -1873,6 +1899,14 @@ video {
|
|
1873
1899
|
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
1874
1900
|
}
|
1875
1901
|
|
1902
|
+
.dsEcom-opacity-0 {
|
1903
|
+
opacity: 0;
|
1904
|
+
}
|
1905
|
+
|
1906
|
+
.dsEcom-opacity-50 {
|
1907
|
+
opacity: 0.5;
|
1908
|
+
}
|
1909
|
+
|
1876
1910
|
.dsEcom-shadow-upc-shadow-prominent {
|
1877
1911
|
--tw-shadow: 0px 8px 48px -6px rgba(89, 89, 89, 0.24);
|
1878
1912
|
--tw-shadow-colored: 0px 8px 48px -6px var(--tw-shadow-color);
|
@@ -1897,6 +1931,18 @@ video {
|
|
1897
1931
|
transition-duration: 150ms;
|
1898
1932
|
}
|
1899
1933
|
|
1934
|
+
.dsEcom-transition-opacity {
|
1935
|
+
transition-property: opacity;
|
1936
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
1937
|
+
transition-duration: 150ms;
|
1938
|
+
}
|
1939
|
+
|
1940
|
+
.dsEcom-transition-transform {
|
1941
|
+
transition-property: transform;
|
1942
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
1943
|
+
transition-duration: 150ms;
|
1944
|
+
}
|
1945
|
+
|
1900
1946
|
.dsEcom-duration-200 {
|
1901
1947
|
transition-duration: 200ms;
|
1902
1948
|
}
|
@@ -1909,16 +1955,78 @@ video {
|
|
1909
1955
|
transition-duration: 0.3s;
|
1910
1956
|
}
|
1911
1957
|
|
1958
|
+
.dsEcom-ease-in-out {
|
1959
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
1960
|
+
}
|
1961
|
+
|
1912
1962
|
* {
|
1913
1963
|
box-sizing: border-box;
|
1914
1964
|
padding: 0;
|
1915
1965
|
margin: 0;
|
1916
1966
|
}
|
1917
1967
|
|
1968
|
+
/* Base theme variables with instant fallbacks */
|
1969
|
+
|
1970
|
+
:root {
|
1971
|
+
/* Theme Tokens - Colors */
|
1972
|
+
--color-primary: #e50a17;
|
1973
|
+
--color-primary-dark: #b70812;
|
1974
|
+
--color-primary-darker: #89060e;
|
1975
|
+
--color-secondary: #482783;
|
1976
|
+
--color-secondary-light: #6d529c;
|
1977
|
+
--color-secondary-dark: #331c5d;
|
1978
|
+
--color-text-primary: #191919;
|
1979
|
+
--color-text-secondary: #595959;
|
1980
|
+
--color-background: #ffffff;
|
1981
|
+
--color-surface: #fafafa;
|
1982
|
+
--color-success: #359e29;
|
1983
|
+
--color-error: #dc3545;
|
1984
|
+
--color-warning: #fd6d21;
|
1985
|
+
--color-info: #1762ca;
|
1986
|
+
/* Typography */
|
1987
|
+
--font-family-heading: "upc-font-family-zizou-slab";
|
1988
|
+
--font-family-body: "core-font-family-public-sans";
|
1989
|
+
--font-family-special: "upn-font-family-sharp-grotesk";
|
1990
|
+
}
|
1991
|
+
|
1992
|
+
/* Custom theme overrides */
|
1993
|
+
|
1994
|
+
:root {
|
1995
|
+
--color-primary: var(--custom-color-primary, var(--color-primary));
|
1996
|
+
--color-primary-dark: var(--custom-color-primary-dark, var(--color-primary-dark));
|
1997
|
+
--color-primary-darker: var(--custom-color-primary-darker, var(--color-primary-darker));
|
1998
|
+
--color-secondary: var(--custom-color-secondary, var(--color-secondary));
|
1999
|
+
--color-secondary-light: var(--custom-color-secondary-light, var(--color-secondary-light));
|
2000
|
+
--color-secondary-dark: var(--custom-color-secondary-dark, var(--color-secondary-dark));
|
2001
|
+
--color-text-primary: var(--custom-color-text-primary, var(--color-text-primary));
|
2002
|
+
--color-text-secondary: var(--custom-color-text-secondary, var(--color-text-secondary));
|
2003
|
+
--color-background: var(--custom-color-background, var(--color-background));
|
2004
|
+
--color-surface: var(--custom-color-surface, var(--color-surface));
|
2005
|
+
--color-success: var(--custom-color-success, var(--color-success));
|
2006
|
+
--color-error: var(--custom-color-error, var(--color-error));
|
2007
|
+
--color-warning: var(--custom-color-warning, var(--color-warning));
|
2008
|
+
--color-info: var(--custom-color-info, var(--color-info));
|
2009
|
+
--font-family-heading: var(--custom-font-family-heading, var(--font-family-heading));
|
2010
|
+
--font-family-body: var(--custom-font-family-body, var(--font-family-body));
|
2011
|
+
--font-family-special: var(--custom-font-family-special, var(--font-family-special));
|
2012
|
+
}
|
2013
|
+
|
2014
|
+
/* Font faces are now optional and can be overridden */
|
2015
|
+
|
1918
2016
|
@font-face {
|
1919
2017
|
font-family: "upc-font-family-zizou-slab";
|
1920
2018
|
|
1921
|
-
src: url("../src/assets/fonts/Slab/zizou-slab-bold.ttf") format("opentype");
|
2019
|
+
src: var(--custom-font-heading-src, url("../src/assets/fonts/Slab/zizou-slab-bold.ttf")) format("opentype");
|
2020
|
+
|
2021
|
+
font-display: swap;
|
2022
|
+
}
|
2023
|
+
|
2024
|
+
@font-face {
|
2025
|
+
font-family: "core-font-family-public-sans";
|
2026
|
+
|
2027
|
+
font-style: normal;
|
2028
|
+
|
2029
|
+
src: var(--custom-font-body-src, url("../src/assets/fonts/Sans/PublicSans-Regular.ttf")) format("opentype");
|
1922
2030
|
|
1923
2031
|
font-display: swap;
|
1924
2032
|
}
|
@@ -1950,16 +2058,6 @@ video {
|
|
1950
2058
|
font-display: swap;
|
1951
2059
|
}
|
1952
2060
|
|
1953
|
-
@font-face {
|
1954
|
-
font-family: "core-font-family-public-sans";
|
1955
|
-
|
1956
|
-
font-style: normal;
|
1957
|
-
|
1958
|
-
src: url("../src/assets/fonts/Sans/PublicSans-Regular.ttf") format("opentype");
|
1959
|
-
|
1960
|
-
font-display: swap;
|
1961
|
-
}
|
1962
|
-
|
1963
2061
|
@font-face {
|
1964
2062
|
font-family: "core-font-family-public-sans";
|
1965
2063
|
|
@@ -2143,10 +2241,19 @@ video {
|
|
2143
2241
|
fill: var(--secondary-70);
|
2144
2242
|
}
|
2145
2243
|
|
2244
|
+
.hover\:dsEcom-text-blue-800:hover {
|
2245
|
+
--tw-text-opacity: 1;
|
2246
|
+
color: rgb(30 64 175 / var(--tw-text-opacity, 1));
|
2247
|
+
}
|
2248
|
+
|
2146
2249
|
.hover\:dsEcom-text-neutral-70:hover {
|
2147
2250
|
color: var(--neutral-70);
|
2148
2251
|
}
|
2149
2252
|
|
2253
|
+
.hover\:dsEcom-text-neutral-80:hover {
|
2254
|
+
color: var(--neutral-80);
|
2255
|
+
}
|
2256
|
+
|
2150
2257
|
.hover\:dsEcom-text-primary-70:hover {
|
2151
2258
|
color: var(--primary-70);
|
2152
2259
|
}
|
@@ -2208,6 +2315,12 @@ video {
|
|
2208
2315
|
display: block !important;
|
2209
2316
|
}
|
2210
2317
|
|
2318
|
+
@media (min-width: 768px) {
|
2319
|
+
.md\:dsEcom-w-\[350px\] {
|
2320
|
+
width: 350px;
|
2321
|
+
}
|
2322
|
+
}
|
2323
|
+
|
2211
2324
|
@media (min-width: 320px) and (max-width: 1024px) {
|
2212
2325
|
.mobiles\:dsEcom-order-first {
|
2213
2326
|
order: -9999;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "lau-ecom-design-system",
|
3
3
|
"private": false,
|
4
|
-
"version": "1.0.
|
4
|
+
"version": "1.0.21",
|
5
5
|
"sourceType": "module",
|
6
6
|
"sideEffects": false,
|
7
7
|
"main": "dist/lau-ecom-design-system.ssr.js",
|
@@ -26,7 +26,8 @@
|
|
26
26
|
"preview": "vite preview",
|
27
27
|
"storybook": "storybook dev -p 6006",
|
28
28
|
"build-storybook": "storybook build",
|
29
|
-
"prepare": "husky"
|
29
|
+
"prepare": "husky",
|
30
|
+
"watch": "rollup -c -w"
|
30
31
|
},
|
31
32
|
"dependencies": {
|
32
33
|
"vue": "^3.5.12"
|
@@ -5,7 +5,6 @@ import {
|
|
5
5
|
LauEcomUpcIconExclamationTriangle,
|
6
6
|
} from "../LauEcomIcon";
|
7
7
|
import { DropdownItem } from "./types";
|
8
|
-
import { Colors } from "../../utils";
|
9
8
|
|
10
9
|
interface Props {
|
11
10
|
id?: string;
|
@@ -14,6 +13,9 @@ interface Props {
|
|
14
13
|
placeholder?: string;
|
15
14
|
dropdownItems: DropdownItem[];
|
16
15
|
errorMessage?: string;
|
16
|
+
disabledColor?: string;
|
17
|
+
errorColor?: string;
|
18
|
+
defaultColor?: string;
|
17
19
|
}
|
18
20
|
|
19
21
|
const props = withDefaults(defineProps<Props>(), {
|
@@ -22,6 +24,9 @@ const props = withDefaults(defineProps<Props>(), {
|
|
22
24
|
isDisabled: false,
|
23
25
|
placeholder: "Placeholder",
|
24
26
|
errorMessage: "",
|
27
|
+
disabledColor: "var(--neutral-70)",
|
28
|
+
errorColor: "var(--feedback-error-60)",
|
29
|
+
defaultColor: "var(--neutral-100)",
|
25
30
|
});
|
26
31
|
|
27
32
|
const isOpen = ref(false);
|
@@ -62,9 +67,9 @@ const lauEcomIconClasses = computed(() => {
|
|
62
67
|
});
|
63
68
|
|
64
69
|
const iconArrowDownColor = computed(() => {
|
65
|
-
if (props.isDisabled) return
|
66
|
-
if (props.errorMessage) return
|
67
|
-
return
|
70
|
+
if (props.isDisabled) return props.disabledColor;
|
71
|
+
if (props.errorMessage) return props.errorColor;
|
72
|
+
return props.defaultColor;
|
68
73
|
});
|
69
74
|
</script>
|
70
75
|
|
@@ -110,7 +115,7 @@ const iconArrowDownColor = computed(() => {
|
|
110
115
|
<LauEcomUpcIconExclamationTriangle
|
111
116
|
width="16"
|
112
117
|
height="16"
|
113
|
-
:color="
|
118
|
+
:color="errorColor"
|
114
119
|
/>
|
115
120
|
</span>
|
116
121
|
<p class="dsEcom-ml-1">
|
@@ -0,0 +1,207 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { computed, ref } from "vue";
|
3
|
+
import { LauEcomSize } from "../../enums";
|
4
|
+
import {
|
5
|
+
LauEcomUpcIconExclamationTriangle,
|
6
|
+
LauEcomUpcIconNavCheckmark,
|
7
|
+
} from "../LauEcomIcon";
|
8
|
+
|
9
|
+
interface Props {
|
10
|
+
id?: string;
|
11
|
+
type?: string;
|
12
|
+
placeholder?: string;
|
13
|
+
isDisabled?: boolean;
|
14
|
+
label?: string;
|
15
|
+
size?: LauEcomSize;
|
16
|
+
name?: string;
|
17
|
+
modelValue?: string | number;
|
18
|
+
inputContainerClass?: string;
|
19
|
+
inputClass?: string;
|
20
|
+
errorMessage?: string;
|
21
|
+
hasSuccess?: boolean;
|
22
|
+
limit?: number;
|
23
|
+
}
|
24
|
+
|
25
|
+
const props = withDefaults(defineProps<Props>(), {
|
26
|
+
id: "lauEcomInput",
|
27
|
+
type: "text",
|
28
|
+
placeholder: "Placeholder",
|
29
|
+
isDisabled: false,
|
30
|
+
label: "Text label",
|
31
|
+
size: LauEcomSize.md,
|
32
|
+
name: "input",
|
33
|
+
modelValue: "",
|
34
|
+
inputContainerClass: "",
|
35
|
+
inputClass: "",
|
36
|
+
errorMessage: "",
|
37
|
+
hasSuccess: false,
|
38
|
+
limit: 50,
|
39
|
+
});
|
40
|
+
|
41
|
+
const emit = defineEmits<{
|
42
|
+
"update:modelValue": [value: string];
|
43
|
+
}>();
|
44
|
+
|
45
|
+
const inputValue = ref(props.modelValue);
|
46
|
+
const errorMessageValue = ref(props.errorMessage);
|
47
|
+
|
48
|
+
const handleInput = (event: Event) => {
|
49
|
+
const newValue = (event.target as HTMLInputElement).value;
|
50
|
+
|
51
|
+
if (newValue.length === props.limit) {
|
52
|
+
errorMessageValue.value = "Excediste el numero de caracteres";
|
53
|
+
inputValue.value = newValue;
|
54
|
+
emit("update:modelValue", newValue);
|
55
|
+
return;
|
56
|
+
} else {
|
57
|
+
errorMessageValue.value = props.errorMessage;
|
58
|
+
}
|
59
|
+
|
60
|
+
inputValue.value = newValue;
|
61
|
+
emit("update:modelValue", newValue);
|
62
|
+
};
|
63
|
+
|
64
|
+
const labelClasses = computed(() => {
|
65
|
+
return {
|
66
|
+
"lau-ecom-label": true,
|
67
|
+
"lau-ecom-label--disabled": props.isDisabled,
|
68
|
+
};
|
69
|
+
});
|
70
|
+
|
71
|
+
const inputContainerClasses = computed(() => {
|
72
|
+
return [
|
73
|
+
"dsEcom-relative",
|
74
|
+
props.inputContainerClass ? props.inputContainerClass : "dsEcom-w-[284px]",
|
75
|
+
props.size === LauEcomSize.md ? "dsEcom-h-[42px]" : "dsEcom-h-[46px]",
|
76
|
+
];
|
77
|
+
});
|
78
|
+
|
79
|
+
const inputClasses = computed(() => {
|
80
|
+
return [
|
81
|
+
"lau-ecom-input core-font-body-reg-04-16px",
|
82
|
+
props.inputClass,
|
83
|
+
props.size === LauEcomSize.md ? "dsEcom-py-[9px]" : "dsEcom-py-[11px]",
|
84
|
+
{ "lau-ecom-input--disabled": props.isDisabled },
|
85
|
+
{ "lau-ecom-input--error": errorMessageValue.value },
|
86
|
+
{ "lau-ecom-input-success": props.hasSuccess && !errorMessageValue.value },
|
87
|
+
props.hasSuccess || errorMessageValue.value
|
88
|
+
? "placeholder:!dsEcom-text-neutral-100"
|
89
|
+
: "placeholder:!dsEcom-text-neutral-80",
|
90
|
+
];
|
91
|
+
});
|
92
|
+
|
93
|
+
const successClasses = computed(() => {
|
94
|
+
return [
|
95
|
+
"lau-ecom-success",
|
96
|
+
props.size === LauEcomSize.md ? "dsEcom-top-[10px]" : "dsEcom-top-3",
|
97
|
+
];
|
98
|
+
});
|
99
|
+
</script>
|
100
|
+
|
101
|
+
<template>
|
102
|
+
<div class="dsEcom-flex dsEcom-flex-col">
|
103
|
+
<label v-if="label" :class="labelClasses">
|
104
|
+
{{ label }}
|
105
|
+
</label>
|
106
|
+
<div :class="inputContainerClasses">
|
107
|
+
<input
|
108
|
+
:id="id"
|
109
|
+
:class="inputClasses"
|
110
|
+
:type="type"
|
111
|
+
:placeholder="placeholder"
|
112
|
+
:name="name"
|
113
|
+
:disabled="isDisabled"
|
114
|
+
:value="inputValue"
|
115
|
+
:maxlength="limit"
|
116
|
+
@input="handleInput"
|
117
|
+
/>
|
118
|
+
<div v-if="hasSuccess && !errorMessageValue" :class="successClasses">
|
119
|
+
<LauEcomUpcIconNavCheckmark
|
120
|
+
class="dsEcom-fill-feedback-success-60"
|
121
|
+
width="24"
|
122
|
+
height="24"
|
123
|
+
/>
|
124
|
+
</div>
|
125
|
+
<div
|
126
|
+
v-if="errorMessageValue"
|
127
|
+
class="lau-ecom-error-message core-font-body-reg-06-12px"
|
128
|
+
>
|
129
|
+
<div class="dsEcom-flex">
|
130
|
+
<LauEcomUpcIconExclamationTriangle
|
131
|
+
class="dsEcom-fill-primary-60"
|
132
|
+
width="16"
|
133
|
+
height="16"
|
134
|
+
/>
|
135
|
+
<p class="dsEcom-ml-1">
|
136
|
+
{{ errorMessageValue }}
|
137
|
+
</p>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<span v-if="inputValue.toString().length === limit">
|
141
|
+
{{ `${inputValue.toString().length}/${limit}` }}
|
142
|
+
</span>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
</div>
|
146
|
+
</template>
|
147
|
+
|
148
|
+
<style scoped>
|
149
|
+
input[type="number"]::-webkit-inner-spin-button,
|
150
|
+
input[type="number"]::-webkit-outer-spin-button {
|
151
|
+
-webkit-appearance: none;
|
152
|
+
margin: 0;
|
153
|
+
}
|
154
|
+
|
155
|
+
.lau-ecom-label {
|
156
|
+
@apply dsEcom-block
|
157
|
+
dsEcom-text-neutral-100
|
158
|
+
dsEcom-font-core-font-family-public-sans
|
159
|
+
dsEcom-text-[12px]
|
160
|
+
dsEcom-font-core-font-weight-extrabold
|
161
|
+
dsEcom-leading-[18px];
|
162
|
+
}
|
163
|
+
|
164
|
+
.lau-ecom-label--disabled {
|
165
|
+
@apply !dsEcom-text-neutral-70;
|
166
|
+
}
|
167
|
+
|
168
|
+
.lau-ecom-input {
|
169
|
+
@apply dsEcom-w-full
|
170
|
+
dsEcom-pl-3
|
171
|
+
dsEcom-pr-[44px]
|
172
|
+
dsEcom-rounded-sm
|
173
|
+
dsEcom-border
|
174
|
+
dsEcom-border-neutral-80
|
175
|
+
hover:dsEcom-border-stroke-secondary-60
|
176
|
+
focus:dsEcom-border-stroke-secondary-60 focus:!dsEcom-text-neutral-100
|
177
|
+
focus-visible:dsEcom-outline-none
|
178
|
+
disabled:placeholder:dsEcom-text-neutral-70 disabled:dsEcom-bg-neutral-20
|
179
|
+
disabled:!dsEcom-border-neutral-70;
|
180
|
+
}
|
181
|
+
|
182
|
+
.lau-ecom-input--disabled {
|
183
|
+
@apply !dsEcom-text-neutral-70;
|
184
|
+
}
|
185
|
+
|
186
|
+
.lau-ecom-input--error {
|
187
|
+
@apply !dsEcom-border-feedback-error-60;
|
188
|
+
}
|
189
|
+
|
190
|
+
.lau-ecom-input-success {
|
191
|
+
@apply !dsEcom-border-feedback-success-60
|
192
|
+
placeholder:!dsEcom-text-neutral-100;
|
193
|
+
}
|
194
|
+
|
195
|
+
.lau-ecom-error-message {
|
196
|
+
@apply dsEcom-flex
|
197
|
+
dsEcom-items-center
|
198
|
+
dsEcom-mt-[2px]
|
199
|
+
dsEcom-justify-between
|
200
|
+
dsEcom-text-primary-60;
|
201
|
+
}
|
202
|
+
|
203
|
+
.lau-ecom-success {
|
204
|
+
@apply dsEcom-absolute
|
205
|
+
dsEcom-right-3;
|
206
|
+
}
|
207
|
+
</style>
|