@salutejs/plasma-new-hope 0.324.0-canary.1978.15107688795.0 → 0.324.0-canary.1978.15135791908.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.
@@ -18,7 +18,8 @@ var _component = function _component(componentConfig) {
18
18
  var tag = componentConfig.tag,
19
19
  base = componentConfig.base,
20
20
  name = componentConfig.name,
21
- intersections = componentConfig.intersections;
21
+ intersections = componentConfig.intersections,
22
+ invariants = componentConfig.invariants;
22
23
  var staticVariants = utils.getStaticVariants(componentConfig);
23
24
  var dynamicVariants = utils.getDynamicVariants(componentConfig);
24
25
  var component = /*#__PURE__*/React.forwardRef(function (props, ref) {
@@ -28,7 +29,7 @@ var _component = function _component(componentConfig) {
28
29
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
29
30
  var variants = dynamicVariants(rest);
30
31
  var intersectionStyles = utils.getIntersectionStyles(rest, intersections);
31
- var cls = core.cx.apply(void 0, [className, base].concat(_rollupPluginBabelHelpers.toConsumableArray(staticVariants), _rollupPluginBabelHelpers.toConsumableArray(variants), _rollupPluginBabelHelpers.toConsumableArray(intersectionStyles)));
32
+ var cls = core.cx.apply(void 0, [className, base].concat(_rollupPluginBabelHelpers.toConsumableArray(staticVariants), _rollupPluginBabelHelpers.toConsumableArray(variants), _rollupPluginBabelHelpers.toConsumableArray(intersectionStyles), [invariants]));
32
33
 
33
34
  // styled-components do it inside
34
35
  // filter props
@@ -1 +1 @@
1
- {"version":3,"file":"linaria.js","sources":["../../src/engines/linaria.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cx } from '@linaria/core';\n\n// TODO: #1008 Избавиться от импортов и переделать addFocus\nimport 'focus-visible';\nimport { getStaticVariants, getDynamicVariants, getIntersectionStyles } from './utils';\nimport { ComponentConfig, HTMLAnyAttributes } from './types';\n\n/* eslint-disable no-underscore-dangle */\nexport const _component = (componentConfig: ComponentConfig) => {\n const { tag, base, name, intersections } = componentConfig;\n const staticVariants = getStaticVariants(componentConfig);\n const dynamicVariants = getDynamicVariants(componentConfig);\n\n const component = forwardRef<HTMLElement, HTMLAnyAttributes>((props, ref) => {\n const { className, as, forwardedAs, ...rest } = props;\n const variants = dynamicVariants(rest);\n const intersectionStyles = getIntersectionStyles(rest, intersections) as string[];\n\n const cls = cx(className, base as string, ...(staticVariants as string[]), ...variants, ...intersectionStyles);\n\n // styled-components do it inside\n // filter props\n const baseProps: HTMLAnyAttributes = {};\n for (const key in rest) {\n if (!(key in componentConfig.variations)) {\n baseProps[key] = rest[key];\n }\n }\n\n baseProps.ref = ref;\n\n // styled-components do it inside\n // add props that should be attr( disabled for example)\n const htmlAttrs: HTMLAnyAttributes = {};\n for (const key in componentConfig.variations || {}) {\n if (key in rest) {\n const variant = componentConfig.variations[key];\n\n const { attrs } = variant;\n if (typeof attrs === 'boolean') {\n htmlAttrs[key] = rest[key];\n }\n }\n }\n\n const Root = as || forwardedAs || (tag as React.ElementType);\n\n return <Root className={cls} {...htmlAttrs} {...baseProps} />;\n });\n if (name) {\n component.displayName = name;\n }\n return component;\n};\n"],"names":["_component","componentConfig","tag","base","name","intersections","staticVariants","getStaticVariants","dynamicVariants","getDynamicVariants","component","forwardRef","props","ref","className","as","forwardedAs","rest","_objectWithoutProperties","_excluded","variants","intersectionStyles","getIntersectionStyles","cls","cx","apply","concat","_toConsumableArray","baseProps","key","variations","htmlAttrs","variant","attrs","Root","React","createElement","_extends","displayName"],"mappings":";;;;;;;;;;;;;;;AAQA;IACaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,eAAgC,EAAK;AAC5D,EAAA,IAAQC,GAAG,GAAgCD,eAAe,CAAlDC,GAAG;IAAEC,IAAI,GAA0BF,eAAe,CAA7CE,IAAI;IAAEC,IAAI,GAAoBH,eAAe,CAAvCG,IAAI;IAAEC,aAAa,GAAKJ,eAAe,CAAjCI,aAAa,CAAA;AACtC,EAAA,IAAMC,cAAc,GAAGC,uBAAiB,CAACN,eAAe,C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,IAAI,EAAE;AACb,QAAA,IAAMe,OAAO,GAAG/B,eAAe,CAAC6B,UAAU,CAACD,IAAG,CAAC,CAAA;AAE/C,QAAA,IAAQI,KAAK,GAAKD,OAAO,CAAjBC,KAAK,CAAA;AACb,QAAA,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;AAC5BF,UAAAA,SAAS,CAACF,IAAG,CAAC,GAAGZ,IAAI,CAACY,IAAG,CAAC,CAAA;AAC9B,SAAA;AACJ,OAAA;AACJ,KAAA;AAEA,IAAA,IAAMK,IAAI,GAAGnB,EAAE,IAAIC,WAAW,IAAKd,GAAyB,CAAA;AAE5D,IAAA,oBAAOiC,sBAAA,CAAAC,aAAA,CAACF,IAAI,EAAAG,iCAAA,CAAA;AAACvB,MAAAA,SAAS,EAAES,GAAAA;AAAI,KAAA,EAAKQ,SAAS,EAAMH,SAAS,CAAG,CAAC,CAAA;AACjE,GAAC,CAAC,CAAA;AACF,EAAA,IAAIxB,IAAI,EAAE;IACNM,SAAS,CAAC4B,WAAW,GAAGlC,IAAI,CAAA;AAChC,GAAA;AACA,EAAA,OAAOM,SAAS,CAAA;AACpB;;;;"}
1
+ {"version":3,"file":"linaria.js","sources":["../../src/engines/linaria.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cx } from '@linaria/core';\n\n// TODO: #1008 Избавиться от импортов и переделать addFocus\nimport 'focus-visible';\nimport { getStaticVariants, getDynamicVariants, getIntersectionStyles } from './utils';\nimport { ComponentConfig, HTMLAnyAttributes } from './types';\n\n/* eslint-disable no-underscore-dangle */\nexport const _component = (componentConfig: ComponentConfig) => {\n const { tag, base, name, intersections, invariants } = componentConfig;\n\n const staticVariants = getStaticVariants(componentConfig);\n const dynamicVariants = getDynamicVariants(componentConfig);\n\n const component = forwardRef<HTMLElement, HTMLAnyAttributes>((props, ref) => {\n const { className, as, forwardedAs, ...rest } = props;\n const variants = dynamicVariants(rest);\n const intersectionStyles = getIntersectionStyles(rest, intersections) as string[];\n\n const cls = cx(\n className,\n base as string,\n ...(staticVariants as string[]),\n ...variants,\n ...intersectionStyles,\n invariants as string,\n );\n\n // styled-components do it inside\n // filter props\n const baseProps: HTMLAnyAttributes = {};\n for (const key in rest) {\n if (!(key in componentConfig.variations)) {\n baseProps[key] = rest[key];\n }\n }\n\n baseProps.ref = ref;\n\n // styled-components do it inside\n // add props that should be attr( disabled for example)\n const htmlAttrs: HTMLAnyAttributes = {};\n for (const key in componentConfig.variations || {}) {\n if (key in rest) {\n const variant = componentConfig.variations[key];\n\n const { attrs } = variant;\n if (typeof attrs === 'boolean') {\n htmlAttrs[key] = rest[key];\n }\n }\n }\n\n const Root = as || forwardedAs || (tag as React.ElementType);\n\n return <Root className={cls} {...htmlAttrs} {...baseProps} />;\n });\n if (name) {\n component.displayName = name;\n }\n return component;\n};\n"],"names":["_component","componentConfig","tag","base","name","intersections","invariants","staticVariants","getStaticVariants","dynamicVariants","getDynamicVariants","component","forwardRef","props","ref","className","as","forwardedAs","rest","_objectWithoutProperties","_excluded","variants","intersectionStyles","getIntersectionStyles","cls","cx","apply","concat","_toConsumableArray","baseProps","key","variations","htmlAttrs","variant","attrs","Root","React","createElement","_extends","displayName"],"mappings":";;;;;;;;;;;;;;;AAQA;IACaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,eAAgC,EAAK;AAC5D,EAAA,IAAQC,GAAG,GAA4CD,eAAe,CAA9DC,GAAG;IAAEC,IAAI,GAAsCF,eAAe,CAAzDE,IAAI;IAAEC,IAAI,GAAgCH,eAAe,CAAnDG,IAAI;IAAEC,aAAa,GAAiBJ,eAAe,CAA7CI,aAAa;IAAEC,UAAU,GAAKL,eAAe,CAA9BK,UAAU,CAAA;AAElD,EAAA,IAAMC,cAAc,GAAGC,uBAAiB,CAACP,eAAe,CAAC,CAAA;AACzD,EAAA,IAAMQ,eAAe,GAAGC,wBAAkB,CAACT,eAAe,CAAC,CAAA;EAE3D,IAAMU,SAAS,gBAAGC,gBAAU,CAAiC,UAACC,KAAK,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GAAKD,OAAO,CAAjBC,KAAK,CAAA;AACb,QAAA,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;AAC5BF,UAAAA,SAAS,CAACF,IAAG,CAAC,GAAGZ,IAAI,CAACY,IAAG,CAAC,CAAA;AAC9B,SAAA;AACJ,OAAA;AACJ,KAAA;AAEA,IAAA,IAAMK,IAAI,GAAGnB,EAAE,IAAIC,WAAW,IAAKf,GAAyB,CAAA;AAE5D,IAAA,oBAAOkC,sBAAA,CAAAC,aAAA,CAACF,IAAI,EAAAG,iCAAA,CAAA;AAACvB,MAAAA,SAAS,EAAES,GAAAA;AAAI,KAAA,EAAKQ,SAAS,EAAMH,SAAS,CAAG,CAAC,CAAA;AACjE,GAAC,CAAC,CAAA;AACF,EAAA,IAAIzB,IAAI,EAAE;IACNO,SAAS,CAAC4B,WAAW,GAAGnC,IAAI,CAAA;AAChC,GAAA;AACA,EAAA,OAAOO,SAAS,CAAA;AACpB;;;;"}
@@ -504,7 +504,7 @@ type SuggestionItem = {
504
504
  import { Select, Cell } from '@salutejs/{{ package }}';
505
505
 
506
506
  export function App() {
507
- const mockData = [
507
+ const items = [
508
508
  { label: 'Алексей Смирнов' },
509
509
  { label: 'Екатерина Иванова' },
510
510
  ];