@rkosafo/cai.components 0.0.1 → 0.0.3
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.
- package/dist/baseEditor/index.svelte +32 -0
- package/dist/baseEditor/index.svelte.d.ts +18 -0
- package/dist/builders/filters/FilterBuilder.svelte +638 -0
- package/dist/builders/filters/FilterBuilder.svelte.d.ts +4 -0
- package/dist/builders/filters/index.d.ts +1 -0
- package/dist/builders/filters/index.js +1 -0
- package/dist/forms/FormCheckbox/FormCheckbox.svelte +53 -0
- package/dist/forms/FormCheckbox/FormCheckbox.svelte.d.ts +4 -0
- package/dist/forms/FormCheckbox/index.d.ts +1 -0
- package/dist/forms/FormCheckbox/index.js +1 -0
- package/dist/forms/FormDatepicker/FormDatepicker.svelte +159 -0
- package/dist/forms/FormDatepicker/FormDatepicker.svelte.d.ts +13 -0
- package/dist/forms/FormDatepicker/index.d.ts +1 -0
- package/dist/forms/FormDatepicker/index.js +1 -0
- package/dist/forms/FormInput/FormInput.svelte +87 -0
- package/dist/forms/FormInput/FormInput.svelte.d.ts +4 -0
- package/dist/forms/FormInput/index.d.ts +1 -0
- package/dist/forms/FormInput/index.js +1 -0
- package/dist/forms/FormRadio/FormRadio.svelte +53 -0
- package/dist/forms/FormRadio/FormRadio.svelte.d.ts +4 -0
- package/dist/forms/FormRadio/index.d.ts +1 -0
- package/dist/forms/FormRadio/index.js +1 -0
- package/dist/forms/FormSelect/FormSelect.svelte +86 -0
- package/dist/forms/FormSelect/FormSelect.svelte.d.ts +4 -0
- package/dist/forms/FormSelect/index.d.ts +1 -0
- package/dist/forms/FormSelect/index.js +1 -0
- package/dist/forms/FormTextarea/FormTextarea.svelte +77 -0
- package/dist/forms/FormTextarea/FormTextarea.svelte.d.ts +4 -0
- package/dist/forms/FormTextarea/index.d.ts +1 -0
- package/dist/forms/FormTextarea/index.js +1 -0
- package/dist/forms/checkbox/Checkbox.svelte +82 -0
- package/dist/forms/checkbox/Checkbox.svelte.d.ts +4 -0
- package/dist/forms/checkbox/CheckboxButton.svelte +92 -0
- package/dist/forms/checkbox/CheckboxButton.svelte.d.ts +18 -0
- package/dist/forms/checkbox/index.d.ts +3 -0
- package/dist/forms/checkbox/index.js +3 -0
- package/dist/forms/checkbox/theme.d.ts +317 -0
- package/dist/forms/checkbox/theme.js +113 -0
- package/dist/forms/datepicker/Datepicker.svelte +706 -0
- package/dist/forms/datepicker/Datepicker.svelte.d.ts +41 -0
- package/dist/forms/datepicker/index.d.ts +2 -0
- package/dist/forms/datepicker/index.js +2 -0
- package/dist/forms/datepicker/theme.d.ts +385 -0
- package/dist/forms/datepicker/theme.js +56 -0
- package/dist/forms/form/Form.svelte +69 -0
- package/dist/forms/form/Form.svelte.d.ts +6 -0
- package/dist/forms/form/index.d.ts +2 -0
- package/dist/forms/form/index.js +2 -0
- package/dist/forms/input/Input.svelte +363 -0
- package/dist/forms/input/Input.svelte.d.ts +4 -0
- package/dist/forms/input/index.d.ts +4 -0
- package/dist/forms/input/index.js +5 -0
- package/dist/forms/input/theme.d.ts +301 -0
- package/dist/forms/input/theme.js +100 -0
- package/dist/forms/label/Label.svelte +38 -0
- package/dist/forms/label/Label.svelte.d.ts +15 -0
- package/dist/forms/label/index.d.ts +2 -0
- package/dist/forms/label/index.js +2 -0
- package/dist/forms/label/theme.d.ts +75 -0
- package/dist/forms/label/theme.js +29 -0
- package/dist/forms/radio/Radio.svelte +48 -0
- package/dist/forms/radio/Radio.svelte.d.ts +25 -0
- package/dist/forms/radio/RadioButton.svelte +22 -0
- package/dist/forms/radio/RadioButton.svelte.d.ts +25 -0
- package/dist/forms/radio/index.d.ts +3 -0
- package/dist/forms/radio/index.js +3 -0
- package/dist/forms/radio/theme.d.ts +290 -0
- package/dist/forms/radio/theme.js +95 -0
- package/dist/forms/select/Select.svelte +50 -0
- package/dist/forms/select/Select.svelte.d.ts +4 -0
- package/dist/forms/select/index.d.ts +1 -0
- package/dist/forms/select/index.js +1 -0
- package/dist/forms/textarea/Textarea.svelte +165 -0
- package/dist/forms/textarea/Textarea.svelte.d.ts +4 -0
- package/dist/forms/textarea/index.d.ts +2 -0
- package/dist/forms/textarea/index.js +2 -0
- package/dist/forms/textarea/theme.d.ts +100 -0
- package/dist/forms/textarea/theme.js +35 -0
- package/dist/index.d.ts +42 -2
- package/dist/index.js +42 -2
- package/dist/layout/TF/Content/Content.svelte +28 -0
- package/dist/layout/TF/Content/Content.svelte.d.ts +8 -0
- package/dist/layout/TF/Content/index.d.ts +1 -0
- package/dist/layout/TF/Content/index.js +1 -0
- package/dist/layout/TF/Header/Header.svelte +159 -0
- package/dist/layout/TF/Header/Header.svelte.d.ts +21 -0
- package/dist/layout/TF/Header/index.d.ts +1 -0
- package/dist/layout/TF/Header/index.js +1 -0
- package/dist/layout/TF/Sidebar/Sidebar.svelte +74 -0
- package/dist/layout/TF/Sidebar/Sidebar.svelte.d.ts +23 -0
- package/dist/layout/TF/Sidebar/index.d.ts +1 -0
- package/dist/layout/TF/Sidebar/index.js +1 -0
- package/dist/layout/TF/Wrapper/Wrapper.svelte +17 -0
- package/dist/layout/TF/Wrapper/Wrapper.svelte.d.ts +8 -0
- package/dist/layout/TF/Wrapper/index.d.ts +1 -0
- package/dist/layout/TF/Wrapper/index.js +1 -0
- package/dist/layout/TF/index.d.ts +5 -0
- package/dist/layout/TF/index.js +5 -0
- package/dist/themes/ThemeProvider.svelte +20 -0
- package/dist/themes/ThemeProvider.svelte.d.ts +9 -0
- package/dist/themes/index.d.ts +7 -0
- package/dist/themes/index.js +1 -0
- package/dist/themes/themeUtils.d.ts +24 -0
- package/dist/themes/themeUtils.js +74 -0
- package/dist/themes/themes.d.ts +18 -0
- package/dist/themes/themes.js +18 -0
- package/dist/types/index.d.ts +755 -0
- package/dist/types/index.js +1 -0
- package/dist/typography/heading/Heading.svelte +35 -0
- package/dist/typography/heading/Heading.svelte.d.ts +10 -0
- package/dist/typography/heading/index.d.ts +2 -0
- package/dist/typography/heading/index.js +2 -0
- package/dist/typography/heading/theme.d.ts +30 -0
- package/dist/typography/heading/theme.js +17 -0
- package/dist/ui/accordion/Accordion.svelte +49 -0
- package/dist/ui/accordion/Accordion.svelte.d.ts +4 -0
- package/dist/ui/accordion/AccordionItem.svelte +173 -0
- package/dist/ui/accordion/AccordionItem.svelte.d.ts +4 -0
- package/dist/ui/accordion/index.d.ts +3 -0
- package/dist/ui/accordion/index.js +3 -0
- package/dist/ui/accordion/theme.d.ts +96 -0
- package/dist/ui/accordion/theme.js +59 -0
- package/dist/ui/alert/Alert.svelte +83 -0
- package/dist/ui/alert/Alert.svelte.d.ts +5 -0
- package/dist/ui/alert/index.d.ts +2 -0
- package/dist/ui/alert/index.js +2 -0
- package/dist/ui/alert/theme.d.ts +108 -0
- package/dist/ui/alert/theme.js +149 -0
- package/dist/ui/alertDialog/AlertDialog.svelte +40 -0
- package/dist/ui/alertDialog/AlertDialog.svelte.d.ts +4 -0
- package/dist/ui/alertDialog/index.d.ts +1 -0
- package/dist/ui/alertDialog/index.js +1 -0
- package/dist/ui/avatar/Avatar.svelte +77 -0
- package/dist/ui/avatar/Avatar.svelte.d.ts +4 -0
- package/dist/ui/avatar/index.d.ts +2 -0
- package/dist/ui/avatar/index.js +2 -0
- package/dist/ui/avatar/theme.d.ts +63 -0
- package/dist/ui/avatar/theme.js +31 -0
- package/dist/ui/buttons/Button.svelte +102 -0
- package/dist/ui/buttons/Button.svelte.d.ts +4 -0
- package/dist/ui/buttons/GradientButton.svelte +59 -0
- package/dist/ui/buttons/GradientButton.svelte.d.ts +4 -0
- package/dist/ui/buttons/index.d.ts +3 -0
- package/dist/ui/buttons/index.js +3 -0
- package/dist/ui/buttons/theme.d.ts +704 -0
- package/dist/ui/buttons/theme.js +332 -0
- package/dist/ui/datatable/Datatable.svelte +516 -0
- package/dist/ui/datatable/Datatable.svelte.d.ts +5 -0
- package/dist/ui/datatable/index.d.ts +2 -0
- package/dist/ui/datatable/index.js +2 -0
- package/dist/ui/drawer/Drawer.svelte +280 -0
- package/dist/ui/drawer/Drawer.svelte.d.ts +37 -0
- package/dist/ui/drawer/index.d.ts +2 -0
- package/dist/ui/drawer/index.js +2 -0
- package/dist/ui/drawer/theme.d.ts +211 -0
- package/dist/ui/drawer/theme.js +46 -0
- package/dist/ui/dropdown/Dropdown.svelte +36 -0
- package/dist/ui/dropdown/Dropdown.svelte.d.ts +4 -0
- package/dist/ui/dropdown/DropdownDivider.svelte +11 -0
- package/dist/ui/dropdown/DropdownDivider.svelte.d.ts +4 -0
- package/dist/ui/dropdown/DropdownGroup.svelte +14 -0
- package/dist/ui/dropdown/DropdownGroup.svelte.d.ts +4 -0
- package/dist/ui/dropdown/DropdownHeader.svelte +14 -0
- package/dist/ui/dropdown/DropdownHeader.svelte.d.ts +4 -0
- package/dist/ui/dropdown/DropdownItem.svelte +52 -0
- package/dist/ui/dropdown/DropdownItem.svelte.d.ts +4 -0
- package/dist/ui/dropdown/index.d.ts +6 -0
- package/dist/ui/dropdown/index.js +6 -0
- package/dist/ui/dropdown/theme.d.ts +55 -0
- package/dist/ui/dropdown/theme.js +20 -0
- package/dist/ui/footer/Footer.svelte +15 -0
- package/dist/ui/footer/Footer.svelte.d.ts +4 -0
- package/dist/ui/footer/FooterBrand.svelte +37 -0
- package/dist/ui/footer/FooterBrand.svelte.d.ts +4 -0
- package/dist/ui/footer/FooterCopyright.svelte +45 -0
- package/dist/ui/footer/FooterCopyright.svelte.d.ts +4 -0
- package/dist/ui/footer/FooterIcon.svelte +22 -0
- package/dist/ui/footer/FooterIcon.svelte.d.ts +4 -0
- package/dist/ui/footer/FooterLink.svelte +33 -0
- package/dist/ui/footer/FooterLink.svelte.d.ts +4 -0
- package/dist/ui/footer/FooterLinkGroup.svelte +13 -0
- package/dist/ui/footer/FooterLinkGroup.svelte.d.ts +4 -0
- package/dist/ui/footer/index.d.ts +7 -0
- package/dist/ui/footer/index.js +7 -0
- package/dist/ui/footer/theme.d.ts +137 -0
- package/dist/ui/footer/theme.js +39 -0
- package/dist/ui/indicator/Indicator.svelte +42 -0
- package/dist/ui/indicator/Indicator.svelte.d.ts +4 -0
- package/dist/ui/indicator/index.d.ts +2 -0
- package/dist/ui/indicator/index.js +2 -0
- package/dist/ui/indicator/theme.d.ts +177 -0
- package/dist/ui/indicator/theme.js +114 -0
- package/dist/ui/modal/Modal.svelte +265 -0
- package/dist/ui/modal/Modal.svelte.d.ts +38 -0
- package/dist/ui/modal/index.d.ts +2 -0
- package/dist/ui/modal/index.js +2 -0
- package/dist/ui/modal/theme.d.ts +190 -0
- package/dist/ui/modal/theme.js +41 -0
- package/dist/ui/notificationList/NotificationList.svelte +123 -0
- package/dist/ui/notificationList/NotificationList.svelte.d.ts +25 -0
- package/dist/ui/notificationList/index.d.ts +1 -0
- package/dist/ui/notificationList/index.js +1 -0
- package/dist/ui/pageLoader/PageLoader.svelte +10 -0
- package/dist/ui/pageLoader/PageLoader.svelte.d.ts +4 -0
- package/dist/ui/pageLoader/index.d.ts +1 -0
- package/dist/ui/pageLoader/index.js +1 -0
- package/dist/ui/paginate/Paginate.svelte +96 -0
- package/dist/ui/paginate/Paginate.svelte.d.ts +4 -0
- package/dist/ui/paginate/index.d.ts +1 -0
- package/dist/ui/paginate/index.js +1 -0
- package/dist/ui/tab/Tab.svelte +65 -0
- package/dist/ui/tab/Tab.svelte.d.ts +4 -0
- package/dist/ui/tab/index.d.ts +2 -0
- package/dist/ui/tab/index.js +2 -0
- package/dist/ui/tab/theme.d.ts +135 -0
- package/dist/ui/tab/theme.js +83 -0
- package/dist/ui/table/Table.svelte +385 -0
- package/dist/ui/table/Table.svelte.d.ts +4 -0
- package/dist/ui/table/index.d.ts +1 -0
- package/dist/ui/table/index.js +1 -0
- package/dist/ui/tableLoader/TableLoader.svelte +24 -0
- package/dist/ui/tableLoader/TableLoader.svelte.d.ts +13 -0
- package/dist/ui/tableLoader/index.d.ts +1 -0
- package/dist/ui/tableLoader/index.js +1 -0
- package/dist/ui/toolbar/Toolbar.svelte +59 -0
- package/dist/ui/toolbar/Toolbar.svelte.d.ts +17 -0
- package/dist/ui/toolbar/ToolbarButton.svelte +56 -0
- package/dist/ui/toolbar/ToolbarButton.svelte.d.ts +17 -0
- package/dist/ui/toolbar/ToolbarGroup.svelte +43 -0
- package/dist/ui/toolbar/ToolbarGroup.svelte.d.ts +16 -0
- package/dist/ui/toolbar/index.d.ts +4 -0
- package/dist/ui/toolbar/index.js +4 -0
- package/dist/ui/toolbar/theme.d.ts +320 -0
- package/dist/ui/toolbar/theme.js +155 -0
- package/dist/utils/Popper.svelte +257 -0
- package/dist/utils/Popper.svelte.d.ts +4 -0
- package/dist/utils/action.d.ts +16 -0
- package/dist/utils/action.js +107 -0
- package/dist/utils/closeButton/CloseButton.svelte +88 -0
- package/dist/utils/closeButton/CloseButton.svelte.d.ts +12 -0
- package/dist/utils/closeButton/index.d.ts +2 -0
- package/dist/utils/closeButton/index.js +2 -0
- package/dist/utils/closeButton/theme.d.ts +100 -0
- package/dist/utils/closeButton/theme.js +69 -0
- package/dist/utils/dismissable.d.ts +9 -0
- package/dist/utils/dismissable.js +16 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +35 -0
- package/dist/utils/paginate.svelte.d.ts +22 -0
- package/dist/utils/paginate.svelte.js +167 -0
- package/dist/utils/singleSelection.svelte.d.ts +15 -0
- package/dist/utils/singleSelection.svelte.js +49 -0
- package/dist/utils/svelte-legos.d.ts +7 -0
- package/dist/utils/svelte-legos.js +14 -0
- package/package.json +24 -2
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type { Classes } from "../../themes/themeUtils.js";
|
|
2
|
+
import { type VariantProps } from "tailwind-variants";
|
|
3
|
+
export type ModalVariants = VariantProps<typeof modal> & Classes<typeof modal>;
|
|
4
|
+
export declare const modal: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
fullscreen: {
|
|
6
|
+
true: {
|
|
7
|
+
base: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
placement: {
|
|
11
|
+
"top-left": {
|
|
12
|
+
base: string;
|
|
13
|
+
};
|
|
14
|
+
"top-center": {
|
|
15
|
+
base: string;
|
|
16
|
+
};
|
|
17
|
+
"top-right": {
|
|
18
|
+
base: string;
|
|
19
|
+
};
|
|
20
|
+
"center-left": {
|
|
21
|
+
base: string;
|
|
22
|
+
};
|
|
23
|
+
center: {
|
|
24
|
+
base: string;
|
|
25
|
+
};
|
|
26
|
+
"center-right": {
|
|
27
|
+
base: string;
|
|
28
|
+
};
|
|
29
|
+
"bottom-left": {
|
|
30
|
+
base: string;
|
|
31
|
+
};
|
|
32
|
+
"bottom-center": {
|
|
33
|
+
base: string;
|
|
34
|
+
};
|
|
35
|
+
"bottom-right": {
|
|
36
|
+
base: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
size: {
|
|
40
|
+
none: {
|
|
41
|
+
base: string;
|
|
42
|
+
};
|
|
43
|
+
xs: {
|
|
44
|
+
base: string;
|
|
45
|
+
};
|
|
46
|
+
sm: {
|
|
47
|
+
base: string;
|
|
48
|
+
};
|
|
49
|
+
md: {
|
|
50
|
+
base: string;
|
|
51
|
+
};
|
|
52
|
+
lg: {
|
|
53
|
+
base: string;
|
|
54
|
+
};
|
|
55
|
+
xl: {
|
|
56
|
+
base: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}, {
|
|
60
|
+
base: string;
|
|
61
|
+
form: string;
|
|
62
|
+
header: string;
|
|
63
|
+
footer: string;
|
|
64
|
+
body: string;
|
|
65
|
+
close: string;
|
|
66
|
+
}, undefined, {
|
|
67
|
+
fullscreen: {
|
|
68
|
+
true: {
|
|
69
|
+
base: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
placement: {
|
|
73
|
+
"top-left": {
|
|
74
|
+
base: string;
|
|
75
|
+
};
|
|
76
|
+
"top-center": {
|
|
77
|
+
base: string;
|
|
78
|
+
};
|
|
79
|
+
"top-right": {
|
|
80
|
+
base: string;
|
|
81
|
+
};
|
|
82
|
+
"center-left": {
|
|
83
|
+
base: string;
|
|
84
|
+
};
|
|
85
|
+
center: {
|
|
86
|
+
base: string;
|
|
87
|
+
};
|
|
88
|
+
"center-right": {
|
|
89
|
+
base: string;
|
|
90
|
+
};
|
|
91
|
+
"bottom-left": {
|
|
92
|
+
base: string;
|
|
93
|
+
};
|
|
94
|
+
"bottom-center": {
|
|
95
|
+
base: string;
|
|
96
|
+
};
|
|
97
|
+
"bottom-right": {
|
|
98
|
+
base: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
size: {
|
|
102
|
+
none: {
|
|
103
|
+
base: string;
|
|
104
|
+
};
|
|
105
|
+
xs: {
|
|
106
|
+
base: string;
|
|
107
|
+
};
|
|
108
|
+
sm: {
|
|
109
|
+
base: string;
|
|
110
|
+
};
|
|
111
|
+
md: {
|
|
112
|
+
base: string;
|
|
113
|
+
};
|
|
114
|
+
lg: {
|
|
115
|
+
base: string;
|
|
116
|
+
};
|
|
117
|
+
xl: {
|
|
118
|
+
base: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
}, {
|
|
122
|
+
base: string;
|
|
123
|
+
form: string;
|
|
124
|
+
header: string;
|
|
125
|
+
footer: string;
|
|
126
|
+
body: string;
|
|
127
|
+
close: string;
|
|
128
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
129
|
+
fullscreen: {
|
|
130
|
+
true: {
|
|
131
|
+
base: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
placement: {
|
|
135
|
+
"top-left": {
|
|
136
|
+
base: string;
|
|
137
|
+
};
|
|
138
|
+
"top-center": {
|
|
139
|
+
base: string;
|
|
140
|
+
};
|
|
141
|
+
"top-right": {
|
|
142
|
+
base: string;
|
|
143
|
+
};
|
|
144
|
+
"center-left": {
|
|
145
|
+
base: string;
|
|
146
|
+
};
|
|
147
|
+
center: {
|
|
148
|
+
base: string;
|
|
149
|
+
};
|
|
150
|
+
"center-right": {
|
|
151
|
+
base: string;
|
|
152
|
+
};
|
|
153
|
+
"bottom-left": {
|
|
154
|
+
base: string;
|
|
155
|
+
};
|
|
156
|
+
"bottom-center": {
|
|
157
|
+
base: string;
|
|
158
|
+
};
|
|
159
|
+
"bottom-right": {
|
|
160
|
+
base: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
size: {
|
|
164
|
+
none: {
|
|
165
|
+
base: string;
|
|
166
|
+
};
|
|
167
|
+
xs: {
|
|
168
|
+
base: string;
|
|
169
|
+
};
|
|
170
|
+
sm: {
|
|
171
|
+
base: string;
|
|
172
|
+
};
|
|
173
|
+
md: {
|
|
174
|
+
base: string;
|
|
175
|
+
};
|
|
176
|
+
lg: {
|
|
177
|
+
base: string;
|
|
178
|
+
};
|
|
179
|
+
xl: {
|
|
180
|
+
base: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
}, {
|
|
184
|
+
base: string;
|
|
185
|
+
form: string;
|
|
186
|
+
header: string;
|
|
187
|
+
footer: string;
|
|
188
|
+
body: string;
|
|
189
|
+
close: string;
|
|
190
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const modal = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
base: "backdrop:bg-black/80 open:flex flex-col w-full max-h-[90hv] rounded-lg divide-y text-gray-500 dark:text-gray-400 border-gray-300 dark:border-gray-800 divide-gray-300 dark:divide-gray-700 bg-white dark:bg-gray-800 pointer-events-auto",
|
|
5
|
+
form: "flex flex-col rounded-lg divide-y",
|
|
6
|
+
header: "flex items-center p-4 md:p-5 justify-between rounded-t-lg shrink-0 text-xl font-semibold text-gray-900 dark:text-white",
|
|
7
|
+
footer: "flex items-center p-4 md:p-5 space-x-3 rtl:space-x-reverse rounded-b-lg shrink-0",
|
|
8
|
+
body: "p-4 md:p-5 space-y-4 overflow-y-auto overscroll-contain",
|
|
9
|
+
close: "absolute top-3 end-2.5"
|
|
10
|
+
},
|
|
11
|
+
variants: {
|
|
12
|
+
fullscreen: {
|
|
13
|
+
true: {
|
|
14
|
+
base: "fixed inset-0 w-screen h-screen max-w-none max-h-none m-0 p-0 border-none rounded-none bg-white dark:bg-gray-900"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
placement: {
|
|
18
|
+
"top-left": { base: "top-0 left-0" },
|
|
19
|
+
"top-center": { base: "top-0 left-1/2 -translate-x-1/2" },
|
|
20
|
+
"top-right": { base: "top-0 left-full -translate-x-full" },
|
|
21
|
+
"center-left": { base: "top-1/2 left-0 -translate-y-1/2" },
|
|
22
|
+
center: { base: "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" },
|
|
23
|
+
"center-right": { base: "top-1/2 left-full -translate-x-full -translate-y-1/2" },
|
|
24
|
+
"bottom-left": { base: "top-full -translate-y-full left-0" },
|
|
25
|
+
"bottom-center": { base: "top-full -translate-y-full left-1/2 -translate-x-1/2" },
|
|
26
|
+
"bottom-right": { base: "top-full -translate-y-full left-full -translate-x-full" }
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
none: { base: "" },
|
|
30
|
+
xs: { base: "max-w-md" },
|
|
31
|
+
sm: { base: "max-w-lg" },
|
|
32
|
+
md: { base: "max-w-2xl" },
|
|
33
|
+
lg: { base: "max-w-4xl" },
|
|
34
|
+
xl: { base: "max-w-7xl" }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
placement: "center",
|
|
39
|
+
size: "md"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<script lang="ts" generics="T extends NotificationItem">
|
|
4
|
+
import { Dropdown, DropdownItem } from '../dropdown/index.js';
|
|
5
|
+
import { Avatar } from '../avatar/index.js';
|
|
6
|
+
import { PageLoader, type NotificationItem, type NotificationListProps } from '../../index.js';
|
|
7
|
+
import { onDestroy, onMount } from 'svelte';
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
open = $bindable(false),
|
|
11
|
+
onClearNotifications,
|
|
12
|
+
header,
|
|
13
|
+
busy = false,
|
|
14
|
+
data: initialData = [],
|
|
15
|
+
onclick,
|
|
16
|
+
footer,
|
|
17
|
+
read
|
|
18
|
+
}: NotificationListProps<T> = $props();
|
|
19
|
+
|
|
20
|
+
let data = $state(initialData);
|
|
21
|
+
let internalOpen = $state(false);
|
|
22
|
+
|
|
23
|
+
$effect(() => {
|
|
24
|
+
if (open !== undefined) {
|
|
25
|
+
internalOpen = open;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
async function fetchData() {
|
|
30
|
+
if (!read) return;
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
busy = true;
|
|
34
|
+
const result = await read();
|
|
35
|
+
data = result;
|
|
36
|
+
} finally {
|
|
37
|
+
busy = false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
$effect(() => {
|
|
42
|
+
if (internalOpen) {
|
|
43
|
+
data = [];
|
|
44
|
+
fetchData();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
onMount(() => {
|
|
49
|
+
if (initialData && initialData.length > 0) {
|
|
50
|
+
data = initialData;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
onDestroy(() => {
|
|
55
|
+
data = [];
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<Dropdown
|
|
60
|
+
bind:isOpen={internalOpen}
|
|
61
|
+
class="w-full max-w-sm divide-gray-100 rounded shadow dark:divide-gray-700 dark:bg-gray-800"
|
|
62
|
+
>
|
|
63
|
+
{#if header}
|
|
64
|
+
{@render header()}
|
|
65
|
+
{:else}
|
|
66
|
+
<div class="py-2 text-center font-bold">Notifications</div>
|
|
67
|
+
{/if}
|
|
68
|
+
<div
|
|
69
|
+
class="scrollbar-thumb-blue scrollbar-thumb-rounded scrollbar-track-blue-lighter scrollbar-w-2 scrolling-touch flex max-h-80 flex-col divide-y overflow-y-auto"
|
|
70
|
+
>
|
|
71
|
+
{#if busy}
|
|
72
|
+
<div class="flex h-52 w-96 items-center justify-center">
|
|
73
|
+
<PageLoader size={40} />
|
|
74
|
+
</div>
|
|
75
|
+
{:else if data.length}
|
|
76
|
+
{#each data as item, index}
|
|
77
|
+
<DropdownItem class="flex w-full space-x-4" onclick={() => onclick?.(item)}>
|
|
78
|
+
<Avatar cornerStyle="rounded">
|
|
79
|
+
<iconify-icon icon={item.icon} style="font-size: 20px;"></iconify-icon>
|
|
80
|
+
</Avatar>
|
|
81
|
+
<div class="w-full pl-3 text-start">
|
|
82
|
+
<div class="mb-1.5 text-sm text-gray-500 dark:text-gray-400">
|
|
83
|
+
<span class="font-semibold text-gray-900 dark:text-white">{item.sender}</span>: "{item.content}"
|
|
84
|
+
</div>
|
|
85
|
+
<div class="flex items-center justify-between">
|
|
86
|
+
<div class="text-xs text-primary-600 dark:text-primary-500">{item.time}</div>
|
|
87
|
+
<div class="flex items-center gap-1">
|
|
88
|
+
{#if item.isRead}
|
|
89
|
+
<span class="text-xs font-light text-gray-400">Read</span>
|
|
90
|
+
{/if}
|
|
91
|
+
<iconify-icon
|
|
92
|
+
icon={item.isRead ? 'ri:check-double-line' : 'uim:check'}
|
|
93
|
+
class={item.isRead ? 'text-blue-700' : 'text-gray-500'}
|
|
94
|
+
style="font-size: 18px;"
|
|
95
|
+
></iconify-icon>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</DropdownItem>
|
|
100
|
+
{/each}
|
|
101
|
+
{:else}
|
|
102
|
+
<div class="flex h-32 w-80 items-center justify-center space-x-4">
|
|
103
|
+
<p>No Notifications</p>
|
|
104
|
+
</div>
|
|
105
|
+
{/if}
|
|
106
|
+
</div>
|
|
107
|
+
{#if footer}
|
|
108
|
+
{@render footer()}
|
|
109
|
+
{:else}
|
|
110
|
+
<div
|
|
111
|
+
class="-my-1 block bg-gray-50 py-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-100 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700"
|
|
112
|
+
>
|
|
113
|
+
{#if data.length}
|
|
114
|
+
<button class="w-full" onclick={onClearNotifications}>
|
|
115
|
+
<div class="inline-flex items-center gap-2">
|
|
116
|
+
<iconify-icon icon="ic:round-close"></iconify-icon>
|
|
117
|
+
Clear all
|
|
118
|
+
</div>
|
|
119
|
+
</button>
|
|
120
|
+
{/if}
|
|
121
|
+
</div>
|
|
122
|
+
{/if}
|
|
123
|
+
</Dropdown>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type NotificationItem, type NotificationListProps } from '../../index.js';
|
|
2
|
+
declare function $$render<T extends NotificationItem>(): {
|
|
3
|
+
props: NotificationListProps<T>;
|
|
4
|
+
exports: {};
|
|
5
|
+
bindings: "open";
|
|
6
|
+
slots: {};
|
|
7
|
+
events: {};
|
|
8
|
+
};
|
|
9
|
+
declare class __sveltets_Render<T extends NotificationItem> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
13
|
+
bindings(): "open";
|
|
14
|
+
exports(): {};
|
|
15
|
+
}
|
|
16
|
+
interface $$IsomorphicComponent {
|
|
17
|
+
new <T extends NotificationItem>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
+
<T extends NotificationItem>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
|
+
}
|
|
23
|
+
declare const NotificationList: $$IsomorphicComponent;
|
|
24
|
+
type NotificationList<T extends NotificationItem> = InstanceType<typeof NotificationList<T>>;
|
|
25
|
+
export default NotificationList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NotificationList } from "./NotificationList.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NotificationList } from "./NotificationList.svelte";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { PageLoaderProps } from '../../index.js';
|
|
3
|
+
|
|
4
|
+
let { size = 70, iconColor = 'text-blue-400' }: PageLoaderProps = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class="grid h-full w-full items-center justify-center">
|
|
8
|
+
<iconify-icon class={iconColor} icon="svg-spinners:blocks-shuffle-3" style="font-size: {size}px;"
|
|
9
|
+
></iconify-icon>
|
|
10
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PageLoader } from "./PageLoader.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PageLoader } from "./PageLoader.svelte";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dropdown, type PaginateProps } from '../../index.js';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
currentPage,
|
|
6
|
+
hasNextPage,
|
|
7
|
+
hasPreviousPage,
|
|
8
|
+
onNextPage,
|
|
9
|
+
onPreviousPage,
|
|
10
|
+
refresh = null,
|
|
11
|
+
totalPages,
|
|
12
|
+
hiddenColumns = $bindable([]),
|
|
13
|
+
tableColumns = [],
|
|
14
|
+
textSmall = false,
|
|
15
|
+
hideLabel = true,
|
|
16
|
+
recordCount = 0
|
|
17
|
+
}: PaginateProps = $props();
|
|
18
|
+
|
|
19
|
+
// let hideState = tableColumns.map(x => )
|
|
20
|
+
let hideState = $state<Record<string, boolean>>({});
|
|
21
|
+
hiddenColumns.forEach((x) => (hideState[x] = true));
|
|
22
|
+
// $: hiddenColumns = Object.keys(hideState).filter((x) => hideState[x]);
|
|
23
|
+
// let hiddenColumns
|
|
24
|
+
|
|
25
|
+
let open = $state(false);
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div class:text-sm={textSmall} class="flex w-full items-center justify-between gap-2 text-gray-600">
|
|
29
|
+
<button
|
|
30
|
+
class=" items-center justify-center gap-1 p-2 text-sm font-semibold"
|
|
31
|
+
class:hidden={!totalPages}
|
|
32
|
+
class:flex={totalPages}
|
|
33
|
+
onclick={onPreviousPage}
|
|
34
|
+
disabled={!hasPreviousPage}
|
|
35
|
+
class:active={hasPreviousPage}
|
|
36
|
+
class:hover:bg-gray-200={hasPreviousPage}
|
|
37
|
+
class:rounded-md={hasPreviousPage}
|
|
38
|
+
class:text-gray-300={!hasPreviousPage}
|
|
39
|
+
>
|
|
40
|
+
<iconify-icon icon="material-symbols:arrow-back" style="font-size: 18px"></iconify-icon>
|
|
41
|
+
{#if !hideLabel}
|
|
42
|
+
<span>PREV</span>
|
|
43
|
+
{/if}
|
|
44
|
+
</button>
|
|
45
|
+
<div class="text-sm font-semibold">
|
|
46
|
+
{#if !hideLabel}
|
|
47
|
+
<span>Page</span>
|
|
48
|
+
{/if}
|
|
49
|
+
<span class:hidden={!totalPages} class:flex={totalPages}>{currentPage}/{totalPages}</span>
|
|
50
|
+
</div>
|
|
51
|
+
<span class:hidden={!recordCount} class:flex={recordCount}>({recordCount})</span>
|
|
52
|
+
|
|
53
|
+
<button
|
|
54
|
+
class="flex items-center justify-center gap-1 p-2 text-sm font-semibold"
|
|
55
|
+
class:hidden={!totalPages}
|
|
56
|
+
class:flex={totalPages}
|
|
57
|
+
onclick={onNextPage}
|
|
58
|
+
disabled={!hasNextPage}
|
|
59
|
+
class:active={hasNextPage}
|
|
60
|
+
class:hover:bg-gray-200={hasNextPage}
|
|
61
|
+
class:rounded-md={hasNextPage}
|
|
62
|
+
class:text-gray-300={!hasNextPage}
|
|
63
|
+
>
|
|
64
|
+
{#if !hideLabel}
|
|
65
|
+
<span>NEXT</span>
|
|
66
|
+
{/if}
|
|
67
|
+
<iconify-icon icon="material-symbols:arrow-forward" style="font-size: 18px"></iconify-icon>
|
|
68
|
+
</button>
|
|
69
|
+
<button
|
|
70
|
+
type="button"
|
|
71
|
+
aria-label="arrows-clockwise"
|
|
72
|
+
class="rotate-2 font-bold hover:text-gray-600"
|
|
73
|
+
class:hidden={!refresh}
|
|
74
|
+
onclick={refresh}
|
|
75
|
+
>
|
|
76
|
+
<iconify-icon icon="ph:arrows-clockwise" class="hover:animate-spin hover:text-gray-400"
|
|
77
|
+
></iconify-icon>
|
|
78
|
+
</button>
|
|
79
|
+
<div class:hidden={!tableColumns.length} class:flex={tableColumns}>
|
|
80
|
+
<button onclick={() => (open = !open)}>
|
|
81
|
+
<iconify-icon icon="ph:columns" class="text-red-500 hover:text-red-800"></iconify-icon>
|
|
82
|
+
<!-- <Tooltip>Toggle Columns</Tooltip> -->
|
|
83
|
+
</button>
|
|
84
|
+
<Dropdown
|
|
85
|
+
bind:isOpen={open}
|
|
86
|
+
class="scrollbar-thumb-blue scrollbar-thumb-rounded scrollbar-track-blue-lighter scrollbar-w-2 scrolling-touch h-56 min-w-40 overflow-y-auto px-3 pb-3 text-sm"
|
|
87
|
+
>
|
|
88
|
+
{#each tableColumns as column}
|
|
89
|
+
<li class="flex w-full px-2 py-1.5 whitespace-nowrap">
|
|
90
|
+
<!-- <Toggle bind:checked={hideState[column.id]} class="cursor-pointer" /> -->
|
|
91
|
+
{column.header}
|
|
92
|
+
</li>
|
|
93
|
+
{/each}
|
|
94
|
+
</Dropdown>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Paginate } from "./Paginate.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Paginate } from "./Paginate.svelte";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CloseButton, type TabProps } from '../../index.js';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
activeTab = $bindable(0),
|
|
6
|
+
tabs = [],
|
|
7
|
+
onTabChange,
|
|
8
|
+
onRemoveTab,
|
|
9
|
+
onTabAdd
|
|
10
|
+
}: TabProps = $props();
|
|
11
|
+
|
|
12
|
+
function changeTab(id: number | string) {
|
|
13
|
+
activeTab = id;
|
|
14
|
+
onTabChange?.(id);
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div class="relative flex h-full w-full flex-col">
|
|
19
|
+
<div class="mb-4 flex flex-wrap space-x-3 border-b-2">
|
|
20
|
+
{#each tabs as tab}
|
|
21
|
+
<button
|
|
22
|
+
class="rounded-t-md border-b-2 px-4 py-2"
|
|
23
|
+
class:bg-primary-500={activeTab === tab.id}
|
|
24
|
+
class:text-white={activeTab === tab.id}
|
|
25
|
+
class:text-gray-600={activeTab !== tab.id}
|
|
26
|
+
class:hover:bg-gray-100={activeTab !== tab.id}
|
|
27
|
+
class:border-transparent={activeTab !== tab.id}
|
|
28
|
+
class:border-white={activeTab === tab.id}
|
|
29
|
+
onclick={() => changeTab(tab.id)}
|
|
30
|
+
>
|
|
31
|
+
<div class="flex items-center gap-2">
|
|
32
|
+
<span class="text-sm">
|
|
33
|
+
{tab.title}
|
|
34
|
+
</span>
|
|
35
|
+
<iconify-icon icon={tab.icon} style="font-size: 15px;"></iconify-icon>
|
|
36
|
+
{#if tab.isClosable}
|
|
37
|
+
<CloseButton
|
|
38
|
+
size="sm"
|
|
39
|
+
class=" {activeTab === tab.id
|
|
40
|
+
? 'text-white hover:bg-white/20'
|
|
41
|
+
: 'text-gray-600 hover:bg-gray-200'}"
|
|
42
|
+
onclick={(e: any) => {
|
|
43
|
+
onRemoveTab?.({ tabId: tab.id });
|
|
44
|
+
e.stopPropagation();
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
|
49
|
+
</button>
|
|
50
|
+
{/each}
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class=" h-full w-full">
|
|
54
|
+
{#each tabs as tab (tab.id)}
|
|
55
|
+
<div class:hidden={activeTab !== tab.id} class="h-full w-full">
|
|
56
|
+
<!-- {@render tab.children({
|
|
57
|
+
...tab,
|
|
58
|
+
onTabAdd,
|
|
59
|
+
onRemoveTab
|
|
60
|
+
})} -->
|
|
61
|
+
<tab.children {...tab} {onTabAdd} {onRemoveTab} />
|
|
62
|
+
</div>
|
|
63
|
+
{/each}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|