agroptima-design-system 0.27.1-beta.0 → 0.27.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agroptima-design-system",
3
- "version": "0.27.1-beta.0",
3
+ "version": "0.27.2",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -1,6 +1,7 @@
1
1
  import './Card.scss'
2
2
  import React from 'react'
3
3
  import { classNames } from '../../utils/classNames'
4
+ import Link from 'next/link'
4
5
 
5
6
  export type Variant = 'primary'
6
7
 
@@ -23,20 +24,28 @@ export function Card({
23
24
  isActive = false,
24
25
  error = false,
25
26
  children,
27
+ href,
26
28
  ...props
27
29
  }: CardProps) {
28
30
  if (!visible) return null
29
31
 
30
- const Tag = props.href ? 'a' : 'article'
31
-
32
- const cssClasses = classNames(className, 'card', variant, {
32
+ const cssClasses = classNames('card', variant, className, {
33
33
  disabled: isDisabled,
34
34
  active: isActive,
35
35
  error: error,
36
36
  })
37
+
38
+ if (href && !isDisabled) {
39
+ return (
40
+ <Link href={href} className={cssClasses} {...props}>
41
+ {children}
42
+ </Link>
43
+ )
44
+ }
45
+
37
46
  return (
38
- <Tag className={cssClasses} {...props}>
47
+ <article className={cssClasses} {...props}>
39
48
  {children}
40
- </Tag>
49
+ </article>
41
50
  )
42
51
  }
@@ -56,7 +56,8 @@ $gap: config.$space-4x;
56
56
  padding: config.$space-4x auto config.$space-4x auto;
57
57
 
58
58
  .button {
59
- width: 50%;
59
+ display: flex;
60
+ flex-grow: 1;
60
61
  }
61
62
  }
62
63
  }
@@ -65,7 +65,9 @@ export function Input({
65
65
  >
66
66
  {!hideLabel && (
67
67
  <label
68
- className={classNames('input-label', required ? 'is-required' : '')}
68
+ className={classNames('input-label', {
69
+ 'is-required': required,
70
+ })}
69
71
  htmlFor={identifier}
70
72
  >
71
73
  {label}
@@ -68,6 +68,10 @@
68
68
 
69
69
  .quantity-selector-label {
70
70
  @include form-typography.form-label;
71
+ &.is-required::after {
72
+ content: '*';
73
+ color: color_alias.$primary-color-600;
74
+ }
71
75
  }
72
76
  }
73
77
  }
@@ -29,16 +29,22 @@ export function QuantitySelector({
29
29
  disabled,
30
30
  ...props
31
31
  }: QuantitySelectorProps): React.JSX.Element {
32
- const cssClasses = classNames('quantity-selector', className)
33
-
34
32
  return (
35
- <div className={`quantity-selector-group ${variant}`} {...props}>
33
+ <div
34
+ className={classNames('quantity-selector-group', variant, className)}
35
+ {...props}
36
+ >
36
37
  {!hideLabel && (
37
- <label className="quantity-selector-label" htmlFor={id}>
38
+ <label
39
+ className={classNames('quantity-selector-label', {
40
+ 'is-required': props.required,
41
+ })}
42
+ htmlFor={id}
43
+ >
38
44
  {label}
39
45
  </label>
40
46
  )}
41
- <div className={cssClasses}>
47
+ <div className="quantity-selector">
42
48
  <Button
43
49
  label=""
44
50
  accessibilityLabel="-"
@@ -33,6 +33,10 @@
33
33
  width: 100%;
34
34
  }
35
35
 
36
+ .hidden {
37
+ display: none !important;
38
+ }
39
+
36
40
  .only-desktop {
37
41
  @media only screen and (max-width: breakpoints.$large) {
38
42
  display: none !important;
@@ -1,7 +1,6 @@
1
1
  import { IconButton } from '../atoms/Button'
2
2
  import { Card, CardHeader, CardContent, CardFooter } from '../atoms/Card'
3
3
  import { Button } from '../atoms/Button'
4
- import { type } from 'os'
5
4
 
6
5
  const figmaPrimaryDesign = {
7
6
  design: {
@@ -4,6 +4,10 @@ import { Meta } from "@storybook/blocks";
4
4
 
5
5
  # Changelog
6
6
 
7
+ # 0.27.2
8
+
9
+ * Add * to required input in Quantiy component
10
+
7
11
  # 0.27.1
8
12
 
9
13
  * Update Card with href prop