react-native-ui-kitten icon indicating copy to clipboard operation
react-native-ui-kitten copied to clipboard

type issue with meta in customMapping for eva in ApplicationProvider

Open 0x0000F1 opened this issue 3 years ago • 3 comments

🐛 Bug Report

customMapping is requiring all fields in meta to be filled

To Reproduce

use typescript with UI kitten

Expected behavior

I expected these examples to work https://akveo.github.io/react-native-ui-kitten/docs/design-system/customize-mapping#change-a-single-parameter

but sadly had to tinker with /node_modules/@eva-design/dss/types/schema.d.ts and change the fields in the meta field to make them optional so that the examples could work

UI Kitten and Eva version

| Package | Version | | ----------- | 5.0.0| | @eva-design/eva | | | @ui-kitten/components | |

it can be easily fixed with this

export interface ControlMetaType {
    scope?: ScopeMetaType;
    parameters?: {
        [key: string]: PropertyMetaType;
    };
    appearances?: {
        [key: string]: AppearanceMetaType;
    };
    variantGroups?: {
        [key: string]: {
            [key: string]: VariantMetaType;
        };
    };
    states?: {
        [key: string]: StateMetaType;
    };
}

0x0000F1 avatar Dec 15 '20 14:12 0x0000F1

Same issue here. It there any fix foreseen @artyorsh ? 🙏

Current workaround, but I'm not sure what are the side effects of setting empty meta info):

{
  "components": {
    "Button": {
      "meta": {
        "scope": "all",      // <---
        "parameters": {},    // <---
        "appearances": {},   // <---
        "variantGroups": {}, // <---
        "states": {}         // <---
      },
      "appearances": {
        "filled": {
          "mapping": {},
          "variantGroups": {
            "status": {
              "primary": {
                "textColor": "$color-basic-1000"
              }
            }
          }
        }
      }
    }
  }
}

binajmen avatar May 17 '21 21:05 binajmen

Any fixes for this?

greenafrican avatar Nov 08 '21 17:11 greenafrican

Any fixes for this?

I ended up building my own components library so I have no clue... sorry

0x0000F1 avatar Nov 10 '21 16:11 0x0000F1

Hello there,

In our documentation we provide example for one example, by default you need specify meta for all of your types.

Regards, Vlad

bataevvlad avatar May 30 '23 11:05 bataevvlad