@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
@@ -0,0 +1,41 @@
1
+ export const core = {
2
+ disableTelemetry: true,
3
+ builder: "@storybook/builder-vite",
4
+ };
5
+
6
+ export const framework = {
7
+ name: "@storybook/react-vite",
8
+ };
9
+
10
+ export const stories = [
11
+ "../src/stories/**/*.mdx",
12
+ "../src/stories/**/*.stories.@(js|jsx|ts|tsx)",
13
+ ];
14
+
15
+ export const docs = {
16
+ defaultName: "Overview",
17
+ autodocs: "tag",
18
+ };
19
+
20
+ export const staticDirs = [
21
+ "../public",
22
+ { from: "../node_modules/@ilo-org/fonts/font-css", to: "/fonts" },
23
+ ];
24
+
25
+ export const addons = [
26
+ "@storybook/addon-links",
27
+ "@storybook/addon-essentials",
28
+ "@storybook/addon-a11y",
29
+ "@storybook/addon-styling",
30
+ "storybook-addon-rtl-direction",
31
+ ];
32
+
33
+ export const typescript = {
34
+ reactDocgen: "react-docgen-typescript",
35
+ reactDocgenTypescriptOptions: {
36
+ compilerOptions: {
37
+ allowSyntheticDefaultImports: true,
38
+ esModuleInterop: true,
39
+ },
40
+ },
41
+ };
@@ -0,0 +1,92 @@
1
+ <!-- .storybook/manager-head.html -->
2
+ <style>
3
+ @import url("/fonts/fonts-google.css");
4
+ @import url("https://fonts.googleapis.com/css2?family=Fira+Code&display=swap");
5
+ </style>
6
+
7
+ <!-- Canonical URL -->
8
+
9
+ <link href="https://react.ui.ilo.org" rel="canonical" />
10
+
11
+ <!-- Favicon -->
12
+ <link rel="icon" href="/favicon.ico" type="image/x-icon" />
13
+
14
+ <style>
15
+ :root {
16
+ --ilo-white: #fff;
17
+ --ilo-dark-blue: #230050;
18
+ --ilo-light-blue: #ffcd2d;
19
+ --ilo-turquoise: #05d2d2;
20
+ --ilo-purple: #960a55;
21
+ --ilo-light-blue: rgba(235, 245, 253, 1);
22
+ }
23
+
24
+ body {
25
+ font-family: "Noto Sans", sans-serif;
26
+ }
27
+
28
+ a[id*="overview"] > svg {
29
+ color: var(--ilo-purple);
30
+ font-family: "Overpass", sans-serif;
31
+ }
32
+
33
+ a:not[id*="overview"] > svg {
34
+ color: var(--ilo-turquoise);
35
+ }
36
+
37
+ /* Remount component */
38
+ button[title="Remount component"]:hover,
39
+ button[title="Zoom in"]:hover,
40
+ button[title="Zoom out"]:hover,
41
+ button[title="Reset zoom"]:hover,
42
+ button[title="Change the background of the preview"]:hover,
43
+ button[title="Apply a grid to the preview"]:hover,
44
+ button[title="Change the size of the preview"]:hover,
45
+ button[title="Enable measure"]:hover,
46
+ button[title="Apply outlines to the preview"]:hover,
47
+ button[title="Vision simulator"]:hover,
48
+ button[title="Go full screen [F]"]:hover,
49
+ a[title="Open canvas in new tab"]:hover,
50
+ button[title="Copy canvas link"]:hover {
51
+ color: var(--ilo-dark-blue);
52
+ background-color: var(--ilo-light-blue);
53
+ }
54
+
55
+ button.sto-1qova3h,
56
+ button.sto-4f61h0,
57
+ button[title="Rotate viewport"]:hover {
58
+ color: var(--ilo-light-blue);
59
+ }
60
+
61
+ button.tabbutton:active,
62
+ button.tabbutton:focus {
63
+ border-bottom-color: var(--ilo-light-blue);
64
+ }
65
+
66
+ .realm {
67
+ width: 100%;
68
+ background: transparent;
69
+ box-sizing: border-box;
70
+ text-align: left;
71
+ font-size: 0.8rem;
72
+ border-top: 1px solid #d3dce3;
73
+ padding-top: 15px;
74
+ color: #1e2dbe;
75
+ font-weight: 600;
76
+ font-family: "Nunito Sans", sans-serif;
77
+ margin-top: -10px;
78
+ }
79
+ </style>
80
+
81
+ <script>
82
+ window.addEventListener("load", function () {
83
+ const sidebar = document.querySelector(".sidebar-header");
84
+ const customLabel = document.createElement("div");
85
+ customLabel.classList.add("realm");
86
+ customLabel.textContent = "React Components";
87
+
88
+ if (sidebar) {
89
+ sidebar.insertAdjacentElement("afterend", customLabel);
90
+ }
91
+ });
92
+ </script>
@@ -0,0 +1,6 @@
1
+ import { addons } from "@storybook/manager-api";
2
+ import { theme } from "./theme";
3
+
4
+ addons.setConfig({
5
+ theme: theme,
6
+ });
@@ -0,0 +1,5 @@
1
+ <style>
2
+ .story-decorator {
3
+ padding-top: 2rem;
4
+ }
5
+ </style>
@@ -0,0 +1,81 @@
1
+ import { GlobalProvider } from "../src/components/GlobalProvider";
2
+ import { themeprefix } from "@ilo-org/themes/tokens/theme/base.json";
3
+ import { Decorator } from "@storybook/react";
4
+ import { theme } from "./theme";
5
+ import "./styles.scss";
6
+ import { brand } from "@ilo-org/themes/tokens/brand/base.json";
7
+
8
+ export const parameters = {
9
+ actions: { argTypesRegex: "^on[A-Z].*" },
10
+ controls: {
11
+ expanded: true,
12
+ matchers: {
13
+ color: /(background|color)$/i,
14
+ date: /Date$/,
15
+ },
16
+ },
17
+ options: {
18
+ storySort: {
19
+ method: "alphabetical",
20
+ order: ["Welcome", "GettingStarted"],
21
+ locales: "en-US",
22
+ },
23
+ },
24
+ backgrounds: {
25
+ values: [
26
+ { name: "light", value: "white" },
27
+ { name: "dark", value: brand["ilo-dark-blue"].value },
28
+ ],
29
+ },
30
+ previewTabs: {
31
+ "storybook/docs/panel": { index: -1 },
32
+ canvas: { title: "Code", hidden: false },
33
+ },
34
+ viewMode: "docs",
35
+ layout: "padded",
36
+ docs: {
37
+ theme: theme,
38
+ source: {
39
+ excludeDecorators: true,
40
+ },
41
+ },
42
+ };
43
+
44
+ export const decorators: Decorator[] = [
45
+ // Providces the GlobalProvider context to all stories
46
+ (Story) => (
47
+ <GlobalProvider prefix={themeprefix.value}>
48
+ <Story />
49
+ </GlobalProvider>
50
+ ),
51
+ // Wraps components in story mode
52
+ (Story, ctx) => {
53
+ // Should this story be rendered in full width?
54
+ const fullWidthStories = ["footer", "localnav", "navigation", "hero"];
55
+ const isFullWidth = fullWidthStories.some((story) =>
56
+ ctx.title.toLocaleLowerCase().includes(story)
57
+ );
58
+
59
+ if (ctx.viewMode === "story") {
60
+ if (isFullWidth) {
61
+ return <Story />;
62
+ }
63
+
64
+ return (
65
+ <div className="story-decorator-wrapper ">
66
+ <div className="story-decorator">
67
+ <Story />
68
+ </div>
69
+ </div>
70
+ );
71
+ }
72
+ return <Story />;
73
+ },
74
+ ];
75
+
76
+ export const globalTypes = {
77
+ rtlDirection: {
78
+ description: "HTML dir attribute",
79
+ defaultValue: false,
80
+ },
81
+ };
@@ -0,0 +1,25 @@
1
+ @import "@ilo-org/themes/build/scss/tokens";
2
+ @import "@ilo-org/styles/scss/monorepo";
3
+
4
+ h1,
5
+ h2,
6
+ h3,
7
+ h4,
8
+ h5 {
9
+ font-family: "Overpass", sans-serif !important;
10
+ }
11
+
12
+ button[title="Zoom in"]:hover,
13
+ button[title="Zoom out"]:hover,
14
+ button[title="Reset zoom"]:hover {
15
+ color: $brand-ilo-dark-blue;
16
+ background-color: $brand-ilo-light-blue;
17
+ }
18
+
19
+ a[class*="ilo--button"] {
20
+ color: $brand-ilo-dark-blue;
21
+
22
+ &:hover {
23
+ color: $brand-ilo-blue;
24
+ }
25
+ }
@@ -0,0 +1,46 @@
1
+ // .storybook/YourTheme.js
2
+
3
+ import { create } from "@storybook/theming/create";
4
+ import ilo_logo from "@ilo-org/brand-assets/logo_en_horizontal_blue.svg";
5
+ import brandColors from "@ilo-org/themes/tokens/brand/base.json";
6
+
7
+ const { brand } = brandColors;
8
+
9
+ export const theme = create({
10
+ base: "light",
11
+ brandTitle: "ILO Design System for React",
12
+ brandUrl: "https://www.ilo.org/",
13
+ brandImage: ilo_logo,
14
+ brandTarget: "_self",
15
+
16
+ colorPrimary: brand["ilo-dark-blue"].value,
17
+ colorSecondary: brand["ilo-blue"].value,
18
+
19
+ // UI
20
+ appBg: brand["ilo-light-blue"].value,
21
+ appContentBg: brand["ilo-white"].value,
22
+ appBorderColor: brand["ilo-grey-ui"].value,
23
+ appBorderRadius: 0,
24
+
25
+ fontBase: "'Noto Sans', sans-serif",
26
+ fontCode: "'Fira Code', monospace",
27
+
28
+ // Text colors
29
+ textColor: brand["ilo-dark-blue"].value,
30
+ textInverseColor: brand["ilo-white"].value,
31
+ textMutedColor: brand["ilo-grey-accessible"].value,
32
+
33
+ // Toolbar default and active colors
34
+ barTextColor: brand["ilo-white"].value,
35
+ barSelectedColor: brand["ilo-yellow"].value,
36
+ barBg: brand["ilo-dark-blue"].value,
37
+
38
+ buttonBg: brand["ilo-white"].value,
39
+ buttonBorder: brand["ilo-grey-ui"].value,
40
+ booleanBg: brand["ilo-light-blue"].value,
41
+ booleanSelectedBg: brand["ilo-white"].value,
42
+ inputBg: brand["ilo-light-blue"].value,
43
+ inputBorder: brand["ilo-grey-ui"].value,
44
+ inputTextColor: brand["ilo-dark-blue"].value,
45
+ inputBorderRadius: 3,
46
+ });
@@ -0,0 +1,15 @@
1
+
2
+ > @ilo-org/react@0.14.0 build:lib /home/runner/work/designsystem/designsystem/packages/react
3
+ > rollup -c
4
+
5
+ 
6
+ src/index.ts, src/components/**/index.ts, src/components/**/*.tsx, src/hooks/*.ts, src/utils/*.ts → lib/esm, lib/cjs...
7
+ (!) Mixing named and default exports
8
+ https://rollupjs.org/configuration-options/#output-exports
9
+ The following entry modules are using named and default exports together:
10
+ src/components/Fieldset/Fieldset.tsx
11
+ src/components/FormControl/FormControl.tsx
12
+ src/hooks/usePrevious.ts
13
+
14
+ Consumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
15
+ created lib/esm, lib/cjs in 16s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @ilo-org/react
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 977e15006: Fixes a bug where some distribution assets weren't getting included in Design System packages while a lot of non-essential development assets were. At the same time, this removes some `src` directories from the packages which some consumers might have been using.
8
+
9
+ ### Patch Changes
10
+
11
+ - 0d38e6428: Update video.js types
12
+ - f226b7be3: added home screen
13
+ - 8e6c502a7: Fixes some layout issues in List that caused parts of the list item numbers to get chopped off in ordered lists when they were rendered in containers with hidden overflow, as well as some incorrect rendering in RTL layouts.
14
+ - f5a78ab73: Fix profile hover in dark mode in text card
15
+ - 92f05c1fe: commonjs module resolution
16
+ - Updated dependencies [3ceaceaa3]
17
+ - Updated dependencies [13bcd92df]
18
+ - Updated dependencies [8e6c502a7]
19
+ - Updated dependencies [f5a78ab73]
20
+ - Updated dependencies [d0a08d7c3]
21
+ - Updated dependencies [977e15006]
22
+ - @ilo-org/styles@0.16.0
23
+ - @ilo-org/brand-assets@0.5.0
24
+ - @ilo-org/fonts@0.2.0
25
+ - @ilo-org/icons-react@0.1.0
26
+ - @ilo-org/themes@0.8.0
27
+ - @ilo-org/utils@0.1.0
28
+
3
29
  ## 0.13.0
4
30
 
5
31
  ### Minor Changes
@@ -16,7 +16,6 @@ require('react');
16
16
  require('../../../GlobalCtx-10114bdd.js');
17
17
  require('../../Link/Link.js');
18
18
  require('../../List/List.js');
19
- require('../../../ListCtx-14aa546f.js');
20
19
  require('../../List/ListItem.js');
21
20
  require('../../LinkList/LinkList.js');
22
21
  require('../../Profile/Profile.js');