@sproutsocial/seeds-react-mixins 1.0.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,7 @@
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;
@@ -0,0 +1,3 @@
1
+ // @flow
2
+ export * from './index.flow';
3
+
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,19 @@
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;"]);
@@ -0,0 +1,3 @@
1
+ // @flow
2
+ export * from '../__flow__';
3
+
@@ -0,0 +1,6 @@
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
@@ -0,0 +1 @@
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"}
File without changes
package/lib/index.js ADDED
@@ -0,0 +1,13 @@
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;"]);
@@ -0,0 +1,3 @@
1
+ // @flow
2
+ export * from '../__flow__';
3
+
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@sproutsocial/seeds-react-mixins",
3
+ "version": "1.0.0",
4
+ "description": "Seeds Utilities",
5
+ "main": "commonjs/index.js",
6
+ "module": "lib/index.mjs",
7
+ "types": "dist/types/index.d.ts",
8
+ "author": "Sprout Social, Inc.",
9
+ "license": "MIT",
10
+ "files": [
11
+ "__flow__",
12
+ "commonjs",
13
+ "dist",
14
+ "lib"
15
+ ],
16
+ "scripts": {
17
+ "build": "yarn build:ts-declarations && tsx scripts/build.ts",
18
+ "build:ts-declarations": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json"
19
+ },
20
+ "dependencies": {
21
+ "@sproutsocial/seeds-react-theme": "1.0.0"
22
+ },
23
+ "devDependencies": {
24
+ "@sproutsocial/eslint-config-seeds": "*",
25
+ "@sproutsocial/seeds-build-flow": "*",
26
+ "polished": "^3.4.1",
27
+ "react": "^17.0.2",
28
+ "typescript": "^5.1.6",
29
+ "tsx": "3.13.0"
30
+ },
31
+ "engines": {
32
+ "node": ">=18"
33
+ }
34
+ }