meticulous-ui 3.8.3 → 3.8.5
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/cjs/components/Switch/Switch.cjs +25 -25
- package/components/Switch/Switch.js +87 -73
- package/index.d.ts +80 -0
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("react/jsx-runtime"),i=require("react"),y=require("styled-components"),N=require("prop-types"),g=require("../../colors/grey.cjs"),B=require("../../colors/green.cjs"),b=require("../../colors/white.cjs"),E=e=>e&&e.__esModule?e:{default:e},h=E(y),t=E(N),p=1.9,d=.28,c=p+d*2,X=.7,k=d+p,Z=h.default.button`
|
|
2
2
|
position: relative;
|
|
3
3
|
isolation: isolate;
|
|
4
|
-
height: ${
|
|
4
|
+
height: ${c}rem;
|
|
5
5
|
width: ${({$hasLabel:e})=>e?"max-content":"4.8rem"};
|
|
6
6
|
min-width: 4.8rem;
|
|
7
7
|
max-width: 20rem;
|
|
8
|
-
border-radius: ${
|
|
8
|
+
border-radius: ${c/2}rem;
|
|
9
9
|
border: 0.094rem solid rgba(0, 0, 0, 0.08);
|
|
10
10
|
display: flex;
|
|
11
11
|
align-items: center;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
15
15
|
outline: none;
|
|
16
16
|
|
|
17
|
-
padding-left: ${({$checked:e,$hasLabel:r})=>r?e?`${
|
|
18
|
-
padding-right: ${({$checked:e,$hasLabel:r})=>r?e?`${
|
|
17
|
+
padding-left: ${({$checked:e,$hasLabel:r})=>r?e?`${d}rem`:`${k}rem`:"0"};
|
|
18
|
+
padding-right: ${({$checked:e,$hasLabel:r})=>r?e?`${k}rem`:`${d}rem`:"0"};
|
|
19
19
|
|
|
20
20
|
transition:
|
|
21
21
|
background-color 0.3s ease,
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
padding-left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
24
24
|
padding-right 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
25
25
|
|
|
26
|
-
background-color: ${({$checked:e,$onColor:r,$offColor:
|
|
26
|
+
background-color: ${({$checked:e,$onColor:r,$offColor:s,$disabled:u})=>u?g.default.m300:e?r||B.default.m500:s||g.default.m400};
|
|
27
27
|
|
|
28
28
|
&:focus-visible {
|
|
29
|
-
outline: 0.188rem solid ${({$onColor:e})=>e?`${e}88`:`${
|
|
29
|
+
outline: 0.188rem solid ${({$onColor:e})=>e?`${e}88`:`${B.default.m500}88`};
|
|
30
30
|
outline-offset: 0.125rem;
|
|
31
31
|
}
|
|
32
|
-
`,
|
|
32
|
+
`,C=h.default.div`
|
|
33
33
|
position: absolute;
|
|
34
34
|
top: 50%;
|
|
35
35
|
transform: translateY(-50%);
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
41
41
|
z-index: 10;
|
|
42
42
|
|
|
43
|
-
${({$isGlass:e,$checked:r})=>e?
|
|
44
|
-
width: ${
|
|
45
|
-
height: ${
|
|
43
|
+
${({$isGlass:e,$checked:r})=>e?y.css`
|
|
44
|
+
width: ${c*1.55}rem;
|
|
45
|
+
height: ${c*1.9}rem;
|
|
46
46
|
left: -0.75rem;
|
|
47
47
|
transform: translateY(-50%) translateX(${r?"var(--glass-travel, 0rem)":"0"});
|
|
48
48
|
transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
@@ -86,14 +86,14 @@
|
|
|
86
86
|
&::after {
|
|
87
87
|
display: none;
|
|
88
88
|
}
|
|
89
|
-
`:
|
|
90
|
-
width: ${
|
|
91
|
-
height: ${
|
|
92
|
-
left: ${r?`calc(100% - ${
|
|
93
|
-
background: ${
|
|
89
|
+
`:y.css`
|
|
90
|
+
width: ${p}rem;
|
|
91
|
+
height: ${p}rem;
|
|
92
|
+
left: ${r?`calc(100% - ${k}rem)`:`${d}rem`};
|
|
93
|
+
background: ${b.default};
|
|
94
94
|
box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.25);
|
|
95
95
|
`}
|
|
96
|
-
`,
|
|
96
|
+
`,J=h.default.span`
|
|
97
97
|
position: relative;
|
|
98
98
|
z-index: 2;
|
|
99
99
|
font-size: 0.9rem;
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
text-overflow: ellipsis;
|
|
106
106
|
user-select: none;
|
|
107
107
|
pointer-events: none;
|
|
108
|
-
padding: ${({$isGlass:e,$checked:r})=>e?r?"0 1.6rem 0 0.6rem":"0 0.6rem 0 1.6rem":`0 ${
|
|
108
|
+
padding: ${({$isGlass:e,$checked:r})=>e?r?"0 1.6rem 0 0.6rem":"0 0.6rem 0 1.6rem":`0 ${X}rem`};
|
|
109
109
|
color: rgba(255, 255, 255, 0.95);
|
|
110
|
-
`,
|
|
110
|
+
`,Q=h.default.span`
|
|
111
111
|
display: flex;
|
|
112
112
|
align-items: center;
|
|
113
113
|
justify-content: center;
|
|
@@ -116,9 +116,9 @@
|
|
|
116
116
|
stroke-width: 2.5;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
filter: drop-shadow(0 0 0.25rem ${({$color:e})=>e||
|
|
120
|
-
drop-shadow(0 0 0.625rem ${({$color:e})=>e||
|
|
121
|
-
drop-shadow(0 0 1.25rem ${({$color:e})=>e||
|
|
122
|
-
drop-shadow(0 0 2.5rem ${({$color:e})=>e?`${e}99`:`${
|
|
123
|
-
drop-shadow(0 0 3.75rem ${({$color:e})=>e?`${e}4D`:`${
|
|
124
|
-
`,
|
|
119
|
+
filter: drop-shadow(0 0 0.25rem ${({$color:e})=>e||b.default})
|
|
120
|
+
drop-shadow(0 0 0.625rem ${({$color:e})=>e||b.default})
|
|
121
|
+
drop-shadow(0 0 1.25rem ${({$color:e})=>e||b.default})
|
|
122
|
+
drop-shadow(0 0 2.5rem ${({$color:e})=>e?`${e}99`:`${g.default.m100}99`})
|
|
123
|
+
drop-shadow(0 0 3.75rem ${({$color:e})=>e?`${e}4D`:`${g.default.m200}4D`});
|
|
124
|
+
`,H=({checked:e,defaultChecked:r=!1,onChange:s,onIcon:u,offIcon:_,onColor:T,offColor:D,onLabel:z,offLabel:j,label:I,id:P,disabled:f=!1,isGlass:l,...$})=>{const[A,q]=i.useState(r),w=e!==void 0,o=w?e:A,v=i.useRef(null);i.useRef(0);const[R,F]=i.useState(null);i.useEffect(()=>{if(!l||!v.current)return;const n=v.current,a=()=>{const Y=parseFloat(getComputedStyle(document.documentElement).fontSize),G=n.getBoundingClientRect().width/Y-(c*1.2+.1-.75);F(`${G.toFixed(4)}rem`)};a();const M=new ResizeObserver(a);return M.observe(n),()=>M.disconnect()},[l]);const O=n=>{if(n.preventDefault(),f)return;const a=!o;w||q(a),s==null||s(a)},U=n=>{if(n.key==="Enter"||n.key===" "){if(n.repeat){n.preventDefault();return}if(n.preventDefault(),!f){const a=!o;w||q(a),s==null||s(a)}}},K=u!=null||_!=null,S=z!=null||j!=null,L=o?u:_,x=o?z:j;return m.jsxs(Z,{...$,ref:v,id:P,type:"button",role:"switch","aria-checked":o,"aria-label":I||x||void 0,"aria-disabled":f||void 0,onClick:O,onKeyDown:U,$checked:o,$disabled:f,$onColor:T,$offColor:D,$hasLabel:S,style:R!=null?{...$.style,"--glass-travel":R}:$.style,children:[m.jsx(C,{"aria-hidden":"true",$checked:o,$isGlass:l,children:l?m.jsx(Q,{$color:o?T:D,children:L}):K&&L}),S&&x&&m.jsx(J,{$isGlass:l,$checked:o,"aria-live":"polite","aria-atomic":"true",children:x})]})};H.propTypes={checked:t.default.bool,defaultChecked:t.default.bool,onChange:t.default.func,onIcon:t.default.node,offIcon:t.default.node,onColor:t.default.string,offColor:t.default.string,onLabel:t.default.string,offLabel:t.default.string,label:t.default.string,id:t.default.string,disabled:t.default.bool,isGlass:t.default.bool};exports.default=H;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as R, useRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as N, jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useRef as _, useEffect as X } from "react";
|
|
3
|
+
import p, { css as j } from "styled-components";
|
|
4
4
|
import r from "prop-types";
|
|
5
5
|
import b from "../../colors/grey.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
6
|
+
import A from "../../colors/green.js";
|
|
7
|
+
import u from "../../colors/white.js";
|
|
8
|
+
const f = 1.9, l = 0.28, c = f + l * 2, Z = 0.7, k = l + f, q = p.button`
|
|
9
9
|
position: relative;
|
|
10
10
|
isolation: isolate;
|
|
11
|
-
height: ${
|
|
11
|
+
height: ${c}rem;
|
|
12
12
|
width: ${({ $hasLabel: e }) => e ? "max-content" : "4.8rem"};
|
|
13
13
|
min-width: 4.8rem;
|
|
14
14
|
max-width: 20rem;
|
|
15
|
-
border-radius: ${
|
|
15
|
+
border-radius: ${c / 2}rem;
|
|
16
16
|
border: 0.094rem solid rgba(0, 0, 0, 0.08);
|
|
17
17
|
display: flex;
|
|
18
18
|
align-items: center;
|
|
@@ -21,8 +21,8 @@ const u = 1.9, a = 0.28, l = u + a * 2, N = 0.7, v = a + u, X = g.button`
|
|
|
21
21
|
cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
|
|
22
22
|
outline: none;
|
|
23
23
|
|
|
24
|
-
padding-left: ${({ $checked: e, $hasLabel: t }) => t ? e ? `${
|
|
25
|
-
padding-right: ${({ $checked: e, $hasLabel: t }) => t ? e ? `${
|
|
24
|
+
padding-left: ${({ $checked: e, $hasLabel: t }) => t ? e ? `${l}rem` : `${k}rem` : "0"};
|
|
25
|
+
padding-right: ${({ $checked: e, $hasLabel: t }) => t ? e ? `${k}rem` : `${l}rem` : "0"};
|
|
26
26
|
|
|
27
27
|
transition:
|
|
28
28
|
background-color 0.3s ease,
|
|
@@ -30,13 +30,13 @@ const u = 1.9, a = 0.28, l = u + a * 2, N = 0.7, v = a + u, X = g.button`
|
|
|
30
30
|
padding-left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
31
31
|
padding-right 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
32
32
|
|
|
33
|
-
background-color: ${({ $checked: e, $onColor: t, $offColor:
|
|
33
|
+
background-color: ${({ $checked: e, $onColor: t, $offColor: i, $disabled: d }) => d ? b.m300 : e ? t || A.m500 : i || b.m400};
|
|
34
34
|
|
|
35
35
|
&:focus-visible {
|
|
36
|
-
outline: 0.188rem solid ${({ $onColor: e }) => e ? `${e}88` : `${
|
|
36
|
+
outline: 0.188rem solid ${({ $onColor: e }) => e ? `${e}88` : `${A.m500}88`};
|
|
37
37
|
outline-offset: 0.125rem;
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
39
|
+
`, C = p.div`
|
|
40
40
|
position: absolute;
|
|
41
41
|
top: 50%;
|
|
42
42
|
transform: translateY(-50%);
|
|
@@ -47,9 +47,9 @@ const u = 1.9, a = 0.28, l = u + a * 2, N = 0.7, v = a + u, X = g.button`
|
|
|
47
47
|
transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
48
48
|
z-index: 10;
|
|
49
49
|
|
|
50
|
-
${({ $isGlass: e, $checked: t }) => e ?
|
|
51
|
-
width: ${
|
|
52
|
-
height: ${
|
|
50
|
+
${({ $isGlass: e, $checked: t }) => e ? j`
|
|
51
|
+
width: ${c * 1.55}rem;
|
|
52
|
+
height: ${c * 1.9}rem;
|
|
53
53
|
left: -0.75rem;
|
|
54
54
|
transform: translateY(-50%) translateX(${t ? "var(--glass-travel, 0rem)" : "0"});
|
|
55
55
|
transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
@@ -93,14 +93,14 @@ const u = 1.9, a = 0.28, l = u + a * 2, N = 0.7, v = a + u, X = g.button`
|
|
|
93
93
|
&::after {
|
|
94
94
|
display: none;
|
|
95
95
|
}
|
|
96
|
-
` :
|
|
97
|
-
width: ${
|
|
98
|
-
height: ${
|
|
99
|
-
left: ${t ? `calc(100% - ${
|
|
100
|
-
background: ${
|
|
96
|
+
` : j`
|
|
97
|
+
width: ${f}rem;
|
|
98
|
+
height: ${f}rem;
|
|
99
|
+
left: ${t ? `calc(100% - ${k}rem)` : `${l}rem`};
|
|
100
|
+
background: ${u};
|
|
101
101
|
box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.25);
|
|
102
102
|
`}
|
|
103
|
-
`,
|
|
103
|
+
`, J = p.span`
|
|
104
104
|
position: relative;
|
|
105
105
|
z-index: 2;
|
|
106
106
|
font-size: 0.9rem;
|
|
@@ -112,9 +112,9 @@ const u = 1.9, a = 0.28, l = u + a * 2, N = 0.7, v = a + u, X = g.button`
|
|
|
112
112
|
text-overflow: ellipsis;
|
|
113
113
|
user-select: none;
|
|
114
114
|
pointer-events: none;
|
|
115
|
-
padding: ${({ $isGlass: e, $checked: t }) => e ? t ? "0 1.6rem 0 0.6rem" : "0 0.6rem 0 1.6rem" : `0 ${
|
|
115
|
+
padding: ${({ $isGlass: e, $checked: t }) => e ? t ? "0 1.6rem 0 0.6rem" : "0 0.6rem 0 1.6rem" : `0 ${Z}rem`};
|
|
116
116
|
color: rgba(255, 255, 255, 0.95);
|
|
117
|
-
`,
|
|
117
|
+
`, Q = p.span`
|
|
118
118
|
display: flex;
|
|
119
119
|
align-items: center;
|
|
120
120
|
justify-content: center;
|
|
@@ -123,69 +123,83 @@ const u = 1.9, a = 0.28, l = u + a * 2, N = 0.7, v = a + u, X = g.button`
|
|
|
123
123
|
stroke-width: 2.5;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
filter: drop-shadow(0 0 0.25rem ${({ $color: e }) => e ||
|
|
127
|
-
drop-shadow(0 0 0.625rem ${({ $color: e }) => e ||
|
|
128
|
-
drop-shadow(0 0 1.25rem ${({ $color: e }) => e ||
|
|
126
|
+
filter: drop-shadow(0 0 0.25rem ${({ $color: e }) => e || u})
|
|
127
|
+
drop-shadow(0 0 0.625rem ${({ $color: e }) => e || u})
|
|
128
|
+
drop-shadow(0 0 1.25rem ${({ $color: e }) => e || u})
|
|
129
129
|
drop-shadow(0 0 2.5rem ${({ $color: e }) => e ? `${e}99` : `${b.m100}99`})
|
|
130
130
|
drop-shadow(0 0 3.75rem ${({ $color: e }) => e ? `${e}4D` : `${b.m200}4D`});
|
|
131
|
-
`,
|
|
131
|
+
`, V = ({
|
|
132
132
|
checked: e,
|
|
133
133
|
defaultChecked: t = !1,
|
|
134
|
-
onChange:
|
|
135
|
-
onIcon:
|
|
134
|
+
onChange: i,
|
|
135
|
+
onIcon: d,
|
|
136
136
|
offIcon: x,
|
|
137
|
-
onColor:
|
|
138
|
-
offColor:
|
|
139
|
-
onLabel:
|
|
140
|
-
offLabel:
|
|
141
|
-
label:
|
|
142
|
-
id:
|
|
143
|
-
disabled:
|
|
144
|
-
isGlass:
|
|
145
|
-
...
|
|
137
|
+
onColor: y,
|
|
138
|
+
offColor: T,
|
|
139
|
+
onLabel: z,
|
|
140
|
+
offLabel: D,
|
|
141
|
+
label: S,
|
|
142
|
+
id: F,
|
|
143
|
+
disabled: m = !1,
|
|
144
|
+
isGlass: a,
|
|
145
|
+
...g
|
|
146
146
|
}) => {
|
|
147
|
-
const [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
const [M, L] = R(t), h = e !== void 0, n = h ? e : M, $ = _(null);
|
|
148
|
+
_(0);
|
|
149
|
+
const [B, P] = R(null);
|
|
150
|
+
X(() => {
|
|
151
|
+
if (!a || !$.current) return;
|
|
152
|
+
const o = $.current, s = () => {
|
|
153
|
+
const Y = parseFloat(getComputedStyle(document.documentElement).fontSize), G = o.getBoundingClientRect().width / Y - (c * 1.2 + 0.1 - 0.75);
|
|
154
|
+
P(`${G.toFixed(4)}rem`);
|
|
153
155
|
};
|
|
154
|
-
|
|
155
|
-
const I = new ResizeObserver(
|
|
156
|
-
return I.observe(
|
|
157
|
-
}, [
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
s();
|
|
157
|
+
const I = new ResizeObserver(s);
|
|
158
|
+
return I.observe(o), () => I.disconnect();
|
|
159
|
+
}, [a]);
|
|
160
|
+
const U = (o) => {
|
|
161
|
+
if (o.preventDefault(), m) return;
|
|
162
|
+
const s = !n;
|
|
163
|
+
h || L(s), i == null || i(s);
|
|
164
|
+
}, K = (o) => {
|
|
165
|
+
if (o.key === "Enter" || o.key === " ") {
|
|
166
|
+
if (o.repeat) {
|
|
167
|
+
o.preventDefault();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (o.preventDefault(), !m) {
|
|
171
|
+
const s = !n;
|
|
172
|
+
h || L(s), i == null || i(s);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}, O = d != null || x != null, E = z != null || D != null, H = n ? d : x, w = n ? z : D;
|
|
176
|
+
return /* @__PURE__ */ N(
|
|
177
|
+
q,
|
|
165
178
|
{
|
|
166
|
-
...
|
|
167
|
-
ref:
|
|
168
|
-
id:
|
|
179
|
+
...g,
|
|
180
|
+
ref: $,
|
|
181
|
+
id: F,
|
|
169
182
|
type: "button",
|
|
170
183
|
role: "switch",
|
|
171
|
-
"aria-checked":
|
|
172
|
-
"aria-label":
|
|
173
|
-
"aria-disabled":
|
|
174
|
-
onClick:
|
|
175
|
-
|
|
176
|
-
$
|
|
177
|
-
$
|
|
178
|
-
$
|
|
179
|
-
$
|
|
180
|
-
|
|
184
|
+
"aria-checked": n,
|
|
185
|
+
"aria-label": S || w || void 0,
|
|
186
|
+
"aria-disabled": m || void 0,
|
|
187
|
+
onClick: U,
|
|
188
|
+
onKeyDown: K,
|
|
189
|
+
$checked: n,
|
|
190
|
+
$disabled: m,
|
|
191
|
+
$onColor: y,
|
|
192
|
+
$offColor: T,
|
|
193
|
+
$hasLabel: E,
|
|
194
|
+
style: B != null ? { ...g.style, "--glass-travel": B } : g.style,
|
|
181
195
|
children: [
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
|
|
196
|
+
/* @__PURE__ */ v(C, { "aria-hidden": "true", $checked: n, $isGlass: a, children: a ? /* @__PURE__ */ v(Q, { $color: n ? y : T, children: H }) : O && H }),
|
|
197
|
+
E && w && /* @__PURE__ */ v(J, { $isGlass: a, $checked: n, "aria-live": "polite", "aria-atomic": "true", children: w })
|
|
184
198
|
]
|
|
185
199
|
}
|
|
186
200
|
);
|
|
187
201
|
};
|
|
188
|
-
|
|
202
|
+
V.propTypes = {
|
|
189
203
|
checked: r.bool,
|
|
190
204
|
defaultChecked: r.bool,
|
|
191
205
|
onChange: r.func,
|
|
@@ -201,5 +215,5 @@ Q.propTypes = {
|
|
|
201
215
|
isGlass: r.bool
|
|
202
216
|
};
|
|
203
217
|
export {
|
|
204
|
-
|
|
218
|
+
V as default
|
|
205
219
|
};
|
package/index.d.ts
CHANGED
|
@@ -539,6 +539,86 @@ export interface SwitchProps {
|
|
|
539
539
|
|
|
540
540
|
export declare const Switch: React.FC<SwitchProps>;
|
|
541
541
|
|
|
542
|
+
// ---------------------------------------------------------------------------
|
|
543
|
+
// Grid
|
|
544
|
+
// ---------------------------------------------------------------------------
|
|
545
|
+
|
|
546
|
+
type GridAlignItems = 'start' | 'end' | 'center' | 'stretch' | 'baseline';
|
|
547
|
+
type GridJustifyItems = 'start' | 'end' | 'center' | 'stretch';
|
|
548
|
+
type GridAlignContent =
|
|
549
|
+
| 'start'
|
|
550
|
+
| 'end'
|
|
551
|
+
| 'center'
|
|
552
|
+
| 'stretch'
|
|
553
|
+
| 'space-between'
|
|
554
|
+
| 'space-around'
|
|
555
|
+
| 'space-evenly';
|
|
556
|
+
type GridJustifyContent =
|
|
557
|
+
| 'start'
|
|
558
|
+
| 'end'
|
|
559
|
+
| 'center'
|
|
560
|
+
| 'stretch'
|
|
561
|
+
| 'space-between'
|
|
562
|
+
| 'space-around'
|
|
563
|
+
| 'space-evenly';
|
|
564
|
+
type GridAutoFlow = 'row' | 'column' | 'dense' | 'row dense' | 'column dense';
|
|
565
|
+
|
|
566
|
+
export interface GridProps extends React.HTMLAttributes<HTMLElement> {
|
|
567
|
+
as?: React.ElementType;
|
|
568
|
+
/** Number of equal columns or a CSS grid-template-columns value */
|
|
569
|
+
columns?: number | string;
|
|
570
|
+
/** Number of equal rows or a CSS grid-template-rows value */
|
|
571
|
+
rows?: number | string;
|
|
572
|
+
/** Template areas — each string is one row, e.g. ['header header', 'sidebar main'] */
|
|
573
|
+
areas?: string[];
|
|
574
|
+
/** Gap between all cells */
|
|
575
|
+
gap?: string;
|
|
576
|
+
/** Column-only gap */
|
|
577
|
+
columnGap?: string;
|
|
578
|
+
/** Row-only gap */
|
|
579
|
+
rowGap?: string;
|
|
580
|
+
/** Enables responsive auto-fit columns: repeat(auto-fit, minmax(value, 1fr)) */
|
|
581
|
+
minChildWidth?: string;
|
|
582
|
+
autoFlow?: GridAutoFlow;
|
|
583
|
+
autoColumns?: string;
|
|
584
|
+
autoRows?: string;
|
|
585
|
+
alignItems?: GridAlignItems;
|
|
586
|
+
justifyItems?: GridJustifyItems;
|
|
587
|
+
alignContent?: GridAlignContent;
|
|
588
|
+
justifyContent?: GridJustifyContent;
|
|
589
|
+
/** Render as inline-grid instead of grid */
|
|
590
|
+
inline?: boolean;
|
|
591
|
+
children?: React.ReactNode;
|
|
592
|
+
'aria-label'?: string;
|
|
593
|
+
'aria-labelledby'?: string;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
export interface GridItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
597
|
+
as?: React.ElementType;
|
|
598
|
+
/** grid-column shorthand, e.g. '1 / 3' */
|
|
599
|
+
column?: string;
|
|
600
|
+
columnStart?: number | string;
|
|
601
|
+
columnEnd?: number | string;
|
|
602
|
+
/** Shortcut for span N columns */
|
|
603
|
+
columnSpan?: number;
|
|
604
|
+
/** grid-row shorthand, e.g. '1 / 3' */
|
|
605
|
+
row?: string;
|
|
606
|
+
rowStart?: number | string;
|
|
607
|
+
rowEnd?: number | string;
|
|
608
|
+
/** Shortcut for span N rows */
|
|
609
|
+
rowSpan?: number;
|
|
610
|
+
/** Named grid-area defined on the parent Grid */
|
|
611
|
+
area?: string;
|
|
612
|
+
alignSelf?: 'auto' | GridAlignItems;
|
|
613
|
+
justifySelf?: 'auto' | GridJustifyItems;
|
|
614
|
+
/** place-self shorthand */
|
|
615
|
+
placeSelf?: string;
|
|
616
|
+
children?: React.ReactNode;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export declare const Grid: React.FC<GridProps>;
|
|
620
|
+
export declare const GridItem: React.FC<GridItemProps>;
|
|
621
|
+
|
|
542
622
|
// ---------------------------------------------------------------------------
|
|
543
623
|
// Hooks
|
|
544
624
|
// ---------------------------------------------------------------------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meticulous-ui",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.5",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
|
|
6
6
|
"types": "./index.d.ts",
|