@strapi/design-system 1.7.0-alpha.3 → 1.7.0-alpha.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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),N=require("react"),X=require("@strapi/icons"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),N=require("react"),X=require("@strapi/icons"),y=require("styled-components"),i=require("./SelectParts.cjs"),Y=require("../BaseCheckbox/assets/checkmark.cjs"),g=require("../Box/Box.cjs"),J=require("../Field/Field.cjs"),K=require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");const Q=require("../Field/FieldHint.cjs"),U=require("../Field/FieldError.cjs");require("../Field/FieldContext.cjs");require("../Field/FieldAction.cjs");const Z=require("../Flex/Flex.cjs"),ee=require("../hooks/useId.cjs"),te=require("../hooks/useIntersection.cjs"),re=require("../Tag/Tag.cjs"),C=require("../Typography/Typography.cjs"),ne=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function ie(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const a=ie(N),se=ne(y),oe=({children:e,clearLabel:n="Clear",customizeContent:r,disabled:o,error:l,hint:d,id:u,label:p,labelAction:O,onChange:x,onClear:M,onReachEnd:I,placeholder:R,required:b,selectButtonTitle:ae,startIcon:v,size:B="M",value:j,withTags:m,..._})=>{const q=a.useRef(null),[k,T]=a.useState(),[L,P]=a.useState(!1),h=ee.useId(u),E=`${h}-hint`,V=`${h}-error`,z=s=>{x?x(s):T(s)},A=s=>()=>{const f=Array.isArray(j)?j.filter(F=>F!==s):(k??[]).filter(F=>F!==s);x?x(f):T(f)},G=s=>{P(s)},S=a.useRef(null),H=()=>{S.current.focus()},$=`intersection-${h}`,D=s=>{I&&I(s)};te.useIntersection(q,D,{selectorToWatch:`#${$}`,skipWhen:!L});const c=typeof j<"u"?j:k,W=({value:s,textValue:f})=>t.jsx(re.Tag,{tabIndex:-1,disabled:o,icon:t.jsx(X.Cross,{}),onClick:A(s),children:f},s);return t.jsx(J.Field,{hint:d,error:l,id:h,required:b,children:t.jsxs(Z.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsx(K.FieldLabel,{onClick:H,action:O,children:p}),t.jsxs(i.Root,{onOpenChange:G,disabled:o,required:b,onValueChange:z,value:c,..._,multi:!0,children:[t.jsx(i.Trigger,{ref:S,"aria-label":p,"aria-describedby":`${E} ${V}`,id:h,startIcon:v,size:B,hasError:Boolean(l),disabled:o,clearLabel:n,onClear:c?.length?M:void 0,paddingLeft:m&&c?.length?1:3,children:t.jsx(i.Value,{placeholder:R,textColor:c?.length?"neutral800":"neutral600",children:c?.length?m?W:r?r(c):void 0:void 0})}),t.jsx(i.Portal,{children:t.jsx(i.Content,{position:"popper",sideOffset:4,children:t.jsxs(i.Viewport,{ref:q,children:[e,t.jsx(g.Box,{id:$,width:"100%",height:"1px"})]})})})]}),t.jsx(Q.FieldHint,{}),t.jsx(U.FieldError,{})]})})},le=a.forwardRef(({value:e,children:n,startIcon:r,...o},l)=>t.jsxs(i.Item,{ref:l,value:e.toString(),...o,children:[r&&t.jsx(g.Box,{as:"span","aria-hidden":!0,children:r}),t.jsx(i.ItemIndicator,{children:({isSelected:d,isIntermediate:u})=>t.jsx(w,{hasRadius:!0,overflow:"hidden",position:"relative",$indeterminate:u,$selected:d,zIndex:1,height:"18px",width:"18px"})}),t.jsx(C.Typography,{textColor:"neutral800",children:t.jsx(i.ItemText,{children:n})})]})),w=se.default(g.Box)`
|
|
2
2
|
border: 1px solid
|
|
3
3
|
${({theme:e,$selected:n,$indeterminate:r})=>n||r?e.colors.primary600:e.colors.neutral300};
|
|
4
4
|
background-color: ${({theme:e,$selected:n,$indeterminate:r})=>n||r?e.colors.primary600:e.colors.neutral0};
|
|
5
5
|
|
|
6
|
-
${({theme:e,$indeterminate:n})=>n&&
|
|
6
|
+
${({theme:e,$indeterminate:n})=>n&&y.css`
|
|
7
7
|
&::after {
|
|
8
8
|
content: '';
|
|
9
9
|
display: block;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
`}
|
|
20
20
|
|
|
21
|
-
${({$selected:e})=>e&&
|
|
21
|
+
${({$selected:e})=>e&&y.css`
|
|
22
22
|
&::after {
|
|
23
23
|
content: '';
|
|
24
24
|
background: url(${Y}) no-repeat no-repeat center center;
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
position: absolute;
|
|
28
28
|
}
|
|
29
29
|
`}
|
|
30
|
-
`,ce=a.forwardRef(({children:e,label:n,startIcon:r,values:
|
|
30
|
+
`,ce=a.forwardRef(({children:e,label:n,startIcon:r,values:o=[],...l},d)=>t.jsxs(i.Group,{ref:d,children:[t.jsxs(i.Item,{value:o,...l,children:[r&&t.jsx(g.Box,{as:"span","aria-hidden":!0,children:r}),t.jsx(i.ItemIndicator,{children:({isSelected:u,isIntermediate:p})=>t.jsx(w,{hasRadius:!0,overflow:"hidden",position:"relative",$indeterminate:p,$selected:u,zIndex:1,height:"18px",width:"18px"})}),t.jsx(C.Typography,{textColor:"neutral800",children:t.jsx(i.ItemText,{children:n})})]}),e]}));exports.MultiSelect=oe;exports.MultiSelectGroup=ce;exports.MultiSelectOption=le;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
3
|
import { Cross as J } from "@strapi/icons";
|
|
4
4
|
import K, { css as T } from "styled-components";
|
|
5
5
|
import { Item as S, ItemIndicator as F, ItemText as O, Group as N, Root as Q, Trigger as U, Value as Z, Portal as ee, Content as re, Viewport as te } from "./SelectParts.js";
|
|
6
6
|
import ne from "../BaseCheckbox/assets/checkmark.js";
|
|
7
|
-
import { Box as
|
|
7
|
+
import { Box as x } from "../Box/Box.js";
|
|
8
8
|
import { Field as oe } from "../Field/Field.js";
|
|
9
9
|
import { FieldLabel as ie } from "../Field/FieldLabel.js";
|
|
10
10
|
import "../Field/FieldInput.js";
|
|
11
11
|
import { FieldHint as le } from "../Field/FieldHint.js";
|
|
12
|
-
import { FieldError as
|
|
12
|
+
import { FieldError as de } from "../Field/FieldError.js";
|
|
13
13
|
import "../Field/FieldContext.js";
|
|
14
14
|
import "../Field/FieldAction.js";
|
|
15
|
-
import { Flex as
|
|
16
|
-
import { useId as
|
|
15
|
+
import { Flex as ae } from "../Flex/Flex.js";
|
|
16
|
+
import { useId as ce } from "../hooks/useId.js";
|
|
17
17
|
import { useIntersection as se } from "../hooks/useIntersection.js";
|
|
18
18
|
import { Tag as he } from "../Tag/Tag.js";
|
|
19
19
|
import { Typography as M } from "../Typography/Typography.js";
|
|
20
20
|
const Be = ({
|
|
21
21
|
children: r,
|
|
22
|
-
clearLabel:
|
|
23
|
-
customizeContent:
|
|
22
|
+
clearLabel: o = "Clear",
|
|
23
|
+
customizeContent: t,
|
|
24
24
|
disabled: i,
|
|
25
25
|
error: l,
|
|
26
26
|
hint: s,
|
|
@@ -29,48 +29,48 @@ const Be = ({
|
|
|
29
29
|
labelAction: L,
|
|
30
30
|
onChange: f,
|
|
31
31
|
onClear: V,
|
|
32
|
-
onReachEnd:
|
|
33
|
-
placeholder:
|
|
34
|
-
required:
|
|
32
|
+
onReachEnd: $,
|
|
33
|
+
placeholder: E,
|
|
34
|
+
required: b,
|
|
35
35
|
selectButtonTitle: pe,
|
|
36
|
-
startIcon:
|
|
37
|
-
size:
|
|
36
|
+
startIcon: j,
|
|
37
|
+
size: z = "M",
|
|
38
38
|
value: m,
|
|
39
|
-
withTags:
|
|
39
|
+
withTags: k,
|
|
40
40
|
...A
|
|
41
41
|
}) => {
|
|
42
|
-
const
|
|
43
|
-
f ? f(
|
|
44
|
-
}, X = (
|
|
45
|
-
const
|
|
46
|
-
f ? f(
|
|
47
|
-
}, Y = (
|
|
48
|
-
W(
|
|
49
|
-
}, y =
|
|
42
|
+
const w = a.useRef(null), [C, R] = a.useState(), [G, W] = a.useState(!1), p = ce(h), q = `${p}-hint`, H = `${p}-error`, P = (n) => {
|
|
43
|
+
f ? f(n) : R(n);
|
|
44
|
+
}, X = (n) => () => {
|
|
45
|
+
const g = Array.isArray(m) ? m.filter((I) => I !== n) : (C ?? []).filter((I) => I !== n);
|
|
46
|
+
f ? f(g) : R(g);
|
|
47
|
+
}, Y = (n) => {
|
|
48
|
+
W(n);
|
|
49
|
+
}, y = a.useRef(null), _ = () => {
|
|
50
50
|
y.current.focus();
|
|
51
51
|
}, v = `intersection-${p}`;
|
|
52
|
-
se(
|
|
53
|
-
|
|
52
|
+
se(w, (n) => {
|
|
53
|
+
$ && $(n);
|
|
54
54
|
}, {
|
|
55
55
|
selectorToWatch: `#${v}`,
|
|
56
56
|
skipWhen: !G
|
|
57
57
|
});
|
|
58
|
-
const
|
|
59
|
-
value:
|
|
60
|
-
textValue:
|
|
58
|
+
const d = typeof m < "u" ? m : C, D = ({
|
|
59
|
+
value: n,
|
|
60
|
+
textValue: g
|
|
61
61
|
}) => e(he, {
|
|
62
62
|
tabIndex: -1,
|
|
63
63
|
disabled: i,
|
|
64
64
|
icon: e(J, {}),
|
|
65
|
-
onClick: X(
|
|
66
|
-
children:
|
|
67
|
-
},
|
|
65
|
+
onClick: X(n),
|
|
66
|
+
children: g
|
|
67
|
+
}, n);
|
|
68
68
|
return e(oe, {
|
|
69
69
|
hint: s,
|
|
70
70
|
error: l,
|
|
71
71
|
id: p,
|
|
72
|
-
required:
|
|
73
|
-
children:
|
|
72
|
+
required: b,
|
|
73
|
+
children: c(ae, {
|
|
74
74
|
direction: "column",
|
|
75
75
|
alignItems: "stretch",
|
|
76
76
|
gap: 1,
|
|
@@ -78,12 +78,12 @@ const Be = ({
|
|
|
78
78
|
onClick: _,
|
|
79
79
|
action: L,
|
|
80
80
|
children: u
|
|
81
|
-
}),
|
|
81
|
+
}), c(Q, {
|
|
82
82
|
onOpenChange: Y,
|
|
83
83
|
disabled: i,
|
|
84
|
-
required:
|
|
84
|
+
required: b,
|
|
85
85
|
onValueChange: P,
|
|
86
|
-
value:
|
|
86
|
+
value: d,
|
|
87
87
|
...A,
|
|
88
88
|
multi: !0,
|
|
89
89
|
children: [e(U, {
|
|
@@ -91,25 +91,25 @@ const Be = ({
|
|
|
91
91
|
"aria-label": u,
|
|
92
92
|
"aria-describedby": `${q} ${H}`,
|
|
93
93
|
id: p,
|
|
94
|
-
startIcon:
|
|
95
|
-
size:
|
|
94
|
+
startIcon: j,
|
|
95
|
+
size: z,
|
|
96
96
|
hasError: Boolean(l),
|
|
97
97
|
disabled: i,
|
|
98
|
-
clearLabel:
|
|
99
|
-
onClear:
|
|
100
|
-
paddingLeft:
|
|
98
|
+
clearLabel: o,
|
|
99
|
+
onClear: d?.length ? V : void 0,
|
|
100
|
+
paddingLeft: k && d?.length ? 1 : 3,
|
|
101
101
|
children: e(Z, {
|
|
102
|
-
placeholder:
|
|
103
|
-
textColor:
|
|
104
|
-
children:
|
|
102
|
+
placeholder: E,
|
|
103
|
+
textColor: d?.length ? "neutral800" : "neutral600",
|
|
104
|
+
children: d?.length ? k ? D : t ? t(d) : void 0 : void 0
|
|
105
105
|
})
|
|
106
106
|
}), e(ee, {
|
|
107
107
|
children: e(re, {
|
|
108
108
|
position: "popper",
|
|
109
109
|
sideOffset: 4,
|
|
110
|
-
children:
|
|
111
|
-
ref:
|
|
112
|
-
children: [r, e(
|
|
110
|
+
children: c(te, {
|
|
111
|
+
ref: w,
|
|
112
|
+
children: [r, e(x, {
|
|
113
113
|
id: v,
|
|
114
114
|
width: "100%",
|
|
115
115
|
height: "1px"
|
|
@@ -117,22 +117,22 @@ const Be = ({
|
|
|
117
117
|
})
|
|
118
118
|
})
|
|
119
119
|
})]
|
|
120
|
-
}), e(le, {}), e(
|
|
120
|
+
}), e(le, {}), e(de, {})]
|
|
121
121
|
})
|
|
122
122
|
});
|
|
123
|
-
}, Le =
|
|
123
|
+
}, Le = a.forwardRef(({
|
|
124
124
|
value: r,
|
|
125
|
-
children:
|
|
126
|
-
startIcon:
|
|
125
|
+
children: o,
|
|
126
|
+
startIcon: t,
|
|
127
127
|
...i
|
|
128
|
-
}, l) =>
|
|
128
|
+
}, l) => c(S, {
|
|
129
129
|
ref: l,
|
|
130
130
|
value: r.toString(),
|
|
131
131
|
...i,
|
|
132
|
-
children: [
|
|
132
|
+
children: [t && e(x, {
|
|
133
133
|
as: "span",
|
|
134
134
|
"aria-hidden": !0,
|
|
135
|
-
children:
|
|
135
|
+
children: t
|
|
136
136
|
}), e(F, {
|
|
137
137
|
children: ({
|
|
138
138
|
isSelected: s,
|
|
@@ -150,26 +150,26 @@ const Be = ({
|
|
|
150
150
|
}), e(M, {
|
|
151
151
|
textColor: "neutral800",
|
|
152
152
|
children: e(O, {
|
|
153
|
-
children:
|
|
153
|
+
children: o
|
|
154
154
|
})
|
|
155
155
|
})]
|
|
156
|
-
})), B = K(
|
|
156
|
+
})), B = K(x)`
|
|
157
157
|
border: 1px solid
|
|
158
158
|
${({
|
|
159
159
|
theme: r,
|
|
160
|
-
$selected:
|
|
161
|
-
$indeterminate:
|
|
162
|
-
}) =>
|
|
160
|
+
$selected: o,
|
|
161
|
+
$indeterminate: t
|
|
162
|
+
}) => o || t ? r.colors.primary600 : r.colors.neutral300};
|
|
163
163
|
background-color: ${({
|
|
164
164
|
theme: r,
|
|
165
|
-
$selected:
|
|
166
|
-
$indeterminate:
|
|
167
|
-
}) =>
|
|
165
|
+
$selected: o,
|
|
166
|
+
$indeterminate: t
|
|
167
|
+
}) => o || t ? r.colors.primary600 : r.colors.neutral0};
|
|
168
168
|
|
|
169
169
|
${({
|
|
170
170
|
theme: r,
|
|
171
|
-
$indeterminate:
|
|
172
|
-
}) =>
|
|
171
|
+
$indeterminate: o
|
|
172
|
+
}) => o && T`
|
|
173
173
|
&::after {
|
|
174
174
|
content: '';
|
|
175
175
|
display: block;
|
|
@@ -195,21 +195,21 @@ const Be = ({
|
|
|
195
195
|
position: absolute;
|
|
196
196
|
}
|
|
197
197
|
`}
|
|
198
|
-
`, Ve =
|
|
198
|
+
`, Ve = a.forwardRef(({
|
|
199
199
|
children: r,
|
|
200
|
-
label:
|
|
201
|
-
startIcon:
|
|
200
|
+
label: o,
|
|
201
|
+
startIcon: t,
|
|
202
202
|
values: i = [],
|
|
203
203
|
...l
|
|
204
|
-
}, s) =>
|
|
204
|
+
}, s) => c(N, {
|
|
205
205
|
ref: s,
|
|
206
|
-
children: [
|
|
206
|
+
children: [c(S, {
|
|
207
207
|
value: i,
|
|
208
208
|
...l,
|
|
209
|
-
children: [
|
|
209
|
+
children: [t && e(x, {
|
|
210
210
|
as: "span",
|
|
211
211
|
"aria-hidden": !0,
|
|
212
|
-
children:
|
|
212
|
+
children: t
|
|
213
213
|
}), e(F, {
|
|
214
214
|
children: ({
|
|
215
215
|
isSelected: h,
|
|
@@ -227,7 +227,7 @@ const Be = ({
|
|
|
227
227
|
}), e(M, {
|
|
228
228
|
textColor: "neutral800",
|
|
229
229
|
children: e(O, {
|
|
230
|
-
children:
|
|
230
|
+
children: o
|
|
231
231
|
})
|
|
232
232
|
})]
|
|
233
233
|
}), r]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),N=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),N=require("react"),s=require("./SelectParts.cjs"),I=require("../Box/Box.cjs"),V=require("../Field/Field.cjs"),H=require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");const W=require("../Field/FieldHint.cjs"),z=require("../Field/FieldError.cjs");require("../Field/FieldContext.cjs");require("../Field/FieldAction.cjs");const A=require("../Flex/Flex.cjs"),D=require("../hooks/useId.cjs"),G=require("../hooks/useIntersection.cjs"),J=require("../Typography/Typography.cjs");function K(t){if(t&&t.__esModule)return t;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(i,r,l.get?l:{enumerable:!0,get:()=>t[r]})}}return i.default=t,Object.freeze(i)}const d=K(N),Q=({children:t,clearLabel:i="Clear",customizeContent:r,disabled:l,error:u,hint:q,id:y,label:p,labelAction:m,onChange:a,onClear:h,onReachEnd:f,placeholder:O,required:x,selectButtonTitle:X,startIcon:T,size:B="M",value:j,...R})=>{const[C,g]=d.useState(),[_,k]=d.useState(!1),o=D.useId(y),v=`${o}-hint`,P=`${o}-error`,$=n=>{a?a(typeof j=="number"?Number(n):n):g(n)},w=n=>{k(n)},L=n=>{h&&h(n),a||g("")},F=d.useRef(null),M=()=>{F.current.focus()},b=d.useRef(null),S=`intersection-${o}`,E=n=>{f&&f(n)};G.useIntersection(b,E,{selectorToWatch:`#${S}`,skipWhen:!_});const c=(typeof j<"u"?j.toString():C)??"";return e.jsx(V.Field,{hint:q,error:u,id:o,required:x,children:e.jsxs(A.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[e.jsx(H.FieldLabel,{onClick:M,action:m,children:p}),e.jsxs(s.Root,{onOpenChange:w,disabled:l,required:x,onValueChange:$,value:c,...R,children:[e.jsx(s.Trigger,{ref:F,"aria-label":p,"aria-describedby":`${v} ${P}`,id:o,startIcon:T,size:B,hasError:Boolean(u),disabled:l,clearLabel:i,onClear:c&&h?L:void 0,children:e.jsx(s.Value,{placeholder:O,textColor:c?"neutral800":"neutral600",children:c&&r?r(c):void 0})}),e.jsx(s.Portal,{children:e.jsx(s.Content,{position:"popper",sideOffset:4,children:e.jsxs(s.Viewport,{ref:b,children:[t,e.jsx(I.Box,{id:S,width:"100%",height:"1px"})]})})})]}),e.jsx(W.FieldHint,{}),e.jsx(z.FieldError,{})]})})},U=d.forwardRef(({value:t,startIcon:i,children:r,...l},u)=>e.jsxs(s.Item,{ref:u,value:t.toString(),...l,children:[i&&e.jsx(I.Box,{as:"span","aria-hidden":!0,children:i}),e.jsx(J.Typography,{textColor:"neutral800",children:e.jsx(s.ItemText,{children:r})})]}));exports.SingleSelect=Q;exports.SingleSelectOption=U;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { Item as q, ItemText as
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { Item as q, ItemText as H, Root as M, Trigger as P, Value as _, Portal as z, Content as A, Viewport as D } from "./SelectParts.js";
|
|
4
4
|
import { Box as R } from "../Box/Box.js";
|
|
5
5
|
import { Field as G } from "../Field/Field.js";
|
|
6
6
|
import { FieldLabel as J } from "../Field/FieldLabel.js";
|
|
@@ -14,86 +14,86 @@ import { useId as X } from "../hooks/useId.js";
|
|
|
14
14
|
import { useIntersection as Y } from "../hooks/useIntersection.js";
|
|
15
15
|
import { Typography as Z } from "../Typography/Typography.js";
|
|
16
16
|
const Ie = ({
|
|
17
|
-
children:
|
|
18
|
-
clearLabel:
|
|
19
|
-
customizeContent:
|
|
20
|
-
disabled:
|
|
17
|
+
children: s,
|
|
18
|
+
clearLabel: o = "Clear",
|
|
19
|
+
customizeContent: l,
|
|
20
|
+
disabled: d,
|
|
21
21
|
error: c,
|
|
22
|
-
hint:
|
|
23
|
-
id:
|
|
24
|
-
label:
|
|
25
|
-
labelAction:
|
|
22
|
+
hint: C,
|
|
23
|
+
id: O,
|
|
24
|
+
label: m,
|
|
25
|
+
labelAction: B,
|
|
26
26
|
onChange: h,
|
|
27
|
-
onClear:
|
|
28
|
-
onReachEnd:
|
|
29
|
-
placeholder:
|
|
30
|
-
required:
|
|
27
|
+
onClear: p,
|
|
28
|
+
onReachEnd: u,
|
|
29
|
+
placeholder: F,
|
|
30
|
+
required: g,
|
|
31
31
|
selectButtonTitle: ee,
|
|
32
|
-
startIcon:
|
|
33
|
-
size:
|
|
34
|
-
value:
|
|
35
|
-
...
|
|
32
|
+
startIcon: T,
|
|
33
|
+
size: $ = "M",
|
|
34
|
+
value: f,
|
|
35
|
+
...y
|
|
36
36
|
}) => {
|
|
37
|
-
const [
|
|
38
|
-
h ? h(typeof
|
|
37
|
+
const [w, I] = i.useState(), [V, k] = i.useState(!1), t = X(O), v = `${t}-hint`, E = `${t}-error`, L = (r) => {
|
|
38
|
+
h ? h(typeof f == "number" ? Number(r) : r) : I(r);
|
|
39
39
|
}, N = (r) => {
|
|
40
40
|
k(r);
|
|
41
41
|
}, j = (r) => {
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
}, x =
|
|
42
|
+
p && p(r), h || I("");
|
|
43
|
+
}, b = i.useRef(null), W = () => {
|
|
44
|
+
b.current.focus();
|
|
45
|
+
}, x = i.useRef(null), S = `intersection-${t}`;
|
|
46
46
|
Y(x, (r) => {
|
|
47
|
-
|
|
47
|
+
u && u(r);
|
|
48
48
|
}, {
|
|
49
|
-
selectorToWatch: `#${
|
|
49
|
+
selectorToWatch: `#${S}`,
|
|
50
50
|
skipWhen: !V
|
|
51
51
|
});
|
|
52
|
-
const n = (typeof
|
|
52
|
+
const n = (typeof f < "u" ? f.toString() : w) ?? "";
|
|
53
53
|
return e(G, {
|
|
54
|
-
hint:
|
|
54
|
+
hint: C,
|
|
55
55
|
error: c,
|
|
56
56
|
id: t,
|
|
57
|
-
required:
|
|
58
|
-
children:
|
|
57
|
+
required: g,
|
|
58
|
+
children: a(U, {
|
|
59
59
|
direction: "column",
|
|
60
60
|
alignItems: "stretch",
|
|
61
61
|
gap: 1,
|
|
62
62
|
children: [e(J, {
|
|
63
63
|
onClick: W,
|
|
64
|
-
action:
|
|
65
|
-
children:
|
|
66
|
-
}),
|
|
64
|
+
action: B,
|
|
65
|
+
children: m
|
|
66
|
+
}), a(M, {
|
|
67
67
|
onOpenChange: N,
|
|
68
|
-
disabled:
|
|
69
|
-
required:
|
|
68
|
+
disabled: d,
|
|
69
|
+
required: g,
|
|
70
70
|
onValueChange: L,
|
|
71
71
|
value: n,
|
|
72
|
-
...
|
|
73
|
-
children: [e(
|
|
74
|
-
ref:
|
|
75
|
-
"aria-label":
|
|
72
|
+
...y,
|
|
73
|
+
children: [e(P, {
|
|
74
|
+
ref: b,
|
|
75
|
+
"aria-label": m,
|
|
76
76
|
"aria-describedby": `${v} ${E}`,
|
|
77
77
|
id: t,
|
|
78
|
-
startIcon:
|
|
79
|
-
size:
|
|
78
|
+
startIcon: T,
|
|
79
|
+
size: $,
|
|
80
80
|
hasError: Boolean(c),
|
|
81
|
-
disabled:
|
|
82
|
-
clearLabel:
|
|
83
|
-
onClear: n &&
|
|
84
|
-
children: e(
|
|
85
|
-
placeholder:
|
|
81
|
+
disabled: d,
|
|
82
|
+
clearLabel: o,
|
|
83
|
+
onClear: n && p ? j : void 0,
|
|
84
|
+
children: e(_, {
|
|
85
|
+
placeholder: F,
|
|
86
86
|
textColor: n ? "neutral800" : "neutral600",
|
|
87
|
-
children: n ?
|
|
87
|
+
children: n && l ? l(n) : void 0
|
|
88
88
|
})
|
|
89
|
-
}), e(
|
|
89
|
+
}), e(z, {
|
|
90
90
|
children: e(A, {
|
|
91
91
|
position: "popper",
|
|
92
92
|
sideOffset: 4,
|
|
93
|
-
children:
|
|
93
|
+
children: a(D, {
|
|
94
94
|
ref: x,
|
|
95
|
-
children: [
|
|
96
|
-
id:
|
|
95
|
+
children: [s, e(R, {
|
|
96
|
+
id: S,
|
|
97
97
|
width: "100%",
|
|
98
98
|
height: "1px"
|
|
99
99
|
})]
|
|
@@ -103,23 +103,23 @@ const Ie = ({
|
|
|
103
103
|
}), e(K, {}), e(Q, {})]
|
|
104
104
|
})
|
|
105
105
|
});
|
|
106
|
-
}, be =
|
|
107
|
-
value:
|
|
108
|
-
startIcon:
|
|
109
|
-
children:
|
|
110
|
-
...
|
|
111
|
-
}, c) =>
|
|
106
|
+
}, be = i.forwardRef(({
|
|
107
|
+
value: s,
|
|
108
|
+
startIcon: o,
|
|
109
|
+
children: l,
|
|
110
|
+
...d
|
|
111
|
+
}, c) => a(q, {
|
|
112
112
|
ref: c,
|
|
113
|
-
value:
|
|
114
|
-
...
|
|
115
|
-
children: [
|
|
113
|
+
value: s.toString(),
|
|
114
|
+
...d,
|
|
115
|
+
children: [o && e(R, {
|
|
116
116
|
as: "span",
|
|
117
117
|
"aria-hidden": !0,
|
|
118
|
-
children:
|
|
118
|
+
children: o
|
|
119
119
|
}), e(Z, {
|
|
120
120
|
textColor: "neutral800",
|
|
121
|
-
children: e(
|
|
122
|
-
children:
|
|
121
|
+
children: e(H, {
|
|
122
|
+
children: l
|
|
123
123
|
})
|
|
124
124
|
})]
|
|
125
125
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/design-system",
|
|
3
|
-
"version": "1.7.0-alpha.
|
|
3
|
+
"version": "1.7.0-alpha.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"@internationalized/number": "^3.2.0",
|
|
24
24
|
"@radix-ui/react-dropdown-menu": "^2.0.4",
|
|
25
25
|
"@radix-ui/react-use-callback-ref": "^1.0.0",
|
|
26
|
-
"@strapi/ui-primitives": "^1.7.0-alpha.
|
|
26
|
+
"@strapi/ui-primitives": "^1.7.0-alpha.5",
|
|
27
27
|
"@uiw/react-codemirror": "^4.19.7",
|
|
28
28
|
"compute-scroll-into-view": "^1.0.17",
|
|
29
29
|
"prop-types": "^15.7.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@playwright/test": "1.27.1",
|
|
33
|
-
"@strapi/icons": "^1.7.0-alpha.
|
|
33
|
+
"@strapi/icons": "^1.7.0-alpha.5",
|
|
34
34
|
"@types/react-router-dom": "^5.3.3",
|
|
35
35
|
"@types/styled-components": "^5.1.26",
|
|
36
36
|
"axe-playwright": "^1.1.11",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"@types/react": "17.0.2",
|
|
66
66
|
"@types/react-dom": "17.0.2"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "d1e66b3426b71272f8a6ec4249944c32f4b77fd9"
|
|
69
69
|
}
|