@councilbox/councilbox-ui 2.0.58 → 2.0.60
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/SafeHtml.js +3 -0
- package/ScrollbarOld.js +3 -0
- package/dist/HOCs/overlayA11yStack.js +1 -1
- package/dist/HOCs/useDynamicStyles.js +39 -4
- package/dist/build-index.js +21 -7
- package/dist/components/Accordion/Accordion.css +7 -1
- package/dist/components/Button/Button.js +79 -87
- package/dist/components/Button/button.css +171 -16
- package/dist/components/DatePicker/Calendar.js +3 -5
- package/dist/components/DatePicker/DatePicker.css +1 -1
- package/dist/components/DateRangePicker/RangeCalendar.js +2 -4
- package/dist/components/IconButton/IconButton.js +1 -1
- package/dist/components/Modal/Modal.js +13 -3
- package/dist/components/RichTextInput/RichTextInput.js +28 -7
- package/dist/components/SafeHtml/SafeHtml.js +82 -0
- package/dist/components/Scrollbar/Scrollbar.css +60 -19
- package/dist/components/Scrollbar/Scrollbar.js +386 -62
- package/dist/components/ScrollbarOld/DesignScrollbarOld.js +24 -0
- package/dist/components/ScrollbarOld/ScrollbarOld.css +38 -0
- package/dist/components/ScrollbarOld/ScrollbarOld.js +104 -0
- package/dist/components/SelectInput/SelectInput.js +1 -0
- package/dist/components/Stepper/Stepper.css +6 -1
- package/dist/components/Tabs/Tabs.js +1 -0
- package/dist/components/TextInput/TextInput.css +164 -1
- package/dist/components/TextInput/TextInput.js +171 -167
- package/dist/components/ThemeProvider/Colors.js +1 -1
- package/dist/components/ThemeProvider/ThemeProvider.js +1 -7
- package/dist/components/Toast/toastStore.js +1 -0
- package/dist/styles/colorConsts.css +1 -1
- package/dist/styles/stylesheet.js +2 -50
- package/dist/testing/TestAutocomplete.js +1 -105
- package/dist/utils/sanitizeHtml.js +199 -0
- package/package.json +18 -32
- package/IconFont.js +0 -3
- package/dist/__snapshots__/storybook.test.js.snap +0 -104
- package/dist/components/1.Introduction.stories.mdx +0 -67
- package/dist/components/2.Changelog.stories.mdx +0 -595
- package/dist/components/3.Guide.stories.mdx +0 -235
- package/dist/components/Accordion/Accordion.stories.js +0 -44
- package/dist/components/Accordion/DesignAccordion.stories.js +0 -27
- package/dist/components/Alert/Alert.stories.js +0 -51
- package/dist/components/Avatar/Avatar.stories.js +0 -100
- package/dist/components/Avatar/DesignAvatar.stories.js +0 -64
- package/dist/components/Avatar/DesignAvatarText.stories.js +0 -123
- package/dist/components/AvatarGroup/AvatarGroup.stories.js +0 -25
- package/dist/components/AvatarGroup/DesignAvatarGroup.stories.js +0 -118
- package/dist/components/Block/Block.stories.js +0 -45
- package/dist/components/Block/DesignBlock.stories.js +0 -35
- package/dist/components/Button/Button.stories.js +0 -72
- package/dist/components/ButtonBasic/ButtonBasic.stories.js +0 -108
- package/dist/components/Checkbox/Checkbox.stories.js +0 -41
- package/dist/components/DatePicker/DatePicker.stories.js +0 -180
- package/dist/components/DateRangePicker/DateRangePicker.stories.js +0 -147
- package/dist/components/DateTimePicker/DateTimePicker.stories.js +0 -144
- package/dist/components/DragDrop/DragDrop.stories.js +0 -55
- package/dist/components/DrawerPanel/DrawerPanel.stories.js +0 -51
- package/dist/components/DropDown/DesignDropDown.stories.js +0 -216
- package/dist/components/DropDown/DropDown.stories.js +0 -43
- package/dist/components/EnhancedTable/DesignEnhancedTable.stories.js +0 -128
- package/dist/components/EnhancedTable/EnhancedTable.stories.js +0 -49
- package/dist/components/FabButton/DesignFabButton.stories.js +0 -40
- package/dist/components/FabButton/FabButton.stories.js +0 -46
- package/dist/components/Grid/DesignGrid.stories.js +0 -45
- package/dist/components/Grid/Grid.stories.js +0 -37
- package/dist/components/Header/DesignHeader.stories.js +0 -65
- package/dist/components/Header/Header.stories.js +0 -99
- package/dist/components/IconButton/DesignIconButton.stories.js +0 -113
- package/dist/components/IconButton/IconButton.stories.js +0 -40
- package/dist/components/IconButtonSquare/DesignIconButtonSquare.stories.js +0 -21
- package/dist/components/IconButtonSquare/IconButtonSquare.stories.js +0 -39
- package/dist/components/IconFont/IconFont.css +0 -0
- package/dist/components/IconFont/IconFont.js +0 -86
- package/dist/components/IconFont/IconFont.stories.js +0 -36
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +0 -272
- package/dist/components/InputPassword/InputPassword.stories.js +0 -75
- package/dist/components/InputText/InputText.stories.js +0 -100
- package/dist/components/InputTextArea/DesignInputTextArea.stories.js +0 -116
- package/dist/components/InputTextArea/InputTextArea.stories.js +0 -40
- package/dist/components/LoadingSection/LoadingSection.stories.js +0 -42
- package/dist/components/MenuItem/DesignMenuItem.stories.js +0 -54
- package/dist/components/MenuItem/MenuItem.stories.js +0 -53
- package/dist/components/MenuLateralLeft/MenuLateralLeft.stories.js +0 -37
- package/dist/components/MenuLateralRight/MenuLateralRight.stories.js +0 -37
- package/dist/components/Modal/DesignModal.stories.js +0 -39
- package/dist/components/Modal/Modal.stories.js +0 -67
- package/dist/components/PaginationFooter/DesignPaginationFooter.stories.js +0 -22
- package/dist/components/PaginationFooter/PaginationFooter.stories.js +0 -48
- package/dist/components/RadioButton/Radio.stories.js +0 -57
- package/dist/components/RichTextInput/DesignRichTextInput.stories.js +0 -113
- package/dist/components/RichTextInput/RichTextInput.stories.js +0 -33
- package/dist/components/Ripple/Ripple.stories.js +0 -39
- package/dist/components/Scrollbar/Scrollbar.stories.js +0 -37
- package/dist/components/SelectInput/SelectInput.stories.js +0 -81
- package/dist/components/Slider/Slider.stories.js +0 -37
- package/dist/components/Spacing/Spacing.stories.js +0 -32
- package/dist/components/Stars/Stars.stories.js +0 -37
- package/dist/components/Stepper/DesignStepper.stories.js +0 -130
- package/dist/components/Stepper/Stepper.stories.js +0 -41
- package/dist/components/Table/DesignTable.stories.js +0 -614
- package/dist/components/Table/Table.stories.js +0 -53
- package/dist/components/Tabs/Tabs.stories.js +0 -44
- package/dist/components/Tag/DesignTags.stories.js +0 -81
- package/dist/components/Tag/Tag.stories.js +0 -45
- package/dist/components/TextInput/TextInput.stories.js +0 -60
- package/dist/components/TimePicker/TimePicker.stories.js +0 -132
- package/dist/components/Timeline/DesignTimeline.stories.js +0 -19
- package/dist/components/Timeline/Timeline.stories.js +0 -37
- package/dist/components/Toast/DesignToast.stories.js +0 -174
- package/dist/components/Toast/Toast.stories.js +0 -33
- package/dist/components/Toggle/Toggle.stories.js +0 -42
- package/dist/components/Tooltip/DesignTooltip.stories.js +0 -45
- package/dist/components/Tooltip/Tooltip.stories.js +0 -33
- package/dist/components/Typography/Typography.stories.js +0 -73
- package/dist/fonts/IconNames.json +0 -6848
- package/dist/reportWebVitals.js +0 -28
- package/dist/storybook.test.js +0 -5
|
@@ -40,9 +40,14 @@
|
|
|
40
40
|
cursor: inherit;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
.cbx-stepper-item-contentText:focus {
|
|
44
|
+
outline: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
.cbx-stepper-item-contentText:focus-visible {
|
|
44
48
|
outline: 2px solid var(--accent);
|
|
45
|
-
outline-offset: 2px;
|
|
49
|
+
outline-offset: -2px;
|
|
50
|
+
border-radius: 0.25rem;
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
.cbx-stepper-item-contentText:last-child {
|
|
@@ -248,6 +248,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
248
248
|
"aria-selected": isActive,
|
|
249
249
|
"aria-controls": item.panelId || undefined,
|
|
250
250
|
"aria-disabled": item.disabled || undefined,
|
|
251
|
+
"aria-label": item.ariaLabel || item['aria-label'],
|
|
251
252
|
tabIndex: isActive ? 0 : -1,
|
|
252
253
|
onClick: function onClick(e) {
|
|
253
254
|
return handleTabClick(e, index, item.value || index);
|
|
@@ -9,4 +9,167 @@
|
|
|
9
9
|
height: 0.875rem;
|
|
10
10
|
line-height: 1.1;
|
|
11
11
|
font-size: 0.875rem;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.cbx-TextInput-root {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
position: relative;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
border: 0;
|
|
22
|
+
vertical-align: top;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.cbx-TextInput-fullWidth {
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.cbx-TextInput-margin-normal {
|
|
31
|
+
margin-top: 16px;
|
|
32
|
+
margin-bottom: 8px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.cbx-TextInput-margin-dense {
|
|
36
|
+
margin-top: 8px;
|
|
37
|
+
margin-bottom: 4px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.cbx-TextInput-root .cbx-inputText-allContainer,
|
|
41
|
+
.cbx-TextInput-root .cbx-inputText-container {
|
|
42
|
+
width: 100%;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.cbx-TextInput-root .cbx-inputText-container-helpers {
|
|
47
|
+
padding-top: 0;
|
|
48
|
+
margin-top: var(--spacing4);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.cbx-TextInput-root .cbx-inputText-endAdornment.ri-information-line {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.cbx-TextInput-root .cbx-inputText-endAdornment.ri-check-line {
|
|
56
|
+
color: inherit !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.cbx-TextInput-root .cbx-inputText-label.cbx-inputText-label-standard,
|
|
60
|
+
.cbx-TextInput-root.cbx-TextInput-standard .cbx-inputText-label {
|
|
61
|
+
transform: translate(0px, 20px) scale(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.cbx-TextInput-root.cbx-TextInput-small.cbx-TextInput-standard .cbx-inputText-label {
|
|
65
|
+
transform: translate(0px, 17px) scale(1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.cbx-TextInput-root .cbx-inputText-standard:focus ~ label.cbx-inputText-label,
|
|
69
|
+
.cbx-TextInput-root .cbx-inputText-standard.shrink ~ label.cbx-inputText-label,
|
|
70
|
+
.cbx-TextInput-root .cbx-inputText-standard:not(:placeholder-shown) ~ label.cbx-inputText-label {
|
|
71
|
+
transform: translate(0px, -1.5px) scale(0.75);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cbx-TextInput-root.cbx-TextInput-withLabel .cbx-input.cbx-inputText-standard {
|
|
75
|
+
padding: 20px var(--spacing8) 4px 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.cbx-TextInput-root.cbx-TextInput-small.cbx-TextInput-withLabel .cbx-input.cbx-inputText-standard {
|
|
79
|
+
padding-top: 17px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.cbx-TextInput-root .cbx-input.cbx-inputText-standard:focus ~ label.cbx-inputText-label {
|
|
83
|
+
color: var(--primary);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cbx-TextInput-root.cbx-TextInput-noUnderline .cbx-inputText-container-standard,
|
|
87
|
+
.cbx-TextInput-root.cbx-TextInput-noUnderline .cbx-inputText-container-standard:hover,
|
|
88
|
+
.cbx-TextInput-root.cbx-TextInput-noUnderline .cbx-inputText-container-filled,
|
|
89
|
+
.cbx-TextInput-root.cbx-TextInput-noUnderline .cbx-inputText-container-filled:hover {
|
|
90
|
+
border-bottom: 0 !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.cbx-TextInput-root.cbx-TextInput-noUnderline .cbx-inputText-bar {
|
|
94
|
+
display: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-inputText-container {
|
|
98
|
+
height: 56px;
|
|
99
|
+
max-height: 56px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-input {
|
|
103
|
+
height: 56px;
|
|
104
|
+
max-height: 56px;
|
|
105
|
+
padding: 16.5px 14px 16.5px 14px;
|
|
106
|
+
color: inherit;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-inputText-fieldset {
|
|
110
|
+
height: 61px;
|
|
111
|
+
max-height: 61px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-inputText-label {
|
|
115
|
+
transform: translate(14px, 16px) scale(1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.cbx-TextInput-root.cbx-TextInput-outlined.cbx-TextInput-small .cbx-inputText-container {
|
|
119
|
+
height: 40px;
|
|
120
|
+
max-height: 40px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.cbx-TextInput-root.cbx-TextInput-outlined.cbx-TextInput-small .cbx-input {
|
|
124
|
+
height: 40px;
|
|
125
|
+
max-height: 40px;
|
|
126
|
+
padding-top: 8.5px;
|
|
127
|
+
padding-bottom: 8.5px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.cbx-TextInput-root.cbx-TextInput-outlined.cbx-TextInput-small .cbx-inputText-fieldset {
|
|
131
|
+
height: 45px;
|
|
132
|
+
max-height: 45px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.cbx-TextInput-root.cbx-TextInput-outlined.cbx-TextInput-small .cbx-inputText-label {
|
|
136
|
+
transform: translate(14px, 9px) scale(1);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-input:focus ~ label.cbx-inputText-label,
|
|
140
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-input.shrink ~ label.cbx-inputText-label,
|
|
141
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-input:not(:placeholder-shown) ~ label.cbx-inputText-label {
|
|
142
|
+
transform: translate(14px, -9px) scale(0.75);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.cbx-TextInput-root .cbx-inputText-fieldset-outlined {
|
|
146
|
+
border: 1px solid var(--gray3);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.cbx-TextInput-root .cbx-inputText-fieldset-outlined.focusedNo.value {
|
|
150
|
+
border-color: var(--gray3);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.cbx-TextInput-root .cbx-inputText-fieldset-outlined.hover {
|
|
154
|
+
border-width: 2px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.cbx-TextInput-root .cbx-inputText-fieldset-outlined.focused {
|
|
158
|
+
border: 2px solid var(--gray4);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.cbx-TextInput-root .cbx-inputText-outlined:disabled ~ .cbx-inputText-fieldset {
|
|
162
|
+
border: 1px solid rgba(0, 0, 0, 0.38) !important;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.cbx-TextInput-root .cbx-inputText-container-textArea .cbx-input,
|
|
166
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-inputText-container-textArea .cbx-input {
|
|
167
|
+
height: auto;
|
|
168
|
+
max-height: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-inputText-container.cbx-inputText-container-textArea,
|
|
172
|
+
.cbx-TextInput-root.cbx-TextInput-outlined .cbx-inputText-container-textArea .cbx-inputText-fieldset {
|
|
173
|
+
height: auto;
|
|
174
|
+
max-height: none;
|
|
175
|
+
}
|
|
@@ -1,147 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports["default"] = void 0;
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
10
10
|
require("../../styles/main.css");
|
|
11
11
|
require("./TextInput.css");
|
|
12
|
-
var
|
|
12
|
+
var _InputText = _interopRequireDefault(require("../InputText/InputText"));
|
|
13
13
|
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
14
14
|
var _useA11yGuard2 = require("../../HOCs/useA11yGuard");
|
|
15
|
-
var _excluded = ["id", "className", "onChange", "label", "disabled", "error", "helper", "success", "width", "helperText", "fullWidth", "disableUnderline", "sx"]
|
|
15
|
+
var _excluded = ["id", "className", "onChange", "label", "disabled", "error", "helper", "success", "width", "helperText", "fullWidth", "disableUnderline", "sx", "style", "variant", "size", "margin", "value", "defaultValue", "type", "name", "placeholder", "autoComplete", "autoFocus", "required", "multiline", "rows", "minRows", "onFocus", "onBlur", "inputProps", "InputProps", "InputLabelProps", "inputRef", "aria-label"],
|
|
16
|
+
_excluded2 = ["onChange", "onFocus", "onBlur"];
|
|
16
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
18
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
19
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
25
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
27
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
|
|
28
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
29
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18
30
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
19
31
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
'& legend': {
|
|
58
|
-
'& span': {
|
|
59
|
-
paddingLeft: 'var(--spacing4)',
|
|
60
|
-
paddingRight: 'var(--spacing4)'
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
'&:hover fieldset': {
|
|
65
|
-
borderColor: 'var(--gray3)',
|
|
66
|
-
borderWidth: '2px'
|
|
67
|
-
},
|
|
68
|
-
'&:active fieldset': {
|
|
69
|
-
borderColor: 'var(--gray4)',
|
|
70
|
-
borderWidth: '2px'
|
|
71
|
-
},
|
|
72
|
-
'&.Mui-focused fieldset': {
|
|
73
|
-
borderColor: 'var(--gray4)',
|
|
74
|
-
borderWidth: '2px'
|
|
75
|
-
},
|
|
76
|
-
'&:focus-visible': {
|
|
77
|
-
outline: 'none',
|
|
78
|
-
'& fieldset': {
|
|
79
|
-
outline: 'none',
|
|
80
|
-
boxShadow: '0 0 0 3px white, 0 0 7px 4px var(--primary)',
|
|
81
|
-
border: '2px solid var(--gray4)'
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
'& .MuiOutlinedInput-root.Mui-error': {
|
|
86
|
-
'& fieldset': {
|
|
87
|
-
borderColor: 'var(--error)'
|
|
88
|
-
},
|
|
89
|
-
'&:hover fieldset': {
|
|
90
|
-
borderColor: 'var(--error)',
|
|
91
|
-
borderWidth: '2px'
|
|
92
|
-
},
|
|
93
|
-
'&:active fieldset': {
|
|
94
|
-
borderColor: 'var(--error)',
|
|
95
|
-
borderWidth: '2px'
|
|
96
|
-
},
|
|
97
|
-
'&.Mui-focused fieldset': {
|
|
98
|
-
borderColor: 'var(--error)',
|
|
99
|
-
borderWidth: '2px'
|
|
100
|
-
},
|
|
101
|
-
'&:focus-visible': {
|
|
102
|
-
borderColor: 'var(--gray4)',
|
|
103
|
-
borderWidth: '2px',
|
|
104
|
-
boxShadow: '0 0 0 3px white, 0 0 7px 4px var(--primary)'
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
'& .MuiOutlinedInput-root.Mui-disabled': {
|
|
108
|
-
'& fieldset': {
|
|
109
|
-
borderColor: 'rgba(0,0,0,0.38)',
|
|
110
|
-
borderWidth: '1px'
|
|
111
|
-
},
|
|
112
|
-
'&:hover fieldset': {
|
|
113
|
-
borderColor: 'rgba(0,0,0,0.38)',
|
|
114
|
-
borderWidth: '1px'
|
|
115
|
-
},
|
|
116
|
-
'&:active fieldset': {
|
|
117
|
-
borderColor: 'rgba(0,0,0,0.38)',
|
|
118
|
-
borderWidth: '1px'
|
|
119
|
-
},
|
|
120
|
-
'&.Mui-focused fieldset': {
|
|
121
|
-
borderColor: 'rgba(0,0,0,0.38)',
|
|
122
|
-
borderWidth: '1px'
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
var TextInput = function TextInput(_ref2) {
|
|
128
|
-
var id = _ref2.id,
|
|
129
|
-
className = _ref2.className,
|
|
130
|
-
onChange = _ref2.onChange,
|
|
131
|
-
label = _ref2.label,
|
|
132
|
-
disabled = _ref2.disabled,
|
|
133
|
-
error = _ref2.error,
|
|
134
|
-
helper = _ref2.helper,
|
|
135
|
-
success = _ref2.success,
|
|
136
|
-
width = _ref2.width,
|
|
137
|
-
helperText = _ref2.helperText,
|
|
138
|
-
fullWidth = _ref2.fullWidth,
|
|
139
|
-
disableUnderline = _ref2.disableUnderline,
|
|
140
|
-
sx = _ref2.sx,
|
|
141
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
32
|
+
var TextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
33
|
+
var id = _ref.id,
|
|
34
|
+
className = _ref.className,
|
|
35
|
+
onChange = _ref.onChange,
|
|
36
|
+
label = _ref.label,
|
|
37
|
+
disabled = _ref.disabled,
|
|
38
|
+
error = _ref.error,
|
|
39
|
+
helper = _ref.helper,
|
|
40
|
+
success = _ref.success,
|
|
41
|
+
width = _ref.width,
|
|
42
|
+
helperText = _ref.helperText,
|
|
43
|
+
fullWidth = _ref.fullWidth,
|
|
44
|
+
disableUnderline = _ref.disableUnderline,
|
|
45
|
+
sx = _ref.sx,
|
|
46
|
+
style = _ref.style,
|
|
47
|
+
variant = _ref.variant,
|
|
48
|
+
size = _ref.size,
|
|
49
|
+
margin = _ref.margin,
|
|
50
|
+
value = _ref.value,
|
|
51
|
+
defaultValue = _ref.defaultValue,
|
|
52
|
+
type = _ref.type,
|
|
53
|
+
name = _ref.name,
|
|
54
|
+
placeholder = _ref.placeholder,
|
|
55
|
+
autoComplete = _ref.autoComplete,
|
|
56
|
+
autoFocus = _ref.autoFocus,
|
|
57
|
+
required = _ref.required,
|
|
58
|
+
multiline = _ref.multiline,
|
|
59
|
+
rows = _ref.rows,
|
|
60
|
+
minRows = _ref.minRows,
|
|
61
|
+
onFocus = _ref.onFocus,
|
|
62
|
+
onBlur = _ref.onBlur,
|
|
63
|
+
inputProps = _ref.inputProps,
|
|
64
|
+
InputProps = _ref.InputProps,
|
|
65
|
+
InputLabelProps = _ref.InputLabelProps,
|
|
66
|
+
inputRef = _ref.inputRef,
|
|
67
|
+
ariaLabel = _ref['aria-label'],
|
|
68
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
142
69
|
var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
|
|
143
70
|
requireAccessibleText = _useA11yGuard.requireAccessibleText;
|
|
144
|
-
|
|
71
|
+
var isControlled = value !== undefined;
|
|
72
|
+
var _React$useState = _react["default"].useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : ''),
|
|
73
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
74
|
+
innerValue = _React$useState2[0],
|
|
75
|
+
setInnerValue = _React$useState2[1];
|
|
76
|
+
var innerInputRef = _react["default"].useRef(null);
|
|
77
|
+
var setInputRef = _react["default"].useCallback(function (node) {
|
|
78
|
+
innerInputRef.current = node;
|
|
79
|
+
if (typeof inputRef === 'function') {
|
|
80
|
+
inputRef(node);
|
|
81
|
+
} else if (inputRef) {
|
|
82
|
+
inputRef.current = node;
|
|
83
|
+
}
|
|
84
|
+
}, [inputRef]);
|
|
85
|
+
_react["default"].useEffect(function () {
|
|
86
|
+
var _innerInputRef$curren;
|
|
87
|
+
if (autoFocus) (_innerInputRef$curren = innerInputRef.current) === null || _innerInputRef$curren === void 0 ? void 0 : _innerInputRef$curren.focus();
|
|
88
|
+
}, []);
|
|
89
|
+
requireAccessibleText(label || ariaLabel, {
|
|
145
90
|
component: 'TextInput',
|
|
146
91
|
prop: '"label" o "aria-label"',
|
|
147
92
|
hint: 'Un campo de texto debe contar con una etiqueta visible (label) o un "aria-label" para ser identificado por los lectores de pantalla.',
|
|
@@ -151,49 +96,94 @@ var TextInput = function TextInput(_ref2) {
|
|
|
151
96
|
disabled: disabled
|
|
152
97
|
}
|
|
153
98
|
});
|
|
154
|
-
|
|
155
|
-
|
|
99
|
+
var _ref2 = InputProps || {},
|
|
100
|
+
startAdornment = _ref2.startAdornment,
|
|
101
|
+
endAdornment = _ref2.endAdornment,
|
|
102
|
+
inputDisableUnderline = _ref2.disableUnderline,
|
|
103
|
+
readOnly = _ref2.readOnly,
|
|
104
|
+
nestedInputProps = _ref2.inputProps;
|
|
105
|
+
var _nestedInputProps$inp = _objectSpread(_objectSpread({}, nestedInputProps), inputProps),
|
|
106
|
+
inputPropsOnChange = _nestedInputProps$inp.onChange,
|
|
107
|
+
inputPropsOnFocus = _nestedInputProps$inp.onFocus,
|
|
108
|
+
inputPropsOnBlur = _nestedInputProps$inp.onBlur,
|
|
109
|
+
restInputProps = _objectWithoutProperties(_nestedInputProps$inp, _excluded2);
|
|
110
|
+
var resolvedVariant = variant === 'outlined' || variant === 'filled' ? variant : 'standard';
|
|
111
|
+
var hideUnderline = inputDisableUnderline !== null && inputDisableUnderline !== void 0 ? inputDisableUnderline : disableUnderline;
|
|
112
|
+
var handleChange = function handleChange(event) {
|
|
113
|
+
if (!isControlled) {
|
|
114
|
+
setInnerValue(event.target.value);
|
|
115
|
+
}
|
|
116
|
+
if (inputPropsOnChange) inputPropsOnChange(event);
|
|
117
|
+
if (onChange) onChange(event);
|
|
118
|
+
};
|
|
119
|
+
var handleFocus = function handleFocus(event) {
|
|
120
|
+
if (inputPropsOnFocus) inputPropsOnFocus(event);
|
|
121
|
+
if (onFocus) onFocus(event);
|
|
122
|
+
};
|
|
123
|
+
var handleBlur = function handleBlur(event) {
|
|
124
|
+
if (inputPropsOnBlur) inputPropsOnBlur(event);
|
|
125
|
+
if (onBlur) onBlur(event);
|
|
126
|
+
};
|
|
127
|
+
var errorContent = error && error !== true ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
128
|
+
className: "cbx-TextInput-items-center"
|
|
129
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
130
|
+
className: 'cbx-TextInput-infoBtn ri-information-line',
|
|
131
|
+
"aria-hidden": "true"
|
|
132
|
+
}), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
133
|
+
variant: "XS",
|
|
134
|
+
color: 'var(--error)',
|
|
135
|
+
component: 'span'
|
|
136
|
+
}, error)) : error;
|
|
137
|
+
var helperContent = helper && /*#__PURE__*/_react["default"].createElement("span", {
|
|
138
|
+
className: "cbx-TextInput-items-center"
|
|
139
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
140
|
+
className: 'cbx-TextInput-infoBtn ri-information-line',
|
|
141
|
+
"aria-hidden": "true"
|
|
142
|
+
}), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
143
|
+
color: !disabled ? 'var(--gray4)' : 'var(--gray3)',
|
|
144
|
+
variant: "XS",
|
|
145
|
+
component: 'span'
|
|
146
|
+
}, helper));
|
|
147
|
+
var rootClasses = ['cbx-TextInput-root', "cbx-TextInput-".concat(resolvedVariant), size === 'small' ? 'cbx-TextInput-small' : '', fullWidth ? 'cbx-TextInput-fullWidth' : '', margin && margin !== 'none' ? "cbx-TextInput-margin-".concat(margin) : '', hideUnderline ? 'cbx-TextInput-noUnderline' : '', label ? 'cbx-TextInput-withLabel' : '', className || ''].filter(Boolean).join(' ');
|
|
148
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
149
|
+
ref: ref,
|
|
150
|
+
className: rootClasses,
|
|
151
|
+
style: _objectSpread({
|
|
152
|
+
minWidth: width || '15rem'
|
|
153
|
+
}, style)
|
|
154
|
+
}, props), /*#__PURE__*/_react["default"].createElement(_InputText["default"], _extends({}, restInputProps, {
|
|
155
|
+
ref: setInputRef,
|
|
156
156
|
id: id,
|
|
157
|
-
|
|
158
|
-
sx: {
|
|
159
|
-
minWidth: width || '15rem',
|
|
160
|
-
height: '3rem',
|
|
161
|
-
sx: sx
|
|
162
|
-
},
|
|
157
|
+
name: name,
|
|
163
158
|
label: label,
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
"aria-label": ariaLabel,
|
|
160
|
+
placeholder: placeholder,
|
|
161
|
+
autoComplete: autoComplete || 'on',
|
|
162
|
+
variant: resolvedVariant,
|
|
163
|
+
type: multiline ? 'textArea' : type || 'text',
|
|
164
|
+
multiline: multiline,
|
|
165
|
+
rows: multiline ? rows || minRows : undefined,
|
|
166
|
+
value: isControlled ? value : innerValue,
|
|
167
|
+
onChange: handleChange,
|
|
168
|
+
onFocus: handleFocus,
|
|
169
|
+
onBlur: handleBlur,
|
|
166
170
|
disabled: disabled,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
182
|
-
color: !disabled ? 'var(--gray4)' : 'var(--gray3)',
|
|
183
|
-
variant: "XS",
|
|
184
|
-
component: 'span'
|
|
185
|
-
}, helper))),
|
|
186
|
-
InputProps: {
|
|
187
|
-
disableUnderline: disableUnderline,
|
|
188
|
-
endAdornment: success && /*#__PURE__*/_react["default"].createElement("i", {
|
|
189
|
-
className: "cbx-TextInput-endAdornment ri-check-line"
|
|
190
|
-
})
|
|
191
|
-
}
|
|
192
|
-
}, props));
|
|
193
|
-
};
|
|
194
|
-
TextInput.displayName = "TextInput";
|
|
171
|
+
required: required,
|
|
172
|
+
readOnly: readOnly,
|
|
173
|
+
fullWidth: true,
|
|
174
|
+
success: success,
|
|
175
|
+
error: errorContent,
|
|
176
|
+
helperText: helperText || helperContent && !error ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, helperText, !error && helperContent) : undefined,
|
|
177
|
+
shrink: InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.shrink,
|
|
178
|
+
InputProps: startAdornment || endAdornment ? {
|
|
179
|
+
startAdornment: startAdornment,
|
|
180
|
+
endAdornment: endAdornment
|
|
181
|
+
} : undefined,
|
|
182
|
+
sx: sx
|
|
183
|
+
})));
|
|
184
|
+
});
|
|
195
185
|
TextInput.propTypes = {
|
|
196
|
-
label: _propTypes["default"].
|
|
186
|
+
label: _propTypes["default"].node,
|
|
197
187
|
helper: _propTypes["default"].string,
|
|
198
188
|
width: _propTypes["default"].string,
|
|
199
189
|
id: _propTypes["default"].string,
|
|
@@ -202,7 +192,14 @@ TextInput.propTypes = {
|
|
|
202
192
|
disabled: _propTypes["default"].bool,
|
|
203
193
|
error: _propTypes["default"].node,
|
|
204
194
|
success: _propTypes["default"].bool,
|
|
205
|
-
disableUnderline: _propTypes["default"].bool
|
|
195
|
+
disableUnderline: _propTypes["default"].bool,
|
|
196
|
+
variant: _propTypes["default"].oneOf(['standard', 'outlined', 'filled']),
|
|
197
|
+
size: _propTypes["default"].oneOf(['small', 'medium']),
|
|
198
|
+
margin: _propTypes["default"].oneOf(['none', 'dense', 'normal']),
|
|
199
|
+
multiline: _propTypes["default"].bool,
|
|
200
|
+
InputProps: _propTypes["default"].object,
|
|
201
|
+
InputLabelProps: _propTypes["default"].object,
|
|
202
|
+
inputProps: _propTypes["default"].object
|
|
206
203
|
};
|
|
207
204
|
TextInput.defaultProps = {
|
|
208
205
|
label: '',
|
|
@@ -213,7 +210,14 @@ TextInput.defaultProps = {
|
|
|
213
210
|
onChange: undefined,
|
|
214
211
|
disabled: false,
|
|
215
212
|
disableUnderline: false,
|
|
216
|
-
error: undefined
|
|
213
|
+
error: undefined,
|
|
214
|
+
variant: 'standard',
|
|
215
|
+
size: 'medium',
|
|
216
|
+
margin: undefined,
|
|
217
|
+
multiline: false,
|
|
218
|
+
InputProps: undefined,
|
|
219
|
+
InputLabelProps: undefined,
|
|
220
|
+
inputProps: undefined
|
|
217
221
|
};
|
|
218
222
|
var _default = TextInput;
|
|
219
223
|
exports["default"] = _default;
|
|
@@ -6,9 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _styles = require("@mui/material/styles");
|
|
10
9
|
require("../../styles/main.css");
|
|
11
|
-
var _stylesheet = require("../../styles/stylesheet");
|
|
12
10
|
var _CouncilboxThemeContext = require("./CouncilboxThemeContext");
|
|
13
11
|
var _Colors = require("./Colors");
|
|
14
12
|
var _useWindowSize2 = _interopRequireDefault(require("../../HOCs/useWindowSize"));
|
|
@@ -60,10 +58,6 @@ var _default = function _default(_ref) {
|
|
|
60
58
|
innerHeight: innerHeight,
|
|
61
59
|
options: mergedOptions
|
|
62
60
|
}
|
|
63
|
-
},
|
|
64
|
-
theme: (0, _stylesheet.theme)({
|
|
65
|
-
colors: state.colors
|
|
66
|
-
})
|
|
67
|
-
}, children));
|
|
61
|
+
}, children);
|
|
68
62
|
};
|
|
69
63
|
exports["default"] = _default;
|
|
@@ -93,6 +93,7 @@ var ensureMounted = function ensureMounted() {
|
|
|
93
93
|
mounted = true;
|
|
94
94
|
var node = document.createElement('div');
|
|
95
95
|
node.setAttribute('id', 'cbx-toast-root');
|
|
96
|
+
node.setAttribute('data-overlay-persistent', '');
|
|
96
97
|
document.body.appendChild(node);
|
|
97
98
|
var element = /*#__PURE__*/_react["default"].createElement(_ToastRoot["default"], {
|
|
98
99
|
subscribe: subscribeToasts,
|