@typeolymp/ui-components 1.19.1 → 1.19.3

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/build/index.js CHANGED
@@ -8252,11 +8252,32 @@ var DataSummary = function (_a) {
8252
8252
  }) })] }) }));
8253
8253
  };
8254
8254
 
8255
- var Container$o = styled__default["default"].div(templateObject_1$G || (templateObject_1$G = __makeTemplateObject$1(["\n padding: 7px 10px;\n background-color: ", ";\n box-shadow: 0 2px 0 ", ";\n border: 1px solid ", ";\n border-radius: 4px;\n box-sizing: border-box;\n text-decoration: none;\n\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: normal;\n color: ", ";\n"], ["\n padding: 7px 10px;\n background-color: ", ";\n box-shadow: 0 2px 0 ", ";\n border: 1px solid ", ";\n border-radius: 4px;\n box-sizing: border-box;\n text-decoration: none;\n\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: normal;\n color: ", ";\n"])), theme.colors.lightGray.base, theme.colors.lightGray.darker, theme.colors.lightGray.darker, theme.fonts.paragraph, theme.subheading.small.fontSize, theme.subheading.small.fontWeight, theme.colors.darkGray.light);
8255
+ var Container$o = styled__default["default"].div(templateObject_1$G || (templateObject_1$G = __makeTemplateObject$1(["\n padding: 7px 10px;\n background-color: ", ";\n box-shadow: ", ";\n border: 1px solid;\n border-color: ", ";\n border-radius: 4px;\n box-sizing: border-box;\n text-decoration: none;\n\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: normal;\n color: ", ";\n"], ["\n padding: 7px 10px;\n background-color: ", ";\n box-shadow: ", ";\n border: 1px solid;\n border-color: ", ";\n border-radius: 4px;\n box-sizing: border-box;\n text-decoration: none;\n\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: normal;\n color: ", ";\n"])), function (_a) {
8256
+ var color = _a.color;
8257
+ if (!color)
8258
+ return theme.colors.lightGray.base;
8259
+ return theme.colors[color].light;
8260
+ }, function (_a) {
8261
+ var color = _a.color;
8262
+ if (!color)
8263
+ return "0 2px 0 ".concat(theme.colors.lightGray.darker);
8264
+ return "0 2px 0 ".concat(theme.colors[color].dark);
8265
+ }, function (_a) {
8266
+ var color = _a.color;
8267
+ if (!color)
8268
+ return theme.colors.lightGray.darker;
8269
+ return theme.colors[color].dark;
8270
+ }, theme.fonts.paragraph, theme.subheading.small.fontSize, theme.subheading.small.fontWeight, function (_a) {
8271
+ var color = _a.color;
8272
+ if (!color)
8273
+ return theme.colors.darkGray.light;
8274
+ return theme.colors[color].darker;
8275
+ });
8256
8276
  var templateObject_1$G;
8257
8277
 
8258
- var Tag = function (props) {
8259
- return jsxRuntime.jsx(Container$o, { children: props.children });
8278
+ var Tag = function (_a) {
8279
+ var color = _a.color, children = _a.children;
8280
+ return jsxRuntime.jsx(Container$o, __assign$2({ color: color }, { children: children }));
8260
8281
  };
8261
8282
 
8262
8283
  var Container$n = styled__default["default"].div(templateObject_1$F || (templateObject_1$F = __makeTemplateObject$1(["\n width: 46px;\n min-width: 46px;\n max-width: 46px;\n height: 27px;\n min-height: 27px;\n max-height: 27px;\n border-radius: 14px;\n cursor: ", ";\n position: relative;\n background-color: ", ";\n\n :after {\n content: \"\";\n width: 21px;\n height: 21px;\n border-radius: 50%;\n position: absolute;\n top: 3px;\n right: ", ";\n left: ", ";\n background-color: ", ";\n }\n\n input {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"], ["\n width: 46px;\n min-width: 46px;\n max-width: 46px;\n height: 27px;\n min-height: 27px;\n max-height: 27px;\n border-radius: 14px;\n cursor: ", ";\n position: relative;\n background-color: ", ";\n\n :after {\n content: \"\";\n width: 21px;\n height: 21px;\n border-radius: 50%;\n position: absolute;\n top: 3px;\n right: ", ";\n left: ", ";\n background-color: ", ";\n }\n\n input {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {
@@ -47849,8 +47870,11 @@ var TimeChart = function (_a) {
47849
47870
  };
47850
47871
 
47851
47872
  var Chart = function (_a) {
47852
- var type = _a.type, locale = _a.locale, exerciseResults = _a.exerciseResults, nExercisesInCourse = _a.nExercisesInCourse;
47853
- var _b = React$3.useState(Period.TODAY), period = _b[0], setPeriod = _b[1];
47873
+ var type = _a.type, locale = _a.locale, exerciseResults = _a.exerciseResults, _b = _a.defaultPeriod, defaultPeriod = _b === void 0 ? Period.TODAY : _b, onChangePeriod = _a.onChangePeriod, nExercisesInCourse = _a.nExercisesInCourse;
47874
+ var _c = React$3.useState(defaultPeriod), period = _c[0], setPeriod = _c[1];
47875
+ React$3.useEffect(function () {
47876
+ setPeriod(defaultPeriod);
47877
+ }, [defaultPeriod]);
47854
47878
  var periods = [
47855
47879
  { value: Period.TODAY, label: translations[locale]["Today"] },
47856
47880
  { value: Period.LAST_7_DAYS, label: translations[locale]["Last 7 days"] },
@@ -47890,10 +47914,13 @@ var Chart = function (_a) {
47890
47914
  justifyContent: "space-between",
47891
47915
  marginBottom: 10,
47892
47916
  padding: "0 15px 0 5px",
47893
- } }, { children: [jsxRuntime.jsx(Heading, __assign$2({ type: "h3" }, { children: titles[type] })), jsxRuntime.jsx(Select, __assign$2({ defaultValue: period, onChange: function (value) { return setPeriod(value); }, id: "period", name: "period" }, { children: periods.map(function (_a) {
47917
+ } }, { children: [jsxRuntime.jsx(Heading, __assign$2({ type: "h3" }, { children: titles[type] })), jsxRuntime.jsx(Select, __assign$2({ defaultValue: period, onChange: function (value) {
47918
+ setPeriod(value);
47919
+ onChangePeriod(value);
47920
+ }, id: "period", name: "period" }, { children: periods.map(function (_a) {
47894
47921
  var value = _a.value, label = _a.label;
47895
47922
  return (jsxRuntime.jsx("option", __assign$2({ value: value }, { children: label }), value));
47896
- }) }))] })), renderChart()] }));
47923
+ }) }), period)] })), renderChart()] }));
47897
47924
  };
47898
47925
 
47899
47926
  var StyledTextarea = styled__default["default"].textarea(templateObject_1$a || (templateObject_1$a = __makeTemplateObject$1(["\n width: 100%;\n min-width: 228px;\n min-height: 50px;\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n resize: vertical;\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"], ["\n width: 100%;\n min-width: 228px;\n min-height: 50px;\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n resize: vertical;\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {