@imposium-hub/components 1.28.3 → 1.30.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 (35) hide show
  1. package/.storybook/main.js +1 -1
  2. package/.storybook/preview-head.html +5 -0
  3. package/Entry.ts +2 -0
  4. package/components/assets/AssetsTableDurationCell.tsx +46 -0
  5. package/components/button-group-field/ButtonGroupField.stories.tsx +59 -0
  6. package/components/button-menu/ButtonMenu.stories.tsx +41 -0
  7. package/components/card/Card.stories.tsx +44 -0
  8. package/components/checkbox-field/CheckboxField.stories.tsx +34 -0
  9. package/components/color-field/ColorFiled.stories.tsx +39 -0
  10. package/components/controlled-list/ControlledList.stories.tsx +26 -0
  11. package/components/determinate-loader/DeterminateLoader.stories.tsx +43 -0
  12. package/components/dropdown/dropdown.stories.tsx +43 -0
  13. package/components/field-wrapper/FieldWrapper.stories.tsx +44 -0
  14. package/components/h-rule/HRule.stories.tsx +17 -0
  15. package/components/list-field/ListField.stories.tsx +40 -0
  16. package/components/modal/Modal.stories.tsx +51 -0
  17. package/components/number-field/NumberField.stories.tsx +43 -0
  18. package/components/number-field/NumberField.tsx +1 -1
  19. package/components/section/Section.stories.tsx +82 -0
  20. package/components/select-field/SelectField.stories.tsx +38 -0
  21. package/components/shortcut-menu/ShortcutMenu.stories.tsx +24 -0
  22. package/components/slider-field/SliderField.stories.tsx +48 -0
  23. package/components/tabs/Tabs.stories.tsx +66 -0
  24. package/components/text-area-field/TextAreaField.stories.tsx +46 -0
  25. package/components/text-field/TextField.stories.tsx +52 -0
  26. package/dist/components.js +2 -2
  27. package/dist/components.js.map +1 -1
  28. package/dist/styles.css +1 -1
  29. package/dist/styles.css.map +1 -1
  30. package/dist/styles.less +8 -0
  31. package/dist/styles.less.map +1 -1
  32. package/less/components/assets.less +4 -0
  33. package/less/components/form-field.less +4 -0
  34. package/package.json +14 -7
  35. package/services/API.ts +8 -0
@@ -0,0 +1,82 @@
1
+ import * as React from 'react';
2
+ import { action } from '@storybook/addon-actions';
3
+ import Section from './Section';
4
+ import TextField from '../text-field/TextField';
5
+ import NumberField from '../number-field/NumberField';
6
+ import Button from '../button/Button';
7
+ import ButtonMenu from '../button-menu/ButtonMenu';
8
+ import ButtonMenuItem from '../button-menu/ButtonMenuItem';
9
+ import Card from '../card/Card';
10
+ import {ICON_COPY, ICON_BARS} from '../../constants/icons';
11
+
12
+ export default {
13
+ title: 'Section',
14
+ component: Section
15
+ };
16
+
17
+ export const defaultSection = () => {
18
+
19
+ const menuItems = [
20
+ <ButtonMenuItem
21
+ key = 'duplicate'
22
+ label = {<span>{ICON_COPY}&nbsp;Button Duplicate Overlay</span>}
23
+ onClick = {action('CLICKED')}/>,
24
+ <ButtonMenuItem
25
+ key = 'delete'
26
+ label = {<span>{ICON_COPY}&nbsp;Button Duplicate Overlay</span>}
27
+ onClick = {action('CLICKED')}/>
28
+ ];
29
+
30
+ const menu = <ButtonMenu
31
+ position = 'left'
32
+ items = {menuItems}
33
+ button = {<Button style = 'subtle'>
34
+ {ICON_BARS}
35
+ </Button>}/>;
36
+
37
+ return (
38
+ <Section
39
+ title = 'Section Title'
40
+ buttons = {menu}
41
+ >
42
+ <Card
43
+ title = 'Card'
44
+ open = {true}
45
+ collapsable = {false}>
46
+ <TextField
47
+ label = {'TextField'}
48
+ tooltip = {'TOOLTIP'}
49
+ value = {'name'}
50
+ width = '33%'
51
+ onChange = {action('CLICKED')}/>
52
+ <NumberField
53
+ label = {'NumberField'}
54
+ tooltip = {'TOOLTIP'}
55
+ width = '33%'
56
+ readOnly = {true}
57
+ value = {1}
58
+ onChange = {action('CLICKED')}
59
+ />
60
+ </Card>
61
+ <Card
62
+ title = 'Card'
63
+ open = {true}
64
+ collapsable = {false}>
65
+ <TextField
66
+ label = {'TextField'}
67
+ tooltip = {'TOOLTIP'}
68
+ value = {'name'}
69
+ width = '33%'
70
+ onChange = {action('CLICKED')}/>
71
+ <NumberField
72
+ label = {'NumberField'}
73
+ tooltip = {'TOOLTIP'}
74
+ width = '33%'
75
+ readOnly = {true}
76
+ value = {1}
77
+ onChange = {action('CLICKED')}
78
+ />
79
+ </Card>
80
+ </Section>
81
+ );
82
+ };
@@ -0,0 +1,38 @@
1
+ import * as React from 'react';
2
+ import SelectField from './SelectField';
3
+ import { action } from '@storybook/addon-actions';
4
+ import { IToolTipConfig } from '../Tooltip';
5
+
6
+ export default {
7
+ title: 'SelectField',
8
+ components: SelectField
9
+ };
10
+
11
+ interface ISelectOption {
12
+ label : string;
13
+ value : string;
14
+ }
15
+
16
+ interface ISelectFieldProps {
17
+ buttons? : any;
18
+ label? : string;
19
+ selectRef? : any;
20
+ options : any;
21
+ disable ? : boolean;
22
+ tooltip ? : IToolTipConfig | string;
23
+ placeholder? : string;
24
+ value : any;
25
+ width? : string | number;
26
+ onChange(e) : void;
27
+ info? : string;
28
+ labelPosition? : string;
29
+ }
30
+
31
+ export const defaultSelectField = () => (
32
+ <SelectField
33
+ label = {'Select Field'}
34
+ value = {'value'}
35
+ width = '50%'
36
+ options = { ['Option1', 'Option2'] }
37
+ onChange = {action('CHANGED')}/>
38
+ );
@@ -0,0 +1,24 @@
1
+ import * as React from 'react';
2
+ import ShortcutMenu from './ShortcutMenu';
3
+
4
+ export default {
5
+ title: 'ShortcutMenu',
6
+ component: ShortcutMenu
7
+ };
8
+
9
+ interface IShortcutMenu {
10
+ shortcutCopyMap : any;
11
+ heading? : string;
12
+ }
13
+
14
+ const shortcuts = {
15
+ 'Up': 'Select previous experience',
16
+ 'Down': 'Select next experience',
17
+ 'Left': 'Go to previous page',
18
+ 'Right': 'Go to next page',
19
+ 'Shift + R': 'Refresh current page'
20
+ };
21
+
22
+ export const defaultShortcutMenu = () => (
23
+ <ShortcutMenu shortcutCopyMap = {shortcuts} />
24
+ );
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ import SliderField from './SliderField';
3
+ import { IToolTipConfig } from '../Tooltip';
4
+
5
+ export default {
6
+ title: 'SliderField',
7
+ component: SliderField
8
+ };
9
+
10
+ interface ISliderFieldProps {
11
+ label? : string;
12
+ value : number;
13
+ width? : string | number;
14
+ min : number;
15
+ max : number;
16
+ step : number;
17
+ tooltip? : IToolTipConfig | string;
18
+ defaultValue : number;
19
+ onChange(e) : void;
20
+ info? : string;
21
+ labelPosition? : string;
22
+ }
23
+
24
+ interface ISliderFieldState {
25
+ inputValue : any;
26
+ }
27
+
28
+ export const defaultSliderField = () => {
29
+ const [sliderValue, setSliderValue] = React.useState(5);
30
+
31
+ const handleChange = (e) => {
32
+ setSliderValue(e.target.value);
33
+ };
34
+
35
+ return (
36
+ <div style={{width: '50%'}}>
37
+ <SliderField
38
+ label = {'Slider Field'}
39
+ min = {0}
40
+ max = {50}
41
+ step = {1}
42
+ value = {sliderValue}
43
+ defaultValue = {0}
44
+ onChange = {handleChange}
45
+ />
46
+ </div>
47
+ );
48
+ };
@@ -0,0 +1,66 @@
1
+ import * as React from 'react';
2
+ import Tabs from './Tabs';
3
+
4
+ export default {
5
+ title: 'Tabs',
6
+ component: Tabs
7
+ };
8
+
9
+ interface ITab {
10
+ content : any;
11
+ key : string;
12
+ canClose? : boolean;
13
+ resize? : boolean;
14
+ label : string;
15
+ }
16
+
17
+ interface ITabsProps {
18
+ activeTab? : string;
19
+ keepMounted? : boolean;
20
+ options : ITab[];
21
+ onChange(i) : void;
22
+ onClose(i) : void;
23
+ tabPadding? : number;
24
+ }
25
+
26
+ interface ITabsState {
27
+ allowableTabsInView : number | null;
28
+ }
29
+
30
+ const tabs = [
31
+ {
32
+ label: 'Tab1',
33
+ key: 'project',
34
+ content: 'Content 1'
35
+ },
36
+ {
37
+ label: 'Tab2',
38
+ key: 'moderation',
39
+ content: 'Content 2'
40
+ },
41
+ {
42
+ label: 'Tab3',
43
+ key: 'advanced',
44
+ content: 'Content 3'
45
+ },
46
+ {
47
+ label: 'Tab4',
48
+ key: 'video',
49
+ content: 'Content 4'
50
+ }
51
+ ];
52
+
53
+ export const defaultTabs = () => {
54
+ const [activeTab, setActiveTab] = React.useState('project');
55
+
56
+ const handleTabChange = (i) => {
57
+ setActiveTab(i);
58
+ };
59
+
60
+ return (
61
+ <Tabs
62
+ activeTab = { activeTab }
63
+ onChange = {(i) => handleTabChange(i)}
64
+ options = {tabs}/>
65
+ );
66
+ };
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ import TextAreaField from './TextAreaField';
3
+ import { action } from '@storybook/addon-actions';
4
+ import { IToolTipConfig } from '../Tooltip';
5
+
6
+ export default {
7
+ title: 'TextAreaField',
8
+ components: TextAreaField
9
+ };
10
+
11
+ interface ITextAreaFieldProps {
12
+ buttons? : any;
13
+ controlled? : boolean;
14
+ disabled? : boolean;
15
+ label? : string;
16
+ placeholder? : string;
17
+ readOnly? : boolean;
18
+ value : string;
19
+ showCopy? : boolean;
20
+ width? : string | number;
21
+ tooltip? : IToolTipConfig | string;
22
+ onBlur?(e) : void;
23
+ onChange?(e) : void;
24
+ onFocus?(e) : void;
25
+ onNotification?(n, t?) : void;
26
+ onError?(e) : void;
27
+ onSubmit?(e) : void;
28
+ info? : string;
29
+ labelPosition? : string;
30
+ }
31
+
32
+ interface ITextAreaFieldState {
33
+ editing : boolean;
34
+ internalValue : string;
35
+ }
36
+
37
+ export const defaultTextAreaField = () => (
38
+ <TextAreaField
39
+ label = {'TextArea Field'}
40
+ showCopy = {true}
41
+ tooltip = {'TOOLTIP'}
42
+ value = {''}
43
+ onNotification = {(n) => action(n)}
44
+ onError = {(n) => action(n)}
45
+ onChange = {action('CHANGED')}/>
46
+ );
@@ -0,0 +1,52 @@
1
+ import * as React from 'react';
2
+ import { action } from '@storybook/addon-actions';
3
+ import TextField from './TextField';
4
+ import { IToolTipConfig } from '../Tooltip';
5
+
6
+ export default {
7
+ title: 'TextField',
8
+ components: TextField
9
+ };
10
+
11
+ interface ITextFieldProps {
12
+ buttons? : any;
13
+ controlled? : boolean;
14
+ loading? : boolean;
15
+ disabled? : boolean;
16
+ submittable? : boolean;
17
+ focusOnMount ? : boolean;
18
+ label? : string;
19
+ placeholder? : string;
20
+ readOnly? : boolean;
21
+ value? : string;
22
+ tooltip ? : IToolTipConfig | string;
23
+ showCopy? : boolean;
24
+ width? : string | number;
25
+ submittableType? : 'search' | 'add';
26
+ suggestions? : string[];
27
+ hideButtons? : boolean;
28
+ onBlur?(e) : void;
29
+ onChange?(e) : void;
30
+ onFocus?(e) : void;
31
+ onNotification?(e) : void;
32
+ onError?(e) : void;
33
+ onSubmit?(e) : void;
34
+ doSubmit? : (v : string) => any;
35
+ pattern? : RegExp;
36
+ info? : string;
37
+ labelPosition? : string;
38
+ }
39
+
40
+ interface ITextFieldState {
41
+ editing : boolean;
42
+ suggestions : string[];
43
+ internalValue : string;
44
+ }
45
+
46
+ export const defaultTextField = () => (
47
+ <TextField
48
+ label = {'Label'}
49
+ tooltip = {'TOOLTIP'}
50
+ value = {''}
51
+ onChange = {(v) => action(v)}/>
52
+ );