@ilo-org/react 0.13.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 (151) 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 +26 -0
  10. package/lib/cjs/components/Cards/CardGroup/CardGroup.js +0 -1
  11. package/lib/cjs/components/Cards/CardGroup/index.js +197 -160
  12. package/lib/cjs/components/Cards/FactlistCard/FactListCard.js +0 -1
  13. package/lib/cjs/components/Cards/FactlistCard/index.js +0 -1
  14. package/lib/cjs/components/Cards/TextCard/TextCard.js +1 -1
  15. package/lib/cjs/components/List/List.js +9 -11
  16. package/lib/cjs/components/List/ListItem.js +4 -7
  17. package/lib/cjs/components/List/index.js +1 -2
  18. package/lib/cjs/components/index.js +0 -1
  19. package/lib/cjs/index.js +0 -1
  20. package/lib/esm/components/Cards/CardGroup/CardGroup.js +0 -1
  21. package/lib/esm/components/Cards/CardGroup/index.js +197 -160
  22. package/lib/esm/components/Cards/FactlistCard/FactListCard.js +0 -1
  23. package/lib/esm/components/Cards/FactlistCard/index.js +0 -1
  24. package/lib/esm/components/Cards/TextCard/TextCard.js +1 -1
  25. package/lib/esm/components/List/List.js +10 -12
  26. package/lib/esm/components/List/ListItem.js +4 -7
  27. package/lib/esm/components/List/index.js +1 -2
  28. package/lib/esm/components/index.js +0 -1
  29. package/lib/esm/index.js +0 -1
  30. package/lib/types/react/src/components/List/List.props.d.ts +2 -9
  31. package/lib/types/react/src/components/List/ListItem.props.d.ts +0 -6
  32. package/lib/types/react/src/types/index.d.ts +0 -2
  33. package/package.json +32 -12
  34. package/public/fao-logo.svg +195 -0
  35. package/public/favicon.ico +0 -0
  36. package/public/hero.jpg +0 -0
  37. package/public/ilo-dg.jpg +0 -0
  38. package/public/ilo-headquarters.jpg +0 -0
  39. package/public/large.jpg +0 -0
  40. package/public/media-file-poster.jpg +0 -0
  41. package/public/medium.jpg +0 -0
  42. package/public/react.svg +8 -0
  43. package/public/small.jpg +0 -0
  44. package/public/unhcr-logo.svg +1 -0
  45. package/public/unicef-logo.png +0 -0
  46. package/public/video-example.mp4 +0 -0
  47. package/public/wfp-logo.svg +1 -0
  48. package/public/who-logo.svg +1 -0
  49. package/public/youtube-video-poster.avif +0 -0
  50. package/rollup.config.mjs +2 -0
  51. package/src/__tests__/Accordion.test.tsx +16 -0
  52. package/src/__tests__/Button.test.tsx +60 -0
  53. package/src/__tests__/Callout.test.tsx +43 -0
  54. package/src/__tests__/ContextMenu.test.tsx +19 -0
  55. package/src/__tests__/Dropdown.test.tsx +38 -0
  56. package/src/__tests__/Heading.test.tsx +51 -0
  57. package/src/__tests__/Image.test.tsx +21 -0
  58. package/src/__tests__/LinkList.test.tsx +17 -0
  59. package/src/__tests__/List.test.tsx +25 -0
  60. package/src/__tests__/Loading.test.tsx +33 -0
  61. package/src/__tests__/Notification.test.tsx +39 -0
  62. package/src/__tests__/Pagination.test.tsx +58 -0
  63. package/src/__tests__/Profile.test.tsx +48 -0
  64. package/src/__tests__/ReadMore.test.tsx +43 -0
  65. package/src/__tests__/RichText.test.tsx +16 -0
  66. package/src/__tests__/SearchField.test.tsx +35 -0
  67. package/src/__tests__/TableOfContents.test.tsx +12 -0
  68. package/src/__tests__/Tag.test.tsx +10 -0
  69. package/src/components/Cards/CardGroup/CardGroup.args.ts +205 -166
  70. package/src/components/Cards/TextCard/TextCard.tsx +1 -1
  71. package/src/components/List/List.props.ts +2 -10
  72. package/src/components/List/List.tsx +17 -22
  73. package/src/components/List/ListItem.props.ts +0 -7
  74. package/src/components/List/ListItem.tsx +6 -11
  75. package/src/setup.ts +6 -0
  76. package/src/stories/Accordion/Accordion.stories.tsx +145 -0
  77. package/src/stories/Breadcrumb/Breadcrumb.mdx +17 -0
  78. package/src/stories/Breadcrumb/Breadcrumb.stories.tsx +20 -0
  79. package/src/stories/Button/Button.mdx +94 -0
  80. package/src/stories/Button/Button.stories.tsx +68 -0
  81. package/src/stories/Callout/Callout.mdx +35 -0
  82. package/src/stories/Callout/Callout.stories.tsx +43 -0
  83. package/src/stories/Card/DataCard.stories.tsx +45 -0
  84. package/src/stories/Card/DetailCard.stories.tsx +41 -0
  85. package/src/stories/Card/FactlistCard.stories.tsx +48 -0
  86. package/src/stories/Card/FeatureCard.stories.tsx +56 -0
  87. package/src/stories/Card/MultilinkCard.stories.tsx +48 -0
  88. package/src/stories/Card/PromoCard.stories.tsx +48 -0
  89. package/src/stories/Card/StatCard.stories.tsx +45 -0
  90. package/src/stories/Card/TextCard.stories.tsx +45 -0
  91. package/src/stories/CardGroup/CardGroup.mdx +17 -0
  92. package/src/stories/CardGroup/CardGroup.stories.tsx +50 -0
  93. package/src/stories/Checkbox/Checkbox.stories.tsx +118 -0
  94. package/src/stories/ContextMenu/ContextMenu.stories.tsx +83 -0
  95. package/src/stories/DatePicker/DatePicker.stories.tsx +110 -0
  96. package/src/stories/Dropdown/Dropdown.stories.tsx +145 -0
  97. package/src/stories/Empty/Empty.stories.tsx +53 -0
  98. package/src/stories/Fieldset/Fieldset.stories.tsx +167 -0
  99. package/src/stories/FileUpload/FileUpload.stories.tsx +103 -0
  100. package/src/stories/Footer/Footer.mdx +17 -0
  101. package/src/stories/Footer/Footer.stories.tsx +15 -0
  102. package/src/stories/Form/Form.mdx +58 -0
  103. package/src/stories/Form/Form.stories.tsx +162 -0
  104. package/src/stories/GetStarted.mdx +57 -0
  105. package/src/stories/Heading/Heading.stories.tsx +193 -0
  106. package/src/stories/Hero/Hero.stories.tsx +68 -0
  107. package/src/stories/Image/Image.stories.tsx +50 -0
  108. package/src/stories/Link/Link.stories.tsx +81 -0
  109. package/src/stories/LinkList/LinkList.args.ts +190 -0
  110. package/src/stories/LinkList/LinkList.stories.tsx +60 -0
  111. package/src/stories/List/List.stories.tsx +167 -0
  112. package/src/stories/Loading/Loading.stories.tsx +97 -0
  113. package/src/stories/LocalNav/LocalNav.mdx +17 -0
  114. package/src/stories/LocalNav/LocalNav.stories.tsx +15 -0
  115. package/src/stories/Logo/Logo.stories.tsx +172 -0
  116. package/src/stories/LogoGrid/LogoGrid.stories.tsx +59 -0
  117. package/src/stories/Navigation/Navigation.mdx +17 -0
  118. package/src/stories/Navigation/Navigation.stories.tsx +15 -0
  119. package/src/stories/Notification/Notification.stories.tsx +187 -0
  120. package/src/stories/NumberPicker/NumberPicker.stories.tsx +69 -0
  121. package/src/stories/Pagination/Pagination.stories.tsx +86 -0
  122. package/src/stories/Profile/Profile.stories.tsx +64 -0
  123. package/src/stories/Radio/Radio.stories.tsx +232 -0
  124. package/src/stories/ReadMore/ReadMore.stories.tsx +59 -0
  125. package/src/stories/RichText/RichText.stories.tsx +63 -0
  126. package/src/stories/SearchField/SearchField.stories.tsx +91 -0
  127. package/src/stories/SocialMedia/SocialMedia.stories.tsx +60 -0
  128. package/src/stories/TableOfContents/TableOfContents.stories.tsx +55 -0
  129. package/src/stories/Tabs/Tabs.mdx +17 -0
  130. package/src/stories/Tabs/Tabs.stories.tsx +25 -0
  131. package/src/stories/Tag/Tag.stories.tsx +130 -0
  132. package/src/stories/TextInput/TextInput.stories.tsx +100 -0
  133. package/src/stories/Textarea/Textarea.stories.tsx +147 -0
  134. package/src/stories/Toggle/Toggle.stories.tsx +99 -0
  135. package/src/stories/Tooltip/Tooltip.stories.tsx +82 -0
  136. package/src/stories/Video/Video.stories.tsx +71 -0
  137. package/src/stories/Welcome.stories.mdx +37 -0
  138. package/src/stories/assets/code-brackets.svg +1 -0
  139. package/src/stories/assets/colors.svg +1 -0
  140. package/src/stories/assets/comments.svg +1 -0
  141. package/src/stories/assets/direction.svg +1 -0
  142. package/src/stories/assets/flow.svg +1 -0
  143. package/src/stories/assets/plugin.svg +1 -0
  144. package/src/stories/assets/repo.svg +1 -0
  145. package/src/stories/assets/stackalt.svg +1 -0
  146. package/src/stories/welcome.scss +133 -0
  147. package/src/types/index.ts +0 -2
  148. package/lib/cjs/ListCtx-14aa546f.js +0 -9
  149. package/lib/esm/ListCtx-da435fdf.js +0 -6
  150. package/lib/types/react/src/components/List/ListCtx.d.ts +0 -4
  151. package/src/components/List/ListCtx.ts +0 -7
@@ -2,24 +2,22 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var classNames = require('classnames');
5
- var React = require('react');
6
5
  var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
7
- var ListCtx = require('../../ListCtx-14aa546f.js');
8
6
  require('tslib');
7
+ require('react');
9
8
  require('../../GlobalCtx-10114bdd.js');
10
9
 
11
- const List = ({ children, className, alignment, ordered, title, }) => {
10
+ const List = ({ children, className, alignment = "default", ordered = "unstyled", title, }) => {
12
11
  const { prefix } = hooks_useGlobalSettings();
13
12
  const baseClass = `${prefix}--list`;
14
- const [activeItems] = React.useState([]);
15
- const listClasses = classNames(className, {
16
- [baseClass]: true,
17
- [`${baseClass}--${alignment}`]: alignment,
18
- [`${baseClass}--${ordered}`]: true,
13
+ const unstyledClass = `${baseClass}__unstyled`;
14
+ const horizontalClass = `${baseClass}__horizontal`;
15
+ const titleClass = `${baseClass}--title`;
16
+ const listClasses = classNames(className, baseClass, {
17
+ [unstyledClass]: ordered === "unstyled",
18
+ [horizontalClass]: alignment === "horizontal",
19
19
  });
20
- return (jsxRuntime.jsx(ListCtx.ListContext.Provider, Object.assign({ value: {
21
- activeItems,
22
- } }, { children: jsxRuntime.jsxs("div", Object.assign({ className: listClasses }, { children: [title && jsxRuntime.jsx("h5", Object.assign({ className: `${baseClass}__title` }, { children: title })), ordered && ordered === "ordered" && jsxRuntime.jsx("ol", { children: children }), ordered && ordered !== "ordered" && (jsxRuntime.jsx("ul", Object.assign({ className: `${baseClass}--${alignment}` }, { children: children })))] })) })));
20
+ return (jsxRuntime.jsxs("div", Object.assign({ className: listClasses }, { children: [title && jsxRuntime.jsx("h2", Object.assign({ className: titleClass }, { children: title })), ordered && ordered === "ordered" ? (jsxRuntime.jsx("ol", { children: children })) : (jsxRuntime.jsx("ul", { children: children }))] })));
23
21
  };
24
22
 
25
23
  module.exports = List;
@@ -4,18 +4,15 @@ var tslib = require('tslib');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var classNames = require('classnames');
6
6
  var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
7
- var ListCtx = require('../../ListCtx-14aa546f.js');
8
7
  require('react');
9
8
  require('../../GlobalCtx-10114bdd.js');
10
9
 
11
10
  const ListItem = (_a) => {
12
- var { children, id, className } = _a, rest = tslib.__rest(_a, ["children", "id", "className"]);
11
+ var { children, className } = _a, rest = tslib.__rest(_a, ["children", "className"]);
13
12
  const { prefix } = hooks_useGlobalSettings();
14
- const baseClass = `${prefix}--list__item`;
15
- const listItemClasses = classNames(className, {
16
- [baseClass]: true,
17
- });
18
- return (jsxRuntime.jsx(ListCtx.ListItemContext.Provider, Object.assign({ value: { id } }, { children: jsxRuntime.jsx("li", Object.assign({ className: listItemClasses }, rest, { children: children })) })));
13
+ const baseClass = `${prefix}--list--item`;
14
+ const listItemClasses = classNames(className, baseClass);
15
+ return (jsxRuntime.jsx("li", Object.assign({ className: listItemClasses }, rest, { children: children })));
19
16
  };
20
17
 
21
18
  module.exports = ListItem;
@@ -4,11 +4,10 @@ var components_List_List = require('./List.js');
4
4
  var components_List_ListItem = require('./ListItem.js');
5
5
  require('react/jsx-runtime');
6
6
  require('classnames');
7
- require('react');
8
7
  require('../../hooks/useGlobalSettings.js');
9
8
  require('tslib');
9
+ require('react');
10
10
  require('../../GlobalCtx-10114bdd.js');
11
- require('../../ListCtx-14aa546f.js');
12
11
 
13
12
 
14
13
 
@@ -46,7 +46,6 @@ var components_Video_Video = require('./Video/Video.js');
46
46
  var components_Dropdown_Dropdown = require('./Dropdown/Dropdown.js');
47
47
  var components_Icon_Icon = require('./Icon/Icon.js');
48
48
  var components_List_List = require('./List/List.js');
49
- require('../ListCtx-14aa546f.js');
50
49
  var components_Profile_Profile = require('./Profile/Profile.js');
51
50
  var components_TableOfContents_TableOfContents = require('./TableOfContents/TableOfContents.js');
52
51
  var components_Footer_Footer = require('./Footer/Footer.js');
package/lib/cjs/index.js CHANGED
@@ -46,7 +46,6 @@ var components_Video_Video = require('./components/Video/Video.js');
46
46
  var components_Dropdown_Dropdown = require('./components/Dropdown/Dropdown.js');
47
47
  var components_Icon_Icon = require('./components/Icon/Icon.js');
48
48
  var components_List_List = require('./components/List/List.js');
49
- require('./ListCtx-14aa546f.js');
50
49
  var components_Profile_Profile = require('./components/Profile/Profile.js');
51
50
  var components_TableOfContents_TableOfContents = require('./components/TableOfContents/TableOfContents.js');
52
51
  var components_Footer_Footer = require('./components/Footer/Footer.js');
@@ -14,7 +14,6 @@ import 'react';
14
14
  import '../../../GlobalCtx-7fb23cfa.js';
15
15
  import '../../Link/Link.js';
16
16
  import '../../List/List.js';
17
- import '../../../ListCtx-da435fdf.js';
18
17
  import '../../List/ListItem.js';
19
18
  import '../../LinkList/LinkList.js';
20
19
  import '../../Profile/Profile.js';