@symbo.ls/init 1.0.7 → 1.0.10

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 @@
1
+ {"version":"0.0.1","COLOR":{"transparent":"rgba(0, 0, 0, 0)","black":"black","blue":"#0079FD","indigo":"#50E1FF","green":"#59AC56","red":"#FE5B47","yellow":"#EDCB38","orange":"#E2862F","brown":"#7D6755","pink":"#FD8ABF","purple":"#7345AF","white":"white"},"GRADIENT":{"gradient-dark":"linear-gradient(0deg,\n rgba(0,0,0,0.06) 0%,\n rgba(0,0,0,0.07) 100%\n )","gradient-dark-active":"linear-gradient(0deg,\n rgba(0,0,0,0.09) 0%,\n rgba(0,0,0,0.1) 100%\n )","gradient-light":"linear-gradient(\n 0deg,\n rgba(255,255,255,0.05) 0%,\n rgba(255,255,255,0.06) 100%\n )","gradient-light-active":"linear-gradient(\n 0deg,\n rgba(255,255,255,0.09) 0%,\n rgba(255,255,255,0.10) 100%\n )"},"THEME":{"document":{"variants":{"light":{"color":"black","background":"white"},"dark":{"color":"white","background":"black"}}},"primary":{"color":"white","background":"blue"},"secondary":{"variants":{"light":{"color":"white","background":"gradient-light"},"dark":{"color":"white","background":"gradient-dark-active"}}}},"FONT":{"Karla":[{"url":"https://symbols-fonts.s3.us-west-1.amazonaws.com/Karla/Karla-VariableFont_wght.ttf","fontWeight":"variable","fontStyle":"normal","fontDisplay":"swap","unicodeRange":"U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF"},{"url":"https://symbols-fonts.s3.us-west-1.amazonaws.com/Karla/Karla-VariableFont_wght.ttf","fontStyle":"normal","fontWeight":"variable","fontDisplay":"swap","unicodeRange":"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"}]},"FONT_FAMILY":{"StartWithKarla":{"default":true,"value":["\"Karla\""],"type":"serif"}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/init",
3
- "version": "1.0.7",
3
+ "version": "1.0.10",
4
4
  "license": "MIT",
5
5
  "gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
6
6
  "dependencies": {
@@ -11,7 +11,7 @@
11
11
  "css-in-props": "latest"
12
12
  },
13
13
  "source": "src/index.js",
14
- "main": "dist/main.js",
14
+ "main": "src/index.js",
15
15
  "targets": {
16
16
  "main": {
17
17
  "context": "browser",
@@ -21,11 +21,13 @@
21
21
  },
22
22
  "files": [
23
23
  "dist",
24
+ "src",
25
+ ".symbolsrc.json",
24
26
  "README.md"
25
27
  ],
26
28
  "scripts": {
27
29
  "prebuild": "rm -rf dist .parcel-cache",
28
- "build": "parcel build index.js",
30
+ "build": "parcel build src/index.js",
29
31
  "build:watch": "nodemon --exec \"yarn build\" --ignore 'dist/*' --watch ..",
30
32
  "test:lint": "npx standard \"packages/**/*.js\"",
31
33
  "test": "echo running all tests is not supported, maybe run: \"yarn test:lint\"",
package/src/index.js ADDED
@@ -0,0 +1,32 @@
1
+ 'use strict'
2
+
3
+ import {
4
+ set,
5
+ FONT,
6
+ RESET,
7
+ getFontFaceString
8
+ } from '@symbo.ls/scratch'
9
+
10
+ import CONFIG_DEFAULT from '@symbo.ls/config-default'
11
+ import SYMBOLSRC_FILE from '../.symbolsrc.json'
12
+
13
+ import createEmotion from '@emotion/css/create-instance'
14
+ import { setClassname } from 'css-in-props'
15
+
16
+ const { css, injectGlobal } = createEmotion({
17
+ key: 'smbls'
18
+ })
19
+
20
+ export const init = (config) => {
21
+ const defaultConfig = config || CONFIG_DEFAULT || SYMBOLSRC_FILE
22
+
23
+ const conf = set({ verbose: false, ...defaultConfig })
24
+ const FontFace = getFontFaceString(FONT)
25
+
26
+ injectGlobal(FontFace)
27
+ injectGlobal(RESET)
28
+
29
+ return conf
30
+ }
31
+
32
+ export const setClass = props => setClassname(props, css)