@radui/ui 1.0.1 → 1.1.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 (238) hide show
  1. package/dist/components/Accordion.cjs +1 -1
  2. package/dist/components/Accordion.js +1 -1
  3. package/dist/components/AlertDialog.cjs +1 -1
  4. package/dist/components/AlertDialog.d.ts +61 -24
  5. package/dist/components/AlertDialog.js +1 -1
  6. package/dist/components/Avatar.cjs +1 -1
  7. package/dist/components/Avatar.d.ts +36 -6
  8. package/dist/components/Avatar.js +1 -1
  9. package/dist/components/AvatarGroup.cjs +1 -1
  10. package/dist/components/AvatarGroup.d.ts +39 -18
  11. package/dist/components/AvatarGroup.js +1 -1
  12. package/dist/components/{AvatarPrimitiveFallback-CBb0nHGD.cjs → AvatarPrimitiveFallback-BpUU1vNV.cjs} +1 -1
  13. package/dist/components/{AvatarPrimitiveFallback-C1siRii4.js → AvatarPrimitiveFallback-DIXB9Tnm.js} +1 -1
  14. package/dist/components/Badge.cjs +1 -1
  15. package/dist/components/Badge.js +1 -1
  16. package/dist/components/Breadcrumb.cjs +1 -1
  17. package/dist/components/Breadcrumb.js +1 -1
  18. package/dist/components/Button.cjs +1 -1
  19. package/dist/components/Button.js +1 -1
  20. package/dist/components/Callout.cjs +1 -1
  21. package/dist/components/Callout.d.ts +32 -18
  22. package/dist/components/Callout.js +1 -1
  23. package/dist/components/Card.cjs +1 -1
  24. package/dist/components/Card.d.ts +31 -16
  25. package/dist/components/Card.js +1 -1
  26. package/dist/components/Checkbox.cjs +1 -1
  27. package/dist/components/Checkbox.js +1 -1
  28. package/dist/components/CheckboxCards.cjs +1 -1
  29. package/dist/components/CheckboxCards.js +1 -1
  30. package/dist/components/CheckboxGroup.cjs +1 -1
  31. package/dist/components/CheckboxGroup.d.ts +6 -2
  32. package/dist/components/CheckboxGroup.js +1 -1
  33. package/dist/components/{CheckboxGroupPrimitive-DfHQYkep.js → CheckboxGroupPrimitive-BRCGIztp.js} +1 -1
  34. package/dist/components/{CheckboxGroupPrimitive-d9yBl6m5.cjs → CheckboxGroupPrimitive-C21WO4L3.cjs} +1 -1
  35. package/dist/components/Collapsible.cjs +1 -1
  36. package/dist/components/Collapsible.d.ts +34 -4
  37. package/dist/components/Collapsible.js +1 -1
  38. package/dist/components/Combobox.cjs +1 -1
  39. package/dist/components/Combobox.d.ts +57 -45
  40. package/dist/components/Combobox.js +1 -1
  41. package/dist/components/ComboboxPrimitive-BdX2jgpQ.js +1 -0
  42. package/dist/components/ComboboxPrimitive-CyO6ZH5T.cjs +1 -0
  43. package/dist/components/Command.cjs +1 -1
  44. package/dist/components/Command.d.ts +36 -8
  45. package/dist/components/Command.js +1 -1
  46. package/dist/components/ContextMenu.cjs +1 -1
  47. package/dist/components/ContextMenu.d.ts +25 -11
  48. package/dist/components/ContextMenu.js +1 -1
  49. package/dist/components/Dialog.cjs +1 -1
  50. package/dist/components/Dialog.d.ts +29 -4
  51. package/dist/components/Dialog.js +1 -1
  52. package/dist/components/Disclosure.cjs +1 -1
  53. package/dist/components/Disclosure.js +1 -1
  54. package/dist/components/Drawer.cjs +1 -1
  55. package/dist/components/Drawer.d.ts +31 -3
  56. package/dist/components/Drawer.js +1 -1
  57. package/dist/components/DropdownMenu.cjs +1 -1
  58. package/dist/components/DropdownMenu.d.ts +25 -11
  59. package/dist/components/DropdownMenu.js +1 -1
  60. package/dist/components/HoverCard.cjs +1 -1
  61. package/dist/components/HoverCard.d.ts +15 -1
  62. package/dist/components/HoverCard.js +1 -1
  63. package/dist/components/Label.cjs +1 -0
  64. package/dist/components/Label.d.ts +18 -0
  65. package/dist/components/Label.js +1 -0
  66. package/dist/components/Link.cjs +1 -1
  67. package/dist/components/Link.js +1 -1
  68. package/dist/components/LiveRegion.cjs +1 -1
  69. package/dist/components/LiveRegion.d.ts +2 -5
  70. package/dist/components/LiveRegion.js +1 -1
  71. package/dist/components/MenuPrimitive-Ctqo21Vd.cjs +1 -0
  72. package/dist/components/MenuPrimitive-Cy_MJfjG.js +1 -0
  73. package/dist/components/Menubar.cjs +1 -1
  74. package/dist/components/Menubar.d.ts +45 -16
  75. package/dist/components/Menubar.js +1 -1
  76. package/dist/components/Meter.cjs +1 -0
  77. package/dist/components/Meter.d.ts +44 -0
  78. package/dist/components/Meter.js +1 -0
  79. package/dist/components/Minimap.cjs +1 -1
  80. package/dist/components/Minimap.js +1 -1
  81. package/dist/components/NavigationMenu.cjs +1 -1
  82. package/dist/components/NavigationMenu.d.ts +2 -0
  83. package/dist/components/NavigationMenu.js +1 -1
  84. package/dist/components/Popover.cjs +1 -1
  85. package/dist/components/Popover.d.ts +64 -5
  86. package/dist/components/Popover.js +1 -1
  87. package/dist/components/Progress.cjs +1 -1
  88. package/dist/components/Progress.d.ts +14 -2
  89. package/dist/components/Progress.js +1 -1
  90. package/dist/components/Radio.cjs +1 -1
  91. package/dist/components/Radio.js +1 -1
  92. package/dist/components/RadioCards.cjs +1 -1
  93. package/dist/components/RadioCards.d.ts +22 -1
  94. package/dist/components/RadioCards.js +1 -1
  95. package/dist/components/RadioGroup.cjs +1 -1
  96. package/dist/components/RadioGroup.d.ts +27 -7
  97. package/dist/components/RadioGroup.js +1 -1
  98. package/dist/components/RadioGroupPrimitive-B0CrM2bi.cjs +1 -0
  99. package/dist/components/RadioGroupPrimitive-CnPy0zgW.js +1 -0
  100. package/dist/components/ScrollArea.cjs +1 -1
  101. package/dist/components/ScrollArea.d.ts +24 -13
  102. package/dist/components/ScrollArea.js +1 -1
  103. package/dist/components/Select.cjs +1 -1
  104. package/dist/components/Select.d.ts +52 -44
  105. package/dist/components/Select.js +1 -1
  106. package/dist/components/Separator.cjs +1 -1
  107. package/dist/components/Separator.d.ts +8 -1
  108. package/dist/components/Separator.js +1 -1
  109. package/dist/components/Slider.cjs +1 -1
  110. package/dist/components/Slider.js +1 -1
  111. package/dist/components/Steps.cjs +1 -1
  112. package/dist/components/Steps.d.ts +33 -16
  113. package/dist/components/Steps.js +1 -1
  114. package/dist/components/Switch.cjs +1 -1
  115. package/dist/components/Switch.d.ts +14 -2
  116. package/dist/components/Switch.js +1 -1
  117. package/dist/components/TabNav.cjs +1 -1
  118. package/dist/components/TabNav.d.ts +5 -0
  119. package/dist/components/TabNav.js +1 -1
  120. package/dist/components/Table.cjs +1 -1
  121. package/dist/components/Table.d.ts +23 -12
  122. package/dist/components/Table.js +1 -1
  123. package/dist/components/Tabs.cjs +1 -1
  124. package/dist/components/Tabs.js +1 -1
  125. package/dist/components/Theme.cjs +1 -1
  126. package/dist/components/Theme.d.ts +2 -0
  127. package/dist/components/Theme.js +1 -1
  128. package/dist/components/Toast.cjs +1 -1
  129. package/dist/components/Toast.js +1 -1
  130. package/dist/components/Toggle.cjs +1 -1
  131. package/dist/components/Toggle.js +1 -1
  132. package/dist/components/ToggleGroup.cjs +1 -1
  133. package/dist/components/ToggleGroup.js +1 -1
  134. package/dist/components/Toolbar.cjs +1 -1
  135. package/dist/components/Toolbar.d.ts +8 -1
  136. package/dist/components/Toolbar.js +1 -1
  137. package/dist/components/Tooltip.cjs +1 -1
  138. package/dist/components/Tooltip.d.ts +7 -1
  139. package/dist/components/Tooltip.js +1 -1
  140. package/dist/components/Tree.cjs +1 -1
  141. package/dist/components/Tree.d.ts +8 -1
  142. package/dist/components/Tree.js +1 -1
  143. package/dist/components/VisuallyHidden.cjs +1 -1
  144. package/dist/components/VisuallyHidden.d.ts +6 -1
  145. package/dist/components/VisuallyHidden.js +1 -1
  146. package/dist/components/{floating-ui.react-2kiGB4sW.js → floating-ui.react-CZf-mCiA.js} +1 -1
  147. package/dist/components/{index-WGIYLuwZ.cjs → index-BZO29jsF.cjs} +1 -1
  148. package/dist/components/index-B_OPdW20.js +1 -0
  149. package/dist/components/{index-436yWBk4.cjs → index-BbvJO-A-.cjs} +1 -1
  150. package/dist/components/index-Bg-UeWCo.cjs +1 -0
  151. package/dist/components/index-BidxkqdT.js +1 -0
  152. package/dist/components/{index-DMX7gpdp.js → index-CAD0hWja.js} +1 -1
  153. package/dist/components/{index-xlB--dex.js → index-CXv1Y-O3.js} +1 -1
  154. package/dist/components/{index-CukraWfT.cjs → index-C_Yiql9j.cjs} +1 -1
  155. package/dist/components/{index-nYRBURkR.js → index-Cp5L_alO.js} +1 -1
  156. package/dist/components/{index-C7dBo_Ry.js → index-D8QLtYJh.js} +1 -1
  157. package/dist/components/{index-FITGoHty.js → index-DH-14XDv.js} +1 -1
  158. package/dist/components/{index-CoPhBYnZ.cjs → index-K0sE1H4u.cjs} +1 -1
  159. package/dist/components/{index-BeakeOqt.cjs → index-rUSzFrhJ.cjs} +1 -1
  160. package/dist/index.cjs +2 -0
  161. package/dist/index.d.ts +2 -0
  162. package/dist/index.js +2 -0
  163. package/dist/styles/clarity/Accordion/accordion.clarity.scss +147 -0
  164. package/dist/styles/clarity/AlertDialog/alert-dialog.clarity.scss +199 -0
  165. package/dist/styles/clarity/Avatar/_avatar-base.clarity.scss +87 -0
  166. package/dist/styles/clarity/Avatar/avatar.clarity.scss +1 -0
  167. package/dist/styles/clarity/AvatarGroup/avatar-group.clarity.scss +122 -0
  168. package/dist/styles/clarity/Badge/badge.clarity.scss +118 -0
  169. package/dist/styles/clarity/BlockQuote/blockquote.clarity.scss +123 -0
  170. package/dist/styles/clarity/Breadcrumb/breadcrumb.clarity.scss +50 -0
  171. package/dist/styles/clarity/Button/button.clarity.scss +132 -0
  172. package/dist/styles/clarity/Callout/callout.clarity.scss +183 -0
  173. package/dist/styles/clarity/Card/card.clarity.scss +121 -0
  174. package/dist/styles/clarity/Checkbox/checkbox.clarity.scss +75 -0
  175. package/dist/styles/clarity/CheckboxCards/checkbox-cards.clarity.scss +143 -0
  176. package/dist/styles/clarity/CheckboxGroup/checkbox-group.clarity.scss +92 -0
  177. package/dist/styles/clarity/Code/code.clarity.scss +42 -0
  178. package/dist/styles/clarity/Collapsible/collapsible.clarity.scss +84 -0
  179. package/dist/styles/clarity/Combobox/combobox.clarity.scss +157 -0
  180. package/dist/styles/clarity/Command/command.clarity.scss +231 -0
  181. package/dist/styles/clarity/ContextMenu/context-menu.clarity.scss +272 -0
  182. package/dist/styles/clarity/DataList/data-list.clarity.scss +60 -0
  183. package/dist/styles/clarity/Dialog/dialog.clarity.scss +205 -0
  184. package/dist/styles/clarity/Disclosure/disclosure.clarity.scss +56 -0
  185. package/dist/styles/clarity/Drawer/drawer.clarity.scss +331 -0
  186. package/dist/styles/clarity/DropdownMenu/dropdown-menu.clarity.scss +187 -0
  187. package/dist/styles/clarity/Em/em.clarity.scss +3 -0
  188. package/dist/styles/clarity/Fieldset/fieldset.clarity.scss +49 -0
  189. package/dist/styles/clarity/Heading/heading.clarity.scss +46 -0
  190. package/dist/styles/clarity/HoverCard/hover-card.clarity.scss +43 -0
  191. package/dist/styles/clarity/Kbd/kbd.clarity.scss +55 -0
  192. package/dist/styles/clarity/Label/label.clarity.scss +11 -0
  193. package/dist/styles/clarity/Link/link.clarity.scss +41 -0
  194. package/dist/styles/clarity/Menubar/menubar.clarity.scss +149 -0
  195. package/dist/styles/clarity/Meter/meter.clarity.scss +39 -0
  196. package/dist/styles/clarity/Minimap/minimap.clarity.scss +92 -0
  197. package/dist/styles/clarity/NavigationMenu/navigation-menu.clarity.scss +128 -0
  198. package/dist/styles/clarity/NumberField/number-field.clarity.scss +135 -0
  199. package/dist/styles/clarity/Popover/popover.clarity.scss +106 -0
  200. package/dist/styles/clarity/Progress/progress.clarity.scss +38 -0
  201. package/dist/styles/clarity/Quote/quote.clarity.scss +26 -0
  202. package/dist/styles/clarity/Radio/radio.clarity.scss +76 -0
  203. package/dist/styles/clarity/RadioCards/radiocards.clarity.scss +134 -0
  204. package/dist/styles/clarity/RadioGroup/radio-group.clarity.scss +99 -0
  205. package/dist/styles/clarity/ScrollArea/scroll-area.clarity.scss +112 -0
  206. package/dist/styles/clarity/Select/select.clarity.scss +228 -0
  207. package/dist/styles/clarity/Separator/separator.clarity.scss +23 -0
  208. package/dist/styles/clarity/Skeleton/skeleton.clarity.scss +33 -0
  209. package/dist/styles/clarity/Slider/slider.clarity.scss +203 -0
  210. package/dist/styles/clarity/Spinner/spinner.clarity.scss +52 -0
  211. package/dist/styles/clarity/Splitter/splitter.clarity.scss +151 -0
  212. package/dist/styles/clarity/Steps/steps.clarity.scss +143 -0
  213. package/dist/styles/clarity/Strong/strong.clarity.scss +6 -0
  214. package/dist/styles/clarity/Switch/switch.clarity.scss +89 -0
  215. package/dist/styles/clarity/TabNav/tab-nav.clarity.scss +69 -0
  216. package/dist/styles/clarity/Table/table.clarity.scss +128 -0
  217. package/dist/styles/clarity/Tabs/tabs.clarity.scss +91 -0
  218. package/dist/styles/clarity/Text/text.clarity.scss +5 -0
  219. package/dist/styles/clarity/TextArea/textarea.clarity.scss +146 -0
  220. package/dist/styles/clarity/TextField/text-field.clarity.scss +120 -0
  221. package/dist/styles/clarity/Toast/toast.clarity.scss +203 -0
  222. package/dist/styles/clarity/Toggle/toggle.clarity.scss +51 -0
  223. package/dist/styles/clarity/ToggleGroup/toggle-group.clarity.scss +103 -0
  224. package/dist/styles/clarity/Toolbar/toolbar.clarity.scss +140 -0
  225. package/dist/styles/clarity/Tooltip/tooltip.clarity.scss +37 -0
  226. package/dist/styles/clarity/Tree/tree.clarity.scss +103 -0
  227. package/dist/themes/baremetal.css +1 -1
  228. package/dist/themes/default.css +1 -1
  229. package/package.json +21 -2
  230. package/dist/components/ComboboxPrimitive-DQcJ8pzQ.js +0 -1
  231. package/dist/components/ComboboxPrimitive-kFYDdMUS.cjs +0 -1
  232. package/dist/components/MenuPrimitive-B1-7Sfhj.cjs +0 -1
  233. package/dist/components/MenuPrimitive-D9VMz2TZ.js +0 -1
  234. package/dist/components/RadioGroupPrimitive-CpA06FS_.cjs +0 -1
  235. package/dist/components/RadioGroupPrimitive-D1PP4y2M.js +0 -1
  236. package/dist/components/index-CbKtybdA.cjs +0 -1
  237. package/dist/components/index-D8I-rMwz.js +0 -1
  238. package/dist/components/index-XF8itt-H.js +0 -1
@@ -1 +1 @@
1
- 'use client';"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("./index-CbKtybdA.cjs"),r=require("./index-BwNOI8cB.cjs"),i=require("./mergeProps-DW5qFqqJ.cjs"),o=require("./index-WGIYLuwZ.cjs"),s=require("./keyboard-BBlFllyi.cjs");const a=t.createContext(void 0),c=()=>{const e=t.useContext(a);if(!e)throw new Error("Collapsible compound components must be used within a CollapsiblePrimitive.Root component");return e},u=t.forwardRef((({children:i,defaultOpen:o=!1,open:s,onOpenChange:c,disabled:u=!1,transitionDuration:l,transitionTimingFunction:d="linear",...m},p)=>{const h=t.useId(),[f,v]=r.useControllableState(s,o,c);return e.jsx(a.Provider,{value:{open:f,onOpenChange:e=>{u||v(e)},disabled:u,contentId:h,transitionDuration:l,transitionTimingFunction:d},children:e.jsx(n.Primitive.div,{...m,ref:p,"data-state":f?"open":"closed","data-disabled":u?"":void 0,children:i})})}));u.displayName="CollapsiblePrimitiveRoot";function l(){const[e,n]=t.useState(!1);return t.useEffect((()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)"),t=e=>{n(e.matches)};return t(e),"function"==typeof e.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e.addListener(t),()=>e.removeListener(t))}),[]),e}const d=t.forwardRef((({children:r,className:o,asChild:s=!1,forceMount:a=!1,style:u,...d},m)=>{const{open:p,contentId:h,transitionDuration:f,transitionTimingFunction:v}=c(),g=l(),y=void 0!==f?f:g?0:300,[C,b]=t.useState(p?void 0:0),[P,w]=t.useState(p||a),[,x]=t.useState(0),R=t.useRef(),F=t.useRef(),E=t.useRef(null),T=t.useRef(0),q=t.useRef(0),D=t.useRef(),j=t.useRef(p||a);t.useEffect((()=>{const e=requestAnimationFrame((()=>{j.current=!1}));return()=>cancelAnimationFrame(e)}),[]),t.useLayoutEffect((()=>{R.current&&clearTimeout(R.current),F.current&&cancelAnimationFrame(F.current);const e=E.current;if(!e)return;D.current=D.current||{transitionDuration:e.style.transitionDuration,transitionProperty:e.style.transitionProperty,transitionTimingFunction:e.style.transitionTimingFunction},e.style.transitionDuration="0s",e.style.transitionProperty="none";const t=e.getBoundingClientRect(),n=t.height||e.scrollHeight,r=t.width||e.scrollWidth;return T.current=n,q.current=r,j.current||(e.style.transitionDuration=D.current.transitionDuration,e.style.transitionProperty=D.current.transitionProperty,e.style.transitionTimingFunction=D.current.transitionTimingFunction),0===y?(b(p?void 0:0),w(!(!p&&!a)),void(p&&x((e=>e+1)))):j.current&&p?(w(!0),void b(void 0)):(p?(w(!0),b(0),F.current=requestAnimationFrame((()=>{E.current,F.current=requestAnimationFrame((()=>{E.current&&b(T.current??E.current.scrollHeight)}))})),R.current=setTimeout((()=>{b(void 0)}),y)):(b(T.current??e.scrollHeight),F.current=requestAnimationFrame((()=>{E.current,F.current=requestAnimationFrame((()=>{b(0)}))})),R.current=setTimeout((()=>{a||w(!1)}),y)),()=>{R.current&&clearTimeout(R.current),F.current&&cancelAnimationFrame(F.current)})}),[p,y,a]),t.useLayoutEffect((()=>{const e=E.current;if(!e||!p||void 0!==C)return;const t=e.getBoundingClientRect(),n=t.height||e.scrollHeight,r=t.width||e.scrollWidth;n===T.current&&r===q.current||(T.current=n,q.current=r,x((e=>e+1)))}),[r,p,C]);if(!(p||P||a))return null;const A={...u,overflow:"hidden",height:void 0!==C?`${C}px`:void 0,"--radix-collapsible-content-height":void 0!==T.current?`${T.current}px`:void 0,"--radix-collapsible-content-width":void 0!==q.current?`${q.current}px`:void 0,"--rad-collapsible-content-height":void 0!==T.current?`${T.current}px`:void 0,"--rad-collapsible-content-width":void 0!==q.current?`${q.current}px`:void 0,...y>0?{transition:`height ${y}ms ${v}`}:{}},L=s&&t.isValidElement(r);return e.jsx(n.Primitive.div,{id:h,ref:i.composeRefs(m,E),"aria-hidden":!p,"data-state":p?"open":"closed",className:o,style:A,asChild:L,...d,children:r})}));d.displayName="CollapsiblePrimitiveContent";const m=t.forwardRef((({children:t,asChild:n=!1,...r},i)=>{const{open:a,onOpenChange:u,disabled:l,contentId:d}=c();return e.jsx(o.ButtonPrimitive,{...r,"aria-controls":d,"aria-expanded":a,"data-state":a?"open":"closed","data-disabled":l?"true":void 0,ref:i,onClick:e=>{r.onClick?.(e),l||u(!a)},onKeyDown:e=>{r.onKeyDown?.(e),e.defaultPrevented||e.key===s.KEYBOARD_KEYS.ESCAPE&&a&&!l&&u(!1)},asChild:n,children:t})}));m.displayName="CollapsiblePrimitiveTrigger";const p=()=>(console.warn("Direct usage of CollapsiblePrimitive is not supported. Please use CollapsiblePrimitive.Root, CollapsiblePrimitive.Content, etc. instead."),null);p.Root=u,p.Content=d,p.Trigger=m,exports.CollapsiblePrimitive=p,exports.usePrefersReducedMotion=l;
1
+ 'use client';"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("./index-Bg-UeWCo.cjs"),r=require("./index-BwNOI8cB.cjs"),i=require("./mergeProps-DW5qFqqJ.cjs"),o=require("./index-BZO29jsF.cjs"),s=require("./keyboard-BBlFllyi.cjs");const a=t.createContext(void 0),c=()=>{const e=t.useContext(a);if(!e)throw new Error("Collapsible compound components must be used within a CollapsiblePrimitive.Root component");return e},u=t.forwardRef((({children:i,defaultOpen:o=!1,open:s,onOpenChange:c,disabled:u=!1,transitionDuration:l,transitionTimingFunction:d="linear",...m},p)=>{const h=t.useId(),[f,v]=r.useControllableState(s,o,c);return e.jsx(a.Provider,{value:{open:f,onOpenChange:e=>{u||v(e)},disabled:u,contentId:h,transitionDuration:l,transitionTimingFunction:d},children:e.jsx(n.Primitive.div,{...m,ref:p,"data-state":f?"open":"closed","data-disabled":u?"":void 0,children:i})})}));u.displayName="CollapsiblePrimitiveRoot";function l(){const[e,n]=t.useState(!1);return t.useEffect((()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)"),t=e=>{n(e.matches)};return t(e),"function"==typeof e.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e.addListener(t),()=>e.removeListener(t))}),[]),e}const d=t.forwardRef((({children:r,className:o,asChild:s=!1,forceMount:a=!1,style:u,...d},m)=>{const{open:p,contentId:h,transitionDuration:f,transitionTimingFunction:v}=c(),g=l(),y=void 0!==f?f:g?0:300,[C,b]=t.useState(p?void 0:0),[P,w]=t.useState(p||a),[,x]=t.useState(0),R=t.useRef(),F=t.useRef(),E=t.useRef(null),T=t.useRef(0),q=t.useRef(0),D=t.useRef(),j=t.useRef(p||a);t.useEffect((()=>{const e=requestAnimationFrame((()=>{j.current=!1}));return()=>cancelAnimationFrame(e)}),[]),t.useLayoutEffect((()=>{R.current&&clearTimeout(R.current),F.current&&cancelAnimationFrame(F.current);const e=E.current;if(!e)return;D.current=D.current||{transitionDuration:e.style.transitionDuration,transitionProperty:e.style.transitionProperty,transitionTimingFunction:e.style.transitionTimingFunction},e.style.transitionDuration="0s",e.style.transitionProperty="none";const t=e.getBoundingClientRect(),n=t.height||e.scrollHeight,r=t.width||e.scrollWidth;return T.current=n,q.current=r,j.current||(e.style.transitionDuration=D.current.transitionDuration,e.style.transitionProperty=D.current.transitionProperty,e.style.transitionTimingFunction=D.current.transitionTimingFunction),0===y?(b(p?void 0:0),w(!(!p&&!a)),void(p&&x((e=>e+1)))):j.current&&p?(w(!0),void b(void 0)):(p?(w(!0),b(0),F.current=requestAnimationFrame((()=>{E.current,F.current=requestAnimationFrame((()=>{E.current&&b(T.current??E.current.scrollHeight)}))})),R.current=setTimeout((()=>{b(void 0)}),y)):(b(T.current??e.scrollHeight),F.current=requestAnimationFrame((()=>{E.current,F.current=requestAnimationFrame((()=>{b(0)}))})),R.current=setTimeout((()=>{a||w(!1)}),y)),()=>{R.current&&clearTimeout(R.current),F.current&&cancelAnimationFrame(F.current)})}),[p,y,a]),t.useLayoutEffect((()=>{const e=E.current;if(!e||!p||void 0!==C)return;const t=e.getBoundingClientRect(),n=t.height||e.scrollHeight,r=t.width||e.scrollWidth;n===T.current&&r===q.current||(T.current=n,q.current=r,x((e=>e+1)))}),[r,p,C]);if(!(p||P||a))return null;const A={...u,overflow:"hidden",height:void 0!==C?`${C}px`:void 0,"--radix-collapsible-content-height":void 0!==T.current?`${T.current}px`:void 0,"--radix-collapsible-content-width":void 0!==q.current?`${q.current}px`:void 0,"--rad-collapsible-content-height":void 0!==T.current?`${T.current}px`:void 0,"--rad-collapsible-content-width":void 0!==q.current?`${q.current}px`:void 0,...y>0?{transition:`height ${y}ms ${v}`}:{}},L=s&&t.isValidElement(r);return e.jsx(n.Primitive.div,{id:h,ref:i.composeRefs(m,E),"aria-hidden":!p,"data-state":p?"open":"closed",className:o,style:A,asChild:L,...d,children:r})}));d.displayName="CollapsiblePrimitiveContent";const m=t.forwardRef((({children:t,asChild:n=!1,...r},i)=>{const{open:a,onOpenChange:u,disabled:l,contentId:d}=c();return e.jsx(o.ButtonPrimitive,{...r,"aria-controls":d,"aria-expanded":a,"data-state":a?"open":"closed","data-disabled":l?"true":void 0,ref:i,onClick:e=>{r.onClick?.(e),l||u(!a)},onKeyDown:e=>{r.onKeyDown?.(e),e.defaultPrevented||e.key===s.KEYBOARD_KEYS.ESCAPE&&a&&!l&&u(!1)},asChild:n,children:t})}));m.displayName="CollapsiblePrimitiveTrigger";const p=()=>(console.warn("Direct usage of CollapsiblePrimitive is not supported. Please use CollapsiblePrimitive.Root, CollapsiblePrimitive.Content, etc. instead."),null);p.Root=u,p.Content=d,p.Trigger=m,exports.CollapsiblePrimitive=p,exports.usePrefersReducedMotion=l;
@@ -1 +1 @@
1
- 'use client';"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("./index-CbKtybdA.cjs"),n=require("./index-WGIYLuwZ.cjs"),i=require("./keyboard-BBlFllyi.cjs"),l=require("./mergeRefs-BUn-enYe.cjs");const a=t.createContext({orientation:"horizontal",loop:!0,dir:"ltr",disableTabIndexing:!1,mode:"default"}),o=new Set(["listbox","menu","menubar","radiogroup","scrollbar","select","separator","slider","tablist","toolbar","tree","treegrid"]),s=t.forwardRef((({children:n,orientation:i="horizontal",loop:l=!0,"aria-label":s,"aria-labelledby":u,disableTabIndexing:d=!1,mode:c="default",dir:f="ltr",asChild:b=!1,...m},h)=>{const g=b&&t.isValidElement(n)?n.props.role:void 0,I=m.role??g,R="both"!==i&&I&&o.has(I)?i:void 0,p={orientation:i,loop:l,disableTabIndexing:d,dir:f,mode:c};return e.jsx(a.Provider,{value:p,children:e.jsx(r.Primitive.div,{"aria-orientation":R,"aria-label":s,"aria-labelledby":u,ref:h,asChild:b,...m,children:n})})}));s.displayName="RovingFocusRoot";const u=t.createContext({focusedItemId:null,setFocusedItemId:()=>{},focusItems:[],setFocusItems:()=>{},addFocusItem:()=>{},groupRef:null,itemRefs:new Map,registerItemRef:()=>{},unregisterItemRef:()=>{}}),d=t.forwardRef((({children:o,"aria-label":s,"aria-labelledby":d,role:c,type:f,handleRightKeyDown:b,handleLeftKeyDown:m,domId:h,...g},I)=>{const R=t.useId(),p=h??R,v=t.useRef(null),{focusedItemId:y,setFocusedItemId:E,addFocusItem:x,focusItems:O,itemRefs:D,registerItemRef:C,unregisterItemRef:A}=t.useContext(u),{orientation:K,loop:F,disableTabIndexing:_,dir:Y}=t.useContext(a),w=t.Children.toArray(o)[0],N=!0===w?.props?.disabled,S="a"===("string"==typeof w?.type?w.type.toLowerCase():"")||null!=w?.props?.href,k=c??(S?void 0:"button"),P=f??(S?void 0:"button"),T=_||!N&&y===p?0:-1;t.useEffect((()=>(C(p,v),x(p),()=>{A(p)})),[p]);const j=e=>{E(e);const t=D.get(e);t?.current&&t.current.focus()},B=(e,t)=>{let r=e;for(let e=0;e<O.length;e++){if(r+=t,F)r<0&&(r=O.length-1),r>=O.length&&(r=0);else if(r<0||r>=O.length)return-1;const e=O[r],n=D.get(e);if(!n?.current)continue;if(!("true"===n.current.getAttribute("data-child-disabled")))return r}return-1},q=()=>{const e=O.indexOf(p),t=B(e,-1);-1!==t&&j(O[t])},G=()=>{const e=O.indexOf(p),t=B(e,1);-1!==t&&j(O[t])},W=S?r.Primitive.button:n.ButtonPrimitive;return e.jsx(W,{asChild:!0,onFocus:e=>{N&&e.target.blur(),N||E(p)},tabIndex:T,ref:l.mergeRefs(v,I),id:p,onKeyDown:e=>{if(!N)switch(e.key){case i.KEYBOARD_KEYS.ARROW_UP:e.preventDefault(),"vertical"!==K&&"both"!==K||q();break;case i.KEYBOARD_KEYS.ARROW_LEFT:e.preventDefault(),m&&m(),"horizontal"!==K&&"both"!==K||("rtl"===Y?G():q());break;case i.KEYBOARD_KEYS.ARROW_DOWN:e.preventDefault(),"vertical"!==K&&"both"!==K||G();break;case i.KEYBOARD_KEYS.ARROW_RIGHT:e.preventDefault(),b&&b(),"horizontal"!==K&&"both"!==K||("rtl"===Y?q():G());break;case i.KEYBOARD_KEYS.HOME:e.preventDefault(),(()=>{if(O.length>0){const e=B(-1,1);-1!==e&&j(O[e])}})();break;case i.KEYBOARD_KEYS.END:e.preventDefault(),(()=>{if(O.length>0){const e=B(O.length,-1);-1!==e&&j(O[e])}})();case i.KEYBOARD_KEYS.TAB:}},"data-child-disabled":N,role:k,type:P,"aria-disabled":N,"aria-label":s,"aria-labelledby":d,...g,children:o})}));d.displayName="RovingFocusItem";const c={Root:s,Group:({children:n,"aria-label":i,"aria-labelledby":l,asChild:a,...o})=>{const s=t.useRef(null),[d,c]=t.useState([]),[f,b]=t.useState(null),m=t.useId(),h=t.useRef(new Map),g=t.useCallback((e=>e.find((e=>{const t=h.current.get(e);return"true"!==t?.current?.getAttribute("data-child-disabled")}))??null),[]),I=t.useCallback(((e,t)=>{h.current.set(e,t)}),[]),R=t.useCallback((e=>{h.current.delete(e),c((t=>t.filter((t=>t!==e))))}),[]),p=t.useCallback((e=>{"undefined"==typeof window?c((t=>t.includes(e)?t:[...t,e])):c((t=>{if(t.includes(e))return t;const r=Array.from(h.current.entries()).filter((([,e])=>e.current));r.sort((([,e],[,t])=>{const r=e.current,n=t.current;if(!r||!n)return 0;const i=r.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0}));const n=r.map((([e])=>e));return n.length===t.length&&n.every(((e,r)=>e===t[r]))?t:n}))}),[]);t.useEffect((()=>{if(0===d.length)return void(null!==f&&b(null));const e=f?h.current.get(f):null;if(!(null!=f&&"true"!==e?.current?.getAttribute("data-child-disabled"))){const e=g(d);e!==f&&b(e)}}),[g,d,f,b]);const v={focusedItemId:f,setFocusedItemId:b,focusItems:d,setFocusItems:c,addFocusItem:p,groupRef:s,itemRefs:h.current,registerItemRef:I,unregisterItemRef:R},y=t.Children.toArray(n),E=1===y.length&&t.isValidElement(y[0])&&y[0].type!==t.Fragment,x=a??E;return e.jsx(u.Provider,{value:v,children:e.jsx(r.Primitive.div,{id:m,ref:s,role:"group","aria-label":i,"aria-labelledby":l,asChild:x,...o,children:n})})},Item:d};exports.RovingFocusGroupContext=u,exports.RovingFocusGroupUtility=c;
1
+ 'use client';"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("./index-Bg-UeWCo.cjs"),n=require("./index-BZO29jsF.cjs"),i=require("./keyboard-BBlFllyi.cjs"),l=require("./mergeRefs-BUn-enYe.cjs");const a=t.createContext({orientation:"horizontal",loop:!0,dir:"ltr",disableTabIndexing:!1,mode:"default"}),o=new Set(["listbox","menu","menubar","radiogroup","scrollbar","select","separator","slider","tablist","toolbar","tree","treegrid"]),s=t.forwardRef((({children:n,orientation:i="horizontal",loop:l=!0,"aria-label":s,"aria-labelledby":u,disableTabIndexing:d=!1,mode:c="default",dir:f="ltr",asChild:b=!1,...m},h)=>{const g=b&&t.isValidElement(n)?n.props.role:void 0,I=m.role??g,R="both"!==i&&I&&o.has(I)?i:void 0,p={orientation:i,loop:l,disableTabIndexing:d,dir:f,mode:c};return e.jsx(a.Provider,{value:p,children:e.jsx(r.Primitive.div,{"aria-orientation":R,"aria-label":s,"aria-labelledby":u,ref:h,asChild:b,...m,children:n})})}));s.displayName="RovingFocusRoot";const u=t.createContext({focusedItemId:null,setFocusedItemId:()=>{},focusItems:[],setFocusItems:()=>{},addFocusItem:()=>{},groupRef:null,itemRefs:new Map,registerItemRef:()=>{},unregisterItemRef:()=>{}}),d=t.forwardRef((({children:o,"aria-label":s,"aria-labelledby":d,role:c,type:f,handleRightKeyDown:b,handleLeftKeyDown:m,domId:h,...g},I)=>{const R=t.useId(),p=h??R,v=t.useRef(null),{focusedItemId:y,setFocusedItemId:E,addFocusItem:x,focusItems:O,itemRefs:D,registerItemRef:C,unregisterItemRef:A}=t.useContext(u),{orientation:K,loop:F,disableTabIndexing:_,dir:Y}=t.useContext(a),w=t.Children.toArray(o)[0],N=!0===w?.props?.disabled,S="a"===("string"==typeof w?.type?w.type.toLowerCase():"")||null!=w?.props?.href,k=c??(S?void 0:"button"),P=f??(S?void 0:"button"),T=_||!N&&y===p?0:-1;t.useEffect((()=>(C(p,v),x(p),()=>{A(p)})),[p]);const j=e=>{E(e);const t=D.get(e);t?.current&&t.current.focus()},B=(e,t)=>{let r=e;for(let e=0;e<O.length;e++){if(r+=t,F)r<0&&(r=O.length-1),r>=O.length&&(r=0);else if(r<0||r>=O.length)return-1;const e=O[r],n=D.get(e);if(!n?.current)continue;if(!("true"===n.current.getAttribute("data-child-disabled")))return r}return-1},q=()=>{const e=O.indexOf(p),t=B(e,-1);-1!==t&&j(O[t])},G=()=>{const e=O.indexOf(p),t=B(e,1);-1!==t&&j(O[t])},W=S?r.Primitive.button:n.ButtonPrimitive;return e.jsx(W,{asChild:!0,onFocus:e=>{N&&e.target.blur(),N||E(p)},tabIndex:T,ref:l.mergeRefs(v,I),id:p,onKeyDown:e=>{if(!N)switch(e.key){case i.KEYBOARD_KEYS.ARROW_UP:e.preventDefault(),"vertical"!==K&&"both"!==K||q();break;case i.KEYBOARD_KEYS.ARROW_LEFT:e.preventDefault(),m&&m(),"horizontal"!==K&&"both"!==K||("rtl"===Y?G():q());break;case i.KEYBOARD_KEYS.ARROW_DOWN:e.preventDefault(),"vertical"!==K&&"both"!==K||G();break;case i.KEYBOARD_KEYS.ARROW_RIGHT:e.preventDefault(),b&&b(),"horizontal"!==K&&"both"!==K||("rtl"===Y?q():G());break;case i.KEYBOARD_KEYS.HOME:e.preventDefault(),(()=>{if(O.length>0){const e=B(-1,1);-1!==e&&j(O[e])}})();break;case i.KEYBOARD_KEYS.END:e.preventDefault(),(()=>{if(O.length>0){const e=B(O.length,-1);-1!==e&&j(O[e])}})();case i.KEYBOARD_KEYS.TAB:}},"data-child-disabled":N,role:k,type:P,"aria-disabled":N,"aria-label":s,"aria-labelledby":d,...g,children:o})}));d.displayName="RovingFocusItem";const c={Root:s,Group:({children:n,"aria-label":i,"aria-labelledby":l,asChild:a,...o})=>{const s=t.useRef(null),[d,c]=t.useState([]),[f,b]=t.useState(null),m=t.useId(),h=t.useRef(new Map),g=t.useCallback((e=>e.find((e=>{const t=h.current.get(e);return"true"!==t?.current?.getAttribute("data-child-disabled")}))??null),[]),I=t.useCallback(((e,t)=>{h.current.set(e,t)}),[]),R=t.useCallback((e=>{h.current.delete(e),c((t=>t.filter((t=>t!==e))))}),[]),p=t.useCallback((e=>{"undefined"==typeof window?c((t=>t.includes(e)?t:[...t,e])):c((t=>{if(t.includes(e))return t;const r=Array.from(h.current.entries()).filter((([,e])=>e.current));r.sort((([,e],[,t])=>{const r=e.current,n=t.current;if(!r||!n)return 0;const i=r.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0}));const n=r.map((([e])=>e));return n.length===t.length&&n.every(((e,r)=>e===t[r]))?t:n}))}),[]);t.useEffect((()=>{if(0===d.length)return void(null!==f&&b(null));const e=f?h.current.get(f):null;if(!(null!=f&&"true"!==e?.current?.getAttribute("data-child-disabled"))){const e=g(d);e!==f&&b(e)}}),[g,d,f,b]);const v={focusedItemId:f,setFocusedItemId:b,focusItems:d,setFocusItems:c,addFocusItem:p,groupRef:s,itemRefs:h.current,registerItemRef:I,unregisterItemRef:R},y=t.Children.toArray(n),E=1===y.length&&t.isValidElement(y[0])&&y[0].type!==t.Fragment,x=a??E;return e.jsx(u.Provider,{value:v,children:e.jsx(r.Primitive.div,{id:m,ref:s,role:"group","aria-label":i,"aria-labelledby":l,asChild:x,...o,children:n})})},Item:d};exports.RovingFocusGroupContext=u,exports.RovingFocusGroupUtility=c;
package/dist/index.cjs CHANGED
@@ -18,6 +18,7 @@ exports.Em = require('./components/Em.cjs').default;
18
18
  exports.Heading = require('./components/Heading.cjs').default;
19
19
  exports.Text = require('./components/Text.cjs').default;
20
20
  exports.Kbd = require('./components/Kbd.cjs').default;
21
+ exports.Label = require('./components/Label.cjs').default;
21
22
  exports.LiveRegion = require('./components/LiveRegion.cjs').default;
22
23
  exports.Progress = require('./components/Progress.cjs').default;
23
24
  exports.Separator = require('./components/Separator.cjs').default;
@@ -48,6 +49,7 @@ exports.DropdownMenu = require('./components/DropdownMenu.cjs').default;
48
49
  exports.Fieldset = require('./components/Fieldset.cjs').default;
49
50
  exports.HoverCard = require('./components/HoverCard.cjs').default;
50
51
  exports.Menubar = require('./components/Menubar.cjs').default;
52
+ exports.Meter = require('./components/Meter.cjs').default;
51
53
  exports.Minimap = require('./components/Minimap.cjs').default;
52
54
  exports.NavigationMenu = require('./components/NavigationMenu.cjs').default;
53
55
  exports.NumberField = require('./components/NumberField.cjs').default;
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export { default as Em } from './components/Em.js';
15
15
  export { default as Heading } from './components/Heading.js';
16
16
  export { default as Text } from './components/Text.js';
17
17
  export { default as Kbd } from './components/Kbd.js';
18
+ export { default as Label } from './components/Label.js';
18
19
  export { default as LiveRegion } from './components/LiveRegion.js';
19
20
  export { default as Progress } from './components/Progress.js';
20
21
  export { default as Separator } from './components/Separator.js';
@@ -45,6 +46,7 @@ export { default as DropdownMenu } from './components/DropdownMenu.js';
45
46
  export { default as Fieldset } from './components/Fieldset.js';
46
47
  export { default as HoverCard } from './components/HoverCard.js';
47
48
  export { default as Menubar } from './components/Menubar.js';
49
+ export { default as Meter } from './components/Meter.js';
48
50
  export { default as Minimap } from './components/Minimap.js';
49
51
  export { default as NavigationMenu } from './components/NavigationMenu.js';
50
52
  export { default as NumberField } from './components/NumberField.js';
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ export { default as Em } from './components/Em.js';
17
17
  export { default as Heading } from './components/Heading.js';
18
18
  export { default as Text } from './components/Text.js';
19
19
  export { default as Kbd } from './components/Kbd.js';
20
+ export { default as Label } from './components/Label.js';
20
21
  export { default as LiveRegion } from './components/LiveRegion.js';
21
22
  export { default as Progress } from './components/Progress.js';
22
23
  export { default as Separator } from './components/Separator.js';
@@ -47,6 +48,7 @@ export { default as DropdownMenu } from './components/DropdownMenu.js';
47
48
  export { default as Fieldset } from './components/Fieldset.js';
48
49
  export { default as HoverCard } from './components/HoverCard.js';
49
50
  export { default as Menubar } from './components/Menubar.js';
51
+ export { default as Meter } from './components/Meter.js';
50
52
  export { default as Minimap } from './components/Minimap.js';
51
53
  export { default as NavigationMenu } from './components/NavigationMenu.js';
52
54
  export { default as NumberField } from './components/NumberField.js';
@@ -0,0 +1,147 @@
1
+ .rad-ui-accordion-root {
2
+ width: 100%;
3
+
4
+ .rad-ui-accordion-item {
5
+ border-bottom: 1px solid var(--rad-ui-border-soft);
6
+
7
+ &[data-disabled] {
8
+ opacity: 0.5;
9
+ pointer-events: none;
10
+ }
11
+
12
+ .rad-ui-accordion-header {
13
+ display: flex;
14
+ margin: 0;
15
+ }
16
+
17
+ .rad-ui-accordion-trigger {
18
+ flex: 1;
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: space-between;
22
+ gap: var(--rad-ui-spacing-4);
23
+ padding: 1rem 4px;
24
+ font-size: var(--rad-ui-component-font-size-comfortable);
25
+ font-weight: 600;
26
+ line-height: 1.4;
27
+ background-color: transparent;
28
+ color: var(--rad-ui-text-primary);
29
+ border: none;
30
+ cursor: pointer;
31
+ text-align: left;
32
+ width: 100%;
33
+
34
+ &:focus-visible {
35
+ outline: none;
36
+ box-shadow: var(--rad-ui-focus-ring-shadow-offset);
37
+ border-radius: var(--rad-ui-radius-sm);
38
+ }
39
+
40
+ &[aria-disabled="true"] {
41
+ pointer-events: none;
42
+ opacity: 0.5;
43
+ }
44
+
45
+ // Chevron icon
46
+ svg,
47
+ .rad-ui-accordion-chevron {
48
+ height: 1.125rem;
49
+ width: 1.125rem;
50
+ flex-shrink: 0;
51
+ color: var(--rad-ui-text-secondary);
52
+ transition: transform var(--rad-ui-motion-duration-normal) ease;
53
+ }
54
+ }
55
+
56
+ &[data-state="open"] {
57
+ .rad-ui-accordion-trigger {
58
+ svg,
59
+ .rad-ui-accordion-chevron {
60
+ transform: rotate(180deg);
61
+ }
62
+ }
63
+ }
64
+
65
+ .rad-ui-accordion-content {
66
+ overflow: hidden;
67
+ font-size: var(--rad-ui-component-font-size-comfortable);
68
+ line-height: 1.6;
69
+ color: var(--rad-ui-text-secondary);
70
+
71
+ .rad-ui-accordion-content-inner {
72
+ padding-bottom: 1rem;
73
+
74
+ > :first-child {
75
+ margin-top: 0;
76
+ }
77
+
78
+ > :last-child {
79
+ margin-bottom: 0;
80
+ }
81
+ }
82
+ }
83
+
84
+ /* Opt-in expand/collapse animation.
85
+ *
86
+ * The default panel animates via the inline `height` the Collapsible
87
+ * primitive sets, which works but is limited to a height tween. This
88
+ * variant uses the `grid-template-rows: 0fr -> 1fr` technique instead,
89
+ * which also fades and slides the panel in.
90
+ *
91
+ * `height: auto !important` is required, not stylistic: it overrides the
92
+ * inline height the primitive writes during its own tween. Without it the
93
+ * two animations fight and the panel snaps. Because the inline height is
94
+ * discarded, callers using this variant should pass `forceMount` so the
95
+ * panel stays mounted and the collapse can finish.
96
+ *
97
+ * The bottom spacing moves from the panel's `padding-bottom` onto its
98
+ * last child as a `margin-bottom`. Padding on the grid item does not
99
+ * collapse with a `0fr` track: the padding box still occupies 1rem, so
100
+ * the closed panel reserved a 1rem gap under the trigger. A margin on
101
+ * the child is outside the collapsed track and collapses with it. The
102
+ * base rule zeroes the last child's margin, so this has to override it;
103
+ * both selectors compile to (0,5,0) and this one is later in the file.
104
+ *
105
+ * Removed in 798f9c8f along with the `WithAnimation` story and left
106
+ * unreplaced; restored here so the story and the docs example share one
107
+ * definition. */
108
+ .rad-ui-accordion-content-animated {
109
+ height: auto !important;
110
+ display: grid;
111
+ grid-template-rows: 0fr;
112
+ transition: grid-template-rows var(--rad-ui-motion-duration-normal) ease;
113
+
114
+ .rad-ui-accordion-content-inner {
115
+ min-height: 0;
116
+ padding-bottom: 0;
117
+ transform-origin: top;
118
+ opacity: 0;
119
+ transform: translateY(-8px) scaleY(0.96);
120
+ transition: opacity var(--rad-ui-motion-duration-normal) ease, transform var(--rad-ui-motion-duration-normal) ease;
121
+
122
+ > *:last-child {
123
+ margin-bottom: 1rem;
124
+ }
125
+ }
126
+
127
+ &[data-state="open"] {
128
+ grid-template-rows: 1fr;
129
+
130
+ .rad-ui-accordion-content-inner {
131
+ opacity: 1;
132
+ transform: translateY(0) scaleY(1);
133
+ }
134
+ }
135
+
136
+ @media (prefers-reduced-motion: reduce) {
137
+ transition: none;
138
+
139
+ .rad-ui-accordion-content-inner {
140
+ opacity: 1;
141
+ transform: none;
142
+ transition: none;
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
@@ -0,0 +1,199 @@
1
+ @use '../Button/button.clarity';
2
+
3
+ %rad-ui-alert-dialog-action-skin {
4
+ @extend .rad-ui-button-root;
5
+
6
+ min-height: var(--rad-ui-control-height-md);
7
+ padding-inline: calc(var(--rad-ui-control-padding-x-md) + var(--rad-ui-density-gap-xs));
8
+ border-radius: var(--rad-ui-control-radius-lg);
9
+ font-size: calc(var(--rad-ui-font-size-2) - (var(--rad-ui-spacing-1) / 4));
10
+ font-weight: var(--rad-ui-component-font-weight-medium);
11
+ letter-spacing: -0.03em;
12
+ background-color: var(--rad-ui-surface-inverse);
13
+ color: var(--rad-ui-text-inverse);
14
+ border: var(--rad-ui-border-width-default) solid var(--rad-ui-surface-inverse);
15
+ box-shadow: var(--rad-ui-control-shadow);
16
+
17
+ &:hover {
18
+ background-color: var(--rad-ui-text-primary);
19
+ border-color: var(--rad-ui-text-primary);
20
+ }
21
+ }
22
+
23
+ %rad-ui-alert-dialog-cancel-skin {
24
+ @extend .rad-ui-button-root;
25
+
26
+ min-height: var(--rad-ui-control-height-md);
27
+ padding-inline: calc(var(--rad-ui-control-padding-x-md) + var(--rad-ui-density-gap-xs));
28
+ border-radius: var(--rad-ui-control-radius-lg);
29
+ font-size: calc(var(--rad-ui-font-size-2) - (var(--rad-ui-spacing-1) / 4));
30
+ font-weight: var(--rad-ui-component-font-weight-medium);
31
+ letter-spacing: -0.03em;
32
+ background-color: var(--rad-ui-surface-panel);
33
+ color: var(--rad-ui-text-primary);
34
+ border: var(--rad-ui-border-width-default) solid var(--rad-ui-border-soft);
35
+ box-shadow: var(--rad-ui-control-shadow);
36
+
37
+ &:hover {
38
+ background-color: var(--rad-ui-surface-subtle);
39
+ border-color: var(--rad-ui-border-default);
40
+ color: var(--rad-ui-text-primary);
41
+ }
42
+ }
43
+
44
+ .rad-ui-alert-dialog-overlay {
45
+ position: fixed;
46
+ inset: 0;
47
+ z-index: var(--rad-ui-z-index-overlay);
48
+ background-color: var(--rad-ui-overlay-scrim);
49
+ backdrop-filter: blur(var(--rad-ui-blur-lg));
50
+ overflow: hidden;
51
+ transition:
52
+ opacity var(--rad-ui-motion-duration-normal) var(--rad-ui-motion-easing-standard),
53
+ visibility var(--rad-ui-motion-duration-normal) var(--rad-ui-motion-easing-standard);
54
+
55
+ &[data-state="open"] {
56
+ opacity: 1;
57
+ visibility: visible;
58
+ }
59
+
60
+ &[data-state="closed"] {
61
+ opacity: 0;
62
+ visibility: hidden;
63
+ }
64
+ }
65
+
66
+ .rad-ui-alert-dialog-trigger {
67
+ @extend .rad-ui-button-root;
68
+
69
+ cursor: pointer;
70
+ }
71
+
72
+ .rad-ui-alert-dialog-content {
73
+ --rad-ui-alert-dialog-body-font-size: calc(var(--rad-ui-font-size-2) - (var(--rad-ui-spacing-1) / 4));
74
+ --rad-ui-alert-dialog-title-font-size-mobile: calc(var(--rad-ui-font-size-3) - (var(--rad-ui-spacing-1) / 4));
75
+ --rad-ui-alert-dialog-inline-padding: var(--rad-ui-spacing-4);
76
+ --rad-ui-alert-dialog-inline-padding-mobile: calc(var(--rad-ui-spacing-3) + var(--rad-ui-density-gap-xs));
77
+
78
+ position: fixed;
79
+ left: 50%;
80
+ top: 50%;
81
+ z-index: var(--rad-ui-z-index-portal);
82
+ width: 100%;
83
+ max-width: var(--rad-ui-overlay-width-lg);
84
+ transform: translate(-50%, -50%);
85
+ padding: var(--rad-ui-spacing-4) var(--rad-ui-alert-dialog-inline-padding) 0;
86
+ border-radius: var(--rad-ui-panel-radius-lg);
87
+ background-color: var(--rad-ui-surface-panel);
88
+ color: var(--rad-ui-text-primary);
89
+ border: var(--rad-ui-border-width-default) solid var(--rad-ui-border-default);
90
+ box-shadow: var(--rad-ui-elevation-lg-shadow);
91
+ display: flex;
92
+ flex-direction: column;
93
+ gap: 0;
94
+ overflow: hidden;
95
+ transition:
96
+ opacity var(--rad-ui-motion-duration-normal) var(--rad-ui-motion-easing-standard),
97
+ visibility var(--rad-ui-motion-duration-normal) var(--rad-ui-motion-easing-standard),
98
+ transform var(--rad-ui-motion-duration-normal) var(--rad-ui-motion-easing-standard);
99
+
100
+ &[data-state="open"] {
101
+ opacity: 1;
102
+ visibility: visible;
103
+ transform: translate(-50%, -50%) scale(1);
104
+ }
105
+
106
+ &[data-state="closed"] {
107
+ opacity: 0;
108
+ visibility: hidden;
109
+ transform: translate(-50%, -50%) scale(0.95);
110
+ }
111
+
112
+ &:focus {
113
+ outline: none;
114
+ }
115
+
116
+ // Nested child components
117
+ .rad-ui-alert-dialog-title {
118
+ font-size: var(--rad-ui-font-size-3);
119
+ font-weight: var(--rad-ui-component-font-weight-medium);
120
+ line-height: calc(var(--rad-ui-component-line-height-tight) + 0.15);
121
+ margin: 0;
122
+ margin-bottom: var(--rad-ui-spacing-2);
123
+ color: var(--rad-ui-text-primary);
124
+ letter-spacing: -0.05em;
125
+ }
126
+
127
+ .rad-ui-alert-dialog-description {
128
+ max-width: calc(var(--rad-ui-overlay-width-lg) - var(--rad-ui-spacing-12) - var(--rad-ui-size-4));
129
+ font-size: var(--rad-ui-alert-dialog-body-font-size);
130
+ font-weight: var(--rad-ui-component-font-weight-regular);
131
+ line-height: calc(var(--rad-ui-component-line-height-normal) + 0.2);
132
+ margin: 0;
133
+ margin-bottom: calc(var(--rad-ui-spacing-3) + var(--rad-ui-density-gap-xs));
134
+ color: var(--rad-ui-text-muted);
135
+ letter-spacing: -0.025em;
136
+ }
137
+
138
+ .rad-ui-alert-dialog-footer {
139
+ display: flex;
140
+ flex-direction: column-reverse;
141
+ gap: var(--rad-ui-spacing-2);
142
+ margin: 0 calc(var(--rad-ui-alert-dialog-inline-padding) * -1);
143
+ padding: calc(var(--rad-ui-spacing-3) + var(--rad-ui-density-gap-xs)) var(--rad-ui-alert-dialog-inline-padding) var(--rad-ui-spacing-4);
144
+ border-top: var(--rad-ui-border-width-default) solid var(--rad-ui-border-soft);
145
+ background-color: var(--rad-ui-surface-subtle);
146
+ border-bottom-left-radius: inherit;
147
+ border-bottom-right-radius: inherit;
148
+
149
+ @media (width > 640px) {
150
+ flex-direction: row;
151
+ justify-content: flex-end;
152
+ align-items: center;
153
+ }
154
+
155
+ .rad-ui-alert-dialog-action {
156
+ @extend %rad-ui-alert-dialog-action-skin;
157
+ }
158
+
159
+ .rad-ui-alert-dialog-cancel {
160
+ @extend %rad-ui-alert-dialog-cancel-skin;
161
+ }
162
+ }
163
+
164
+ @media (width <= 640px) {
165
+ max-width: calc(100% - 2rem);
166
+ margin: var(--rad-ui-spacing-4);
167
+ padding: calc(var(--rad-ui-spacing-3) + var(--rad-ui-density-gap-xs)) var(--rad-ui-alert-dialog-inline-padding-mobile) 0;
168
+ border-radius: calc(var(--rad-ui-panel-radius-md) + var(--rad-ui-density-gap-xs));
169
+
170
+ .rad-ui-alert-dialog-title {
171
+ font-size: var(--rad-ui-alert-dialog-title-font-size-mobile);
172
+ margin-bottom: var(--rad-ui-spacing-2);
173
+ }
174
+
175
+ .rad-ui-alert-dialog-description {
176
+ font-size: var(--rad-ui-alert-dialog-body-font-size);
177
+ margin-bottom: calc(var(--rad-ui-spacing-3) + var(--rad-ui-density-gap-xs));
178
+ }
179
+
180
+ .rad-ui-alert-dialog-footer {
181
+ margin: 0 calc(var(--rad-ui-alert-dialog-inline-padding-mobile) * -1);
182
+ padding: var(--rad-ui-spacing-3) var(--rad-ui-alert-dialog-inline-padding-mobile) var(--rad-ui-alert-dialog-inline-padding-mobile);
183
+ }
184
+
185
+ .rad-ui-alert-dialog-action,
186
+ .rad-ui-alert-dialog-cancel {
187
+ width: 100%;
188
+ }
189
+ }
190
+ }
191
+
192
+ // Standalone button styles (for when used outside of content context)
193
+ .rad-ui-alert-dialog-action {
194
+ @extend %rad-ui-alert-dialog-action-skin;
195
+ }
196
+
197
+ .rad-ui-alert-dialog-cancel {
198
+ @extend %rad-ui-alert-dialog-cancel-skin;
199
+ }
@@ -0,0 +1,87 @@
1
+ // Base avatar styles - shared between avatar and avatar-group components
2
+ .rad-ui-avatar {
3
+ position: relative;
4
+ display: flex;
5
+ height: var(--rad-ui-size-10); // h-10
6
+ width: var(--rad-ui-size-10); // w-10
7
+ flex-shrink: 0;
8
+ overflow: hidden;
9
+ border-radius: var(--rad-ui-radius-full); // rounded-full
10
+
11
+ .rad-ui-avatar-image {
12
+ aspect-ratio: 1 / 1;
13
+ height: 100%;
14
+ width: 100%;
15
+ object-fit: cover;
16
+ border-radius: inherit;
17
+
18
+ // Keep a loading/undecoded image out of the layout so the fallback is the only
19
+ // visible content until the image is ready (it still loads while hidden).
20
+ &[data-state="loading"] {
21
+ position: absolute;
22
+ inset: 0;
23
+ opacity: 0;
24
+ }
25
+ }
26
+
27
+ // Default styles (no color prop) — semantic tokens so dark theme keeps contrast vs canvas
28
+ .rad-ui-avatar-fallback {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ height: 100%;
33
+ width: 100%;
34
+ border-radius: inherit;
35
+ font-size: var(--rad-ui-font-size-2); // text-sm
36
+ line-height: var(--rad-ui-line-height-1);
37
+ font-weight: 500; // font-medium
38
+ color: var(--rad-ui-text-primary);
39
+ background-color: var(--rad-ui-surface-muted);
40
+ box-shadow: inset 0 0 0 1px var(--rad-ui-border-soft);
41
+ }
42
+
43
+ // Size variants - must come before more specific selectors
44
+ &[data-size="sm"],
45
+ &[data-size="small"] {
46
+ height: var(--rad-ui-size-8); // h-8
47
+ width: var(--rad-ui-size-8); // w-8
48
+
49
+ .rad-ui-avatar-fallback {
50
+ font-size: var(--rad-ui-font-size-1); // text-xs
51
+ }
52
+ }
53
+
54
+ &[data-size="lg"],
55
+ &[data-size="large"] {
56
+ height: var(--rad-ui-size-12); // h-12
57
+ width: var(--rad-ui-size-12); // w-12
58
+
59
+ .rad-ui-avatar-fallback {
60
+ font-size: var(--rad-ui-font-size-3); // text-base
61
+ }
62
+ }
63
+
64
+ &[data-rad-ui-has-image] {
65
+ .rad-ui-avatar-fallback {
66
+ color: var(--rad-ui-text-primary);
67
+ background-color: var(--rad-ui-surface-muted);
68
+ box-shadow: inset 0 0 0 1px var(--rad-ui-border-soft);
69
+ }
70
+ }
71
+
72
+ // Solid accent fallback: light initials on the 950 step (as Button/Badge solid).
73
+ // The 800 step cannot carry light or dark text at WCAG AA for most scales
74
+ // (gray 3.2:1 light / 3.6:1 dark, sky 1.5:1), so it is not used for text surfaces.
75
+ &[data-color]:not([data-rad-ui-has-image]) {
76
+ .rad-ui-avatar-fallback {
77
+ color: var(--rad-ui-color-accent-50);
78
+ background-color: var(--rad-ui-color-accent-950);
79
+ box-shadow: var(--rad-ui-shadow-none);
80
+ }
81
+ }
82
+
83
+ // Square variant
84
+ &[data-variant="square"] {
85
+ border-radius: var(--rad-ui-radius-sm); // rounded-md
86
+ }
87
+ }
@@ -0,0 +1 @@
1
+ @use "avatar-base.clarity";
@@ -0,0 +1,122 @@
1
+ /* stylelint-disable no-descending-specificity */
2
+ // Base avatar styles (least specific) - must come first
3
+ @use "../Avatar/avatar-base.clarity";
4
+
5
+ // Avatar group styles (more specific due to nesting)
6
+ // Note: This file has nested selectors that create specificity conflicts
7
+ // The structure is functionally correct, but stylelint can't handle the nesting properly
8
+ .rad-ui-avatar-group {
9
+ --rad-ui-avatar-group-overlap: calc(var(--rad-ui-spacing-1) + var(--rad-ui-density-gap-xs));
10
+
11
+ display: flex;
12
+ flex-direction: row;
13
+ align-items: center;
14
+
15
+ .rad-ui-avatar-group-item {
16
+ position: relative;
17
+ display: flex;
18
+ height: var(--rad-ui-size-10); // h-10
19
+ width: var(--rad-ui-size-10); // w-10
20
+ flex-shrink: 0;
21
+ overflow: hidden;
22
+ border-radius: var(--rad-ui-radius-full); // rounded-full
23
+ background-color: var(--rad-ui-surface-panel);
24
+ box-shadow: 0 0 0 var(--rad-ui-border-width-2) var(--rad-ui-surface-panel);
25
+
26
+ // Overlapping avatars with negative margin
27
+ &:not(:first-child) {
28
+ margin-left: calc(var(--rad-ui-avatar-group-overlap) * -1);
29
+ z-index: 1;
30
+ }
31
+
32
+ &:first-child {
33
+ margin-left: 0;
34
+ }
35
+
36
+ // Nested avatar components - more specific than standalone .rad-ui-avatar
37
+ .rad-ui-avatar {
38
+ height: 100%;
39
+ width: 100%;
40
+ border-radius: inherit;
41
+ }
42
+
43
+ .rad-ui-avatar-image,
44
+ .rad-ui-avatar-group-avatar {
45
+ width: 100%;
46
+ height: 100%;
47
+ object-fit: cover;
48
+ border-radius: inherit;
49
+
50
+ // Hidden (but still loading) until decoded, so the fallback is the only
51
+ // visible content while the image is pending.
52
+ &[data-state="loading"] {
53
+ position: absolute;
54
+ inset: 0;
55
+ opacity: 0;
56
+ }
57
+ }
58
+
59
+ // Default styles (no color prop) - muted appearance
60
+ .rad-ui-avatar-fallback,
61
+ .rad-ui-avatar-group-fallback {
62
+ display: flex;
63
+ align-items: center;
64
+ justify-content: center;
65
+ height: 100%;
66
+ width: 100%;
67
+ border-radius: inherit;
68
+ font-size: var(--rad-ui-font-size-2); // text-sm
69
+ line-height: var(--rad-ui-line-height-1);
70
+ font-weight: 600; // font-semibold
71
+ color: var(--rad-ui-text-primary);
72
+ background-color: var(--rad-ui-surface-muted);
73
+ }
74
+
75
+ // Item `color` prop: solid accent fallback (same recipe as Avatar).
76
+ &[data-color]:not([data-rad-ui-has-image]) {
77
+ .rad-ui-avatar-fallback,
78
+ .rad-ui-avatar-group-fallback {
79
+ color: var(--rad-ui-color-accent-50);
80
+ background-color: var(--rad-ui-color-accent-950);
81
+ }
82
+ }
83
+ }
84
+
85
+ // Size variants — mirror Avatar sizes (accepts both short and library-standard names)
86
+ &[data-size="sm"] .rad-ui-avatar-group-item,
87
+ &[data-size="small"] .rad-ui-avatar-group-item {
88
+ height: var(--rad-ui-size-8);
89
+ width: var(--rad-ui-size-8);
90
+
91
+ .rad-ui-avatar-fallback,
92
+ .rad-ui-avatar-group-fallback {
93
+ font-size: var(--rad-ui-font-size-1);
94
+ }
95
+ }
96
+
97
+ &[data-size="lg"] .rad-ui-avatar-group-item,
98
+ &[data-size="large"] .rad-ui-avatar-group-item {
99
+ height: var(--rad-ui-size-12);
100
+ width: var(--rad-ui-size-12);
101
+
102
+ .rad-ui-avatar-fallback,
103
+ .rad-ui-avatar-group-fallback {
104
+ font-size: var(--rad-ui-font-size-3);
105
+ }
106
+ }
107
+
108
+ &[data-variant="square"] .rad-ui-avatar-group-item {
109
+ border-radius: var(--rad-ui-radius-sm);
110
+ }
111
+
112
+ // Spacing variant (no overlap) - more specific
113
+ &[data-variant="spacing"] {
114
+ gap: var(--rad-ui-spacing-2);
115
+
116
+ .rad-ui-avatar-group-item {
117
+ margin-left: 0;
118
+ }
119
+ }
120
+
121
+ }
122
+ /* stylelint-enable no-descending-specificity */