@obosbbl/grunnmuren-react 3.1.2 → 3.1.3

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
@@ -167,7 +167,7 @@ declare function Breadcrumbs(props: BreadcrumbsProps): react_jsx_runtime.JSX.Ele
167
167
  */
168
168
  declare const buttonVariants: (props?: ({
169
169
  variant?: "primary" | "secondary" | "tertiary" | undefined;
170
- color?: "mint" | "white" | "blue" | undefined;
170
+ color?: "blue" | "mint" | "white" | undefined;
171
171
  isIconOnly?: boolean | undefined;
172
172
  isPending?: boolean | undefined;
173
173
  } & ({
@@ -194,7 +194,7 @@ type CardProps = VariantProps<typeof cardVariants> & HTMLAttributes<HTMLDivEleme
194
194
  };
195
195
  declare const cardVariants: (props?: ({
196
196
  variant?: "subtle" | "outlined" | undefined;
197
- layout?: "horizontal" | "vertical" | undefined;
197
+ layout?: "vertical" | "horizontal" | undefined;
198
198
  } & ({
199
199
  class?: cva.ClassValue;
200
200
  className?: never;
@@ -351,7 +351,7 @@ type MediaProps = HTMLProps<HTMLDivElement> & VariantProps<typeof mediaVariant>
351
351
  ref?: Ref<HTMLDivElement>;
352
352
  };
353
353
  declare const mediaVariant: (props?: ({
354
- fit?: "contain" | "cover" | undefined;
354
+ fit?: "cover" | "contain" | undefined;
355
355
  } & ({
356
356
  class?: cva.ClassValue;
357
357
  className?: never;
package/dist/index.mjs CHANGED
@@ -492,7 +492,7 @@ function isLinkProps$1(props) {
492
492
  }
493
493
  function Backlink(props) {
494
494
  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');
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
496
  const content = /*#__PURE__*/ jsxs(Fragment, {
497
497
  children: [
498
498
  /*#__PURE__*/ jsx(ChevronLeft, {
@@ -1079,33 +1079,36 @@ const Carousel = ({ className, children, onChange, ...rest })=>{
1079
1079
  }
1080
1080
  }, 150);
1081
1081
  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
- }
1082
+ setScrollTargetIndex((currentTargetIndex)=>{
1083
+ const targetIndex = currentTargetIndex - 1;
1084
+ if (targetIndex < 0) {
1085
+ return currentTargetIndex;
1086
+ }
1087
+ if (isScrollingProgrammatically.current) {
1088
+ // If we're already scrolling, queue this action
1089
+ scrollQueue.current = [
1090
+ targetIndex
1091
+ ];
1092
+ return currentTargetIndex;
1093
+ }
1094
+ return targetIndex;
1095
+ });
1094
1096
  };
1095
1097
  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
- }
1098
+ setScrollTargetIndex((currentTargetIndex)=>{
1099
+ const targetIndex = currentTargetIndex + 1;
1100
+ if (!carouselItemsRef.current || targetIndex >= carouselItemsRef.current.children.length) {
1101
+ return currentTargetIndex;
1102
+ }
1103
+ if (isScrollingProgrammatically.current) {
1104
+ // If we're already scrolling, queue this action
1105
+ scrollQueue.current = [
1106
+ targetIndex
1107
+ ];
1108
+ return currentTargetIndex;
1109
+ }
1110
+ return targetIndex;
1111
+ });
1109
1112
  };
1110
1113
  return /*#__PURE__*/ jsx("div", {
1111
1114
  "data-slot": "carousel",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "Grunnmuren components in React",
5
5
  "repository": {
6
6
  "url": "https://github.com/code-obos/grunnmuren"