@vitus-labs/coolgrid 0.46.0 → 0.49.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/lib/analysis/vitus-labs-coolgrid.js.html +1 -1
- package/lib/analysis/vitus-labs-coolgrid.module.js.html +1 -1
- package/package.json +5 -12
- package/lib/analysis/vitus-labs-coolgrid.umd.js.html +0 -6444
- package/lib/analysis/vitus-labs-coolgrid.umd.min.js.html +0 -6444
- package/lib/vitus-labs-coolgrid.umd.js +0 -277
- package/lib/vitus-labs-coolgrid.umd.js.map +0 -1
- package/lib/vitus-labs-coolgrid.umd.min.js +0 -62
- package/lib/vitus-labs-coolgrid.umd.min.js.map +0 -1
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@vitus-labs/unistyle'), require('react'), require('@vitus-labs/core')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@vitus-labs/unistyle', 'react', '@vitus-labs/core'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.vitusLabsCoolgrid = {}, global.unistyle, global.React, global.core));
|
|
5
|
-
})(this, (function (exports, unistyle, React, core) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
-
|
|
11
|
-
const PKG_NAME = '@vitus-labs/coolgrid';
|
|
12
|
-
/* eslint-disable import/prefer-default-export */
|
|
13
|
-
const CONTEXT_KEYS = [
|
|
14
|
-
// 'breakpoints',
|
|
15
|
-
// 'rootSize',
|
|
16
|
-
'columns',
|
|
17
|
-
'size',
|
|
18
|
-
'gap',
|
|
19
|
-
'padding',
|
|
20
|
-
'gutter',
|
|
21
|
-
'colCss',
|
|
22
|
-
'colComponent',
|
|
23
|
-
'rowCss',
|
|
24
|
-
'rowComponent',
|
|
25
|
-
'contentAlignX',
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
const isNumber = (value) => Number.isFinite(value);
|
|
29
|
-
const hasValue = (value) => isNumber(value) && value > 0;
|
|
30
|
-
const isVisible = (value) => (isNumber(value) && value !== 0) || value === undefined;
|
|
31
|
-
const omitCtxKeys = (props) => core.omit(props, CONTEXT_KEYS);
|
|
32
|
-
|
|
33
|
-
var ContainerContext = React.createContext({});
|
|
34
|
-
|
|
35
|
-
const pickThemeProps = (props, keywords) => core.pick(props, keywords);
|
|
36
|
-
const getGridContext = (props = {}, theme = {}) => ({
|
|
37
|
-
columns: (core.get(props, 'columns') ||
|
|
38
|
-
core.get(theme, 'grid.columns') ||
|
|
39
|
-
core.get(theme, 'coolgrid.columns')),
|
|
40
|
-
containerWidth: (core.get(props, 'width') ||
|
|
41
|
-
core.get(theme, 'grid.container') ||
|
|
42
|
-
core.get(theme, 'coolgrid.container')),
|
|
43
|
-
});
|
|
44
|
-
const useGridContext = (props) => {
|
|
45
|
-
const { theme } = React.useContext(unistyle.context);
|
|
46
|
-
const ctxProps = pickThemeProps(props, CONTEXT_KEYS);
|
|
47
|
-
const gridContext = getGridContext(ctxProps, theme);
|
|
48
|
-
return { ...gridContext, ...ctxProps };
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const styles$2 = ({ theme: t, css, rootSize }) => css `
|
|
52
|
-
max-width: ${unistyle.value(t.width, rootSize)};
|
|
53
|
-
${unistyle.extendCss(t.extraStyles)};
|
|
54
|
-
`;
|
|
55
|
-
var Styled$2 = core.config.styled(core.config.component) `
|
|
56
|
-
${false };
|
|
57
|
-
|
|
58
|
-
display: flex;
|
|
59
|
-
width: 100%;
|
|
60
|
-
flex-direction: column;
|
|
61
|
-
margin-right: auto;
|
|
62
|
-
margin-left: auto;
|
|
63
|
-
|
|
64
|
-
${unistyle.makeItResponsive({
|
|
65
|
-
key: '$coolgrid',
|
|
66
|
-
styles: styles$2,
|
|
67
|
-
css: core.config.css,
|
|
68
|
-
normalize: true,
|
|
69
|
-
})};
|
|
70
|
-
`;
|
|
71
|
-
|
|
72
|
-
const Component$2 = ({ children, component, css, width, ...props }) => {
|
|
73
|
-
const { containerWidth = {}, ...ctx } = useGridContext(props);
|
|
74
|
-
let finalWidth = containerWidth;
|
|
75
|
-
if (width) {
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
77
|
-
// @ts-ignore
|
|
78
|
-
finalWidth = typeof width === 'function' ? width(containerWidth) : width;
|
|
79
|
-
}
|
|
80
|
-
return (React__default["default"].createElement(Styled$2, { ...omitCtxKeys(props), as: component, "$coolgrid": {
|
|
81
|
-
width: finalWidth,
|
|
82
|
-
extraStyles: css,
|
|
83
|
-
} },
|
|
84
|
-
React__default["default"].createElement(ContainerContext.Provider, { value: ctx }, children)));
|
|
85
|
-
};
|
|
86
|
-
const name$2 = `${PKG_NAME}/Container`;
|
|
87
|
-
Component$2.displayName = name$2;
|
|
88
|
-
Component$2.pkgName = PKG_NAME;
|
|
89
|
-
Component$2.VITUS_LABS__COMPONENT = name$2;
|
|
90
|
-
|
|
91
|
-
var RowContext = React.createContext({});
|
|
92
|
-
|
|
93
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
94
|
-
const spacingStyles$1 = ({ gap, gutter }, { rootSize }) => {
|
|
95
|
-
if (!isNumber(gap))
|
|
96
|
-
return '';
|
|
97
|
-
const getValue = (param) => unistyle.value(param, rootSize);
|
|
98
|
-
const spacingX = (gap / 2) * -1;
|
|
99
|
-
const spacingY = isNumber(gutter) ? gutter - gap / 2 : gap / 2;
|
|
100
|
-
return core.config.css `
|
|
101
|
-
margin: ${getValue(spacingY)} ${getValue(spacingX)};
|
|
102
|
-
`;
|
|
103
|
-
};
|
|
104
|
-
const contentAlign = (align) => {
|
|
105
|
-
if (!align)
|
|
106
|
-
return '';
|
|
107
|
-
return core.config.css `
|
|
108
|
-
justify-content: ${unistyle.ALIGN_CONTENT_MAP_X[align]};
|
|
109
|
-
`;
|
|
110
|
-
};
|
|
111
|
-
const styles$1 = ({ theme, css, rootSize }) => {
|
|
112
|
-
const { gap, gutter, contentAlignX, extraStyles } = theme;
|
|
113
|
-
return css `
|
|
114
|
-
${spacingStyles$1({ gap, gutter }, { rootSize })};
|
|
115
|
-
${contentAlign(contentAlignX)};
|
|
116
|
-
${unistyle.extendCss(extraStyles)};
|
|
117
|
-
`;
|
|
118
|
-
};
|
|
119
|
-
var Styled$1 = core.config.styled(core.config.component) `
|
|
120
|
-
${false };
|
|
121
|
-
|
|
122
|
-
display: flex;
|
|
123
|
-
flex-wrap: wrap;
|
|
124
|
-
align-self: stretch;
|
|
125
|
-
flex-direction: row;
|
|
126
|
-
|
|
127
|
-
${unistyle.makeItResponsive({
|
|
128
|
-
key: '$coolgrid',
|
|
129
|
-
styles: styles$1,
|
|
130
|
-
css: core.config.css,
|
|
131
|
-
normalize: true,
|
|
132
|
-
})};
|
|
133
|
-
`;
|
|
134
|
-
|
|
135
|
-
const Component$1 = ({ children, component, css, contentAlignX: rowAlignX, ...props }) => {
|
|
136
|
-
const parentCtx = React.useContext(ContainerContext);
|
|
137
|
-
const { columns, gap, gutter, rowComponent, rowCss, contentAlignX, ...ctx } = useGridContext({ ...parentCtx, ...props });
|
|
138
|
-
const context = React.useMemo(() => ({ ...ctx, columns, gap, gutter }), [ctx, columns, gap, gutter]);
|
|
139
|
-
const finalProps = {
|
|
140
|
-
...omitCtxKeys(props),
|
|
141
|
-
as: component || rowComponent,
|
|
142
|
-
$coolgrid: {
|
|
143
|
-
contentAlignX: rowAlignX || contentAlignX,
|
|
144
|
-
columns,
|
|
145
|
-
gap,
|
|
146
|
-
gutter,
|
|
147
|
-
extraStyles: css || rowCss,
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
return (React__default["default"].createElement(Styled$1, { ...finalProps },
|
|
151
|
-
React__default["default"].createElement(RowContext.Provider, { value: context }, children)));
|
|
152
|
-
};
|
|
153
|
-
const name$1 = `${PKG_NAME}/Row`;
|
|
154
|
-
Component$1.displayName = name$1;
|
|
155
|
-
Component$1.pkgName = PKG_NAME;
|
|
156
|
-
Component$1.VITUS_LABS__COMPONENT = name$1;
|
|
157
|
-
|
|
158
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
159
|
-
const hasWidth = (size, columns) => hasValue(size) && hasValue(columns);
|
|
160
|
-
const widthStyles = ({ size, columns, gap, RNparentWidth }, { rootSize }) => {
|
|
161
|
-
if (!hasWidth(size, columns)) {
|
|
162
|
-
return '';
|
|
163
|
-
}
|
|
164
|
-
// calculate % of width
|
|
165
|
-
const width = (RNparentWidth / columns) * size;
|
|
166
|
-
const hasGap = hasValue(gap);
|
|
167
|
-
// eslint-disable-next-line no-nested-ternary
|
|
168
|
-
const val = hasGap
|
|
169
|
-
? width - gap
|
|
170
|
-
: width;
|
|
171
|
-
return core.config.css `
|
|
172
|
-
flex-grow: 0;
|
|
173
|
-
flex-shrink: 0;
|
|
174
|
-
max-width: ${unistyle.value(val, rootSize)};
|
|
175
|
-
flex-basis: ${unistyle.value(val, rootSize)};
|
|
176
|
-
`;
|
|
177
|
-
};
|
|
178
|
-
const spacingStyles = (type, param, rootSize) => {
|
|
179
|
-
if (!param || !isNumber(param)) {
|
|
180
|
-
return '';
|
|
181
|
-
}
|
|
182
|
-
const finalStyle = `${type}: ${unistyle.value(param / 2, rootSize)}`;
|
|
183
|
-
return core.config.css `
|
|
184
|
-
${finalStyle};
|
|
185
|
-
`;
|
|
186
|
-
};
|
|
187
|
-
const styles = ({ theme, css, rootSize, }) => {
|
|
188
|
-
const { size, columns, gap, padding, extraStyles, RNparentWidth } = theme;
|
|
189
|
-
const renderStyles = isVisible(size);
|
|
190
|
-
if (renderStyles) {
|
|
191
|
-
return css `
|
|
192
|
-
left: initial;
|
|
193
|
-
position: relative;
|
|
194
|
-
${widthStyles({ size, columns, gap, RNparentWidth }, { rootSize })};
|
|
195
|
-
${spacingStyles('padding', padding, rootSize)};
|
|
196
|
-
${spacingStyles('margin', gap, rootSize)};
|
|
197
|
-
${unistyle.extendCss(extraStyles)};
|
|
198
|
-
`;
|
|
199
|
-
}
|
|
200
|
-
return css `
|
|
201
|
-
left: -9999px;
|
|
202
|
-
position: fixed;
|
|
203
|
-
margin: 0;
|
|
204
|
-
padding: 0;
|
|
205
|
-
`;
|
|
206
|
-
};
|
|
207
|
-
var Styled = core.config.styled(core.config.component) `
|
|
208
|
-
${false };
|
|
209
|
-
|
|
210
|
-
position: relative;
|
|
211
|
-
display: flex;
|
|
212
|
-
flex-basis: 0;
|
|
213
|
-
flex-grow: 1;
|
|
214
|
-
flex-direction: column;
|
|
215
|
-
justify-content: stretch;
|
|
216
|
-
|
|
217
|
-
${unistyle.makeItResponsive({
|
|
218
|
-
key: '$coolgrid',
|
|
219
|
-
styles,
|
|
220
|
-
css: core.config.css,
|
|
221
|
-
normalize: true,
|
|
222
|
-
})};
|
|
223
|
-
`;
|
|
224
|
-
|
|
225
|
-
const Component = ({ children, component, css, ...props }) => {
|
|
226
|
-
const parentCtx = React.useContext(RowContext);
|
|
227
|
-
const { colCss, colComponent, columns, gap, size, padding } = useGridContext({
|
|
228
|
-
...parentCtx,
|
|
229
|
-
...props,
|
|
230
|
-
});
|
|
231
|
-
return (React__default["default"].createElement(Styled, { ...omitCtxKeys(props), as: component || colComponent, "$coolgrid": {
|
|
232
|
-
columns,
|
|
233
|
-
gap,
|
|
234
|
-
size,
|
|
235
|
-
padding,
|
|
236
|
-
extraStyles: css || colCss,
|
|
237
|
-
} }, children));
|
|
238
|
-
};
|
|
239
|
-
const name = `${PKG_NAME}/Col`;
|
|
240
|
-
Component.displayName = name;
|
|
241
|
-
Component.pkgName = PKG_NAME;
|
|
242
|
-
Component.VITUS_LABS__COMPONENT = name;
|
|
243
|
-
|
|
244
|
-
var theme = {
|
|
245
|
-
rootSize: 16,
|
|
246
|
-
breakpoints: {
|
|
247
|
-
xs: 0,
|
|
248
|
-
sm: 576,
|
|
249
|
-
md: 768,
|
|
250
|
-
lg: 992,
|
|
251
|
-
xl: 1200,
|
|
252
|
-
},
|
|
253
|
-
grid: {
|
|
254
|
-
columns: 12,
|
|
255
|
-
container: {
|
|
256
|
-
xs: '100%',
|
|
257
|
-
sm: 540,
|
|
258
|
-
md: 720,
|
|
259
|
-
lg: 960,
|
|
260
|
-
xl: 1140,
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
Object.defineProperty(exports, 'Provider', {
|
|
266
|
-
enumerable: true,
|
|
267
|
-
get: function () { return unistyle.Provider; }
|
|
268
|
-
});
|
|
269
|
-
exports.Col = Component;
|
|
270
|
-
exports.Container = Component$2;
|
|
271
|
-
exports.Row = Component$1;
|
|
272
|
-
exports.theme = theme;
|
|
273
|
-
|
|
274
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
275
|
-
|
|
276
|
-
}));
|
|
277
|
-
//# sourceMappingURL=vitus-labs-coolgrid.umd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vitus-labs-coolgrid.umd.js","sources":["../src/constants.ts","../src/utils.ts","../src/context/ContainerContext.ts","../src/useContext.tsx","../src/Container/styled.ts","../src/Container/component.tsx","../src/context/RowContext.ts","../src/Row/styled.ts","../src/Row/component.tsx","../src/Col/styled.ts","../src/Col/component.tsx","../src/theme.ts"],"sourcesContent":["export const PKG_NAME = '@vitus-labs/coolgrid'\n\n/* eslint-disable import/prefer-default-export */\nexport const CONTEXT_KEYS = [\n // 'breakpoints',\n // 'rootSize',\n 'columns',\n 'size',\n 'gap',\n 'padding',\n 'gutter',\n 'colCss',\n 'colComponent',\n 'rowCss',\n 'rowComponent',\n 'contentAlignX',\n]\n","import { omit } from '@vitus-labs/core'\nimport { CONTEXT_KEYS } from '~/constants'\n\ntype BoolFunc = (value: any) => boolean\n\nexport const isNumber: BoolFunc = (value) => Number.isFinite(value)\nexport const hasValue: BoolFunc = (value) => isNumber(value) && value > 0\nexport const isVisible: BoolFunc = (value) =>\n (isNumber(value) && value !== 0) || value === undefined\n\ntype HasWidth = (size: any, columns: any) => boolean\nexport const hasWidth: HasWidth = (size, columns) =>\n !!(hasValue(size) && hasValue(columns))\n\ntype OmitCtxKeys = (props?: Record<string, any>) => ReturnType<typeof omit>\nexport const omitCtxKeys: OmitCtxKeys = (props) => omit(props, CONTEXT_KEYS)\n","import { createContext } from 'react'\nimport type { Context } from '~/types'\n\nexport default createContext<Context>({})\n","import { useContext } from 'react'\nimport { get, pick } from '@vitus-labs/core'\nimport { context } from '@vitus-labs/unistyle'\nimport { CONTEXT_KEYS } from '~/constants'\nimport { Obj, ValueType, Context } from '~/types'\n\n// ------------------------------------------\n// pickTheme props\n// ------------------------------------------\nexport type PickThemeProps = <T extends Record<string, unknown>>(\n props: T,\n keywords: Array<keyof T>\n) => ReturnType<typeof pick>\nconst pickThemeProps: PickThemeProps = (props, keywords) =>\n pick(props, keywords)\n\n// ------------------------------------------\n// create grid settings\n// ------------------------------------------\ntype GetGridContext = (\n props: Obj,\n theme: Obj\n) => {\n columns?: ValueType\n containerWidth?: Record<string, number>\n}\n\nexport const getGridContext: GetGridContext = (props = {}, theme = {}) => ({\n columns: (get(props, 'columns') ||\n get(theme, 'grid.columns') ||\n get(theme, 'coolgrid.columns')) as ValueType,\n containerWidth: (get(props, 'width') ||\n get(theme, 'grid.container') ||\n get(theme, 'coolgrid.container')) as Record<string, number>,\n})\n\ntype UseGridContext = (props: Obj) => Context\nconst useGridContext: UseGridContext = (props) => {\n const { theme } = useContext(context)\n const ctxProps = pickThemeProps(props, CONTEXT_KEYS)\n const gridContext = getGridContext(ctxProps, theme as Record<string, unknown>)\n\n return { ...gridContext, ...ctxProps }\n}\n\nexport default useGridContext\n","import { config } from '@vitus-labs/core'\nimport {\n makeItResponsive,\n value,\n extendCss,\n MakeItResponsiveStyles,\n} from '@vitus-labs/unistyle'\nimport { StyledTypes } from '~/types'\n\nconst styles: MakeItResponsiveStyles<\n Pick<StyledTypes, 'width' | 'extraStyles'>\n> = ({ theme: t, css, rootSize }) => css`\n max-width: ${value(t.width, rootSize)};\n ${extendCss(t.extraStyles)};\n`\n\nexport default config.styled(config.component)`\n ${\n __WEB__ &&\n config.css`\n box-sizing: border-box;\n `\n };\n\n display: flex;\n width: 100%;\n flex-direction: column;\n margin-right: auto;\n margin-left: auto;\n\n ${makeItResponsive({\n key: '$coolgrid',\n styles,\n css: config.css,\n normalize: true,\n })};\n`\n","import React from 'react'\nimport { PKG_NAME } from '~/constants'\nimport { omitCtxKeys } from '~/utils'\nimport Context from '~/context/ContainerContext'\nimport useGridContext from '~/useContext'\nimport type { ElementType } from '~/types'\nimport Styled from './styled'\n\nconst Component: ElementType<['containerWidth']> = ({\n children,\n component,\n css,\n width,\n ...props\n}) => {\n const { containerWidth = {}, ...ctx } = useGridContext(props)\n\n let finalWidth = containerWidth\n if (width) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n finalWidth = typeof width === 'function' ? width(containerWidth) : width\n }\n\n return (\n <Styled\n {...omitCtxKeys(props)}\n as={component}\n $coolgrid={{\n width: finalWidth,\n extraStyles: css,\n }}\n >\n <Context.Provider value={ctx}>{children}</Context.Provider>\n </Styled>\n )\n}\n\nconst name = `${PKG_NAME}/Container`\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.VITUS_LABS__COMPONENT = name\n\nexport default Component\n","import { createContext } from 'react'\nimport type { Context } from '~/types'\n\nexport default createContext<Context>({})\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { config } from '@vitus-labs/core'\nimport {\n makeItResponsive,\n value,\n extendCss,\n ALIGN_CONTENT_MAP_X,\n MakeItResponsiveStyles,\n} from '@vitus-labs/unistyle'\nimport { isNumber } from '~/utils'\nimport { CssOutput, StyledTypes } from '~/types'\n\ntype SpacingStyles = (\n props: Pick<StyledTypes, 'gap' | 'gutter'>,\n { rootSize }: { rootSize?: number }\n) => CssOutput\n\nconst spacingStyles: SpacingStyles = ({ gap, gutter }, { rootSize }) => {\n if (!isNumber(gap)) return ''\n\n const getValue = (param) => value(param, rootSize)\n\n const spacingX = (gap! / 2) * -1\n const spacingY = isNumber(gutter) ? gutter! - gap! / 2 : gap! / 2\n\n return config.css`\n margin: ${getValue(spacingY)} ${getValue(spacingX)};\n `\n}\n\nconst contentAlign = (align?: StyledTypes['contentAlignX']) => {\n if (!align) return ''\n\n return config.css`\n justify-content: ${ALIGN_CONTENT_MAP_X[align]};\n `\n}\n\nconst styles: MakeItResponsiveStyles<\n Pick<StyledTypes, 'gap' | 'gutter' | 'contentAlignX' | 'extraStyles'>\n> = ({ theme, css, rootSize }) => {\n const { gap, gutter, contentAlignX, extraStyles } = theme\n\n return css`\n ${spacingStyles({ gap, gutter }, { rootSize })};\n ${contentAlign(contentAlignX)};\n ${extendCss(extraStyles)};\n `\n}\n\nexport default config.styled(config.component)`\n ${\n __WEB__ &&\n config.css`\n box-sizing: border-box;\n `\n };\n\n display: flex;\n flex-wrap: wrap;\n align-self: stretch;\n flex-direction: row;\n\n ${makeItResponsive({\n key: '$coolgrid',\n styles,\n css: config.css,\n normalize: true,\n })};\n`\n","import React, { useContext, useMemo } from 'react'\nimport { PKG_NAME } from '~/constants'\nimport { omitCtxKeys } from '~/utils'\nimport useGridContext from '~/useContext'\nimport { ContainerContext, RowContext } from '~/context'\nimport type { ElementType } from '~/types'\nimport Styled from './styled'\n\nconst Component: ElementType<\n ['containerWidth', 'width', 'rowComponent', 'rowCss']\n> = ({ children, component, css, contentAlignX: rowAlignX, ...props }) => {\n const parentCtx = useContext(ContainerContext)\n const { columns, gap, gutter, rowComponent, rowCss, contentAlignX, ...ctx } =\n useGridContext({ ...parentCtx, ...props })\n\n const context = useMemo(\n () => ({ ...ctx, columns, gap, gutter }),\n [ctx, columns, gap, gutter]\n )\n\n const finalProps = {\n ...omitCtxKeys(props),\n as: component || rowComponent,\n $coolgrid: {\n contentAlignX: rowAlignX || contentAlignX,\n columns,\n gap,\n gutter,\n extraStyles: css || rowCss,\n },\n }\n\n return (\n <Styled {...finalProps}>\n <RowContext.Provider value={context}>{children}</RowContext.Provider>\n </Styled>\n )\n}\n\nconst name = `${PKG_NAME}/Row`\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.VITUS_LABS__COMPONENT = name\n\nexport default Component\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { config } from '@vitus-labs/core'\nimport {\n makeItResponsive,\n value,\n extendCss,\n MakeItResponsiveStyles,\n} from '@vitus-labs/unistyle'\nimport { hasValue, isVisible, isNumber } from '~/utils'\nimport { CssOutput, StyledTypes } from '~/types'\n\ntype HasWidth = (size?: number, columns?: number) => boolean\n\nconst hasWidth: HasWidth = (size, columns) =>\n hasValue(size) && hasValue(columns)\n\ntype WidthStyles = (\n props: Pick<StyledTypes, 'size' | 'columns' | 'gap' | 'RNparentWidth'>,\n defaults: { rootSize?: number }\n) => CssOutput\n\nconst widthStyles: WidthStyles = (\n { size, columns, gap, RNparentWidth },\n { rootSize }\n) => {\n if (!hasWidth(size, columns)) {\n return ''\n }\n\n // calculate % of width\n const width = __WEB__\n ? (size! / columns!) * 100\n : (RNparentWidth / columns!) * size!\n\n const hasGap = hasValue(gap)\n\n // eslint-disable-next-line no-nested-ternary\n const val = __WEB__\n ? hasGap\n ? `calc(${width}% - ${gap}px)`\n : `${width}%`\n : hasGap\n ? width - gap!\n : width\n\n return config.css`\n flex-grow: 0;\n flex-shrink: 0;\n max-width: ${value(val, rootSize)};\n flex-basis: ${value(val, rootSize)};\n `\n}\n\ntype SpacingStyles = (\n type: 'margin' | 'padding',\n param?: number,\n rootSize?: number\n) => CssOutput\nconst spacingStyles: SpacingStyles = (type, param, rootSize) => {\n if (!param || !isNumber(param)) {\n return ''\n }\n\n const finalStyle = `${type}: ${value(param / 2, rootSize)}`\n\n return config.css`\n ${finalStyle};\n `\n}\n\nconst styles: MakeItResponsiveStyles<StyledTypes> = ({\n theme,\n css,\n rootSize,\n}) => {\n const { size, columns, gap, padding, extraStyles, RNparentWidth } = theme\n const renderStyles = isVisible(size)\n\n if (renderStyles) {\n return css`\n left: initial;\n position: relative;\n ${widthStyles({ size, columns, gap, RNparentWidth }, { rootSize })};\n ${spacingStyles('padding', padding, rootSize)};\n ${spacingStyles('margin', gap, rootSize)};\n ${extendCss(extraStyles)};\n `\n }\n\n return css`\n left: -9999px;\n position: fixed;\n margin: 0;\n padding: 0;\n `\n}\n\nexport default config.styled(config.component)`\n ${\n __WEB__ &&\n config.css`\n box-sizing: border-box;\n `\n };\n\n position: relative;\n display: flex;\n flex-basis: 0;\n flex-grow: 1;\n flex-direction: column;\n justify-content: stretch;\n\n ${makeItResponsive({\n key: '$coolgrid',\n styles,\n css: config.css,\n normalize: true,\n })};\n`\n","import React, { useContext } from 'react'\nimport { PKG_NAME } from '~/constants'\nimport { omitCtxKeys } from '~/utils'\nimport useGridContext from '~/useContext'\nimport { RowContext } from '~/context'\nimport type { ElementType } from '~/types'\nimport Styled from './styled'\n\nconst Component: ElementType<\n [\n 'containerWidth',\n 'width',\n 'rowComponent',\n 'rowCss',\n 'colCss',\n 'colComponent',\n 'columns',\n 'gap',\n 'gutter',\n 'contentAlignX'\n ]\n> = ({ children, component, css, ...props }) => {\n const parentCtx = useContext(RowContext)\n const { colCss, colComponent, columns, gap, size, padding } = useGridContext({\n ...parentCtx,\n ...props,\n })\n\n return (\n <Styled\n {...omitCtxKeys(props)}\n as={component || colComponent}\n $coolgrid={{\n columns,\n gap,\n size,\n padding,\n extraStyles: css || colCss,\n }}\n >\n {children}\n </Styled>\n )\n}\n\nconst name = `${PKG_NAME}/Col`\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.VITUS_LABS__COMPONENT = name\n\nexport default Component\n","export default {\n rootSize: 16,\n breakpoints: {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n },\n grid: {\n columns: 12,\n container: {\n xs: '100%',\n sm: 540,\n md: 720,\n lg: 960,\n xl: 1140,\n },\n },\n} as const\n"],"names":["omit","createContext","pick","get","useContext","context","styles","value","extendCss","config","makeItResponsive","Component","React","Styled","Context","name","spacingStyles","ALIGN_CONTENT_MAP_X","useMemo"],"mappings":";;;;;;;;;;EAAO,MAAM,QAAQ,GAAG,sBAAsB,CAAA;EAE9C;EACO,MAAM,YAAY,GAAG;;;MAG1B,SAAS;MACT,MAAM;MACN,KAAK;MACL,SAAS;MACT,QAAQ;MACR,QAAQ;MACR,cAAc;MACd,QAAQ;MACR,cAAc;MACd,eAAe;GAChB;;ECXM,MAAM,QAAQ,GAAa,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;EAC5D,MAAM,QAAQ,GAAa,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAA;EAClE,MAAM,SAAS,GAAa,CAAC,KAAK,KACvC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,KAAK,KAAK,KAAK,SAAS,CAAA;EAOlD,MAAM,WAAW,GAAgB,CAAC,KAAK,KAAKA,SAAI,CAAC,KAAK,EAAE,YAAY,CAAC;;ACZ5E,yBAAeC,mBAAa,CAAU,EAAE,CAAC;;ECUzC,MAAM,cAAc,GAAmB,CAAC,KAAK,EAAE,QAAQ,KACrDC,SAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;EAahB,MAAM,cAAc,GAAmB,CAAC,KAAK,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,MAAM;EACzE,IAAA,OAAO,GAAGC,QAAG,CAAC,KAAK,EAAE,SAAS,CAAC;EAC7B,QAAAA,QAAG,CAAC,KAAK,EAAE,cAAc,CAAC;EAC1B,QAAAA,QAAG,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAc;EAC9C,IAAA,cAAc,GAAGA,QAAG,CAAC,K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WAAW,EAAE,GAAG,IAAI,MAAM;WAC3B,EAEA,EAAA,QAAQ,CACF,EACV;EACH,EAAC;EAED,MAAM,IAAI,GAAG,CAAG,EAAA,QAAQ,MAAM,CAAA;EAE9B,SAAS,CAAC,WAAW,GAAG,IAAI,CAAA;EAC5B,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAA;EAC5B,SAAS,CAAC,qBAAqB,GAAG,IAAI;;ACjDtC,cAAe;EACb,IAAA,QAAQ,EAAE,EAAE;EACZ,IAAA,WAAW,EAAE;EACX,QAAA,EAAE,EAAE,CAAC;EACL,QAAA,EAAE,EAAE,GAAG;EACP,QAAA,EAAE,EAAE,GAAG;EACP,QAAA,EAAE,EAAE,GAAG;EACP,QAAA,EAAE,EAAE,IAAI;EACT,KAAA;EACD,IAAA,IAAI,EAAE;EACJ,QAAA,OAAO,EAAE,EAAE;EACX,QAAA,SAAS,EAAE;EACT,YAAA,EAAE,EAAE,MAAM;EACV,YAAA,EAAE,EAAE,GAAG;EACP,YAAA,EAAE,EAAE,GAAG;EACP,YAAA,EAAE,EAAE,GAAG;EACP,YAAA,EAAE,EAAE,IAAI;EACT,SAAA;EACF,KAAA;GACO;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@vitus-labs/unistyle"),require("react"),require("@vitus-labs/core")):"function"==typeof define&&define.amd?define(["exports","@vitus-labs/unistyle","react","@vitus-labs/core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vitusLabsCoolgrid={},e.unistyle,e.React,e.core)}(this,(function(e,t,o,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(o);const r="@vitus-labs/coolgrid",c=["columns","size","gap","padding","gutter","colCss","colComponent","rowCss","rowComponent","contentAlignX"],l=e=>Number.isFinite(e),a=e=>l(e)&&e>0,u=e=>n.omit(e,c);var d=o.createContext({});const g=e=>{const{theme:i}=o.useContext(t.context),s=((e,t)=>n.pick(e,t))(e,c);return{...((e={},t={})=>({columns:n.get(e,"columns")||n.get(t,"grid.columns")||n.get(t,"coolgrid.columns"),containerWidth:n.get(e,"width")||n.get(t,"grid.container")||n.get(t,"coolgrid.container")}))(s,i),...s}};var m=n.config.styled(n.config.component)`
|
|
2
|
-
${!1};
|
|
3
|
-
|
|
4
|
-
display: flex;
|
|
5
|
-
width: 100%;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
margin-right: auto;
|
|
8
|
-
margin-left: auto;
|
|
9
|
-
|
|
10
|
-
${t.makeItResponsive({key:"$coolgrid",styles:({theme:e,css:o,rootSize:n})=>o`
|
|
11
|
-
max-width: ${t.value(e.width,n)};
|
|
12
|
-
${t.extendCss(e.extraStyles)};
|
|
13
|
-
`,css:n.config.css,normalize:!0})};
|
|
14
|
-
`;const f=({children:e,component:t,css:o,width:n,...i})=>{const{containerWidth:r={},...c}=g(i);let l=r;return n&&(l="function"==typeof n?n(r):n),s.default.createElement(m,{...u(i),as:t,$coolgrid:{width:l,extraStyles:o}},s.default.createElement(d.Provider,{value:c},e))},p=`${r}/Container`;f.displayName=p,f.pkgName=r,f.VITUS_LABS__COMPONENT=p;var x=o.createContext({});var y=n.config.styled(n.config.component)`
|
|
15
|
-
${!1};
|
|
16
|
-
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-wrap: wrap;
|
|
19
|
-
align-self: stretch;
|
|
20
|
-
flex-direction: row;
|
|
21
|
-
|
|
22
|
-
${t.makeItResponsive({key:"$coolgrid",styles:({theme:e,css:o,rootSize:i})=>{const{gap:s,gutter:r,contentAlignX:c,extraStyles:a}=e;return o`
|
|
23
|
-
${(({gap:e,gutter:o},{rootSize:i})=>{if(!l(e))return"";const s=e=>t.value(e,i),r=e/2*-1,c=l(o)?o-e/2:e/2;return n.config.css`
|
|
24
|
-
margin: ${s(c)} ${s(r)};
|
|
25
|
-
`})({gap:s,gutter:r},{rootSize:i})};
|
|
26
|
-
${u=c,u?n.config.css`
|
|
27
|
-
justify-content: ${t.ALIGN_CONTENT_MAP_X[u]};
|
|
28
|
-
`:""};
|
|
29
|
-
${t.extendCss(a)};
|
|
30
|
-
`;var u},css:n.config.css,normalize:!0})};
|
|
31
|
-
`;const v=({children:e,component:t,css:n,contentAlignX:i,...r})=>{const c=o.useContext(d),{columns:l,gap:a,gutter:m,rowComponent:f,rowCss:p,contentAlignX:v,...$}=g({...c,...r}),h=o.useMemo((()=>({...$,columns:l,gap:a,gutter:m})),[$,l,a,m]),C={...u(r),as:t||f,$coolgrid:{contentAlignX:i||v,columns:l,gap:a,gutter:m,extraStyles:n||p}};return s.default.createElement(y,{...C},s.default.createElement(x.Provider,{value:h},e))},$=`${r}/Row`;v.displayName=$,v.pkgName=r,v.VITUS_LABS__COMPONENT=$;const h=({size:e,columns:o,gap:i,RNparentWidth:s},{rootSize:r})=>{if(!((e,t)=>a(e)&&a(t))(e,o))return"";const c=s/o*e,l=a(i)?c-i:c;return n.config.css`
|
|
32
|
-
flex-grow: 0;
|
|
33
|
-
flex-shrink: 0;
|
|
34
|
-
max-width: ${t.value(l,r)};
|
|
35
|
-
flex-basis: ${t.value(l,r)};
|
|
36
|
-
`},C=(e,o,i)=>{if(!o||!l(o))return"";const s=`${e}: ${t.value(o/2,i)}`;return n.config.css`
|
|
37
|
-
${s};
|
|
38
|
-
`};var S=n.config.styled(n.config.component)`
|
|
39
|
-
${!1};
|
|
40
|
-
|
|
41
|
-
position: relative;
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-basis: 0;
|
|
44
|
-
flex-grow: 1;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
justify-content: stretch;
|
|
47
|
-
|
|
48
|
-
${t.makeItResponsive({key:"$coolgrid",styles:({theme:e,css:o,rootSize:n})=>{const{size:i,columns:s,gap:r,padding:c,extraStyles:a,RNparentWidth:u}=e;var d;return l(d=i)&&0!==d||void 0===d?o`
|
|
49
|
-
left: initial;
|
|
50
|
-
position: relative;
|
|
51
|
-
${h({size:i,columns:s,gap:r,RNparentWidth:u},{rootSize:n})};
|
|
52
|
-
${C("padding",c,n)};
|
|
53
|
-
${C("margin",r,n)};
|
|
54
|
-
${t.extendCss(a)};
|
|
55
|
-
`:o`
|
|
56
|
-
left: -9999px;
|
|
57
|
-
position: fixed;
|
|
58
|
-
margin: 0;
|
|
59
|
-
padding: 0;
|
|
60
|
-
`},css:n.config.css,normalize:!0})};
|
|
61
|
-
`;const N=({children:e,component:t,css:n,...i})=>{const r=o.useContext(x),{colCss:c,colComponent:l,columns:a,gap:d,size:m,padding:f}=g({...r,...i});return s.default.createElement(S,{...u(i),as:t||l,$coolgrid:{columns:a,gap:d,size:m,padding:f,extraStyles:n||c}},e)},w=`${r}/Col`;N.displayName=w,N.pkgName=r,N.VITUS_LABS__COMPONENT=w;Object.defineProperty(e,"Provider",{enumerable:!0,get:function(){return t.Provider}}),e.Col=N,e.Container=f,e.Row=v,e.theme={rootSize:16,breakpoints:{xs:0,sm:576,md:768,lg:992,xl:1200},grid:{columns:12,container:{xs:"100%",sm:540,md:720,lg:960,xl:1140}}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
62
|
-
//# sourceMappingURL=vitus-labs-coolgrid.umd.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vitus-labs-coolgrid.umd.min.js","sources":["../src/constants.ts","../src/utils.ts","../src/context/ContainerContext.ts","../src/useContext.tsx","../src/Container/styled.ts","../src/Container/component.tsx","../src/context/RowContext.ts","../src/Row/styled.ts","../src/Row/component.tsx","../src/Col/styled.ts","../src/Col/component.tsx","../src/theme.ts"],"sourcesContent":["export const PKG_NAME = '@vitus-labs/coolgrid'\n\n/* eslint-disable import/prefer-default-export */\nexport const CONTEXT_KEYS = [\n // 'breakpoints',\n // 'rootSize',\n 'columns',\n 'size',\n 'gap',\n 'padding',\n 'gutter',\n 'colCss',\n 'colComponent',\n 'rowCss',\n 'rowComponent',\n 'contentAlignX',\n]\n","import { omit } from '@vitus-labs/core'\nimport { CONTEXT_KEYS } from '~/constants'\n\ntype BoolFunc = (value: any) => boolean\n\nexport const isNumber: BoolFunc = (value) => Number.isFinite(value)\nexport const hasValue: BoolFunc = (value) => isNumber(value) && value > 0\nexport const isVisible: BoolFunc = (value) =>\n (isNumber(value) && value !== 0) || value === undefined\n\ntype HasWidth = (size: any, columns: any) => boolean\nexport const hasWidth: HasWidth = (size, columns) =>\n !!(hasValue(size) && hasValue(columns))\n\ntype OmitCtxKeys = (props?: Record<string, any>) => ReturnType<typeof omit>\nexport const omitCtxKeys: OmitCtxKeys = (props) => omit(props, CONTEXT_KEYS)\n","import { createContext } from 'react'\nimport type { Context } from '~/types'\n\nexport default createContext<Context>({})\n","import { useContext } from 'react'\nimport { get, pick } from '@vitus-labs/core'\nimport { context } from '@vitus-labs/unistyle'\nimport { CONTEXT_KEYS } from '~/constants'\nimport { Obj, ValueType, Context } from '~/types'\n\n// ------------------------------------------\n// pickTheme props\n// ------------------------------------------\nexport type PickThemeProps = <T extends Record<string, unknown>>(\n props: T,\n keywords: Array<keyof T>\n) => ReturnType<typeof pick>\nconst pickThemeProps: PickThemeProps = (props, keywords) =>\n pick(props, keywords)\n\n// ------------------------------------------\n// create grid settings\n// ------------------------------------------\ntype GetGridContext = (\n props: Obj,\n theme: Obj\n) => {\n columns?: ValueType\n containerWidth?: Record<string, number>\n}\n\nexport const getGridContext: GetGridContext = (props = {}, theme = {}) => ({\n columns: (get(props, 'columns') ||\n get(theme, 'grid.columns') ||\n get(theme, 'coolgrid.columns')) as ValueType,\n containerWidth: (get(props, 'width') ||\n get(theme, 'grid.container') ||\n get(theme, 'coolgrid.container')) as Record<string, number>,\n})\n\ntype UseGridContext = (props: Obj) => Context\nconst useGridContext: UseGridContext = (props) => {\n const { theme } = useContext(context)\n const ctxProps = pickThemeProps(props, CONTEXT_KEYS)\n const gridContext = getGridContext(ctxProps, theme as Record<string, unknown>)\n\n return { ...gridContext, ...ctxProps }\n}\n\nexport default useGridContext\n","import { config } from '@vitus-labs/core'\nimport {\n makeItResponsive,\n value,\n extendCss,\n MakeItResponsiveStyles,\n} from '@vitus-labs/unistyle'\nimport { StyledTypes } from '~/types'\n\nconst styles: MakeItResponsiveStyles<\n Pick<StyledTypes, 'width' | 'extraStyles'>\n> = ({ theme: t, css, rootSize }) => css`\n max-width: ${value(t.width, rootSize)};\n ${extendCss(t.extraStyles)};\n`\n\nexport default config.styled(config.component)`\n ${\n __WEB__ &&\n config.css`\n box-sizing: border-box;\n `\n };\n\n display: flex;\n width: 100%;\n flex-direction: column;\n margin-right: auto;\n margin-left: auto;\n\n ${makeItResponsive({\n key: '$coolgrid',\n styles,\n css: config.css,\n normalize: true,\n })};\n`\n","import React from 'react'\nimport { PKG_NAME } from '~/constants'\nimport { omitCtxKeys } from '~/utils'\nimport Context from '~/context/ContainerContext'\nimport useGridContext from '~/useContext'\nimport type { ElementType } from '~/types'\nimport Styled from './styled'\n\nconst Component: ElementType<['containerWidth']> = ({\n children,\n component,\n css,\n width,\n ...props\n}) => {\n const { containerWidth = {}, ...ctx } = useGridContext(props)\n\n let finalWidth = containerWidth\n if (width) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n finalWidth = typeof width === 'function' ? width(containerWidth) : width\n }\n\n return (\n <Styled\n {...omitCtxKeys(props)}\n as={component}\n $coolgrid={{\n width: finalWidth,\n extraStyles: css,\n }}\n >\n <Context.Provider value={ctx}>{children}</Context.Provider>\n </Styled>\n )\n}\n\nconst name = `${PKG_NAME}/Container`\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.VITUS_LABS__COMPONENT = name\n\nexport default Component\n","import { createContext } from 'react'\nimport type { Context } from '~/types'\n\nexport default createContext<Context>({})\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { config } from '@vitus-labs/core'\nimport {\n makeItResponsive,\n value,\n extendCss,\n ALIGN_CONTENT_MAP_X,\n MakeItResponsiveStyles,\n} from '@vitus-labs/unistyle'\nimport { isNumber } from '~/utils'\nimport { CssOutput, StyledTypes } from '~/types'\n\ntype SpacingStyles = (\n props: Pick<StyledTypes, 'gap' | 'gutter'>,\n { rootSize }: { rootSize?: number }\n) => CssOutput\n\nconst spacingStyles: SpacingStyles = ({ gap, gutter }, { rootSize }) => {\n if (!isNumber(gap)) return ''\n\n const getValue = (param) => value(param, rootSize)\n\n const spacingX = (gap! / 2) * -1\n const spacingY = isNumber(gutter) ? gutter! - gap! / 2 : gap! / 2\n\n return config.css`\n margin: ${getValue(spacingY)} ${getValue(spacingX)};\n `\n}\n\nconst contentAlign = (align?: StyledTypes['contentAlignX']) => {\n if (!align) return ''\n\n return config.css`\n justify-content: ${ALIGN_CONTENT_MAP_X[align]};\n `\n}\n\nconst styles: MakeItResponsiveStyles<\n Pick<StyledTypes, 'gap' | 'gutter' | 'contentAlignX' | 'extraStyles'>\n> = ({ theme, css, rootSize }) => {\n const { gap, gutter, contentAlignX, extraStyles } = theme\n\n return css`\n ${spacingStyles({ gap, gutter }, { rootSize })};\n ${contentAlign(contentAlignX)};\n ${extendCss(extraStyles)};\n `\n}\n\nexport default config.styled(config.component)`\n ${\n __WEB__ &&\n config.css`\n box-sizing: border-box;\n `\n };\n\n display: flex;\n flex-wrap: wrap;\n align-self: stretch;\n flex-direction: row;\n\n ${makeItResponsive({\n key: '$coolgrid',\n styles,\n css: config.css,\n normalize: true,\n })};\n`\n","import React, { useContext, useMemo } from 'react'\nimport { PKG_NAME } from '~/constants'\nimport { omitCtxKeys } from '~/utils'\nimport useGridContext from '~/useContext'\nimport { ContainerContext, RowContext } from '~/context'\nimport type { ElementType } from '~/types'\nimport Styled from './styled'\n\nconst Component: ElementType<\n ['containerWidth', 'width', 'rowComponent', 'rowCss']\n> = ({ children, component, css, contentAlignX: rowAlignX, ...props }) => {\n const parentCtx = useContext(ContainerContext)\n const { columns, gap, gutter, rowComponent, rowCss, contentAlignX, ...ctx } =\n useGridContext({ ...parentCtx, ...props })\n\n const context = useMemo(\n () => ({ ...ctx, columns, gap, gutter }),\n [ctx, columns, gap, gutter]\n )\n\n const finalProps = {\n ...omitCtxKeys(props),\n as: component || rowComponent,\n $coolgrid: {\n contentAlignX: rowAlignX || contentAlignX,\n columns,\n gap,\n gutter,\n extraStyles: css || rowCss,\n },\n }\n\n return (\n <Styled {...finalProps}>\n <RowContext.Provider value={context}>{children}</RowContext.Provider>\n </Styled>\n )\n}\n\nconst name = `${PKG_NAME}/Row`\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.VITUS_LABS__COMPONENT = name\n\nexport default Component\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { config } from '@vitus-labs/core'\nimport {\n makeItResponsive,\n value,\n extendCss,\n MakeItResponsiveStyles,\n} from '@vitus-labs/unistyle'\nimport { hasValue, isVisible, isNumber } from '~/utils'\nimport { CssOutput, StyledTypes } from '~/types'\n\ntype HasWidth = (size?: number, columns?: number) => boolean\n\nconst hasWidth: HasWidth = (size, columns) =>\n hasValue(size) && hasValue(columns)\n\ntype WidthStyles = (\n props: Pick<StyledTypes, 'size' | 'columns' | 'gap' | 'RNparentWidth'>,\n defaults: { rootSize?: number }\n) => CssOutput\n\nconst widthStyles: WidthStyles = (\n { size, columns, gap, RNparentWidth },\n { rootSize }\n) => {\n if (!hasWidth(size, columns)) {\n return ''\n }\n\n // calculate % of width\n const width = __WEB__\n ? (size! / columns!) * 100\n : (RNparentWidth / columns!) * size!\n\n const hasGap = hasValue(gap)\n\n // eslint-disable-next-line no-nested-ternary\n const val = __WEB__\n ? hasGap\n ? `calc(${width}% - ${gap}px)`\n : `${width}%`\n : hasGap\n ? width - gap!\n : width\n\n return config.css`\n flex-grow: 0;\n flex-shrink: 0;\n max-width: ${value(val, rootSize)};\n flex-basis: ${value(val, rootSize)};\n `\n}\n\ntype SpacingStyles = (\n type: 'margin' | 'padding',\n param?: number,\n rootSize?: number\n) => CssOutput\nconst spacingStyles: SpacingStyles = (type, param, rootSize) => {\n if (!param || !isNumber(param)) {\n return ''\n }\n\n const finalStyle = `${type}: ${value(param / 2, rootSize)}`\n\n return config.css`\n ${finalStyle};\n `\n}\n\nconst styles: MakeItResponsiveStyles<StyledTypes> = ({\n theme,\n css,\n rootSize,\n}) => {\n const { size, columns, gap, padding, extraStyles, RNparentWidth } = theme\n const renderStyles = isVisible(size)\n\n if (renderStyles) {\n return css`\n left: initial;\n position: relative;\n ${widthStyles({ size, columns, gap, RNparentWidth }, { rootSize })};\n ${spacingStyles('padding', padding, rootSize)};\n ${spacingStyles('margin', gap, rootSize)};\n ${extendCss(extraStyles)};\n `\n }\n\n return css`\n left: -9999px;\n position: fixed;\n margin: 0;\n padding: 0;\n `\n}\n\nexport default config.styled(config.component)`\n ${\n __WEB__ &&\n config.css`\n box-sizing: border-box;\n `\n };\n\n position: relative;\n display: flex;\n flex-basis: 0;\n flex-grow: 1;\n flex-direction: column;\n justify-content: stretch;\n\n ${makeItResponsive({\n key: '$coolgrid',\n styles,\n css: config.css,\n normalize: true,\n })};\n`\n","import React, { useContext } from 'react'\nimport { PKG_NAME } from '~/constants'\nimport { omitCtxKeys } from '~/utils'\nimport useGridContext from '~/useContext'\nimport { RowContext } from '~/context'\nimport type { ElementType } from '~/types'\nimport Styled from './styled'\n\nconst Component: ElementType<\n [\n 'containerWidth',\n 'width',\n 'rowComponent',\n 'rowCss',\n 'colCss',\n 'colComponent',\n 'columns',\n 'gap',\n 'gutter',\n 'contentAlignX'\n ]\n> = ({ children, component, css, ...props }) => {\n const parentCtx = useContext(RowContext)\n const { colCss, colComponent, columns, gap, size, padding } = useGridContext({\n ...parentCtx,\n ...props,\n })\n\n return (\n <Styled\n {...omitCtxKeys(props)}\n as={component || colComponent}\n $coolgrid={{\n columns,\n gap,\n size,\n padding,\n extraStyles: css || colCss,\n }}\n >\n {children}\n </Styled>\n )\n}\n\nconst name = `${PKG_NAME}/Col`\n\nComponent.displayName = name\nComponent.pkgName = PKG_NAME\nComponent.VITUS_LABS__COMPONENT = name\n\nexport default Component\n","export default {\n rootSize: 16,\n breakpoints: {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n },\n grid: {\n columns: 12,\n container: {\n xs: '100%',\n sm: 540,\n md: 720,\n lg: 960,\n xl: 1140,\n },\n },\n} as const\n"],"names":["PKG_NAME","CONTEXT_KEYS","isNumber","value","Number","isFinite","hasValue","omitCtxKeys","props","omit","createContext","useGridContext","theme","useContext","context","ctxProps","keywords","pick","pickThemeProps","columns","get","containerWidth","getGridContext","config","styled","component","makeItResponsive","key","t","css","rootSize","width","extendCss","extraStyles","normalize","Component","children","ctx","finalWidth","React","createElement","Styled","as","$coolgrid","Context","Provider","name","displayName","pkgName","Component$2","VITUS_LABS__COMPONENT","gap","gutter","contentAlignX","getValue","param","spacingX","spacingY","spacingStyles","align","ALIGN_CONTENT_MAP_X","rowAlignX","parentCtx","ContainerContext","rowComponent","rowCss","useMemo","finalProps","RowContext","Component$1","widthStyles","size","RNparentWidth","hasWidth","val","type","finalStyle","styles","padding","undefined","colCss","colComponent","breakpoints","xs","sm","md","lg","xl","grid","container"],"mappings":"2eAAO,MAAMA,EAAW,uBAGXC,EAAe,CAG1B,UACA,OACA,MACA,UACA,SACA,SACA,eACA,SACA,eACA,iBCVWC,EAAsBC,GAAUC,OAAOC,SAASF,GAChDG,EAAsBH,GAAUD,EAASC,IAAUA,EAAQ,EAS3DI,EAA4BC,GAAUC,OAAKD,EAAOP,GCZhDS,IAAAA,EAAAA,EAAAA,cAAuB,ICUtC,MAwBMC,EAAkCH,IACtC,MAAMI,MAAEA,GAAUC,EAAUA,WAACC,EAAOA,SAC9BC,EA1B+B,EAACP,EAAOQ,IAC7CC,EAAAA,KAAKT,EAAOQ,GAyBKE,CAAeV,EAAOP,GAGvC,MAAO,IAfqC,EAACO,EAAQ,GAAII,EAAQ,MAAQ,CACzEO,QAAUC,EAAAA,IAAIZ,EAAO,YACnBY,EAAGA,IAACR,EAAO,iBACXQ,MAAIR,EAAO,oBACbS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