@aarhus-university/au-lib-react-components 10.5.0 → 10.8.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.
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+
4
+ import AUSpinnerComponent from '../src/components/AUSpinnerComponent';
5
+
6
+ // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
7
+ export default {
8
+ title: 'Delphinus/Spinner',
9
+ component: AUSpinnerComponent,
10
+ // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
11
+ decorators: [
12
+ (Story) => {
13
+ // , context) => {
14
+ /*
15
+ const { args: { themeColor, themeMode } } = context;
16
+ const themeColorClass = themeColor === 'none' ? '' : `theme--${themeColor}`;
17
+ const themeModeClass = themeMode === 'light' ? '' : `theme--${themeMode}`;
18
+ */
19
+ return (
20
+ <div>
21
+ {Story()}
22
+ </div>
23
+ );
24
+ },
25
+ ],
26
+ } as ComponentMeta<typeof AUSpinnerComponent>;
27
+
28
+ // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
29
+ const Template: ComponentStory<typeof AUSpinnerComponent> = (args) => (
30
+ <AUSpinnerComponent {...args}>
31
+ <p>Child content</p>
32
+ </AUSpinnerComponent>
33
+ );
34
+
35
+ export const Spinner = Template.bind({});
36
+ // More on args: https://storybook.js.org/docs/react/writing-stories/args
37
+ Spinner.args = {
38
+ loaded: false,
39
+ height: '20rem',
40
+ init: 'box',
41
+ };
@@ -0,0 +1,96 @@
1
+ import React from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+
4
+ import AUToolbarComponent from '../src/components/AUToolbarComponent';
5
+ import AUButtonComponent from '../src/components/AUButtonComponent';
6
+
7
+ // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
8
+ export default {
9
+ title: 'Delphinus/Toolbar',
10
+ component: AUToolbarComponent,
11
+ // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
12
+ decorators: [
13
+ (Story) => {
14
+ // , context) => {
15
+ /*
16
+ const { args: { themeColor, themeMode } } = context;
17
+ const themeColorClass = themeColor === 'none' ? '' : `theme--${themeColor}`;
18
+ const themeModeClass = themeMode === 'light' ? '' : `theme--${themeMode}`;
19
+ */
20
+ return (
21
+ <div>
22
+ {Story()}
23
+ <div className="box theme--background-secondary"><p>Content goes here...</p></div>
24
+ </div>
25
+ );
26
+ },
27
+ ],
28
+ } as ComponentMeta<typeof AUToolbarComponent>;
29
+
30
+ // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
31
+ const Template: ComponentStory<typeof AUToolbarComponent> = (args) => (
32
+ <AUToolbarComponent {...args} />
33
+ );
34
+
35
+ export const Form_Field_and_Buttons_and_Link = Template.bind({});
36
+ // More on args: https://storybook.js.org/docs/react/writing-stories/args
37
+ Form_Field_and_Buttons_and_Link.args = {
38
+ lang: 'da',
39
+ elements: [
40
+ <div className="form__field">
41
+ <label htmlFor="demo-search">Search</label>
42
+ <input type="search" autoComplete="off" autoCorrect="off" autoCapitalize="off" id="demo-search" />
43
+ </div>,
44
+ <AUButtonComponent icon="" label="Mark as read" />,
45
+ <AUButtonComponent icon="" hideLabel label="Delete" />,
46
+ <AUButtonComponent type="text" label="Select all" />,
47
+ <div className="toolbar__split" />,
48
+ <div className="toolbar__text-item">
49
+ <a className="a--text-link" href="#">Open in new tab</a>
50
+ </div>,
51
+ ]
52
+ };
53
+
54
+ export const Many_Actions = Template.bind({});
55
+ // More on args: https://storybook.js.org/docs/react/writing-stories/args
56
+ Many_Actions.args = {
57
+ lang: 'da',
58
+ elements: Array(25).fill(null).map((_, i) => <AUButtonComponent label={`Action ${i + 1}`} />),
59
+ };
60
+
61
+ export const Groupings = Template.bind({});
62
+ // More on args: https://storybook.js.org/docs/react/writing-stories/args
63
+ Groupings.args = {
64
+ lang: 'da',
65
+ elements: [
66
+ <div className="toolbar__group">
67
+ <div className="form__field form__field--horizontal">
68
+ <label htmlFor="demo-all">All issues</label>
69
+ <input type="radio" name="demo" value="all" id="demo-all" defaultChecked />
70
+ </div>
71
+ <div className="form__field form__field--horizontal">
72
+ <label htmlFor="demo-open">Open</label>
73
+ <input type="radio" name="demo" value="all" id="demo-open" />
74
+ </div>
75
+ <div className="form__field form__field--horizontal">
76
+ <label htmlFor="demo-resolved">Resolved</label>
77
+ <input type="radio" name="demo" value="all" id="demo-resolved" />
78
+ </div>
79
+ </div>,
80
+ <div className="toolbar__split" />,
81
+ <div className="toolbar__group">
82
+ <div className="form__field form__field--horizontal">
83
+ <label htmlFor="demo-epics">Epics</label>
84
+ <input type="checkbox" id="demo-epics" defaultChecked />
85
+ </div>
86
+ <div className="form__field form__field--horizontal">
87
+ <label htmlFor="demo-stories">Stories</label>
88
+ <input type="checkbox" id="demo-stories" defaultChecked />
89
+ </div>
90
+ <div className="form__field form__field--horizontal">
91
+ <label htmlFor="demo-tasks">Tasks</label>
92
+ <input type="checkbox" id="demo-tasks" defaultChecked />
93
+ </div>
94
+ </div>,
95
+ ],
96
+ };