agroptima-design-system 0.34.6-beta.2 → 0.34.6
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 +1 -1
- package/src/atoms/Button/Button.tsx +2 -6
- package/src/atoms/Collapsible.scss +16 -15
- package/src/atoms/Collapsible.tsx +5 -5
- package/src/atoms/DatePicker/DateRangePicker.tsx +0 -3
- package/src/atoms/DatePicker/DateSinglePicker.tsx +0 -3
- package/src/atoms/Input.scss +0 -31
- package/src/atoms/Input.tsx +1 -7
- package/src/atoms/Multiselect.tsx +0 -3
- package/src/atoms/QuantitySelector.tsx +1 -7
- package/src/atoms/Select/Select.scss +2 -9
- package/src/atoms/Select/Select.tsx +0 -3
- package/src/atoms/TabMenu/TabMenu.scss +1 -3
- package/src/atoms/TextArea.tsx +0 -3
- package/src/icons/index.tsx +0 -4
- package/src/stories/Button.stories.ts +0 -4
- package/src/stories/Changelog.mdx +8 -10
- package/src/stories/{Collapsible.stories.tsx → Collapsible.stories.js} +36 -62
- package/src/stories/DateRangePicker.stories.ts +0 -5
- package/src/stories/DateSinglePicker.stories.ts +0 -5
- package/src/stories/Input.stories.ts +0 -32
- package/src/stories/Multiselect.stories.ts +0 -4
- package/src/stories/QuantitySelector.stories.ts +0 -5
- package/src/stories/Select.stories.ts +0 -4
- package/src/stories/TextArea.stories.ts +0 -4
- package/src/atoms/InputWithButton/InputWithButton.scss +0 -8
- package/src/atoms/InputWithButton/InputWithButton.tsx +0 -10
- package/src/atoms/InputWithButton/index.tsx +0 -3
- package/src/icons/classic-view.svg +0 -1
- package/src/icons/new-view.svg +0 -1
- package/src/stories/InputWithButton.stories.tsx +0 -56
package/package.json
CHANGED
|
@@ -13,7 +13,6 @@ interface CustomProps {
|
|
|
13
13
|
variant?: ButtonVariant
|
|
14
14
|
loading?: boolean
|
|
15
15
|
disabled?: boolean
|
|
16
|
-
fullWidth?: boolean
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export type ButtonProps = CustomProps & BaseButtonProps
|
|
@@ -44,16 +43,13 @@ export function Button({
|
|
|
44
43
|
leftIcon,
|
|
45
44
|
rightIcon,
|
|
46
45
|
disabled,
|
|
47
|
-
className,
|
|
48
46
|
variant = 'primary',
|
|
49
47
|
loading = false,
|
|
50
|
-
|
|
48
|
+
className,
|
|
51
49
|
...props
|
|
52
50
|
}: ButtonProps) {
|
|
53
51
|
const leftIconName = loading ? 'Loading' : leftIcon
|
|
54
|
-
const cssClasses = classNames(className, 'button', variant
|
|
55
|
-
'full-width': fullWidth,
|
|
56
|
-
})
|
|
52
|
+
const cssClasses = classNames(className, 'button', variant)
|
|
57
53
|
|
|
58
54
|
return (
|
|
59
55
|
<BaseButton
|
|
@@ -20,20 +20,31 @@ details summary::-webkit-details-marker {
|
|
|
20
20
|
|
|
21
21
|
.header {
|
|
22
22
|
display: flex;
|
|
23
|
-
align-items: center;
|
|
23
|
+
align-items: center !important;
|
|
24
24
|
gap: config.$space-3x;
|
|
25
25
|
padding: config.$space-5x;
|
|
26
|
+
padding-bottom: config.$space-5x !important;
|
|
26
27
|
cursor: default;
|
|
27
28
|
|
|
29
|
+
.icon {
|
|
30
|
+
width: config.$icon-size-4x !important;
|
|
31
|
+
height: config.$icon-size-4x !important;
|
|
32
|
+
> svg {
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
28
38
|
.title {
|
|
29
|
-
font-size: 1rem;
|
|
30
|
-
font-weight: normal;
|
|
39
|
+
font-size: 1rem !important;
|
|
40
|
+
font-weight: normal !important;
|
|
31
41
|
flex: 1;
|
|
32
42
|
}
|
|
33
43
|
}
|
|
34
44
|
|
|
35
45
|
.content {
|
|
36
|
-
padding: config.$space-7x
|
|
46
|
+
padding: config.$space-7x;
|
|
47
|
+
padding-bottom: config.$space-3x;
|
|
37
48
|
|
|
38
49
|
&.no-horizontal-padding {
|
|
39
50
|
padding-left: 0;
|
|
@@ -41,7 +52,7 @@ details summary::-webkit-details-marker {
|
|
|
41
52
|
}
|
|
42
53
|
}
|
|
43
54
|
|
|
44
|
-
&.primary
|
|
55
|
+
&.primary {
|
|
45
56
|
&[open] {
|
|
46
57
|
.header {
|
|
47
58
|
background: transparent;
|
|
@@ -58,7 +69,6 @@ details summary::-webkit-details-marker {
|
|
|
58
69
|
.icon {
|
|
59
70
|
> svg {
|
|
60
71
|
fill: color_alias.$neutral-color-200;
|
|
61
|
-
|
|
62
72
|
path {
|
|
63
73
|
fill: color_alias.$neutral-color-200;
|
|
64
74
|
}
|
|
@@ -75,7 +85,6 @@ details summary::-webkit-details-marker {
|
|
|
75
85
|
.icon {
|
|
76
86
|
> svg {
|
|
77
87
|
fill: color_alias.$primary-color-600;
|
|
78
|
-
|
|
79
88
|
path {
|
|
80
89
|
fill: color_alias.$primary-color-600;
|
|
81
90
|
}
|
|
@@ -87,14 +96,6 @@ details summary::-webkit-details-marker {
|
|
|
87
96
|
}
|
|
88
97
|
}
|
|
89
98
|
}
|
|
90
|
-
|
|
91
|
-
&.secondary .content {
|
|
92
|
-
padding: config.$space-3x config.$space-4x config.$space-6x;
|
|
93
|
-
border: 1px solid color_alias.$neutral-color-200;
|
|
94
|
-
border-top: none;
|
|
95
|
-
border-bottom-left-radius: config.$corner-radius-m;
|
|
96
|
-
border-bottom-right-radius: config.$corner-radius-m;
|
|
97
|
-
}
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
.collapsible[open] {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './Collapsible.scss'
|
|
2
|
-
import type { ComponentPropsWithoutRef } from 'react'
|
|
3
2
|
import { classNames } from '../utils/classNames'
|
|
4
3
|
import { Icon } from './Icon'
|
|
5
4
|
|
|
6
|
-
export type Variant = 'primary'
|
|
5
|
+
export type Variant = 'primary'
|
|
7
6
|
|
|
8
|
-
export interface CollapsibleProps
|
|
7
|
+
export interface CollapsibleProps
|
|
8
|
+
extends React.ComponentPropsWithoutRef<'details'> {
|
|
9
9
|
title: string
|
|
10
10
|
variant?: Variant
|
|
11
11
|
name?: string
|
|
@@ -24,7 +24,7 @@ export function Collapsible({
|
|
|
24
24
|
form = false,
|
|
25
25
|
noHorizontalPadding = false,
|
|
26
26
|
...props
|
|
27
|
-
}: CollapsibleProps) {
|
|
27
|
+
}: CollapsibleProps): React.JSX.Element {
|
|
28
28
|
const cssClasses = classNames('collapsible', variant, className, {
|
|
29
29
|
open: props.open,
|
|
30
30
|
disabled: disabled,
|
|
@@ -37,7 +37,7 @@ export function Collapsible({
|
|
|
37
37
|
return (
|
|
38
38
|
<details name={name} className={cssClasses} aria-label={title} {...props}>
|
|
39
39
|
<summary className="header">
|
|
40
|
-
<Icon className="arrow" name="AngleRight"
|
|
40
|
+
<Icon className="arrow" name="AngleRight" />
|
|
41
41
|
<span className="title">{title}</span>
|
|
42
42
|
</summary>
|
|
43
43
|
<div className={contentCssClasses}>{children}</div>
|
|
@@ -29,7 +29,6 @@ export type DateRangePickerProps = {
|
|
|
29
29
|
name?: string
|
|
30
30
|
helpText?: string
|
|
31
31
|
errors?: string[]
|
|
32
|
-
fullWidth?: boolean
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
export type DateRange = {
|
|
@@ -49,12 +48,10 @@ export function DateRangePicker({
|
|
|
49
48
|
label = 'Date',
|
|
50
49
|
errors,
|
|
51
50
|
helpText,
|
|
52
|
-
fullWidth = false,
|
|
53
51
|
}: DateRangePickerProps): JSX.Element {
|
|
54
52
|
const cssClasses = classNames('date-picker', variant, className, {
|
|
55
53
|
toggle: withInput,
|
|
56
54
|
invalid: errors?.length,
|
|
57
|
-
'full-width': fullWidth,
|
|
58
55
|
})
|
|
59
56
|
const helpTexts = buildHelpText(helpText, errors)
|
|
60
57
|
|
|
@@ -28,7 +28,6 @@ export type DateSinglePickerProps = {
|
|
|
28
28
|
label?: string
|
|
29
29
|
helpText?: string
|
|
30
30
|
errors?: string[]
|
|
31
|
-
fullWidth?: boolean
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
export function DateSinglePicker({
|
|
@@ -43,7 +42,6 @@ export function DateSinglePicker({
|
|
|
43
42
|
label = 'Date',
|
|
44
43
|
errors,
|
|
45
44
|
helpText,
|
|
46
|
-
fullWidth = false,
|
|
47
45
|
}: DateSinglePickerProps): JSX.Element {
|
|
48
46
|
const { isOpen, close, toggle } = useOpen(!withInput)
|
|
49
47
|
const pickerRef = useRef(null)
|
|
@@ -53,7 +51,6 @@ export function DateSinglePicker({
|
|
|
53
51
|
const cssClasses = classNames('date-picker', variant, className, {
|
|
54
52
|
toggle: withInput,
|
|
55
53
|
invalid: errors?.length,
|
|
56
|
-
'full-width': fullWidth,
|
|
57
54
|
})
|
|
58
55
|
|
|
59
56
|
const [selected, setSelected] = useState<Date | undefined>(
|
package/src/atoms/Input.scss
CHANGED
|
@@ -17,20 +17,16 @@
|
|
|
17
17
|
flex-direction: row;
|
|
18
18
|
width: 100%;
|
|
19
19
|
padding: config.$space-2x config.$space-3x config.$space-2x;
|
|
20
|
-
|
|
21
20
|
input[type='date'] {
|
|
22
21
|
min-width: -webkit-fill-available;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
input[type='number'] {
|
|
26
24
|
text-align: right;
|
|
27
25
|
}
|
|
28
|
-
|
|
29
26
|
input::placeholder,
|
|
30
27
|
textarea::placeholder {
|
|
31
28
|
@include typography.input-placeholder-text;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
30
|
input,
|
|
35
31
|
input:hover,
|
|
36
32
|
input:focus,
|
|
@@ -56,12 +52,10 @@
|
|
|
56
52
|
-moz-appearance: none;
|
|
57
53
|
appearance: none;
|
|
58
54
|
}
|
|
59
|
-
|
|
60
55
|
.input-suffix {
|
|
61
56
|
text-wrap: nowrap;
|
|
62
57
|
color: color_alias.$neutral-color-600;
|
|
63
58
|
}
|
|
64
|
-
|
|
65
59
|
.icon {
|
|
66
60
|
min-width: config.$icon-size-5x;
|
|
67
61
|
width: config.$icon-size-5x;
|
|
@@ -78,7 +72,6 @@
|
|
|
78
72
|
&.invalid .input-container {
|
|
79
73
|
border: 1px solid color_alias.$error-color-1000;
|
|
80
74
|
}
|
|
81
|
-
|
|
82
75
|
.input-container {
|
|
83
76
|
border-radius: config.$corner-radius-m;
|
|
84
77
|
border: 1px solid color_alias.$neutral-color-600;
|
|
@@ -94,7 +87,6 @@
|
|
|
94
87
|
&:has(textarea:disabled) {
|
|
95
88
|
border: 1px solid color_alias.$neutral-color-400;
|
|
96
89
|
background: color_alias.$neutral-color-50;
|
|
97
|
-
|
|
98
90
|
input {
|
|
99
91
|
color: color_alias.$neutral-color-400;
|
|
100
92
|
}
|
|
@@ -104,11 +96,9 @@
|
|
|
104
96
|
color: color_alias.$neutral-color-400;
|
|
105
97
|
}
|
|
106
98
|
}
|
|
107
|
-
|
|
108
99
|
.icon {
|
|
109
100
|
> svg {
|
|
110
101
|
fill: color_alias.$neutral-color-400;
|
|
111
|
-
|
|
112
102
|
path {
|
|
113
103
|
fill: color_alias.$neutral-color-400;
|
|
114
104
|
}
|
|
@@ -118,7 +108,6 @@
|
|
|
118
108
|
.password-icon {
|
|
119
109
|
> svg {
|
|
120
110
|
fill: color_alias.$neutral-color-600;
|
|
121
|
-
|
|
122
111
|
path {
|
|
123
112
|
fill: color_alias.$neutral-color-600;
|
|
124
113
|
}
|
|
@@ -126,25 +115,20 @@
|
|
|
126
115
|
}
|
|
127
116
|
}
|
|
128
117
|
}
|
|
129
|
-
|
|
130
118
|
&.file .input-container {
|
|
131
119
|
padding: 0;
|
|
132
120
|
border: transparent;
|
|
133
|
-
|
|
134
121
|
&:has(input:focus) {
|
|
135
122
|
border: transparent;
|
|
136
123
|
}
|
|
137
|
-
|
|
138
124
|
input {
|
|
139
125
|
color: color_alias.$neutral-color-600;
|
|
140
|
-
|
|
141
126
|
&::before {
|
|
142
127
|
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='12' fill='none'%3E%3Cpath d='M2.943 8.718h4.114V4.694H9.8L5 0 .2 4.694h2.743v4.024ZM5 1.898l1.488 1.455h-.802v4.023H4.314V3.353h-.802L5 1.898Zm-4.8 8.16h9.6V11.4H.2v-1.341Z' fill='%23EB004D'/%3E%3C/svg%3E");
|
|
143
128
|
position: absolute;
|
|
144
129
|
left: config.$space-3x;
|
|
145
130
|
bottom: config.$space-2x;
|
|
146
131
|
}
|
|
147
|
-
|
|
148
132
|
&::file-selector-button {
|
|
149
133
|
margin-right: config.$space-2x;
|
|
150
134
|
padding-left: config.$space-3x + config.$icon-size-2x + config.$space-1x;
|
|
@@ -152,23 +136,8 @@
|
|
|
152
136
|
}
|
|
153
137
|
}
|
|
154
138
|
}
|
|
155
|
-
|
|
156
139
|
&.hidden {
|
|
157
140
|
display: none;
|
|
158
141
|
}
|
|
159
142
|
|
|
160
|
-
&.ellipsis {
|
|
161
|
-
input {
|
|
162
|
-
text-overflow: ellipsis;
|
|
163
|
-
overflow: hidden;
|
|
164
|
-
white-space: nowrap;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
&.borderless {
|
|
169
|
-
.input-container {
|
|
170
|
-
padding-left: 0;
|
|
171
|
-
padding-right: 0;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
143
|
}
|
package/src/atoms/Input.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import type { IconType } from './Icon'
|
|
|
7
7
|
import { Icon } from './Icon'
|
|
8
8
|
import { Label } from './Label'
|
|
9
9
|
|
|
10
|
-
export type InputVariant = 'primary'
|
|
10
|
+
export type InputVariant = 'primary'
|
|
11
11
|
|
|
12
12
|
export interface InputProps extends React.ComponentPropsWithRef<'input'> {
|
|
13
13
|
label: string
|
|
@@ -20,8 +20,6 @@ export interface InputProps extends React.ComponentPropsWithRef<'input'> {
|
|
|
20
20
|
suffix?: string
|
|
21
21
|
errors?: string[]
|
|
22
22
|
rightIcon?: IconType
|
|
23
|
-
fullWidth?: boolean
|
|
24
|
-
ellipsis?: boolean
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
export function Input({
|
|
@@ -39,8 +37,6 @@ export function Input({
|
|
|
39
37
|
id,
|
|
40
38
|
errors,
|
|
41
39
|
rightIcon,
|
|
42
|
-
fullWidth = false,
|
|
43
|
-
ellipsis = false,
|
|
44
40
|
...props
|
|
45
41
|
}: InputProps): React.JSX.Element {
|
|
46
42
|
const identifier = id || name
|
|
@@ -66,8 +62,6 @@ export function Input({
|
|
|
66
62
|
file: type === 'file',
|
|
67
63
|
invalid: errors?.length,
|
|
68
64
|
hidden: type === 'hidden',
|
|
69
|
-
'full-width': fullWidth,
|
|
70
|
-
ellipsis: ellipsis,
|
|
71
65
|
})}
|
|
72
66
|
>
|
|
73
67
|
{!hideLabel && (
|
|
@@ -30,7 +30,6 @@ export interface MultiselectProps extends InputPropsWithoutOnChange {
|
|
|
30
30
|
onChange?: (value: string[]) => void
|
|
31
31
|
isSearchable?: boolean
|
|
32
32
|
searchLabel?: string
|
|
33
|
-
fullWidth?: boolean
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
export function Multiselect({
|
|
@@ -51,7 +50,6 @@ export function Multiselect({
|
|
|
51
50
|
defaultValue = [],
|
|
52
51
|
isSearchable = false,
|
|
53
52
|
searchLabel = 'Search',
|
|
54
|
-
fullWidth = false,
|
|
55
53
|
...props
|
|
56
54
|
}: MultiselectProps): React.JSX.Element {
|
|
57
55
|
const { isOpen, close, toggle } = useOpen()
|
|
@@ -83,7 +81,6 @@ export function Multiselect({
|
|
|
83
81
|
disabled,
|
|
84
82
|
filled: hasSelectedOptions,
|
|
85
83
|
invalid: isInvalid,
|
|
86
|
-
'full-width': fullWidth,
|
|
87
84
|
})}
|
|
88
85
|
ref={selectRef}
|
|
89
86
|
>
|
|
@@ -14,7 +14,6 @@ export interface QuantitySelectorProps extends Omit<InputProps, 'type'> {
|
|
|
14
14
|
hideLabel?: boolean
|
|
15
15
|
id?: string
|
|
16
16
|
variant?: Variant
|
|
17
|
-
fullWidth?: boolean
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export function QuantitySelector({
|
|
@@ -25,7 +24,6 @@ export function QuantitySelector({
|
|
|
25
24
|
disabled,
|
|
26
25
|
hideLabel = false,
|
|
27
26
|
variant = 'primary',
|
|
28
|
-
fullWidth = false,
|
|
29
27
|
...props
|
|
30
28
|
}: QuantitySelectorProps): React.JSX.Element {
|
|
31
29
|
const inputRef = useRef<HTMLInputElement>(null)
|
|
@@ -43,11 +41,7 @@ export function QuantitySelector({
|
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
return (
|
|
46
|
-
<div
|
|
47
|
-
className={classNames('quantity-selector-group', variant, className, {
|
|
48
|
-
'full-width': fullWidth,
|
|
49
|
-
})}
|
|
50
|
-
>
|
|
44
|
+
<div className={classNames('quantity-selector-group', variant, className)}>
|
|
51
45
|
{!hideLabel && (
|
|
52
46
|
<Label required={props.required} htmlFor={id}>
|
|
53
47
|
{label}
|
|
@@ -4,15 +4,11 @@
|
|
|
4
4
|
@use '../../settings/depth';
|
|
5
5
|
@use '../../settings/mixins';
|
|
6
6
|
|
|
7
|
-
$elements-space: config.$space-2x;
|
|
8
7
|
|
|
9
8
|
.select-group {
|
|
10
9
|
display: flex;
|
|
11
10
|
flex-direction: column;
|
|
12
|
-
|
|
13
|
-
label {
|
|
14
|
-
margin-bottom: $elements-space;
|
|
15
|
-
}
|
|
11
|
+
gap: config.$space-2x;
|
|
16
12
|
|
|
17
13
|
.select {
|
|
18
14
|
@include typography.select-text;
|
|
@@ -35,9 +31,6 @@ $elements-space: config.$space-2x;
|
|
|
35
31
|
height: config.$icon-size-3x;
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
.help-text {
|
|
39
|
-
margin-top: $elements-space;
|
|
40
|
-
}
|
|
41
34
|
|
|
42
35
|
&.primary {
|
|
43
36
|
&.disabled .select-container {
|
|
@@ -127,7 +120,7 @@ $elements-space: config.$space-2x;
|
|
|
127
120
|
overflow-y: auto;
|
|
128
121
|
overflow-anchor: none;
|
|
129
122
|
z-index: depth.$z-dropdown-options;
|
|
130
|
-
margin:
|
|
123
|
+
margin: 0;
|
|
131
124
|
padding: config.$space-1x 0;
|
|
132
125
|
text-align: left;
|
|
133
126
|
position: absolute;
|
|
@@ -29,7 +29,6 @@ export interface SelectProps extends InputPropsWithoutOnChange {
|
|
|
29
29
|
onChange?: (value: string) => void
|
|
30
30
|
isSearchable?: boolean
|
|
31
31
|
searchLabel?: string
|
|
32
|
-
fullWidth?: boolean
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
const EMPTY_OPTION = { id: '', label: '' }
|
|
@@ -51,7 +50,6 @@ export function Select({
|
|
|
51
50
|
defaultValue,
|
|
52
51
|
isSearchable = false,
|
|
53
52
|
searchLabel = 'Search',
|
|
54
|
-
fullWidth = false,
|
|
55
53
|
...props
|
|
56
54
|
}: SelectProps): React.JSX.Element {
|
|
57
55
|
const { isOpen, close, toggle } = useOpen()
|
|
@@ -81,7 +79,6 @@ export function Select({
|
|
|
81
79
|
disabled,
|
|
82
80
|
filled: selectedOption.id,
|
|
83
81
|
invalid: isInvalid,
|
|
84
|
-
'full-width': fullWidth,
|
|
85
82
|
})}
|
|
86
83
|
ref={selectRef}
|
|
87
84
|
>
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
.tabmenu {
|
|
13
13
|
position: absolute;
|
|
14
14
|
top: 0px;
|
|
15
|
-
z-index: 999;
|
|
16
15
|
display: flex;
|
|
17
16
|
flex-direction: row;
|
|
18
17
|
list-style-type: none;
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
|
|
44
43
|
&.active {
|
|
45
44
|
color: color_alias.$primary-color-600;
|
|
46
|
-
border-bottom:
|
|
45
|
+
border-bottom: 3px solid color_alias.$primary-color-600;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
&.disabled {
|
|
@@ -59,7 +58,6 @@
|
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
.tabmenu-divider {
|
|
62
|
-
z-index: 1;
|
|
63
61
|
position: absolute;
|
|
64
62
|
top: 28px;
|
|
65
63
|
width: 100%;
|
package/src/atoms/TextArea.tsx
CHANGED
|
@@ -15,7 +15,6 @@ export interface TextAreaProps
|
|
|
15
15
|
variant?: TextAreaVariant
|
|
16
16
|
id?: string
|
|
17
17
|
errors?: string[]
|
|
18
|
-
fullWidth?: boolean
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
export function TextArea({
|
|
@@ -29,7 +28,6 @@ export function TextArea({
|
|
|
29
28
|
disabled,
|
|
30
29
|
name,
|
|
31
30
|
errors,
|
|
32
|
-
fullWidth = false,
|
|
33
31
|
...props
|
|
34
32
|
}: TextAreaProps) {
|
|
35
33
|
const identifier = id || name
|
|
@@ -37,7 +35,6 @@ export function TextArea({
|
|
|
37
35
|
<div
|
|
38
36
|
className={classNames('input-group', variant, className, {
|
|
39
37
|
invalid: errors?.length,
|
|
40
|
-
'full-width': fullWidth,
|
|
41
38
|
})}
|
|
42
39
|
>
|
|
43
40
|
{!hideLabel && (
|
package/src/icons/index.tsx
CHANGED
|
@@ -11,7 +11,6 @@ import Check from './check.svg'
|
|
|
11
11
|
import CheckboxActive from './checkbox-active.svg'
|
|
12
12
|
import CheckboxInactive from './checkbox-inactive.svg'
|
|
13
13
|
import CheckboxIndeterminate from './checkbox-indeterminate.svg'
|
|
14
|
-
import ClassicView from './classic-view.svg'
|
|
15
14
|
import Client from './client.svg'
|
|
16
15
|
import Close from './close.svg'
|
|
17
16
|
import Comment from './comment.svg'
|
|
@@ -37,7 +36,6 @@ import Invoice from './invoice.svg'
|
|
|
37
36
|
import Loading from './loading.svg'
|
|
38
37
|
import Logout from './logout.svg'
|
|
39
38
|
import Minus from './minus.svg'
|
|
40
|
-
import NewView from './new-view.svg'
|
|
41
39
|
import PDF from './pdf.svg'
|
|
42
40
|
import Product from './product.svg'
|
|
43
41
|
import Reason from './reason.svg'
|
|
@@ -67,7 +65,6 @@ export {
|
|
|
67
65
|
CheckboxActive,
|
|
68
66
|
CheckboxInactive,
|
|
69
67
|
CheckboxIndeterminate,
|
|
70
|
-
ClassicView,
|
|
71
68
|
Client,
|
|
72
69
|
Close,
|
|
73
70
|
Comment,
|
|
@@ -93,7 +90,6 @@ export {
|
|
|
93
90
|
Loading,
|
|
94
91
|
Logout,
|
|
95
92
|
Minus,
|
|
96
|
-
NewView,
|
|
97
93
|
PDF,
|
|
98
94
|
Product,
|
|
99
95
|
Reason,
|
|
@@ -6,22 +6,20 @@ import { Meta } from "@storybook/blocks";
|
|
|
6
6
|
|
|
7
7
|
## 0.34.6
|
|
8
8
|
|
|
9
|
-
*
|
|
10
|
-
* Fix extra space when open Select and MultiSelect components
|
|
11
|
-
* Add variant `Borderless` to Input component
|
|
12
|
-
* Add prop `ellipsis` to Input component
|
|
13
|
-
* Add variant `Secondary` to Collapsible component
|
|
14
|
-
* Add `classic-view` and `new-view` to icons
|
|
15
|
-
* Add InputWithButton component
|
|
9
|
+
* Fix TabMenu active link border
|
|
16
10
|
|
|
17
|
-
## 0.
|
|
11
|
+
## 0.34.5
|
|
18
12
|
|
|
19
|
-
*
|
|
13
|
+
* Fix TabMenu styles
|
|
20
14
|
|
|
21
|
-
## 0.34.
|
|
15
|
+
## 0.34.4
|
|
22
16
|
|
|
23
17
|
* Update DatePicker related stories with a defaultValue
|
|
24
18
|
|
|
19
|
+
## 0.33.4
|
|
20
|
+
|
|
21
|
+
* Add hasAction and onClick props to Divider component
|
|
22
|
+
|
|
25
23
|
## 0.33.1
|
|
26
24
|
|
|
27
25
|
* Add onChange prop to RadioGroup component
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react'
|
|
2
1
|
import React from 'react'
|
|
3
2
|
import { Button } from '../atoms/Button'
|
|
3
|
+
import { Card } from '../atoms/Card'
|
|
4
4
|
import { Collapsible } from '../atoms/Collapsible'
|
|
5
5
|
import { Divider } from '../atoms/Divider'
|
|
6
|
-
import { Actions, Form as FormComponent
|
|
6
|
+
import { Actions, Form as FormComponent } from '../atoms/Form'
|
|
7
|
+
import { FormContainer } from '../atoms/Form'
|
|
7
8
|
import { Input } from '../atoms/Input'
|
|
8
9
|
import { Select } from '../atoms/Select'
|
|
9
10
|
|
|
@@ -44,15 +45,10 @@ const meta = {
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
export default meta
|
|
47
|
-
type Story = StoryObj<typeof meta>
|
|
48
48
|
|
|
49
|
-
export const Primary
|
|
50
|
-
|
|
51
|
-
title
|
|
52
|
-
name: 'personal-data',
|
|
53
|
-
variant: 'primary',
|
|
54
|
-
disabled: false,
|
|
55
|
-
children: (
|
|
49
|
+
export const Primary = {
|
|
50
|
+
render: () => (
|
|
51
|
+
<Collapsible title="My personal data" name="personal-data">
|
|
56
52
|
<FormContainer fluid>
|
|
57
53
|
<Input
|
|
58
54
|
accessibilityLabel="Fill the form name"
|
|
@@ -99,40 +95,14 @@ export const Primary: Story = {
|
|
|
99
95
|
variant="primary"
|
|
100
96
|
/>
|
|
101
97
|
</FormContainer>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export const Secondary: Story = {
|
|
107
|
-
args: {
|
|
108
|
-
open: true,
|
|
109
|
-
title: 'My personal data',
|
|
110
|
-
name: 'personal-data',
|
|
111
|
-
variant: 'secondary',
|
|
112
|
-
children: (
|
|
113
|
-
<Input
|
|
114
|
-
accessibilityLabel="Fill the form name"
|
|
115
|
-
helpText="This text can help you"
|
|
116
|
-
id="name_input"
|
|
117
|
-
label="Name"
|
|
118
|
-
name="name"
|
|
119
|
-
placeholder="name..."
|
|
120
|
-
type="name"
|
|
121
|
-
variant="primary"
|
|
122
|
-
/>
|
|
123
|
-
),
|
|
124
|
-
},
|
|
98
|
+
</Collapsible>
|
|
99
|
+
),
|
|
125
100
|
}
|
|
126
101
|
|
|
127
102
|
export const PrimaryOpened = {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
variant: 'primary',
|
|
132
|
-
disabled: false,
|
|
133
|
-
open: true,
|
|
134
|
-
children: (
|
|
135
|
-
<>
|
|
103
|
+
render: () => (
|
|
104
|
+
<>
|
|
105
|
+
<Collapsible title="My personal data" name="personal-data" open>
|
|
136
106
|
<Divider title="19/01/2025 - My gaming diary" variant="primary" />
|
|
137
107
|
<FormContainer fluid>
|
|
138
108
|
<Input
|
|
@@ -180,18 +150,26 @@ export const PrimaryOpened = {
|
|
|
180
150
|
variant="primary"
|
|
181
151
|
/>
|
|
182
152
|
</FormContainer>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
153
|
+
</Collapsible>
|
|
154
|
+
<Collapsible title="Another data" name="another-data">
|
|
155
|
+
<Input label="Another data" name="anotherData" placeholder="..." />
|
|
156
|
+
</Collapsible>
|
|
157
|
+
<Collapsible
|
|
158
|
+
noHorizontalPadding
|
|
159
|
+
title="Important information"
|
|
160
|
+
name="no-horizontal-padding-example"
|
|
161
|
+
>
|
|
162
|
+
<Card>
|
|
163
|
+
<p>Not available</p>
|
|
164
|
+
</Card>
|
|
165
|
+
</Collapsible>
|
|
166
|
+
</>
|
|
167
|
+
),
|
|
186
168
|
}
|
|
187
169
|
|
|
188
|
-
export const PrimaryDisabled
|
|
189
|
-
|
|
190
|
-
title
|
|
191
|
-
name: 'personal-data',
|
|
192
|
-
variant: 'primary',
|
|
193
|
-
disabled: true,
|
|
194
|
-
children: (
|
|
170
|
+
export const PrimaryDisabled = {
|
|
171
|
+
render: () => (
|
|
172
|
+
<Collapsible title="My personal data" name="personal-data" disabled>
|
|
195
173
|
<FormContainer fluid>
|
|
196
174
|
<Input
|
|
197
175
|
accessibilityLabel="Fill the form name"
|
|
@@ -238,17 +216,13 @@ export const PrimaryDisabled: Story = {
|
|
|
238
216
|
variant="primary"
|
|
239
217
|
/>
|
|
240
218
|
</FormContainer>
|
|
241
|
-
|
|
242
|
-
|
|
219
|
+
</Collapsible>
|
|
220
|
+
),
|
|
243
221
|
}
|
|
244
222
|
|
|
245
|
-
export const Form
|
|
246
|
-
|
|
247
|
-
form
|
|
248
|
-
title: 'User',
|
|
249
|
-
name: 'user-form',
|
|
250
|
-
variant: 'primary',
|
|
251
|
-
children: (
|
|
223
|
+
export const Form = {
|
|
224
|
+
render: () => (
|
|
225
|
+
<Collapsible open form title="User">
|
|
252
226
|
<FormComponent>
|
|
253
227
|
<Input label="First Name" placeholder="First Name" name="firstName" />
|
|
254
228
|
<Input label="Last Name" placeholder="Last Name" name="lastName" />
|
|
@@ -257,6 +231,6 @@ export const Form: Story = {
|
|
|
257
231
|
<Button type="submit" label="Sign in" variant="primary" />
|
|
258
232
|
</Actions>
|
|
259
233
|
</FormComponent>
|
|
260
|
-
|
|
261
|
-
|
|
234
|
+
</Collapsible>
|
|
235
|
+
),
|
|
262
236
|
}
|
|
@@ -60,15 +60,6 @@ const meta = {
|
|
|
60
60
|
description: 'Is required?',
|
|
61
61
|
type: 'boolean',
|
|
62
62
|
},
|
|
63
|
-
fullWidth: {
|
|
64
|
-
description: 'Makes the input take the full width of the container',
|
|
65
|
-
type: 'boolean',
|
|
66
|
-
},
|
|
67
|
-
ellipsis: {
|
|
68
|
-
description:
|
|
69
|
-
'If true, the input will truncate the text with an ellipsis when it overflows',
|
|
70
|
-
type: 'boolean',
|
|
71
|
-
},
|
|
72
63
|
},
|
|
73
64
|
}
|
|
74
65
|
|
|
@@ -149,26 +140,3 @@ export const WithSuffix: Story = {
|
|
|
149
140
|
},
|
|
150
141
|
parameters: figmaPrimaryDesign,
|
|
151
142
|
}
|
|
152
|
-
|
|
153
|
-
export const Borderless: Story = {
|
|
154
|
-
args: {
|
|
155
|
-
label: 'Delivery data',
|
|
156
|
-
defaultValue: '221b Baker St, London NW1, 6XE, United Kingdom',
|
|
157
|
-
variant: 'borderless',
|
|
158
|
-
readOnly: true,
|
|
159
|
-
helpText: 'This text can help you',
|
|
160
|
-
name: 'delivery_data',
|
|
161
|
-
},
|
|
162
|
-
parameters: figmaPrimaryDesign,
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export const Ellipsis: Story = {
|
|
166
|
-
args: {
|
|
167
|
-
label: 'Label for input with ellipsis',
|
|
168
|
-
defaultValue:
|
|
169
|
-
"Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn., Nnnhafh'drn bug ep Tsathoggua sgn'wahl nghupadgh, nglui syha'h y-ee y-n'gha. NaflDagon y-zhro lw'nafh stell'bsna h'li'hee vulgtm R'lyeh hafh'drnyar, goka nnnAzathoth sgn'wahl gebor shogg ftaghu y'hah, naorr'e lloig hupadghog nageb k'yarnakagl ph'sgn'wahl. Nnngnaiih stell'bsna 'bthnk mnahn' h'goka hrii zhro hai 'fhalma h'geb, goka f'vulgtlagln nilgh'ri y-chtenff Hastur 'fhalma mnahn' fm'latgh. Nauln vulgtm y-shtunggli uaaah li'hee y'hah hlirgh, orr'e nglui hafh'drn ngstell'bsna ngep hupadgh, 'bthnkagl hafh'drnog s'uhn chtenff ya. Syha'h 'bthnk vulgtlagln ah zhro f'n'gha uh'e Nyarlathotep sgn'wahl ebunma 'ai fhtagn sll'ha ehye, ckadishtu hrii nahai 'ai ilyaa namg n'gha ooboshu mnahn' Azathoth cHastur wgah'n.",
|
|
170
|
-
name: 'ellipsis',
|
|
171
|
-
ellipsis: true,
|
|
172
|
-
},
|
|
173
|
-
parameters: figmaPrimaryDesign,
|
|
174
|
-
}
|
|
@@ -47,10 +47,6 @@ const meta = {
|
|
|
47
47
|
description:
|
|
48
48
|
'Optional array of errors. If passed, the errors are listed and invalid style is applied.',
|
|
49
49
|
},
|
|
50
|
-
fullWidth: {
|
|
51
|
-
description: 'Makes the TextArea take the full width of the container',
|
|
52
|
-
type: 'boolean',
|
|
53
|
-
},
|
|
54
50
|
},
|
|
55
51
|
}
|
|
56
52
|
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import './InputWithButton.scss'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
interface InputWithButtonProps {
|
|
5
|
-
children: React.ReactNode
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function InputWithButton({ children }: InputWithButtonProps) {
|
|
9
|
-
return <div className="input-with-button">{children}</div>
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#table-view__a)"><path d="M17.778 17.778v-3.334H2.222v3.334h15.556Zm0-5.556V7.778H2.222v4.444h15.556Zm0-6.666V2.222H2.222v3.334h15.556ZM2.222 20a2.14 2.14 0 0 1-1.57-.653A2.14 2.14 0 0 1 0 17.777V2.223c0-.61.218-1.134.653-1.57A2.14 2.14 0 0 1 2.223 0h15.555a2.14 2.14 0 0 1 1.57.653c.434.435.652.958.652 1.57v15.555a2.14 2.14 0 0 1-.653 1.57 2.14 2.14 0 0 1-1.57.652H2.223Z" fill="#161C26"/></g><defs><clipPath id="table-view__a"><path fill="#fff" d="M0 0h20v20H0z"/></clipPath></defs></svg>
|
package/src/icons/new-view.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#new-view__a)"><path d="M2.222 20a2.14 2.14 0 0 1-1.57-.653A2.14 2.14 0 0 1 0 17.777V2.223c0-.61.218-1.134.653-1.57A2.14 2.14 0 0 1 2.223 0h15.555a2.14 2.14 0 0 1 1.57.653c.434.435.652.958.652 1.57v15.555a2.14 2.14 0 0 1-.653 1.57 2.14 2.14 0 0 1-1.57.652H2.223Zm3.334-2.222V2.222H2.222v15.556h3.334Zm2.222 0h10V2.222h-10v15.556Z" fill="#161C26"/></g><defs><clipPath id="new-view__a"><path fill="#fff" d="M0 0h20v20H0z"/></clipPath></defs></svg>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react'
|
|
2
|
-
import { Input } from '../atoms/Input'
|
|
3
|
-
import { InputWithButton } from '../atoms/InputWithButton'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Design System/Atoms/InputWithButton',
|
|
7
|
-
component: InputWithButton,
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component:
|
|
12
|
-
'<h2>Usage guidelines</h2>\n' +
|
|
13
|
-
'<p>The InputWithButton component is used when a user needs to input information and immediately trigger an action, such as searching, submitting, or generating content. It combines an input field with a complementary interactive element, typically a button, placed within the same container.</p>\n' +
|
|
14
|
-
'<ul>\n' +
|
|
15
|
-
' <li>Use when the action is closely tied to the input (e.g., "Search", "Add", "Go")</li>\n' +
|
|
16
|
-
' <li>Always include a visible label for accessibility and clarity</li>\n' +
|
|
17
|
-
' <li>Use concise and descriptive button text or icons</li>\n' +
|
|
18
|
-
' <li>Ensure the input and button are visually grouped and aligned</li>\n' +
|
|
19
|
-
' <li>Support help and error text as in a standard input</li>\n' +
|
|
20
|
-
' <li>Pass the button or other actionable element through the <code>children</code> prop</li>\n' +
|
|
21
|
-
' <li>Do not overload with multiple actions—one clear purpose per instance</li>\n' +
|
|
22
|
-
'</ul>',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
tags: ['autodocs'],
|
|
27
|
-
argTypes: {
|
|
28
|
-
children: {
|
|
29
|
-
description: 'prop is used to pass a input and button components.',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default meta
|
|
35
|
-
type Story = StoryObj<typeof meta>
|
|
36
|
-
|
|
37
|
-
export const Primary: Story = {
|
|
38
|
-
args: {
|
|
39
|
-
children: (
|
|
40
|
-
<>
|
|
41
|
-
<Input
|
|
42
|
-
fullWidth
|
|
43
|
-
ellipsis
|
|
44
|
-
defaultValue="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
|
|
45
|
-
variant="borderless"
|
|
46
|
-
label="Input with button"
|
|
47
|
-
id="input-with-button"
|
|
48
|
-
readOnly
|
|
49
|
-
/>
|
|
50
|
-
<button type="button" className="button">
|
|
51
|
-
Action
|
|
52
|
-
</button>
|
|
53
|
-
</>
|
|
54
|
-
),
|
|
55
|
-
},
|
|
56
|
-
}
|