@canonical/react-ds-app-launchpad 0.9.0-experimental.4 → 0.9.0-experimental.6

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 (154) hide show
  1. package/dist/esm/ui/FileTree/Context.js +4 -0
  2. package/dist/esm/ui/FileTree/Context.js.map +1 -0
  3. package/dist/esm/ui/FileTree/Provider.js +74 -0
  4. package/dist/esm/ui/FileTree/Provider.js.map +1 -0
  5. package/dist/esm/ui/FileTree/common/File/File.js +12 -0
  6. package/dist/esm/ui/FileTree/common/File/File.js.map +1 -0
  7. package/dist/esm/ui/FileTree/common/File/index.js +4 -0
  8. package/dist/esm/ui/FileTree/common/File/index.js.map +1 -0
  9. package/dist/esm/ui/FileTree/common/File/types.js +2 -0
  10. package/dist/esm/ui/FileTree/common/File/types.js.map +1 -0
  11. package/dist/esm/ui/FileTree/common/Folder/Folder.js +12 -0
  12. package/dist/esm/ui/FileTree/common/Folder/Folder.js.map +1 -0
  13. package/dist/esm/ui/FileTree/common/Folder/index.js +4 -0
  14. package/dist/esm/ui/FileTree/common/Folder/index.js.map +1 -0
  15. package/dist/esm/ui/FileTree/common/Folder/types.js +2 -0
  16. package/dist/esm/ui/FileTree/common/Folder/types.js.map +1 -0
  17. package/dist/esm/ui/FileTree/common/IndentationBlock/IndentationBlock.js +16 -0
  18. package/dist/esm/ui/FileTree/common/IndentationBlock/IndentationBlock.js.map +1 -0
  19. package/dist/esm/ui/FileTree/common/IndentationBlock/index.js +4 -0
  20. package/dist/esm/ui/FileTree/common/IndentationBlock/index.js.map +1 -0
  21. package/dist/esm/ui/FileTree/common/IndentationBlock/types.js +2 -0
  22. package/dist/esm/ui/FileTree/common/IndentationBlock/types.js.map +1 -0
  23. package/dist/esm/ui/FileTree/common/Node/Context.js +10 -0
  24. package/dist/esm/ui/FileTree/common/Node/Context.js.map +1 -0
  25. package/dist/esm/ui/FileTree/common/Node/Provider.js +163 -0
  26. package/dist/esm/ui/FileTree/common/Node/Provider.js.map +1 -0
  27. package/dist/esm/ui/FileTree/common/Node/hooks/index.js +2 -0
  28. package/dist/esm/ui/FileTree/common/Node/hooks/index.js.map +1 -0
  29. package/dist/esm/ui/FileTree/common/Node/hooks/useNode.js +12 -0
  30. package/dist/esm/ui/FileTree/common/Node/hooks/useNode.js.map +1 -0
  31. package/dist/esm/ui/FileTree/common/Node/index.js +4 -0
  32. package/dist/esm/ui/FileTree/common/Node/index.js.map +1 -0
  33. package/dist/esm/ui/FileTree/common/Node/types.js +2 -0
  34. package/dist/esm/ui/FileTree/common/Node/types.js.map +1 -0
  35. package/dist/esm/ui/FileTree/common/SearchBox/SearchBox.js +31 -0
  36. package/dist/esm/ui/FileTree/common/SearchBox/SearchBox.js.map +1 -0
  37. package/dist/esm/ui/FileTree/common/SearchBox/index.js +4 -0
  38. package/dist/esm/ui/FileTree/common/SearchBox/index.js.map +1 -0
  39. package/dist/esm/ui/FileTree/common/SearchBox/types.js +2 -0
  40. package/dist/esm/ui/FileTree/common/SearchBox/types.js.map +1 -0
  41. package/dist/esm/ui/FileTree/common/TreeView/TreeView.js +60 -0
  42. package/dist/esm/ui/FileTree/common/TreeView/TreeView.js.map +1 -0
  43. package/dist/esm/ui/FileTree/common/TreeView/index.js +4 -0
  44. package/dist/esm/ui/FileTree/common/TreeView/index.js.map +1 -0
  45. package/dist/esm/ui/FileTree/common/TreeView/types.js +2 -0
  46. package/dist/esm/ui/FileTree/common/TreeView/types.js.map +1 -0
  47. package/dist/esm/ui/FileTree/common/index.js +5 -0
  48. package/dist/esm/ui/FileTree/common/index.js.map +1 -0
  49. package/dist/esm/ui/FileTree/hooks/index.js +2 -0
  50. package/dist/esm/ui/FileTree/hooks/index.js.map +1 -0
  51. package/dist/esm/ui/FileTree/hooks/useFileTree.js +11 -0
  52. package/dist/esm/ui/FileTree/hooks/useFileTree.js.map +1 -0
  53. package/dist/esm/ui/FileTree/index.js +10 -0
  54. package/dist/esm/ui/FileTree/index.js.map +1 -0
  55. package/dist/esm/ui/FileTree/styles.css +47 -0
  56. package/dist/esm/ui/FileTree/types.js +2 -0
  57. package/dist/esm/ui/FileTree/types.js.map +1 -0
  58. package/dist/esm/ui/FileTree/utils/hashNodeName.js +11 -0
  59. package/dist/esm/ui/FileTree/utils/hashNodeName.js.map +1 -0
  60. package/dist/esm/ui/FileTree/utils/index.js +2 -0
  61. package/dist/esm/ui/FileTree/utils/index.js.map +1 -0
  62. package/dist/esm/ui/RelativeTime/RelativeTime.js +66 -0
  63. package/dist/esm/ui/RelativeTime/RelativeTime.js.map +1 -0
  64. package/dist/esm/ui/RelativeTime/index.js +4 -0
  65. package/dist/esm/ui/RelativeTime/index.js.map +1 -0
  66. package/dist/esm/ui/RelativeTime/types.js +2 -0
  67. package/dist/esm/ui/RelativeTime/types.js.map +1 -0
  68. package/dist/esm/ui/RelativeTime/utils/constants.js +6 -0
  69. package/dist/esm/ui/RelativeTime/utils/constants.js.map +1 -0
  70. package/dist/esm/ui/RelativeTime/utils/formatHumanTime.js +43 -0
  71. package/dist/esm/ui/RelativeTime/utils/formatHumanTime.js.map +1 -0
  72. package/dist/esm/ui/RelativeTime/utils/getOptimalUpdateInterval.js +24 -0
  73. package/dist/esm/ui/RelativeTime/utils/getOptimalUpdateInterval.js.map +1 -0
  74. package/dist/esm/ui/RelativeTime/utils/index.js +4 -0
  75. package/dist/esm/ui/RelativeTime/utils/index.js.map +1 -0
  76. package/dist/esm/ui/RelativeTime/utils/parseInstant.js +22 -0
  77. package/dist/esm/ui/RelativeTime/utils/parseInstant.js.map +1 -0
  78. package/dist/types/ui/FileTree/Context.d.ts +4 -0
  79. package/dist/types/ui/FileTree/Context.d.ts.map +1 -0
  80. package/dist/types/ui/FileTree/Provider.d.ts +7 -0
  81. package/dist/types/ui/FileTree/Provider.d.ts.map +1 -0
  82. package/dist/types/ui/FileTree/common/File/File.d.ts +10 -0
  83. package/dist/types/ui/FileTree/common/File/File.d.ts.map +1 -0
  84. package/dist/types/ui/FileTree/common/File/index.d.ts +3 -0
  85. package/dist/types/ui/FileTree/common/File/index.d.ts.map +1 -0
  86. package/dist/types/ui/FileTree/common/File/types.d.ts +16 -0
  87. package/dist/types/ui/FileTree/common/File/types.d.ts.map +1 -0
  88. package/dist/types/ui/FileTree/common/Folder/Folder.d.ts +10 -0
  89. package/dist/types/ui/FileTree/common/Folder/Folder.d.ts.map +1 -0
  90. package/dist/types/ui/FileTree/common/Folder/index.d.ts +3 -0
  91. package/dist/types/ui/FileTree/common/Folder/index.d.ts.map +1 -0
  92. package/dist/types/ui/FileTree/common/Folder/types.d.ts +16 -0
  93. package/dist/types/ui/FileTree/common/Folder/types.d.ts.map +1 -0
  94. package/dist/types/ui/FileTree/common/IndentationBlock/IndentationBlock.d.ts +10 -0
  95. package/dist/types/ui/FileTree/common/IndentationBlock/IndentationBlock.d.ts.map +1 -0
  96. package/dist/types/ui/FileTree/common/IndentationBlock/index.d.ts +3 -0
  97. package/dist/types/ui/FileTree/common/IndentationBlock/index.d.ts.map +1 -0
  98. package/dist/types/ui/FileTree/common/IndentationBlock/types.d.ts +12 -0
  99. package/dist/types/ui/FileTree/common/IndentationBlock/types.d.ts.map +1 -0
  100. package/dist/types/ui/FileTree/common/Node/Context.d.ts +5 -0
  101. package/dist/types/ui/FileTree/common/Node/Context.d.ts.map +1 -0
  102. package/dist/types/ui/FileTree/common/Node/Provider.d.ts +6 -0
  103. package/dist/types/ui/FileTree/common/Node/Provider.d.ts.map +1 -0
  104. package/dist/types/ui/FileTree/common/Node/hooks/index.d.ts +2 -0
  105. package/dist/types/ui/FileTree/common/Node/hooks/index.d.ts.map +1 -0
  106. package/dist/types/ui/FileTree/common/Node/hooks/useNode.d.ts +3 -0
  107. package/dist/types/ui/FileTree/common/Node/hooks/useNode.d.ts.map +1 -0
  108. package/dist/types/ui/FileTree/common/Node/index.d.ts +5 -0
  109. package/dist/types/ui/FileTree/common/Node/index.d.ts.map +1 -0
  110. package/dist/types/ui/FileTree/common/Node/types.d.ts +28 -0
  111. package/dist/types/ui/FileTree/common/Node/types.d.ts.map +1 -0
  112. package/dist/types/ui/FileTree/common/SearchBox/SearchBox.d.ts +10 -0
  113. package/dist/types/ui/FileTree/common/SearchBox/SearchBox.d.ts.map +1 -0
  114. package/dist/types/ui/FileTree/common/SearchBox/index.d.ts +3 -0
  115. package/dist/types/ui/FileTree/common/SearchBox/index.d.ts.map +1 -0
  116. package/dist/types/ui/FileTree/common/SearchBox/types.d.ts +12 -0
  117. package/dist/types/ui/FileTree/common/SearchBox/types.d.ts.map +1 -0
  118. package/dist/types/ui/FileTree/common/TreeView/TreeView.d.ts +16 -0
  119. package/dist/types/ui/FileTree/common/TreeView/TreeView.d.ts.map +1 -0
  120. package/dist/types/ui/FileTree/common/TreeView/index.d.ts +3 -0
  121. package/dist/types/ui/FileTree/common/TreeView/index.d.ts.map +1 -0
  122. package/dist/types/ui/FileTree/common/TreeView/types.d.ts +20 -0
  123. package/dist/types/ui/FileTree/common/TreeView/types.d.ts.map +1 -0
  124. package/dist/types/ui/FileTree/common/index.d.ts +5 -0
  125. package/dist/types/ui/FileTree/common/index.d.ts.map +1 -0
  126. package/dist/types/ui/FileTree/hooks/index.d.ts +2 -0
  127. package/dist/types/ui/FileTree/hooks/index.d.ts.map +1 -0
  128. package/dist/types/ui/FileTree/hooks/useFileTree.d.ts +3 -0
  129. package/dist/types/ui/FileTree/hooks/useFileTree.d.ts.map +1 -0
  130. package/dist/types/ui/FileTree/index.d.ts +5 -0
  131. package/dist/types/ui/FileTree/index.d.ts.map +1 -0
  132. package/dist/types/ui/FileTree/types.d.ts +69 -0
  133. package/dist/types/ui/FileTree/types.d.ts.map +1 -0
  134. package/dist/types/ui/FileTree/utils/hashNodeName.d.ts +3 -0
  135. package/dist/types/ui/FileTree/utils/hashNodeName.d.ts.map +1 -0
  136. package/dist/types/ui/FileTree/utils/index.d.ts +2 -0
  137. package/dist/types/ui/FileTree/utils/index.d.ts.map +1 -0
  138. package/dist/types/ui/RelativeTime/RelativeTime.d.ts +11 -0
  139. package/dist/types/ui/RelativeTime/RelativeTime.d.ts.map +1 -0
  140. package/dist/types/ui/RelativeTime/index.d.ts +3 -0
  141. package/dist/types/ui/RelativeTime/index.d.ts.map +1 -0
  142. package/dist/types/ui/RelativeTime/types.d.ts +36 -0
  143. package/dist/types/ui/RelativeTime/types.d.ts.map +1 -0
  144. package/dist/types/ui/RelativeTime/utils/constants.d.ts +6 -0
  145. package/dist/types/ui/RelativeTime/utils/constants.d.ts.map +1 -0
  146. package/dist/types/ui/RelativeTime/utils/formatHumanTime.d.ts +21 -0
  147. package/dist/types/ui/RelativeTime/utils/formatHumanTime.d.ts.map +1 -0
  148. package/dist/types/ui/RelativeTime/utils/getOptimalUpdateInterval.d.ts +8 -0
  149. package/dist/types/ui/RelativeTime/utils/getOptimalUpdateInterval.d.ts.map +1 -0
  150. package/dist/types/ui/RelativeTime/utils/index.d.ts +4 -0
  151. package/dist/types/ui/RelativeTime/utils/index.d.ts.map +1 -0
  152. package/dist/types/ui/RelativeTime/utils/parseInstant.d.ts +9 -0
  153. package/dist/types/ui/RelativeTime/utils/parseInstant.d.ts.map +1 -0
  154. package/package.json +4 -3
@@ -0,0 +1,10 @@
1
+ /* @canonical/generator-ds 0.9.0-experimental.1 */
2
+ export * from "./hooks/index.js";
3
+ import Provider from "./Provider.js";
4
+ import { File, Folder, SearchBox, TreeView } from "./common/index.js";
5
+ export const FileTree = Provider;
6
+ FileTree.SearchBox = SearchBox;
7
+ FileTree.File = File;
8
+ FileTree.TreeView = TreeView;
9
+ FileTree.Folder = Folder;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/FileTree/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,cAAc,kBAAkB,CAAC;AAOjC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGtE,MAAM,CAAC,MAAM,QAAQ,GAAG,QAA6B,CAAC;AACtD,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;AAC/B,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC"}
@@ -0,0 +1,47 @@
1
+ /* @canonical/generator-ds 0.9.0-experimental.1 */
2
+
3
+ .ds.file-tree {
4
+ --file-tree-container-border-color: #c4c4c4;
5
+
6
+ --file-tree-node-icon-size: 16px;
7
+ --file-tree-node-text-color-default: rgba(0, 0, 0, 0.6);
8
+ --file-tree-node-text-color-active: #000000;
9
+
10
+ --file-tree-node-background-color: #ffffff;
11
+ --file-tree-node-background-color-hover: #f2f2f2;
12
+ --file-tree-node-focus-outline-color: #878787;
13
+
14
+ --file-tree-node-indent-width: 16px;
15
+ --file-tree-node-indent-bar-color: #efefef;
16
+ --file-tree-node-indent-bar-width: 1px;
17
+ --file-tree-node-items-gap: 8px;
18
+ --file-tree-node-horizontal-padding: 8px;
19
+ --file-tree-node-vertical-padding: 2px;
20
+
21
+ --file-tree-node-file-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.99194 2.5H4.5V13.5H11.5V7.00806H9.24194C7.9993 7.00806 6.99194 6.0007 6.99194 4.75806V2.5ZM10.8869 5.50806L8.49194 3.1127V4.75806C8.49194 5.17227 8.82773 5.50806 9.24194 5.50806H10.8869ZM3 2.5C3 1.67157 3.67157 1 4.5 1H8.08647C8.35172 1 8.60609 1.10538 8.79364 1.29295L12.7072 5.20712C12.8947 5.39465 13 5.64898 13 5.91417V13.5C13 14.3284 12.3284 15 11.5 15H4.5C3.67157 15 3 14.3284 3 13.5V2.5ZM5.65837 8.48389H10.4917V9.98389H5.65837V8.48389ZM5.65837 10.7339V12.2339H10.4917V10.7339H5.65837Z' fill='black'/%3E%3C/svg%3E%0A");
22
+ --file-tree-node-closed-folder-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 5H13.5C14.3284 5 15 5.67157 15 6.5V12.5C15 13.3284 14.3284 14 13.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H8.5C9.32843 2 10 2.67157 10 3.5V5ZM8.5 3.5V5H2.5V3.5H8.5ZM2.5 12.5L2.5 6.5H13.5V12.5H2.5Z' fill='black'/%3E%3C/svg%3E%0A");
23
+ --file-tree-node-opened-folder-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6 5.46408V3.60693H2.5V8.66667L2.94235 7.09388C3.12429 6.44696 3.7143 6 4.38632 6H11.5V5.46408H6ZM13 6H14.0216C15.0862 6 15.812 7.07821 15.4113 8.06457L13.38 13.0646C13.1503 13.6301 12.6007 14 11.9903 14H2.98007C2.97153 14 2.963 13.9999 2.9545 13.9998H2.5C1.67157 13.9998 1 13.3282 1 12.4998V3.60693C1 2.77851 1.67157 2.10693 2.5 2.10693H6C6.82843 2.10693 7.5 2.77851 7.5 3.60693V3.96408H11.5C12.3284 3.96408 13 4.63565 13 5.46408V6ZM4.38632 7.5H14.0216L11.9903 12.5H2.98007L4.38632 7.5Z' fill='black'/%3E%3C/svg%3E%0A");
24
+
25
+ --file-tree-search-box-vertical-padding: 6px;
26
+ --file-tree-search-box-horizontal-padding: 8px;
27
+
28
+ --file-tree-search-box-line-height: 24px;
29
+ --file-tree-search-box-button-size: 24px;
30
+ --file-tree-search-box-border-color: #6c6c6c;
31
+
32
+ --file-tree-search-box-search-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.96399 1C8.08013 1.00013 9.17384 1.31346 10.1207 1.90436C11.0676 2.49526 11.8297 3.34002 12.3203 4.34256C12.8109 5.34511 13.0103 6.4652 12.8959 7.57547C12.7815 8.68573 12.3578 9.7416 11.673 10.623L15.976 14.928L14.916 15.988L10.61 11.683C9.85937 12.2631 8.98121 12.6558 8.0484 12.8284C7.1156 13.001 6.15506 12.9487 5.24655 12.6757C4.33805 12.4026 3.50777 11.9168 2.82467 11.2586C2.14157 10.6003 1.62534 9.7886 1.31886 8.89083C1.01237 7.99305 0.924467 7.03512 1.06244 6.09656C1.20042 5.158 1.5603 4.26589 2.11219 3.49431C2.66409 2.72273 3.39208 2.09393 4.23573 1.66012C5.07938 1.22631 6.01434 1.00001 6.96299 1H6.96399ZM6.96399 2.5C6.37221 2.49114 5.78458 2.60005 5.23528 2.82039C4.68598 3.04072 4.18598 3.36809 3.76436 3.78344C3.34274 4.19879 3.00793 4.69384 2.7794 5.23978C2.55087 5.78572 2.43318 6.37166 2.43318 6.9635C2.43318 7.55534 2.55087 8.14128 2.7794 8.68722C3.00793 9.23316 3.34274 9.72821 3.76436 10.1436C4.18598 10.5589 4.68598 10.8863 5.23528 11.1066C5.78458 11.327 6.37221 11.4359 6.96399 11.427C8.13621 11.4095 9.25448 10.9315 10.0772 10.0963C10.9 9.26115 11.3612 8.13585 11.3612 6.9635C11.3612 5.79115 10.9 4.66585 10.0772 3.83069C9.25448 2.99553 8.13621 2.51755 6.96399 2.5Z' fill='black'/%3E%3C/svg%3E%0A");
33
+ --file-tree-search-box-reset-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000' fill-rule='nonzero' d='M13.041 1.898l1.06 1.06L9.062 8l5.04 5.042-1.06 1.06L8 9.062 2.96 14.1l-1.06-1.06L6.938 8 1.9 2.96l1.06-1.06 5.04 5.04z'/%3E%3C/svg%3E");
34
+
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: 0;
38
+ border: 1px solid var(--file-tree-container-border-color);
39
+ overflow: auto;
40
+ padding: 0;
41
+ margin: 0;
42
+
43
+ ul {
44
+ margin: 0;
45
+ padding: 0;
46
+ }
47
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/FileTree/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ const hashNodeName = (name) => {
2
+ let hash = 0;
3
+ for (let i = 0; i < name.length; i++) {
4
+ const char = name.charCodeAt(i);
5
+ hash = (hash << 5) - hash + char;
6
+ hash |= 0;
7
+ }
8
+ return hash;
9
+ };
10
+ export default hashNodeName;
11
+ //# sourceMappingURL=hashNodeName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashNodeName.js","sourceRoot":"","sources":["../../../../../src/ui/FileTree/utils/hashNodeName.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;IACpC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;QACjC,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as hashNodeName } from "./hashNodeName.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/FileTree/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
+ import { formatHumanTime, getOptimalUpdateInterval, parseInstant, } from "./utils/index.js";
4
+ const componentCssClassName = "ds relative-time";
5
+ /**
6
+ * The RelativeTime component displays timestamps in a human-readable relative format (like "2 hours ago" or "in 3 days").
7
+ *
8
+ * It features automatic live updates with interval optimization based on time distance, configurable "now" threshold,
9
+ * and renders as proper semantic HTML using the <time> element. The component leverages the Temporal API for calculations and Intl.RelativeTimeFormat for localization.
10
+ */
11
+ const RelativeTime = ({ id, className, style, time, relativeTimeFormat, nowThreshold = 10, disableLiveUpdate = false, nowKeyword = "now", invalidDateKeyword = "invalid date", }) => {
12
+ const [relativeTime, setRelativeTime] = useState("");
13
+ const [localeTimeString, setLocaleTimeString] = useState("");
14
+ const [stringTime, setStringTime] = useState("");
15
+ const intervalRef = useRef(null);
16
+ const instantTime = useMemo(() => {
17
+ try {
18
+ return parseInstant(time);
19
+ }
20
+ catch (error) {
21
+ console.error(error);
22
+ return null;
23
+ }
24
+ }, [time]);
25
+ const updateRelativeTime = useCallback(() => {
26
+ if (instantTime === null) {
27
+ setRelativeTime(invalidDateKeyword);
28
+ setLocaleTimeString("");
29
+ setStringTime("");
30
+ return null;
31
+ }
32
+ const timeFormatter = relativeTimeFormat ||
33
+ new Intl.RelativeTimeFormat(undefined, { numeric: "auto" });
34
+ setRelativeTime(formatHumanTime(instantTime, {
35
+ nowThreshold,
36
+ nowKeyword,
37
+ relativeTimeFormat: timeFormatter,
38
+ }));
39
+ setLocaleTimeString(instantTime.toLocaleString());
40
+ setStringTime(instantTime.toString());
41
+ }, [
42
+ instantTime,
43
+ relativeTimeFormat,
44
+ nowThreshold,
45
+ nowKeyword,
46
+ invalidDateKeyword,
47
+ ]);
48
+ useEffect(() => {
49
+ // initial calculation
50
+ updateRelativeTime();
51
+ if (disableLiveUpdate || instantTime === null)
52
+ return;
53
+ const updateInterval = getOptimalUpdateInterval(instantTime);
54
+ // SSR check
55
+ if (typeof window === "undefined")
56
+ return;
57
+ intervalRef.current = window.setInterval(updateRelativeTime, updateInterval);
58
+ return () => {
59
+ if (intervalRef.current)
60
+ window.clearInterval(intervalRef.current);
61
+ };
62
+ }, [instantTime, disableLiveUpdate, updateRelativeTime]);
63
+ return (_jsx("time", { id: id, style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), title: localeTimeString, dateTime: stringTime, children: relativeTime }));
64
+ };
65
+ export default RelativeTime;
66
+ //# sourceMappingURL=RelativeTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelativeTime.js","sourceRoot":"","sources":["../../../../src/ui/RelativeTime/RelativeTime.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ /* @canonical/generator-ds 0.9.0-experimental.4 */
2
+ export { default as RelativeTime } from "./RelativeTime.js";
3
+ export * from "./types.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/RelativeTime/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/RelativeTime/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export const MINUTE_IN_SECONDS = 60;
2
+ export const HOUR_IN_SECONDS = MINUTE_IN_SECONDS * 60;
3
+ export const DAY_IN_SECONDS = HOUR_IN_SECONDS * 24;
4
+ export const MONTH_IN_SECONDS = DAY_IN_SECONDS * 30;
5
+ export const YEAR_IN_SECONDS = DAY_IN_SECONDS * 365;
6
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/ui/RelativeTime/utils/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,GAAG,EAAE,CAAC;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,GAAG,EAAE,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,GAAG,EAAE,CAAC;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,GAAG,GAAG,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ /**
3
+ * Formats a given instant as a human-readable time relative to the current time.
4
+ * @param instant The instant to format.
5
+ * @param options The options to use for formatting.
6
+ * @returns A human-readable relative time string
7
+ */
8
+ function formatHumanTime(instant, options) {
9
+ const now = Temporal.Now.instant();
10
+ const deltaSeconds = instant.epochSeconds - now.epochSeconds;
11
+ const absDeltaSeconds = Math.abs(deltaSeconds);
12
+ if (absDeltaSeconds < options.nowThreshold) {
13
+ return options.nowKeyword;
14
+ }
15
+ const timeZone = Temporal.Now.timeZoneId() || "UTC";
16
+ const instantZDT = instant.toZonedDateTimeISO(timeZone);
17
+ const nowZDT = now.toZonedDateTimeISO(timeZone);
18
+ const diff = instantZDT.since(nowZDT, { largestUnit: "years" });
19
+ const units = [
20
+ "years",
21
+ "months",
22
+ "days",
23
+ "hours",
24
+ "minutes",
25
+ "seconds",
26
+ ];
27
+ let rtfUnit = "seconds";
28
+ let rtfValue = 0;
29
+ for (const unit of units) {
30
+ const value = diff[unit];
31
+ if (value !== 0) {
32
+ rtfUnit = unit;
33
+ rtfValue = value;
34
+ break;
35
+ }
36
+ }
37
+ if (rtfValue === 0) {
38
+ return options.nowKeyword;
39
+ }
40
+ return options.relativeTimeFormat.format(rtfValue, rtfUnit);
41
+ }
42
+ export default formatHumanTime;
43
+ //# sourceMappingURL=formatHumanTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatHumanTime.js","sourceRoot":"","sources":["../../../../../src/ui/RelativeTime/utils/formatHumanTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAgBjD;;;;;GAKG;AACH,SAAS,eAAe,CACtB,OAAyB,EACzB,OAAyB;IAEzB,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACnC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;IAC7D,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE/C,IAAI,eAAe,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;QAC3C,OAAO,OAAO,CAAC,UAAU,CAAC;IAC5B,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,KAAK,CAAC;IACpD,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,GAAG,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;IAEhE,MAAM,KAAK,GAAG;QACZ,OAAO;QACP,QAAQ;QACR,MAAM;QACN,OAAO;QACP,SAAS;QACT,SAAS;KAC8B,CAAC;IAE1C,IAAI,OAAO,GAAgC,SAAS,CAAC;IACrD,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,OAAO,GAAG,IAAI,CAAC;YACf,QAAQ,GAAG,KAAK,CAAC;YACjB,MAAM;QACR,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,OAAO,CAAC,UAAU,CAAC;IAC5B,CAAC;IAED,OAAO,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import * as constants from "./constants.js";
3
+ /**
4
+ * Calcualte the optimal update interval for a given instant based on the time distance from now.
5
+ * @returns The optimal update interval in milliseconds.
6
+ */
7
+ function getOptimalUpdateInterval(instant) {
8
+ const now = Temporal.Now.instant();
9
+ const deltaSeconds = instant.epochSeconds - now.epochSeconds;
10
+ const absDeltaSeconds = Math.abs(deltaSeconds);
11
+ if (absDeltaSeconds < constants.MINUTE_IN_SECONDS) {
12
+ return 1000;
13
+ }
14
+ if (absDeltaSeconds < constants.HOUR_IN_SECONDS) {
15
+ return constants.MINUTE_IN_SECONDS * 1000;
16
+ }
17
+ if (absDeltaSeconds < constants.DAY_IN_SECONDS) {
18
+ return constants.HOUR_IN_SECONDS * 1000;
19
+ }
20
+ // for any other time distance, update once a day
21
+ return constants.DAY_IN_SECONDS * 1000;
22
+ }
23
+ export default getOptimalUpdateInterval;
24
+ //# sourceMappingURL=getOptimalUpdateInterval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOptimalUpdateInterval.js","sourceRoot":"","sources":["../../../../../src/ui/RelativeTime/utils/getOptimalUpdateInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C;;;GAGG;AACH,SAAS,wBAAwB,CAAC,OAAyB;IACzD,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACnC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;IAC7D,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE/C,IAAI,eAAe,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,eAAe,GAAG,SAAS,CAAC,eAAe,EAAE,CAAC;QAChD,OAAO,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAC5C,CAAC;IAED,IAAI,eAAe,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;QAC/C,OAAO,SAAS,CAAC,eAAe,GAAG,IAAI,CAAC;IAC1C,CAAC;IACD,iDAAiD;IACjD,OAAO,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC;AACzC,CAAC;AAED,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default as formatHumanTime } from "./formatHumanTime.js";
2
+ export { default as getOptimalUpdateInterval } from "./getOptimalUpdateInterval.js";
3
+ export { default as parseInstant } from "./parseInstant.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/RelativeTime/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ /**
3
+ * Parser for Temporal.Instant.
4
+ * @param time - instance, date or string to parse
5
+ * @throws Error if time is invalid
6
+ */
7
+ function parseInstant(time) {
8
+ if (time instanceof Temporal.Instant) {
9
+ return time;
10
+ }
11
+ if (time instanceof Date) {
12
+ return Temporal.Instant.fromEpochMilliseconds(time.getTime());
13
+ }
14
+ try {
15
+ return Temporal.Instant.from(time);
16
+ }
17
+ catch (e) {
18
+ throw new Error(`Invalid time string (ISO string or Date object expected): ${time}`);
19
+ }
20
+ }
21
+ export default parseInstant;
22
+ //# sourceMappingURL=parseInstant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseInstant.js","sourceRoot":"","sources":["../../../../../src/ui/RelativeTime/utils/parseInstant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;;;GAIG;AACH,SAAS,YAAY,CAAC,IAAsC;IAC1D,IAAI,IAAI,YAAY,QAAQ,CAAC,OAAO,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,IAAI,YAAY,IAAI,EAAE,CAAC;QACzB,OAAO,QAAQ,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,6DAA6D,IAAI,EAAE,CACpE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ContextOptions } from "./types.js";
2
+ declare const Context: import("react").Context<ContextOptions | null>;
3
+ export default Context;
4
+ //# sourceMappingURL=Context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/ui/FileTree/Context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,QAAA,MAAM,OAAO,gDAA6C,CAAC;AAE3D,eAAe,OAAO,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type React from "react";
2
+ import "./styles.css";
3
+ import type { ProviderOptions } from "./types.js";
4
+ export declare const dataPathHash = "data-path-hash";
5
+ declare const Provider: ({ id, className, style, children, ...contextOptions }: ProviderOptions) => React.ReactElement;
6
+ export default Provider;
7
+ //# sourceMappingURL=Provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/ui/FileTree/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAyB,eAAe,EAAE,MAAM,YAAY,CAAC;AAGzE,eAAO,MAAM,YAAY,mBAAmB,CAAC;AAE7C,QAAA,MAAM,QAAQ,0DAMX,eAAe,KAAG,KAAK,CAAC,YA8G1B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type React from "react";
2
+ import "./styles.css";
3
+ import type { FileProps } from "./types.js";
4
+ /**
5
+ * description of the File component
6
+ * @returns {React.ReactElement} - Rendered File
7
+ */
8
+ declare const File: ({ id, className, style, name, marker, }: FileProps) => React.ReactElement;
9
+ export default File;
10
+ //# sourceMappingURL=File.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/File/File.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;GAGG;AACH,QAAA,MAAM,IAAI,4CAMP,SAAS,KAAG,KAAK,CAAC,YAWpB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as File } from "./File.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/File/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,cAAc,YAAY,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type React from "react";
2
+ export interface FileProps {
3
+ /** A unique identifier for the File */
4
+ id?: string;
5
+ /** Additional CSS classes */
6
+ className?: string;
7
+ /** Inline styles */
8
+ style?: React.CSSProperties;
9
+ /** File name */
10
+ name: string;
11
+ /**
12
+ * Shows a marker to the right of the file name.
13
+ */
14
+ marker?: React.ReactNode;
15
+ }
16
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/File/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,SAAS;IACxB,uCAAuC;IACvC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B"}
@@ -0,0 +1,10 @@
1
+ import type React from "react";
2
+ import "./styles.css";
3
+ import type { FolderProps } from "./types.js";
4
+ /**
5
+ * description of the Folder component
6
+ * @returns {React.ReactElement} - Rendered Folder
7
+ */
8
+ declare const Folder: ({ id, children, className, style, name, defaultOpen, }: FolderProps) => React.ReactElement;
9
+ export default Folder;
10
+ //# sourceMappingURL=Folder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Folder.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Folder/Folder.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;GAGG;AACH,QAAA,MAAM,MAAM,2DAOT,WAAW,KAAG,KAAK,CAAC,YAatB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as Folder } from "./Folder.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Folder/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,cAAc,YAAY,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type React from "react";
2
+ export interface FolderProps {
3
+ /** A unique identifier for the Folder */
4
+ id?: string;
5
+ /** Additional CSS classes */
6
+ className?: string;
7
+ /** Child elements */
8
+ children?: React.ReactNode;
9
+ /** Inline styles */
10
+ style?: React.CSSProperties;
11
+ /** Folder name */
12
+ name: string;
13
+ /** Whether the folder is expanded by default */
14
+ defaultOpen?: boolean;
15
+ }
16
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Folder/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -0,0 +1,10 @@
1
+ import type React from "react";
2
+ import "./styles.css";
3
+ import type { IndentationBlockProps } from "./types.js";
4
+ /**
5
+ * description of the IndentationBlock component
6
+ * @returns {React.ReactElement} - Rendered IndentationBlock
7
+ */
8
+ declare const IndentationBlock: ({ id, className, style, depth, }: IndentationBlockProps) => React.ReactElement | null;
9
+ export default IndentationBlock;
10
+ //# sourceMappingURL=IndentationBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndentationBlock.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/IndentationBlock/IndentationBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAIxD;;;GAGG;AACH,QAAA,MAAM,gBAAgB,qCAKnB,qBAAqB,KAAG,KAAK,CAAC,YAAY,GAAG,IAkB/C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as IndentationBlock } from "./IndentationBlock.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/IndentationBlock/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpE,cAAc,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type React from "react";
2
+ export interface IndentationBlockProps {
3
+ /** A unique identifier for the IndentationBlock */
4
+ id?: string;
5
+ /** Additional CSS classes */
6
+ className?: string;
7
+ /** Inline styles */
8
+ style?: React.CSSProperties;
9
+ /** Depth of the indentation */
10
+ depth: number;
11
+ }
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/IndentationBlock/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,5 @@
1
+ import type { ContextOptions } from "./types.js";
2
+ export declare const rootLevelEmptyContext: ContextOptions;
3
+ declare const Context: import("react").Context<ContextOptions>;
4
+ export default Context;
5
+ //# sourceMappingURL=Context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Node/Context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,qBAAqB,EAAE,cAKnC,CAAC;AAEF,QAAA,MAAM,OAAO,yCAAuD,CAAC;AAErE,eAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type React from "react";
2
+ import "./styles.css";
3
+ import type { ProviderProps } from "./types.js";
4
+ declare const Provider: ({ id, className, style, children, name, marker, ...nodeOptions }: ProviderProps) => React.ReactElement | null;
5
+ export default Provider;
6
+ //# sourceMappingURL=Provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Node/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAOhD,QAAA,MAAM,QAAQ,qEAQX,aAAa,KAAG,KAAK,CAAC,YAAY,GAAG,IA+MvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as useNode } from "./useNode.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/FileTree/common/Node/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const useNode: () => import("../types.js").ContextOptions;
2
+ export default useNode;
3
+ //# sourceMappingURL=useNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNode.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/FileTree/common/Node/hooks/useNode.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,OAAO,4CAOZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { default as Context } from "./Context.js";
2
+ export * from "./hooks/index.js";
3
+ export { default as Node } from "./Provider.js";
4
+ export type * from "./types.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,eAAe,CAAC;AAChD,mBAAmB,YAAY,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { FileTreeData } from "../../types.js";
2
+ export type ContextOptions = {
3
+ depth: number;
4
+ path: string;
5
+ addChildNode: (node: FileTreeData) => void;
6
+ childNodes: FileTreeData[];
7
+ };
8
+ export type FileOptions = {
9
+ nodeType: "file";
10
+ };
11
+ export type FolderOptions = {
12
+ nodeType: "folder";
13
+ defaultOpen?: boolean;
14
+ };
15
+ export type ProviderProps = {
16
+ /** A unique identifier for the Folder */
17
+ id?: string;
18
+ /** Additional CSS classes */
19
+ className?: string;
20
+ /** Child elements */
21
+ children?: React.ReactNode;
22
+ /** Inline styles */
23
+ style?: React.CSSProperties;
24
+ name: string;
25
+ /** Shows a marker to the right of the node */
26
+ marker?: React.ReactNode;
27
+ } & (FileOptions | FolderOptions);
28
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Node/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IAEb,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,YAAY,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,yCAAyC;IACzC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb,8CAA8C;IAC9C,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,GAAG,CAAC,WAAW,GAAG,aAAa,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type React from "react";
2
+ import "./styles.css";
3
+ import type { SearchBoxProps } from "./types.js";
4
+ /**
5
+ * description of the SearchBox component
6
+ * @returns {React.ReactElement} - Rendered SearchBox
7
+ */
8
+ declare const SearchBox: ({ id, children, className, style, }: SearchBoxProps) => React.ReactElement | null;
9
+ export default SearchBox;
10
+ //# sourceMappingURL=SearchBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchBox.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/SearchBox/SearchBox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD;;;GAGG;AACH,QAAA,MAAM,SAAS,wCAKZ,cAAc,KAAG,KAAK,CAAC,YAAY,GAAG,IAyDxC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as SearchBox } from "./SearchBox.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/SearchBox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,cAAc,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type React from "react";
2
+ export interface SearchBoxProps {
3
+ /** A unique identifier for the SearchBox */
4
+ id?: string;
5
+ /** Additional CSS classes */
6
+ className?: string;
7
+ /** Child elements */
8
+ children?: React.ReactNode;
9
+ /** Inline styles */
10
+ style?: React.CSSProperties;
11
+ }
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/SearchBox/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B"}