wimui 0.65.2 → 0.67.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/ai.cjs +1 -1
- package/dist/ai.js +3 -3
- package/dist/components/_internal/ChoiceLabel.cjs +2 -0
- package/dist/components/_internal/ChoiceLabel.d.ts +31 -0
- package/dist/components/_internal/ChoiceLabel.js +22 -0
- package/dist/components/_internal/choice-label.module.cjs +2 -0
- package/dist/components/_internal/choice-label.module.js +11 -0
- package/dist/components/_internal/rovingIndex.cjs +2 -0
- package/dist/components/_internal/rovingIndex.d.ts +38 -0
- package/dist/components/_internal/rovingIndex.js +16 -0
- package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
- package/dist/components/ai/ChatUI/ChatUI.d.ts +83 -1
- package/dist/components/ai/ChatUI/ChatUI.js +184 -81
- package/dist/components/ai/ChatUI/chat-ui.module.cjs +1 -1
- package/dist/components/ai/ChatUI/chat-ui.module.js +46 -26
- package/dist/components/data-display/Card/Card.cjs +1 -1
- package/dist/components/data-display/Card/Card.d.ts +21 -0
- package/dist/components/data-display/Card/Card.js +7 -3
- package/dist/components/data-display/Card/card.module.cjs +1 -1
- package/dist/components/data-display/Card/card.module.js +17 -16
- package/dist/components/form/CheckboxGroup/CheckboxGroup.cjs +1 -1
- package/dist/components/form/CheckboxGroup/CheckboxGroup.d.ts +9 -0
- package/dist/components/form/CheckboxGroup/CheckboxGroup.js +42 -30
- package/dist/components/form/CheckboxGroup/checkbox-group.module.cjs +1 -1
- package/dist/components/form/CheckboxGroup/checkbox-group.module.js +4 -3
- package/dist/components/form/RadioGroup/RadioGroup.cjs +1 -1
- package/dist/components/form/RadioGroup/RadioGroup.d.ts +9 -0
- package/dist/components/form/RadioGroup/RadioGroup.js +46 -34
- package/dist/components/form/RadioGroup/radio-group.module.cjs +1 -1
- package/dist/components/form/RadioGroup/radio-group.module.js +4 -3
- package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.js +56 -68
- package/dist/components/form/ToggleGroup/ToggleGroup.cjs +1 -1
- package/dist/components/form/ToggleGroup/ToggleGroup.js +80 -88
- package/dist/components/layout/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/layout/Toolbar/Toolbar.js +52 -51
- package/dist/components/navigation/Stepper/Stepper.cjs +1 -1
- package/dist/components/navigation/Stepper/Stepper.js +51 -53
- package/dist/components/navigation/TabNavigation/TabNavigation.cjs +1 -1
- package/dist/components/navigation/TabNavigation/TabNavigation.js +47 -49
- package/dist/components/navigation/Tabs/Tabs.cjs +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +80 -73
- package/dist/data-display.cjs +1 -1
- package/dist/data-display.js +40 -40
- package/dist/i18n/generated/common.cjs +1 -1
- package/dist/i18n/generated/common.d.ts +1 -1
- package/dist/i18n/generated/common.js +9 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +174 -174
- package/dist/llms-full.txt +9 -1
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +3 -1
- package/dist/locales/ja/common.json +3 -1
- package/dist/locales/pt/common.json +3 -1
- package/dist/styles.css +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_container_1pjll_49`,t=`_messageList_1pjll_65`,n=`_message_1pjll_65`,r=`_left_1pjll_97`,i=`_right_1pjll_102`,a=`_contentWrapper_1pjll_107`,o=`_sent_1pjll_110`,s=`_received_1pjll_113`,c=`_messageAvatar_1pjll_116`,l=`_sender_1pjll_125`,u=`_bubble_1pjll_130`,d=`_typing_1pjll_141`,f=`_typingDot_1pjll_148`,p=`_actions_1pjll_172`,m=`_hoverOnly_1pjll_179`,h=`_hasAvatar_1pjll_197`,g=`_timestamp_1pjll_237`,_=`_toolCall_1pjll_244`,v=`_toolHeader_1pjll_250`,y=`_toolChevron_1pjll_289`,b=`_expanded_1pjll_294`,x=`_toolName_1pjll_297`,S=`_toolSummary_1pjll_307`,C=`_toolStatus_1pjll_314`,w=`_done_1pjll_322`,T=`_error_1pjll_325`,E=`_toolSpinner_1pjll_328`,D=`_toolBody_1pjll_346`,O=`_toolSection_1pjll_356`,k=`_toolCode_1pjll_363`,A=`_toolLabel_1pjll_384`,j=`_system_1pjll_390`,M=`_warning_1pjll_402`,N=`_danger_1pjll_405`,P=`_systemText_1pjll_408`,F=`_systemAction_1pjll_413`,I=`_inputArea_1pjll_416`,L=`_fieldContainer_1pjll_429`,R=`_field_1pjll_429`,z=`_sendButton_1pjll_478`,B=`_attachButton_1pjll_505`,V=`_avatar_1pjll_527`,H=`_sm_1pjll_540`,U=`_md_1pjll_545`,W=`_lg_1pjll_550`,G=`_s1_1pjll_558`,K=`_s3_1pjll_562`,q=`_s5_1pjll_566`,J=`_s7_1pjll_570`,Y=`_s10_1pjll_574`,X=`_s12_1pjll_578`,Z=`_s14_1pjll_582`,Q=`_s16_1pjll_586`,$=`_s18_1pjll_590`,ee=`_s20_1pjll_594`,te=`_s22_1pjll_598`,ne=`_s24_1pjll_602`,re=`_image_1pjll_606`,ie=`_fallback_1pjll_611`,ae={container:e,messageList:t,message:n,left:r,right:i,contentWrapper:a,sent:o,received:s,messageAvatar:c,sender:l,bubble:u,typing:d,typingDot:f,"chat-typing":`_chat-typing_1pjll_1`,actions:p,hoverOnly:m,hasAvatar:h,timestamp:g,toolCall:_,toolHeader:v,toolChevron:y,expanded:b,toolName:x,toolSummary:S,toolStatus:C,done:w,error:T,toolSpinner:E,"chat-tool-spin":`_chat-tool-spin_1pjll_1`,toolBody:D,toolSection:O,toolCode:k,toolLabel:A,system:j,warning:M,danger:N,systemText:P,systemAction:F,inputArea:I,fieldContainer:L,field:R,sendButton:z,attachButton:B,avatar:V,sm:H,md:U,lg:W,s1:G,s3:K,s5:q,s7:J,s10:Y,s12:X,s14:Z,s16:Q,s18:$,s20:ee,s22:te,s24:ne,image:re,fallback:ie};exports.actions=p,exports.attachButton=B,exports.avatar=V,exports.bubble=u,exports.container=e,exports.contentWrapper=a,exports.danger=N,exports.default=ae,exports.done=w,exports.error=T,exports.expanded=b,exports.fallback=ie,exports.field=R,exports.fieldContainer=L,exports.hasAvatar=h,exports.hoverOnly=m,exports.image=re,exports.inputArea=I,exports.left=r,exports.lg=W,exports.md=U,exports.message=n,exports.messageAvatar=c,exports.messageList=t,exports.received=s,exports.right=i,exports.s1=G,exports.s10=Y,exports.s12=X,exports.s14=Z,exports.s16=Q,exports.s18=$,exports.s20=ee,exports.s22=te,exports.s24=ne,exports.s3=K,exports.s5=q,exports.s7=J,exports.sendButton=z,exports.sender=l,exports.sent=o,exports.sm=H,exports.system=j,exports.systemAction=F,exports.systemText=P,exports.timestamp=g,exports.toolBody=D,exports.toolCall=_,exports.toolChevron=y,exports.toolCode=k,exports.toolHeader=v,exports.toolLabel=A,exports.toolName=x,exports.toolSection=O,exports.toolSpinner=E,exports.toolStatus=C,exports.toolSummary=S,exports.typing=d,exports.typingDot=f,exports.warning=M;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/ai/ChatUI/chat-ui.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_container_1pjll_49", t = "_messageList_1pjll_65", n = "_message_1pjll_65", r = "_left_1pjll_97", i = "_right_1pjll_102", a = "_contentWrapper_1pjll_107", o = "_sent_1pjll_110", s = "_received_1pjll_113", c = "_messageAvatar_1pjll_116", l = "_sender_1pjll_125", u = "_bubble_1pjll_130", d = "_typing_1pjll_141", f = "_typingDot_1pjll_148", p = "_actions_1pjll_172", m = "_hoverOnly_1pjll_179", h = "_hasAvatar_1pjll_197", g = "_timestamp_1pjll_237", _ = "_toolCall_1pjll_244", v = "_toolHeader_1pjll_250", y = "_toolChevron_1pjll_289", b = "_expanded_1pjll_294", x = "_toolName_1pjll_297", S = "_toolSummary_1pjll_307", C = "_toolStatus_1pjll_314", w = "_done_1pjll_322", T = "_error_1pjll_325", E = "_toolSpinner_1pjll_328", D = "_toolBody_1pjll_346", O = "_toolSection_1pjll_356", k = "_toolCode_1pjll_363", A = "_toolLabel_1pjll_384", j = "_system_1pjll_390", M = "_warning_1pjll_402", N = "_danger_1pjll_405", P = "_systemText_1pjll_408", F = "_systemAction_1pjll_413", I = "_inputArea_1pjll_416", L = "_fieldContainer_1pjll_429", R = "_field_1pjll_429", z = "_sendButton_1pjll_478", B = "_attachButton_1pjll_505", V = "_avatar_1pjll_527", H = "_sm_1pjll_540", U = "_md_1pjll_545", W = "_lg_1pjll_550", G = "_s1_1pjll_558", K = "_s3_1pjll_562", q = "_s5_1pjll_566", J = "_s7_1pjll_570", Y = "_s10_1pjll_574", X = "_s12_1pjll_578", Z = "_s14_1pjll_582", Q = "_s16_1pjll_586", $ = "_s18_1pjll_590", ee = "_s20_1pjll_594", te = "_s22_1pjll_598", ne = "_s24_1pjll_602", re = "_image_1pjll_606", ie = "_fallback_1pjll_611", ae = {
|
|
4
4
|
container: e,
|
|
5
5
|
messageList: t,
|
|
6
6
|
message: n,
|
|
@@ -14,34 +14,54 @@ var e = "_container_774t4_23", t = "_messageList_774t4_39", n = "_message_774t4_
|
|
|
14
14
|
bubble: u,
|
|
15
15
|
typing: d,
|
|
16
16
|
typingDot: f,
|
|
17
|
-
"chat-typing": "_chat-
|
|
17
|
+
"chat-typing": "_chat-typing_1pjll_1",
|
|
18
18
|
actions: p,
|
|
19
19
|
hoverOnly: m,
|
|
20
20
|
hasAvatar: h,
|
|
21
21
|
timestamp: g,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
22
|
+
toolCall: _,
|
|
23
|
+
toolHeader: v,
|
|
24
|
+
toolChevron: y,
|
|
25
|
+
expanded: b,
|
|
26
|
+
toolName: x,
|
|
27
|
+
toolSummary: S,
|
|
28
|
+
toolStatus: C,
|
|
29
|
+
done: w,
|
|
30
|
+
error: T,
|
|
31
|
+
toolSpinner: E,
|
|
32
|
+
"chat-tool-spin": "_chat-tool-spin_1pjll_1",
|
|
33
|
+
toolBody: D,
|
|
34
|
+
toolSection: O,
|
|
35
|
+
toolCode: k,
|
|
36
|
+
toolLabel: A,
|
|
37
|
+
system: j,
|
|
38
|
+
warning: M,
|
|
39
|
+
danger: N,
|
|
40
|
+
systemText: P,
|
|
41
|
+
systemAction: F,
|
|
42
|
+
inputArea: I,
|
|
43
|
+
fieldContainer: L,
|
|
44
|
+
field: R,
|
|
45
|
+
sendButton: z,
|
|
46
|
+
attachButton: B,
|
|
47
|
+
avatar: V,
|
|
48
|
+
sm: H,
|
|
49
|
+
md: U,
|
|
50
|
+
lg: W,
|
|
51
|
+
s1: G,
|
|
52
|
+
s3: K,
|
|
53
|
+
s5: q,
|
|
54
|
+
s7: J,
|
|
55
|
+
s10: Y,
|
|
56
|
+
s12: X,
|
|
57
|
+
s14: Z,
|
|
58
|
+
s16: Q,
|
|
59
|
+
s18: $,
|
|
60
|
+
s20: ee,
|
|
61
|
+
s22: te,
|
|
62
|
+
s24: ne,
|
|
63
|
+
image: re,
|
|
64
|
+
fallback: ie
|
|
45
65
|
};
|
|
46
66
|
//#endregion
|
|
47
|
-
export { p as actions,
|
|
67
|
+
export { p as actions, B as attachButton, V as avatar, u as bubble, e as container, a as contentWrapper, N as danger, ae as default, w as done, T as error, b as expanded, ie as fallback, R as field, L as fieldContainer, h as hasAvatar, m as hoverOnly, re as image, I as inputArea, r as left, W as lg, U as md, n as message, c as messageAvatar, t as messageList, s as received, i as right, G as s1, Y as s10, X as s12, Z as s14, Q as s16, $ as s18, ee as s20, te as s22, ne as s24, K as s3, q as s5, J as s7, z as sendButton, l as sender, o as sent, H as sm, j as system, F as systemAction, P as systemText, g as timestamp, D as toolBody, _ as toolCall, y as toolChevron, k as toolCode, v as toolHeader, A as toolLabel, x as toolName, O as toolSection, E as toolSpinner, C as toolStatus, S as toolSummary, d as typing, f as typingDot, M as warning };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../utilities/warn-unstyled-value.cjs"),r=require("./styled-values.cjs"),i=require("./card.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=a.default.forwardRef(({asChild:e=!1,variant:a=`outline`,padding:c=`md`,radius:l=`lg`,interactive:u=!1,className:d,children:f,...p},m)=>{let h=e?t.Root:`div`;return r.CARD_STYLED_PADDING.includes(c)||n.warnUnstyledValue(`Card`,`padding`,c,r.CARD_STYLED_PADDING),r.CARD_STYLED_RADIUS.includes(l)||n.warnUnstyledValue(`Card`,`radius`,l,r.CARD_STYLED_RADIUS),(0,s.jsx)(h,{ref:m,className:(0,o.default)(`wim-card`,i.default.root,i.default[a],i.default[`padding-${c}`],i.default[`radius-${l}`],u&&i.default.interactive,d),...p,children:f})});c.displayName=`Card`;var l=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.header,e),...n,children:t}),u=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.body,e),...n,children:t}),d=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.footer,e),...n,children:t});l.displayName=`Card.Header`,u.displayName=`Card.Body`,d.displayName=`Card.Footer`,c.Header=l,c.Body=u,c.Footer=d,exports.Card=c,exports.default=c,exports.CardBody=u,exports.CardFooter=d,exports.CardHeader=l;
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../utilities/warn-unstyled-value.cjs"),r=require("./styled-values.cjs"),i=require("./card.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=a.default.forwardRef(({asChild:e=!1,variant:a=`outline`,padding:c=`md`,radius:l=`lg`,interactive:u=!1,className:d,children:f,...p},m)=>{let h=e?t.Root:`div`;return r.CARD_STYLED_PADDING.includes(c)||n.warnUnstyledValue(`Card`,`padding`,c,r.CARD_STYLED_PADDING),r.CARD_STYLED_RADIUS.includes(l)||n.warnUnstyledValue(`Card`,`radius`,l,r.CARD_STYLED_RADIUS),(0,s.jsx)(h,{ref:m,className:(0,o.default)(`wim-card`,i.default.root,i.default[a],i.default[`padding-${c}`],i.default[`radius-${l}`],u&&i.default.interactive,d),...p,children:f})});c.displayName=`Card`;var l=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.header,e),...n,children:t}),u=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.body,e),...n,children:t}),d=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.footer,e),...n,children:t}),f=a.default.forwardRef(({asChild:e=!1,className:n,...r},a)=>(0,s.jsx)(e?t.Root:`a`,{ref:a,className:(0,o.default)(`wim-card-link`,i.default.link,n),...r}));l.displayName=`Card.Header`,u.displayName=`Card.Body`,d.displayName=`Card.Footer`,f.displayName=`Card.Link`,c.Header=l,c.Body=u,c.Footer=d,c.Link=f,exports.Card=c,exports.default=c,exports.CardBody=u,exports.CardFooter=d,exports.CardHeader=l,exports.CardLink=f;
|
|
@@ -35,6 +35,7 @@ interface CardComponent {
|
|
|
35
35
|
Header: typeof CardHeader;
|
|
36
36
|
Body: typeof CardBody;
|
|
37
37
|
Footer: typeof CardFooter;
|
|
38
|
+
Link: typeof CardLink;
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
40
41
|
* `Card` はコンテンツをグループ化して表示するためのコンテナコンポーネントです。
|
|
@@ -52,4 +53,24 @@ export declare const CardFooter: {
|
|
|
52
53
|
({ className, children, ...props }: React.ComponentPropsWithoutRef<"div">): React.JSX.Element;
|
|
53
54
|
displayName: string;
|
|
54
55
|
};
|
|
56
|
+
export type CardLinkProps = React.ComponentPropsWithoutRef<"a"> & {
|
|
57
|
+
/** Render your own element (a router `Link`, or a `button`) instead of an `<a>`. */
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The main link of a card, stretched over the whole card (T365).
|
|
62
|
+
*
|
|
63
|
+
* Put the link text where it reads naturally (usually the title). Clicking
|
|
64
|
+
* anywhere on the card follows it, while other buttons and links inside the
|
|
65
|
+
* card stay separate targets above it, so nothing interactive is nested in
|
|
66
|
+
* the link. Text inside the card cannot be selected by dragging, because the
|
|
67
|
+
* link covers it.
|
|
68
|
+
*
|
|
69
|
+
* Use one per card. Pair it with `interactive` on the `Card` for the hover
|
|
70
|
+
* and press feedback.
|
|
71
|
+
*/
|
|
72
|
+
export declare const CardLink: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
73
|
+
/** Render your own element (a router `Link`, or a `button`) instead of an `<a>`. */
|
|
74
|
+
asChild?: boolean;
|
|
75
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
55
76
|
export default Card;
|
|
@@ -28,7 +28,11 @@ var l = ({ className: e, children: t, ...n }) => /* @__PURE__ */ s("div", {
|
|
|
28
28
|
className: o(i.footer, e),
|
|
29
29
|
...n,
|
|
30
30
|
children: t
|
|
31
|
-
})
|
|
32
|
-
|
|
31
|
+
}), f = a.forwardRef(({ asChild: t = !1, className: n, ...r }, a) => /* @__PURE__ */ s(t ? e : "a", {
|
|
32
|
+
ref: a,
|
|
33
|
+
className: o("wim-card-link", i.link, n),
|
|
34
|
+
...r
|
|
35
|
+
}));
|
|
36
|
+
l.displayName = "Card.Header", u.displayName = "Card.Body", d.displayName = "Card.Footer", f.displayName = "Card.Link", c.Header = l, c.Body = u, c.Footer = d, c.Link = f;
|
|
33
37
|
//#endregion
|
|
34
|
-
export { c as Card, c as default, u as CardBody, d as CardFooter, l as CardHeader };
|
|
38
|
+
export { c as Card, c as default, u as CardBody, d as CardFooter, l as CardHeader, f as CardLink };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1jf6x_3`,t=`_elevated_1jf6x_14`,n=`_interactive_1jf6x_18`,r=`_outline_1jf6x_21`,i=`_flat_1jf6x_27`,a=`_glass_1jf6x_34`,o=`_header_1jf6x_55`,s=`_body_1jf6x_55`,c=`_footer_1jf6x_55`,l=`_link_1jf6x_158`,u={root:e,elevated:t,interactive:n,outline:r,flat:i,glass:a,"padding-none":`_padding-none_1jf6x_52`,header:o,body:s,footer:c,"padding-xs":`_padding-xs_1jf6x_58`,"padding-sm":`_padding-sm_1jf6x_64`,"padding-md":`_padding-md_1jf6x_70`,"padding-lg":`_padding-lg_1jf6x_76`,"padding-xl":`_padding-xl_1jf6x_96`,"padding-2xl":`_padding-2xl_1jf6x_102`,"padding-3xl":`_padding-3xl_1jf6x_108`,"radius-none":`_radius-none_1jf6x_117`,"radius-sm":`_radius-sm_1jf6x_121`,"radius-md":`_radius-md_1jf6x_125`,"radius-lg":`_radius-lg_1jf6x_129`,"radius-xl":`_radius-xl_1jf6x_138`,"radius-2xl":`_radius-2xl_1jf6x_142`,link:l};exports.body=s,exports.default=u,exports.elevated=t,exports.flat=i,exports.footer=c,exports.glass=a,exports.header=o,exports.interactive=n,exports.link=l,exports.outline=r,exports.root=e;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/data-display/Card/card.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1jf6x_3", t = "_elevated_1jf6x_14", n = "_interactive_1jf6x_18", r = "_outline_1jf6x_21", i = "_flat_1jf6x_27", a = "_glass_1jf6x_34", o = "_header_1jf6x_55", s = "_body_1jf6x_55", c = "_footer_1jf6x_55", l = "_link_1jf6x_158", u = {
|
|
4
4
|
root: e,
|
|
5
5
|
elevated: t,
|
|
6
6
|
interactive: n,
|
|
7
7
|
outline: r,
|
|
8
8
|
flat: i,
|
|
9
9
|
glass: a,
|
|
10
|
-
"padding-none": "_padding-
|
|
10
|
+
"padding-none": "_padding-none_1jf6x_52",
|
|
11
11
|
header: o,
|
|
12
12
|
body: s,
|
|
13
13
|
footer: c,
|
|
14
|
-
"padding-xs": "_padding-
|
|
15
|
-
"padding-sm": "_padding-
|
|
16
|
-
"padding-md": "_padding-
|
|
17
|
-
"padding-lg": "_padding-
|
|
18
|
-
"padding-xl": "_padding-
|
|
19
|
-
"padding-2xl": "_padding-
|
|
20
|
-
"padding-3xl": "_padding-
|
|
21
|
-
"radius-none": "_radius-
|
|
22
|
-
"radius-sm": "_radius-
|
|
23
|
-
"radius-md": "_radius-
|
|
24
|
-
"radius-lg": "_radius-
|
|
25
|
-
"radius-xl": "_radius-
|
|
26
|
-
"radius-2xl": "_radius-
|
|
14
|
+
"padding-xs": "_padding-xs_1jf6x_58",
|
|
15
|
+
"padding-sm": "_padding-sm_1jf6x_64",
|
|
16
|
+
"padding-md": "_padding-md_1jf6x_70",
|
|
17
|
+
"padding-lg": "_padding-lg_1jf6x_76",
|
|
18
|
+
"padding-xl": "_padding-xl_1jf6x_96",
|
|
19
|
+
"padding-2xl": "_padding-2xl_1jf6x_102",
|
|
20
|
+
"padding-3xl": "_padding-3xl_1jf6x_108",
|
|
21
|
+
"radius-none": "_radius-none_1jf6x_117",
|
|
22
|
+
"radius-sm": "_radius-sm_1jf6x_121",
|
|
23
|
+
"radius-md": "_radius-md_1jf6x_125",
|
|
24
|
+
"radius-lg": "_radius-lg_1jf6x_129",
|
|
25
|
+
"radius-xl": "_radius-xl_1jf6x_138",
|
|
26
|
+
"radius-2xl": "_radius-2xl_1jf6x_142",
|
|
27
|
+
link: l
|
|
27
28
|
};
|
|
28
29
|
//#endregion
|
|
29
|
-
export { s as body,
|
|
30
|
+
export { s as body, u as default, t as elevated, i as flat, c as footer, a as glass, o as header, n as interactive, l as link, r as outline, e as root };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../FieldTemplate/FieldTemplate.cjs"),r=require("../Checkbox/Checkbox.cjs"),i=require("./checkbox-group.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../FieldTemplate/FieldTemplate.cjs"),r=require("../Checkbox/Checkbox.cjs"),i=require("./checkbox-group.module.cjs"),a=require("../../_internal/ChoiceLabel.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=(0,o.forwardRef)(({options:e,value:l,defaultValue:u=[],onChange:d,direction:f=`vertical`,variant:p=`default`,name:m,className:h,label:g,error:_,required:v,disabled:y,asChild:b=!1,children:x,...S},C)=>{let w=l!==void 0,[T,E]=(0,o.useState)(u),D=`wim-checkbox-group-${(0,o.useId)()}`,O=`${D}-label`,k=_?`${D}-error`:void 0,A=w?l:T,j=(e,t)=>{let n;n=t?[...A,e]:A.filter(t=>t!==e),w||E(n),d&&d(n)};return(0,c.jsx)(n.FieldTemplate,{label:g,error:_,required:v,labelId:O,errorId:k,className:h,children:(0,c.jsxs)(b?t.Root:`div`,{...S,ref:C,className:(0,s.default)(`wim-checkbox-group`,i.default.root,f===`horizontal`&&i.default.horizontal,p===`card`&&i.default.cards),role:`group`,"aria-labelledby":g?O:S[`aria-labelledby`],"aria-describedby":[S[`aria-describedby`],k].filter(Boolean).join(` `)||void 0,children:[e.map(e=>{let t=e.description?`${D}-${e.value}-description`:void 0,n=e.description?`${D}-${e.value}-label`:void 0;return(0,c.jsx)(r.Checkbox,{value:e.value,checked:A.includes(e.value),disabled:y||e.disabled,error:!!_,name:m,onChange:t=>j(e.value,t.target.checked),"aria-describedby":t,"aria-labelledby":n,className:(0,s.default)(p===`card`&&a.choiceLabelClasses.card,e.description&&a.choiceLabelClasses.top),children:(0,c.jsx)(a.ChoiceLabel,{label:e.label,description:e.description,descriptionId:t,labelId:n})},e.value)}),(0,c.jsx)(t.Slottable,{children:x})]})})});l.displayName=`CheckboxGroup`,exports.CheckboxGroup=l,exports.default=l;
|
|
@@ -3,6 +3,8 @@ type Option = {
|
|
|
3
3
|
label: string;
|
|
4
4
|
value: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
/** A second line that explains the option (shown under the label, and linked with `aria-describedby`) */
|
|
7
|
+
description?: string;
|
|
6
8
|
};
|
|
7
9
|
export interface CheckboxGroupProps extends Omit<React.ComponentPropsWithoutRef<"div">, "onChange" | "defaultValue"> {
|
|
8
10
|
/** List of checkbox options */
|
|
@@ -15,6 +17,13 @@ export interface CheckboxGroupProps extends Omit<React.ComponentPropsWithoutRef<
|
|
|
15
17
|
onChange?: (value: string[]) => void;
|
|
16
18
|
/** Layout direction of the checkboxes */
|
|
17
19
|
direction?: "vertical" | "horizontal";
|
|
20
|
+
/**
|
|
21
|
+
* `card` draws each option as a bordered card that is selectable as a whole
|
|
22
|
+
* (the card is the option's `<label>`). Keys and group semantics stay those
|
|
23
|
+
* of a checkbox group. Use with `description` when the options need explaining.
|
|
24
|
+
* @default "default"
|
|
25
|
+
*/
|
|
26
|
+
variant?: "default" | "card";
|
|
18
27
|
/** Name attribute shared by the checkbox inputs */
|
|
19
28
|
name?: string;
|
|
20
29
|
/** Whether to render as a child element. */
|
|
@@ -3,41 +3,53 @@ import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react
|
|
|
3
3
|
import { FieldTemplate as n } from "../FieldTemplate/FieldTemplate.js";
|
|
4
4
|
import { Checkbox as r } from "../Checkbox/Checkbox.js";
|
|
5
5
|
import i from "./checkbox-group.module.js";
|
|
6
|
-
import {
|
|
7
|
-
import c from "
|
|
8
|
-
import
|
|
6
|
+
import { ChoiceLabel as a, choiceLabelClasses as o } from "../../_internal/ChoiceLabel.js";
|
|
7
|
+
import { forwardRef as s, useId as c, useState as l } from "react";
|
|
8
|
+
import u from "classnames";
|
|
9
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/form/CheckboxGroup/CheckboxGroup.tsx
|
|
10
|
-
var
|
|
11
|
-
let
|
|
11
|
+
var p = s(({ options: s, value: p, defaultValue: m = [], onChange: h, direction: g = "vertical", variant: _ = "default", name: v, className: y, label: b, error: x, required: S, disabled: C, asChild: w = !1, children: T, ...E }, D) => {
|
|
12
|
+
let O = p !== void 0, [k, A] = l(m), j = `wim-checkbox-group-${c()}`, M = `${j}-label`, N = x ? `${j}-error` : void 0, P = O ? p : k, F = (e, t) => {
|
|
12
13
|
let n;
|
|
13
|
-
n = t ? [...
|
|
14
|
+
n = t ? [...P, e] : P.filter((t) => t !== e), O || A(n), h && h(n);
|
|
14
15
|
};
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
label:
|
|
17
|
-
error:
|
|
18
|
-
required:
|
|
19
|
-
labelId:
|
|
20
|
-
errorId:
|
|
21
|
-
className:
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
-
...
|
|
24
|
-
ref:
|
|
25
|
-
className:
|
|
16
|
+
return /* @__PURE__ */ d(n, {
|
|
17
|
+
label: b,
|
|
18
|
+
error: x,
|
|
19
|
+
required: S,
|
|
20
|
+
labelId: M,
|
|
21
|
+
errorId: N,
|
|
22
|
+
className: y,
|
|
23
|
+
children: /* @__PURE__ */ f(w ? e : "div", {
|
|
24
|
+
...E,
|
|
25
|
+
ref: D,
|
|
26
|
+
className: u("wim-checkbox-group", i.root, g === "horizontal" && i.horizontal, _ === "card" && i.cards),
|
|
26
27
|
role: "group",
|
|
27
|
-
"aria-labelledby":
|
|
28
|
-
"aria-describedby": [
|
|
29
|
-
children: [
|
|
30
|
-
value: e.value
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
"aria-labelledby": b ? M : E["aria-labelledby"],
|
|
29
|
+
"aria-describedby": [E["aria-describedby"], N].filter(Boolean).join(" ") || void 0,
|
|
30
|
+
children: [s.map((e) => {
|
|
31
|
+
let t = e.description ? `${j}-${e.value}-description` : void 0, n = e.description ? `${j}-${e.value}-label` : void 0;
|
|
32
|
+
return /* @__PURE__ */ d(r, {
|
|
33
|
+
value: e.value,
|
|
34
|
+
checked: P.includes(e.value),
|
|
35
|
+
disabled: C || e.disabled,
|
|
36
|
+
error: !!x,
|
|
37
|
+
name: v,
|
|
38
|
+
onChange: (t) => F(e.value, t.target.checked),
|
|
39
|
+
"aria-describedby": t,
|
|
40
|
+
"aria-labelledby": n,
|
|
41
|
+
className: u(_ === "card" && o.card, e.description && o.top),
|
|
42
|
+
children: /* @__PURE__ */ d(a, {
|
|
43
|
+
label: e.label,
|
|
44
|
+
description: e.description,
|
|
45
|
+
descriptionId: t,
|
|
46
|
+
labelId: n
|
|
47
|
+
})
|
|
48
|
+
}, e.value);
|
|
49
|
+
}), /* @__PURE__ */ d(t, { children: T })]
|
|
38
50
|
})
|
|
39
51
|
});
|
|
40
52
|
});
|
|
41
|
-
|
|
53
|
+
p.displayName = "CheckboxGroup";
|
|
42
54
|
//#endregion
|
|
43
|
-
export {
|
|
55
|
+
export { p as CheckboxGroup, p as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1pbiw_3`,t=`_horizontal_1pbiw_8`,n=`_cards_1pbiw_15`,r={root:e,horizontal:t,cards:n};exports.cards=n,exports.default=r,exports.horizontal=t,exports.root=e;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/CheckboxGroup/checkbox-group.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1pbiw_3", t = "_horizontal_1pbiw_8", n = "_cards_1pbiw_15", r = {
|
|
4
4
|
root: e,
|
|
5
|
-
horizontal: t
|
|
5
|
+
horizontal: t,
|
|
6
|
+
cards: n
|
|
6
7
|
};
|
|
7
8
|
//#endregion
|
|
8
|
-
export { n as default, t as horizontal, e as root };
|
|
9
|
+
export { n as cards, r as default, t as horizontal, e as root };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../FieldTemplate/FieldTemplate.cjs"),r=require("../Radio/Radio.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../FieldTemplate/FieldTemplate.cjs"),r=require("../../_internal/ChoiceLabel.cjs"),i=require("../Radio/Radio.cjs"),a=require("./radio-group.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=(0,o.forwardRef)(({options:e,value:l,defaultValue:u,onChange:d,direction:f=`vertical`,variant:p=`default`,name:m,className:h,label:g,error:_,required:v,disabled:y,asChild:b=!1,children:x,...S},C)=>{let w=l!==void 0,[T,E]=(0,o.useState)(u),D=`wim-radio-group-${(0,o.useId)()}`,O=`${D}-label`,k=_?`${D}-error`:void 0,A=w?l:T,j=e=>{w||E(e),d&&d(e)};return(0,c.jsx)(n.FieldTemplate,{label:g,error:_,required:v,labelId:O,errorId:k,className:h,children:(0,c.jsxs)(b?t.Root:`div`,{...S,ref:C,className:(0,s.default)(`wim-radio-group`,a.default.root,f===`horizontal`&&a.default.horizontal,p===`card`&&a.default.cards),role:`radiogroup`,"aria-labelledby":g?O:S[`aria-labelledby`],"aria-describedby":[S[`aria-describedby`],k].filter(Boolean).join(` `)||void 0,"aria-required":v,"aria-invalid":!!_,children:[e.map(e=>{let t=e.description?`${D}-${e.value}-description`:void 0,n=e.description?`${D}-${e.value}-label`:void 0;return(0,c.jsx)(i.Radio,{value:e.value,checked:A===e.value,disabled:y||e.disabled,error:!!_,name:m,onChange:()=>j(e.value),"aria-describedby":t,"aria-labelledby":n,className:(0,s.default)(p===`card`&&r.choiceLabelClasses.card,e.description&&r.choiceLabelClasses.top),children:(0,c.jsx)(r.ChoiceLabel,{label:e.label,description:e.description,descriptionId:t,labelId:n})},e.value)}),(0,c.jsx)(t.Slottable,{children:x})]})})});l.displayName=`RadioGroup`,exports.RadioGroup=l,exports.default=l;
|
|
@@ -3,6 +3,8 @@ type Option = {
|
|
|
3
3
|
label: string;
|
|
4
4
|
value: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
/** A second line that explains the option (shown under the label, and linked with `aria-describedby`) */
|
|
7
|
+
description?: string;
|
|
6
8
|
};
|
|
7
9
|
export interface RadioGroupProps extends Omit<React.ComponentPropsWithoutRef<"div">, "onChange" | "defaultValue"> {
|
|
8
10
|
/** List of radio options */
|
|
@@ -15,6 +17,13 @@ export interface RadioGroupProps extends Omit<React.ComponentPropsWithoutRef<"di
|
|
|
15
17
|
onChange?: (value: string) => void;
|
|
16
18
|
/** Layout direction of the radio buttons */
|
|
17
19
|
direction?: "vertical" | "horizontal";
|
|
20
|
+
/**
|
|
21
|
+
* `card` draws each option as a bordered card that is selectable as a whole
|
|
22
|
+
* (the card is the option's `<label>`). Keys and group semantics stay those
|
|
23
|
+
* of a radio group. Use with `description` when the options need explaining.
|
|
24
|
+
* @default "default"
|
|
25
|
+
*/
|
|
26
|
+
variant?: "default" | "card";
|
|
18
27
|
/** Name attribute shared by the radio inputs */
|
|
19
28
|
name?: string;
|
|
20
29
|
/** Whether to render as a child element. */
|
|
@@ -1,44 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
3
|
import { FieldTemplate as n } from "../FieldTemplate/FieldTemplate.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import c from "
|
|
8
|
-
import
|
|
4
|
+
import { ChoiceLabel as r, choiceLabelClasses as i } from "../../_internal/ChoiceLabel.js";
|
|
5
|
+
import { Radio as a } from "../Radio/Radio.js";
|
|
6
|
+
import o from "./radio-group.module.js";
|
|
7
|
+
import { forwardRef as s, useId as c, useState as l } from "react";
|
|
8
|
+
import u from "classnames";
|
|
9
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/form/RadioGroup/RadioGroup.tsx
|
|
10
|
-
var
|
|
11
|
-
let
|
|
12
|
-
|
|
11
|
+
var p = s(({ options: s, value: p, defaultValue: m, onChange: h, direction: g = "vertical", variant: _ = "default", name: v, className: y, label: b, error: x, required: S, disabled: C, asChild: w = !1, children: T, ...E }, D) => {
|
|
12
|
+
let O = p !== void 0, [k, A] = l(m), j = `wim-radio-group-${c()}`, M = `${j}-label`, N = x ? `${j}-error` : void 0, P = O ? p : k, F = (e) => {
|
|
13
|
+
O || A(e), h && h(e);
|
|
13
14
|
};
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
label:
|
|
16
|
-
error:
|
|
17
|
-
required:
|
|
18
|
-
labelId:
|
|
19
|
-
errorId:
|
|
20
|
-
className:
|
|
21
|
-
children: /* @__PURE__ */
|
|
22
|
-
...
|
|
23
|
-
ref:
|
|
24
|
-
className:
|
|
15
|
+
return /* @__PURE__ */ d(n, {
|
|
16
|
+
label: b,
|
|
17
|
+
error: x,
|
|
18
|
+
required: S,
|
|
19
|
+
labelId: M,
|
|
20
|
+
errorId: N,
|
|
21
|
+
className: y,
|
|
22
|
+
children: /* @__PURE__ */ f(w ? e : "div", {
|
|
23
|
+
...E,
|
|
24
|
+
ref: D,
|
|
25
|
+
className: u("wim-radio-group", o.root, g === "horizontal" && o.horizontal, _ === "card" && o.cards),
|
|
25
26
|
role: "radiogroup",
|
|
26
|
-
"aria-labelledby":
|
|
27
|
-
"aria-describedby": [
|
|
28
|
-
"aria-required":
|
|
29
|
-
"aria-invalid": !!
|
|
30
|
-
children: [
|
|
31
|
-
value: e.value
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
"aria-labelledby": b ? M : E["aria-labelledby"],
|
|
28
|
+
"aria-describedby": [E["aria-describedby"], N].filter(Boolean).join(" ") || void 0,
|
|
29
|
+
"aria-required": S,
|
|
30
|
+
"aria-invalid": !!x,
|
|
31
|
+
children: [s.map((e) => {
|
|
32
|
+
let t = e.description ? `${j}-${e.value}-description` : void 0, n = e.description ? `${j}-${e.value}-label` : void 0;
|
|
33
|
+
return /* @__PURE__ */ d(a, {
|
|
34
|
+
value: e.value,
|
|
35
|
+
checked: P === e.value,
|
|
36
|
+
disabled: C || e.disabled,
|
|
37
|
+
error: !!x,
|
|
38
|
+
name: v,
|
|
39
|
+
onChange: () => F(e.value),
|
|
40
|
+
"aria-describedby": t,
|
|
41
|
+
"aria-labelledby": n,
|
|
42
|
+
className: u(_ === "card" && i.card, e.description && i.top),
|
|
43
|
+
children: /* @__PURE__ */ d(r, {
|
|
44
|
+
label: e.label,
|
|
45
|
+
description: e.description,
|
|
46
|
+
descriptionId: t,
|
|
47
|
+
labelId: n
|
|
48
|
+
})
|
|
49
|
+
}, e.value);
|
|
50
|
+
}), /* @__PURE__ */ d(t, { children: T })]
|
|
39
51
|
})
|
|
40
52
|
});
|
|
41
53
|
});
|
|
42
|
-
|
|
54
|
+
p.displayName = "RadioGroup";
|
|
43
55
|
//#endregion
|
|
44
|
-
export {
|
|
56
|
+
export { p as RadioGroup, p as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1pbiw_3`,t=`_horizontal_1pbiw_8`,n=`_cards_1pbiw_15`,r={root:e,horizontal:t,cards:n};exports.cards=n,exports.default=r,exports.horizontal=t,exports.root=e;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/RadioGroup/radio-group.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1pbiw_3", t = "_horizontal_1pbiw_8", n = "_cards_1pbiw_15", r = {
|
|
4
4
|
root: e,
|
|
5
|
-
horizontal: t
|
|
5
|
+
horizontal: t,
|
|
6
|
+
cards: n
|
|
6
7
|
};
|
|
7
8
|
//#endregion
|
|
8
|
-
export { n as default, t as horizontal, e as root };
|
|
9
|
+
export { n as cards, r as default, t as horizontal, e as root };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("../../media/Icon/Icon.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("../../media/Icon/Icon.cjs"),i=require("../../_internal/rovingIndex.cjs"),a=require("../FieldTemplate/FieldTemplate.cjs"),o=require("../../_internal/useIndicator.cjs"),s=require("./segmented-control.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=(0,c.forwardRef)(({options:e,value:d,onChange:f,size:p=`md`,fullWidth:m=!1,className:h,label:g,error:_,required:v,layout:y=`vertical`,disabled:b=!1,asChild:x=!1,children:S,id:C,styles:w,"aria-label":T,"aria-labelledby":E,"aria-describedby":D},O)=>{let k=(0,c.useRef)([]),A=(0,c.useId)(),j=C||`wim-segmented-${A}`,M=`${j}-label`,N=`${j}-error`,{containerRef:P,sliderStyle:F,isReady:I}=o.useIndicator({activeSelector:`.${s.default.active}`,dependence:e.length}),L=e.findIndex(e=>e.value===d),R=(t,n)=>{let r=i.getRovingIndex({key:t.key,current:n,count:e.length});r!==null&&(t.preventDefault(),f(e[r].value),k.current[r]?.focus())},z=`${j}-item-0`;return(0,u.jsx)(a.FieldTemplate,{label:g,error:_,required:v,layout:y,labelId:M,htmlFor:z,errorId:N,className:h,children:(0,u.jsxs)(x?t.Root:`div`,{ref:n.useMergedRef(P,O),id:j,className:(0,l.default)(`wim-segmented-control`,s.default.root,s.default[p],m&&s.default.fullWidth,I&&s.default.ready,_&&s.default.danger,w?.root),role:`radiogroup`,"aria-labelledby":g?M:E,"aria-label":g||E?void 0:T,"aria-required":v,"aria-invalid":_?!0:void 0,"aria-describedby":[D,_?N:void 0].filter(Boolean).join(` `)||void 0,children:[(0,u.jsx)(`div`,{className:(0,l.default)(s.default.slider,w?.slider),style:F,"aria-hidden":`true`}),e.map((e,t)=>{let n=e.value===d,i=n||L===-1&&t===0,a=`${j}-item-${t}`;return(0,u.jsxs)(`button`,{id:a,ref:e=>{k.current[t]=e},type:`button`,className:(0,l.default)(s.default.item,n&&s.default.active,!e.label&&e.iconName&&s.default.iconOnly,w?.item),onClick:()=>f(e.value),onKeyDown:e=>R(e,t),onFocus:()=>{},onBlur:()=>{},role:`radio`,"aria-checked":n,tabIndex:i?0:-1,"aria-label":e.label?void 0:e.value,disabled:b,children:[e.iconName&&(0,u.jsx)(r.Icon,{name:e.iconName,size:p,className:s.default.icon}),e.label&&(0,u.jsx)(`span`,{className:(0,l.default)(s.default.label,w?.label),children:e.label})]},e.value)}),(0,u.jsx)(t.Slottable,{children:S})]})})});d.displayName=`SegmentedControl`,exports.SegmentedControl=d;
|