rescript-polished 1.15.0 → 2.1.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,63 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Mixins between 1`] = `"calc(-40.00px + 14.00vw)"`;
4
-
5
- exports[`Mixins clearfix 1`] = `
6
- Object {
7
- "div::after": Object {
8
- "clear": "both",
9
- "content": "\\"\\"",
10
- "display": "table",
11
- },
12
- }
13
- `;
14
-
15
- exports[`Mixins cover 1`] = `
16
- Object {
17
- "bottom": "16px",
18
- "left": "16px",
19
- "position": "absolute",
20
- "right": "16px",
21
- "top": "16px",
22
- }
23
- `;
24
-
25
- exports[`Mixins ellipsis 1`] = `
26
- Object {
27
- "WebkitBoxOrient": "vertical",
28
- "WebkitLineClamp": 10,
29
- "display": "-webkit-box",
30
- "maxWidth": "16px",
31
- "overflow": "hidden",
32
- "textOverflow": "ellipsis",
33
- "whiteSpace": "normal",
34
- "wordWrap": "normal",
35
- }
36
- `;
37
-
38
- exports[`Mixins fluidRange 1`] = `
39
- Object {
40
- "@media (min-width: 1024px)": Object {
41
- "padding": "20px",
42
- },
43
- "@media (min-width: 320px)": Object {
44
- "padding": "calc(20.00px + 0.00vw)",
45
- },
46
- "padding": "20px",
47
- }
48
- `;
49
-
50
- exports[`Mixins fluidRangeWithArray 1`] = `
51
- Object {
52
- "@media (min-width: 1024px)": Object {
53
- "margin": "32px",
54
- "padding": "32px",
55
- },
56
- "@media (min-width: 320px)": Object {
57
- "margin": "calc(8.73px + 2.27vw)",
58
- "padding": "calc(8.73px + 2.27vw)",
59
- },
60
- "margin": "16px",
61
- "padding": "16px",
62
- }
63
- `;
@@ -1,14 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
-
4
-
5
- var Color;
6
-
7
- var $$Math;
8
-
9
- var Mixins;
10
-
11
- exports.Color = Color;
12
- exports.$$Math = $$Math;
13
- exports.Mixins = Mixins;
14
- /* No side effect */
@@ -1,8 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
-
4
-
5
- var Color;
6
-
7
- exports.Color = Color;
8
- /* No side effect */
@@ -1,140 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
-
4
- var Curry = require("bs-platform/lib/js/curry.js");
5
- var Caml_array = require("bs-platform/lib/js/caml_array.js");
6
- var Belt_Option = require("bs-platform/lib/js/belt_Option.js");
7
- var Caml_format = require("bs-platform/lib/js/caml_format.js");
8
- var Caml_option = require("bs-platform/lib/js/caml_option.js");
9
- var Css_AtomicTypes = require("bs-css/lib/js/src/Css_AtomicTypes.js");
10
- var Polished__Color = require("./Polished__Color.js");
11
-
12
- var regex = "rgba\\(\\s*(-?\\d+|-?\\d*\\.\\d+(?=%))\\s*,\\s*(-?\\d+|-?\\d*\\.\\d+(?=%))\\s*,\\s*(-?\\d+|-?\\d*\\.\\d+(?=%))\\s*,\\s*(-?\\d+|-?\\d*.\\d+)\\s*\\)";
13
-
14
- function rgbaRegexGroups(param, i) {
15
- return [
16
- 1,
17
- 2,
18
- 3,
19
- 4
20
- ].includes(i);
21
- }
22
-
23
- function rgbValue(v) {
24
- return Caml_format.caml_int_of_string(Belt_Option.getExn((v == null) ? undefined : Caml_option.some(v)));
25
- }
26
-
27
- function alphaValue(v) {
28
- return Caml_format.caml_float_of_string((v == null) ? undefined : Caml_option.some(v));
29
- }
30
-
31
- function fromString(string) {
32
- var result = new RegExp(regex).exec(string);
33
- if (result === null) {
34
- return ;
35
- }
36
- var values = result.filter(rgbaRegexGroups);
37
- var red = Caml_format.caml_int_of_string(Belt_Option.getExn(Caml_option.nullable_to_opt(Caml_array.get(values, 0))));
38
- var green = Caml_format.caml_int_of_string(Belt_Option.getExn(Caml_option.nullable_to_opt(Caml_array.get(values, 1))));
39
- var blue = Caml_format.caml_int_of_string(Belt_Option.getExn(Caml_option.nullable_to_opt(Caml_array.get(values, 2))));
40
- var alpha = Caml_format.caml_float_of_string(Caml_option.nullable_to_opt(Caml_array.get(values, 3)));
41
- return Css_AtomicTypes.Color.rgba(red, green, blue, {
42
- NAME: "num",
43
- VAL: alpha
44
- });
45
- }
46
-
47
- var Rgba = {
48
- regex: regex,
49
- rgbaRegexGroups: rgbaRegexGroups,
50
- rgbValue: rgbValue,
51
- alphaValue: alphaValue,
52
- fromString: fromString
53
- };
54
-
55
- function fromString$1(string) {
56
- return {
57
- NAME: "hex",
58
- VAL: string.slice(1, string.length)
59
- };
60
- }
61
-
62
- var Hex = {
63
- fromString: fromString$1
64
- };
65
-
66
- var toString = Css_AtomicTypes.Color.toString;
67
-
68
- function fromString$2(string) {
69
- var match = string.slice(0, 4);
70
- if (match === "rgba") {
71
- return Belt_Option.getExn(fromString(string));
72
- } else {
73
- return fromString$1(string);
74
- }
75
- }
76
-
77
- var Utils = {
78
- Rgba: Rgba,
79
- Hex: Hex,
80
- toString: toString,
81
- fromString: fromString$2
82
- };
83
-
84
- function shade(color, amount) {
85
- return fromString$2(Polished__Color.shade(Curry._1(toString, color), amount));
86
- }
87
-
88
- function tint(color, amount) {
89
- return fromString$2(Polished__Color.tint(Curry._1(toString, color), amount));
90
- }
91
-
92
- function lighten(color, amount) {
93
- return fromString$2(Polished__Color.lighten(Curry._1(toString, color), amount));
94
- }
95
-
96
- function darken(color, amount) {
97
- return fromString$2(Polished__Color.darken(Curry._1(toString, color), amount));
98
- }
99
-
100
- function transparentize(color, amount) {
101
- return fromString(Polished__Color.transparentize(Curry._1(toString, color), amount));
102
- }
103
-
104
- function getContrast(c1, c2) {
105
- return Polished__Color.getContrast(Curry._1(toString, c1), Curry._1(toString, c2));
106
- }
107
-
108
- function getLuminance(color) {
109
- return Polished__Color.getLuminance(Curry._1(toString, color));
110
- }
111
-
112
- function grayscale(color) {
113
- return fromString$2(Polished__Color.grayscale(Curry._1(toString, color)));
114
- }
115
-
116
- function desaturate(color, amount) {
117
- return fromString$2(Polished__Color.desaturate(Curry._1(toString, color), amount));
118
- }
119
-
120
- function complement(color) {
121
- return fromString$2(Polished__Color.complement(Curry._1(toString, color)));
122
- }
123
-
124
- function adjustHue(color, degree) {
125
- return fromString$2(Polished__Color.adjustHue(Curry._1(toString, color), degree));
126
- }
127
-
128
- exports.Utils = Utils;
129
- exports.shade = shade;
130
- exports.tint = tint;
131
- exports.lighten = lighten;
132
- exports.darken = darken;
133
- exports.transparentize = transparentize;
134
- exports.getContrast = getContrast;
135
- exports.getLuminance = getLuminance;
136
- exports.grayscale = grayscale;
137
- exports.desaturate = desaturate;
138
- exports.complement = complement;
139
- exports.adjustHue = adjustHue;
140
- /* Polished__Color Not a pure module */
@@ -1,144 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
-
4
- var Polished = require("polished");
5
-
6
- function shade(color, amount) {
7
- return Polished.shade(amount, color);
8
- }
9
-
10
- function tint(color, amount) {
11
- return Polished.tint(amount, color);
12
- }
13
-
14
- function lighten(color, amount) {
15
- return Polished.lighten(amount, color);
16
- }
17
-
18
- function darken(color, amount) {
19
- return Polished.darken(amount, color);
20
- }
21
-
22
- function hsl(hue, saturation, lightness) {
23
- return Polished.hsl(hue, saturation, lightness);
24
- }
25
-
26
- function adjustHue(color, degree) {
27
- return Polished.adjustHue(degree, color);
28
- }
29
-
30
- function complement(prim) {
31
- return Polished.complement(prim);
32
- }
33
-
34
- function desaturate(color, amount) {
35
- return Polished.desaturate(amount, color);
36
- }
37
-
38
- function getContrast(prim, prim$1) {
39
- return Polished.getContrast(prim, prim$1);
40
- }
41
-
42
- function getLuminance(prim) {
43
- return Polished.getLuminance(prim);
44
- }
45
-
46
- function grayscale(prim) {
47
- return Polished.grayscale(prim);
48
- }
49
-
50
- function hsla(hue, saturation, lightness, alpha) {
51
- return Polished.hsla(hue, saturation, lightness, alpha);
52
- }
53
-
54
- function invert(prim) {
55
- return Polished.invert(prim);
56
- }
57
-
58
- function meetsContrastGuidelines(prim, prim$1) {
59
- return Polished.meetsContrastGuidelines(prim, prim$1);
60
- }
61
-
62
- function transparentize(color, amount) {
63
- return Polished.transparentize(amount, color);
64
- }
65
-
66
- function hslToColorString(prim) {
67
- return Polished.hslToColorString(prim);
68
- }
69
-
70
- function mix(color1, color2, weight) {
71
- return Polished.mix(weight, color1, color2);
72
- }
73
-
74
- function opacify(color, amount) {
75
- return Polished.opacify(amount, color);
76
- }
77
-
78
- function parseToHsl(prim) {
79
- return Polished.parseToHsl(prim);
80
- }
81
-
82
- function parseToRgb(prim) {
83
- return Polished.parseToRgb(prim);
84
- }
85
-
86
- function readableColor(color, lightReturnColorOpt, darkReturnColorOpt, strictOpt, param) {
87
- var lightReturnColor = lightReturnColorOpt !== undefined ? lightReturnColorOpt : "#fff";
88
- var darkReturnColor = darkReturnColorOpt !== undefined ? darkReturnColorOpt : "#000";
89
- var strict = strictOpt !== undefined ? strictOpt : true;
90
- return Polished.readableColor(color, lightReturnColor, darkReturnColor, strict);
91
- }
92
-
93
- function rgb(prim) {
94
- return Polished.rgb(prim);
95
- }
96
-
97
- function rgba(prim) {
98
- return Polished.rgba(prim);
99
- }
100
-
101
- function saturate(color, amount) {
102
- return Polished.saturate(amount, color);
103
- }
104
-
105
- function setHue(color, hue) {
106
- return Polished.setHue(hue, color);
107
- }
108
-
109
- function setLightness(color, lightness) {
110
- return Polished.setLightness(lightness, color);
111
- }
112
-
113
- function setSaturation(color, saturation) {
114
- return Polished.setSaturation(saturation, color);
115
- }
116
-
117
- exports.shade = shade;
118
- exports.tint = tint;
119
- exports.lighten = lighten;
120
- exports.darken = darken;
121
- exports.hsl = hsl;
122
- exports.adjustHue = adjustHue;
123
- exports.complement = complement;
124
- exports.desaturate = desaturate;
125
- exports.getContrast = getContrast;
126
- exports.getLuminance = getLuminance;
127
- exports.grayscale = grayscale;
128
- exports.hsla = hsla;
129
- exports.invert = invert;
130
- exports.meetsContrastGuidelines = meetsContrastGuidelines;
131
- exports.transparentize = transparentize;
132
- exports.hslToColorString = hslToColorString;
133
- exports.mix = mix;
134
- exports.opacify = opacify;
135
- exports.parseToHsl = parseToHsl;
136
- exports.parseToRgb = parseToRgb;
137
- exports.readableColor = readableColor;
138
- exports.rgb = rgb;
139
- exports.rgba = rgba;
140
- exports.saturate = saturate;
141
- exports.setHue = setHue;
142
- exports.setLightness = setLightness;
143
- exports.setSaturation = setSaturation;
144
- /* polished Not a pure module */
@@ -1,11 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
-
4
- var Polished = require("polished");
5
-
6
- function math(prim, prim$1) {
7
- return Polished.math(prim, prim$1);
8
- }
9
-
10
- exports.math = math;
11
- /* polished Not a pure module */
@@ -1,51 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
-
4
- var Polished = require("polished");
5
- var Js_undefined = require("bs-platform/lib/js/js_undefined.js");
6
-
7
- function makeString(s) {
8
- return s;
9
- }
10
-
11
- function makeFloat(i) {
12
- return i;
13
- }
14
-
15
- var Size = {
16
- makeString: makeString,
17
- makeFloat: makeFloat
18
- };
19
-
20
- function between(minScreen, maxScreen, fromSize, toSize, param) {
21
- return Polished.between(fromSize, toSize, minScreen, maxScreen);
22
- }
23
-
24
- function clearFix(parent) {
25
- return Polished.clearFix(parent);
26
- }
27
-
28
- function cover(offset, param) {
29
- return Polished.cover(Js_undefined.fromOption(offset));
30
- }
31
-
32
- function ellipsis(width, lines, param) {
33
- return Polished.ellipsis(Js_undefined.fromOption(width), lines);
34
- }
35
-
36
- function fluidRange(minScreen, maxScreen, cssProp) {
37
- return Polished.fluidRange(cssProp, Js_undefined.fromOption(minScreen), Js_undefined.fromOption(maxScreen));
38
- }
39
-
40
- function fluidRangeWithArray(minScreen, maxScreen, cssProps) {
41
- return Polished.fluidRange(cssProps, Js_undefined.fromOption(minScreen), Js_undefined.fromOption(maxScreen));
42
- }
43
-
44
- exports.Size = Size;
45
- exports.between = between;
46
- exports.clearFix = clearFix;
47
- exports.cover = cover;
48
- exports.ellipsis = ellipsis;
49
- exports.fluidRange = fluidRange;
50
- exports.fluidRangeWithArray = fluidRangeWithArray;
51
- /* polished Not a pure module */