@sproutsocial/seeds-react-mixins 1.0.0 → 2.0.1
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/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +76 -0
- package/dist/index.mjs +47 -0
- package/package.json +14 -15
- package/__flow__/index.flow.js +0 -7
- package/__flow__/index.js +0 -3
- package/commonjs/index.flow.js +0 -1
- package/commonjs/index.js +0 -19
- package/commonjs/index.js.flow +0 -3
- package/dist/types/index.d.ts +0 -6
- package/dist/types/index.d.ts.map +0 -1
- package/lib/index.flow.js +0 -0
- package/lib/index.js +0 -13
- package/lib/index.js.flow +0 -3
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as styled_components from 'styled-components';
|
|
2
|
+
|
|
3
|
+
declare const svgToDataURL: (svgStr: string) => string;
|
|
4
|
+
declare const visuallyHidden: styled_components.FlattenSimpleInterpolation;
|
|
5
|
+
declare const focusRing: styled_components.FlattenSimpleInterpolation;
|
|
6
|
+
declare const pill: styled_components.FlattenSimpleInterpolation;
|
|
7
|
+
declare const disabled: styled_components.FlattenSimpleInterpolation;
|
|
8
|
+
|
|
9
|
+
export { disabled, focusRing, pill, svgToDataURL, visuallyHidden };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as styled_components from 'styled-components';
|
|
2
|
+
|
|
3
|
+
declare const svgToDataURL: (svgStr: string) => string;
|
|
4
|
+
declare const visuallyHidden: styled_components.FlattenSimpleInterpolation;
|
|
5
|
+
declare const focusRing: styled_components.FlattenSimpleInterpolation;
|
|
6
|
+
declare const pill: styled_components.FlattenSimpleInterpolation;
|
|
7
|
+
declare const disabled: styled_components.FlattenSimpleInterpolation;
|
|
8
|
+
|
|
9
|
+
export { disabled, focusRing, pill, svgToDataURL, visuallyHidden };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
disabled: () => disabled,
|
|
24
|
+
focusRing: () => focusRing,
|
|
25
|
+
pill: () => pill,
|
|
26
|
+
svgToDataURL: () => svgToDataURL,
|
|
27
|
+
visuallyHidden: () => visuallyHidden
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(src_exports);
|
|
30
|
+
var import_polished = require("polished");
|
|
31
|
+
var import_styled_components = require("styled-components");
|
|
32
|
+
var import_seeds_react_theme = require("@sproutsocial/seeds-react-theme");
|
|
33
|
+
var svgToDataURL = (svgStr) => {
|
|
34
|
+
const encoded = encodeURIComponent(svgStr).replace(/'/g, "%27").replace(/"/g, "%22");
|
|
35
|
+
const header = "data:image/svg+xml,";
|
|
36
|
+
const dataUrl = header + encoded;
|
|
37
|
+
return dataUrl;
|
|
38
|
+
};
|
|
39
|
+
var visuallyHidden = import_styled_components.css`
|
|
40
|
+
position: absolute;
|
|
41
|
+
width: 1px;
|
|
42
|
+
height: 1px;
|
|
43
|
+
padding: 0;
|
|
44
|
+
margin: -1px;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
clip: rect(0 0 0 0);
|
|
47
|
+
border: 0;
|
|
48
|
+
`;
|
|
49
|
+
var focusRing = import_styled_components.css`
|
|
50
|
+
box-shadow: 0 0 0 1px ${import_seeds_react_theme.theme.colors.button.primary.background.base},
|
|
51
|
+
0 0px 0px 4px
|
|
52
|
+
${(0, import_polished.transparentize)(0.7, import_seeds_react_theme.theme.colors.button.primary.background.base)};
|
|
53
|
+
outline: none;
|
|
54
|
+
|
|
55
|
+
&::-moz-focus-inner {
|
|
56
|
+
border: 0;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
var pill = import_styled_components.css`
|
|
60
|
+
min-width: ${import_seeds_react_theme.theme.space[600]};
|
|
61
|
+
min-height: ${import_seeds_react_theme.theme.space[600]};
|
|
62
|
+
padding: ${import_seeds_react_theme.theme.space[300]};
|
|
63
|
+
border-radius: ${import_seeds_react_theme.theme.radii.pill};
|
|
64
|
+
`;
|
|
65
|
+
var disabled = import_styled_components.css`
|
|
66
|
+
opacity: 0.4;
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
`;
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
disabled,
|
|
72
|
+
focusRing,
|
|
73
|
+
pill,
|
|
74
|
+
svgToDataURL,
|
|
75
|
+
visuallyHidden
|
|
76
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { transparentize } from "polished";
|
|
3
|
+
import { css } from "styled-components";
|
|
4
|
+
import { theme } from "@sproutsocial/seeds-react-theme";
|
|
5
|
+
var svgToDataURL = (svgStr) => {
|
|
6
|
+
const encoded = encodeURIComponent(svgStr).replace(/'/g, "%27").replace(/"/g, "%22");
|
|
7
|
+
const header = "data:image/svg+xml,";
|
|
8
|
+
const dataUrl = header + encoded;
|
|
9
|
+
return dataUrl;
|
|
10
|
+
};
|
|
11
|
+
var visuallyHidden = css`
|
|
12
|
+
position: absolute;
|
|
13
|
+
width: 1px;
|
|
14
|
+
height: 1px;
|
|
15
|
+
padding: 0;
|
|
16
|
+
margin: -1px;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
clip: rect(0 0 0 0);
|
|
19
|
+
border: 0;
|
|
20
|
+
`;
|
|
21
|
+
var focusRing = css`
|
|
22
|
+
box-shadow: 0 0 0 1px ${theme.colors.button.primary.background.base},
|
|
23
|
+
0 0px 0px 4px
|
|
24
|
+
${transparentize(0.7, theme.colors.button.primary.background.base)};
|
|
25
|
+
outline: none;
|
|
26
|
+
|
|
27
|
+
&::-moz-focus-inner {
|
|
28
|
+
border: 0;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
var pill = css`
|
|
32
|
+
min-width: ${theme.space[600]};
|
|
33
|
+
min-height: ${theme.space[600]};
|
|
34
|
+
padding: ${theme.space[300]};
|
|
35
|
+
border-radius: ${theme.radii.pill};
|
|
36
|
+
`;
|
|
37
|
+
var disabled = css`
|
|
38
|
+
opacity: 0.4;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
`;
|
|
41
|
+
export {
|
|
42
|
+
disabled,
|
|
43
|
+
focusRing,
|
|
44
|
+
pill,
|
|
45
|
+
svgToDataURL,
|
|
46
|
+
visuallyHidden
|
|
47
|
+
};
|
package/package.json
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/seeds-react-mixins",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Seeds
|
|
5
|
-
"main": "commonjs/index.js",
|
|
6
|
-
"module": "lib/index.mjs",
|
|
7
|
-
"types": "dist/types/index.d.ts",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Seeds mixins",
|
|
8
5
|
"author": "Sprout Social, Inc.",
|
|
9
6
|
"license": "MIT",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.mjs",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
|
-
"
|
|
12
|
-
"commonjs",
|
|
13
|
-
"dist",
|
|
14
|
-
"lib"
|
|
11
|
+
"dist"
|
|
15
12
|
],
|
|
16
13
|
"scripts": {
|
|
17
|
-
"build": "
|
|
18
|
-
"build:ts-declarations": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json"
|
|
14
|
+
"build": "tsup"
|
|
19
15
|
},
|
|
20
16
|
"dependencies": {
|
|
21
|
-
"@sproutsocial/seeds-react-theme": "1.0.0"
|
|
17
|
+
"@sproutsocial/seeds-react-theme": "1.0.0",
|
|
18
|
+
"polished": "^3.4.1"
|
|
22
19
|
},
|
|
23
20
|
"devDependencies": {
|
|
24
21
|
"@sproutsocial/eslint-config-seeds": "*",
|
|
25
|
-
"@sproutsocial/seeds-build-flow": "*",
|
|
26
|
-
"polished": "^3.4.1",
|
|
27
22
|
"react": "^17.0.2",
|
|
23
|
+
"styled-components": "^5.2.3",
|
|
28
24
|
"typescript": "^5.1.6",
|
|
29
|
-
"
|
|
25
|
+
"tsup": "^8.0.1"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"styled-components": "^5.2.3"
|
|
30
29
|
},
|
|
31
30
|
"engines": {
|
|
32
31
|
"node": ">=18"
|
package/__flow__/index.flow.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import type { CSSRules } from "styled-components";
|
|
3
|
-
declare export var svgToDataURL: (svgStr: string) => string;
|
|
4
|
-
declare export var visuallyHidden: CSSRules;
|
|
5
|
-
declare export var focusRing: CSSRules;
|
|
6
|
-
declare export var pill: CSSRules;
|
|
7
|
-
declare export var disabled: CSSRules;
|
package/__flow__/index.js
DELETED
package/commonjs/index.flow.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/commonjs/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.visuallyHidden = exports.svgToDataURL = exports.pill = exports.focusRing = exports.disabled = void 0;
|
|
7
|
-
var _polished = require("polished");
|
|
8
|
-
var _styledComponents = require("styled-components");
|
|
9
|
-
var _seedsReactTheme = require("@sproutsocial/seeds-react-theme");
|
|
10
|
-
var svgToDataURL = exports.svgToDataURL = function svgToDataURL(svgStr) {
|
|
11
|
-
var encoded = encodeURIComponent(svgStr).replace(/'/g, "%27").replace(/"/g, "%22");
|
|
12
|
-
var header = "data:image/svg+xml,";
|
|
13
|
-
var dataUrl = header + encoded;
|
|
14
|
-
return dataUrl;
|
|
15
|
-
};
|
|
16
|
-
var visuallyHidden = exports.visuallyHidden = (0, _styledComponents.css)(["position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0;"]);
|
|
17
|
-
var focusRing = exports.focusRing = (0, _styledComponents.css)(["box-shadow:0 0 0 1px ", ",0 0px 0px 4px ", ";outline:none;&::-moz-focus-inner{border:0;}"], _seedsReactTheme.theme.colors.button.primary.background.base, (0, _polished.transparentize)(0.7, _seedsReactTheme.theme.colors.button.primary.background.base));
|
|
18
|
-
var pill = exports.pill = (0, _styledComponents.css)(["min-width:", ";min-height:", ";padding:", ";border-radius:", ";"], _seedsReactTheme.theme.space[600], _seedsReactTheme.theme.space[600], _seedsReactTheme.theme.space[300], _seedsReactTheme.theme.radii.pill);
|
|
19
|
-
var disabled = exports.disabled = (0, _styledComponents.css)(["opacity:0.4;pointer-events:none;"]);
|
package/commonjs/index.js.flow
DELETED
package/dist/types/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const svgToDataURL: (svgStr: string) => string;
|
|
2
|
-
export declare const visuallyHidden: import("styled-components").FlattenSimpleInterpolation;
|
|
3
|
-
export declare const focusRing: import("styled-components").FlattenSimpleInterpolation;
|
|
4
|
-
export declare const pill: import("styled-components").FlattenSimpleInterpolation;
|
|
5
|
-
export declare const disabled: import("styled-components").FlattenSimpleInterpolation;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,WAAY,MAAM,WAS1C,CAAC;AAEF,eAAO,MAAM,cAAc,wDAS1B,CAAC;AAEF,eAAO,MAAM,SAAS,wDASrB,CAAC;AAEF,eAAO,MAAM,IAAI,wDAKhB,CAAC;AAEF,eAAO,MAAM,QAAQ,wDAGpB,CAAC"}
|
package/lib/index.flow.js
DELETED
|
File without changes
|
package/lib/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { transparentize } from "polished";
|
|
2
|
-
import { css } from "styled-components";
|
|
3
|
-
import { theme } from "@sproutsocial/seeds-react-theme";
|
|
4
|
-
export var svgToDataURL = function svgToDataURL(svgStr) {
|
|
5
|
-
var encoded = encodeURIComponent(svgStr).replace(/'/g, "%27").replace(/"/g, "%22");
|
|
6
|
-
var header = "data:image/svg+xml,";
|
|
7
|
-
var dataUrl = header + encoded;
|
|
8
|
-
return dataUrl;
|
|
9
|
-
};
|
|
10
|
-
export var visuallyHidden = css(["position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0;"]);
|
|
11
|
-
export var focusRing = css(["box-shadow:0 0 0 1px ", ",0 0px 0px 4px ", ";outline:none;&::-moz-focus-inner{border:0;}"], theme.colors.button.primary.background.base, transparentize(0.7, theme.colors.button.primary.background.base));
|
|
12
|
-
export var pill = css(["min-width:", ";min-height:", ";padding:", ";border-radius:", ";"], theme.space[600], theme.space[600], theme.space[300], theme.radii.pill);
|
|
13
|
-
export var disabled = css(["opacity:0.4;pointer-events:none;"]);
|
package/lib/index.js.flow
DELETED