kempo-ui 0.0.3 → 0.0.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 (137) hide show
  1. package/.github/workflows/publish-major.yml +39 -0
  2. package/.github/workflows/publish-minor.yml +39 -0
  3. package/.github/workflows/{publish-npm.yml → publish-patch.yml} +1 -1
  4. package/.vscode/settings.json +2 -0
  5. package/dist/kempo-hljs.css +1 -0
  6. package/dist/src/components/Accordion.js +36 -0
  7. package/dist/src/components/Card.js +37 -0
  8. package/dist/src/components/Collapsible.js +41 -0
  9. package/dist/src/components/ContentSlider.js +44 -0
  10. package/dist/src/components/Dialog.js +113 -0
  11. package/dist/src/components/Icon.js +2 -2
  12. package/dist/src/components/PersistantCollapsible.js +1 -0
  13. package/dist/src/components/PhotoViewer.js +135 -0
  14. package/dist/src/components/Resize.js +96 -0
  15. package/dist/src/components/ShowMore.js +42 -0
  16. package/dist/src/components/SideMenu.js +1 -1
  17. package/dist/src/components/Split.js +84 -0
  18. package/dist/src/components/Tabs.js +155 -0
  19. package/dist/src/components/Tags.js +69 -0
  20. package/dist/src/components/ThemeSwitcher.js +23 -0
  21. package/dist/src/components/Timestamp.js +1 -0
  22. package/dist/src/utils/debounce.js +1 -0
  23. package/dist/src/utils/drag.js +1 -0
  24. package/dist/src/utils/formatTimestamp.js +1 -0
  25. package/dist/src/utils/propConverters.js +1 -0
  26. package/dist/src/utils/watchWindowSize.js +1 -0
  27. package/docs/components/accordion.html +69 -25
  28. package/docs/components/card.html +6 -5
  29. package/docs/components/collapsible.html +198 -0
  30. package/docs/components/content-slider.html +56 -26
  31. package/docs/components/dialog.html +54 -48
  32. package/docs/components/focus-capture.html +2 -3
  33. package/docs/components/icon.html +5 -8
  34. package/docs/components/import.html +1 -6
  35. package/docs/components/persistant-collapsible.html +123 -0
  36. package/docs/components/photo-viewer.html +226 -0
  37. package/docs/components/resize.html +44 -18
  38. package/docs/components/show-more.html +12 -6
  39. package/docs/components/side-menu.html +3 -12
  40. package/docs/components/split.html +26 -5
  41. package/docs/components/tablePagination.html +4 -4
  42. package/docs/components/tableRecordFiltering.html +16 -3
  43. package/docs/components/tableRecordSelection.html +2 -2
  44. package/docs/components/tabs.html +24 -7
  45. package/docs/components/tags.html +24 -8
  46. package/docs/components/theme-switcher.html +3 -6
  47. package/docs/components/timestamp.html +20 -24
  48. package/docs/components/toast.html +23 -32
  49. package/docs/components/toggle.html +4 -3
  50. package/docs/kempo-hljs.css +1 -0
  51. package/docs/media/civic.jpg +0 -0
  52. package/docs/media/corvette.jpg +0 -0
  53. package/docs/media/evo.jpg +0 -0
  54. package/docs/media/gtr.jpg +0 -0
  55. package/docs/media/nsx.jpg +0 -0
  56. package/docs/nav.inc.html +11 -17
  57. package/docs/src/components/Accordion.js +36 -0
  58. package/docs/src/components/Card.js +37 -0
  59. package/docs/src/components/Collapsible.js +41 -0
  60. package/docs/src/components/ContentSlider.js +44 -0
  61. package/docs/src/components/Dialog.js +113 -0
  62. package/docs/src/components/Icon.js +2 -2
  63. package/docs/src/components/PersistantCollapsible.js +1 -0
  64. package/docs/src/components/PhotoViewer.js +135 -0
  65. package/docs/src/components/Resize.js +96 -0
  66. package/docs/src/components/ShowMore.js +42 -0
  67. package/docs/src/components/SideMenu.js +1 -1
  68. package/docs/src/components/Split.js +84 -0
  69. package/docs/src/components/Tabs.js +155 -0
  70. package/docs/src/components/Tags.js +69 -0
  71. package/docs/src/components/ThemeSwitcher.js +23 -0
  72. package/docs/src/components/Timestamp.js +1 -0
  73. package/docs/src/utils/debounce.js +1 -0
  74. package/docs/src/utils/drag.js +1 -0
  75. package/docs/src/utils/formatTimestamp.js +1 -0
  76. package/docs/src/utils/propConverters.js +1 -0
  77. package/docs/src/utils/watchWindowSize.js +1 -0
  78. package/docs/utils/debounce.html +78 -0
  79. package/docs/utils/drag.html +104 -0
  80. package/docs/utils/formatTimestamp.html +114 -0
  81. package/docs/utils/propConverters.html +132 -0
  82. package/docs/utils/watchWindowSize.html +166 -0
  83. package/icons/error.svg +1 -1
  84. package/icons/warning.svg +1 -1
  85. package/package.json +1 -1
  86. package/scripts/build.js +1 -1
  87. package/scripts/docs.js +4 -2
  88. package/src/components/Accordion.js +229 -0
  89. package/src/components/Collapsible.js +109 -0
  90. package/src/components/ContentSlider.js +205 -0
  91. package/src/components/Dialog.js +368 -0
  92. package/src/components/PersistantCollapsible.js +69 -0
  93. package/src/components/PhotoViewer.js +368 -0
  94. package/src/components/Resize.js +210 -0
  95. package/src/components/ShadowComponent.js +3 -1
  96. package/src/components/ShowMore.js +109 -0
  97. package/src/components/Sortable.js +193 -0
  98. package/src/components/Split.js +192 -0
  99. package/src/components/Table.js +1202 -0
  100. package/src/components/Tabs.js +428 -0
  101. package/src/components/Tags.js +253 -0
  102. package/src/components/Timestamp.js +31 -0
  103. package/src/components/Toast.js +454 -0
  104. package/src/components/Toggle.js +173 -0
  105. package/src/components/tableControls/DeleteRecord.js +29 -0
  106. package/src/components/tableControls/Edit.js +88 -0
  107. package/src/components/tableControls/ExportCSV.js +71 -0
  108. package/src/components/tableControls/ExportJson.js +55 -0
  109. package/src/components/tableControls/FieldSortHide.js +76 -0
  110. package/src/components/tableControls/Filters.js +114 -0
  111. package/src/components/tableControls/FirstPage.js +65 -0
  112. package/src/components/tableControls/HiddenCount.js +45 -0
  113. package/src/components/tableControls/Hide.js +34 -0
  114. package/src/components/tableControls/LastPage.js +65 -0
  115. package/src/components/tableControls/NextPage.js +65 -0
  116. package/src/components/tableControls/PageSelect.js +109 -0
  117. package/src/components/tableControls/PageSize.js +68 -0
  118. package/src/components/tableControls/PrevPage.js +65 -0
  119. package/src/components/tableControls/Search.js +58 -0
  120. package/src/components/tableControls/ShowAll.js +34 -0
  121. package/src/components/tableControls/TableControl.js +105 -0
  122. package/src/utils/debounce.js +9 -0
  123. package/src/utils/drag.js +80 -0
  124. package/src/utils/formatTimestamp.js +27 -0
  125. package/src/utils/toTitleCase.js +9 -0
  126. package/src/utils/watchWindowSize.js +16 -0
  127. package/dist/src/utils/cli.js +0 -1
  128. package/dist/src/utils/fs-utils.js +0 -1
  129. package/docs/components/component.html +0 -90
  130. package/docs/components/directory-viewer.html +0 -90
  131. package/docs/components/lazy-component.html +0 -84
  132. package/docs/components/reactive-component.html +0 -69
  133. package/docs/components/reactive-lazy-component.html +0 -69
  134. package/docs/components/search.html +0 -102
  135. package/docs/components/sortable.html +0 -96
  136. package/src/utils/cli.js +0 -43
  137. package/src/utils/fs-utils.js +0 -41
@@ -1,96 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Sortable - Components - Kempo Docs - A Web Components Solution</title>
7
- <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
- <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
9
- <script type="module">
10
- import Import from '../src/components/Import.js';
11
- import Icon from '../src/components/Icon.js';
12
- Import.replacements.root = '../';
13
- Icon.pathToIcons = ['../icons'];
14
- </script>
15
- </head>
16
- <body>
17
- <k-import src="../nav.inc.html"></k-import>
18
- <h1 class="ta-center">Sortable</h1>
19
- <main>
20
- <details
21
- class="b r mb"
22
- >
23
- <summary class="p">Table of Contents</summary>
24
- <div class="m mt0 pl">
25
- <h6>Examples</h6>
26
- <a href="#basicUsage">Basic Usage</a><br />
27
-
28
- <h6 class="mt">
29
- <a href="#sortable">Sortable JavaScript Reference</a>
30
- </h6>
31
- <a href="#sortableConstructor">Constructor</a><br />
32
- <a href="#sortableRequirements">Requirements</a><br />
33
- <a href="#sortableAttributes">Attributes</a>
34
-
35
- <h6 class="mt">
36
- <a href="#sortableItem">SortableItem JavaScript Reference</a>
37
- </h6>
38
- <a href="#sortableItemConstructor">Constructor</a><br />
39
- <a href="#sortableItemAttributes">Attributes</a>
40
- </div>
41
- </details>
42
-
43
- <h3>Description</h3>
44
- <p>A component that allows the user to sort items in a list.</p>
45
-
46
- <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
47
-
48
- <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-sortable</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">k-sortable-item</span>&gt;</span>Item 1<span class="hljs-tag">&lt;/<span class="hljs-name">k-sortable-item</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">k-sortable-item</span>&gt;</span>Item 2<span class="hljs-tag">&lt;/<span class="hljs-name">k-sortable-item</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">k-sortable-item</span>&gt;</span>Item 3<span class="hljs-tag">&lt;/<span class="hljs-name">k-sortable-item</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">k-sortable-item</span>&gt;</span>Item 4<span class="hljs-tag">&lt;/<span class="hljs-name">k-sortable-item</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">k-sortable-item</span>&gt;</span>Item 5<span class="hljs-tag">&lt;/<span class="hljs-name">k-sortable-item</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-sortable</span>&gt;</span></code></pre>
49
- <k-sortable>
50
- <k-sortable-item>Item 1</k-sortable-item>
51
- <k-sortable-item>Item 2</k-sortable-item>
52
- <k-sortable-item>Item 3</k-sortable-item>
53
- <k-sortable-item>Item 4</k-sortable-item>
54
- <k-sortable-item>Item 5</k-sortable-item>
55
- </k-sortable>
56
-
57
- <br />
58
- <hr />
59
-
60
- <h2 id="sortable">Sortable JavaScript Reference</h2>
61
-
62
- <h3 id="sortableConstructor"><a href="#sortableConstructor" class="no-link">Constructor</a></h3>
63
- <h6>Extends <a href="./component.html">Component</a></h6>
64
- <h5>
65
- <code>new Sortable()</code>
66
- </h5>
67
-
68
- <h3 id="sortableRequirements"><a href="#sortableRequirements" class="no-link">Requirements</a></h3>
69
- <ul>
70
- <li>Sortable items must be direct children of the Sortable component.</li>
71
- </ul>
72
-
73
- <h3 id="sortableAttributes"><a href="#sortableAttributes" class="no-link">Attributes</a></h3>
74
- <h5><code>sorting: boolean</code></h5>
75
- <p>Indicates whether the item is currently being sorted.</p>
76
-
77
-
78
- <br />
79
- <hr />
80
- <h2 id="sortableItem">SortableItem JavaScript Reference</h2>
81
-
82
- <h3 id="sortableItemConstructor"><a href="#sortableItemConstructor" class="no-link">Constructor</a></h3>
83
- <h6>Extends <a href="./component.html">Component</a></h6>
84
- <h5>
85
- <code>new SortableItem()</code>
86
- </h5>
87
-
88
- <h3 id="sortableItemAttributes"><a href="#sortableItemAttributes" class="no-link">Attributes</a></h3>
89
- <h5><code>sorting: boolean</code></h5>
90
- <p>Indicates whether the item is currently being sorted.</p>
91
-
92
- </main>
93
- <script type="module" src="../src/components/Import.js"></script>
94
- <script type="module" src="../src/components/Sortable.js"></script>
95
- </body>
96
- </html>
package/src/utils/cli.js DELETED
@@ -1,43 +0,0 @@
1
- import { spawn } from 'child_process';
2
-
3
- export const getArgs = mapping => {
4
- const args = {};
5
- const argv = process.argv.slice(2);
6
-
7
- for(let i = 0; i < argv.length; i++) {
8
- const arg = argv[i];
9
- if(arg.startsWith('-')) {
10
- const key = arg.replace(/^-+/, '');
11
- const mappedKey = mapping[key] || key;
12
- const nextArg = argv[i + 1];
13
-
14
- if(nextArg && !nextArg.startsWith('-')) {
15
- args[mappedKey] = nextArg;
16
- i++;
17
- } else {
18
- args[mappedKey] = true;
19
- }
20
- }
21
- }
22
-
23
- return args;
24
- };
25
-
26
- export const runChildNodeProcess = scriptPath => {
27
- const child = spawn('node', [scriptPath], {
28
- stdio: 'inherit',
29
- shell: true
30
- });
31
-
32
- return new Promise((resolve, reject) => {
33
- child.on('close', code => {
34
- if(code === 0) {
35
- resolve();
36
- } else {
37
- reject(new Error(`Process exited with code ${code}`));
38
- }
39
- });
40
-
41
- child.on('error', reject);
42
- });
43
- };
@@ -1,41 +0,0 @@
1
- import fs from 'fs/promises';
2
- import path from 'path';
3
-
4
- export const ensureDir = async dirPath => {
5
- try {
6
- await fs.mkdir(dirPath, { recursive: true });
7
- } catch (error) {
8
- if(error.code !== 'EEXIST') {
9
- throw error;
10
- }
11
- }
12
- };
13
-
14
- export const copyDir = async (src, dest) => {
15
- await ensureDir(dest);
16
- const entries = await fs.readdir(src, { withFileTypes: true });
17
-
18
- for(const entry of entries) {
19
- const srcPath = path.join(src, entry.name);
20
- const destPath = path.join(dest, entry.name);
21
-
22
- if(entry.isDirectory()) {
23
- await copyDir(srcPath, destPath);
24
- } else {
25
- await fs.copyFile(srcPath, destPath);
26
- }
27
- }
28
- };
29
-
30
- export const emptyDir = async dirPath => {
31
- try {
32
- const entries = await fs.readdir(dirPath);
33
- await Promise.all(entries.map(entry =>
34
- fs.rm(path.join(dirPath, entry), { recursive: true, force: true })
35
- ));
36
- } catch (error) {
37
- if(error.code !== 'ENOENT') {
38
- throw error;
39
- }
40
- }
41
- };