@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.
- package/.storybook/main.ts +41 -0
- package/.storybook/manager-head.html +92 -0
- package/.storybook/manager.ts +6 -0
- package/.storybook/preview-head.html +5 -0
- package/.storybook/preview.tsx +81 -0
- package/.storybook/styles.scss +25 -0
- package/.storybook/theme.ts +46 -0
- package/.turbo/turbo-build:lib.log +15 -0
- package/CHANGELOG.md +26 -0
- package/lib/cjs/components/Cards/CardGroup/CardGroup.js +0 -1
- package/lib/cjs/components/Cards/CardGroup/index.js +197 -160
- package/lib/cjs/components/Cards/FactlistCard/FactListCard.js +0 -1
- package/lib/cjs/components/Cards/FactlistCard/index.js +0 -1
- package/lib/cjs/components/Cards/TextCard/TextCard.js +1 -1
- package/lib/cjs/components/List/List.js +9 -11
- package/lib/cjs/components/List/ListItem.js +4 -7
- package/lib/cjs/components/List/index.js +1 -2
- package/lib/cjs/components/index.js +0 -1
- package/lib/cjs/index.js +0 -1
- package/lib/esm/components/Cards/CardGroup/CardGroup.js +0 -1
- package/lib/esm/components/Cards/CardGroup/index.js +197 -160
- package/lib/esm/components/Cards/FactlistCard/FactListCard.js +0 -1
- package/lib/esm/components/Cards/FactlistCard/index.js +0 -1
- package/lib/esm/components/Cards/TextCard/TextCard.js +1 -1
- package/lib/esm/components/List/List.js +10 -12
- package/lib/esm/components/List/ListItem.js +4 -7
- package/lib/esm/components/List/index.js +1 -2
- package/lib/esm/components/index.js +0 -1
- package/lib/esm/index.js +0 -1
- package/lib/types/react/src/components/List/List.props.d.ts +2 -9
- package/lib/types/react/src/components/List/ListItem.props.d.ts +0 -6
- package/lib/types/react/src/types/index.d.ts +0 -2
- package/package.json +32 -12
- package/public/fao-logo.svg +195 -0
- package/public/favicon.ico +0 -0
- package/public/hero.jpg +0 -0
- package/public/ilo-dg.jpg +0 -0
- package/public/ilo-headquarters.jpg +0 -0
- package/public/large.jpg +0 -0
- package/public/media-file-poster.jpg +0 -0
- package/public/medium.jpg +0 -0
- package/public/react.svg +8 -0
- package/public/small.jpg +0 -0
- package/public/unhcr-logo.svg +1 -0
- package/public/unicef-logo.png +0 -0
- package/public/video-example.mp4 +0 -0
- package/public/wfp-logo.svg +1 -0
- package/public/who-logo.svg +1 -0
- package/public/youtube-video-poster.avif +0 -0
- package/rollup.config.mjs +2 -0
- package/src/__tests__/Accordion.test.tsx +16 -0
- package/src/__tests__/Button.test.tsx +60 -0
- package/src/__tests__/Callout.test.tsx +43 -0
- package/src/__tests__/ContextMenu.test.tsx +19 -0
- package/src/__tests__/Dropdown.test.tsx +38 -0
- package/src/__tests__/Heading.test.tsx +51 -0
- package/src/__tests__/Image.test.tsx +21 -0
- package/src/__tests__/LinkList.test.tsx +17 -0
- package/src/__tests__/List.test.tsx +25 -0
- package/src/__tests__/Loading.test.tsx +33 -0
- package/src/__tests__/Notification.test.tsx +39 -0
- package/src/__tests__/Pagination.test.tsx +58 -0
- package/src/__tests__/Profile.test.tsx +48 -0
- package/src/__tests__/ReadMore.test.tsx +43 -0
- package/src/__tests__/RichText.test.tsx +16 -0
- package/src/__tests__/SearchField.test.tsx +35 -0
- package/src/__tests__/TableOfContents.test.tsx +12 -0
- package/src/__tests__/Tag.test.tsx +10 -0
- package/src/components/Cards/CardGroup/CardGroup.args.ts +205 -166
- package/src/components/Cards/TextCard/TextCard.tsx +1 -1
- package/src/components/List/List.props.ts +2 -10
- package/src/components/List/List.tsx +17 -22
- package/src/components/List/ListItem.props.ts +0 -7
- package/src/components/List/ListItem.tsx +6 -11
- package/src/setup.ts +6 -0
- package/src/stories/Accordion/Accordion.stories.tsx +145 -0
- package/src/stories/Breadcrumb/Breadcrumb.mdx +17 -0
- package/src/stories/Breadcrumb/Breadcrumb.stories.tsx +20 -0
- package/src/stories/Button/Button.mdx +94 -0
- package/src/stories/Button/Button.stories.tsx +68 -0
- package/src/stories/Callout/Callout.mdx +35 -0
- package/src/stories/Callout/Callout.stories.tsx +43 -0
- package/src/stories/Card/DataCard.stories.tsx +45 -0
- package/src/stories/Card/DetailCard.stories.tsx +41 -0
- package/src/stories/Card/FactlistCard.stories.tsx +48 -0
- package/src/stories/Card/FeatureCard.stories.tsx +56 -0
- package/src/stories/Card/MultilinkCard.stories.tsx +48 -0
- package/src/stories/Card/PromoCard.stories.tsx +48 -0
- package/src/stories/Card/StatCard.stories.tsx +45 -0
- package/src/stories/Card/TextCard.stories.tsx +45 -0
- package/src/stories/CardGroup/CardGroup.mdx +17 -0
- package/src/stories/CardGroup/CardGroup.stories.tsx +50 -0
- package/src/stories/Checkbox/Checkbox.stories.tsx +118 -0
- package/src/stories/ContextMenu/ContextMenu.stories.tsx +83 -0
- package/src/stories/DatePicker/DatePicker.stories.tsx +110 -0
- package/src/stories/Dropdown/Dropdown.stories.tsx +145 -0
- package/src/stories/Empty/Empty.stories.tsx +53 -0
- package/src/stories/Fieldset/Fieldset.stories.tsx +167 -0
- package/src/stories/FileUpload/FileUpload.stories.tsx +103 -0
- package/src/stories/Footer/Footer.mdx +17 -0
- package/src/stories/Footer/Footer.stories.tsx +15 -0
- package/src/stories/Form/Form.mdx +58 -0
- package/src/stories/Form/Form.stories.tsx +162 -0
- package/src/stories/GetStarted.mdx +57 -0
- package/src/stories/Heading/Heading.stories.tsx +193 -0
- package/src/stories/Hero/Hero.stories.tsx +68 -0
- package/src/stories/Image/Image.stories.tsx +50 -0
- package/src/stories/Link/Link.stories.tsx +81 -0
- package/src/stories/LinkList/LinkList.args.ts +190 -0
- package/src/stories/LinkList/LinkList.stories.tsx +60 -0
- package/src/stories/List/List.stories.tsx +167 -0
- package/src/stories/Loading/Loading.stories.tsx +97 -0
- package/src/stories/LocalNav/LocalNav.mdx +17 -0
- package/src/stories/LocalNav/LocalNav.stories.tsx +15 -0
- package/src/stories/Logo/Logo.stories.tsx +172 -0
- package/src/stories/LogoGrid/LogoGrid.stories.tsx +59 -0
- package/src/stories/Navigation/Navigation.mdx +17 -0
- package/src/stories/Navigation/Navigation.stories.tsx +15 -0
- package/src/stories/Notification/Notification.stories.tsx +187 -0
- package/src/stories/NumberPicker/NumberPicker.stories.tsx +69 -0
- package/src/stories/Pagination/Pagination.stories.tsx +86 -0
- package/src/stories/Profile/Profile.stories.tsx +64 -0
- package/src/stories/Radio/Radio.stories.tsx +232 -0
- package/src/stories/ReadMore/ReadMore.stories.tsx +59 -0
- package/src/stories/RichText/RichText.stories.tsx +63 -0
- package/src/stories/SearchField/SearchField.stories.tsx +91 -0
- package/src/stories/SocialMedia/SocialMedia.stories.tsx +60 -0
- package/src/stories/TableOfContents/TableOfContents.stories.tsx +55 -0
- package/src/stories/Tabs/Tabs.mdx +17 -0
- package/src/stories/Tabs/Tabs.stories.tsx +25 -0
- package/src/stories/Tag/Tag.stories.tsx +130 -0
- package/src/stories/TextInput/TextInput.stories.tsx +100 -0
- package/src/stories/Textarea/Textarea.stories.tsx +147 -0
- package/src/stories/Toggle/Toggle.stories.tsx +99 -0
- package/src/stories/Tooltip/Tooltip.stories.tsx +82 -0
- package/src/stories/Video/Video.stories.tsx +71 -0
- package/src/stories/Welcome.stories.mdx +37 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/stories/welcome.scss +133 -0
- package/src/types/index.ts +0 -2
- package/lib/cjs/ListCtx-14aa546f.js +0 -9
- package/lib/esm/ListCtx-da435fdf.js +0 -6
- package/lib/types/react/src/components/List/ListCtx.d.ts +0 -4
- 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
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
[
|
|
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.
|
|
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,
|
|
11
|
+
var { children, className } = _a, rest = tslib.__rest(_a, ["children", "className"]);
|
|
13
12
|
const { prefix } = hooks_useGlobalSettings();
|
|
14
|
-
const baseClass = `${prefix}--
|
|
15
|
-
const listItemClasses = classNames(className,
|
|
16
|
-
|
|
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';
|