@chayns-components/core 5.0.64 → 5.0.65
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.
- package/lib/cjs/components/list/List.utils.js +2 -2
- package/lib/cjs/components/list/List.utils.js.map +1 -1
- package/lib/cjs/components/list/list-item/ListItem.utils.js +1 -1
- package/lib/cjs/components/list/list-item/ListItem.utils.js.map +1 -1
- package/lib/esm/components/list/List.utils.js +2 -2
- package/lib/esm/components/list/List.utils.js.map +1 -1
- package/lib/esm/components/list/list-item/ListItem.utils.js +1 -1
- package/lib/esm/components/list/list-item/ListItem.utils.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,10 +12,10 @@ const isMarkedListItemElement = node => /*#__PURE__*/(0, _react.isValidElement)(
|
|
|
12
12
|
exports.isMarkedListItemElement = isMarkedListItemElement;
|
|
13
13
|
const shouldShowExpandIndicator = node => _react.Children.toArray(node).some(child => {
|
|
14
14
|
if (isDirectListItemElement(child)) {
|
|
15
|
-
return child.props.
|
|
15
|
+
return child.props.shouldHideIndicator !== true && child.props.children !== undefined;
|
|
16
16
|
}
|
|
17
17
|
if (isMarkedListItemElement(child)) {
|
|
18
|
-
return child.props.isExpandable
|
|
18
|
+
return child.props.isExpandable === true && child.props.shouldHideIndicator !== true;
|
|
19
19
|
}
|
|
20
20
|
if (/*#__PURE__*/(0, _react.isValidElement)(child) && child.props.children !== undefined) {
|
|
21
21
|
return shouldShowExpandIndicator(child.props.children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.utils.js","names":["_react","require","_ListItem","isDirectListItemElement","node","isValidElement","type","displayName","exports","isMarkedListItemElement","$$listItem","LIST_ITEM_MARKER","shouldShowExpandIndicator","Children","toArray","some","child","props","
|
|
1
|
+
{"version":3,"file":"List.utils.js","names":["_react","require","_ListItem","isDirectListItemElement","node","isValidElement","type","displayName","exports","isMarkedListItemElement","$$listItem","LIST_ITEM_MARKER","shouldShowExpandIndicator","Children","toArray","some","child","props","shouldHideIndicator","children","undefined","isExpandable"],"sources":["../../../../src/components/list/List.utils.ts"],"sourcesContent":["import { Children, isValidElement, type ReactElement, type ReactNode } from 'react';\nimport { LIST_ITEM_MARKER } from './list-item/ListItem.utils';\n\nexport interface ListItemMetaProps {\n isExpandable?: boolean;\n shouldHideIndicator?: boolean;\n children?: ReactNode;\n}\n\ntype ListItemMarkedType = {\n $$listItem?: typeof LIST_ITEM_MARKER;\n};\n\nexport const isDirectListItemElement = (node: ReactNode): node is ReactElement<ListItemMetaProps> =>\n isValidElement(node) && (node.type as { displayName?: string }).displayName === 'ListItem';\n\nexport const isMarkedListItemElement = (node: ReactNode): node is ReactElement<ListItemMetaProps> =>\n isValidElement(node) &&\n typeof node.type !== 'string' &&\n (node.type as ListItemMarkedType).$$listItem === LIST_ITEM_MARKER;\n\nexport const shouldShowExpandIndicator = (node: ReactNode): boolean =>\n Children.toArray(node).some((child) => {\n if (isDirectListItemElement(child)) {\n return child.props.shouldHideIndicator !== true && child.props.children !== undefined;\n }\n\n if (isMarkedListItemElement(child)) {\n return child.props.isExpandable === true && child.props.shouldHideIndicator !== true;\n }\n\n if (isValidElement<{ children?: ReactNode }>(child) && child.props.children !== undefined) {\n return shouldShowExpandIndicator(child.props.children);\n }\n\n return false;\n });\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAYO,MAAME,uBAAuB,GAAIC,IAAe,IACnD,iBAAAC,qBAAc,EAACD,IAAI,CAAC,IAAKA,IAAI,CAACE,IAAI,CAA8BC,WAAW,KAAK,UAAU;AAACC,OAAA,CAAAL,uBAAA,GAAAA,uBAAA;AAExF,MAAMM,uBAAuB,GAAIL,IAAe,IACnD,iBAAAC,qBAAc,EAACD,IAAI,CAAC,IACpB,OAAOA,IAAI,CAACE,IAAI,KAAK,QAAQ,IAC5BF,IAAI,CAACE,IAAI,CAAwBI,UAAU,KAAKC,0BAAgB;AAACH,OAAA,CAAAC,uBAAA,GAAAA,uBAAA;AAE/D,MAAMG,yBAAyB,GAAIR,IAAe,IACrDS,eAAQ,CAACC,OAAO,CAACV,IAAI,CAAC,CAACW,IAAI,CAAEC,KAAK,IAAK;EACnC,IAAIb,uBAAuB,CAACa,KAAK,CAAC,EAAE;IAChC,OAAOA,KAAK,CAACC,KAAK,CAACC,mBAAmB,KAAK,IAAI,IAAIF,KAAK,CAACC,KAAK,CAACE,QAAQ,KAAKC,SAAS;EACzF;EAEA,IAAIX,uBAAuB,CAACO,KAAK,CAAC,EAAE;IAChC,OAAOA,KAAK,CAACC,KAAK,CAACI,YAAY,KAAK,IAAI,IAAIL,KAAK,CAACC,KAAK,CAACC,mBAAmB,KAAK,IAAI;EACxF;EAEA,IAAI,iBAAAb,qBAAc,EAA2BW,KAAK,CAAC,IAAIA,KAAK,CAACC,KAAK,CAACE,QAAQ,KAAKC,SAAS,EAAE;IACvF,OAAOR,yBAAyB,CAACI,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC;EAC1D;EAEA,OAAO,KAAK;AAChB,CAAC,CAAC;AAACX,OAAA,CAAAI,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -29,7 +29,7 @@ exports.withListItemMarker = withListItemMarker;
|
|
|
29
29
|
const withListItemMarkerForwardRef = (render, displayName) => {
|
|
30
30
|
const Component = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
31
31
|
const {
|
|
32
|
-
isExpandable =
|
|
32
|
+
isExpandable = false,
|
|
33
33
|
shouldHideIndicator = false,
|
|
34
34
|
...restProps
|
|
35
35
|
} = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.utils.js","names":["_react","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","LIST_ITEM_MARKER","exports","Symbol","getDisplayName","Component","displayName","name","withListItemMarker","WrappedComponent","props","isExpandable","shouldHideIndicator","restProps","createElement","$$listItem","withListItemMarkerForwardRef","render","forwardRef","ref"],"sources":["../../../../../src/components/list/list-item/ListItem.utils.tsx"],"sourcesContent":["import React, {\n ComponentType,\n forwardRef,\n ForwardRefExoticComponent,\n ForwardRefRenderFunction,\n RefAttributes,\n} from 'react';\n\nexport const LIST_ITEM_MARKER = Symbol('ListItem');\n\nexport interface ListItemMetaProps {\n // eslint-disable-next-line react/no-unused-prop-types\n isExpandable?: boolean;\n // eslint-disable-next-line react/no-unused-prop-types\n shouldHideIndicator?: boolean;\n}\n\nexport type ListItemMarkedComponent<P> = ComponentType<P & ListItemMetaProps> & {\n $$listItem: typeof LIST_ITEM_MARKER;\n};\n\nexport type ListItemMarkedForwardRefComponent<P, R> = ForwardRefExoticComponent<\n P & ListItemMetaProps & RefAttributes<R>\n> & {\n $$listItem: typeof LIST_ITEM_MARKER;\n};\n\ntype DisplayNameComponent = {\n displayName?: string;\n name?: string;\n};\n\nconst getDisplayName = (Component: DisplayNameComponent): string =>\n Component.displayName || Component.name || 'Component';\n\nexport const withListItemMarker = <P,>(\n Component: ComponentType<P & ListItemMetaProps>,\n): ListItemMarkedComponent<P> => {\n const WrappedComponent = ((props: P & ListItemMetaProps) => {\n const { isExpandable = false, shouldHideIndicator = false, ...restProps } = props;\n\n return (\n <Component\n {...(restProps as P)}\n isExpandable={isExpandable}\n shouldHideIndicator={shouldHideIndicator}\n />\n );\n }) as ListItemMarkedComponent<P>;\n\n WrappedComponent.$$listItem = LIST_ITEM_MARKER;\n WrappedComponent.displayName = `withListItemMarker(${getDisplayName(Component)})`;\n\n return WrappedComponent;\n};\n\nexport const withListItemMarkerForwardRef = <P, R>(\n render: ForwardRefRenderFunction<R, P & ListItemMetaProps>,\n displayName: string,\n): ListItemMarkedForwardRefComponent<P, R> => {\n const Component = forwardRef<R, P & ListItemMetaProps>((props, ref) => {\n const { isExpandable =
|
|
1
|
+
{"version":3,"file":"ListItem.utils.js","names":["_react","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","LIST_ITEM_MARKER","exports","Symbol","getDisplayName","Component","displayName","name","withListItemMarker","WrappedComponent","props","isExpandable","shouldHideIndicator","restProps","createElement","$$listItem","withListItemMarkerForwardRef","render","forwardRef","ref"],"sources":["../../../../../src/components/list/list-item/ListItem.utils.tsx"],"sourcesContent":["import React, {\n ComponentType,\n forwardRef,\n ForwardRefExoticComponent,\n ForwardRefRenderFunction,\n RefAttributes,\n} from 'react';\n\nexport const LIST_ITEM_MARKER = Symbol('ListItem');\n\nexport interface ListItemMetaProps {\n // eslint-disable-next-line react/no-unused-prop-types\n isExpandable?: boolean;\n // eslint-disable-next-line react/no-unused-prop-types\n shouldHideIndicator?: boolean;\n}\n\nexport type ListItemMarkedComponent<P> = ComponentType<P & ListItemMetaProps> & {\n $$listItem: typeof LIST_ITEM_MARKER;\n};\n\nexport type ListItemMarkedForwardRefComponent<P, R> = ForwardRefExoticComponent<\n P & ListItemMetaProps & RefAttributes<R>\n> & {\n $$listItem: typeof LIST_ITEM_MARKER;\n};\n\ntype DisplayNameComponent = {\n displayName?: string;\n name?: string;\n};\n\nconst getDisplayName = (Component: DisplayNameComponent): string =>\n Component.displayName || Component.name || 'Component';\n\nexport const withListItemMarker = <P,>(\n Component: ComponentType<P & ListItemMetaProps>,\n): ListItemMarkedComponent<P> => {\n const WrappedComponent = ((props: P & ListItemMetaProps) => {\n const { isExpandable = false, shouldHideIndicator = false, ...restProps } = props;\n\n return (\n <Component\n {...(restProps as P)}\n isExpandable={isExpandable}\n shouldHideIndicator={shouldHideIndicator}\n />\n );\n }) as ListItemMarkedComponent<P>;\n\n WrappedComponent.$$listItem = LIST_ITEM_MARKER;\n WrappedComponent.displayName = `withListItemMarker(${getDisplayName(Component)})`;\n\n return WrappedComponent;\n};\n\nexport const withListItemMarkerForwardRef = <P, R>(\n render: ForwardRefRenderFunction<R, P & ListItemMetaProps>,\n displayName: string,\n): ListItemMarkedForwardRefComponent<P, R> => {\n const Component = forwardRef<R, P & ListItemMetaProps>((props, ref) => {\n const { isExpandable = false, shouldHideIndicator = false, ...restProps } = props;\n\n return render(\n {\n ...(restProps as P),\n isExpandable,\n shouldHideIndicator,\n },\n ref,\n );\n }) as ListItemMarkedForwardRefComponent<P, R>;\n\n Component.$$listItem = LIST_ITEM_MARKER;\n Component.displayName = displayName;\n\n return Component;\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -4,10 +4,10 @@ export const isDirectListItemElement = node => /*#__PURE__*/isValidElement(node)
|
|
|
4
4
|
export const isMarkedListItemElement = node => /*#__PURE__*/isValidElement(node) && typeof node.type !== 'string' && node.type.$$listItem === LIST_ITEM_MARKER;
|
|
5
5
|
export const shouldShowExpandIndicator = node => Children.toArray(node).some(child => {
|
|
6
6
|
if (isDirectListItemElement(child)) {
|
|
7
|
-
return child.props.
|
|
7
|
+
return child.props.shouldHideIndicator !== true && child.props.children !== undefined;
|
|
8
8
|
}
|
|
9
9
|
if (isMarkedListItemElement(child)) {
|
|
10
|
-
return child.props.isExpandable
|
|
10
|
+
return child.props.isExpandable === true && child.props.shouldHideIndicator !== true;
|
|
11
11
|
}
|
|
12
12
|
if (/*#__PURE__*/isValidElement(child) && child.props.children !== undefined) {
|
|
13
13
|
return shouldShowExpandIndicator(child.props.children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.utils.js","names":["Children","isValidElement","LIST_ITEM_MARKER","isDirectListItemElement","node","type","displayName","isMarkedListItemElement","$$listItem","shouldShowExpandIndicator","toArray","some","child","props","
|
|
1
|
+
{"version":3,"file":"List.utils.js","names":["Children","isValidElement","LIST_ITEM_MARKER","isDirectListItemElement","node","type","displayName","isMarkedListItemElement","$$listItem","shouldShowExpandIndicator","toArray","some","child","props","shouldHideIndicator","children","undefined","isExpandable"],"sources":["../../../../src/components/list/List.utils.ts"],"sourcesContent":["import { Children, isValidElement, type ReactElement, type ReactNode } from 'react';\nimport { LIST_ITEM_MARKER } from './list-item/ListItem.utils';\n\nexport interface ListItemMetaProps {\n isExpandable?: boolean;\n shouldHideIndicator?: boolean;\n children?: ReactNode;\n}\n\ntype ListItemMarkedType = {\n $$listItem?: typeof LIST_ITEM_MARKER;\n};\n\nexport const isDirectListItemElement = (node: ReactNode): node is ReactElement<ListItemMetaProps> =>\n isValidElement(node) && (node.type as { displayName?: string }).displayName === 'ListItem';\n\nexport const isMarkedListItemElement = (node: ReactNode): node is ReactElement<ListItemMetaProps> =>\n isValidElement(node) &&\n typeof node.type !== 'string' &&\n (node.type as ListItemMarkedType).$$listItem === LIST_ITEM_MARKER;\n\nexport const shouldShowExpandIndicator = (node: ReactNode): boolean =>\n Children.toArray(node).some((child) => {\n if (isDirectListItemElement(child)) {\n return child.props.shouldHideIndicator !== true && child.props.children !== undefined;\n }\n\n if (isMarkedListItemElement(child)) {\n return child.props.isExpandable === true && child.props.shouldHideIndicator !== true;\n }\n\n if (isValidElement<{ children?: ReactNode }>(child) && child.props.children !== undefined) {\n return shouldShowExpandIndicator(child.props.children);\n }\n\n return false;\n });\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc,QAA2C,OAAO;AACnF,SAASC,gBAAgB,QAAQ,4BAA4B;AAY7D,OAAO,MAAMC,uBAAuB,GAAIC,IAAe,IACnD,aAAAH,cAAc,CAACG,IAAI,CAAC,IAAKA,IAAI,CAACC,IAAI,CAA8BC,WAAW,KAAK,UAAU;AAE9F,OAAO,MAAMC,uBAAuB,GAAIH,IAAe,IACnD,aAAAH,cAAc,CAACG,IAAI,CAAC,IACpB,OAAOA,IAAI,CAACC,IAAI,KAAK,QAAQ,IAC5BD,IAAI,CAACC,IAAI,CAAwBG,UAAU,KAAKN,gBAAgB;AAErE,OAAO,MAAMO,yBAAyB,GAAIL,IAAe,IACrDJ,QAAQ,CAACU,OAAO,CAACN,IAAI,CAAC,CAACO,IAAI,CAAEC,KAAK,IAAK;EACnC,IAAIT,uBAAuB,CAACS,KAAK,CAAC,EAAE;IAChC,OAAOA,KAAK,CAACC,KAAK,CAACC,mBAAmB,KAAK,IAAI,IAAIF,KAAK,CAACC,KAAK,CAACE,QAAQ,KAAKC,SAAS;EACzF;EAEA,IAAIT,uBAAuB,CAACK,KAAK,CAAC,EAAE;IAChC,OAAOA,KAAK,CAACC,KAAK,CAACI,YAAY,KAAK,IAAI,IAAIL,KAAK,CAACC,KAAK,CAACC,mBAAmB,KAAK,IAAI;EACxF;EAEA,IAAI,aAAAb,cAAc,CAA2BW,KAAK,CAAC,IAAIA,KAAK,CAACC,KAAK,CAACE,QAAQ,KAAKC,SAAS,EAAE;IACvF,OAAOP,yBAAyB,CAACG,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC;EAC1D;EAEA,OAAO,KAAK;AAChB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -21,7 +21,7 @@ export const withListItemMarker = Component => {
|
|
|
21
21
|
export const withListItemMarkerForwardRef = (render, displayName) => {
|
|
22
22
|
const Component = /*#__PURE__*/forwardRef((props, ref) => {
|
|
23
23
|
const {
|
|
24
|
-
isExpandable =
|
|
24
|
+
isExpandable = false,
|
|
25
25
|
shouldHideIndicator = false,
|
|
26
26
|
...restProps
|
|
27
27
|
} = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.utils.js","names":["React","forwardRef","LIST_ITEM_MARKER","Symbol","getDisplayName","Component","displayName","name","withListItemMarker","WrappedComponent","props","isExpandable","shouldHideIndicator","restProps","createElement","_extends","$$listItem","withListItemMarkerForwardRef","render","ref"],"sources":["../../../../../src/components/list/list-item/ListItem.utils.tsx"],"sourcesContent":["import React, {\n ComponentType,\n forwardRef,\n ForwardRefExoticComponent,\n ForwardRefRenderFunction,\n RefAttributes,\n} from 'react';\n\nexport const LIST_ITEM_MARKER = Symbol('ListItem');\n\nexport interface ListItemMetaProps {\n // eslint-disable-next-line react/no-unused-prop-types\n isExpandable?: boolean;\n // eslint-disable-next-line react/no-unused-prop-types\n shouldHideIndicator?: boolean;\n}\n\nexport type ListItemMarkedComponent<P> = ComponentType<P & ListItemMetaProps> & {\n $$listItem: typeof LIST_ITEM_MARKER;\n};\n\nexport type ListItemMarkedForwardRefComponent<P, R> = ForwardRefExoticComponent<\n P & ListItemMetaProps & RefAttributes<R>\n> & {\n $$listItem: typeof LIST_ITEM_MARKER;\n};\n\ntype DisplayNameComponent = {\n displayName?: string;\n name?: string;\n};\n\nconst getDisplayName = (Component: DisplayNameComponent): string =>\n Component.displayName || Component.name || 'Component';\n\nexport const withListItemMarker = <P,>(\n Component: ComponentType<P & ListItemMetaProps>,\n): ListItemMarkedComponent<P> => {\n const WrappedComponent = ((props: P & ListItemMetaProps) => {\n const { isExpandable = false, shouldHideIndicator = false, ...restProps } = props;\n\n return (\n <Component\n {...(restProps as P)}\n isExpandable={isExpandable}\n shouldHideIndicator={shouldHideIndicator}\n />\n );\n }) as ListItemMarkedComponent<P>;\n\n WrappedComponent.$$listItem = LIST_ITEM_MARKER;\n WrappedComponent.displayName = `withListItemMarker(${getDisplayName(Component)})`;\n\n return WrappedComponent;\n};\n\nexport const withListItemMarkerForwardRef = <P, R>(\n render: ForwardRefRenderFunction<R, P & ListItemMetaProps>,\n displayName: string,\n): ListItemMarkedForwardRefComponent<P, R> => {\n const Component = forwardRef<R, P & ListItemMetaProps>((props, ref) => {\n const { isExpandable =
|
|
1
|
+
{"version":3,"file":"ListItem.utils.js","names":["React","forwardRef","LIST_ITEM_MARKER","Symbol","getDisplayName","Component","displayName","name","withListItemMarker","WrappedComponent","props","isExpandable","shouldHideIndicator","restProps","createElement","_extends","$$listItem","withListItemMarkerForwardRef","render","ref"],"sources":["../../../../../src/components/list/list-item/ListItem.utils.tsx"],"sourcesContent":["import React, {\n ComponentType,\n forwardRef,\n ForwardRefExoticComponent,\n ForwardRefRenderFunction,\n RefAttributes,\n} from 'react';\n\nexport const LIST_ITEM_MARKER = Symbol('ListItem');\n\nexport interface ListItemMetaProps {\n // eslint-disable-next-line react/no-unused-prop-types\n isExpandable?: boolean;\n // eslint-disable-next-line react/no-unused-prop-types\n shouldHideIndicator?: boolean;\n}\n\nexport type ListItemMarkedComponent<P> = ComponentType<P & ListItemMetaProps> & {\n $$listItem: typeof LIST_ITEM_MARKER;\n};\n\nexport type ListItemMarkedForwardRefComponent<P, R> = ForwardRefExoticComponent<\n P & ListItemMetaProps & RefAttributes<R>\n> & {\n $$listItem: typeof LIST_ITEM_MARKER;\n};\n\ntype DisplayNameComponent = {\n displayName?: string;\n name?: string;\n};\n\nconst getDisplayName = (Component: DisplayNameComponent): string =>\n Component.displayName || Component.name || 'Component';\n\nexport const withListItemMarker = <P,>(\n Component: ComponentType<P & ListItemMetaProps>,\n): ListItemMarkedComponent<P> => {\n const WrappedComponent = ((props: P & ListItemMetaProps) => {\n const { isExpandable = false, shouldHideIndicator = false, ...restProps } = props;\n\n return (\n <Component\n {...(restProps as P)}\n isExpandable={isExpandable}\n shouldHideIndicator={shouldHideIndicator}\n />\n );\n }) as ListItemMarkedComponent<P>;\n\n WrappedComponent.$$listItem = LIST_ITEM_MARKER;\n WrappedComponent.displayName = `withListItemMarker(${getDisplayName(Component)})`;\n\n return WrappedComponent;\n};\n\nexport const withListItemMarkerForwardRef = <P, R>(\n render: ForwardRefRenderFunction<R, P & ListItemMetaProps>,\n displayName: string,\n): ListItemMarkedForwardRefComponent<P, R> => {\n const Component = forwardRef<R, P & ListItemMetaProps>((props, ref) => {\n const { isExpandable = false, shouldHideIndicator = false, ...restProps } = props;\n\n return render(\n {\n ...(restProps as P),\n isExpandable,\n shouldHideIndicator,\n },\n ref,\n );\n }) as ListItemMarkedForwardRefComponent<P, R>;\n\n Component.$$listItem = LIST_ITEM_MARKER;\n Component.displayName = displayName;\n\n return Component;\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAERC,UAAU,QAIP,OAAO;AAEd,OAAO,MAAMC,gBAAgB,GAAGC,MAAM,CAAC,UAAU,CAAC;AAwBlD,MAAMC,cAAc,GAAIC,SAA+B,IACnDA,SAAS,CAACC,WAAW,IAAID,SAAS,CAACE,IAAI,IAAI,WAAW;AAE1D,OAAO,MAAMC,kBAAkB,GAC3BH,SAA+C,IAClB;EAC7B,MAAMI,gBAAgB,GAAKC,KAA4B,IAAK;IACxD,MAAM;MAAEC,YAAY,GAAG,KAAK;MAAEC,mBAAmB,GAAG,KAAK;MAAE,GAAGC;IAAU,CAAC,GAAGH,KAAK;IAEjF,oBACIV,KAAA,CAAAc,aAAA,CAACT,SAAS,EAAAU,QAAA,KACDF,SAAS;MACdF,YAAY,EAAEA,YAAa;MAC3BC,mBAAmB,EAAEA;IAAoB,EAC5C,CAAC;EAEV,CAAgC;EAEhCH,gBAAgB,CAACO,UAAU,GAAGd,gBAAgB;EAC9CO,gBAAgB,CAACH,WAAW,GAAG,sBAAsBF,cAAc,CAACC,SAAS,CAAC,GAAG;EAEjF,OAAOI,gBAAgB;AAC3B,CAAC;AAED,OAAO,MAAMQ,4BAA4B,GAAGA,CACxCC,MAA0D,EAC1DZ,WAAmB,KACuB;EAC1C,MAAMD,SAAS,gBAAGJ,UAAU,CAA2B,CAACS,KAAK,EAAES,GAAG,KAAK;IACnE,MAAM;MAAER,YAAY,GAAG,KAAK;MAAEC,mBAAmB,GAAG,KAAK;MAAE,GAAGC;IAAU,CAAC,GAAGH,KAAK;IAEjF,OAAOQ,MAAM,CACT;MACI,GAAIL,SAAe;MACnBF,YAAY;MACZC;IACJ,CAAC,EACDO,GACJ,CAAC;EACL,CAAC,CAA4C;EAE7Cd,SAAS,CAACW,UAAU,GAAGd,gBAAgB;EACvCG,SAAS,CAACC,WAAW,GAAGA,WAAW;EAEnC,OAAOD,SAAS;AACpB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.65",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "c7f378804f42f70cd616addd985e699a5bc49b9f"
|
|
92
92
|
}
|