@hyphen/hyphen-components 2.11.4 → 2.12.0
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/components/ThemeProvider/ThemeProvider.d.ts +2 -1
- package/dist/css/index.css +2 -2
- package/dist/css/variables.css +0 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/useTheme/useTheme.d.ts +5 -0
- package/dist/hooks/useTheme/useTheme.stories.d.ts +6 -0
- package/dist/hyphen-components.cjs.development.js +60 -62
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +61 -64
- package/dist/hyphen-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FormLabel/FormLabel.module.scss +0 -5
- package/src/components/FormLabel/FormLabel.tsx +2 -11
- package/src/components/HelpText/HelpText.module.scss +1 -4
- package/src/components/InputValidationMessage/InputValidationMessage.tsx +1 -1
- package/src/components/ThemeProvider/ThemeProvider.stories.tsx +6 -3
- package/src/components/ThemeProvider/ThemeProvider.tsx +10 -13
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useTheme/useTheme.stories.tsx +63 -0
- package/src/hooks/useTheme/useTheme.ts +11 -0
- package/src/styles/variables/forms.scss +0 -1
|
@@ -1159,13 +1159,27 @@ var InputValidationMessage = function InputValidationMessage(_ref) {
|
|
|
1159
1159
|
var children = _ref.children,
|
|
1160
1160
|
_ref$size = _ref.size,
|
|
1161
1161
|
size = _ref$size === void 0 ? 'sm' : _ref$size;
|
|
1162
|
-
var classes = classNames('hyphen-components__variables__form-control', styles$n['input-validation-message'], 'font-color-danger', "font-size-" + size, 'm-top-
|
|
1162
|
+
var classes = classNames('hyphen-components__variables__form-control', styles$n['input-validation-message'], 'font-color-danger', "font-size-" + size, 'm-top-sm');
|
|
1163
1163
|
return React.createElement("div", {
|
|
1164
1164
|
className: classes
|
|
1165
1165
|
}, children);
|
|
1166
1166
|
};
|
|
1167
1167
|
|
|
1168
|
-
var styles$m = {"label":"FormLabel-module_label__qTUB9","radio-input-label":"FormLabel-module_radio-input-label__IpAiN","disabled":"FormLabel-module_disabled__83oiH"
|
|
1168
|
+
var styles$m = {"label":"FormLabel-module_label__qTUB9","radio-input-label":"FormLabel-module_radio-input-label__IpAiN","disabled":"FormLabel-module_disabled__83oiH"};
|
|
1169
|
+
|
|
1170
|
+
var styles$l = {"help-text":"HelpText-module_help-text__8WodW"};
|
|
1171
|
+
|
|
1172
|
+
var HelpText = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1173
|
+
var children = _ref.children,
|
|
1174
|
+
className = _ref.className;
|
|
1175
|
+
return React.createElement(Box, {
|
|
1176
|
+
ref: ref,
|
|
1177
|
+
className: classNames('hyphen-components__variables__form-control', styles$l['help-text'], className),
|
|
1178
|
+
display: "block",
|
|
1179
|
+
color: "secondary",
|
|
1180
|
+
fontSize: "sm"
|
|
1181
|
+
}, children);
|
|
1182
|
+
});
|
|
1169
1183
|
|
|
1170
1184
|
var _excluded$w = ["children", "inputId", "className", "display", "helpText", "isDisabled", "isFieldRequired", "isRadioInputLabel", "requiredIndicator", "margin", "padding"];
|
|
1171
1185
|
var FormLabel = function FormLabel(_ref) {
|
|
@@ -1199,13 +1213,7 @@ var FormLabel = function FormLabel(_ref) {
|
|
|
1199
1213
|
margin: margin,
|
|
1200
1214
|
padding: padding,
|
|
1201
1215
|
htmlFor: inputId
|
|
1202
|
-
}, restProps), children, isFieldRequired && requiredIndicator && React.createElement("span", null, requiredIndicator), helpText && React.createElement(
|
|
1203
|
-
as: "p",
|
|
1204
|
-
display: "block",
|
|
1205
|
-
fontSize: "sm",
|
|
1206
|
-
color: "secondary",
|
|
1207
|
-
className: styles$m['help-text']
|
|
1208
|
-
}, helpText));
|
|
1216
|
+
}, restProps), children, isFieldRequired && requiredIndicator && React.createElement("span", null, requiredIndicator), helpText && React.createElement(HelpText, null, helpText));
|
|
1209
1217
|
};
|
|
1210
1218
|
|
|
1211
1219
|
var _excluded$v = ["id", "isChecked", "label", "onChange", "className", "error", "hideLabel", "helpText", "isDisabled", "isIndeterminate", "isRequired", "onBlur", "onFocus", "requiredIndicator", "size"];
|
|
@@ -1295,7 +1303,7 @@ var CheckboxInput = function CheckboxInput(_ref2) {
|
|
|
1295
1303
|
})), label && !hideLabel && React.createElement(FormLabel, _extends({}, labelProps), label)), error && error !== true && React.createElement(InputValidationMessage, null, error));
|
|
1296
1304
|
};
|
|
1297
1305
|
|
|
1298
|
-
var styles$
|
|
1306
|
+
var styles$k = {};
|
|
1299
1307
|
|
|
1300
1308
|
var _excluded$u = ["children", "dayClassName", "maxDate", "minDate", "monthsShown", "openToDate", "startDate", "selected", "selectsRange", "showTwoColumnMonthYearPicker", "showFullMonthYearPicker", "showMonthYearPicker", "className", "formatWeekDay"];
|
|
1301
1309
|
var DatePicker = function DatePicker(_ref) {
|
|
@@ -1330,7 +1338,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
1330
1338
|
return formattedDate[0];
|
|
1331
1339
|
} : _ref$formatWeekDay,
|
|
1332
1340
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
1333
|
-
var datePickerClasses = classNames(styles$
|
|
1341
|
+
var datePickerClasses = classNames(styles$k['react-datepicker'], className);
|
|
1334
1342
|
return React.createElement(ReactDatePicker, _extends({
|
|
1335
1343
|
inline: true,
|
|
1336
1344
|
calendarClassName: datePickerClasses,
|
|
@@ -1388,7 +1396,7 @@ function getAutoCompleteValue(value) {
|
|
|
1388
1396
|
return value;
|
|
1389
1397
|
}
|
|
1390
1398
|
|
|
1391
|
-
var styles$
|
|
1399
|
+
var styles$j = {"text-input-wrapper":"TextInput-module_text-input-wrapper__HCnQD","size-sm":"TextInput-module_size-sm__qWJn7","prefix":"TextInput-module_prefix__-wFO9","suffix":"TextInput-module_suffix__327yL","clear-button":"TextInput-module_clear-button__LUJpO","is-clearable":"TextInput-module_is-clearable__ExAY3","size-md":"TextInput-module_size-md__UFPtt","size-lg":"TextInput-module_size-lg__Hjfez","disabled":"TextInput-module_disabled__lrifj","size-sm-tablet":"TextInput-module_size-sm-tablet__neC5C","size-md-tablet":"TextInput-module_size-md-tablet__u29oc","size-lg-tablet":"TextInput-module_size-lg-tablet__3PUB3","size-sm-desktop":"TextInput-module_size-sm-desktop__kA12V","size-md-desktop":"TextInput-module_size-md-desktop__yLJGr","size-lg-desktop":"TextInput-module_size-lg-desktop__A1pcS","size-sm-hd":"TextInput-module_size-sm-hd__f7Thr","size-md-hd":"TextInput-module_size-md-hd__Tsnqc","size-lg-hd":"TextInput-module_size-lg-hd__XLMos","error":"TextInput-module_error__p6zZq","text-input-label":"TextInput-module_text-input-label__3PlSG"};
|
|
1392
1400
|
|
|
1393
1401
|
var _excluded$s = ["id", "label", "onChange", "value", "autoComplete", "autoFocus", "error", "helpText", "hideLabel", "inputProps", "isDisabled", "isRequired", "maxLength", "name", "onBlur", "onClear", "onFocus", "prefix", "placeholder", "requiredIndicator", "suffix", "size", "type"];
|
|
1394
1402
|
var TextInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -1436,10 +1444,10 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1436
1444
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1437
1445
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
1438
1446
|
var responsiveClasses = generateResponsiveClasses('size', size);
|
|
1439
|
-
var inputWrapperClasses = classNames.apply(void 0, ['hyphen-components__variables__form-control', styles$
|
|
1440
|
-
return styles$
|
|
1441
|
-
}), [(_ref2 = {}, _ref2[styles$
|
|
1442
|
-
var clearBtnClasses = classNames(styles$
|
|
1447
|
+
var inputWrapperClasses = classNames.apply(void 0, ['hyphen-components__variables__form-control', styles$j['text-input-wrapper']].concat(responsiveClasses.map(function (c) {
|
|
1448
|
+
return styles$j[c];
|
|
1449
|
+
}), [(_ref2 = {}, _ref2[styles$j.error] = error, _ref2[styles$j.disabled] = isDisabled, _ref2[styles$j['is-clearable']] = onClear, _ref2)]));
|
|
1450
|
+
var clearBtnClasses = classNames(styles$j['clear-button'], styles$j.md);
|
|
1443
1451
|
var renderClearIcon = function renderClearIcon() {
|
|
1444
1452
|
var handleKeyPress = function handleKeyPress(event) {
|
|
1445
1453
|
if (event.keyCode === 13 && onClear) onClear(event);
|
|
@@ -1498,17 +1506,17 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1498
1506
|
}, prefix && React.createElement(Box, {
|
|
1499
1507
|
color: "secondary",
|
|
1500
1508
|
background: "secondary",
|
|
1501
|
-
className: classNames(styles$
|
|
1509
|
+
className: classNames(styles$j.prefix, 'ws-nowrap')
|
|
1502
1510
|
}, prefix), React.createElement(Box, _extends({
|
|
1503
1511
|
as: "input"
|
|
1504
1512
|
}, computedInputProps)), !!onClear && !!value && renderClearIcon(), suffix && React.createElement(Box, {
|
|
1505
1513
|
color: "secondary",
|
|
1506
1514
|
background: "secondary",
|
|
1507
|
-
className: classNames(styles$
|
|
1515
|
+
className: classNames(styles$j.suffix, 'ws-nowrap')
|
|
1508
1516
|
}, suffix)));
|
|
1509
1517
|
});
|
|
1510
1518
|
|
|
1511
|
-
var styles$
|
|
1519
|
+
var styles$i = {"popover":"Popover-module_popover__rvS3X","fadeIn":"Popover-module_fadeIn__0btE5","popover-arrow":"Popover-module_popover-arrow__SLtPW"};
|
|
1512
1520
|
|
|
1513
1521
|
// eslint-disable-next-line import/prefer-default-export
|
|
1514
1522
|
var getColumnKeys = function getColumnKeys(columns) {
|
|
@@ -1666,14 +1674,14 @@ var Popover = function Popover(_ref) {
|
|
|
1666
1674
|
attributes = _usePopper.attributes;
|
|
1667
1675
|
var containerBoxProps = _extends({}, contentContainerDefaults, contentContainerProps);
|
|
1668
1676
|
var computedArrowColor = arrowColor || containerBoxProps.background;
|
|
1669
|
-
var arrowClasses = classNames(styles$
|
|
1677
|
+
var arrowClasses = classNames(styles$i['popover-arrow'], "background-color-" + computedArrowColor, {
|
|
1670
1678
|
'display-none': !hasArrow
|
|
1671
1679
|
});
|
|
1672
1680
|
var renderPopperContent = function renderPopperContent() {
|
|
1673
1681
|
var renderPopperBox = function renderPopperBox() {
|
|
1674
1682
|
return React.createElement(Box, _extends({
|
|
1675
1683
|
ref: popperRef,
|
|
1676
|
-
className: classNames(styles$
|
|
1684
|
+
className: classNames(styles$i.popover, className),
|
|
1677
1685
|
style: popperStyles.popper,
|
|
1678
1686
|
role: "dialog",
|
|
1679
1687
|
"aria-label": "Popover",
|
|
@@ -1858,7 +1866,7 @@ var DetailsSummary = function DetailsSummary(_ref) {
|
|
|
1858
1866
|
}), children);
|
|
1859
1867
|
};
|
|
1860
1868
|
|
|
1861
|
-
var styles$
|
|
1869
|
+
var styles$h = {"details-reset":"Details-module_details-reset__HWtSD"};
|
|
1862
1870
|
|
|
1863
1871
|
var _excluded$o = ["children", "className", "display", "isOpen"];
|
|
1864
1872
|
var DetailsBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -1868,7 +1876,7 @@ var DetailsBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1868
1876
|
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
1869
1877
|
isOpen = _ref.isOpen,
|
|
1870
1878
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
1871
|
-
var detailsClasses = classNames(className, styles$
|
|
1879
|
+
var detailsClasses = classNames(className, styles$h['details-reset'], styles$h.details);
|
|
1872
1880
|
return React.createElement(Box, _extends({
|
|
1873
1881
|
as: "details",
|
|
1874
1882
|
className: detailsClasses,
|
|
@@ -1885,7 +1893,7 @@ var Details = /*#__PURE__*/function () {
|
|
|
1885
1893
|
return Details;
|
|
1886
1894
|
}();
|
|
1887
1895
|
|
|
1888
|
-
var styles$
|
|
1896
|
+
var styles$g = {"drawer":"Drawer-module_drawer__IKoOm","hide-overlay-right":"Drawer-module_hide-overlay-right__FANA9","hide-overlay-left":"Drawer-module_hide-overlay-left__xZFa3","hide-overlay-bottom":"Drawer-module_hide-overlay-bottom__11EB1","hide-overlay-top":"Drawer-module_hide-overlay-top__kEsV5","drawer-content":"Drawer-module_drawer-content__zZ9xR","left":"Drawer-module_left__pwTcW","right":"Drawer-module_right__EzGpI","bottom":"Drawer-module_bottom__r3Q5Z","top":"Drawer-module_top__xQejO"};
|
|
1889
1897
|
|
|
1890
1898
|
var Drawer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1891
1899
|
var _dynamicStyle, _classNames, _classNames2;
|
|
@@ -1931,8 +1939,8 @@ var Drawer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1931
1939
|
}, [initialFocusRef]);
|
|
1932
1940
|
var dynamicWidth = width;
|
|
1933
1941
|
var dynamicStyle = (_dynamicStyle = {}, _dynamicStyle['--w'] = dynamicWidth, _dynamicStyle);
|
|
1934
|
-
var overlayClassnames = classNames(styles$
|
|
1935
|
-
var contentClassnames = classNames(styles$
|
|
1942
|
+
var overlayClassnames = classNames(styles$g.overlay, styles$g.drawer, (_classNames = {}, _classNames[styles$g['hide-overlay']] = hideOverlay, _classNames[styles$g["hide-overlay-" + placement]] = hideOverlay, _classNames['position-fixed'] = containerRef === undefined, _classNames['position-absolute'] = containerRef !== undefined, _classNames));
|
|
1943
|
+
var contentClassnames = classNames(styles$g['drawer-content'], styles$g[placement], (_classNames2 = {}, _classNames2[styles$g['hide-overlay']] = hideOverlay, _classNames2['overflow-auto'] = !closeButton && !title, _classNames2.className = className, _classNames2));
|
|
1936
1944
|
var renderHeader = function renderHeader() {
|
|
1937
1945
|
if (closeButton && onDismiss && !title) {
|
|
1938
1946
|
return React.createElement(Box, {
|
|
@@ -1954,7 +1962,7 @@ var Drawer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1954
1962
|
alignItems: "center",
|
|
1955
1963
|
padding: "2xl"
|
|
1956
1964
|
}, React.createElement(Box, {
|
|
1957
|
-
className: styles$
|
|
1965
|
+
className: styles$g.title,
|
|
1958
1966
|
fontWeight: "bold"
|
|
1959
1967
|
}, title), onDismiss && React.createElement(Button, {
|
|
1960
1968
|
variant: "tertiary",
|
|
@@ -2058,7 +2066,7 @@ var RadioInputIcon = function RadioInputIcon(_ref) {
|
|
|
2058
2066
|
}));
|
|
2059
2067
|
};
|
|
2060
2068
|
|
|
2061
|
-
var styles$
|
|
2069
|
+
var styles$f = {"size-sm":"RadioInput-module_size-sm__6DLmn","size-md":"RadioInput-module_size-md__wiJ4R","size-lg":"RadioInput-module_size-lg__pX8S8","radio-container":"RadioInput-module_radio-container__EBRgV","hidden":"RadioInput-module_hidden__KF4as","size-sm-tablet":"RadioInput-module_size-sm-tablet__x7edi","size-md-tablet":"RadioInput-module_size-md-tablet__T-HTa","size-lg-tablet":"RadioInput-module_size-lg-tablet__0Hkim","size-sm-desktop":"RadioInput-module_size-sm-desktop__HjeWG","size-md-desktop":"RadioInput-module_size-md-desktop__3Y1fn","size-lg-desktop":"RadioInput-module_size-lg-desktop__z3nKW","size-sm-hd":"RadioInput-module_size-sm-hd__oxAR7","size-md-hd":"RadioInput-module_size-md-hd__ws7ro","size-lg-hd":"RadioInput-module_size-lg-hd__87uii"};
|
|
2062
2070
|
|
|
2063
2071
|
var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
2064
2072
|
var _classNames;
|
|
@@ -2082,7 +2090,7 @@ var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2082
2090
|
_ref$size = _ref.size,
|
|
2083
2091
|
size = _ref$size === void 0 ? 'md' : _ref$size;
|
|
2084
2092
|
var responsiveClasses = classNames.apply(void 0, generateResponsiveClasses('size', size).map(function (c) {
|
|
2085
|
-
return styles$
|
|
2093
|
+
return styles$f[c];
|
|
2086
2094
|
}));
|
|
2087
2095
|
var labelProps = {
|
|
2088
2096
|
inputId: option.id,
|
|
@@ -2091,7 +2099,7 @@ var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2091
2099
|
isRadioInputLabel: true,
|
|
2092
2100
|
justifyContent: 'center'
|
|
2093
2101
|
};
|
|
2094
|
-
var containerClasses = classNames('hyphen-components__variables__form-control', className, styles$
|
|
2102
|
+
var containerClasses = classNames('hyphen-components__variables__form-control', className, styles$f['radio-container'], responsiveClasses, (_classNames = {}, _classNames[styles$f.hidden] = isHidden, _classNames));
|
|
2095
2103
|
return React.createElement(React.Fragment, null, option && React.createElement(Box, {
|
|
2096
2104
|
className: containerClasses,
|
|
2097
2105
|
key: option.id,
|
|
@@ -2127,7 +2135,7 @@ var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2127
2135
|
}), option.label && React.createElement(FormLabel, _extends({}, labelProps), option.label)));
|
|
2128
2136
|
});
|
|
2129
2137
|
|
|
2130
|
-
var styles$
|
|
2138
|
+
var styles$e = {"radio-group":"RadioGroup-module_radio-group__FWPcT","fieldset":"RadioGroup-module_fieldset__PEUXI","legend":"RadioGroup-module_legend__tcfV7","description":"RadioGroup-module_description__8fzM-"};
|
|
2131
2139
|
|
|
2132
2140
|
var _excluded$l = ["name", "onChange", "options", "className", "description", "direction", "error", "isDisabled", "isRequired", "onBlur", "onFocus", "requiredIndicator", "size", "title", "value"];
|
|
2133
2141
|
var RadioGroup = function RadioGroup(_ref) {
|
|
@@ -2160,19 +2168,19 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
2160
2168
|
_ref$value = _ref.value,
|
|
2161
2169
|
value = _ref$value === void 0 ? undefined : _ref$value,
|
|
2162
2170
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
2163
|
-
var groupClasses = classNames('hyphen-components__variables__form-control', className, (_classNames = {}, _classNames[styles$
|
|
2171
|
+
var groupClasses = classNames('hyphen-components__variables__form-control', className, (_classNames = {}, _classNames[styles$e.loading] = error, _classNames));
|
|
2164
2172
|
return React.createElement("div", _extends({
|
|
2165
|
-
className: classNames(styles$
|
|
2173
|
+
className: classNames(styles$e['radio-group'], groupClasses)
|
|
2166
2174
|
}, restProps), React.createElement("fieldset", {
|
|
2167
|
-
className: styles$
|
|
2175
|
+
className: styles$e.fieldset
|
|
2168
2176
|
}, (title || description) && React.createElement("legend", {
|
|
2169
|
-
className: styles$
|
|
2177
|
+
className: styles$e.legend
|
|
2170
2178
|
}, title, isRequired && React.createElement("span", null, requiredIndicator), description && React.createElement("div", {
|
|
2171
|
-
className: styles$
|
|
2179
|
+
className: styles$e.description
|
|
2172
2180
|
}, description)), React.createElement(Box, {
|
|
2173
2181
|
direction: direction,
|
|
2174
2182
|
gap: "sm",
|
|
2175
|
-
className: styles$
|
|
2183
|
+
className: styles$e.options
|
|
2176
2184
|
}, options && options.map(function (option) {
|
|
2177
2185
|
return React.createElement(RadioInput, {
|
|
2178
2186
|
key: option.id,
|
|
@@ -2212,7 +2220,7 @@ var FormikRadioGroup = function FormikRadioGroup(_ref) {
|
|
|
2212
2220
|
}));
|
|
2213
2221
|
};
|
|
2214
2222
|
|
|
2215
|
-
var styles$
|
|
2223
|
+
var styles$d = {"react-select-icon":"SelectInput-module_react-select-icon__PvocB","size-sm":"SelectInput-module_size-sm__PKB-J","size-md":"SelectInput-module_size-md__n9Fj8","size-lg":"SelectInput-module_size-lg__LQ-uG","error":"SelectInput-module_error__Avf98","size-sm-tablet":"SelectInput-module_size-sm-tablet__2Dg01","size-md-tablet":"SelectInput-module_size-md-tablet__-iOSg","size-lg-tablet":"SelectInput-module_size-lg-tablet__9xmuJ","size-sm-desktop":"SelectInput-module_size-sm-desktop__tOWI4","size-md-desktop":"SelectInput-module_size-md-desktop__vo-UC","size-lg-desktop":"SelectInput-module_size-lg-desktop__nxQdj","size-sm-hd":"SelectInput-module_size-sm-hd__qamTH","size-md-hd":"SelectInput-module_size-md-hd__Cf8hk","size-lg-hd":"SelectInput-module_size-lg-hd__E4-mZ","disabled":"SelectInput-module_disabled__4ezAy","select-input-label":"SelectInput-module_select-input-label__eqEYa"};
|
|
2216
2224
|
|
|
2217
2225
|
var _excluded$j = ["id", "label", "onChange", "options", "value", "autoFocus", "className", "error", "helpText", "hideLabel", "isClearable", "isDisabled", "isMulti", "isRequired", "menuPortalTarget", "name", "onFocus", "onBlur", "placeholder", "requiredIndicator", "size"];
|
|
2218
2226
|
var SelectInput = function SelectInput(_ref) {
|
|
@@ -2271,13 +2279,13 @@ var SelectInput = function SelectInput(_ref) {
|
|
|
2271
2279
|
};
|
|
2272
2280
|
var responsiveClasses = generateResponsiveClasses('size', size);
|
|
2273
2281
|
var wrapperClasses = classNames.apply(void 0, ['hyphen-components__variables__form-control', 'select-input-wrapper', className].concat(responsiveClasses.map(function (c) {
|
|
2274
|
-
return styles$
|
|
2275
|
-
}), [(_ref2 = {}, _ref2[styles$
|
|
2276
|
-
var inputClasses = classNames('react-select', (_classNames = {}, _classNames[styles$
|
|
2282
|
+
return styles$d[c];
|
|
2283
|
+
}), [(_ref2 = {}, _ref2[styles$d.disabled] = isDisabled, _ref2)]));
|
|
2284
|
+
var inputClasses = classNames('react-select', (_classNames = {}, _classNames[styles$d.error] = error, _classNames));
|
|
2277
2285
|
var labelProps = {
|
|
2278
2286
|
inputId: id,
|
|
2279
2287
|
helpText: helpText,
|
|
2280
|
-
className: styles$
|
|
2288
|
+
className: styles$d['select-input-label'],
|
|
2281
2289
|
isDisabled: isDisabled,
|
|
2282
2290
|
isFieldRequired: isRequired,
|
|
2283
2291
|
requiredIndicator: requiredIndicator
|
|
@@ -2348,20 +2356,6 @@ var FormikSelectInput = function FormikSelectInput(_ref) {
|
|
|
2348
2356
|
}));
|
|
2349
2357
|
};
|
|
2350
2358
|
|
|
2351
|
-
var styles$d = {"help-text":"HelpText-module_help-text__8WodW"};
|
|
2352
|
-
|
|
2353
|
-
var HelpText = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
2354
|
-
var children = _ref.children,
|
|
2355
|
-
className = _ref.className;
|
|
2356
|
-
return React.createElement(Box, {
|
|
2357
|
-
ref: ref,
|
|
2358
|
-
className: classNames('hyphen-components__variables__form-control', styles$d['help-text'], className),
|
|
2359
|
-
display: "block",
|
|
2360
|
-
color: "secondary",
|
|
2361
|
-
fontSize: "sm"
|
|
2362
|
-
}, children);
|
|
2363
|
-
});
|
|
2364
|
-
|
|
2365
2359
|
var styles$c = {"text-input-wrapper":"SelectInputInset-module_text-input-wrapper__hZ4Fy","size-md":"SelectInputInset-module_size-md__6MFcV","select-input-label":"SelectInputInset-module_select-input-label__6XdR6","clear-button":"SelectInputInset-module_clear-button__xbZaY","size-lg":"SelectInputInset-module_size-lg__i2Bzf","disabled":"SelectInputInset-module_disabled__DYSr2","size-md-tablet":"SelectInputInset-module_size-md-tablet__xwoPz","size-lg-tablet":"SelectInputInset-module_size-lg-tablet__2DgFa","size-md-desktop":"SelectInputInset-module_size-md-desktop__MfemS","size-lg-desktop":"SelectInputInset-module_size-lg-desktop__etLGJ","size-md-hd":"SelectInputInset-module_size-md-hd__NWb1q","size-lg-hd":"SelectInputInset-module_size-lg-hd__ycjXC","error":"SelectInputInset-module_error__j-jgS"};
|
|
2366
2360
|
|
|
2367
2361
|
var SelectInputInset = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -4006,22 +4000,19 @@ function ThemeProvider(_ref) {
|
|
|
4006
4000
|
}
|
|
4007
4001
|
root.classList.add(theme);
|
|
4008
4002
|
}, [theme]);
|
|
4003
|
+
var isDarkMode = theme === 'dark' || theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
4009
4004
|
var value = {
|
|
4010
4005
|
theme: theme,
|
|
4011
4006
|
setTheme: function setTheme(theme) {
|
|
4012
4007
|
localStorage.setItem(storageKey, theme);
|
|
4013
4008
|
_setTheme(theme);
|
|
4014
|
-
}
|
|
4009
|
+
},
|
|
4010
|
+
isDarkMode: isDarkMode
|
|
4015
4011
|
};
|
|
4016
4012
|
return React.createElement(ThemeProviderContext.Provider, _extends({}, props, {
|
|
4017
4013
|
value: value
|
|
4018
4014
|
}), children);
|
|
4019
4015
|
}
|
|
4020
|
-
var useTheme = function useTheme() {
|
|
4021
|
-
var context = React.useContext(ThemeProviderContext);
|
|
4022
|
-
if (context === undefined) throw new Error('useTheme must be used within a ThemeProvider. Be sure your App is wrapped in ThemeProvider.');
|
|
4023
|
-
return context;
|
|
4024
|
-
};
|
|
4025
4016
|
|
|
4026
4017
|
var styles = {"toast-notification":"ToastNotification-module_toast-notification__2xiTW","toast-error":"ToastNotification-module_toast-error__4ArAY","toast-dismiss":"ToastNotification-module_toast-dismiss__xxmkb","toast-notification-enter-top":"ToastNotification-module_toast-notification-enter-top__ZZDCr","toast-notification-exit-top":"ToastNotification-module_toast-notification-exit-top__fOIkZ","toast-notification-enter-bottom":"ToastNotification-module_toast-notification-enter-bottom__So3w7","toast-notification-exit-bottom":"ToastNotification-module_toast-notification-exit-bottom__DDthi","toast-notification-exit-left":"ToastNotification-module_toast-notification-exit-left__Fh1hC","toast-notification-exit-right":"ToastNotification-module_toast-notification-exit-right__C1jQ9","toast-notification-fade-in":"ToastNotification-module_toast-notification-fade-in__JlSGi","toast-notification-fade-out":"ToastNotification-module_toast-notification-fade-out__r6q4Q"};
|
|
4027
4018
|
|
|
@@ -4661,6 +4652,12 @@ var useOpenClose = function useOpenClose(props) {
|
|
|
4661
4652
|
};
|
|
4662
4653
|
};
|
|
4663
4654
|
|
|
4655
|
+
var useTheme = function useTheme() {
|
|
4656
|
+
var context = React.useContext(ThemeProviderContext);
|
|
4657
|
+
if (context === undefined) throw new Error('useTheme must be used within a ThemeProvider. Be sure your App is wrapped in ThemeProvider.');
|
|
4658
|
+
return context;
|
|
4659
|
+
};
|
|
4660
|
+
|
|
4664
4661
|
exports.Alert = Alert;
|
|
4665
4662
|
exports.Badge = Badge;
|
|
4666
4663
|
exports.Box = Box;
|
|
@@ -4708,6 +4705,7 @@ exports.TextInputInset = TextInputInset;
|
|
|
4708
4705
|
exports.TextareaInput = TextareaInput;
|
|
4709
4706
|
exports.TextareaInputInset = TextareaInputInset;
|
|
4710
4707
|
exports.ThemeProvider = ThemeProvider;
|
|
4708
|
+
exports.ThemeProviderContext = ThemeProviderContext;
|
|
4711
4709
|
exports.TimePicker = TimePicker;
|
|
4712
4710
|
exports.TimePickerNative = TimePickerNative;
|
|
4713
4711
|
exports.ToastContainer = ToastContainer;
|