@obosbbl/grunnmuren-react 2.3.4 → 3.0.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
@@ -80,7 +80,7 @@ declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
80
80
  */
81
81
  declare const buttonVariants: (props?: ({
82
82
  variant?: "primary" | "secondary" | "tertiary" | undefined;
83
- color?: "mint" | "white" | "green" | undefined;
83
+ color?: "mint" | "white" | "blue" | undefined;
84
84
  isIconOnly?: boolean | undefined;
85
85
  isPending?: boolean | undefined;
86
86
  } & ({
@@ -93,12 +93,6 @@ declare const buttonVariants: (props?: ({
93
93
  type ButtonOrLinkProps$1 = VariantProps<typeof buttonVariants> & {
94
94
  children?: React.ReactNode;
95
95
  href?: LinkProps['href'];
96
- /**
97
- * Display the button in a loading state
98
- * @deprecated Use isPending instead.
99
- * @default false
100
- */
101
- isLoading?: boolean;
102
96
  /** Additional style properties for the element. */
103
97
  style?: React.CSSProperties;
104
98
  /** Ref to the element. */
@@ -158,11 +152,6 @@ type ComboboxProps<T extends object> = {
158
152
  description?: React.ReactNode;
159
153
  /** Error message for the form control. Automatically sets `isInvalid` to true */
160
154
  errorMessage?: React.ReactNode;
161
- /**
162
- * Display the dropdown button trigger in a pending state
163
- * @deprecated Use isPending instead.
164
- */
165
- isLoading?: boolean;
166
155
  /**
167
156
  * Display the dropdown button trigger in a pending state
168
157
  * @default false
package/dist/index.mjs CHANGED
@@ -291,14 +291,14 @@ const translations$1 = {
291
291
  */ variant: {
292
292
  primary: 'no-underline',
293
293
  // by using an inset box-shadow to emulate a border instead of an actual border, the button size will be equal regardless of the variant
294
- secondary: 'no-underline shadow-[inset_0_0_0_2px]',
294
+ secondary: 'border-2 border-current no-underline hover:border-transparent',
295
295
  tertiary: 'underline hover:no-underline'
296
296
  },
297
297
  /**
298
298
  * Adjusts the color of the button for usage on different backgrounds.
299
- * @default green
299
+ * @default blue
300
300
  */ color: {
301
- green: 'focus-visible:outline-focus',
301
+ blue: 'focus-visible:outline-focus',
302
302
  mint: 'focus-visible:outline-focus focus-visible:outline-mint',
303
303
  white: 'focus-visible:outline-focus focus-visible:outline-white'
304
304
  },
@@ -317,18 +317,18 @@ const translations$1 = {
317
317
  },
318
318
  compoundVariants: [
319
319
  {
320
- color: 'green',
320
+ color: 'blue',
321
321
  variant: 'primary',
322
322
  // Darken bg by 20% on hover. The color is manually crafted
323
- className: 'bg-green text-white hover:bg-green-dark active:bg-[#007352] [&_[role="progressbar"]]:text-white'
323
+ className: 'bg-blue-dark text-white hover:bg-blue active:bg-[#0536A0] active:text-white [&_[role="progressbar"]]:text-white'
324
324
  },
325
325
  {
326
- color: 'green',
326
+ color: 'blue',
327
327
  variant: 'secondary',
328
- className: 'text-black shadow-green hover:bg-green hover:text-white active:bg-green [&:hover_[role="progressbar"]]:text-white [&_[role="progressbar"]]:text-black'
328
+ className: 'text-blue-dark hover:border-transparent hover:bg-blue hover:text-blue-dark hover:text-white active:bg-[#0536A0] [&:hover_[role="progressbar"]]:text-white [&_[role="progressbar"]]:text-blue-dark'
329
329
  },
330
330
  {
331
- color: 'green',
331
+ color: 'blue',
332
332
  variant: 'tertiary',
333
333
  className: '[&_[role="progressbar"]]:text-black'
334
334
  },
@@ -341,7 +341,7 @@ const translations$1 = {
341
341
  {
342
342
  color: 'mint',
343
343
  variant: 'secondary',
344
- className: 'text-mint shadow-mint hover:bg-mint hover:text-black [&:hover_[role="progressbar"]]:text-black [&_[role="progressbar"]]:text-mint'
344
+ className: 'text-mint hover:bg-mint hover:text-black [&:hover_[role="progressbar"]]:text-black [&_[role="progressbar"]]:text-mint'
345
345
  },
346
346
  {
347
347
  color: 'mint',
@@ -356,7 +356,7 @@ const translations$1 = {
356
356
  {
357
357
  color: 'white',
358
358
  variant: 'secondary',
359
- className: 'text-white shadow-white hover:bg-white hover:text-black [&:hover_[role="progressbar"]]:text-black [&_[role="progressbar"]]:text-white'
359
+ className: 'text-white hover:bg-white hover:text-black [&:hover_[role="progressbar"]]:text-black [&_[role="progressbar"]]:text-white'
360
360
  },
361
361
  {
362
362
  color: 'white',
@@ -366,7 +366,7 @@ const translations$1 = {
366
366
  ],
367
367
  defaultVariants: {
368
368
  variant: 'primary',
369
- color: 'green',
369
+ color: 'blue',
370
370
  isIconOnly: false,
371
371
  isPending: false
372
372
  }
@@ -377,8 +377,7 @@ function isLinkProps$1(props) {
377
377
  }
378
378
  function Button({ ref = null, ...props }) {
379
379
  [props, ref] = useContextProps(props, ref, ButtonContext);
380
- const { children: _children, color, isIconOnly, isLoading, variant, isPending: _isPending, ...restProps } = props;
381
- const isPending = _isPending || isLoading;
380
+ const { children: _children, color, isIconOnly, variant, isPending, ...restProps } = props;
382
381
  const className = buttonVariants({
383
382
  className: props.className,
384
383
  color,
@@ -638,8 +637,7 @@ function InputAddonDivider() {
638
637
  }
639
638
 
640
639
  function Combobox(props) {
641
- const { className, children, description, errorMessage, isLoading, isPending: _isPending, label, isInvalid: _isInvalid, ref, ...restProps } = props;
642
- const isPending = _isPending || isLoading;
640
+ const { className, children, description, errorMessage, isPending, label, isInvalid: _isInvalid, ref, ...restProps } = props;
643
641
  // the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
644
642
  // which will override any built in validation
645
643
  const isInvalid = !!errorMessage || _isInvalid;
@@ -1802,7 +1800,7 @@ const FileUpload = ({ children, files: _files, onChange, validate, isInvalid: _i
1802
1800
  children: children
1803
1801
  })
1804
1802
  }),
1805
- /*#__PURE__*/ jsx("ul", {
1803
+ controlledOrUncontrolledFiles.length > 0 && /*#__PURE__*/ jsx("ul", {
1806
1804
  className: "mt-4 grid gap-y-2",
1807
1805
  children: controlledOrUncontrolledFiles.map((file, fileIndex)=>{
1808
1806
  let fileName = file.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "2.3.4",
3
+ "version": "3.0.0",
4
4
  "description": "Grunnmuren components in React",
5
5
  "repository": {
6
6
  "url": "https://github.com/code-obos/grunnmuren"