@chassis-ui/react 0.3.0 → 0.4.1

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 (173) hide show
  1. package/README.md +2 -2
  2. package/dist/alert.d.ts +1 -1
  3. package/dist/alert.js +1 -1
  4. package/dist/avatar.d.ts +1 -1
  5. package/dist/avatar.js +1 -1
  6. package/dist/badge.d.ts +1 -1
  7. package/dist/breadcrumb.js +1 -1
  8. package/dist/button.d.ts +1 -1
  9. package/dist/card.d.ts +1 -1
  10. package/dist/card.js +1 -1
  11. package/dist/checkbox.d.ts +2 -2
  12. package/dist/checkbox.js +1 -1
  13. package/dist/chip.d.ts +1 -1
  14. package/dist/chunks/{Button-Cptd4Yk7.d.ts → Button-BuZ_GOHS.d.ts} +2 -2
  15. package/dist/chunks/{Link-nrd0JWlO.d.ts → Link-CKymd2ru.d.ts} +2 -2
  16. package/dist/chunks/Link-DyZyAQFj.js +2 -0
  17. package/dist/chunks/Link-DyZyAQFj.js.map +1 -0
  18. package/dist/chunks/{MenuToggle-BdQtF7FV.js → MenuToggle-7RQ0dmtZ.js} +2 -2
  19. package/dist/chunks/{MenuToggle-BdQtF7FV.js.map → MenuToggle-7RQ0dmtZ.js.map} +1 -1
  20. package/dist/chunks/alert-3kTBfWFw.js +2 -0
  21. package/dist/chunks/{alert-BXI-_qlt.js.map → alert-3kTBfWFw.js.map} +1 -1
  22. package/dist/chunks/{avatar-S3dGy6Qc.js → avatar-MklqAKcz.js} +2 -2
  23. package/dist/chunks/{avatar-S3dGy6Qc.js.map → avatar-MklqAKcz.js.map} +1 -1
  24. package/dist/chunks/{breadcrumb-s6J9itez.js → breadcrumb-CHxTiZLt.js} +2 -2
  25. package/dist/chunks/{breadcrumb-s6J9itez.js.map → breadcrumb-CHxTiZLt.js.map} +1 -1
  26. package/dist/chunks/breakpoints-CGk8szzR.js +2 -0
  27. package/dist/chunks/breakpoints-CGk8szzR.js.map +1 -0
  28. package/dist/chunks/breakpoints-ECy4lKQT.d.ts +6 -0
  29. package/dist/chunks/card-CTP9K8xG.js +2 -0
  30. package/dist/chunks/card-CTP9K8xG.js.map +1 -0
  31. package/dist/chunks/{checkbox-ChACalAw.js → checkbox-ZyQn5Ku5.js} +2 -2
  32. package/dist/chunks/{checkbox-ChACalAw.js.map → checkbox-ZyQn5Ku5.js.map} +1 -1
  33. package/dist/chunks/colorClassNames-CEh5Yzfp.js +2 -0
  34. package/dist/chunks/colorClassNames-CEh5Yzfp.js.map +1 -0
  35. package/dist/chunks/datagrid-DOYxx0sF.js +3 -0
  36. package/dist/chunks/datagrid-DOYxx0sF.js.map +1 -0
  37. package/dist/chunks/flex-B52oLCCC.js +2 -0
  38. package/dist/chunks/flex-B52oLCCC.js.map +1 -0
  39. package/dist/chunks/grid-C7tO-ppc.js +2 -0
  40. package/dist/chunks/grid-C7tO-ppc.js.map +1 -0
  41. package/dist/chunks/{index-Bm2NpgND.d.ts → index-0jbACjYQ.d.ts} +2 -2
  42. package/dist/chunks/{index-D9PZHY_I.d.ts → index-B19ZH3fm.d.ts} +2 -2
  43. package/dist/chunks/{index-COsIPd8L.d.ts → index-B1kw0jzM.d.ts} +2 -2
  44. package/dist/chunks/{index-e7SJkI_m.d.ts → index-BLS1jhSJ.d.ts} +2 -2
  45. package/dist/chunks/{index-DjrEvKd-.d.ts → index-BMkbJVHg.d.ts} +2 -2
  46. package/dist/chunks/{index-t_x6jj7l.d.ts → index-BOx8v-oT.d.ts} +2 -2
  47. package/dist/chunks/index-BSLneLYu.d.ts +79 -0
  48. package/dist/chunks/{index-BnR7wjax.d.ts → index-BfEJYF4c.d.ts} +2 -2
  49. package/dist/chunks/{index-CRfm7W6C.d.ts → index-C9gzVqwX.d.ts} +2 -2
  50. package/dist/chunks/{index-DjXRq-n3.d.ts → index-CHQR8x8_.d.ts} +6 -12
  51. package/dist/chunks/{index-BTTeKpiE.d.ts → index-CIwzgZJi.d.ts} +2 -2
  52. package/dist/chunks/{index-I-H3VJ-L.d.ts → index-CYvVmTPR.d.ts} +4 -4
  53. package/dist/chunks/{index-qMq_-GY2.d.ts → index-CjT_4IZx.d.ts} +3 -3
  54. package/dist/chunks/index-CxjNw4ss.d.ts +216 -0
  55. package/dist/chunks/{index-DgHvXzVh.d.ts → index-DHcztR18.d.ts} +3 -3
  56. package/dist/chunks/{index-DXjbI7Yv.d.ts → index-DM01FX3a.d.ts} +3 -3
  57. package/dist/chunks/{index-CYgBmZ8w.d.ts → index-DP5xugE-.d.ts} +2 -2
  58. package/dist/chunks/{index-FKh7iFQE.d.ts → index-DPCwFiJL.d.ts} +2 -2
  59. package/dist/chunks/{index-DJr_ZK4b.d.ts → index-DQImhbhy.d.ts} +2 -2
  60. package/dist/chunks/{index-CJXKl97l.d.ts → index-DtvHH_Mb.d.ts} +2 -2
  61. package/dist/chunks/{index-CJzKu7QI.d.ts → index-Dzga1f4w.d.ts} +3 -3
  62. package/dist/chunks/{index-CKx1KHED.d.ts → index-NGgDkhyn.d.ts} +18 -25
  63. package/dist/chunks/{index-Dfy1YW5j.d.ts → index-U27Ar174.d.ts} +2 -2
  64. package/dist/chunks/{index-CsMIgBsd.d.ts → index-YJ9QdBuq.d.ts} +9 -10
  65. package/dist/chunks/{index-Dh5CaHTP.d.ts → index-aRdgpeRb.d.ts} +2 -2
  66. package/dist/chunks/{index-BO9jLOIb.d.ts → index-lSPcxiii.d.ts} +2 -2
  67. package/dist/chunks/{index-DceCODH9.d.ts → index-x0vZRyoU.d.ts} +2 -2
  68. package/dist/chunks/{list-BQCkwWjF.js → list-07e2a1Ym.js} +2 -2
  69. package/dist/chunks/{list-BQCkwWjF.js.map → list-07e2a1Ym.js.map} +1 -1
  70. package/dist/chunks/{menu-98EAD9nj.js → menu-Upf6P-2P.js} +2 -2
  71. package/dist/chunks/{menu-98EAD9nj.js.map → menu-Upf6P-2P.js.map} +1 -1
  72. package/dist/chunks/{nav-TiZuTHC6.js → nav-DI6oEULI.js} +2 -2
  73. package/dist/chunks/{nav-TiZuTHC6.js.map → nav-DI6oEULI.js.map} +1 -1
  74. package/dist/chunks/{nav-overflow-Ay5mM5Gc.js → nav-overflow-DlLer6EK.js} +2 -2
  75. package/dist/chunks/{nav-overflow-Ay5mM5Gc.js.map → nav-overflow-DlLer6EK.js.map} +1 -1
  76. package/dist/chunks/{notification-Ds24wnPq.js → notification-Dbci5Ka3.js} +2 -2
  77. package/dist/chunks/{notification-Ds24wnPq.js.map → notification-Dbci5Ka3.js.map} +1 -1
  78. package/dist/chunks/pagination-BREQp-ZC.js +2 -0
  79. package/dist/chunks/{pagination-BkOquk-x.js.map → pagination-BREQp-ZC.js.map} +1 -1
  80. package/dist/chunks/placeholder-DhNpUJqv.js +2 -0
  81. package/dist/chunks/placeholder-DhNpUJqv.js.map +1 -0
  82. package/dist/chunks/progress-BqgWezdG.js +2 -0
  83. package/dist/chunks/progress-BqgWezdG.js.map +1 -0
  84. package/dist/chunks/{radio-DOFYCfJi.js → radio-B6gJdtoN.js} +2 -2
  85. package/dist/chunks/{radio-DOFYCfJi.js.map → radio-B6gJdtoN.js.map} +1 -1
  86. package/dist/chunks/{renderFormCheck-DZh_5Df8.d.ts → renderFormCheck-nKgpa_a3.d.ts} +2 -2
  87. package/dist/chunks/skeleton-Bjv9gGd3.js +2 -0
  88. package/dist/chunks/skeleton-Bjv9gGd3.js.map +1 -0
  89. package/dist/chunks/spacingClassName-DVhk8m3P.js.map +1 -1
  90. package/dist/chunks/spinner-DBuvQvMR.js +2 -0
  91. package/dist/chunks/spinner-DBuvQvMR.js.map +1 -0
  92. package/dist/chunks/stack-DK5F53VT.js +2 -0
  93. package/dist/chunks/stack-DK5F53VT.js.map +1 -0
  94. package/dist/chunks/static-table-uu297Liz.js +2 -0
  95. package/dist/chunks/{static-table-D0M4oc_t.js.map → static-table-uu297Liz.js.map} +1 -1
  96. package/dist/chunks/{table-Cy6uEuEP.js → table-DPLOygg0.js} +2 -2
  97. package/dist/chunks/{table-Cy6uEuEP.js.map → table-DPLOygg0.js.map} +1 -1
  98. package/dist/chunks/tableClassName-DleBjOj2.js +2 -0
  99. package/dist/chunks/tableClassName-DleBjOj2.js.map +1 -0
  100. package/dist/chunks/{types-CS_40Txv.d.ts → types-D6FM7bYR.d.ts} +16 -2
  101. package/dist/close-button.d.ts +1 -1
  102. package/dist/datagrid.d.ts +1 -1
  103. package/dist/datagrid.js +1 -1
  104. package/dist/flex.d.ts +1 -1
  105. package/dist/flex.js +1 -1
  106. package/dist/grid.d.ts +2 -2
  107. package/dist/grid.js +1 -1
  108. package/dist/index.d.ts +32 -32
  109. package/dist/index.js +1 -1
  110. package/dist/link.d.ts +1 -1
  111. package/dist/link.js +1 -1
  112. package/dist/list.d.ts +1 -1
  113. package/dist/list.js +1 -1
  114. package/dist/menu.d.ts +1 -1
  115. package/dist/menu.js +1 -1
  116. package/dist/nav-overflow.d.ts +1 -1
  117. package/dist/nav-overflow.js +1 -1
  118. package/dist/nav.d.ts +1 -1
  119. package/dist/nav.js +1 -1
  120. package/dist/navbar.d.ts +1 -1
  121. package/dist/notification.d.ts +1 -1
  122. package/dist/notification.js +1 -1
  123. package/dist/pagination.js +1 -1
  124. package/dist/placeholder.d.ts +1 -1
  125. package/dist/placeholder.js +1 -1
  126. package/dist/progress.d.ts +1 -1
  127. package/dist/progress.js +1 -1
  128. package/dist/radio.d.ts +1 -1
  129. package/dist/radio.js +1 -1
  130. package/dist/skeleton.d.ts +1 -1
  131. package/dist/skeleton.js +1 -1
  132. package/dist/spinner.d.ts +1 -1
  133. package/dist/spinner.js +1 -1
  134. package/dist/stack.d.ts +1 -1
  135. package/dist/stack.js +1 -1
  136. package/dist/static-table.d.ts +1 -1
  137. package/dist/static-table.js +1 -1
  138. package/dist/stepper.d.ts +1 -1
  139. package/dist/switch.d.ts +1 -1
  140. package/dist/table.d.ts +1 -1
  141. package/dist/table.js +1 -1
  142. package/dist/toast.d.ts +1 -1
  143. package/package.json +4 -4
  144. package/dist/chunks/Link-CZsWCnQb.js +0 -2
  145. package/dist/chunks/Link-CZsWCnQb.js.map +0 -1
  146. package/dist/chunks/alert-BXI-_qlt.js +0 -2
  147. package/dist/chunks/breakpoints-CJ-498B7.d.ts +0 -7
  148. package/dist/chunks/breakpoints-o_2Ev7ir.js +0 -2
  149. package/dist/chunks/breakpoints-o_2Ev7ir.js.map +0 -1
  150. package/dist/chunks/card-YXn3bj_d.js +0 -2
  151. package/dist/chunks/card-YXn3bj_d.js.map +0 -1
  152. package/dist/chunks/datagrid-CH3Cy-q7.js +0 -3
  153. package/dist/chunks/datagrid-CH3Cy-q7.js.map +0 -1
  154. package/dist/chunks/flex-CmlJbKVj.js +0 -2
  155. package/dist/chunks/flex-CmlJbKVj.js.map +0 -1
  156. package/dist/chunks/grid-DK_vxz-4.js +0 -2
  157. package/dist/chunks/grid-DK_vxz-4.js.map +0 -1
  158. package/dist/chunks/index-CVUMS0x7.d.ts +0 -74
  159. package/dist/chunks/index-RHJhkSY-.d.ts +0 -273
  160. package/dist/chunks/pagination-BkOquk-x.js +0 -2
  161. package/dist/chunks/placeholder-BCr83sUn.js +0 -2
  162. package/dist/chunks/placeholder-BCr83sUn.js.map +0 -1
  163. package/dist/chunks/progress-zWkTltor.js +0 -2
  164. package/dist/chunks/progress-zWkTltor.js.map +0 -1
  165. package/dist/chunks/skeleton-BrD2JwNx.js +0 -2
  166. package/dist/chunks/skeleton-BrD2JwNx.js.map +0 -1
  167. package/dist/chunks/spinner-DblhvrHL.js +0 -2
  168. package/dist/chunks/spinner-DblhvrHL.js.map +0 -1
  169. package/dist/chunks/stack-CsMiQbpq.js +0 -2
  170. package/dist/chunks/stack-CsMiQbpq.js.map +0 -1
  171. package/dist/chunks/static-table-D0M4oc_t.js +0 -2
  172. package/dist/chunks/tableClassName-CZA2Bse8.js +0 -2
  173. package/dist/chunks/tableClassName-CZA2Bse8.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"notification-Ds24wnPq.js","names":[],"sources":["../../src/components/notification/context.ts","../../src/hooks/useNotification.ts","../../src/components/notification/NotificationText.tsx","../../src/components/notification/NotificationTitle.tsx","../../src/components/notification/Notification.tsx","../../src/components/notification/NotificationIcon.tsx","../../src/components/notification/notificationQueue.ts","../../src/components/notification/NotificationStack.tsx"],"sourcesContent":["import { createContext } from 'react'\n\nexport interface NotificationContextProps {\n /**\n * Whether the notification is currently visible.\n */\n visible?: boolean\n /**\n * Dismisses the notification. Wire this to any element's `onClick` — see `useNotification`.\n */\n close: () => void\n}\n\nexport const NotificationContext = createContext<NotificationContextProps>({ close: () => {} })\n","import { useContext } from 'react'\nimport { NotificationContext, NotificationContextProps } from '../components/notification/context'\n\nexport type UseNotificationResult = NotificationContextProps\n\n// Reach the enclosing `Notification`'s dismiss handler from anywhere in its composed markup —\n// e.g. to close it from a plain `Button` placed alongside other `actions`, instead of the\n// built-in `dismissible` close button. Only meaningful inside a `Notification`; outside one it\n// returns a no-op `close`.\nexport const useNotification = (): UseNotificationResult => useContext(NotificationContext)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype NotificationTextOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type NotificationTextProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n NotificationTextOwnProps<C>\n>\n\ntype NotificationTextComponent = (<C extends ElementType = 'div'>(\n props: NotificationTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NotificationTextRender<C extends ElementType = 'div'>(\n { children, component, className, ...rest }: NotificationTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('notification-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NotificationText = createPolymorphicComponent<NotificationTextComponent>(\n NotificationTextRender as ForwardRefRenderFunction<Element, NotificationTextProps<ElementType>>,\n 'NotificationText'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype NotificationTitleOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type NotificationTitleProps<C extends ElementType = 'h4'> = PolymorphicComponentProps<\n C,\n NotificationTitleOwnProps<C>\n>\n\ntype NotificationTitleComponent = (<C extends ElementType = 'h4'>(\n props: NotificationTitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NotificationTitleRender<C extends ElementType = 'h4'>(\n { children, className, component, ...rest }: NotificationTitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'h4'\n const _className = classNames('notification-title', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NotificationTitle = createPolymorphicComponent<NotificationTitleComponent>(\n NotificationTitleRender as ForwardRefRenderFunction<Element, NotificationTitleProps<ElementType>>,\n 'NotificationTitle'\n)\n","import React, { ElementType, forwardRef, HTMLAttributes, ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { ContextColor } from '../../types'\nimport { CloseButton } from '../close-button/CloseButton'\nimport { useAutoDismiss, useDismissibleTransition } from '../../hooks'\nimport { NotificationContext } from './context'\nimport { ResolvedIcon } from '../../utils/iconSlot'\nimport { NotificationText } from './NotificationText'\nimport { NotificationTitle } from './NotificationTitle'\nimport './Notification.scss'\n\nexport interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /**\n * Optional trailing content — e.g. a row of `Button`s — rendered after `text`/`children`.\n */\n actions?: ReactNode\n /**\n * Automatically dismiss the notification after `delay`. The timer pauses while the pointer\n * or focus is on the notification, and only starts once the notification is visible.\n * Defaults to `false` — unlike `Toast`, notifications are persistent banners by default.\n */\n autohide?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Overrides the dismiss button's accessible name (defaults to `'Close'`). Set this for\n * non-English UIs.\n */\n closeLabel?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Whether the notification is shown when it first renders. Such a notification is\n * uncontrolled: its close button and the `autohide` timer hide it. Use `visible` to show and\n * hide it from outside.\n *\n * @default true\n */\n defaultVisible?: boolean\n /**\n * Delay in ms before an `autohide` notification dismisses itself.\n */\n delay?: number\n /**\n * Optionally add a close button to the notification and allow it to self dismiss.\n */\n dismissible?: boolean\n /**\n * Leading icon. A string is an icon name, rendered like `<NotificationIcon name={icon} />` (or\n * by `IconProvider`'s `component`); pass any other\n * node for a fully custom icon. Automatically top-aligns with `title` when both are set —\n * a custom icon node is responsible for its own alignment.\n */\n icon?: string | ReactNode\n /**\n * Applies the solid context style to the notification.\n */\n solid?: boolean\n /**\n * Message body, rendered via a single `<NotificationText>`. For multi-block content, compose\n * `children` manually instead — `text` wraps everything in one element.\n */\n text?: ReactNode\n /**\n * Heading, rendered via `<NotificationTitle>`.\n */\n title?: ReactNode\n /**\n * Element or component used for the `title` heading. Passed through to `NotificationTitle`'s\n * own `component` prop. Defaults to `'h4'`.\n */\n titleComponent?: ElementType\n /**\n * Callback fired once the notification has hidden: after its exit transition.\n */\n onClose?: () => void\n /**\n * Callback fired when the notification starts to show.\n */\n onShow?: () => void\n /**\n * Callback fired with `false` when the notification asks to hide: its close button, `close`\n * from `useNotification`, or the `autohide` timer. With `visible` set, the notification hides\n * only when `visible` becomes `false`.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * ARIA live-region role. Use `status` (the default) for confirmation, progress, and\n * informational messages, which announce politely. Use `alert` for messages that need\n * immediate attention — validation errors, failed operations — which interrupt speech.\n */\n role?: 'status' | 'alert'\n /**\n * Whether the notification is shown. Setting it makes the notification controlled: it hides\n * only when this becomes `false`, so pair it with `onVisibleChange`. Left unset, the\n * notification is shown and hides itself (see `defaultVisible`).\n */\n visible?: boolean\n}\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n actions,\n autohide = false,\n children,\n className,\n closeLabel = 'Close',\n color = 'primary',\n defaultVisible = true,\n delay = 5000,\n dismissible,\n icon,\n solid,\n text,\n title,\n titleComponent = 'h4',\n role = 'status',\n visible,\n onClose,\n onShow,\n onVisibleChange,\n ...rest\n },\n ref\n ) => {\n const {\n close,\n entered,\n forkedRef,\n isMounted,\n textId,\n titleId,\n transitionClass,\n visible: _visible\n } = useDismissibleTransition({\n defaultVisible,\n displayName: 'Notification',\n onClose,\n onShow,\n onVisibleChange,\n ref,\n visible\n })\n\n // Gated on `entered`, not just `_visible` (see `Toast`'s identical comment) — the entrance\n // transition finishing is what `autohide`'s JSDoc means by \"the timer starts once the\n // notification is visible\".\n const autoDismissProps = useAutoDismiss({\n enabled: autohide,\n delay,\n visible: _visible && entered,\n onHide: close\n })\n\n const _className = classNames(\n 'notification',\n 'fade',\n color,\n {\n solid\n },\n className\n )\n\n if (!isMounted) return null\n\n return (\n <NotificationContext.Provider value={{ visible: _visible, close }}>\n <div\n className={classNames(_className, transitionClass)}\n role={role}\n aria-labelledby={title ? titleId : undefined}\n aria-describedby={title && text ? textId : undefined}\n {...mergeProps(rest, autoDismissProps)}\n ref={forkedRef}\n >\n {icon &&\n (typeof icon === 'string' ? (\n <ResolvedIcon\n value={icon}\n className={classNames('notification-icon', { 'align-self-start': !!title })}\n />\n ) : (\n icon\n ))}\n {title && (\n <NotificationTitle id={titleId} component={titleComponent}>\n {title}\n </NotificationTitle>\n )}\n {text && <NotificationText id={textId}>{text}</NotificationText>}\n {children}\n {actions}\n {dismissible && <CloseButton label={closeLabel} onClick={close} />}\n </div>\n </NotificationContext.Provider>\n )\n }\n)\n\nNotification.displayName = 'Notification'\n","import React, { forwardRef } from 'react'\nimport classNames from 'classnames'\n\nimport { Icon, IconProps } from '../icon/Icon'\n\nexport type NotificationIconProps = IconProps & {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n}\n\nexport const NotificationIcon = forwardRef<HTMLSpanElement | SVGSVGElement, NotificationIconProps>(\n ({ className, ...rest }, ref) => {\n const _className = classNames('notification-icon', className)\n\n return <Icon className={_className} {...rest} ref={ref} />\n }\n)\n\nNotificationIcon.displayName = 'NotificationIcon'\n","import { ReactNode } from 'react'\nimport { ToastQueue } from 'react-stately'\n\nimport { NotificationProps } from './Notification'\n\nexport interface NotificationContent extends Pick<\n NotificationProps,\n | 'actions'\n | 'autohide'\n | 'closeLabel'\n | 'color'\n | 'delay'\n | 'dismissible'\n | 'icon'\n | 'role'\n | 'solid'\n | 'text'\n | 'title'\n | 'titleComponent'\n> {\n /**\n * Content of the notification. Compose manually (typically a `NotificationIcon`/\n * `NotificationTitle`/`NotificationText`), or leave empty and use the `icon`/`title`/`text`\n * shorthand options instead.\n */\n children?: ReactNode\n}\n\n// The queue backing `NotificationStack` — a module-level singleton so `addNotification()` is\n// callable from anywhere (an event handler, an async callback) without threading a `push` prop\n// through render. `NotificationStack` subscribes to it via `useToastQueue`; nothing renders\n// until a `<NotificationStack />` is actually mounted somewhere to display the queue's contents.\nexport const notificationQueue = new ToastQueue<NotificationContent>()\n\n// Adds a notification to the queue. Returns the notification's key, which can be passed to\n// `closeNotification` to dismiss it programmatically. `children` is optional — omit it for a\n// notification composed entirely from the `icon`/`title`/`text` shorthand options.\nexport function addNotification(\n children?: ReactNode,\n options: Omit<NotificationContent, 'children'> = {}\n): string {\n return notificationQueue.add({ children, ...options })\n}\n\n// Removes a queued notification immediately, bypassing its own exit animation.\nexport function closeNotification(key: string): void {\n notificationQueue.close(key)\n}\n","import React, { forwardRef, HTMLAttributes } from 'react'\n\nimport { useToastRegionQueue } from '../../hooks'\nimport { Stack } from '../stack'\nimport { Notification } from './Notification'\nimport { notificationQueue } from './notificationQueue'\n\nexport interface NotificationStackProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Queued notifications show newest-first by default — the typical toast pattern. Set\n * `reverse` for a chronological transcript instead, oldest-first.\n */\n reverse?: boolean\n}\n\n// Renders the shared `notificationQueue` (see `notificationQueue.ts` — `addNotification()` is\n// how notifications get added to it from anywhere in the app) plus any statically-passed\n// `children`, e.g. a permanently pinned notification alongside dynamic ones — the same static\n// children still render with nothing queued, so this doubles as a plain grouping/spacing\n// wrapper for hand-placed notifications. Unlike `Toaster`, this always renders in normal\n// document flow rather than a fixed/portaled overlay — Chassis notifications are in-page\n// banners, not floating toasts.\nexport const NotificationStack = forwardRef<HTMLDivElement, NotificationStackProps>(\n ({ children, className, reverse, ...rest }, ref) => {\n const { forkedRef, regionProps, state } = useToastRegionQueue(notificationQueue, ref)\n\n if (state.visibleToasts.length === 0 && !children) {\n return null\n }\n\n // The queue is already newest-first (each add unshifts); `reverse` opts into chronological\n // order instead.\n const queued = reverse ? [...state.visibleToasts].reverse() : state.visibleToasts\n\n return (\n <Stack\n direction=\"vertical\"\n gap=\"sm\"\n className={className}\n {...regionProps}\n {...rest}\n ref={forkedRef}\n >\n {children}\n {queued.map((item) => {\n const { children: notificationChildren, ...notificationProps } = item.content\n return (\n <Notification\n key={item.key}\n {...notificationProps}\n onClose={() => state.close(item.key)}\n >\n {notificationChildren}\n </Notification>\n )\n })}\n </Stack>\n )\n }\n)\n\nNotificationStack.displayName = 'NotificationStack'\n"],"mappings":"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"}
1
+ {"version":3,"file":"notification-Dbci5Ka3.js","names":[],"sources":["../../src/components/notification/context.ts","../../src/hooks/useNotification.ts","../../src/components/notification/NotificationText.tsx","../../src/components/notification/NotificationTitle.tsx","../../src/components/notification/Notification.tsx","../../src/components/notification/NotificationIcon.tsx","../../src/components/notification/notificationQueue.ts","../../src/components/notification/NotificationStack.tsx"],"sourcesContent":["import { createContext } from 'react'\n\nexport interface NotificationContextProps {\n /**\n * Whether the notification is currently visible.\n */\n visible?: boolean\n /**\n * Dismisses the notification. Wire this to any element's `onClick` — see `useNotification`.\n */\n close: () => void\n}\n\nexport const NotificationContext = createContext<NotificationContextProps>({ close: () => {} })\n","import { useContext } from 'react'\nimport { NotificationContext, NotificationContextProps } from '../components/notification/context'\n\nexport type UseNotificationResult = NotificationContextProps\n\n// Reach the enclosing `Notification`'s dismiss handler from anywhere in its composed markup —\n// e.g. to close it from a plain `Button` placed alongside other `actions`, instead of the\n// built-in `dismissible` close button. Only meaningful inside a `Notification`; outside one it\n// returns a no-op `close`.\nexport const useNotification = (): UseNotificationResult => useContext(NotificationContext)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype NotificationTextOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type NotificationTextProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n NotificationTextOwnProps<C>\n>\n\ntype NotificationTextComponent = (<C extends ElementType = 'div'>(\n props: NotificationTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NotificationTextRender<C extends ElementType = 'div'>(\n { children, component, className, ...rest }: NotificationTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('notification-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NotificationText = createPolymorphicComponent<NotificationTextComponent>(\n NotificationTextRender as ForwardRefRenderFunction<Element, NotificationTextProps<ElementType>>,\n 'NotificationText'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype NotificationTitleOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type NotificationTitleProps<C extends ElementType = 'h4'> = PolymorphicComponentProps<\n C,\n NotificationTitleOwnProps<C>\n>\n\ntype NotificationTitleComponent = (<C extends ElementType = 'h4'>(\n props: NotificationTitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NotificationTitleRender<C extends ElementType = 'h4'>(\n { children, className, component, ...rest }: NotificationTitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'h4'\n const _className = classNames('notification-title', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NotificationTitle = createPolymorphicComponent<NotificationTitleComponent>(\n NotificationTitleRender as ForwardRefRenderFunction<Element, NotificationTitleProps<ElementType>>,\n 'NotificationTitle'\n)\n","import React, { ElementType, forwardRef, HTMLAttributes, ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { ContextColor } from '../../types'\nimport { CloseButton } from '../close-button/CloseButton'\nimport { useAutoDismiss, useDismissibleTransition } from '../../hooks'\nimport { NotificationContext } from './context'\nimport { ResolvedIcon } from '../../utils/iconSlot'\nimport { NotificationText } from './NotificationText'\nimport { NotificationTitle } from './NotificationTitle'\nimport './Notification.scss'\n\nexport interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /**\n * Optional trailing content — e.g. a row of `Button`s — rendered after `text`/`children`.\n */\n actions?: ReactNode\n /**\n * Automatically dismiss the notification after `delay`. The timer pauses while the pointer\n * or focus is on the notification, and only starts once the notification is visible.\n * Defaults to `false` — unlike `Toast`, notifications are persistent banners by default.\n */\n autohide?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Overrides the dismiss button's accessible name (defaults to `'Close'`). Set this for\n * non-English UIs.\n */\n closeLabel?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Whether the notification is shown when it first renders. Such a notification is\n * uncontrolled: its close button and the `autohide` timer hide it. Use `visible` to show and\n * hide it from outside.\n *\n * @default true\n */\n defaultVisible?: boolean\n /**\n * Delay in ms before an `autohide` notification dismisses itself.\n */\n delay?: number\n /**\n * Optionally add a close button to the notification and allow it to self dismiss.\n */\n dismissible?: boolean\n /**\n * Leading icon. A string is an icon name, rendered like `<NotificationIcon name={icon} />` (or\n * by `IconProvider`'s `component`); pass any other\n * node for a fully custom icon. Automatically top-aligns with `title` when both are set —\n * a custom icon node is responsible for its own alignment.\n */\n icon?: string | ReactNode\n /**\n * Applies the solid context style to the notification.\n */\n solid?: boolean\n /**\n * Message body, rendered via a single `<NotificationText>`. For multi-block content, compose\n * `children` manually instead — `text` wraps everything in one element.\n */\n text?: ReactNode\n /**\n * Heading, rendered via `<NotificationTitle>`.\n */\n title?: ReactNode\n /**\n * Element or component used for the `title` heading. Passed through to `NotificationTitle`'s\n * own `component` prop. Defaults to `'h4'`.\n */\n titleComponent?: ElementType\n /**\n * Callback fired once the notification has hidden: after its exit transition.\n */\n onClose?: () => void\n /**\n * Callback fired when the notification starts to show.\n */\n onShow?: () => void\n /**\n * Callback fired with `false` when the notification asks to hide: its close button, `close`\n * from `useNotification`, or the `autohide` timer. With `visible` set, the notification hides\n * only when `visible` becomes `false`.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * ARIA live-region role. Use `status` (the default) for confirmation, progress, and\n * informational messages, which announce politely. Use `alert` for messages that need\n * immediate attention — validation errors, failed operations — which interrupt speech.\n */\n role?: 'status' | 'alert'\n /**\n * Whether the notification is shown. Setting it makes the notification controlled: it hides\n * only when this becomes `false`, so pair it with `onVisibleChange`. Left unset, the\n * notification is shown and hides itself (see `defaultVisible`).\n */\n visible?: boolean\n}\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n actions,\n autohide = false,\n children,\n className,\n closeLabel = 'Close',\n color = 'primary',\n defaultVisible = true,\n delay = 5000,\n dismissible,\n icon,\n solid,\n text,\n title,\n titleComponent = 'h4',\n role = 'status',\n visible,\n onClose,\n onShow,\n onVisibleChange,\n ...rest\n },\n ref\n ) => {\n const {\n close,\n entered,\n forkedRef,\n isMounted,\n textId,\n titleId,\n transitionClass,\n visible: _visible\n } = useDismissibleTransition({\n defaultVisible,\n displayName: 'Notification',\n onClose,\n onShow,\n onVisibleChange,\n ref,\n visible\n })\n\n // Gated on `entered`, not just `_visible` (see `Toast`'s identical comment) — the entrance\n // transition finishing is what `autohide`'s JSDoc means by \"the timer starts once the\n // notification is visible\".\n const autoDismissProps = useAutoDismiss({\n enabled: autohide,\n delay,\n visible: _visible && entered,\n onHide: close\n })\n\n const _className = classNames(\n 'notification',\n 'fade',\n color,\n {\n solid\n },\n className\n )\n\n if (!isMounted) return null\n\n return (\n <NotificationContext.Provider value={{ visible: _visible, close }}>\n <div\n className={classNames(_className, transitionClass)}\n role={role}\n aria-labelledby={title ? titleId : undefined}\n aria-describedby={title && text ? textId : undefined}\n {...mergeProps(rest, autoDismissProps)}\n ref={forkedRef}\n >\n {icon &&\n (typeof icon === 'string' ? (\n <ResolvedIcon\n value={icon}\n className={classNames('notification-icon', { 'align-self-start': !!title })}\n />\n ) : (\n icon\n ))}\n {title && (\n <NotificationTitle id={titleId} component={titleComponent}>\n {title}\n </NotificationTitle>\n )}\n {text && <NotificationText id={textId}>{text}</NotificationText>}\n {children}\n {actions}\n {dismissible && <CloseButton label={closeLabel} onClick={close} />}\n </div>\n </NotificationContext.Provider>\n )\n }\n)\n\nNotification.displayName = 'Notification'\n","import React, { forwardRef } from 'react'\nimport classNames from 'classnames'\n\nimport { Icon, IconProps } from '../icon/Icon'\n\nexport type NotificationIconProps = IconProps & {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n}\n\nexport const NotificationIcon = forwardRef<HTMLSpanElement | SVGSVGElement, NotificationIconProps>(\n ({ className, ...rest }, ref) => {\n const _className = classNames('notification-icon', className)\n\n return <Icon className={_className} {...rest} ref={ref} />\n }\n)\n\nNotificationIcon.displayName = 'NotificationIcon'\n","import { ReactNode } from 'react'\nimport { ToastQueue } from 'react-stately'\n\nimport { NotificationProps } from './Notification'\n\nexport interface NotificationContent extends Pick<\n NotificationProps,\n | 'actions'\n | 'autohide'\n | 'closeLabel'\n | 'color'\n | 'delay'\n | 'dismissible'\n | 'icon'\n | 'role'\n | 'solid'\n | 'text'\n | 'title'\n | 'titleComponent'\n> {\n /**\n * Content of the notification. Compose manually (typically a `NotificationIcon`/\n * `NotificationTitle`/`NotificationText`), or leave empty and use the `icon`/`title`/`text`\n * shorthand options instead.\n */\n children?: ReactNode\n}\n\n// The queue backing `NotificationStack` — a module-level singleton so `addNotification()` is\n// callable from anywhere (an event handler, an async callback) without threading a `push` prop\n// through render. `NotificationStack` subscribes to it via `useToastQueue`; nothing renders\n// until a `<NotificationStack />` is actually mounted somewhere to display the queue's contents.\nexport const notificationQueue = new ToastQueue<NotificationContent>()\n\n// Adds a notification to the queue. Returns the notification's key, which can be passed to\n// `closeNotification` to dismiss it programmatically. `children` is optional — omit it for a\n// notification composed entirely from the `icon`/`title`/`text` shorthand options.\nexport function addNotification(\n children?: ReactNode,\n options: Omit<NotificationContent, 'children'> = {}\n): string {\n return notificationQueue.add({ children, ...options })\n}\n\n// Removes a queued notification immediately, bypassing its own exit animation.\nexport function closeNotification(key: string): void {\n notificationQueue.close(key)\n}\n","import React, { forwardRef, HTMLAttributes } from 'react'\n\nimport { useToastRegionQueue } from '../../hooks'\nimport { Stack } from '../stack'\nimport { Notification } from './Notification'\nimport { notificationQueue } from './notificationQueue'\n\nexport interface NotificationStackProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Queued notifications show newest-first by default — the typical toast pattern. Set\n * `reverse` for a chronological transcript instead, oldest-first.\n */\n reverse?: boolean\n}\n\n// Renders the shared `notificationQueue` (see `notificationQueue.ts` — `addNotification()` is\n// how notifications get added to it from anywhere in the app) plus any statically-passed\n// `children`, e.g. a permanently pinned notification alongside dynamic ones — the same static\n// children still render with nothing queued, so this doubles as a plain grouping/spacing\n// wrapper for hand-placed notifications. Unlike `Toaster`, this always renders in normal\n// document flow rather than a fixed/portaled overlay — Chassis notifications are in-page\n// banners, not floating toasts.\nexport const NotificationStack = forwardRef<HTMLDivElement, NotificationStackProps>(\n ({ children, className, reverse, ...rest }, ref) => {\n const { forkedRef, regionProps, state } = useToastRegionQueue(notificationQueue, ref)\n\n if (state.visibleToasts.length === 0 && !children) {\n return null\n }\n\n // The queue is already newest-first (each add unshifts); `reverse` opts into chronological\n // order instead.\n const queued = reverse ? [...state.visibleToasts].reverse() : state.visibleToasts\n\n return (\n <Stack\n direction=\"vertical\"\n gap=\"sm\"\n className={className}\n {...regionProps}\n {...rest}\n ref={forkedRef}\n >\n {children}\n {queued.map((item) => {\n const { children: notificationChildren, ...notificationProps } = item.content\n return (\n <Notification\n key={item.key}\n {...notificationProps}\n onClose={() => state.close(item.key)}\n >\n {notificationChildren}\n </Notification>\n )\n })}\n </Stack>\n )\n }\n)\n\nNotificationStack.displayName = 'NotificationStack'\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{d as e,g as t,p as n}from"./slot-CNhFZdHF.js";import{t as r}from"./polymorphic-BhGNZQja.js";import{t as i}from"./useButtonSemantics-CILM_lhi.js";import{t as a}from"./focusRedirect-BrvK3U_o.js";import{t as o}from"./iconSlot-BNu2MrFI.js";import s,{forwardRef as c,useEffect as l,useRef as u}from"react";import d from"classnames";import{mergeProps as f}from"react-aria";function p({prevDisabled:e,nextDisabled:t,onPrev:n,onNext:r}){let i=u(null),o=u(null),s=u(null);return l(()=>{let n=s.current;s.current=null,n&&(n.from===`prev`&&e?a(o.current,n.viaPointer):n.from===`next`&&t&&a(i.current,n.viaPointer))}),{prevRef:i,nextRef:o,handlePrevClick:e=>{s.current={from:`prev`,viaPointer:e.detail!==0},n()},handleNextClick:e=>{s.current={from:`next`,viaPointer:e.detail!==0},r()}}}function m({active:r,children:a,className:o,component:c,disabled:l,href:u,onClick:p,...m},h){let g=d(`pagination-item`,{active:r,disabled:l},o),_=n(c,u,`button`),v=t(_,u,m),y=e(v,u,`PaginationItem`),b=_,x=_,S=e=>{if(v===`anchor`&&l){e.preventDefault();return}p?.(e)},C=v!==`button`&&v!==`anchor`&&!!p,{buttonProps:w,forkedRef:T}=i(h,{disabled:l,onClick:p}),E=r?{"aria-current":`page`}:{};return s.createElement(`li`,{className:g},v===`button`?s.createElement(b,{...m,className:`pagination-link`,type:`button`,disabled:l,onClick:S,...E,ref:h},a):v===`anchor`?s.createElement(x,{...m,className:`pagination-link`,...y,onClick:S,...l&&{"aria-disabled":!0,tabIndex:-1},...E,ref:h},a):s.createElement(_,{className:`pagination-link`,...f(m,C?w:{}),...!C&&{onClick:S},...y,...E,ref:C?T:h},a))}const h=r(m,`PaginationItem`),g={start:`justify-content-start`,center:`justify-content-center`,end:`justify-content-end`};function _(e,t,n){let r=Math.max(1,n);if(t<=r)return Array.from({length:t},(e,t)=>t+1);let i=Math.floor(r/2),a=Math.max(1,e-i),o=Math.min(t,a+r-1);o-a<r-1&&(a=Math.max(1,o-r+1));let s=[];a>1&&(s.push(1),a>2&&s.push(`...`));for(let e=a;e<=o;e++)s.push(e);return o<t&&(o<t-1&&s.push(`...`),s.push(t)),s}const v=c(({activePage:e=1,align:t,"aria-label":n=`Pagination`,children:r,className:i,maxVisiblePages:a=5,nextIcon:c,nextLabel:l=`Next`,onActivePageChange:u,pages:f,previousIcon:m,previousLabel:v=`Previous`,showPageNumbers:y=!0,showPrevNext:b=!0,size:x,...S},C)=>{let w=d(`pagination`,x,t&&g[t],i),T=f?Math.min(Math.max(e,1),f):e,E=f?T<=1:!1,D=f?T>=f:!1,{prevRef:O,nextRef:k,handlePrevClick:A,handleNextClick:j}=p({prevDisabled:E,nextDisabled:D,onPrev:()=>u&&u(T-1),onNext:()=>u&&u(T+1)}),M=f?s.createElement(s.Fragment,null,b&&s.createElement(h,{ref:O,disabled:E,onClick:A,"aria-label":v},s.createElement(o,{icon:`previous`,override:m,className:`directional-icon`})),y&&_(T,f,a).map((e,t)=>e===`...`?s.createElement(h,{key:`ellipsis-${t}`,disabled:!0,component:`span`,"aria-hidden":`true`},`…`):s.createElement(h,{key:e,active:e===T,onClick:()=>u&&u(e)},e)),b&&s.createElement(h,{ref:k,disabled:D,onClick:j,"aria-label":l},s.createElement(o,{icon:`next`,override:c,className:`directional-icon`}))):null;return s.createElement(`nav`,{"aria-label":n,ref:C,...S},s.createElement(`ul`,{className:w},M??r))});v.displayName=`Pagination`;export{h as n,p as r,v as t};
2
+ //# sourceMappingURL=pagination-BREQp-ZC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pagination-BkOquk-x.js","names":[],"sources":["../../src/hooks/usePagination.ts","../../src/components/pagination/PaginationItem.tsx","../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import { MouseEvent, RefObject, useEffect, useRef } from 'react'\n\nimport { focusRedirect } from '../utils/focusRedirect'\n\nexport interface UsePaginationOptions {\n /**\n * Whether the Previous control is currently disabled.\n */\n prevDisabled: boolean\n /**\n * Whether the Next control is currently disabled.\n */\n nextDisabled: boolean\n /**\n * Called when Previous is clicked, before the state change that may disable it.\n */\n onPrev: () => void\n /**\n * Called when Next is clicked, before the state change that may disable it.\n */\n onNext: () => void\n}\n\nexport interface UsePaginationResult<T extends HTMLElement = HTMLButtonElement> {\n // `RefObject<T | null>`, not `RefObject<T>`: these come from `useRef<T>(null)`, so `.current`\n // really is null before mount (and whenever the control isn't rendered — a hand-composed\n // pagination may omit Prev/Next entirely). Declaring the non-null form let a consumer write\n // `prevRef.current.focus()` with no type error and crash at runtime.\n prevRef: RefObject<T | null>\n nextRef: RefObject<T | null>\n handlePrevClick: (event: MouseEvent<T>) => void\n handleNextClick: (event: MouseEvent<T>) => void\n}\n\ninterface Pending {\n from: 'prev' | 'next'\n // A `click` fired by real pointer activation has `detail >= 1`; one fired by keyboard\n // activation (Enter/Space on a focused button) has `detail === 0`.\n viaPointer: boolean\n}\n\n// Native `disabled` buttons are blurred by the browser the instant they're disabled. Clicking a\n// Prev/Next control into the first/last page disables that very control, silently dropping focus\n// to `<body>`. Wire `handlePrevClick`/`handleNextClick` up as each control's `onClick` — they call\n// `onPrev`/`onNext` and redirect focus to the still-enabled sibling in one step, so callers don't\n// hand-wrap their own click handler around a separate mark-then-focus call.\n// Works for `Pagination`'s built-in smart mode and for hand-composed Prev/Next controls alike —\n// pass the element type of whatever you're attaching the refs to (`PaginationItem` defaults to\n// an `HTMLButtonElement`, but renders an `HTMLAnchorElement` when given `href` or `component`).\nexport function usePagination<T extends HTMLElement = HTMLButtonElement>({\n prevDisabled,\n nextDisabled,\n onPrev,\n onNext\n}: UsePaginationOptions): UsePaginationResult<T> {\n const prevRef = useRef<T>(null)\n const nextRef = useRef<T>(null)\n const pending = useRef<Pending | null>(null)\n\n // Deliberately no dependency array: this must run after every render, not just ones where\n // prevDisabled/nextDisabled change value. A Prev/Next click that doesn't cross a boundary\n // (e.g. moving between two enabled middle pages) leaves both booleans unchanged, so a\n // dependency-gated effect would skip and leave `pending` stale — a later, unrelated render\n // that does flip one of the booleans (e.g. jumping straight to the first/last page via a\n // page-number click) would then wrongly consume that stale mark and redirect focus.\n useEffect(() => {\n const from = pending.current\n pending.current = null\n if (!from) return\n if (from.from === 'prev' && prevDisabled) {\n focusRedirect(nextRef.current, from.viaPointer)\n } else if (from.from === 'next' && nextDisabled) {\n focusRedirect(prevRef.current, from.viaPointer)\n }\n })\n\n return {\n prevRef,\n nextRef,\n handlePrevClick: (event) => {\n pending.current = { from: 'prev', viaPointer: event.detail !== 0 }\n onPrev()\n },\n handleNextClick: (event) => {\n pending.current = { from: 'next', viaPointer: event.detail !== 0 }\n onNext()\n }\n }\n}\n","import React, {\n ElementType,\n ForwardRefRenderFunction,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n Ref\n} from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { useButtonSemantics } from '../../hooks'\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype PaginationItemOwnProps<C extends ElementType> = {\n /**\n * Toggle the active state for the component.\n */\n active?: boolean\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * The href attribute. When provided the item renders as an `<a>` tag; otherwise as a `<button>`.\n */\n href?: string\n}\n\nexport type PaginationItemProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n PaginationItemOwnProps<C>\n>\n\ntype PaginationItemComponent = (<C extends ElementType = 'button'>(\n props: PaginationItemProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLButtonElement | HTMLAnchorElement | HTMLSpanElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction PaginationItemRender<C extends ElementType = 'button'>(\n {\n active,\n children,\n className,\n component,\n disabled,\n href,\n onClick,\n ...rest\n }: PaginationItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n const _className = classNames(\n 'pagination-item',\n {\n active,\n disabled\n },\n className\n )\n\n // The active page keeps whatever element it would render anyway (`<button>`, or `<a>` when\n // given `href`) rather than collapsing to a `<span>`. Swapping the tag on activation made React\n // unmount the focused control and mount a different element in its place, so a keyboard user who\n // activated a page was dropped to `<body>` and had to tab in from the top of the document again\n // (WCAG 2.4.3). The `<span>` wasn't even inert: `Pagination`'s smart mode passes an `onClick`,\n // so `useButtonSemantics` gave it `role=\"button\"` and `tabIndex={0}` — a synthetic button,\n // strictly worse than the real one it replaced. Styling is unaffected either way: chassis-css\n // matches `.pagination-link { &.active, .active > & }`, and `active` still lands on the `<li>`.\n const Component = linkElement(component, href, 'button')\n // The kind rather than the tag, counting a router link with `href` or `to` as an anchor: under `asChild`, `Component` is a `Slot` standing in for the\n // caller's element, and a slotted `<a>` needs what `component=\"a\"` gets. Each branch below\n // renders `Component` typed as its tag, which is the tag itself or that `Slot`.\n const kind = resolveLinkKind(Component, href, rest)\n // A router link as `component` takes `href` too; it used to get none.\n const linkProps = hrefProps(kind, href, 'PaginationItem')\n const NativeButton = Component as 'button'\n const Anchor = Component as 'a'\n\n // `<a>` has no real `disabled` attribute, so a disabled anchor pagination item still fires\n // click (and still navigates) unless it's blocked here, same guard `Button` applies.\n const handleClick = (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (kind === 'anchor' && disabled) {\n event.preventDefault()\n return\n }\n onClick?.(event as never)\n }\n\n // A custom `component`/default (non-`button`/`a`) branch gets a raw `onClick` with no keyboard\n // semantics otherwise — the same gap `Link` fills via `useButtonSemantics`.\n const needsButtonSemantics = kind !== 'button' && kind !== 'anchor' && !!onClick\n const { buttonProps, forkedRef } = useButtonSemantics<HTMLElement>(ref as Ref<HTMLElement>, {\n disabled,\n onClick: onClick as MouseEventHandler<HTMLElement> | undefined\n })\n\n // `aria-current=\"page\"` goes on the control itself, not the wrapping `<li>` — that's where the\n // WAI-ARIA pagination pattern puts it, and it's what a screen reader conveys when focus lands on\n // the control. On the `<li>` it was attached to a presentational list item nothing focuses.\n const currentProps = active ? { 'aria-current': 'page' as const } : {}\n\n return (\n <li className={_className}>\n {kind === 'button' ? (\n <NativeButton\n {...(rest as Record<string, unknown>)}\n className=\"pagination-link\"\n type=\"button\"\n disabled={disabled}\n onClick={handleClick}\n {...currentProps}\n ref={ref as Ref<HTMLButtonElement>}\n >\n {children}\n </NativeButton>\n ) : kind === 'anchor' ? (\n <Anchor\n {...(rest as Record<string, unknown>)}\n className=\"pagination-link\"\n {...linkProps}\n onClick={handleClick}\n {...(disabled && { 'aria-disabled': true, tabIndex: -1 })}\n {...currentProps}\n ref={ref as Ref<HTMLAnchorElement>}\n >\n {children}\n </Anchor>\n ) : (\n <Component\n className=\"pagination-link\"\n {...(mergeProps(rest, needsButtonSemantics ? buttonProps : {}) as Record<\n string,\n unknown\n >)}\n {...(!needsButtonSemantics && { onClick: handleClick })}\n {...linkProps}\n {...currentProps}\n ref={needsButtonSemantics ? forkedRef : ref}\n >\n {children}\n </Component>\n )}\n </li>\n )\n}\n\nexport const PaginationItem = createPolymorphicComponent<PaginationItemComponent>(\n PaginationItemRender as ForwardRefRenderFunction<Element, PaginationItemProps<ElementType>>,\n 'PaginationItem'\n)\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../../utils/iconSlot'\nimport classNames from 'classnames'\n\nimport { PaginationItem } from './PaginationItem'\nimport { usePagination } from '../../hooks'\n\nexport interface PaginationProps extends HTMLAttributes<HTMLElement> {\n /**\n * Current active page (1-indexed). Used with `pages` for data-driven mode.\n */\n activePage?: number\n /**\n * Set the alignment of pagination components.\n */\n align?: 'start' | 'center' | 'end'\n /**\n * Accessible label for the pagination `<nav>` landmark. Override for non-English locales,\n * or when multiple paginators appear on the same page.\n *\n * @default 'Pagination'\n */\n 'aria-label'?: string\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Maximum number of visible page buttons (default: 5). Flanking pages are collapsed to ellipsis.\n */\n maxVisiblePages?: number\n /**\n * The \"next page\" control's icon in smart pagination mode: an icon name, or an element of your\n * own icon set. Defaults to `IconProvider`'s `next` icon.\n */\n nextIcon?: IconValue\n /**\n * Accessible label for the \"next page\" control, used in smart pagination mode. Override for\n * non-English locales.\n *\n * @default 'Next'\n */\n nextLabel?: string\n /**\n * Callback fired when the active page changes.\n */\n onActivePageChange?: (page: number) => void\n /**\n * Total number of pages. When provided alongside `activePage` and `onActivePageChange`,\n * the component renders a fully-controlled smart paginator with Prev/Next and ellipsis.\n */\n pages?: number\n /**\n * The \"previous page\" control's icon in smart pagination mode: an icon name, or an element of\n * your own icon set. Defaults to `IconProvider`'s `previous` icon.\n */\n previousIcon?: IconValue\n /**\n * Accessible label for the \"previous page\" control, used in smart pagination mode. Override\n * for non-English locales.\n *\n * @default 'Previous'\n */\n previousLabel?: string\n /**\n * Show the numbered page buttons in smart pagination mode. Set `false` alongside\n * `showPrevNext` to build a Prev/Next-only paginator.\n *\n * @default true\n */\n showPageNumbers?: boolean\n /**\n * Show the Prev/Next controls in smart pagination mode. Set `false` alongside\n * `showPageNumbers` to build a page-numbers-only paginator.\n *\n * @default true\n */\n showPrevNext?: boolean\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n}\n\nfunction getPageRange(activePage: number, pages: number, maxVisible: number): (number | '...')[] {\n const safeMaxVisible = Math.max(1, maxVisible)\n\n if (pages <= safeMaxVisible) {\n return Array.from({ length: pages }, (_, i) => i + 1)\n }\n\n const half = Math.floor(safeMaxVisible / 2)\n let start = Math.max(1, activePage - half)\n const end = Math.min(pages, start + safeMaxVisible - 1)\n\n if (end - start < safeMaxVisible - 1) {\n start = Math.max(1, end - safeMaxVisible + 1)\n }\n\n const result: (number | '...')[] = []\n\n if (start > 1) {\n result.push(1)\n if (start > 2) result.push('...')\n }\n\n for (let i = start; i <= end; i++) {\n result.push(i)\n }\n\n if (end < pages) {\n if (end < pages - 1) result.push('...')\n result.push(pages)\n }\n\n return result\n}\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n (\n {\n activePage = 1,\n align,\n 'aria-label': ariaLabel = 'Pagination',\n children,\n className,\n maxVisiblePages = 5,\n nextIcon,\n nextLabel = 'Next',\n onActivePageChange,\n pages,\n previousIcon,\n previousLabel = 'Previous',\n showPageNumbers = true,\n showPrevNext = true,\n size,\n ...rest\n },\n ref\n ) => {\n const _className = classNames(\n 'pagination',\n size,\n {\n [`justify-content-${align}`]: align\n },\n className\n )\n\n const clampedActivePage = pages ? Math.min(Math.max(activePage, 1), pages) : activePage\n const prevDisabled = pages ? clampedActivePage <= 1 : false\n const nextDisabled = pages ? clampedActivePage >= pages : false\n\n const { prevRef, nextRef, handlePrevClick, handleNextClick } = usePagination({\n prevDisabled,\n nextDisabled,\n onPrev: () => onActivePageChange && onActivePageChange(clampedActivePage - 1),\n onNext: () => onActivePageChange && onActivePageChange(clampedActivePage + 1)\n })\n\n const smartContent = pages ? (\n <>\n {showPrevNext && (\n <PaginationItem\n ref={prevRef}\n disabled={prevDisabled}\n onClick={handlePrevClick}\n aria-label={previousLabel}\n >\n <IconSlot icon=\"previous\" override={previousIcon} className=\"directional-icon\" />\n </PaginationItem>\n )}\n {showPageNumbers &&\n getPageRange(clampedActivePage, pages, maxVisiblePages).map((page, idx) =>\n page === '...' ? (\n // eslint-disable-next-line react/no-array-index-key\n <PaginationItem key={`ellipsis-${idx}`} disabled component=\"span\" aria-hidden=\"true\">\n &hellip;\n </PaginationItem>\n ) : (\n <PaginationItem\n key={page}\n active={page === clampedActivePage}\n onClick={() => onActivePageChange && onActivePageChange(page)}\n >\n {page}\n </PaginationItem>\n )\n )}\n {showPrevNext && (\n <PaginationItem\n ref={nextRef}\n disabled={nextDisabled}\n onClick={handleNextClick}\n aria-label={nextLabel}\n >\n <IconSlot icon=\"next\" override={nextIcon} className=\"directional-icon\" />\n </PaginationItem>\n )}\n </>\n ) : null\n\n return (\n <nav aria-label={ariaLabel} ref={ref} {...rest}>\n <ul className={_className}>{smartContent ?? children}</ul>\n </nav>\n )\n }\n)\n\nPagination.displayName = 'Pagination'\n"],"mappings":"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"}
1
+ {"version":3,"file":"pagination-BREQp-ZC.js","names":[],"sources":["../../src/hooks/usePagination.ts","../../src/components/pagination/PaginationItem.tsx","../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import { MouseEvent, RefObject, useEffect, useRef } from 'react'\n\nimport { focusRedirect } from '../utils/focusRedirect'\n\nexport interface UsePaginationOptions {\n /**\n * Whether the Previous control is currently disabled.\n */\n prevDisabled: boolean\n /**\n * Whether the Next control is currently disabled.\n */\n nextDisabled: boolean\n /**\n * Called when Previous is clicked, before the state change that may disable it.\n */\n onPrev: () => void\n /**\n * Called when Next is clicked, before the state change that may disable it.\n */\n onNext: () => void\n}\n\nexport interface UsePaginationResult<T extends HTMLElement = HTMLButtonElement> {\n // `RefObject<T | null>`, not `RefObject<T>`: these come from `useRef<T>(null)`, so `.current`\n // really is null before mount (and whenever the control isn't rendered — a hand-composed\n // pagination may omit Prev/Next entirely). Declaring the non-null form let a consumer write\n // `prevRef.current.focus()` with no type error and crash at runtime.\n prevRef: RefObject<T | null>\n nextRef: RefObject<T | null>\n handlePrevClick: (event: MouseEvent<T>) => void\n handleNextClick: (event: MouseEvent<T>) => void\n}\n\ninterface Pending {\n from: 'prev' | 'next'\n // A `click` fired by real pointer activation has `detail >= 1`; one fired by keyboard\n // activation (Enter/Space on a focused button) has `detail === 0`.\n viaPointer: boolean\n}\n\n// Native `disabled` buttons are blurred by the browser the instant they're disabled. Clicking a\n// Prev/Next control into the first/last page disables that very control, silently dropping focus\n// to `<body>`. Wire `handlePrevClick`/`handleNextClick` up as each control's `onClick` — they call\n// `onPrev`/`onNext` and redirect focus to the still-enabled sibling in one step, so callers don't\n// hand-wrap their own click handler around a separate mark-then-focus call.\n// Works for `Pagination`'s built-in smart mode and for hand-composed Prev/Next controls alike —\n// pass the element type of whatever you're attaching the refs to (`PaginationItem` defaults to\n// an `HTMLButtonElement`, but renders an `HTMLAnchorElement` when given `href` or `component`).\nexport function usePagination<T extends HTMLElement = HTMLButtonElement>({\n prevDisabled,\n nextDisabled,\n onPrev,\n onNext\n}: UsePaginationOptions): UsePaginationResult<T> {\n const prevRef = useRef<T>(null)\n const nextRef = useRef<T>(null)\n const pending = useRef<Pending | null>(null)\n\n // Deliberately no dependency array: this must run after every render, not just ones where\n // prevDisabled/nextDisabled change value. A Prev/Next click that doesn't cross a boundary\n // (e.g. moving between two enabled middle pages) leaves both booleans unchanged, so a\n // dependency-gated effect would skip and leave `pending` stale — a later, unrelated render\n // that does flip one of the booleans (e.g. jumping straight to the first/last page via a\n // page-number click) would then wrongly consume that stale mark and redirect focus.\n useEffect(() => {\n const from = pending.current\n pending.current = null\n if (!from) return\n if (from.from === 'prev' && prevDisabled) {\n focusRedirect(nextRef.current, from.viaPointer)\n } else if (from.from === 'next' && nextDisabled) {\n focusRedirect(prevRef.current, from.viaPointer)\n }\n })\n\n return {\n prevRef,\n nextRef,\n handlePrevClick: (event) => {\n pending.current = { from: 'prev', viaPointer: event.detail !== 0 }\n onPrev()\n },\n handleNextClick: (event) => {\n pending.current = { from: 'next', viaPointer: event.detail !== 0 }\n onNext()\n }\n }\n}\n","import React, {\n ElementType,\n ForwardRefRenderFunction,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n Ref\n} from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { useButtonSemantics } from '../../hooks'\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype PaginationItemOwnProps<C extends ElementType> = {\n /**\n * Toggle the active state for the component.\n */\n active?: boolean\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * The href attribute. When provided the item renders as an `<a>` tag; otherwise as a `<button>`.\n */\n href?: string\n}\n\nexport type PaginationItemProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n PaginationItemOwnProps<C>\n>\n\ntype PaginationItemComponent = (<C extends ElementType = 'button'>(\n props: PaginationItemProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLButtonElement | HTMLAnchorElement | HTMLSpanElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction PaginationItemRender<C extends ElementType = 'button'>(\n {\n active,\n children,\n className,\n component,\n disabled,\n href,\n onClick,\n ...rest\n }: PaginationItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n const _className = classNames(\n 'pagination-item',\n {\n active,\n disabled\n },\n className\n )\n\n // The active page keeps whatever element it would render anyway (`<button>`, or `<a>` when\n // given `href`) rather than collapsing to a `<span>`. Swapping the tag on activation made React\n // unmount the focused control and mount a different element in its place, so a keyboard user who\n // activated a page was dropped to `<body>` and had to tab in from the top of the document again\n // (WCAG 2.4.3). The `<span>` wasn't even inert: `Pagination`'s smart mode passes an `onClick`,\n // so `useButtonSemantics` gave it `role=\"button\"` and `tabIndex={0}` — a synthetic button,\n // strictly worse than the real one it replaced. Styling is unaffected either way: chassis-css\n // matches `.pagination-link { &.active, .active > & }`, and `active` still lands on the `<li>`.\n const Component = linkElement(component, href, 'button')\n // The kind rather than the tag, counting a router link with `href` or `to` as an anchor: under `asChild`, `Component` is a `Slot` standing in for the\n // caller's element, and a slotted `<a>` needs what `component=\"a\"` gets. Each branch below\n // renders `Component` typed as its tag, which is the tag itself or that `Slot`.\n const kind = resolveLinkKind(Component, href, rest)\n // A router link as `component` takes `href` too; it used to get none.\n const linkProps = hrefProps(kind, href, 'PaginationItem')\n const NativeButton = Component as 'button'\n const Anchor = Component as 'a'\n\n // `<a>` has no real `disabled` attribute, so a disabled anchor pagination item still fires\n // click (and still navigates) unless it's blocked here, same guard `Button` applies.\n const handleClick = (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (kind === 'anchor' && disabled) {\n event.preventDefault()\n return\n }\n onClick?.(event as never)\n }\n\n // A custom `component`/default (non-`button`/`a`) branch gets a raw `onClick` with no keyboard\n // semantics otherwise — the same gap `Link` fills via `useButtonSemantics`.\n const needsButtonSemantics = kind !== 'button' && kind !== 'anchor' && !!onClick\n const { buttonProps, forkedRef } = useButtonSemantics<HTMLElement>(ref as Ref<HTMLElement>, {\n disabled,\n onClick: onClick as MouseEventHandler<HTMLElement> | undefined\n })\n\n // `aria-current=\"page\"` goes on the control itself, not the wrapping `<li>` — that's where the\n // WAI-ARIA pagination pattern puts it, and it's what a screen reader conveys when focus lands on\n // the control. On the `<li>` it was attached to a presentational list item nothing focuses.\n const currentProps = active ? { 'aria-current': 'page' as const } : {}\n\n return (\n <li className={_className}>\n {kind === 'button' ? (\n <NativeButton\n {...(rest as Record<string, unknown>)}\n className=\"pagination-link\"\n type=\"button\"\n disabled={disabled}\n onClick={handleClick}\n {...currentProps}\n ref={ref as Ref<HTMLButtonElement>}\n >\n {children}\n </NativeButton>\n ) : kind === 'anchor' ? (\n <Anchor\n {...(rest as Record<string, unknown>)}\n className=\"pagination-link\"\n {...linkProps}\n onClick={handleClick}\n {...(disabled && { 'aria-disabled': true, tabIndex: -1 })}\n {...currentProps}\n ref={ref as Ref<HTMLAnchorElement>}\n >\n {children}\n </Anchor>\n ) : (\n <Component\n className=\"pagination-link\"\n {...(mergeProps(rest, needsButtonSemantics ? buttonProps : {}) as Record<\n string,\n unknown\n >)}\n {...(!needsButtonSemantics && { onClick: handleClick })}\n {...linkProps}\n {...currentProps}\n ref={needsButtonSemantics ? forkedRef : ref}\n >\n {children}\n </Component>\n )}\n </li>\n )\n}\n\nexport const PaginationItem = createPolymorphicComponent<PaginationItemComponent>(\n PaginationItemRender as ForwardRefRenderFunction<Element, PaginationItemProps<ElementType>>,\n 'PaginationItem'\n)\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../../utils/iconSlot'\nimport classNames from 'classnames'\n\nimport { PaginationItem } from './PaginationItem'\nimport { usePagination } from '../../hooks'\n\n// Whole class names, not `justify-content-${align}`: see `utils/colorClassNames.ts`.\nconst ALIGN_CLASS_NAMES: Record<NonNullable<PaginationProps['align']>, string> = {\n start: 'justify-content-start',\n center: 'justify-content-center',\n end: 'justify-content-end'\n}\n\nexport interface PaginationProps extends HTMLAttributes<HTMLElement> {\n /**\n * Current active page (1-indexed). Used with `pages` for data-driven mode.\n */\n activePage?: number\n /**\n * Set the alignment of pagination components.\n */\n align?: 'start' | 'center' | 'end'\n /**\n * Accessible label for the pagination `<nav>` landmark. Override for non-English locales,\n * or when multiple paginators appear on the same page.\n *\n * @default 'Pagination'\n */\n 'aria-label'?: string\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Maximum number of visible page buttons (default: 5). Flanking pages are collapsed to ellipsis.\n */\n maxVisiblePages?: number\n /**\n * The \"next page\" control's icon in smart pagination mode: an icon name, or an element of your\n * own icon set. Defaults to `IconProvider`'s `next` icon.\n */\n nextIcon?: IconValue\n /**\n * Accessible label for the \"next page\" control, used in smart pagination mode. Override for\n * non-English locales.\n *\n * @default 'Next'\n */\n nextLabel?: string\n /**\n * Callback fired when the active page changes.\n */\n onActivePageChange?: (page: number) => void\n /**\n * Total number of pages. When provided alongside `activePage` and `onActivePageChange`,\n * the component renders a fully-controlled smart paginator with Prev/Next and ellipsis.\n */\n pages?: number\n /**\n * The \"previous page\" control's icon in smart pagination mode: an icon name, or an element of\n * your own icon set. Defaults to `IconProvider`'s `previous` icon.\n */\n previousIcon?: IconValue\n /**\n * Accessible label for the \"previous page\" control, used in smart pagination mode. Override\n * for non-English locales.\n *\n * @default 'Previous'\n */\n previousLabel?: string\n /**\n * Show the numbered page buttons in smart pagination mode. Set `false` alongside\n * `showPrevNext` to build a Prev/Next-only paginator.\n *\n * @default true\n */\n showPageNumbers?: boolean\n /**\n * Show the Prev/Next controls in smart pagination mode. Set `false` alongside\n * `showPageNumbers` to build a page-numbers-only paginator.\n *\n * @default true\n */\n showPrevNext?: boolean\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n}\n\nfunction getPageRange(activePage: number, pages: number, maxVisible: number): (number | '...')[] {\n const safeMaxVisible = Math.max(1, maxVisible)\n\n if (pages <= safeMaxVisible) {\n return Array.from({ length: pages }, (_, i) => i + 1)\n }\n\n const half = Math.floor(safeMaxVisible / 2)\n let start = Math.max(1, activePage - half)\n const end = Math.min(pages, start + safeMaxVisible - 1)\n\n if (end - start < safeMaxVisible - 1) {\n start = Math.max(1, end - safeMaxVisible + 1)\n }\n\n const result: (number | '...')[] = []\n\n if (start > 1) {\n result.push(1)\n if (start > 2) result.push('...')\n }\n\n for (let i = start; i <= end; i++) {\n result.push(i)\n }\n\n if (end < pages) {\n if (end < pages - 1) result.push('...')\n result.push(pages)\n }\n\n return result\n}\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n (\n {\n activePage = 1,\n align,\n 'aria-label': ariaLabel = 'Pagination',\n children,\n className,\n maxVisiblePages = 5,\n nextIcon,\n nextLabel = 'Next',\n onActivePageChange,\n pages,\n previousIcon,\n previousLabel = 'Previous',\n showPageNumbers = true,\n showPrevNext = true,\n size,\n ...rest\n },\n ref\n ) => {\n const _className = classNames('pagination', size, align && ALIGN_CLASS_NAMES[align], className)\n\n const clampedActivePage = pages ? Math.min(Math.max(activePage, 1), pages) : activePage\n const prevDisabled = pages ? clampedActivePage <= 1 : false\n const nextDisabled = pages ? clampedActivePage >= pages : false\n\n const { prevRef, nextRef, handlePrevClick, handleNextClick } = usePagination({\n prevDisabled,\n nextDisabled,\n onPrev: () => onActivePageChange && onActivePageChange(clampedActivePage - 1),\n onNext: () => onActivePageChange && onActivePageChange(clampedActivePage + 1)\n })\n\n const smartContent = pages ? (\n <>\n {showPrevNext && (\n <PaginationItem\n ref={prevRef}\n disabled={prevDisabled}\n onClick={handlePrevClick}\n aria-label={previousLabel}\n >\n <IconSlot icon=\"previous\" override={previousIcon} className=\"directional-icon\" />\n </PaginationItem>\n )}\n {showPageNumbers &&\n getPageRange(clampedActivePage, pages, maxVisiblePages).map((page, idx) =>\n page === '...' ? (\n // eslint-disable-next-line react/no-array-index-key\n <PaginationItem key={`ellipsis-${idx}`} disabled component=\"span\" aria-hidden=\"true\">\n &hellip;\n </PaginationItem>\n ) : (\n <PaginationItem\n key={page}\n active={page === clampedActivePage}\n onClick={() => onActivePageChange && onActivePageChange(page)}\n >\n {page}\n </PaginationItem>\n )\n )}\n {showPrevNext && (\n <PaginationItem\n ref={nextRef}\n disabled={nextDisabled}\n onClick={handleNextClick}\n aria-label={nextLabel}\n >\n <IconSlot icon=\"next\" override={nextIcon} className=\"directional-icon\" />\n </PaginationItem>\n )}\n </>\n ) : null\n\n return (\n <nav aria-label={ariaLabel} ref={ref} {...rest}>\n <ul className={_className}>{smartContent ?? children}</ul>\n </nav>\n )\n }\n)\n\nPagination.displayName = 'Pagination'\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{a as e}from"./slot-CNhFZdHF.js";import{t}from"./polymorphic-BhGNZQja.js";import n from"react";import r from"classnames";const i={start:`float-start`,center:`d-block mx-auto`,end:`float-end`};function a({align:t,alt:a,className:o,color:s,component:c,fluid:l,height:u,rounded:d,src:f,text:p,thumbnail:m,title:h=`Placeholder`,variant:g,width:_,...v},y){let b=h!==!1,x=p===!1?void 0:p??(_!==void 0&&u!==void 0?`${_}x${u}`:void 0),S=x!==void 0,C=[b&&h,S&&x].filter(Boolean).join(`: `)||void 0;if(f||e(c)){let e=c??`img`,s=r({image:l||m,fluid:l,rounded:d,thumbnail:m},t&&i[t],o);return n.createElement(e,{src:f,width:_,height:u,alt:a??C??``,className:s,...v,ref:y})}let w=r(`image`,{context:!!(s||g)},s,g||`bg-evident`,`fg-subtle`,o);return n.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:_,height:u,"aria-label":C,"aria-hidden":!C||void 0,className:w,preserveAspectRatio:`xMidYMid slice`,role:C?`img`:void 0,...v,ref:y},b&&n.createElement(`title`,null,h),S&&n.createElement(`text`,{dy:`.3em`,fill:`currentColor`,textAnchor:`middle`,x:`50%`,y:`50%`},x))}const o=t(a,`Placeholder`);export{o as t};
2
+ //# sourceMappingURL=placeholder-DhNpUJqv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder-DhNpUJqv.js","names":[],"sources":["../../src/components/placeholder/Placeholder.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor, ContextStyle } from '../../types'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { isSlot } from '../../utils/slot'\n\ntype PlaceholderAlign = 'start' | 'center' | 'end'\n\ntype PlaceholderOwnProps<C extends ElementType> = {\n /**\n * Set the horizontal alignment. Only applies when `src` is set.\n */\n align?: PlaceholderAlign\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the generated placeholder graphic to one of Chassis context colors. Has no\n * effect when `src` is set.\n */\n color?: ContextColor\n /**\n * Sets the variant of the generated placeholder graphic to one of Chassis context styles. Has no\n * effect when `src` is set.\n */\n variant?: Exclude<ContextStyle, 'basic' | 'outline'>\n /**\n * Component used for the root node when `src` is set. Either a string to use an HTML element\n * or a component — e.g. a framework's own `Image` component. Its own props (`src`, `fill`,\n * `priority`, etc.) are type-checked at the call site once passed here. With `asChild`, the\n * child element is the image and carries its own `src`.\n */\n component?: C\n /**\n * Make the image responsive, so it never grows larger than its parent. Only applies when `src`\n * is set.\n */\n fluid?: boolean\n /**\n * Placeholder height.\n */\n height?: number | string\n /**\n * Give the image a rounded border-radius. Only applies when `src` is set.\n */\n rounded?: boolean\n /**\n * Renders a real image instead of the generated placeholder graphic, e.g. a default asset or a\n * `placehold.co` URL.\n */\n src?: string\n /**\n * Text shown in the generated placeholder graphic. Defaults to `{width}x{height}`. Pass `false`\n * to hide it. Has no effect when `src` is set.\n */\n text?: string | false\n /**\n * Give the image a thumbnail appearance (padding, background, border, box-shadow). Only\n * applies when `src` is set.\n */\n thumbnail?: boolean\n /**\n * Accessible title for the generated placeholder graphic, rendered as an SVG `<title>`. Pass\n * `false` to hide it. Has no effect when `src` is set.\n *\n * @default 'Placeholder'\n */\n title?: string | false\n /**\n * Placeholder width.\n */\n width?: number | string\n}\n\nexport type PlaceholderProps<C extends ElementType = 'img'> = PolymorphicComponentProps<\n C,\n PlaceholderOwnProps<C>\n>\n\ntype PlaceholderComponent = (<C extends ElementType = 'img'>(\n props: PlaceholderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n// Whole class names, not `float-${align}`: see `utils/colorClassNames.ts`.\nconst ALIGN_CLASS_NAMES: Record<PlaceholderAlign, string> = {\n start: 'float-start',\n center: 'd-block mx-auto',\n end: 'float-end'\n}\n\nfunction PlaceholderRender<C extends ElementType = 'img'>(\n {\n align,\n alt,\n className,\n color,\n component,\n fluid,\n height,\n rounded,\n src,\n text,\n thumbnail,\n title = 'Placeholder',\n variant,\n width,\n ...rest\n }: PlaceholderProps<C>,\n ref: PolymorphicRef<C>\n) {\n const showTitle = title !== false\n const displayText =\n text === false\n ? undefined\n : (text ?? (width !== undefined && height !== undefined ? `${width}x${height}` : undefined))\n const showText = displayText !== undefined\n const label =\n [showTitle && title, showText && displayText].filter(Boolean).join(': ') || undefined\n\n // Under `asChild` the caller's element is the image and holds the `src`, so there is none here\n // to choose the branch by.\n if (src || isSlot(component)) {\n const Component = component ?? 'img'\n const _className = classNames(\n { image: fluid || thumbnail, fluid, rounded, thumbnail },\n align && ALIGN_CLASS_NAMES[align],\n className\n )\n\n return (\n <Component\n src={src}\n width={width}\n height={height}\n alt={alt ?? label ?? ''}\n className={_className}\n {...rest}\n ref={ref}\n />\n )\n }\n\n const _className = classNames(\n 'image',\n { context: Boolean(color || variant) },\n color,\n variant ? variant : 'bg-evident',\n 'fg-subtle',\n className\n )\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={width}\n height={height}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={_className}\n preserveAspectRatio=\"xMidYMid slice\"\n role={label ? 'img' : undefined}\n {...rest}\n ref={ref as PolymorphicRef<'svg'>}\n >\n {showTitle && <title>{title}</title>}\n {showText && (\n <text dy=\".3em\" fill=\"currentColor\" textAnchor=\"middle\" x=\"50%\" y=\"50%\">\n {displayText}\n </text>\n )}\n </svg>\n )\n}\n\nexport const Placeholder = createPolymorphicComponent<PlaceholderComponent>(\n PlaceholderRender as ForwardRefRenderFunction<Element, PlaceholderProps<ElementType>>,\n 'Placeholder'\n)\n"],"mappings":"gKA0FA,MAAM,EAAsD,CAC1D,MAAO,cACP,OAAQ,kBACR,IAAK,WACP,EAEA,SAAS,EACP,CACE,QACA,MACA,YACA,QACA,YACA,QACA,SACA,UACA,MACA,OACA,YACA,QAAQ,cACR,UACA,QACA,GAAG,GAEL,EACA,CACA,IAAM,EAAY,IAAU,GACtB,EACJ,IAAS,GACL,IAAA,GACC,IAAS,IAAU,IAAA,IAAa,IAAW,IAAA,GAAY,GAAG,EAAM,GAAG,IAAW,IAAA,IAC/E,EAAW,IAAgB,IAAA,GAC3B,EACJ,CAAC,GAAa,EAAO,GAAY,CAAW,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,GAAK,IAAA,GAI9E,GAAI,GAAO,EAAO,CAAS,EAAG,CAC5B,IAAM,EAAY,GAAa,MACzB,EAAa,EACjB,CAAE,MAAO,GAAS,EAAW,QAAO,UAAS,WAAU,EACvD,GAAS,EAAkB,GAC3B,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CACO,MACE,QACC,SACR,IAAK,GAAO,GAAS,GACrB,UAAW,EACX,GAAI,EACC,KACN,CAAA,CAEL,CAEA,IAAM,EAAa,EACjB,QACA,CAAE,QAAS,GAAQ,GAAS,EAAS,EACrC,EACA,GAAoB,aACpB,YACA,CACF,EAEA,OACE,EAAA,cAAC,MAAD,CACE,MAAM,6BACC,QACC,SACR,aAAY,EACZ,cAAa,IAAQ,IAAA,GACrB,UAAW,EACX,oBAAoB,iBACpB,KAAM,EAAQ,MAAQ,IAAA,GACtB,GAAI,EACC,KAQF,EANF,GAAa,EAAA,cAAC,QAAA,KAAO,CAAa,EAClC,GACC,EAAA,cAAC,OAAD,CAAM,GAAG,OAAO,KAAK,eAAe,WAAW,SAAS,EAAE,MAAM,EAAE,KAE5D,EADH,CACG,CAEL,CAET,CAEA,MAAa,EAAc,EACzB,EACA,aACF"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./colorClassNames-CEh5Yzfp.js";import n,{useId as r}from"react";import i from"classnames";function a({children:e,animated:r,className:a,color:o,component:s,striped:c,style:l,value:u=0,...d},f){let p=s??`div`,m=Math.min(100,Math.max(0,u)),h=i(`progress-bar`,o&&[t[o],`fg-contrast`],{striped:c,animated:r},a);return n.createElement(p,{...d,className:h,style:{width:`${m}%`,...l},ref:f},n.createElement(`span`,{className:`mx-2xs`},e))}const o=e(a,`ProgressBar`);function s({"aria-label":e,animated:t,children:a,className:s,color:c,component:l,height:u,inlineValue:d,label:f,showValue:p,striped:m,style:h,value:g=0,..._},v){let y=l??`div`,b=i(`progress`,s),x=Math.min(100,Math.max(0,g)),S=a===void 0?d?`${x}%`:void 0:a,C=!!(f||p),w=r(),T=f!=null&&typeof f!=`string`,E={...h};u!==void 0&&(E[`--cx-height`]=`${u}px`);let D=n.createElement(y,{..._,className:b,role:`progressbar`,"aria-valuenow":x,"aria-valuemin":0,"aria-valuemax":100,"aria-label":e??(typeof f==`string`?f:void 0),"aria-labelledby":!e&&T?w:void 0,style:E,ref:v},n.createElement(o,{animated:t,color:c,striped:m,value:x},S));return C?n.createElement(`div`,{className:`d-flex flex-column gap-xs`},n.createElement(`div`,{className:i(`d-flex`,f?`justify-content-between`:`justify-content-end`)},f?n.createElement(`span`,{className:`font-strong`,id:T?w:void 0},f):null,p?n.createElement(`span`,{className:`font-strong`},x,`%`):null),D):D}const c=e(s,`Progress`);export{o as n,c as t};
2
+ //# sourceMappingURL=progress-BqgWezdG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-BqgWezdG.js","names":[],"sources":["../../src/components/progress/ProgressBar.tsx","../../src/components/progress/Progress.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport { BG_COLOR_CLASS_NAMES } from '../../utils/colorClassNames'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype ProgressBarOwnProps<C extends ElementType> = {\n /**\n * Use to animate the stripes right to left via CSS3 animations.\n */\n animated?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Adds a diagonal stripe pattern over the bar's background.\n */\n striped?: boolean\n /**\n * The percent to progress the ProgressBar.\n */\n value?: number\n}\n\nexport type ProgressBarProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ProgressBarOwnProps<C>\n>\n\ntype ProgressBarComponent = (<C extends ElementType = 'div'>(\n props: ProgressBarProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ProgressBarRender<C extends ElementType = 'div'>(\n {\n children,\n animated,\n className,\n color,\n component,\n striped,\n style,\n value = 0,\n ...rest\n }: ProgressBarProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const clampedValue = Math.min(100, Math.max(0, value))\n const _className = classNames(\n 'progress-bar',\n color && [BG_COLOR_CLASS_NAMES[color], 'fg-contrast'],\n {\n striped,\n animated\n },\n className\n )\n\n return (\n <Component\n {...rest}\n className={_className}\n style={{ width: `${clampedValue}%`, ...style }}\n ref={ref}\n >\n <span className=\"mx-2xs\">{children}</span>\n </Component>\n )\n}\n\nexport const ProgressBar = createPolymorphicComponent<ProgressBarComponent>(\n ProgressBarRender as ForwardRefRenderFunction<Element, ProgressBarProps<ElementType>>,\n 'ProgressBar'\n)\n","import React, {\n CSSProperties,\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n useId\n} from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { ProgressBar } from './ProgressBar'\n\ntype ProgressStyle = CSSProperties & {\n '--cx-height'?: string\n}\n\ntype ProgressOwnProps<C extends ElementType> = {\n /**\n * Use to animate the stripes right to left via CSS3 animations.\n */\n animated?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Sets the height of the component, via the `--cx-height` custom property. If you set that\n * value the inner bar (and the striped pattern's tile size) automatically resizes accordingly.\n */\n height?: number\n /**\n * Shows the current value as text inside the bar, independently of `showValue` — combine both\n * to get a `label` + `showValue` caption above the bar alongside an `inlineValue` reading\n * inside it.\n */\n inlineValue?: boolean\n /**\n * A text label describing the progress. Rendered in a caption row above the bar. Also used as\n * the default accessible name when no `aria-label`/`aria-labelledby` is supplied.\n */\n label?: ReactNode\n /**\n * Shows the current value as text in the caption row above the bar, alongside `label` when\n * both are set, or alone otherwise. Use `inlineValue` to show it inside the bar instead.\n */\n showValue?: boolean\n /**\n * Adds a diagonal stripe pattern over the bar's background.\n */\n striped?: boolean\n /**\n * The percent to progress the ProgressBar (out of 100).\n */\n value?: number\n}\n\nexport type ProgressProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ProgressOwnProps<C>\n>\n\ntype ProgressComponent = (<C extends ElementType = 'div'>(\n props: ProgressProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ProgressRender<C extends ElementType = 'div'>(\n {\n 'aria-label': ariaLabel,\n animated,\n children,\n className,\n color,\n component,\n height,\n inlineValue,\n label,\n showValue,\n striped,\n style,\n value = 0,\n ...rest\n }: ProgressProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('progress', className)\n const clampedValue = Math.min(100, Math.max(0, value))\n\n const barChildren =\n children !== undefined ? children : inlineValue ? `${clampedValue}%` : undefined\n const hasCaption = Boolean(label || showValue)\n\n const labelId = useId()\n const isNodeLabel = label != null && typeof label !== 'string'\n\n const _style: ProgressStyle = { ...style }\n if (height !== undefined) _style['--cx-height'] = `${height}px`\n\n const progressElement = (\n <Component\n {...rest}\n className={_className}\n role=\"progressbar\"\n aria-valuenow={clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={ariaLabel ?? (typeof label === 'string' ? label : undefined)}\n aria-labelledby={!ariaLabel && isNodeLabel ? labelId : undefined}\n style={_style}\n ref={ref}\n >\n <ProgressBar animated={animated} color={color} striped={striped} value={clampedValue}>\n {barChildren}\n </ProgressBar>\n </Component>\n )\n\n if (!hasCaption) return progressElement\n\n return (\n <div className=\"d-flex flex-column gap-xs\">\n <div\n className={classNames('d-flex', label ? 'justify-content-between' : 'justify-content-end')}\n >\n {label ? (\n <span className=\"font-strong\" id={isNodeLabel ? labelId : undefined}>\n {label}\n </span>\n ) : null}\n {showValue ? <span className=\"font-strong\">{clampedValue}%</span> : null}\n </div>\n {progressElement}\n </div>\n )\n}\n\nexport const Progress = createPolymorphicComponent<ProgressComponent>(\n ProgressRender as ForwardRefRenderFunction<Element, ProgressProps<ElementType>>,\n 'Progress'\n)\n"],"mappings":"uLA+CA,SAAS,EACP,CACE,WACA,WACA,YACA,QACA,YACA,UACA,QACA,QAAQ,EACR,GAAG,GAEL,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAe,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAC/C,EAAa,EACjB,eACA,GAAS,CAAC,EAAqB,GAAQ,aAAa,EACpD,CACE,UACA,UACF,EACA,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CACE,GAAI,EACJ,UAAW,EACX,MAAO,CAAE,MAAO,GAAG,EAAa,GAAI,GAAG,CAAM,EACxC,KAGI,EADT,EAAA,cAAC,OAAD,CAAM,UAAU,QAAyB,EAAf,CAAe,CAChC,CAEf,CAEA,MAAa,EAAc,EACzB,EACA,aACF,ECTA,SAAS,EACP,CACE,aAAc,EACd,WACA,WACA,YACA,QACA,YACA,SACA,cACA,QACA,YACA,UACA,QACA,QAAQ,EACR,GAAG,GAEL,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAAW,WAAY,CAAS,EAC7C,EAAe,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAE/C,EACJ,IAAa,IAAA,GAAuB,EAAc,GAAG,EAAa,GAAK,IAAA,GAA9C,EACrB,EAAa,GAAQ,GAAS,GAE9B,EAAU,EAAM,EAChB,EAAc,GAAS,MAAQ,OAAO,GAAU,SAEhD,EAAwB,CAAE,GAAG,CAAM,EACrC,IAAW,IAAA,KAAW,EAAO,eAAiB,GAAG,EAAO,KAE5D,IAAM,EACJ,EAAA,cAAC,EAAD,CACE,GAAI,EACJ,UAAW,EACX,KAAK,cACL,gBAAe,EACf,gBAAe,EACf,gBAAe,IACf,aAAY,IAAc,OAAO,GAAU,SAAW,EAAQ,IAAA,IAC9D,kBAAiB,CAAC,GAAa,EAAc,EAAU,IAAA,GACvD,MAAO,EACF,KAKI,EAHT,EAAA,cAAC,EAAD,CAAuB,WAAiB,QAAgB,UAAS,MAAO,CAE3D,EADV,CACU,CACJ,EAKb,OAFK,EAGH,EAAA,cAAC,MAAD,CAAK,UAAU,2BAYV,EAXH,EAAA,cAAC,MAAD,CACE,UAAW,EAAW,SAAU,EAAQ,0BAA4B,qBAAqB,CAQtF,EANF,EACC,EAAA,cAAC,OAAD,CAAM,UAAU,cAAc,GAAI,EAAc,EAAU,IAAA,EAEpD,EADH,CACG,EACJ,KACH,EAAY,EAAA,cAAC,OAAD,CAAM,UAAU,aAAmC,EAApB,EAAa,GAAO,EAAI,IACjE,EACJ,CACE,EAfiB,CAiB1B,CAEA,MAAa,EAAW,EACtB,EACA,UACF"}
@@ -1,2 +1,2 @@
1
- import"./focus-ring-SR_LwaN7.js";import{c as e}from"./slot-CNhFZdHF.js";import{t}from"./useForkedRef-DVEfT-KI.js";import{n,t as r}from"./FormHelp-AE6_iSLJ.js";import{t as i}from"./validationClassName-gRGs4KBm.js";import{t as a}from"./renderFormCheck-DN_-V62U.js";import{n as o,r as s}from"./unhandledProps-9Kdj7WVf.js";import{t as c}from"./flex-CmlJbKVj.js";import l,{createContext as u,forwardRef as d,useContext as f,useRef as p}from"react";import m from"classnames";import{useRadio as h,useRadioGroup as g}from"react-aria";import{useRadioGroupState as _}from"react-stately";const v=u(null),y=[...o,`form`,`name`,`required`,`tabIndex`],b=d(({button:n,children:r,className:o,color:c,disabled:u,id:d,label:g,size:_,style:b,...x},S)=>{let C=f(v);if(!C)throw Error(`Radio must be rendered inside a RadioGroup.`);let{describedBy:w,state:T,valid:E}=C,D=T.isInvalid,O=p(null),k=t(S,O),A=g??r,{inputProps:j}=h({...x,children:A,isDisabled:u},T,O),M=m(i(D,E));return a({button:n,className:o,color:c,input:l.createElement(`input`,{...s(j,x,y),"aria-describedby":e(x[`aria-describedby`],w),className:M,id:d,ref:k}),invalid:D,label:A,size:_,style:b,valid:E})});b.displayName=`Radio`;const x=d(({children:t,className:a,defaultValue:o,description:u,disabled:d,errorMessage:f,invalid:p,label:h,name:y,onChange:b,orientation:x,required:S,valid:C,value:w,...T},E)=>{let D={...T,defaultValue:o,description:u,errorMessage:f,isDisabled:d,isInvalid:p,isRequired:S,label:h,name:y,onChange:b,orientation:x,value:w},O=_(D),{radioGroupProps:k,labelProps:A,descriptionProps:j,errorMessageProps:M}=g(D,O),N=m(`form-field`,i(p,C),a),P=e(!!u&&j.id,!!(p&&f)&&M.id),F=l.createElement(v.Provider,{value:{describedBy:P,state:O,valid:C}},t);return l.createElement(`fieldset`,{...s(k,T,[`onBlur`,`onFocus`]),"aria-describedby":e(P,T[`aria-describedby`]),className:N,ref:E},h&&l.createElement(`legend`,{className:`form-label`,...A},h),x===`horizontal`?l.createElement(c,{wrap:`wrap`,gap:`md`},F):F,u&&l.createElement(r,j,u),p&&f&&l.createElement(n,{invalid:!0,...M},f))});x.displayName=`RadioGroup`;export{b as n,x as t};
2
- //# sourceMappingURL=radio-DOFYCfJi.js.map
1
+ import"./focus-ring-SR_LwaN7.js";import{c as e}from"./slot-CNhFZdHF.js";import{t}from"./useForkedRef-DVEfT-KI.js";import{n,t as r}from"./FormHelp-AE6_iSLJ.js";import{t as i}from"./validationClassName-gRGs4KBm.js";import{t as a}from"./renderFormCheck-DN_-V62U.js";import{n as o,r as s}from"./unhandledProps-9Kdj7WVf.js";import{t as c}from"./flex-B52oLCCC.js";import l,{createContext as u,forwardRef as d,useContext as f,useRef as p}from"react";import m from"classnames";import{useRadio as h,useRadioGroup as g}from"react-aria";import{useRadioGroupState as _}from"react-stately";const v=u(null),y=[...o,`form`,`name`,`required`,`tabIndex`],b=d(({button:n,children:r,className:o,color:c,disabled:u,id:d,label:g,size:_,style:b,...x},S)=>{let C=f(v);if(!C)throw Error(`Radio must be rendered inside a RadioGroup.`);let{describedBy:w,state:T,valid:E}=C,D=T.isInvalid,O=p(null),k=t(S,O),A=g??r,{inputProps:j}=h({...x,children:A,isDisabled:u},T,O),M=m(i(D,E));return a({button:n,className:o,color:c,input:l.createElement(`input`,{...s(j,x,y),"aria-describedby":e(x[`aria-describedby`],w),className:M,id:d,ref:k}),invalid:D,label:A,size:_,style:b,valid:E})});b.displayName=`Radio`;const x=d(({children:t,className:a,defaultValue:o,description:u,disabled:d,errorMessage:f,invalid:p,label:h,name:y,onChange:b,orientation:x,required:S,valid:C,value:w,...T},E)=>{let D={...T,defaultValue:o,description:u,errorMessage:f,isDisabled:d,isInvalid:p,isRequired:S,label:h,name:y,onChange:b,orientation:x,value:w},O=_(D),{radioGroupProps:k,labelProps:A,descriptionProps:j,errorMessageProps:M}=g(D,O),N=m(`form-field`,i(p,C),a),P=e(!!u&&j.id,!!(p&&f)&&M.id),F=l.createElement(v.Provider,{value:{describedBy:P,state:O,valid:C}},t);return l.createElement(`fieldset`,{...s(k,T,[`onBlur`,`onFocus`]),"aria-describedby":e(P,T[`aria-describedby`]),className:N,ref:E},h&&l.createElement(`legend`,{className:`form-label`,...A},h),x===`horizontal`?l.createElement(c,{wrap:`wrap`,gap:`md`},F):F,u&&l.createElement(r,j,u),p&&f&&l.createElement(n,{invalid:!0,...M},f))});x.displayName=`RadioGroup`;export{b as n,x as t};
2
+ //# sourceMappingURL=radio-B6gJdtoN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-DOFYCfJi.js","names":[],"sources":["../../src/components/radio/context.ts","../../src/components/radio/Radio.tsx","../../src/components/radio/RadioGroup.tsx"],"sourcesContent":["import { createContext } from 'react'\nimport { RadioGroupState } from 'react-stately'\n\nexport interface RadioGroupContextValue {\n state: RadioGroupState\n /**\n * `RadioGroup`'s own `valid` prop, mirrored here since it has no react-stately equivalent to\n * read off `state` the way `isInvalid` does — each `Radio` needs it to apply its own\n * `is-valid` class.\n */\n valid?: boolean\n /**\n * The ids of the group's description and error message, when they are rendered. Each item is\n * described by them too.\n */\n describedBy?: string\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null)\n","import React, { forwardRef, InputHTMLAttributes, ReactNode, useContext, useRef } from 'react'\nimport classNames from 'classnames'\nimport { AriaRadioProps, useRadio } from 'react-aria'\n\nimport { useForkedRef } from '../../hooks'\nimport { ContextColor } from '../../types'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { joinIds } from '../../utils/idRefs'\nimport { mergeUnhandledProps, TOGGLE_PROPS } from '../../utils/unhandledProps'\n\nimport { RadioGroupContext } from './context'\nimport { ButtonObject, renderFormCheck } from '../form/renderFormCheck'\n\nexport interface RadioProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'checked' | 'defaultChecked' | 'onChange' | 'size'\n> {\n /**\n * Create button-like radios. Combine with `<RadioGroup>` to build radio toggle-button groups.\n */\n button?: ButtonObject\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the radio indicator to one of Chassis context colors. Ignored when `button` is set.\n */\n color?: ContextColor\n /**\n * The id global attribute defines an identifier (ID) that must be unique in the whole document.\n */\n id?: string\n /**\n * The element represents a caption for a component.\n *\n * Children are accepted as an alias for this prop — `label` wins when both are given.\n * react-aria, which backs this component, calls the same thing `children`; this package renames\n * it to `label`, and honouring both means the shape React developers reach for first still\n * names the control instead of silently producing an unlabelled one.\n */\n label?: ReactNode\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * The value of the radio button, used to identify it within its `<RadioGroup>`.\n */\n value: string\n}\n\n// The group owns its radios' `name`, `form` and required state, and which one is the tab stop.\nconst RADIO_PROPS = [...TOGGLE_PROPS, 'form', 'name', 'required', 'tabIndex']\n\n// `<Radio>` must be rendered inside a `<RadioGroup>` — react-aria has no standalone\n// radio hook, only useRadio(props, RadioGroupState, ref), because a lone radio with no group is\n// not a meaningful accessible control (see https://chassis-ui.com/css/docs/forms/checkbox-radio).\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n ({ button, children, className, color, disabled, id, label, size, style, ...rest }, ref) => {\n const group = useContext(RadioGroupContext)\n\n if (!group) {\n throw new Error('Radio must be rendered inside a RadioGroup.')\n }\n\n const { describedBy: groupDescribedBy, state: groupState, valid } = group\n const invalid = groupState.isInvalid\n\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n\n // `label` is this package's name for what react-aria calls `children`. Accept either, so the\n // shape React developers reach for first (`<Radio>Label</Radio>`) names the control instead of\n // being silently dropped — see the note on `label` in `RadioProps`.\n const resolvedLabel = label ?? children\n\n const { inputProps } = useRadio(\n {\n ...rest,\n children: resolvedLabel,\n isDisabled: disabled\n } as AriaRadioProps,\n groupState,\n inputRef\n )\n\n const inputClassName = classNames(validationClassName(invalid, valid))\n\n return renderFormCheck({\n button,\n className,\n color,\n // Described by the group's description and error message, as react-aria intends, but only\n // by those the group renders (FORMS.md, gotcha 6).\n input: (\n <input\n {...mergeUnhandledProps(inputProps, rest, RADIO_PROPS)}\n aria-describedby={joinIds(rest['aria-describedby'], groupDescribedBy)}\n className={inputClassName}\n id={id}\n ref={forkedRef}\n />\n ),\n invalid,\n label: resolvedLabel,\n size,\n style,\n valid\n })\n }\n)\n\nRadio.displayName = 'Radio'\n","import React, { forwardRef, HTMLAttributes, ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { AriaRadioGroupProps, useRadioGroup } from 'react-aria'\nimport { RadioGroupProps as StatelyRadioGroupProps, useRadioGroupState } from 'react-stately'\n\nimport { validationClassName } from '../../utils/validationClassName'\nimport { joinIds } from '../../utils/idRefs'\nimport { mergeUnhandledProps } from '../../utils/unhandledProps'\n\nimport { RadioGroupContext } from './context'\nimport { FormFeedback } from '../form/FormFeedback'\nimport { FormHelp } from '../form/FormHelp'\nimport { Flex } from '../flex'\n\nexport interface RadioGroupProps extends Omit<\n HTMLAttributes<HTMLFieldSetElement>,\n 'defaultValue' | 'onChange'\n> {\n /**\n * One or more `<Radio>` elements.\n */\n children: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The selected value, uncontrolled.\n */\n defaultValue?: string\n /**\n * A description for the group, rendered below the options.\n */\n description?: ReactNode\n /**\n * Disables every radio in the group.\n */\n disabled?: boolean\n /**\n * An error message for the group, rendered below the options when `invalid` is set.\n */\n errorMessage?: ReactNode\n /**\n * Set group validation state to invalid.\n */\n invalid?: boolean\n /**\n * The group's caption, rendered as a `<legend>`.\n */\n label?: ReactNode\n /**\n * The name for the group, used for native form submission.\n */\n name?: string\n /**\n * Callback fired when the selected value changes.\n */\n onChange?: (value: string) => void\n /**\n * Lay the group's radios out on the same horizontal row instead of stacking them.\n */\n orientation?: 'horizontal' | 'vertical'\n /**\n * Marks the group as required.\n */\n required?: boolean\n /**\n * Set group validation state to valid.\n */\n valid?: boolean\n /**\n * The selected value, controlled.\n */\n value?: string\n}\n\nexport const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(\n (\n {\n children,\n className,\n defaultValue,\n description,\n disabled,\n errorMessage,\n invalid,\n label,\n name,\n onChange,\n orientation,\n required,\n valid,\n value,\n ...rest\n },\n ref\n ) => {\n const groupProps = {\n ...rest,\n defaultValue,\n description,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isRequired: required,\n label,\n name,\n onChange,\n orientation,\n value\n }\n\n const state = useRadioGroupState(groupProps as StatelyRadioGroupProps)\n const { radioGroupProps, labelProps, descriptionProps, errorMessageProps } = useRadioGroup(\n groupProps as AriaRadioGroupProps,\n state\n )\n\n const _className = classNames('form-field', validationClassName(invalid, valid), className)\n\n // Only the ids this group renders. react-aria's own describe the group and every item by a\n // description and an error message whether or not they exist (FORMS.md, gotcha 6).\n const describedBy = joinIds(\n Boolean(description) && descriptionProps.id,\n Boolean(invalid && errorMessage) && errorMessageProps.id\n )\n\n const items = (\n <RadioGroupContext.Provider value={{ describedBy, state, valid }}>\n {children}\n </RadioGroupContext.Provider>\n )\n\n return (\n <fieldset\n {...mergeUnhandledProps(radioGroupProps, rest, ['onBlur', 'onFocus'])}\n aria-describedby={joinIds(describedBy, rest['aria-describedby'])}\n className={_className}\n ref={ref}\n >\n {label && (\n <legend className=\"form-label\" {...labelProps}>\n {label}\n </legend>\n )}\n {orientation === 'horizontal' ? (\n <Flex wrap=\"wrap\" gap=\"md\">\n {items}\n </Flex>\n ) : (\n items\n )}\n {description && <FormHelp {...descriptionProps}>{description}</FormHelp>}\n {invalid && errorMessage && (\n <FormFeedback invalid {...errorMessageProps}>\n {errorMessage}\n </FormFeedback>\n )}\n </fieldset>\n )\n }\n)\n\nRadioGroup.displayName = 'RadioGroup'\n"],"mappings":"ikBAkBA,MAAa,EAAoB,EAA6C,IAAI,ECmC5E,EAAc,CAAC,GAAG,EAAc,OAAQ,OAAQ,WAAY,UAAU,EAK/D,EAAQ,GAClB,CAAE,SAAQ,WAAU,YAAW,QAAO,WAAU,KAAI,QAAO,OAAM,QAAO,GAAG,GAAQ,IAAQ,CAC1F,IAAM,EAAQ,EAAW,CAAiB,EAE1C,GAAI,CAAC,EACH,MAAU,MAAM,6CAA6C,EAG/D,GAAM,CAAE,YAAa,EAAkB,MAAO,EAAY,SAAU,EAC9D,EAAU,EAAW,UAErB,EAAW,EAAyB,IAAI,EACxC,EAAY,EAAa,EAAK,CAAQ,EAKtC,EAAgB,GAAS,EAEzB,CAAE,cAAe,EACrB,CACE,GAAG,EACH,SAAU,EACV,WAAY,CACd,EACA,EACA,CACF,EAEM,EAAiB,EAAW,EAAoB,EAAS,CAAK,CAAC,EAErE,OAAO,EAAgB,CACrB,SACA,YACA,QAGA,MACE,EAAA,cAAC,QAAD,CACE,GAAI,EAAoB,EAAY,EAAM,CAAW,EACrD,mBAAkB,EAAQ,EAAK,oBAAqB,CAAgB,EACpE,UAAW,EACP,KACJ,IAAK,CACN,CAAA,EAEH,UACA,MAAO,EACP,OACA,QACA,OACF,CAAC,CACH,CACF,EAEA,EAAM,YAAc,QCrCpB,MAAa,EAAa,GAEtB,CACE,WACA,YACA,eACA,cACA,WACA,eACA,UACA,QACA,OACA,WACA,cACA,WACA,QACA,QACA,GAAG,GAEL,IACG,CACH,IAAM,EAAa,CACjB,GAAG,EACH,eACA,cACA,eACA,WAAY,EACZ,UAAW,EACX,WAAY,EACZ,QACA,OACA,WACA,cACA,OACF,EAEM,EAAQ,EAAmB,CAAoC,EAC/D,CAAE,kBAAiB,aAAY,mBAAkB,qBAAsB,EAC3E,EACA,CACF,EAEM,EAAa,EAAW,aAAc,EAAoB,EAAS,CAAK,EAAG,CAAS,EAIpF,EAAc,EAClB,EAAQ,GAAgB,EAAiB,GACzC,GAAQ,GAAW,IAAiB,EAAkB,EACxD,EAEM,EACJ,EAAA,cAAC,EAAkB,SAAnB,CAA4B,MAAO,CAAE,cAAa,QAAO,OAAM,CAEnC,EADzB,CACyB,EAG9B,OACE,EAAA,cAAC,WAAD,CACE,GAAI,EAAoB,EAAiB,EAAM,CAAC,SAAU,SAAS,CAAC,EACpE,mBAAkB,EAAQ,EAAa,EAAK,mBAAmB,EAC/D,UAAW,EACN,KAoBG,EAlBP,GACC,EAAA,cAAC,SAAD,CAAQ,UAAU,aAAa,GAAI,CAE3B,EADL,CACK,EAET,IAAgB,aACf,EAAA,cAAC,EAAD,CAAM,KAAK,OAAO,IAAI,IAEhB,EADH,CACG,EAEN,EAED,GAAe,EAAA,cAAC,EAAa,EAAmB,CAAsB,EACtE,GAAW,GACV,EAAA,cAAC,EAAD,CAAc,QAAA,GAAQ,GAAI,CAEZ,EADX,CACW,CAER,CAEd,CACF,EAEA,EAAW,YAAc"}
1
+ {"version":3,"file":"radio-B6gJdtoN.js","names":[],"sources":["../../src/components/radio/context.ts","../../src/components/radio/Radio.tsx","../../src/components/radio/RadioGroup.tsx"],"sourcesContent":["import { createContext } from 'react'\nimport { RadioGroupState } from 'react-stately'\n\nexport interface RadioGroupContextValue {\n state: RadioGroupState\n /**\n * `RadioGroup`'s own `valid` prop, mirrored here since it has no react-stately equivalent to\n * read off `state` the way `isInvalid` does — each `Radio` needs it to apply its own\n * `is-valid` class.\n */\n valid?: boolean\n /**\n * The ids of the group's description and error message, when they are rendered. Each item is\n * described by them too.\n */\n describedBy?: string\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null)\n","import React, { forwardRef, InputHTMLAttributes, ReactNode, useContext, useRef } from 'react'\nimport classNames from 'classnames'\nimport { AriaRadioProps, useRadio } from 'react-aria'\n\nimport { useForkedRef } from '../../hooks'\nimport { ContextColor } from '../../types'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { joinIds } from '../../utils/idRefs'\nimport { mergeUnhandledProps, TOGGLE_PROPS } from '../../utils/unhandledProps'\n\nimport { RadioGroupContext } from './context'\nimport { ButtonObject, renderFormCheck } from '../form/renderFormCheck'\n\nexport interface RadioProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'checked' | 'defaultChecked' | 'onChange' | 'size'\n> {\n /**\n * Create button-like radios. Combine with `<RadioGroup>` to build radio toggle-button groups.\n */\n button?: ButtonObject\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the radio indicator to one of Chassis context colors. Ignored when `button` is set.\n */\n color?: ContextColor\n /**\n * The id global attribute defines an identifier (ID) that must be unique in the whole document.\n */\n id?: string\n /**\n * The element represents a caption for a component.\n *\n * Children are accepted as an alias for this prop — `label` wins when both are given.\n * react-aria, which backs this component, calls the same thing `children`; this package renames\n * it to `label`, and honouring both means the shape React developers reach for first still\n * names the control instead of silently producing an unlabelled one.\n */\n label?: ReactNode\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * The value of the radio button, used to identify it within its `<RadioGroup>`.\n */\n value: string\n}\n\n// The group owns its radios' `name`, `form` and required state, and which one is the tab stop.\nconst RADIO_PROPS = [...TOGGLE_PROPS, 'form', 'name', 'required', 'tabIndex']\n\n// `<Radio>` must be rendered inside a `<RadioGroup>` — react-aria has no standalone\n// radio hook, only useRadio(props, RadioGroupState, ref), because a lone radio with no group is\n// not a meaningful accessible control (see https://chassis-ui.com/css/docs/forms/checkbox-radio).\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n ({ button, children, className, color, disabled, id, label, size, style, ...rest }, ref) => {\n const group = useContext(RadioGroupContext)\n\n if (!group) {\n throw new Error('Radio must be rendered inside a RadioGroup.')\n }\n\n const { describedBy: groupDescribedBy, state: groupState, valid } = group\n const invalid = groupState.isInvalid\n\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n\n // `label` is this package's name for what react-aria calls `children`. Accept either, so the\n // shape React developers reach for first (`<Radio>Label</Radio>`) names the control instead of\n // being silently dropped — see the note on `label` in `RadioProps`.\n const resolvedLabel = label ?? children\n\n const { inputProps } = useRadio(\n {\n ...rest,\n children: resolvedLabel,\n isDisabled: disabled\n } as AriaRadioProps,\n groupState,\n inputRef\n )\n\n const inputClassName = classNames(validationClassName(invalid, valid))\n\n return renderFormCheck({\n button,\n className,\n color,\n // Described by the group's description and error message, as react-aria intends, but only\n // by those the group renders (FORMS.md, gotcha 6).\n input: (\n <input\n {...mergeUnhandledProps(inputProps, rest, RADIO_PROPS)}\n aria-describedby={joinIds(rest['aria-describedby'], groupDescribedBy)}\n className={inputClassName}\n id={id}\n ref={forkedRef}\n />\n ),\n invalid,\n label: resolvedLabel,\n size,\n style,\n valid\n })\n }\n)\n\nRadio.displayName = 'Radio'\n","import React, { forwardRef, HTMLAttributes, ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { AriaRadioGroupProps, useRadioGroup } from 'react-aria'\nimport { RadioGroupProps as StatelyRadioGroupProps, useRadioGroupState } from 'react-stately'\n\nimport { validationClassName } from '../../utils/validationClassName'\nimport { joinIds } from '../../utils/idRefs'\nimport { mergeUnhandledProps } from '../../utils/unhandledProps'\n\nimport { RadioGroupContext } from './context'\nimport { FormFeedback } from '../form/FormFeedback'\nimport { FormHelp } from '../form/FormHelp'\nimport { Flex } from '../flex'\n\nexport interface RadioGroupProps extends Omit<\n HTMLAttributes<HTMLFieldSetElement>,\n 'defaultValue' | 'onChange'\n> {\n /**\n * One or more `<Radio>` elements.\n */\n children: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The selected value, uncontrolled.\n */\n defaultValue?: string\n /**\n * A description for the group, rendered below the options.\n */\n description?: ReactNode\n /**\n * Disables every radio in the group.\n */\n disabled?: boolean\n /**\n * An error message for the group, rendered below the options when `invalid` is set.\n */\n errorMessage?: ReactNode\n /**\n * Set group validation state to invalid.\n */\n invalid?: boolean\n /**\n * The group's caption, rendered as a `<legend>`.\n */\n label?: ReactNode\n /**\n * The name for the group, used for native form submission.\n */\n name?: string\n /**\n * Callback fired when the selected value changes.\n */\n onChange?: (value: string) => void\n /**\n * Lay the group's radios out on the same horizontal row instead of stacking them.\n */\n orientation?: 'horizontal' | 'vertical'\n /**\n * Marks the group as required.\n */\n required?: boolean\n /**\n * Set group validation state to valid.\n */\n valid?: boolean\n /**\n * The selected value, controlled.\n */\n value?: string\n}\n\nexport const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(\n (\n {\n children,\n className,\n defaultValue,\n description,\n disabled,\n errorMessage,\n invalid,\n label,\n name,\n onChange,\n orientation,\n required,\n valid,\n value,\n ...rest\n },\n ref\n ) => {\n const groupProps = {\n ...rest,\n defaultValue,\n description,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isRequired: required,\n label,\n name,\n onChange,\n orientation,\n value\n }\n\n const state = useRadioGroupState(groupProps as StatelyRadioGroupProps)\n const { radioGroupProps, labelProps, descriptionProps, errorMessageProps } = useRadioGroup(\n groupProps as AriaRadioGroupProps,\n state\n )\n\n const _className = classNames('form-field', validationClassName(invalid, valid), className)\n\n // Only the ids this group renders. react-aria's own describe the group and every item by a\n // description and an error message whether or not they exist (FORMS.md, gotcha 6).\n const describedBy = joinIds(\n Boolean(description) && descriptionProps.id,\n Boolean(invalid && errorMessage) && errorMessageProps.id\n )\n\n const items = (\n <RadioGroupContext.Provider value={{ describedBy, state, valid }}>\n {children}\n </RadioGroupContext.Provider>\n )\n\n return (\n <fieldset\n {...mergeUnhandledProps(radioGroupProps, rest, ['onBlur', 'onFocus'])}\n aria-describedby={joinIds(describedBy, rest['aria-describedby'])}\n className={_className}\n ref={ref}\n >\n {label && (\n <legend className=\"form-label\" {...labelProps}>\n {label}\n </legend>\n )}\n {orientation === 'horizontal' ? (\n <Flex wrap=\"wrap\" gap=\"md\">\n {items}\n </Flex>\n ) : (\n items\n )}\n {description && <FormHelp {...descriptionProps}>{description}</FormHelp>}\n {invalid && errorMessage && (\n <FormFeedback invalid {...errorMessageProps}>\n {errorMessage}\n </FormFeedback>\n )}\n </fieldset>\n )\n }\n)\n\nRadioGroup.displayName = 'RadioGroup'\n"],"mappings":"ikBAkBA,MAAa,EAAoB,EAA6C,IAAI,ECmC5E,EAAc,CAAC,GAAG,EAAc,OAAQ,OAAQ,WAAY,UAAU,EAK/D,EAAQ,GAClB,CAAE,SAAQ,WAAU,YAAW,QAAO,WAAU,KAAI,QAAO,OAAM,QAAO,GAAG,GAAQ,IAAQ,CAC1F,IAAM,EAAQ,EAAW,CAAiB,EAE1C,GAAI,CAAC,EACH,MAAU,MAAM,6CAA6C,EAG/D,GAAM,CAAE,YAAa,EAAkB,MAAO,EAAY,SAAU,EAC9D,EAAU,EAAW,UAErB,EAAW,EAAyB,IAAI,EACxC,EAAY,EAAa,EAAK,CAAQ,EAKtC,EAAgB,GAAS,EAEzB,CAAE,cAAe,EACrB,CACE,GAAG,EACH,SAAU,EACV,WAAY,CACd,EACA,EACA,CACF,EAEM,EAAiB,EAAW,EAAoB,EAAS,CAAK,CAAC,EAErE,OAAO,EAAgB,CACrB,SACA,YACA,QAGA,MACE,EAAA,cAAC,QAAD,CACE,GAAI,EAAoB,EAAY,EAAM,CAAW,EACrD,mBAAkB,EAAQ,EAAK,oBAAqB,CAAgB,EACpE,UAAW,EACP,KACJ,IAAK,CACN,CAAA,EAEH,UACA,MAAO,EACP,OACA,QACA,OACF,CAAC,CACH,CACF,EAEA,EAAM,YAAc,QCrCpB,MAAa,EAAa,GAEtB,CACE,WACA,YACA,eACA,cACA,WACA,eACA,UACA,QACA,OACA,WACA,cACA,WACA,QACA,QACA,GAAG,GAEL,IACG,CACH,IAAM,EAAa,CACjB,GAAG,EACH,eACA,cACA,eACA,WAAY,EACZ,UAAW,EACX,WAAY,EACZ,QACA,OACA,WACA,cACA,OACF,EAEM,EAAQ,EAAmB,CAAoC,EAC/D,CAAE,kBAAiB,aAAY,mBAAkB,qBAAsB,EAC3E,EACA,CACF,EAEM,EAAa,EAAW,aAAc,EAAoB,EAAS,CAAK,EAAG,CAAS,EAIpF,EAAc,EAClB,EAAQ,GAAgB,EAAiB,GACzC,GAAQ,GAAW,IAAiB,EAAkB,EACxD,EAEM,EACJ,EAAA,cAAC,EAAkB,SAAnB,CAA4B,MAAO,CAAE,cAAa,QAAO,OAAM,CAEnC,EADzB,CACyB,EAG9B,OACE,EAAA,cAAC,WAAD,CACE,GAAI,EAAoB,EAAiB,EAAM,CAAC,SAAU,SAAS,CAAC,EACpE,mBAAkB,EAAQ,EAAa,EAAK,mBAAmB,EAC/D,UAAW,EACN,KAoBG,EAlBP,GACC,EAAA,cAAC,SAAD,CAAQ,UAAU,aAAa,GAAI,CAE3B,EADL,CACK,EAET,IAAgB,aACf,EAAA,cAAC,EAAD,CAAM,KAAK,OAAO,IAAI,IAEhB,EADH,CACG,EAEN,EAED,GAAe,EAAA,cAAC,EAAa,EAAmB,CAAsB,EACtE,GAAW,GACV,EAAA,cAAC,EAAD,CAAc,QAAA,GAAQ,GAAI,CAEZ,EADX,CACW,CAER,CAEd,CACF,EAEA,EAAW,YAAc"}
@@ -1,4 +1,4 @@
1
- import { a as Shapes, n as ContextColor } from "./types-CS_40Txv.js";
1
+ import { r as ContextColor, s as Shapes } from "./types-D6FM7bYR.js";
2
2
  import React, { CSSProperties, ReactNode } from "react";
3
3
  //#region src/components/form/renderFormCheck.d.ts
4
4
  type ButtonObject = {
@@ -21,4 +21,4 @@ type ButtonObject = {
21
21
  };
22
22
  //#endregion
23
23
  export { ButtonObject as t };
24
- //# sourceMappingURL=renderFormCheck-DZh_5Df8.d.ts.map
24
+ //# sourceMappingURL=renderFormCheck-nKgpa_a3.d.ts.map
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./colorClassNames-CEh5Yzfp.js";import{a as n,i as r}from"./breakpoints-CGk8szzR.js";import i,{Fragment as a,forwardRef as o}from"react";import s from"classnames";const c=(e,t)=>e===!0?`${t}flex-fill`:e===`auto`?`${t}w-auto`:typeof e==`number`||typeof e==`string`?Number(e)===12?`${t}w-100`:`${t}w-${e}/12`:null;function l({children:e,animation:a,className:o,color:l,component:u,span:d,...f},p){let m=u??`span`,h=s(`skeleton`,a&&`skeleton-${a}`,l&&t[l],r([n(d,c)]),o);return i.createElement(m,{className:h,...f,ref:p},e)}const u=e(l,`Skeleton`);function d({children:e,color:t,component:n,loading:r,spans:o,...s},c){if(!r)return i.createElement(i.Fragment,null,e);let l=o===void 0?[void 0]:Array.isArray(o)?o:[o];return i.createElement(i.Fragment,null,l.map((e,r)=>i.createElement(a,{key:r},r>0&&` `,i.createElement(u,{component:n,span:e,color:t,...s,ref:r===0?c:void 0}))))}const f=o(d);f.displayName=`SkeletonLoader`;export{u as n,f as t};
2
+ //# sourceMappingURL=skeleton-Bjv9gGd3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton-Bjv9gGd3.js","names":[],"sources":["../../src/components/skeleton/Skeleton.tsx","../../src/components/skeleton/SkeletonLoader.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { WidthSpan, responsiveClassNames, responsiveProp } from '../../utils/breakpoints'\nimport { ContextColor, Responsive } from '../../types'\nimport { BG_COLOR_CLASS_NAMES } from '../../utils/colorClassNames'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype SkeletonOwnProps<C extends ElementType> = {\n /**\n * Adds `skeleton-{animation}` alongside the base `skeleton` class, so the element animates\n * itself as well as any nested `<Skeleton>` children. Nest plain `<Skeleton>` children inside\n * it for the glow pulse to reach them too, or apply `wave` to a container of one or more\n * `<Skeleton>` children for a directional sweep across the whole group.\n */\n animation?: 'glow' | 'wave'\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use an HTML element or a component —\n * e.g. `Avatar` or `Button`. Its own props are type-checked at the call site once passed here.\n *\n * @default 'span'\n */\n component?: C\n /**\n * Width of the skeleton in twelfths of its parent (`span={6}` is half, mapped to the\n * `w-{n}/12` class; `span={12}` is `w-100`), `'auto'` for its natural width (`w-auto`), or\n * `true` to fill the rest of a flex row (`flex-fill`). Unset by default, so the rendered\n * element's own intrinsic width applies — set it explicitly (e.g. `span={12}`) for a\n * full-width text line; leave it unset when `component` is something that sizes itself, like\n * `Avatar` or `Button`. An object sets the width from a breakpoint up: `{ base: 12, md: 6 }`.\n *\n * @type { Responsive<'auto' | number | string | boolean> }\n */\n span?: Responsive<WidthSpan>\n}\n\nexport type SkeletonProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n SkeletonOwnProps<C>\n>\n\ntype SkeletonComponent = (<C extends ElementType = 'span'>(\n props: SkeletonProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n// chassis-css has the fractions `w-1/12` to `w-11/12`; twelve twelfths is `w-100`.\nconst spanClassName = (span: WidthSpan, prefix: string) => {\n if (span === true) return `${prefix}flex-fill`\n if (span === 'auto') return `${prefix}w-auto`\n if (typeof span === 'number' || typeof span === 'string') {\n return Number(span) === 12 ? `${prefix}w-100` : `${prefix}w-${span}/12`\n }\n return null\n}\n\nfunction SkeletonRender<C extends ElementType = 'span'>(\n { children, animation, className, color, component, span, ...rest }: SkeletonProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames(\n 'skeleton',\n animation && `skeleton-${animation}`,\n color && BG_COLOR_CLASS_NAMES[color],\n responsiveClassNames([responsiveProp(span, spanClassName)]),\n className\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Skeleton = createPolymorphicComponent<SkeletonComponent>(\n SkeletonRender as ForwardRefRenderFunction<Element, SkeletonProps<ElementType>>,\n 'Skeleton'\n)\n","import React, {\n ComponentPropsWithoutRef,\n ElementType,\n ForwardedRef,\n forwardRef,\n ForwardRefRenderFunction,\n Fragment,\n ReactElement,\n ReactNode\n} from 'react'\n\nimport { WidthSpan } from '../../utils/breakpoints'\nimport { PolymorphicRef } from '../../utils/polymorphic'\nimport { ContextColor } from '../../types'\nimport { Skeleton, SkeletonProps } from './Skeleton'\n\ntype SkeletonLoaderOwnProps<C extends ElementType> = {\n /**\n * The real content, rendered unchanged (no wrapping element) once `loading` is `false`.\n */\n children: ReactNode\n /**\n * Sets the color of the generated skeleton lines to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the generated skeleton(s) — e.g. `Avatar` or `Button` — for swapping\n * non-text content, not just text runs. Its own props are type-checked at the call site once\n * passed here, same as `Skeleton`'s own `component` prop.\n *\n * @default 'span'\n */\n component?: C\n /**\n * Swaps `children` for one `<Skeleton>` per entry in `spans` while `true`.\n */\n loading: boolean\n /**\n * One skeleton line per entry, using the same values as `Skeleton`'s `span` prop — e.g.\n * `[12, 6]` for a full-width line followed by a half-width one. A single value (e.g. `6`) is\n * shorthand for a single line, equivalent to `[6]`. Leave unset for a single skeleton sized by\n * `component`'s own intrinsic width instead — e.g. an `Avatar`'s `size` prop. Rendered instead\n * of `children` while `loading` is `true`; ignored once `loading` is `false`.\n *\n * @type { 'auto' | number | string | boolean | Array<'auto' | number | string | boolean> }\n */\n spans?: WidthSpan | WidthSpan[]\n}\n\n// Spelled out rather than `PolymorphicComponentProps`, which adds `asChild`: `SkeletonLoader`\n// renders no element of its own (it swaps its `children` for generated `Skeleton` lines), so\n// there's nothing for a child element to stand in for. (`Omit`-ing it from that type instead\n// breaks `C`'s inference from `component`.)\nexport type SkeletonLoaderProps<C extends ElementType = 'span'> = SkeletonLoaderOwnProps<C> &\n Omit<ComponentPropsWithoutRef<C>, keyof SkeletonLoaderOwnProps<C> | 'asChild'>\n\ntype SkeletonLoaderComponent = (<C extends ElementType = 'span'>(\n props: SkeletonLoaderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n/**\n * A pure content swap: no wrapping element of its own, so `.skeleton-glow`/`.skeleton-wave`\n * won't reach the lines it generates unless applied to a container already in the tree — see\n * `Skeleton`'s own docs for why the animation classes need a `.skeleton` descendant to animate.\n *\n * The ref goes to the first generated skeleton while `loading`, and is `null` once the real\n * content shows: that content is the caller's, with refs of its own.\n */\nfunction SkeletonLoaderRender<C extends ElementType = 'span'>(\n { children, color, component, loading, spans, ...rest }: SkeletonLoaderProps<C>,\n ref: ForwardedRef<Element>\n) {\n if (!loading) return <>{children}</>\n\n const spanList = spans === undefined ? [undefined] : Array.isArray(spans) ? spans : [spans]\n\n return (\n <>\n {spanList.map((span, index) => (\n // eslint-disable-next-line react/no-array-index-key -- `spans` is a static prop array\n <Fragment key={index}>\n {index > 0 && ' '}\n {/* `rest` is `C`'s own props minus `SkeletonLoaderOwnProps`'s keys, which structurally\n satisfies what `Skeleton<C>` wants (`C`'s own props minus its own, different, key\n set) — TS can't verify that across two independently-generic components, hence the\n cast. */}\n <Skeleton\n component={component}\n span={span}\n color={color}\n {...(rest as unknown as SkeletonProps<C>)}\n ref={index === 0 ? ref : undefined}\n />\n </Fragment>\n ))}\n </>\n )\n}\n\n// `forwardRef` takes a render function that isn't generic, so the generic type is cast back on,\n// as `createPolymorphicComponent` does.\nexport const SkeletonLoader = forwardRef(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n SkeletonLoaderRender as ForwardRefRenderFunction<Element, any>\n) as unknown as SkeletonLoaderComponent\n\nSkeletonLoader.displayName = 'SkeletonLoader'\n"],"mappings":"+PA0DA,MAAM,GAAiB,EAAiB,IAClC,IAAS,GAAa,GAAG,EAAO,WAChC,IAAS,OAAe,GAAG,EAAO,QAClC,OAAO,GAAS,UAAY,OAAO,GAAS,SACvC,OAAO,CAAI,IAAM,GAAK,GAAG,EAAO,OAAS,GAAG,EAAO,IAAI,EAAK,KAE9D,KAGT,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,QAAO,YAAW,OAAM,GAAG,GAC7D,EACA,CACA,IAAM,EAAY,GAAa,OACzB,EAAa,EACjB,WACA,GAAa,YAAY,IACzB,GAAS,EAAqB,GAC9B,EAAqB,CAAC,EAAe,EAAM,CAAa,CAAC,CAAC,EAC1D,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAW,EACtB,EACA,UACF,ECtBA,SAAS,EACP,CAAE,WAAU,QAAO,YAAW,UAAS,QAAO,GAAG,GACjD,EACA,CACA,GAAI,CAAC,EAAS,OAAO,EAAA,cAAA,EAAA,SAAA,KAAG,CAAW,EAEnC,IAAM,EAAW,IAAU,IAAA,GAAY,CAAC,IAAA,EAAS,EAAI,MAAM,QAAQ,CAAK,EAAI,EAAQ,CAAC,CAAK,EAE1F,OACE,EAAA,cAAA,EAAA,SAAA,KACG,EAAS,KAAK,EAAM,IAEnB,EAAA,cAAC,EAAD,CAAU,IAAK,CAaL,EAZP,EAAQ,GAAK,IAKd,EAAA,cAAC,EAAD,CACa,YACL,OACC,QACP,GAAK,EACL,IAAK,IAAU,EAAI,EAAM,IAAA,EAC1B,CAAA,CACO,CACX,CACD,CAEN,CAIA,MAAa,EAAiB,EAE5B,CACF,EAEA,EAAe,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"spacingClassName-DVhk8m3P.js","names":[],"sources":["../../src/utils/spacingClassName.ts"],"sourcesContent":["import { Spacing } from '../types'\n\n// A spacing prop (`gap`/`rowGap`/`gutter`/...) is typed `Spacing | 0`, but `0` is meaningful\n// (chassis-css's `gap-0` etc. exist) while `undefined`/`false`-ish values mean \"not set\" — a\n// plain truthy check would drop `0`, so every caller needs this same `typeof` guard instead.\n// Shared by `Flex`, `Stack`, `Row`, and `CardBody`'s own `layoutClassNames`/`_className` builders,\n// which otherwise duplicated it once per spacing prop (`gap`, `rowGap`, `columnGap`, `gutter`,\n// `gutterX`, `gutterY`, ...).\nexport const spacingClassName = (\n base: string,\n value: Spacing | 0 | undefined,\n prefix = ''\n): string | null =>\n typeof value === 'string' || typeof value === 'number' ? `${prefix}${base}-${value}` : null\n"],"mappings":"AAQA,MAAa,GACX,EACA,EACA,EAAS,KAET,OAAO,GAAU,UAAY,OAAO,GAAU,SAAW,GAAG,IAAS,EAAK,GAAG,IAAU"}
1
+ {"version":3,"file":"spacingClassName-DVhk8m3P.js","names":[],"sources":["../../src/utils/spacingClassName.ts"],"sourcesContent":["import { Spacing } from '../types'\n\n// A spacing prop (`gap`/`rowGap`/`columnGap`) is typed `Spacing | 0`, but `0` is meaningful\n// (chassis-css's `gap-0` etc. exist) while `undefined`/`false`-ish values mean \"not set\" — a\n// plain truthy check would drop `0`, so every caller needs this same `typeof` guard instead.\n// Shared by `Flex`, `Stack` and `CardBody`'s own `layoutClassNames`/`_className` builders, which\n// otherwise duplicated it once per spacing prop.\nexport const spacingClassName = (\n base: string,\n value: Spacing | 0 | undefined,\n prefix = ''\n): string | null =>\n typeof value === 'string' || typeof value === 'number' ? `${prefix}${base}-${value}` : null\n"],"mappings":"AAOA,MAAa,GACX,EACA,EACA,EAAS,KAET,OAAO,GAAU,UAAY,OAAO,GAAU,SAAW,GAAG,IAAS,EAAK,GAAG,IAAU"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{n as t}from"./colorClassNames-CEh5Yzfp.js";import{t as n}from"./VisuallyHidden-C2dM7HhC.js";import r from"react";import i from"classnames";const a={sm:`spinner-sm`};function o({className:e,color:o,component:s,size:c,variant:l=`border`,visuallyHiddenLabel:u=`Loading...`,...d},f){let p=s??`div`,m=i(`spinner-${l}`,o?t[o]:null,c&&a[c],e);return r.createElement(p,{className:m,role:`status`,...d,ref:f},r.createElement(n,null,u))}const s=e(o,`Spinner`);export{s as t};
2
+ //# sourceMappingURL=spinner-DBuvQvMR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner-DBuvQvMR.js","names":[],"sources":["../../src/components/spinner/Spinner.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { ContextColor } from '../../types'\nimport { FG_COLOR_CLASS_NAMES } from '../../utils/colorClassNames'\nimport { VisuallyHidden } from '../visually-hidden/VisuallyHidden'\n\ntype SpinnerOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Renders a smaller spinner, with the `spinner-sm` class.\n */\n size?: 'sm'\n /**\n * Set the button variant to an outlined button or a ghost button.\n */\n variant?: 'border' | 'grow'\n /**\n * Set visually hidden label for accessibility purposes.\n */\n visuallyHiddenLabel?: string\n}\n\n// chassis-css sizes a spinner of either variant with the one `spinner-{size}` class. Whole class\n// names: see `utils/colorClassNames.ts`.\nconst SIZE_CLASS_NAMES: Record<NonNullable<SpinnerOwnProps<ElementType>['size']>, string> = {\n sm: 'spinner-sm'\n}\n\nexport type SpinnerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n SpinnerOwnProps<C>\n>\n\ntype SpinnerComponent = (<C extends ElementType = 'div'>(\n props: SpinnerProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction SpinnerRender<C extends ElementType = 'div'>(\n {\n className,\n color,\n component,\n size,\n variant = 'border',\n visuallyHiddenLabel = 'Loading...',\n ...rest\n }: SpinnerProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n `spinner-${variant}`,\n color ? FG_COLOR_CLASS_NAMES[color] : null,\n size && SIZE_CLASS_NAMES[size],\n className\n )\n\n return (\n <Component className={_className} role=\"status\" {...rest} ref={ref}>\n <VisuallyHidden>{visuallyHiddenLabel}</VisuallyHidden>\n </Component>\n )\n}\n\nexport const Spinner = createPolymorphicComponent<SpinnerComponent>(\n SpinnerRender as ForwardRefRenderFunction<Element, SpinnerProps<ElementType>>,\n 'Spinner'\n)\n"],"mappings":"iOAyCA,MAAM,EAAsF,CAC1F,GAAI,YACN,EAWA,SAAS,EACP,CACE,YACA,QACA,YACA,OACA,UAAU,SACV,sBAAsB,aACtB,GAAG,GAEL,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EACjB,WAAW,IACX,EAAQ,EAAqB,GAAS,KACtC,GAAQ,EAAiB,GACzB,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,KAAK,SAAS,GAAI,EAAW,KAEpD,EADT,EAAA,cAAC,EAAA,KAAgB,CAAoC,CAC5C,CAEf,CAEA,MAAa,EAAU,EACrB,EACA,SACF"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{a as t,i as n,n as r}from"./breakpoints-CGk8szzR.js";import{t as i}from"./spacingClassName-DVhk8m3P.js";import a from"react";import o from"classnames";const s=(e,t)=>`${t}${e===`vertical`?`vstack`:`hstack`}`;function c({children:e,className:c,component:l,direction:u=`horizontal`,gap:d,...f},p){let m=l??`div`,h=o(r(u)===void 0&&`hstack`,n([t(u,s)]),i(`gap`,d),c);return a.createElement(m,{className:h,...f,ref:p},e)}const l=e(c,`Stack`);export{l as t};
2
+ //# sourceMappingURL=stack-DK5F53VT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-DK5F53VT.js","names":[],"sources":["../../src/components/stack/Stack.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { baseValue, responsiveClassNames, responsiveProp } from '../../utils/breakpoints'\nimport { spacingClassName } from '../../utils/spacingClassName'\nimport { Responsive, Spacing } from '../../types'\n\nconst directionClassName = (direction: 'horizontal' | 'vertical', prefix: string) =>\n `${prefix}${direction === 'vertical' ? 'vstack' : 'hstack'}`\n\ntype StackOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Lays children out in a row (`horizontal`, the default, maps to `.hstack`) or a column\n * (`vertical`, maps to `.vstack`). An object switches the direction from a breakpoint up:\n * `{ base: 'vertical', md: 'horizontal' }`. The breakpoints are container queries, so they\n * require a `.contains-inline` ancestor (not applied by `Stack` itself — see the docs) to\n * establish the container context they evaluate against.\n */\n direction?: Responsive<'horizontal' | 'vertical'>\n /**\n * Spacing between children, mapped to the `gap-*` utility classes.\n *\n * @type { Spacing | 0 }\n */\n gap?: Spacing | 0\n}\n\nexport type StackProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n StackOwnProps<C>\n>\n\ntype StackComponent = (<C extends ElementType = 'div'>(\n props: StackProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction StackRender<C extends ElementType = 'div'>(\n { children, className, component, direction = 'horizontal', gap, ...rest }: StackProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n // An object with no `base` still starts from the default direction.\n baseValue(direction) === undefined && 'hstack',\n responsiveClassNames([responsiveProp(direction, directionClassName)]),\n spacingClassName('gap', gap),\n className\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Stack = createPolymorphicComponent<StackComponent>(\n StackRender as ForwardRefRenderFunction<Element, StackProps<ElementType>>,\n 'Stack'\n)\n"],"mappings":"6OAYA,MAAM,GAAsB,EAAsC,IAChE,GAAG,IAAS,IAAc,WAAa,SAAW,WAoCpD,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,YAAY,aAAc,MAAK,GAAG,GACpE,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAEjB,EAAU,CAAS,IAAM,IAAA,IAAa,SACtC,EAAqB,CAAC,EAAe,EAAW,CAAkB,CAAC,CAAC,EACpE,EAAiB,MAAO,CAAG,EAC3B,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAQ,EACnB,EACA,OACF"}
@@ -0,0 +1,2 @@
1
+ import{n as e,r as t}from"./tableClassName-DleBjOj2.js";import n,{forwardRef as r}from"react";const i=r(({align:r,bordered:i,borderless:a,caption:o,children:s,className:c,color:l,hover:u,responsive:d,sm:f,stacked:p,striped:m,...h},g)=>{let _=n.createElement(`table`,{...h,className:e({align:r,bordered:i,borderless:a,className:c,color:l,hover:u,sm:f,stacked:p,striped:m}),ref:g},o&&n.createElement(`caption`,null,o),s),v=t({responsive:d,stacked:p});return v?n.createElement(`div`,{className:v},_):_});i.displayName=`StaticTable`;export{i as t};
2
+ //# sourceMappingURL=static-table-uu297Liz.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static-table-D0M4oc_t.js","names":[],"sources":["../../src/components/static-table/StaticTable.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, TableHTMLAttributes } from 'react'\n\nimport { TableStyleProps, tableClassName, tableWrapperClassName } from '../../utils/tableClassName'\n\nexport interface StaticTableProps\n extends TableStyleProps, Omit<TableHTMLAttributes<HTMLTableElement>, 'align' | 'color'> {\n /**\n * Content shown above the table, functioning as a heading for it.\n */\n caption?: ReactNode\n /**\n * The table's own markup — plain `<thead>`/`<tbody>`/`<tfoot>`/`<tr>`/`<th>`/`<td>` elements,\n * rendered as-is.\n */\n children?: ReactNode\n /**\n * Convert rows into stacked label/value blocks below a container width, for tables with too\n * many columns to read comfortably even with horizontal scrolling. `true` always stacks; a\n * breakpoint name stacks only below it. Implies `responsive` when `responsive` isn't set\n * separately. Unlike `Table`, which derives each cell's label from its column header, a static\n * table has no collection to read labels from — give each `<td>` a `data-cell` attribute with\n * the label to show before its value.\n */\n stacked?: TableStyleProps['stacked']\n}\n\n// A plain, server-renderable `<table>` with `Table`'s styling props and none of its behavior — no\n// sorting, selection, or keyboard grid navigation, and no hooks, so it needs no client JavaScript\n// at all. Imported from `@chassis-ui/react/static-table`, whose entry deliberately has no\n// `'use client'` directive (see `RSC.md`). `forwardRef` is fine here: React Server Components\n// render forwardRef components like any other function component (a ref just can't be passed\n// from the server side).\nexport const StaticTable = forwardRef<HTMLTableElement, StaticTableProps>(\n (\n {\n align,\n bordered,\n borderless,\n caption,\n children,\n className,\n color,\n hover,\n responsive,\n sm,\n stacked,\n striped,\n ...rest\n },\n ref\n ) => {\n const table = (\n <table\n {...rest}\n className={tableClassName({\n align,\n bordered,\n borderless,\n className,\n color,\n hover,\n sm,\n stacked,\n striped\n })}\n ref={ref}\n >\n {caption && <caption>{caption}</caption>}\n {children}\n </table>\n )\n\n const wrapperClassName = tableWrapperClassName({ responsive, stacked })\n return wrapperClassName ? <div className={wrapperClassName}>{table}</div> : table\n }\n)\n\nStaticTable.displayName = 'StaticTable'\n"],"mappings":"yFAgCA,MAAa,EAAc,GAEvB,CACE,QACA,WACA,aACA,UACA,WACA,YACA,QACA,QACA,aACA,KACA,UACA,UACA,GAAG,GAEL,IACG,CACH,IAAM,EACJ,EAAA,cAAC,QAAD,CACE,GAAI,EACJ,UAAW,EAAe,CACxB,QACA,WACA,aACA,YACA,QACA,QACA,KACA,UACA,SACF,CAAC,EACI,KAIA,EAFJ,GAAW,EAAA,cAAC,UAAA,KAAS,CAAiB,EACtC,CACI,EAGH,EAAmB,EAAsB,CAAE,aAAY,SAAQ,CAAC,EACtE,OAAO,EAAmB,EAAA,cAAC,MAAD,CAAK,UAAW,CAA8B,EAAX,CAAW,EAAI,CAC9E,CACF,EAEA,EAAY,YAAc"}
1
+ {"version":3,"file":"static-table-uu297Liz.js","names":[],"sources":["../../src/components/static-table/StaticTable.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, TableHTMLAttributes } from 'react'\n\nimport { TableStyleProps, tableClassName, tableWrapperClassName } from '../../utils/tableClassName'\n\nexport interface StaticTableProps\n extends TableStyleProps, Omit<TableHTMLAttributes<HTMLTableElement>, 'align' | 'color'> {\n /**\n * Content shown above the table, functioning as a heading for it.\n */\n caption?: ReactNode\n /**\n * The table's own markup — plain `<thead>`/`<tbody>`/`<tfoot>`/`<tr>`/`<th>`/`<td>` elements,\n * rendered as-is.\n */\n children?: ReactNode\n /**\n * Convert rows into stacked label/value blocks below a container width, for tables with too\n * many columns to read comfortably even with horizontal scrolling. `true` always stacks; a\n * breakpoint name stacks only below it. Implies `responsive` when `responsive` isn't set\n * separately. Unlike `Table`, which derives each cell's label from its column header, a static\n * table has no collection to read labels from — give each `<td>` a `data-cell` attribute with\n * the label to show before its value.\n */\n stacked?: TableStyleProps['stacked']\n}\n\n// A plain, server-renderable `<table>` with `Table`'s styling props and none of its behavior — no\n// sorting, selection, or keyboard grid navigation, and no hooks, so it needs no client JavaScript\n// at all. Imported from `@chassis-ui/react/static-table`, whose entry deliberately has no\n// `'use client'` directive (see `RSC.md`). `forwardRef` is fine here: React Server Components\n// render forwardRef components like any other function component (a ref just can't be passed\n// from the server side).\nexport const StaticTable = forwardRef<HTMLTableElement, StaticTableProps>(\n (\n {\n align,\n bordered,\n borderless,\n caption,\n children,\n className,\n color,\n hover,\n responsive,\n sm,\n stacked,\n striped,\n ...rest\n },\n ref\n ) => {\n const table = (\n <table\n {...rest}\n className={tableClassName({\n align,\n bordered,\n borderless,\n className,\n color,\n hover,\n sm,\n stacked,\n striped\n })}\n ref={ref}\n >\n {caption && <caption>{caption}</caption>}\n {children}\n </table>\n )\n\n const wrapperClassName = tableWrapperClassName({ responsive, stacked })\n return wrapperClassName ? <div className={wrapperClassName}>{table}</div> : table\n }\n)\n\nStaticTable.displayName = 'StaticTable'\n"],"mappings":"8FAgCA,MAAa,EAAc,GAEvB,CACE,QACA,WACA,aACA,UACA,WACA,YACA,QACA,QACA,aACA,KACA,UACA,UACA,GAAG,GAEL,IACG,CACH,IAAM,EACJ,EAAA,cAAC,QAAD,CACE,GAAI,EACJ,UAAW,EAAe,CACxB,QACA,WACA,aACA,YACA,QACA,QACA,KACA,UACA,SACF,CAAC,EACI,KAIA,EAFJ,GAAW,EAAA,cAAC,UAAA,KAAS,CAAiB,EACtC,CACI,EAGH,EAAmB,EAAsB,CAAE,aAAY,SAAQ,CAAC,EACtE,OAAO,EAAmB,EAAA,cAAC,MAAD,CAAK,UAAW,CAA8B,EAAX,CAAW,EAAI,CAC9E,CACF,EAEA,EAAY,YAAc"}
@@ -1,2 +1,2 @@
1
- import"./focus-ring-SR_LwaN7.js";import{t as e}from"./useForkedRef-DVEfT-KI.js";import{n as t,t as n}from"./tableClassName-CZA2Bse8.js";import r,{forwardRef as i,useRef as a}from"react";import o from"classnames";import{useCheckbox as s,useTable as c,useTableCell as l,useTableColumnHeader as u,useTableHeaderRow as d,useTableRow as f,useTableRowGroup as p,useTableSelectAllCheckbox as m,useTableSelectionCheckbox as h}from"react-aria";import{Cell as g,Column as _,Row as v,TableBody as y,TableHeader as b,useTableState as x,useToggleState as S}from"react-stately";const C=i(({align:i,bordered:o,borderless:s,caption:l,children:u,className:d,color:f,disabledKeys:p,footer:m,hover:h,id:g,onSelectionChange:_,onSortChange:v,responsive:y,selectedKeys:b,selectionMode:S=`none`,sm:C,sortDescriptor:j,stacked:M,striped:N,...P},F)=>{let I=x({children:u,disabledKeys:p,onSelectionChange:_,onSortChange:v,selectedKeys:b,selectionMode:S,showSelectionCheckboxes:S===`multiple`,sortDescriptor:j}),L=a(null),R=e(L,F),{gridProps:z}=c({"aria-label":P[`aria-label`],"aria-labelledby":P[`aria-labelledby`],id:g},I,L),B=n({align:i,bordered:o,borderless:s,className:d,color:f,hover:h,sm:C,stacked:M,striped:N}),V=r.createElement(`table`,{...z,"aria-describedby":z[`aria-describedby`]||void 0,className:B,ref:R},l&&r.createElement(`caption`,null,l),r.createElement(w,{className:u[0].props.className,type:`thead`},I.collection.headerRows.map(e=>r.createElement(T,{key:e.key,item:e,state:I},[...I.collection.getChildren?.(e.key)??[]].map(e=>e.props?.isSelectionCell?r.createElement(D,{key:e.key,column:e,state:I}):r.createElement(E,{key:e.key,column:e,state:I}))))),r.createElement(w,{className:u[1].props.className,type:`tbody`},[...I.collection.body.childNodes].map(e=>r.createElement(O,{key:e.key,item:e,state:I},[...I.collection.getChildren?.(e.key)??[]].map(e=>e.props?.isSelectionCell?r.createElement(A,{key:e.key,cell:e,state:I}):r.createElement(k,{key:e.key,cell:e,stacked:!!M,state:I}))))),m&&r.createElement(`tfoot`,null,m)),H=t({responsive:y,stacked:M});return H?r.createElement(`div`,{className:H},V):V});C.displayName=`Table`;const w=({className:e,type:t,children:n})=>{let{rowGroupProps:i}=p();return r.createElement(t,{...i,className:e||void 0},n)},T=({children:e,item:t,state:n})=>{let i=a(null),{rowProps:o}=d({node:t},n,i);return r.createElement(`tr`,{...o,ref:i},e)},E=({column:e,state:t})=>{let n=a(null),{columnHeaderProps:i}=u({node:e},t,n),o=t.sortDescriptor?.column===e.key,s=t.sortDescriptor?.direction===`ascending`?`▲`:`▼`;return r.createElement(`th`,{...i,className:e.props?.className||void 0,colSpan:e.colSpan??void 0,scope:`col`,ref:n},e.rendered,e.props?.allowsSorting&&r.createElement(`span`,{"aria-hidden":`true`,className:`table-sort-icon`},o?s:`⇅`))},D=({column:e,state:t})=>{let n=a(null),{columnHeaderProps:i}=u({node:e},t,n),{checkboxProps:o}=m(t);return r.createElement(`th`,{...i,className:`table-selection-cell`,scope:`col`,suppressHydrationWarning:!0,ref:n},r.createElement(j,{checkboxProps:o}))},O=({children:e,item:t,state:n})=>{let i=a(null),{rowProps:s}=f({node:t},n,i),c=n.selectionManager.isSelected(t.key);return r.createElement(`tr`,{...s,className:o({active:c},t.props?.className),ref:i},e)},k=({cell:e,stacked:t,state:n})=>{let i=a(null),{gridCellProps:o}=l({node:e},n,i);return r.createElement(`td`,{...o,className:e.props?.className||void 0,"data-cell":t&&e.column?.textValue||void 0,ref:i},e.rendered)},A=({cell:e,state:t})=>{let n=a(null),{gridCellProps:i}=l({node:e},t,n),{checkboxProps:o}=h({key:e.parentKey},t);return r.createElement(`td`,{...i,className:`table-selection-cell`,suppressHydrationWarning:!0,ref:n},r.createElement(j,{checkboxProps:o}))},j=({checkboxProps:e})=>{let t=S(e),n=a(null),{inputProps:i}=s(e,t,n);return r.createElement(`input`,{...i,"aria-describedby":void 0,className:`check-input`,ref:n})},M=y,N=g,P=_,F=b,I=v;export{M as a,N as i,F as n,C as o,P as r,I as t};
2
- //# sourceMappingURL=table-Cy6uEuEP.js.map
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./useForkedRef-DVEfT-KI.js";import{n as t,r as n}from"./tableClassName-DleBjOj2.js";import r,{forwardRef as i,useRef as a}from"react";import o from"classnames";import{useCheckbox as s,useTable as c,useTableCell as l,useTableColumnHeader as u,useTableHeaderRow as d,useTableRow as f,useTableRowGroup as p,useTableSelectAllCheckbox as m,useTableSelectionCheckbox as h}from"react-aria";import{Cell as g,Column as _,Row as v,TableBody as y,TableHeader as b,useTableState as x,useToggleState as S}from"react-stately";const C=i(({align:i,bordered:o,borderless:s,caption:l,children:u,className:d,color:f,disabledKeys:p,footer:m,hover:h,id:g,onSelectionChange:_,onSortChange:v,responsive:y,selectedKeys:b,selectionMode:S=`none`,sm:C,sortDescriptor:j,stacked:M,striped:N,...P},F)=>{let I=x({children:u,disabledKeys:p,onSelectionChange:_,onSortChange:v,selectedKeys:b,selectionMode:S,showSelectionCheckboxes:S===`multiple`,sortDescriptor:j}),L=a(null),R=e(L,F),{gridProps:z}=c({"aria-label":P[`aria-label`],"aria-labelledby":P[`aria-labelledby`],id:g},I,L),B=t({align:i,bordered:o,borderless:s,className:d,color:f,hover:h,sm:C,stacked:M,striped:N}),V=r.createElement(`table`,{...z,"aria-describedby":z[`aria-describedby`]||void 0,className:B,ref:R},l&&r.createElement(`caption`,null,l),r.createElement(w,{className:u[0].props.className,type:`thead`},I.collection.headerRows.map(e=>r.createElement(T,{key:e.key,item:e,state:I},[...I.collection.getChildren?.(e.key)??[]].map(e=>e.props?.isSelectionCell?r.createElement(D,{key:e.key,column:e,state:I}):r.createElement(E,{key:e.key,column:e,state:I}))))),r.createElement(w,{className:u[1].props.className,type:`tbody`},[...I.collection.body.childNodes].map(e=>r.createElement(O,{key:e.key,item:e,state:I},[...I.collection.getChildren?.(e.key)??[]].map(e=>e.props?.isSelectionCell?r.createElement(A,{key:e.key,cell:e,state:I}):r.createElement(k,{key:e.key,cell:e,stacked:!!M,state:I}))))),m&&r.createElement(`tfoot`,null,m)),H=n({responsive:y,stacked:M});return H?r.createElement(`div`,{className:H},V):V});C.displayName=`Table`;const w=({className:e,type:t,children:n})=>{let{rowGroupProps:i}=p();return r.createElement(t,{...i,className:e||void 0},n)},T=({children:e,item:t,state:n})=>{let i=a(null),{rowProps:o}=d({node:t},n,i);return r.createElement(`tr`,{...o,ref:i},e)},E=({column:e,state:t})=>{let n=a(null),{columnHeaderProps:i}=u({node:e},t,n),o=t.sortDescriptor?.column===e.key,s=t.sortDescriptor?.direction===`ascending`?`▲`:`▼`;return r.createElement(`th`,{...i,className:e.props?.className||void 0,colSpan:e.colSpan??void 0,scope:`col`,ref:n},e.rendered,e.props?.allowsSorting&&r.createElement(`span`,{"aria-hidden":`true`,className:`table-sort-icon`},o?s:`⇅`))},D=({column:e,state:t})=>{let n=a(null),{columnHeaderProps:i}=u({node:e},t,n),{checkboxProps:o}=m(t);return r.createElement(`th`,{...i,className:`table-selection-cell`,scope:`col`,suppressHydrationWarning:!0,ref:n},r.createElement(j,{checkboxProps:o}))},O=({children:e,item:t,state:n})=>{let i=a(null),{rowProps:s}=f({node:t},n,i),c=n.selectionManager.isSelected(t.key);return r.createElement(`tr`,{...s,className:o({active:c},t.props?.className),ref:i},e)},k=({cell:e,stacked:t,state:n})=>{let i=a(null),{gridCellProps:o}=l({node:e},n,i);return r.createElement(`td`,{...o,className:e.props?.className||void 0,"data-cell":t&&e.column?.textValue||void 0,ref:i},e.rendered)},A=({cell:e,state:t})=>{let n=a(null),{gridCellProps:i}=l({node:e},t,n),{checkboxProps:o}=h({key:e.parentKey},t);return r.createElement(`td`,{...i,className:`table-selection-cell`,suppressHydrationWarning:!0,ref:n},r.createElement(j,{checkboxProps:o}))},j=({checkboxProps:e})=>{let t=S(e),n=a(null),{inputProps:i}=s(e,t,n);return r.createElement(`input`,{...i,"aria-describedby":void 0,className:`check-input`,ref:n})},M=y,N=g,P=_,F=b,I=v;export{M as a,N as i,F as n,C as o,P as r,I as t};
2
+ //# sourceMappingURL=table-DPLOygg0.js.map