@obosbbl/grunnmuren-react 3.8.2 → 3.9.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.
@@ -106,6 +106,10 @@ const Lead = ()=>/*#__PURE__*/ jsxRuntime.jsx("p", {
106
106
  className: "lead",
107
107
  children: "Dokumentavgift er en avgift som du må betale til staten når du kjøper en fast eiendom."
108
108
  });
109
+ const LeadSm = ()=>/*#__PURE__*/ jsxRuntime.jsx("p", {
110
+ className: "lead-sm",
111
+ children: "Dokumentavgift er en avgift som du må betale til staten når du kjøper en fast eiendom."
112
+ });
109
113
  const Body = ()=>{
110
114
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
111
115
  children: [
@@ -219,6 +223,7 @@ exports.Default = Default;
219
223
  exports.Description = Description;
220
224
  exports.Headings = Headings;
221
225
  exports.Lead = Lead;
226
+ exports.LeadSm = LeadSm;
222
227
  exports.Prose = Prose;
223
228
  exports.ProseWhite = ProseWhite;
224
229
  exports.default = meta;
@@ -4,6 +4,7 @@ import { Meta } from '@storybook/react-vite';
4
4
  declare const Default: () => react.JSX.Element;
5
5
  declare const Headings: () => react.JSX.Element;
6
6
  declare const Lead: () => react.JSX.Element;
7
+ declare const LeadSm: () => react.JSX.Element;
7
8
  declare const Body: () => react.JSX.Element;
8
9
  declare const Blockquote: () => react.JSX.Element;
9
10
  declare const Description: () => react.JSX.Element;
@@ -11,4 +12,4 @@ declare const Prose: () => react.JSX.Element;
11
12
  declare const ProseWhite: () => react.JSX.Element;
12
13
  declare const meta: Meta;
13
14
 
14
- export { Blockquote, Body, Default, Description, Headings, Lead, Prose, ProseWhite, meta as default };
15
+ export { Blockquote, Body, Default, Description, Headings, Lead, LeadSm, Prose, ProseWhite, meta as default };
@@ -4,6 +4,7 @@ import { Meta } from '@storybook/react-vite';
4
4
  declare const Default: () => react.JSX.Element;
5
5
  declare const Headings: () => react.JSX.Element;
6
6
  declare const Lead: () => react.JSX.Element;
7
+ declare const LeadSm: () => react.JSX.Element;
7
8
  declare const Body: () => react.JSX.Element;
8
9
  declare const Blockquote: () => react.JSX.Element;
9
10
  declare const Description: () => react.JSX.Element;
@@ -11,4 +12,4 @@ declare const Prose: () => react.JSX.Element;
11
12
  declare const ProseWhite: () => react.JSX.Element;
12
13
  declare const meta: Meta;
13
14
 
14
- export { Blockquote, Body, Default, Description, Headings, Lead, Prose, ProseWhite, meta as default };
15
+ export { Blockquote, Body, Default, Description, Headings, Lead, LeadSm, Prose, ProseWhite, meta as default };
@@ -104,6 +104,10 @@ const Lead = ()=>/*#__PURE__*/ jsx("p", {
104
104
  className: "lead",
105
105
  children: "Dokumentavgift er en avgift som du må betale til staten når du kjøper en fast eiendom."
106
106
  });
107
+ const LeadSm = ()=>/*#__PURE__*/ jsx("p", {
108
+ className: "lead-sm",
109
+ children: "Dokumentavgift er en avgift som du må betale til staten når du kjøper en fast eiendom."
110
+ });
107
111
  const Body = ()=>{
108
112
  return /*#__PURE__*/ jsxs(Fragment, {
109
113
  children: [
@@ -211,4 +215,4 @@ const meta = {
211
215
  title: 'Typography'
212
216
  };
213
217
 
214
- export { Blockquote, Body, Default, Description, Headings, Lead, Prose, ProseWhite, meta as default };
218
+ export { Blockquote, Body, Default, Description, Headings, Lead, LeadSm, Prose, ProseWhite, meta as default };
package/dist/index.d.mts CHANGED
@@ -31,7 +31,7 @@ import { TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps a
31
31
  import { TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1, TagProps as TagProps$1 } from 'react-aria-components/TagGroup';
32
32
  import { TextFieldProps as TextFieldProps$1 } from 'react-aria-components/TextField';
33
33
  import { PopoverProps } from 'react-aria-components/Popover';
34
- import { HeaderProps } from 'react-aria-components/Header';
34
+ import { HeaderProps as HeaderProps$1 } from 'react-aria-components/Header';
35
35
  import { ListBoxItemProps, ListBoxSectionProps } from 'react-aria-components/ListBox';
36
36
  export { ListBoxItemProps as ComboboxItemProps, ListBoxItemProps as SelectItemProps } from 'react-aria-components/ListBox';
37
37
 
@@ -400,7 +400,7 @@ declare const ListBoxSection: <T extends object>({ className, ...restProps }: Li
400
400
  /**
401
401
  * This component can be used to label grouped items in a `ListBoxSection` with a heading
402
402
  */
403
- declare const ListBoxHeader: (props: HeaderProps) => react.JSX.Element;
403
+ declare const ListBoxHeader: (props: HeaderProps$1) => react.JSX.Element;
404
404
 
405
405
  type ComboboxProps<T extends object> = {
406
406
  children: React.ReactNode;
@@ -439,7 +439,7 @@ type HeadingProps = Omit<HTMLProps<HTMLHeadingElement>, 'size'> & VariantProps<t
439
439
  };
440
440
  declare const HeadingContext: react.Context<ContextValue<Partial<HeadingProps>, HTMLHeadingElement>>;
441
441
  declare const headingVariants: (props?: ({
442
- size?: "s" | "xl" | "l" | "m" | "xs" | undefined;
442
+ size?: "xl" | "l" | "m" | "s" | "xs" | undefined;
443
443
  } & ({
444
444
  class?: cva.ClassValue;
445
445
  className?: never;
@@ -481,6 +481,34 @@ type CaptionProps = HTMLProps<HTMLDivElement> & {
481
481
  };
482
482
  declare const Caption: ({ className, ...restProps }: CaptionProps) => react.JSX.Element;
483
483
  declare const Footer: (props: FooterProps) => react.JSX.Element;
484
+ type HeaderProps = HTMLProps<HTMLDivElement> & {
485
+ children: React.ReactNode;
486
+ };
487
+ type HeaderProviderValues = [
488
+ [
489
+ typeof HeadingContext,
490
+ ContextValue<Partial<HeadingProps>, HTMLHeadingElement>
491
+ ],
492
+ [
493
+ typeof ButtonContext,
494
+ ContextValue<ButtonProps, HTMLButtonElement | HTMLAnchorElement>
495
+ ]
496
+ ];
497
+ declare const HeaderContext: react.Context<{
498
+ /** @private Set by Modal/Drawer with the contexts to wrap the header content in */
499
+ _providerValues?: HeaderProviderValues;
500
+ }>;
501
+ /**
502
+ * Wraps the title of a Modal/Drawer (and, optionally, a `<Button slot="close" />`).
503
+ *
504
+ * Renders a `data-slot="header"` element consumers can style freely, e.g.
505
+ * `className="sticky top-0 bg-white"`. Inside a Modal/Drawer the dialog provides
506
+ * (via `HeaderContext`) the contexts to wrap the content in — wiring the title's
507
+ * accessible name (`aria-labelledby`) and the close button's appearance — so the
508
+ * consumer only writes a `Heading` and a bare `<Button slot="close" />`, with no
509
+ * `slot="title"` needed.
510
+ */
511
+ declare const Header: ({ children, ...props }: HeaderProps) => react.JSX.Element;
484
512
 
485
513
  type DateFormatterProps = {
486
514
  value: Date | string;
@@ -991,5 +1019,5 @@ type VideoLoopProps = {
991
1019
  };
992
1020
  declare const VideoLoop: ({ src, format, alt, className }: VideoLoopProps) => react.JSX.Element;
993
1021
 
994
- 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, Hero, HeroContext, Label, Link, LinkList, LinkListContainer, LinkListContext, LinkListItem, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tab, TabList, TabPanel, Tabs, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselButton as UNSAFE_CarouselButton, CarouselContext as UNSAFE_CarouselContext, CarouselControls as UNSAFE_CarouselControls, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, CarouselItemsContainer as UNSAFE_CarouselItemsContainer, CarouselItemsContainer as UNSAFE_CarouselItemsContainerProps, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, Drawer as UNSAFE_Drawer, FileUpload as UNSAFE_FileUpload, Modal as UNSAFE_Modal, Pagination as UNSAFE_Pagination, ResizableTableContainer as UNSAFE_ResizableTableContainer, Step as UNSAFE_Step, Stepper as UNSAFE_Stepper, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableColumnResizer as UNSAFE_TableColumnResizer, UNSAFE_TableContainer, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Toggletip as UNSAFE_Toggletip, ToggletipContent as UNSAFE_ToggletipContent, ToggletipTrigger as UNSAFE_ToggletipTrigger, VideoLoop, _useLocale as useLocale };
995
- 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, HeroContextValue, HeroProps, LinkListContainerProps, LinkListContextValue, LinkListItemProps, LinkListProps, LinkProps, Locale, MediaProps, NumberFieldProps, RadioGroupProps, RadioProps, SelectProps, TabListProps, TabPanelProps, TabProps, TabsProps, TagGroupProps, TagListProps, TagProps, TextAreaProps, TextFieldProps, CarouselButtonProps as UNSAFE_CarouselButtonProps, CarouselContextValue as UNSAFE_CarouselContextValue, CarouselControlsProps as UNSAFE_CarouselControlsProps, CarouselItemProps as UNSAFE_CarouselItemProps, CarouselItemsProps as UNSAFE_CarouselItemsProps, CarouselProps as UNSAFE_CarouselProps, CarouselElement as UNSAFE_CarouselRef, DialogProps as UNSAFE_DialogProps, DialogTriggerProps as UNSAFE_DialogTriggerProps, DrawerProps as UNSAFE_DrawerProps, FileUploadProps as UNSAFE_FileUploadProps, ModalProps as UNSAFE_ModalProps, PaginationProps as UNSAFE_PaginationProps, ResizableTableContainerProps as UNSAFE_ResizableTableContainerProps, StepProps as UNSAFE_StepProps, StepperProps as UNSAFE_StepperProps, TableBodyProps as UNSAFE_TableBodyProps, TableCellProps as UNSAFE_TableCellProps, TableColumnProps as UNSAFE_TableColumnProps, TableColumnResizerProps as UNSAFE_TableColumnResizerProps, UNSAFE_TableContainerProps, TableHeaderProps as UNSAFE_TableHeaderProps, TableProps as UNSAFE_TableProps, TableRowProps as UNSAFE_TableRowProps, ToggletipContentProps as UNSAFE_ToggletipContentProps, ToggletipProps as UNSAFE_ToggletipProps, ToggletipTriggerProps as UNSAFE_ToggletipTriggerProps };
1022
+ 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, Header, HeaderContext, Heading, HeadingContext, Hero, HeroContext, Label, Link, LinkList, LinkListContainer, LinkListContext, LinkListItem, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tab, TabList, TabPanel, Tabs, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselButton as UNSAFE_CarouselButton, CarouselContext as UNSAFE_CarouselContext, CarouselControls as UNSAFE_CarouselControls, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, CarouselItemsContainer as UNSAFE_CarouselItemsContainer, CarouselItemsContainer as UNSAFE_CarouselItemsContainerProps, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, Drawer as UNSAFE_Drawer, FileUpload as UNSAFE_FileUpload, Modal as UNSAFE_Modal, Pagination as UNSAFE_Pagination, ResizableTableContainer as UNSAFE_ResizableTableContainer, Step as UNSAFE_Step, Stepper as UNSAFE_Stepper, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableColumnResizer as UNSAFE_TableColumnResizer, UNSAFE_TableContainer, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Toggletip as UNSAFE_Toggletip, ToggletipContent as UNSAFE_ToggletipContent, ToggletipTrigger as UNSAFE_ToggletipTrigger, VideoLoop, _useLocale as useLocale };
1023
+ 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, HeaderProps, HeadingProps, HeroContextValue, HeroProps, LinkListContainerProps, LinkListContextValue, LinkListItemProps, LinkListProps, LinkProps, Locale, MediaProps, NumberFieldProps, RadioGroupProps, RadioProps, SelectProps, TabListProps, TabPanelProps, TabProps, TabsProps, TagGroupProps, TagListProps, TagProps, TextAreaProps, TextFieldProps, CarouselButtonProps as UNSAFE_CarouselButtonProps, CarouselContextValue as UNSAFE_CarouselContextValue, CarouselControlsProps as UNSAFE_CarouselControlsProps, CarouselItemProps as UNSAFE_CarouselItemProps, CarouselItemsProps as UNSAFE_CarouselItemsProps, CarouselProps as UNSAFE_CarouselProps, CarouselElement as UNSAFE_CarouselRef, DialogProps as UNSAFE_DialogProps, DialogTriggerProps as UNSAFE_DialogTriggerProps, DrawerProps as UNSAFE_DrawerProps, FileUploadProps as UNSAFE_FileUploadProps, ModalProps as UNSAFE_ModalProps, PaginationProps as UNSAFE_PaginationProps, ResizableTableContainerProps as UNSAFE_ResizableTableContainerProps, StepProps as UNSAFE_StepProps, StepperProps as UNSAFE_StepperProps, TableBodyProps as UNSAFE_TableBodyProps, TableCellProps as UNSAFE_TableCellProps, TableColumnProps as UNSAFE_TableColumnProps, TableColumnResizerProps as UNSAFE_TableColumnResizerProps, UNSAFE_TableContainerProps, TableHeaderProps as UNSAFE_TableHeaderProps, TableProps as UNSAFE_TableProps, TableRowProps as UNSAFE_TableRowProps, ToggletipContentProps as UNSAFE_ToggletipContentProps, ToggletipProps as UNSAFE_ToggletipProps, ToggletipTriggerProps as UNSAFE_ToggletipTriggerProps };
package/dist/index.mjs CHANGED
@@ -24,6 +24,7 @@ import useEmblaCarousel from 'embla-carousel-react';
24
24
  import { WheelGesturesPlugin } from 'embla-carousel-wheel-gestures';
25
25
  import { GroupContext, Group } from 'react-aria-components/Group';
26
26
  import { Dialog as Dialog$1, DialogTrigger as DialogTrigger$1, OverlayTriggerStateContext } from 'react-aria-components/Dialog';
27
+ import { HeadingContext as HeadingContext$1 } from 'react-aria-components/Heading';
27
28
  import { Modal as Modal$1, ModalOverlay } from 'react-aria-components/Modal';
28
29
  import { CheckboxContext, Checkbox as Checkbox$1 } from 'react-aria-components/Checkbox';
29
30
  import { Text } from 'react-aria-components/Text';
@@ -33,7 +34,7 @@ import { Label as Label$1, LabelContext } from 'react-aria-components/Label';
33
34
  import { ComboBox } from 'react-aria-components/ComboBox';
34
35
  import { Input, InputContext } from 'react-aria-components/Input';
35
36
  import { Popover, OverlayArrow } from 'react-aria-components/Popover';
36
- import { Header } from 'react-aria-components/Header';
37
+ import { Header as Header$1 } from 'react-aria-components/Header';
37
38
  import { ListBoxItem as ListBoxItem$1, ListBoxSection as ListBoxSection$1, ListBox as ListBox$1 } from 'react-aria-components/ListBox';
38
39
  import { useDateFormatter } from 'react-aria/useDateFormatter';
39
40
  import { FormContext } from 'react-aria-components/Form';
@@ -132,6 +133,27 @@ const Footer = (props)=>/*#__PURE__*/ jsx("div", {
132
133
  ...props,
133
134
  "data-slot": "footer"
134
135
  });
136
+ const HeaderContext = /*#__PURE__*/ createContext({});
137
+ /**
138
+ * Wraps the title of a Modal/Drawer (and, optionally, a `<Button slot="close" />`).
139
+ *
140
+ * Renders a `data-slot="header"` element consumers can style freely, e.g.
141
+ * `className="sticky top-0 bg-white"`. Inside a Modal/Drawer the dialog provides
142
+ * (via `HeaderContext`) the contexts to wrap the content in — wiring the title's
143
+ * accessible name (`aria-labelledby`) and the close button's appearance — so the
144
+ * consumer only writes a `Heading` and a bare `<Button slot="close" />`, with no
145
+ * `slot="title"` needed.
146
+ */ const Header = ({ children, ...props })=>{
147
+ const { _providerValues } = useContext(HeaderContext);
148
+ return /*#__PURE__*/ jsx("div", {
149
+ ...props,
150
+ "data-slot": "header",
151
+ children: _providerValues ? /*#__PURE__*/ jsx(Provider, {
152
+ values: _providerValues,
153
+ children: children
154
+ }) : children
155
+ });
156
+ };
135
157
 
136
158
  const disclosureButtonVariants = cva({
137
159
  base: [
@@ -1350,55 +1372,68 @@ const _ModalOverlay = ({ style = {}, zIndex = 10, fullscreen, ...restProps })=>/
1350
1372
  ...style
1351
1373
  }
1352
1374
  });
1353
- const Modal = ({ isDismissable = true, isOpen, onOpenChange, defaultOpen, className, zIndex, fullscreen = false, ...restProps })=>{
1375
+ const Modal = ({ isDismissable = true, isOpen, onOpenChange, defaultOpen, className, zIndex, fullscreen = false, ...restProps })=>/*#__PURE__*/ jsx(_ModalOverlay, {
1376
+ isOpen: isOpen,
1377
+ onOpenChange: onOpenChange,
1378
+ defaultOpen: defaultOpen,
1379
+ isDismissable: isDismissable,
1380
+ isKeyboardDismissDisabled: !isDismissable,
1381
+ zIndex: zIndex,
1382
+ fullscreen: fullscreen,
1383
+ children: /*#__PURE__*/ jsx(Modal$1, {
1384
+ ...restProps,
1385
+ className: ({ isEntering, isExiting })=>cx(className, 'overflow-auto bg-white text-left shadow-xl', fullscreen ? 'fixed inset-0' : 'w-full max-w-md rounded-2xl align-middle', isEntering && 'zoom-in-95 animate-in duration-300 ease-out', isExiting && 'zoom-out-95 animate-out duration-200 ease-in', // Using the motion-safe class does not work, so we use motion-reduce to overwrite instead
1386
+ 'motion-reduce:animate-none')
1387
+ })
1388
+ });
1389
+ /**
1390
+ * Rendered inside RACDialog (where React Aria exposes the generated title id via
1391
+ * its HeadingContext). Builds the contexts the header content needs and hands them
1392
+ * to `Header` through `HeaderContext`, so `Header` only has to render a `Provider`
1393
+ * around its own children — no knowledge of the dialog, close icon or locale.
1394
+ */ const HeaderTitle = ({ children })=>{
1395
+ const racTitle = useSlottedContext(HeadingContext$1, 'title');
1354
1396
  const locale = _useLocale();
1355
1397
  return /*#__PURE__*/ jsx(Provider, {
1356
1398
  values: [
1357
1399
  [
1358
- HeadingContext,
1400
+ HeaderContext,
1359
1401
  {
1360
- slots: {
1361
- [DEFAULT_SLOT]: {},
1362
- title: {
1363
- className: 'heading-s',
1364
- _outerWrapper: (children)=>/*#__PURE__*/ jsxs("div", {
1365
- className: "flex items-center justify-between gap-x-2",
1366
- children: [
1367
- children,
1368
- isDismissable && /*#__PURE__*/ jsx(Button, {
1369
- slot: "close",
1370
- variant: "tertiary",
1371
- className: "data-focus-visible:outline-focus-inset px-2.5!",
1372
- "aria-label": translations$1.close[locale],
1373
- onPress: ()=>onOpenChange?.(false),
1374
- children: /*#__PURE__*/ jsx(Close, {})
1375
- })
1376
- ]
1377
- })
1378
- }
1379
- }
1402
+ _providerValues: [
1403
+ [
1404
+ HeadingContext,
1405
+ {
1406
+ className: 'heading-s',
1407
+ id: racTitle?.id
1408
+ }
1409
+ ],
1410
+ [
1411
+ ButtonContext,
1412
+ {
1413
+ slots: {
1414
+ [DEFAULT_SLOT]: {},
1415
+ // Appearance for a bare `<Button slot="close" />`; the close
1416
+ // behaviour (onPress) comes from the Dialog's ButtonContext below.
1417
+ close: {
1418
+ variant: 'tertiary',
1419
+ 'aria-label': translations$1.close[locale],
1420
+ className: 'data-focus-visible:outline-focus-inset px-2.5!',
1421
+ children: /*#__PURE__*/ jsx(Close, {})
1422
+ }
1423
+ }
1424
+ }
1425
+ ]
1426
+ ]
1380
1427
  }
1381
1428
  ]
1382
1429
  ],
1383
- children: /*#__PURE__*/ jsx(_ModalOverlay, {
1384
- isOpen: isOpen,
1385
- onOpenChange: onOpenChange,
1386
- defaultOpen: defaultOpen,
1387
- isDismissable: isDismissable,
1388
- isKeyboardDismissDisabled: !isDismissable,
1389
- zIndex: zIndex,
1390
- fullscreen: fullscreen,
1391
- children: /*#__PURE__*/ jsx(Modal$1, {
1392
- ...restProps,
1393
- className: ({ isEntering, isExiting })=>cx(className, 'overflow-auto bg-white text-left shadow-xl', fullscreen ? 'fixed inset-0' : 'w-full max-w-md rounded-2xl align-middle', isEntering && 'zoom-in-95 animate-in duration-300 ease-out', isExiting && 'zoom-out-95 animate-out duration-200 ease-in', // Using the motion-safe class does not work, so we use motion-reduce to overwrite instead
1394
- 'motion-reduce:animate-none')
1395
- })
1396
- })
1430
+ children: children
1397
1431
  });
1398
1432
  };
1399
1433
  const Dialog = ({ className, children, ...restProps })=>/*#__PURE__*/ jsx(Dialog$1, {
1400
1434
  ...restProps,
1401
- className: cx(className, 'relative flex flex-col gap-y-5 p-4 outline-none', // Footer
1435
+ className: cx(className, 'relative flex flex-col gap-y-5 p-4 outline-none', // Header
1436
+ '**:data-[slot="header"]:flex **:data-[slot="header"]:items-center **:data-[slot="header"]:justify-between **:data-[slot="header"]:gap-x-2', // Footer
1402
1437
  '**:data-[slot="footer"]:flex **:data-[slot="footer"]:gap-x-2'),
1403
1438
  children: ({ close })=>/*#__PURE__*/ jsx(Provider, {
1404
1439
  values: [
@@ -1419,7 +1454,9 @@ const Dialog = ({ className, children, ...restProps })=>/*#__PURE__*/ jsx(Dialog
1419
1454
  }
1420
1455
  ]
1421
1456
  ],
1422
- children: children
1457
+ children: /*#__PURE__*/ jsx(HeaderTitle, {
1458
+ children: children
1459
+ })
1423
1460
  })
1424
1461
  });
1425
1462
  /**
@@ -2015,7 +2052,7 @@ const ListBoxItem = (props)=>{
2015
2052
  });
2016
2053
  /**
2017
2054
  * This component can be used to label grouped items in a `ListBoxSection` with a heading
2018
- */ const ListBoxHeader = (props)=>/*#__PURE__*/ jsx(Header, {
2055
+ */ const ListBoxHeader = (props)=>/*#__PURE__*/ jsx(Header$1, {
2019
2056
  ...props,
2020
2057
  className: cx(props.className, 'text-blue-dark mx-6 cursor-default py-2 leading-6 font-medium')
2021
2058
  });
@@ -2150,60 +2187,28 @@ const drawerVariants = cva({
2150
2187
  }
2151
2188
  ]
2152
2189
  });
2153
- const Drawer = ({ isDismissable = true, isOpen, onOpenChange, defaultOpen, className, zIndex = 10, placement = 'right', style = {}, ...restProps })=>{
2154
- const locale = _useLocale();
2155
- return /*#__PURE__*/ jsx(Provider, {
2156
- values: [
2157
- [
2158
- HeadingContext,
2159
- {
2160
- slots: {
2161
- [DEFAULT_SLOT]: {},
2162
- title: {
2163
- className: 'heading-s',
2164
- _outerWrapper: (children)=>/*#__PURE__*/ jsxs("div", {
2165
- className: "flex items-center justify-between gap-x-2",
2166
- children: [
2167
- children,
2168
- isDismissable && /*#__PURE__*/ jsx(Button, {
2169
- slot: "close",
2170
- variant: "tertiary",
2171
- className: "data-focus-visible:outline-focus-inset px-2.5!",
2172
- "aria-label": translations$1.close[locale],
2173
- onPress: ()=>onOpenChange?.(false),
2174
- children: /*#__PURE__*/ jsx(Close, {})
2175
- })
2176
- ]
2177
- })
2178
- }
2179
- }
2180
- }
2181
- ]
2182
- ],
2183
- children: /*#__PURE__*/ jsx(ModalOverlay, {
2184
- isOpen: isOpen,
2185
- onOpenChange: onOpenChange,
2186
- defaultOpen: defaultOpen,
2187
- isDismissable: isDismissable,
2188
- isKeyboardDismissDisabled: !isDismissable,
2189
- style: {
2190
- zIndex,
2191
- ...style
2192
- },
2193
- className: ({ isEntering, isExiting })=>cx('fixed inset-0 bg-black/25 backdrop-blur-sm', isEntering && 'fade-in animate-in duration-300 ease-out', isExiting && 'fade-out animate-out duration-200 ease-in', // Using the motion-safe class does not work, so we use motion-reduce to overwrite instead
2194
- 'motion-reduce:animate-none'),
2195
- children: /*#__PURE__*/ jsx(Modal$1, {
2196
- ...restProps,
2197
- className: ({ isEntering, isExiting })=>drawerVariants({
2198
- placement,
2199
- isEntering,
2200
- isExiting,
2201
- className
2202
- })
2203
- })
2190
+ const Drawer = ({ isDismissable = true, isOpen, onOpenChange, defaultOpen, className, zIndex = 10, placement = 'right', style = {}, ...restProps })=>/*#__PURE__*/ jsx(ModalOverlay, {
2191
+ isOpen: isOpen,
2192
+ onOpenChange: onOpenChange,
2193
+ defaultOpen: defaultOpen,
2194
+ isDismissable: isDismissable,
2195
+ isKeyboardDismissDisabled: !isDismissable,
2196
+ style: {
2197
+ zIndex,
2198
+ ...style
2199
+ },
2200
+ className: ({ isEntering, isExiting })=>cx('fixed inset-0 bg-black/25 backdrop-blur-sm', isEntering && 'fade-in animate-in duration-300 ease-out', isExiting && 'fade-out animate-out duration-200 ease-in', // Using the motion-safe class does not work, so we use motion-reduce to overwrite instead
2201
+ 'motion-reduce:animate-none'),
2202
+ children: /*#__PURE__*/ jsx(Modal$1, {
2203
+ ...restProps,
2204
+ className: ({ isEntering, isExiting })=>drawerVariants({
2205
+ placement,
2206
+ isEntering,
2207
+ isExiting,
2208
+ className
2209
+ })
2204
2210
  })
2205
2211
  });
2206
- };
2207
2212
 
2208
2213
  /**
2209
2214
  * A FileTrigger allows a user to access the file system with any pressable React Aria or React Spectrum component, or custom components built with usePress.
@@ -3707,4 +3712,4 @@ const VideoLoop = ({ src, format, alt, className })=>{
3707
3712
  });
3708
3713
  };
3709
3714
 
3710
- 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, Hero, HeroContext, Label, Link, LinkList, LinkListContainer, LinkListContext, LinkListItem, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tab, TabList, TabPanel, Tabs, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselButton as UNSAFE_CarouselButton, CarouselContext as UNSAFE_CarouselContext, CarouselControls as UNSAFE_CarouselControls, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, CarouselItemsContainer as UNSAFE_CarouselItemsContainer, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, Drawer as UNSAFE_Drawer, FileUpload as UNSAFE_FileUpload, Modal as UNSAFE_Modal, Pagination as UNSAFE_Pagination, ResizableTableContainer as UNSAFE_ResizableTableContainer, Step as UNSAFE_Step, Stepper as UNSAFE_Stepper, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableColumnResizer as UNSAFE_TableColumnResizer, UNSAFE_TableContainer, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Toggletip as UNSAFE_Toggletip, ToggletipContent as UNSAFE_ToggletipContent, ToggletipTrigger as UNSAFE_ToggletipTrigger, VideoLoop, _useLocale as useLocale };
3715
+ 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, Header, HeaderContext, Heading, HeadingContext, Hero, HeroContext, Label, Link, LinkList, LinkListContainer, LinkListContext, LinkListItem, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tab, TabList, TabPanel, Tabs, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselButton as UNSAFE_CarouselButton, CarouselContext as UNSAFE_CarouselContext, CarouselControls as UNSAFE_CarouselControls, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, CarouselItemsContainer as UNSAFE_CarouselItemsContainer, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, Drawer as UNSAFE_Drawer, FileUpload as UNSAFE_FileUpload, Modal as UNSAFE_Modal, Pagination as UNSAFE_Pagination, ResizableTableContainer as UNSAFE_ResizableTableContainer, Step as UNSAFE_Step, Stepper as UNSAFE_Stepper, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableColumnResizer as UNSAFE_TableColumnResizer, UNSAFE_TableContainer, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Toggletip as UNSAFE_Toggletip, ToggletipContent as UNSAFE_ToggletipContent, ToggletipTrigger as UNSAFE_ToggletipTrigger, VideoLoop, _useLocale as useLocale };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "3.8.2",
3
+ "version": "3.9.0",
4
4
  "description": "Grunnmuren components in React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "react-aria-components": "^1.17.0",
27
27
  "react-stately": "^3.46.0",
28
28
  "use-debounce": "^10.0.4",
29
- "@obosbbl/grunnmuren-icons-react": "^2.2.1"
29
+ "@obosbbl/grunnmuren-icons-react": "^2.3.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^24.0.0",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": "^19",
37
- "@obosbbl/grunnmuren-tailwind": "^2.4.12"
37
+ "@obosbbl/grunnmuren-tailwind": "^2.5.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "bunchee"