@purpurds/grid 8.5.2 → 8.7.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.
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.cjs.js.map +1 -1
- package/dist/grid.es.js +5 -5
- package/dist/grid.es.js.map +1 -1
- package/package.json +5 -5
- package/src/grid.item.tsx +1 -1
- package/src/grid.tsx +2 -2
package/dist/grid.cjs.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var v;function C(){return v||(v=1,(function(p){(function(){var d={}.hasOwnProperty;function u(){for(var r="",i=0;i<arguments.length;i++){var _=arguments[i];_&&(r=e(r,l.call(this,_)))}return r}function l(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return u.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var _ in r)d.call(r,_)&&r[_]&&(i=e(i,this&&this[_]||_));return i}function e(r,i){return i?r?r+" "+i:r+i:r}p.exports?(u.default=u,p.exports=u):window.classNames=u})()})(c)),c.exports}var w=C();const j=N(w),I={"purpur-grid-item":"_purpur-grid-item_zx9tz_1","purpur-grid-item--no-col-gap":"_purpur-grid-item--no-col-gap_zx9tz_6","purpur-grid-item-colspan-sm-4":"_purpur-grid-item-colspan-sm-4_zx9tz_24","purpur-grid-item-colspan-sm-3":"_purpur-grid-item-colspan-sm-3_zx9tz_27","purpur-grid-item-colspan-sm-2":"_purpur-grid-item-colspan-sm-2_zx9tz_30","purpur-grid-item-colspan-sm-1":"_purpur-grid-item-colspan-sm-1_zx9tz_33","purpur-grid-item-colspan-md-8":"_purpur-grid-item-colspan-md-8_zx9tz_37","purpur-grid-item-colspan-md-7":"_purpur-grid-item-colspan-md-7_zx9tz_42","purpur-grid-item-colspan-md-6":"_purpur-grid-item-colspan-md-6_zx9tz_47","purpur-grid-item-colspan-md-5":"_purpur-grid-item-colspan-md-5_zx9tz_52","purpur-grid-item-colspan-md-4":"_purpur-grid-item-colspan-md-4_zx9tz_57","purpur-grid-item-colspan-md-3":"_purpur-grid-item-colspan-md-3_zx9tz_62","purpur-grid-item-colspan-md-2":"_purpur-grid-item-colspan-md-2_zx9tz_67","purpur-grid-item-colspan-md-1":"_purpur-grid-item-colspan-md-1_zx9tz_72","purpur-grid-item-colspan-lg-12":"_purpur-grid-item-colspan-lg-12_zx9tz_77","purpur-grid-item-colspan-lg-11":"_purpur-grid-item-colspan-lg-11_zx9tz_82","purpur-grid-item-colspan-lg-10":"_purpur-grid-item-colspan-lg-10_zx9tz_87","purpur-grid-item-colspan-lg-9":"_purpur-grid-item-colspan-lg-9_zx9tz_92","purpur-grid-item-colspan-lg-8":"_purpur-grid-item-colspan-lg-8_zx9tz_97","purpur-grid-item-colspan-lg-7":"_purpur-grid-item-colspan-lg-7_zx9tz_102","purpur-grid-item-colspan-lg-6":"_purpur-grid-item-colspan-lg-6_zx9tz_107","purpur-grid-item-colspan-lg-5":"_purpur-grid-item-colspan-lg-5_zx9tz_112","purpur-grid-item-colspan-lg-4":"_purpur-grid-item-colspan-lg-4_zx9tz_117","purpur-grid-item-colspan-lg-3":"_purpur-grid-item-colspan-lg-3_zx9tz_122","purpur-grid-item-colspan-lg-2":"_purpur-grid-item-colspan-lg-2_zx9tz_127","purpur-grid-item-colspan-lg-1":"_purpur-grid-item-colspan-lg-1_zx9tz_77"},O=j.bind(I),g="purpur-grid-item",s=({children:p,className:d,colSpanSm:u=4,colSpanMd:l=8,colSpanLg:e=12,noColGap:r=!1,...i})=>{const _=O([
|
|
5
|
+
*/var v;function C(){return v||(v=1,(function(p){(function(){var d={}.hasOwnProperty;function u(){for(var r="",i=0;i<arguments.length;i++){var _=arguments[i];_&&(r=e(r,l.call(this,_)))}return r}function l(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return u.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var _ in r)d.call(r,_)&&r[_]&&(i=e(i,this&&this[_]||_));return i}function e(r,i){return i?r?r+" "+i:r+i:r}p.exports?(u.default=u,p.exports=u):window.classNames=u})()})(c)),c.exports}var w=C();const j=N(w),I={"purpur-grid-item":"_purpur-grid-item_zx9tz_1","purpur-grid-item--no-col-gap":"_purpur-grid-item--no-col-gap_zx9tz_6","purpur-grid-item-colspan-sm-4":"_purpur-grid-item-colspan-sm-4_zx9tz_24","purpur-grid-item-colspan-sm-3":"_purpur-grid-item-colspan-sm-3_zx9tz_27","purpur-grid-item-colspan-sm-2":"_purpur-grid-item-colspan-sm-2_zx9tz_30","purpur-grid-item-colspan-sm-1":"_purpur-grid-item-colspan-sm-1_zx9tz_33","purpur-grid-item-colspan-md-8":"_purpur-grid-item-colspan-md-8_zx9tz_37","purpur-grid-item-colspan-md-7":"_purpur-grid-item-colspan-md-7_zx9tz_42","purpur-grid-item-colspan-md-6":"_purpur-grid-item-colspan-md-6_zx9tz_47","purpur-grid-item-colspan-md-5":"_purpur-grid-item-colspan-md-5_zx9tz_52","purpur-grid-item-colspan-md-4":"_purpur-grid-item-colspan-md-4_zx9tz_57","purpur-grid-item-colspan-md-3":"_purpur-grid-item-colspan-md-3_zx9tz_62","purpur-grid-item-colspan-md-2":"_purpur-grid-item-colspan-md-2_zx9tz_67","purpur-grid-item-colspan-md-1":"_purpur-grid-item-colspan-md-1_zx9tz_72","purpur-grid-item-colspan-lg-12":"_purpur-grid-item-colspan-lg-12_zx9tz_77","purpur-grid-item-colspan-lg-11":"_purpur-grid-item-colspan-lg-11_zx9tz_82","purpur-grid-item-colspan-lg-10":"_purpur-grid-item-colspan-lg-10_zx9tz_87","purpur-grid-item-colspan-lg-9":"_purpur-grid-item-colspan-lg-9_zx9tz_92","purpur-grid-item-colspan-lg-8":"_purpur-grid-item-colspan-lg-8_zx9tz_97","purpur-grid-item-colspan-lg-7":"_purpur-grid-item-colspan-lg-7_zx9tz_102","purpur-grid-item-colspan-lg-6":"_purpur-grid-item-colspan-lg-6_zx9tz_107","purpur-grid-item-colspan-lg-5":"_purpur-grid-item-colspan-lg-5_zx9tz_112","purpur-grid-item-colspan-lg-4":"_purpur-grid-item-colspan-lg-4_zx9tz_117","purpur-grid-item-colspan-lg-3":"_purpur-grid-item-colspan-lg-3_zx9tz_122","purpur-grid-item-colspan-lg-2":"_purpur-grid-item-colspan-lg-2_zx9tz_127","purpur-grid-item-colspan-lg-1":"_purpur-grid-item-colspan-lg-1_zx9tz_77"},O=j.bind(I),g="purpur-grid-item",s=({children:p,className:d,colSpanSm:u=4,colSpanMd:l=8,colSpanLg:e=12,noColGap:r=!1,...i})=>{const _=O([g,{[`${g}--no-col-gap`]:r,[`${g}-colspan-sm-${u}`]:u,[`${g}-colspan-md-${l}`]:l,[`${g}-colspan-lg-${e}`]:e},d]);return o.jsx("div",{className:_,...i,children:p})},q=p=>!!p&&m.isValidElement(p)&&p.type===s;s.displayName="Grid.Item";const A={"purpur-grid":"_purpur-grid_8kjv6_1","purpur-grid__inner":"_purpur-grid__inner_8kjv6_27","purpur-grid__inner--no-gap":"_purpur-grid__inner--no-gap_8kjv6_32","purpur-grid__inner--no-row-gap":"_purpur-grid__inner--no-row-gap_8kjv6_32","purpur-grid__inner--grid":"_purpur-grid__inner--grid_8kjv6_50","purpur-grid__inner--no-col-gap":"_purpur-grid__inner--no-col-gap_8kjv6_54","purpur-grid__inner-col-sm-4":"_purpur-grid__inner-col-sm-4_8kjv6_57","purpur-grid__inner-col-sm-3":"_purpur-grid__inner-col-sm-3_8kjv6_60","purpur-grid__inner-col-sm-2":"_purpur-grid__inner-col-sm-2_8kjv6_63","purpur-grid__inner-col-md-8":"_purpur-grid__inner-col-md-8_8kjv6_67","purpur-grid__inner-col-md-7":"_purpur-grid__inner-col-md-7_8kjv6_72","purpur-grid__inner-col-md-6":"_purpur-grid__inner-col-md-6_8kjv6_77","purpur-grid__inner-col-md-5":"_purpur-grid__inner-col-md-5_8kjv6_82","purpur-grid__inner-col-md-4":"_purpur-grid__inner-col-md-4_8kjv6_87","purpur-grid__inner-col-md-3":"_purpur-grid__inner-col-md-3_8kjv6_92","purpur-grid__inner-col-md-2":"_purpur-grid__inner-col-md-2_8kjv6_97","purpur-grid__inner-col-lg-12":"_purpur-grid__inner-col-lg-12_8kjv6_102","purpur-grid__inner-col-lg-11":"_purpur-grid__inner-col-lg-11_8kjv6_107","purpur-grid__inner-col-lg-10":"_purpur-grid__inner-col-lg-10_8kjv6_112","purpur-grid__inner-col-lg-9":"_purpur-grid__inner-col-lg-9_8kjv6_117","purpur-grid__inner-col-lg-8":"_purpur-grid__inner-col-lg-8_8kjv6_122","purpur-grid__inner-col-lg-7":"_purpur-grid__inner-col-lg-7_8kjv6_127","purpur-grid__inner-col-lg-6":"_purpur-grid__inner-col-lg-6_8kjv6_132","purpur-grid__inner-col-lg-5":"_purpur-grid__inner-col-lg-5_8kjv6_137","purpur-grid__inner-col-lg-4":"_purpur-grid__inner-col-lg-4_8kjv6_142","purpur-grid__inner-col-lg-3":"_purpur-grid__inner-col-lg-3_8kjv6_147","purpur-grid__inner-col-lg-2":"_purpur-grid__inner-col-lg-2_8kjv6_152","purpur-grid__inner--flex":"_purpur-grid__inner--flex_8kjv6_156"},x=j.bind(A),E="purpur-grid",n="purpur-grid__inner",a=({children:p,className:d,containerClassName:u,colsSm:l=1,colsMd:e=1,colsLg:r=1,noGap:i=!1,noColGap:_=!1,noRowGap:f=!1,...k})=>{const z=m.Children.toArray(p).filter(q),t=!!z.length,$=x([E,u]),h=x([n,{[`${n}--grid`]:!t,[`${n}--flex`]:t,[`${n}--no-gap`]:i,[`${n}--no-col-gap`]:_,[`${n}--no-row-gap`]:f,[`${n}-col-sm-${l}`]:l>1&&!t,[`${n}-col-md-${e}`]:e>1&&!t,[`${n}-col-lg-${r}`]:r>1&&!t},d]);return o.jsx("div",{className:$,...k,children:o.jsx("div",{className:h,children:t?m.Children.map(z,({props:{children:y,...b}})=>o.jsx(s,{...b,noColGap:i||_,children:y})):p})})};a.displayName="Grid";a.Item=s;exports.Grid=a;
|
|
6
6
|
//# sourceMappingURL=grid.cjs.js.map
|
package/dist/grid.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.cjs.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/grid.item.tsx","../src/grid.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { isValidElement, type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./grid.item.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type ItemProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n /** The number of columns that the item spans on small screens. */\n colSpanSm?: 1 | 2 | 3 | 4;\n /** The number of columns that the item spans on medium screens. */\n colSpanMd?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;\n /** The number of columns that the item spans on large screens. */\n colSpanLg?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /** This will be passed from the parent component. */\n noColGap?: boolean;\n};\n\nconst rootClassName = \"purpur-grid-item\";\n\nexport const Item = ({\n children,\n className,\n colSpanSm = 4,\n colSpanMd = 8,\n colSpanLg = 12,\n noColGap = false,\n ...props\n}: ItemProps) => {\n const classes = cx([\n
|
|
1
|
+
{"version":3,"file":"grid.cjs.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/grid.item.tsx","../src/grid.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { isValidElement, type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./grid.item.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type ItemProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n /** The number of columns that the item spans on small screens. */\n colSpanSm?: 1 | 2 | 3 | 4;\n /** The number of columns that the item spans on medium screens. */\n colSpanMd?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;\n /** The number of columns that the item spans on large screens. */\n colSpanLg?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /** This will be passed from the parent component. */\n noColGap?: boolean;\n};\n\nconst rootClassName = \"purpur-grid-item\";\n\nexport const Item = ({\n children,\n className,\n colSpanSm = 4,\n colSpanMd = 8,\n colSpanLg = 12,\n noColGap = false,\n ...props\n}: ItemProps) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--no-col-gap`]: noColGap,\n [`${rootClassName}-colspan-sm-${colSpanSm}`]: colSpanSm,\n [`${rootClassName}-colspan-md-${colSpanMd}`]: colSpanMd,\n [`${rootClassName}-colspan-lg-${colSpanLg}`]: colSpanLg,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n {children}\n </div>\n );\n};\n\nexport const isItem = (child?: ReactNode): child is ReactElement<ItemProps> =>\n !!child && isValidElement<ItemProps>(child) && child.type === Item;\n\nItem.displayName = \"Grid.Item\";\n","import React, { Children, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport { isItem, Item } from \"./grid.item\";\nimport styles from \"./grid.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type GridProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n containerClassName?: string;\n /** The number of columns on small screens. */\n colsSm?: 1 | 2 | 3 | 4;\n /** The number of columns on medium screens. */\n colsMd?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;\n /** The number of columns on large screens. */\n colsLg?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /** Eliminates gaps between columns and rows. */\n noGap?: boolean;\n /** Eliminates gaps between columns. */\n noColGap?: boolean;\n /** Eliminates gaps between rows. */\n noRowGap?: boolean;\n};\n\nexport type GridCmp<P> = React.FunctionComponent<P> & {\n Item: typeof Item;\n};\n\nconst rootClassName = \"purpur-grid\";\nconst innerClassName = \"purpur-grid__inner\";\n\nexport const Grid = ({\n children,\n className,\n containerClassName,\n colsSm = 1,\n colsMd = 1,\n colsLg = 1,\n noGap = false,\n noColGap = false,\n noRowGap = false,\n ...props\n}: GridProps) => {\n const gridItemChildren = Children.toArray(children).filter(isItem);\n const hasItemChildren = !!gridItemChildren.length;\n\n const containerClasses = cx([rootClassName, containerClassName]);\n\n const classes = cx([\n innerClassName,\n {\n [`${innerClassName}--grid`]: !hasItemChildren,\n [`${innerClassName}--flex`]: hasItemChildren,\n [`${innerClassName}--no-gap`]: noGap,\n [`${innerClassName}--no-col-gap`]: noColGap,\n [`${innerClassName}--no-row-gap`]: noRowGap,\n [`${innerClassName}-col-sm-${colsSm}`]: colsSm > 1 && !hasItemChildren,\n [`${innerClassName}-col-md-${colsMd}`]: colsMd > 1 && !hasItemChildren,\n [`${innerClassName}-col-lg-${colsLg}`]: colsLg > 1 && !hasItemChildren,\n },\n className,\n ]);\n\n return (\n <div className={containerClasses} {...props}>\n <div className={classes}>\n {hasItemChildren\n ? Children.map(gridItemChildren, ({ props: { children, ...colProps } }) => (\n <Item {...colProps} noColGap={noGap || noColGap}>\n {children}\n </Item>\n ))\n : children}\n </div>\n </div>\n );\n};\n\nGrid.displayName = \"Grid\";\n\nGrid.Item = Item;\n"],"names":["hasOwn","classNames","classes","arg","appendClass","parseValue","key","value","newClass","module","cx","c","styles","rootClassName","Item","children","className","colSpanSm","colSpanMd","colSpanLg","noColGap","props","isItem","child","isValidElement","innerClassName","Grid","containerClassName","colsSm","colsMd","colsLg","noGap","noRowGap","gridItemChildren","Children","hasItemChildren","containerClasses","jsx","colProps"],"mappings":";;;;kDAOC,UAAY,CAGZ,IAAIA,EAAS,CAAA,EAAG,eAEhB,SAASC,GAAc,CAGtB,QAFIC,EAAU,GAEL,EAAI,EAAG,EAAI,UAAU,OAAQ,IAAK,CAC1C,IAAIC,EAAM,UAAU,CAAC,EACjBA,IACHD,EAAUE,EAAYF,EAASG,EAA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GAAM,GAAGwB,EAAU,SAAUP,GAASX,EACpC,SAAAL,CAAAA,CACH,CACD,EACDA,EACN,EACF,CAEJ,EAEAW,EAAK,YAAc,OAEnBA,EAAK,KAAOZ","x_google_ignoreList":[0]}
|
package/dist/grid.es.js
CHANGED
|
@@ -80,14 +80,14 @@ const f = /* @__PURE__ */ C(I), O = {
|
|
|
80
80
|
...i
|
|
81
81
|
}) => {
|
|
82
82
|
const _ = A([
|
|
83
|
-
d,
|
|
84
83
|
o,
|
|
85
84
|
{
|
|
86
85
|
[`${o}--no-col-gap`]: r,
|
|
87
86
|
[`${o}-colspan-sm-${u}`]: u,
|
|
88
87
|
[`${o}-colspan-md-${l}`]: l,
|
|
89
88
|
[`${o}-colspan-lg-${e}`]: e
|
|
90
|
-
}
|
|
89
|
+
},
|
|
90
|
+
d
|
|
91
91
|
]);
|
|
92
92
|
return /* @__PURE__ */ g("div", { className: _, ...i, children: p });
|
|
93
93
|
}, E = (p) => !!p && b(p) && p.type === s;
|
|
@@ -133,8 +133,7 @@ const q = {
|
|
|
133
133
|
noRowGap: j = !1,
|
|
134
134
|
...k
|
|
135
135
|
}) => {
|
|
136
|
-
const m = a.toArray(p).filter(E), t = !!m.length, $ = v([
|
|
137
|
-
d,
|
|
136
|
+
const m = a.toArray(p).filter(E), t = !!m.length, $ = v([B, u]), h = v([
|
|
138
137
|
n,
|
|
139
138
|
{
|
|
140
139
|
[`${n}--grid`]: !t,
|
|
@@ -145,7 +144,8 @@ const q = {
|
|
|
145
144
|
[`${n}-col-sm-${l}`]: l > 1 && !t,
|
|
146
145
|
[`${n}-col-md-${e}`]: e > 1 && !t,
|
|
147
146
|
[`${n}-col-lg-${r}`]: r > 1 && !t
|
|
148
|
-
}
|
|
147
|
+
},
|
|
148
|
+
d
|
|
149
149
|
]);
|
|
150
150
|
return /* @__PURE__ */ g("div", { className: $, ...k, children: /* @__PURE__ */ g("div", { className: h, children: t ? a.map(m, ({ props: { children: y, ...N } }) => /* @__PURE__ */ g(s, { ...N, noColGap: i || _, children: y })) : p }) });
|
|
151
151
|
};
|
package/dist/grid.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.es.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/grid.item.tsx","../src/grid.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { isValidElement, type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./grid.item.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type ItemProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n /** The number of columns that the item spans on small screens. */\n colSpanSm?: 1 | 2 | 3 | 4;\n /** The number of columns that the item spans on medium screens. */\n colSpanMd?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;\n /** The number of columns that the item spans on large screens. */\n colSpanLg?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /** This will be passed from the parent component. */\n noColGap?: boolean;\n};\n\nconst rootClassName = \"purpur-grid-item\";\n\nexport const Item = ({\n children,\n className,\n colSpanSm = 4,\n colSpanMd = 8,\n colSpanLg = 12,\n noColGap = false,\n ...props\n}: ItemProps) => {\n const classes = cx([\n
|
|
1
|
+
{"version":3,"file":"grid.es.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/grid.item.tsx","../src/grid.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { isValidElement, type ReactElement, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./grid.item.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type ItemProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n /** The number of columns that the item spans on small screens. */\n colSpanSm?: 1 | 2 | 3 | 4;\n /** The number of columns that the item spans on medium screens. */\n colSpanMd?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;\n /** The number of columns that the item spans on large screens. */\n colSpanLg?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /** This will be passed from the parent component. */\n noColGap?: boolean;\n};\n\nconst rootClassName = \"purpur-grid-item\";\n\nexport const Item = ({\n children,\n className,\n colSpanSm = 4,\n colSpanMd = 8,\n colSpanLg = 12,\n noColGap = false,\n ...props\n}: ItemProps) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--no-col-gap`]: noColGap,\n [`${rootClassName}-colspan-sm-${colSpanSm}`]: colSpanSm,\n [`${rootClassName}-colspan-md-${colSpanMd}`]: colSpanMd,\n [`${rootClassName}-colspan-lg-${colSpanLg}`]: colSpanLg,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n {children}\n </div>\n );\n};\n\nexport const isItem = (child?: ReactNode): child is ReactElement<ItemProps> =>\n !!child && isValidElement<ItemProps>(child) && child.type === Item;\n\nItem.displayName = \"Grid.Item\";\n","import React, { Children, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport { isItem, Item } from \"./grid.item\";\nimport styles from \"./grid.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type GridProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n containerClassName?: string;\n /** The number of columns on small screens. */\n colsSm?: 1 | 2 | 3 | 4;\n /** The number of columns on medium screens. */\n colsMd?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;\n /** The number of columns on large screens. */\n colsLg?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n /** Eliminates gaps between columns and rows. */\n noGap?: boolean;\n /** Eliminates gaps between columns. */\n noColGap?: boolean;\n /** Eliminates gaps between rows. */\n noRowGap?: boolean;\n};\n\nexport type GridCmp<P> = React.FunctionComponent<P> & {\n Item: typeof Item;\n};\n\nconst rootClassName = \"purpur-grid\";\nconst innerClassName = \"purpur-grid__inner\";\n\nexport const Grid = ({\n children,\n className,\n containerClassName,\n colsSm = 1,\n colsMd = 1,\n colsLg = 1,\n noGap = false,\n noColGap = false,\n noRowGap = false,\n ...props\n}: GridProps) => {\n const gridItemChildren = Children.toArray(children).filter(isItem);\n const hasItemChildren = !!gridItemChildren.length;\n\n const containerClasses = cx([rootClassName, containerClassName]);\n\n const classes = cx([\n innerClassName,\n {\n [`${innerClassName}--grid`]: !hasItemChildren,\n [`${innerClassName}--flex`]: hasItemChildren,\n [`${innerClassName}--no-gap`]: noGap,\n [`${innerClassName}--no-col-gap`]: noColGap,\n [`${innerClassName}--no-row-gap`]: noRowGap,\n [`${innerClassName}-col-sm-${colsSm}`]: colsSm > 1 && !hasItemChildren,\n [`${innerClassName}-col-md-${colsMd}`]: colsMd > 1 && !hasItemChildren,\n [`${innerClassName}-col-lg-${colsLg}`]: colsLg > 1 && !hasItemChildren,\n },\n className,\n ]);\n\n return (\n <div className={containerClasses} {...props}>\n <div className={classes}>\n {hasItemChildren\n ? Children.map(gridItemChildren, ({ props: { children, ...colProps } }) => (\n <Item {...colProps} noColGap={noGap || noColGap}>\n {children}\n </Item>\n ))\n : children}\n </div>\n </div>\n );\n};\n\nGrid.displayName = \"Grid\";\n\nGrid.Item = Item;\n"],"names":["hasOwn","classNames","classes","arg","appendClass","parseValue","key","value","newClass","module","cx","c","styles","rootClassName","Item","children","className","colSpanSm","colSpanMd","colSpanLg","noColGap","props","isItem","child","isValidElement","innerClassName","Grid","containerClassName","colsSm","colsMd","colsLg","noGap","noRowGap","gridItemChildren","Children","hasItemChildren","containerClasses","jsx","colProps"],"mappings":";;;;;;;;;;;;;;AAOA,KAAC,WAAY;AAGZ,UAAIA,IAAS,CAAA,EAAG;AAEhB,eAASC,IAAc;AAGtB,iBAFIC,IAAU,IAEL,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AAC1C,cAAIC,IAAM,UAAU,CAAC;AACrB,UAAIA,MACHD,IAAUE,EAAYF,GAASG,EAAW,KAAK,MAAMF,CAAG,CAAC;AAAA,QAE7D;AAEE,eAAOD;AAAA,MACT;AAEC,eAASG,EAAYF,GAAK;AACzB,YAAI,OAAOA,KAAQ,YAAY,OAAOA,KAAQ;AAC7C,i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G,OAAA,EAAI,WAAWoB,GAAmB,GAAGf,GACpC,UAAA,gBAAAgB,EAAC,OAAA,EAAI,WAAWnC,GACb,cACGgC,EAAS,IAAID,GAAkB,CAAC,EAAE,OAAO,EAAE,UAAAlB,GAAU,GAAGuB,EAAA,EAAS,MAC/D,gBAAAD,EAACvB,KAAM,GAAGwB,GAAU,UAAUP,KAASX,GACpC,UAAAL,EAAAA,CACH,CACD,IACDA,GACN,GACF;AAEJ;AAEAW,EAAK,cAAc;AAEnBA,EAAK,OAAOZ;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/grid",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.7.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/grid.cjs.js",
|
|
6
6
|
"types": "./dist/grid.d.ts",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"source": "src/grid.tsx",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"classnames": "~2.5.0",
|
|
19
|
-
"@purpurds/common-types": "8.
|
|
20
|
-
"@purpurds/tokens": "8.
|
|
19
|
+
"@purpurds/common-types": "8.7.0",
|
|
20
|
+
"@purpurds/tokens": "8.7.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@storybook/react-vite": "^9.0.18",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"typescript": "^5.6.3",
|
|
39
39
|
"vite": "^6.2.1",
|
|
40
40
|
"vitest": "^3.1.2",
|
|
41
|
+
"@purpurds/link": "8.7.0",
|
|
41
42
|
"@purpurds/component-rig": "1.0.0",
|
|
42
|
-
"@purpurds/paragraph": "8.
|
|
43
|
-
"@purpurds/link": "8.5.2"
|
|
43
|
+
"@purpurds/paragraph": "8.7.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@types/react": "^18 || ^19",
|
package/src/grid.item.tsx
CHANGED
|
@@ -30,7 +30,6 @@ export const Item = ({
|
|
|
30
30
|
...props
|
|
31
31
|
}: ItemProps) => {
|
|
32
32
|
const classes = cx([
|
|
33
|
-
className,
|
|
34
33
|
rootClassName,
|
|
35
34
|
{
|
|
36
35
|
[`${rootClassName}--no-col-gap`]: noColGap,
|
|
@@ -38,6 +37,7 @@ export const Item = ({
|
|
|
38
37
|
[`${rootClassName}-colspan-md-${colSpanMd}`]: colSpanMd,
|
|
39
38
|
[`${rootClassName}-colspan-lg-${colSpanLg}`]: colSpanLg,
|
|
40
39
|
},
|
|
40
|
+
className,
|
|
41
41
|
]);
|
|
42
42
|
|
|
43
43
|
return (
|
package/src/grid.tsx
CHANGED
|
@@ -46,10 +46,9 @@ export const Grid = ({
|
|
|
46
46
|
const gridItemChildren = Children.toArray(children).filter(isItem);
|
|
47
47
|
const hasItemChildren = !!gridItemChildren.length;
|
|
48
48
|
|
|
49
|
-
const containerClasses = cx([
|
|
49
|
+
const containerClasses = cx([rootClassName, containerClassName]);
|
|
50
50
|
|
|
51
51
|
const classes = cx([
|
|
52
|
-
className,
|
|
53
52
|
innerClassName,
|
|
54
53
|
{
|
|
55
54
|
[`${innerClassName}--grid`]: !hasItemChildren,
|
|
@@ -61,6 +60,7 @@ export const Grid = ({
|
|
|
61
60
|
[`${innerClassName}-col-md-${colsMd}`]: colsMd > 1 && !hasItemChildren,
|
|
62
61
|
[`${innerClassName}-col-lg-${colsLg}`]: colsLg > 1 && !hasItemChildren,
|
|
63
62
|
},
|
|
63
|
+
className,
|
|
64
64
|
]);
|
|
65
65
|
|
|
66
66
|
return (
|