histoire 0.1.1 → 0.1.4

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.
Files changed (48) hide show
  1. package/dist/client/app/App.vue +15 -0
  2. package/dist/client/app/components/app/AppHeader.vue +6 -6
  3. package/dist/client/app/components/app/Breadcrumb.vue +98 -0
  4. package/dist/client/app/components/app/MobileOverlay.vue +34 -0
  5. package/dist/client/app/components/misc/HatchedPattern.vue +11 -23
  6. package/dist/client/app/components/search/SearchItem.vue +1 -1
  7. package/dist/client/app/components/search/SearchModal.vue +2 -2
  8. package/dist/client/app/components/story/StoryListFolder.vue +2 -2
  9. package/dist/client/app/components/story/StoryListItem.vue +2 -2
  10. package/dist/client/app/components/story/StoryResponsivePreview.vue +94 -9
  11. package/dist/client/app/components/story/StorySidePanel.vue +68 -0
  12. package/dist/client/app/components/story/StoryVariantListItem.vue +2 -2
  13. package/dist/client/app/components/story/StoryVariantSingleView.vue +6 -2
  14. package/dist/client/app/components/story/StoryView.vue +10 -121
  15. package/dist/client/app/components/story/StoryViewer.vue +157 -0
  16. package/dist/client/app/stores/story.ts +1 -1
  17. package/dist/client/app/style/{floating-vue.css → floating-vue.pcss} +0 -0
  18. package/dist/client/app/style/{main.css → main.pcss} +13 -3
  19. package/dist/client/app/style/transitions.pcss +26 -0
  20. package/dist/client/app/util/responsive.d.ts +1 -0
  21. package/dist/client/app/util/responsive.js +2 -0
  22. package/dist/client/app/util/responsive.ts +3 -0
  23. package/dist/node/build.js +7 -0
  24. package/dist/style.css +158 -73
  25. package/package.json +4 -5
  26. package/src/client/app/App.vue +15 -0
  27. package/src/client/app/components/app/AppHeader.vue +6 -6
  28. package/src/client/app/components/app/Breadcrumb.vue +98 -0
  29. package/src/client/app/components/app/MobileOverlay.vue +34 -0
  30. package/src/client/app/components/misc/HatchedPattern.vue +11 -23
  31. package/src/client/app/components/search/SearchItem.vue +1 -1
  32. package/src/client/app/components/search/SearchModal.vue +2 -2
  33. package/src/client/app/components/story/StoryListFolder.vue +2 -2
  34. package/src/client/app/components/story/StoryListItem.vue +2 -2
  35. package/src/client/app/components/story/StoryResponsivePreview.vue +94 -9
  36. package/src/client/app/components/story/StorySidePanel.vue +68 -0
  37. package/src/client/app/components/story/StoryVariantListItem.vue +2 -2
  38. package/src/client/app/components/story/StoryVariantSingleView.vue +6 -2
  39. package/src/client/app/components/story/StoryView.vue +10 -121
  40. package/src/client/app/components/story/StoryViewer.vue +157 -0
  41. package/src/client/app/stores/story.ts +1 -1
  42. package/src/client/app/style/{floating-vue.css → floating-vue.pcss} +0 -0
  43. package/src/client/app/style/{main.css → main.pcss} +13 -3
  44. package/src/client/app/style/transitions.pcss +26 -0
  45. package/src/client/app/util/responsive.ts +3 -0
  46. package/src/node/build.ts +7 -0
  47. package/dist/client/app/style/transitions.css +0 -12
  48. package/src/client/app/style/transitions.css +0 -12
package/dist/style.css CHANGED
@@ -176,12 +176,6 @@
176
176
  left:-2px
177
177
  }
178
178
 
179
- .v-popper{
180
- width:-webkit-max-content;
181
- width:-moz-max-content;
182
- width:max-content
183
- }
184
-
185
179
  .v-popper--theme-dropdown .v-popper__inner{
186
180
  background:#fff;
187
181
  color:#000;
@@ -255,6 +249,18 @@
255
249
  opacity: 0;
256
250
  }
257
251
 
252
+ .__histoire-fade-enter-active,
253
+ .__histoire-fade-leave-active {
254
+ transition: transform .15s, opacity .15s;
255
+ transform: translateY(0px);
256
+ }
257
+
258
+ .__histoire-fade-enter-from,
259
+ .__histoire-fade-leave-to {
260
+ transform: translateY(32px);
261
+ opacity: 0;
262
+ }
263
+
258
264
  *,
259
265
  ::before,
260
266
  ::after {
@@ -854,14 +860,14 @@ button {
854
860
  isolation:isolate
855
861
  }
856
862
 
857
- .htw-z-20{
858
- z-index:20
859
- }
860
-
861
863
  .htw-z-10{
862
864
  z-index:10
863
865
  }
864
866
 
867
+ .htw-z-20{
868
+ z-index:20
869
+ }
870
+
865
871
  .htw-m-1{
866
872
  margin:0.25rem
867
873
  }
@@ -938,10 +944,22 @@ button {
938
944
  height:4rem
939
945
  }
940
946
 
947
+ .htw-h-6{
948
+ height:1.5rem
949
+ }
950
+
951
+ .htw-h-12{
952
+ height:3rem
953
+ }
954
+
941
955
  .htw-h-5{
942
956
  height:1.25rem
943
957
  }
944
958
 
959
+ .htw-h-8{
960
+ height:2rem
961
+ }
962
+
945
963
  .htw-h-\[2px\]{
946
964
  height:2px
947
965
  }
@@ -958,10 +976,6 @@ button {
958
976
  height:1px
959
977
  }
960
978
 
961
- .htw-h-8{
962
- height:2rem
963
- }
964
-
965
979
  .htw-h-10{
966
980
  height:2.5rem
967
981
  }
@@ -986,18 +1000,26 @@ button {
986
1000
  width:100%
987
1001
  }
988
1002
 
989
- .htw-w-5{
990
- width:1.25rem
1003
+ .htw-w-6{
1004
+ width:1.5rem
991
1005
  }
992
1006
 
993
- .htw-w-4{
994
- width:1rem
1007
+ .htw-w-5{
1008
+ width:1.25rem
995
1009
  }
996
1010
 
997
1011
  .htw-w-screen{
998
1012
  width:100vw
999
1013
  }
1000
1014
 
1015
+ .htw-w-8{
1016
+ width:2rem
1017
+ }
1018
+
1019
+ .htw-w-4{
1020
+ width:1rem
1021
+ }
1022
+
1001
1023
  .htw-w-px{
1002
1024
  width:1px
1003
1025
  }
@@ -1048,6 +1070,14 @@ button {
1048
1070
  flex:1 1 0%
1049
1071
  }
1050
1072
 
1073
+ .htw-shrink-0{
1074
+ flex-shrink:0
1075
+ }
1076
+
1077
+ .htw-grow{
1078
+ flex-grow:1
1079
+ }
1080
+
1051
1081
  .htw-rotate-90{
1052
1082
  --tw-rotate:90deg;
1053
1083
  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))
@@ -1092,6 +1122,14 @@ button {
1092
1122
  flex-direction:column
1093
1123
  }
1094
1124
 
1125
+ .htw-flex-wrap{
1126
+ flex-wrap:wrap
1127
+ }
1128
+
1129
+ .htw-place-content-between{
1130
+ place-content:space-between
1131
+ }
1132
+
1095
1133
  .htw-items-center{
1096
1134
  align-items:center
1097
1135
  }
@@ -1140,6 +1178,11 @@ button {
1140
1178
  border-bottom-width:calc(1px * var(--tw-divide-y-reverse))
1141
1179
  }
1142
1180
 
1181
+ .htw-divide-gray-100 > :not([hidden]) ~ :not([hidden]){
1182
+ --tw-divide-opacity:1;
1183
+ border-color:rgb(var(--_histoire-color-gray-100) / var(--tw-divide-opacity))
1184
+ }
1185
+
1143
1186
  .htw-divide-gray-200 > :not([hidden]) ~ :not([hidden]){
1144
1187
  --tw-divide-opacity:1;
1145
1188
  border-color:rgb(var(--_histoire-color-gray-200) / var(--tw-divide-opacity))
@@ -1157,6 +1200,10 @@ button {
1157
1200
  overflow-y:auto
1158
1201
  }
1159
1202
 
1203
+ .htw-overflow-y-scroll{
1204
+ overflow-y:scroll
1205
+ }
1206
+
1160
1207
  .htw-truncate{
1161
1208
  overflow:hidden;
1162
1209
  text-overflow:ellipsis;
@@ -1201,6 +1248,10 @@ button {
1201
1248
  border-bottom-width:2px
1202
1249
  }
1203
1250
 
1251
+ .htw-border-b{
1252
+ border-bottom-width:1px
1253
+ }
1254
+
1204
1255
  .htw-border-r{
1205
1256
  border-right-width:1px
1206
1257
  }
@@ -1213,15 +1264,16 @@ button {
1213
1264
  border-left-width:2px
1214
1265
  }
1215
1266
 
1216
- .htw-border-b{
1217
- border-bottom-width:1px
1218
- }
1219
-
1220
1267
  .htw-border-gray-600{
1221
1268
  --tw-border-opacity:1;
1222
1269
  border-color:rgb(var(--_histoire-color-gray-600) / var(--tw-border-opacity))
1223
1270
  }
1224
1271
 
1272
+ .htw-border-gray-100{
1273
+ --tw-border-opacity:1;
1274
+ border-color:rgb(var(--_histoire-color-gray-100) / var(--tw-border-opacity))
1275
+ }
1276
+
1225
1277
  .htw-border-gray-200{
1226
1278
  --tw-border-opacity:1;
1227
1279
  border-color:rgb(var(--_histoire-color-gray-200) / var(--tw-border-opacity))
@@ -1231,11 +1283,6 @@ button {
1231
1283
  border-color:transparent
1232
1284
  }
1233
1285
 
1234
- .htw-border-gray-100{
1235
- --tw-border-opacity:1;
1236
- border-color:rgb(var(--_histoire-color-gray-100) / var(--tw-border-opacity))
1237
- }
1238
-
1239
1286
  .htw-border-gray-500\/10{
1240
1287
  border-color:rgb(var(--_histoire-color-gray-500) / 0.1)
1241
1288
  }
@@ -1264,6 +1311,11 @@ button {
1264
1311
  background-color:rgb(var(--_histoire-color-gray-500) / var(--tw-bg-opacity))
1265
1312
  }
1266
1313
 
1314
+ .htw-bg-white{
1315
+ --tw-bg-opacity:1;
1316
+ background-color:rgb(255 255 255 / var(--tw-bg-opacity))
1317
+ }
1318
+
1267
1319
  .htw-bg-primary-500{
1268
1320
  --tw-bg-opacity:1;
1269
1321
  background-color:rgb(var(--_histoire-color-primary-500) / var(--tw-bg-opacity))
@@ -1277,11 +1329,6 @@ button {
1277
1329
  background-color:rgb(255 255 255 / 0.8)
1278
1330
  }
1279
1331
 
1280
- .htw-bg-white{
1281
- --tw-bg-opacity:1;
1282
- background-color:rgb(255 255 255 / var(--tw-bg-opacity))
1283
- }
1284
-
1285
1332
  .htw-bg-transparent{
1286
1333
  background-color:transparent
1287
1334
  }
@@ -1314,16 +1361,16 @@ button {
1314
1361
  stroke-width:2
1315
1362
  }
1316
1363
 
1317
- .htw-p-1{
1318
- padding:0.25rem
1364
+ .htw-p-2{
1365
+ padding:0.5rem
1319
1366
  }
1320
1367
 
1321
1368
  .htw-p-4{
1322
1369
  padding:1rem
1323
1370
  }
1324
1371
 
1325
- .htw-p-2{
1326
- padding:0.5rem
1372
+ .htw-p-1{
1373
+ padding:0.25rem
1327
1374
  }
1328
1375
 
1329
1376
  .htw-p-2\.5{
@@ -1340,9 +1387,14 @@ button {
1340
1387
  padding-right:1rem
1341
1388
  }
1342
1389
 
1343
- .htw-py-4{
1344
- padding-top:1rem;
1345
- padding-bottom:1rem
1390
+ .htw-py-3{
1391
+ padding-top:0.75rem;
1392
+ padding-bottom:0.75rem
1393
+ }
1394
+
1395
+ .htw-px-6{
1396
+ padding-left:1.5rem;
1397
+ padding-right:1.5rem
1346
1398
  }
1347
1399
 
1348
1400
  .htw-py-12{
@@ -1350,9 +1402,9 @@ button {
1350
1402
  padding-bottom:3rem
1351
1403
  }
1352
1404
 
1353
- .htw-px-6{
1354
- padding-left:1.5rem;
1355
- padding-right:1.5rem
1405
+ .htw-py-4{
1406
+ padding-top:1rem;
1407
+ padding-bottom:1rem
1356
1408
  }
1357
1409
 
1358
1410
  .htw-px-0\.5{
@@ -1360,9 +1412,9 @@ button {
1360
1412
  padding-right:0.125rem
1361
1413
  }
1362
1414
 
1363
- .htw-py-1\.5{
1364
- padding-top:0.375rem;
1365
- padding-bottom:0.375rem
1415
+ .htw-py-2{
1416
+ padding-top:0.5rem;
1417
+ padding-bottom:0.5rem
1366
1418
  }
1367
1419
 
1368
1420
  .htw-px-0{
@@ -1370,11 +1422,6 @@ button {
1370
1422
  padding-right:0px
1371
1423
  }
1372
1424
 
1373
- .htw-py-1{
1374
- padding-top:0.25rem;
1375
- padding-bottom:0.25rem
1376
- }
1377
-
1378
1425
  .htw-px-2{
1379
1426
  padding-left:0.5rem;
1380
1427
  padding-right:0.5rem
@@ -1390,11 +1437,6 @@ button {
1390
1437
  padding-bottom:0px
1391
1438
  }
1392
1439
 
1393
- .htw-py-3{
1394
- padding-top:0.75rem;
1395
- padding-bottom:0.75rem
1396
- }
1397
-
1398
1440
  .htw-pr-2{
1399
1441
  padding-right:0.5rem
1400
1442
  }
@@ -1450,24 +1492,24 @@ button {
1450
1492
  color:rgb(255 255 255 / 0.4)
1451
1493
  }
1452
1494
 
1453
- .htw-text-gray-400{
1495
+ .htw-text-primary-500{
1454
1496
  --tw-text-opacity:1;
1455
- color:rgb(var(--_histoire-color-gray-400) / var(--tw-text-opacity))
1497
+ color:rgb(var(--_histoire-color-primary-500) / var(--tw-text-opacity))
1456
1498
  }
1457
1499
 
1458
- .htw-text-white{
1500
+ .htw-text-gray-500{
1459
1501
  --tw-text-opacity:1;
1460
- color:rgb(255 255 255 / var(--tw-text-opacity))
1502
+ color:rgb(var(--_histoire-color-gray-500) / var(--tw-text-opacity))
1461
1503
  }
1462
1504
 
1463
- .htw-text-primary-500{
1505
+ .htw-text-gray-400{
1464
1506
  --tw-text-opacity:1;
1465
- color:rgb(var(--_histoire-color-primary-500) / var(--tw-text-opacity))
1507
+ color:rgb(var(--_histoire-color-gray-400) / var(--tw-text-opacity))
1466
1508
  }
1467
1509
 
1468
- .htw-text-gray-500{
1510
+ .htw-text-white{
1469
1511
  --tw-text-opacity:1;
1470
- color:rgb(var(--_histoire-color-gray-500) / var(--tw-text-opacity))
1512
+ color:rgb(255 255 255 / var(--tw-text-opacity))
1471
1513
  }
1472
1514
 
1473
1515
  .htw-text-black\/\[2\%\]{
@@ -1591,7 +1633,16 @@ body,
1591
1633
  #app {
1592
1634
  height: 100%;
1593
1635
  font-family: 'Lato', sans-serif;
1594
- font-size: 14px;
1636
+ }
1637
+
1638
+ #app {
1639
+ font-size: 18px;
1640
+ }
1641
+
1642
+ @media (min-width: 640px) {
1643
+ #app {
1644
+ font-size: 14px;
1645
+ }
1595
1646
  }
1596
1647
 
1597
1648
  .__histoire-sandbox {
@@ -1681,25 +1732,35 @@ body,
1681
1732
  --tw-prose-td-borders:var(--tw-prose-invert-td-borders)
1682
1733
  }
1683
1734
 
1735
+ .htw-dark .dark\:htw-divide-gray-800 > :not([hidden]) ~ :not([hidden]){
1736
+ --tw-divide-opacity:1;
1737
+ border-color:rgb(var(--_histoire-color-gray-800) / var(--tw-divide-opacity))
1738
+ }
1739
+
1684
1740
  .htw-dark .dark\:htw-divide-gray-850 > :not([hidden]) ~ :not([hidden]){
1685
1741
  --tw-divide-opacity:1;
1686
1742
  border-color:rgb(var(--_histoire-color-gray-850) / var(--tw-divide-opacity))
1687
1743
  }
1688
1744
 
1689
- .htw-dark .dark\:htw-border-gray-850{
1745
+ .htw-dark .dark\:htw-border-gray-800{
1690
1746
  --tw-border-opacity:1;
1691
- border-color:rgb(var(--_histoire-color-gray-850) / var(--tw-border-opacity))
1747
+ border-color:rgb(var(--_histoire-color-gray-800) / var(--tw-border-opacity))
1692
1748
  }
1693
1749
 
1694
- .htw-dark .dark\:htw-border-gray-800{
1750
+ .htw-dark .dark\:htw-border-gray-850{
1695
1751
  --tw-border-opacity:1;
1696
- border-color:rgb(var(--_histoire-color-gray-800) / var(--tw-border-opacity))
1752
+ border-color:rgb(var(--_histoire-color-gray-850) / var(--tw-border-opacity))
1697
1753
  }
1698
1754
 
1699
1755
  .htw-dark .dark\:htw-border-gray-700\/30{
1700
1756
  border-color:rgb(var(--_histoire-color-gray-700) / 0.3)
1701
1757
  }
1702
1758
 
1759
+ .htw-dark .dark\:htw-border-gray-750{
1760
+ --tw-border-opacity:1;
1761
+ border-color:rgb(var(--_histoire-color-gray-750) / var(--tw-border-opacity))
1762
+ }
1763
+
1703
1764
  .htw-dark .dark\:htw-border-primary-900{
1704
1765
  --tw-border-opacity:1;
1705
1766
  border-color:rgb(var(--_histoire-color-primary-900) / var(--tw-border-opacity))
@@ -1709,11 +1770,6 @@ body,
1709
1770
  border-color:rgb(255 255 255 / 0.2)
1710
1771
  }
1711
1772
 
1712
- .htw-dark .dark\:htw-border-gray-750{
1713
- --tw-border-opacity:1;
1714
- border-color:rgb(var(--_histoire-color-gray-750) / var(--tw-border-opacity))
1715
- }
1716
-
1717
1773
  .htw-dark .dark\:htw-border-gray-500{
1718
1774
  --tw-border-opacity:1;
1719
1775
  border-color:rgb(var(--_histoire-color-gray-500) / var(--tw-border-opacity))
@@ -1807,6 +1863,25 @@ body,
1807
1863
  border-color:rgb(var(--_histoire-color-primary-500) / var(--tw-border-opacity))
1808
1864
  }
1809
1865
 
1866
+ @media (min-width: 640px){
1867
+ .sm\:htw-h-4{
1868
+ height:1rem
1869
+ }
1870
+
1871
+ .sm\:htw-w-4{
1872
+ width:1rem
1873
+ }
1874
+
1875
+ .sm\:htw-p-1{
1876
+ padding:0.25rem
1877
+ }
1878
+
1879
+ .sm\:htw-py-4{
1880
+ padding-top:1rem;
1881
+ padding-bottom:1rem
1882
+ }
1883
+ }
1884
+
1810
1885
  @media (min-width: 768px){
1811
1886
  .md\:htw-mx-auto{
1812
1887
  margin-left:auto;
@@ -1816,4 +1891,14 @@ body,
1816
1891
  .md\:htw-mt-16{
1817
1892
  margin-top:4rem
1818
1893
  }
1894
+
1895
+ .md\:htw-py-1\.5{
1896
+ padding-top:0.375rem;
1897
+ padding-bottom:0.375rem
1898
+ }
1899
+
1900
+ .md\:htw-py-1{
1901
+ padding-top:0.25rem;
1902
+ padding-bottom:0.25rem
1903
+ }
1819
1904
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "histoire",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "A fast story book powered by Vite",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -34,9 +34,9 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@iconify/vue": "^3.1.3",
37
- "@histoire/controls": "^0.1.1",
37
+ "@histoire/controls": "^0.1.4",
38
38
  "@vitejs/plugin-vue": "^2.2.0",
39
- "@vueuse/core": "^7.6.2",
39
+ "@vueuse/core": "^8.1.1",
40
40
  "case": "^1.6.3",
41
41
  "chokidar": "^3.5.3",
42
42
  "defu": "^5.0.1",
@@ -60,7 +60,6 @@
60
60
  "vue-router": "^4.0.12"
61
61
  },
62
62
  "peerDependencies": {
63
- "@vue/runtime-core": "^3.2.31",
64
63
  "vite": "^2.8.3",
65
64
  "vue": "^3.2.31"
66
65
  },
@@ -81,7 +80,7 @@
81
80
  },
82
81
  "scripts": {
83
82
  "build": "rimraf dist && tsc -d && pnpm run build:css && node ./scripts/copy.mjs",
84
- "build:css": "tailwindcss -i src/client/app/style/main.css -o ./dist/style.css -c tailwind.config.cjs --postcss postcss.config.cjs",
83
+ "build:css": "tailwindcss -i src/client/app/style/main.pcss -o ./dist/style.css -c tailwind.config.cjs --postcss postcss.config.cjs",
85
84
  "watch": "concurrently \"tsc -d -w --sourceMap\" \"pnpm run build:css -- --watch\" \"node ./scripts/watchAndCopy.mjs\"",
86
85
  "test:open": "peeky open",
87
86
  "test": "peeky run"
@@ -11,6 +11,8 @@ import { mapFile } from './util/mapping'
11
11
  import { useTitle } from '@vueuse/core'
12
12
  import { histoireConfig } from './util/config.js'
13
13
  import { onKeyboardShortcut } from './util/keyboard.js'
14
+ import { isMobile } from './util/responsive'
15
+ import Breadcrumb from './components/app/Breadcrumb.vue'
14
16
 
15
17
  const SearchModal = defineAsyncComponent(() => import('./components/search/SearchModal.vue'))
16
18
 
@@ -79,7 +81,20 @@ onKeyboardShortcut(['ctrl+k', 'meta+k'], (event) => {
79
81
  </div>
80
82
 
81
83
  <div class="htw-h-screen dark:htw-bg-gray-700 dark:htw-text-gray-100">
84
+ <div
85
+ v-if="isMobile"
86
+ class="htw-h-full htw-flex htw-flex-col htw-divide-y htw-divide-gray-100 dark:htw-divide-gray-800"
87
+ >
88
+ <AppHeader @search="isSearchOpen = true" />
89
+ <Breadcrumb
90
+ :tree="tree"
91
+ :stories="stories"
92
+ />
93
+ <RouterView class="htw-grow" />
94
+ </div>
95
+
82
96
  <BaseSplitPane
97
+ v-else
83
98
  save-id="main-horiz"
84
99
  :min="5"
85
100
  :max="50"
@@ -16,8 +16,8 @@ const themeIcon = computed(() => {
16
16
  })
17
17
 
18
18
  onKeyboardShortcut(['ctrl+shift+d', 'meta+shift+d'], (event) => {
19
- toggleDark()
20
19
  event.preventDefault()
20
+ toggleDark()
21
21
  })
22
22
  </script>
23
23
 
@@ -25,7 +25,7 @@ onKeyboardShortcut(['ctrl+shift+d', 'meta+shift+d'], (event) => {
25
25
  <div
26
26
  class="htw-px-4 htw-h-16 htw-flex htw-items-center htw-gap-2"
27
27
  >
28
- <div class="htw-py-4 htw-flex-1 htw-h-full htw-flex htw-items-center htw-pr-2">
28
+ <div class="htw-py-3 sm:htw-py-4 htw-flex-1 htw-h-full htw-flex htw-items-center htw-pr-2">
29
29
  <a
30
30
  :href="histoireConfig.theme?.logoHref"
31
31
  target="_blank"
@@ -39,23 +39,23 @@ onKeyboardShortcut(['ctrl+shift+d', 'meta+shift+d'], (event) => {
39
39
  <div class="htw-ml-auto htw-flex-none htw-flex">
40
40
  <a
41
41
  v-tooltip="makeTooltip('Search', ({ isMac }) => isMac ? 'meta+k' : 'ctrl+k')"
42
- class="htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer"
42
+ class="htw-p-2 sm:htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer"
43
43
  @click="$emit('search')"
44
44
  >
45
45
  <Icon
46
46
  icon="carbon:search"
47
- class="htw-w-5 htw-h-5"
47
+ class="htw-w-6 htw-h-6 sm:htw-w-4 sm:htw-h-4"
48
48
  />
49
49
  </a>
50
50
 
51
51
  <a
52
52
  v-tooltip="makeTooltip('Toggle dark mode', ({ isMac }) => isMac ? 'meta+shift+d' : 'ctrl+shift+d')"
53
- class="htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer"
53
+ class="htw-p-2 sm:htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer"
54
54
  @click="toggleDark()"
55
55
  >
56
56
  <Icon
57
57
  :icon="themeIcon"
58
- class="htw-w-5 htw-h-5"
58
+ class="htw-w-6 htw-h-6 sm:htw-w-4 sm:htw-h-4"
59
59
  />
60
60
  </a>
61
61
  </div>
@@ -0,0 +1,98 @@
1
+ <script lang="ts" setup>
2
+ import { computed, ref, watch } from 'vue'
3
+ import { Icon } from '@iconify/vue'
4
+ import { useStoryStore } from '../../stores/story'
5
+ import { Story, Tree } from '../../types'
6
+ import MobileOverlay from './MobileOverlay.vue'
7
+ import StoryList from '../story/StoryList.vue'
8
+
9
+ const props = defineProps<{
10
+ tree: Tree
11
+ stories: Story[]
12
+ }>()
13
+
14
+ const storyStore = useStoryStore()
15
+
16
+ const story = computed(() => storyStore.currentStory)
17
+
18
+ const folders = computed(() => {
19
+ return story.value.file.path.slice(0, -1)
20
+ })
21
+
22
+ const isMenuOpened = ref(false)
23
+
24
+ function openMenu () {
25
+ isMenuOpened.value = true
26
+ }
27
+
28
+ function closeMenu () {
29
+ isMenuOpened.value = false
30
+ }
31
+
32
+ watch(story, () => {
33
+ isMenuOpened.value = false
34
+ })
35
+ </script>
36
+
37
+ <template>
38
+ <div>
39
+ <a
40
+ class="htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center"
41
+ @click="openMenu"
42
+ >
43
+ <template v-if="story">
44
+ <template
45
+ v-for="(file, key) of folders"
46
+ :key="key"
47
+ >
48
+ <span>
49
+ {{ file }}
50
+ </span>
51
+ <span class="htw-opacity-40">
52
+ /
53
+ </span>
54
+ </template>
55
+ <span class="htw-flex htw-items-center htw-gap-2">
56
+ <Icon
57
+ :icon="story.icon ?? 'carbon:cube'"
58
+ class="base-list-item-link-icon htw-w-5 htw-h-5 htw-flex-none"
59
+ :class="{
60
+ 'htw-text-primary-500': !story.iconColor,
61
+ 'bind-icon-color': story.iconColor,
62
+ }"
63
+ />
64
+ {{ story.title }}
65
+ <span class="htw-opacity-40 htw-text-sm">
66
+ {{ story.variants.length }}
67
+ </span>
68
+ </span>
69
+ </template>
70
+ <template v-else>
71
+ Select a story...
72
+ </template>
73
+
74
+ <Icon
75
+ icon="carbon:chevron-sort"
76
+ class="htw-w-5 htw-h-5 htw-shrink-0 htw-ml-auto"
77
+ />
78
+ </a>
79
+ </div>
80
+
81
+ <MobileOverlay
82
+ title="Select a story"
83
+ :opened="isMenuOpened"
84
+ @close="closeMenu"
85
+ >
86
+ <StoryList
87
+ :tree="tree"
88
+ :stories="stories"
89
+ class="htw-flex-1 htw-overflow-y-scroll"
90
+ />
91
+ </MobileOverlay>
92
+ </template>
93
+
94
+ <style scoped>
95
+ .bind-icon-color {
96
+ color: v-bind('story?.iconColor');
97
+ }
98
+ </style>
@@ -0,0 +1,34 @@
1
+ <script lang="ts" setup>
2
+ import { Icon } from '@iconify/vue'
3
+ import { defineEmits } from '@vue/runtime-core'
4
+
5
+ const props = defineProps<{
6
+ title: string
7
+ opened: boolean
8
+ }>()
9
+
10
+ const emits = defineEmits<{(e: 'close'): void}>()
11
+ </script>
12
+
13
+ <template>
14
+ <transition name="__histoire-fade">
15
+ <div
16
+ v-if="opened"
17
+ class="htw-absolute htw-z-10 htw-bg-white dark:htw-bg-gray-700 htw-w-screen htw-h-screen htw-inset-0 htw-overflow-hidden htw-flex htw-flex-col"
18
+ >
19
+ <div class="htw-p-4 htw-h-16 htw-flex htw-border-b htw-border-gray-100 dark:htw-border-gray-800 htw-items-center htw-place-content-between">
20
+ <span class="htw-text-gray-500">{{ title }}</span>
21
+ <a
22
+ class="htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer"
23
+ @click="emits('close')"
24
+ >
25
+ <Icon
26
+ icon="carbon:close"
27
+ class="htw-w-8 htw-h-8 htw-shrink-0"
28
+ />
29
+ </a>
30
+ </div>
31
+ <slot />
32
+ </div>
33
+ </transition>
34
+ </template>