@youcan/celeste 0.6.60 → 0.6.62
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/celeste.css +65 -53
- package/dist/cjs/button.js +1 -1
- package/dist/cjs/file-upload-area.js +41 -36
- package/dist/components/file-upload/file-upload-area.d.ts +1 -1
- package/dist/es/button.js +1 -1
- package/dist/es/file-upload-area.js +42 -37
- package/package.json +3 -3
- package/src/components/button/button.vue +5 -0
- package/src/components/button/stories/button.stories.ts +20 -0
- package/src/components/file-upload/file-upload-area.vue +10 -4
package/dist/celeste.css
CHANGED
|
@@ -1277,7 +1277,7 @@ to {
|
|
|
1277
1277
|
border-color: var(--color-stroke-soft-200);
|
|
1278
1278
|
background-color: var(--color-bg-white-0);
|
|
1279
1279
|
color: var(--color-state-faded-base);
|
|
1280
|
-
}.celeste-button[data-v-
|
|
1280
|
+
}.celeste-button[data-v-6c1800fd] {
|
|
1281
1281
|
display: inline-flex;
|
|
1282
1282
|
box-sizing: border-box;
|
|
1283
1283
|
align-items: center;
|
|
@@ -1292,217 +1292,229 @@ to {
|
|
|
1292
1292
|
text-decoration: none;
|
|
1293
1293
|
cursor: pointer;
|
|
1294
1294
|
}
|
|
1295
|
-
.celeste-button[data-v-
|
|
1295
|
+
.celeste-button[data-v-6c1800fd]:disabled {
|
|
1296
1296
|
background-color: var(--color-bg-weak-50);
|
|
1297
1297
|
color: var(--color-text-disabled-300);
|
|
1298
1298
|
cursor: default;
|
|
1299
1299
|
}
|
|
1300
|
-
.celeste-button[data-v-
|
|
1300
|
+
.celeste-button[data-v-6c1800fd] i {
|
|
1301
1301
|
flex-shrink: 0;
|
|
1302
1302
|
width: 20px;
|
|
1303
1303
|
height: 20px;
|
|
1304
1304
|
}
|
|
1305
|
-
.celeste-button-size-xxs[data-v-
|
|
1305
|
+
.celeste-button-size-xxs[data-v-6c1800fd] {
|
|
1306
1306
|
gap: var(--spacing-4);
|
|
1307
1307
|
height: 28px;
|
|
1308
1308
|
padding: var(--spacing-4) var(--spacing-6);
|
|
1309
1309
|
border-radius: var(--radius-8);
|
|
1310
1310
|
}
|
|
1311
|
-
.celeste-button-size-
|
|
1311
|
+
.celeste-button-size-xxs[data-v-6c1800fd]:has(> :only-child:is(i)) {
|
|
1312
|
+
padding: var(--spacing-4);
|
|
1313
|
+
}
|
|
1314
|
+
.celeste-button-size-xs[data-v-6c1800fd] {
|
|
1312
1315
|
gap: var(--spacing-4);
|
|
1313
1316
|
height: 32px;
|
|
1314
1317
|
padding: var(--spacing-6) var(--spacing-8);
|
|
1315
1318
|
border-radius: var(--radius-8);
|
|
1316
1319
|
}
|
|
1317
|
-
.celeste-button-size-
|
|
1320
|
+
.celeste-button-size-xs[data-v-6c1800fd]:has(> :only-child:is(i)) {
|
|
1321
|
+
padding: var(--spacing-6);
|
|
1322
|
+
}
|
|
1323
|
+
.celeste-button-size-sm[data-v-6c1800fd] {
|
|
1318
1324
|
gap: var(--spacing-6);
|
|
1319
1325
|
height: 36px;
|
|
1320
1326
|
padding: var(--spacing-8) var(--spacing-10);
|
|
1321
1327
|
border-radius: var(--radius-8);
|
|
1322
1328
|
}
|
|
1323
|
-
.celeste-button-size-
|
|
1329
|
+
.celeste-button-size-sm[data-v-6c1800fd]:has(> :only-child:is(i)) {
|
|
1330
|
+
padding: var(--spacing-8);
|
|
1331
|
+
}
|
|
1332
|
+
.celeste-button-size-md[data-v-6c1800fd] {
|
|
1324
1333
|
gap: var(--spacing-6);
|
|
1325
1334
|
height: 40px;
|
|
1326
1335
|
padding: var(--spacing-10) var(--spacing-12);
|
|
1327
1336
|
border-radius: var(--radius-10);
|
|
1328
1337
|
}
|
|
1329
|
-
.celeste-button-
|
|
1338
|
+
.celeste-button-size-md[data-v-6c1800fd]:has(> :only-child:is(i)) {
|
|
1339
|
+
padding: var(--spacing-10);
|
|
1340
|
+
}
|
|
1341
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-fill[data-v-6c1800fd]:not(:disabled) {
|
|
1330
1342
|
border-color: var(--color-primary-base);
|
|
1331
1343
|
background-color: var(--color-primary-base);
|
|
1332
1344
|
box-shadow: none;
|
|
1333
1345
|
color: var(--color-text-white-0);
|
|
1334
1346
|
}
|
|
1335
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-fill[data-v-
|
|
1347
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-fill[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1336
1348
|
border-color: var(--color-primary-darker);
|
|
1337
1349
|
background-color: var(--color-primary-darker);
|
|
1338
1350
|
color: var(--color-text-white-0);
|
|
1339
1351
|
}
|
|
1340
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-fill[data-v-
|
|
1352
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-fill[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1341
1353
|
outline: none;
|
|
1342
1354
|
box-shadow: var(--shadow-buttons-primary-focus);
|
|
1343
1355
|
}
|
|
1344
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-stroke[data-v-
|
|
1356
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-stroke[data-v-6c1800fd]:not(:disabled) {
|
|
1345
1357
|
border-color: var(--color-primary-base);
|
|
1346
1358
|
background-color: transparent;
|
|
1347
1359
|
box-shadow: none;
|
|
1348
1360
|
color: var(--color-primary-base);
|
|
1349
1361
|
}
|
|
1350
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-stroke[data-v-
|
|
1362
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-stroke[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1351
1363
|
border-color: transparent;
|
|
1352
1364
|
background-color: var(--color-primary-alpha-10);
|
|
1353
1365
|
color: var(--color-primary-base);
|
|
1354
1366
|
}
|
|
1355
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-stroke[data-v-
|
|
1367
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-stroke[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1356
1368
|
outline: none;
|
|
1357
1369
|
box-shadow: var(--shadow-buttons-primary-focus);
|
|
1358
1370
|
}
|
|
1359
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-lighter[data-v-
|
|
1371
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-lighter[data-v-6c1800fd]:not(:disabled) {
|
|
1360
1372
|
border-color: transparent;
|
|
1361
1373
|
background-color: var(--color-primary-alpha-10);
|
|
1362
1374
|
box-shadow: none;
|
|
1363
1375
|
color: var(--color-primary-base);
|
|
1364
1376
|
}
|
|
1365
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-lighter[data-v-
|
|
1377
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-lighter[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1366
1378
|
border-color: var(--color-primary-base);
|
|
1367
1379
|
background-color: transparent;
|
|
1368
1380
|
color: var(--color-primary-base);
|
|
1369
1381
|
}
|
|
1370
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-lighter[data-v-
|
|
1382
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-lighter[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1371
1383
|
outline: none;
|
|
1372
1384
|
box-shadow: var(--shadow-buttons-primary-focus);
|
|
1373
1385
|
}
|
|
1374
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-ghost[data-v-
|
|
1386
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-ghost[data-v-6c1800fd]:not(:disabled) {
|
|
1375
1387
|
border-color: transparent;
|
|
1376
1388
|
background-color: transparent;
|
|
1377
1389
|
box-shadow: none;
|
|
1378
1390
|
color: var(--color-primary-base);
|
|
1379
1391
|
}
|
|
1380
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-ghost[data-v-
|
|
1392
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-ghost[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1381
1393
|
border-color: transparent;
|
|
1382
1394
|
background-color: var(--color-primary-alpha-10);
|
|
1383
1395
|
color: var(--color-primary-base);
|
|
1384
1396
|
}
|
|
1385
|
-
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-ghost[data-v-
|
|
1397
|
+
.celeste-button-intent-primary:not(:disabled).celeste-button-variant-ghost[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1386
1398
|
outline: none;
|
|
1387
1399
|
box-shadow: var(--shadow-buttons-primary-focus);
|
|
1388
1400
|
}
|
|
1389
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-fill[data-v-
|
|
1401
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-fill[data-v-6c1800fd]:not(:disabled) {
|
|
1390
1402
|
border-color: var(--color-bg-strong-950);
|
|
1391
1403
|
background-color: var(--color-bg-strong-950);
|
|
1392
1404
|
box-shadow: none;
|
|
1393
1405
|
color: var(--color-text-white-0);
|
|
1394
1406
|
}
|
|
1395
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-fill[data-v-
|
|
1407
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-fill[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1396
1408
|
border-color: transparent;
|
|
1397
1409
|
background-color: var(--color-bg-surface-800);
|
|
1398
1410
|
color: var(--color-text-white-0);
|
|
1399
1411
|
}
|
|
1400
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-fill[data-v-
|
|
1412
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-fill[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1401
1413
|
outline: none;
|
|
1402
1414
|
box-shadow: var(--shadow-buttons-important-focus);
|
|
1403
1415
|
}
|
|
1404
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-stroke[data-v-
|
|
1416
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-stroke[data-v-6c1800fd]:not(:disabled) {
|
|
1405
1417
|
border-color: var(--color-bg-soft-200);
|
|
1406
1418
|
background-color: transparent;
|
|
1407
1419
|
box-shadow: var(--shadow-regular-xs);
|
|
1408
1420
|
color: var(--color-text-sub-600);
|
|
1409
1421
|
}
|
|
1410
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-stroke[data-v-
|
|
1422
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-stroke[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1411
1423
|
border-color: transparent;
|
|
1412
1424
|
background-color: var(--color-bg-weak-50);
|
|
1413
1425
|
color: var(--color-text-strong-950);
|
|
1414
1426
|
}
|
|
1415
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-stroke[data-v-
|
|
1427
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-stroke[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1416
1428
|
outline: none;
|
|
1417
1429
|
box-shadow: var(--shadow-buttons-important-focus);
|
|
1418
1430
|
}
|
|
1419
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-lighter[data-v-
|
|
1431
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-lighter[data-v-6c1800fd]:not(:disabled) {
|
|
1420
1432
|
border-color: var(--color-bg-weak-50);
|
|
1421
1433
|
background-color: var(--color-bg-weak-50);
|
|
1422
1434
|
box-shadow: none;
|
|
1423
1435
|
color: var(--color-text-sub-600);
|
|
1424
1436
|
}
|
|
1425
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-lighter[data-v-
|
|
1437
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-lighter[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1426
1438
|
border-color: var(--color-bg-soft-200);
|
|
1427
1439
|
background-color: transparent;
|
|
1428
1440
|
color: var(--color-text-strong-950);
|
|
1429
1441
|
}
|
|
1430
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-lighter[data-v-
|
|
1442
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-lighter[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1431
1443
|
outline: none;
|
|
1432
1444
|
box-shadow: var(--shadow-buttons-important-focus);
|
|
1433
1445
|
}
|
|
1434
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-ghost[data-v-
|
|
1446
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-ghost[data-v-6c1800fd]:not(:disabled) {
|
|
1435
1447
|
border-color: transparent;
|
|
1436
1448
|
background-color: transparent;
|
|
1437
1449
|
box-shadow: none;
|
|
1438
1450
|
color: var(--color-text-sub-600);
|
|
1439
1451
|
}
|
|
1440
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-ghost[data-v-
|
|
1452
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-ghost[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1441
1453
|
border-color: transparent;
|
|
1442
1454
|
background-color: var(--color-bg-weak-50);
|
|
1443
1455
|
color: var(--color-text-strong-950);
|
|
1444
1456
|
}
|
|
1445
|
-
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-ghost[data-v-
|
|
1457
|
+
.celeste-button-intent-neutral:not(:disabled).celeste-button-variant-ghost[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1446
1458
|
outline: none;
|
|
1447
1459
|
box-shadow: var(--shadow-buttons-important-focus);
|
|
1448
1460
|
}
|
|
1449
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-fill[data-v-
|
|
1461
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-fill[data-v-6c1800fd]:not(:disabled) {
|
|
1450
1462
|
border-color: var(--color-state-error-base);
|
|
1451
1463
|
background-color: var(--color-state-error-base);
|
|
1452
1464
|
box-shadow: none;
|
|
1453
1465
|
color: var(--color-text-white-0);
|
|
1454
1466
|
}
|
|
1455
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-fill[data-v-
|
|
1467
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-fill[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1456
1468
|
border-color: var(--color-red-700);
|
|
1457
1469
|
background-color: var(--color-red-700);
|
|
1458
1470
|
color: var(--color-text-white-0);
|
|
1459
1471
|
}
|
|
1460
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-fill[data-v-
|
|
1472
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-fill[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1461
1473
|
outline: none;
|
|
1462
1474
|
box-shadow: var(--shadow-buttons-error-focus);
|
|
1463
1475
|
}
|
|
1464
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-stroke[data-v-
|
|
1476
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-stroke[data-v-6c1800fd]:not(:disabled) {
|
|
1465
1477
|
border-color: var(--color-state-error-base);
|
|
1466
1478
|
background-color: transparent;
|
|
1467
1479
|
box-shadow: none;
|
|
1468
1480
|
color: var(--color-state-error-base);
|
|
1469
1481
|
}
|
|
1470
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-stroke[data-v-
|
|
1482
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-stroke[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1471
1483
|
border-color: transparent;
|
|
1472
1484
|
background-color: var(--color-red-alpha-10);
|
|
1473
1485
|
color: var(--color-state-error-base);
|
|
1474
1486
|
}
|
|
1475
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-stroke[data-v-
|
|
1487
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-stroke[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1476
1488
|
outline: none;
|
|
1477
1489
|
box-shadow: var(--shadow-buttons-error-focus);
|
|
1478
1490
|
}
|
|
1479
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-lighter[data-v-
|
|
1491
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-lighter[data-v-6c1800fd]:not(:disabled) {
|
|
1480
1492
|
border-color: transparent;
|
|
1481
1493
|
background-color: var(--color-red-alpha-10);
|
|
1482
1494
|
box-shadow: none;
|
|
1483
1495
|
color: var(--color-state-error-base);
|
|
1484
1496
|
}
|
|
1485
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-lighter[data-v-
|
|
1497
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-lighter[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1486
1498
|
border-color: var(--color-state-error-base);
|
|
1487
1499
|
background-color: transparent;
|
|
1488
1500
|
color: var(--color-state-error-base);
|
|
1489
1501
|
}
|
|
1490
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-lighter[data-v-
|
|
1502
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-lighter[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1491
1503
|
outline: none;
|
|
1492
1504
|
box-shadow: var(--shadow-buttons-error-focus);
|
|
1493
1505
|
}
|
|
1494
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-ghost[data-v-
|
|
1506
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-ghost[data-v-6c1800fd]:not(:disabled) {
|
|
1495
1507
|
border-color: transparent;
|
|
1496
1508
|
background-color: transparent;
|
|
1497
1509
|
box-shadow: none;
|
|
1498
1510
|
color: var(--color-state-error-base);
|
|
1499
1511
|
}
|
|
1500
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-ghost[data-v-
|
|
1512
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-ghost[data-v-6c1800fd]:not(:disabled):hover:not(:disabled) {
|
|
1501
1513
|
border-color: transparent;
|
|
1502
1514
|
background-color: var(--color-red-alpha-10);
|
|
1503
1515
|
color: var(--color-state-error-base);
|
|
1504
1516
|
}
|
|
1505
|
-
.celeste-button-intent-error:not(:disabled).celeste-button-variant-ghost[data-v-
|
|
1517
|
+
.celeste-button-intent-error:not(:disabled).celeste-button-variant-ghost[data-v-6c1800fd]:not(:disabled):focus:not(:disabled) {
|
|
1506
1518
|
outline: none;
|
|
1507
1519
|
box-shadow: var(--shadow-buttons-error-focus);
|
|
1508
1520
|
}@property --celeste-fbutton-bg-start {
|
|
@@ -3470,7 +3482,7 @@ to {
|
|
|
3470
3482
|
color: var(--color-icon-disabled-300);
|
|
3471
3483
|
}[data-v-3405639f] {
|
|
3472
3484
|
box-sizing: border-box;
|
|
3473
|
-
}.celeste-file-upload-area[data-v-
|
|
3485
|
+
}.celeste-file-upload-area[data-v-cfdea6ac] {
|
|
3474
3486
|
display: flex;
|
|
3475
3487
|
box-sizing: border-box;
|
|
3476
3488
|
flex-direction: column;
|
|
@@ -3485,40 +3497,40 @@ to {
|
|
|
3485
3497
|
background-color: var(--color-bg-white-0);
|
|
3486
3498
|
cursor: pointer;
|
|
3487
3499
|
}
|
|
3488
|
-
.celeste-file-upload-area[data-v-
|
|
3500
|
+
.celeste-file-upload-area[data-v-cfdea6ac]:hover {
|
|
3489
3501
|
background-color: var(--color-bg-weak-50);
|
|
3490
3502
|
}
|
|
3491
|
-
.celeste-file-upload-area > i[data-v-
|
|
3503
|
+
.celeste-file-upload-area > i[data-v-cfdea6ac] {
|
|
3492
3504
|
width: 24px;
|
|
3493
3505
|
height: 24px;
|
|
3494
3506
|
color: var(--color-icon-sub-600);
|
|
3495
3507
|
}
|
|
3496
|
-
.celeste-file-upload-area .celeste-file-upload-area-content[data-v-
|
|
3508
|
+
.celeste-file-upload-area .celeste-file-upload-area-content[data-v-cfdea6ac] {
|
|
3497
3509
|
display: grid;
|
|
3498
3510
|
gap: var(--spacing-6);
|
|
3499
3511
|
text-align: center;
|
|
3500
3512
|
}
|
|
3501
|
-
.celeste-file-upload-area .celeste-file-upload-area-content .celeste-file-upload-area-label[data-v-
|
|
3513
|
+
.celeste-file-upload-area .celeste-file-upload-area-content .celeste-file-upload-area-label[data-v-cfdea6ac] {
|
|
3502
3514
|
color: var(--color-text-strong-950);
|
|
3503
3515
|
font: var(--label-sm);
|
|
3504
3516
|
}
|
|
3505
|
-
.celeste-file-upload-area .celeste-file-upload-area-content .celeste-file-upload-area-description[data-v-
|
|
3517
|
+
.celeste-file-upload-area .celeste-file-upload-area-content .celeste-file-upload-area-description[data-v-cfdea6ac] {
|
|
3506
3518
|
color: var(--color-text-sub-600);
|
|
3507
3519
|
font: var(--label-xs);
|
|
3508
3520
|
}
|
|
3509
|
-
.celeste-file-upload-area .celeste-file-upload-area-trigger[data-v-
|
|
3521
|
+
.celeste-file-upload-area .celeste-file-upload-area-trigger[data-v-cfdea6ac] {
|
|
3510
3522
|
background-color: var(--color-bg-white-0) !important;
|
|
3511
3523
|
}
|
|
3512
|
-
.celeste-file-upload-area .celeste-file-upload-area-trigger[data-v-
|
|
3524
|
+
.celeste-file-upload-area .celeste-file-upload-area-trigger[data-v-cfdea6ac]:hover {
|
|
3513
3525
|
background-color: transparent !important;
|
|
3514
3526
|
box-shadow: none !important;
|
|
3515
3527
|
}
|
|
3516
|
-
.celeste-file-upload-area > input[type=file][data-v-
|
|
3528
|
+
.celeste-file-upload-area > input[type=file][data-v-cfdea6ac] {
|
|
3517
3529
|
position: absolute;
|
|
3518
3530
|
opacity: 0;
|
|
3519
3531
|
scale: 0;
|
|
3520
3532
|
}
|
|
3521
|
-
.celeste-file-upload-area[data-over-drop-zone=true][data-v-
|
|
3533
|
+
.celeste-file-upload-area[data-over-drop-zone=true][data-v-cfdea6ac] {
|
|
3522
3534
|
background-color: var(--color-bg-weak-50);
|
|
3523
3535
|
}.celeste-hint-text[data-v-0fde56ef] {
|
|
3524
3536
|
display: flex;
|
package/dist/cjs/button.js
CHANGED
|
@@ -36,5 +36,5 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
const Button = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
39
|
+
const Button = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-6c1800fd"]]);
|
|
40
40
|
module.exports = Button;
|
|
@@ -5,14 +5,13 @@ const index = require("./chunks/index3.js");
|
|
|
5
5
|
const clsx = require("./chunks/clsx.js");
|
|
6
6
|
;/* empty css */
|
|
7
7
|
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
8
|
-
const _hoisted_1 =
|
|
9
|
-
const _hoisted_2 = { class: "celeste-file-upload-area-
|
|
10
|
-
const _hoisted_3 = {
|
|
11
|
-
const _hoisted_4 = {
|
|
8
|
+
const _hoisted_1 = { class: "celeste-file-upload-area-content" };
|
|
9
|
+
const _hoisted_2 = { class: "celeste-file-upload-area-label" };
|
|
10
|
+
const _hoisted_3 = {
|
|
12
11
|
key: 0,
|
|
13
12
|
class: "celeste-file-upload-area-description"
|
|
14
13
|
};
|
|
15
|
-
const
|
|
14
|
+
const _hoisted_4 = ["multiple", "accept"];
|
|
16
15
|
const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
17
16
|
__name: "file-upload-area",
|
|
18
17
|
props: /* @__PURE__ */ Mo.mergeModels({
|
|
@@ -38,6 +37,9 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
38
37
|
const files = Mo.useModel(__props, "modelValue");
|
|
39
38
|
const dropZoneRef = Mo.useTemplateRef("dropZoneRef");
|
|
40
39
|
const { isOverDropZone } = index.useDropZone(dropZoneRef, { onDrop });
|
|
40
|
+
const uploadComponent = Mo.computed(() => {
|
|
41
|
+
return props.onTriggerClick ? "div" : "label";
|
|
42
|
+
});
|
|
41
43
|
function handleUpload(e) {
|
|
42
44
|
const input = e.target;
|
|
43
45
|
const newFiles = Array.from(input.files ?? []);
|
|
@@ -97,45 +99,48 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
return (_ctx, _cache) => {
|
|
100
|
-
return Mo.openBlock(), Mo.
|
|
102
|
+
return Mo.openBlock(), Mo.createBlock(Mo.resolveDynamicComponent(uploadComponent.value), {
|
|
101
103
|
ref_key: "dropZoneRef",
|
|
102
104
|
ref: dropZoneRef,
|
|
103
105
|
class: Mo.normalizeClass(Mo.unref(clsx.clsx)(
|
|
104
106
|
"celeste-file-upload-area",
|
|
105
107
|
props.class
|
|
106
108
|
)),
|
|
107
|
-
"data-over-drop-zone": Mo.unref(isOverDropZone)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
key: 0,
|
|
118
|
-
"as-child": "",
|
|
119
|
-
intent: "neutral",
|
|
120
|
-
variant: "stroke",
|
|
121
|
-
size: "xs",
|
|
122
|
-
class: "celeste-file-upload-area-trigger",
|
|
123
|
-
onClick: handleTriggerClick
|
|
124
|
-
}, {
|
|
125
|
-
default: Mo.withCtx(() => [
|
|
126
|
-
Mo.createElementVNode("span", null, Mo.toDisplayString(_ctx.triggerLabel), 1)
|
|
109
|
+
"data-over-drop-zone": Mo.unref(isOverDropZone),
|
|
110
|
+
onClick: handleTriggerClick
|
|
111
|
+
}, {
|
|
112
|
+
default: Mo.withCtx(() => [
|
|
113
|
+
Mo.createElementVNode("i", {
|
|
114
|
+
class: Mo.normalizeClass(_ctx.icon)
|
|
115
|
+
}, null, 2),
|
|
116
|
+
Mo.createElementVNode("div", _hoisted_1, [
|
|
117
|
+
Mo.createElementVNode("span", _hoisted_2, Mo.toDisplayString(Mo.unref(isOverDropZone) ? _ctx.labelOnDrop : _ctx.label), 1),
|
|
118
|
+
!Mo.unref(isOverDropZone) ? (Mo.openBlock(), Mo.createElementBlock("span", _hoisted_3, Mo.toDisplayString(_ctx.description), 1)) : Mo.createCommentVNode("", true)
|
|
127
119
|
]),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
120
|
+
!Mo.unref(isOverDropZone) ? (Mo.openBlock(), Mo.createBlock(button, {
|
|
121
|
+
key: 0,
|
|
122
|
+
"as-child": "",
|
|
123
|
+
intent: "neutral",
|
|
124
|
+
variant: "stroke",
|
|
125
|
+
size: "xs",
|
|
126
|
+
class: "celeste-file-upload-area-trigger"
|
|
127
|
+
}, {
|
|
128
|
+
default: Mo.withCtx(() => [
|
|
129
|
+
Mo.createElementVNode("span", null, Mo.toDisplayString(_ctx.triggerLabel), 1)
|
|
130
|
+
]),
|
|
131
|
+
_: 1
|
|
132
|
+
})) : Mo.createCommentVNode("", true),
|
|
133
|
+
!_ctx.onTriggerClick ? (Mo.openBlock(), Mo.createElementBlock("input", Mo.mergeProps({ key: 1 }, _ctx.$attrs, {
|
|
134
|
+
type: "file",
|
|
135
|
+
multiple: _ctx.multiple,
|
|
136
|
+
accept: _ctx.accept,
|
|
137
|
+
onChange: handleUpload
|
|
138
|
+
}), null, 16, _hoisted_4)) : Mo.createCommentVNode("", true)
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
}, 8, ["class", "data-over-drop-zone"]);
|
|
137
142
|
};
|
|
138
143
|
}
|
|
139
144
|
});
|
|
140
|
-
const fileUploadArea = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
145
|
+
const fileUploadArea = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-cfdea6ac"]]);
|
|
141
146
|
module.exports = fileUploadArea;
|
|
@@ -39,5 +39,5 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
39
39
|
triggerLabel: string;
|
|
40
40
|
maxSize: number;
|
|
41
41
|
maxFiles: number;
|
|
42
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
42
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
43
43
|
export default _default;
|
package/dist/es/button.js
CHANGED
|
@@ -35,7 +35,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
const Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
38
|
+
const Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6c1800fd"]]);
|
|
39
39
|
export {
|
|
40
40
|
Button as default
|
|
41
41
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { defineComponent, mergeModels, useModel, useTemplateRef, openBlock,
|
|
1
|
+
import { defineComponent, mergeModels, useModel, useTemplateRef, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, unref, withCtx, createElementVNode, toDisplayString, createElementBlock, createCommentVNode, mergeProps } from "vue";
|
|
2
2
|
import Button from "./button.js";
|
|
3
3
|
import { c as useDropZone } from "./chunks/index3.js";
|
|
4
4
|
import { c as clsx } from "./chunks/clsx.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
7
|
-
const _hoisted_1 =
|
|
8
|
-
const _hoisted_2 = { class: "celeste-file-upload-area-
|
|
9
|
-
const _hoisted_3 = {
|
|
10
|
-
const _hoisted_4 = {
|
|
7
|
+
const _hoisted_1 = { class: "celeste-file-upload-area-content" };
|
|
8
|
+
const _hoisted_2 = { class: "celeste-file-upload-area-label" };
|
|
9
|
+
const _hoisted_3 = {
|
|
11
10
|
key: 0,
|
|
12
11
|
class: "celeste-file-upload-area-description"
|
|
13
12
|
};
|
|
14
|
-
const
|
|
13
|
+
const _hoisted_4 = ["multiple", "accept"];
|
|
15
14
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
15
|
__name: "file-upload-area",
|
|
17
16
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -37,6 +36,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
36
|
const files = useModel(__props, "modelValue");
|
|
38
37
|
const dropZoneRef = useTemplateRef("dropZoneRef");
|
|
39
38
|
const { isOverDropZone } = useDropZone(dropZoneRef, { onDrop });
|
|
39
|
+
const uploadComponent = computed(() => {
|
|
40
|
+
return props.onTriggerClick ? "div" : "label";
|
|
41
|
+
});
|
|
40
42
|
function handleUpload(e) {
|
|
41
43
|
const input = e.target;
|
|
42
44
|
const newFiles = Array.from(input.files ?? []);
|
|
@@ -96,47 +98,50 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
return (_ctx, _cache) => {
|
|
99
|
-
return openBlock(),
|
|
101
|
+
return openBlock(), createBlock(resolveDynamicComponent(uploadComponent.value), {
|
|
100
102
|
ref_key: "dropZoneRef",
|
|
101
103
|
ref: dropZoneRef,
|
|
102
104
|
class: normalizeClass(unref(clsx)(
|
|
103
105
|
"celeste-file-upload-area",
|
|
104
106
|
props.class
|
|
105
107
|
)),
|
|
106
|
-
"data-over-drop-zone": unref(isOverDropZone)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
key: 0,
|
|
117
|
-
"as-child": "",
|
|
118
|
-
intent: "neutral",
|
|
119
|
-
variant: "stroke",
|
|
120
|
-
size: "xs",
|
|
121
|
-
class: "celeste-file-upload-area-trigger",
|
|
122
|
-
onClick: handleTriggerClick
|
|
123
|
-
}, {
|
|
124
|
-
default: withCtx(() => [
|
|
125
|
-
createElementVNode("span", null, toDisplayString(_ctx.triggerLabel), 1)
|
|
108
|
+
"data-over-drop-zone": unref(isOverDropZone),
|
|
109
|
+
onClick: handleTriggerClick
|
|
110
|
+
}, {
|
|
111
|
+
default: withCtx(() => [
|
|
112
|
+
createElementVNode("i", {
|
|
113
|
+
class: normalizeClass(_ctx.icon)
|
|
114
|
+
}, null, 2),
|
|
115
|
+
createElementVNode("div", _hoisted_1, [
|
|
116
|
+
createElementVNode("span", _hoisted_2, toDisplayString(unref(isOverDropZone) ? _ctx.labelOnDrop : _ctx.label), 1),
|
|
117
|
+
!unref(isOverDropZone) ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.description), 1)) : createCommentVNode("", true)
|
|
126
118
|
]),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
!unref(isOverDropZone) ? (openBlock(), createBlock(Button, {
|
|
120
|
+
key: 0,
|
|
121
|
+
"as-child": "",
|
|
122
|
+
intent: "neutral",
|
|
123
|
+
variant: "stroke",
|
|
124
|
+
size: "xs",
|
|
125
|
+
class: "celeste-file-upload-area-trigger"
|
|
126
|
+
}, {
|
|
127
|
+
default: withCtx(() => [
|
|
128
|
+
createElementVNode("span", null, toDisplayString(_ctx.triggerLabel), 1)
|
|
129
|
+
]),
|
|
130
|
+
_: 1
|
|
131
|
+
})) : createCommentVNode("", true),
|
|
132
|
+
!_ctx.onTriggerClick ? (openBlock(), createElementBlock("input", mergeProps({ key: 1 }, _ctx.$attrs, {
|
|
133
|
+
type: "file",
|
|
134
|
+
multiple: _ctx.multiple,
|
|
135
|
+
accept: _ctx.accept,
|
|
136
|
+
onChange: handleUpload
|
|
137
|
+
}), null, 16, _hoisted_4)) : createCommentVNode("", true)
|
|
138
|
+
]),
|
|
139
|
+
_: 1
|
|
140
|
+
}, 8, ["class", "data-over-drop-zone"]);
|
|
136
141
|
};
|
|
137
142
|
}
|
|
138
143
|
});
|
|
139
|
-
const fileUploadArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
144
|
+
const fileUploadArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cfdea6ac"]]);
|
|
140
145
|
export {
|
|
141
146
|
fileUploadArea as default
|
|
142
147
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youcan/celeste",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.62",
|
|
5
5
|
"author": "YouCan <tech@youcan.shop>",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"youcan",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"radix-vue": "^1.9.12",
|
|
45
45
|
"tinycolor2": "^1.6.0",
|
|
46
46
|
"vue-sonner": "^2.0.2",
|
|
47
|
-
"@youcan/celeste-icons": "0.6.
|
|
48
|
-
"@youcan/celeste-tokens": "0.6.
|
|
47
|
+
"@youcan/celeste-icons": "0.6.62",
|
|
48
|
+
"@youcan/celeste-tokens": "0.6.62"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@chromatic-com/storybook": "^4.1.1",
|
|
@@ -38,6 +38,7 @@ export interface ButtonProps extends PrimitiveProps {
|
|
|
38
38
|
|
|
39
39
|
<style lang="scss" scoped>
|
|
40
40
|
@use 'sass:map';
|
|
41
|
+
@use 'sass:list';
|
|
41
42
|
|
|
42
43
|
$size-map: (
|
|
43
44
|
'xxs': (
|
|
@@ -247,6 +248,10 @@ $hover-map: (
|
|
|
247
248
|
height: map.get($v, height);
|
|
248
249
|
padding: map.get($v, padding);
|
|
249
250
|
border-radius: map.get($v, border-radius);
|
|
251
|
+
|
|
252
|
+
&:has(> :only-child:is(i)) {
|
|
253
|
+
padding: list.nth(map.get($v, padding), 1);
|
|
254
|
+
}
|
|
250
255
|
}
|
|
251
256
|
}
|
|
252
257
|
|
|
@@ -29,3 +29,23 @@ export const Default: Story = {
|
|
|
29
29
|
`,
|
|
30
30
|
}),
|
|
31
31
|
};
|
|
32
|
+
|
|
33
|
+
export const IconOnly: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
size: 'sm',
|
|
36
|
+
intent: 'neutral',
|
|
37
|
+
variant: 'stroke',
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
render: args => ({
|
|
41
|
+
components: { Button },
|
|
42
|
+
setup() {
|
|
43
|
+
return { args };
|
|
44
|
+
},
|
|
45
|
+
template: `
|
|
46
|
+
<Button v-bind="args">
|
|
47
|
+
<i class="i-celeste-translate"></i>
|
|
48
|
+
</Button>
|
|
49
|
+
`,
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import Button from '@/components/button/button.vue';
|
|
3
3
|
import { useDropZone } from '@vueuse/core';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { type InputHTMLAttributes, useTemplateRef } from 'vue';
|
|
5
|
+
import { computed, type InputHTMLAttributes, useTemplateRef } from 'vue';
|
|
6
6
|
|
|
7
7
|
const props = withDefaults(defineProps<FileUploadAreaProps>(), {
|
|
8
8
|
icon: 'i-celeste-upload-cloud-2-line',
|
|
@@ -22,6 +22,10 @@ const files = defineModel<File[]>({ default: [] });
|
|
|
22
22
|
const dropZoneRef = useTemplateRef<HTMLElement>('dropZoneRef');
|
|
23
23
|
const { isOverDropZone } = useDropZone(dropZoneRef, { onDrop });
|
|
24
24
|
|
|
25
|
+
const uploadComponent = computed(() => {
|
|
26
|
+
return props.onTriggerClick ? 'div' : 'label';
|
|
27
|
+
});
|
|
28
|
+
|
|
25
29
|
function handleUpload(e: Event) {
|
|
26
30
|
const input = e.target as HTMLInputElement;
|
|
27
31
|
const newFiles = Array.from(input.files ?? []);
|
|
@@ -124,13 +128,15 @@ export interface FileUploadAreaEmit {
|
|
|
124
128
|
</script>
|
|
125
129
|
|
|
126
130
|
<template>
|
|
127
|
-
<
|
|
131
|
+
<component
|
|
132
|
+
:is="uploadComponent"
|
|
128
133
|
ref="dropZoneRef"
|
|
129
134
|
:class="clsx(
|
|
130
135
|
'celeste-file-upload-area',
|
|
131
136
|
props.class,
|
|
132
137
|
)"
|
|
133
138
|
:data-over-drop-zone="isOverDropZone"
|
|
139
|
+
@click="handleTriggerClick"
|
|
134
140
|
>
|
|
135
141
|
<i :class="icon" />
|
|
136
142
|
<div class="celeste-file-upload-area-content">
|
|
@@ -151,18 +157,18 @@ export interface FileUploadAreaEmit {
|
|
|
151
157
|
variant="stroke"
|
|
152
158
|
size="xs"
|
|
153
159
|
class="celeste-file-upload-area-trigger"
|
|
154
|
-
@click="handleTriggerClick"
|
|
155
160
|
>
|
|
156
161
|
<span>{{ triggerLabel }}</span>
|
|
157
162
|
</Button>
|
|
158
163
|
<input
|
|
164
|
+
v-if="!onTriggerClick"
|
|
159
165
|
v-bind="$attrs"
|
|
160
166
|
type="file"
|
|
161
167
|
:multiple="multiple"
|
|
162
168
|
:accept="accept"
|
|
163
169
|
@change="handleUpload"
|
|
164
170
|
>
|
|
165
|
-
</
|
|
171
|
+
</component>
|
|
166
172
|
</template>
|
|
167
173
|
|
|
168
174
|
<style scoped lang="scss">
|