@imposium-hub/components 1.29.0 → 1.31.1

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 (32) hide show
  1. package/.storybook/main.js +1 -1
  2. package/.storybook/preview-head.html +5 -0
  3. package/components/assets/AssetField.tsx +32 -11
  4. package/components/button-group-field/ButtonGroupField.stories.tsx +59 -0
  5. package/components/button-menu/ButtonMenu.stories.tsx +41 -0
  6. package/components/card/Card.stories.tsx +44 -0
  7. package/components/checkbox-field/CheckboxField.stories.tsx +34 -0
  8. package/components/color-field/ColorFiled.stories.tsx +39 -0
  9. package/components/controlled-list/ControlledList.stories.tsx +26 -0
  10. package/components/determinate-loader/DeterminateLoader.stories.tsx +43 -0
  11. package/components/dropdown/dropdown.stories.tsx +43 -0
  12. package/components/field-wrapper/FieldWrapper.stories.tsx +44 -0
  13. package/components/h-rule/HRule.stories.tsx +17 -0
  14. package/components/list-field/ListField.stories.tsx +40 -0
  15. package/components/modal/Modal.stories.tsx +51 -0
  16. package/components/number-field/NumberField.stories.tsx +43 -0
  17. package/components/section/Section.stories.tsx +82 -0
  18. package/components/select-field/SelectField.stories.tsx +38 -0
  19. package/components/shortcut-menu/ShortcutMenu.stories.tsx +24 -0
  20. package/components/slider-field/SliderField.stories.tsx +48 -0
  21. package/components/tabs/Tabs.stories.tsx +66 -0
  22. package/components/text-area-field/TextAreaField.stories.tsx +46 -0
  23. package/components/text-field/TextField.stories.tsx +52 -0
  24. package/dist/components.js +2 -2
  25. package/dist/components.js.map +1 -1
  26. package/dist/styles.css +1 -1
  27. package/dist/styles.css.map +1 -1
  28. package/dist/styles.less +4 -0
  29. package/dist/styles.less.map +1 -1
  30. package/less/components/form-field.less +4 -0
  31. package/package.json +14 -7
  32. package/services/API.ts +8 -0
@@ -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
+ );