@obosbbl/grunnmuren-react 2.0.0-canary.50 → 2.0.0-canary.52

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,4 +1,4 @@
1
- import { RouterProvider, ButtonProps as ButtonProps$1, LinkProps, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, ListBoxItemProps, ListBoxSectionProps, HeadingProps as HeadingProps$1, ComboBoxProps, RadioGroupProps as RadioGroupProps$1, RadioProps as RadioProps$1, SelectProps as SelectProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, ContextValue, BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1, Link, DisclosureProps as DisclosureProps$1 } from 'react-aria-components';
1
+ import { RouterProvider, ButtonProps as ButtonProps$1, LinkProps, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, ListBoxItemProps, ListBoxSectionProps, HeadingProps as HeadingProps$1, ComboBoxProps, RadioGroupProps as RadioGroupProps$1, RadioProps as RadioProps$1, SelectProps as SelectProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, ContextValue, BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1, DisclosureProps as DisclosureProps$1 } from 'react-aria-components';
2
2
  export { ListBoxItemProps as ComboboxItemProps, Form, ListBoxItemProps as SelectItemProps, DisclosureGroup as UNSAFE_DisclosureGroup, DisclosureGroupProps as UNSAFE_DisclosureGroupProps } from 'react-aria-components';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
@@ -569,7 +569,7 @@ type ButtonOrLinkProps = {
569
569
  */
570
570
  withUnderline?: boolean;
571
571
  };
572
- type BacklinkProps = (ButtonProps$1 | React.ComponentPropsWithoutRef<typeof Link>) & ButtonOrLinkProps;
572
+ type BacklinkProps = (ButtonProps$1 | LinkProps) & ButtonOrLinkProps;
573
573
  declare const _Backlink: react.ForwardRefExoticComponent<BacklinkProps & react.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
574
574
 
575
575
  type CardProps = VariantProps<typeof cardVariants> & {
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { I18nProvider, RouterProvider, useLocale, useContextProps, Provider, Link, Button as Button$1, Text, CheckboxContext, Checkbox as Checkbox$1, FieldError, Label as Label$1, CheckboxGroup as CheckboxGroup$1, ListBoxItem as ListBoxItem$1, ListBoxSection as ListBoxSection$1, Header, ListBox as ListBox$1, ComboBox, Group, Input, Popover, RadioGroup as RadioGroup$1, Radio as Radio$1, Select as Select$1, SelectValue, TextField as TextField$1, TextArea as TextArea$1, NumberField as NumberField$1, Breadcrumbs as Breadcrumbs$1, Breadcrumb as Breadcrumb$1, ButtonContext, DisclosureContext, DisclosureGroupStateContext } from 'react-aria-components';
2
+ import { I18nProvider, RouterProvider, useLocale, useContextProps, Provider, Link, Button as Button$1, Text, CheckboxContext, Checkbox as Checkbox$1, FieldError, Label as Label$1, CheckboxGroup as CheckboxGroup$1, ListBoxItem as ListBoxItem$1, ListBoxSection as ListBoxSection$1, Header, ListBox as ListBox$1, ComboBox, Group, Input, Popover, RadioGroup as RadioGroup$1, Radio as Radio$1, Select as Select$1, SelectValue, TextField as TextField$1, TextArea as TextArea$1, NumberField as NumberField$1, Breadcrumbs as Breadcrumbs$1, Breadcrumb as Breadcrumb$1, ButtonContext, DisclosureContext, DisclosureGroupStateContext, DEFAULT_SLOT } from 'react-aria-components';
3
3
  export { Form, DisclosureGroup as UNSAFE_DisclosureGroup } from 'react-aria-components';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { ChevronDown, LoadingSpinner, Check, Close, InfoCircle, CheckCircle, Warning, Error, ChevronRight, ChevronLeft, PlayerPause, PlayerPlay } from '@obosbbl/grunnmuren-icons-react';
@@ -1092,8 +1092,8 @@ const cardVariants = cva({
1092
1092
  '[&_[data-slot="media"]]:relative',
1093
1093
  // Position media at the edges of the card (because of these negative margins the media-element must be a wrapper around the actual image or other media content)
1094
1094
  '[&_[data-slot="media"]]:mx-[calc(theme(space.3)*-1-theme(borderWidth.DEFAULT))] [&_[data-slot="media"]]:mt-[calc(theme(space.3)*-1-theme(borderWidth.DEFAULT))]',
1095
- // Sets the aspect ratio of the media content (width: 100% is necessary to make aspect ratio work in FF)
1096
- '[&_[data-slot="media"]>*:not([data-slot="badge"])]:aspect-[3/2] [&_[data-slot="media"]>*:not([data-slot="badge"])]:w-full [&_[data-slot="media"]_img]:object-cover',
1095
+ // Sets the aspect ratio of the media content (width: 100% is necessary to make aspect ratio work on images in FF)
1096
+ '[&_[data-slot="media"]>*:not([data-slot="badge"])]:aspect-[3/2] [&_[data-slot="media"]_img]:w-full [&_[data-slot="media"]_img]:object-cover',
1097
1097
  // Prepare zoom animation for hover effects. The hover effect can also be enabled by classes on the parent component, so it is always prepared here.
1098
1098
  '[&_[data-slot="media"]>*]:duration-300 [&_[data-slot="media"]>*]:ease-in-out [&_[data-slot="media"]>*]:motion-safe:transition-transform',
1099
1099
  // **** Card link ****
@@ -1168,6 +1168,7 @@ const cardVariants = cva({
1168
1168
  '[&:has(>[data-slot="media"]:first-child)]:flex-col',
1169
1169
  '[&:has(>[data-slot="media"]:last-child)]:flex-col-reverse',
1170
1170
  '[&:has(>[data-slot="media"])]:md:!flex-row',
1171
+ '[&_[data-slot="media"]]:md:h-fit',
1171
1172
  '[&:has(>[data-slot="media"])>*]:md:basis-1/2',
1172
1173
  // Position media at the edges of the card
1173
1174
  '[&_[data-slot="media"]]:md:mb-[calc(theme(space.3)*-1-theme(borderWidth.DEFAULT))]',
@@ -1178,8 +1179,8 @@ const cardVariants = cva({
1178
1179
  '[&:has(>[data-slot="media"]:last-child)_[data-slot="card-link"]]:z-[1]',
1179
1180
  // **** Without Media ****
1180
1181
  '[&:not(:has(>[data-slot="media"]))]:flex-row',
1181
- // Make the layout responsive: when the Content reaches a minimum width of 18rem, the layout switches to vertical. Also makes sure Content takes up the remaining space available.
1182
- '[&:not(:has(>[data-slot="media"]))]:flex-wrap [&:not(:has(>[data-slot="media"]))_[data-slot="content"]]:grow [&:not(:has(>[data-slot="media"]))_[data-slot="content"]]:basis-[18rem]',
1182
+ // Make the layout responsive: when the Content reaches a minimum width of 12rem, the layout switches to vertical. Also makes sure Content takes up the remaining space available.
1183
+ '[&:not(:has(>[data-slot="media"]))]:flex-wrap [&:not(:has(>[data-slot="media"]))_[data-slot="content"]]:grow [&:not(:has(>[data-slot="media"]))_[data-slot="content"]]:basis-[12rem]',
1183
1184
  // Make sure svg's etc. are not shrinkable
1184
1185
  '[&>:not([data-slot="content"],[data-slot="media"])]:shrink-0'
1185
1186
  ]
@@ -1375,7 +1376,7 @@ const VideoLoop = ({ src, format, alt, className })=>{
1375
1376
 
1376
1377
  const disclosureButtonVariants = cva({
1377
1378
  base: [
1378
- 'inline-flex cursor-pointer items-center justify-between rounded-lg outline-none data-[focus-visible]:outline-focus',
1379
+ 'inline-flex cursor-pointer items-center justify-between rounded-lg outline-none data-[focus-visible]:outline-current data-[focus-visible]:outline-focus',
1379
1380
  // Ensure a minimum click area of 44x44px, while making it look like it only has the size of the content
1380
1381
  '-m-2.5 p-2.5 data-[focus-visible]:outline-offset-[-0.625rem]'
1381
1382
  ],
@@ -1407,6 +1408,7 @@ const DisclosureButton = ({ className, withChevron, isIconOnly, children, ref: _
1407
1408
  withChevron,
1408
1409
  isIconOnly
1409
1410
  }),
1411
+ slot: "trigger",
1410
1412
  children: [
1411
1413
  children,
1412
1414
  withChevron && /*#__PURE__*/ jsx(ChevronDown, {
@@ -1449,7 +1451,12 @@ const Disclosure = ({ ref: _ref, children, ..._props })=>{
1449
1451
  ],
1450
1452
  [
1451
1453
  ButtonContext,
1452
- buttonProps
1454
+ {
1455
+ slots: {
1456
+ [DEFAULT_SLOT]: {},
1457
+ trigger: buttonProps
1458
+ }
1459
+ }
1453
1460
  ],
1454
1461
  [
1455
1462
  DisclosurePanelContext,
@@ -1478,13 +1485,16 @@ const DisclosurePanel = ({ ref: _ref, ..._props })=>{
1478
1485
  const isWithoutRole = _role === 'none';
1479
1486
  const role = isWithoutRole ? undefined : _role;
1480
1487
  return /*#__PURE__*/ jsx("div", {
1481
- className: cx('grid transition-all duration-300 after:relative after:block after:h-0 after:transition-all after:duration-300 motion-reduce:transition-none', disclosureContext?.isExpanded ? 'grid-rows-[1fr] after:h-3.5' : 'grid-rows-[0fr]'),
1488
+ className: cx('grid transition-all duration-300 motion-reduce:transition-none', disclosureContext?.isExpanded ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]'),
1482
1489
  children: /*#__PURE__*/ jsx("div", {
1483
- ...restProps,
1484
- ref: ref,
1485
- className: cx(className, 'relative overflow-hidden [content-visibility:visible] before:relative before:block before:h-1.5 after:relative after:block after:h-1.5'),
1486
- role: role,
1487
- "aria-labelledby": isWithoutRole ? undefined : ariaLabelledby
1490
+ className: "overflow-hidden",
1491
+ children: /*#__PURE__*/ jsx("div", {
1492
+ ...restProps,
1493
+ className: cx(className, '[content-visibility:visible]'),
1494
+ ref: ref,
1495
+ role: role,
1496
+ "aria-labelledby": isWithoutRole ? undefined : ariaLabelledby
1497
+ })
1488
1498
  })
1489
1499
  });
1490
1500
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "2.0.0-canary.50",
3
+ "version": "2.0.0-canary.52",
4
4
  "description": "Grunnmuren components in React",
5
5
  "repository": {
6
6
  "url": "https://github.com/code-obos/grunnmuren"