@burnsred/ui 0.6.2 → 0.6.3
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/CHANGELOG.md +23 -53
- package/dist/development.js +205 -492
- package/dist/development.js.map +1 -1
- package/dist/legacy.js +30 -0
- package/dist/production.min.js +1 -1
- package/package.json +18 -20
- package/dist/index.js +0 -5
package/dist/development.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import styled, { css, keyframes, ThemeConsumer, withTheme } from 'styled-components';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { withEnhanceProps, colorFromPalette, mixins, color, useEnhanceProps, useCleanProps, media, variant, image, component } from '@burnsred/theme';
|
|
4
|
-
import { action } from '@storybook/addon-actions';
|
|
5
|
-
import { text, boolean, select } from '@storybook/addon-knobs';
|
|
6
1
|
import PropTypes from 'prop-types';
|
|
7
2
|
import PropTypesImmutable from 'react-immutable-proptypes';
|
|
8
3
|
import PropTypesPlus from '@burnsred/prop-types-plus';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { withEnhanceProps, colorFromPalette, mixins, color, useEnhanceProps, useCleanProps, media, image, component } from '@burnsred/theme';
|
|
9
6
|
import 'core-js/modules/es6.object.assign';
|
|
10
7
|
import classnames from 'classnames';
|
|
11
8
|
import { useDefault } from '@burnsred/default';
|
|
12
9
|
import 'core-js/modules/es6.function.name';
|
|
10
|
+
import styled, { css, keyframes, withTheme } from 'styled-components';
|
|
13
11
|
import 'core-js/modules/es6.regexp.to-string';
|
|
14
12
|
import 'core-js/modules/web.dom.iterable';
|
|
15
13
|
import 'core-js/modules/es6.array.iterator';
|
|
16
|
-
import '
|
|
14
|
+
import { Map, List } from 'immutable';
|
|
17
15
|
import _flowRight from 'lodash/flowRight';
|
|
18
16
|
import { withProps } from '@burnsred/higher-order-component';
|
|
19
|
-
import { Map, List } from 'immutable';
|
|
20
17
|
import exact from 'prop-types-exact';
|
|
21
18
|
import withOnClickOutside from 'react-onclickoutside';
|
|
22
19
|
import ReactDOM from 'react-dom';
|
|
@@ -692,443 +689,7 @@ UIButton.defaultProps = {
|
|
|
692
689
|
to: undefined,
|
|
693
690
|
variant: 'standard'
|
|
694
691
|
};
|
|
695
|
-
var
|
|
696
|
-
|
|
697
|
-
var Wrapper =
|
|
698
|
-
/*#__PURE__*/
|
|
699
|
-
styled.div.withConfig({
|
|
700
|
-
displayName: "Buttonstories__Wrapper",
|
|
701
|
-
componentId: "sc-17igda1-0"
|
|
702
|
-
})(["text-align:center;margin:1rem;"]);
|
|
703
|
-
var createStoryForUIButton = (function (stories) {
|
|
704
|
-
return stories.add('dynamic story', function () {
|
|
705
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
706
|
-
return React.createElement(UIButton$1, {
|
|
707
|
-
content: text('children', 'Hello Button'),
|
|
708
|
-
disabled: boolean('disabled', false),
|
|
709
|
-
iconFont: "material",
|
|
710
|
-
iconName: "delete",
|
|
711
|
-
onClick: action('clicked'),
|
|
712
|
-
palette: "primary",
|
|
713
|
-
processing: boolean('processing', false),
|
|
714
|
-
variant: select('variant', variant({
|
|
715
|
-
name: 'component_uiButton_'
|
|
716
|
-
})({
|
|
717
|
-
theme: theme
|
|
718
|
-
}), 'text')
|
|
719
|
-
});
|
|
720
|
-
});
|
|
721
|
-
}).add('variants', function () {
|
|
722
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
723
|
-
return variant({
|
|
724
|
-
name: 'component_uiButton_'
|
|
725
|
-
})({
|
|
726
|
-
theme: theme
|
|
727
|
-
}).map(function (name) {
|
|
728
|
-
return React.createElement(Wrapper, {
|
|
729
|
-
key: name
|
|
730
|
-
}, React.createElement(UIButton$1, {
|
|
731
|
-
content: name,
|
|
732
|
-
iconFont: "material",
|
|
733
|
-
iconName: "delete",
|
|
734
|
-
palette: "primary",
|
|
735
|
-
variant: name
|
|
736
|
-
}));
|
|
737
|
-
});
|
|
738
|
-
});
|
|
739
|
-
});
|
|
740
|
-
});
|
|
741
|
-
|
|
742
|
-
function _templateObject$3() {
|
|
743
|
-
var data = _taggedTemplateLiteral(["", ""]);
|
|
744
|
-
|
|
745
|
-
_templateObject$3 = function _templateObject() {
|
|
746
|
-
return data;
|
|
747
|
-
};
|
|
748
|
-
|
|
749
|
-
return data;
|
|
750
|
-
}
|
|
751
|
-
var iconCss =
|
|
752
|
-
/*#__PURE__*/
|
|
753
|
-
css(["margin-right:0.5rem;max-width:2rem;vertical-align:middle;"]);
|
|
754
|
-
var Wrapper$1 =
|
|
755
|
-
/*#__PURE__*/
|
|
756
|
-
styled.div.withConfig({
|
|
757
|
-
displayName: "Iconstories__Wrapper",
|
|
758
|
-
componentId: "sc-1p3nfhe-0"
|
|
759
|
-
})(["display:inline-block;margin:1rem;position:relative;&:after{content:'", "';font-size:0.75rem;left:50%;position:absolute;top:calc(100% + 1rem);transform:translateX(-50%);white-space:pre;}"], function (props) {
|
|
760
|
-
return props.label;
|
|
761
|
-
});
|
|
762
|
-
var createStoryForUIIcon = (function (stories) {
|
|
763
|
-
return stories.add('dynamic story', function () {
|
|
764
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
765
|
-
return React.createElement(_StyledUIIcon, {
|
|
766
|
-
fontawesome: boolean('fontawesome', false),
|
|
767
|
-
material: boolean('material', false),
|
|
768
|
-
name: select('name', ['apple', 'delete', 'plus'], 'apple'),
|
|
769
|
-
variant: select('variant', variant({
|
|
770
|
-
name: 'component_uiIcon_'
|
|
771
|
-
})({
|
|
772
|
-
theme: theme
|
|
773
|
-
}), 'main')
|
|
774
|
-
});
|
|
775
|
-
});
|
|
776
|
-
}).add('variants', function () {
|
|
777
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
778
|
-
return variant({
|
|
779
|
-
name: 'component_uiIcon_'
|
|
780
|
-
})({
|
|
781
|
-
theme: theme
|
|
782
|
-
}).map(function (name) {
|
|
783
|
-
return React.createElement(Wrapper$1, {
|
|
784
|
-
key: name
|
|
785
|
-
}, React.createElement(UIIcon, {
|
|
786
|
-
name: "apple",
|
|
787
|
-
variant: name
|
|
788
|
-
}), name);
|
|
789
|
-
});
|
|
790
|
-
});
|
|
791
|
-
});
|
|
792
|
-
});
|
|
793
|
-
|
|
794
|
-
var _StyledUIIcon = styled(UIIcon)(_templateObject$3(), iconCss);
|
|
795
|
-
|
|
796
|
-
var UIImage =
|
|
797
|
-
/*#__PURE__*/
|
|
798
|
-
styled.img.withConfig({
|
|
799
|
-
displayName: "Image__UIImage",
|
|
800
|
-
componentId: "sc-1fmo7bh-0"
|
|
801
|
-
})(["", " ", ""], component(), function (props) {
|
|
802
|
-
return props.css;
|
|
803
|
-
});
|
|
804
|
-
UIImage.propTypes = {
|
|
805
|
-
alt: PropTypes.string.isRequired,
|
|
806
|
-
namespace: PropTypesPlus.string,
|
|
807
|
-
src: PropTypes.string.isRequired,
|
|
808
|
-
variant: PropTypes.string
|
|
809
|
-
};
|
|
810
|
-
UIImage.defaultProps = {
|
|
811
|
-
namespace: 'component_uiImage',
|
|
812
|
-
variant: 'standard'
|
|
813
|
-
};
|
|
814
|
-
var UIImage$1 = _flowRight([withTheme, withProps(function (props) {
|
|
815
|
-
return {
|
|
816
|
-
alt: props.name,
|
|
817
|
-
src: image(props)
|
|
818
|
-
};
|
|
819
|
-
})])(UIImage);
|
|
820
|
-
|
|
821
|
-
function _templateObject2() {
|
|
822
|
-
var data = _taggedTemplateLiteral(["", ""]);
|
|
823
|
-
|
|
824
|
-
_templateObject2 = function _templateObject2() {
|
|
825
|
-
return data;
|
|
826
|
-
};
|
|
827
|
-
|
|
828
|
-
return data;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
function _templateObject$4() {
|
|
832
|
-
var data = _taggedTemplateLiteral(["", ""]);
|
|
833
|
-
|
|
834
|
-
_templateObject$4 = function _templateObject() {
|
|
835
|
-
return data;
|
|
836
|
-
};
|
|
837
|
-
|
|
838
|
-
return data;
|
|
839
|
-
}
|
|
840
|
-
var imageCss =
|
|
841
|
-
/*#__PURE__*/
|
|
842
|
-
css(["margin-right:0.5rem;max-width:2rem;vertical-align:middle;"]);
|
|
843
|
-
var Wrapper$2 =
|
|
844
|
-
/*#__PURE__*/
|
|
845
|
-
styled.div.withConfig({
|
|
846
|
-
displayName: "Imagestories__Wrapper",
|
|
847
|
-
componentId: "a2mbve-0"
|
|
848
|
-
})(["display:inline-block;margin:1rem;position:relative;&:after{content:'", "';font-size:0.75rem;left:50%;position:absolute;top:calc(100% + 1rem);transform:translateX(-50%);white-space:pre;}"], function (props) {
|
|
849
|
-
return props.label;
|
|
850
|
-
});
|
|
851
|
-
var createStoryForUIImage = (function (stories) {
|
|
852
|
-
return stories.add('dynamic story', function () {
|
|
853
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
854
|
-
return React.createElement(_StyledUIImage, {
|
|
855
|
-
name: select('name', Object.keys(theme.images || {}), Object.keys(theme.images || {})[0]),
|
|
856
|
-
variant: select('variant', variant({
|
|
857
|
-
name: 'component_uiImage_'
|
|
858
|
-
})({
|
|
859
|
-
theme: theme
|
|
860
|
-
}), 'main')
|
|
861
|
-
});
|
|
862
|
-
});
|
|
863
|
-
}).add('names', function () {
|
|
864
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
865
|
-
return variant({
|
|
866
|
-
name: 'images_'
|
|
867
|
-
})({
|
|
868
|
-
theme: theme
|
|
869
|
-
}).map(function (name) {
|
|
870
|
-
return React.createElement(Wrapper$2, {
|
|
871
|
-
key: name,
|
|
872
|
-
label: name
|
|
873
|
-
}, React.createElement(_StyledUIImage2, {
|
|
874
|
-
name: name
|
|
875
|
-
}));
|
|
876
|
-
});
|
|
877
|
-
});
|
|
878
|
-
}).add('variants', function () {
|
|
879
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
880
|
-
return variant({
|
|
881
|
-
name: 'component_uiImage_'
|
|
882
|
-
})({
|
|
883
|
-
theme: theme
|
|
884
|
-
}).map(function (name) {
|
|
885
|
-
return React.createElement(Wrapper$2, {
|
|
886
|
-
key: name
|
|
887
|
-
}, React.createElement(UIImage$1, {
|
|
888
|
-
name: variant({
|
|
889
|
-
name: 'images_'
|
|
890
|
-
})({
|
|
891
|
-
theme: theme
|
|
892
|
-
})[0],
|
|
893
|
-
variant: name
|
|
894
|
-
}), name);
|
|
895
|
-
});
|
|
896
|
-
});
|
|
897
|
-
});
|
|
898
|
-
});
|
|
899
|
-
|
|
900
|
-
var _StyledUIImage = styled(UIImage$1)(_templateObject$4(), imageCss);
|
|
901
|
-
|
|
902
|
-
var _StyledUIImage2 = styled(UIImage$1)(_templateObject2(), imageCss);
|
|
903
|
-
|
|
904
|
-
var createStoryForUIProcessingCircle = (function (stories) {
|
|
905
|
-
return stories.add('dynamic story', function () {
|
|
906
|
-
return React.createElement(ProgressCircle, {
|
|
907
|
-
palette: select('palette', ['primary', 'secondary', 'black']),
|
|
908
|
-
size: select('size', ['16px', '32px', '48px'], '32px'),
|
|
909
|
-
thickness: select('thickness', [10, 20, 40], 20),
|
|
910
|
-
value: select('value', [null, 0, 33, 50, 100], null)
|
|
911
|
-
});
|
|
912
|
-
});
|
|
913
|
-
});
|
|
914
|
-
|
|
915
|
-
var primaryScale =
|
|
916
|
-
/*#__PURE__*/
|
|
917
|
-
keyframes(["0%{transform:scaleX(0.08);}36.65%{animation-timing-function:cubic-bezier(0.334731,0.12482,0.785844,1);transform:scaleX(0.08);}65.15%{animation-timing-function:cubmic-bezier(0.06,0.11,0.6,1);transform:scaleX(0.661479);}100%{transform:scaleX(0.08);}"]);
|
|
918
|
-
var primaryTranslate =
|
|
919
|
-
/*#__PURE__*/
|
|
920
|
-
keyframes(["0%{transform:translateX(0);}20%{animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);transform:translateX(0);}59.15%{animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);transform:translateX(83.67142%);}100%{transform:translateX(200.611057%);}"]);
|
|
921
|
-
var secondaryScale =
|
|
922
|
-
/*#__PURE__*/
|
|
923
|
-
keyframes(["0%{animation-timing-function:cubic-bezier(0.205028,0.057051,0.57661,0.45397);transform:scaleX(0.08);}19.15%{animation-timing-function:cubic-bezier(0.152313,0.196432,0.648374,1.004315);transform:scaleX(0.457104);}44.15%{animation-timing-function:cubic-bezier(0.257759,-0.003163,0.211762,1.38179);transform:scaleX(0.72796);}100%{transform:scaleX(0.08);}"]);
|
|
924
|
-
var secondaryTranslate =
|
|
925
|
-
/*#__PURE__*/
|
|
926
|
-
keyframes(["0%{animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);transform:translateX(0);}25%{animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);transform:translateX(37.651913%);}48.35%{animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);transform:translateX(84.386165%);}100%{transform:translateX(160.277782%);}"]);
|
|
927
|
-
var Block =
|
|
928
|
-
/*#__PURE__*/
|
|
929
|
-
styled.div.withConfig({
|
|
930
|
-
displayName: "ProgressLinestyles__Block",
|
|
931
|
-
componentId: "gwo5u1-0"
|
|
932
|
-
})(["display:flex;align-items:center;height:", ";min-width:2rem;overflow:hidden;position:relative;transition:opacity 0.25s cubic-bezier(0.4,0,0.6,1) 0ms;transform:translateZ(0);", ""], function (props) {
|
|
933
|
-
return props.height;
|
|
934
|
-
}, mixins.margin);
|
|
935
|
-
var BarWrapper =
|
|
936
|
-
/*#__PURE__*/
|
|
937
|
-
styled.div.withConfig({
|
|
938
|
-
displayName: "ProgressLinestyles__BarWrapper",
|
|
939
|
-
componentId: "gwo5u1-1"
|
|
940
|
-
})(["height:", ";position:relative;flex:1;"], function (props) {
|
|
941
|
-
return props.thickness;
|
|
942
|
-
});
|
|
943
|
-
var Buffer =
|
|
944
|
-
/*#__PURE__*/
|
|
945
|
-
styled.div.withConfig({
|
|
946
|
-
displayName: "ProgressLinestyles__Buffer",
|
|
947
|
-
componentId: "gwo5u1-2"
|
|
948
|
-
})(["background-color:", ";height:100%;position:absolute;transition:transform ", ";transform-origin:left top;width:100%;", ""], function (props) {
|
|
949
|
-
return color({
|
|
950
|
-
palette: props.palette || 'gray',
|
|
951
|
-
paletteWeight: props.paletteWeight
|
|
952
|
-
})(props);
|
|
953
|
-
}, function (props) {
|
|
954
|
-
return props.transitionDuration || '225ms';
|
|
955
|
-
}, function (props) {
|
|
956
|
-
return props.value !== null && css(["transform:translateX(", "%);"], props.value - 100);
|
|
957
|
-
});
|
|
958
|
-
var BarPrimary =
|
|
959
|
-
/*#__PURE__*/
|
|
960
|
-
styled.div.withConfig({
|
|
961
|
-
displayName: "ProgressLinestyles__BarPrimary",
|
|
962
|
-
componentId: "gwo5u1-3"
|
|
963
|
-
})(["height:100%;position:absolute;transform-origin:left top;width:100%;", ""], function (props) {
|
|
964
|
-
return props.value === null && css(["transform:scaleX(0);animation:", " 2s infinite linear;left:-145.166611%;transition:none;"], primaryTranslate);
|
|
965
|
-
});
|
|
966
|
-
var BarPrimaryInner =
|
|
967
|
-
/*#__PURE__*/
|
|
968
|
-
styled.span.withConfig({
|
|
969
|
-
displayName: "ProgressLinestyles__BarPrimaryInner",
|
|
970
|
-
componentId: "gwo5u1-4"
|
|
971
|
-
})(["background-color:", ";display:inline-block;height:100%;position:absolute;width:100%;", " ", ""], function (props) {
|
|
972
|
-
return color({
|
|
973
|
-
palette: props.palette || 'primary',
|
|
974
|
-
paletteWeight: props.paletteWeight
|
|
975
|
-
})(props);
|
|
976
|
-
}, function (props) {
|
|
977
|
-
return props.value === null && css(["animation:", " 2s infinite linear;"], primaryScale);
|
|
978
|
-
}, function (props) {
|
|
979
|
-
return props.value !== null && css(["transform:translateX(", "%);transition:transform ", " cubic-bezier(0.4,0,0.6,1) 0ms;"], props.value - 100, props.transitionDuration || '225ms');
|
|
980
|
-
});
|
|
981
|
-
var BarSecondary =
|
|
982
|
-
/*#__PURE__*/
|
|
983
|
-
styled.div.withConfig({
|
|
984
|
-
displayName: "ProgressLinestyles__BarSecondary",
|
|
985
|
-
componentId: "gwo5u1-5"
|
|
986
|
-
})(["animation:", " 2s infinite linear;height:100%;left:-54.888891%;position:absolute;transition:none;transform-origin:left top;visibility:visible;width:100%;"], secondaryTranslate);
|
|
987
|
-
var BarSecondaryInner =
|
|
988
|
-
/*#__PURE__*/
|
|
989
|
-
styled.span.withConfig({
|
|
990
|
-
displayName: "ProgressLinestyles__BarSecondaryInner",
|
|
991
|
-
componentId: "gwo5u1-6"
|
|
992
|
-
})(["animation:", " 2s infinite linear;background-color:", ";display:inline-block;height:100%;position:absolute;visibility:visible;width:100%;"], secondaryScale, function (props) {
|
|
993
|
-
return color({
|
|
994
|
-
palette: props.palette || 'primary',
|
|
995
|
-
paletteWeight: props.paletteWeight
|
|
996
|
-
})(props);
|
|
997
|
-
});
|
|
998
|
-
|
|
999
|
-
function UIProgressLine(props) {
|
|
1000
|
-
var _React$useState = React.useState(props.valueInitial === undefined ? props.value : props.valueInitial),
|
|
1001
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1002
|
-
value = _React$useState2[0],
|
|
1003
|
-
setValue = _React$useState2[1];
|
|
1004
|
-
|
|
1005
|
-
var _React$useState3 = React.useState(props.bufferValueInitial === undefined ? props.bufferValue : props.bufferValueInitial),
|
|
1006
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
1007
|
-
bufferValue = _React$useState4[0],
|
|
1008
|
-
setBufferValue = _React$useState4[1];
|
|
1009
|
-
|
|
1010
|
-
React.useEffect(function () {
|
|
1011
|
-
setTimeout(function () {
|
|
1012
|
-
setValue(props.value);
|
|
1013
|
-
setBufferValue(props.bufferValue);
|
|
1014
|
-
}, 0);
|
|
1015
|
-
}, [props.value, props.bufferValue]);
|
|
1016
|
-
return React.createElement(Block, {
|
|
1017
|
-
className: props.className,
|
|
1018
|
-
height: props.height,
|
|
1019
|
-
$margin: props.margin,
|
|
1020
|
-
$marginBottom: props.marginBottom,
|
|
1021
|
-
$marginLeft: props.marginLeft,
|
|
1022
|
-
$marginRight: props.marginRight,
|
|
1023
|
-
$marginTop: props.marginTop
|
|
1024
|
-
}, React.createElement(Buffer, {
|
|
1025
|
-
palette: props.bufferPalette,
|
|
1026
|
-
paletteWeight: props.bufferPaletteWeight,
|
|
1027
|
-
transitionDuration: props.transitionDuration,
|
|
1028
|
-
value: bufferValue
|
|
1029
|
-
}), React.createElement(BarWrapper, {
|
|
1030
|
-
thickness: props.thickness || props.height
|
|
1031
|
-
}, React.createElement(BarPrimary, {
|
|
1032
|
-
value: props.value,
|
|
1033
|
-
transitionDuration: props.transitionDuration
|
|
1034
|
-
}, React.createElement(BarPrimaryInner, {
|
|
1035
|
-
palette: props.palette,
|
|
1036
|
-
paletteWeight: props.paletteWeight,
|
|
1037
|
-
transitionDuration: props.transitionDuration,
|
|
1038
|
-
value: value
|
|
1039
|
-
})), value === null && React.createElement(BarSecondary, null, React.createElement(BarSecondaryInner, {
|
|
1040
|
-
palette: props.palette,
|
|
1041
|
-
paletteWeight: props.paletteWeight
|
|
1042
|
-
}))));
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
UIProgressLine.propTypes = {
|
|
1046
|
-
bufferPalette: PropTypes.string,
|
|
1047
|
-
bufferPaletteWeight: PropTypes.string,
|
|
1048
|
-
bufferValue: PropTypes.number,
|
|
1049
|
-
bufferValueInitial: PropTypes.number,
|
|
1050
|
-
height: PropTypes.string,
|
|
1051
|
-
margin: PropTypes.string,
|
|
1052
|
-
marginBottom: PropTypes.string,
|
|
1053
|
-
marginLeft: PropTypes.string,
|
|
1054
|
-
marginRight: PropTypes.string,
|
|
1055
|
-
marginTop: PropTypes.string,
|
|
1056
|
-
palette: PropTypes.string,
|
|
1057
|
-
paletteWeight: PropTypes.string,
|
|
1058
|
-
thickness: PropTypes.string,
|
|
1059
|
-
transitionDuration: PropTypes.string,
|
|
1060
|
-
value: PropTypes.number,
|
|
1061
|
-
valueInitial: PropTypes.number
|
|
1062
|
-
};
|
|
1063
|
-
UIProgressLine.defaultProps = {
|
|
1064
|
-
bufferPalette: undefined,
|
|
1065
|
-
bufferPaletteWeight: undefined,
|
|
1066
|
-
bufferValue: 100,
|
|
1067
|
-
bufferValueInitial: undefined,
|
|
1068
|
-
height: '4px',
|
|
1069
|
-
margin: undefined,
|
|
1070
|
-
marginBottom: undefined,
|
|
1071
|
-
marginLeft: undefined,
|
|
1072
|
-
marginRight: undefined,
|
|
1073
|
-
marginTop: undefined,
|
|
1074
|
-
palette: undefined,
|
|
1075
|
-
paletteWeight: undefined,
|
|
1076
|
-
thickness: undefined,
|
|
1077
|
-
transitionDuration: undefined,
|
|
1078
|
-
value: null,
|
|
1079
|
-
valueInitial: undefined
|
|
1080
|
-
};
|
|
1081
|
-
|
|
1082
|
-
var Block$1 =
|
|
1083
|
-
/*#__PURE__*/
|
|
1084
|
-
styled.div.withConfig({
|
|
1085
|
-
displayName: "ProgressLinestories__Block",
|
|
1086
|
-
componentId: "rcgabs-0"
|
|
1087
|
-
})(["width:300px;"]);
|
|
1088
|
-
var createStoryForUIProcessingLine = (function (stories) {
|
|
1089
|
-
return stories.add('dynamic story', function () {
|
|
1090
|
-
return React.createElement(Block$1, null, React.createElement(UIProgressLine, {
|
|
1091
|
-
bufferPalette: select('bufferPalette', ['primary', 'secondary', 'gray']),
|
|
1092
|
-
height: select('height', ['1px', '2px', '4px', '8px', '16px'], '4px'),
|
|
1093
|
-
palette: select('palette', ['primary', 'secondary', 'gray']),
|
|
1094
|
-
value: select('value', [null, 0, 33, 50, 100], null)
|
|
1095
|
-
}));
|
|
1096
|
-
});
|
|
1097
|
-
});
|
|
1098
|
-
|
|
1099
|
-
var Wrapper$3 =
|
|
1100
|
-
/*#__PURE__*/
|
|
1101
|
-
styled.div.withConfig({
|
|
1102
|
-
displayName: "Typestories__Wrapper",
|
|
1103
|
-
componentId: "nme558-0"
|
|
1104
|
-
})(["text-align:center;margin:1rem;"]);
|
|
1105
|
-
var createStoryForUIType = (function (stories) {
|
|
1106
|
-
return stories.add('dynamic story', function () {
|
|
1107
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
1108
|
-
return React.createElement(UIType$1, {
|
|
1109
|
-
variant: select('variant', variant({
|
|
1110
|
-
name: 'component_uiType_'
|
|
1111
|
-
})({
|
|
1112
|
-
theme: theme
|
|
1113
|
-
}), 'body1')
|
|
1114
|
-
}, text('children', 'Hello TypeSet'));
|
|
1115
|
-
});
|
|
1116
|
-
}).add('variants', function () {
|
|
1117
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
1118
|
-
return variant({
|
|
1119
|
-
name: 'component_uiType_'
|
|
1120
|
-
})({
|
|
1121
|
-
theme: theme
|
|
1122
|
-
}).map(function (name) {
|
|
1123
|
-
return React.createElement(Wrapper$3, {
|
|
1124
|
-
key: name
|
|
1125
|
-
}, React.createElement(UIType$1, {
|
|
1126
|
-
variant: name
|
|
1127
|
-
}, name));
|
|
1128
|
-
});
|
|
1129
|
-
});
|
|
1130
|
-
});
|
|
1131
|
-
});
|
|
692
|
+
var Button$1 = React.memo(UIButton);
|
|
1132
693
|
|
|
1133
694
|
var UICard = withEnhanceProps(styled.div.withConfig({
|
|
1134
695
|
displayName: "Card__UICard",
|
|
@@ -1161,46 +722,6 @@ UICard.defaultProps = {
|
|
|
1161
722
|
variant: 'standard'
|
|
1162
723
|
};
|
|
1163
724
|
|
|
1164
|
-
var Wrapper$4 =
|
|
1165
|
-
/*#__PURE__*/
|
|
1166
|
-
styled.div.withConfig({
|
|
1167
|
-
displayName: "Cardstories__Wrapper",
|
|
1168
|
-
componentId: "sc-1ogn9bx-0"
|
|
1169
|
-
})(["text-align:center;margin:1rem;"]);
|
|
1170
|
-
var createStoryForUICard = (function (stories) {
|
|
1171
|
-
return stories.add('dynamic story', function () {
|
|
1172
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
1173
|
-
var _ref2;
|
|
1174
|
-
|
|
1175
|
-
return React.createElement(UICard, {
|
|
1176
|
-
variant: select('variant', Object.keys(((_ref2 = theme) != null ? (_ref2 = _ref2.components) != null ? _ref2.uiCard : _ref2 : _ref2) || {}), 'main')
|
|
1177
|
-
}, text('children', 'Hello Well'));
|
|
1178
|
-
});
|
|
1179
|
-
}).add('variants', function () {
|
|
1180
|
-
return React.createElement(ThemeConsumer, null, function (theme) {
|
|
1181
|
-
var _ref;
|
|
1182
|
-
|
|
1183
|
-
return Object.keys(((_ref = theme) != null ? (_ref = _ref.components) != null ? _ref.uiCard : _ref : _ref) || {}).map(function (variant) {
|
|
1184
|
-
return React.createElement(Wrapper$4, {
|
|
1185
|
-
key: variant
|
|
1186
|
-
}, React.createElement(UICard, {
|
|
1187
|
-
variant: variant
|
|
1188
|
-
}, variant));
|
|
1189
|
-
});
|
|
1190
|
-
});
|
|
1191
|
-
});
|
|
1192
|
-
});
|
|
1193
|
-
|
|
1194
|
-
function createStoriesForUI(storyFactory) {
|
|
1195
|
-
createStoryForUIButton(storyFactory('Button'));
|
|
1196
|
-
createStoryForUICard(storyFactory('Card'));
|
|
1197
|
-
createStoryForUIIcon(storyFactory('Icon'));
|
|
1198
|
-
createStoryForUIImage(storyFactory('Image'));
|
|
1199
|
-
createStoryForUIProcessingCircle(storyFactory('ProcessingCircle'));
|
|
1200
|
-
createStoryForUIProcessingLine(storyFactory('ProcessingLine'));
|
|
1201
|
-
createStoryForUIType(storyFactory('Type'));
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
725
|
var UIError = function UIError(props) {
|
|
1205
726
|
return React.createElement(UIType$1, _extends({
|
|
1206
727
|
variant: "body2",
|
|
@@ -1333,6 +854,31 @@ UIFlexBox.defaultProps = {
|
|
|
1333
854
|
variant: 'standard'
|
|
1334
855
|
};
|
|
1335
856
|
|
|
857
|
+
var UIImage =
|
|
858
|
+
/*#__PURE__*/
|
|
859
|
+
styled.img.withConfig({
|
|
860
|
+
displayName: "Image__UIImage",
|
|
861
|
+
componentId: "sc-1fmo7bh-0"
|
|
862
|
+
})(["", " ", ""], component(), function (props) {
|
|
863
|
+
return props.css;
|
|
864
|
+
});
|
|
865
|
+
UIImage.propTypes = {
|
|
866
|
+
alt: PropTypes.string.isRequired,
|
|
867
|
+
namespace: PropTypesPlus.string,
|
|
868
|
+
src: PropTypes.string.isRequired,
|
|
869
|
+
variant: PropTypes.string
|
|
870
|
+
};
|
|
871
|
+
UIImage.defaultProps = {
|
|
872
|
+
namespace: 'component_uiImage',
|
|
873
|
+
variant: 'standard'
|
|
874
|
+
};
|
|
875
|
+
var Image = _flowRight([withTheme, withProps(function (props) {
|
|
876
|
+
return {
|
|
877
|
+
alt: props.name,
|
|
878
|
+
src: image(props)
|
|
879
|
+
};
|
|
880
|
+
})])(UIImage);
|
|
881
|
+
|
|
1336
882
|
var hooks$2 = {
|
|
1337
883
|
usePropsTrigger: function usePropsTrigger(props, styles, hidden, setHidden) {
|
|
1338
884
|
return React.useMemo(function () {
|
|
@@ -1345,7 +891,7 @@ var hooks$2 = {
|
|
|
1345
891
|
}
|
|
1346
892
|
};
|
|
1347
893
|
|
|
1348
|
-
var Wrapper
|
|
894
|
+
var Wrapper =
|
|
1349
895
|
/*#__PURE__*/
|
|
1350
896
|
styled.div.withConfig({
|
|
1351
897
|
displayName: "Tooltipstyles__Wrapper",
|
|
@@ -1365,10 +911,10 @@ var styles = {
|
|
|
1365
911
|
}))
|
|
1366
912
|
};
|
|
1367
913
|
|
|
1368
|
-
function _templateObject$
|
|
914
|
+
function _templateObject$3() {
|
|
1369
915
|
var data = _taggedTemplateLiteral(["", ""]);
|
|
1370
916
|
|
|
1371
|
-
_templateObject$
|
|
917
|
+
_templateObject$3 = function _templateObject() {
|
|
1372
918
|
return data;
|
|
1373
919
|
};
|
|
1374
920
|
|
|
@@ -1408,7 +954,7 @@ UITooltip.defaultProps = {
|
|
|
1408
954
|
};
|
|
1409
955
|
var UITooltip$1 = React.memo(UITooltip);
|
|
1410
956
|
|
|
1411
|
-
var _StyledWrapper = styled(Wrapper
|
|
957
|
+
var _StyledWrapper = styled(Wrapper)(_templateObject$3(), function (p) {
|
|
1412
958
|
return p._css;
|
|
1413
959
|
});
|
|
1414
960
|
|
|
@@ -1450,10 +996,10 @@ var styles$1 = {
|
|
|
1450
996
|
tooltip: css(["margin-left:0.5rem;"])
|
|
1451
997
|
};
|
|
1452
998
|
|
|
1453
|
-
function _templateObject$
|
|
999
|
+
function _templateObject$4() {
|
|
1454
1000
|
var data = _taggedTemplateLiteral(["", ""]);
|
|
1455
1001
|
|
|
1456
|
-
_templateObject$
|
|
1002
|
+
_templateObject$4 = function _templateObject() {
|
|
1457
1003
|
return data;
|
|
1458
1004
|
};
|
|
1459
1005
|
|
|
@@ -1526,7 +1072,7 @@ UILabel.defaultProps = {
|
|
|
1526
1072
|
};
|
|
1527
1073
|
var Label$1 = React.memo(UILabel);
|
|
1528
1074
|
|
|
1529
|
-
var _StyledUILabelRoot = styled(UILabelRoot)(_templateObject$
|
|
1075
|
+
var _StyledUILabelRoot = styled(UILabelRoot)(_templateObject$4(), function (p) {
|
|
1530
1076
|
return p._css;
|
|
1531
1077
|
});
|
|
1532
1078
|
|
|
@@ -1869,6 +1415,173 @@ function Portal$1(props) {
|
|
|
1869
1415
|
return elementRef && ReactDOM.createPortal(props.children, elementRef);
|
|
1870
1416
|
}
|
|
1871
1417
|
|
|
1418
|
+
var primaryScale =
|
|
1419
|
+
/*#__PURE__*/
|
|
1420
|
+
keyframes(["0%{transform:scaleX(0.08);}36.65%{animation-timing-function:cubic-bezier(0.334731,0.12482,0.785844,1);transform:scaleX(0.08);}65.15%{animation-timing-function:cubmic-bezier(0.06,0.11,0.6,1);transform:scaleX(0.661479);}100%{transform:scaleX(0.08);}"]);
|
|
1421
|
+
var primaryTranslate =
|
|
1422
|
+
/*#__PURE__*/
|
|
1423
|
+
keyframes(["0%{transform:translateX(0);}20%{animation-timing-function:cubic-bezier(0.5,0,0.701732,0.495819);transform:translateX(0);}59.15%{animation-timing-function:cubic-bezier(0.302435,0.381352,0.55,0.956352);transform:translateX(83.67142%);}100%{transform:translateX(200.611057%);}"]);
|
|
1424
|
+
var secondaryScale =
|
|
1425
|
+
/*#__PURE__*/
|
|
1426
|
+
keyframes(["0%{animation-timing-function:cubic-bezier(0.205028,0.057051,0.57661,0.45397);transform:scaleX(0.08);}19.15%{animation-timing-function:cubic-bezier(0.152313,0.196432,0.648374,1.004315);transform:scaleX(0.457104);}44.15%{animation-timing-function:cubic-bezier(0.257759,-0.003163,0.211762,1.38179);transform:scaleX(0.72796);}100%{transform:scaleX(0.08);}"]);
|
|
1427
|
+
var secondaryTranslate =
|
|
1428
|
+
/*#__PURE__*/
|
|
1429
|
+
keyframes(["0%{animation-timing-function:cubic-bezier(0.15,0,0.515058,0.409685);transform:translateX(0);}25%{animation-timing-function:cubic-bezier(0.31033,0.284058,0.8,0.733712);transform:translateX(37.651913%);}48.35%{animation-timing-function:cubic-bezier(0.4,0.627035,0.6,0.902026);transform:translateX(84.386165%);}100%{transform:translateX(160.277782%);}"]);
|
|
1430
|
+
var Block =
|
|
1431
|
+
/*#__PURE__*/
|
|
1432
|
+
styled.div.withConfig({
|
|
1433
|
+
displayName: "ProgressLinestyles__Block",
|
|
1434
|
+
componentId: "gwo5u1-0"
|
|
1435
|
+
})(["display:flex;align-items:center;height:", ";min-width:2rem;overflow:hidden;position:relative;transition:opacity 0.25s cubic-bezier(0.4,0,0.6,1) 0ms;transform:translateZ(0);", ""], function (props) {
|
|
1436
|
+
return props.height;
|
|
1437
|
+
}, mixins.margin);
|
|
1438
|
+
var BarWrapper =
|
|
1439
|
+
/*#__PURE__*/
|
|
1440
|
+
styled.div.withConfig({
|
|
1441
|
+
displayName: "ProgressLinestyles__BarWrapper",
|
|
1442
|
+
componentId: "gwo5u1-1"
|
|
1443
|
+
})(["height:", ";position:relative;flex:1;"], function (props) {
|
|
1444
|
+
return props.thickness;
|
|
1445
|
+
});
|
|
1446
|
+
var Buffer =
|
|
1447
|
+
/*#__PURE__*/
|
|
1448
|
+
styled.div.withConfig({
|
|
1449
|
+
displayName: "ProgressLinestyles__Buffer",
|
|
1450
|
+
componentId: "gwo5u1-2"
|
|
1451
|
+
})(["background-color:", ";height:100%;position:absolute;transition:transform ", ";transform-origin:left top;width:100%;", ""], function (props) {
|
|
1452
|
+
return color({
|
|
1453
|
+
palette: props.palette || 'gray',
|
|
1454
|
+
paletteWeight: props.paletteWeight
|
|
1455
|
+
})(props);
|
|
1456
|
+
}, function (props) {
|
|
1457
|
+
return props.transitionDuration || '225ms';
|
|
1458
|
+
}, function (props) {
|
|
1459
|
+
return props.value !== null && css(["transform:translateX(", "%);"], props.value - 100);
|
|
1460
|
+
});
|
|
1461
|
+
var BarPrimary =
|
|
1462
|
+
/*#__PURE__*/
|
|
1463
|
+
styled.div.withConfig({
|
|
1464
|
+
displayName: "ProgressLinestyles__BarPrimary",
|
|
1465
|
+
componentId: "gwo5u1-3"
|
|
1466
|
+
})(["height:100%;position:absolute;transform-origin:left top;width:100%;", ""], function (props) {
|
|
1467
|
+
return props.value === null && css(["transform:scaleX(0);animation:", " 2s infinite linear;left:-145.166611%;transition:none;"], primaryTranslate);
|
|
1468
|
+
});
|
|
1469
|
+
var BarPrimaryInner =
|
|
1470
|
+
/*#__PURE__*/
|
|
1471
|
+
styled.span.withConfig({
|
|
1472
|
+
displayName: "ProgressLinestyles__BarPrimaryInner",
|
|
1473
|
+
componentId: "gwo5u1-4"
|
|
1474
|
+
})(["background-color:", ";display:inline-block;height:100%;position:absolute;width:100%;", " ", ""], function (props) {
|
|
1475
|
+
return color({
|
|
1476
|
+
palette: props.palette || 'primary',
|
|
1477
|
+
paletteWeight: props.paletteWeight
|
|
1478
|
+
})(props);
|
|
1479
|
+
}, function (props) {
|
|
1480
|
+
return props.value === null && css(["animation:", " 2s infinite linear;"], primaryScale);
|
|
1481
|
+
}, function (props) {
|
|
1482
|
+
return props.value !== null && css(["transform:translateX(", "%);transition:transform ", " cubic-bezier(0.4,0,0.6,1) 0ms;"], props.value - 100, props.transitionDuration || '225ms');
|
|
1483
|
+
});
|
|
1484
|
+
var BarSecondary =
|
|
1485
|
+
/*#__PURE__*/
|
|
1486
|
+
styled.div.withConfig({
|
|
1487
|
+
displayName: "ProgressLinestyles__BarSecondary",
|
|
1488
|
+
componentId: "gwo5u1-5"
|
|
1489
|
+
})(["animation:", " 2s infinite linear;height:100%;left:-54.888891%;position:absolute;transition:none;transform-origin:left top;visibility:visible;width:100%;"], secondaryTranslate);
|
|
1490
|
+
var BarSecondaryInner =
|
|
1491
|
+
/*#__PURE__*/
|
|
1492
|
+
styled.span.withConfig({
|
|
1493
|
+
displayName: "ProgressLinestyles__BarSecondaryInner",
|
|
1494
|
+
componentId: "gwo5u1-6"
|
|
1495
|
+
})(["animation:", " 2s infinite linear;background-color:", ";display:inline-block;height:100%;position:absolute;visibility:visible;width:100%;"], secondaryScale, function (props) {
|
|
1496
|
+
return color({
|
|
1497
|
+
palette: props.palette || 'primary',
|
|
1498
|
+
paletteWeight: props.paletteWeight
|
|
1499
|
+
})(props);
|
|
1500
|
+
});
|
|
1501
|
+
|
|
1502
|
+
function UIProgressLine(props) {
|
|
1503
|
+
var _React$useState = React.useState(props.valueInitial === undefined ? props.value : props.valueInitial),
|
|
1504
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1505
|
+
value = _React$useState2[0],
|
|
1506
|
+
setValue = _React$useState2[1];
|
|
1507
|
+
|
|
1508
|
+
var _React$useState3 = React.useState(props.bufferValueInitial === undefined ? props.bufferValue : props.bufferValueInitial),
|
|
1509
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
1510
|
+
bufferValue = _React$useState4[0],
|
|
1511
|
+
setBufferValue = _React$useState4[1];
|
|
1512
|
+
|
|
1513
|
+
React.useEffect(function () {
|
|
1514
|
+
setTimeout(function () {
|
|
1515
|
+
setValue(props.value);
|
|
1516
|
+
setBufferValue(props.bufferValue);
|
|
1517
|
+
}, 0);
|
|
1518
|
+
}, [props.value, props.bufferValue]);
|
|
1519
|
+
return React.createElement(Block, {
|
|
1520
|
+
className: props.className,
|
|
1521
|
+
height: props.height,
|
|
1522
|
+
$margin: props.margin,
|
|
1523
|
+
$marginBottom: props.marginBottom,
|
|
1524
|
+
$marginLeft: props.marginLeft,
|
|
1525
|
+
$marginRight: props.marginRight,
|
|
1526
|
+
$marginTop: props.marginTop
|
|
1527
|
+
}, React.createElement(Buffer, {
|
|
1528
|
+
palette: props.bufferPalette,
|
|
1529
|
+
paletteWeight: props.bufferPaletteWeight,
|
|
1530
|
+
transitionDuration: props.transitionDuration,
|
|
1531
|
+
value: bufferValue
|
|
1532
|
+
}), React.createElement(BarWrapper, {
|
|
1533
|
+
thickness: props.thickness || props.height
|
|
1534
|
+
}, React.createElement(BarPrimary, {
|
|
1535
|
+
value: props.value,
|
|
1536
|
+
transitionDuration: props.transitionDuration
|
|
1537
|
+
}, React.createElement(BarPrimaryInner, {
|
|
1538
|
+
palette: props.palette,
|
|
1539
|
+
paletteWeight: props.paletteWeight,
|
|
1540
|
+
transitionDuration: props.transitionDuration,
|
|
1541
|
+
value: value
|
|
1542
|
+
})), value === null && React.createElement(BarSecondary, null, React.createElement(BarSecondaryInner, {
|
|
1543
|
+
palette: props.palette,
|
|
1544
|
+
paletteWeight: props.paletteWeight
|
|
1545
|
+
}))));
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
UIProgressLine.propTypes = {
|
|
1549
|
+
bufferPalette: PropTypes.string,
|
|
1550
|
+
bufferPaletteWeight: PropTypes.string,
|
|
1551
|
+
bufferValue: PropTypes.number,
|
|
1552
|
+
bufferValueInitial: PropTypes.number,
|
|
1553
|
+
height: PropTypes.string,
|
|
1554
|
+
margin: PropTypes.string,
|
|
1555
|
+
marginBottom: PropTypes.string,
|
|
1556
|
+
marginLeft: PropTypes.string,
|
|
1557
|
+
marginRight: PropTypes.string,
|
|
1558
|
+
marginTop: PropTypes.string,
|
|
1559
|
+
palette: PropTypes.string,
|
|
1560
|
+
paletteWeight: PropTypes.string,
|
|
1561
|
+
thickness: PropTypes.string,
|
|
1562
|
+
transitionDuration: PropTypes.string,
|
|
1563
|
+
value: PropTypes.number,
|
|
1564
|
+
valueInitial: PropTypes.number
|
|
1565
|
+
};
|
|
1566
|
+
UIProgressLine.defaultProps = {
|
|
1567
|
+
bufferPalette: undefined,
|
|
1568
|
+
bufferPaletteWeight: undefined,
|
|
1569
|
+
bufferValue: 100,
|
|
1570
|
+
bufferValueInitial: undefined,
|
|
1571
|
+
height: '4px',
|
|
1572
|
+
margin: undefined,
|
|
1573
|
+
marginBottom: undefined,
|
|
1574
|
+
marginLeft: undefined,
|
|
1575
|
+
marginRight: undefined,
|
|
1576
|
+
marginTop: undefined,
|
|
1577
|
+
palette: undefined,
|
|
1578
|
+
paletteWeight: undefined,
|
|
1579
|
+
thickness: undefined,
|
|
1580
|
+
transitionDuration: undefined,
|
|
1581
|
+
value: null,
|
|
1582
|
+
valueInitial: undefined
|
|
1583
|
+
};
|
|
1584
|
+
|
|
1872
1585
|
var UISpacer = withEnhanceProps(styled.div.withConfig({
|
|
1873
1586
|
displayName: "Spacer__UISpacer",
|
|
1874
1587
|
componentId: "sc-62ugl2-0"
|
|
@@ -1884,5 +1597,5 @@ UISpacer.defaultProps = {
|
|
|
1884
1597
|
variant: 'standard'
|
|
1885
1598
|
};
|
|
1886
1599
|
|
|
1887
|
-
export {
|
|
1600
|
+
export { Button$1 as UIButton, UICard, UIError$1 as UIError, ErrorBoundary as UIErrorBoundary, ErrorWell as UIErrorWell, UIFlexBox, UIIcon, Image as UIImage, Label$1 as UILabel, UILine, EnhancedPopup as UIPopup, Portal$1 as UIPortal, ProgressCircle as UIProgressCircle, UIProgressLine, UISpacer, UIType$1 as UIType };
|
|
1888
1601
|
//# sourceMappingURL=development.js.map
|