sag_components 1.0.0 → 1.0.2

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,32 @@
1
+ name: Azure Static Web Apps CI/CD
2
+
3
+ pr:
4
+ branches:
5
+ include:
6
+ - Task-9085-Create-basic-dropdown
7
+ trigger:
8
+ branches:
9
+ include:
10
+ - Task-9085-Create-basic-dropdown
11
+
12
+ jobs:
13
+ - job: build_and_deploy_job
14
+ displayName: Build and Deploy Job
15
+ condition: or(eq(variables['Build.Reason'], 'Manual'),or(eq(variables['Build.Reason'], 'PullRequest'),eq(variables['Build.Reason'], 'IndividualCI')))
16
+ pool:
17
+ vmImage: ubuntu-latest
18
+ variables:
19
+ - group: Azure-Static-Web-Apps-delightful-cliff-010f39003-variable-group
20
+ steps:
21
+ - checkout: self
22
+ submodules: true
23
+ - task: AzureStaticWebApp@0
24
+ inputs:
25
+ azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS_API_TOKEN_DELIGHTFUL_CLIFF_010F39003)
26
+ ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
27
+ # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
28
+ app_location: "/" # App source code path
29
+ api_location: "" # Api source code path - optional
30
+ output_location: "build" # Built app content directory - optional
31
+ ###### End of Repository/Build Configurations ######
32
+
package/decs.d.ts ADDED
File without changes
package/dist/App.js ADDED
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _logo = _interopRequireDefault(require("./logo.svg"));
9
+ require("./App.css");
10
+ var _Button = require("./stories/Button");
11
+ var _Dropdown = _interopRequireDefault(require("./stories/Dropdown"));
12
+ var onChangehandler = function onChangehandler(event, newValue) {
13
+ console.log("Dropdown onChange event returned:");
14
+ console.log(newValue);
15
+ };
16
+ var onInputChangeHandler = function onInputChangeHandler(event, newInputValue) {
17
+ console.log("Dropdown onInputChange event returned:");
18
+ console.log(newInputValue);
19
+ };
20
+ function App() {
21
+ var options = [{
22
+ id: "1",
23
+ label: "Shufersal"
24
+ }, {
25
+ id: "2",
26
+ label: "EPC"
27
+ }, {
28
+ id: "3",
29
+ label: "Food Lion"
30
+ }, {
31
+ id: "4",
32
+ label: "Hannaford"
33
+ }, {
34
+ id: "5",
35
+ label: "Giant Food"
36
+ }, {
37
+ id: "6",
38
+ label: "The Giant Company"
39
+ }, {
40
+ id: "7",
41
+ label: "Stop&Shop"
42
+ }, {
43
+ id: "8",
44
+ label: "Price Chopper"
45
+ }, {
46
+ id: "9",
47
+ label: "South Eastern Grocers"
48
+ }];
49
+ return /*#__PURE__*/React.createElement("div", {
50
+ className: "App"
51
+ }, /*#__PURE__*/React.createElement(_Dropdown.default, {
52
+ width: "300",
53
+ size: "small",
54
+ text: "Select retailer......",
55
+ multiSelect: false,
56
+ options: options,
57
+ shape: "round",
58
+ onChange: onChangehandler,
59
+ onInputChange: onInputChangeHandler
60
+ }), /*#__PURE__*/React.createElement(_Dropdown.default, {
61
+ width: 400,
62
+ size: "small",
63
+ text: "Select retailer......",
64
+ multiSelect: true,
65
+ options: options,
66
+ shape: "round",
67
+ onChange: onChangehandler,
68
+ onInputChange: onInputChangeHandler
69
+ }));
70
+ }
71
+ var _default = App;
72
+ exports.default = _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _react = require("@testing-library/react");
5
+ var _App = _interopRequireDefault(require("./App"));
6
+ test('renders learn react link', function () {
7
+ (0, _react.render)( /*#__PURE__*/React.createElement(_App.default, null));
8
+ var linkElement = _react.screen.getByText(/learn react/i);
9
+ expect(linkElement).toBeInTheDocument();
10
+ });
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _react = _interopRequireDefault(require("react"));
5
+ var _client = _interopRequireDefault(require("react-dom/client"));
6
+ require("./index.css");
7
+ var _App = _interopRequireDefault(require("./App"));
8
+ require("@fontsource/roboto/300.css");
9
+ require("@fontsource/roboto/400.css");
10
+ require("@fontsource/roboto/500.css");
11
+ require("@fontsource/roboto/700.css");
12
+ var root = _client.default.createRoot(document.getElementById('root'));
13
+ root.render( /*#__PURE__*/_react.default.createElement(_react.default.StrictMode, null, /*#__PURE__*/_react.default.createElement(_App.default, null)));
14
+
15
+ // If you want to start measuring performance in your app, pass a function
16
+ // to log results (for example: reportWebVitals(console.log))
17
+ // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.SmallContainedStyle = exports.MediumOutlinedStyle = exports.LargeTextStyle = exports.DisabledContainedStyle = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _Button = require("./components/Button");
10
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
11
+ var _default = {
12
+ title: "SAG BI/Button",
13
+ component: _Button.Button,
14
+ tags: ["autodocs"],
15
+ argTypes: {
16
+ text: {
17
+ name: "text",
18
+ control: {
19
+ type: "text"
20
+ },
21
+ description: "text inside of the button",
22
+ defaultValue: ""
23
+ },
24
+ style: {
25
+ control: {
26
+ type: "radio"
27
+ },
28
+ options: ["contained", "outlined", "text"],
29
+ description: "style of the button"
30
+ },
31
+ size: {
32
+ control: {
33
+ type: "radio"
34
+ },
35
+ options: ["small", "medium", "large"],
36
+ description: "size of the button"
37
+ },
38
+ disabled: {
39
+ name: "disabled",
40
+ control: {
41
+ type: "boolean"
42
+ },
43
+ description: "changes the button to be enabled/disabled",
44
+ defaultValue: ""
45
+ },
46
+ onClick: {
47
+ action: "onClick",
48
+ description: "returns an event click object when user clicks on a button"
49
+ }
50
+ }
51
+ };
52
+ exports.default = _default;
53
+ var Template = function Template(args) {
54
+ return /*#__PURE__*/_react.default.createElement(_Button.Button, args);
55
+ };
56
+ var SmallContainedStyle = Template.bind({});
57
+ exports.SmallContainedStyle = SmallContainedStyle;
58
+ SmallContainedStyle.args = {
59
+ text: "Confirm",
60
+ style: "contained",
61
+ size: "small",
62
+ disabled: false
63
+ };
64
+ var DisabledContainedStyle = Template.bind({});
65
+ exports.DisabledContainedStyle = DisabledContainedStyle;
66
+ DisabledContainedStyle.args = {
67
+ size: "small",
68
+ text: "Confirm",
69
+ style: "contained",
70
+ disabled: true
71
+ };
72
+ var MediumOutlinedStyle = Template.bind({});
73
+ exports.MediumOutlinedStyle = MediumOutlinedStyle;
74
+ MediumOutlinedStyle.args = {
75
+ text: "Confirm",
76
+ size: "medium",
77
+ style: "outlined",
78
+ disabled: false
79
+ };
80
+ var LargeTextStyle = Template.bind({});
81
+ exports.LargeTextStyle = LargeTextStyle;
82
+ LargeTextStyle.args = {
83
+ text: "Confirm",
84
+ size: "large",
85
+ style: "text",
86
+ disabled: false
87
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.DropdownContainer = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
10
+ var _templateObject;
11
+ var DropdownContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "; \n text-align: left; \n position: relative; \n align-items: center;\n justify-content: center;\n"])), function (props) {
12
+ return props.width;
13
+ });
14
+ exports.DropdownContainer = DropdownContainer;
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.UpDownArrowIcon = exports.SmallSquare = exports.SmallRound = exports.SearchIcon = exports.MultiSelectWithIcons = exports.MultiSelectSmall = exports.MultiSelectLarge = exports.LargeSquareWithIcons = exports.LargeRoundWithoutIcons = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _Dropdown = require("./components/Dropdown");
10
+ var options = [{
11
+ id: 0,
12
+ label: "Shufersal"
13
+ }, {
14
+ id: 1,
15
+ label: "EPC"
16
+ }, {
17
+ id: 2,
18
+ label: "Food Lion"
19
+ }, {
20
+ id: 3,
21
+ label: "Hannaford"
22
+ }, {
23
+ id: 4,
24
+ label: "Giant Food"
25
+ }, {
26
+ id: 5,
27
+ label: "The Giant Company"
28
+ }, {
29
+ id: 6,
30
+ label: "Stop&Shop"
31
+ }, {
32
+ id: 7,
33
+ label: "Price Chopper"
34
+ }, {
35
+ id: 8,
36
+ label: "South Eastern Grocers"
37
+ }];
38
+
39
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
40
+ var _default = {
41
+ title: "SAG BI/Dropdown",
42
+ component: _Dropdown.Dropdown,
43
+ tags: ["autodocs"],
44
+ argTypes: {
45
+ width: {
46
+ control: {
47
+ type: "number"
48
+ },
49
+ description: "width of the input field",
50
+ defaultValue: 300
51
+ },
52
+ size: {
53
+ control: {
54
+ type: "radio"
55
+ },
56
+ options: ["small", "large"],
57
+ description: "size: small/large"
58
+ },
59
+ text: {
60
+ name: "text",
61
+ control: {
62
+ type: "text"
63
+ },
64
+ description: "text inside of the input field",
65
+ defaultValue: 'Search...'
66
+ },
67
+ placeHolder: {
68
+ name: "placeHolder",
69
+ control: {
70
+ type: "text"
71
+ },
72
+ description: "notify the user how to type a text",
73
+ defaultValue: "Type..."
74
+ },
75
+ multiSelect: {
76
+ name: "multiSelect",
77
+ // control: { type: "boolean",
78
+ // },
79
+ control: false,
80
+ description: "true/false - allows multi select - (switch multiSelect / singleSelect is disabled in this story)"
81
+ },
82
+ limitTagsOnMultiSelect: {
83
+ name: "limitTagsOnMultiSelect",
84
+ control: {
85
+ type: "number"
86
+ },
87
+ description: "limit noumber displayed tags on multi select when not focused"
88
+ },
89
+ options: {
90
+ description: "array [] of objects: {id: string1 , label: string2 } to fill dropdown options "
91
+ },
92
+ shape: {
93
+ control: {
94
+ type: "radio"
95
+ },
96
+ options: ["round", "square"],
97
+ description: "shape: round/square"
98
+ },
99
+ showPopupIcon: {
100
+ name: "showPopupIcon",
101
+ control: {
102
+ type: "boolean"
103
+ },
104
+ description: "show/hide popup (up/down arrow) icon"
105
+ },
106
+ showSearchIcon: {
107
+ name: "showSearchIcon",
108
+ control: {
109
+ type: "boolean"
110
+ },
111
+ description: "show/hide search icon "
112
+ },
113
+ onChange: {
114
+ action: "onChange",
115
+ description: "returns an option (object) selected by the user"
116
+ },
117
+ onInputChange: {
118
+ action: "onInputChange",
119
+ description: "returns a value (string) displayed in the textbox"
120
+ }
121
+ }
122
+ };
123
+ exports.default = _default;
124
+ var Template = function Template(args) {
125
+ return /*#__PURE__*/_react.default.createElement(_Dropdown.Dropdown, args);
126
+ };
127
+ var SmallSquare = Template.bind({});
128
+ exports.SmallSquare = SmallSquare;
129
+ SmallSquare.args = {
130
+ width: 300,
131
+ size: "small",
132
+ text: "Retailer",
133
+ multiSelect: false,
134
+ limitTagsOnMultiSelect: 0,
135
+ placeHolder: "Type...",
136
+ shape: "square",
137
+ showPopupIcon: false,
138
+ showSearchIcon: false,
139
+ options: options
140
+ };
141
+ var SmallRound = Template.bind({});
142
+ exports.SmallRound = SmallRound;
143
+ SmallRound.args = {
144
+ width: 300,
145
+ size: "small",
146
+ text: "Retailer",
147
+ multiSelect: false,
148
+ limitTagsOnMultiSelect: 0,
149
+ placeHolder: "Type...",
150
+ shape: "round",
151
+ showPopupIcon: false,
152
+ showSearchIcon: false,
153
+ options: options
154
+ };
155
+ var UpDownArrowIcon = Template.bind({});
156
+ exports.UpDownArrowIcon = UpDownArrowIcon;
157
+ UpDownArrowIcon.args = {
158
+ width: 300,
159
+ size: "small",
160
+ text: "Retailer",
161
+ multiSelect: false,
162
+ limitTagsOnMultiSelect: 0,
163
+ placeHolder: "Type...",
164
+ shape: "round",
165
+ showPopupIcon: true,
166
+ showSearchIcon: false,
167
+ options: options
168
+ };
169
+ var SearchIcon = Template.bind({});
170
+ exports.SearchIcon = SearchIcon;
171
+ SearchIcon.args = {
172
+ width: 300,
173
+ size: "small",
174
+ text: "Retailer",
175
+ multiSelect: false,
176
+ limitTagsOnMultiSelect: 0,
177
+ placeHolder: "Type...",
178
+ shape: "round",
179
+ showPopupIcon: false,
180
+ showSearchIcon: true,
181
+ options: options
182
+ };
183
+ var MultiSelectSmall = Template.bind({});
184
+ exports.MultiSelectSmall = MultiSelectSmall;
185
+ MultiSelectSmall.args = {
186
+ width: 400,
187
+ size: "small",
188
+ text: "Retailer",
189
+ multiSelect: true,
190
+ limitTagsOnMultiSelect: 2,
191
+ placeHolder: "Type...",
192
+ shape: "square",
193
+ showPopupIcon: false,
194
+ showSearchIcon: false,
195
+ options: options
196
+ };
197
+ var MultiSelectLarge = Template.bind({});
198
+ exports.MultiSelectLarge = MultiSelectLarge;
199
+ MultiSelectLarge.args = {
200
+ width: 500,
201
+ size: "large",
202
+ text: "Retailer",
203
+ multiSelect: true,
204
+ limitTagsOnMultiSelect: 2,
205
+ placeHolder: "Type...",
206
+ shape: "round",
207
+ showPopupIcon: false,
208
+ showSearchIcon: false,
209
+ options: options
210
+ };
211
+ var MultiSelectWithIcons = Template.bind({});
212
+ exports.MultiSelectWithIcons = MultiSelectWithIcons;
213
+ MultiSelectWithIcons.args = {
214
+ width: 500,
215
+ size: "large",
216
+ text: "Retailer",
217
+ multiSelect: true,
218
+ limitTagsOnMultiSelect: 2,
219
+ placeHolder: "Type...",
220
+ shape: "square",
221
+ showPopupIcon: true,
222
+ showSearchIcon: true,
223
+ options: options
224
+ };
225
+ var LargeRoundWithoutIcons = Template.bind({});
226
+ exports.LargeRoundWithoutIcons = LargeRoundWithoutIcons;
227
+ LargeRoundWithoutIcons.args = {
228
+ width: 400,
229
+ size: "large",
230
+ text: "Retailer",
231
+ multiSelect: false,
232
+ limitTagsOnMultiSelect: 0,
233
+ placeHolder: "Type part of name...",
234
+ shape: "round",
235
+ showPopupIcon: false,
236
+ showSearchIcon: false,
237
+ options: options
238
+ };
239
+ var LargeSquareWithIcons = Template.bind({});
240
+ exports.LargeSquareWithIcons = LargeSquareWithIcons;
241
+ LargeSquareWithIcons.args = {
242
+ width: 400,
243
+ size: "large",
244
+ text: "Retailer",
245
+ multiSelect: false,
246
+ limitTagsOnMultiSelect: 0,
247
+ placeHolder: "Type part of name...",
248
+ shape: "square",
249
+ showPopupIcon: true,
250
+ showSearchIcon: true,
251
+ options: options
252
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.DropdownContainer = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
10
+ var _templateObject;
11
+ var DropdownContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "; \n text-align: left; \n position: relative; \n align-items: center;\n justify-content: center;\n"])), function (props) {
12
+ return props.width;
13
+ });
14
+ exports.DropdownContainer = DropdownContainer;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InfoIcon = void 0;
7
+ var InfoIcon = function InfoIcon(_ref) {
8
+ var clicked = _ref.clicked;
9
+ return /*#__PURE__*/React.createElement("svg", {
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ viewBox: "0 0 24 24",
12
+ fill: "none",
13
+ stroke: clicked ? "white" : "black",
14
+ strokeWidth: "2",
15
+ strokeLinecap: "round",
16
+ strokeLinejoin: "round",
17
+ className: "feather feather-info"
18
+ }, /*#__PURE__*/React.createElement("circle", {
19
+ cx: "12",
20
+ cy: "12",
21
+ r: "10"
22
+ }), /*#__PURE__*/React.createElement("line", {
23
+ x1: "12",
24
+ y1: "16",
25
+ x2: "12",
26
+ y2: "12"
27
+ }), /*#__PURE__*/React.createElement("line", {
28
+ x1: "12",
29
+ y1: "8",
30
+ x2: "12",
31
+ y2: "8"
32
+ }));
33
+ };
34
+ exports.InfoIcon = InfoIcon;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Primary = void 0;
7
+ var _OneColumnContainer = require("./components/OneColumnContainer");
8
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
9
+ var _default = {
10
+ title: 'Sag BI/OneColumnContainer',
11
+ component: _OneColumnContainer.OneColumnContainer,
12
+ tags: ['autodocs']
13
+ }; // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
14
+ exports.default = _default;
15
+ var Primary = {
16
+ args: {
17
+ infoText: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
18
+ width: "250px",
19
+ height: "250px"
20
+ }
21
+ };
22
+ exports.Primary = Primary;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.StyledContainer = exports.InfoTextLabel = exports.InfoTextContainer = exports.IconContainer = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
11
+ var StyledContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px; \n display: flex;\n position: relative;\n border-radius: 10px;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n"])), function (props) {
12
+ return props.width;
13
+ }, function (props) {
14
+ return props.height;
15
+ });
16
+ exports.StyledContainer = StyledContainer;
17
+ var InfoTextContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n align-items: center;\n display: flex;\n visibility: ", ";\n text-align: center;\n justify-content: center;\n background: rgba(16, 16, 16, .6);\n"])), function (props) {
18
+ return props.width;
19
+ }, function (props) {
20
+ return props.height;
21
+ }, function (props) {
22
+ return props.clicked ? 'visible' : 'hidden';
23
+ });
24
+ exports.InfoTextContainer = InfoTextContainer;
25
+ var InfoTextLabel = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n text-align: center;\n color: white;\n margin: 10px;\n justify-content: center;\n"])));
26
+ exports.InfoTextLabel = InfoTextLabel;
27
+ var IconContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n width: 15px;\n height: 15px;\n position: absolute;\n margin-top:10px;\n margin-right:10px;\n top: 0;\n right: 0;\n"])));
28
+ exports.IconContainer = IconContainer;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = exports.Button = void 0;
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _Button = _interopRequireDefault(require("@mui/material/Button"));
12
+ var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
13
+ var _excluded = ["text", "style", "size", "disabled", "onClick"];
14
+ var Button = function Button(_ref) {
15
+ var text = _ref.text,
16
+ style = _ref.style,
17
+ size = _ref.size,
18
+ disabled = _ref.disabled,
19
+ _onClick = _ref.onClick,
20
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
21
+ return /*#__PURE__*/React.createElement(_Stack.default, {
22
+ direction: "row",
23
+ spacing: 2
24
+ }, /*#__PURE__*/React.createElement(_Button.default, {
25
+ sx: {
26
+ textTransform: 'none'
27
+ },
28
+ variant: style,
29
+ size: size,
30
+ disabled: disabled ? true : false,
31
+ onClick: function onClick(event) {
32
+ _onClick(event);
33
+ }
34
+ }, text));
35
+ };
36
+ exports.Button = Button;
37
+ var _default = Button;
38
+ exports.default = _default;
@@ -5,12 +5,12 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.OneColumnContainer = void 0;
8
+ exports.default = exports.OneColumnContainer = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
- var _OneColumnContainer = require("./OneColumnContainer.style");
13
- var _InfoIcon = require("./InfoIcon");
12
+ var _OneColumnContainer = require("../OneColumnContainer.style");
13
+ var _InfoIcon = require("../InfoIcon");
14
14
  var _excluded = ["width", "height", "infoText"];
15
15
  /**
16
16
  * Primary UI component for user interaction
@@ -41,4 +41,6 @@ var OneColumnContainer = function OneColumnContainer(_ref) {
41
41
  })));
42
42
  };
43
43
  exports.OneColumnContainer = OneColumnContainer;
44
- OneColumnContainer.defaultProps = {};
44
+ OneColumnContainer.defaultProps = {};
45
+ var _default = OneColumnContainer;
46
+ exports.default = _default;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
- "main": "dist/index.js",
5
+ "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "start": "react-scripts start",
8
8
  "build": "cross-env BABEL_ENV=production babel src -d dist",
package/src/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export function Button({ text, style, size, disabled, onClick, ...props }: {
2
+ [x: string]: any;
3
+ text: any;
4
+ style: any;
5
+ size: any;
6
+ disabled: any;
7
+ onClick: any;
8
+ }): any;
9
+ export default Button;
10
+
@@ -0,0 +1,79 @@
1
+ import React from "react";
2
+ import { Button } from "./components/Button";
3
+
4
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
5
+ export default {
6
+ title: "SAG BI/Button",
7
+ component: Button,
8
+ tags: ["autodocs"],
9
+
10
+ argTypes: {
11
+ text: {
12
+ name: "text",
13
+ control: { type: "text" },
14
+ description: "text inside of the button",
15
+ defaultValue: "",
16
+ },
17
+
18
+ style: {
19
+ control: { type: "radio" },
20
+ options: ["contained", "outlined", "text"],
21
+ description: "style of the button",
22
+ },
23
+
24
+ size: {
25
+ control: { type: "radio" },
26
+ options: ["small", "medium", "large"],
27
+ description: "size of the button",
28
+ },
29
+
30
+ disabled: {
31
+ name: "disabled",
32
+ control: { type: "boolean" },
33
+ description: "changes the button to be enabled/disabled",
34
+ defaultValue: "",
35
+ },
36
+
37
+ onClick: {
38
+ action: "onClick",
39
+ description: "returns an event click object when user clicks on a button",
40
+ },
41
+ },
42
+ };
43
+
44
+ const Template = (args) => <Button {...args} />;
45
+
46
+ export const SmallContainedStyle = Template.bind({});
47
+ SmallContainedStyle.args = {
48
+ text: "Confirm",
49
+ style: "contained",
50
+ size: "small",
51
+ disabled: false,
52
+ };
53
+
54
+
55
+ export const DisabledContainedStyle = Template.bind({});
56
+ DisabledContainedStyle.args = {
57
+ size: "small",
58
+ text: "Confirm",
59
+ style: "contained",
60
+ disabled: true,
61
+ };
62
+
63
+ export const MediumOutlinedStyle = Template.bind({});
64
+ MediumOutlinedStyle.args = {
65
+ text: "Confirm",
66
+ size: "medium",
67
+ style: "outlined",
68
+ disabled: false,
69
+ };
70
+
71
+
72
+ export const LargeTextStyle = Template.bind({});
73
+ LargeTextStyle.args = {
74
+ text: "Confirm",
75
+ size: "large",
76
+ style: "text",
77
+ disabled: false,
78
+ };
79
+
@@ -1,4 +1,4 @@
1
- import { OneColumnContainer } from './OneColumnContainer';
1
+ import { OneColumnContainer } from './components/OneColumnContainer';
2
2
 
3
3
  // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
4
4
  export default {
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import MUIButton from "@mui/material/Button";
3
+ import Stack from "@mui/material/Stack";
4
+
5
+ export const Button = ({text, style, size, disabled, onClick, ...props}) => {
6
+
7
+ return (
8
+ <Stack direction="row" spacing={2}>
9
+ <MUIButton
10
+ sx={{ textTransform: 'none'}}
11
+ variant={style}
12
+ size={size}
13
+ disabled={disabled ? true : false}
14
+ onClick={(event) => {
15
+ onClick(event);
16
+ }}
17
+ >
18
+ {text}
19
+ </MUIButton>
20
+ </Stack>
21
+ );
22
+ };
23
+
24
+ export default Button;
@@ -1,6 +1,6 @@
1
1
  import React,{useState} from 'react';
2
- import { InfoTextLabel,InfoTextContainer,IconContainer, StyledContainer } from './OneColumnContainer.style'
3
- import { InfoIcon } from "./InfoIcon";
2
+ import { InfoTextLabel,InfoTextContainer,IconContainer, StyledContainer } from '../OneColumnContainer.style'
3
+ import { InfoIcon } from "../InfoIcon";
4
4
 
5
5
  /**
6
6
  * Primary UI component for user interaction
@@ -31,3 +31,5 @@ OneColumnContainer.propTypes = {
31
31
  OneColumnContainer.defaultProps = {
32
32
 
33
33
  };
34
+
35
+ export default OneColumnContainer;
package/tsconfig.json ADDED
File without changes
@@ -1,28 +0,0 @@
1
- import * as React from "react";
2
- // import {Button as MuiButton} from "@mui/material/Button" ;
3
- import Button from "@mui/material/Button";
4
- import Stack from "@mui/material/Stack";
5
-
6
- export const ButtonText = (text, size, disabled, onClick) => {
7
- const myText = "Ok";
8
- return (
9
- <Stack direction="row" spacing={2}>
10
- {/* <Button variant="contained"
11
- >
12
- {myText}
13
- </Button> */}
14
- <Button
15
- variant="contained"
16
- // size={size}
17
- // disabled={disabled ? true : false}
18
- // onClick={(event) => {
19
- // onClick(event);
20
- // }}
21
- >
22
- {myText}
23
- </Button>
24
- </Stack>
25
- );
26
- };
27
-
28
- export default ButtonText;
@@ -1,65 +0,0 @@
1
- import React from "react";
2
- import { ButtonText } from "./ButtonText";
3
-
4
- // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
5
- export default {
6
- title: "SAG BI/Button",
7
- component: ButtonText,
8
- tags: ["autodocs"],
9
-
10
- argTypes: {
11
- // width: {
12
- // control: { type: "number" },
13
- // description: "width of the input field",
14
- // defaultValue: 300,
15
- // },
16
-
17
- size: {
18
- control: { type: "radio" },
19
- options: ["small", "large"],
20
- description: "size: small/large",
21
- },
22
-
23
- text: {
24
- name: "text",
25
- control: { type: "text" },
26
- description: "text inside of the button",
27
- defaultValue: "",
28
- },
29
-
30
- // shape: {
31
- // control: { type: "radio" },
32
- // options: ["round", "square"],
33
- // description: "shape: round/square",
34
- // },
35
-
36
- onClick: {
37
- action: "onClick",
38
- description: "returns an event click object when user clicks on a button",
39
- },
40
- },
41
- };
42
-
43
- const Template = (args) => <ButtonText {...args} />;
44
-
45
- export const Small = Template.bind({});
46
- Small.args = {
47
- // width: 300,
48
- size: "small",
49
- text: "Yes",
50
- };
51
-
52
- export const Large = Template.bind({});
53
- Large.args = {
54
- // width: 300,
55
- size: "small",
56
- text: "No",
57
- };
58
-
59
- export const Disabled = Template.bind({});
60
- Disabled.args = {
61
- // width: 300,
62
- size: "small",
63
- text: "Ok",
64
- disabled: true,
65
- };