@obosbbl/grunnmuren-react 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { DisclosureProps as DisclosureProps$1, ButtonProps as ButtonProps$1, LinkProps as LinkProps$1, BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1, ContextValue, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, HeadingProps as HeadingProps$1, ListBoxItemProps, ListBoxSectionProps, ComboBoxProps, FileTriggerProps as FileTriggerProps$1, RouterProvider, TextProps, LabelProps, DialogProps as DialogProps$1, DialogTriggerProps as DialogTriggerProps$1, ModalOverlayProps, NumberFieldProps as NumberFieldProps$1, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SelectProps as SelectProps$1, TableProps as TableProps$1, TableBodyProps as TableBodyProps$1, CellProps, ColumnProps, TableHeaderProps as TableHeaderProps$1, RowProps, TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps as TabPanelProps$1, TabsProps as TabsProps$1, TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1, TagProps as TagProps$1, TextFieldProps as TextFieldProps$1 } from 'react-aria-components';
2
- export { ListBoxItemProps as ComboboxItemProps, Form, Group, LabelProps, ListBoxItemProps as SelectItemProps, DisclosureGroup as UNSAFE_DisclosureGroup, DisclosureGroupProps as UNSAFE_DisclosureGroupProps } from 'react-aria-components';
1
+ import { DisclosureProps as DisclosureProps$1, ButtonProps as ButtonProps$1, LinkProps as LinkProps$1, BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1, ContextValue, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, HeadingProps as HeadingProps$1, ListBoxItemProps, ListBoxSectionProps, ComboBoxProps, FileTriggerProps as FileTriggerProps$1, RouterProvider, TextProps, LabelProps, DialogProps as DialogProps$1, DialogTriggerProps as DialogTriggerProps$1, ModalOverlayProps, NumberFieldProps as NumberFieldProps$1, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SelectProps as SelectProps$1, ColumnResizerProps, TableProps as TableProps$1, TableBodyProps as TableBodyProps$1, CellProps, ColumnProps, ResizableTableContainerProps, TableHeaderProps as TableHeaderProps$1, RowProps, TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps as TabPanelProps$1, TabsProps as TabsProps$1, TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1, TagProps as TagProps$1, TextFieldProps as TextFieldProps$1 } from 'react-aria-components';
2
+ export { ListBoxItemProps as ComboboxItemProps, DisclosureGroup, DisclosureGroupProps, Form, Group, LabelProps, ListBoxItemProps as SelectItemProps } from 'react-aria-components';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { RefAttributes, HTMLAttributes, HTMLProps, ComponentProps, ReactNode, Ref, JSX, RefObject, Dispatch, SetStateAction } from 'react';
@@ -19,8 +19,8 @@ declare const disclosureButtonVariants: (props?: ({
19
19
  class?: never;
20
20
  className?: cva.ClassValue;
21
21
  })) | undefined) => string;
22
- type DisclosureButtonProps = Omit<ButtonProps$1, 'children' | 'aria-expanded' | 'aria-controls'> & VariantProps<typeof disclosureButtonVariants> & {
23
- children: React.ReactNode;
22
+ type DisclosureButtonProps = Omit<ButtonProps$1, 'children'> & VariantProps<typeof disclosureButtonVariants> & {
23
+ children?: React.ReactNode;
24
24
  } & RefAttributes<HTMLButtonElement>;
25
25
  declare const DisclosureButton: ({ className, withChevron, isIconOnly, children, ref: _ref, ...restProps }: DisclosureButtonProps) => react_jsx_runtime.JSX.Element;
26
26
  type DisclosureProps = DisclosureProps$1 & RefAttributes<HTMLDivElement> & {
@@ -577,12 +577,16 @@ declare function Table(props: TableProps): react_jsx_runtime.JSX.Element;
577
577
  */
578
578
  declare function TableHeader({ className, children, ...restProps }: TableHeaderProps): react_jsx_runtime.JSX.Element;
579
579
  declare function TableColumn(props: TableColumnProps): react_jsx_runtime.JSX.Element;
580
+ type TableColumnResizerProps = ColumnResizerProps;
581
+ declare const TableColumnResizer: ({ className, ...restProps }: TableColumnResizerProps) => react_jsx_runtime.JSX.Element;
580
582
  /**
581
583
  * Container for table rows.
582
584
  */
583
585
  declare function TableBody({ className, children, ...restProps }: TableBodyProps): react_jsx_runtime.JSX.Element;
584
586
  declare function TableRow(props: TableRowProps): react_jsx_runtime.JSX.Element;
585
587
  declare function TableCell(props: TableCellProps): react_jsx_runtime.JSX.Element;
588
+ type TableContainerProps = ResizableTableContainerProps;
589
+ declare const TableContainer: ({ className, ...restProps }: ResizableTableContainerProps) => react_jsx_runtime.JSX.Element;
586
590
 
587
591
  type TabsProps = Omit<TabsProps$1, 'className'> & RefAttributes<HTMLDivElement> & {
588
592
  /**
@@ -740,5 +744,5 @@ type VideoLoopProps = {
740
744
  };
741
745
  declare const VideoLoop: ({ src, format, alt, className }: VideoLoopProps) => react_jsx_runtime.JSX.Element;
742
746
 
743
- export { Accordion, AccordionItem, Alertbox, Avatar, Backlink, Badge, Breadcrumb, Breadcrumbs, Button, ButtonContext, Caption, Card, CardLink, Checkbox, CheckboxGroup, Combobox, ListBoxHeader as ComboboxHeader, ListBoxItem as ComboboxItem, ListBoxSection as ComboboxSection, Content, ContentContext, DateFormatter, Description, DisclosureStateContext, ErrorMessage, Footer, GrunnmurenProvider, Heading, HeadingContext, Label, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, Disclosure as UNSAFE_Disclosure, DisclosureButton as UNSAFE_DisclosureButton, DisclosurePanel as UNSAFE_DisclosurePanel, FileUpload as UNSAFE_FileUpload, Hero as UNSAFE_Hero, Link as UNSAFE_Link, LinkList as UNSAFE_LinkList, LinkListItem as UNSAFE_LinkListItem, Modal as UNSAFE_Modal, Tab as UNSAFE_Tab, TabList as UNSAFE_TabList, TabPanel as UNSAFE_TabPanel, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Tabs as UNSAFE_Tabs, VideoLoop, _useLocale as useLocale };
744
- export type { AccordionItemProps, AccordionProps, Props as AlertboxProps, AvatarProps, BacklinkProps, BadgeProps, BreadcrumbProps, BreadcrumbsProps, ButtonProps, CaptionProps, CardLinkProps, CardProps, CheckboxGroupProps, CheckboxProps, ComboboxProps, ContentProps, DateFormatterProps, DescriptionProps, ErrorMessageProps, FooterProps, GrunnmurenProviderProps, HeadingProps, Locale, MediaProps, NumberFieldProps, RadioGroupProps, RadioProps, SelectProps, TagGroupProps, TagListProps, TagProps, TextAreaProps, TextFieldProps, CarouselItemProps as UNSAFE_CarouselItemProps, CarouselItemsProps as UNSAFE_CarouselItemsProps, CarouselProps as UNSAFE_CarouselProps, DialogProps as UNSAFE_DialogProps, DialogTriggerProps as UNSAFE_DialogTriggerProps, DisclosureButtonProps as UNSAFE_DisclosureButtonProps, DisclosurePanelProps as UNSAFE_DisclosurePanelProps, DisclosureProps as UNSAFE_DisclosureProps, FileUploadProps as UNSAFE_FileUploadProps, HeroProps as UNSAFE_HeroProps, LinkListItemProps as UNSAFE_LinkListItemProps, LinkListProps as UNSAFE_LinkListProps, LinkProps as UNSAFE_LinkProps, ModalProps as UNSAFE_ModalProps, TabListProps as UNSAFE_TabListProps, TabPanelProps as UNSAFE_TabPanelProps, TabProps as UNSAFE_TabProps, TableBodyProps as UNSAFE_TableBodyProps, TableCellProps as UNSAFE_TableCellProps, TableColumnProps as UNSAFE_TableColumnProps, TableHeaderProps as UNSAFE_TableHeaderProps, TableProps as UNSAFE_TableProps, TableRowProps as UNSAFE_TableRowProps, TabsProps as UNSAFE_TabsProps };
747
+ export { Accordion, AccordionItem, Alertbox, Avatar, Backlink, Badge, Breadcrumb, Breadcrumbs, Button, ButtonContext, Caption, Card, CardLink, Checkbox, CheckboxGroup, Combobox, ListBoxHeader as ComboboxHeader, ListBoxItem as ComboboxItem, ListBoxSection as ComboboxSection, Content, ContentContext, DateFormatter, Description, Disclosure, DisclosureButton, DisclosurePanel, DisclosureStateContext, ErrorMessage, Footer, GrunnmurenProvider, Heading, HeadingContext, Label, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, FileUpload as UNSAFE_FileUpload, Hero as UNSAFE_Hero, Link as UNSAFE_Link, LinkList as UNSAFE_LinkList, LinkListItem as UNSAFE_LinkListItem, Modal as UNSAFE_Modal, Tab as UNSAFE_Tab, TabList as UNSAFE_TabList, TabPanel as UNSAFE_TabPanel, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableColumnResizer as UNSAFE_TableColumnResizer, TableContainer as UNSAFE_TableContainer, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Tabs as UNSAFE_Tabs, VideoLoop, _useLocale as useLocale };
748
+ export type { AccordionItemProps, AccordionProps, Props as AlertboxProps, AvatarProps, BacklinkProps, BadgeProps, BreadcrumbProps, BreadcrumbsProps, ButtonProps, CaptionProps, CardLinkProps, CardProps, CheckboxGroupProps, CheckboxProps, ComboboxProps, ContentProps, DateFormatterProps, DescriptionProps, DisclosureButtonProps, DisclosurePanelProps, DisclosureProps, ErrorMessageProps, FooterProps, GrunnmurenProviderProps, HeadingProps, Locale, MediaProps, NumberFieldProps, RadioGroupProps, RadioProps, SelectProps, TagGroupProps, TagListProps, TagProps, TextAreaProps, TextFieldProps, CarouselItemProps as UNSAFE_CarouselItemProps, CarouselItemsProps as UNSAFE_CarouselItemsProps, CarouselProps as UNSAFE_CarouselProps, DialogProps as UNSAFE_DialogProps, DialogTriggerProps as UNSAFE_DialogTriggerProps, FileUploadProps as UNSAFE_FileUploadProps, HeroProps as UNSAFE_HeroProps, LinkListItemProps as UNSAFE_LinkListItemProps, LinkListProps as UNSAFE_LinkListProps, LinkProps as UNSAFE_LinkProps, ModalProps as UNSAFE_ModalProps, TabListProps as UNSAFE_TabListProps, TabPanelProps as UNSAFE_TabPanelProps, TabProps as UNSAFE_TabProps, TableBodyProps as UNSAFE_TableBodyProps, TableCellProps as UNSAFE_TableCellProps, TableColumnProps as UNSAFE_TableColumnProps, TableColumnResizerProps as UNSAFE_TableColumnResizerProps, TableContainerProps as UNSAFE_TableContainerProps, TableHeaderProps as UNSAFE_TableHeaderProps, TableProps as UNSAFE_TableProps, TableRowProps as UNSAFE_TableRowProps, TabsProps as UNSAFE_TabsProps };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { useContextProps, DisclosureContext, DisclosureGroupStateContext, Provider, ButtonContext as ButtonContext$1, DEFAULT_SLOT, Button as Button$1, useLocale, Link as Link$1, Breadcrumb as Breadcrumb$1, Breadcrumbs as Breadcrumbs$1, Text, CheckboxContext, Checkbox as Checkbox$1, FieldError, Label as Label$1, CheckboxGroup as CheckboxGroup$1, Header, ListBoxItem as ListBoxItem$1, ListBoxSection as ListBoxSection$1, ListBox as ListBox$1, ComboBox, Group, Input, Popover, useSlottedContext, FormContext, FieldErrorContext, LabelContext, InputContext, I18nProvider, RouterProvider, GroupContext, Dialog as Dialog$1, DialogTrigger as DialogTrigger$1, Modal as Modal$1, ModalOverlay as ModalOverlay$1, NumberField as NumberField$1, Radio as Radio$1, RadioGroup as RadioGroup$1, Select as Select$1, SelectValue, Table as Table$1, TableBody as TableBody$1, Cell, Column, TableHeader as TableHeader$1, Row, Tab as Tab$1, TabListStateContext, TabList as TabList$1, TabPanel as TabPanel$1, Tabs as Tabs$1, TagGroup as TagGroup$1, TagList as TagList$1, Tag as Tag$1, TextField as TextField$1, TextArea as TextArea$1 } from 'react-aria-components';
3
- export { Form, Group, DisclosureGroup as UNSAFE_DisclosureGroup } from 'react-aria-components';
2
+ import { useContextProps, DisclosureContext, DisclosureGroupStateContext, Provider, ButtonContext as ButtonContext$1, DEFAULT_SLOT, Button as Button$1, useLocale, Link as Link$1, Breadcrumb as Breadcrumb$1, Breadcrumbs as Breadcrumbs$1, Text, CheckboxContext, Checkbox as Checkbox$1, FieldError, Label as Label$1, CheckboxGroup as CheckboxGroup$1, Header, ListBoxItem as ListBoxItem$1, ListBoxSection as ListBoxSection$1, ListBox as ListBox$1, ComboBox, Group, Input, Popover, useSlottedContext, FormContext, FieldErrorContext, LabelContext, InputContext, I18nProvider, RouterProvider, GroupContext, Dialog as Dialog$1, DialogTrigger as DialogTrigger$1, Modal as Modal$1, ModalOverlay as ModalOverlay$1, NumberField as NumberField$1, Radio as Radio$1, RadioGroup as RadioGroup$1, Select as Select$1, SelectValue, ColumnResizer, Table as Table$1, TableBody as TableBody$1, Cell, Column, ResizableTableContainer, TableHeader as TableHeader$1, Row, Tab as Tab$1, TabListStateContext, TabList as TabList$1, TabPanel as TabPanel$1, Tabs as Tabs$1, TagGroup as TagGroup$1, TagList as TagList$1, Tag as Tag$1, TextField as TextField$1, TextArea as TextArea$1 } from 'react-aria-components';
3
+ export { DisclosureGroup, Form, Group } from 'react-aria-components';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { cva, cx, compose } from 'cva';
6
6
  import { createContext, useContext, useId, useRef, Children, useState, useEffect, isValidElement, cloneElement, useCallback } from 'react';
@@ -117,6 +117,7 @@ const disclosureButtonVariants = cva({
117
117
  });
118
118
  const DisclosureButton = ({ className, withChevron, isIconOnly, children, ref: _ref, ...restProps })=>{
119
119
  const [props, ref] = useContextProps(restProps, _ref, ButtonContext$1);
120
+ const hasContext = !!useContext(DisclosureContext);
120
121
  return /*#__PURE__*/ jsxs(Button$1, {
121
122
  ...props,
122
123
  ref: ref,
@@ -125,7 +126,7 @@ const DisclosureButton = ({ className, withChevron, isIconOnly, children, ref: _
125
126
  withChevron,
126
127
  isIconOnly
127
128
  }),
128
- slot: "trigger",
129
+ slot: hasContext ? 'trigger' : undefined,
129
130
  children: [
130
131
  children,
131
132
  withChevron && /*#__PURE__*/ jsx(ChevronDown, {
@@ -482,7 +483,7 @@ const Avatar = ({ src, alt = '', className, onError, loading = 'lazy', ...rest }
482
483
  */ const Link = ({ children, className, ...restProps })=>{
483
484
  return /*#__PURE__*/ jsx(Link$1, {
484
485
  ...restProps,
485
- className: cx(className, 'inline-flex cursor-pointer items-center gap-1 font-medium hover:no-underline focus-visible:outline-current focus-visible:outline-focus-offset [&>svg]:shrink-0'),
486
+ className: cx(className, 'inline-flex cursor-pointer items-center gap-1 font-medium hover:no-underline focus-visible:outline-current focus-visible:outline-focus-offset [&>svg]:shrink-0 [&>svg]:transition-transform'),
486
487
  children: children
487
488
  });
488
489
  };
@@ -492,7 +493,7 @@ function isLinkProps$1(props) {
492
493
  }
493
494
  function Backlink(props) {
494
495
  const { className, style, children, withUnderline, ref, ...restProps } = props;
495
- const _className = cx(className, 'group flex! max-w-fit cursor-pointer items-center gap-3 rounded-md p-2.5 font-normal no-underline focus-visible:outline-focus');
496
+ const _className = cx(className, 'group flex max-w-fit cursor-pointer items-center gap-3 rounded-md p-2.5 font-normal no-underline focus-visible:outline-focus');
496
497
  const content = /*#__PURE__*/ jsxs(Fragment, {
497
498
  children: [
498
499
  /*#__PURE__*/ jsx(ChevronLeft, {
@@ -1079,33 +1080,36 @@ const Carousel = ({ className, children, onChange, ...rest })=>{
1079
1080
  }
1080
1081
  }, 150);
1081
1082
  const handlePrevious = ()=>{
1082
- const targetIndex = scrollTargetIndex - 1;
1083
- if (targetIndex < 0) {
1084
- return;
1085
- }
1086
- if (isScrollingProgrammatically.current) {
1087
- // If we're already scrolling, queue this action
1088
- scrollQueue.current = [
1089
- targetIndex
1090
- ];
1091
- } else {
1092
- setScrollTargetIndex(targetIndex);
1093
- }
1083
+ setScrollTargetIndex((currentTargetIndex)=>{
1084
+ const targetIndex = currentTargetIndex - 1;
1085
+ if (targetIndex < 0) {
1086
+ return currentTargetIndex;
1087
+ }
1088
+ if (isScrollingProgrammatically.current) {
1089
+ // If we're already scrolling, queue this action
1090
+ scrollQueue.current = [
1091
+ targetIndex
1092
+ ];
1093
+ return currentTargetIndex;
1094
+ }
1095
+ return targetIndex;
1096
+ });
1094
1097
  };
1095
1098
  const handleNext = ()=>{
1096
- if (!carouselItemsRef.current) return;
1097
- const targetIndex = scrollTargetIndex + 1;
1098
- if (targetIndex >= carouselItemsRef.current.children.length) {
1099
- return;
1100
- }
1101
- if (isScrollingProgrammatically.current) {
1102
- // If we're already scrolling, queue this action
1103
- scrollQueue.current = [
1104
- targetIndex
1105
- ];
1106
- } else {
1107
- setScrollTargetIndex(targetIndex);
1108
- }
1099
+ setScrollTargetIndex((currentTargetIndex)=>{
1100
+ const targetIndex = currentTargetIndex + 1;
1101
+ if (!carouselItemsRef.current || targetIndex >= carouselItemsRef.current.children.length) {
1102
+ return currentTargetIndex;
1103
+ }
1104
+ if (isScrollingProgrammatically.current) {
1105
+ // If we're already scrolling, queue this action
1106
+ scrollQueue.current = [
1107
+ targetIndex
1108
+ ];
1109
+ return currentTargetIndex;
1110
+ }
1111
+ return targetIndex;
1112
+ });
1109
1113
  };
1110
1114
  return /*#__PURE__*/ jsx("div", {
1111
1115
  "data-slot": "carousel",
@@ -2230,7 +2234,7 @@ function ScrollButton({ direction, onClick, isVisible, hasScrollingOccurred, cla
2230
2234
  /**
2231
2235
  * Simple hook for detecting horizontal scroll capabilities
2232
2236
  * Returns scroll state and a ref to attach to your scrollable container
2233
- */ function useHorizontalScroll() {
2237
+ */ function useHorizontalScroll(scrollStateDeps = []) {
2234
2238
  const scrollContainerRef = useRef(null);
2235
2239
  const [scrollState, setScrollState] = useState({
2236
2240
  canScrollLeft: false,
@@ -2252,13 +2256,15 @@ function ScrollButton({ direction, onClick, isVisible, hasScrollingOccurred, cla
2252
2256
  }));
2253
2257
  }, []);
2254
2258
  const debouncedUpdateScrollState = useDebouncedCallback(updateScrollState, 100);
2259
+ // Initial check and react to dependency changes
2260
+ useEffect(updateScrollState, [
2261
+ ...scrollStateDeps
2262
+ ]);
2255
2263
  useEffect(()=>{
2256
2264
  const container = scrollContainerRef.current;
2257
2265
  if (!container) {
2258
2266
  return;
2259
2267
  }
2260
- // Initial check
2261
- updateScrollState();
2262
2268
  // Listen for scroll events
2263
2269
  container.addEventListener('scroll', debouncedUpdateScrollState);
2264
2270
  // Listen for resize events (content or container size changes)
@@ -2296,11 +2302,18 @@ const tableRowVariants = cva({
2296
2302
  'group-data-[variant=zebra-striped]:even:bg-sky-lightest'
2297
2303
  ]
2298
2304
  });
2305
+ // Used to deal with showing or hiding scroll indicators during column resizing
2306
+ const TableScrollContainerContext = /*#__PURE__*/ createContext({
2307
+ isResizing: false
2308
+ });
2299
2309
  /**
2300
2310
  * A container component for displaying tabular data with horizontal scrolling support.
2301
2311
  */ function Table(props) {
2302
2312
  const { className, children, variant = 'default', ...restProps } = props;
2303
- const { scrollContainerRef, canScrollLeft, canScrollRight, hasScrollingOccurred } = useHorizontalScroll();
2313
+ const { isResizing } = useContext(TableScrollContainerContext);
2314
+ const { scrollContainerRef, canScrollLeft, canScrollRight, hasScrollingOccurred } = useHorizontalScroll([
2315
+ isResizing
2316
+ ]);
2304
2317
  const handleScroll = useCallback((direction)=>{
2305
2318
  const container = scrollContainerRef.current;
2306
2319
  if (!container) return;
@@ -2366,10 +2379,16 @@ function TableColumn(props) {
2366
2379
  const { className, children, ...restProps } = props;
2367
2380
  return /*#__PURE__*/ jsx(Column, {
2368
2381
  ...restProps,
2369
- className: cx(className, 'px-4 py-3 text-left font-medium text-black text-sm', 'data-focus-visible:outline-focus-inset', 'min-w-fit whitespace-nowrap'),
2382
+ className: cx(className, 'px-4 py-3 text-left font-medium text-black text-sm', 'data-focus-visible:outline-focus-inset', '[&_:not([data-slot="table-column-resizer"]):focus-visible]:outline-focus-offset', 'min-w-fit whitespace-nowrap', 'has-data-[slot=table-column-resizer]:*:data-[slot=content]:flex has-data-[slot=table-column-resizer]:*:data-[slot=content]:justify-between has-data-[slot=table-column-resizer]:*:data-[slot=content]:gap-2'),
2383
+ "data-slot": "table-column",
2370
2384
  children: children
2371
2385
  });
2372
2386
  }
2387
+ const TableColumnResizer = ({ className, ...restProps })=>/*#__PURE__*/ jsx(ColumnResizer, {
2388
+ ...restProps,
2389
+ className: cx(className, '-my-3 -mr-4.5 size-11 flex-none', 'cursor-ew-resize', 'relative after:absolute after:top-2 after:right-5 after:bottom-2 after:w-px after:bg-black', 'data-focused:after:outline-focus-offset'),
2390
+ "data-slot": "table-column-resizer"
2391
+ });
2373
2392
  /**
2374
2393
  * Container for table rows.
2375
2394
  */ function TableBody({ className, children, ...restProps }) {
@@ -2394,9 +2413,29 @@ function TableCell(props) {
2394
2413
  return /*#__PURE__*/ jsx(Cell, {
2395
2414
  ...restProps,
2396
2415
  className: cx(className, 'px-4 py-3 text-black text-sm leading-relaxed', 'min-w-fit whitespace-nowrap', 'align-top', 'data-focus-visible:outline-focus-inset'),
2416
+ "data-slot": "table-cell",
2397
2417
  children: children
2398
2418
  });
2399
2419
  }
2420
+ const TableContainer = ({ className, ...restProps })=>{
2421
+ const [isResizing, setIsResizing] = useState(false);
2422
+ return /*#__PURE__*/ jsx(Provider, {
2423
+ values: [
2424
+ [
2425
+ TableScrollContainerContext,
2426
+ {
2427
+ isResizing
2428
+ }
2429
+ ]
2430
+ ],
2431
+ children: /*#__PURE__*/ jsx(ResizableTableContainer, {
2432
+ ...restProps,
2433
+ className: cx(className, '**:data-[slot=table-column]:overflow-hidden **:data-[slot=table-column]:text-ellipsis', '**:data-[slot=table-cell]:overflow-hidden **:data-[slot=table-cell]:text-ellipsis'),
2434
+ onResizeStart: ()=>setIsResizing(true),
2435
+ onResizeEnd: ()=>setIsResizing(false)
2436
+ })
2437
+ });
2438
+ };
2400
2439
 
2401
2440
  const tabsVariants = cva({
2402
2441
  base: [
@@ -2792,4 +2831,4 @@ const VideoLoop = ({ src, format, alt, className })=>{
2792
2831
  });
2793
2832
  };
2794
2833
 
2795
- export { Accordion, AccordionItem, Alertbox, Avatar, Backlink, Badge, Breadcrumb, Breadcrumbs, Button, ButtonContext, Caption, Card, CardLink, Checkbox, CheckboxGroup, Combobox, ListBoxHeader as ComboboxHeader, ListBoxItem as ComboboxItem, ListBoxSection as ComboboxSection, Content, ContentContext, DateFormatter, Description, DisclosureStateContext, ErrorMessage, Footer, GrunnmurenProvider, Heading, HeadingContext, Label, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, Disclosure as UNSAFE_Disclosure, DisclosureButton as UNSAFE_DisclosureButton, DisclosurePanel as UNSAFE_DisclosurePanel, FileUpload as UNSAFE_FileUpload, Hero as UNSAFE_Hero, Link as UNSAFE_Link, LinkList as UNSAFE_LinkList, LinkListItem as UNSAFE_LinkListItem, Modal as UNSAFE_Modal, Tab as UNSAFE_Tab, TabList as UNSAFE_TabList, TabPanel as UNSAFE_TabPanel, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Tabs as UNSAFE_Tabs, VideoLoop, _useLocale as useLocale };
2834
+ export { Accordion, AccordionItem, Alertbox, Avatar, Backlink, Badge, Breadcrumb, Breadcrumbs, Button, ButtonContext, Caption, Card, CardLink, Checkbox, CheckboxGroup, Combobox, ListBoxHeader as ComboboxHeader, ListBoxItem as ComboboxItem, ListBoxSection as ComboboxSection, Content, ContentContext, DateFormatter, Description, Disclosure, DisclosureButton, DisclosurePanel, DisclosureStateContext, ErrorMessage, Footer, GrunnmurenProvider, Heading, HeadingContext, Label, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, FileUpload as UNSAFE_FileUpload, Hero as UNSAFE_Hero, Link as UNSAFE_Link, LinkList as UNSAFE_LinkList, LinkListItem as UNSAFE_LinkListItem, Modal as UNSAFE_Modal, Tab as UNSAFE_Tab, TabList as UNSAFE_TabList, TabPanel as UNSAFE_TabPanel, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableColumnResizer as UNSAFE_TableColumnResizer, TableContainer as UNSAFE_TableContainer, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Tabs as UNSAFE_Tabs, VideoLoop, _useLocale as useLocale };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "description": "Grunnmuren components in React",
5
5
  "repository": {
6
6
  "url": "https://github.com/code-obos/grunnmuren"
@@ -24,7 +24,7 @@
24
24
  "@react-aria/utils": "^3.29.1",
25
25
  "@react-stately/form": "^3.1.5",
26
26
  "@react-stately/utils": "^3.10.7",
27
- "@types/node": "^22.0.0",
27
+ "@types/node": "^24.0.0",
28
28
  "cva": "^1.0.0-0",
29
29
  "react-aria": "^3.41.1",
30
30
  "react-aria-components": "^1.10.1",