@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import React, { forwardRef, Children, createElement, cloneElement, useRef, useState, useEffect, isValidElement, useCallback, useMemo, useLayoutEffect, createContext
|
|
2
|
+
import React, { forwardRef, Children, createElement, cloneElement, useRef, useState, useEffect, isValidElement, useCallback, useMemo, useLayoutEffect, createContext } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import icons from '@hyphen/hyphen-design-tokens/build/assets/icons/react';
|
|
5
5
|
import format from 'date-fns/format';
|
|
@@ -1155,13 +1155,27 @@ var InputValidationMessage = function InputValidationMessage(_ref) {
|
|
|
1155
1155
|
var children = _ref.children,
|
|
1156
1156
|
_ref$size = _ref.size,
|
|
1157
1157
|
size = _ref$size === void 0 ? 'sm' : _ref$size;
|
|
1158
|
-
var classes = classNames('hyphen-components__variables__form-control', styles$n['input-validation-message'], 'font-color-danger', "font-size-" + size, 'm-top-
|
|
1158
|
+
var classes = classNames('hyphen-components__variables__form-control', styles$n['input-validation-message'], 'font-color-danger', "font-size-" + size, 'm-top-sm');
|
|
1159
1159
|
return React.createElement("div", {
|
|
1160
1160
|
className: classes
|
|
1161
1161
|
}, children);
|
|
1162
1162
|
};
|
|
1163
1163
|
|
|
1164
|
-
var styles$m = {"label":"FormLabel-module_label__qTUB9","radio-input-label":"FormLabel-module_radio-input-label__IpAiN","disabled":"FormLabel-module_disabled__83oiH"
|
|
1164
|
+
var styles$m = {"label":"FormLabel-module_label__qTUB9","radio-input-label":"FormLabel-module_radio-input-label__IpAiN","disabled":"FormLabel-module_disabled__83oiH"};
|
|
1165
|
+
|
|
1166
|
+
var styles$l = {"help-text":"HelpText-module_help-text__8WodW"};
|
|
1167
|
+
|
|
1168
|
+
var HelpText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1169
|
+
var children = _ref.children,
|
|
1170
|
+
className = _ref.className;
|
|
1171
|
+
return React.createElement(Box, {
|
|
1172
|
+
ref: ref,
|
|
1173
|
+
className: classNames('hyphen-components__variables__form-control', styles$l['help-text'], className),
|
|
1174
|
+
display: "block",
|
|
1175
|
+
color: "secondary",
|
|
1176
|
+
fontSize: "sm"
|
|
1177
|
+
}, children);
|
|
1178
|
+
});
|
|
1165
1179
|
|
|
1166
1180
|
var _excluded$w = ["children", "inputId", "className", "display", "helpText", "isDisabled", "isFieldRequired", "isRadioInputLabel", "requiredIndicator", "margin", "padding"];
|
|
1167
1181
|
var FormLabel = function FormLabel(_ref) {
|
|
@@ -1195,13 +1209,7 @@ var FormLabel = function FormLabel(_ref) {
|
|
|
1195
1209
|
margin: margin,
|
|
1196
1210
|
padding: padding,
|
|
1197
1211
|
htmlFor: inputId
|
|
1198
|
-
}, restProps), children, isFieldRequired && requiredIndicator && React.createElement("span", null, requiredIndicator), helpText && React.createElement(
|
|
1199
|
-
as: "p",
|
|
1200
|
-
display: "block",
|
|
1201
|
-
fontSize: "sm",
|
|
1202
|
-
color: "secondary",
|
|
1203
|
-
className: styles$m['help-text']
|
|
1204
|
-
}, helpText));
|
|
1212
|
+
}, restProps), children, isFieldRequired && requiredIndicator && React.createElement("span", null, requiredIndicator), helpText && React.createElement(HelpText, null, helpText));
|
|
1205
1213
|
};
|
|
1206
1214
|
|
|
1207
1215
|
var _excluded$v = ["id", "isChecked", "label", "onChange", "className", "error", "hideLabel", "helpText", "isDisabled", "isIndeterminate", "isRequired", "onBlur", "onFocus", "requiredIndicator", "size"];
|
|
@@ -1291,7 +1299,7 @@ var CheckboxInput = function CheckboxInput(_ref2) {
|
|
|
1291
1299
|
})), label && !hideLabel && React.createElement(FormLabel, _extends({}, labelProps), label)), error && error !== true && React.createElement(InputValidationMessage, null, error));
|
|
1292
1300
|
};
|
|
1293
1301
|
|
|
1294
|
-
var styles$
|
|
1302
|
+
var styles$k = {};
|
|
1295
1303
|
|
|
1296
1304
|
var _excluded$u = ["children", "dayClassName", "maxDate", "minDate", "monthsShown", "openToDate", "startDate", "selected", "selectsRange", "showTwoColumnMonthYearPicker", "showFullMonthYearPicker", "showMonthYearPicker", "className", "formatWeekDay"];
|
|
1297
1305
|
var DatePicker = function DatePicker(_ref) {
|
|
@@ -1326,7 +1334,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
1326
1334
|
return formattedDate[0];
|
|
1327
1335
|
} : _ref$formatWeekDay,
|
|
1328
1336
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
1329
|
-
var datePickerClasses = classNames(styles$
|
|
1337
|
+
var datePickerClasses = classNames(styles$k['react-datepicker'], className);
|
|
1330
1338
|
return React.createElement(ReactDatePicker, _extends({
|
|
1331
1339
|
inline: true,
|
|
1332
1340
|
calendarClassName: datePickerClasses,
|
|
@@ -1384,7 +1392,7 @@ function getAutoCompleteValue(value) {
|
|
|
1384
1392
|
return value;
|
|
1385
1393
|
}
|
|
1386
1394
|
|
|
1387
|
-
var styles$
|
|
1395
|
+
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"};
|
|
1388
1396
|
|
|
1389
1397
|
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"];
|
|
1390
1398
|
var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -1432,10 +1440,10 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1432
1440
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1433
1441
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
1434
1442
|
var responsiveClasses = generateResponsiveClasses('size', size);
|
|
1435
|
-
var inputWrapperClasses = classNames.apply(void 0, ['hyphen-components__variables__form-control', styles$
|
|
1436
|
-
return styles$
|
|
1437
|
-
}), [(_ref2 = {}, _ref2[styles$
|
|
1438
|
-
var clearBtnClasses = classNames(styles$
|
|
1443
|
+
var inputWrapperClasses = classNames.apply(void 0, ['hyphen-components__variables__form-control', styles$j['text-input-wrapper']].concat(responsiveClasses.map(function (c) {
|
|
1444
|
+
return styles$j[c];
|
|
1445
|
+
}), [(_ref2 = {}, _ref2[styles$j.error] = error, _ref2[styles$j.disabled] = isDisabled, _ref2[styles$j['is-clearable']] = onClear, _ref2)]));
|
|
1446
|
+
var clearBtnClasses = classNames(styles$j['clear-button'], styles$j.md);
|
|
1439
1447
|
var renderClearIcon = function renderClearIcon() {
|
|
1440
1448
|
var handleKeyPress = function handleKeyPress(event) {
|
|
1441
1449
|
if (event.keyCode === 13 && onClear) onClear(event);
|
|
@@ -1494,17 +1502,17 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1494
1502
|
}, prefix && React.createElement(Box, {
|
|
1495
1503
|
color: "secondary",
|
|
1496
1504
|
background: "secondary",
|
|
1497
|
-
className: classNames(styles$
|
|
1505
|
+
className: classNames(styles$j.prefix, 'ws-nowrap')
|
|
1498
1506
|
}, prefix), React.createElement(Box, _extends({
|
|
1499
1507
|
as: "input"
|
|
1500
1508
|
}, computedInputProps)), !!onClear && !!value && renderClearIcon(), suffix && React.createElement(Box, {
|
|
1501
1509
|
color: "secondary",
|
|
1502
1510
|
background: "secondary",
|
|
1503
|
-
className: classNames(styles$
|
|
1511
|
+
className: classNames(styles$j.suffix, 'ws-nowrap')
|
|
1504
1512
|
}, suffix)));
|
|
1505
1513
|
});
|
|
1506
1514
|
|
|
1507
|
-
var styles$
|
|
1515
|
+
var styles$i = {"popover":"Popover-module_popover__rvS3X","fadeIn":"Popover-module_fadeIn__0btE5","popover-arrow":"Popover-module_popover-arrow__SLtPW"};
|
|
1508
1516
|
|
|
1509
1517
|
// eslint-disable-next-line import/prefer-default-export
|
|
1510
1518
|
var getColumnKeys = function getColumnKeys(columns) {
|
|
@@ -1662,14 +1670,14 @@ var Popover = function Popover(_ref) {
|
|
|
1662
1670
|
attributes = _usePopper.attributes;
|
|
1663
1671
|
var containerBoxProps = _extends({}, contentContainerDefaults, contentContainerProps);
|
|
1664
1672
|
var computedArrowColor = arrowColor || containerBoxProps.background;
|
|
1665
|
-
var arrowClasses = classNames(styles$
|
|
1673
|
+
var arrowClasses = classNames(styles$i['popover-arrow'], "background-color-" + computedArrowColor, {
|
|
1666
1674
|
'display-none': !hasArrow
|
|
1667
1675
|
});
|
|
1668
1676
|
var renderPopperContent = function renderPopperContent() {
|
|
1669
1677
|
var renderPopperBox = function renderPopperBox() {
|
|
1670
1678
|
return React.createElement(Box, _extends({
|
|
1671
1679
|
ref: popperRef,
|
|
1672
|
-
className: classNames(styles$
|
|
1680
|
+
className: classNames(styles$i.popover, className),
|
|
1673
1681
|
style: popperStyles.popper,
|
|
1674
1682
|
role: "dialog",
|
|
1675
1683
|
"aria-label": "Popover",
|
|
@@ -1854,7 +1862,7 @@ var DetailsSummary = function DetailsSummary(_ref) {
|
|
|
1854
1862
|
}), children);
|
|
1855
1863
|
};
|
|
1856
1864
|
|
|
1857
|
-
var styles$
|
|
1865
|
+
var styles$h = {"details-reset":"Details-module_details-reset__HWtSD"};
|
|
1858
1866
|
|
|
1859
1867
|
var _excluded$o = ["children", "className", "display", "isOpen"];
|
|
1860
1868
|
var DetailsBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -1864,7 +1872,7 @@ var DetailsBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1864
1872
|
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
1865
1873
|
isOpen = _ref.isOpen,
|
|
1866
1874
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
1867
|
-
var detailsClasses = classNames(className, styles$
|
|
1875
|
+
var detailsClasses = classNames(className, styles$h['details-reset'], styles$h.details);
|
|
1868
1876
|
return React.createElement(Box, _extends({
|
|
1869
1877
|
as: "details",
|
|
1870
1878
|
className: detailsClasses,
|
|
@@ -1881,7 +1889,7 @@ var Details = /*#__PURE__*/function () {
|
|
|
1881
1889
|
return Details;
|
|
1882
1890
|
}();
|
|
1883
1891
|
|
|
1884
|
-
var styles$
|
|
1892
|
+
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"};
|
|
1885
1893
|
|
|
1886
1894
|
var Drawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1887
1895
|
var _dynamicStyle, _classNames, _classNames2;
|
|
@@ -1927,8 +1935,8 @@ var Drawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1927
1935
|
}, [initialFocusRef]);
|
|
1928
1936
|
var dynamicWidth = width;
|
|
1929
1937
|
var dynamicStyle = (_dynamicStyle = {}, _dynamicStyle['--w'] = dynamicWidth, _dynamicStyle);
|
|
1930
|
-
var overlayClassnames = classNames(styles$
|
|
1931
|
-
var contentClassnames = classNames(styles$
|
|
1938
|
+
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));
|
|
1939
|
+
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));
|
|
1932
1940
|
var renderHeader = function renderHeader() {
|
|
1933
1941
|
if (closeButton && onDismiss && !title) {
|
|
1934
1942
|
return React.createElement(Box, {
|
|
@@ -1950,7 +1958,7 @@ var Drawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1950
1958
|
alignItems: "center",
|
|
1951
1959
|
padding: "2xl"
|
|
1952
1960
|
}, React.createElement(Box, {
|
|
1953
|
-
className: styles$
|
|
1961
|
+
className: styles$g.title,
|
|
1954
1962
|
fontWeight: "bold"
|
|
1955
1963
|
}, title), onDismiss && React.createElement(Button, {
|
|
1956
1964
|
variant: "tertiary",
|
|
@@ -2054,7 +2062,7 @@ var RadioInputIcon = function RadioInputIcon(_ref) {
|
|
|
2054
2062
|
}));
|
|
2055
2063
|
};
|
|
2056
2064
|
|
|
2057
|
-
var styles$
|
|
2065
|
+
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"};
|
|
2058
2066
|
|
|
2059
2067
|
var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
2060
2068
|
var _classNames;
|
|
@@ -2078,7 +2086,7 @@ var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2078
2086
|
_ref$size = _ref.size,
|
|
2079
2087
|
size = _ref$size === void 0 ? 'md' : _ref$size;
|
|
2080
2088
|
var responsiveClasses = classNames.apply(void 0, generateResponsiveClasses('size', size).map(function (c) {
|
|
2081
|
-
return styles$
|
|
2089
|
+
return styles$f[c];
|
|
2082
2090
|
}));
|
|
2083
2091
|
var labelProps = {
|
|
2084
2092
|
inputId: option.id,
|
|
@@ -2087,7 +2095,7 @@ var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2087
2095
|
isRadioInputLabel: true,
|
|
2088
2096
|
justifyContent: 'center'
|
|
2089
2097
|
};
|
|
2090
|
-
var containerClasses = classNames('hyphen-components__variables__form-control', className, styles$
|
|
2098
|
+
var containerClasses = classNames('hyphen-components__variables__form-control', className, styles$f['radio-container'], responsiveClasses, (_classNames = {}, _classNames[styles$f.hidden] = isHidden, _classNames));
|
|
2091
2099
|
return React.createElement(React.Fragment, null, option && React.createElement(Box, {
|
|
2092
2100
|
className: containerClasses,
|
|
2093
2101
|
key: option.id,
|
|
@@ -2123,7 +2131,7 @@ var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2123
2131
|
}), option.label && React.createElement(FormLabel, _extends({}, labelProps), option.label)));
|
|
2124
2132
|
});
|
|
2125
2133
|
|
|
2126
|
-
var styles$
|
|
2134
|
+
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-"};
|
|
2127
2135
|
|
|
2128
2136
|
var _excluded$l = ["name", "onChange", "options", "className", "description", "direction", "error", "isDisabled", "isRequired", "onBlur", "onFocus", "requiredIndicator", "size", "title", "value"];
|
|
2129
2137
|
var RadioGroup = function RadioGroup(_ref) {
|
|
@@ -2156,19 +2164,19 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
2156
2164
|
_ref$value = _ref.value,
|
|
2157
2165
|
value = _ref$value === void 0 ? undefined : _ref$value,
|
|
2158
2166
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
2159
|
-
var groupClasses = classNames('hyphen-components__variables__form-control', className, (_classNames = {}, _classNames[styles$
|
|
2167
|
+
var groupClasses = classNames('hyphen-components__variables__form-control', className, (_classNames = {}, _classNames[styles$e.loading] = error, _classNames));
|
|
2160
2168
|
return React.createElement("div", _extends({
|
|
2161
|
-
className: classNames(styles$
|
|
2169
|
+
className: classNames(styles$e['radio-group'], groupClasses)
|
|
2162
2170
|
}, restProps), React.createElement("fieldset", {
|
|
2163
|
-
className: styles$
|
|
2171
|
+
className: styles$e.fieldset
|
|
2164
2172
|
}, (title || description) && React.createElement("legend", {
|
|
2165
|
-
className: styles$
|
|
2173
|
+
className: styles$e.legend
|
|
2166
2174
|
}, title, isRequired && React.createElement("span", null, requiredIndicator), description && React.createElement("div", {
|
|
2167
|
-
className: styles$
|
|
2175
|
+
className: styles$e.description
|
|
2168
2176
|
}, description)), React.createElement(Box, {
|
|
2169
2177
|
direction: direction,
|
|
2170
2178
|
gap: "sm",
|
|
2171
|
-
className: styles$
|
|
2179
|
+
className: styles$e.options
|
|
2172
2180
|
}, options && options.map(function (option) {
|
|
2173
2181
|
return React.createElement(RadioInput, {
|
|
2174
2182
|
key: option.id,
|
|
@@ -2208,7 +2216,7 @@ var FormikRadioGroup = function FormikRadioGroup(_ref) {
|
|
|
2208
2216
|
}));
|
|
2209
2217
|
};
|
|
2210
2218
|
|
|
2211
|
-
var styles$
|
|
2219
|
+
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"};
|
|
2212
2220
|
|
|
2213
2221
|
var _excluded$j = ["id", "label", "onChange", "options", "value", "autoFocus", "className", "error", "helpText", "hideLabel", "isClearable", "isDisabled", "isMulti", "isRequired", "menuPortalTarget", "name", "onFocus", "onBlur", "placeholder", "requiredIndicator", "size"];
|
|
2214
2222
|
var SelectInput = function SelectInput(_ref) {
|
|
@@ -2267,13 +2275,13 @@ var SelectInput = function SelectInput(_ref) {
|
|
|
2267
2275
|
};
|
|
2268
2276
|
var responsiveClasses = generateResponsiveClasses('size', size);
|
|
2269
2277
|
var wrapperClasses = classNames.apply(void 0, ['hyphen-components__variables__form-control', 'select-input-wrapper', className].concat(responsiveClasses.map(function (c) {
|
|
2270
|
-
return styles$
|
|
2271
|
-
}), [(_ref2 = {}, _ref2[styles$
|
|
2272
|
-
var inputClasses = classNames('react-select', (_classNames = {}, _classNames[styles$
|
|
2278
|
+
return styles$d[c];
|
|
2279
|
+
}), [(_ref2 = {}, _ref2[styles$d.disabled] = isDisabled, _ref2)]));
|
|
2280
|
+
var inputClasses = classNames('react-select', (_classNames = {}, _classNames[styles$d.error] = error, _classNames));
|
|
2273
2281
|
var labelProps = {
|
|
2274
2282
|
inputId: id,
|
|
2275
2283
|
helpText: helpText,
|
|
2276
|
-
className: styles$
|
|
2284
|
+
className: styles$d['select-input-label'],
|
|
2277
2285
|
isDisabled: isDisabled,
|
|
2278
2286
|
isFieldRequired: isRequired,
|
|
2279
2287
|
requiredIndicator: requiredIndicator
|
|
@@ -2344,20 +2352,6 @@ var FormikSelectInput = function FormikSelectInput(_ref) {
|
|
|
2344
2352
|
}));
|
|
2345
2353
|
};
|
|
2346
2354
|
|
|
2347
|
-
var styles$d = {"help-text":"HelpText-module_help-text__8WodW"};
|
|
2348
|
-
|
|
2349
|
-
var HelpText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
2350
|
-
var children = _ref.children,
|
|
2351
|
-
className = _ref.className;
|
|
2352
|
-
return React.createElement(Box, {
|
|
2353
|
-
ref: ref,
|
|
2354
|
-
className: classNames('hyphen-components__variables__form-control', styles$d['help-text'], className),
|
|
2355
|
-
display: "block",
|
|
2356
|
-
color: "secondary",
|
|
2357
|
-
fontSize: "sm"
|
|
2358
|
-
}, children);
|
|
2359
|
-
});
|
|
2360
|
-
|
|
2361
2355
|
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"};
|
|
2362
2356
|
|
|
2363
2357
|
var SelectInputInset = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -4002,22 +3996,19 @@ function ThemeProvider(_ref) {
|
|
|
4002
3996
|
}
|
|
4003
3997
|
root.classList.add(theme);
|
|
4004
3998
|
}, [theme]);
|
|
3999
|
+
var isDarkMode = theme === 'dark' || theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
4005
4000
|
var value = {
|
|
4006
4001
|
theme: theme,
|
|
4007
4002
|
setTheme: function setTheme(theme) {
|
|
4008
4003
|
localStorage.setItem(storageKey, theme);
|
|
4009
4004
|
_setTheme(theme);
|
|
4010
|
-
}
|
|
4005
|
+
},
|
|
4006
|
+
isDarkMode: isDarkMode
|
|
4011
4007
|
};
|
|
4012
4008
|
return React.createElement(ThemeProviderContext.Provider, _extends({}, props, {
|
|
4013
4009
|
value: value
|
|
4014
4010
|
}), children);
|
|
4015
4011
|
}
|
|
4016
|
-
var useTheme = function useTheme() {
|
|
4017
|
-
var context = useContext(ThemeProviderContext);
|
|
4018
|
-
if (context === undefined) throw new Error('useTheme must be used within a ThemeProvider. Be sure your App is wrapped in ThemeProvider.');
|
|
4019
|
-
return context;
|
|
4020
|
-
};
|
|
4021
4012
|
|
|
4022
4013
|
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"};
|
|
4023
4014
|
|
|
@@ -4657,5 +4648,11 @@ var useOpenClose = function useOpenClose(props) {
|
|
|
4657
4648
|
};
|
|
4658
4649
|
};
|
|
4659
4650
|
|
|
4660
|
-
|
|
4651
|
+
var useTheme = function useTheme() {
|
|
4652
|
+
var context = React.useContext(ThemeProviderContext);
|
|
4653
|
+
if (context === undefined) throw new Error('useTheme must be used within a ThemeProvider. Be sure your App is wrapped in ThemeProvider.');
|
|
4654
|
+
return context;
|
|
4655
|
+
};
|
|
4656
|
+
|
|
4657
|
+
export { Alert, Badge, Box, Button, Card, CardBaseComponent, Checkbox, CheckboxInput, DateInput, DatePicker, Details, DetailsBaseComponent, DetailsSummary, Drawer, FormControl, FormLabel, FormikCheckboxInput, FormikRadioGroup, FormikSelectInput, FormikSelectInputInset, FormikSelectInputNative, FormikTextInput, FormikTextInputInset, FormikTextareaInput, FormikTextareaInputInset, FormikTimePicker, FormikTimePickerNative, FormikToggle, Heading, Icon, Modal, ModalBaseComponent, Pagination, Popover, RadioGroup, ResponsiveContext, ResponsiveProvider, SelectInput, SelectInputInset, SelectInputNative, Spinner, Table, TextInput, TextInputInset, TextareaInput, TextareaInputInset, ThemeProvider, ThemeProviderContext, TimePicker, TimePickerNative, ToastContainer, Toggle, boxPropsKeys, createRectRef, toast, useBreakpoint, useIsomorphicLayoutEffect, useOpenClose, useTheme, useToasts, useWindowSize };
|
|
4661
4658
|
//# sourceMappingURL=hyphen-components.esm.js.map
|