@kkkarsss/ui 1.0.0

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 (246) hide show
  1. package/dist/.storybook/main.d.ts +3 -0
  2. package/dist/.storybook/main.js +34 -0
  3. package/dist/.storybook/preview.d.ts +4 -0
  4. package/dist/.storybook/preview.js +19 -0
  5. package/dist/index.css +238 -0
  6. package/dist/index.d.ts +4 -0
  7. package/dist/index.js +4 -0
  8. package/dist/providers/alert/alert-context.d.ts +16 -0
  9. package/dist/providers/alert/alert-context.js +2 -0
  10. package/dist/providers/alert/alert-provider.d.ts +6 -0
  11. package/dist/providers/alert/alert-provider.js +50 -0
  12. package/dist/providers/alert/use-alerts.d.ts +1 -0
  13. package/dist/providers/alert/use-alerts.js +9 -0
  14. package/dist/providers/index.d.ts +9 -0
  15. package/dist/providers/index.js +9 -0
  16. package/dist/providers/theme/index.d.ts +3 -0
  17. package/dist/providers/theme/index.js +3 -0
  18. package/dist/providers/theme/theme-context.d.ts +7 -0
  19. package/dist/providers/theme/theme-context.js +6 -0
  20. package/dist/providers/theme/theme-provider.d.ts +9 -0
  21. package/dist/providers/theme/theme-provider.js +27 -0
  22. package/dist/providers/theme/use-theme.d.ts +4 -0
  23. package/dist/providers/theme/use-theme.js +8 -0
  24. package/dist/providers/widget/index.d.ts +3 -0
  25. package/dist/providers/widget/index.js +3 -0
  26. package/dist/providers/widget/use-widgets.d.ts +4 -0
  27. package/dist/providers/widget/use-widgets.js +8 -0
  28. package/dist/providers/widget/widget-context.d.ts +12 -0
  29. package/dist/providers/widget/widget-context.js +6 -0
  30. package/dist/providers/widget/widget-provider.d.ts +6 -0
  31. package/dist/providers/widget/widget-provider.js +13 -0
  32. package/dist/src/index.d.ts +4 -0
  33. package/dist/src/index.js +4 -0
  34. package/dist/src/providers/alert/alert-context.d.ts +16 -0
  35. package/dist/src/providers/alert/alert-context.js +2 -0
  36. package/dist/src/providers/alert/alert-provider.d.ts +6 -0
  37. package/dist/src/providers/alert/alert-provider.js +50 -0
  38. package/dist/src/providers/alert/use-alerts.d.ts +1 -0
  39. package/dist/src/providers/alert/use-alerts.js +9 -0
  40. package/dist/src/providers/index.d.ts +9 -0
  41. package/dist/src/providers/index.js +9 -0
  42. package/dist/src/providers/theme/theme-context.d.ts +7 -0
  43. package/dist/src/providers/theme/theme-context.js +6 -0
  44. package/dist/src/providers/theme/theme-provider.d.ts +9 -0
  45. package/dist/src/providers/theme/theme-provider.js +27 -0
  46. package/dist/src/providers/theme/use-theme.d.ts +4 -0
  47. package/dist/src/providers/theme/use-theme.js +8 -0
  48. package/dist/src/providers/widget/use-widgets.d.ts +4 -0
  49. package/dist/src/providers/widget/use-widgets.js +8 -0
  50. package/dist/src/providers/widget/widget-context.d.ts +12 -0
  51. package/dist/src/providers/widget/widget-context.js +6 -0
  52. package/dist/src/providers/widget/widget-provider.d.ts +6 -0
  53. package/dist/src/providers/widget/widget-provider.js +15 -0
  54. package/dist/src/ui/controls/button/button.d.ts +10 -0
  55. package/dist/src/ui/controls/button/button.js +11 -0
  56. package/dist/src/ui/controls/button/button.stories.d.ts +9 -0
  57. package/dist/src/ui/controls/button/button.stories.js +38 -0
  58. package/dist/src/ui/controls/chip/chip.d.ts +12 -0
  59. package/dist/src/ui/controls/chip/chip.js +11 -0
  60. package/dist/src/ui/controls/chip/chip.stories.d.ts +9 -0
  61. package/dist/src/ui/controls/chip/chip.stories.js +42 -0
  62. package/dist/src/ui/controls/color-picker/color-picker.d.ts +8 -0
  63. package/dist/src/ui/controls/color-picker/color-picker.js +21 -0
  64. package/dist/src/ui/controls/color-picker/color-picker.stories.d.ts +7 -0
  65. package/dist/src/ui/controls/color-picker/color-picker.stories.js +21 -0
  66. package/dist/src/ui/controls/copy/copy.d.ts +6 -0
  67. package/dist/src/ui/controls/copy/copy.js +20 -0
  68. package/dist/src/ui/controls/copy/copy.stories.d.ts +7 -0
  69. package/dist/src/ui/controls/copy/copy.stories.js +20 -0
  70. package/dist/src/ui/controls/index.d.ts +7 -0
  71. package/dist/src/ui/controls/index.js +7 -0
  72. package/dist/src/ui/controls/input/input.d.ts +14 -0
  73. package/dist/src/ui/controls/input/input.js +12 -0
  74. package/dist/src/ui/controls/input/input.stories.d.ts +9 -0
  75. package/dist/src/ui/controls/input/input.stories.js +46 -0
  76. package/dist/src/ui/controls/select/select.d.ts +14 -0
  77. package/dist/src/ui/controls/select/select.js +80 -0
  78. package/dist/src/ui/controls/select/select.stories.d.ts +8 -0
  79. package/dist/src/ui/controls/select/select.stories.js +40 -0
  80. package/dist/src/ui/controls/textarea/textarea.d.ts +11 -0
  81. package/dist/src/ui/controls/textarea/textarea.js +20 -0
  82. package/dist/src/ui/controls/textarea/textarea.stories.d.ts +8 -0
  83. package/dist/src/ui/controls/textarea/textarea.stories.js +35 -0
  84. package/dist/src/ui/index.d.ts +3 -0
  85. package/dist/src/ui/index.js +3 -0
  86. package/dist/src/ui/information/block/block.d.ts +10 -0
  87. package/dist/src/ui/information/block/block.js +10 -0
  88. package/dist/src/ui/information/block/block.stories.d.ts +8 -0
  89. package/dist/src/ui/information/block/block.stories.js +38 -0
  90. package/dist/src/ui/information/cell/cell.d.ts +26 -0
  91. package/dist/src/ui/information/cell/cell.js +31 -0
  92. package/dist/src/ui/information/cell/cell.stories.d.ts +11 -0
  93. package/dist/src/ui/information/cell/cell.stories.js +62 -0
  94. package/dist/src/ui/information/cell/cells-block.d.ts +9 -0
  95. package/dist/src/ui/information/cell/cells-block.js +5 -0
  96. package/dist/src/ui/information/cell/cells-block.stories.d.ts +6 -0
  97. package/dist/src/ui/information/cell/cells-block.stories.js +20 -0
  98. package/dist/src/ui/information/index.d.ts +6 -0
  99. package/dist/src/ui/information/index.js +6 -0
  100. package/dist/src/ui/information/spinner/spinner.d.ts +2 -0
  101. package/dist/src/ui/information/spinner/spinner.js +5 -0
  102. package/dist/src/ui/information/spinner/spinner.stories.d.ts +6 -0
  103. package/dist/src/ui/information/spinner/spinner.stories.js +8 -0
  104. package/dist/src/ui/information/tag/tag.d.ts +6 -0
  105. package/dist/src/ui/information/tag/tag.js +7 -0
  106. package/dist/src/ui/information/tag/tag.stories.d.ts +8 -0
  107. package/dist/src/ui/information/tag/tag.stories.js +25 -0
  108. package/dist/src/ui/information/text/typo.d.ts +12 -0
  109. package/dist/src/ui/information/text/typo.js +41 -0
  110. package/dist/src/ui/information/text/typo.stories.d.ts +10 -0
  111. package/dist/src/ui/information/text/typo.stories.js +60 -0
  112. package/dist/src/ui/layout/dropdown/dropdown.d.ts +11 -0
  113. package/dist/src/ui/layout/dropdown/dropdown.js +59 -0
  114. package/dist/src/ui/layout/dropdown/dropdown.stories.d.ts +6 -0
  115. package/dist/src/ui/layout/dropdown/dropdown.stories.js +24 -0
  116. package/dist/src/ui/layout/flex/flex.d.ts +12 -0
  117. package/dist/src/ui/layout/flex/flex.js +36 -0
  118. package/dist/src/ui/layout/flex/flex.stories.d.ts +8 -0
  119. package/dist/src/ui/layout/flex/flex.stories.js +53 -0
  120. package/dist/src/ui/layout/icon-action/icon-action.d.ts +9 -0
  121. package/dist/src/ui/layout/icon-action/icon-action.js +11 -0
  122. package/dist/src/ui/layout/icon-action/icon-action.stories.d.ts +7 -0
  123. package/dist/src/ui/layout/icon-action/icon-action.stories.js +23 -0
  124. package/dist/src/ui/layout/index.d.ts +5 -0
  125. package/dist/src/ui/layout/index.js +5 -0
  126. package/dist/src/ui/layout/main-page-layout/main-page-layout.d.ts +7 -0
  127. package/dist/src/ui/layout/main-page-layout/main-page-layout.js +8 -0
  128. package/dist/src/ui/layout/main-page-layout/main-page-layout.stories.d.ts +6 -0
  129. package/dist/src/ui/layout/main-page-layout/main-page-layout.stories.js +19 -0
  130. package/dist/src/ui/layout/offset/offset.d.ts +6 -0
  131. package/dist/src/ui/layout/offset/offset.js +10 -0
  132. package/dist/src/ui/layout/offset/offset.stories.d.ts +8 -0
  133. package/dist/src/ui/layout/offset/offset.stories.js +33 -0
  134. package/dist/src/utils/classes.d.ts +1 -0
  135. package/dist/src/utils/classes.js +1 -0
  136. package/dist/src/utils/index.d.ts +1 -0
  137. package/dist/src/utils/index.js +1 -0
  138. package/dist/stories/Button.d.ts +15 -0
  139. package/dist/stories/Button.js +7 -0
  140. package/dist/stories/Button.stories.d.ts +23 -0
  141. package/dist/stories/Button.stories.js +44 -0
  142. package/dist/stories/Header.d.ts +12 -0
  143. package/dist/stories/Header.js +4 -0
  144. package/dist/stories/Header.stories.d.ts +18 -0
  145. package/dist/stories/Header.stories.js +26 -0
  146. package/dist/stories/Page.d.ts +3 -0
  147. package/dist/stories/Page.js +8 -0
  148. package/dist/stories/Page.stories.d.ts +12 -0
  149. package/dist/stories/Page.stories.js +24 -0
  150. package/dist/ui/controls/button/button.d.ts +10 -0
  151. package/dist/ui/controls/button/button.js +11 -0
  152. package/dist/ui/controls/button/button.stories.d.ts +9 -0
  153. package/dist/ui/controls/button/button.stories.js +38 -0
  154. package/dist/ui/controls/chip/chip.d.ts +12 -0
  155. package/dist/ui/controls/chip/chip.js +11 -0
  156. package/dist/ui/controls/chip/chip.stories.d.ts +9 -0
  157. package/dist/ui/controls/chip/chip.stories.js +42 -0
  158. package/dist/ui/controls/color-picker/color-picker.d.ts +8 -0
  159. package/dist/ui/controls/color-picker/color-picker.js +21 -0
  160. package/dist/ui/controls/color-picker/color-picker.stories.d.ts +7 -0
  161. package/dist/ui/controls/color-picker/color-picker.stories.js +21 -0
  162. package/dist/ui/controls/copy/copy.d.ts +6 -0
  163. package/dist/ui/controls/copy/copy.js +20 -0
  164. package/dist/ui/controls/copy/copy.stories.d.ts +7 -0
  165. package/dist/ui/controls/copy/copy.stories.js +20 -0
  166. package/dist/ui/controls/date-input/date-input.d.ts +10 -0
  167. package/dist/ui/controls/date-input/date-input.js +25 -0
  168. package/dist/ui/controls/date-picker/date-picker.d.ts +7 -0
  169. package/dist/ui/controls/date-picker/date-picker.js +32 -0
  170. package/dist/ui/controls/index.d.ts +9 -0
  171. package/dist/ui/controls/index.js +9 -0
  172. package/dist/ui/controls/input/input.d.ts +15 -0
  173. package/dist/ui/controls/input/input.js +12 -0
  174. package/dist/ui/controls/input/input.stories.d.ts +9 -0
  175. package/dist/ui/controls/input/input.stories.js +46 -0
  176. package/dist/ui/controls/select/select.d.ts +14 -0
  177. package/dist/ui/controls/select/select.js +80 -0
  178. package/dist/ui/controls/select/select.stories.d.ts +8 -0
  179. package/dist/ui/controls/select/select.stories.js +40 -0
  180. package/dist/ui/controls/textarea/textarea.d.ts +11 -0
  181. package/dist/ui/controls/textarea/textarea.js +20 -0
  182. package/dist/ui/controls/textarea/textarea.stories.d.ts +8 -0
  183. package/dist/ui/controls/textarea/textarea.stories.js +35 -0
  184. package/dist/ui/controls/theme-toggle/theme-toggle.d.ts +2 -0
  185. package/dist/ui/controls/theme-toggle/theme-toggle.js +10 -0
  186. package/dist/ui/index.d.ts +3 -0
  187. package/dist/ui/index.js +3 -0
  188. package/dist/ui/information/block/block.d.ts +13 -0
  189. package/dist/ui/information/block/block.js +10 -0
  190. package/dist/ui/information/block/block.stories.d.ts +9 -0
  191. package/dist/ui/information/block/block.stories.js +47 -0
  192. package/dist/ui/information/calendar-like/calendar-like.d.ts +24 -0
  193. package/dist/ui/information/calendar-like/calendar-like.js +71 -0
  194. package/dist/ui/information/cell/cell.d.ts +26 -0
  195. package/dist/ui/information/cell/cell.js +31 -0
  196. package/dist/ui/information/cell/cell.stories.d.ts +11 -0
  197. package/dist/ui/information/cell/cell.stories.js +62 -0
  198. package/dist/ui/information/cell/cells-block.d.ts +9 -0
  199. package/dist/ui/information/cell/cells-block.js +5 -0
  200. package/dist/ui/information/cell/cells-block.stories.d.ts +6 -0
  201. package/dist/ui/information/cell/cells-block.stories.js +20 -0
  202. package/dist/ui/information/index.d.ts +8 -0
  203. package/dist/ui/information/index.js +8 -0
  204. package/dist/ui/information/not-found/not-found.d.ts +2 -0
  205. package/dist/ui/information/not-found/not-found.js +6 -0
  206. package/dist/ui/information/spinner/spinner.d.ts +2 -0
  207. package/dist/ui/information/spinner/spinner.js +5 -0
  208. package/dist/ui/information/spinner/spinner.stories.d.ts +6 -0
  209. package/dist/ui/information/spinner/spinner.stories.js +8 -0
  210. package/dist/ui/information/tag/tag.d.ts +6 -0
  211. package/dist/ui/information/tag/tag.js +7 -0
  212. package/dist/ui/information/tag/tag.stories.d.ts +8 -0
  213. package/dist/ui/information/tag/tag.stories.js +25 -0
  214. package/dist/ui/information/text/typo.d.ts +13 -0
  215. package/dist/ui/information/text/typo.js +41 -0
  216. package/dist/ui/information/text/typo.stories.d.ts +10 -0
  217. package/dist/ui/information/text/typo.stories.js +60 -0
  218. package/dist/ui/information/typo.d.ts +12 -0
  219. package/dist/ui/information/typo.js +41 -0
  220. package/dist/ui/layout/dropdown/dropdown.d.ts +11 -0
  221. package/dist/ui/layout/dropdown/dropdown.js +44 -0
  222. package/dist/ui/layout/dropdown/dropdown.stories.d.ts +6 -0
  223. package/dist/ui/layout/dropdown/dropdown.stories.js +24 -0
  224. package/dist/ui/layout/flex/flex.d.ts +13 -0
  225. package/dist/ui/layout/flex/flex.js +36 -0
  226. package/dist/ui/layout/flex/flex.stories.d.ts +8 -0
  227. package/dist/ui/layout/flex/flex.stories.js +53 -0
  228. package/dist/ui/layout/icon-action/icon-action.d.ts +9 -0
  229. package/dist/ui/layout/icon-action/icon-action.js +11 -0
  230. package/dist/ui/layout/icon-action/icon-action.stories.d.ts +7 -0
  231. package/dist/ui/layout/icon-action/icon-action.stories.js +23 -0
  232. package/dist/ui/layout/index.d.ts +5 -0
  233. package/dist/ui/layout/index.js +5 -0
  234. package/dist/ui/layout/main-page-layout/main-page-layout.d.ts +7 -0
  235. package/dist/ui/layout/main-page-layout/main-page-layout.js +8 -0
  236. package/dist/ui/layout/main-page-layout/main-page-layout.stories.d.ts +6 -0
  237. package/dist/ui/layout/main-page-layout/main-page-layout.stories.js +19 -0
  238. package/dist/ui/layout/offset/offset.d.ts +7 -0
  239. package/dist/ui/layout/offset/offset.js +10 -0
  240. package/dist/ui/layout/offset/offset.stories.d.ts +8 -0
  241. package/dist/ui/layout/offset/offset.stories.js +33 -0
  242. package/dist/utils/classes.d.ts +1 -0
  243. package/dist/utils/classes.js +1 -0
  244. package/dist/utils/index.d.ts +1 -0
  245. package/dist/utils/index.js +1 -0
  246. package/package.json +67 -0
@@ -0,0 +1,3 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite';
2
+ declare const config: StorybookConfig;
3
+ export default config;
@@ -0,0 +1,34 @@
1
+ import * as path from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ const __filename = fileURLToPath(import.meta.url);
4
+ const __dirname = path.dirname(__filename);
5
+ const config = {
6
+ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
7
+ addons: [
8
+ '@chromatic-com/storybook',
9
+ '@storybook/addon-vitest',
10
+ '@storybook/addon-a11y',
11
+ '@storybook/addon-docs',
12
+ '@storybook/addon-onboarding',
13
+ ],
14
+ framework: '@storybook/react-vite',
15
+ async viteFinal(config) {
16
+ if (config.resolve) {
17
+ const alias = config.resolve.alias || {};
18
+ if (Array.isArray(alias)) {
19
+ alias.push({
20
+ find: '@kars',
21
+ replacement: path.resolve(__dirname, '../../kars-modules/src'),
22
+ });
23
+ }
24
+ else {
25
+ config.resolve.alias = {
26
+ ...alias,
27
+ '@kars': path.resolve(__dirname, '../../kars-modules/src'),
28
+ };
29
+ }
30
+ }
31
+ return config;
32
+ },
33
+ };
34
+ export default config;
@@ -0,0 +1,4 @@
1
+ import type { Preview } from '@storybook/react-vite';
2
+ import '../src/index.css';
3
+ declare const preview: Preview;
4
+ export default preview;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { ThemeProvider, WidgetProvider } from '../src';
3
+ import '../src/index.css';
4
+ const preview = {
5
+ decorators: [
6
+ (Story) => {
7
+ return React.createElement(ThemeProvider, null, React.createElement(WidgetProvider, null, Story()));
8
+ },
9
+ ],
10
+ parameters: {
11
+ controls: {
12
+ matchers: {
13
+ color: /(background|color)$/i,
14
+ date: /Date$/i,
15
+ },
16
+ },
17
+ },
18
+ };
19
+ export default preview;
package/dist/index.css ADDED
@@ -0,0 +1,238 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
2
+
3
+ @tailwind base;
4
+ @tailwind components;
5
+ @tailwind utilities;
6
+
7
+ @layer utilities {
8
+ /* Text Sizes */
9
+ .text-xxs { font-size: 8px; line-height: 8px; }
10
+ .text-xs { font-size: var(--text-xs); line-height: var(--text-xs); }
11
+ .text-s { font-size: var(--text-s); line-height: var(--text-s); }
12
+ .text-m { font-size: var(--text-m); line-height: var(--text-m); }
13
+ .text-l { font-size: var(--text-l); line-height: var(--text-l); }
14
+ .text-xl { font-size: var(--text-xl); line-height: var(--text-xl); }
15
+
16
+ /* Padding Sizes (Unified) */
17
+ .p-none { padding: 0; }
18
+ .p-xs { padding: 2px; }
19
+ .p-s { padding: 4px; }
20
+ .p-m { padding: 8px; }
21
+ .p-l { padding: 16px; }
22
+ .p-xl { padding: 32px; }
23
+
24
+ /* Padding Top */
25
+ .pt-none { padding-top: 0; }
26
+ .pt-xs { padding-top: 2px; }
27
+ .pt-s { padding-top: 4px; }
28
+ .pt-m { padding-top: 8px; }
29
+ .pt-l { padding-top: 16px; }
30
+ .pt-xl { padding-top: 32px; }
31
+
32
+ /* Padding Bottom */
33
+ .pb-none { padding-bottom: 0; }
34
+ .pb-xs { padding-bottom: 2px; }
35
+ .pb-s { padding-bottom: 4px; }
36
+ .pb-m { padding-bottom: 8px; }
37
+ .pb-l { padding-bottom: 16px; }
38
+ .pb-xl { padding-bottom: 32px; }
39
+
40
+ /* Padding Left */
41
+ .pl-none { padding-left: 0; }
42
+ .pl-xs { padding-left: 2px; }
43
+ .pl-s { padding-left: 4px; }
44
+ .pl-m { padding-left: 8px; }
45
+ .pl-l { padding-left: 16px; }
46
+ .pl-xl { padding-left: 32px; }
47
+
48
+ /* Padding Right */
49
+ .pr-none { padding-right: 0; }
50
+ .pr-xs { padding-right: 2px; }
51
+ .pr-s { padding-right: 4px; }
52
+ .pr-m { padding-right: 8px; }
53
+ .pr-l { padding-right: 16px; }
54
+ .pr-xl { padding-right: 32px; }
55
+
56
+ /* Padding X */
57
+ .px-none { padding-left: 0; padding-right: 0; }
58
+ .px-xs { padding-left: 2px; padding-right: 2px; }
59
+ .px-s { padding-left: 4px; padding-right: 4px; }
60
+ .px-m { padding-left: 8px; padding-right: 8px; }
61
+ .px-l { padding-left: 16px; padding-right: 16px; }
62
+ .px-xl { padding-left: 32px; padding-right: 32px; }
63
+
64
+ /* Padding Y */
65
+ .py-none { padding-top: 0; padding-bottom: 0; }
66
+ .py-xs { padding-top: 2px; padding-bottom: 2px; }
67
+ .py-s { padding-top: 4px; padding-bottom: 4px; }
68
+ .py-m { padding-top: 8px; padding-bottom: 8px; }
69
+ .py-l { padding-top: 16px; padding-bottom: 16px; }
70
+ .py-xl { padding-top: 32px; padding-bottom: 32px; }
71
+
72
+ /* Margin Sizes (Unified) */
73
+ .m-none { margin: 0; }
74
+ .m-xs { margin: 2px; }
75
+ .m-s { margin: 4px; }
76
+ .m-m { margin: 8px; }
77
+ .m-l { margin: 16px; }
78
+ .m-xl { margin: 32px; }
79
+
80
+ /* margin Top */
81
+ .mt-none { margin-top: 0; }
82
+ .mt-xs { margin-top: 2px; }
83
+ .mt-s { margin-top: 4px; }
84
+ .mt-m { margin-top: 8px; }
85
+ .mt-l { margin-top: 16px; }
86
+ .mt-xl { margin-top: 32px; }
87
+
88
+ /* margin Bottom */
89
+ .mb-none { margin-bottom: 0; }
90
+ .mb-xs { margin-bottom: 2px; }
91
+ .mb-s { margin-bottom: 4px; }
92
+ .mb-m { margin-bottom: 8px; }
93
+ .mb-l { margin-bottom: 16px; }
94
+ .mb-xl { margin-bottom: 32px; }
95
+
96
+ /* margin Left */
97
+ .ml-none { margin-left: 0; }
98
+ .ml-xs { margin-left: 2px; }
99
+ .ml-s { margin-left: 4px; }
100
+ .ml-m { margin-left: 8px; }
101
+ .ml-l { margin-left: 16px; }
102
+ .ml-xl { margin-left: 32px; }
103
+
104
+ /* margin Right */
105
+ .mr-none { margin-right: 0; }
106
+ .mr-xs { margin-right: 2px; }
107
+ .mr-s { margin-right: 4px; }
108
+ .mr-m { margin-right: 8px; }
109
+ .mr-l { margin-right: 16px; }
110
+ .mr-xl { margin-right: 32px; }
111
+
112
+ /* margin X */
113
+ .mx-none { margin-left: 0; margin-right: 0; }
114
+ .mx-xs { margin-left: 2px; margin-right: 2px; }
115
+ .mx-s { margin-left: 4px; margin-right: 4px; }
116
+ .mx-m { margin-left: 8px; margin-right: 8px; }
117
+ .mx-l { margin-left: 16px; margin-right: 16px; }
118
+ .mx-xl { margin-left: 32px; margin-right: 32px; }
119
+
120
+ /* margin Y */
121
+ .my-none { margin-top: 0; margin-bottom: 0; }
122
+ .my-xs { margin-top: 2px; margin-bottom: 2px; }
123
+ .my-s { margin-top: 4px; margin-bottom: 4px; }
124
+ .my-m { margin-top: 8px; margin-bottom: 8px; }
125
+ .my-l { margin-top: 16px; margin-bottom: 16px; }
126
+ .my-xl { margin-top: 32px; margin-bottom: 32px; }
127
+
128
+ /* Gap Sizes */
129
+ .gap-none { gap: 0; }
130
+ .gap-xs { gap: 2px; }
131
+ .gap-s { gap: 4px; }
132
+ .gap-m { gap: 8px; }
133
+ .gap-l { gap: 16px; }
134
+ .gap-xl { gap: 32px; }
135
+ }
136
+
137
+ :root {
138
+ font-family: Roboto, sans-serif;
139
+
140
+ /* Text Sizes */
141
+ --text-xl: 18px;
142
+ --text-l: 16px;
143
+ --text-m: 14px;
144
+ --text-s: 12px;
145
+ --text-xs: 10px;
146
+
147
+ /* Dark theme (default) */
148
+ --background: #232323;
149
+ --background-accent: #272727;
150
+ --foreground: #d9d9d9;
151
+
152
+ --secondary: #3b3b3b;
153
+ --secondary-foreground: #999;
154
+
155
+ --accent: #ed3a64;
156
+ --accent-foreground: #ffffff;
157
+ --shadow: rgba(0, 0, 0, 0.1);
158
+
159
+ --success: #22c55e;
160
+ --warning: #f59e0b;
161
+ --error: #ef4444;
162
+
163
+ font-synthesis: none;
164
+ text-rendering: optimizeLegibility;
165
+ -webkit-font-smoothing: antialiased;
166
+ }
167
+
168
+ .dark {
169
+ color-scheme: dark;
170
+ --background: #232323;
171
+ --background-accent: #272727;
172
+ --foreground: #d9d9d9;
173
+
174
+ --secondary: #3b3b3b;
175
+ --secondary-foreground: #999;
176
+
177
+ --accent: #ed3a64;
178
+ --accent-foreground: #ffffff;
179
+ --shadow: rgba(0, 0, 0, 0.1);
180
+ }
181
+
182
+ .light {
183
+ color-scheme: light;
184
+ --background: #f4f4f4;
185
+ --background-accent: #fafafa;
186
+ --foreground: #080809;
187
+
188
+ --secondary: #e5e7eb;
189
+ --secondary-foreground: #919191;
190
+ --shadow: rgba(0, 0, 0, 0.03);
191
+ }
192
+
193
+ * {
194
+ box-sizing: border-box;
195
+ margin: 0;
196
+ padding: 0;
197
+ font-family: Roboto, sans-serif;
198
+ }
199
+
200
+ .cursor {
201
+ cursor: pointer;
202
+ }
203
+
204
+ a {
205
+ text-decoration: none;
206
+ color: inherit;
207
+ }
208
+
209
+ body {
210
+ width: 100%;
211
+ height: 100vh;
212
+ background-color: var(--background);
213
+ color: var(--foreground);
214
+ }
215
+
216
+ .scrollbar-custom {
217
+ scrollbar-width: thin;
218
+ scrollbar-color: var(--secondary) transparent;
219
+ }
220
+ .scrollbar-custom::-webkit-scrollbar {
221
+ width: 4px;
222
+ height: 4px;
223
+ }
224
+ .scrollbar-custom::-webkit-scrollbar-track {
225
+ background: transparent;
226
+ }
227
+ .scrollbar-custom::-webkit-scrollbar-thumb {
228
+ background-color: var(--secondary);
229
+ border-radius: 10px;
230
+ }
231
+
232
+ .scrollbar-none {
233
+ scrollbar-width: none;
234
+ -ms-overflow-style: none;
235
+ }
236
+ .scrollbar-none::-webkit-scrollbar {
237
+ display: none;
238
+ }
@@ -0,0 +1,4 @@
1
+ import './index.css';
2
+ export * from './ui';
3
+ export * from './providers';
4
+ export * from './utils';
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import './index.css';
2
+ export * from './ui';
3
+ export * from './providers';
4
+ export * from './utils';
@@ -0,0 +1,16 @@
1
+ export type TAlert = {
2
+ id: string;
3
+ title: string;
4
+ description?: string;
5
+ timestamp: Date;
6
+ isRead: boolean;
7
+ };
8
+ export type TAlertContext = {
9
+ currentAlert: TAlert | null;
10
+ history: TAlert[];
11
+ addAlert: (alert: Omit<TAlert, 'id' | 'timestamp' | 'isRead'>) => void;
12
+ clearHistory: () => void;
13
+ dismissCurrentAlert: (isRead?: boolean) => void;
14
+ markAllAsRead: () => void;
15
+ };
16
+ export declare const AlertContext: import("react").Context<TAlertContext | undefined>;
@@ -0,0 +1,2 @@
1
+ import { createContext } from 'react';
2
+ export const AlertContext = createContext(undefined);
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from 'react';
2
+ type TAlertProviderProps = {
3
+ children: ReactNode;
4
+ };
5
+ export declare function AlertProvider({ children }: TAlertProviderProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState, useCallback, useRef } from 'react';
3
+ import { AlertContext } from './alert-context';
4
+ export function AlertProvider({ children }) {
5
+ const [currentAlert, setCurrentAlert] = useState(null);
6
+ const [history, setHistory] = useState([]);
7
+ const timerRef = useRef(null);
8
+ const dismissCurrentAlert = useCallback((isRead = false) => {
9
+ if (timerRef.current) {
10
+ clearTimeout(timerRef.current);
11
+ timerRef.current = null;
12
+ }
13
+ if (isRead && currentAlert) {
14
+ setHistory((prev) => prev.map((a) => (a.id === currentAlert.id ? { ...a, isRead: true } : a)));
15
+ }
16
+ setCurrentAlert(null);
17
+ }, [currentAlert]);
18
+ const addAlert = useCallback((alertData) => {
19
+ const newAlert = {
20
+ ...alertData,
21
+ id: Math.random().toString(36).substring(2, 9),
22
+ timestamp: new Date(),
23
+ isRead: false,
24
+ };
25
+ setHistory((prev) => [newAlert, ...prev]);
26
+ setCurrentAlert(newAlert);
27
+ if (timerRef.current) {
28
+ clearTimeout(timerRef.current);
29
+ }
30
+ timerRef.current = setTimeout(() => {
31
+ setCurrentAlert(null);
32
+ timerRef.current = null;
33
+ }, 5000);
34
+ }, []);
35
+ const clearHistory = useCallback(() => {
36
+ setHistory([]);
37
+ }, []);
38
+ const markAllAsRead = useCallback(() => {
39
+ setHistory((prev) => prev.map((a) => ({ ...a, isRead: true })));
40
+ }, []);
41
+ const value = {
42
+ currentAlert,
43
+ history,
44
+ addAlert,
45
+ clearHistory,
46
+ dismissCurrentAlert,
47
+ markAllAsRead,
48
+ };
49
+ return _jsx(AlertContext.Provider, { value: value, children: children });
50
+ }
@@ -0,0 +1 @@
1
+ export declare const useAlerts: () => import("./alert-context").TAlertContext;
@@ -0,0 +1,9 @@
1
+ import { useContext } from 'react';
2
+ import { AlertContext } from './alert-context';
3
+ export const useAlerts = () => {
4
+ const context = useContext(AlertContext);
5
+ if (context === undefined) {
6
+ throw new Error('useAlerts must be used within an AlertProvider');
7
+ }
8
+ return context;
9
+ };
@@ -0,0 +1,9 @@
1
+ export { WidgetsProviderContext } from './widget/widget-context';
2
+ export { WidgetProvider } from './widget/widget-provider';
3
+ export { useWidget } from './widget/use-widgets';
4
+ export { type TTheme, ThemeProviderContext } from './theme/theme-context';
5
+ export { useTheme } from './theme/use-theme';
6
+ export { ThemeProvider } from './theme/theme-provider';
7
+ export { AlertContext, type TAlert } from './alert/alert-context';
8
+ export { AlertProvider } from './alert/alert-provider';
9
+ export { useAlerts } from './alert/use-alerts';
@@ -0,0 +1,9 @@
1
+ export { WidgetsProviderContext } from './widget/widget-context';
2
+ export { WidgetProvider } from './widget/widget-provider';
3
+ export { useWidget } from './widget/use-widgets';
4
+ export { ThemeProviderContext } from './theme/theme-context';
5
+ export { useTheme } from './theme/use-theme';
6
+ export { ThemeProvider } from './theme/theme-provider';
7
+ export { AlertContext } from './alert/alert-context';
8
+ export { AlertProvider } from './alert/alert-provider';
9
+ export { useAlerts } from './alert/use-alerts';
@@ -0,0 +1,3 @@
1
+ export * from './use-theme';
2
+ export * from './theme-context';
3
+ export * from './theme-provider';
@@ -0,0 +1,3 @@
1
+ export * from './use-theme';
2
+ export * from './theme-context';
3
+ export * from './theme-provider';
@@ -0,0 +1,7 @@
1
+ export type TTheme = 'dark' | 'light' | 'system';
2
+ type ThemeProviderState = {
3
+ theme: TTheme;
4
+ setTheme: (theme: TTheme) => void;
5
+ };
6
+ export declare const ThemeProviderContext: import("react").Context<ThemeProviderState>;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { createContext } from 'react';
2
+ const initialState = {
3
+ theme: 'system',
4
+ setTheme: () => null,
5
+ };
6
+ export const ThemeProviderContext = createContext(initialState);
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type TTheme } from './theme-context';
3
+ type TThemeProviderProps = {
4
+ children: ReactNode;
5
+ defaultTheme?: TTheme;
6
+ storageKey?: string;
7
+ };
8
+ export declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: TThemeProviderProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { ThemeProviderContext } from './theme-context';
4
+ export function ThemeProvider({ children, defaultTheme = 'system', storageKey = 'theme', ...props }) {
5
+ const [theme, setTheme] = useState(() => localStorage.getItem(storageKey) || defaultTheme);
6
+ useEffect(() => {
7
+ const root = window.document.documentElement;
8
+ root.classList.remove('light', 'dark');
9
+ if (theme === 'system') {
10
+ const systemTheme = window.matchMedia('(prefers-color-scheme: dark)')
11
+ .matches
12
+ ? 'dark'
13
+ : 'light';
14
+ root.classList.add(systemTheme);
15
+ return;
16
+ }
17
+ root.classList.add(theme);
18
+ }, [theme]);
19
+ const value = {
20
+ theme,
21
+ setTheme: (theme) => {
22
+ localStorage.setItem(storageKey, theme);
23
+ setTheme(theme);
24
+ },
25
+ };
26
+ return (_jsx(ThemeProviderContext.Provider, { ...props, value: value, children: children }));
27
+ }
@@ -0,0 +1,4 @@
1
+ export declare const useTheme: () => {
2
+ theme: import("./theme-context").TTheme;
3
+ setTheme: (theme: import("./theme-context").TTheme) => void;
4
+ };
@@ -0,0 +1,8 @@
1
+ import { useContext } from 'react';
2
+ import { ThemeProviderContext } from './theme-context';
3
+ export const useTheme = () => {
4
+ const context = useContext(ThemeProviderContext);
5
+ if (context === undefined)
6
+ throw new Error('useTheme must be used within a ThemeProvider');
7
+ return context;
8
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./widget-context";
2
+ export * from "./widget-provider";
3
+ export * from "./use-widgets";
@@ -0,0 +1,3 @@
1
+ export * from "./widget-context";
2
+ export * from "./widget-provider";
3
+ export * from "./use-widgets";
@@ -0,0 +1,4 @@
1
+ export declare const useWidget: () => {
2
+ widget: import("./widget-context").TWidget | null;
3
+ setWidget: (widgets: import("./widget-context").TWidget | null) => void;
4
+ };
@@ -0,0 +1,8 @@
1
+ import { useContext } from 'react';
2
+ import { WidgetsProviderContext } from './widget-context';
3
+ export const useWidget = () => {
4
+ const context = useContext(WidgetsProviderContext);
5
+ if (context === undefined)
6
+ throw new Error('useWidget must be used within a WidgetsProvider');
7
+ return context;
8
+ };
@@ -0,0 +1,12 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { TBlockProps } from '../../ui';
3
+ export type TWidget = {
4
+ ui: ReactElement<TBlockProps>;
5
+ id: string;
6
+ };
7
+ type TWidgetProviderState = {
8
+ widget: TWidget | null;
9
+ setWidget: (widgets: TWidget | null) => void;
10
+ };
11
+ export declare const WidgetsProviderContext: import("react").Context<TWidgetProviderState>;
12
+ export {};
@@ -0,0 +1,6 @@
1
+ import { createContext } from 'react';
2
+ const initialState = {
3
+ widget: null,
4
+ setWidget: () => null,
5
+ };
6
+ export const WidgetsProviderContext = createContext(initialState);
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from 'react';
2
+ type TWidgetProviderProps = {
3
+ children: ReactNode;
4
+ };
5
+ export declare function WidgetProvider({ children }: TWidgetProviderProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo, useState } from 'react';
3
+ import { WidgetsProviderContext } from './widget-context';
4
+ export function WidgetProvider({ children }) {
5
+ const [widget, setWidget] = useState(null);
6
+ const value = useMemo(() => ({
7
+ widget,
8
+ setWidget: (newWidget) => {
9
+ setWidget(newWidget);
10
+ },
11
+ }), [widget]);
12
+ return _jsx(WidgetsProviderContext.Provider, { value: value, children: children });
13
+ }
@@ -0,0 +1,4 @@
1
+ import './index.css';
2
+ export * from './ui/index.js';
3
+ export * from './providers/index.js';
4
+ export * from './utils/index.js';
@@ -0,0 +1,4 @@
1
+ import './index.css';
2
+ export * from './ui/index.js';
3
+ export * from './providers/index.js';
4
+ export * from './utils/index.js';
@@ -0,0 +1,16 @@
1
+ export type TAlert = {
2
+ id: string;
3
+ title: string;
4
+ description?: string;
5
+ timestamp: Date;
6
+ isRead: boolean;
7
+ };
8
+ export type TAlertContext = {
9
+ currentAlert: TAlert | null;
10
+ history: TAlert[];
11
+ addAlert: (alert: Omit<TAlert, 'id' | 'timestamp' | 'isRead'>) => void;
12
+ clearHistory: () => void;
13
+ dismissCurrentAlert: (isRead?: boolean) => void;
14
+ markAllAsRead: () => void;
15
+ };
16
+ export declare const AlertContext: import("react").Context<TAlertContext | undefined>;
@@ -0,0 +1,2 @@
1
+ import { createContext } from 'react';
2
+ export const AlertContext = createContext(undefined);
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from 'react';
2
+ type TAlertProviderProps = {
3
+ children: ReactNode;
4
+ };
5
+ export declare function AlertProvider({ children }: TAlertProviderProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};