quicksnack 3.17.1 → 3.20.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.
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const AnimatedCheckmark: React.FC;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
29
+ var __importDefault = (this && this.__importDefault) || function (mod) {
30
+ return (mod && mod.__esModule) ? mod : { "default": mod };
31
+ };
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ exports.AnimatedCheckmark = void 0;
34
+ var react_1 = __importDefault(require("react"));
35
+ var styled_components_1 = __importStar(require("styled-components"));
36
+ var G = styled_components_1.default.g(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fill: none; \n stroke: ", "; \n stroke-width: 10;\n"], ["\n fill: none; \n stroke: ", "; \n stroke-width: 10;\n"])), function (props) { return props.theme.palette.colors.green; });
37
+ var polyLineAnimation = (0, styled_components_1.keyframes)(templateObject_2 || (templateObject_2 = __makeTemplateObject([" \n 0% {\n stroke-dashoffset: 100px\n }\n 100% {\n stroke-dashoffset: 0px\n }\n"], [" \n 0% {\n stroke-dashoffset: 100px\n }\n 100% {\n stroke-dashoffset: 0px\n }\n"])));
38
+ var Polyline = styled_components_1.default.polyline(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n stroke-dasharray: 100px, 100px;\n stroke-dashoffset: 200px;\n animation: ", " 0.25s ease-in-out 0.7s backwards;\n stroke: #fff; \n stroke-width: 10; \n"], ["\n stroke-dasharray: 100px, 100px;\n stroke-dashoffset: 200px;\n animation: ", " 0.25s ease-in-out 0.7s backwards;\n stroke: #fff; \n stroke-width: 10; \n"])), polyLineAnimation);
39
+ var circleAnimation = (0, styled_components_1.keyframes)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n 0% {\n stroke-dashoffset: 480px \n }\n 100% {\n stroke-dashoffset: 960px\n }\n"], ["\n 0% {\n stroke-dashoffset: 480px \n }\n 100% {\n stroke-dashoffset: 960px\n }\n"])));
40
+ var Circle = styled_components_1.default.circle(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n stroke-dasharray: 480px, 480px; \n stroke-dashoffset: 960px;\n animation: ", " 0.6s ease-in-out backwards;\n cx: 77;\n cy: 77;\n r: 72;\n"], ["\n stroke-dasharray: 480px, 480px; \n stroke-dashoffset: 960px;\n animation: ", " 0.6s ease-in-out backwards;\n cx: 77;\n cy: 77;\n r: 72;\n"])), circleAnimation);
41
+ var circleColoredAnimation = (0, styled_components_1.keyframes)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n 0% { \n opacity:0; \n }\n 100% { \n opacity:100; \n }\n"], ["\n 0% { \n opacity:0; \n }\n 100% { \n opacity:100; \n }\n"])));
42
+ var CircleColored = styled_components_1.default.circle(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n stroke-dasharray: 480px, 480px; \n stroke-dashoffset: 960px;\n animation: ", " 0.6s ease-in-out 0.7s backwards;\n fill: ", ";\n cx: 77;\n cy: 77;\n r: 72;\n"], ["\n stroke-dasharray: 480px, 480px; \n stroke-dashoffset: 960px;\n animation: ", " 0.6s ease-in-out 0.7s backwards;\n fill: ", ";\n cx: 77;\n cy: 77;\n r: 72;\n"])), circleColoredAnimation, function (props) { return props.theme.palette.colors.green; });
43
+ var AnimatedCheckmark = function () { return (react_1.default.createElement("svg", { viewBox: "0 0 154 154" },
44
+ react_1.default.createElement(G, null,
45
+ react_1.default.createElement(Circle, null),
46
+ react_1.default.createElement(CircleColored, null),
47
+ react_1.default.createElement(Polyline, { points: "43.5,77.8 63.7,97.9 112.2,49.4" })))); };
48
+ exports.AnimatedCheckmark = AnimatedCheckmark;
49
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -4,6 +4,7 @@ interface Props {
4
4
  icon: JSX.Element;
5
5
  value: string;
6
6
  label: string;
7
+ smallerValue?: boolean;
7
8
  backgroundColor: keyof Theme['palette']['colors'];
8
9
  }
9
10
  export declare const Statistic: React.FC<React.PropsWithChildren<Props>>;
@@ -13,15 +13,15 @@ var styled_components_1 = __importDefault(require("styled-components"));
13
13
  var Box_1 = require("../Box/Box");
14
14
  var Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n border-radius: ", ";\n padding: ", ";\n background-color: ", "; \n box-sizing: border-box;\n height: 100%;\n"], ["\n display: flex;\n border-radius: ", ";\n padding: ", ";\n background-color: ", "; \n box-sizing: border-box;\n height: 100%;\n"])), function (props) { return props.theme.spacing(1); }, function (props) { return props.theme.spacing(4); }, function (props) { return props.theme.palette.colors[props.backgroundColor]; });
15
15
  var Label = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n text-transform: uppercase;\n color: ", ";\n font-size: ", "; \n"], ["\n text-transform: uppercase;\n color: ", ";\n font-size: ", "; \n"])), function (props) { return props.theme.palette.common.white; }, function (props) { return props.theme.spacing(3); });
16
- var Value = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: bold; \n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: bold; \n"])), function (props) { return props.theme.palette.common.white; }, function (props) { return props.theme.spacing(7.5); });
16
+ var Value = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", "; \n font-weight: bold; \n font-size: ", "; \n"], ["\n color: ", "; \n font-weight: bold; \n font-size: ", "; \n"])), function (props) { return props.theme.palette.common.white; }, function (props) { return props.theme.spacing(props.smallerValue ? 5.5 : 7.5); });
17
17
  var IconWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: ", " 0 auto 0; \n & svg {\n height: 100%;\n width: ", ";\n color: white;\n }\n"], ["\n margin: ", " 0 auto 0; \n & svg {\n height: 100%;\n width: ", ";\n color: white;\n }\n"])), function (props) { return props.theme.spacing(1); }, function (props) { return props.theme.spacing(10); });
18
18
  var Statistic = function (_a) {
19
- var icon = _a.icon, value = _a.value, label = _a.label, backgroundColor = _a.backgroundColor;
19
+ var icon = _a.icon, value = _a.value, label = _a.label, backgroundColor = _a.backgroundColor, smallerValue = _a.smallerValue;
20
20
  return (react_1.default.createElement(Wrapper, { backgroundColor: backgroundColor },
21
21
  react_1.default.createElement(IconWrapper, null, icon),
22
22
  react_1.default.createElement(Box_1.Box, { flexGrow: 1, textAlign: "right" },
23
23
  react_1.default.createElement(Label, null, label),
24
- react_1.default.createElement(Value, null, value))));
24
+ react_1.default.createElement(Value, { smallerValue: smallerValue }, value))));
25
25
  };
26
26
  exports.Statistic = Statistic;
27
27
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  interface Props extends React.InputHTMLAttributes<any> {
3
+ dimmed?: boolean;
3
4
  options: Record<string, string>;
4
5
  }
5
6
  export declare const Checkbox: React.FC<React.PropsWithChildren<Props>>;
@@ -14,6 +14,29 @@ var __assign = (this && this.__assign) || function () {
14
14
  };
15
15
  return __assign.apply(this, arguments);
16
16
  };
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
32
+ });
33
+ var __importStar = (this && this.__importStar) || function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
17
40
  var __rest = (this && this.__rest) || function (s, e) {
18
41
  var t = {};
19
42
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -31,18 +54,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31
54
  Object.defineProperty(exports, "__esModule", { value: true });
32
55
  exports.Checkbox = void 0;
33
56
  var react_1 = __importDefault(require("react"));
34
- var styled_components_1 = __importDefault(require("styled-components"));
57
+ var styled_components_1 = __importStar(require("styled-components"));
35
58
  var Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin: 4px 0; \n"], ["\n margin: 4px 0; \n"])));
36
59
  var Label = styled_components_1.default.label(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative; \n"], ["\n position: relative; \n"])));
37
60
  var Input = styled_components_1.default.input(templateObject_3 || (templateObject_3 = __makeTemplateObject([" \n position: absolute;\n top: 0;\n left: 0;\n \n width: 17px;\n height: 17px; \n \n z-index: 99;\n opacity: 0; \n margin-right: ", ";\n transform: translateY(1px);\n \n &~span {\n user-select: none;\n padding-left: 1.85714em;\n cursor: pointer;\n font-size: .92857143em;\n }\n \n &~span:before, &~span:after {\n position: absolute;\n top: 0;\n left: 0;\n width: 17px;\n height: 17px;\n line-height: 17px;\n content: ''; \n border-radius: 4px;\n border: 1px solid rgba(34,36,38,.15);\n z-index:0;\n }\n \n &:checked~span {\n font-style: italic;\n }\n \n &:checked~span:before {\n background: #fff;\n border-color: rgba(34,36,38,.35); \n }\n \n &:checked~span:after { \n font-style: normal; \n text-align: center;\n content: '\\2714';\n opacity: 1;\n color: ", "\n } \n \n &:focus~span:before, &:focus~span:after {\n border-color: #85b7d9;\n border-radius: 4px;\n background: #fff;\n box-shadow: 0 0 0 0 rgba(34,36,38,.35) inset;\n } \n \n &.error~span {\n color: ", "; \n }\n \n &.error~span:before, &.error~span:after {\n background: #fff6f6;\n border-color: #e0b4b4;\n color: #9f3a38;\n } \n"], [" \n position: absolute;\n top: 0;\n left: 0;\n \n width: 17px;\n height: 17px; \n \n z-index: 99;\n opacity: 0; \n margin-right: ", ";\n transform: translateY(1px);\n \n &~span {\n user-select: none;\n padding-left: 1.85714em;\n cursor: pointer;\n font-size: .92857143em;\n }\n \n &~span:before, &~span:after {\n position: absolute;\n top: 0;\n left: 0;\n width: 17px;\n height: 17px;\n line-height: 17px;\n content: ''; \n border-radius: 4px;\n border: 1px solid rgba(34,36,38,.15);\n z-index:0;\n }\n \n &:checked~span {\n font-style: italic;\n }\n \n &:checked~span:before {\n background: #fff;\n border-color: rgba(34,36,38,.35); \n }\n \n &:checked~span:after { \n font-style: normal; \n text-align: center;\n content: '\\\\2714';\n opacity: 1;\n color: ", "\n } \n \n &:focus~span:before, &:focus~span:after {\n border-color: #85b7d9;\n border-radius: 4px;\n background: #fff;\n box-shadow: 0 0 0 0 rgba(34,36,38,.35) inset;\n } \n \n &.error~span {\n color: ", "; \n }\n \n &.error~span:before, &.error~span:after {\n background: #fff6f6;\n border-color: #e0b4b4;\n color: #9f3a38;\n } \n"])), function (props) { return props.theme.spacing(2); }, function (props) { return props.theme.palette.common.black; }, function (props) { return props.theme.palette.form.error; });
61
+ var Span = styled_components_1.default.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) { return props.dimmed ? (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["color: #999c9e;"], ["color: #999c9e;"]))) : ''; });
38
62
  exports.Checkbox = react_1.default.forwardRef(function (_a, ref) {
39
- var options = _a.options, name = _a.name, restProps = __rest(_a, ["options", "name"]);
63
+ var options = _a.options, name = _a.name, dimmed = _a.dimmed, restProps = __rest(_a, ["options", "name", "dimmed"]);
40
64
  return (react_1.default.createElement(react_1.default.Fragment, null, Object.entries(options).map(function (_a) {
41
65
  var value = _a[0], label = _a[1];
42
66
  return (react_1.default.createElement(Wrapper, { key: value },
43
67
  react_1.default.createElement(Label, { key: value },
44
68
  react_1.default.createElement(Input, __assign({ type: "checkbox", value: value, name: name, ref: ref }, restProps)),
45
- react_1.default.createElement("span", null, label))));
69
+ react_1.default.createElement(Span, { dimmed: dimmed }, label))));
46
70
  })));
47
71
  });
48
- var templateObject_1, templateObject_2, templateObject_3;
72
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
package/dist/theme.js CHANGED
@@ -72,7 +72,7 @@ exports.theme = {
72
72
  indigo: '#6610f2',
73
73
  purple: '#6f42c1',
74
74
  pink: '#e83e8c',
75
- red: '#DB636C',
75
+ red: '#e83e3e',
76
76
  orange: '#fd7e14',
77
77
  yellow: '#ffc107',
78
78
  green: '#23B294',
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.17.1",
4
+ "version": "3.20.0",
5
5
  "private": false,
6
6
  "files": [
7
7
  "dist/**"