@dxc-technology/halstack-react 0.0.0-bd24f1d → 0.0.0-beebecd
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/dist/ThemeContext.js +131 -99
- package/dist/accordion/Accordion.js +44 -39
- package/dist/accordion-group/AccordionGroup.js +1 -3
- package/dist/alert/Alert.js +5 -5
- package/dist/alert/index.d.ts +51 -0
- package/dist/button/Button.js +29 -22
- package/dist/common/variables.js +419 -280
- package/dist/date/Date.js +5 -7
- package/dist/{new-date/NewDate.js → date-input/DateInput.js} +69 -72
- package/dist/date-input/index.d.ts +95 -0
- package/dist/dropdown/Dropdown.js +108 -68
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +280 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/header/Header.js +3 -23
- package/dist/input-text/InputText.js +3 -3
- package/dist/layout/ApplicationLayout.js +1 -1
- package/dist/link/Link.js +4 -8
- package/dist/main.d.ts +8 -0
- package/dist/main.js +29 -13
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/new-textarea/NewTextarea.js +62 -39
- package/dist/new-textarea/index.d.ts +117 -0
- package/dist/{number/Number.js → number-input/NumberInput.js} +9 -11
- package/dist/{number/NumberContext.js → number-input/NumberInputContext.js} +2 -2
- package/dist/number-input/index.d.ts +113 -0
- package/dist/{password/Password.js → password-input/PasswordInput.js} +11 -13
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +62 -26
- package/dist/select/Select.js +122 -158
- package/dist/sidenav/Sidenav.js +6 -4
- package/dist/slider/Slider.js +89 -14
- package/dist/spinner/Spinner.js +217 -54
- package/dist/tag/Tag.js +26 -32
- package/dist/{new-input-text/NewInputText.js → text-input/TextInput.js} +180 -170
- package/dist/text-input/index.d.ts +135 -0
- package/dist/toggle-group/ToggleGroup.js +132 -28
- package/dist/upload/transaction/Transaction.js +2 -2
- package/package.json +2 -1
- package/test/{NewDate.test.js → DateInput.test.js} +66 -27
- package/test/FileInput.test.js +201 -0
- package/test/InputText.test.js +24 -16
- package/test/NewTextarea.test.js +95 -101
- package/test/{Number.test.js → NumberInput.test.js} +84 -66
- package/test/Paginator.test.js +1 -1
- package/test/PasswordInput.test.js +83 -0
- package/test/ResultsetTable.test.js +1 -2
- package/test/Select.test.js +40 -17
- package/test/Spinner.test.js +5 -0
- package/test/{NewInputText.test.js → TextInput.test.js} +146 -231
- package/test/ToggleGroup.test.js +5 -1
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/password/styles.css +0 -3
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/slider/Slider.stories.js +0 -241
- package/test/Password.test.js +0 -76
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
6
|
-
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
|
|
9
|
-
var _react2 = require("@storybook/react");
|
|
10
|
-
|
|
11
|
-
var _addonActions = require("@storybook/addon-actions");
|
|
12
|
-
|
|
13
|
-
var _addonKnobs = require("@storybook/addon-knobs");
|
|
14
|
-
|
|
15
|
-
var _run_icon_black = _interopRequireDefault(require("../../.storybook/public/run_icon_black.png"));
|
|
16
|
-
|
|
17
|
-
var _readme = _interopRequireDefault(require("./readme.md"));
|
|
18
|
-
|
|
19
|
-
var _Button = _interopRequireDefault(require("./Button"));
|
|
20
|
-
|
|
21
|
-
var onClick = (0, _addonActions.action)("onClick");
|
|
22
|
-
|
|
23
|
-
onClick.toString = function () {
|
|
24
|
-
return "onClickHandler";
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
(0, _react2.storiesOf)("Form Components|Button", module).add("Types", function () {
|
|
28
|
-
return _react["default"].createElement("div", null, _react["default"].createElement("h3", null, "Light"), _react["default"].createElement("div", null, _react["default"].createElement(_Button["default"], {
|
|
29
|
-
mode: "basic",
|
|
30
|
-
theme: "light",
|
|
31
|
-
label: "Basic Button",
|
|
32
|
-
onClick: onClick
|
|
33
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
34
|
-
mode: "raised",
|
|
35
|
-
theme: "light",
|
|
36
|
-
label: "Raised Button",
|
|
37
|
-
onClick: onClick
|
|
38
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
39
|
-
mode: "flat",
|
|
40
|
-
theme: "light",
|
|
41
|
-
label: "Flat Button",
|
|
42
|
-
onClick: onClick
|
|
43
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
44
|
-
mode: "outlined",
|
|
45
|
-
theme: "light",
|
|
46
|
-
label: "Outlined Button",
|
|
47
|
-
onClick: onClick
|
|
48
|
-
})), _react["default"].createElement("div", null, _react["default"].createElement(_Button["default"], {
|
|
49
|
-
disabled: true,
|
|
50
|
-
mode: "basic",
|
|
51
|
-
theme: "light",
|
|
52
|
-
label: "Basic Button",
|
|
53
|
-
onClick: onClick
|
|
54
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
55
|
-
disabled: true,
|
|
56
|
-
mode: "raised",
|
|
57
|
-
theme: "light",
|
|
58
|
-
label: "Raised Button",
|
|
59
|
-
onClick: onClick
|
|
60
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
61
|
-
disabled: true,
|
|
62
|
-
mode: "flat",
|
|
63
|
-
theme: "light",
|
|
64
|
-
label: "Flat Button",
|
|
65
|
-
onClick: onClick
|
|
66
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
67
|
-
disabled: true,
|
|
68
|
-
mode: "outlined",
|
|
69
|
-
theme: "light",
|
|
70
|
-
label: "Outlined Button",
|
|
71
|
-
onClick: onClick
|
|
72
|
-
})), _react["default"].createElement("h3", null, "Dark"), _react["default"].createElement("div", {
|
|
73
|
-
style: {
|
|
74
|
-
background: "black"
|
|
75
|
-
}
|
|
76
|
-
}, _react["default"].createElement("div", null, _react["default"].createElement(_Button["default"], {
|
|
77
|
-
mode: "basic",
|
|
78
|
-
theme: "dark",
|
|
79
|
-
label: "Basic Button",
|
|
80
|
-
onClick: onClick
|
|
81
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
82
|
-
mode: "raised",
|
|
83
|
-
theme: "dark",
|
|
84
|
-
label: "Raised Button",
|
|
85
|
-
onClick: onClick
|
|
86
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
87
|
-
mode: "flat",
|
|
88
|
-
theme: "dark",
|
|
89
|
-
label: "Flat Button",
|
|
90
|
-
onClick: onClick
|
|
91
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
92
|
-
mode: "outlined",
|
|
93
|
-
theme: "dark",
|
|
94
|
-
label: "Outlined Button",
|
|
95
|
-
onClick: onClick
|
|
96
|
-
})), _react["default"].createElement("div", null, _react["default"].createElement(_Button["default"], {
|
|
97
|
-
disabled: true,
|
|
98
|
-
mode: "basic",
|
|
99
|
-
theme: "dark",
|
|
100
|
-
label: "Basic Button",
|
|
101
|
-
onClick: onClick
|
|
102
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
103
|
-
disabled: true,
|
|
104
|
-
mode: "raised",
|
|
105
|
-
theme: "dark",
|
|
106
|
-
label: "Raised Button",
|
|
107
|
-
onClick: onClick
|
|
108
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
109
|
-
disabled: true,
|
|
110
|
-
mode: "flat",
|
|
111
|
-
theme: "dark",
|
|
112
|
-
label: "Flat Button",
|
|
113
|
-
onClick: onClick
|
|
114
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
115
|
-
disabled: true,
|
|
116
|
-
mode: "outlined",
|
|
117
|
-
theme: "dark",
|
|
118
|
-
label: "Outlined Button",
|
|
119
|
-
onClick: onClick
|
|
120
|
-
}))), _react["default"].createElement("h3", null, "With icon"), _react["default"].createElement("div", null, _react["default"].createElement(_Button["default"], {
|
|
121
|
-
mode: "basic",
|
|
122
|
-
theme: "light",
|
|
123
|
-
label: "Basic Button",
|
|
124
|
-
onClick: onClick,
|
|
125
|
-
iconPosition: "after",
|
|
126
|
-
iconSrc: _run_icon_black["default"]
|
|
127
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
128
|
-
mode: "raised",
|
|
129
|
-
theme: "light",
|
|
130
|
-
label: "Raised Button",
|
|
131
|
-
onClick: onClick,
|
|
132
|
-
iconPosition: "after",
|
|
133
|
-
iconSrc: _run_icon_black["default"]
|
|
134
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
135
|
-
mode: "flat",
|
|
136
|
-
theme: "light",
|
|
137
|
-
label: "Flat Button",
|
|
138
|
-
onClick: onClick,
|
|
139
|
-
iconSrc: _run_icon_black["default"]
|
|
140
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
141
|
-
mode: "outlined",
|
|
142
|
-
theme: "light",
|
|
143
|
-
label: "Outlined Button",
|
|
144
|
-
onClick: onClick,
|
|
145
|
-
iconPosition: "after",
|
|
146
|
-
iconSrc: _run_icon_black["default"]
|
|
147
|
-
})), _react["default"].createElement("div", null, _react["default"].createElement(_Button["default"], {
|
|
148
|
-
disabled: true,
|
|
149
|
-
mode: "basic",
|
|
150
|
-
theme: "light",
|
|
151
|
-
label: "Basic Button",
|
|
152
|
-
onClick: onClick,
|
|
153
|
-
iconPosition: "after",
|
|
154
|
-
iconSrc: _run_icon_black["default"]
|
|
155
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
156
|
-
disabled: true,
|
|
157
|
-
mode: "raised",
|
|
158
|
-
theme: "light",
|
|
159
|
-
label: "Raised Button",
|
|
160
|
-
onClick: onClick,
|
|
161
|
-
iconPosition: "after",
|
|
162
|
-
iconSrc: _run_icon_black["default"]
|
|
163
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
164
|
-
disabled: true,
|
|
165
|
-
mode: "flat",
|
|
166
|
-
theme: "light",
|
|
167
|
-
label: "Flat Button",
|
|
168
|
-
onClick: onClick,
|
|
169
|
-
iconPosition: "after",
|
|
170
|
-
iconSrc: _run_icon_black["default"]
|
|
171
|
-
}), _react["default"].createElement(_Button["default"], {
|
|
172
|
-
disabled: true,
|
|
173
|
-
mode: "outlined",
|
|
174
|
-
theme: "light",
|
|
175
|
-
label: "Outlined Button",
|
|
176
|
-
onClick: onClick,
|
|
177
|
-
iconPosition: "after",
|
|
178
|
-
iconSrc: _run_icon_black["default"]
|
|
179
|
-
})));
|
|
180
|
-
}, {
|
|
181
|
-
notes: {
|
|
182
|
-
markdown: _readme["default"]
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
var knobProps = function knobProps() {
|
|
187
|
-
return {
|
|
188
|
-
label: (0, _addonKnobs.text)("label", "Test Button"),
|
|
189
|
-
mode: (0, _addonKnobs.select)("mode", {
|
|
190
|
-
basic: "basic",
|
|
191
|
-
raised: "raised",
|
|
192
|
-
flat: "flat",
|
|
193
|
-
outlined: "outlined"
|
|
194
|
-
}, "basic"),
|
|
195
|
-
theme: (0, _addonKnobs.select)("theme", {
|
|
196
|
-
light: "light",
|
|
197
|
-
dark: "dark"
|
|
198
|
-
}, "light"),
|
|
199
|
-
disabled: (0, _addonKnobs["boolean"])("disabled", false),
|
|
200
|
-
iconPosition: (0, _addonKnobs.select)("icon position", {
|
|
201
|
-
before: "before",
|
|
202
|
-
after: "after"
|
|
203
|
-
}, "before"),
|
|
204
|
-
icon: (0, _addonKnobs["boolean"])("With Icon", true)
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
(0, _react2.storiesOf)("Form Components|Button", module).add("Knobs example", function () {
|
|
209
|
-
var props = knobProps();
|
|
210
|
-
return _react["default"].createElement("div", {
|
|
211
|
-
style: {
|
|
212
|
-
background: props.theme === "dark" && "black" || "transparent"
|
|
213
|
-
}
|
|
214
|
-
}, props.icon && _react["default"].createElement(_Button["default"], (0, _extends2["default"])({}, props, {
|
|
215
|
-
onClick: onClick,
|
|
216
|
-
iconSrc: _run_icon_black["default"]
|
|
217
|
-
})) || _react["default"].createElement(_Button["default"], (0, _extends2["default"])({}, props, {
|
|
218
|
-
onClick: onClick
|
|
219
|
-
})));
|
|
220
|
-
}, {
|
|
221
|
-
notes: {
|
|
222
|
-
markdown: _readme["default"]
|
|
223
|
-
}
|
|
224
|
-
});
|
package/dist/button/readme.md
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# DXC Button Component
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
import { DxcButton } from "@dxc-technology/halstack-react";
|
|
7
|
-
|
|
8
|
-
<DxcButton onClick={handleClick} label="Test Button" />;
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Props
|
|
12
|
-
|
|
13
|
-
<table>
|
|
14
|
-
<tr style="background-color: grey">
|
|
15
|
-
<td>Name</td>
|
|
16
|
-
<td>Default</td>
|
|
17
|
-
<td>Description</td>
|
|
18
|
-
</tr>
|
|
19
|
-
<tr>
|
|
20
|
-
<td>mode: 'basic' | 'outlined' | 'raised' | 'flat'</td>
|
|
21
|
-
<td><code>'basic'</code></td>
|
|
22
|
-
<td>Uses on of the available button modes.</td>
|
|
23
|
-
</tr>
|
|
24
|
-
<tr>
|
|
25
|
-
<td>theme: 'light' |'dark'</td>
|
|
26
|
-
<td><code>'light'</code></td>
|
|
27
|
-
<td>Uses one of the available button modes.</td>
|
|
28
|
-
</tr>
|
|
29
|
-
<tr>
|
|
30
|
-
<td>label: string</td>
|
|
31
|
-
<td><code>'basic'</code></td>
|
|
32
|
-
<td>Text to be placed next to the button.</td>
|
|
33
|
-
</tr>
|
|
34
|
-
<tr>
|
|
35
|
-
<td>iconSrc: string</td>
|
|
36
|
-
<td></td>
|
|
37
|
-
<td>URL of the icon that will be placed next to the button label.</td>
|
|
38
|
-
</tr>
|
|
39
|
-
<tr>
|
|
40
|
-
<td>iconPosition: 'before' | 'after'</td>
|
|
41
|
-
<td><code>'before'</code></td>
|
|
42
|
-
<td>Whether the icon should appear after or before the label.</td>
|
|
43
|
-
</tr>
|
|
44
|
-
<tr>
|
|
45
|
-
<td>disabled: boolean</td>
|
|
46
|
-
<td><code>false</code></td>
|
|
47
|
-
<td>If true, the component will be disabled.</td>
|
|
48
|
-
</tr>
|
|
49
|
-
<tr>
|
|
50
|
-
<td>disableRipple: boolean</td>
|
|
51
|
-
<td><code>false</code></td>
|
|
52
|
-
<td>If true, the ripple effect will be disabled.</td>
|
|
53
|
-
</tr>
|
|
54
|
-
<tr>
|
|
55
|
-
<td>onClick: function</td>
|
|
56
|
-
<td></td>
|
|
57
|
-
<td>This function will be called when the user clicks the button. The event object will be passed as a parameter.</td>
|
|
58
|
-
</tr>
|
|
59
|
-
|
|
60
|
-
</table>
|
|
61
|
-
|
|
62
|
-
## Examples
|
|
63
|
-
|
|
64
|
-
- Basic button - Light theme - Enabled - Icon after label - With ripple
|
|
65
|
-
|
|
66
|
-
```js
|
|
67
|
-
import React from "react";
|
|
68
|
-
|
|
69
|
-
import { DxcButton } from "@dxc-technology/halstack-react";
|
|
70
|
-
|
|
71
|
-
function App() {
|
|
72
|
-
const handleOnClick = event => {
|
|
73
|
-
console.log("Button clicked");
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<div>
|
|
78
|
-
<DxcButton
|
|
79
|
-
label="Basic"
|
|
80
|
-
mode="basic"
|
|
81
|
-
disabled={false}
|
|
82
|
-
theme="light"
|
|
83
|
-
disableRipple={false}
|
|
84
|
-
iconPosition="after"
|
|
85
|
-
iconSrc="/images/run_icon.png"
|
|
86
|
-
onClick={handleOnClick}
|
|
87
|
-
/>
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export default App;
|
|
93
|
-
```
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
6
|
-
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
|
|
9
|
-
var _react2 = require("@storybook/react");
|
|
10
|
-
|
|
11
|
-
var _addonActions = require("@storybook/addon-actions");
|
|
12
|
-
|
|
13
|
-
var _amazon = _interopRequireDefault(require("../../.storybook/public/amazon.svg"));
|
|
14
|
-
|
|
15
|
-
var _addonKnobs = require("@storybook/addon-knobs");
|
|
16
|
-
|
|
17
|
-
var _readme = _interopRequireDefault(require("./readme.md"));
|
|
18
|
-
|
|
19
|
-
var _Dropdown = _interopRequireDefault(require("./Dropdown"));
|
|
20
|
-
|
|
21
|
-
var onChange = (0, _addonActions.action)("onChange");
|
|
22
|
-
|
|
23
|
-
onChange.toString = function () {
|
|
24
|
-
return "onChangeHandler";
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var optionsWithoutIcon = [{
|
|
28
|
-
value: 1,
|
|
29
|
-
label: "Amazon"
|
|
30
|
-
}, {
|
|
31
|
-
value: 2,
|
|
32
|
-
label: "Ebay"
|
|
33
|
-
}, {
|
|
34
|
-
value: 3,
|
|
35
|
-
label: "Apple"
|
|
36
|
-
}];
|
|
37
|
-
var optionsWithIcon = [{
|
|
38
|
-
value: 1,
|
|
39
|
-
label: "Amazon",
|
|
40
|
-
iconSrc: _amazon["default"]
|
|
41
|
-
}, {
|
|
42
|
-
value: 2,
|
|
43
|
-
label: "Ebay",
|
|
44
|
-
iconSrc: _amazon["default"]
|
|
45
|
-
}, {
|
|
46
|
-
value: 3,
|
|
47
|
-
label: "Apple",
|
|
48
|
-
iconSrc: _amazon["default"]
|
|
49
|
-
}];
|
|
50
|
-
|
|
51
|
-
var selectOption = function selectOption(option) {
|
|
52
|
-
console.log(option);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
(0, _react2.storiesOf)("Form Components|Dropdown", module).add("Component", function () {
|
|
56
|
-
return _react["default"].createElement("div", null, _react["default"].createElement("div", {
|
|
57
|
-
style: {
|
|
58
|
-
height: "200px",
|
|
59
|
-
display: "flex",
|
|
60
|
-
flexWrap: "wrap"
|
|
61
|
-
}
|
|
62
|
-
}, _react["default"].createElement(_Dropdown["default"], {
|
|
63
|
-
options: optionsWithoutIcon,
|
|
64
|
-
onSelectOption: selectOption,
|
|
65
|
-
iconSrc: _amazon["default"],
|
|
66
|
-
label: "Basic dropdown",
|
|
67
|
-
theme: "light",
|
|
68
|
-
mode: "basic",
|
|
69
|
-
optionsIconPosition: "before"
|
|
70
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
71
|
-
options: optionsWithIcon,
|
|
72
|
-
onSelectOption: selectOption,
|
|
73
|
-
iconSrc: _amazon["default"],
|
|
74
|
-
label: "Outlined dropdown",
|
|
75
|
-
theme: "light",
|
|
76
|
-
mode: "outlined",
|
|
77
|
-
optionsIconPosition: "after"
|
|
78
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
79
|
-
options: optionsWithoutIcon,
|
|
80
|
-
onSelectOption: selectOption,
|
|
81
|
-
label: "Basic dropdown",
|
|
82
|
-
theme: "light",
|
|
83
|
-
mode: "basic",
|
|
84
|
-
optionsIconPosition: "before"
|
|
85
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
86
|
-
options: optionsWithoutIcon,
|
|
87
|
-
onSelectOption: selectOption,
|
|
88
|
-
label: "Outlined dropdown",
|
|
89
|
-
theme: "light",
|
|
90
|
-
mode: "outlined",
|
|
91
|
-
optionsIconPosition: "after"
|
|
92
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
93
|
-
options: optionsWithIcon,
|
|
94
|
-
onSelectOption: selectOption,
|
|
95
|
-
iconSrc: _amazon["default"],
|
|
96
|
-
label: "",
|
|
97
|
-
theme: "light",
|
|
98
|
-
mode: "basic",
|
|
99
|
-
caretHidden: true,
|
|
100
|
-
optionsIconPosition: "before"
|
|
101
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
102
|
-
options: optionsWithIcon,
|
|
103
|
-
onSelectOption: selectOption,
|
|
104
|
-
iconSrc: _amazon["default"],
|
|
105
|
-
label: "",
|
|
106
|
-
theme: "light",
|
|
107
|
-
mode: "outlined",
|
|
108
|
-
caretHidden: true,
|
|
109
|
-
optionsIconPosition: "after"
|
|
110
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
111
|
-
options: optionsWithIcon,
|
|
112
|
-
onSelectOption: selectOption,
|
|
113
|
-
iconSrc: _amazon["default"],
|
|
114
|
-
label: "",
|
|
115
|
-
theme: "light",
|
|
116
|
-
mode: "basic",
|
|
117
|
-
caretHidden: false,
|
|
118
|
-
optionsIconPosition: "before"
|
|
119
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
120
|
-
options: optionsWithIcon,
|
|
121
|
-
onSelectOption: selectOption,
|
|
122
|
-
iconSrc: _amazon["default"],
|
|
123
|
-
label: "",
|
|
124
|
-
theme: "light",
|
|
125
|
-
mode: "outlined",
|
|
126
|
-
caretHidden: false,
|
|
127
|
-
optionsIconPosition: "after"
|
|
128
|
-
})), _react["default"].createElement("div", {
|
|
129
|
-
style: {
|
|
130
|
-
background: "black",
|
|
131
|
-
display: "flex",
|
|
132
|
-
height: "250px",
|
|
133
|
-
flexWrap: "wrap"
|
|
134
|
-
}
|
|
135
|
-
}, _react["default"].createElement(_Dropdown["default"], {
|
|
136
|
-
options: optionsWithIcon,
|
|
137
|
-
onSelectOption: selectOption,
|
|
138
|
-
iconSrc: _amazon["default"],
|
|
139
|
-
label: "Basic dropdown",
|
|
140
|
-
theme: "dark",
|
|
141
|
-
mode: "basic",
|
|
142
|
-
optionsIconPosition: "before"
|
|
143
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
144
|
-
options: optionsWithIcon,
|
|
145
|
-
onSelectOption: selectOption,
|
|
146
|
-
iconSrc: _amazon["default"],
|
|
147
|
-
label: "Outlined dropdown",
|
|
148
|
-
theme: "dark",
|
|
149
|
-
mode: "outlined",
|
|
150
|
-
optionsIconPosition: "after"
|
|
151
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
152
|
-
options: optionsWithoutIcon,
|
|
153
|
-
onSelectOption: selectOption,
|
|
154
|
-
label: "Basic dropdown",
|
|
155
|
-
theme: "dark",
|
|
156
|
-
mode: "basic",
|
|
157
|
-
optionsIconPosition: "before"
|
|
158
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
159
|
-
options: optionsWithoutIcon,
|
|
160
|
-
onSelectOption: selectOption,
|
|
161
|
-
label: "Outlined dropdown",
|
|
162
|
-
theme: "dark",
|
|
163
|
-
mode: "outlined",
|
|
164
|
-
optionsIconPosition: "after"
|
|
165
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
166
|
-
options: optionsWithIcon,
|
|
167
|
-
onSelectOption: selectOption,
|
|
168
|
-
iconSrc: _amazon["default"],
|
|
169
|
-
label: "",
|
|
170
|
-
theme: "dark",
|
|
171
|
-
mode: "basic",
|
|
172
|
-
caretHidden: true,
|
|
173
|
-
optionsIconPosition: "before"
|
|
174
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
175
|
-
options: optionsWithIcon,
|
|
176
|
-
onSelectOption: selectOption,
|
|
177
|
-
iconSrc: _amazon["default"],
|
|
178
|
-
label: "",
|
|
179
|
-
theme: "dark",
|
|
180
|
-
mode: "outlined",
|
|
181
|
-
caretHidden: true,
|
|
182
|
-
optionsIconPosition: "after"
|
|
183
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
184
|
-
options: optionsWithIcon,
|
|
185
|
-
onSelectOption: selectOption,
|
|
186
|
-
iconSrc: _amazon["default"],
|
|
187
|
-
label: "",
|
|
188
|
-
theme: "dark",
|
|
189
|
-
mode: "basic",
|
|
190
|
-
caretHidden: false,
|
|
191
|
-
optionsIconPosition: "before"
|
|
192
|
-
}), _react["default"].createElement(_Dropdown["default"], {
|
|
193
|
-
options: optionsWithIcon,
|
|
194
|
-
onSelectOption: selectOption,
|
|
195
|
-
iconSrc: _amazon["default"],
|
|
196
|
-
label: "",
|
|
197
|
-
theme: "dark",
|
|
198
|
-
mode: "outlined",
|
|
199
|
-
caretHidden: false,
|
|
200
|
-
optionsIconPosition: "after"
|
|
201
|
-
})));
|
|
202
|
-
}, {
|
|
203
|
-
notes: {
|
|
204
|
-
markdown: _readme["default"]
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
var knobProps = function knobProps() {
|
|
209
|
-
return {
|
|
210
|
-
optionsIconPosition: (0, _addonKnobs.select)("Options Icon Position", {
|
|
211
|
-
before: "before",
|
|
212
|
-
after: "after"
|
|
213
|
-
}, "before"),
|
|
214
|
-
iconPosition: (0, _addonKnobs.select)("Icon Position", {
|
|
215
|
-
before: "before",
|
|
216
|
-
after: "after"
|
|
217
|
-
}, "before"),
|
|
218
|
-
label: (0, _addonKnobs.text)("Label", "Test Dropdown"),
|
|
219
|
-
theme: (0, _addonKnobs.select)("Theme", {
|
|
220
|
-
light: "light",
|
|
221
|
-
dark: "dark"
|
|
222
|
-
}, "light"),
|
|
223
|
-
mode: (0, _addonKnobs.select)("Mode", {
|
|
224
|
-
basic: "basic",
|
|
225
|
-
outlined: "outlined"
|
|
226
|
-
}, "basic"),
|
|
227
|
-
caretHidden: (0, _addonKnobs["boolean"])("Caret Hidden", false),
|
|
228
|
-
disableRipple: (0, _addonKnobs["boolean"])("Disable Ripple", false)
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
(0, _react2.storiesOf)("Form Components|Dropdown", module).add("Knobs example", function () {
|
|
233
|
-
var props = knobProps();
|
|
234
|
-
return _react["default"].createElement("div", {
|
|
235
|
-
style: {
|
|
236
|
-
paddingTop: "20px",
|
|
237
|
-
height: "200px",
|
|
238
|
-
background: props.theme === "dark" && "black" || "transparent"
|
|
239
|
-
}
|
|
240
|
-
}, _react["default"].createElement(_Dropdown["default"], (0, _extends2["default"])({}, props, {
|
|
241
|
-
iconSrc: _amazon["default"],
|
|
242
|
-
options: optionsWithIcon,
|
|
243
|
-
onSelectOption: selectOption
|
|
244
|
-
})));
|
|
245
|
-
}, {
|
|
246
|
-
notes: {
|
|
247
|
-
markdown: _readme["default"]
|
|
248
|
-
}
|
|
249
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg id="baseline-arrow_drop_down-24px" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
2
|
-
<path id="Trazado_2384" data-name="Trazado 2384" d="M7,10l5,5,5-5Z" fill="#fff"/>
|
|
3
|
-
<path id="Trazado_2385" data-name="Trazado 2385" d="M0,0H24V24H0Z" fill="none"/>
|
|
4
|
-
</svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7 14l5-5 5 5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg id="baseline-arrow_drop_up-24px" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
2
|
-
<path id="Trazado_2386" data-name="Trazado 2386" d="M7,14l5-5,5,5Z" fill="#fff"/>
|
|
3
|
-
<path id="Trazado_2387" data-name="Trazado 2387" d="M0,0H24V24H0Z" fill="none"/>
|
|
4
|
-
</svg>
|
package/dist/dropdown/readme.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# DXC Dropdown Component
|
|
2
|
-
|
|
3
|
-
## Props
|
|
4
|
-
|
|
5
|
-
<table>
|
|
6
|
-
<tr style="background-color: grey">
|
|
7
|
-
<td>Name</td>
|
|
8
|
-
<td>Default</td>
|
|
9
|
-
<td>Description</td>
|
|
10
|
-
</tr>
|
|
11
|
-
<tr>
|
|
12
|
-
<td>options: object[]</td>
|
|
13
|
-
<td><code>[]</code></td>
|
|
14
|
-
<td>An array of objects representing the options. Each object has the following properties:
|
|
15
|
-
<ul>
|
|
16
|
-
<li><b>label</b>: Option display value</li>
|
|
17
|
-
<li><b>iconSrc</b>: URL of the icon that will be placed next to the option label (Optional)</li>
|
|
18
|
-
<li><b>value</b>: Option inner value</li>
|
|
19
|
-
<li><b>options</b>: array for nested</li>
|
|
20
|
-
</ul>
|
|
21
|
-
</td>
|
|
22
|
-
</tr>
|
|
23
|
-
<tr>
|
|
24
|
-
<td>optionsIconPosition: 'before' | 'after'</td>
|
|
25
|
-
<td><code>'before'</code></td>
|
|
26
|
-
<td>In case options include an icon, whether the icon should appear after or before the label.</td>
|
|
27
|
-
</tr>
|
|
28
|
-
<tr>
|
|
29
|
-
<td>iconSrc: string</td>
|
|
30
|
-
<td><code></code></td>
|
|
31
|
-
<td>URL of the icon that will be placed next to the option label (Optional)</td>
|
|
32
|
-
</tr>
|
|
33
|
-
<tr>
|
|
34
|
-
<td>iconPosition: 'before' | 'after'</td>
|
|
35
|
-
<td><code>'before'</code></td>
|
|
36
|
-
<td>Whether the icon should appear after or before the label.</td>
|
|
37
|
-
</tr>
|
|
38
|
-
<tr>
|
|
39
|
-
<td>label: string</td>
|
|
40
|
-
<td></td>
|
|
41
|
-
<td>Text to be placed within the dropdown.</td>
|
|
42
|
-
</tr>
|
|
43
|
-
<tr>
|
|
44
|
-
<td>theme: 'light' | 'dark'</td>
|
|
45
|
-
<td><code>'light'</code></td>
|
|
46
|
-
<td>Uses one of the available component themes.</td>
|
|
47
|
-
</tr>
|
|
48
|
-
<tr>
|
|
49
|
-
<td>mode: 'basic' | 'outlined'</td>
|
|
50
|
-
<td><code>'basic'</code></td>
|
|
51
|
-
<td>Uses one of the available component modes.</td>
|
|
52
|
-
</tr>
|
|
53
|
-
<tr>
|
|
54
|
-
<td>showCaret: boolean</td>
|
|
55
|
-
<td><code>true</code></td>
|
|
56
|
-
<td>Whether the arrow next to the labe must be displayed or not.</td>
|
|
57
|
-
</tr>
|
|
58
|
-
<tr>
|
|
59
|
-
<td>disableRipple: boolean</td>
|
|
60
|
-
<td><code>false</code></td>
|
|
61
|
-
<td>If true, the ripple effect will be disabled.</td>
|
|
62
|
-
</tr>
|
|
63
|
-
<tr>
|
|
64
|
-
<td>onSelectOption: function</td>
|
|
65
|
-
<td></td>
|
|
66
|
-
<td>This function will be called every time the selection changes. The string with the key of the selected value will be passed as a parameter to this function.</td>
|
|
67
|
-
</tr>
|
|
68
|
-
</table>
|
|
69
|
-
|