@ilo-org/react 0.12.0 → 0.14.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 (260) hide show
  1. package/.storybook/main.ts +41 -0
  2. package/.storybook/manager-head.html +92 -0
  3. package/.storybook/manager.ts +6 -0
  4. package/.storybook/preview-head.html +5 -0
  5. package/.storybook/preview.tsx +81 -0
  6. package/.storybook/styles.scss +25 -0
  7. package/.storybook/theme.ts +46 -0
  8. package/.turbo/turbo-build:lib.log +15 -0
  9. package/CHANGELOG.md +43 -0
  10. package/lib/cjs/components/Cards/CardGroup/CardGroup.js +41 -0
  11. package/lib/cjs/components/Cards/CardGroup/index.js +796 -0
  12. package/lib/cjs/components/Cards/DataCard/DataCard.js +27 -0
  13. package/lib/cjs/components/Cards/DataCard/index.js +73 -19
  14. package/lib/cjs/components/Cards/DetailCard/DetailCard.js +20 -0
  15. package/lib/cjs/components/Cards/DetailCard/index.js +17 -12
  16. package/lib/cjs/components/Cards/FactlistCard/FactListCard.js +22 -0
  17. package/lib/cjs/components/Cards/FactlistCard/index.js +16 -15
  18. package/lib/cjs/components/Cards/FeatureCard/FeatureCard.js +24 -0
  19. package/lib/cjs/components/Cards/FeatureCard/index.js +31 -16
  20. package/lib/cjs/components/Cards/MultilinkCard/MultiLinkCard.js +24 -0
  21. package/lib/cjs/components/Cards/MultilinkCard/index.js +35 -16
  22. package/lib/cjs/components/Cards/PromoCard/PromoCard.js +23 -0
  23. package/lib/cjs/components/Cards/PromoCard/index.js +18 -15
  24. package/lib/cjs/components/Cards/StatCard/StatCard.js +21 -0
  25. package/lib/cjs/components/Cards/StatCard/index.js +15 -13
  26. package/lib/cjs/components/Cards/TextCard/TextCard.js +23 -0
  27. package/lib/cjs/components/Cards/TextCard/index.js +22 -17
  28. package/lib/cjs/components/Footer/Footer.js +1 -1
  29. package/lib/cjs/components/List/List.js +9 -11
  30. package/lib/cjs/components/List/ListItem.js +4 -7
  31. package/lib/cjs/components/List/index.js +1 -2
  32. package/lib/cjs/components/Navigation/Navigation.js +3 -3
  33. package/lib/cjs/components/Pagination/Pagination.js +1 -1
  34. package/lib/cjs/components/index.js +10 -13
  35. package/lib/cjs/index.js +10 -13
  36. package/lib/esm/components/Cards/CardGroup/CardGroup.js +39 -0
  37. package/lib/esm/components/Cards/CardGroup/index.js +793 -0
  38. package/lib/esm/components/Cards/DataCard/DataCard.js +25 -0
  39. package/lib/esm/components/Cards/DataCard/index.js +72 -19
  40. package/lib/esm/components/Cards/DetailCard/DetailCard.js +18 -0
  41. package/lib/esm/components/Cards/DetailCard/index.js +16 -12
  42. package/lib/esm/components/Cards/FactlistCard/FactListCard.js +20 -0
  43. package/lib/esm/components/Cards/FactlistCard/index.js +15 -15
  44. package/lib/esm/components/Cards/FeatureCard/FeatureCard.js +22 -0
  45. package/lib/esm/components/Cards/FeatureCard/index.js +30 -16
  46. package/lib/esm/components/Cards/MultilinkCard/MultiLinkCard.js +22 -0
  47. package/lib/esm/components/Cards/MultilinkCard/index.js +34 -16
  48. package/lib/esm/components/Cards/PromoCard/PromoCard.js +21 -0
  49. package/lib/esm/components/Cards/PromoCard/index.js +17 -15
  50. package/lib/esm/components/Cards/StatCard/StatCard.js +19 -0
  51. package/lib/esm/components/Cards/StatCard/index.js +14 -13
  52. package/lib/esm/components/Cards/TextCard/TextCard.js +21 -0
  53. package/lib/esm/components/Cards/TextCard/index.js +21 -17
  54. package/lib/esm/components/Footer/Footer.js +1 -1
  55. package/lib/esm/components/List/List.js +10 -12
  56. package/lib/esm/components/List/ListItem.js +4 -7
  57. package/lib/esm/components/List/index.js +1 -2
  58. package/lib/esm/components/Navigation/Navigation.js +3 -3
  59. package/lib/esm/components/Pagination/Pagination.js +1 -1
  60. package/lib/esm/components/index.js +9 -11
  61. package/lib/esm/index.js +9 -11
  62. package/lib/types/react/src/components/Cards/CardGroup/CardGroup.args.d.ts +13 -0
  63. package/lib/types/react/src/components/Cards/CardGroup/CardGroup.props.d.ts +58 -0
  64. package/lib/types/react/src/components/Cards/CardGroup/index.d.ts +3 -0
  65. package/lib/types/react/src/components/Cards/DataCard/DataCard.args.d.ts +2 -0
  66. package/lib/types/react/src/components/Cards/DataCard/DataCard.d.ts +4 -0
  67. package/lib/types/react/src/components/Cards/DataCard/DataCard.props.d.ts +50 -0
  68. package/lib/types/react/src/components/Cards/DataCard/index.d.ts +3 -4
  69. package/lib/types/react/src/components/Cards/DetailCard/DetailCard.args.d.ts +3 -0
  70. package/lib/types/react/src/components/Cards/DetailCard/DetailCard.d.ts +4 -0
  71. package/lib/types/react/src/components/Cards/DetailCard/DetailCard.props.d.ts +35 -0
  72. package/lib/types/react/src/components/Cards/DetailCard/index.d.ts +3 -4
  73. package/lib/types/react/src/components/Cards/FactlistCard/FactListCard.args.d.ts +3 -0
  74. package/lib/types/react/src/components/Cards/FactlistCard/FactListCard.d.ts +4 -0
  75. package/lib/types/react/src/components/Cards/FactlistCard/FactListCard.props.d.ts +16 -0
  76. package/lib/types/react/src/components/Cards/FactlistCard/index.d.ts +3 -4
  77. package/lib/types/react/src/components/Cards/FeatureCard/FeatureCard.args.d.ts +3 -0
  78. package/lib/types/react/src/components/Cards/FeatureCard/FeatureCard.d.ts +4 -0
  79. package/lib/types/react/src/components/Cards/FeatureCard/FeatureCard.props.d.ts +31 -0
  80. package/lib/types/react/src/components/Cards/FeatureCard/index.d.ts +3 -4
  81. package/lib/types/react/src/components/Cards/MultilinkCard/MultiLinkCard.d.ts +4 -0
  82. package/lib/types/react/src/components/Cards/MultilinkCard/MultilinkCard.args.d.ts +2 -0
  83. package/lib/types/react/src/components/Cards/MultilinkCard/MultilinkCard.props.d.ts +25 -0
  84. package/lib/types/react/src/components/Cards/MultilinkCard/index.d.ts +3 -4
  85. package/lib/types/react/src/components/Cards/PromoCard/PromoCard.args.d.ts +3 -0
  86. package/lib/types/react/src/components/Cards/PromoCard/PromoCard.d.ts +4 -0
  87. package/lib/types/react/src/components/Cards/PromoCard/PromoCard.props.d.ts +30 -0
  88. package/lib/types/react/src/components/Cards/PromoCard/index.d.ts +3 -4
  89. package/lib/types/react/src/components/Cards/StatCard/StatCard.args.d.ts +3 -0
  90. package/lib/types/react/src/components/Cards/StatCard/StatCard.d.ts +4 -0
  91. package/lib/types/react/src/components/Cards/StatCard/StatCard.props.d.ts +18 -0
  92. package/lib/types/react/src/components/Cards/StatCard/index.d.ts +3 -4
  93. package/lib/types/react/src/components/Cards/TextCard/TextCard.args.d.ts +3 -0
  94. package/lib/types/react/src/components/Cards/TextCard/TextCard.d.ts +4 -0
  95. package/lib/types/react/src/components/Cards/TextCard/TextCard.props.d.ts +26 -0
  96. package/lib/types/react/src/components/Cards/TextCard/index.d.ts +3 -4
  97. package/lib/types/react/src/components/List/List.props.d.ts +2 -9
  98. package/lib/types/react/src/components/List/ListItem.props.d.ts +0 -6
  99. package/lib/types/react/src/components/index.d.ts +1 -1
  100. package/lib/types/react/src/types/index.d.ts +4 -2
  101. package/package.json +32 -12
  102. package/public/react.svg +8 -0
  103. package/rollup.config.mjs +2 -0
  104. package/src/__tests__/Accordion.test.tsx +16 -0
  105. package/src/__tests__/Button.test.tsx +60 -0
  106. package/src/__tests__/Callout.test.tsx +43 -0
  107. package/src/__tests__/ContextMenu.test.tsx +19 -0
  108. package/src/__tests__/Dropdown.test.tsx +38 -0
  109. package/src/__tests__/Heading.test.tsx +51 -0
  110. package/src/__tests__/Image.test.tsx +21 -0
  111. package/src/__tests__/LinkList.test.tsx +17 -0
  112. package/src/__tests__/List.test.tsx +25 -0
  113. package/src/__tests__/Loading.test.tsx +33 -0
  114. package/src/__tests__/Notification.test.tsx +39 -0
  115. package/src/__tests__/Pagination.test.tsx +58 -0
  116. package/src/__tests__/Profile.test.tsx +48 -0
  117. package/src/__tests__/ReadMore.test.tsx +43 -0
  118. package/src/__tests__/RichText.test.tsx +16 -0
  119. package/src/__tests__/SearchField.test.tsx +35 -0
  120. package/src/__tests__/TableOfContents.test.tsx +12 -0
  121. package/src/__tests__/Tag.test.tsx +10 -0
  122. package/src/components/Cards/{CardGroup.args.ts → CardGroup/CardGroup.args.ts} +299 -437
  123. package/src/components/Cards/CardGroup/CardGroup.props.ts +78 -0
  124. package/src/components/Cards/CardGroup/CardGroup.tsx +54 -0
  125. package/src/components/Cards/CardGroup/index.tsx +3 -0
  126. package/src/components/Cards/DataCard/DataCard.args.ts +69 -0
  127. package/src/components/Cards/DataCard/DataCard.props.ts +60 -0
  128. package/src/components/Cards/DataCard/DataCard.tsx +107 -0
  129. package/src/components/Cards/DataCard/index.tsx +3 -107
  130. package/src/components/Cards/DetailCard/DetailCard.args.ts +17 -0
  131. package/src/components/Cards/DetailCard/DetailCard.props.ts +43 -0
  132. package/src/components/Cards/DetailCard/DetailCard.tsx +62 -0
  133. package/src/components/Cards/DetailCard/index.tsx +3 -62
  134. package/src/components/Cards/FactlistCard/FactListCard.args.ts +14 -0
  135. package/src/components/Cards/FactlistCard/FactListCard.props.ts +19 -0
  136. package/src/components/Cards/FactlistCard/FactListCard.tsx +42 -0
  137. package/src/components/Cards/FactlistCard/index.tsx +3 -42
  138. package/src/components/Cards/FeatureCard/FeatureCard.args.ts +30 -0
  139. package/src/components/Cards/FeatureCard/FeatureCard.props.ts +38 -0
  140. package/src/components/Cards/FeatureCard/FeatureCard.tsx +69 -0
  141. package/src/components/Cards/FeatureCard/index.tsx +3 -69
  142. package/src/components/Cards/MultilinkCard/MultiLinkCard.tsx +76 -0
  143. package/src/components/Cards/MultilinkCard/MultilinkCard.args.ts +33 -0
  144. package/src/components/Cards/MultilinkCard/MultilinkCard.props.ts +30 -0
  145. package/src/components/Cards/MultilinkCard/index.tsx +3 -76
  146. package/src/components/Cards/PromoCard/PromoCard.args.ts +19 -0
  147. package/src/components/Cards/PromoCard/PromoCard.props.ts +36 -0
  148. package/src/components/Cards/PromoCard/PromoCard.tsx +60 -0
  149. package/src/components/Cards/PromoCard/index.tsx +3 -60
  150. package/src/components/Cards/StatCard/StatCard.args.ts +14 -0
  151. package/src/components/Cards/StatCard/StatCard.props.ts +21 -0
  152. package/src/components/Cards/StatCard/StatCard.tsx +36 -0
  153. package/src/components/Cards/StatCard/index.tsx +3 -36
  154. package/src/components/Cards/TextCard/TextCard.args.ts +21 -0
  155. package/src/components/Cards/TextCard/TextCard.props.ts +32 -0
  156. package/src/components/Cards/TextCard/TextCard.tsx +62 -0
  157. package/src/components/Cards/TextCard/index.tsx +3 -63
  158. package/src/components/Footer/Footer.args.ts +4 -16
  159. package/src/components/Footer/Footer.tsx +41 -37
  160. package/src/components/List/List.props.ts +2 -10
  161. package/src/components/List/List.tsx +17 -22
  162. package/src/components/List/ListItem.props.ts +0 -7
  163. package/src/components/List/ListItem.tsx +6 -11
  164. package/src/components/Navigation/Navigation.tsx +5 -5
  165. package/src/components/Pagination/Pagination.tsx +2 -1
  166. package/src/components/index.ts +1 -1
  167. package/src/setup.ts +6 -0
  168. package/src/stories/Accordion/Accordion.stories.tsx +145 -0
  169. package/src/stories/Breadcrumb/Breadcrumb.mdx +17 -0
  170. package/src/stories/Breadcrumb/Breadcrumb.stories.tsx +20 -0
  171. package/src/stories/Button/Button.mdx +94 -0
  172. package/src/stories/Button/Button.stories.tsx +68 -0
  173. package/src/stories/Callout/Callout.mdx +35 -0
  174. package/src/stories/Callout/Callout.stories.tsx +43 -0
  175. package/src/stories/Card/DataCard.stories.tsx +45 -0
  176. package/src/stories/Card/DetailCard.stories.tsx +41 -0
  177. package/src/stories/Card/FactlistCard.stories.tsx +48 -0
  178. package/src/stories/Card/FeatureCard.stories.tsx +56 -0
  179. package/src/stories/Card/MultilinkCard.stories.tsx +48 -0
  180. package/src/stories/Card/PromoCard.stories.tsx +48 -0
  181. package/src/stories/Card/StatCard.stories.tsx +45 -0
  182. package/src/stories/Card/TextCard.stories.tsx +45 -0
  183. package/src/stories/CardGroup/CardGroup.mdx +17 -0
  184. package/src/stories/CardGroup/CardGroup.stories.tsx +50 -0
  185. package/src/stories/Checkbox/Checkbox.stories.tsx +118 -0
  186. package/src/stories/ContextMenu/ContextMenu.stories.tsx +83 -0
  187. package/src/stories/DatePicker/DatePicker.stories.tsx +110 -0
  188. package/src/stories/Dropdown/Dropdown.stories.tsx +145 -0
  189. package/src/stories/Empty/Empty.stories.tsx +53 -0
  190. package/src/stories/Fieldset/Fieldset.stories.tsx +167 -0
  191. package/src/stories/FileUpload/FileUpload.stories.tsx +103 -0
  192. package/src/stories/Footer/Footer.mdx +17 -0
  193. package/src/stories/Footer/Footer.stories.tsx +15 -0
  194. package/src/stories/Form/Form.mdx +58 -0
  195. package/src/stories/Form/Form.stories.tsx +162 -0
  196. package/src/stories/GetStarted.mdx +57 -0
  197. package/src/stories/Heading/Heading.stories.tsx +193 -0
  198. package/src/stories/Hero/Hero.stories.tsx +68 -0
  199. package/src/stories/Image/Image.stories.tsx +50 -0
  200. package/src/stories/Link/Link.stories.tsx +81 -0
  201. package/src/stories/LinkList/LinkList.args.ts +190 -0
  202. package/src/stories/LinkList/LinkList.stories.tsx +60 -0
  203. package/src/stories/List/List.stories.tsx +167 -0
  204. package/src/stories/Loading/Loading.stories.tsx +97 -0
  205. package/src/stories/LocalNav/LocalNav.mdx +17 -0
  206. package/src/stories/LocalNav/LocalNav.stories.tsx +15 -0
  207. package/src/stories/Logo/Logo.stories.tsx +172 -0
  208. package/src/stories/LogoGrid/LogoGrid.stories.tsx +59 -0
  209. package/src/stories/Navigation/Navigation.mdx +17 -0
  210. package/src/stories/Navigation/Navigation.stories.tsx +15 -0
  211. package/src/stories/Notification/Notification.stories.tsx +187 -0
  212. package/src/stories/NumberPicker/NumberPicker.stories.tsx +69 -0
  213. package/src/stories/Pagination/Pagination.stories.tsx +86 -0
  214. package/src/stories/Profile/Profile.stories.tsx +64 -0
  215. package/src/stories/Radio/Radio.stories.tsx +232 -0
  216. package/src/stories/ReadMore/ReadMore.stories.tsx +59 -0
  217. package/src/stories/RichText/RichText.stories.tsx +63 -0
  218. package/src/stories/SearchField/SearchField.stories.tsx +91 -0
  219. package/src/stories/SocialMedia/SocialMedia.stories.tsx +60 -0
  220. package/src/stories/TableOfContents/TableOfContents.stories.tsx +55 -0
  221. package/src/stories/Tabs/Tabs.mdx +17 -0
  222. package/src/stories/Tabs/Tabs.stories.tsx +25 -0
  223. package/src/stories/Tag/Tag.stories.tsx +130 -0
  224. package/src/stories/TextInput/TextInput.stories.tsx +100 -0
  225. package/src/stories/Textarea/Textarea.stories.tsx +147 -0
  226. package/src/stories/Toggle/Toggle.stories.tsx +99 -0
  227. package/src/stories/Tooltip/Tooltip.stories.tsx +82 -0
  228. package/src/stories/Video/Video.stories.tsx +71 -0
  229. package/src/stories/Welcome.stories.mdx +37 -0
  230. package/src/stories/assets/code-brackets.svg +1 -0
  231. package/src/stories/assets/colors.svg +1 -0
  232. package/src/stories/assets/comments.svg +1 -0
  233. package/src/stories/assets/direction.svg +1 -0
  234. package/src/stories/assets/flow.svg +1 -0
  235. package/src/stories/assets/plugin.svg +1 -0
  236. package/src/stories/assets/repo.svg +1 -0
  237. package/src/stories/assets/stackalt.svg +1 -0
  238. package/src/stories/welcome.scss +133 -0
  239. package/src/types/index.ts +6 -2
  240. package/lib/cjs/ListCtx-14aa546f.js +0 -9
  241. package/lib/cjs/components/Cards/Card.js +0 -40
  242. package/lib/cjs/components/Cards/CardGroup.js +0 -33
  243. package/lib/cjs/components/Cards/index.js +0 -37
  244. package/lib/esm/ListCtx-da435fdf.js +0 -6
  245. package/lib/esm/components/Cards/Card.js +0 -38
  246. package/lib/esm/components/Cards/CardGroup.js +0 -31
  247. package/lib/esm/components/Cards/index.js +0 -22
  248. package/lib/types/react/src/components/Cards/Card.d.ts +0 -4
  249. package/lib/types/react/src/components/Cards/Card.props.d.ts +0 -307
  250. package/lib/types/react/src/components/Cards/CardGroup.props.d.ts +0 -16
  251. package/lib/types/react/src/components/Cards/index.d.ts +0 -11
  252. package/lib/types/react/src/components/List/ListCtx.d.ts +0 -4
  253. package/src/components/Cards/Card.args.ts +0 -220
  254. package/src/components/Cards/Card.props.ts +0 -382
  255. package/src/components/Cards/Card.tsx +0 -36
  256. package/src/components/Cards/CardGroup.props.ts +0 -19
  257. package/src/components/Cards/CardGroup.tsx +0 -54
  258. package/src/components/Cards/index.ts +0 -22
  259. package/src/components/List/ListCtx.ts +0 -7
  260. /package/lib/types/react/src/components/Cards/{CardGroup.d.ts → CardGroup/CardGroup.d.ts} +0 -0
@@ -66,7 +66,7 @@ const Navigation: FC<NavigationProps> = ({
66
66
  </div>
67
67
  </div>
68
68
  <div className={`${baseClass}--logo-bar`}>
69
- <div className={`${baseClass}--inner`}>
69
+ <div className={`${baseClass}--inner ${prefix}--container`}>
70
70
  <a href={siteurl} className={`${baseClass}--logo-link`}>
71
71
  <img className={`${baseClass}--logo`} src={logo} alt="ILO Logo" />
72
72
  </a>
@@ -82,7 +82,7 @@ const Navigation: FC<NavigationProps> = ({
82
82
  </div>
83
83
  </div>
84
84
  <div className={`${baseClass}--navigation`}>
85
- <div className={`${baseClass}--inner`}>
85
+ <div className={`${baseClass}--inner ${prefix}--container`}>
86
86
  <div className={`${prefix}--mobile--nav`}>
87
87
  <div className={`${prefix}--mobile--nav--logo`}>
88
88
  <a href={siteurl} className={`${baseClass}--logo-link`}>
@@ -115,7 +115,7 @@ const Navigation: FC<NavigationProps> = ({
115
115
  </button>
116
116
  </div>
117
117
  <div className={`${prefix}--mobile--nav--language--select`}>
118
- <div className={`${baseClass}--inner`}>
118
+ <div className={`${baseClass}--inner ${prefix}--container`}>
119
119
  <div className={`${prefix}--mobile--subnav--menu`}>
120
120
  <button
121
121
  className={`${prefix}--mobile--subnav--back`}
@@ -193,7 +193,7 @@ const Navigation: FC<NavigationProps> = ({
193
193
  className={`${prefix}--subnav`}
194
194
  aria-labelledby="secondary-navigation"
195
195
  >
196
- <div className={`${prefix}--subnav--inner`}>
196
+ <div className={`${prefix}--subnav--inner ${prefix}--container`}>
197
197
  <div className={`${prefix}--mobile--subnav`}>
198
198
  <div className={`${prefix}--mobile--subnav--menu`}>
199
199
  <button
@@ -231,7 +231,7 @@ const Navigation: FC<NavigationProps> = ({
231
231
  </nav>
232
232
  )}
233
233
  <div className={`${prefix}--search-box`}>
234
- <div className={`${prefix}--header--inner`}>
234
+ <div className={`${prefix}--header--inner ${prefix}--container`}>
235
235
  <SearchField
236
236
  input={searchfield?.input}
237
237
  action={searchfield?.action}
@@ -84,7 +84,8 @@ const Pagination: FC<PaginationProps> = ({
84
84
  </div>
85
85
 
86
86
  <p className={`${baseClass}--page`}>
87
- <span>{currentPage + 1}</span> {pageCountPreposition}{" "}
87
+ <span>{currentPage + 1}</span>
88
+ <span>{pageCountPreposition}</span>
88
89
  <span>{totalPages}</span>
89
90
  </p>
90
91
 
@@ -41,6 +41,6 @@ export { TableOfContents } from "./TableOfContents";
41
41
  export { Footer } from "./Footer";
42
42
  export { LocalNav } from "./LocalNav";
43
43
  export { Navigation } from "./Navigation";
44
- export { Card, CardGroup } from "./Cards";
44
+ export { CardGroup } from "./Cards/CardGroup";
45
45
  export { Breadcrumb } from "./Breadcrumb";
46
46
  export { Tabs } from "./Tabs";
package/src/setup.ts ADDED
@@ -0,0 +1,6 @@
1
+ import "@testing-library/jest-dom";
2
+ import "@testing-library/jest-dom/extend-expect";
3
+ import { setProjectAnnotations } from "@storybook/react";
4
+ import * as globalStorybookConfig from "../.storybook/preview";
5
+
6
+ setProjectAnnotations(globalStorybookConfig);
@@ -0,0 +1,145 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import {
3
+ Title,
4
+ Subtitle,
5
+ Description,
6
+ Primary,
7
+ ArgTypes,
8
+ Stories,
9
+ } from "@storybook/blocks";
10
+ import {
11
+ Accordion,
12
+ AccordionButton,
13
+ AccordionPanel,
14
+ AccordionItem,
15
+ } from "../../components/Accordion";
16
+ import { AccordionProps } from "../../components/Accordion/Accordion.props";
17
+ import { large } from "../../components/Accordion/Accordion.args";
18
+
19
+ /**
20
+ * Accordion Story
21
+ *
22
+ */
23
+ const AccordionMeta: Meta<typeof Accordion> = {
24
+ title: "Components/Content/Accordion",
25
+ component: Accordion,
26
+ tags: ["autodocs"],
27
+ subcomponents: {
28
+ AccordionItem,
29
+ AccordionButton,
30
+ AccordionPanel,
31
+ },
32
+ parameters: {
33
+ docs: {
34
+ page: () => (
35
+ <>
36
+ <Subtitle />
37
+ <Title />
38
+ <Description>
39
+ The accordion component allows the user to show and hide sections of
40
+ related content on a page. Click the accordions below to
41
+ expand/collapse the accordion content.
42
+ </Description>
43
+ <Primary />
44
+ <Stories title="Examples"></Stories>
45
+ <ArgTypes />
46
+ </>
47
+ ),
48
+ },
49
+ },
50
+ };
51
+
52
+ export default AccordionMeta;
53
+
54
+ //@TODO: We should just use the list component for this
55
+
56
+ const DefaultAccordion = (args: AccordionProps) => (
57
+ <Accordion {...args}>
58
+ <AccordionItem id="l1">
59
+ <AccordionButton>Topics</AccordionButton>
60
+ <AccordionPanel>
61
+ <div style={{ padding: "20px" }}>
62
+ <ul className="ilo--list--unordered">
63
+ <li>Employment Promotion and Job Creation</li>
64
+ <li>Social Protection</li>
65
+ <li>International Labour Standards</li>
66
+ <li>Social Dialogue and Tripartism</li>
67
+ </ul>
68
+ </div>
69
+ </AccordionPanel>
70
+ </AccordionItem>
71
+ <AccordionItem id="l2">
72
+ <AccordionButton>Sectors</AccordionButton>
73
+ <AccordionPanel>
74
+ <div style={{ padding: "20px" }}>
75
+ <ul className="ilo--list--unordered">
76
+ <li>Agriculture, Forestry, and Fishing</li>
77
+ <li>Construction</li>
78
+ <li>Manufacturing</li>
79
+ <li>Transport and Storage</li>
80
+ <li>Wholesale and Retail Trade</li>
81
+ <li>Information and Communication</li>
82
+ </ul>
83
+ </div>
84
+ </AccordionPanel>
85
+ </AccordionItem>
86
+ </Accordion>
87
+ );
88
+
89
+ const Default: StoryObj<typeof DefaultAccordion> = {
90
+ name: "Default",
91
+ args: large,
92
+ render: (args) => <DefaultAccordion {...args} />,
93
+ };
94
+
95
+ const Scrollable: StoryObj<typeof DefaultAccordion> = {
96
+ name: "Scrollable",
97
+ args: large,
98
+ render: (args) => (
99
+ <Accordion {...args}>
100
+ <AccordionItem id="l1">
101
+ <AccordionButton>Topics</AccordionButton>
102
+ <AccordionPanel scroll>
103
+ <div style={{ padding: "20px" }}>
104
+ <ul className="ilo--list--unordered">
105
+ <li>Employment Promotion and Job Creation</li>
106
+ <li>Social Protection</li>
107
+ <li>International Labour Standards</li>
108
+ <li>Social Dialogue and Tripartism</li>
109
+ <li>Occupational Safety and Health</li>
110
+ <li>Labor Migration</li>
111
+ <li>Child Labour and Forced Labour Elimination</li>
112
+ <li>Gender Equality and Non-Discrimination</li>
113
+ <li>Decent Work</li>
114
+ <li>Wages and Working Hours</li>
115
+ <li>Social Security</li>
116
+ <li>Green Jobs</li>
117
+ </ul>
118
+ </div>
119
+ </AccordionPanel>
120
+ </AccordionItem>
121
+ <AccordionItem id="l2">
122
+ <AccordionButton>Sectors</AccordionButton>
123
+ <AccordionPanel scroll>
124
+ <div style={{ padding: "20px" }}>
125
+ <ul className="ilo--list--unordered">
126
+ <li>Agriculture, Forestry, and Fishing</li>
127
+ <li>Construction</li>
128
+ <li>Manufacturing</li>
129
+ <li>Transport and Storage</li>
130
+ <li>Wholesale and Retail Trade</li>
131
+ <li>Information and Communication</li>
132
+ <li>Finance and Insurance</li>
133
+ <li>Health and Social Work</li>
134
+ <li>Educational Services</li>
135
+ <li>Public Administration and Defense</li>
136
+ <li>Other Services</li>
137
+ </ul>
138
+ </div>
139
+ </AccordionPanel>
140
+ </AccordionItem>
141
+ </Accordion>
142
+ ),
143
+ };
144
+
145
+ export { Default, Scrollable };
@@ -0,0 +1,17 @@
1
+ import { Meta, Story, Canvas, ArgsTable, Unstyled } from "@storybook/blocks";
2
+ import * as BreadcrumbStories from "./Breadcrumb.stories.tsx";
3
+ import { Breadcrumb } from "../../components";
4
+
5
+ <Meta title="Breadcrumb" of={BreadcrumbStories} />
6
+
7
+ # Breadcrumb
8
+
9
+ A component for displaying links in a "breadcrumb" style.
10
+
11
+ <Canvas>
12
+ <Story of={BreadcrumbStories.BasicBreadcrumb} />
13
+ </Canvas>
14
+
15
+ ## Default Props
16
+
17
+ <ArgsTable of={Breadcrumb} />
@@ -0,0 +1,20 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Breadcrumb } from "../../components/Breadcrumb";
3
+ import BreadcrumbArgs from "../../components/Breadcrumb/Breadcrumb.args";
4
+
5
+ const BreadcrumbMeta: Meta<typeof Breadcrumb> = {
6
+ title: "Components/Navigation/Breadcrumb",
7
+ component: Breadcrumb,
8
+ };
9
+
10
+ export default BreadcrumbMeta;
11
+
12
+ export const BasicBreadcrumb: StoryObj<typeof Breadcrumb> = {
13
+ args: BreadcrumbArgs.basic,
14
+ name: "Basic",
15
+ };
16
+
17
+ export const FiveLinksBreadcrumb: StoryObj<typeof Breadcrumb> = {
18
+ args: BreadcrumbArgs.fiveLinks,
19
+ name: "Five Links",
20
+ };
@@ -0,0 +1,94 @@
1
+ import { Meta, Story, Canvas, ArgsTable, Unstyled } from "@storybook/blocks";
2
+ import * as ButtonStories from "./Button.stories.tsx";
3
+ import { Button, GlobalProvider } from "../../components";
4
+
5
+ <Meta title="Button" of={ButtonStories} />
6
+
7
+ # Button
8
+
9
+ Buttons allow users to take actions like submitting a form or opening a modal window. They can also be used as links that will navigate users to different pages.
10
+
11
+ <Canvas>
12
+ <Story of={ButtonStories.PrimaryBtn} />
13
+ <Story of={ButtonStories.SecondaryBtn} />
14
+ <Story of={ButtonStories.TertiaryBtn} />
15
+ <Story of={ButtonStories.AlertBtn} />
16
+ <Story of={ButtonStories.IconBtn} />
17
+ <Story of={ButtonStories.DisabledBtn} />
18
+ </Canvas>
19
+
20
+ ## Button sizes
21
+
22
+ Buttons come in three sizes: `large`, `medium` and `small`. The default size is `large`.
23
+
24
+ <div style={{ margin: "0 0 40px" }}>
25
+ <Button
26
+ type="primary"
27
+ size="large"
28
+ label="Large"
29
+ style={{
30
+ marginRight: "1rem",
31
+ display: "table-cell",
32
+ verticalAlign: "bottom",
33
+ }}
34
+ />
35
+ <Button
36
+ type="primary"
37
+ size="medium"
38
+ label="Medium"
39
+ style={{
40
+ marginRight: "1rem",
41
+ display: "table-cell",
42
+ verticalAlign: "bottom",
43
+ }}
44
+ />
45
+ <Button
46
+ type="primary"
47
+ size="small"
48
+ label="Small"
49
+ style={{
50
+ marginRight: "1rem",
51
+ display: "table-cell",
52
+ verticalAlign: "bottom",
53
+ }}
54
+ />
55
+ </div>
56
+
57
+ ## Buttons with icons
58
+
59
+ Buttons can have icons. See the [complete list](https://github.com/international-labour-organization/designsystem/blob/develop/packages/icons/icons.yml) of icons available. By changing the props you can set the icon to use, and set its position in the button. Additonally, you can set the `icononly` prop to `true` if you want the button's label to be visually hidden.
60
+
61
+ <div style={{ display: "flex", flexFlow: "row", margin: "0 0 40px" }}>
62
+ <Button
63
+ type="secondary"
64
+ icon="add"
65
+ label="Icon left"
66
+ style={{ marginRight: "1rem" }}
67
+ />
68
+ <Button
69
+ type="secondary"
70
+ icon="add"
71
+ iconPosition="right"
72
+ label="Icon right"
73
+ style={{ marginRight: "1rem" }}
74
+ />
75
+ <Button
76
+ type="secondary"
77
+ icon="add"
78
+ label="Icon Only"
79
+ icononly
80
+ style={{ marginRight: "1rem" }}
81
+ />
82
+ </div>
83
+
84
+ ## Buttons as links
85
+
86
+ Populating the `url` prop with a valid url and/or an anchor to an id in the current document (e.g. `#my-id`) will result in the same design being displayed, but "under the hood," in the html, an `<a>` element will be used, allowing link functionality. When this is populated, the `target` prop is also read. Populating this, sets the `target` attribute of the anchor tag, which opens the link url in a new tab or window.
87
+
88
+ <Canvas>
89
+ <Story of={ButtonStories.LinkBtn} />
90
+ </Canvas>
91
+
92
+ ## Default Props
93
+
94
+ <ArgsTable of={Button} />
@@ -0,0 +1,68 @@
1
+ import { Button, buttonArgs } from "../../components/Button";
2
+ import { Meta, StoryObj } from "@storybook/react";
3
+
4
+ const argTypes = {
5
+ size: {
6
+ options: ["large", "medium", "small"],
7
+ control: { type: "select" },
8
+ },
9
+ type: {
10
+ options: ["primary", "secondary", "tertiary", "alert"],
11
+ control: { type: "select" },
12
+ },
13
+ icononly: {
14
+ options: [true, false],
15
+ control: { type: "boolean" },
16
+ },
17
+ iconPosition: {
18
+ options: ["left", "center", "right"],
19
+ control: { type: "select" },
20
+ },
21
+ opensmodal: {
22
+ options: [true, false],
23
+ control: { type: "boolean" },
24
+ },
25
+ };
26
+
27
+ const ButtonMeta: Meta<typeof Button> = {
28
+ title: "Components/User Interface/Button",
29
+ component: Button,
30
+ argTypes,
31
+ };
32
+
33
+ export default ButtonMeta;
34
+
35
+ export const PrimaryBtn: StoryObj<typeof Button> = {
36
+ args: buttonArgs.primary,
37
+ name: "Primary",
38
+ };
39
+
40
+ export const SecondaryBtn: StoryObj<typeof Button> = {
41
+ args: buttonArgs.secondary,
42
+ name: "Secondary",
43
+ };
44
+
45
+ export const TertiaryBtn: StoryObj<typeof Button> = {
46
+ args: buttonArgs.tertiary,
47
+ name: "Tertiary",
48
+ };
49
+
50
+ export const AlertBtn: StoryObj<typeof Button> = {
51
+ args: buttonArgs.alert,
52
+ name: "Alert",
53
+ };
54
+
55
+ export const IconBtn: StoryObj<typeof Button> = {
56
+ args: buttonArgs.icon,
57
+ name: "Icon",
58
+ };
59
+
60
+ export const DisabledBtn: StoryObj<typeof Button> = {
61
+ args: buttonArgs.disabled,
62
+ name: "Disabled",
63
+ };
64
+
65
+ export const LinkBtn: StoryObj<typeof Button> = {
66
+ name: "Link",
67
+ args: buttonArgs.link,
68
+ };
@@ -0,0 +1,35 @@
1
+ import { Meta, Story, Canvas, ArgsTable, Unstyled } from "@storybook/blocks";
2
+ import * as CalloutStories from "./Callout.stories.tsx";
3
+ import { Callout } from "../../components";
4
+
5
+ <Meta title="Callout" of={CalloutStories} />
6
+
7
+ # Callout
8
+
9
+ The Callout component provides an inline alert or message to end users.
10
+
11
+ <Canvas>
12
+ <Story of={CalloutStories.InfoCallout} />
13
+ </Canvas>
14
+
15
+ ## Callout type
16
+
17
+ You can change the coloring of the callout with the `type` prop. The default is `info`.
18
+
19
+ ## Examples
20
+
21
+ <Canvas>
22
+ <Story of={CalloutStories.SuccessCallout} />
23
+ </Canvas>
24
+
25
+ <Canvas>
26
+ <Story of={CalloutStories.WarningCallout} />
27
+ </Canvas>
28
+
29
+ <Canvas>
30
+ <Story of={CalloutStories.ErrorCallout} />
31
+ </Canvas>
32
+
33
+ ## Default Props
34
+
35
+ <ArgsTable of={Callout} />
@@ -0,0 +1,43 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Callout, calloutArgs } from "../../components/Callout";
3
+
4
+ const CalloutMeta: Meta<typeof Callout> = {
5
+ title: "Components/Feedback/Callout",
6
+ component: Callout,
7
+ argTypes: {
8
+ isCollapsible: {
9
+ options: [true, false],
10
+ control: { type: "boolean" },
11
+ },
12
+ isOpen: {
13
+ options: [true, false],
14
+ control: { type: "boolean" },
15
+ },
16
+ type: {
17
+ options: ["info", "error", "success", "warning"],
18
+ control: { type: "select" },
19
+ },
20
+ },
21
+ };
22
+
23
+ export default CalloutMeta;
24
+
25
+ export const InfoCallout: StoryObj<typeof Callout> = {
26
+ args: calloutArgs.baseArgs,
27
+ name: "Info",
28
+ };
29
+
30
+ export const SuccessCallout: StoryObj<typeof Callout> = {
31
+ args: calloutArgs.success,
32
+ name: "Success",
33
+ };
34
+
35
+ export const WarningCallout: StoryObj<typeof Callout> = {
36
+ args: calloutArgs.warning,
37
+ name: "Warning",
38
+ };
39
+
40
+ export const ErrorCallout: StoryObj<typeof Callout> = {
41
+ args: calloutArgs.error,
42
+ name: "Error",
43
+ };
@@ -0,0 +1,45 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { DataCard, DataCardArgs } from "../../components/Cards/DataCard";
3
+ import {
4
+ ArgTypes,
5
+ Description,
6
+ Primary,
7
+ Stories,
8
+ Title,
9
+ } from "@storybook/blocks";
10
+
11
+ const CardMeta: Meta<typeof DataCard> = {
12
+ title: "Components/Cards/Data Card",
13
+ component: DataCard,
14
+ tags: ["autodocs"],
15
+ argTypes: {
16
+ size: {
17
+ options: ["narrow", "wide", "fluid"],
18
+ control: { type: "radio" },
19
+ },
20
+ columns: {
21
+ options: ["one", "two"],
22
+ control: { type: "radio" },
23
+ },
24
+ },
25
+ parameters: {
26
+ docs: {
27
+ page: () => (
28
+ <>
29
+ <Title>Card</Title>
30
+ <Description>Cards display prominent content of a page.</Description>
31
+ <Primary />
32
+ <ArgTypes of={CardMeta} />
33
+ <Stories />
34
+ </>
35
+ ),
36
+ },
37
+ },
38
+ };
39
+
40
+ export default CardMeta;
41
+
42
+ export const DataCardDefault: StoryObj<typeof DataCard> = {
43
+ args: DataCardArgs,
44
+ name: "Default",
45
+ };
@@ -0,0 +1,41 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { DetailCard, DetailCardArgs } from "../../components/Cards/DetailCard";
3
+ import {
4
+ ArgTypes,
5
+ Description,
6
+ Primary,
7
+ Stories,
8
+ Title,
9
+ } from "@storybook/blocks";
10
+
11
+ const CardMeta: Meta<typeof DetailCard> = {
12
+ title: "Components/Cards/Detail Card",
13
+ component: DetailCard,
14
+ tags: ["autodocs"],
15
+ argTypes: {
16
+ size: {
17
+ options: ["wide", "narrow", "fluid"],
18
+ control: { type: "radio" },
19
+ },
20
+ },
21
+ parameters: {
22
+ docs: {
23
+ page: () => (
24
+ <>
25
+ <Title>Card</Title>
26
+ <Description>Cards display prominent content of a page.</Description>
27
+ <Primary />
28
+ <ArgTypes of={CardMeta} />
29
+ <Stories />
30
+ </>
31
+ ),
32
+ },
33
+ },
34
+ };
35
+
36
+ export default CardMeta;
37
+
38
+ export const DetailCardDefault: StoryObj<typeof DetailCard> = {
39
+ args: DetailCardArgs,
40
+ name: "Default",
41
+ };
@@ -0,0 +1,48 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import {
3
+ FactlistCard,
4
+ FactlistCardArgs,
5
+ } from "../../components/Cards/FactlistCard";
6
+ import {
7
+ ArgTypes,
8
+ Description,
9
+ Primary,
10
+ Stories,
11
+ Title,
12
+ } from "@storybook/blocks";
13
+
14
+ const CardMeta: Meta<typeof FactlistCard> = {
15
+ title: "Components/Cards/Factlist Card",
16
+ component: FactlistCard,
17
+ tags: ["autodocs"],
18
+ argTypes: {
19
+ theme: {
20
+ options: ["dark", "light"],
21
+ control: { type: "radio" },
22
+ },
23
+ size: {
24
+ options: ["wide", "narrow", "fluid"],
25
+ control: { type: "radio" },
26
+ },
27
+ },
28
+ parameters: {
29
+ docs: {
30
+ page: () => (
31
+ <>
32
+ <Title>Card</Title>
33
+ <Description>Cards display prominent content of a page.</Description>
34
+ <Primary />
35
+ <ArgTypes of={CardMeta} />
36
+ <Stories />
37
+ </>
38
+ ),
39
+ },
40
+ },
41
+ };
42
+
43
+ export default CardMeta;
44
+
45
+ export const FactListCardDefault: StoryObj<typeof FactlistCard> = {
46
+ args: FactlistCardArgs,
47
+ name: "Default",
48
+ };