this.gui 1.0.15 → 1.0.16

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 (258) hide show
  1. package/README.md +0 -39
  2. package/dist/style.css +1 -1
  3. package/dist/this-gui.es.js +3751 -1882
  4. package/dist/this-gui.umd.js +34 -22
  5. package/package.json +14 -12
  6. package/src/App.jsx +50 -21
  7. package/src/SiteBuilder.jsx +39 -0
  8. package/src/index.mdx +10 -0
  9. package/src/main.jsx +11 -14
  10. package/src/scripts/verifyLayouts.js +175 -0
  11. package/src/scripts/verifyTemplates.js +154 -0
  12. package/src/stories/Atoms/Alert/Alert.css +196 -14
  13. package/src/stories/Atoms/Alert/Alert.jsx +43 -28
  14. package/src/stories/Atoms/Alert/Alert.stories.jsx +154 -28
  15. package/src/stories/Atoms/Audio/Audio.css +246 -16
  16. package/src/stories/Atoms/Audio/Audio.jsx +204 -29
  17. package/src/stories/Atoms/Audio/Audio.stories.jsx +178 -28
  18. package/src/stories/Atoms/Badge/Badge.css +234 -15
  19. package/src/stories/Atoms/Badge/Badge.jsx +44 -31
  20. package/src/stories/Atoms/Badge/Badge.stories.jsx +108 -29
  21. package/src/stories/Atoms/Button/Button.css +106 -45
  22. package/src/stories/Atoms/Button/Button.jsx +31 -82
  23. package/src/stories/Atoms/Button/Button.stories.jsx +170 -40
  24. package/src/stories/Atoms/Caption/Caption.css +156 -16
  25. package/src/stories/Atoms/Caption/Caption.jsx +62 -31
  26. package/src/stories/Atoms/Caption/Caption.stories.jsx +194 -28
  27. package/src/stories/Atoms/Checkbox/Checkbox.css +168 -15
  28. package/src/stories/Atoms/Checkbox/Checkbox.jsx +73 -31
  29. package/src/stories/Atoms/Checkbox/Checkbox.stories.jsx +98 -27
  30. package/src/stories/Atoms/Container/Container.css +75 -15
  31. package/src/stories/Atoms/Container/Container.jsx +41 -28
  32. package/src/stories/Atoms/Container/Container.stories.jsx +92 -29
  33. package/src/stories/Atoms/Divider/Divider.css +131 -13
  34. package/src/stories/Atoms/Divider/Divider.jsx +54 -33
  35. package/src/stories/Atoms/Divider/Divider.stories.jsx +93 -29
  36. package/src/stories/Atoms/Heading/Heading.css +99 -16
  37. package/src/stories/Atoms/Heading/Heading.jsx +57 -29
  38. package/src/stories/Atoms/Heading/Heading.stories.jsx +117 -28
  39. package/src/stories/Atoms/Icon/Icon.css +219 -27
  40. package/src/stories/Atoms/Icon/Icon.jsx +67 -38
  41. package/src/stories/Atoms/Icon/Icon.stories.jsx +156 -51
  42. package/src/stories/Atoms/Image/Image.css +231 -15
  43. package/src/stories/Atoms/Image/Image.jsx +166 -32
  44. package/src/stories/Atoms/Image/Image.stories.jsx +319 -28
  45. package/src/stories/Atoms/Label/Label.css +158 -16
  46. package/src/stories/Atoms/Label/Label.jsx +61 -31
  47. package/src/stories/Atoms/Label/Label.stories.jsx +167 -28
  48. package/src/stories/Atoms/Link/Link.css +58 -16
  49. package/src/stories/Atoms/Link/Link.jsx +73 -32
  50. package/src/stories/Atoms/Link/Link.stories.jsx +141 -29
  51. package/src/stories/Atoms/Loader/Loader.css +93 -16
  52. package/src/stories/Atoms/Loader/Loader.jsx +47 -30
  53. package/src/stories/Atoms/Loader/Loader.stories.jsx +86 -28
  54. package/src/stories/Atoms/Logo/Logo.css +94 -0
  55. package/src/stories/Atoms/Logo/Logo.jsx +53 -0
  56. package/src/stories/Atoms/Logo/Logo.stories.jsx +120 -0
  57. package/src/stories/Atoms/Paragraph/Paragraph.css +167 -16
  58. package/src/stories/Atoms/Paragraph/Paragraph.jsx +67 -31
  59. package/src/stories/Atoms/Paragraph/Paragraph.stories.jsx +130 -28
  60. package/src/stories/Atoms/ProgressBar/ProgressBar.css +115 -17
  61. package/src/stories/Atoms/ProgressBar/ProgressBar.jsx +30 -31
  62. package/src/stories/Atoms/ProgressBar/ProgressBar.stories.jsx +72 -27
  63. package/src/stories/Atoms/RadioButton/RadioButton.css +118 -17
  64. package/src/stories/Atoms/RadioButton/RadioButton.jsx +77 -31
  65. package/src/stories/Atoms/RadioButton/RadioButton.stories.jsx +99 -27
  66. package/src/stories/Atoms/Range/Range.css +169 -0
  67. package/src/stories/Atoms/Range/Range.jsx +87 -0
  68. package/src/stories/Atoms/Range/Range.stories.jsx +110 -0
  69. package/src/stories/Atoms/Select/Select.css +74 -16
  70. package/src/stories/Atoms/Select/Select.jsx +62 -30
  71. package/src/stories/Atoms/Select/Select.stories.jsx +95 -27
  72. package/src/stories/Atoms/Slider/Slider.css +77 -16
  73. package/src/stories/Atoms/Slider/Slider.jsx +119 -31
  74. package/src/stories/Atoms/Slider/Slider.stories.jsx +77 -28
  75. package/src/stories/Atoms/Snackbar/Snackbar.css +297 -13
  76. package/src/stories/Atoms/Snackbar/Snackbar.jsx +62 -31
  77. package/src/stories/Atoms/Snackbar/Snackbar.stories.jsx +63 -26
  78. package/src/stories/Atoms/Spacer/Spacer.css +101 -16
  79. package/src/stories/Atoms/Spacer/Spacer.jsx +26 -32
  80. package/src/stories/Atoms/Spacer/Spacer.stories.jsx +50 -30
  81. package/src/stories/Atoms/Spinner/Spinner.css +97 -16
  82. package/src/stories/Atoms/Spinner/Spinner.jsx +50 -26
  83. package/src/stories/Atoms/Spinner/Spinner.stories.jsx +47 -30
  84. package/src/stories/Atoms/Tag/Tag.css +97 -14
  85. package/src/stories/Atoms/Tag/Tag.jsx +58 -24
  86. package/src/stories/Atoms/Tag/Tag.stories.jsx +55 -29
  87. package/src/stories/Atoms/TextArea/TextArea.css +84 -15
  88. package/src/stories/Atoms/TextArea/TextArea.jsx +107 -31
  89. package/src/stories/Atoms/TextArea/TextArea.stories.jsx +24 -30
  90. package/src/stories/Atoms/TextInput/TextInput.css +89 -17
  91. package/src/stories/Atoms/TextInput/TextInput.jsx +118 -27
  92. package/src/stories/Atoms/TextInput/TextInput.stories.jsx +52 -25
  93. package/src/stories/Atoms/Toggle/Toggle.css +105 -17
  94. package/src/stories/Atoms/Toggle/Toggle.jsx +55 -28
  95. package/src/stories/Atoms/Toggle/Toggle.stories.jsx +23 -30
  96. package/src/stories/Atoms/Tooltip/Tooltip.css +367 -14
  97. package/src/stories/Atoms/Tooltip/Tooltip.jsx +32 -28
  98. package/src/stories/Atoms/Tooltip/Tooltip.stories.jsx +41 -31
  99. package/src/stories/Atoms/Video/Video.css +27 -18
  100. package/src/stories/Atoms/Video/Video.jsx +65 -29
  101. package/src/stories/Atoms/Video/Video.stories.jsx +29 -30
  102. package/src/stories/Atoms/index.js +5 -2
  103. package/src/stories/Atoms/meta_Atoms.js +3 -1
  104. package/src/stories/Layouts/Accordion/Accordion.css +16 -0
  105. package/src/stories/Layouts/Accordion/Accordion.jsx +31 -0
  106. package/src/stories/Layouts/Accordion/Accordion.stories.jsx +28 -0
  107. package/src/stories/Layouts/DropdownMenu/DropdownMenu.css +16 -0
  108. package/src/stories/Layouts/DropdownMenu/DropdownMenu.jsx +31 -0
  109. package/src/stories/Layouts/DropdownMenu/DropdownMenu.stories.jsx +28 -0
  110. package/src/stories/Layouts/Flexbox/Flexbox.css +16 -0
  111. package/src/stories/Layouts/Flexbox/Flexbox.jsx +11 -0
  112. package/src/stories/Layouts/Flexbox/Flexbox.stories.jsx +28 -0
  113. package/src/stories/Layouts/Footer/Footer.css +16 -0
  114. package/src/stories/Layouts/Footer/Footer.jsx +31 -0
  115. package/src/stories/Layouts/Footer/Footer.stories.jsx +28 -0
  116. package/src/stories/Layouts/Grid/Grid.jsx +2 -4
  117. package/src/stories/Layouts/Grid/Grid.stories.jsx +20 -18
  118. package/src/stories/Layouts/Header/Header.css +16 -0
  119. package/src/stories/Layouts/Header/Header.jsx +31 -0
  120. package/src/stories/Layouts/Header/Header.stories.jsx +28 -0
  121. package/src/stories/Layouts/HeroBanner/HeroBanner.css +16 -0
  122. package/src/stories/Layouts/HeroBanner/HeroBanner.jsx +31 -0
  123. package/src/stories/Layouts/HeroBanner/HeroBanner.stories.jsx +28 -0
  124. package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.css +16 -0
  125. package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.jsx +31 -0
  126. package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.stories.jsx +28 -0
  127. package/src/stories/Layouts/Pagination/Pagination.css +16 -0
  128. package/src/stories/Layouts/Pagination/Pagination.jsx +31 -0
  129. package/src/stories/Layouts/Pagination/Pagination.stories.jsx +28 -0
  130. package/src/stories/Layouts/Section/Section.css +16 -0
  131. package/src/stories/Layouts/Section/Section.jsx +31 -0
  132. package/src/stories/Layouts/Section/Section.stories.jsx +28 -0
  133. package/src/stories/Layouts/Sidebar/Sidebar.css +16 -0
  134. package/src/stories/Layouts/Sidebar/Sidebar.jsx +71 -0
  135. package/src/stories/Layouts/Sidebar/Sidebar.stories.jsx +28 -0
  136. package/src/stories/Layouts/Tabs/Tabs.css +16 -0
  137. package/src/stories/Layouts/Tabs/Tabs.jsx +31 -0
  138. package/src/stories/Layouts/Tabs/Tabs.stories.jsx +28 -0
  139. package/src/stories/Layouts/index.js +31 -0
  140. package/src/stories/Layouts/meta_Layouts.js +31 -0
  141. package/src/stories/Molecules/Navbar/Navbar.css +63 -59
  142. package/src/stories/Molecules/Navbar/Navbar.jsx +43 -48
  143. package/src/stories/Molecules/Navbar/Navbar.stories.jsx +58 -8
  144. package/src/stories/Molecules/SearchBar/SearchBar.css +66 -1
  145. package/src/stories/Molecules/SearchBar/SearchBar.jsx +59 -11
  146. package/src/stories/Molecules/SearchBar/SearchBar.stories.jsx +16 -7
  147. package/src/stories/Molecules/SelectTheme/SelectTheme.jsx +16 -38
  148. package/src/stories/Molecules/SelectTheme/SelectTheme.stories.jsx +1 -2
  149. package/src/stories/Molecules/Sidebar/Sidebar.css +65 -2
  150. package/src/stories/Molecules/Sidebar/Sidebar.jsx +66 -11
  151. package/src/stories/Molecules/Sidebar/Sidebar.stories.jsx +20 -5
  152. package/src/stories/Templates/AdminDashboard/AdminDashboard.css +7 -0
  153. package/src/stories/Templates/AdminDashboard/AdminDashboard.jsx +24 -0
  154. package/src/stories/Templates/AdminDashboard/AdminDashboard.stories.jsx +20 -0
  155. package/src/stories/Templates/CallToAction/CallToAction.css +7 -0
  156. package/src/stories/Templates/CallToAction/CallToAction.jsx +24 -0
  157. package/src/stories/Templates/CallToAction/CallToAction.stories.jsx +20 -0
  158. package/src/stories/Templates/FeaturesList/FeaturesList.css +7 -0
  159. package/src/stories/Templates/FeaturesList/FeaturesList.jsx +24 -0
  160. package/src/stories/Templates/FeaturesList/FeaturesList.stories.jsx +20 -0
  161. package/src/stories/Templates/FormSection/FormSection.css +7 -0
  162. package/src/stories/Templates/FormSection/FormSection.jsx +24 -0
  163. package/src/stories/Templates/FormSection/FormSection.stories.jsx +20 -0
  164. package/src/stories/Templates/HeroSection/HeroSection.css +7 -0
  165. package/src/stories/Templates/HeroSection/HeroSection.jsx +24 -0
  166. package/src/stories/Templates/HeroSection/HeroSection.stories.jsx +20 -0
  167. package/src/stories/Templates/LocationInfo/LocationInfo.css +7 -0
  168. package/src/stories/Templates/LocationInfo/LocationInfo.jsx +24 -0
  169. package/src/stories/Templates/LocationInfo/LocationInfo.stories.jsx +20 -0
  170. package/src/stories/Templates/ProductPage/ProductPage.css +7 -0
  171. package/src/stories/Templates/ProductPage/ProductPage.jsx +24 -0
  172. package/src/stories/Templates/ProductPage/ProductPage.stories.jsx +20 -0
  173. package/src/stories/Templates/RegistrationPage/RegistrationPage.css +7 -0
  174. package/src/stories/Templates/RegistrationPage/RegistrationPage.jsx +24 -0
  175. package/src/stories/Templates/RegistrationPage/RegistrationPage.stories.jsx +20 -0
  176. package/src/stories/Templates/ShoppingCart/ShoppingCart.css +7 -0
  177. package/src/stories/Templates/ShoppingCart/ShoppingCart.jsx +24 -0
  178. package/src/stories/Templates/ShoppingCart/ShoppingCart.stories.jsx +20 -0
  179. package/src/stories/Templates/SidebarTopNav/SidebarTopNav.css +7 -0
  180. package/src/stories/Templates/SidebarTopNav/SidebarTopNav.jsx +24 -0
  181. package/src/stories/Templates/SidebarTopNav/SidebarTopNav.stories.jsx +20 -0
  182. package/src/stories/Templates/SignInPage/SignInPage.css +7 -0
  183. package/src/stories/Templates/SignInPage/SignInPage.jsx +24 -0
  184. package/src/stories/Templates/SignInPage/SignInPage.stories.jsx +20 -0
  185. package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.css +7 -0
  186. package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.jsx +24 -0
  187. package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.stories.jsx +20 -0
  188. package/src/stories/Templates/Testimonials/Testimonials.css +7 -0
  189. package/src/stories/Templates/Testimonials/Testimonials.jsx +24 -0
  190. package/src/stories/Templates/Testimonials/Testimonials.stories.jsx +20 -0
  191. package/src/stories/Templates/index.js +33 -0
  192. package/src/stories/Templates/{Templates.js → meta_Templates.js} +3 -1
  193. package/src/stories/assets/logo.png +0 -0
  194. package/src/stories/assets/logo.svg +106 -0
  195. package/src/stories/assets/test.svg +3 -0
  196. package/src/themes/README.md +301 -0
  197. package/src/themes/ThemeProvider.jsx +47 -22
  198. package/src/themes/styles/dracula/dark.css +0 -0
  199. package/src/themes/styles/dracula/light.css +0 -0
  200. package/src/themes/styles/github/dark.css +0 -0
  201. package/src/themes/styles/github/light.css +0 -0
  202. package/src/themes/styles/neurons/dark.css +247 -0
  203. package/src/themes/styles/neurons/light.css +280 -0
  204. package/dist/github-3688a83a.js +0 -5
  205. package/dist/gothic-94a7ecd6.js +0 -5
  206. package/dist/newsprint-32bf94d9.js +0 -5
  207. package/dist/night-4a954853.js +0 -5
  208. package/dist/pixyll-94de4610.js +0 -5
  209. package/dist/whitey-db68723e.js +0 -5
  210. package/src/MDXEditor.jsx +0 -32
  211. package/src/stories/Atoms/RangeInput/RangeInput.css +0 -29
  212. package/src/stories/Atoms/RangeInput/RangeInput.jsx +0 -41
  213. package/src/stories/Atoms/RangeInput/RangeInput.stories.jsx +0 -41
  214. package/src/stories/Components.md +0 -189
  215. package/src/stories/Layouts/Layout.js +0 -28
  216. package/src/styles/Header.modules.css +0 -32
  217. package/src/styles/global.css +0 -59
  218. package/src/themes/Themes.js +0 -44
  219. package/src/themes/dark.js +0 -22
  220. package/src/themes/light.js +0 -22
  221. package/src/themes/typ/Readme.md +0 -4
  222. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700.woff2 +0 -0
  223. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700italic.woff2 +0 -0
  224. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-italic.woff2 +0 -0
  225. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-regular.woff2 +0 -0
  226. package/src/themes/typ/github.css +0 -416
  227. package/src/themes/typ/gothic/GUST e-foundry License.txt +0 -29
  228. package/src/themes/typ/gothic/didact-gothic-c-ext.woff2 +0 -0
  229. package/src/themes/typ/gothic/didact-gothic-c.woff2 +0 -0
  230. package/src/themes/typ/gothic/texgyreadventor-bold.woff +0 -0
  231. package/src/themes/typ/gothic/texgyreadventor-bolditalic.woff +0 -0
  232. package/src/themes/typ/gothic/texgyreadventor-italic.woff +0 -0
  233. package/src/themes/typ/gothic/texgyreadventor-regular.woff +0 -0
  234. package/src/themes/typ/gothic.css +0 -410
  235. package/src/themes/typ/newsprint/pt-serif-v11-latin-700.woff2 +0 -0
  236. package/src/themes/typ/newsprint/pt-serif-v11-latin-700italic.woff2 +0 -0
  237. package/src/themes/typ/newsprint/pt-serif-v11-latin-italic.woff2 +0 -0
  238. package/src/themes/typ/newsprint/pt-serif-v11-latin-regular.woff2 +0 -0
  239. package/src/themes/typ/newsprint.css +0 -622
  240. package/src/themes/typ/night/codeblock.dark.css +0 -113
  241. package/src/themes/typ/night/credit.html +0 -1
  242. package/src/themes/typ/night/cursor.png +0 -0
  243. package/src/themes/typ/night/cursor@2x.png +0 -0
  244. package/src/themes/typ/night/mermaid.dark.css +0 -7
  245. package/src/themes/typ/night/sourcemode.dark.css +0 -38
  246. package/src/themes/typ/night.css +0 -1032
  247. package/src/themes/typ/pixyll/lato-v14-latin-300.woff +0 -0
  248. package/src/themes/typ/pixyll/lato-v14-latin-300italic.woff +0 -0
  249. package/src/themes/typ/pixyll/lato-v14-latin-900.woff +0 -0
  250. package/src/themes/typ/pixyll/lato-v14-latin-900italic.woff +0 -0
  251. package/src/themes/typ/pixyll/merriweather-v19-latin-300.woff +0 -0
  252. package/src/themes/typ/pixyll/merriweather-v19-latin-300italic.woff +0 -0
  253. package/src/themes/typ/pixyll/merriweather-v19-latin-700.woff +0 -0
  254. package/src/themes/typ/pixyll/merriweather-v19-latin-700italic.woff +0 -0
  255. package/src/themes/typ/pixyll.css +0 -528
  256. package/src/themes/typ/whitey.css +0 -299
  257. /package/src/stories/Molecules/{Molecules.js → meta_Molecules.js} +0 -0
  258. /package/src/stories/Organisms/{Organisms.js → meta_Organisms.js} +0 -0
@@ -1,41 +1,207 @@
1
-
1
+ // src/stories/Atoms/Caption/Caption.stories.jsx
2
+ import React from 'react';
2
3
  import { Caption } from './Caption';
4
+ import './Caption.css';
3
5
 
4
- // Storybook configuration for Caption component
5
6
  export default {
6
7
  title: 'Atoms/Text/Caption',
7
8
  component: Caption,
8
- parameters: {
9
- layout: 'centered',
10
- },
11
9
  argTypes: {
12
- children: { control: 'text' },
10
+ text: {
11
+ control: 'text',
12
+ description: 'Text content of the caption.',
13
+ table: {
14
+ type: { summary: 'string' },
15
+ defaultValue: { summary: 'required' },
16
+ },
17
+ },
18
+ variant: {
19
+ control: {
20
+ type: 'select',
21
+ options: [
22
+ 'image',
23
+ 'table',
24
+ 'form',
25
+ 'chart',
26
+ 'transcription',
27
+ 'description',
28
+ 'interactive',
29
+ ],
30
+ },
31
+ description: 'Variant/type of the caption.',
32
+ table: {
33
+ type: { summary: `'image' | 'table' | 'form' | 'chart' | 'transcription' | 'description' | 'interactive'` },
34
+ defaultValue: { summary: 'image' },
35
+ },
36
+ },
37
+ size: {
38
+ control: {
39
+ type: 'select',
40
+ options: ['small', 'normal', 'large'],
41
+ },
42
+ description: 'Size of the caption.',
43
+ table: {
44
+ type: { summary: `'small' | 'normal' | 'large'` },
45
+ defaultValue: { summary: 'normal' },
46
+ },
47
+ },
48
+ color: {
49
+ control: {
50
+ type: 'select',
51
+ options: [
52
+ 'info',
53
+ 'warning',
54
+ 'alert',
55
+ 'success',
56
+ 'neutral',
57
+ 'dark',
58
+ 'classy-color-1',
59
+ 'classy-color-2',
60
+ 'classy-color-3',
61
+ 'classy-color-4',
62
+ 'classy-color-5',
63
+ 'small-switch-color-1',
64
+ 'small-switch-color-2',
65
+ 'natural-color-1',
66
+ 'natural-color-2',
67
+ 'natural-color-3',
68
+ 'grey-friend-1',
69
+ 'grey-friend-2',
70
+ 'shade-1',
71
+ 'shade-2',
72
+ 'shade-3',
73
+ 'shade-4',
74
+ ],
75
+ },
76
+ description: 'Color of the caption (matches global theme colors).',
77
+ table: {
78
+ type: { summary: `'info' | 'warning' | 'alert' | 'success' | 'neutral' | 'dark' | 'classy-color-1' | 'classy-color-2' | 'classy-color-3' | 'classy-color-4' | 'classy-color-5' | 'small-switch-color-1' | 'small-switch-color-2' | 'natural-color-1' | 'natural-color-2' | 'natural-color-3' | 'grey-friend-1' | 'grey-friend-2' | 'shade-1' | 'shade-2' | 'shade-3' | 'shade-4'` },
79
+ },
80
+ },
81
+ className: {
82
+ control: 'text',
83
+ description: 'Additional CSS classes.',
84
+ table: {
85
+ type: { summary: 'string' },
86
+ },
87
+ },
88
+ style: {
89
+ control: 'object',
90
+ description: 'Inline styles.',
91
+ table: {
92
+ type: { summary: 'object' },
93
+ },
94
+ },
13
95
  },
14
96
  };
15
97
 
16
- export const Primary = {
17
- args: {
18
- primary: true,
19
- children: 'This is a primary Caption',
20
- },
21
- };
98
+ /**
99
+ * Image or Video Captions
100
+ */
101
+ export const ImageCaption = () => (
102
+ <figure style={{ textAlign: 'center' }}>
103
+ <img src="https://via.placeholder.com/150" alt="Sample Image" />
104
+ <Caption text="CEO delivering the keynote at the annual conference." variant="image" />
105
+ </figure>
106
+ );
22
107
 
23
- export const Secondary = {
24
- args: {
25
- children: 'This is a secondary Caption',
26
- },
27
- };
108
+ /**
109
+ * Table Captions
110
+ */
111
+ export const TableCaption = () => (
112
+ <figure>
113
+ <table>
114
+ <caption>Quarterly financial results for Q3 2024</caption>
115
+ <thead>
116
+ <tr>
117
+ <th>Revenue</th>
118
+ <th>Expenses</th>
119
+ <th>Profit</th>
120
+ </tr>
121
+ </thead>
122
+ <tbody>
123
+ <tr>
124
+ <td>$1,000,000</td>
125
+ <td>$750,000</td>
126
+ <td>$250,000</td>
127
+ </tr>
128
+ </tbody>
129
+ </table>
130
+ {/* Alternatively, using Caption component */}
131
+ {/* <Caption text="Quarterly financial results for Q3 2024" variant="table" /> */}
132
+ </figure>
133
+ );
28
134
 
29
- export const Large = {
30
- args: {
31
- size: 'large',
32
- children: 'This is a large Caption',
33
- },
34
- };
135
+ /**
136
+ * Form Element Captions
137
+ */
138
+ export const FormCaption = () => (
139
+ <div>
140
+ <label htmlFor="meeting-date">Meeting Date</label>
141
+ <input type="date" id="meeting-date" name="meeting-date" />
142
+ <Caption text="Select your preferred meeting date." variant="form" />
143
+ </div>
144
+ );
35
145
 
36
- export const Small = {
37
- args: {
38
- size: 'small',
39
- children: 'This is a small Caption',
40
- },
146
+ /**
147
+ * Chart or Graph Captions
148
+ */
149
+ export const ChartCaption = () => (
150
+ <div style={{ position: 'relative' }}>
151
+ <img src="https://via.placeholder.com/300x200" alt="Sample Chart" />
152
+ <Caption text="Annual growth rate comparison between 2020 and 2024." variant="chart" />
153
+ </div>
154
+ );
155
+
156
+ /**
157
+ * Audio or Video Transcriptions (Subtitles or Captions)
158
+ */
159
+ export const TranscriptionCaption = () => (
160
+ <div style={{ position: 'relative', display: 'inline-block' }}>
161
+ <video width="300" controls>
162
+ <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4" />
163
+ Your browser does not support the video tag.
164
+ </video>
165
+ <Caption
166
+ text="[Music playing in the background]."
167
+ variant="transcription"
168
+ size="small"
169
+ color="neutral"
170
+ style={{ position: 'absolute', bottom: '10px', left: '50%' }}
171
+ />
172
+ </div>
173
+ );
174
+
175
+ /**
176
+ * Content Descriptions or Explanations
177
+ */
178
+ export const DescriptionCaption = () => (
179
+ <div>
180
+ <img src="https://via.placeholder.com/300x200" alt="Sample Data" />
181
+ <Caption text="Data collected from a sample size of 1000 users." variant="description" />
182
+ </div>
183
+ );
184
+
185
+ /**
186
+ * Captions for Elements
187
+ */
188
+ export const ElementCaption = () => (
189
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
190
+ <button>🔊</button>
191
+ <Caption text="Adjust volume level." variant="interactive" />
192
+ </div>
193
+ );
194
+
195
+ /**
196
+ * Interactive Playground
197
+ */
198
+ const Template = (args) => <Caption {...args} />;
199
+
200
+ export const InteractiveCaptionStory = Template.bind({});
201
+ InteractiveCaptionStory.args = {
202
+ text: 'Interactive Caption',
203
+ variant: 'image',
204
+ size: 'normal',
205
+ color: 'info',
41
206
  };
207
+ InteractiveCaptionStory.storyName = 'Interactive Caption';
@@ -1,29 +1,182 @@
1
+ /* src/stories/Atoms/Checkbox/Checkbox.css */
1
2
 
3
+ /* Base Checkbox Styles */
2
4
  .checkbox {
3
- padding: 16px;
4
- border-radius: 8px;
5
- background-color: #f0f0f0;
6
- border: 1px solid #ddd;
5
+ position: relative;
6
+ display: inline-flex;
7
+ align-items: center;
8
+ cursor: pointer;
9
+ font-family: var(--font-family);
10
+ font-size: var(--font-size-base); /* Inherit base font size */
11
+ color: var(--text-color);
12
+ user-select: none;
7
13
  }
8
14
 
9
- .checkbox--primary {
10
- background-color: #e3f2fd;
11
- border-color: #1e88e5;
15
+ /* Disabled State */
16
+ .checkbox--disabled {
17
+ cursor: not-allowed;
18
+ opacity: 0.6;
12
19
  }
13
20
 
14
- .checkbox--secondary {
15
- background-color: #fff;
16
- border-color: #ccc;
21
+ /* Hidden Checkbox Input */
22
+ .checkbox input {
23
+ opacity: 0;
24
+ position: absolute;
25
+ cursor: pointer;
26
+ height: 0;
27
+ width: 0;
17
28
  }
18
29
 
19
- .checkbox--small {
20
- padding: 8px;
30
+ /* Custom Checkbox */
31
+ .checkbox::before {
32
+ content: '';
33
+ display: inline-block;
34
+ width: 16px;
35
+ height: 16px;
36
+ margin-right: 8px;
37
+ border: 2px solid var(--border-color);
38
+ border-radius: 4px;
39
+ background-color: var(--background-color);
40
+ transition: background-color var(--transition-speed), border-color var(--transition-speed);
41
+ }
42
+
43
+ /* Checked State */
44
+ .checkbox input:checked + .checkbox__label::before {
45
+ background-color: var(--primary-color);
46
+ border-color: var(--primary-color);
47
+ }
48
+
49
+ /* Checkmark */
50
+ .checkbox input:checked + .checkbox__label::after {
51
+ content: '';
52
+ position: absolute;
53
+ left: 5px;
54
+ top: 1px;
55
+ width: 5px;
56
+ height: 10px;
57
+ border: solid var(--text-color-inverse);
58
+ border-width: 0 2px 2px 0;
59
+ transform: rotate(45deg);
60
+ }
61
+
62
+ /* Variants */
63
+ .checkbox--primary::before {
64
+ border-color: var(--primary-color);
21
65
  }
22
66
 
23
- .checkbox--medium {
24
- padding: 16px;
67
+ .checkbox--secondary::before {
68
+ border-color: var(--secondary-color);
69
+ }
70
+
71
+ /* Sizes */
72
+ .checkbox--small {
73
+ font-size: var(--font-size-small); /* Inherit small font size */
25
74
  }
26
75
 
27
76
  .checkbox--large {
28
- padding: 32px;
77
+ font-size: var(--font-size-large); /* Inherit large font size */
78
+ }
79
+
80
+ .checkbox--small::before {
81
+ width: 12px;
82
+ height: 12px;
83
+ }
84
+
85
+ .checkbox--large::before {
86
+ width: 20px;
87
+ height: 20px;
88
+ }
89
+
90
+ /* Rounded */
91
+ .checkbox--rounded::before {
92
+ border-radius: 50%;
93
+ }
94
+
95
+ /* Color Classes */
96
+ .info {
97
+ --primary-color: var(--info-color);
98
+ }
99
+
100
+ .warning {
101
+ --primary-color: var(--warning-color);
102
+ }
103
+
104
+ .alert {
105
+ --primary-color: var(--alert-color);
106
+ }
107
+
108
+ .success {
109
+ --primary-color: var(--success-color);
110
+ }
111
+
112
+ .neutral {
113
+ --primary-color: var(--neutral-color);
114
+ }
115
+
116
+ .dark {
117
+ --primary-color: var(--dark-color);
118
+ }
119
+
120
+ .classy-color-1 {
121
+ --primary-color: var(--classy-color-1);
122
+ }
123
+
124
+ .classy-color-2 {
125
+ --primary-color: var(--classy-color-2);
126
+ }
127
+
128
+ .classy-color-3 {
129
+ --primary-color: var(--classy-color-3);
130
+ }
131
+
132
+ .classy-color-4 {
133
+ --primary-color: var(--classy-color-4);
134
+ }
135
+
136
+ .classy-color-5 {
137
+ --primary-color: var(--classy-color-5);
138
+ }
139
+
140
+ .small-switch-color-1 {
141
+ --primary-color: var(--small-switch-color-1);
142
+ }
143
+
144
+ .small-switch-color-2 {
145
+ --primary-color: var(--small-switch-color-2);
146
+ }
147
+
148
+ .natural-color-1 {
149
+ --primary-color: var(--natural-color-1);
150
+ }
151
+
152
+ .natural-color-2 {
153
+ --primary-color: var(--natural-color-2);
154
+ }
155
+
156
+ .natural-color-3 {
157
+ --primary-color: var(--natural-color-3);
158
+ }
159
+
160
+ .grey-friend-1 {
161
+ --primary-color: var(--grey-friend-1);
162
+ }
163
+
164
+ .grey-friend-2 {
165
+ --primary-color: var(--grey-friend-2);
166
+ }
167
+
168
+ .shade-1 {
169
+ --primary-color: var(--shade-1);
170
+ }
171
+
172
+ .shade-2 {
173
+ --primary-color: var(--shade-2);
174
+ }
175
+
176
+ .shade-3 {
177
+ --primary-color: var(--shade-3);
178
+ }
179
+
180
+ .shade-4 {
181
+ --primary-color: var(--shade-4);
29
182
  }
@@ -1,41 +1,83 @@
1
-
1
+ // src/stories/Atoms/Checkbox/Checkbox.jsx
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
+ import classNames from 'classnames';
4
5
  import './Checkbox.css';
5
6
 
6
- /**
7
- * Checkbox component for user interaction
8
- */
9
- export const Checkbox = ({ primary, size, children, ...props }) => {
10
- const mode = primary ? 'checkbox--primary' : 'checkbox--secondary';
7
+ export const Checkbox = ({
8
+ label,
9
+ checked = false,
10
+ onChange,
11
+ variant = 'primary',
12
+ size = 'normal',
13
+ color = 'info',
14
+ rounded = false,
15
+ disabled = false,
16
+ className = '',
17
+ ...props
18
+ }) => {
19
+ const checkboxClasses = classNames('checkbox', className, {
20
+ [`checkbox--${variant}`]: variant,
21
+ [`checkbox--${size}`]: size !== 'normal',
22
+ [color]: color,
23
+ 'checkbox--rounded': rounded,
24
+ 'checkbox--disabled': disabled,
25
+ });
26
+
11
27
  return (
12
- <div
13
- className={['checkbox', `checkbox--${size}`, mode].join(' ')}
14
- {...props}
15
- >
16
- {children}
17
- </div>
28
+ <label className={checkboxClasses}>
29
+ <input
30
+ type="checkbox"
31
+ checked={checked}
32
+ onChange={onChange}
33
+ disabled={disabled}
34
+ {...props}
35
+ />
36
+ <span className="checkbox__label">{label}</span>
37
+ </label>
18
38
  );
19
39
  };
20
40
 
21
41
  Checkbox.propTypes = {
22
- /**
23
- * Is this the primary style for the component?
24
- */
25
- primary: PropTypes.bool,
26
- /**
27
- * Size of the component
28
- */
29
- size: PropTypes.oneOf(['small', 'medium', 'large']),
30
- /**
31
- * Content to be rendered inside the component
32
- */
33
- children: PropTypes.node.isRequired,
42
+ /** Label text for the checkbox */
43
+ label: PropTypes.string.isRequired,
44
+ /** Checked state of the checkbox */
45
+ checked: PropTypes.bool,
46
+ /** Change handler */
47
+ onChange: PropTypes.func,
48
+ /** Variant of the checkbox */
49
+ variant: PropTypes.oneOf(['primary', 'secondary']),
50
+ /** Size of the checkbox */
51
+ size: PropTypes.oneOf(['small', 'normal', 'large']),
52
+ /** Color from the global palette */
53
+ color: PropTypes.oneOf([
54
+ 'info',
55
+ 'warning',
56
+ 'alert',
57
+ 'success',
58
+ 'neutral',
59
+ 'dark',
60
+ 'classy-color-1',
61
+ 'classy-color-2',
62
+ 'classy-color-3',
63
+ 'classy-color-4',
64
+ 'classy-color-5',
65
+ 'small-switch-color-1',
66
+ 'small-switch-color-2',
67
+ 'natural-color-1',
68
+ 'natural-color-2',
69
+ 'natural-color-3',
70
+ 'grey-friend-1',
71
+ 'grey-friend-2',
72
+ 'shade-1',
73
+ 'shade-2',
74
+ 'shade-3',
75
+ 'shade-4',
76
+ ]),
77
+ /** Rounded or Squared */
78
+ rounded: PropTypes.bool,
79
+ /** Disabled state */
80
+ disabled: PropTypes.bool,
81
+ /** Additional CSS classes */
82
+ className: PropTypes.string,
34
83
  };
35
-
36
- Checkbox.defaultProps = {
37
- primary: false,
38
- size: 'medium',
39
- };
40
-
41
- export default Checkbox;
@@ -1,41 +1,112 @@
1
-
1
+ // src/stories/Atoms/Checkbox/Checkbox.stories.jsx
2
+ import React, { useState } from 'react';
2
3
  import { Checkbox } from './Checkbox';
4
+ import './Checkbox.css';
3
5
 
4
- // Storybook configuration for Checkbox component
5
6
  export default {
6
7
  title: 'Atoms/Interactive/Checkbox',
7
8
  component: Checkbox,
8
- parameters: {
9
- layout: 'centered',
10
- },
11
9
  argTypes: {
12
- children: { control: 'text' },
10
+ label: { control: 'text', defaultValue: 'Checkbox Label' },
11
+ variant: {
12
+ control: { type: 'select', options: ['primary', 'secondary'] },
13
+ description: 'Checkbox variant.',
14
+ },
15
+ size: {
16
+ control: { type: 'select', options: ['small', 'normal', 'large'] },
17
+ description: 'Checkbox size.',
18
+ },
19
+ color: {
20
+ control: {
21
+ type: 'select',
22
+ options: [
23
+ 'info',
24
+ 'warning',
25
+ 'alert',
26
+ 'success',
27
+ 'neutral',
28
+ 'dark',
29
+ 'classy-color-1',
30
+ 'classy-color-2',
31
+ 'classy-color-3',
32
+ 'classy-color-4',
33
+ 'classy-color-5',
34
+ 'small-switch-color-1',
35
+ 'small-switch-color-2',
36
+ 'natural-color-1',
37
+ 'natural-color-2',
38
+ 'natural-color-3',
39
+ 'grey-friend-1',
40
+ 'grey-friend-2',
41
+ 'shade-1',
42
+ 'shade-2',
43
+ 'shade-3',
44
+ 'shade-4',
45
+ ],
46
+ },
47
+ description: 'Checkbox color.',
48
+ },
49
+ rounded: {
50
+ control: 'boolean',
51
+ description: 'Rounded or squared checkbox.',
52
+ },
53
+ disabled: {
54
+ control: 'boolean',
55
+ description: 'Disable the checkbox.',
56
+ },
13
57
  },
14
58
  };
15
59
 
16
- export const Primary = {
17
- args: {
18
- primary: true,
19
- children: 'This is a primary Checkbox',
20
- },
21
- };
60
+ /**
61
+ * Primary Checkbox - Normal Size - Squared
62
+ */
63
+ export const PrimaryNormal = () => (
64
+ <Checkbox label="Primary Normal Checkbox" variant="primary" size="normal" color="info" />
65
+ );
22
66
 
23
- export const Secondary = {
24
- args: {
25
- children: 'This is a secondary Checkbox',
26
- },
27
- };
67
+ /**
68
+ * Secondary Checkbox - Large Size - Rounded
69
+ */
70
+ export const SecondaryLargeRounded = () => (
71
+ <Checkbox label="Secondary Large Rounded Checkbox" variant="secondary" size="large" color="warning" rounded />
72
+ );
28
73
 
29
- export const Large = {
30
- args: {
31
- size: 'large',
32
- children: 'This is a large Checkbox',
33
- },
74
+ /**
75
+ * Primary Checkbox - Small Size - Rounded
76
+ */
77
+ export const PrimarySmallRounded = () => (
78
+ <Checkbox label="Primary Small Rounded Checkbox" variant="primary" size="small" color="success" rounded />
79
+ );
80
+
81
+ /**
82
+ * Secondary Checkbox - Normal Size - Squared
83
+ */
84
+ export const SecondaryNormal = () => (
85
+ <Checkbox label="Secondary Normal Checkbox" variant="secondary" size="normal" color="neutral" />
86
+ );
87
+
88
+ /**
89
+ * Interactive Checkbox
90
+ */
91
+ const Template = (args) => {
92
+ const [checked, setChecked] = useState(args.checked || false);
93
+
94
+ const handleChange = (e) => {
95
+ setChecked(e.target.checked);
96
+ if (args.onChange) args.onChange(e);
97
+ };
98
+
99
+ return <Checkbox {...args} checked={checked} onChange={handleChange} />;
34
100
  };
35
101
 
36
- export const Small = {
37
- args: {
38
- size: 'small',
39
- children: 'This is a small Checkbox',
40
- },
102
+ export const InteractiveCheckbox = Template.bind({});
103
+ InteractiveCheckbox.args = {
104
+ label: 'Interactive Checkbox',
105
+ variant: 'primary',
106
+ size: 'normal',
107
+ color: 'info',
108
+ rounded: false,
109
+ disabled: false,
110
+ checked: false,
41
111
  };
112
+ InteractiveCheckbox.storyName = 'Interactive Checkbox';