@shmidko61/lc-ui-kit 0.6.0 → 0.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 CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),w=require("./box.cjs"),g=require("./responsive-style.config-B2m9jVlX.cjs");function j(t){const i=[],n={},l={md:t.md,lg:t.lg,xl:t.xl};a(t,i,n);for(const e of g.responsiveBreakpoints){const o=l[e];o&&a(o,i,n,`${e}:`,`${e}-`)}return{className:i.join(" "),style:Object.keys(n).length>0?n:void 0}}function a({cols:t,gap:i},n,l,e="",o=""){if(t!==void 0){const c=`${o}grid-template-columns`;l[`--${c}`]=`repeat(${t}, minmax(0, 1fr))`,n.push(`${e}${m("grid-cols",`var(--${c})`)}`)}if(i!==void 0){const c=`${o}grid-gap`;l[`--${c}`]=G(i),n.push(`${e}${m("gap",`var(--${c})`)}`)}}function m(t,i){return[t,"-[",i,"]"].join("")}function G(t){return typeof t=="number"?`${t}px`:t}function N({children:t,className:i,cols:n=1,gap:l=0,md:e,lg:o,xl:c,style:s,...h}){const r=j({cols:n,gap:l,md:e,lg:o,xl:c}),v=d(e),x=d(o),y=d(c),$=r.style||s?{...r.style,...s}:void 0;return u.jsx(w.Box,{...h,display:"grid",className:g.cn(r.className,i),md:v,lg:x,xl:y,style:$,children:t})}function f({children:t,className:i,...n}){return u.jsx("div",{className:i,...n,children:t})}const S=Object.assign(N,{Item:f});function d(t){if(t)return{aspectRatio:t.aspectRatio,background:t.background,backgroundColor:t.backgroundColor,boxShadow:t.boxShadow,color:t.color,height:t.height,maxHeight:t.maxHeight,maxWidth:t.maxWidth,minHeight:t.minHeight,minWidth:t.minWidth,opacity:t.opacity,overflow:t.overflow,overflowX:t.overflowX,overflowY:t.overflowY,pointerEvents:t.pointerEvents,transform:t.transform,transformOrigin:t.transformOrigin,width:t.width}}exports.Grid=S;exports.GridItem=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),w=require("./box.cjs"),g=require("./responsive-style.config-B2m9jVlX.cjs");function j(t){const i=[],n={},l={md:t.md,lg:t.lg,xl:t.xl};a(t,i,n);for(const e of g.responsiveBreakpoints){const o=l[e];o&&a(o,i,n,`${e}:`,`${e}-`)}return{className:i.join(" "),style:Object.keys(n).length>0?n:void 0}}function a({cols:t,gap:i},n,l,e="",o=""){if(t!==void 0){const c=`${o}grid-template-columns`;l[`--${c}`]=`repeat(${t}, minmax(0, 1fr))`,n.push(`${e}${m("grid-cols",`var(--${c})`)}`)}if(i!==void 0){const c=`${o}grid-gap`;l[`--${c}`]=G(i),n.push(`${e}${m("gap",`var(--${c})`)}`)}}function m(t,i){return[t,"-[",i,"]"].join("")}function G(t){return typeof t=="number"?`${t}px`:t}function N({children:t,className:i,cols:n=1,gap:l=0,md:e,lg:o,xl:c,style:s,...h}){const d=j({cols:n,gap:l,md:e,lg:o,xl:c}),v=r(e),x=r(o),y=r(c),$=d.style||s?{...d.style,...s}:void 0;return u.jsx(w.Box,{...h,display:"grid",className:g.cn(d.className,i),md:v,lg:x,xl:y,style:$,children:t})}function f({children:t,className:i,...n}){return u.jsx("div",{className:i,...n,children:t})}const S=Object.assign(N,{Item:f});function r(t){if(t)return{aspectRatio:t.aspectRatio,background:t.background,backgroundColor:t.backgroundColor,boxShadow:t.boxShadow,color:t.color,height:t.height,maxHeight:t.maxHeight,maxWidth:t.maxWidth,minHeight:t.minHeight,minWidth:t.minWidth,m:t.m,p:t.p,opacity:t.opacity,overflow:t.overflow,overflowX:t.overflowX,overflowY:t.overflowY,pointerEvents:t.pointerEvents,transform:t.transform,transformOrigin:t.transformOrigin,width:t.width}}exports.Grid=S;exports.GridItem=f;
package/dist/grid.js CHANGED
@@ -2,15 +2,15 @@ import { jsx as f } from "react/jsx-runtime";
2
2
  import { Box as $ } from "./box.js";
3
3
  import { a as w, c as y } from "./responsive-style.config-DFuATrIM.js";
4
4
  function N(t) {
5
- const i = [], n = {}, c = {
5
+ const i = [], n = {}, l = {
6
6
  md: t.md,
7
7
  lg: t.lg,
8
8
  xl: t.xl
9
9
  };
10
- m(t, i, n);
10
+ r(t, i, n);
11
11
  for (const o of w) {
12
- const e = c[o];
13
- e && m(
12
+ const e = l[o];
13
+ e && r(
14
14
  e,
15
15
  i,
16
16
  n,
@@ -23,16 +23,16 @@ function N(t) {
23
23
  style: Object.keys(n).length > 0 ? n : void 0
24
24
  };
25
25
  }
26
- function m({ cols: t, gap: i }, n, c, o = "", e = "") {
26
+ function r({ cols: t, gap: i }, n, l, o = "", e = "") {
27
27
  if (t !== void 0) {
28
- const a = `${e}grid-template-columns`;
29
- c[`--${a}`] = `repeat(${t}, minmax(0, 1fr))`, n.push(
30
- `${o}${s("grid-cols", `var(--${a})`)}`
28
+ const c = `${e}grid-template-columns`;
29
+ l[`--${c}`] = `repeat(${t}, minmax(0, 1fr))`, n.push(
30
+ `${o}${s("grid-cols", `var(--${c})`)}`
31
31
  );
32
32
  }
33
33
  if (i !== void 0) {
34
- const a = `${e}grid-gap`;
35
- c[`--${a}`] = j(i), n.push(`${o}${s("gap", `var(--${a})`)}`);
34
+ const c = `${e}grid-gap`;
35
+ l[`--${c}`] = j(i), n.push(`${o}${s("gap", `var(--${c})`)}`);
36
36
  }
37
37
  }
38
38
  function s(t, i) {
@@ -45,23 +45,23 @@ function B({
45
45
  children: t,
46
46
  className: i,
47
47
  cols: n = 1,
48
- gap: c = 0,
48
+ gap: l = 0,
49
49
  md: o,
50
50
  lg: e,
51
- xl: a,
52
- style: r,
51
+ xl: c,
52
+ style: d,
53
53
  ...g
54
54
  }) {
55
- const l = N({ cols: n, gap: c, md: o, lg: e, xl: a }), u = d(o), h = d(e), v = d(a), x = l.style || r ? {
56
- ...l.style,
57
- ...r
55
+ const a = N({ cols: n, gap: l, md: o, lg: e, xl: c }), u = m(o), h = m(e), v = m(c), x = a.style || d ? {
56
+ ...a.style,
57
+ ...d
58
58
  } : void 0;
59
59
  return /* @__PURE__ */ f(
60
60
  $,
61
61
  {
62
62
  ...g,
63
63
  display: "grid",
64
- className: y(l.className, i),
64
+ className: y(a.className, i),
65
65
  md: u,
66
66
  lg: h,
67
67
  xl: v,
@@ -76,7 +76,7 @@ function C({ children: t, className: i, ...n }) {
76
76
  const W = Object.assign(B, {
77
77
  Item: C
78
78
  });
79
- function d(t) {
79
+ function m(t) {
80
80
  if (t)
81
81
  return {
82
82
  aspectRatio: t.aspectRatio,
@@ -89,6 +89,8 @@ function d(t) {
89
89
  maxWidth: t.maxWidth,
90
90
  minHeight: t.minHeight,
91
91
  minWidth: t.minWidth,
92
+ m: t.m,
93
+ p: t.p,
92
94
  opacity: t.opacity,
93
95
  overflow: t.overflow,
94
96
  overflowX: t.overflowX,
@@ -3,9 +3,11 @@ import { AtLeastOne } from './shared.types';
3
3
  * Значение внутреннего/внешнего отступа из рекомендованной шкалы.
4
4
  *
5
5
  * Пример: `16` сериализуется в `16px`. Тип также допускает любое число,
6
- * поэтому шкала является рекомендованной, а не строгой.
6
+ * поэтому шкала является рекомендованной, а не строгой. CSS-строки передаются
7
+ * без преобразования: `10px`, `1rem`, `14cqw`, `5%`, `calc(...)`, `var(...)`.
8
+ * Передавайте одну CSS-величину; для разных сторон используйте массив или объект.
7
9
  */
8
- export type UiKitIndentations = 0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 80 | 96 | number;
10
+ export type UiKitIndentations = 0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 80 | 96 | number | (string & {});
9
11
  /**
10
12
  * Значение внешнего отступа. `auto` полезен для центрирования через `mx`.
11
13
  */
@@ -118,6 +120,8 @@ export type UiKitAnyIndentationMargin = AtLeastOne<{
118
120
  * Пример: `<Box p={{ px: 24, py: 16 }} m={{ mx: 'auto' }} />`.
119
121
  */
120
122
  export type UiKitIndentationsProps = {
123
+ /** Число (px), CSS-величина, четыре стороны или объект осей/сторон. Доступен в md/lg/xl. */
121
124
  p?: UiKitIndentations | UiKitArrayIndentation | UiKitAxisIndentationPadding | UiKitAnyIndentationPadding | UiKitMixedXAxisIndentationPadding | UiKitMixedYAxisIndentationPadding;
125
+ /** Как padding, дополнительно поддерживает auto и отрицательные величины. */
122
126
  m?: UiKitMarginIndentation | UiKitMarginArrayIndentation | UiKitAxisIndentationMargin | UiKitAnyIndentationMargin | UiKitMixedXAxisIndentationMargin | UiKitMixedYAxisIndentationMargin;
123
127
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shmidko61/lc-ui-kit",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"