@symbo.ls/icon 2.11.394 → 2.11.401

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.
Files changed (2) hide show
  1. package/index.js +16 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -12,6 +12,21 @@ const getIconName = ({ key, props, context, deps, state }) => {
12
12
  return deps.isString(iconName) ? iconName : key
13
13
  }
14
14
 
15
+ export const getSfSymbols = (el, s) => {
16
+ const { props, parent } = el
17
+ const sfSymbols = props.sfSymbols || parent.props.sfSymbols
18
+ if (sfSymbols) {
19
+ const sf = require('@symbo.ls/sf-symbols')
20
+ return {
21
+ width: 'A',
22
+ height: 'A',
23
+ display: 'inline-block',
24
+ src: sf[sfSymbols],
25
+ style: { fill: 'currentColor' }
26
+ }
27
+ }
28
+ }
29
+
15
30
  export const Icon = {
16
31
  extend: 'Svg',
17
32
  deps: { isString, replaceLiteralsWithObjectFields },
@@ -101,7 +116,7 @@ export const IconText = {
101
116
  Icon: {
102
117
  props: ({ parent, props }) => ({ icon: parent.props.icon }),
103
118
  if: ({ parent, props }) => {
104
- const doesExist = parent.props.icon || parent.props.Icon || props.name || props.icon
119
+ const doesExist = parent.props.icon || parent.props.Icon || props.name || props.icon || props.sfSymbols || parent.props.sfSymbols
105
120
  return doesExist
106
121
  }
107
122
  },
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/icon",
3
- "version": "2.11.394",
3
+ "version": "2.11.401",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "96fc31e44dd43084955c647e91b5d0e70d56aee8",
6
+ "gitHead": "c5689e84f4386d6ba629a84de0f4122adea1c47e",
7
7
  "dependencies": {
8
8
  "@symbo.ls/atoms": "latest",
9
9
  "@symbo.ls/utils": "latest"