@symbo.ls/icon 2.11.204 → 2.11.210

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +6 -10
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -31,7 +31,7 @@ For example, you can change the color and size of the icon:
31
31
  ```javascript
32
32
  const MyComponent = {
33
33
  IconText: {
34
- icon: {
34
+ Icon: {
35
35
  name: 'star',
36
36
  color: 'blue'
37
37
  },
package/index.js CHANGED
@@ -1,14 +1,16 @@
1
1
  'use strict'
2
2
 
3
3
  import { Flex, Svg } from '@symbo.ls/atoms'
4
+ import { isString } from '@domql/utils'
4
5
 
5
6
  export const Icon = {
6
7
  extend: Svg,
7
- props: ({ key, props, parent, context }) => {
8
+ deps: { isString },
9
+ props: ({ key, props, parent, context, deps }) => {
8
10
  const { ICONS, useIconSprite, verbose } = context && context.designSystem
9
11
  const { toCamelCase } = context && context.utils
10
12
  const iconName = props.inheritedString || props.name || props.icon || key
11
- const camelCase = toCamelCase(iconName)
13
+ const camelCase = toCamelCase(deps.isString(iconName) ? iconName : key)
12
14
 
13
15
  const isArray = camelCase.split(/([a-z])([A-Z])/g)
14
16
 
@@ -58,15 +60,9 @@ export const IconText = {
58
60
  lineHeight: 1
59
61
  },
60
62
 
61
- // TODO: remove this variant
62
- icon: {
63
- extend: Icon,
64
- if: ({ parent }) => parent.props.icon
65
- },
66
-
67
63
  Icon: {
68
- props: {},
69
- if: ({ props }) => props.name || props.icon
64
+ props: ({ parent, props }) => ({ icon: parent.props.icon || props.name || props.icon }),
65
+ if: ({ parent, props }) => parent.props.icon || parent.props.Icon || props.name || props.icon
70
66
  },
71
67
 
72
68
  text: ({ props }) => props.text,
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/icon",
3
- "version": "2.11.204",
3
+ "version": "2.11.210",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "dab7f6d84335bca5af356b849c51204910670e76",
6
+ "gitHead": "45ec4a9a2ab3233c83b705202980d45b0c3cb91e",
7
7
  "dependencies": {
8
8
  "@symbo.ls/atoms": "latest"
9
9
  },