slicejs-cli 2.0.3 → 2.0.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 (128) hide show
  1. package/ProjectTemplate/api/index.js +97 -0
  2. package/ProjectTemplate/src/App/index.html +22 -0
  3. package/ProjectTemplate/src/App/index.js +63 -0
  4. package/ProjectTemplate/src/App/style.css +40 -0
  5. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.css +16 -0
  6. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.html +22 -0
  7. package/ProjectTemplate/src/Components/AppComponents/ButtonDocumentation/ButtonDocumentation.js +102 -0
  8. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.css +15 -0
  9. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.html +38 -0
  10. package/ProjectTemplate/src/Components/AppComponents/CardDocumentation/CardDocumentation.js +113 -0
  11. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.css +21 -0
  12. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.html +35 -0
  13. package/ProjectTemplate/src/Components/AppComponents/CheckboxDocumentation/CheckboxDocumentation.js +103 -0
  14. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.css +14 -0
  15. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.html +3 -0
  16. package/ProjectTemplate/src/Components/AppComponents/CodeVisualizer/CodeVisualizer.js +45 -0
  17. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.css +0 -0
  18. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.html +30 -0
  19. package/ProjectTemplate/src/Components/AppComponents/Documentation/Documentation.js +75 -0
  20. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.css +62 -0
  21. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.html +0 -0
  22. package/ProjectTemplate/src/Components/AppComponents/DocumentationPage/DocumentationPage.js +241 -0
  23. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.css +41 -0
  24. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.html +95 -0
  25. package/ProjectTemplate/src/Components/AppComponents/InputDocumentation/InputDocumentation.js +315 -0
  26. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.css +108 -0
  27. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.html +16 -0
  28. package/ProjectTemplate/src/Components/AppComponents/LandingMenu/LandingMenu.js +33 -0
  29. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.css +14 -0
  30. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.html +0 -0
  31. package/ProjectTemplate/src/Components/AppComponents/LandingPage/LandingPage.js +53 -0
  32. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.css +80 -0
  33. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.html +39 -0
  34. package/ProjectTemplate/src/Components/AppComponents/MainMenu/MainMenu.js +42 -0
  35. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.css +0 -0
  36. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.html +0 -0
  37. package/ProjectTemplate/src/Components/AppComponents/MyLayout/MyLayout.js +13 -0
  38. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.css +49 -0
  39. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.html +1 -0
  40. package/ProjectTemplate/src/Components/AppComponents/MyNavigation/MyNavigation.js +60 -0
  41. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.css +12 -0
  42. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.html +0 -0
  43. package/ProjectTemplate/src/Components/AppComponents/Playground/Playground.js +126 -0
  44. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.css +104 -0
  45. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.html +12 -0
  46. package/ProjectTemplate/src/Components/AppComponents/SliceTeamCard/SliceTeamCard.js +74 -0
  47. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.css +21 -0
  48. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.html +35 -0
  49. package/ProjectTemplate/src/Components/AppComponents/SwitchDocumentation/SwitchDocumentation.js +103 -0
  50. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.css +23 -0
  51. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.html +6 -0
  52. package/ProjectTemplate/src/Components/AppComponents/TheSliceTeam/TheSliceTeam.js +129 -0
  53. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.css +0 -0
  54. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.html +7 -0
  55. package/ProjectTemplate/src/Components/AppComponents/WhatIsSlice/WhatIsSlice.js +15 -0
  56. package/ProjectTemplate/src/Components/Service/FetchManager/FetchManager.js +133 -0
  57. package/ProjectTemplate/src/Components/Service/IndexedDbManager/IndexedDbManager.js +141 -0
  58. package/ProjectTemplate/src/Components/Service/Link/Link.js +26 -0
  59. package/ProjectTemplate/src/Components/Visual/Button/Button.css +47 -0
  60. package/ProjectTemplate/src/Components/Visual/Button/Button.html +5 -0
  61. package/ProjectTemplate/src/Components/Visual/Button/Button.js +70 -0
  62. package/ProjectTemplate/src/Components/Visual/Card/Card.css +68 -0
  63. package/ProjectTemplate/src/Components/Visual/Card/Card.html +7 -0
  64. package/ProjectTemplate/src/Components/Visual/Card/Card.js +107 -0
  65. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.css +87 -0
  66. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.html +8 -0
  67. package/ProjectTemplate/src/Components/Visual/Checkbox/Checkbox.js +86 -0
  68. package/ProjectTemplate/src/Components/Visual/Details/Details.css +70 -0
  69. package/ProjectTemplate/src/Components/Visual/Details/Details.html +9 -0
  70. package/ProjectTemplate/src/Components/Visual/Details/Details.js +76 -0
  71. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.css +60 -0
  72. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.html +5 -0
  73. package/ProjectTemplate/src/Components/Visual/DropDown/DropDown.js +63 -0
  74. package/ProjectTemplate/src/Components/Visual/Grid/Grid.css +7 -0
  75. package/ProjectTemplate/src/Components/Visual/Grid/Grid.html +1 -0
  76. package/ProjectTemplate/src/Components/Visual/Grid/Grid.js +57 -0
  77. package/ProjectTemplate/src/Components/Visual/Icon/Icon.css +510 -0
  78. package/ProjectTemplate/src/Components/Visual/Icon/Icon.html +1 -0
  79. package/ProjectTemplate/src/Components/Visual/Icon/Icon.js +89 -0
  80. package/ProjectTemplate/src/Components/Visual/Icon/slc.eot +0 -0
  81. package/ProjectTemplate/src/Components/Visual/Icon/slc.json +555 -0
  82. package/ProjectTemplate/src/Components/Visual/Icon/slc.styl +507 -0
  83. package/ProjectTemplate/src/Components/Visual/Icon/slc.svg +1485 -0
  84. package/ProjectTemplate/src/Components/Visual/Icon/slc.symbol.svg +1059 -0
  85. package/ProjectTemplate/src/Components/Visual/Icon/slc.ttf +0 -0
  86. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff +0 -0
  87. package/ProjectTemplate/src/Components/Visual/Icon/slc.woff2 +0 -0
  88. package/ProjectTemplate/src/Components/Visual/Input/Input.css +91 -0
  89. package/ProjectTemplate/src/Components/Visual/Input/Input.html +4 -0
  90. package/ProjectTemplate/src/Components/Visual/Input/Input.js +215 -0
  91. package/ProjectTemplate/src/Components/Visual/Layout/Layout.css +0 -0
  92. package/ProjectTemplate/src/Components/Visual/Layout/Layout.html +0 -0
  93. package/ProjectTemplate/src/Components/Visual/Layout/Layout.js +49 -0
  94. package/ProjectTemplate/src/Components/Visual/Loading/Loading.css +56 -0
  95. package/ProjectTemplate/src/Components/Visual/Loading/Loading.html +83 -0
  96. package/ProjectTemplate/src/Components/Visual/Loading/Loading.js +38 -0
  97. package/ProjectTemplate/src/Components/Visual/MultiRoute/MultiRoute.js +93 -0
  98. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.css +115 -0
  99. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.html +44 -0
  100. package/ProjectTemplate/src/Components/Visual/Navbar/Navbar.js +141 -0
  101. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.css +117 -0
  102. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.html +24 -0
  103. package/ProjectTemplate/src/Components/Visual/NotFound/NotFound.js +16 -0
  104. package/ProjectTemplate/src/Components/Visual/Route/Route.js +93 -0
  105. package/ProjectTemplate/src/Components/Visual/Select/Select.css +84 -0
  106. package/ProjectTemplate/src/Components/Visual/Select/Select.html +8 -0
  107. package/ProjectTemplate/src/Components/Visual/Select/Select.js +195 -0
  108. package/ProjectTemplate/src/Components/Visual/Switch/Switch.css +76 -0
  109. package/ProjectTemplate/src/Components/Visual/Switch/Switch.html +8 -0
  110. package/ProjectTemplate/src/Components/Visual/Switch/Switch.js +102 -0
  111. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.css +36 -0
  112. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.html +1 -0
  113. package/ProjectTemplate/src/Components/Visual/TreeItem/TreeItem.js +126 -0
  114. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.css +8 -0
  115. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.html +1 -0
  116. package/ProjectTemplate/src/Components/Visual/TreeView/TreeView.js +48 -0
  117. package/ProjectTemplate/src/Components/components.js +42 -0
  118. package/ProjectTemplate/src/Styles/sliceStyles.css +34 -0
  119. package/ProjectTemplate/src/Themes/Dark.css +42 -0
  120. package/ProjectTemplate/src/Themes/Light.css +31 -0
  121. package/ProjectTemplate/src/Themes/Slice.css +47 -0
  122. package/ProjectTemplate/src/images/Slice.js-logo.png +0 -0
  123. package/ProjectTemplate/src/images/favicon.ico +0 -0
  124. package/ProjectTemplate/src/images/im2/Slice.js-logo.png +0 -0
  125. package/ProjectTemplate/src/routes.js +36 -0
  126. package/ProjectTemplate/src/sliceConfig.json +58 -0
  127. package/package.json +2 -2
  128. package/post.js +5 -2
@@ -0,0 +1,13 @@
1
+ export default class MyLayout extends HTMLElement {
2
+ constructor(props) {
3
+ super();
4
+ slice.attachTemplate(this);
5
+
6
+ slice.controller.setComponentProps(this, props);
7
+ this.debuggerProps = [];
8
+ }
9
+
10
+ init() {}
11
+ }
12
+
13
+ customElements.define('slice-mylayout', MyLayout);
@@ -0,0 +1,49 @@
1
+ slice-mynavigation {
2
+ position: fixed;
3
+ top: 0;
4
+ right: 0;
5
+ font-family: var(--font-family);
6
+ background-color: var(--primary-background-color);
7
+ border-left: 1px solid var(--primary-color-shade);
8
+ display: flex;
9
+ align-items: flex-start;
10
+ height: 100%;
11
+ width: 17%;
12
+ transition: transform 0.3s ease, width 0.3s ease;
13
+ overflow-x: hidden;
14
+ }
15
+ .my_navigation {
16
+ display: flex;
17
+ flex-direction: column;
18
+ margin-top: 80px;
19
+ }
20
+ .my_navigation a {
21
+ padding: 10px;
22
+ }
23
+
24
+ @media only screen and (max-width: 770px) {
25
+ slice-mynavigation {
26
+ visibility: hidden;
27
+ }
28
+ }
29
+ a[class^="nav-"] {
30
+ text-decoration: none;
31
+ color: var(--font-primary-color);
32
+ }
33
+ a[class^="nav-"]:hover{
34
+ color: var(--primary-color);
35
+ }
36
+ a[class$="1"] {
37
+ font-weight: 700;
38
+ margin-left: 0%;
39
+ }
40
+ a[class$="2"] {
41
+ margin-left: 5%;
42
+ }
43
+ a[class$="3"] {
44
+ margin-left: 10%;
45
+ }
46
+ a[class$="4"] {
47
+ margin-left: 15%;
48
+ }
49
+
@@ -0,0 +1 @@
1
+ <div class="my_navigation"></div>
@@ -0,0 +1,60 @@
1
+ export default class MyNavigation extends HTMLElement {
2
+ constructor(props) {
3
+ super();
4
+ slice.attachTemplate(this);
5
+
6
+ this.$navigation = this.querySelector('.my_navigation');
7
+
8
+ slice.controller.setComponentProps(this, props);
9
+ this.debuggerProps = ['page'];
10
+ }
11
+
12
+ set page(value) {
13
+ this._page = value;
14
+ this.updateNavigation();
15
+ }
16
+
17
+ get page() {
18
+ return this._page;
19
+ }
20
+
21
+ init() {
22
+ if (this.page) {
23
+ this.updateNavigation();
24
+ }
25
+ }
26
+
27
+ updateNavigation() {
28
+ this.$navigation.innerHTML = '';
29
+ const idElements = this.page.querySelectorAll('[id]');
30
+
31
+ idElements.forEach((element) => {
32
+ const a = document.createElement('a');
33
+ a.textContent = element.innerHTML;
34
+
35
+ // Obtener la jerarquía del elemento, por ejemplo 'h1', 'h2', etc.
36
+ const tagName = element.tagName.toLowerCase();
37
+
38
+ // Iterar desde h1 hasta h6 para aplicar clases basadas en la jerarquía
39
+ for (let i = 1; i <= 6; i++) {
40
+ if (tagName === `h${i}`) {
41
+ a.classList.add(`nav-h${i}`);
42
+ break; // Si ya encontró la coincidencia, no sigue iterando
43
+ }
44
+ }
45
+
46
+ if (element.id) {
47
+ a.href = `#${element.id}`;
48
+ a.addEventListener('click', (event) => {
49
+ event.preventDefault();
50
+ document.getElementById(element.id).scrollIntoView({ behavior: 'smooth', block: 'center' });
51
+ });
52
+ } else {
53
+ a.href = ``;
54
+ }
55
+ this.$navigation.appendChild(a);
56
+ });
57
+ }
58
+ }
59
+
60
+ customElements.define('slice-mynavigation', MyNavigation);
@@ -0,0 +1,12 @@
1
+ .indexGrid {
2
+ display: grid;
3
+ grid-template-columns: repeat(3, 1fr);
4
+ grid-template-rows: repeat(1, 1fr);
5
+ gap: 10px;
6
+ margin: 0 auto;
7
+ }
8
+ .indexGridItem {
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ }
@@ -0,0 +1,126 @@
1
+ export default class Playground extends HTMLElement {
2
+ constructor(props) {
3
+ super();
4
+ slice.attachTemplate(this);
5
+
6
+ slice.controller.setComponentProps(this, props);
7
+ this.debuggerProps = [];
8
+ }
9
+
10
+ async init() {
11
+ let theme = slice.stylesManager.themeManager.currentTheme;
12
+
13
+ const navBar = await slice.build('Navbar', {
14
+ // position: "fixed",
15
+ logo: {
16
+ src: '../../images/Slice.js-logo.png',
17
+ path: '/',
18
+ },
19
+ items: [
20
+ {
21
+ text: 'Home',
22
+ path: '/',
23
+ },
24
+ {
25
+ text: 'Documentation',
26
+ path: '/Documentation',
27
+ },
28
+ {
29
+ text: 'Playground',
30
+ path: '/Playground',
31
+ },
32
+ {
33
+ text: 'Our Team',
34
+ path: '/Team',
35
+ }
36
+ ],
37
+ buttons: [
38
+ {
39
+ value: 'Change Theme',
40
+ // color:
41
+ onClickCallback: async () => {
42
+ if (theme === 'Slice') {
43
+ await slice.setTheme('Light');
44
+ theme = 'Light';
45
+ } else if (theme === 'Light') {
46
+ await slice.setTheme('Dark');
47
+ theme = 'Dark';
48
+ } else if (theme === 'Dark') {
49
+ await slice.setTheme('Slice');
50
+ theme = 'Slice';
51
+ }
52
+ },
53
+ },
54
+ ],
55
+ });
56
+
57
+ this.appendChild(navBar);
58
+
59
+ const sliceButton = await slice.build('Button', {
60
+ value: 'Slice',
61
+ onClickCallback: () => {
62
+ if (slice.translator.currentLanguage == 'es') {
63
+ slice.translator.changeLanguage('en');
64
+ } else {
65
+ slice.translator.changeLanguage('es');
66
+ }
67
+ },
68
+ });
69
+ const sliceInput = await slice.build('Input', {
70
+ placeholder: 'Enter text here...',
71
+ });
72
+ const checkbox = await slice.build('Checkbox', {
73
+ label: 'Check',
74
+ position: 'top',
75
+ });
76
+
77
+ const sliceSwitch = await slice.build('Switch', {
78
+ label: 'Switch',
79
+ labelPlacement: 'left',
80
+ });
81
+ const select = await slice.build('Select', {
82
+ options: [
83
+ { value: 'Hola', id: 0 },
84
+ { value: 'Hello', id: 1 },
85
+ { value: 'Hallo', id: 2 },
86
+ { value: 'Hi', id: 3 },
87
+ { value: 'Hola', id: 4 },
88
+ { value: 'Hello', id: 5 },
89
+ { value: 'Hallo', id: 6 },
90
+ { value: 'Hi', id: 7 },
91
+ ],
92
+ visibleProp: 'id',
93
+ label: 'Elige una opcion',
94
+ multiple: true,
95
+ });
96
+ const sliceCard = await slice.build('Card', {
97
+ sliceId: 'prueba',
98
+ });
99
+ const details = await slice.build('Details', {
100
+ title: 'Slice',
101
+ text: 'Slice details text',
102
+ });
103
+
104
+ const grid = document.createElement('div');
105
+ grid.classList.add('indexGrid');
106
+
107
+ sliceButton.classList.add('indexGridItem');
108
+ sliceInput.classList.add('indexGridItem');
109
+ sliceSwitch.classList.add('indexGridItem');
110
+ select.classList.add('indexGridItem');
111
+ checkbox.classList.add('indexGridItem');
112
+ details.classList.add('indexGridItem');
113
+
114
+ grid.appendChild(sliceButton);
115
+ grid.appendChild(sliceInput);
116
+ grid.appendChild(sliceSwitch);
117
+ grid.appendChild(select);
118
+ grid.appendChild(checkbox);
119
+ grid.appendChild(sliceCard);
120
+ grid.appendChild(details);
121
+
122
+ this.appendChild(grid);
123
+ }
124
+ }
125
+
126
+ customElements.define('slice-playground', Playground);
@@ -0,0 +1,104 @@
1
+ slice-team-card {
2
+ display: block;
3
+ width: 100%;
4
+ max-width: 800px;
5
+ margin: 20px auto;
6
+ font-family: var(--font-family);
7
+ }
8
+
9
+ .slice_team_card {
10
+ display: flex;
11
+ align-items: center;
12
+ padding: 20px;
13
+ background: var(--primary-background-color);
14
+ border: 1px solid var(--medium-color);
15
+ border-radius: 12px;
16
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
17
+ transition: transform 0.3s ease-in-out;
18
+ width: 100%;
19
+ }
20
+
21
+ .slice_team_card:hover {
22
+ transform: scale(1.02);
23
+ }
24
+
25
+ /* Imagen circular */
26
+ .team_card_image {
27
+ flex: 0 0 120px;
28
+ height: 120px;
29
+ border-radius: 50%;
30
+ overflow: hidden;
31
+ margin-right: 20px;
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ background: var(--light-gray);
36
+ }
37
+
38
+ .team_card_image img {
39
+ width: 100%;
40
+ height: 100%;
41
+ object-fit: cover;
42
+ border-radius: 50%;
43
+ }
44
+
45
+ /* Contenido de la tarjeta */
46
+ .team_card_content {
47
+ flex: 1;
48
+ }
49
+
50
+ .team_card_name {
51
+ margin: 0;
52
+ font-size: 1.5rem;
53
+ font-weight: bold;
54
+ color: var(--font-primary-color);
55
+ }
56
+
57
+ .team_card_role {
58
+ margin: 5px 0;
59
+ font-size: 1rem;
60
+ color: var(--medium-contrast);
61
+ }
62
+
63
+ .team_card_description {
64
+ font-size: 0.9rem;
65
+ color: var(--medium-contrast);
66
+ margin-top: 5px;
67
+ }
68
+
69
+ /* Links */
70
+ .team_card_links {
71
+ margin-top: 10px;
72
+ display: flex;
73
+ gap: 10px;
74
+ }
75
+
76
+ .team_card_links a {
77
+ display: inline-flex;
78
+ align-items: center;
79
+ justify-content: center;
80
+ padding: 8px 12px;
81
+ background: var(--primary-color);
82
+ color: var(--primary-color-contrast);
83
+ border-radius: 8px;
84
+ text-decoration: none;
85
+ transition: background 0.3s;
86
+ font-weight: bold;
87
+ }
88
+
89
+ .team_card_links a:hover {
90
+ background: var(--secondary-color);
91
+ }
92
+
93
+ /* Responsive */
94
+ @media (max-width: 600px) {
95
+ .slice_team_card {
96
+ flex-direction: column;
97
+ text-align: center;
98
+ }
99
+
100
+ .team_card_image {
101
+ margin-bottom: 15px;
102
+ margin-right: 0;
103
+ }
104
+ }
@@ -0,0 +1,12 @@
1
+ <div class="slice_team_card">
2
+ <div class="team_card_image">
3
+ <img src="" alt="Profile Image">
4
+ </div>
5
+ <div class="team_card_content">
6
+ <h3 class="team_card_name"></h3>
7
+ <p class="team_card_role"></p>
8
+ <p class="team_card_description"></p>
9
+ <div class="team_card_links"></div>
10
+ </div>
11
+ </div>
12
+
@@ -0,0 +1,74 @@
1
+ export default class SliceTeamCard extends HTMLElement {
2
+ constructor(props) {
3
+ super();
4
+ slice.attachTemplate(this);
5
+
6
+ this.$imageContainer = this.querySelector('.team_card_image img');
7
+ this.$name = this.querySelector('.team_card_name');
8
+ this.$role = this.querySelector('.team_card_role');
9
+ this.$description = this.querySelector('.team_card_description');
10
+ this.$links = this.querySelector('.team_card_links');
11
+
12
+ slice.controller.setComponentProps(this, props);
13
+ this.debuggerProps = ['name', 'role', 'image', 'description', 'links'];
14
+ }
15
+
16
+ get name() {
17
+ return this._name;
18
+ }
19
+
20
+ set name(value) {
21
+ this._name = value;
22
+ if (this.$name) this.$name.textContent = value;
23
+ }
24
+
25
+ get role() {
26
+ return this._role;
27
+ }
28
+
29
+ set role(value) {
30
+ this._role = value;
31
+ if (this.$role) this.$role.textContent = value;
32
+ }
33
+
34
+ get image() {
35
+ return this._image;
36
+ }
37
+
38
+ set image(value) {
39
+ this._image = value;
40
+ if (this.$imageContainer) {
41
+ this.$imageContainer.src = value;
42
+ this.$imageContainer.alt = value ? `${this._name} profile picture` : 'Profile image';
43
+ }
44
+ }
45
+
46
+ get description() {
47
+ return this._description;
48
+ }
49
+
50
+ set description(value) {
51
+ this._description = value;
52
+ if (this.$description) this.$description.textContent = value;
53
+ }
54
+
55
+ get links() {
56
+ return this._links;
57
+ }
58
+
59
+ set links(values) {
60
+ this._links = values;
61
+ if (this.$links) {
62
+ this.$links.innerHTML = ''; // Limpiar enlaces previos
63
+ values.forEach(link => {
64
+ const a = document.createElement('a');
65
+ a.href = link.href;
66
+ a.textContent = link.label;
67
+ a.target = '_blank';
68
+ this.$links.appendChild(a);
69
+ });
70
+ }
71
+ }
72
+ }
73
+
74
+ window.customElements.define('slice-team-card', SliceTeamCard);
@@ -0,0 +1,21 @@
1
+ .switchs {
2
+ width: 100%;
3
+ display: flex;
4
+ flex-direction: row;
5
+ justify-content: center;
6
+ align-items: center;
7
+ }
8
+ .labelSwitch {
9
+ display: grid;
10
+ align-items: end;
11
+ grid-template-columns: repeat(2, 1fr);
12
+ grid-template-rows: repeat(1, 1fr);
13
+ gap: 10px;
14
+ margin: 0 auto;
15
+ }
16
+
17
+ @media only screen and (max-width: 770px) {
18
+ .labelSwitch {
19
+ grid-template-columns: repeat(1, 1fr);
20
+ }
21
+ }
@@ -0,0 +1,35 @@
1
+ <h1 id="sliceSwitch">Slice Switch</h1>
2
+ <div class="mySwitch">
3
+ <p>This is a Slice Switch.</p>
4
+ </div>
5
+ <div class="colorSwitch">
6
+ <h2 id="customColor">Custom color</h2>
7
+ <p>
8
+ You cand customize your Slice Switch by changing it's color with the color
9
+ prop
10
+ </p>
11
+ </div>
12
+ <h1 id="label">Label</h1>
13
+ <div class="label">
14
+ <p>You can set a label to your switch.</p>
15
+ </div>
16
+ <h2 id="labelPlacement">Label Placement</h2>
17
+ <p>You can also set in wich position to put the label to.</p>
18
+ <div class="labelSwitch">
19
+ <div class="labelLeft">
20
+ <h2>Left</h2>
21
+ <p>This label is positioned at left.</p>
22
+ </div>
23
+ <div class="labelTop">
24
+ <h2>Top</h2>
25
+ <p>This label is positioned at top.</p>
26
+ </div>
27
+ <div class="labelRight">
28
+ <h2>Right (default)</h2>
29
+ <p>This label is positioned at right.</p>
30
+ </div>
31
+ <div class="labelBottom">
32
+ <h2>Bottom</h2>
33
+ <p>This label is positioned at bottom.</p>
34
+ </div>
35
+ </div>
@@ -0,0 +1,103 @@
1
+ export default class SwitchDocumentation extends HTMLElement {
2
+ constructor(props) {
3
+ super();
4
+ slice.attachTemplate(this);
5
+
6
+ slice.controller.setComponentProps(this, props);
7
+ this.debuggerProps = [];
8
+ }
9
+
10
+ async init() {
11
+ await this.createSwitch(this.querySelector('.mySwitch'), {}, `{}`);
12
+ await this.createSwitch(
13
+ this.querySelector('.colorSwitch'),
14
+ { customColor: 'gold' },
15
+ `{
16
+ customColor: "gold"
17
+ }`
18
+ );
19
+ await this.createSwitch(
20
+ this.querySelector('.label'),
21
+ {
22
+ label: 'Switch',
23
+ },
24
+ `{
25
+ label: "Switch",
26
+ }`
27
+ );
28
+ await this.createSwitch(
29
+ this.querySelector('.labelLeft'),
30
+ {
31
+ label: 'Left',
32
+ labelPlacement: 'left',
33
+ },
34
+ `{
35
+ label: "Left",
36
+ labelPlacement: "left",
37
+ }`
38
+ );
39
+ await this.createSwitch(
40
+ this.querySelector('.labelTop'),
41
+ {
42
+ label: 'Top',
43
+ labelPlacement: 'top',
44
+ },
45
+ `{
46
+ label: "Top",
47
+ labelPlacement: "top",
48
+ }`
49
+ );
50
+ await this.createSwitch(
51
+ this.querySelector('.labelRight'),
52
+ {
53
+ label: 'Right',
54
+ labelPlacement: 'right',
55
+ },
56
+ `{
57
+ label: "Right",
58
+ labelPlacement: "right",
59
+ }`
60
+ );
61
+ await this.createSwitch(
62
+ this.querySelector('.labelBottom'),
63
+ {
64
+ label: 'Bottom',
65
+ labelPlacement: 'bottom',
66
+ },
67
+ `{
68
+ label: "Bottom",
69
+ labelPlacement: "bottom",
70
+ }`
71
+ );
72
+ }
73
+
74
+ async createSwitch(appendTo, switchProps, codeProps) {
75
+ if (!codeProps) {
76
+ codeProps = '{}';
77
+ }
78
+ const mySwitch = await slice.build('Switch', switchProps);
79
+
80
+ const componentCode = await slice.build('CodeVisualizer', {
81
+ value: `const mySwitch = await slice.build("Switch", ${codeProps});
82
+
83
+ `,
84
+ language: 'javascript',
85
+ });
86
+
87
+ const div = document.createElement('div');
88
+ const switchDiv = document.createElement('div');
89
+ switchDiv.classList.add('switchs');
90
+ switchDiv.appendChild(mySwitch);
91
+ div.classList.add('switchs_container');
92
+ div.appendChild(switchDiv);
93
+ div.appendChild(componentCode);
94
+
95
+ if (appendTo) {
96
+ appendTo.appendChild(div);
97
+ }
98
+
99
+ return div;
100
+ }
101
+ }
102
+
103
+ customElements.define('slice-switchdocumentation', SwitchDocumentation);
@@ -0,0 +1,23 @@
1
+ .slice_team {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ padding: 2rem;
6
+ margin-top: 80px; /* Ajusta este valor según la altura de tu navbar */
7
+ width: 100%;
8
+ }
9
+
10
+ .slice_team_title {
11
+ font-size: 2rem;
12
+ color: var(--font-primary-color);
13
+ margin-bottom: 1rem;
14
+ text-align: center;
15
+ }
16
+
17
+ .slice_team_container {
18
+ display: flex;
19
+ flex-direction: column; /* Cambiado para que estén en columna */
20
+ align-items: center; /* Centrar las tarjetas */
21
+ gap: 1.5rem;
22
+ width: 100%;
23
+ }
@@ -0,0 +1,6 @@
1
+ <div class="slice_team">
2
+ <h2 class="slice_team_title">Our Team</h2>
3
+ <div class="slice_team_container"></div>
4
+ </div>
5
+
6
+