@obosbbl/grunnmuren-react 2.0.0-canary.51 → 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.
Files changed (2) hide show
  1. package/dist/index.mjs +22 -13
  2. package/package.json +1 -1
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 ****
@@ -1179,8 +1179,8 @@ const cardVariants = cva({
1179
1179
  '[&:has(>[data-slot="media"]:last-child)_[data-slot="card-link"]]:z-[1]',
1180
1180
  // **** Without Media ****
1181
1181
  '[&:not(:has(>[data-slot="media"]))]:flex-row',
1182
- // 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.
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-[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]',
1184
1184
  // Make sure svg's etc. are not shrinkable
1185
1185
  '[&>:not([data-slot="content"],[data-slot="media"])]:shrink-0'
1186
1186
  ]
@@ -1376,7 +1376,7 @@ const VideoLoop = ({ src, format, alt, className })=>{
1376
1376
 
1377
1377
  const disclosureButtonVariants = cva({
1378
1378
  base: [
1379
- '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',
1380
1380
  // Ensure a minimum click area of 44x44px, while making it look like it only has the size of the content
1381
1381
  '-m-2.5 p-2.5 data-[focus-visible]:outline-offset-[-0.625rem]'
1382
1382
  ],
@@ -1408,6 +1408,7 @@ const DisclosureButton = ({ className, withChevron, isIconOnly, children, ref: _
1408
1408
  withChevron,
1409
1409
  isIconOnly
1410
1410
  }),
1411
+ slot: "trigger",
1411
1412
  children: [
1412
1413
  children,
1413
1414
  withChevron && /*#__PURE__*/ jsx(ChevronDown, {
@@ -1450,7 +1451,12 @@ const Disclosure = ({ ref: _ref, children, ..._props })=>{
1450
1451
  ],
1451
1452
  [
1452
1453
  ButtonContext,
1453
- buttonProps
1454
+ {
1455
+ slots: {
1456
+ [DEFAULT_SLOT]: {},
1457
+ trigger: buttonProps
1458
+ }
1459
+ }
1454
1460
  ],
1455
1461
  [
1456
1462
  DisclosurePanelContext,
@@ -1479,13 +1485,16 @@ const DisclosurePanel = ({ ref: _ref, ..._props })=>{
1479
1485
  const isWithoutRole = _role === 'none';
1480
1486
  const role = isWithoutRole ? undefined : _role;
1481
1487
  return /*#__PURE__*/ jsx("div", {
1482
- 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]'),
1483
1489
  children: /*#__PURE__*/ jsx("div", {
1484
- ...restProps,
1485
- ref: ref,
1486
- 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'),
1487
- role: role,
1488
- "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
+ })
1489
1498
  })
1490
1499
  });
1491
1500
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "2.0.0-canary.51",
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"