@dxc-technology/halstack-react 0.0.0-dcee34a → 0.0.0-dd6acd7
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/README.md +46 -0
- package/dist/index.d.mts +6518 -0
- package/dist/index.d.ts +6518 -0
- package/dist/index.js +13484 -0
- package/dist/index.mjs +13427 -0
- package/package.json +68 -66
- package/BackgroundColorContext.d.ts +0 -10
- package/BackgroundColorContext.js +0 -47
- package/HalstackContext.d.ts +0 -12
- package/HalstackContext.js +0 -343
- package/accordion/Accordion.d.ts +0 -4
- package/accordion/Accordion.js +0 -239
- package/accordion/Accordion.stories.tsx +0 -395
- package/accordion/Accordion.test.js +0 -71
- package/accordion/types.d.ts +0 -69
- package/accordion/types.js +0 -5
- package/accordion-group/AccordionGroup.d.ts +0 -7
- package/accordion-group/AccordionGroup.js +0 -149
- package/accordion-group/AccordionGroup.stories.tsx +0 -251
- package/accordion-group/AccordionGroup.test.js +0 -126
- package/accordion-group/types.d.ts +0 -79
- package/accordion-group/types.js +0 -5
- package/alert/Alert.d.ts +0 -4
- package/alert/Alert.js +0 -293
- package/alert/Alert.stories.tsx +0 -198
- package/alert/Alert.test.js +0 -92
- package/alert/types.d.ts +0 -49
- package/alert/types.js +0 -5
- package/badge/Badge.d.ts +0 -4
- package/badge/Badge.js +0 -61
- package/badge/types.d.ts +0 -5
- package/badge/types.js +0 -5
- package/bleed/Bleed.d.ts +0 -3
- package/bleed/Bleed.js +0 -51
- package/bleed/Bleed.stories.tsx +0 -341
- package/bleed/types.d.ts +0 -37
- package/bleed/types.js +0 -5
- package/box/Box.d.ts +0 -4
- package/box/Box.js +0 -116
- package/box/Box.stories.tsx +0 -147
- package/box/Box.test.js +0 -18
- package/box/types.d.ts +0 -44
- package/box/types.js +0 -5
- package/bulleted-list/BulletedList.d.ts +0 -7
- package/bulleted-list/BulletedList.js +0 -123
- package/bulleted-list/BulletedList.stories.tsx +0 -200
- package/bulleted-list/types.d.ts +0 -11
- package/bulleted-list/types.js +0 -5
- package/button/Button.d.ts +0 -4
- package/button/Button.js +0 -154
- package/button/Button.stories.tsx +0 -425
- package/button/Button.test.js +0 -35
- package/button/types.d.ts +0 -53
- package/button/types.js +0 -5
- package/card/Card.d.ts +0 -4
- package/card/Card.js +0 -161
- package/card/Card.stories.tsx +0 -201
- package/card/Card.test.js +0 -50
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +0 -68
- package/card/types.js +0 -5
- package/checkbox/Checkbox.d.ts +0 -4
- package/checkbox/Checkbox.js +0 -250
- package/checkbox/Checkbox.stories.tsx +0 -260
- package/checkbox/Checkbox.test.js +0 -155
- package/checkbox/types.d.ts +0 -68
- package/checkbox/types.js +0 -5
- package/chip/Chip.d.ts +0 -4
- package/chip/Chip.js +0 -155
- package/chip/Chip.stories.tsx +0 -206
- package/chip/Chip.test.js +0 -56
- package/chip/types.d.ts +0 -45
- package/chip/types.js +0 -5
- package/common/OpenSans.css +0 -81
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/common/utils.js +0 -22
- package/common/variables.js +0 -1538
- package/date-input/Calendar.d.ts +0 -4
- package/date-input/Calendar.js +0 -258
- package/date-input/DateInput.d.ts +0 -4
- package/date-input/DateInput.js +0 -269
- package/date-input/DateInput.stories.tsx +0 -304
- package/date-input/DateInput.test.js +0 -835
- package/date-input/DatePicker.d.ts +0 -4
- package/date-input/DatePicker.js +0 -146
- package/date-input/Icons.d.ts +0 -6
- package/date-input/Icons.js +0 -75
- package/date-input/YearPicker.d.ts +0 -4
- package/date-input/YearPicker.js +0 -126
- package/date-input/types.d.ts +0 -158
- package/date-input/types.js +0 -5
- package/dialog/Dialog.d.ts +0 -4
- package/dialog/Dialog.js +0 -160
- package/dialog/Dialog.stories.tsx +0 -289
- package/dialog/Dialog.test.js +0 -70
- package/dialog/types.d.ts +0 -44
- package/dialog/types.js +0 -5
- package/dropdown/Dropdown.d.ts +0 -4
- package/dropdown/Dropdown.js +0 -388
- package/dropdown/Dropdown.stories.tsx +0 -438
- package/dropdown/Dropdown.test.js +0 -585
- package/dropdown/DropdownMenu.d.ts +0 -4
- package/dropdown/DropdownMenu.js +0 -70
- package/dropdown/DropdownMenuItem.d.ts +0 -4
- package/dropdown/DropdownMenuItem.js +0 -81
- package/dropdown/types.d.ts +0 -100
- package/dropdown/types.js +0 -5
- package/file-input/FileInput.d.ts +0 -4
- package/file-input/FileInput.js +0 -551
- package/file-input/FileInput.stories.tsx +0 -618
- package/file-input/FileInput.test.js +0 -498
- package/file-input/FileItem.d.ts +0 -4
- package/file-input/FileItem.js +0 -161
- package/file-input/types.d.ts +0 -129
- package/file-input/types.js +0 -5
- package/flex/Flex.d.ts +0 -4
- package/flex/Flex.js +0 -69
- package/flex/Flex.stories.tsx +0 -103
- package/flex/types.d.ts +0 -32
- package/flex/types.js +0 -5
- package/footer/Footer.d.ts +0 -4
- package/footer/Footer.js +0 -185
- package/footer/Footer.stories.tsx +0 -228
- package/footer/Footer.test.js +0 -109
- package/footer/Icons.d.ts +0 -2
- package/footer/Icons.js +0 -77
- package/footer/types.d.ts +0 -66
- package/footer/types.js +0 -5
- package/header/Header.d.ts +0 -7
- package/header/Header.js +0 -303
- package/header/Header.stories.tsx +0 -315
- package/header/Header.test.js +0 -79
- package/header/Icons.d.ts +0 -2
- package/header/Icons.js +0 -34
- package/header/types.d.ts +0 -48
- package/header/types.js +0 -5
- package/heading/Heading.d.ts +0 -4
- package/heading/Heading.js +0 -159
- package/heading/Heading.stories.tsx +0 -54
- package/heading/Heading.test.js +0 -186
- package/heading/types.d.ts +0 -33
- package/heading/types.js +0 -5
- package/inset/Inset.d.ts +0 -3
- package/inset/Inset.js +0 -51
- package/inset/Inset.stories.tsx +0 -229
- package/inset/types.d.ts +0 -37
- package/inset/types.js +0 -5
- package/layout/ApplicationLayout.d.ts +0 -20
- package/layout/ApplicationLayout.js +0 -171
- package/layout/ApplicationLayout.stories.tsx +0 -162
- package/layout/Icons.d.ts +0 -5
- package/layout/Icons.js +0 -66
- package/layout/SidenavContext.d.ts +0 -5
- package/layout/SidenavContext.js +0 -19
- package/layout/types.d.ts +0 -42
- package/layout/types.js +0 -5
- package/link/Link.d.ts +0 -4
- package/link/Link.js +0 -136
- package/link/Link.stories.tsx +0 -253
- package/link/Link.test.js +0 -83
- package/link/types.d.ts +0 -54
- package/link/types.js +0 -5
- package/main.d.ts +0 -44
- package/main.js +0 -369
- package/nav-tabs/NavTabs.d.ts +0 -8
- package/nav-tabs/NavTabs.js +0 -125
- package/nav-tabs/NavTabs.stories.tsx +0 -260
- package/nav-tabs/NavTabs.test.js +0 -82
- package/nav-tabs/Tab.d.ts +0 -4
- package/nav-tabs/Tab.js +0 -149
- package/nav-tabs/types.d.ts +0 -53
- package/nav-tabs/types.js +0 -5
- package/number-input/NumberInput.d.ts +0 -4
- package/number-input/NumberInput.js +0 -76
- package/number-input/NumberInput.stories.tsx +0 -115
- package/number-input/NumberInput.test.js +0 -542
- package/number-input/NumberInputContext.d.ts +0 -4
- package/number-input/NumberInputContext.js +0 -19
- package/number-input/numberInputContextTypes.d.ts +0 -19
- package/number-input/numberInputContextTypes.js +0 -5
- package/number-input/types.d.ts +0 -124
- package/number-input/types.js +0 -5
- package/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -54
- package/paginator/Paginator.d.ts +0 -4
- package/paginator/Paginator.js +0 -165
- package/paginator/Paginator.stories.tsx +0 -87
- package/paginator/Paginator.test.js +0 -315
- package/paginator/types.d.ts +0 -38
- package/paginator/types.js +0 -5
- package/paragraph/Paragraph.d.ts +0 -6
- package/paragraph/Paragraph.js +0 -38
- package/paragraph/Paragraph.stories.tsx +0 -44
- package/password-input/PasswordInput.d.ts +0 -4
- package/password-input/PasswordInput.js +0 -166
- package/password-input/PasswordInput.stories.tsx +0 -131
- package/password-input/PasswordInput.test.js +0 -181
- package/password-input/types.d.ts +0 -110
- package/password-input/types.js +0 -5
- package/progress-bar/ProgressBar.d.ts +0 -4
- package/progress-bar/ProgressBar.js +0 -176
- package/progress-bar/ProgressBar.stories.jsx +0 -93
- package/progress-bar/ProgressBar.test.js +0 -110
- package/progress-bar/types.d.ts +0 -36
- package/progress-bar/types.js +0 -5
- package/quick-nav/QuickNav.d.ts +0 -4
- package/quick-nav/QuickNav.js +0 -117
- package/quick-nav/QuickNav.stories.tsx +0 -356
- package/quick-nav/types.d.ts +0 -21
- package/quick-nav/types.js +0 -5
- package/radio-group/Radio.d.ts +0 -4
- package/radio-group/Radio.js +0 -156
- package/radio-group/RadioGroup.d.ts +0 -4
- package/radio-group/RadioGroup.js +0 -283
- package/radio-group/RadioGroup.stories.tsx +0 -214
- package/radio-group/RadioGroup.test.js +0 -722
- package/radio-group/types.d.ts +0 -114
- package/radio-group/types.js +0 -5
- package/resultsetTable/Icons.d.ts +0 -7
- package/resultsetTable/Icons.js +0 -51
- package/resultsetTable/ResultsetTable.d.ts +0 -4
- package/resultsetTable/ResultsetTable.js +0 -195
- package/resultsetTable/ResultsetTable.stories.tsx +0 -300
- package/resultsetTable/ResultsetTable.test.js +0 -325
- package/resultsetTable/types.d.ts +0 -67
- package/resultsetTable/types.js +0 -5
- package/select/Icons.d.ts +0 -10
- package/select/Icons.js +0 -93
- package/select/Listbox.d.ts +0 -4
- package/select/Listbox.js +0 -169
- package/select/Option.d.ts +0 -4
- package/select/Option.js +0 -97
- package/select/Select.d.ts +0 -4
- package/select/Select.js +0 -664
- package/select/Select.stories.tsx +0 -971
- package/select/Select.test.js +0 -2228
- package/select/types.d.ts +0 -210
- package/select/types.js +0 -5
- package/sidenav/Sidenav.d.ts +0 -10
- package/sidenav/Sidenav.js +0 -266
- package/sidenav/Sidenav.stories.tsx +0 -282
- package/sidenav/Sidenav.test.js +0 -44
- package/sidenav/types.d.ts +0 -73
- package/sidenav/types.js +0 -5
- package/slider/Slider.d.ts +0 -4
- package/slider/Slider.js +0 -343
- package/slider/Slider.stories.tsx +0 -240
- package/slider/Slider.test.js +0 -250
- package/slider/types.d.ts +0 -86
- package/slider/types.js +0 -5
- package/spinner/Spinner.d.ts +0 -4
- package/spinner/Spinner.js +0 -250
- package/spinner/Spinner.stories.jsx +0 -129
- package/spinner/Spinner.test.js +0 -64
- package/spinner/types.d.ts +0 -32
- package/spinner/types.js +0 -5
- package/switch/Switch.d.ts +0 -4
- package/switch/Switch.js +0 -262
- package/switch/Switch.stories.tsx +0 -171
- package/switch/Switch.test.js +0 -225
- package/switch/types.d.ts +0 -66
- package/switch/types.js +0 -5
- package/table/Table.d.ts +0 -4
- package/table/Table.js +0 -118
- package/table/Table.stories.jsx +0 -356
- package/table/Table.test.js +0 -26
- package/table/types.d.ts +0 -21
- package/table/types.js +0 -5
- package/tabs/Tab.d.ts +0 -4
- package/tabs/Tab.js +0 -133
- package/tabs/Tabs.d.ts +0 -4
- package/tabs/Tabs.js +0 -467
- package/tabs/Tabs.stories.tsx +0 -226
- package/tabs/Tabs.test.js +0 -351
- package/tabs/types.d.ts +0 -92
- package/tabs/types.js +0 -5
- package/tag/Tag.d.ts +0 -4
- package/tag/Tag.js +0 -183
- package/tag/Tag.stories.tsx +0 -155
- package/tag/Tag.test.js +0 -60
- package/tag/types.d.ts +0 -69
- package/tag/types.js +0 -5
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -60
- package/text-input/Suggestion.d.ts +0 -4
- package/text-input/Suggestion.js +0 -84
- package/text-input/Suggestions.d.ts +0 -4
- package/text-input/Suggestions.js +0 -134
- package/text-input/TextInput.d.ts +0 -4
- package/text-input/TextInput.js +0 -673
- package/text-input/TextInput.stories.tsx +0 -569
- package/text-input/TextInput.test.js +0 -1724
- package/text-input/types.d.ts +0 -197
- package/text-input/types.js +0 -5
- package/textarea/Textarea.d.ts +0 -4
- package/textarea/Textarea.js +0 -277
- package/textarea/Textarea.stories.jsx +0 -216
- package/textarea/Textarea.test.js +0 -437
- package/textarea/types.d.ts +0 -137
- package/textarea/types.js +0 -5
- package/toggle-group/ToggleGroup.d.ts +0 -4
- package/toggle-group/ToggleGroup.js +0 -215
- package/toggle-group/ToggleGroup.stories.tsx +0 -215
- package/toggle-group/ToggleGroup.test.js +0 -156
- package/toggle-group/types.d.ts +0 -105
- package/toggle-group/types.js +0 -5
- package/typography/Typography.d.ts +0 -4
- package/typography/Typography.js +0 -131
- package/typography/Typography.stories.tsx +0 -198
- package/typography/types.d.ts +0 -18
- package/typography/types.js +0 -5
- package/useTheme.d.ts +0 -2
- package/useTheme.js +0 -22
- package/useTranslatedLabels.d.ts +0 -2
- package/useTranslatedLabels.js +0 -20
- package/wizard/Wizard.d.ts +0 -4
- package/wizard/Wizard.js +0 -285
- package/wizard/Wizard.stories.tsx +0 -253
- package/wizard/Wizard.test.js +0 -141
- package/wizard/types.d.ts +0 -65
- package/wizard/types.js +0 -5
package/select/Icons.d.ts
DELETED
package/select/Icons.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var selectIcons = {
|
|
13
|
-
error: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
14
|
-
role: "img",
|
|
15
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
-
height: "24px",
|
|
17
|
-
viewBox: "0 0 24 24",
|
|
18
|
-
width: "24px",
|
|
19
|
-
fill: "currentColor"
|
|
20
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
21
|
-
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
|
22
|
-
})),
|
|
23
|
-
arrowUp: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
24
|
-
role: "img",
|
|
25
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
26
|
-
height: "24px",
|
|
27
|
-
viewBox: "0 0 24 24",
|
|
28
|
-
width: "24px",
|
|
29
|
-
fill: "currentColor"
|
|
30
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
31
|
-
d: "M0 0h24v24H0V0z",
|
|
32
|
-
fill: "none"
|
|
33
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
34
|
-
d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z"
|
|
35
|
-
})),
|
|
36
|
-
arrowDown: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
37
|
-
role: "img",
|
|
38
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
39
|
-
height: "24px",
|
|
40
|
-
viewBox: "0 0 24 24",
|
|
41
|
-
width: "24px",
|
|
42
|
-
fill: "currentColor"
|
|
43
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
44
|
-
d: "M0 0h24v24H0V0z",
|
|
45
|
-
fill: "none"
|
|
46
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
47
|
-
d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
|
|
48
|
-
})),
|
|
49
|
-
clear: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
50
|
-
role: "img",
|
|
51
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
52
|
-
width: "24",
|
|
53
|
-
height: "24",
|
|
54
|
-
viewBox: "0 0 24 24",
|
|
55
|
-
fill: "currentColor"
|
|
56
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
57
|
-
d: "M0 0h24v24H0V0z",
|
|
58
|
-
fill: "none"
|
|
59
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
60
|
-
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
61
|
-
})),
|
|
62
|
-
selected: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
63
|
-
role: "img",
|
|
64
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
65
|
-
height: "24px",
|
|
66
|
-
viewBox: "0 0 24 24",
|
|
67
|
-
width: "24px",
|
|
68
|
-
fill: "currentColor"
|
|
69
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
70
|
-
d: "M0 0h24v24H0z",
|
|
71
|
-
fill: "none"
|
|
72
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
73
|
-
d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"
|
|
74
|
-
})),
|
|
75
|
-
searchOff: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
76
|
-
role: "img",
|
|
77
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
78
|
-
height: "24px",
|
|
79
|
-
viewBox: "0 0 24 24",
|
|
80
|
-
width: "24px",
|
|
81
|
-
fill: "currentColor"
|
|
82
|
-
}, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
83
|
-
fill: "none",
|
|
84
|
-
height: "24",
|
|
85
|
-
width: "24"
|
|
86
|
-
})), /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
87
|
-
d: "M15.5,14h-0.79l-0.28-0.27C15.41,12.59,16,11.11,16,9.5C16,5.91,13.09,3,9.5,3C6.08,3,3.28,5.64,3.03,9h2.02 C5.3,6.75,7.18,5,9.5,5C11.99,5,14,7.01,14,9.5S11.99,14,9.5,14c-0.17,0-0.33-0.03-0.5-0.05v2.02C9.17,15.99,9.33,16,9.5,16 c1.61,0,3.09-0.59,4.23-1.57L14,14.71v0.79l5,4.99L20.49,19L15.5,14z"
|
|
88
|
-
}), /*#__PURE__*/_react["default"].createElement("polygon", {
|
|
89
|
-
points: "6.47,10.82 4,13.29 1.53,10.82 0.82,11.53 3.29,14 0.82,16.47 1.53,17.18 4,14.71 6.47,17.18 7.18,16.47 4.71,14 7.18,11.53"
|
|
90
|
-
}))))
|
|
91
|
-
};
|
|
92
|
-
var _default = selectIcons;
|
|
93
|
-
exports["default"] = _default;
|
package/select/Listbox.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ListboxProps } from "./types";
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ id, currentValue, options, visualFocusIndex, lastOptionIndex, multiple, optional, optionalItem, searchable, handleOptionOnClick, styles, }: ListboxProps) => JSX.Element>;
|
|
4
|
-
export default _default;
|
package/select/Listbox.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
-
|
|
18
|
-
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
19
|
-
|
|
20
|
-
var _Option = _interopRequireDefault(require("./Option"));
|
|
21
|
-
|
|
22
|
-
var _Icons = _interopRequireDefault(require("./Icons"));
|
|
23
|
-
|
|
24
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
25
|
-
|
|
26
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
|
-
var groupsHaveOptions = function groupsHaveOptions(options) {
|
|
31
|
-
return options !== null && options !== void 0 && options[0].options ? options.some(function (groupOption) {
|
|
32
|
-
var _groupOption$options;
|
|
33
|
-
|
|
34
|
-
return ((_groupOption$options = groupOption.options) === null || _groupOption$options === void 0 ? void 0 : _groupOption$options.length) > 0;
|
|
35
|
-
}) : true;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
var Listbox = function Listbox(_ref) {
|
|
39
|
-
var id = _ref.id,
|
|
40
|
-
currentValue = _ref.currentValue,
|
|
41
|
-
options = _ref.options,
|
|
42
|
-
visualFocusIndex = _ref.visualFocusIndex,
|
|
43
|
-
lastOptionIndex = _ref.lastOptionIndex,
|
|
44
|
-
multiple = _ref.multiple,
|
|
45
|
-
optional = _ref.optional,
|
|
46
|
-
optionalItem = _ref.optionalItem,
|
|
47
|
-
searchable = _ref.searchable,
|
|
48
|
-
handleOptionOnClick = _ref.handleOptionOnClick,
|
|
49
|
-
styles = _ref.styles;
|
|
50
|
-
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
51
|
-
var listboxRef = (0, _react.useRef)(null);
|
|
52
|
-
var globalIndex = optional && !multiple ? 0 : -1;
|
|
53
|
-
|
|
54
|
-
var mapOptionFunc = function mapOptionFunc(option, mapIndex) {
|
|
55
|
-
if (option.options) {
|
|
56
|
-
var groupId = "group-".concat(mapIndex);
|
|
57
|
-
return option.options.length > 0 && /*#__PURE__*/_react["default"].createElement("li", {
|
|
58
|
-
key: "group-".concat(mapIndex)
|
|
59
|
-
}, /*#__PURE__*/_react["default"].createElement(GroupList, {
|
|
60
|
-
role: "group",
|
|
61
|
-
"aria-labelledby": groupId
|
|
62
|
-
}, /*#__PURE__*/_react["default"].createElement(GroupLabel, {
|
|
63
|
-
role: "presentation",
|
|
64
|
-
id: groupId
|
|
65
|
-
}, option.label), option.options.map(function (singleOption) {
|
|
66
|
-
globalIndex++;
|
|
67
|
-
return /*#__PURE__*/_react["default"].createElement(_Option["default"], {
|
|
68
|
-
key: "option-".concat(singleOption.value),
|
|
69
|
-
id: "option-".concat(globalIndex),
|
|
70
|
-
option: singleOption,
|
|
71
|
-
onClick: handleOptionOnClick,
|
|
72
|
-
multiple: multiple,
|
|
73
|
-
visualFocused: visualFocusIndex === globalIndex,
|
|
74
|
-
isGroupedOption: true,
|
|
75
|
-
isLastOption: lastOptionIndex === globalIndex,
|
|
76
|
-
isSelected: multiple ? currentValue.includes(singleOption.value) : currentValue === singleOption.value
|
|
77
|
-
});
|
|
78
|
-
})));
|
|
79
|
-
} else {
|
|
80
|
-
globalIndex++;
|
|
81
|
-
return /*#__PURE__*/_react["default"].createElement(_Option["default"], {
|
|
82
|
-
key: "option-".concat(option.value),
|
|
83
|
-
id: "option-".concat(globalIndex),
|
|
84
|
-
option: option,
|
|
85
|
-
onClick: handleOptionOnClick,
|
|
86
|
-
multiple: multiple,
|
|
87
|
-
visualFocused: visualFocusIndex === globalIndex,
|
|
88
|
-
isLastOption: lastOptionIndex === globalIndex,
|
|
89
|
-
isSelected: multiple ? currentValue.includes(option.value) : currentValue === option.value
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
(0, _react.useLayoutEffect)(function () {
|
|
95
|
-
if (currentValue && !multiple) {
|
|
96
|
-
var _listEl$scrollTo;
|
|
97
|
-
|
|
98
|
-
var listEl = listboxRef === null || listboxRef === void 0 ? void 0 : listboxRef.current;
|
|
99
|
-
var selectedListOptionEl = listEl === null || listEl === void 0 ? void 0 : listEl.querySelector("[aria-selected='true']");
|
|
100
|
-
listEl === null || listEl === void 0 ? void 0 : (_listEl$scrollTo = listEl.scrollTo) === null || _listEl$scrollTo === void 0 ? void 0 : _listEl$scrollTo.call(listEl, {
|
|
101
|
-
top: (selectedListOptionEl === null || selectedListOptionEl === void 0 ? void 0 : selectedListOptionEl.offsetTop) - (listEl === null || listEl === void 0 ? void 0 : listEl.clientHeight) / 2
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}, [currentValue, multiple]);
|
|
105
|
-
(0, _react.useLayoutEffect)(function () {
|
|
106
|
-
var _listboxRef$current, _visualFocusedOptionE;
|
|
107
|
-
|
|
108
|
-
var visualFocusedOptionEl = listboxRef === null || listboxRef === void 0 ? void 0 : (_listboxRef$current = listboxRef.current) === null || _listboxRef$current === void 0 ? void 0 : _listboxRef$current.querySelectorAll("[role='option']")[visualFocusIndex];
|
|
109
|
-
visualFocusedOptionEl === null || visualFocusedOptionEl === void 0 ? void 0 : (_visualFocusedOptionE = visualFocusedOptionEl.scrollIntoView) === null || _visualFocusedOptionE === void 0 ? void 0 : _visualFocusedOptionE.call(visualFocusedOptionEl, {
|
|
110
|
-
block: "nearest",
|
|
111
|
-
inline: "start"
|
|
112
|
-
});
|
|
113
|
-
}, [visualFocusIndex]);
|
|
114
|
-
return /*#__PURE__*/_react["default"].createElement(ListboxContainer, {
|
|
115
|
-
id: id,
|
|
116
|
-
onClick: function onClick(event) {
|
|
117
|
-
event.stopPropagation();
|
|
118
|
-
},
|
|
119
|
-
onMouseDown: function onMouseDown(event) {
|
|
120
|
-
event.preventDefault();
|
|
121
|
-
},
|
|
122
|
-
ref: listboxRef,
|
|
123
|
-
role: "listbox",
|
|
124
|
-
"aria-multiselectable": multiple,
|
|
125
|
-
style: styles
|
|
126
|
-
}, searchable && (options.length === 0 || !groupsHaveOptions(options)) ? /*#__PURE__*/_react["default"].createElement(OptionsSystemMessage, null, /*#__PURE__*/_react["default"].createElement(NoMatchesFoundIcon, null, _Icons["default"].searchOff), translatedLabels.select.noMatchesErrorMessage) : optional && !multiple && /*#__PURE__*/_react["default"].createElement(_Option["default"], {
|
|
127
|
-
key: "option-".concat(optionalItem.value),
|
|
128
|
-
id: "option-".concat(0),
|
|
129
|
-
option: optionalItem,
|
|
130
|
-
onClick: handleOptionOnClick,
|
|
131
|
-
multiple: multiple,
|
|
132
|
-
visualFocused: visualFocusIndex === 0,
|
|
133
|
-
isGroupedOption: false,
|
|
134
|
-
isLastOption: lastOptionIndex === 0,
|
|
135
|
-
isSelected: multiple ? currentValue.includes(optionalItem.value) : currentValue === optionalItem.value
|
|
136
|
-
}), options.map(mapOptionFunc));
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
var ListboxContainer = _styledComponents["default"].ul(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n max-height: 304px;\n overflow-y: auto;\n margin: 0;\n padding: 0.25rem 0;\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: 0.25rem;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n cursor: default;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
140
|
-
return props.theme.listDialogBackgroundColor;
|
|
141
|
-
}, function (props) {
|
|
142
|
-
return props.theme.listDialogBorderColor;
|
|
143
|
-
}, function (props) {
|
|
144
|
-
return props.theme.listOptionFontColor;
|
|
145
|
-
}, function (props) {
|
|
146
|
-
return props.theme.fontFamily;
|
|
147
|
-
}, function (props) {
|
|
148
|
-
return props.theme.listOptionFontSize;
|
|
149
|
-
}, function (props) {
|
|
150
|
-
return props.theme.listOptionFontStyle;
|
|
151
|
-
}, function (props) {
|
|
152
|
-
return props.theme.listOptionFontWeight;
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
var OptionsSystemMessage = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 4px 16px;\n color: ", ";\n font-size: 0.875rem;\n line-height: 1.715em;\n"])), function (props) {
|
|
156
|
-
return props.theme.systemMessageFontColor;
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
var NoMatchesFoundIcon = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 16px;\n width: 16px;\n padding: 4px;\n margin-right: 0.25rem;\n"])));
|
|
160
|
-
|
|
161
|
-
var GroupList = _styledComponents["default"].ul(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0;\n"])));
|
|
162
|
-
|
|
163
|
-
var GroupLabel = _styledComponents["default"].li(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n padding: 4px 16px;\n font-weight: ", ";\n line-height: 1.715em;\n"])), function (props) {
|
|
164
|
-
return props.theme.listGroupLabelFontWeight;
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
var _default = /*#__PURE__*/_react["default"].memo(Listbox);
|
|
168
|
-
|
|
169
|
-
exports["default"] = _default;
|
package/select/Option.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { OptionProps } from "../select/types";
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ id, option, onClick, multiple, visualFocused, isGroupedOption, isLastOption, isSelected, }: OptionProps) => JSX.Element>;
|
|
4
|
-
export default _default;
|
package/select/Option.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
|
-
var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox"));
|
|
17
|
-
|
|
18
|
-
var _Icons = _interopRequireDefault(require("./Icons"));
|
|
19
|
-
|
|
20
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
21
|
-
|
|
22
|
-
var Option = function Option(_ref) {
|
|
23
|
-
var id = _ref.id,
|
|
24
|
-
option = _ref.option,
|
|
25
|
-
_onClick = _ref.onClick,
|
|
26
|
-
multiple = _ref.multiple,
|
|
27
|
-
visualFocused = _ref.visualFocused,
|
|
28
|
-
_ref$isGroupedOption = _ref.isGroupedOption,
|
|
29
|
-
isGroupedOption = _ref$isGroupedOption === void 0 ? false : _ref$isGroupedOption,
|
|
30
|
-
isLastOption = _ref.isLastOption,
|
|
31
|
-
isSelected = _ref.isSelected;
|
|
32
|
-
return /*#__PURE__*/_react["default"].createElement(OptionItem, {
|
|
33
|
-
id: id,
|
|
34
|
-
onClick: function onClick() {
|
|
35
|
-
_onClick(option);
|
|
36
|
-
},
|
|
37
|
-
visualFocused: visualFocused,
|
|
38
|
-
selected: isSelected,
|
|
39
|
-
role: "option",
|
|
40
|
-
"aria-selected": isSelected
|
|
41
|
-
}, /*#__PURE__*/_react["default"].createElement(StyledOption, {
|
|
42
|
-
visualFocused: visualFocused,
|
|
43
|
-
selected: isSelected,
|
|
44
|
-
last: isLastOption,
|
|
45
|
-
grouped: isGroupedOption,
|
|
46
|
-
multiple: multiple
|
|
47
|
-
}, multiple && /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
48
|
-
checked: isSelected,
|
|
49
|
-
tabIndex: -1
|
|
50
|
-
}), option.icon && /*#__PURE__*/_react["default"].createElement(OptionIcon, {
|
|
51
|
-
grouped: isGroupedOption,
|
|
52
|
-
multiple: multiple,
|
|
53
|
-
role: !(typeof option.icon === "string") ? "img" : undefined
|
|
54
|
-
}, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
55
|
-
src: option.icon
|
|
56
|
-
}) : option.icon), /*#__PURE__*/_react["default"].createElement(OptionContent, {
|
|
57
|
-
grouped: isGroupedOption,
|
|
58
|
-
hasIcon: option.icon ? true : false,
|
|
59
|
-
multiple: multiple
|
|
60
|
-
}, /*#__PURE__*/_react["default"].createElement(OptionLabel, null, option.label), !multiple && isSelected && /*#__PURE__*/_react["default"].createElement(OptionSelectedIndicator, null, _Icons["default"].selected))));
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
var OptionItem = _styledComponents["default"].li(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0 0.5rem;\n box-shadow: inset 0 0 0 2px transparent;\n ", "\n ", ";\n line-height: 1.715em;\n cursor: pointer;\n\n &:hover {\n ", ";\n }\n &:active {\n ", ";\n }\n"])), function (props) {
|
|
64
|
-
return props.visualFocused && "box-shadow: inset 0 0 0 2px ".concat(props.theme.focusListOptionBorderColor, ";");
|
|
65
|
-
}, function (props) {
|
|
66
|
-
return props.selected && "background-color: ".concat(props.theme.selectedListOptionBackgroundColor);
|
|
67
|
-
}, function (props) {
|
|
68
|
-
return props.selected ? "background-color: ".concat(props.theme.selectedHoverListOptionBackgroundColor, ";") : "background-color: ".concat(props.theme.unselectedHoverListOptionBackgroundColor, ";");
|
|
69
|
-
}, function (props) {
|
|
70
|
-
return props.selected ? "background-color: ".concat(props.theme.selectedActiveListOptionBackgroundColor, ";") : "background-color: ".concat(props.theme.unselectedActiveListOptionBackgroundColor, ";");
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
var StyledOption = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 0.5rem 0.188rem 0;\n min-height: 24px;\n ", "\n ", ";\n"])), function (props) {
|
|
74
|
-
return props.grouped && props.multiple && "padding-left: 16px;";
|
|
75
|
-
}, function (props) {
|
|
76
|
-
return props.last || props.visualFocused || props.selected ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
var OptionIcon = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.125rem;\n margin-left: ", ";\n color: ", ";\n\n svg,\n img {\n height: 20px;\n width: 20px;\n }\n"])), function (props) {
|
|
80
|
-
return props.grouped && !props.multiple ? "16px" : "8px";
|
|
81
|
-
}, function (props) {
|
|
82
|
-
return props.theme.listOptionIconColor;
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
var OptionContent = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n gap: 0.25rem;\n width: 100%;\n overflow: hidden;\n margin-left: ", ";\n"])), function (props) {
|
|
86
|
-
return props.grouped && !props.multiple && !props.hasIcon ? "16px" : "8px";
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
var OptionLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
|
|
90
|
-
|
|
91
|
-
var OptionSelectedIndicator = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n color: ", ";\n\n svg {\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
|
|
92
|
-
return props.theme.selectedListOptionIconColor;
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
var _default = /*#__PURE__*/_react["default"].memo(Option);
|
|
96
|
-
|
|
97
|
-
exports["default"] = _default;
|
package/select/Select.d.ts
DELETED