@nulogy/components 8.13.1 → 8.14.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/main.js +907 -582
- package/dist/main.module.js +907 -582
- package/dist/src/Breadcrumbs/Breadcrumbs.d.ts +5 -1
- package/dist/src/Breadcrumbs/Breadcrumbs.story.d.ts +1 -0
- package/dist/src/Breadcrumbs/BreadcrumbsListItem.d.ts +5 -3
- package/dist/src/Button/Button.d.ts +2 -2
- package/dist/src/Button/Button.story.d.ts +1 -6
- package/dist/src/Button/IconicButton.d.ts +2 -0
- package/dist/src/Button/IconicButton.story.d.ts +1 -0
- package/dist/src/Checkbox/Checkbox.d.ts +15 -1
- package/dist/src/Checkbox/Checkbox.story.d.ts +1 -0
- package/dist/src/DatePicker/DatePicker.d.ts +3 -1
- package/dist/src/DatePicker/DatePicker.story.d.ts +1 -0
- package/dist/src/DatePicker/DatePickerInput.d.ts +2 -0
- package/dist/src/DateRange/DateRange.d.ts +2 -0
- package/dist/src/DateRange/DateRange.story.d.ts +13 -72
- package/dist/src/DateRange/EndTime.d.ts +1 -0
- package/dist/src/DateRange/StartTime.d.ts +1 -0
- package/dist/src/DropdownMenu/DropdownButton.d.ts +7 -6
- package/dist/src/DropdownMenu/DropdownLink.d.ts +13 -2
- package/dist/src/DropdownMenu/DropdownMenu.d.ts +2 -0
- package/dist/src/DropdownMenu/DropdownMenu.story.d.ts +1 -0
- package/dist/src/Input/Input.story.d.ts +1 -0
- package/dist/src/Input/InputField.d.ts +6 -3
- package/dist/src/Link/Link.d.ts +7 -4
- package/dist/src/Link/Link.story.d.ts +2 -6
- package/dist/src/NDSProvider/ComponentSizeContext.d.ts +9 -0
- package/dist/src/NDSProvider/NDSProvider.d.ts +13 -2
- package/dist/src/Radio/Radio.d.ts +5 -11
- package/dist/src/Radio/Radio.story.d.ts +1 -0
- package/dist/src/RangeContainer/RangeContainer.d.ts +2 -0
- package/dist/src/Select/Select.d.ts +2 -0
- package/dist/src/Select/Select.story.d.ts +1 -0
- package/dist/src/Select/customReactSelectStyles.d.ts +924 -19
- package/dist/src/Switcher/Switch.d.ts +6 -3
- package/dist/src/Switcher/Switcher.d.ts +7 -5
- package/dist/src/Switcher/Switcher.story.d.ts +1 -0
- package/dist/src/Tabs/Tab.d.ts +2 -3
- package/dist/src/Tabs/Tabs.d.ts +5 -0
- package/dist/src/Tabs/Tabs.story.d.ts +2 -6
- package/dist/src/Textarea/StyledTextarea.d.ts +13 -1
- package/dist/src/Textarea/Textarea.story.d.ts +9 -48
- package/dist/src/TimePicker/TimePicker.d.ts +2 -0
- package/dist/src/TimePicker/TimePicker.story.d.ts +1 -0
- package/dist/src/TimePicker/TimePickerInput.d.ts +310 -1
- package/dist/src/TimePicker/TimePickerOption.d.ts +8 -1
- package/dist/src/TimeRange/TimeRange.d.ts +8 -7
- package/dist/src/Toggle/Toggle.d.ts +2 -0
- package/dist/src/Toggle/Toggle.story.d.ts +1 -0
- package/dist/src/theme.type.d.ts +1 -1
- package/dist/src/utils/ClickInputLabel.d.ts +5 -2
- package/dist/src/utils/dashed.d.ts +6 -0
- package/package.json +2 -2
- package/dist/src/Switcher/Switch.story.d.ts +0 -22
package/dist/main.module.js
CHANGED
|
@@ -8685,6 +8685,317 @@ var InlineIcon = function InlineIcon(props) {
|
|
|
8685
8685
|
}, props)));
|
|
8686
8686
|
};
|
|
8687
8687
|
|
|
8688
|
+
var Flex = styled(Box).withConfig({
|
|
8689
|
+
displayName: "Flex",
|
|
8690
|
+
componentId: "sc-1whlq91-0"
|
|
8691
|
+
})({
|
|
8692
|
+
display: "flex"
|
|
8693
|
+
}, system({
|
|
8694
|
+
gap: {
|
|
8695
|
+
property: "gap",
|
|
8696
|
+
scale: "space"
|
|
8697
|
+
},
|
|
8698
|
+
rowGap: {
|
|
8699
|
+
property: "rowGap",
|
|
8700
|
+
scale: "space"
|
|
8701
|
+
},
|
|
8702
|
+
columnGap: {
|
|
8703
|
+
property: "columnGap",
|
|
8704
|
+
scale: "space"
|
|
8705
|
+
}
|
|
8706
|
+
}), flexbox);
|
|
8707
|
+
|
|
8708
|
+
var textOverflow = system({
|
|
8709
|
+
whiteSpace: true,
|
|
8710
|
+
textOverflow: true
|
|
8711
|
+
});
|
|
8712
|
+
|
|
8713
|
+
var addStyledProps = compose(border, shadow, color, cursor$1, layout, overflow, space, textOverflow, transform, transition, typography, visibility, flexbox);
|
|
8714
|
+
|
|
8715
|
+
var getAttrs = function getAttrs(inline) {
|
|
8716
|
+
return inline ? {
|
|
8717
|
+
as: "span"
|
|
8718
|
+
} : null;
|
|
8719
|
+
};
|
|
8720
|
+
|
|
8721
|
+
var Text = styled.p.attrs(function (props) {
|
|
8722
|
+
return getAttrs(props.inline);
|
|
8723
|
+
}).withConfig({
|
|
8724
|
+
displayName: "Text",
|
|
8725
|
+
componentId: "sc-15glbbx-0"
|
|
8726
|
+
})(function (_ref) {
|
|
8727
|
+
var disabled = _ref.disabled,
|
|
8728
|
+
textTransform = _ref.textTransform,
|
|
8729
|
+
theme = _ref.theme;
|
|
8730
|
+
return {
|
|
8731
|
+
textTransform: textTransform,
|
|
8732
|
+
color: "currentColor",
|
|
8733
|
+
marginTop: 0,
|
|
8734
|
+
marginBottom: 0,
|
|
8735
|
+
fontSize: theme.fontSizes.medium,
|
|
8736
|
+
lineHeight: theme.lineHeights.base,
|
|
8737
|
+
opacity: disabled ? "0.7" : undefined
|
|
8738
|
+
};
|
|
8739
|
+
}, addStyledProps);
|
|
8740
|
+
Text.defaultProps = {
|
|
8741
|
+
inline: false,
|
|
8742
|
+
disabled: false
|
|
8743
|
+
};
|
|
8744
|
+
|
|
8745
|
+
var Heading1 = Text.withComponent("h1");
|
|
8746
|
+
Heading1.defaultProps = {
|
|
8747
|
+
fontSize: "heading1",
|
|
8748
|
+
lineHeight: "heading1",
|
|
8749
|
+
fontWeight: "light",
|
|
8750
|
+
mt: 0,
|
|
8751
|
+
mb: "x6"
|
|
8752
|
+
};
|
|
8753
|
+
var Heading2 = Text.withComponent("h2");
|
|
8754
|
+
Heading2.defaultProps = {
|
|
8755
|
+
fontSize: "heading2",
|
|
8756
|
+
lineHeight: "heading2",
|
|
8757
|
+
fontWeight: "normal",
|
|
8758
|
+
mt: 0,
|
|
8759
|
+
mb: "x2"
|
|
8760
|
+
};
|
|
8761
|
+
var Heading3 = Text.withComponent("h3");
|
|
8762
|
+
Heading3.defaultProps = {
|
|
8763
|
+
fontSize: "heading3",
|
|
8764
|
+
lineHeight: "heading3",
|
|
8765
|
+
fontWeight: "medium",
|
|
8766
|
+
mt: 0,
|
|
8767
|
+
mb: "x1"
|
|
8768
|
+
};
|
|
8769
|
+
var Heading4 = Text.withComponent("h4");
|
|
8770
|
+
Heading4.defaultProps = {
|
|
8771
|
+
fontSize: "heading4",
|
|
8772
|
+
lineHeight: "heading4",
|
|
8773
|
+
fontWeight: "bold",
|
|
8774
|
+
mt: 0,
|
|
8775
|
+
mb: "x1"
|
|
8776
|
+
};
|
|
8777
|
+
|
|
8778
|
+
var defaultOptions = {
|
|
8779
|
+
bindI18n: 'languageChanged',
|
|
8780
|
+
bindI18nStore: '',
|
|
8781
|
+
transEmptyNodeValue: '',
|
|
8782
|
+
transSupportBasicHtmlNodes: true,
|
|
8783
|
+
transWrapTextNodes: '',
|
|
8784
|
+
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
|
|
8785
|
+
useSuspense: true
|
|
8786
|
+
};
|
|
8787
|
+
var i18nInstance;
|
|
8788
|
+
var I18nContext = React__default.createContext();
|
|
8789
|
+
function getDefaults() {
|
|
8790
|
+
return defaultOptions;
|
|
8791
|
+
}
|
|
8792
|
+
var ReportNamespaces = function () {
|
|
8793
|
+
function ReportNamespaces() {
|
|
8794
|
+
_classCallCheck$1(this, ReportNamespaces);
|
|
8795
|
+
|
|
8796
|
+
this.usedNamespaces = {};
|
|
8797
|
+
}
|
|
8798
|
+
|
|
8799
|
+
_createClass$1(ReportNamespaces, [{
|
|
8800
|
+
key: "addUsedNamespaces",
|
|
8801
|
+
value: function addUsedNamespaces(namespaces) {
|
|
8802
|
+
var _this = this;
|
|
8803
|
+
|
|
8804
|
+
namespaces.forEach(function (ns) {
|
|
8805
|
+
if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;
|
|
8806
|
+
});
|
|
8807
|
+
}
|
|
8808
|
+
}, {
|
|
8809
|
+
key: "getUsedNamespaces",
|
|
8810
|
+
value: function getUsedNamespaces() {
|
|
8811
|
+
return Object.keys(this.usedNamespaces);
|
|
8812
|
+
}
|
|
8813
|
+
}]);
|
|
8814
|
+
|
|
8815
|
+
return ReportNamespaces;
|
|
8816
|
+
}();
|
|
8817
|
+
function getI18n() {
|
|
8818
|
+
return i18nInstance;
|
|
8819
|
+
}
|
|
8820
|
+
|
|
8821
|
+
function warn() {
|
|
8822
|
+
if (console && console.warn) {
|
|
8823
|
+
var _console;
|
|
8824
|
+
|
|
8825
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8826
|
+
args[_key] = arguments[_key];
|
|
8827
|
+
}
|
|
8828
|
+
|
|
8829
|
+
if (typeof args[0] === 'string') args[0] = "react-i18next:: ".concat(args[0]);
|
|
8830
|
+
|
|
8831
|
+
(_console = console).warn.apply(_console, args);
|
|
8832
|
+
}
|
|
8833
|
+
}
|
|
8834
|
+
var alreadyWarned = {};
|
|
8835
|
+
function warnOnce() {
|
|
8836
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8837
|
+
args[_key2] = arguments[_key2];
|
|
8838
|
+
}
|
|
8839
|
+
|
|
8840
|
+
if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
|
|
8841
|
+
if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
|
|
8842
|
+
warn.apply(void 0, args);
|
|
8843
|
+
}
|
|
8844
|
+
function loadNamespaces(i18n, ns, cb) {
|
|
8845
|
+
i18n.loadNamespaces(ns, function () {
|
|
8846
|
+
if (i18n.isInitialized) {
|
|
8847
|
+
cb();
|
|
8848
|
+
} else {
|
|
8849
|
+
var initialized = function initialized() {
|
|
8850
|
+
setTimeout(function () {
|
|
8851
|
+
i18n.off('initialized', initialized);
|
|
8852
|
+
}, 0);
|
|
8853
|
+
cb();
|
|
8854
|
+
};
|
|
8855
|
+
|
|
8856
|
+
i18n.on('initialized', initialized);
|
|
8857
|
+
}
|
|
8858
|
+
});
|
|
8859
|
+
}
|
|
8860
|
+
function hasLoadedNamespace(ns, i18n) {
|
|
8861
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8862
|
+
|
|
8863
|
+
if (!i18n.languages || !i18n.languages.length) {
|
|
8864
|
+
warnOnce('i18n.languages were undefined or empty', i18n.languages);
|
|
8865
|
+
return true;
|
|
8866
|
+
}
|
|
8867
|
+
|
|
8868
|
+
var lng = i18n.languages[0];
|
|
8869
|
+
var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
|
|
8870
|
+
var lastLng = i18n.languages[i18n.languages.length - 1];
|
|
8871
|
+
if (lng.toLowerCase() === 'cimode') return true;
|
|
8872
|
+
|
|
8873
|
+
var loadNotPending = function loadNotPending(l, n) {
|
|
8874
|
+
var loadState = i18n.services.backendConnector.state["".concat(l, "|").concat(n)];
|
|
8875
|
+
return loadState === -1 || loadState === 2;
|
|
8876
|
+
};
|
|
8877
|
+
|
|
8878
|
+
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
|
|
8879
|
+
if (i18n.hasResourceBundle(lng, ns)) return true;
|
|
8880
|
+
if (!i18n.services.backendConnector.backend) return true;
|
|
8881
|
+
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
8882
|
+
return false;
|
|
8883
|
+
}
|
|
8884
|
+
|
|
8885
|
+
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
8886
|
+
|
|
8887
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8888
|
+
function useTranslation(ns) {
|
|
8889
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8890
|
+
var i18nFromProps = props.i18n;
|
|
8891
|
+
|
|
8892
|
+
var _ref = useContext(I18nContext) || {},
|
|
8893
|
+
i18nFromContext = _ref.i18n,
|
|
8894
|
+
defaultNSFromContext = _ref.defaultNS;
|
|
8895
|
+
|
|
8896
|
+
var i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
8897
|
+
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
8898
|
+
|
|
8899
|
+
if (!i18n) {
|
|
8900
|
+
warnOnce('You will need to pass in an i18next instance by using initReactI18next');
|
|
8901
|
+
|
|
8902
|
+
var notReadyT = function notReadyT(k) {
|
|
8903
|
+
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
8904
|
+
};
|
|
8905
|
+
|
|
8906
|
+
var retNotReady = [notReadyT, {}, false];
|
|
8907
|
+
retNotReady.t = notReadyT;
|
|
8908
|
+
retNotReady.i18n = {};
|
|
8909
|
+
retNotReady.ready = false;
|
|
8910
|
+
return retNotReady;
|
|
8911
|
+
}
|
|
8912
|
+
|
|
8913
|
+
if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
|
|
8914
|
+
|
|
8915
|
+
var i18nOptions = _objectSpread$5(_objectSpread$5(_objectSpread$5({}, getDefaults()), i18n.options.react), props);
|
|
8916
|
+
|
|
8917
|
+
var useSuspense = i18nOptions.useSuspense,
|
|
8918
|
+
keyPrefix = i18nOptions.keyPrefix;
|
|
8919
|
+
var namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
8920
|
+
namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
|
|
8921
|
+
if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
|
|
8922
|
+
var ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(function (n) {
|
|
8923
|
+
return hasLoadedNamespace(n, i18n, i18nOptions);
|
|
8924
|
+
});
|
|
8925
|
+
|
|
8926
|
+
function getT() {
|
|
8927
|
+
return i18n.getFixedT(null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
|
|
8928
|
+
}
|
|
8929
|
+
|
|
8930
|
+
var _useState = useState(getT),
|
|
8931
|
+
_useState2 = _slicedToArray$1(_useState, 2),
|
|
8932
|
+
t = _useState2[0],
|
|
8933
|
+
setT = _useState2[1];
|
|
8934
|
+
|
|
8935
|
+
var isMounted = useRef(true);
|
|
8936
|
+
useEffect(function () {
|
|
8937
|
+
var bindI18n = i18nOptions.bindI18n,
|
|
8938
|
+
bindI18nStore = i18nOptions.bindI18nStore;
|
|
8939
|
+
isMounted.current = true;
|
|
8940
|
+
|
|
8941
|
+
if (!ready && !useSuspense) {
|
|
8942
|
+
loadNamespaces(i18n, namespaces, function () {
|
|
8943
|
+
if (isMounted.current) setT(getT);
|
|
8944
|
+
});
|
|
8945
|
+
}
|
|
8946
|
+
|
|
8947
|
+
function boundReset() {
|
|
8948
|
+
if (isMounted.current) setT(getT);
|
|
8949
|
+
}
|
|
8950
|
+
|
|
8951
|
+
if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
|
|
8952
|
+
if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
|
|
8953
|
+
return function () {
|
|
8954
|
+
isMounted.current = false;
|
|
8955
|
+
if (bindI18n && i18n) bindI18n.split(' ').forEach(function (e) {
|
|
8956
|
+
return i18n.off(e, boundReset);
|
|
8957
|
+
});
|
|
8958
|
+
if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(function (e) {
|
|
8959
|
+
return i18n.store.off(e, boundReset);
|
|
8960
|
+
});
|
|
8961
|
+
};
|
|
8962
|
+
}, [i18n, namespaces.join()]);
|
|
8963
|
+
var isInitial = useRef(true);
|
|
8964
|
+
useEffect(function () {
|
|
8965
|
+
if (isMounted.current && !isInitial.current) {
|
|
8966
|
+
setT(getT);
|
|
8967
|
+
}
|
|
8968
|
+
|
|
8969
|
+
isInitial.current = false;
|
|
8970
|
+
}, [i18n]);
|
|
8971
|
+
var ret = [t, i18n, ready];
|
|
8972
|
+
ret.t = t;
|
|
8973
|
+
ret.i18n = i18n;
|
|
8974
|
+
ret.ready = ready;
|
|
8975
|
+
if (ready) return ret;
|
|
8976
|
+
if (!ready && !useSuspense) return ret;
|
|
8977
|
+
throw new Promise(function (resolve) {
|
|
8978
|
+
loadNamespaces(i18n, namespaces, function () {
|
|
8979
|
+
resolve();
|
|
8980
|
+
});
|
|
8981
|
+
});
|
|
8982
|
+
}
|
|
8983
|
+
|
|
8984
|
+
function I18nextProvider(_ref) {
|
|
8985
|
+
var i18n = _ref.i18n,
|
|
8986
|
+
defaultNS = _ref.defaultNS,
|
|
8987
|
+
children = _ref.children;
|
|
8988
|
+
var value = useMemo(function () {
|
|
8989
|
+
return {
|
|
8990
|
+
i18n: i18n,
|
|
8991
|
+
defaultNS: defaultNS
|
|
8992
|
+
};
|
|
8993
|
+
}, [i18n, defaultNS]);
|
|
8994
|
+
return createElement(I18nContext.Provider, {
|
|
8995
|
+
value: value
|
|
8996
|
+
}, children);
|
|
8997
|
+
}
|
|
8998
|
+
|
|
8688
8999
|
function _extends$2() {
|
|
8689
9000
|
_extends$2 = Object.assign || function (target) {
|
|
8690
9001
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -9717,12 +10028,26 @@ var themeGet = function themeGet(path, fallback) {
|
|
|
9717
10028
|
};
|
|
9718
10029
|
};
|
|
9719
10030
|
|
|
9720
|
-
var
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
});
|
|
10031
|
+
var ComponentSizeContext = /*#__PURE__*/createContext(undefined);
|
|
10032
|
+
function useComponentSize(selectedSize) {
|
|
10033
|
+
var context = useContext(ComponentSizeContext);
|
|
9724
10034
|
|
|
9725
|
-
|
|
10035
|
+
if (!context) {
|
|
10036
|
+
throw new Error("useComponentSize must be used within the NDSProvider");
|
|
10037
|
+
}
|
|
10038
|
+
|
|
10039
|
+
return selectedSize !== null && selectedSize !== void 0 ? selectedSize : context.size;
|
|
10040
|
+
}
|
|
10041
|
+
|
|
10042
|
+
var ComponentSizeContextProvider = function ComponentSizeContextProvider(_ref) {
|
|
10043
|
+
var size = _ref.size,
|
|
10044
|
+
children = _ref.children;
|
|
10045
|
+
return /*#__PURE__*/React__default.createElement(ComponentSizeContext.Provider, {
|
|
10046
|
+
value: {
|
|
10047
|
+
size: size
|
|
10048
|
+
}
|
|
10049
|
+
}, children);
|
|
10050
|
+
};
|
|
9726
10051
|
|
|
9727
10052
|
var resetButtonStyles = {
|
|
9728
10053
|
background: "none",
|
|
@@ -9741,11 +10066,11 @@ var getHoverColor = function getHoverColor(props) {
|
|
|
9741
10066
|
return props.hover ? getColor(props) : curriedDarken("0.1", getColor(props));
|
|
9742
10067
|
};
|
|
9743
10068
|
|
|
9744
|
-
var
|
|
10069
|
+
var StyledLink = styled.a.withConfig({
|
|
9745
10070
|
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
9746
10071
|
return !["underline", "hover"].includes(prop) && defaultValidatorFn(prop);
|
|
9747
10072
|
},
|
|
9748
|
-
displayName: "
|
|
10073
|
+
displayName: "Link__StyledLink",
|
|
9749
10074
|
componentId: "sc-1fcpbo4-0"
|
|
9750
10075
|
})(function (_a) {
|
|
9751
10076
|
var underline = _a.underline,
|
|
@@ -9762,314 +10087,29 @@ var Link = styled.a.withConfig({
|
|
|
9762
10087
|
color: getHoverColor(props)
|
|
9763
10088
|
}
|
|
9764
10089
|
});
|
|
9765
|
-
},
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
})({
|
|
9774
|
-
display: "flex"
|
|
9775
|
-
}, system({
|
|
9776
|
-
gap: {
|
|
9777
|
-
property: "gap",
|
|
9778
|
-
scale: "space"
|
|
9779
|
-
},
|
|
9780
|
-
rowGap: {
|
|
9781
|
-
property: "rowGap",
|
|
9782
|
-
scale: "space"
|
|
9783
|
-
},
|
|
9784
|
-
columnGap: {
|
|
9785
|
-
property: "columnGap",
|
|
9786
|
-
scale: "space"
|
|
10090
|
+
}, variant({
|
|
10091
|
+
prop: "size",
|
|
10092
|
+
variants: {
|
|
10093
|
+
large: {
|
|
10094
|
+
py: "x2",
|
|
10095
|
+
px: "0"
|
|
10096
|
+
},
|
|
10097
|
+
medium: {}
|
|
9787
10098
|
}
|
|
9788
|
-
}),
|
|
9789
|
-
|
|
9790
|
-
var
|
|
9791
|
-
|
|
9792
|
-
as: "span"
|
|
9793
|
-
} : null;
|
|
9794
|
-
};
|
|
9795
|
-
|
|
9796
|
-
var Text = styled.p.attrs(function (props) {
|
|
9797
|
-
return getAttrs(props.inline);
|
|
9798
|
-
}).withConfig({
|
|
9799
|
-
displayName: "Text",
|
|
9800
|
-
componentId: "sc-15glbbx-0"
|
|
9801
|
-
})(function (_ref) {
|
|
9802
|
-
var disabled = _ref.disabled,
|
|
9803
|
-
textTransform = _ref.textTransform,
|
|
9804
|
-
theme = _ref.theme;
|
|
9805
|
-
return {
|
|
9806
|
-
textTransform: textTransform,
|
|
9807
|
-
color: "currentColor",
|
|
9808
|
-
marginTop: 0,
|
|
9809
|
-
marginBottom: 0,
|
|
9810
|
-
fontSize: theme.fontSizes.medium,
|
|
9811
|
-
lineHeight: theme.lineHeights.base,
|
|
9812
|
-
opacity: disabled ? "0.7" : undefined
|
|
9813
|
-
};
|
|
9814
|
-
}, addStyledProps);
|
|
9815
|
-
Text.defaultProps = {
|
|
9816
|
-
inline: false,
|
|
9817
|
-
disabled: false
|
|
9818
|
-
};
|
|
9819
|
-
|
|
9820
|
-
var Heading1 = Text.withComponent("h1");
|
|
9821
|
-
Heading1.defaultProps = {
|
|
9822
|
-
fontSize: "heading1",
|
|
9823
|
-
lineHeight: "heading1",
|
|
9824
|
-
fontWeight: "light",
|
|
9825
|
-
mt: 0,
|
|
9826
|
-
mb: "x6"
|
|
9827
|
-
};
|
|
9828
|
-
var Heading2 = Text.withComponent("h2");
|
|
9829
|
-
Heading2.defaultProps = {
|
|
9830
|
-
fontSize: "heading2",
|
|
9831
|
-
lineHeight: "heading2",
|
|
9832
|
-
fontWeight: "normal",
|
|
9833
|
-
mt: 0,
|
|
9834
|
-
mb: "x2"
|
|
9835
|
-
};
|
|
9836
|
-
var Heading3 = Text.withComponent("h3");
|
|
9837
|
-
Heading3.defaultProps = {
|
|
9838
|
-
fontSize: "heading3",
|
|
9839
|
-
lineHeight: "heading3",
|
|
9840
|
-
fontWeight: "medium",
|
|
9841
|
-
mt: 0,
|
|
9842
|
-
mb: "x1"
|
|
9843
|
-
};
|
|
9844
|
-
var Heading4 = Text.withComponent("h4");
|
|
9845
|
-
Heading4.defaultProps = {
|
|
9846
|
-
fontSize: "heading4",
|
|
9847
|
-
lineHeight: "heading4",
|
|
9848
|
-
fontWeight: "bold",
|
|
9849
|
-
mt: 0,
|
|
9850
|
-
mb: "x1"
|
|
9851
|
-
};
|
|
10099
|
+
}), addStyledProps);
|
|
10100
|
+
var Link = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
10101
|
+
var size = _a.size,
|
|
10102
|
+
props = __rest(_a, ["size"]);
|
|
9852
10103
|
|
|
9853
|
-
var
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
10104
|
+
var componentSize = useComponentSize(size);
|
|
10105
|
+
return /*#__PURE__*/React__default.createElement(StyledLink, Object.assign({
|
|
10106
|
+
size: componentSize,
|
|
10107
|
+
ref: ref
|
|
10108
|
+
}, props));
|
|
10109
|
+
});
|
|
10110
|
+
Link.defaultProps = {
|
|
10111
|
+
underline: true
|
|
9861
10112
|
};
|
|
9862
|
-
var i18nInstance;
|
|
9863
|
-
var I18nContext = React__default.createContext();
|
|
9864
|
-
function getDefaults() {
|
|
9865
|
-
return defaultOptions;
|
|
9866
|
-
}
|
|
9867
|
-
var ReportNamespaces = function () {
|
|
9868
|
-
function ReportNamespaces() {
|
|
9869
|
-
_classCallCheck$1(this, ReportNamespaces);
|
|
9870
|
-
|
|
9871
|
-
this.usedNamespaces = {};
|
|
9872
|
-
}
|
|
9873
|
-
|
|
9874
|
-
_createClass$1(ReportNamespaces, [{
|
|
9875
|
-
key: "addUsedNamespaces",
|
|
9876
|
-
value: function addUsedNamespaces(namespaces) {
|
|
9877
|
-
var _this = this;
|
|
9878
|
-
|
|
9879
|
-
namespaces.forEach(function (ns) {
|
|
9880
|
-
if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;
|
|
9881
|
-
});
|
|
9882
|
-
}
|
|
9883
|
-
}, {
|
|
9884
|
-
key: "getUsedNamespaces",
|
|
9885
|
-
value: function getUsedNamespaces() {
|
|
9886
|
-
return Object.keys(this.usedNamespaces);
|
|
9887
|
-
}
|
|
9888
|
-
}]);
|
|
9889
|
-
|
|
9890
|
-
return ReportNamespaces;
|
|
9891
|
-
}();
|
|
9892
|
-
function getI18n() {
|
|
9893
|
-
return i18nInstance;
|
|
9894
|
-
}
|
|
9895
|
-
|
|
9896
|
-
function warn() {
|
|
9897
|
-
if (console && console.warn) {
|
|
9898
|
-
var _console;
|
|
9899
|
-
|
|
9900
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9901
|
-
args[_key] = arguments[_key];
|
|
9902
|
-
}
|
|
9903
|
-
|
|
9904
|
-
if (typeof args[0] === 'string') args[0] = "react-i18next:: ".concat(args[0]);
|
|
9905
|
-
|
|
9906
|
-
(_console = console).warn.apply(_console, args);
|
|
9907
|
-
}
|
|
9908
|
-
}
|
|
9909
|
-
var alreadyWarned = {};
|
|
9910
|
-
function warnOnce() {
|
|
9911
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
9912
|
-
args[_key2] = arguments[_key2];
|
|
9913
|
-
}
|
|
9914
|
-
|
|
9915
|
-
if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
|
|
9916
|
-
if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
|
|
9917
|
-
warn.apply(void 0, args);
|
|
9918
|
-
}
|
|
9919
|
-
function loadNamespaces(i18n, ns, cb) {
|
|
9920
|
-
i18n.loadNamespaces(ns, function () {
|
|
9921
|
-
if (i18n.isInitialized) {
|
|
9922
|
-
cb();
|
|
9923
|
-
} else {
|
|
9924
|
-
var initialized = function initialized() {
|
|
9925
|
-
setTimeout(function () {
|
|
9926
|
-
i18n.off('initialized', initialized);
|
|
9927
|
-
}, 0);
|
|
9928
|
-
cb();
|
|
9929
|
-
};
|
|
9930
|
-
|
|
9931
|
-
i18n.on('initialized', initialized);
|
|
9932
|
-
}
|
|
9933
|
-
});
|
|
9934
|
-
}
|
|
9935
|
-
function hasLoadedNamespace(ns, i18n) {
|
|
9936
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
9937
|
-
|
|
9938
|
-
if (!i18n.languages || !i18n.languages.length) {
|
|
9939
|
-
warnOnce('i18n.languages were undefined or empty', i18n.languages);
|
|
9940
|
-
return true;
|
|
9941
|
-
}
|
|
9942
|
-
|
|
9943
|
-
var lng = i18n.languages[0];
|
|
9944
|
-
var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
|
|
9945
|
-
var lastLng = i18n.languages[i18n.languages.length - 1];
|
|
9946
|
-
if (lng.toLowerCase() === 'cimode') return true;
|
|
9947
|
-
|
|
9948
|
-
var loadNotPending = function loadNotPending(l, n) {
|
|
9949
|
-
var loadState = i18n.services.backendConnector.state["".concat(l, "|").concat(n)];
|
|
9950
|
-
return loadState === -1 || loadState === 2;
|
|
9951
|
-
};
|
|
9952
|
-
|
|
9953
|
-
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
|
|
9954
|
-
if (i18n.hasResourceBundle(lng, ns)) return true;
|
|
9955
|
-
if (!i18n.services.backendConnector.backend) return true;
|
|
9956
|
-
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
9957
|
-
return false;
|
|
9958
|
-
}
|
|
9959
|
-
|
|
9960
|
-
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
9961
|
-
|
|
9962
|
-
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
9963
|
-
function useTranslation(ns) {
|
|
9964
|
-
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9965
|
-
var i18nFromProps = props.i18n;
|
|
9966
|
-
|
|
9967
|
-
var _ref = useContext(I18nContext) || {},
|
|
9968
|
-
i18nFromContext = _ref.i18n,
|
|
9969
|
-
defaultNSFromContext = _ref.defaultNS;
|
|
9970
|
-
|
|
9971
|
-
var i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
9972
|
-
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
9973
|
-
|
|
9974
|
-
if (!i18n) {
|
|
9975
|
-
warnOnce('You will need to pass in an i18next instance by using initReactI18next');
|
|
9976
|
-
|
|
9977
|
-
var notReadyT = function notReadyT(k) {
|
|
9978
|
-
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
9979
|
-
};
|
|
9980
|
-
|
|
9981
|
-
var retNotReady = [notReadyT, {}, false];
|
|
9982
|
-
retNotReady.t = notReadyT;
|
|
9983
|
-
retNotReady.i18n = {};
|
|
9984
|
-
retNotReady.ready = false;
|
|
9985
|
-
return retNotReady;
|
|
9986
|
-
}
|
|
9987
|
-
|
|
9988
|
-
if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
|
|
9989
|
-
|
|
9990
|
-
var i18nOptions = _objectSpread$5(_objectSpread$5(_objectSpread$5({}, getDefaults()), i18n.options.react), props);
|
|
9991
|
-
|
|
9992
|
-
var useSuspense = i18nOptions.useSuspense,
|
|
9993
|
-
keyPrefix = i18nOptions.keyPrefix;
|
|
9994
|
-
var namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
9995
|
-
namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
|
|
9996
|
-
if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
|
|
9997
|
-
var ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(function (n) {
|
|
9998
|
-
return hasLoadedNamespace(n, i18n, i18nOptions);
|
|
9999
|
-
});
|
|
10000
|
-
|
|
10001
|
-
function getT() {
|
|
10002
|
-
return i18n.getFixedT(null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
|
|
10003
|
-
}
|
|
10004
|
-
|
|
10005
|
-
var _useState = useState(getT),
|
|
10006
|
-
_useState2 = _slicedToArray$1(_useState, 2),
|
|
10007
|
-
t = _useState2[0],
|
|
10008
|
-
setT = _useState2[1];
|
|
10009
|
-
|
|
10010
|
-
var isMounted = useRef(true);
|
|
10011
|
-
useEffect(function () {
|
|
10012
|
-
var bindI18n = i18nOptions.bindI18n,
|
|
10013
|
-
bindI18nStore = i18nOptions.bindI18nStore;
|
|
10014
|
-
isMounted.current = true;
|
|
10015
|
-
|
|
10016
|
-
if (!ready && !useSuspense) {
|
|
10017
|
-
loadNamespaces(i18n, namespaces, function () {
|
|
10018
|
-
if (isMounted.current) setT(getT);
|
|
10019
|
-
});
|
|
10020
|
-
}
|
|
10021
|
-
|
|
10022
|
-
function boundReset() {
|
|
10023
|
-
if (isMounted.current) setT(getT);
|
|
10024
|
-
}
|
|
10025
|
-
|
|
10026
|
-
if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
|
|
10027
|
-
if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
|
|
10028
|
-
return function () {
|
|
10029
|
-
isMounted.current = false;
|
|
10030
|
-
if (bindI18n && i18n) bindI18n.split(' ').forEach(function (e) {
|
|
10031
|
-
return i18n.off(e, boundReset);
|
|
10032
|
-
});
|
|
10033
|
-
if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(function (e) {
|
|
10034
|
-
return i18n.store.off(e, boundReset);
|
|
10035
|
-
});
|
|
10036
|
-
};
|
|
10037
|
-
}, [i18n, namespaces.join()]);
|
|
10038
|
-
var isInitial = useRef(true);
|
|
10039
|
-
useEffect(function () {
|
|
10040
|
-
if (isMounted.current && !isInitial.current) {
|
|
10041
|
-
setT(getT);
|
|
10042
|
-
}
|
|
10043
|
-
|
|
10044
|
-
isInitial.current = false;
|
|
10045
|
-
}, [i18n]);
|
|
10046
|
-
var ret = [t, i18n, ready];
|
|
10047
|
-
ret.t = t;
|
|
10048
|
-
ret.i18n = i18n;
|
|
10049
|
-
ret.ready = ready;
|
|
10050
|
-
if (ready) return ret;
|
|
10051
|
-
if (!ready && !useSuspense) return ret;
|
|
10052
|
-
throw new Promise(function (resolve) {
|
|
10053
|
-
loadNamespaces(i18n, namespaces, function () {
|
|
10054
|
-
resolve();
|
|
10055
|
-
});
|
|
10056
|
-
});
|
|
10057
|
-
}
|
|
10058
|
-
|
|
10059
|
-
function I18nextProvider(_ref) {
|
|
10060
|
-
var i18n = _ref.i18n,
|
|
10061
|
-
defaultNS = _ref.defaultNS,
|
|
10062
|
-
children = _ref.children;
|
|
10063
|
-
var value = useMemo(function () {
|
|
10064
|
-
return {
|
|
10065
|
-
i18n: i18n,
|
|
10066
|
-
defaultNS: defaultNS
|
|
10067
|
-
};
|
|
10068
|
-
}, [i18n, defaultNS]);
|
|
10069
|
-
return createElement(I18nContext.Provider, {
|
|
10070
|
-
value: value
|
|
10071
|
-
}, children);
|
|
10072
|
-
}
|
|
10073
10113
|
|
|
10074
10114
|
var CloseButton$1 = function CloseButton(_ref) {
|
|
10075
10115
|
var onClick = _ref.onClick,
|
|
@@ -10096,12 +10136,12 @@ var CloseButton$1 = function CloseButton(_ref) {
|
|
|
10096
10136
|
};
|
|
10097
10137
|
|
|
10098
10138
|
var styles = function styles(_ref) {
|
|
10099
|
-
var _ref2;
|
|
10100
|
-
|
|
10101
10139
|
var theme = _ref.theme;
|
|
10102
|
-
return
|
|
10103
|
-
|
|
10104
|
-
|
|
10140
|
+
return {
|
|
10141
|
+
a: {
|
|
10142
|
+
color: theme.colors.black
|
|
10143
|
+
}
|
|
10144
|
+
};
|
|
10105
10145
|
};
|
|
10106
10146
|
|
|
10107
10147
|
var alertColours = {
|
|
@@ -17272,6 +17312,9 @@ function getMenuBorderRadius(_ref4) {
|
|
|
17272
17312
|
style: "none"
|
|
17273
17313
|
};
|
|
17274
17314
|
}
|
|
17315
|
+
function stylesForSize(config, size) {
|
|
17316
|
+
return config[size];
|
|
17317
|
+
}
|
|
17275
17318
|
var showIndicatorSeparator = function showIndicatorSeparator(_ref5) {
|
|
17276
17319
|
var isMulti = _ref5.isMulti,
|
|
17277
17320
|
hasValue = _ref5.hasValue,
|
|
@@ -17284,6 +17327,7 @@ var customStyles = function customStyles(_ref6) {
|
|
|
17284
17327
|
error = _ref6.error,
|
|
17285
17328
|
maxHeight = _ref6.maxHeight,
|
|
17286
17329
|
windowed = _ref6.windowed,
|
|
17330
|
+
size = _ref6.size,
|
|
17287
17331
|
_ref6$hasDefaultOptio = _ref6.hasDefaultOptions,
|
|
17288
17332
|
hasDefaultOptions = _ref6$hasDefaultOptio === void 0 ? true : _ref6$hasDefaultOptio;
|
|
17289
17333
|
return {
|
|
@@ -17372,16 +17416,23 @@ var customStyles = function customStyles(_ref6) {
|
|
|
17372
17416
|
input: function input() {
|
|
17373
17417
|
return {};
|
|
17374
17418
|
},
|
|
17375
|
-
valueContainer: function valueContainer(provided) {
|
|
17376
|
-
return Object.assign(Object.assign({}, provided), {
|
|
17419
|
+
valueContainer: function valueContainer(provided, state) {
|
|
17420
|
+
return Object.assign(Object.assign(Object.assign({}, provided), {
|
|
17377
17421
|
padding: 0,
|
|
17378
17422
|
overflow: "auto",
|
|
17379
17423
|
maxHeight: "150px",
|
|
17380
|
-
|
|
17381
|
-
|
|
17382
|
-
|
|
17383
|
-
|
|
17384
|
-
|
|
17424
|
+
gap: theme.space.half
|
|
17425
|
+
}), stylesForSize({
|
|
17426
|
+
large: {
|
|
17427
|
+
paddingTop: state.isMulti && state.hasValue ? theme.space.x1 : theme.space.x2,
|
|
17428
|
+
paddingBottom: state.isMulti && state.hasValue ? theme.space.x1 : theme.space.x2,
|
|
17429
|
+
gap: theme.space.x1
|
|
17430
|
+
},
|
|
17431
|
+
medium: {
|
|
17432
|
+
paddingTop: theme.space.half,
|
|
17433
|
+
paddingBottom: theme.space.half
|
|
17434
|
+
}
|
|
17435
|
+
}, size));
|
|
17385
17436
|
},
|
|
17386
17437
|
menu: function menu(provided, state) {
|
|
17387
17438
|
return Object.assign(Object.assign({}, provided), {
|
|
@@ -17457,21 +17508,32 @@ var customStyles = function customStyles(_ref6) {
|
|
|
17457
17508
|
});
|
|
17458
17509
|
},
|
|
17459
17510
|
multiValueLabel: function multiValueLabel() {
|
|
17460
|
-
return {
|
|
17511
|
+
return Object.assign({
|
|
17461
17512
|
textOverflow: "ellipsis",
|
|
17462
17513
|
whiteSpace: "nowrap",
|
|
17463
17514
|
overflow: "hidden",
|
|
17464
17515
|
color: theme.colors.black,
|
|
17465
17516
|
borderRadius: theme.radii.small,
|
|
17466
|
-
fontSize: theme.fontSizes.small
|
|
17467
|
-
|
|
17468
|
-
|
|
17469
|
-
|
|
17517
|
+
fontSize: theme.fontSizes.small
|
|
17518
|
+
}, stylesForSize({
|
|
17519
|
+
large: {
|
|
17520
|
+
fontSize: theme.fontSizes.medium,
|
|
17521
|
+
lineHeight: theme.lineHeights.base,
|
|
17522
|
+
padding: theme.space.x1,
|
|
17523
|
+
paddingRight: theme.space.half
|
|
17524
|
+
},
|
|
17525
|
+
medium: {
|
|
17526
|
+
padding: theme.space.half,
|
|
17527
|
+
paddingLeft: theme.space.x1
|
|
17528
|
+
}
|
|
17529
|
+
}, size));
|
|
17470
17530
|
},
|
|
17471
17531
|
multiValueRemove: function multiValueRemove(provided) {
|
|
17472
|
-
return Object.assign(Object.assign({}, provided), {
|
|
17532
|
+
return Object.assign(Object.assign(Object.assign({}, provided), {
|
|
17473
17533
|
svg: {
|
|
17474
|
-
fill: theme.colors.black
|
|
17534
|
+
fill: theme.colors.black,
|
|
17535
|
+
height: theme.sizes.x2,
|
|
17536
|
+
width: theme.sizes.x2
|
|
17475
17537
|
},
|
|
17476
17538
|
borderBottomLeftRadius: 0,
|
|
17477
17539
|
borderTopLeftRadius: 0,
|
|
@@ -17482,7 +17544,13 @@ var customStyles = function customStyles(_ref6) {
|
|
|
17482
17544
|
fill: theme.colors.white
|
|
17483
17545
|
}
|
|
17484
17546
|
}
|
|
17485
|
-
})
|
|
17547
|
+
}), stylesForSize({
|
|
17548
|
+
large: {
|
|
17549
|
+
padding: theme.space.x1
|
|
17550
|
+
},
|
|
17551
|
+
medium: {// Nothing
|
|
17552
|
+
}
|
|
17553
|
+
}, size));
|
|
17486
17554
|
},
|
|
17487
17555
|
noOptionsMessage: function noOptionsMessage(provided) {
|
|
17488
17556
|
return Object.assign(Object.assign({}, provided), {
|
|
@@ -17521,9 +17589,24 @@ var ClickInputLabel = styled.label.withConfig({
|
|
|
17521
17589
|
verticalAlign: "top",
|
|
17522
17590
|
alignItems: "flex-start",
|
|
17523
17591
|
userSelect: "none",
|
|
17524
|
-
|
|
17525
|
-
|
|
17526
|
-
|
|
17592
|
+
paddingTop: Theme.space.x1,
|
|
17593
|
+
paddingBottom: Theme.space.x1,
|
|
17594
|
+
paddingLeft: 0,
|
|
17595
|
+
paddingRight: 0
|
|
17596
|
+
};
|
|
17597
|
+
}, variant({
|
|
17598
|
+
prop: "size",
|
|
17599
|
+
variants: {
|
|
17600
|
+
large: {
|
|
17601
|
+
py: "x2",
|
|
17602
|
+
px: "0"
|
|
17603
|
+
},
|
|
17604
|
+
medium: {
|
|
17605
|
+
py: "x1",
|
|
17606
|
+
px: "0"
|
|
17607
|
+
}
|
|
17608
|
+
}
|
|
17609
|
+
}));
|
|
17527
17610
|
|
|
17528
17611
|
var subPx = function subPx(val1, val2) {
|
|
17529
17612
|
var val2Str = !val2 ? "1px" : "" + val2;
|
|
@@ -18360,6 +18443,7 @@ var StyledOption = styled.div.withConfig({
|
|
|
18360
18443
|
borderBottomRightRadius: theme.radii.medium
|
|
18361
18444
|
},
|
|
18362
18445
|
div: {
|
|
18446
|
+
height: "auto",
|
|
18363
18447
|
padding: subPx(theme.space.x1),
|
|
18364
18448
|
fontWeight: isSelected ? theme.fontWeights.medium : theme.fontWeights.normal,
|
|
18365
18449
|
background: isFocused ? theme.colors.lightBlue : null,
|
|
@@ -18372,6 +18456,21 @@ var StyledOption = styled.div.withConfig({
|
|
|
18372
18456
|
}
|
|
18373
18457
|
}
|
|
18374
18458
|
};
|
|
18459
|
+
}, function (_ref2) {
|
|
18460
|
+
var theme = _ref2.theme,
|
|
18461
|
+
selectProps = _ref2.selectProps;
|
|
18462
|
+
return stylesForSize({
|
|
18463
|
+
large: {
|
|
18464
|
+
div: {
|
|
18465
|
+
padding: subPx(theme.space.x2)
|
|
18466
|
+
}
|
|
18467
|
+
},
|
|
18468
|
+
medium: {
|
|
18469
|
+
div: {
|
|
18470
|
+
padding: subPx(theme.space.x1)
|
|
18471
|
+
}
|
|
18472
|
+
}
|
|
18473
|
+
}, selectProps.size);
|
|
18375
18474
|
});
|
|
18376
18475
|
var SelectOption = function SelectOption(props) {
|
|
18377
18476
|
return /*#__PURE__*/React__default.createElement(StyledOption, Object.assign({}, props, {
|
|
@@ -18480,7 +18579,8 @@ var SelectDefaultProps = {
|
|
|
18480
18579
|
closeMenuOnSelect: true
|
|
18481
18580
|
};
|
|
18482
18581
|
var ReactSelect = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
18483
|
-
var
|
|
18582
|
+
var size = _a.size,
|
|
18583
|
+
autocomplete = _a.autocomplete,
|
|
18484
18584
|
options = _a.options,
|
|
18485
18585
|
labelText = _a.labelText,
|
|
18486
18586
|
required = _a.required,
|
|
@@ -18503,7 +18603,7 @@ var ReactSelect = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
|
18503
18603
|
ariaLabel = _a["aria-label"],
|
|
18504
18604
|
_a$windowThreshold = _a.windowThreshold,
|
|
18505
18605
|
windowThreshold = _a$windowThreshold === void 0 ? 300 : _a$windowThreshold,
|
|
18506
|
-
props = __rest(_a, ["autocomplete", "options", "labelText", "required", "requirementText", "helpText", "disabled", "errorMessage", "errorList", "error", "id", "initialIsOpen", "maxHeight", "multiselect", "onChange", "placeholder", "value", "defaultValue", "components", "aria-label", "windowThreshold"]);
|
|
18606
|
+
props = __rest(_a, ["size", "autocomplete", "options", "labelText", "required", "requirementText", "helpText", "disabled", "errorMessage", "errorList", "error", "id", "initialIsOpen", "maxHeight", "multiselect", "onChange", "placeholder", "value", "defaultValue", "components", "aria-label", "windowThreshold"]);
|
|
18507
18607
|
|
|
18508
18608
|
var _useTranslation = useTranslation(),
|
|
18509
18609
|
t = _useTranslation.t;
|
|
@@ -18512,6 +18612,7 @@ var ReactSelect = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
|
18512
18612
|
var spaceProps = getSubset(props, propTypes.space);
|
|
18513
18613
|
var reactSelectRef = React__default.useRef(null);
|
|
18514
18614
|
var optionsRef = React__default.useRef(options);
|
|
18615
|
+
var componentSize = useComponentSize(size);
|
|
18515
18616
|
React__default.useEffect(function () {
|
|
18516
18617
|
checkOptionsAreValid(options);
|
|
18517
18618
|
optionsRef.current = options;
|
|
@@ -18531,6 +18632,7 @@ var ReactSelect = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
|
18531
18632
|
requirementText: requirementText,
|
|
18532
18633
|
helpText: helpText
|
|
18533
18634
|
}, /*#__PURE__*/React__default.createElement(WindowedSelect, Object.assign({
|
|
18635
|
+
size: componentSize,
|
|
18534
18636
|
ref: reactSelectRef,
|
|
18535
18637
|
placeholder: placeholder || t("select ..."),
|
|
18536
18638
|
windowThreshold: windowThreshold,
|
|
@@ -18538,6 +18640,7 @@ var ReactSelect = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
|
18538
18640
|
theme: themeContext,
|
|
18539
18641
|
error: error,
|
|
18540
18642
|
maxHeight: maxHeight,
|
|
18643
|
+
size: componentSize,
|
|
18541
18644
|
windowed: options.length > windowThreshold
|
|
18542
18645
|
}),
|
|
18543
18646
|
isDisabled: disabled,
|
|
@@ -19098,7 +19201,7 @@ function getBordersSize(styles, axis) {
|
|
|
19098
19201
|
return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
|
|
19099
19202
|
}
|
|
19100
19203
|
|
|
19101
|
-
function getSize$
|
|
19204
|
+
function getSize$2(axis, body, html, computedStyle) {
|
|
19102
19205
|
return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
|
|
19103
19206
|
}
|
|
19104
19207
|
|
|
@@ -19108,8 +19211,8 @@ function getWindowSizes(document) {
|
|
|
19108
19211
|
var computedStyle = isIE(10) && getComputedStyle(html);
|
|
19109
19212
|
|
|
19110
19213
|
return {
|
|
19111
|
-
height: getSize$
|
|
19112
|
-
width: getSize$
|
|
19214
|
+
height: getSize$2('Height', body, html, computedStyle),
|
|
19215
|
+
width: getSize$2('Width', body, html, computedStyle)
|
|
19113
19216
|
};
|
|
19114
19217
|
}
|
|
19115
19218
|
|
|
@@ -21940,36 +22043,6 @@ NavBarDropdownMenu$1.defaultProps = {
|
|
|
21940
22043
|
hideDelay: "100"
|
|
21941
22044
|
};
|
|
21942
22045
|
|
|
21943
|
-
var getSize$2 = function getSize(size, theme) {
|
|
21944
|
-
switch (size) {
|
|
21945
|
-
case "small":
|
|
21946
|
-
return {
|
|
21947
|
-
fontSize: "" + theme.fontSizes.small,
|
|
21948
|
-
lineHeight: "" + theme.lineHeights.smallTextCompressed,
|
|
21949
|
-
padding: subPx(theme.space.half) + " " + theme.space.x1
|
|
21950
|
-
};
|
|
21951
|
-
|
|
21952
|
-
case "medium":
|
|
21953
|
-
return {
|
|
21954
|
-
fontSize: "" + theme.fontSizes.medium,
|
|
21955
|
-
padding: subPx(theme.space.x1) + " " + theme.space.x2
|
|
21956
|
-
};
|
|
21957
|
-
|
|
21958
|
-
case "large":
|
|
21959
|
-
return {
|
|
21960
|
-
fontSize: "" + theme.fontSizes.large,
|
|
21961
|
-
lineHeight: "" + theme.lineHeights.subsectionTitle,
|
|
21962
|
-
padding: subPx(theme.space.x2) + " " + theme.space.x3
|
|
21963
|
-
};
|
|
21964
|
-
|
|
21965
|
-
default:
|
|
21966
|
-
return {
|
|
21967
|
-
fontSize: "" + theme.fontSizes.medium,
|
|
21968
|
-
padding: subPx(theme.space.x1) + " " + theme.space.x2
|
|
21969
|
-
};
|
|
21970
|
-
}
|
|
21971
|
-
};
|
|
21972
|
-
|
|
21973
22046
|
var WrapperButton$2 = styled.button.withConfig({
|
|
21974
22047
|
displayName: "Button__WrapperButton",
|
|
21975
22048
|
componentId: "sc-hxfi59-0"
|
|
@@ -22013,12 +22086,30 @@ var WrapperButton$2 = styled.button.withConfig({
|
|
|
22013
22086
|
},
|
|
22014
22087
|
"&:disabled": {
|
|
22015
22088
|
opacity: ".5"
|
|
22016
|
-
}
|
|
22089
|
+
},
|
|
22090
|
+
fontSize: "medium",
|
|
22091
|
+
padding: subPx(theme.space.x1) + " " + theme.space.x2
|
|
22017
22092
|
};
|
|
22018
22093
|
}, function (_ref3) {
|
|
22019
|
-
var
|
|
22020
|
-
|
|
22021
|
-
|
|
22094
|
+
var theme = _ref3.theme;
|
|
22095
|
+
return variant({
|
|
22096
|
+
prop: "size",
|
|
22097
|
+
variants: {
|
|
22098
|
+
small: {
|
|
22099
|
+
fontSize: "small",
|
|
22100
|
+
lineHeight: "smallTextCompressed",
|
|
22101
|
+
padding: subPx(theme.space.half) + " " + theme.space.x1
|
|
22102
|
+
},
|
|
22103
|
+
large: {
|
|
22104
|
+
fontSize: "medium",
|
|
22105
|
+
padding: subPx(theme.space.x2) + " " + theme.space.x3
|
|
22106
|
+
},
|
|
22107
|
+
medium: {
|
|
22108
|
+
fontSize: "medium",
|
|
22109
|
+
padding: subPx(theme.space.x1) + " " + theme.space.x2
|
|
22110
|
+
}
|
|
22111
|
+
}
|
|
22112
|
+
});
|
|
22022
22113
|
}, space);
|
|
22023
22114
|
var Button = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
22024
22115
|
var children = _a.children,
|
|
@@ -22027,18 +22118,18 @@ var Button = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
|
22027
22118
|
icon = _a.icon,
|
|
22028
22119
|
className = _a.className,
|
|
22029
22120
|
asLink = _a.asLink,
|
|
22030
|
-
|
|
22031
|
-
size = _a$size === void 0 ? "medium" : _a$size,
|
|
22121
|
+
size = _a.size,
|
|
22032
22122
|
props = __rest(_a, ["children", "iconSide", "icon", "className", "asLink", "size"]);
|
|
22033
22123
|
|
|
22034
22124
|
var _useTheme = useTheme(),
|
|
22035
22125
|
smallTextCompressed = _useTheme.lineHeights.smallTextCompressed;
|
|
22036
22126
|
|
|
22127
|
+
var componentSize = useComponentSize(size);
|
|
22037
22128
|
return /*#__PURE__*/React__default.createElement(WrapperButton$2, Object.assign({
|
|
22038
|
-
as: asLink ? "a" :
|
|
22129
|
+
as: asLink ? "a" : "button",
|
|
22039
22130
|
ref: ref,
|
|
22040
22131
|
className: className,
|
|
22041
|
-
size:
|
|
22132
|
+
size: componentSize
|
|
22042
22133
|
}, props), icon && iconSide === "left" && /*#__PURE__*/React__default.createElement(Icon, {
|
|
22043
22134
|
size: smallTextCompressed + "em",
|
|
22044
22135
|
mr: "half",
|
|
@@ -24306,7 +24397,6 @@ var WrapperButton$1 = styled.button.withConfig({
|
|
|
24306
24397
|
position: "relative",
|
|
24307
24398
|
display: "inline-flex",
|
|
24308
24399
|
alignItems: "center",
|
|
24309
|
-
padding: theme.space.half + " " + theme.space.none,
|
|
24310
24400
|
cursor: disabled ? "default" : "pointer"
|
|
24311
24401
|
}, _ref4["" + Text] = {
|
|
24312
24402
|
display: "block",
|
|
@@ -24333,8 +24423,20 @@ var WrapperButton$1 = styled.button.withConfig({
|
|
|
24333
24423
|
boxShadow: theme.shadows.focus
|
|
24334
24424
|
}, _focus["" + HoverText] = {
|
|
24335
24425
|
opacity: "1"
|
|
24336
|
-
}, _focus), _ref4;
|
|
24337
|
-
},
|
|
24426
|
+
}, _focus), _ref4.paddingTop = theme.space.half, _ref4.paddingBottom = theme.space.half, _ref4.paddingLeft = theme.space.none, _ref4.paddingRight = theme.space.none, _ref4;
|
|
24427
|
+
}, variant({
|
|
24428
|
+
prop: "size",
|
|
24429
|
+
variants: {
|
|
24430
|
+
large: {
|
|
24431
|
+
py: "x1",
|
|
24432
|
+
px: "none"
|
|
24433
|
+
},
|
|
24434
|
+
medium: {
|
|
24435
|
+
py: "half",
|
|
24436
|
+
px: "none"
|
|
24437
|
+
}
|
|
24438
|
+
}
|
|
24439
|
+
}), space);
|
|
24338
24440
|
var IconicButton = /*#__PURE__*/React__default.forwardRef(function (_a, forwardedRef) {
|
|
24339
24441
|
var children = _a.children,
|
|
24340
24442
|
_a$color = _a.color,
|
|
@@ -24344,24 +24446,27 @@ var IconicButton = /*#__PURE__*/React__default.forwardRef(function (_a, forwarde
|
|
|
24344
24446
|
icon = _a.icon,
|
|
24345
24447
|
labelHidden = _a.labelHidden,
|
|
24346
24448
|
className = _a.className,
|
|
24347
|
-
iconSize = _a.iconSize,
|
|
24449
|
+
_a$iconSize = _a.iconSize,
|
|
24450
|
+
iconSize = _a$iconSize === void 0 ? "x3" : _a$iconSize,
|
|
24348
24451
|
fontSize = _a.fontSize,
|
|
24349
24452
|
tooltip = _a.tooltip,
|
|
24350
|
-
|
|
24453
|
+
size = _a.size,
|
|
24454
|
+
props = __rest(_a, ["children", "color", "hoverBackgroundColor", "icon", "labelHidden", "className", "iconSize", "fontSize", "tooltip", "size"]);
|
|
24351
24455
|
|
|
24352
|
-
var
|
|
24456
|
+
var componentSize = useComponentSize(size);
|
|
24353
24457
|
return /*#__PURE__*/React__default.createElement(WrapperButton$1, Object.assign({
|
|
24354
24458
|
ref: forwardedRef,
|
|
24355
24459
|
"aria-label": props["aria-label"] ? props["aria-label"] : typeof children === "string" ? children : undefined,
|
|
24356
24460
|
className: className,
|
|
24357
|
-
hoverBackgroundColor: hoverBackgroundColor
|
|
24461
|
+
hoverBackgroundColor: hoverBackgroundColor,
|
|
24462
|
+
size: componentSize
|
|
24358
24463
|
}, props), /*#__PURE__*/React__default.createElement(Manager$1, null, /*#__PURE__*/React__default.createElement(Reference$1, null, function (_ref5) {
|
|
24359
24464
|
var ref = _ref5.ref;
|
|
24360
24465
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
24361
24466
|
ref: ref,
|
|
24362
|
-
size: iconSize
|
|
24467
|
+
size: iconSize
|
|
24363
24468
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
24364
|
-
size:
|
|
24469
|
+
size: iconSize,
|
|
24365
24470
|
icon: icon,
|
|
24366
24471
|
color: color
|
|
24367
24472
|
}));
|
|
@@ -24744,6 +24849,7 @@ var DropdownMenu = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
|
24744
24849
|
children = _a.children,
|
|
24745
24850
|
_a$showArrow = _a.showArrow,
|
|
24746
24851
|
showArrow = _a$showArrow === void 0 ? true : _a$showArrow,
|
|
24852
|
+
size = _a.size,
|
|
24747
24853
|
disabled = _a.disabled,
|
|
24748
24854
|
defaultOpen = _a.defaultOpen,
|
|
24749
24855
|
_a$backgroundColor = _a.backgroundColor,
|
|
@@ -24762,7 +24868,7 @@ var DropdownMenu = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
|
24762
24868
|
closeAriaLabel = _a.closeAriaLabel,
|
|
24763
24869
|
_a$openOnHover = _a.openOnHover,
|
|
24764
24870
|
openOnHover = _a$openOnHover === void 0 ? false : _a$openOnHover,
|
|
24765
|
-
props = __rest(_a, ["trigger", "children", "showArrow", "disabled", "defaultOpen", "backgroundColor", "placement", "className", "id", "boundariesElement", "showDelay", "hideDelay", "openAriaLabel", "closeAriaLabel", "openOnHover"]);
|
|
24871
|
+
props = __rest(_a, ["trigger", "children", "showArrow", "size", "disabled", "defaultOpen", "backgroundColor", "placement", "className", "id", "boundariesElement", "showDelay", "hideDelay", "openAriaLabel", "closeAriaLabel", "openOnHover"]);
|
|
24766
24872
|
|
|
24767
24873
|
var spaceProps = getSubset(props, propTypes.space);
|
|
24768
24874
|
var restProps = omitSubset(props, propTypes.space);
|
|
@@ -24771,6 +24877,7 @@ var DropdownMenu = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
|
24771
24877
|
boundariesElement: boundariesElement
|
|
24772
24878
|
});
|
|
24773
24879
|
}, [boundariesElement]);
|
|
24880
|
+
var componentSize = useComponentSize(size);
|
|
24774
24881
|
return /*#__PURE__*/React__default.createElement(Popper$1, {
|
|
24775
24882
|
trigger: /*#__PURE__*/React__default.cloneElement(trigger(), Object.assign({
|
|
24776
24883
|
type: "button",
|
|
@@ -24795,7 +24902,11 @@ var DropdownMenu = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
|
24795
24902
|
id: id,
|
|
24796
24903
|
backgroundColor: backgroundColor,
|
|
24797
24904
|
showArrow: showArrow
|
|
24798
|
-
}, restProps), children)
|
|
24905
|
+
}, restProps), React__default.Children.map(children, function (child) {
|
|
24906
|
+
return /*#__PURE__*/React__default.cloneElement(child, Object.assign({
|
|
24907
|
+
size: componentSize
|
|
24908
|
+
}, child.props), child.props.children);
|
|
24909
|
+
})));
|
|
24799
24910
|
});
|
|
24800
24911
|
|
|
24801
24912
|
var DropdownButton = styled.button.withConfig({
|
|
@@ -24818,8 +24929,11 @@ var DropdownButton = styled.button.withConfig({
|
|
|
24818
24929
|
lineHeight: theme.lineHeights.base,
|
|
24819
24930
|
fontSize: theme.fontSizes.medium,
|
|
24820
24931
|
transition: ".2s",
|
|
24821
|
-
padding: theme.space.x1 + " " + theme.space.x2 + " " + theme.space.x1 + " 12px",
|
|
24822
24932
|
borderLeft: theme.space.half + " solid transparent",
|
|
24933
|
+
paddingTop: theme.space.x1,
|
|
24934
|
+
paddingRight: theme.space.x2,
|
|
24935
|
+
paddingBottom: theme.space.x1,
|
|
24936
|
+
paddingLeft: "12px",
|
|
24823
24937
|
"&:hover": {
|
|
24824
24938
|
color: theme.colors[hoverColor],
|
|
24825
24939
|
backgroundColor: disabled ? "transparent" : theme.colors[bgHoverColor]
|
|
@@ -24834,7 +24948,23 @@ var DropdownButton = styled.button.withConfig({
|
|
|
24834
24948
|
opacity: ".5"
|
|
24835
24949
|
}
|
|
24836
24950
|
};
|
|
24837
|
-
},
|
|
24951
|
+
}, variant({
|
|
24952
|
+
prop: "size",
|
|
24953
|
+
variants: {
|
|
24954
|
+
large: {
|
|
24955
|
+
pt: "x2",
|
|
24956
|
+
pr: "x2",
|
|
24957
|
+
pb: "x2",
|
|
24958
|
+
pl: "12px"
|
|
24959
|
+
},
|
|
24960
|
+
medium: {
|
|
24961
|
+
pt: "x1",
|
|
24962
|
+
pr: "x2",
|
|
24963
|
+
pb: "x1",
|
|
24964
|
+
pl: "12px"
|
|
24965
|
+
}
|
|
24966
|
+
}
|
|
24967
|
+
}), addStyledProps);
|
|
24838
24968
|
DropdownButton.defaultProps = {
|
|
24839
24969
|
disabled: false,
|
|
24840
24970
|
hoverColor: "darkBlue",
|
|
@@ -24864,7 +24994,6 @@ var DropdownLink = styled.a.withConfig({
|
|
|
24864
24994
|
lineHeight: theme.lineHeights.base,
|
|
24865
24995
|
fontSize: theme.fontSizes.medium,
|
|
24866
24996
|
transition: ".2s",
|
|
24867
|
-
padding: theme.space.x1 + " " + theme.space.x2 + " " + theme.space.x1 + " 12px",
|
|
24868
24997
|
borderLeft: theme.space.half + " solid transparent",
|
|
24869
24998
|
"&:visited": {
|
|
24870
24999
|
color: theme.colors[color]
|
|
@@ -24881,9 +25010,29 @@ var DropdownLink = styled.a.withConfig({
|
|
|
24881
25010
|
},
|
|
24882
25011
|
"&:disabled": {
|
|
24883
25012
|
opacity: ".5"
|
|
24884
|
-
}
|
|
25013
|
+
},
|
|
25014
|
+
paddingTop: theme.space.x1,
|
|
25015
|
+
paddingRight: theme.space.x2,
|
|
25016
|
+
paddingBottom: theme.space.x1,
|
|
25017
|
+
paddingLeft: "12px"
|
|
24885
25018
|
};
|
|
24886
|
-
},
|
|
25019
|
+
}, variant({
|
|
25020
|
+
prop: "size",
|
|
25021
|
+
variants: {
|
|
25022
|
+
large: {
|
|
25023
|
+
pt: "x2",
|
|
25024
|
+
pr: "x2",
|
|
25025
|
+
pb: "x2",
|
|
25026
|
+
pl: "12px"
|
|
25027
|
+
},
|
|
25028
|
+
medium: {
|
|
25029
|
+
pt: "x1",
|
|
25030
|
+
pr: "x2",
|
|
25031
|
+
pb: "x1",
|
|
25032
|
+
pl: "12px"
|
|
25033
|
+
}
|
|
25034
|
+
}
|
|
25035
|
+
}), addStyledProps);
|
|
24887
25036
|
DropdownLink.defaultProps = {
|
|
24888
25037
|
disabled: false,
|
|
24889
25038
|
color: "darkGrey",
|
|
@@ -25850,89 +25999,6 @@ Suffix.defaultProps = {
|
|
|
25850
25999
|
suffixWidth: null
|
|
25851
26000
|
};
|
|
25852
26001
|
|
|
25853
|
-
var StyledInputIcon = styled(Icon).withConfig({
|
|
25854
|
-
displayName: "InputField__StyledInputIcon",
|
|
25855
|
-
componentId: "sc-a97ghf-0"
|
|
25856
|
-
})(function (_ref) {
|
|
25857
|
-
var theme = _ref.theme;
|
|
25858
|
-
return {
|
|
25859
|
-
position: "absolute",
|
|
25860
|
-
right: theme.space.x1,
|
|
25861
|
-
color: theme.colors.darkGrey,
|
|
25862
|
-
bottom: "50%",
|
|
25863
|
-
transform: "translateY(50%)",
|
|
25864
|
-
pointerEvents: "none"
|
|
25865
|
-
};
|
|
25866
|
-
});
|
|
25867
|
-
|
|
25868
|
-
var inputStyles = function inputStyles(theme) {
|
|
25869
|
-
return {
|
|
25870
|
-
disabled: {
|
|
25871
|
-
color: curriedTransparentize(0.33, theme.colors.black),
|
|
25872
|
-
borderColor: theme.colors.lightGrey,
|
|
25873
|
-
backgroundColor: theme.colors.whiteGrey
|
|
25874
|
-
},
|
|
25875
|
-
error: {
|
|
25876
|
-
color: theme.colors.red,
|
|
25877
|
-
borderColor: theme.colors.red
|
|
25878
|
-
},
|
|
25879
|
-
default: {
|
|
25880
|
-
color: theme.colors.black,
|
|
25881
|
-
borderColor: theme.colors.grey
|
|
25882
|
-
}
|
|
25883
|
-
};
|
|
25884
|
-
};
|
|
25885
|
-
|
|
25886
|
-
var getInputStyle = function getInputStyle(_ref2) {
|
|
25887
|
-
var disabled = _ref2.disabled,
|
|
25888
|
-
error = _ref2.error,
|
|
25889
|
-
theme = _ref2.theme;
|
|
25890
|
-
|
|
25891
|
-
if (disabled) {
|
|
25892
|
-
return inputStyles(theme).disabled;
|
|
25893
|
-
}
|
|
25894
|
-
|
|
25895
|
-
if (error) {
|
|
25896
|
-
return inputStyles(theme).error;
|
|
25897
|
-
}
|
|
25898
|
-
|
|
25899
|
-
return inputStyles(theme).default;
|
|
25900
|
-
};
|
|
25901
|
-
|
|
25902
|
-
var StyledInput = styled.input.withConfig({
|
|
25903
|
-
displayName: "InputField__StyledInput",
|
|
25904
|
-
componentId: "sc-a97ghf-1"
|
|
25905
|
-
})(function (_ref3) {
|
|
25906
|
-
var theme = _ref3.theme,
|
|
25907
|
-
inputWidth = _ref3.inputWidth;
|
|
25908
|
-
return {
|
|
25909
|
-
display: "block",
|
|
25910
|
-
flexGrow: 1,
|
|
25911
|
-
border: "1px solid",
|
|
25912
|
-
borderRadius: theme.radii.medium,
|
|
25913
|
-
padding: subPx(theme.space.x1),
|
|
25914
|
-
fontSize: theme.fontSizes.medium,
|
|
25915
|
-
lineHeight: theme.lineHeights.base,
|
|
25916
|
-
margin: theme.space.none,
|
|
25917
|
-
minHeight: theme.space.x5,
|
|
25918
|
-
maxWidth: inputWidth,
|
|
25919
|
-
width: inputWidth,
|
|
25920
|
-
"&:focus": {
|
|
25921
|
-
outline: "none",
|
|
25922
|
-
color: theme.colors.black,
|
|
25923
|
-
borderColor: theme.colors.blue,
|
|
25924
|
-
boxShadow: theme.shadows.focus,
|
|
25925
|
-
" ~ svg": {
|
|
25926
|
-
fill: theme.colors.darkBlue
|
|
25927
|
-
}
|
|
25928
|
-
},
|
|
25929
|
-
"::placeholder": {
|
|
25930
|
-
color: curriedTransparentize(0.4, theme.colors.black)
|
|
25931
|
-
}
|
|
25932
|
-
};
|
|
25933
|
-
}, space, function (props) {
|
|
25934
|
-
return getInputStyle(props);
|
|
25935
|
-
});
|
|
25936
26002
|
var InputField = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
25937
26003
|
var icon = _a.icon,
|
|
25938
26004
|
error = _a.error,
|
|
@@ -25948,8 +26014,11 @@ var InputField = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
25948
26014
|
suffixWidth = _a.suffixWidth,
|
|
25949
26015
|
inputWidth = _a.inputWidth,
|
|
25950
26016
|
iconSize = _a.iconSize,
|
|
25951
|
-
|
|
26017
|
+
size = _a.size,
|
|
26018
|
+
htmlSize = _a.htmlSize,
|
|
26019
|
+
props = __rest(_a, ["icon", "error", "required", "labelText", "requirementText", "helpText", "prefix", "prefixWidth", "prefixAlignment", "suffix", "suffixAlignment", "suffixWidth", "inputWidth", "iconSize", "size", "htmlSize"]);
|
|
25952
26020
|
|
|
26021
|
+
var componentSize = useComponentSize(size);
|
|
25953
26022
|
return /*#__PURE__*/React__default.createElement(MaybeFieldLabel, {
|
|
25954
26023
|
labelText: labelText,
|
|
25955
26024
|
requirementText: requirementText,
|
|
@@ -25971,16 +26040,116 @@ var InputField = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
25971
26040
|
required: required,
|
|
25972
26041
|
error: error,
|
|
25973
26042
|
ref: ref,
|
|
26043
|
+
size: htmlSize,
|
|
26044
|
+
scale: componentSize,
|
|
25974
26045
|
inputWidth: inputWidth
|
|
25975
26046
|
}, props)), icon && /*#__PURE__*/React__default.createElement(StyledInputIcon, {
|
|
25976
26047
|
icon: icon,
|
|
25977
|
-
size: iconSize || "x2"
|
|
26048
|
+
size: iconSize || "x2",
|
|
26049
|
+
scale: componentSize
|
|
25978
26050
|
})), /*#__PURE__*/React__default.createElement(Suffix, {
|
|
25979
26051
|
suffix: suffix,
|
|
25980
26052
|
suffixWidth: suffixWidth,
|
|
25981
26053
|
textAlign: suffixAlignment
|
|
25982
26054
|
})));
|
|
25983
26055
|
});
|
|
26056
|
+
var StyledInput = styled.input.withConfig({
|
|
26057
|
+
displayName: "InputField__StyledInput",
|
|
26058
|
+
componentId: "sc-a97ghf-0"
|
|
26059
|
+
})(function (_ref) {
|
|
26060
|
+
var theme = _ref.theme,
|
|
26061
|
+
inputWidth = _ref.inputWidth;
|
|
26062
|
+
return {
|
|
26063
|
+
display: "block",
|
|
26064
|
+
flexGrow: 1,
|
|
26065
|
+
border: "1px solid",
|
|
26066
|
+
borderRadius: theme.radii.medium,
|
|
26067
|
+
fontSize: theme.fontSizes.medium,
|
|
26068
|
+
lineHeight: theme.lineHeights.base,
|
|
26069
|
+
margin: theme.space.none,
|
|
26070
|
+
minHeight: theme.space.x5,
|
|
26071
|
+
maxWidth: inputWidth,
|
|
26072
|
+
width: inputWidth,
|
|
26073
|
+
"&:focus": {
|
|
26074
|
+
outline: "none",
|
|
26075
|
+
color: theme.colors.black,
|
|
26076
|
+
borderColor: theme.colors.blue,
|
|
26077
|
+
boxShadow: theme.shadows.focus,
|
|
26078
|
+
" ~ svg": {
|
|
26079
|
+
fill: theme.colors.darkBlue
|
|
26080
|
+
}
|
|
26081
|
+
},
|
|
26082
|
+
"::placeholder": {
|
|
26083
|
+
color: curriedTransparentize(0.4, theme.colors.black)
|
|
26084
|
+
},
|
|
26085
|
+
padding: "" + subPx(theme.space.x1)
|
|
26086
|
+
};
|
|
26087
|
+
}, function (_ref2) {
|
|
26088
|
+
var theme = _ref2.theme;
|
|
26089
|
+
return variant({
|
|
26090
|
+
prop: "scale",
|
|
26091
|
+
variants: {
|
|
26092
|
+
large: {
|
|
26093
|
+
padding: "" + subPx(theme.space.x2)
|
|
26094
|
+
},
|
|
26095
|
+
medium: {
|
|
26096
|
+
padding: "" + subPx(theme.space.x1)
|
|
26097
|
+
}
|
|
26098
|
+
}
|
|
26099
|
+
});
|
|
26100
|
+
}, function (_ref3) {
|
|
26101
|
+
var disabled = _ref3.disabled,
|
|
26102
|
+
error = _ref3.error,
|
|
26103
|
+
theme = _ref3.theme;
|
|
26104
|
+
return cssForState({
|
|
26105
|
+
disabled: disabled,
|
|
26106
|
+
error: error,
|
|
26107
|
+
theme: theme
|
|
26108
|
+
});
|
|
26109
|
+
}, space);
|
|
26110
|
+
var StyledInputIcon = styled(Icon).withConfig({
|
|
26111
|
+
displayName: "InputField__StyledInputIcon",
|
|
26112
|
+
componentId: "sc-a97ghf-1"
|
|
26113
|
+
})(function (_ref4) {
|
|
26114
|
+
var theme = _ref4.theme;
|
|
26115
|
+
return {
|
|
26116
|
+
position: "absolute",
|
|
26117
|
+
right: theme.space.x1,
|
|
26118
|
+
color: theme.colors.darkGrey,
|
|
26119
|
+
bottom: "50%",
|
|
26120
|
+
transform: "translateY(50%)",
|
|
26121
|
+
pointerEvents: "none"
|
|
26122
|
+
};
|
|
26123
|
+
}, variant({
|
|
26124
|
+
prop: "scale",
|
|
26125
|
+
variants: {
|
|
26126
|
+
large: {
|
|
26127
|
+
right: "x2"
|
|
26128
|
+
},
|
|
26129
|
+
medium: {
|
|
26130
|
+
right: "x1"
|
|
26131
|
+
}
|
|
26132
|
+
}
|
|
26133
|
+
}));
|
|
26134
|
+
|
|
26135
|
+
var cssForState = function cssForState(_ref5) {
|
|
26136
|
+
var disabled = _ref5.disabled,
|
|
26137
|
+
error = _ref5.error,
|
|
26138
|
+
theme = _ref5.theme;
|
|
26139
|
+
if (disabled) return {
|
|
26140
|
+
color: curriedTransparentize(0.33, theme.colors.black),
|
|
26141
|
+
borderColor: theme.colors.lightGrey,
|
|
26142
|
+
backgroundColor: theme.colors.whiteGrey
|
|
26143
|
+
};
|
|
26144
|
+
if (error) return {
|
|
26145
|
+
color: theme.colors.red,
|
|
26146
|
+
borderColor: theme.colors.red
|
|
26147
|
+
};
|
|
26148
|
+
return {
|
|
26149
|
+
color: theme.colors.black,
|
|
26150
|
+
borderColor: theme.colors.grey
|
|
26151
|
+
};
|
|
26152
|
+
};
|
|
25984
26153
|
|
|
25985
26154
|
var Input = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
25986
26155
|
var errorMessage = _a.errorMessage,
|
|
@@ -26183,10 +26352,12 @@ var renderMenuLink$2 = function renderMenuLink(menuItem, linkOnClick, themeColor
|
|
|
26183
26352
|
target: menuItem.openInNew ? "_blank" : undefined
|
|
26184
26353
|
};
|
|
26185
26354
|
var topLevel = layer === 0;
|
|
26186
|
-
var MenuLink = topLevel ? TopLevelLink : DropdownLink;
|
|
26187
26355
|
return /*#__PURE__*/React__default.createElement("li", {
|
|
26188
26356
|
key: (_a = menuItem.key) !== null && _a !== void 0 ? _a : menuItem.name
|
|
26189
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
26357
|
+
}, topLevel ? /*#__PURE__*/React__default.createElement(TopLevelLink, Object.assign({}, sharedLinkProps), menuItem.name, menuItem.openInNew && /*#__PURE__*/React__default.createElement(Icon, {
|
|
26358
|
+
size: topLevel ? "x3" : "x2",
|
|
26359
|
+
icon: "openInNew"
|
|
26360
|
+
})) : /*#__PURE__*/React__default.createElement(DropdownLink, Object.assign({}, sharedLinkProps), menuItem.name, menuItem.openInNew && /*#__PURE__*/React__default.createElement(Icon, {
|
|
26190
26361
|
size: topLevel ? "x3" : "x2",
|
|
26191
26362
|
icon: "openInNew"
|
|
26192
26363
|
})));
|
|
@@ -26614,33 +26785,73 @@ var BreadcrumbsList = styled.ol.withConfig({
|
|
|
26614
26785
|
};
|
|
26615
26786
|
});
|
|
26616
26787
|
|
|
26617
|
-
var
|
|
26618
|
-
displayName: "
|
|
26788
|
+
var BreadcrumbsListSeparator = styled.li.withConfig({
|
|
26789
|
+
displayName: "BreadcrumbsListItem__BreadcrumbsListSeparator",
|
|
26619
26790
|
componentId: "sc-1ax5rc4-0"
|
|
26620
26791
|
})(function (_ref) {
|
|
26621
26792
|
var theme = _ref.theme;
|
|
26622
26793
|
return {
|
|
26623
26794
|
margin: 0,
|
|
26624
|
-
padding: 0,
|
|
26625
26795
|
listStyle: "none",
|
|
26626
26796
|
display: "inline-flex",
|
|
26627
26797
|
alignSelf: "center",
|
|
26628
26798
|
color: theme.colors.midGrey,
|
|
26629
26799
|
"a, p": {
|
|
26630
|
-
fontSize: theme.fontSizes.
|
|
26800
|
+
fontSize: theme.fontSizes.medium
|
|
26631
26801
|
},
|
|
26632
26802
|
"a:visited": {
|
|
26633
26803
|
color: theme.colors.darkBlue
|
|
26634
26804
|
}
|
|
26635
26805
|
};
|
|
26636
26806
|
}, space, layout, color, flexbox);
|
|
26807
|
+
var BreadcrumbsListItem = styled.li.withConfig({
|
|
26808
|
+
displayName: "BreadcrumbsListItem",
|
|
26809
|
+
componentId: "sc-1ax5rc4-1"
|
|
26810
|
+
})(function (_ref2) {
|
|
26811
|
+
var theme = _ref2.theme;
|
|
26812
|
+
return {
|
|
26813
|
+
margin: 0,
|
|
26814
|
+
listStyle: "none",
|
|
26815
|
+
display: "inline-flex",
|
|
26816
|
+
alignSelf: "center",
|
|
26817
|
+
color: theme.colors.darkBlue,
|
|
26818
|
+
a: {
|
|
26819
|
+
color: theme.colors.darkBlue
|
|
26820
|
+
},
|
|
26821
|
+
"a:visited": {
|
|
26822
|
+
color: theme.colors.darkBlue
|
|
26823
|
+
},
|
|
26824
|
+
"a, p": {
|
|
26825
|
+
padding: theme.space.none,
|
|
26826
|
+
fontSize: theme.fontSizes.small
|
|
26827
|
+
}
|
|
26828
|
+
};
|
|
26829
|
+
}, variant({
|
|
26830
|
+
prop: "size",
|
|
26831
|
+
variants: {
|
|
26832
|
+
large: {
|
|
26833
|
+
"a, p": {
|
|
26834
|
+
py: "x2",
|
|
26835
|
+
px: "x1",
|
|
26836
|
+
fontSize: "medium"
|
|
26837
|
+
}
|
|
26838
|
+
},
|
|
26839
|
+
medium: {
|
|
26840
|
+
"a, p": {
|
|
26841
|
+
py: "0",
|
|
26842
|
+
px: "0",
|
|
26843
|
+
fontSize: "small"
|
|
26844
|
+
}
|
|
26845
|
+
}
|
|
26846
|
+
}
|
|
26847
|
+
}), space, layout, color, flexbox);
|
|
26637
26848
|
|
|
26638
|
-
var insertSeparators = function insertSeparators(items
|
|
26849
|
+
var insertSeparators = function insertSeparators(items) {
|
|
26639
26850
|
return items.reduce(function (acc, current, index) {
|
|
26640
|
-
return acc.concat(current, /*#__PURE__*/React__default.createElement(
|
|
26851
|
+
return acc.concat(current, /*#__PURE__*/React__default.createElement(BreadcrumbsListSeparator, {
|
|
26641
26852
|
"aria-hidden": true,
|
|
26642
26853
|
key: "separator-" + index,
|
|
26643
|
-
className:
|
|
26854
|
+
className: "separator"
|
|
26644
26855
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
26645
26856
|
icon: "rightArrow"
|
|
26646
26857
|
})));
|
|
@@ -26648,22 +26859,19 @@ var insertSeparators = function insertSeparators(items, className) {
|
|
|
26648
26859
|
};
|
|
26649
26860
|
|
|
26650
26861
|
var Breadcrumbs = function Breadcrumbs(_a) {
|
|
26651
|
-
var
|
|
26652
|
-
|
|
26653
|
-
props = __rest(_a, ["
|
|
26862
|
+
var size = _a.size,
|
|
26863
|
+
children = _a.children,
|
|
26864
|
+
props = __rest(_a, ["size", "children"]);
|
|
26654
26865
|
|
|
26866
|
+
var componentSize = useComponentSize(size);
|
|
26655
26867
|
var allItems = React__default.Children.map(children, function (child, index) {
|
|
26656
26868
|
if (! /*#__PURE__*/isValidElement(child)) return null;
|
|
26657
26869
|
return /*#__PURE__*/React__default.createElement(BreadcrumbsListItem, {
|
|
26870
|
+
size: componentSize,
|
|
26658
26871
|
key: "child-" + index
|
|
26659
|
-
},
|
|
26660
|
-
// @ts-ignore
|
|
26661
|
-
color: "darkBlue"
|
|
26662
|
-
}));
|
|
26872
|
+
}, child);
|
|
26663
26873
|
}).filter(Boolean);
|
|
26664
|
-
return /*#__PURE__*/React__default.createElement(Flex, Object.assign({
|
|
26665
|
-
as: as
|
|
26666
|
-
}, props), /*#__PURE__*/React__default.createElement(BreadcrumbsList, null, insertSeparators(allItems, "seperator")));
|
|
26874
|
+
return /*#__PURE__*/React__default.createElement(Flex, Object.assign({}, props), /*#__PURE__*/React__default.createElement(BreadcrumbsList, null, insertSeparators(allItems)));
|
|
26667
26875
|
};
|
|
26668
26876
|
|
|
26669
26877
|
Breadcrumbs.defaultProps = {
|
|
@@ -26862,20 +27070,22 @@ var CheckboxInput = styled.input.withConfig({
|
|
|
26862
27070
|
}), _ref2["&:not(:checked) + " + VisualCheckbox] = Object.assign({}, getCheckboxStyle(props, "unchecked")), _ref2;
|
|
26863
27071
|
});
|
|
26864
27072
|
var Checkbox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
26865
|
-
var
|
|
27073
|
+
var size = props.size,
|
|
27074
|
+
className = props.className,
|
|
26866
27075
|
labelText = props.labelText,
|
|
26867
27076
|
disabled = props.disabled,
|
|
26868
27077
|
checked = props.checked,
|
|
26869
27078
|
required = props.required,
|
|
26870
27079
|
error = props.error,
|
|
26871
27080
|
indeterminate = props.indeterminate;
|
|
27081
|
+
var componentSize = useComponentSize(size);
|
|
26872
27082
|
var spaceProps = getSubset(props, propTypes.space);
|
|
26873
27083
|
var restProps = omitSubset(props, propTypes.space);
|
|
26874
27084
|
return /*#__PURE__*/React__default.createElement(Box, Object.assign({
|
|
26875
27085
|
className: className,
|
|
26876
|
-
py: "half",
|
|
26877
27086
|
px: "0"
|
|
26878
27087
|
}, spaceProps), /*#__PURE__*/React__default.createElement(ClickInputLabel, {
|
|
27088
|
+
size: componentSize,
|
|
26879
27089
|
disabled: disabled
|
|
26880
27090
|
}, /*#__PURE__*/React__default.createElement(CheckboxInput, Object.assign({
|
|
26881
27091
|
type: "checkbox",
|
|
@@ -40389,6 +40599,7 @@ var DatePickerInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
40389
40599
|
onUpKeyPress = _ref.onUpKeyPress,
|
|
40390
40600
|
onDownKeyPress = _ref.onDownKeyPress,
|
|
40391
40601
|
onEnterKeyPress = _ref.onEnterKeyPress,
|
|
40602
|
+
size = _ref.size,
|
|
40392
40603
|
ariaLabel = _ref["aria-label"];
|
|
40393
40604
|
|
|
40394
40605
|
var handleChange = function handleChange(e) {
|
|
@@ -40416,6 +40627,7 @@ var DatePickerInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
40416
40627
|
onBlur: onBlur,
|
|
40417
40628
|
onFocus: onFocus,
|
|
40418
40629
|
ref: ref,
|
|
40630
|
+
size: size,
|
|
40419
40631
|
"aria-label": ariaLabel || t("select a date"),
|
|
40420
40632
|
autoComplete: "off"
|
|
40421
40633
|
}, inputProps, {
|
|
@@ -40538,6 +40750,7 @@ var DEFAULT_PLACEHOLDER$1 = "YYYY-Mon-DD";
|
|
|
40538
40750
|
var DatePicker = /*#__PURE__*/forwardRef(function (_a, datePickerRef) {
|
|
40539
40751
|
var _a$dateFormat = _a.dateFormat,
|
|
40540
40752
|
dateFormat = _a$dateFormat === void 0 ? DEFAULT_DATE_FORMAT : _a$dateFormat,
|
|
40753
|
+
size = _a.size,
|
|
40541
40754
|
errorMessage = _a.errorMessage,
|
|
40542
40755
|
errorList = _a.errorList,
|
|
40543
40756
|
inputProps = _a.inputProps,
|
|
@@ -40551,7 +40764,7 @@ var DatePicker = /*#__PURE__*/forwardRef(function (_a, datePickerRef) {
|
|
|
40551
40764
|
onBlur = _a.onBlur,
|
|
40552
40765
|
onFocus = _a.onFocus,
|
|
40553
40766
|
selected = _a.selected,
|
|
40554
|
-
props = __rest(_a, ["dateFormat", "errorMessage", "errorList", "inputProps", "minDate", "maxDate", "highlightDates", "disableFlipping", "className", "onInputChange", "onChange", "onBlur", "onFocus", "selected"]);
|
|
40767
|
+
props = __rest(_a, ["dateFormat", "size", "errorMessage", "errorList", "inputProps", "minDate", "maxDate", "highlightDates", "disableFlipping", "className", "onInputChange", "onChange", "onBlur", "onFocus", "selected"]);
|
|
40555
40768
|
|
|
40556
40769
|
var _useState = useState(selected),
|
|
40557
40770
|
selectedDate = _useState[0],
|
|
@@ -40561,6 +40774,7 @@ var DatePicker = /*#__PURE__*/forwardRef(function (_a, datePickerRef) {
|
|
|
40561
40774
|
ref = _useState2[0],
|
|
40562
40775
|
setRef = _useState2[1];
|
|
40563
40776
|
|
|
40777
|
+
var componentSize = useComponentSize(size);
|
|
40564
40778
|
useEffect(function () {
|
|
40565
40779
|
registerDatePickerLocales();
|
|
40566
40780
|
});
|
|
@@ -40624,12 +40838,13 @@ var DatePicker = /*#__PURE__*/forwardRef(function (_a, datePickerRef) {
|
|
|
40624
40838
|
};
|
|
40625
40839
|
|
|
40626
40840
|
var customInputProps = Object.assign(Object.assign(Object.assign(Object.assign({}, InputFieldDefaultProps), {
|
|
40627
|
-
inputWidth: "184px",
|
|
40841
|
+
inputWidth: componentSize === "large" ? "240px" : "184px",
|
|
40628
40842
|
error: !!(errorMessage || errorList)
|
|
40629
40843
|
}), inputProps), {
|
|
40630
40844
|
placeholder: inputProps && inputProps.placeholder || (dateFormat === DEFAULT_DATE_FORMAT ? DEFAULT_PLACEHOLDER$1 : dateFormat)
|
|
40631
40845
|
});
|
|
40632
40846
|
var customInput = /*#__PURE__*/React__default.createElement(DatePickerInput, {
|
|
40847
|
+
size: componentSize,
|
|
40633
40848
|
inputProps: customInputProps,
|
|
40634
40849
|
dateFormat: dateFormat,
|
|
40635
40850
|
onInputChange: handleInputChange,
|
|
@@ -40686,7 +40901,8 @@ var RangeContainer = function RangeContainer(_a) {
|
|
|
40686
40901
|
endComponent = _a.endComponent,
|
|
40687
40902
|
_a$errorMessages = _a.errorMessages,
|
|
40688
40903
|
errorMessages = _a$errorMessages === void 0 ? [] : _a$errorMessages,
|
|
40689
|
-
|
|
40904
|
+
size = _a.size,
|
|
40905
|
+
props = __rest(_a, ["labelProps", "startComponent", "endComponent", "errorMessages", "size"]);
|
|
40690
40906
|
|
|
40691
40907
|
var spaceProps = getSubset(props, propTypes.space);
|
|
40692
40908
|
var restProps = omitSubset(props, propTypes.space);
|
|
@@ -40699,10 +40915,9 @@ var RangeContainer = function RangeContainer(_a) {
|
|
|
40699
40915
|
}, /*#__PURE__*/React__default.createElement(Flex, null, startComponent), /*#__PURE__*/React__default.createElement(Flex, {
|
|
40700
40916
|
px: "half",
|
|
40701
40917
|
alignItems: "flex-end",
|
|
40702
|
-
alignSelf: "flex-end"
|
|
40703
|
-
height: "100%"
|
|
40918
|
+
alignSelf: "flex-end"
|
|
40704
40919
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
40705
|
-
lineHeight: "38px"
|
|
40920
|
+
lineHeight: size === "large" ? "56px" : "38px"
|
|
40706
40921
|
}, "-")), /*#__PURE__*/React__default.createElement(Flex, null, endComponent)), errorMessages.map(function (errorMessage, i) {
|
|
40707
40922
|
return (
|
|
40708
40923
|
/*#__PURE__*/
|
|
@@ -40859,27 +41074,44 @@ debounce.debounce = debounce;
|
|
|
40859
41074
|
var debounce_1 = debounce;
|
|
40860
41075
|
debounce_1.debounce;
|
|
40861
41076
|
|
|
40862
|
-
// @ts-nocheck
|
|
40863
41077
|
var TimePickerOption = styled.li.withConfig({
|
|
40864
41078
|
displayName: "TimePickerOption",
|
|
40865
41079
|
componentId: "sc-a59kp-0"
|
|
40866
41080
|
})(function (_ref) {
|
|
40867
41081
|
var theme = _ref.theme,
|
|
40868
|
-
isSelected = _ref.isSelected
|
|
40869
|
-
|
|
40870
|
-
isClosest = _ref.isClosest;
|
|
40871
|
-
return Object.assign({
|
|
40872
|
-
padding: theme.space.x1,
|
|
41082
|
+
isSelected = _ref.isSelected;
|
|
41083
|
+
return {
|
|
40873
41084
|
marginBottom: "0px",
|
|
40874
41085
|
backgroundColor: isSelected ? theme.colors.darkBlue : theme.colors.white,
|
|
40875
41086
|
color: isSelected ? theme.colors.white : theme.colors.black,
|
|
40876
41087
|
"&:hover": {
|
|
40877
41088
|
background: !isSelected && theme.colors.lightBlue
|
|
41089
|
+
},
|
|
41090
|
+
padding: theme.space.x1
|
|
41091
|
+
};
|
|
41092
|
+
}, variant({
|
|
41093
|
+
prop: "size",
|
|
41094
|
+
variants: {
|
|
41095
|
+
large: {
|
|
41096
|
+
px: "x1",
|
|
41097
|
+
py: "x2"
|
|
41098
|
+
},
|
|
41099
|
+
medium: {
|
|
41100
|
+
p: "x1"
|
|
40878
41101
|
}
|
|
40879
|
-
}
|
|
40880
|
-
|
|
40881
|
-
|
|
40882
|
-
|
|
41102
|
+
}
|
|
41103
|
+
}), function (_ref2) {
|
|
41104
|
+
var isSelected = _ref2.isSelected,
|
|
41105
|
+
theme = _ref2.theme,
|
|
41106
|
+
isFocused = _ref2.isFocused,
|
|
41107
|
+
isClosest = _ref2.isClosest;
|
|
41108
|
+
|
|
41109
|
+
if (isFocused || isClosest) {
|
|
41110
|
+
return {
|
|
41111
|
+
background: !isSelected && theme.colors.lightBlue,
|
|
41112
|
+
outline: "none"
|
|
41113
|
+
};
|
|
41114
|
+
}
|
|
40883
41115
|
});
|
|
40884
41116
|
|
|
40885
41117
|
// @ts-nocheck
|
|
@@ -40909,7 +41141,6 @@ var TimePickerDropdown = styled.ul.withConfig({
|
|
|
40909
41141
|
};
|
|
40910
41142
|
});
|
|
40911
41143
|
|
|
40912
|
-
// @ts-nocheck
|
|
40913
41144
|
var TimePickerInput = styled(InputField).withConfig({
|
|
40914
41145
|
displayName: "TimePickerInput",
|
|
40915
41146
|
componentId: "sc-a6tg1z-0"
|
|
@@ -41049,7 +41280,8 @@ var TimePicker = /*#__PURE__*/forwardRef(function (_a, inputRef) {
|
|
|
41049
41280
|
value = _a.value,
|
|
41050
41281
|
error = _a.error,
|
|
41051
41282
|
disabled = _a.disabled,
|
|
41052
|
-
|
|
41283
|
+
size = _a.size,
|
|
41284
|
+
props = __rest(_a, ["timeFormat", "interval", "className", "minTime", "maxTime", "defaultValue", "onInputChange", "onBlur", "onFocus", "errorMessage", "errorList", "labelText", "placeholder", "onClick", "onChange", "aria-label", "value", "error", "disabled", "size"]);
|
|
41053
41285
|
|
|
41054
41286
|
var _useState = useState(defaultValue ? defaultValue : ""),
|
|
41055
41287
|
input = _useState[0],
|
|
@@ -41075,6 +41307,7 @@ var TimePicker = /*#__PURE__*/forwardRef(function (_a, inputRef) {
|
|
|
41075
41307
|
var _useTranslation = useTranslation(),
|
|
41076
41308
|
t = _useTranslation.t;
|
|
41077
41309
|
|
|
41310
|
+
var componentSize = useComponentSize(size);
|
|
41078
41311
|
var scrollToSelection = useCallback(debounce_1(function (currentOption, dropdown) {
|
|
41079
41312
|
var currentIndex = Array.from(dropdown.current.children).indexOf(currentOption);
|
|
41080
41313
|
|
|
@@ -41186,7 +41419,7 @@ var TimePicker = /*#__PURE__*/forwardRef(function (_a, inputRef) {
|
|
|
41186
41419
|
className: "nds-time-picker " + (className || ""),
|
|
41187
41420
|
position: "relative",
|
|
41188
41421
|
ref: onRefChange,
|
|
41189
|
-
width: "130px",
|
|
41422
|
+
width: componentSize === "large" ? "208px" : "130px",
|
|
41190
41423
|
"data-testid": "select-container"
|
|
41191
41424
|
}, props), /*#__PURE__*/React__default.createElement(TimePickerInput, {
|
|
41192
41425
|
labelText: labelText,
|
|
@@ -41202,13 +41435,14 @@ var TimePicker = /*#__PURE__*/forwardRef(function (_a, inputRef) {
|
|
|
41202
41435
|
return handleKeyDown(e);
|
|
41203
41436
|
},
|
|
41204
41437
|
"aria-label": ariaLabel || t("Select a time"),
|
|
41205
|
-
inputWidth: "130px",
|
|
41438
|
+
inputWidth: componentSize === "large" ? "208px" : "130px",
|
|
41206
41439
|
iconSize: "20px",
|
|
41207
41440
|
"data-testid": "select-input",
|
|
41208
41441
|
type: "text",
|
|
41209
41442
|
ref: inputRef,
|
|
41210
41443
|
disabled: disabled,
|
|
41211
|
-
autoComplete: "off"
|
|
41444
|
+
autoComplete: "off",
|
|
41445
|
+
size: componentSize
|
|
41212
41446
|
}), /*#__PURE__*/React__default.createElement(TimePickerDropdown, {
|
|
41213
41447
|
isOpen: dropdownIsOpen,
|
|
41214
41448
|
"aria-expanded": dropdownIsOpen,
|
|
@@ -41231,7 +41465,8 @@ var TimePicker = /*#__PURE__*/forwardRef(function (_a, inputRef) {
|
|
|
41231
41465
|
handleOptionSelection(option);
|
|
41232
41466
|
},
|
|
41233
41467
|
role: "option",
|
|
41234
|
-
"data-testid": "select-option " + closestTestId + " " + selectedTestId
|
|
41468
|
+
"data-testid": "select-option " + closestTestId + " " + selectedTestId,
|
|
41469
|
+
size: componentSize
|
|
41235
41470
|
}, option.label);
|
|
41236
41471
|
})), /*#__PURE__*/React__default.createElement(InlineValidation, {
|
|
41237
41472
|
mt: "x1",
|
|
@@ -41317,7 +41552,8 @@ var DateRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41317
41552
|
locale = _a.locale,
|
|
41318
41553
|
endTimeProps = _a.endTimeProps,
|
|
41319
41554
|
startTimeProps = _a.startTimeProps,
|
|
41320
|
-
|
|
41555
|
+
size = _a.size,
|
|
41556
|
+
props = __rest(_a, ["dateFormat", "onRangeChange", "onStartDateChange", "onEndDateChange", "errorMessage", "startDateErrorMessage", "endDateErrorMessage", "defaultStartDate", "defaultEndDate", "endDateInputProps", "startDateInputProps", "disableRangeValidation", "labelProps", "minDate", "maxDate", "showTimes", "minTime", "maxTime", "defaultStartTime", "defaultEndTime", "onStartTimeChange", "onEndTimeChange", "timeFormat", "interval", "disableFlipping", "locale", "endTimeProps", "startTimeProps", "size"]);
|
|
41321
41557
|
|
|
41322
41558
|
var dateRef1 = useRef();
|
|
41323
41559
|
var dateRef2 = useRef();
|
|
@@ -41344,6 +41580,10 @@ var DateRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41344
41580
|
rangeError = _useState5[0],
|
|
41345
41581
|
setRangeError = _useState5[1];
|
|
41346
41582
|
|
|
41583
|
+
var _useTranslation = useTranslation(),
|
|
41584
|
+
t = _useTranslation.t;
|
|
41585
|
+
|
|
41586
|
+
var componentSize = useComponentSize(size);
|
|
41347
41587
|
useImperativeHandle(ref, function () {
|
|
41348
41588
|
return {
|
|
41349
41589
|
dateRef1: Object.assign(Object.assign({}, dateRef1), {
|
|
@@ -41368,9 +41608,9 @@ var DateRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41368
41608
|
})
|
|
41369
41609
|
};
|
|
41370
41610
|
});
|
|
41371
|
-
|
|
41372
|
-
|
|
41373
|
-
|
|
41611
|
+
useEffect(function () {
|
|
41612
|
+
validateDateRange();
|
|
41613
|
+
}, [startDate, endDate, startTime, endTime]);
|
|
41374
41614
|
|
|
41375
41615
|
var changeStartTimeHandler = function changeStartTimeHandler(label, value) {
|
|
41376
41616
|
setStartTime(value);
|
|
@@ -41439,6 +41679,7 @@ var DateRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41439
41679
|
error: rangeError
|
|
41440
41680
|
}, startDateInputProps);
|
|
41441
41681
|
var startDateInput = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DatePicker, {
|
|
41682
|
+
size: componentSize,
|
|
41442
41683
|
dateFormat: dateFormat,
|
|
41443
41684
|
selected: startDate,
|
|
41444
41685
|
onChange: changeStartDateHandler,
|
|
@@ -41451,6 +41692,7 @@ var DateRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41451
41692
|
disableFlipping: disableFlipping,
|
|
41452
41693
|
ref: dateRef1
|
|
41453
41694
|
}), showTimes && /*#__PURE__*/React__default.createElement(StartTime, Object.assign({
|
|
41695
|
+
size: componentSize,
|
|
41454
41696
|
selected: startTime,
|
|
41455
41697
|
defaultValue: defaultStartTime,
|
|
41456
41698
|
"aria-label": t("select a start time"),
|
|
@@ -41465,6 +41707,7 @@ var DateRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41465
41707
|
error: !!rangeError
|
|
41466
41708
|
}, startTimeProps)));
|
|
41467
41709
|
var endDateInput = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showTimes && /*#__PURE__*/React__default.createElement(EndTime, Object.assign({
|
|
41710
|
+
size: componentSize,
|
|
41468
41711
|
selected: endTime,
|
|
41469
41712
|
defaultValue: defaultEndTime,
|
|
41470
41713
|
minTime: minTime,
|
|
@@ -41478,6 +41721,7 @@ var DateRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41478
41721
|
ref: timeRef2,
|
|
41479
41722
|
error: !!rangeError
|
|
41480
41723
|
}, endTimeProps)), /*#__PURE__*/React__default.createElement(DatePicker, {
|
|
41724
|
+
size: componentSize,
|
|
41481
41725
|
dateFormat: dateFormat,
|
|
41482
41726
|
selected: endDate,
|
|
41483
41727
|
onChange: changeEndDateHandler,
|
|
@@ -41493,10 +41737,8 @@ var DateRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41493
41737
|
disableFlipping: disableFlipping,
|
|
41494
41738
|
ref: dateRef2
|
|
41495
41739
|
}));
|
|
41496
|
-
useEffect(function () {
|
|
41497
|
-
validateDateRange();
|
|
41498
|
-
}, [startDate, endDate, startTime, endTime]);
|
|
41499
41740
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DateRangeStyles, null), /*#__PURE__*/React__default.createElement(RangeContainer, Object.assign({
|
|
41741
|
+
size: componentSize,
|
|
41500
41742
|
labelProps: Object.assign(Object.assign({}, labelProps), {
|
|
41501
41743
|
labelText: labelProps.labelText === DEFAULT_LABEL$1 ? t("date range") : labelProps.labelText
|
|
41502
41744
|
}),
|
|
@@ -48169,6 +48411,17 @@ var Reset = createGlobalStyle(function () {
|
|
|
48169
48411
|
};
|
|
48170
48412
|
});
|
|
48171
48413
|
|
|
48414
|
+
var buildBreakPoints = function buildBreakPoints(breakpointsConfig) {
|
|
48415
|
+
return Object.assign(Object.assign({}, breakpointsConfig), {
|
|
48416
|
+
// We need the map function as a polyfill because the `variant` function
|
|
48417
|
+
// from `styled-system` expects the breakpoints
|
|
48418
|
+
// to be an array and not an object
|
|
48419
|
+
map: function map(fn) {
|
|
48420
|
+
return Object.values(breakpointsConfig).map(fn);
|
|
48421
|
+
}
|
|
48422
|
+
});
|
|
48423
|
+
};
|
|
48424
|
+
|
|
48172
48425
|
var AllNDSGlobalStyles = function AllNDSGlobalStyles(_ref) {
|
|
48173
48426
|
var theme = _ref.theme,
|
|
48174
48427
|
locale = _ref.locale,
|
|
@@ -48189,24 +48442,31 @@ var NDSProvider = function NDSProvider(_ref2) {
|
|
|
48189
48442
|
_ref2$disableGlobalSt = _ref2.disableGlobalStyles,
|
|
48190
48443
|
disableGlobalStyles = _ref2$disableGlobalSt === void 0 ? false : _ref2$disableGlobalSt,
|
|
48191
48444
|
_ref2$locale = _ref2.locale,
|
|
48192
|
-
locale = _ref2$locale === void 0 ? "en_US" : _ref2$locale
|
|
48445
|
+
locale = _ref2$locale === void 0 ? "en_US" : _ref2$locale,
|
|
48446
|
+
_ref2$size = _ref2.size,
|
|
48447
|
+
size = _ref2$size === void 0 ? "medium" : _ref2$size;
|
|
48193
48448
|
useEffect(function () {
|
|
48194
48449
|
i18next.changeLanguage(locale);
|
|
48195
48450
|
}, [locale]);
|
|
48196
48451
|
var mergedTheme = mergeThemes(Theme, theme);
|
|
48452
|
+
var themeWithBreakpoints = Object.assign(Object.assign({}, mergedTheme), {
|
|
48453
|
+
breakpoints: buildBreakPoints(mergedTheme.breakpoints)
|
|
48454
|
+
});
|
|
48197
48455
|
return /*#__PURE__*/React__default.createElement(LocaleContext.Provider, {
|
|
48198
48456
|
value: {
|
|
48199
48457
|
locale: locale
|
|
48200
48458
|
}
|
|
48459
|
+
}, /*#__PURE__*/React__default.createElement(ComponentSizeContextProvider, {
|
|
48460
|
+
size: size
|
|
48201
48461
|
}, /*#__PURE__*/React__default.createElement(AllNDSGlobalStyles, {
|
|
48202
|
-
theme:
|
|
48462
|
+
theme: themeWithBreakpoints,
|
|
48203
48463
|
locale: locale,
|
|
48204
48464
|
disableGlobalStyles: disableGlobalStyles
|
|
48205
48465
|
}, /*#__PURE__*/React__default.createElement(I18nextProvider, {
|
|
48206
48466
|
i18n: i18next
|
|
48207
48467
|
}, /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
48208
|
-
theme:
|
|
48209
|
-
}, children))));
|
|
48468
|
+
theme: themeWithBreakpoints
|
|
48469
|
+
}, children)))));
|
|
48210
48470
|
};
|
|
48211
48471
|
|
|
48212
48472
|
var Overlay = styled(Flex).withConfig({
|
|
@@ -48550,16 +48810,18 @@ var Radio = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
48550
48810
|
checked = _a.checked,
|
|
48551
48811
|
required = _a.required,
|
|
48552
48812
|
error = _a.error,
|
|
48553
|
-
|
|
48813
|
+
size = _a.size,
|
|
48814
|
+
props = __rest(_a, ["className", "labelText", "disabled", "checked", "required", "error", "size"]);
|
|
48554
48815
|
|
|
48816
|
+
var componentSize = useComponentSize(size);
|
|
48555
48817
|
var spaceProps = getSubset(props, propTypes.space);
|
|
48556
48818
|
var restProps = omitSubset(props, propTypes.space);
|
|
48557
48819
|
return /*#__PURE__*/React__default.createElement(Box, Object.assign({
|
|
48558
48820
|
position: "relative",
|
|
48559
48821
|
className: className,
|
|
48560
|
-
py: "half",
|
|
48561
48822
|
px: "0"
|
|
48562
48823
|
}, spaceProps), /*#__PURE__*/React__default.createElement(ClickInputLabel, {
|
|
48824
|
+
size: componentSize,
|
|
48563
48825
|
disabled: disabled
|
|
48564
48826
|
}, /*#__PURE__*/React__default.createElement(RadioInput, Object.assign({
|
|
48565
48827
|
type: "radio",
|
|
@@ -49988,10 +50250,12 @@ var FocusManager = function FocusManager(_ref) {
|
|
|
49988
50250
|
};
|
|
49989
50251
|
|
|
49990
50252
|
var Switcher = function Switcher(_a) {
|
|
49991
|
-
var
|
|
50253
|
+
var size = _a.size,
|
|
50254
|
+
selected = _a.selected,
|
|
49992
50255
|
onChange = _a.onChange,
|
|
49993
|
-
rest = __rest(_a, ["selected", "onChange"]);
|
|
50256
|
+
rest = __rest(_a, ["size", "selected", "onChange"]);
|
|
49994
50257
|
|
|
50258
|
+
var componentSize = useComponentSize(size);
|
|
49995
50259
|
var optionRefs = [];
|
|
49996
50260
|
|
|
49997
50261
|
var isSelected = function isSelected(value, index) {
|
|
@@ -50010,7 +50274,7 @@ var Switcher = function Switcher(_a) {
|
|
|
50010
50274
|
var options = function options(focusedIndex, setFocusedIndex, handleArrowNavigation) {
|
|
50011
50275
|
return React__default.Children.map(rest.children, function (child, index) {
|
|
50012
50276
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
50013
|
-
|
|
50277
|
+
size: componentSize,
|
|
50014
50278
|
tabIndex: index === focusedIndex ? 0 : -1,
|
|
50015
50279
|
selected: isSelected(child.props.value, index),
|
|
50016
50280
|
"aria-selected": isSelected(child.props.value, index),
|
|
@@ -50021,9 +50285,9 @@ var Switcher = function Switcher(_a) {
|
|
|
50021
50285
|
onFocus: function onFocus(e) {
|
|
50022
50286
|
e.stopPropagation();
|
|
50023
50287
|
},
|
|
50024
|
-
onClick: function onClick() {
|
|
50288
|
+
onClick: function onClick(e) {
|
|
50025
50289
|
setFocusedIndex(index);
|
|
50026
|
-
if (onChange) onChange(
|
|
50290
|
+
if (onChange) onChange(e.target.value);
|
|
50027
50291
|
}
|
|
50028
50292
|
});
|
|
50029
50293
|
});
|
|
@@ -50032,7 +50296,7 @@ var Switcher = function Switcher(_a) {
|
|
|
50032
50296
|
return /*#__PURE__*/React__default.createElement(Box, Object.assign({
|
|
50033
50297
|
display: "inline-flex",
|
|
50034
50298
|
bg: "whiteGrey",
|
|
50035
|
-
borderRadius: "
|
|
50299
|
+
borderRadius: "9999px"
|
|
50036
50300
|
}, rest), /*#__PURE__*/React__default.createElement(FocusManager, {
|
|
50037
50301
|
refs: optionRefs,
|
|
50038
50302
|
defaultFocusedIndex: getSelectedIndex()
|
|
@@ -50045,11 +50309,19 @@ var Switcher = function Switcher(_a) {
|
|
|
50045
50309
|
};
|
|
50046
50310
|
|
|
50047
50311
|
Switcher.propTypes = {
|
|
50048
|
-
children: PropTypes.
|
|
50312
|
+
children: PropTypes.arrayOf(PropTypes.element),
|
|
50049
50313
|
selected: PropTypes.string,
|
|
50050
50314
|
onChange: PropTypes.func
|
|
50051
50315
|
};
|
|
50052
50316
|
|
|
50317
|
+
var Switch$1 = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
50318
|
+
var children = _a.children,
|
|
50319
|
+
rest = __rest(_a, ["children"]);
|
|
50320
|
+
|
|
50321
|
+
return /*#__PURE__*/React__default.createElement(SwitchButton, Object.assign({}, rest, {
|
|
50322
|
+
ref: ref
|
|
50323
|
+
}), children);
|
|
50324
|
+
});
|
|
50053
50325
|
var SwitchButton = styled.button.withConfig({
|
|
50054
50326
|
displayName: "Switch__SwitchButton",
|
|
50055
50327
|
componentId: "sc-wsu5uq-0"
|
|
@@ -50057,18 +50329,18 @@ var SwitchButton = styled.button.withConfig({
|
|
|
50057
50329
|
var selected = _ref.selected,
|
|
50058
50330
|
theme = _ref.theme;
|
|
50059
50331
|
return Object.assign(Object.assign(Object.assign({
|
|
50060
|
-
|
|
50061
|
-
padding: theme.space.half + " " + theme.space.x2,
|
|
50332
|
+
margin: 1,
|
|
50062
50333
|
background: selected ? theme.colors.white : "none",
|
|
50063
50334
|
color: selected ? theme.colors.darkBlue : theme.colors.darkGrey,
|
|
50064
50335
|
cursor: "pointer",
|
|
50065
50336
|
border: "none",
|
|
50066
|
-
borderRadius:
|
|
50337
|
+
borderRadius: 9999,
|
|
50067
50338
|
fontSize: theme.fontSizes.medium,
|
|
50068
50339
|
fontWeight: theme.fontWeights.medium,
|
|
50069
50340
|
lineHeight: theme.lineHeights.base,
|
|
50070
50341
|
textDecoration: "none",
|
|
50071
|
-
whiteSpace: "nowrap"
|
|
50342
|
+
whiteSpace: "nowrap",
|
|
50343
|
+
padding: numberFromDimension(theme.space.x1) - 1 + "px " + theme.space.x2
|
|
50072
50344
|
}, selected && {
|
|
50073
50345
|
boxShadow: theme.shadows.small
|
|
50074
50346
|
}), {
|
|
@@ -50081,21 +50353,24 @@ var SwitchButton = styled.button.withConfig({
|
|
|
50081
50353
|
backgroundColor: theme.colors.lightGrey
|
|
50082
50354
|
}
|
|
50083
50355
|
});
|
|
50084
|
-
})
|
|
50085
|
-
|
|
50086
|
-
|
|
50087
|
-
|
|
50088
|
-
|
|
50089
|
-
|
|
50090
|
-
|
|
50091
|
-
|
|
50092
|
-
|
|
50093
|
-
|
|
50356
|
+
}, function (_ref2) {
|
|
50357
|
+
var theme = _ref2.theme;
|
|
50358
|
+
return variant({
|
|
50359
|
+
prop: "size",
|
|
50360
|
+
variants: {
|
|
50361
|
+
large: {
|
|
50362
|
+
padding: numberFromDimension(theme.space.x2) - 1 + "px " + theme.space.x3
|
|
50363
|
+
},
|
|
50364
|
+
medium: {
|
|
50365
|
+
padding: numberFromDimension(theme.space.x1) - 1 + "px " + theme.space.x2
|
|
50366
|
+
}
|
|
50367
|
+
}
|
|
50368
|
+
});
|
|
50094
50369
|
});
|
|
50095
50370
|
Switch$1.propTypes = {
|
|
50096
50371
|
children: PropTypes.node,
|
|
50097
50372
|
selected: PropTypes.bool,
|
|
50098
|
-
value: PropTypes.
|
|
50373
|
+
value: PropTypes.string
|
|
50099
50374
|
};
|
|
50100
50375
|
|
|
50101
50376
|
var barStyles = function barStyles(theme) {
|
|
@@ -50132,11 +50407,11 @@ var getBarStyles = function getBarStyles(selected, theme) {
|
|
|
50132
50407
|
var getBarHoverStyles = function getBarHoverStyles(selected, disabled, theme) {
|
|
50133
50408
|
if (disabled || selected) {
|
|
50134
50409
|
return null;
|
|
50135
|
-
} else {
|
|
50136
|
-
return Object.assign(Object.assign({}, barStyles(theme).expanded), {
|
|
50137
|
-
backgroundColor: theme.colors.lightBlue
|
|
50138
|
-
});
|
|
50139
50410
|
}
|
|
50411
|
+
|
|
50412
|
+
return Object.assign(Object.assign({}, barStyles(theme).expanded), {
|
|
50413
|
+
backgroundColor: theme.colors.lightBlue
|
|
50414
|
+
});
|
|
50140
50415
|
};
|
|
50141
50416
|
|
|
50142
50417
|
var TabButton = styled.button.withConfig({
|
|
@@ -50158,8 +50433,11 @@ var TabButton = styled.button.withConfig({
|
|
|
50158
50433
|
backgroundColor: "transparent",
|
|
50159
50434
|
border: "none",
|
|
50160
50435
|
margin: theme.space.none,
|
|
50161
|
-
padding: theme.space.x1 + " " + theme.space.x3,
|
|
50162
50436
|
position: "relative",
|
|
50437
|
+
paddingTop: theme.space.x1,
|
|
50438
|
+
paddingBottom: theme.space.x1,
|
|
50439
|
+
paddingLeft: theme.space.x3,
|
|
50440
|
+
paddingRight: theme.space.x3,
|
|
50163
50441
|
"&:focus": {
|
|
50164
50442
|
outline: "none",
|
|
50165
50443
|
backgroundColor: theme.colors.lightBlue,
|
|
@@ -50174,7 +50452,19 @@ var TabButton = styled.button.withConfig({
|
|
|
50174
50452
|
"&:before": Object.assign({}, getBarHoverStyles(selected, disabled, theme))
|
|
50175
50453
|
}
|
|
50176
50454
|
};
|
|
50177
|
-
}
|
|
50455
|
+
}, variant({
|
|
50456
|
+
prop: "size",
|
|
50457
|
+
variants: {
|
|
50458
|
+
large: {
|
|
50459
|
+
py: "x2",
|
|
50460
|
+
px: "x4"
|
|
50461
|
+
},
|
|
50462
|
+
medium: {
|
|
50463
|
+
py: "x1",
|
|
50464
|
+
px: "x3"
|
|
50465
|
+
}
|
|
50466
|
+
}
|
|
50467
|
+
}));
|
|
50178
50468
|
var Tab = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
50179
50469
|
var label = _a.label,
|
|
50180
50470
|
props = __rest(_a, ["label"]);
|
|
@@ -50542,7 +50832,9 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
50542
50832
|
var _this$props = this.props,
|
|
50543
50833
|
fitted = _this$props.fitted,
|
|
50544
50834
|
children = _this$props.children,
|
|
50545
|
-
onTabClick = _this$props.onTabClick
|
|
50835
|
+
onTabClick = _this$props.onTabClick,
|
|
50836
|
+
size = _this$props.size;
|
|
50837
|
+
var componentSize = size !== null && size !== void 0 ? size : this.context.size;
|
|
50546
50838
|
var selectedIndex = this.getSelectedIndex();
|
|
50547
50839
|
var tabs = React__default.Children.toArray(children);
|
|
50548
50840
|
return tabs.filter(function (tab) {
|
|
@@ -50569,6 +50861,7 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
50569
50861
|
},
|
|
50570
50862
|
onKeyDown: handleArrowNavigation,
|
|
50571
50863
|
index: index,
|
|
50864
|
+
size: componentSize,
|
|
50572
50865
|
tabIndex: index === focusedIndex ? 0 : -1,
|
|
50573
50866
|
selected: index === selectedIndex,
|
|
50574
50867
|
"aria-selected": index === selectedIndex,
|
|
@@ -50649,6 +50942,7 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
50649
50942
|
return Tabs;
|
|
50650
50943
|
}(React__default.Component);
|
|
50651
50944
|
|
|
50945
|
+
Tabs.contextType = ComponentSizeContext;
|
|
50652
50946
|
Tabs.defaultProps = {
|
|
50653
50947
|
children: null,
|
|
50654
50948
|
className: undefined,
|
|
@@ -50697,12 +50991,12 @@ var StyledTextarea = styled.textarea.withConfig({
|
|
|
50697
50991
|
})(space, function (_ref) {
|
|
50698
50992
|
var theme = _ref.theme,
|
|
50699
50993
|
isResizeable = _ref.isResizeable;
|
|
50994
|
+
_ref.size;
|
|
50700
50995
|
return {
|
|
50701
50996
|
display: "block",
|
|
50702
50997
|
width: "100%",
|
|
50703
50998
|
border: "1px solid",
|
|
50704
50999
|
borderRadius: theme.radii.medium,
|
|
50705
|
-
padding: subPx(theme.space.x1),
|
|
50706
51000
|
fontSize: theme.fontSizes.medium,
|
|
50707
51001
|
lineHeight: theme.lineHeights.base,
|
|
50708
51002
|
minHeight: theme.space.x5,
|
|
@@ -50716,8 +51010,22 @@ var StyledTextarea = styled.textarea.withConfig({
|
|
|
50716
51010
|
},
|
|
50717
51011
|
"::placeholder": {
|
|
50718
51012
|
color: curriedTransparentize(0.4, theme.colors.black)
|
|
50719
|
-
}
|
|
51013
|
+
},
|
|
51014
|
+
padding: "" + subPx(theme.space.x1)
|
|
50720
51015
|
};
|
|
51016
|
+
}, function (_ref2) {
|
|
51017
|
+
var theme = _ref2.theme;
|
|
51018
|
+
return variant({
|
|
51019
|
+
prop: "size",
|
|
51020
|
+
variants: {
|
|
51021
|
+
large: {
|
|
51022
|
+
padding: "" + subPx(theme.space.x2)
|
|
51023
|
+
},
|
|
51024
|
+
medium: {
|
|
51025
|
+
padding: "" + subPx(theme.space.x1)
|
|
51026
|
+
}
|
|
51027
|
+
}
|
|
51028
|
+
});
|
|
50721
51029
|
}, function (props) {
|
|
50722
51030
|
return getTextareaStyle(props);
|
|
50723
51031
|
});
|
|
@@ -50736,8 +51044,10 @@ var Textarea = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
50736
51044
|
rows = _a.rows,
|
|
50737
51045
|
_a$isResizeable = _a.isResizeable,
|
|
50738
51046
|
isResizeable = _a$isResizeable === void 0 ? true : _a$isResizeable,
|
|
50739
|
-
|
|
51047
|
+
size = _a.size,
|
|
51048
|
+
props = __rest(_a, ["errorMessage", "errorList", "error", "required", "labelText", "requirementText", "helpText", "id", "className", "rows", "isResizeable", "size"]);
|
|
50740
51049
|
|
|
51050
|
+
var componentSize = useComponentSize(size);
|
|
50741
51051
|
var spaceProps = getSubset(props, propTypes.space);
|
|
50742
51052
|
var restProps = omitSubset(props, propTypes.space);
|
|
50743
51053
|
return /*#__PURE__*/React__default.createElement(Field, Object.assign({
|
|
@@ -50756,7 +51066,8 @@ var Textarea = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
50756
51066
|
errorList: errorList,
|
|
50757
51067
|
error: error,
|
|
50758
51068
|
rows: rows,
|
|
50759
|
-
isResizeable: isResizeable
|
|
51069
|
+
isResizeable: isResizeable,
|
|
51070
|
+
size: componentSize
|
|
50760
51071
|
}, restProps))), /*#__PURE__*/React__default.createElement(InlineValidation, {
|
|
50761
51072
|
mt: "x1",
|
|
50762
51073
|
errorMessage: errorMessage,
|
|
@@ -50794,7 +51105,8 @@ var TimeRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
50794
51105
|
endAriaLabel = _a.endAriaLabel,
|
|
50795
51106
|
endTimeProps = _a.endTimeProps,
|
|
50796
51107
|
startTimeProps = _a.startTimeProps,
|
|
50797
|
-
|
|
51108
|
+
size = _a.size,
|
|
51109
|
+
props = __rest(_a, ["timeFormat", "onRangeChange", "onStartTimeChange", "onEndTimeChange", "errorMessage", "defaultStartTime", "defaultEndTime", "disableRangeValidation", "labelProps", "minTime", "maxTime", "interval", "startAriaLabel", "endAriaLabel", "endTimeProps", "startTimeProps", "size"]);
|
|
50798
51110
|
|
|
50799
51111
|
var _useState = useState(),
|
|
50800
51112
|
startTime = _useState[0],
|
|
@@ -50810,23 +51122,34 @@ var TimeRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
50810
51122
|
|
|
50811
51123
|
var inputRef1 = useRef();
|
|
50812
51124
|
var inputRef2 = useRef();
|
|
51125
|
+
|
|
51126
|
+
var _useTranslation = useTranslation(),
|
|
51127
|
+
t = _useTranslation.t;
|
|
51128
|
+
|
|
51129
|
+
var componentSize = useComponentSize(size);
|
|
50813
51130
|
useImperativeHandle(ref, function () {
|
|
50814
51131
|
return {
|
|
50815
51132
|
inputRef1: Object.assign(Object.assign({}, inputRef1), {
|
|
50816
51133
|
focus: function focus() {
|
|
50817
|
-
|
|
51134
|
+
if (inputRef1.current) {
|
|
51135
|
+
// @ts-ignore
|
|
51136
|
+
inputRef1.current.focus();
|
|
51137
|
+
}
|
|
50818
51138
|
}
|
|
50819
51139
|
}),
|
|
50820
51140
|
inputRef2: Object.assign(Object.assign({}, inputRef2), {
|
|
50821
51141
|
focus: function focus() {
|
|
50822
|
-
|
|
51142
|
+
if (inputRef2.current) {
|
|
51143
|
+
// @ts-ignore
|
|
51144
|
+
inputRef2.current.focus();
|
|
51145
|
+
}
|
|
50823
51146
|
}
|
|
50824
51147
|
})
|
|
50825
51148
|
};
|
|
50826
51149
|
});
|
|
50827
|
-
|
|
50828
|
-
|
|
50829
|
-
|
|
51150
|
+
useEffect(function () {
|
|
51151
|
+
validateTimeRange();
|
|
51152
|
+
}, [startTime, endTime]);
|
|
50830
51153
|
|
|
50831
51154
|
var changeStartTimeHandler = function changeStartTimeHandler(label, value) {
|
|
50832
51155
|
setStartTime(value);
|
|
@@ -50879,7 +51202,8 @@ var TimeRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
50879
51202
|
"aria-label": startAriaLabel || t("select a start time"),
|
|
50880
51203
|
"data-testid": "timerange-start-time",
|
|
50881
51204
|
ref: inputRef1,
|
|
50882
|
-
error: rangeError
|
|
51205
|
+
error: rangeError,
|
|
51206
|
+
size: componentSize
|
|
50883
51207
|
}, startTimeProps));
|
|
50884
51208
|
var endInput = /*#__PURE__*/React__default.createElement(TimePicker, Object.assign({
|
|
50885
51209
|
timeFormat: timeFormat,
|
|
@@ -50892,19 +51216,17 @@ var TimeRange = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
50892
51216
|
"aria-label": endAriaLabel || t("select an end time"),
|
|
50893
51217
|
"data-testid": "timerange-end-time",
|
|
50894
51218
|
ref: inputRef2,
|
|
50895
|
-
error: rangeError
|
|
51219
|
+
error: rangeError,
|
|
51220
|
+
size: componentSize
|
|
50896
51221
|
}, endTimeProps));
|
|
50897
|
-
useEffect(function () {
|
|
50898
|
-
validateTimeRange();
|
|
50899
|
-
}, [startTime, endTime]);
|
|
50900
51222
|
return /*#__PURE__*/React__default.createElement(RangeContainer, Object.assign({
|
|
50901
51223
|
labelProps: Object.assign(Object.assign({}, labelProps), {
|
|
50902
51224
|
labelText: labelProps.labelText === DEFAULT_LABEL ? t("time range") : labelProps.labelText
|
|
50903
51225
|
}),
|
|
50904
51226
|
startComponent: startInput,
|
|
50905
|
-
selected: endTime,
|
|
50906
51227
|
endComponent: endInput,
|
|
50907
|
-
errorMessages: !disableRangeValidation ? [rangeError, errorMessage] : [errorMessage]
|
|
51228
|
+
errorMessages: !disableRangeValidation ? [rangeError, errorMessage] : [errorMessage],
|
|
51229
|
+
size: componentSize
|
|
50908
51230
|
}, props));
|
|
50909
51231
|
});
|
|
50910
51232
|
TimeRange.defaultProps = {
|
|
@@ -51351,13 +51673,15 @@ var BaseToggle = function BaseToggle(_a) {
|
|
|
51351
51673
|
helpText = _a.helpText,
|
|
51352
51674
|
toggled = _a.toggled,
|
|
51353
51675
|
onClick = _a.onClick,
|
|
51676
|
+
size = _a.size,
|
|
51354
51677
|
dataTestId = _a["data-testid"],
|
|
51355
|
-
props = __rest(_a, ["disabled", "onChange", "onText", "offText", "className", "required", "error", "id", "labelText", "requirementText", "helpText", "toggled", "onClick", "data-testid"]);
|
|
51678
|
+
props = __rest(_a, ["disabled", "onChange", "onText", "offText", "className", "required", "error", "id", "labelText", "requirementText", "helpText", "toggled", "onClick", "size", "data-testid"]);
|
|
51356
51679
|
|
|
51357
51680
|
var handleClick = function handleClick(e) {
|
|
51358
51681
|
if (onClick) onClick(e);
|
|
51359
51682
|
};
|
|
51360
51683
|
|
|
51684
|
+
var componentSize = useComponentSize(size);
|
|
51361
51685
|
var spaceProps = getSubset(props, propTypes.space);
|
|
51362
51686
|
var restProps = omitSubset(props, propTypes.space);
|
|
51363
51687
|
return /*#__PURE__*/React__default.createElement(Field, Object.assign({
|
|
@@ -51370,6 +51694,7 @@ var BaseToggle = function BaseToggle(_a) {
|
|
|
51370
51694
|
requirementText: requirementText,
|
|
51371
51695
|
helpText: helpText
|
|
51372
51696
|
}, /*#__PURE__*/React__default.createElement(ClickInputLabel, {
|
|
51697
|
+
size: componentSize,
|
|
51373
51698
|
as: "div",
|
|
51374
51699
|
onClick: onClick,
|
|
51375
51700
|
disabled: disabled,
|