frutjam 0.0.6 → 0.0.7

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 (33) hide show
  1. package/{src/index.ts → dist/index.d.ts} +4 -4
  2. package/dist/index.js +3 -0
  3. package/dist/index.js.LICENSE.txt +15 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/notification.js +3 -0
  6. package/dist/notification.js.LICENSE.txt +7 -0
  7. package/dist/notification.js.map +1 -0
  8. package/dist/plugins/notification/config.d.ts +2 -0
  9. package/dist/plugins/notification/index.d.ts +16 -0
  10. package/{src/plugins/notification/interfaces.ts → dist/plugins/notification/interfaces.d.ts} +20 -22
  11. package/{src/plugins/notification/types.ts → dist/plugins/notification/types.d.ts} +3 -5
  12. package/dist/plugins/popover/index.d.ts +12 -0
  13. package/dist/plugins/tabs/index.d.ts +15 -0
  14. package/dist/plugins/tabs/types.d.ts +6 -0
  15. package/dist/plugins/telephoneInput/data.d.ts +3 -0
  16. package/dist/plugins/telephoneInput/index.d.ts +12 -0
  17. package/dist/plugins/telephoneInput/interfaces.d.ts +5 -0
  18. package/dist/plugins/telephoneInput/types.d.ts +6 -0
  19. package/dist/tabs.js +3 -0
  20. package/dist/tabs.js.LICENSE.txt +7 -0
  21. package/dist/tabs.js.map +1 -0
  22. package/package.json +24 -7
  23. package/src/plugins/notification/config.ts +0 -14
  24. package/src/plugins/notification/index.ts +0 -124
  25. package/src/plugins/notification/styles.css +0 -9
  26. package/src/plugins/popover/index.ts +0 -45
  27. package/src/plugins/popover/styles.css +0 -12
  28. package/src/plugins/tabs/index.ts +0 -112
  29. package/src/plugins/tabs/types.ts +0 -7
  30. package/src/plugins/telephoneInput/data.ts +0 -1131
  31. package/src/plugins/telephoneInput/index.ts +0 -114
  32. package/src/plugins/telephoneInput/interfaces.ts +0 -6
  33. package/src/plugins/telephoneInput/types.ts +0 -7
@@ -1,112 +0,0 @@
1
-
2
- /*
3
- * Tabs
4
- * @version: 0.0.2
5
- * @author: Nezanuha
6
- * @license: Licensed under MIT
7
- * Copyright 2024 Nezanuha
8
- */
9
-
10
- import { TabOptions } from "./types";
11
-
12
- export default class Tabs {
13
- private tabs: HTMLElement[];
14
- private tabContents: HTMLElement[];
15
- private options: TabOptions;
16
-
17
- constructor(options?: TabOptions) {
18
- this.tabs = Array.from(document.querySelectorAll('.tab'));
19
- this.tabContents = Array.from(document.querySelectorAll('.tab-content'));
20
- this.options = options || {};
21
-
22
- this.init();
23
- this.handleInitialTabState();
24
- }
25
-
26
- private init() {
27
- this.tabs.forEach(tab => {
28
- tab.addEventListener('click', () => this.toggleTab(tab));
29
- });
30
- }
31
-
32
- private toggleTab(selectedTab: HTMLElement) {
33
- const tabId = selectedTab.dataset.tab;
34
-
35
- if (!tabId || selectedTab.classList.contains('disabled')) return;
36
-
37
- this.tabs.forEach(tab => {
38
- tab.classList.remove('active');
39
- });
40
- selectedTab.classList.add('active');
41
-
42
- this.tabContents.forEach(content => {
43
- if (content.id === tabId) {
44
- content.style.display = 'block';
45
- this.animateTab(content);
46
- if (this.options.onTabActive) {
47
- this.options.onTabActive(tabId);
48
- }
49
- } else {
50
- content.style.display = 'none';
51
- }
52
- });
53
- }
54
-
55
- private animateTab(content: HTMLElement) {
56
- // Implement your animation logic here
57
- content.style.opacity = '0';
58
- setTimeout(() => {
59
- content.style.opacity = '1';
60
- }, 300);
61
- }
62
-
63
- private handleInitialTabState() {
64
- if (this.options.disableTabs === 'all') {
65
- this.disableAllTabs();
66
- } else if (Array.isArray(this.options.disableTabs)) {
67
- this.disableTabs(this.options.disableTabs);
68
- } else if (this.options.enableTabs === 'all') {
69
- this.enableAllTabs();
70
- } else if (Array.isArray(this.options.enableTabs)) {
71
- this.enableTabs(this.options.enableTabs);
72
- }
73
- }
74
-
75
- private disableAllTabs() {
76
- this.tabs.forEach(tab => {
77
- tab.classList.add('disabled');
78
- });
79
- }
80
-
81
- private enableAllTabs() {
82
- this.tabs.forEach(tab => {
83
- tab.classList.remove('disabled');
84
- });
85
- }
86
-
87
- enableTabs(tabIds?: string[] | 'all') {
88
- if (tabIds === 'all') {
89
- this.enableAllTabs();
90
- } else if (Array.isArray(tabIds)) {
91
- tabIds.forEach(tabId => {
92
- const tab = this.tabs.find(tab => tab.dataset.tab === tabId);
93
- if (tab) {
94
- tab.classList.remove('disabled');
95
- }
96
- });
97
- }
98
- }
99
-
100
- disableTabs(tabIds?: string[] | 'all') {
101
- if (tabIds === 'all') {
102
- this.disableAllTabs();
103
- } else if (Array.isArray(tabIds)) {
104
- tabIds.forEach(tabId => {
105
- const tab = this.tabs.find(tab => tab.dataset.tab === tabId);
106
- if (tab) {
107
- tab.classList.add('disabled');
108
- }
109
- });
110
- }
111
- }
112
- }
@@ -1,7 +0,0 @@
1
- type TabOptions = {
2
- disableTabs?: string[] | 'all'; // Array of tab IDs to disable or 'all' to disable all tabs
3
- enableTabs?: string[] | 'all'; // Array of tab IDs to enable or 'all' to enable all tabs
4
- onTabActive?: (tabId: string) => void;
5
- };
6
-
7
- export type { TabOptions }