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.
Files changed (58) hide show
  1. package/dist/ai.cjs +1 -1
  2. package/dist/ai.js +3 -3
  3. package/dist/components/_internal/ChoiceLabel.cjs +2 -0
  4. package/dist/components/_internal/ChoiceLabel.d.ts +31 -0
  5. package/dist/components/_internal/ChoiceLabel.js +22 -0
  6. package/dist/components/_internal/choice-label.module.cjs +2 -0
  7. package/dist/components/_internal/choice-label.module.js +11 -0
  8. package/dist/components/_internal/rovingIndex.cjs +2 -0
  9. package/dist/components/_internal/rovingIndex.d.ts +38 -0
  10. package/dist/components/_internal/rovingIndex.js +16 -0
  11. package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
  12. package/dist/components/ai/ChatUI/ChatUI.d.ts +83 -1
  13. package/dist/components/ai/ChatUI/ChatUI.js +184 -81
  14. package/dist/components/ai/ChatUI/chat-ui.module.cjs +1 -1
  15. package/dist/components/ai/ChatUI/chat-ui.module.js +46 -26
  16. package/dist/components/data-display/Card/Card.cjs +1 -1
  17. package/dist/components/data-display/Card/Card.d.ts +21 -0
  18. package/dist/components/data-display/Card/Card.js +7 -3
  19. package/dist/components/data-display/Card/card.module.cjs +1 -1
  20. package/dist/components/data-display/Card/card.module.js +17 -16
  21. package/dist/components/form/CheckboxGroup/CheckboxGroup.cjs +1 -1
  22. package/dist/components/form/CheckboxGroup/CheckboxGroup.d.ts +9 -0
  23. package/dist/components/form/CheckboxGroup/CheckboxGroup.js +42 -30
  24. package/dist/components/form/CheckboxGroup/checkbox-group.module.cjs +1 -1
  25. package/dist/components/form/CheckboxGroup/checkbox-group.module.js +4 -3
  26. package/dist/components/form/RadioGroup/RadioGroup.cjs +1 -1
  27. package/dist/components/form/RadioGroup/RadioGroup.d.ts +9 -0
  28. package/dist/components/form/RadioGroup/RadioGroup.js +46 -34
  29. package/dist/components/form/RadioGroup/radio-group.module.cjs +1 -1
  30. package/dist/components/form/RadioGroup/radio-group.module.js +4 -3
  31. package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
  32. package/dist/components/form/SegmentedControl/SegmentedControl.js +56 -68
  33. package/dist/components/form/ToggleGroup/ToggleGroup.cjs +1 -1
  34. package/dist/components/form/ToggleGroup/ToggleGroup.js +80 -88
  35. package/dist/components/layout/Toolbar/Toolbar.cjs +1 -1
  36. package/dist/components/layout/Toolbar/Toolbar.js +52 -51
  37. package/dist/components/navigation/Stepper/Stepper.cjs +1 -1
  38. package/dist/components/navigation/Stepper/Stepper.js +51 -53
  39. package/dist/components/navigation/TabNavigation/TabNavigation.cjs +1 -1
  40. package/dist/components/navigation/TabNavigation/TabNavigation.js +47 -49
  41. package/dist/components/navigation/Tabs/Tabs.cjs +1 -1
  42. package/dist/components/navigation/Tabs/Tabs.js +80 -73
  43. package/dist/data-display.cjs +1 -1
  44. package/dist/data-display.js +40 -40
  45. package/dist/i18n/generated/common.cjs +1 -1
  46. package/dist/i18n/generated/common.d.ts +1 -1
  47. package/dist/i18n/generated/common.js +9 -3
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.js +174 -174
  50. package/dist/llms-full.txt +9 -1
  51. package/dist/llms.txt +1 -1
  52. package/dist/locales/en/common.json +3 -1
  53. package/dist/locales/ja/common.json +3 -1
  54. package/dist/locales/pt/common.json +3 -1
  55. package/dist/styles.css +1 -1
  56. package/dist/wimui.umd.css +1 -1
  57. package/dist/wimui.umd.js +5 -5
  58. package/package.json +3 -3
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_container_774t4_23`,t=`_messageList_774t4_39`,n=`_message_774t4_39`,r=`_left_774t4_71`,i=`_right_774t4_76`,a=`_contentWrapper_774t4_81`,o=`_sent_774t4_84`,s=`_received_774t4_87`,c=`_messageAvatar_774t4_90`,l=`_sender_774t4_99`,u=`_bubble_774t4_104`,d=`_typing_774t4_115`,f=`_typingDot_774t4_122`,p=`_actions_774t4_146`,m=`_hoverOnly_774t4_153`,h=`_hasAvatar_774t4_171`,g=`_timestamp_774t4_211`,_=`_inputArea_774t4_216`,v=`_fieldContainer_774t4_229`,y=`_field_774t4_229`,b=`_sendButton_774t4_278`,x=`_attachButton_774t4_305`,S=`_avatar_774t4_327`,C=`_sm_774t4_340`,w=`_md_774t4_345`,T=`_lg_774t4_350`,E=`_s1_774t4_358`,D=`_s3_774t4_362`,O=`_s5_774t4_366`,k=`_s7_774t4_370`,A=`_s10_774t4_374`,j=`_s12_774t4_378`,M=`_s14_774t4_382`,N=`_s16_774t4_386`,P=`_s18_774t4_390`,F=`_s20_774t4_394`,I=`_s22_774t4_398`,L=`_s24_774t4_402`,R=`_image_774t4_406`,z=`_fallback_774t4_411`,B={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_774t4_1`,actions:p,hoverOnly:m,hasAvatar:h,timestamp:g,inputArea:_,fieldContainer:v,field:y,sendButton:b,attachButton:x,avatar:S,sm:C,md:w,lg:T,s1:E,s3:D,s5:O,s7:k,s10:A,s12:j,s14:M,s16:N,s18:P,s20:F,s22:I,s24:L,image:R,fallback:z};exports.actions=p,exports.attachButton=x,exports.avatar=S,exports.bubble=u,exports.container=e,exports.contentWrapper=a,exports.default=B,exports.fallback=z,exports.field=y,exports.fieldContainer=v,exports.hasAvatar=h,exports.hoverOnly=m,exports.image=R,exports.inputArea=_,exports.left=r,exports.lg=T,exports.md=w,exports.message=n,exports.messageAvatar=c,exports.messageList=t,exports.received=s,exports.right=i,exports.s1=E,exports.s10=A,exports.s12=j,exports.s14=M,exports.s16=N,exports.s18=P,exports.s20=F,exports.s22=I,exports.s24=L,exports.s3=D,exports.s5=O,exports.s7=k,exports.sendButton=b,exports.sender=l,exports.sent=o,exports.sm=C,exports.timestamp=g,exports.typing=d,exports.typingDot=f;
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 = "_container_774t4_23", t = "_messageList_774t4_39", n = "_message_774t4_39", r = "_left_774t4_71", i = "_right_774t4_76", a = "_contentWrapper_774t4_81", o = "_sent_774t4_84", s = "_received_774t4_87", c = "_messageAvatar_774t4_90", l = "_sender_774t4_99", u = "_bubble_774t4_104", d = "_typing_774t4_115", f = "_typingDot_774t4_122", p = "_actions_774t4_146", m = "_hoverOnly_774t4_153", h = "_hasAvatar_774t4_171", g = "_timestamp_774t4_211", _ = "_inputArea_774t4_216", v = "_fieldContainer_774t4_229", y = "_field_774t4_229", b = "_sendButton_774t4_278", x = "_attachButton_774t4_305", S = "_avatar_774t4_327", C = "_sm_774t4_340", w = "_md_774t4_345", T = "_lg_774t4_350", E = "_s1_774t4_358", D = "_s3_774t4_362", O = "_s5_774t4_366", k = "_s7_774t4_370", A = "_s10_774t4_374", j = "_s12_774t4_378", M = "_s14_774t4_382", N = "_s16_774t4_386", P = "_s18_774t4_390", F = "_s20_774t4_394", I = "_s22_774t4_398", L = "_s24_774t4_402", R = "_image_774t4_406", z = "_fallback_774t4_411", B = {
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-typing_774t4_1",
17
+ "chat-typing": "_chat-typing_1pjll_1",
18
18
  actions: p,
19
19
  hoverOnly: m,
20
20
  hasAvatar: h,
21
21
  timestamp: g,
22
- inputArea: _,
23
- fieldContainer: v,
24
- field: y,
25
- sendButton: b,
26
- attachButton: x,
27
- avatar: S,
28
- sm: C,
29
- md: w,
30
- lg: T,
31
- s1: E,
32
- s3: D,
33
- s5: O,
34
- s7: k,
35
- s10: A,
36
- s12: j,
37
- s14: M,
38
- s16: N,
39
- s18: P,
40
- s20: F,
41
- s22: I,
42
- s24: L,
43
- image: R,
44
- fallback: z
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, x as attachButton, S as avatar, u as bubble, e as container, a as contentWrapper, B as default, z as fallback, y as field, v as fieldContainer, h as hasAvatar, m as hoverOnly, R as image, _ as inputArea, r as left, T as lg, w as md, n as message, c as messageAvatar, t as messageList, s as received, i as right, E as s1, A as s10, j as s12, M as s14, N as s16, P as s18, F as s20, I as s22, L as s24, D as s3, O as s5, k as s7, b as sendButton, l as sender, o as sent, C as sm, g as timestamp, d as typing, f as typingDot };
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
- l.displayName = "Card.Header", u.displayName = "Card.Body", d.displayName = "Card.Footer", c.Header = l, c.Body = u, c.Footer = d;
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=`_root_lfz7s_3`,t=`_elevated_lfz7s_14`,n=`_interactive_lfz7s_18`,r=`_outline_lfz7s_21`,i=`_flat_lfz7s_27`,a=`_glass_lfz7s_34`,o=`_header_lfz7s_55`,s=`_body_lfz7s_55`,c=`_footer_lfz7s_55`,l={root:e,elevated:t,interactive:n,outline:r,flat:i,glass:a,"padding-none":`_padding-none_lfz7s_52`,header:o,body:s,footer:c,"padding-xs":`_padding-xs_lfz7s_58`,"padding-sm":`_padding-sm_lfz7s_64`,"padding-md":`_padding-md_lfz7s_70`,"padding-lg":`_padding-lg_lfz7s_76`,"padding-xl":`_padding-xl_lfz7s_96`,"padding-2xl":`_padding-2xl_lfz7s_102`,"padding-3xl":`_padding-3xl_lfz7s_108`,"radius-none":`_radius-none_lfz7s_117`,"radius-sm":`_radius-sm_lfz7s_120`,"radius-md":`_radius-md_lfz7s_123`,"radius-lg":`_radius-lg_lfz7s_126`,"radius-xl":`_radius-xl_lfz7s_134`,"radius-2xl":`_radius-2xl_lfz7s_137`};exports.body=s,exports.default=l,exports.elevated=t,exports.flat=i,exports.footer=c,exports.glass=a,exports.header=o,exports.interactive=n,exports.outline=r,exports.root=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 = "_root_lfz7s_3", t = "_elevated_lfz7s_14", n = "_interactive_lfz7s_18", r = "_outline_lfz7s_21", i = "_flat_lfz7s_27", a = "_glass_lfz7s_34", o = "_header_lfz7s_55", s = "_body_lfz7s_55", c = "_footer_lfz7s_55", l = {
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-none_lfz7s_52",
10
+ "padding-none": "_padding-none_1jf6x_52",
11
11
  header: o,
12
12
  body: s,
13
13
  footer: c,
14
- "padding-xs": "_padding-xs_lfz7s_58",
15
- "padding-sm": "_padding-sm_lfz7s_64",
16
- "padding-md": "_padding-md_lfz7s_70",
17
- "padding-lg": "_padding-lg_lfz7s_76",
18
- "padding-xl": "_padding-xl_lfz7s_96",
19
- "padding-2xl": "_padding-2xl_lfz7s_102",
20
- "padding-3xl": "_padding-3xl_lfz7s_108",
21
- "radius-none": "_radius-none_lfz7s_117",
22
- "radius-sm": "_radius-sm_lfz7s_120",
23
- "radius-md": "_radius-md_lfz7s_123",
24
- "radius-lg": "_radius-lg_lfz7s_126",
25
- "radius-xl": "_radius-xl_lfz7s_134",
26
- "radius-2xl": "_radius-2xl_lfz7s_137"
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, l as default, t as elevated, i as flat, c as footer, a as glass, o as header, n as interactive, r as outline, e as root };
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 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=(0,a.forwardRef)(({options:e,value:c,defaultValue:l=[],onChange:u,direction:d=`vertical`,name:f,className:p,label:m,error:h,required:g,disabled:_,asChild:v=!1,children:y,...b},x)=>{let S=c!==void 0,[C,w]=(0,a.useState)(l),T=`wim-checkbox-group-${(0,a.useId)()}`,E=`${T}-label`,D=h?`${T}-error`:void 0,O=S?c:C,k=(e,t)=>{let n;n=t?[...O,e]:O.filter(t=>t!==e),S||w(n),u&&u(n)};return(0,s.jsx)(n.FieldTemplate,{label:m,error:h,required:g,labelId:E,errorId:D,className:p,children:(0,s.jsxs)(v?t.Root:`div`,{...b,ref:x,className:(0,o.default)(`wim-checkbox-group`,i.default.root,d===`horizontal`&&i.default.horizontal),role:`group`,"aria-labelledby":m?E:b[`aria-labelledby`],"aria-describedby":[b[`aria-describedby`],D].filter(Boolean).join(` `)||void 0,children:[e.map(e=>(0,s.jsx)(r.Checkbox,{value:e.value,checked:O.includes(e.value),disabled:_||e.disabled,error:!!h,name:f,onChange:t=>k(e.value,t.target.checked),children:e.label},e.value)),(0,s.jsx)(t.Slottable,{children:y})]})})});c.displayName=`CheckboxGroup`,exports.CheckboxGroup=c,exports.default=c;
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 { forwardRef as a, useId as o, useState as s } from "react";
7
- import c from "classnames";
8
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
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 d = a(({ options: a, value: d, defaultValue: f = [], onChange: p, direction: m = "vertical", name: h, className: g, label: _, error: v, required: y, disabled: b, asChild: x = !1, children: S, ...C }, w) => {
11
- let T = d !== void 0, [E, D] = s(f), O = `wim-checkbox-group-${o()}`, k = `${O}-label`, A = v ? `${O}-error` : void 0, j = T ? d : E, M = (e, t) => {
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 ? [...j, e] : j.filter((t) => t !== e), T || D(n), p && p(n);
14
+ n = t ? [...P, e] : P.filter((t) => t !== e), O || A(n), h && h(n);
14
15
  };
15
- return /* @__PURE__ */ l(n, {
16
- label: _,
17
- error: v,
18
- required: y,
19
- labelId: k,
20
- errorId: A,
21
- className: g,
22
- children: /* @__PURE__ */ u(x ? e : "div", {
23
- ...C,
24
- ref: w,
25
- className: c("wim-checkbox-group", i.root, m === "horizontal" && i.horizontal),
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": _ ? k : C["aria-labelledby"],
28
- "aria-describedby": [C["aria-describedby"], A].filter(Boolean).join(" ") || void 0,
29
- children: [a.map((e) => /* @__PURE__ */ l(r, {
30
- value: e.value,
31
- checked: j.includes(e.value),
32
- disabled: b || e.disabled,
33
- error: !!v,
34
- name: h,
35
- onChange: (t) => M(e.value, t.target.checked),
36
- children: e.label
37
- }, e.value)), /* @__PURE__ */ l(t, { children: S })]
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
- d.displayName = "CheckboxGroup";
53
+ p.displayName = "CheckboxGroup";
42
54
  //#endregion
43
- export { d as CheckboxGroup, d as default };
55
+ export { p as CheckboxGroup, p as default };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_root_hvp3f_2`,t=`_horizontal_hvp3f_7`,n={root:e,horizontal:t};exports.default=n,exports.horizontal=t,exports.root=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 = "_root_hvp3f_2", t = "_horizontal_hvp3f_7", n = {
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"),i=require("./radio-group.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=(0,a.forwardRef)(({options:e,value:c,defaultValue:l,onChange:u,direction:d=`vertical`,name:f,className:p,label:m,error:h,required:g,disabled:_,asChild:v=!1,children:y,...b},x)=>{let S=c!==void 0,[C,w]=(0,a.useState)(l),T=`wim-radio-group-${(0,a.useId)()}`,E=`${T}-label`,D=h?`${T}-error`:void 0,O=S?c:C,k=e=>{S||w(e),u&&u(e)};return(0,s.jsx)(n.FieldTemplate,{label:m,error:h,required:g,labelId:E,errorId:D,className:p,children:(0,s.jsxs)(v?t.Root:`div`,{...b,ref:x,className:(0,o.default)(`wim-radio-group`,i.default.root,d===`horizontal`&&i.default.horizontal),role:`radiogroup`,"aria-labelledby":m?E:b[`aria-labelledby`],"aria-describedby":[b[`aria-describedby`],D].filter(Boolean).join(` `)||void 0,"aria-required":g,"aria-invalid":!!h,children:[e.map(e=>(0,s.jsx)(r.Radio,{value:e.value,checked:O===e.value,disabled:_||e.disabled,error:!!h,name:f,onChange:()=>k(e.value),children:e.label},e.value)),(0,s.jsx)(t.Slottable,{children:y})]})})});c.displayName=`RadioGroup`,exports.RadioGroup=c,exports.default=c;
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 { Radio as r } from "../Radio/Radio.js";
5
- import i from "./radio-group.module.js";
6
- import { forwardRef as a, useId as o, useState as s } from "react";
7
- import c from "classnames";
8
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
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 d = a(({ options: a, value: d, defaultValue: f, onChange: p, direction: m = "vertical", name: h, className: g, label: _, error: v, required: y, disabled: b, asChild: x = !1, children: S, ...C }, w) => {
11
- let T = d !== void 0, [E, D] = s(f), O = `wim-radio-group-${o()}`, k = `${O}-label`, A = v ? `${O}-error` : void 0, j = T ? d : E, M = (e) => {
12
- T || D(e), p && p(e);
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__ */ l(n, {
15
- label: _,
16
- error: v,
17
- required: y,
18
- labelId: k,
19
- errorId: A,
20
- className: g,
21
- children: /* @__PURE__ */ u(x ? e : "div", {
22
- ...C,
23
- ref: w,
24
- className: c("wim-radio-group", i.root, m === "horizontal" && i.horizontal),
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": _ ? k : C["aria-labelledby"],
27
- "aria-describedby": [C["aria-describedby"], A].filter(Boolean).join(" ") || void 0,
28
- "aria-required": y,
29
- "aria-invalid": !!v,
30
- children: [a.map((e) => /* @__PURE__ */ l(r, {
31
- value: e.value,
32
- checked: j === e.value,
33
- disabled: b || e.disabled,
34
- error: !!v,
35
- name: h,
36
- onChange: () => M(e.value),
37
- children: e.label
38
- }, e.value)), /* @__PURE__ */ l(t, { children: S })]
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
- d.displayName = "RadioGroup";
54
+ p.displayName = "RadioGroup";
43
55
  //#endregion
44
- export { d as RadioGroup, d as default };
56
+ export { p as RadioGroup, p as default };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_root_hvp3f_2`,t=`_horizontal_hvp3f_7`,n={root:e,horizontal:t};exports.default=n,exports.horizontal=t,exports.root=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 = "_root_hvp3f_2", t = "_horizontal_hvp3f_7", n = {
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"),a=require("../../_internal/useIndicator.cjs"),o=require("./segmented-control.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=(0,s.forwardRef)(({options:e,value:u,onChange:d,size:f=`md`,fullWidth:p=!1,className:m,label:h,error:g,required:_,layout:v=`vertical`,disabled:y=!1,asChild:b=!1,children:x,id:S,styles:C,"aria-label":w,"aria-labelledby":T,"aria-describedby":E},D)=>{let O=(0,s.useRef)([]),k=(0,s.useId)(),A=S||`wim-segmented-${k}`,j=`${A}-label`,M=`${A}-error`,{containerRef:N,sliderStyle:P,isReady:F}=a.useIndicator({activeSelector:`.${o.default.active}`,dependence:e.length}),I=e.findIndex(e=>e.value===u),L=(t,n)=>{let r;switch(t.key){case`ArrowLeft`:case`ArrowUp`:r=n-1,r<0&&(r=e.length-1);break;case`ArrowRight`:case`ArrowDown`:r=n+1,r>=e.length&&(r=0);break;case`Home`:r=0;break;case`End`:r=e.length-1;break;default:return}t.preventDefault(),d(e[r].value),O.current[r]?.focus()},R=`${A}-item-0`;return(0,l.jsx)(i.FieldTemplate,{label:h,error:g,required:_,layout:v,labelId:j,htmlFor:R,errorId:M,className:m,children:(0,l.jsxs)(b?t.Root:`div`,{ref:n.useMergedRef(N,D),id:A,className:(0,c.default)(`wim-segmented-control`,o.default.root,o.default[f],p&&o.default.fullWidth,F&&o.default.ready,g&&o.default.danger,C?.root),role:`radiogroup`,"aria-labelledby":h?j:T,"aria-label":h||T?void 0:w,"aria-required":_,"aria-invalid":g?!0:void 0,"aria-describedby":[E,g?M:void 0].filter(Boolean).join(` `)||void 0,children:[(0,l.jsx)(`div`,{className:(0,c.default)(o.default.slider,C?.slider),style:P,"aria-hidden":`true`}),e.map((e,t)=>{let n=e.value===u,i=n||I===-1&&t===0,a=`${A}-item-${t}`;return(0,l.jsxs)(`button`,{id:a,ref:e=>{O.current[t]=e},type:`button`,className:(0,c.default)(o.default.item,n&&o.default.active,!e.label&&e.iconName&&o.default.iconOnly,C?.item),onClick:()=>d(e.value),onKeyDown:e=>L(e,t),onFocus:()=>{},onBlur:()=>{},role:`radio`,"aria-checked":n,tabIndex:i?0:-1,"aria-label":e.label?void 0:e.value,disabled:y,children:[e.iconName&&(0,l.jsx)(r.Icon,{name:e.iconName,size:f,className:o.default.icon}),e.label&&(0,l.jsx)(`span`,{className:(0,c.default)(o.default.label,C?.label),children:e.label})]},e.value)}),(0,l.jsx)(t.Slottable,{children:x})]})})});u.displayName=`SegmentedControl`,exports.SegmentedControl=u;
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;