@arthurzakharov/ui-kit 1.9.6 → 1.9.8
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._FormRow_7ij1y_1{display:flex;flex-direction:column;align-items:stretch}._XXS_7ij1y_7{gap:var(--rm-ui-padding-xxs);--rm-form-row-gap: var(--rm-ui-padding-xxs)}._XS_7ij1y_12{gap:var(--rm-ui-padding-xs);--rm-form-row-gap: var(--rm-ui-padding-xs)}._SM_7ij1y_17{gap:var(--rm-ui-padding-sm);--rm-form-row-gap: var(--rm-ui-padding-sm)}._MD_7ij1y_22{gap:var(--rm-ui-padding-md);--rm-form-row-gap: var(--rm-ui-padding-md)}._LG_7ij1y_27,._XL_7ij1y_32{gap:var(--rm-ui-padding-xl);--rm-form-row-gap: var(--rm-ui-padding-xl)}._XXL_7ij1y_37{gap:var(--rm-ui-padding-xxl);--rm-form-row-gap: var(--rm-ui-padding-xxl)}._XXXL_7ij1y_42{gap:var(--rm-ui-padding-xxxl);--rm-form-row-gap: var(--rm-ui-padding-xxxl)}@media screen and (min-width:768px){._FormRow_7ij1y_1{flex-direction:row}._Child_7ij1y_52[data-children-quantity="1"]{width:100%}._Child_7ij1y_52[data-children-quantity="2"]:not([data-width]){width:50%}._Child_7ij1y_52[data-children-quantity="3"]:not([data-width]){width:calc(100% / 3)}._Child_7ij1y_52[data-children-quantity="4"]:not([data-width]){width:25%}._Child_7ij1y_52[data-width="1"]{width:100%}._Child_7ij1y_52[data-width="1/2"]{width:50%}._Child_7ij1y_52[data-width="1/2"][data-children-quantity="1"]{width:calc((100% / 2) - (var(--rm-form-row-gap) / 2))}._Child_7ij1y_52[data-width="1/3"]{width:calc(100% / 3)}._Child_7ij1y_52[data-width="1/3"][data-children-quantity="1"]{width:calc((100% / 3) - (var(--rm-form-row-gap) / 2))}._Child_7ij1y_52[data-width="2/3"]{width:calc(200% / 3)}._Child_7ij1y_52[data-width="2/3"][data-children-quantity="1"]{width:calc((200% / 3) - (var(--rm-form-row-gap) / 2))}._Child_7ij1y_52[data-width="1/4"]{width:25%}._Child_7ij1y_52[data-width="1/4"][data-children-quantity="1"]{width:calc((100% / 4) - (var(--rm-form-row-gap) / 2))}._Child_7ij1y_52[data-width="2/4"]{width:50%}._Child_7ij1y_52[data-width="2/4"][data-children-quantity="1"]{width:calc((200% / 4) - (var(--rm-form-row-gap) / 2))}._Child_7ij1y_52[data-width="3/4"]{width:75%}._Child_7ij1y_52[data-width="3/4"][data-children-quantity="1"]{width:calc((300% / 4) - (var(--rm-form-row-gap) / 2))}}
|
|
@@ -3,21 +3,6 @@ import { Base, Size } from '../../utils/types';
|
|
|
3
3
|
export type FormRowWidth = '1/2' | '1/3' | '2/3' | '1/4' | '2/4' | '3/4' | '1';
|
|
4
4
|
export interface FormRowProps extends PropsWithChildren<Base> {
|
|
5
5
|
gap: Size;
|
|
6
|
-
/**
|
|
7
|
-
* Force the desktop width of each child individually.
|
|
8
|
-
*
|
|
9
|
-
* Pass an array of fractions, one per valid child, in order. Supported values
|
|
10
|
-
* cover every valid fraction of a four-column grid:
|
|
11
|
-
* `'1/2'`, `'1/3'`, `'2/3'`, `'1/4'`, `'2/4'`, `'3/4'` and `'1'`.
|
|
12
|
-
*
|
|
13
|
-
* If the array length does not match the number of valid children, the array
|
|
14
|
-
* contains an unknown value, or the fractions sum to more than 1, a warning
|
|
15
|
-
* is logged and the prop is ignored — the row falls back to the default
|
|
16
|
-
* behaviour where all children share the row width equally.
|
|
17
|
-
*
|
|
18
|
-
* On mobile (< 768px) the row stacks vertically as usual; this prop only
|
|
19
|
-
* affects the desktop layout.
|
|
20
|
-
*/
|
|
21
6
|
widths?: FormRowWidth[];
|
|
22
7
|
}
|
|
23
8
|
export declare const FormRow: ({ children, gap, widths, ...base }: FormRowProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,18 +2,18 @@ import { jsx as X } from "react/jsx-runtime";
|
|
|
2
2
|
import { Children as d, isValidElement as u } from "react";
|
|
3
3
|
import f from "clsx";
|
|
4
4
|
import { baseProps as _ } from "../../utils/functions/functions.util.js";
|
|
5
|
-
import '../../assets/form-row-
|
|
5
|
+
import '../../assets/form-row-D6RaOZ-h.css';const L = "_FormRow_7ij1y_1", w = "_XXS_7ij1y_7", j = "_XS_7ij1y_12", S = "_SM_7ij1y_17", y = "_MD_7ij1y_22", F = "_LG_7ij1y_27", x = "_XL_7ij1y_32", v = "_XXL_7ij1y_37", b = "_XXXL_7ij1y_42", M = "_Child_7ij1y_52", o = {
|
|
6
6
|
FormRow: L,
|
|
7
7
|
XXS: w,
|
|
8
|
-
XS:
|
|
9
|
-
SM:
|
|
10
|
-
MD:
|
|
11
|
-
LG:
|
|
12
|
-
XL:
|
|
13
|
-
XXL:
|
|
14
|
-
XXXL:
|
|
15
|
-
Child:
|
|
16
|
-
},
|
|
8
|
+
XS: j,
|
|
9
|
+
SM: S,
|
|
10
|
+
MD: y,
|
|
11
|
+
LG: F,
|
|
12
|
+
XL: x,
|
|
13
|
+
XXL: v,
|
|
14
|
+
XXXL: b,
|
|
15
|
+
Child: M
|
|
16
|
+
}, s = {
|
|
17
17
|
1: 12,
|
|
18
18
|
"1/2": 6,
|
|
19
19
|
"1/3": 4,
|
|
@@ -21,21 +21,21 @@ import '../../assets/form-row-Dgz7icFK.css';const L = "_FormRow_ne9gl_1", w = "_
|
|
|
21
21
|
"1/4": 3,
|
|
22
22
|
"2/4": 6,
|
|
23
23
|
"3/4": 9
|
|
24
|
-
},
|
|
25
|
-
if (d.count(
|
|
26
|
-
const l = d.toArray(
|
|
24
|
+
}, R = s[1], T = ({ children: r, gap: t = "sm", widths: e, ...a }) => {
|
|
25
|
+
if (d.count(r) === 0) return null;
|
|
26
|
+
const l = d.toArray(r).filter(u);
|
|
27
27
|
let c = !1;
|
|
28
|
-
if (
|
|
29
|
-
if (
|
|
28
|
+
if (e)
|
|
29
|
+
if (e.length !== l.length)
|
|
30
30
|
console.warn(
|
|
31
|
-
`[FormRow] \`widths\` length (${
|
|
31
|
+
`[FormRow] \`widths\` length (${e.length}) does not match the number of children (${l.length}). Falling back to default equal-width behaviour.`
|
|
32
32
|
);
|
|
33
33
|
else {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
`[FormRow] \`widths\` contains unknown value "${
|
|
37
|
-
) :
|
|
38
|
-
`[FormRow] \`widths\` total (${
|
|
34
|
+
const i = e.find((n) => !(n in s));
|
|
35
|
+
i !== void 0 ? console.warn(
|
|
36
|
+
`[FormRow] \`widths\` contains unknown value "${i}". Supported values are: ${Object.keys(s).join(", ")}. Falling back to default equal-width behaviour.`
|
|
37
|
+
) : e.reduce((m, h) => m + s[h], 0) > R ? console.warn(
|
|
38
|
+
`[FormRow] \`widths\` total (${e.join(" + ")}) exceeds 1. Falling back to default equal-width behaviour.`
|
|
39
39
|
) : c = !0;
|
|
40
40
|
}
|
|
41
41
|
return /* @__PURE__ */ X(
|
|
@@ -43,22 +43,22 @@ import '../../assets/form-row-Dgz7icFK.css';const L = "_FormRow_ne9gl_1", w = "_
|
|
|
43
43
|
{
|
|
44
44
|
"data-testid": _(a, "data-testid", "form-row"),
|
|
45
45
|
className: f(o.FormRow, _(a, "className"), {
|
|
46
|
-
[o.XXS]:
|
|
47
|
-
[o.XS]:
|
|
48
|
-
[o.SM]:
|
|
49
|
-
[o.MD]:
|
|
50
|
-
[o.LG]:
|
|
51
|
-
[o.XL]:
|
|
52
|
-
[o.XXL]:
|
|
53
|
-
[o.XXXL]:
|
|
46
|
+
[o.XXS]: t === "xxs",
|
|
47
|
+
[o.XS]: t === "xs",
|
|
48
|
+
[o.SM]: t === "sm",
|
|
49
|
+
[o.MD]: t === "md",
|
|
50
|
+
[o.LG]: t === "lg",
|
|
51
|
+
[o.XL]: t === "xl",
|
|
52
|
+
[o.XXL]: t === "xxl",
|
|
53
|
+
[o.XXXL]: t === "xxxl"
|
|
54
54
|
}),
|
|
55
|
-
children: l.map((
|
|
55
|
+
children: l.map((i, n) => /* @__PURE__ */ X(
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
58
|
"data-children-quantity": l.length,
|
|
59
|
-
"data-width": c ?
|
|
59
|
+
"data-width": c ? e[n] : void 0,
|
|
60
60
|
className: o.Child,
|
|
61
|
-
children:
|
|
61
|
+
children: i
|
|
62
62
|
},
|
|
63
63
|
n
|
|
64
64
|
))
|
|
@@ -66,5 +66,5 @@ import '../../assets/form-row-Dgz7icFK.css';const L = "_FormRow_ne9gl_1", w = "_
|
|
|
66
66
|
);
|
|
67
67
|
};
|
|
68
68
|
export {
|
|
69
|
-
|
|
69
|
+
T as FormRow
|
|
70
70
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._FormRow_ne9gl_1{display:flex;flex-direction:column;align-items:stretch}._XXS_ne9gl_14{gap:var(--rm-ui-padding-xxs);--rm-form-row-gap: var(--rm-ui-padding-xxs)}._XS_ne9gl_19{gap:var(--rm-ui-padding-xs);--rm-form-row-gap: var(--rm-ui-padding-xs)}._SM_ne9gl_24{gap:var(--rm-ui-padding-sm);--rm-form-row-gap: var(--rm-ui-padding-sm)}._MD_ne9gl_29{gap:var(--rm-ui-padding-md);--rm-form-row-gap: var(--rm-ui-padding-md)}._LG_ne9gl_34,._XL_ne9gl_39{gap:var(--rm-ui-padding-xl);--rm-form-row-gap: var(--rm-ui-padding-xl)}._XXL_ne9gl_44{gap:var(--rm-ui-padding-xxl);--rm-form-row-gap: var(--rm-ui-padding-xxl)}._XXXL_ne9gl_49{gap:var(--rm-ui-padding-xxxl);--rm-form-row-gap: var(--rm-ui-padding-xxxl)}@media screen and (min-width:768px){._FormRow_ne9gl_1{flex-direction:row}._Child_ne9gl_67:not([data-children-quantity="1"]):not([data-width]){flex-grow:1}._Child_ne9gl_67[data-children-quantity="1"]{width:100%}._Child_ne9gl_67[data-children-quantity="2"]:not([data-width]){width:50%}._Child_ne9gl_67[data-children-quantity="3"]:not([data-width]){width:calc(100% / 3)}._Child_ne9gl_67[data-children-quantity="4"]:not([data-width]){width:25%}._Child_ne9gl_67[data-children-quantity="2"]{--rm-form-row-gap-shrink: calc(var(--rm-form-row-gap) / 2)}._Child_ne9gl_67[data-children-quantity="3"]{--rm-form-row-gap-shrink: calc(var(--rm-form-row-gap) * 2 / 3)}._Child_ne9gl_67[data-children-quantity="4"]{--rm-form-row-gap-shrink: calc(var(--rm-form-row-gap) * 3 / 4)}._Child_ne9gl_67[data-width="1"]{width:100%}._Child_ne9gl_67[data-width="1/2"]{width:calc(100% / 2 - var(--rm-form-row-gap-shrink, 0px))}._Child_ne9gl_67[data-width="1/3"]{width:calc(100% / 3 - var(--rm-form-row-gap-shrink, 0px))}._Child_ne9gl_67[data-width="2/3"]{width:calc(200% / 3 - var(--rm-form-row-gap-shrink, 0px))}._Child_ne9gl_67[data-width="1/4"]{width:calc(100% / 4 - var(--rm-form-row-gap-shrink, 0px))}._Child_ne9gl_67[data-width="2/4"]{width:calc(200% / 4 - var(--rm-form-row-gap-shrink, 0px))}._Child_ne9gl_67[data-width="3/4"]{width:calc(300% / 4 - var(--rm-form-row-gap-shrink, 0px))}}
|