quicksnack 3.11.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import { FormGridCellProps } from "./FormGridCell";
3
3
  export interface FormGridWrapperProps extends FormGridCellProps {
4
+ isRequired?: boolean;
4
5
  label?: string | JSX.Element;
5
6
  hint?: string | JSX.Element;
6
7
  error?: string | JSX.Element;
7
8
  }
8
- export declare const getFormGridWrapperProps: ({ position, align, label, hint, error }: FormGridWrapperProps) => FormGridWrapperProps;
9
+ export declare const getFormGridWrapperProps: ({ position, align, label, hint, error, isRequired }: FormGridWrapperProps) => FormGridWrapperProps;
9
10
  export declare const FormGridWrapper: React.FC<FormGridWrapperProps>;
@@ -15,15 +15,17 @@ var Label = styled_components_1.default.label(templateObject_1 || (templateObjec
15
15
  var Hint = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", ";\n margin: ", ";\n line-height: 1.4em;\n font-size: .92857143em; \n"], ["\n color: ", ";\n margin: ", ";\n line-height: 1.4em;\n font-size: .92857143em; \n"])), (function (props) { return !!props.error ? "#da9796;" : props.theme.palette.form.hint; }), function (props) { return props.theme.spacing(-1, 0, 1, 0); });
16
16
  var Error = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject([" \n color: ", "; \n margin: ", ";\n font-weight: bold; \n font-style: italic; \n line-height: 1.4em;\n font-size: .92857143em; \n"], [" \n color: ", "; \n margin: ", ";\n font-weight: bold; \n font-style: italic; \n line-height: 1.4em;\n font-size: .92857143em; \n"])), function (props) { return props.theme.palette.form.error; }, function (props) { return props.theme.spacing(1, 0, 0, 0); });
17
17
  var getFormGridWrapperProps = function (_a) {
18
- var position = _a.position, align = _a.align, label = _a.label, hint = _a.hint, error = _a.error;
19
- return ({ position: position, align: align, label: label, hint: hint, error: error });
18
+ var position = _a.position, align = _a.align, label = _a.label, hint = _a.hint, error = _a.error, isRequired = _a.isRequired;
19
+ return ({ position: position, align: align, label: label, hint: hint, error: error, isRequired: isRequired });
20
20
  };
21
21
  exports.getFormGridWrapperProps = getFormGridWrapperProps;
22
22
  var FormGridWrapper = function (_a) {
23
- var position = _a.position, align = _a.align, label = _a.label, hint = _a.hint, error = _a.error, children = _a.children;
23
+ var position = _a.position, align = _a.align, label = _a.label, hint = _a.hint, error = _a.error, isRequired = _a.isRequired, children = _a.children;
24
24
  return (react_1.default.createElement(react_1.default.Fragment, null,
25
25
  react_1.default.createElement(FormGridCell_1.FormGridCell, { position: position, align: align, className: 'form-grid-cell__label-hint' },
26
- label && (react_1.default.createElement(Label, { error: error }, label)),
26
+ label && (react_1.default.createElement(Label, { error: error },
27
+ label,
28
+ isRequired && react_1.default.createElement(react_1.default.Fragment, null, " *"))),
27
29
  hint && (react_1.default.createElement(Hint, { error: error }, hint))),
28
30
  react_1.default.createElement(FormGridCell_1.FormGridCell, { position: position, align: align, rowOffset: 1, className: 'form-grid-cell__field-error' },
29
31
  children,
@@ -10,6 +10,7 @@ export declare const scaffoldProps: {
10
10
  type: "TextField";
11
11
  props: {
12
12
  label: string;
13
+ isRequired: true;
13
14
  hint: string;
14
15
  };
15
16
  };
@@ -13,6 +13,7 @@ exports.scaffoldProps = new FormPositioner_1.FormPositioner({
13
13
  type: "TextField",
14
14
  props: {
15
15
  label: "Last name",
16
+ isRequired: true,
16
17
  hint: "Integer posuere erat a ante venenatis dapibus posuere velit aliquet.",
17
18
  }
18
19
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quicksnack",
3
3
  "description": "Quickly create beautiful admin layouts using react",
4
- "version": "3.11.0",
4
+ "version": "3.12.0",
5
5
  "private": false,
6
6
  "files": [
7
7
  "dist/**"