@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,190 @@
1
+ import { LinkListProps } from "../../components/LinkList/LinkList.props";
2
+
3
+ const basic: LinkListProps = {
4
+ headline: "Link List Headline",
5
+ linkgroup: [
6
+ {
7
+ links: [
8
+ {
9
+ label: "Link One",
10
+ url: "https://www.ilo.org",
11
+ },
12
+ {
13
+ label: "Link Two",
14
+ url: "https://www.ilo.org",
15
+ },
16
+ {
17
+ label: "Link Three",
18
+ url: "https://www.ilo.org",
19
+ },
20
+ {
21
+ label: "Link Four",
22
+ url: "https://www.ilo.org",
23
+ },
24
+ {
25
+ label: "Link Five Is Much Longer",
26
+ url: "https://www.ilo.org",
27
+ },
28
+ ],
29
+ },
30
+ ],
31
+ };
32
+
33
+ const withindented: LinkListProps = {
34
+ headline: "Link List Headline",
35
+ linkgroup: [
36
+ {
37
+ links: [
38
+ {
39
+ label: "Link One",
40
+ url: "https://www.ilo.org",
41
+ },
42
+ {
43
+ indented: true,
44
+ label: "Link Two",
45
+ url: "https://www.ilo.org",
46
+ },
47
+ {
48
+ indented: true,
49
+ label: "Link Three",
50
+ url: "https://www.ilo.org",
51
+ },
52
+ {
53
+ indented: true,
54
+ label: "Link Four",
55
+ url: "https://www.ilo.org",
56
+ },
57
+ {
58
+ label: "Link Five Is Much Longer",
59
+ url: "https://www.ilo.org",
60
+ },
61
+ ],
62
+ },
63
+ ],
64
+ };
65
+
66
+ const withsections: LinkListProps = {
67
+ headline: "Link List Headline",
68
+ linkgroup: [
69
+ {
70
+ headline: "Section Headline",
71
+ links: [
72
+ {
73
+ label: "Link One",
74
+ url: "https://www.ilo.org",
75
+ },
76
+ {
77
+ label: "Link Two",
78
+ url: "https://www.ilo.org",
79
+ },
80
+ {
81
+ label: "Link Three",
82
+ url: "https://www.ilo.org",
83
+ },
84
+ {
85
+ label: "Link Four",
86
+ url: "https://www.ilo.org",
87
+ },
88
+ {
89
+ label: "Link Five Is Much Longer",
90
+ url: "https://www.ilo.org",
91
+ },
92
+ ],
93
+ },
94
+ {
95
+ headline: "Section 2 Headline",
96
+ links: [
97
+ {
98
+ label: "Section 2 Link One",
99
+ url: "https://www.ilo.org",
100
+ },
101
+ {
102
+ label: "Section 2 Link Two",
103
+ url: "https://www.ilo.org",
104
+ },
105
+ {
106
+ label: "Section 2 Link Three",
107
+ url: "https://www.ilo.org",
108
+ },
109
+ {
110
+ label: "Section 2 Link Four",
111
+ url: "https://www.ilo.org",
112
+ },
113
+ {
114
+ label: "Section 2 Link Five",
115
+ url: "https://www.ilo.org",
116
+ },
117
+ ],
118
+ },
119
+ ],
120
+ };
121
+
122
+ const withsectionsindented: LinkListProps = {
123
+ headline: "Link List Headline",
124
+ linkgroup: [
125
+ {
126
+ headline: "Section Headline",
127
+ links: [
128
+ {
129
+ indented: true,
130
+ label: "Link One",
131
+ url: "https://www.ilo.org",
132
+ },
133
+ {
134
+ label: "Link Two",
135
+ url: "https://www.ilo.org",
136
+ },
137
+ {
138
+ label: "Link Three",
139
+ url: "https://www.ilo.org",
140
+ },
141
+ {
142
+ label: "Link Four",
143
+ url: "https://www.ilo.org",
144
+ },
145
+ {
146
+ indented: true,
147
+ label: "Link Five Is Much Longer",
148
+ url: "https://www.ilo.org",
149
+ },
150
+ ],
151
+ },
152
+ {
153
+ headline: "Section 2 Headline",
154
+ links: [
155
+ {
156
+ label: "Section 2 Link One",
157
+ url: "https://www.ilo.org",
158
+ },
159
+ {
160
+ indented: true,
161
+ label: "Section 2 Link Two",
162
+ url: "https://www.ilo.org",
163
+ },
164
+ {
165
+ indented: true,
166
+ label: "Section 2 Link Three",
167
+ url: "https://www.ilo.org",
168
+ },
169
+ {
170
+ indented: true,
171
+ label: "Section 2 Link Four",
172
+ url: "https://www.ilo.org",
173
+ },
174
+ {
175
+ label: "Section 2 Link Five",
176
+ url: "https://www.ilo.org",
177
+ },
178
+ ],
179
+ },
180
+ ],
181
+ };
182
+
183
+ const LinkListArgs = {
184
+ basic,
185
+ withindented,
186
+ withsections,
187
+ withsectionsindented,
188
+ };
189
+
190
+ export default LinkListArgs;
@@ -0,0 +1,60 @@
1
+ import { StoryFn, Meta } from "@storybook/react";
2
+ import { Title, Description, Primary, Stories } from "@storybook/addon-docs";
3
+ import { LinkList } from "../../components/LinkList";
4
+ import { LinkListProps } from "../../components/LinkList/LinkList.props";
5
+ import linkListArgs from "./LinkList.args";
6
+
7
+ const LinkListMeta: Meta<typeof LinkList> = {
8
+ title: "Components/Navigation/LinkList",
9
+ component: LinkList,
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ theme: {
13
+ options: ["light", "dark"],
14
+ control: { type: "select" },
15
+ },
16
+ },
17
+ parameters: {
18
+ docs: {
19
+ page: () => (
20
+ <>
21
+ <Title />
22
+ <Description>
23
+ The Link List component is used to display a meaingfully-grouped set
24
+ of links.
25
+ </Description>
26
+ <Primary />
27
+ <Stories title="Examples"></Stories>
28
+ </>
29
+ ),
30
+ },
31
+ },
32
+ };
33
+
34
+ export default LinkListMeta;
35
+
36
+ const LinkListTemplate: StoryFn<LinkListProps> = (args) => (
37
+ <LinkList {...args} />
38
+ );
39
+
40
+ export const Basic: StoryFn<LinkListProps> = LinkListTemplate.bind({});
41
+
42
+ export const WithIndented: StoryFn<LinkListProps> = LinkListTemplate.bind({});
43
+
44
+ export const WithSections: StoryFn<LinkListProps> = LinkListTemplate.bind({});
45
+
46
+ export const WithSectionsIndented: StoryFn<LinkListProps> =
47
+ LinkListTemplate.bind({});
48
+
49
+ // enumerate the props for the variations on the LinkList component
50
+ Basic.args = linkListArgs.basic;
51
+ Basic.storyName = "Basic";
52
+
53
+ WithIndented.args = linkListArgs.withindented;
54
+ WithIndented.storyName = "Indentation";
55
+
56
+ WithSections.args = linkListArgs.withsections;
57
+ WithSections.storyName = "Sections";
58
+
59
+ WithSectionsIndented.args = linkListArgs.withsectionsindented;
60
+ WithSectionsIndented.storyName = "Sections and indentation";
@@ -0,0 +1,167 @@
1
+ import { StoryFn, Meta } from "@storybook/react";
2
+ import {
3
+ Title,
4
+ Description,
5
+ Primary,
6
+ ArgTypes,
7
+ Stories,
8
+ Subheading,
9
+ } from "@storybook/blocks";
10
+ import { List, ListItem } from "../../components/List";
11
+ import { ListProps } from "../../components/List/List.props";
12
+
13
+ const sizeDoc = `
14
+ By changing the \`ordered\` prop you can use switch from a \`<ol>\` to a \`<ul>\`
15
+
16
+ | ordered | Description |
17
+ |----------|-------------|
18
+ | \`ordered\` | make a \`<ol>\` |
19
+ | \`unordered\` | make a \`<ul>\` |
20
+ | \`unstyled\` | make a \`<ul>\` without markers |
21
+ `;
22
+
23
+ const ListMeta: Meta<typeof List> = {
24
+ title: "Components/Content/List",
25
+ tags: ["autodocs"],
26
+ component: List,
27
+ argTypes: {
28
+ alignment: {
29
+ options: ["horizontal", "default"],
30
+ control: { type: "select" },
31
+ },
32
+ ordered: {
33
+ options: ["ordered", "unordered", "unstyled"],
34
+ control: { type: "select" },
35
+ },
36
+ },
37
+ subcomponents: {
38
+ ListItem,
39
+ },
40
+ parameters: {
41
+ docs: {
42
+ page: () => (
43
+ <>
44
+ <Title />
45
+ <Description>
46
+ The List component renders a styled list of text items. In addition
47
+ to the List styles made available in the RichText component, the
48
+ List component also includes unstyled and horizontally aligned
49
+ lists.
50
+ </Description>
51
+ <Primary />
52
+ <Subheading>Size Prop</Subheading>
53
+ <Description>{sizeDoc}</Description>
54
+ <Stories title="Examples"></Stories>
55
+ <Subheading>Default Props</Subheading>
56
+ <ArgTypes />
57
+ </>
58
+ ),
59
+ },
60
+ },
61
+ };
62
+
63
+ export default ListMeta;
64
+
65
+ const longTitle =
66
+ "Four strategic objectives at the heart of the Decent Work agenda";
67
+
68
+ const shortTitle = "The Decent Work agenda";
69
+
70
+ const OrderedTemplate: StoryFn<ListProps> = () => (
71
+ <List title={longTitle} ordered="ordered">
72
+ <ListItem id="ordered1">
73
+ <p>
74
+ Set and promote standards and fundamental principles and rights at work
75
+ </p>
76
+ </ListItem>
77
+ <ListItem id="ordered2">
78
+ <p>
79
+ Create greater opportunities for women and men to decent employment and
80
+ income
81
+ </p>
82
+ </ListItem>
83
+ <ListItem id="ordered3">
84
+ <p>Enhance the coverage and effectiveness of social protection for all</p>
85
+ </ListItem>
86
+ <ListItem id="ordered4">
87
+ <p>Strengthen tripartism and social dialogue</p>
88
+ </ListItem>
89
+ </List>
90
+ );
91
+
92
+ const UnorderedTemplate: StoryFn<ListProps> = () => (
93
+ <List title={longTitle} ordered="unordered">
94
+ <ListItem id="unordered1">
95
+ <p>
96
+ Set and promote standards and fundamental principles and rights at work{" "}
97
+ </p>
98
+ </ListItem>
99
+ <ListItem id="unordered2">
100
+ <p>
101
+ Create greater opportunities for women and men to decent employment and
102
+ income
103
+ </p>
104
+ </ListItem>
105
+ <ListItem id="unordered3">
106
+ <p>Enhance the coverage and effectiveness of social protection for all</p>
107
+ </ListItem>
108
+ <ListItem id="unordered4">
109
+ <p>Strengthen tripartism and social dialogue</p>
110
+ </ListItem>
111
+ </List>
112
+ );
113
+
114
+ const UnstyledTemplate: StoryFn<ListProps> = () => (
115
+ <List title={longTitle} ordered="unstyled">
116
+ <ListItem id="unstyled1">
117
+ <p>
118
+ Set and promote standards and fundamental principles and rights at work{" "}
119
+ </p>
120
+ </ListItem>
121
+ <ListItem id="unstyled2">
122
+ <p>
123
+ Create greater opportunities for women and men to decent employment and
124
+ income
125
+ </p>
126
+ </ListItem>
127
+ <ListItem id="unstyled3">
128
+ <p>Enhance the coverage and effectiveness of social protection for all</p>
129
+ </ListItem>
130
+ <ListItem id="unstyled4">
131
+ <p>Strengthen tripartism and social dialogue</p>
132
+ </ListItem>
133
+ </List>
134
+ );
135
+
136
+ const HorizontalTemplate: StoryFn<ListProps> = () => (
137
+ <List title={shortTitle} alignment="horizontal" ordered="unstyled">
138
+ <ListItem id="horizontal1">
139
+ <p>Labour standards</p>
140
+ </ListItem>
141
+ <ListItem id="horizontal2">
142
+ <p>Employment</p>
143
+ </ListItem>
144
+ <ListItem id="horizontal3">
145
+ <p>Social protection</p>
146
+ </ListItem>
147
+ <ListItem id="horizontal4">
148
+ <p>Tripartism</p>
149
+ </ListItem>
150
+ </List>
151
+ );
152
+
153
+ export const ListOrdered: StoryFn<ListProps> = OrderedTemplate.bind({});
154
+
155
+ export const ListUnordered: StoryFn<ListProps> = UnorderedTemplate.bind({});
156
+
157
+ export const ListUnstyled: StoryFn<ListProps> = UnstyledTemplate.bind({});
158
+
159
+ export const ListHorizontal: StoryFn<ListProps> = HorizontalTemplate.bind({});
160
+
161
+ ListOrdered.storyName = "Ordered";
162
+
163
+ ListUnordered.storyName = "Unordered";
164
+
165
+ ListUnstyled.storyName = "Unstyled";
166
+
167
+ ListHorizontal.storyName = "Horizontal";
@@ -0,0 +1,97 @@
1
+ import { StoryFn, Meta } from "@storybook/react";
2
+ import {
3
+ Title,
4
+ Description,
5
+ Primary,
6
+ Stories,
7
+ Subheading,
8
+ ArgsTable,
9
+ } from "@storybook/addon-docs";
10
+ import { Loading } from "../../components/Loading";
11
+ import { LoadingProps } from "../../components/Loading/Loading.props";
12
+ import loadingArgs from "../../components/Loading/Loading.args";
13
+
14
+ const statusDoc = `
15
+ By changing the \`status\` prop you can change whether the Loading component is displaying the spinner, the completed state, or nothing at all.
16
+
17
+ | type | Description |
18
+ |----------|-------------|
19
+ | \`idle\` | The Loading component is idle and displays nothing. For screen readers, the component must be on the page before the loading state is invoked. |
20
+ | \`loading\` | The Loading component displays the spinner graphic and the loading message. |
21
+ | \`loaded\` | The Loading component displays the completed message and graphic. |`;
22
+
23
+ const sizeDoc = `
24
+ By changing the \`size\` prop you can change whether the Loading component appears as the small or large design.
25
+
26
+ | type | Description |
27
+ |----------|-------------|
28
+ | \`small\` | The Loading component displays the small design |
29
+ | \`large\` | The Loading component displays the large design |`;
30
+
31
+ const LoadingMeta: Meta<typeof Loading> = {
32
+ title: "Components/Transitions/Loading",
33
+ tags: ["autodocs"],
34
+ component: Loading,
35
+ argTypes: {
36
+ size: {
37
+ options: ["small", "large"],
38
+ control: { type: "select" },
39
+ },
40
+ status: {
41
+ options: ["idle", "loading", "loaded"],
42
+ control: { type: "select" },
43
+ },
44
+ },
45
+ parameters: {
46
+ docs: {
47
+ page: () => (
48
+ <>
49
+ <Title />
50
+ <Description>
51
+ The Loading component displays a loading state. Status is passed to
52
+ it via props, along with size setting.
53
+ </Description>
54
+ <Primary />
55
+ <Subheading>Status</Subheading>
56
+ <Description>{statusDoc}</Description>
57
+ <Subheading>Size</Subheading>
58
+ <Description>{sizeDoc}</Description>
59
+ <Stories title="Examples"></Stories>
60
+ <Subheading>Default props</Subheading>
61
+ <ArgsTable />
62
+ </>
63
+ ),
64
+ },
65
+ },
66
+ };
67
+
68
+ export default LoadingMeta;
69
+
70
+ /**
71
+ * Loading Template
72
+ *
73
+ * create a Storybook template for this component
74
+ *
75
+ *@param (Object) args - props to be passed to the component
76
+ */
77
+ const LoadingTemplate: StoryFn<LoadingProps> = (args) => <Loading {...args} />;
78
+
79
+ export const LoadingLarge: StoryFn<LoadingProps> = LoadingTemplate.bind({});
80
+
81
+ export const LoadedLarge: StoryFn<LoadingProps> = LoadingTemplate.bind({});
82
+
83
+ export const LoadingSmall: StoryFn<LoadingProps> = LoadingTemplate.bind({});
84
+
85
+ export const LoadedSmall: StoryFn<LoadingProps> = LoadingTemplate.bind({});
86
+
87
+ LoadingLarge.args = loadingArgs.loadinglarge;
88
+ LoadingLarge.storyName = "Loading - large";
89
+
90
+ LoadedLarge.args = loadingArgs.loadedlarge;
91
+ LoadedLarge.storyName = "Loaded - large";
92
+
93
+ LoadingSmall.args = loadingArgs.loadingsmall;
94
+ LoadingSmall.storyName = "Loading - small";
95
+
96
+ LoadedSmall.args = loadingArgs.loadedsmall;
97
+ LoadedSmall.storyName = "Loaded - small";
@@ -0,0 +1,17 @@
1
+ import { Meta, Story, Canvas, ArgsTable, Unstyled } from "@storybook/blocks";
2
+ import * as LocalNavStories from "./LocalNav.stories.tsx";
3
+ import { LocalNav } from "../../components";
4
+
5
+ <Meta title="LocalNav" of={LocalNavStories} />
6
+
7
+ # Local Navigation Example
8
+
9
+ The local navigation component should be used as the header of a subsite to the main site.
10
+
11
+ <Canvas>
12
+ <Story of={LocalNavStories.BasicLocalNav} />
13
+ </Canvas>
14
+
15
+ ## Default Props
16
+
17
+ <ArgsTable of={LocalNav} />
@@ -0,0 +1,15 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { LocalNav } from "../../components/LocalNav";
3
+ import LocalNavArgs from "../../components/LocalNav/LocalNav.args";
4
+
5
+ const LocalNavMeta: Meta<typeof LocalNav> = {
6
+ title: "Components/Navigation/LocalNav",
7
+ component: LocalNav,
8
+ };
9
+
10
+ export default LocalNavMeta;
11
+
12
+ export const BasicLocalNav: StoryObj<typeof LocalNav> = {
13
+ args: LocalNavArgs.basic,
14
+ name: "Basic",
15
+ };