@indico-data/design-system 2.17.2 → 2.19.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/lib/index.css +616 -184
- package/lib/index.d.ts +17 -21
- package/lib/index.esm.css +616 -184
- package/lib/index.esm.js +36 -462
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +37 -463
- package/lib/index.js.map +1 -1
- package/lib/src/components/button/Button.stories.d.ts +1 -0
- package/lib/src/components/forms/input/Input.d.ts +5 -7
- package/lib/src/components/forms/passwordInput/PasswordInput.d.ts +5 -7
- package/lib/src/components/forms/subcomponents/Label.d.ts +6 -3
- package/lib/src/components/forms/textarea/Textarea.d.ts +5 -7
- package/lib/src/legacy/components/modals/ModalBase/ModalBase.d.ts +0 -1
- package/lib/src/storybook/labelArgTypes.d.ts +3 -0
- package/package.json +1 -1
- package/src/components/button/Button.mdx +6 -3
- package/src/components/button/Button.stories.tsx +8 -0
- package/src/components/button/Button.tsx +14 -6
- package/src/components/button/__tests__/Button.test.tsx +38 -0
- package/src/components/button/styles/Button.scss +14 -22
- package/src/components/button/styles/_variables.scss +77 -4
- package/src/components/forms/checkbox/styles/Checkbox.scss +3 -3
- package/src/components/forms/input/Input.mdx +15 -2
- package/src/components/forms/input/Input.stories.tsx +10 -45
- package/src/components/forms/input/Input.tsx +22 -15
- package/src/components/forms/input/styles/Input.scss +2 -15
- package/src/components/forms/passwordInput/PasswordInput.mdx +10 -8
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +3 -44
- package/src/components/forms/passwordInput/PasswordInput.tsx +20 -15
- package/src/components/forms/passwordInput/styles/PasswordInput.scss +2 -15
- package/src/components/forms/radio/styles/Radio.scss +3 -3
- package/src/components/forms/select/styles/Select.scss +21 -4
- package/src/components/forms/subcomponents/Label.tsx +29 -6
- package/src/components/forms/subcomponents/__tests__/Label.test.tsx +63 -15
- package/src/components/forms/textarea/Textarea.mdx +12 -2
- package/src/components/forms/textarea/Textarea.stories.tsx +4 -46
- package/src/components/forms/textarea/Textarea.tsx +15 -13
- package/src/components/forms/textarea/styles/Textarea.scss +2 -14
- package/src/components/forms/toggle/styles/Toggle.scss +2 -2
- package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.scss +441 -0
- package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.tsx +3 -4
- package/src/legacy/components/modals/ModalBase/ModalBase.tsx +5 -1
- package/src/storybook/labelArgTypes.ts +50 -0
- package/src/styles/globals.scss +11 -0
- package/src/styles/index.scss +2 -2
- package/src/styles/variables/themes/dark.scss +8 -7
- package/src/styles/variables/themes/light.scss +1 -0
- package/lib/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.d.ts +0 -1
- package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.ts +0 -449
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
1
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
3
|
+
import labelArgTypes from '@/storybook/labelArgTypes';
|
|
4
|
+
import { Textarea } from './Textarea';
|
|
4
5
|
|
|
5
6
|
const meta: Meta = {
|
|
6
7
|
title: 'Forms/Textarea',
|
|
@@ -17,28 +18,6 @@ const meta: Meta = {
|
|
|
17
18
|
},
|
|
18
19
|
action: 'onChange',
|
|
19
20
|
},
|
|
20
|
-
label: {
|
|
21
|
-
control: 'text',
|
|
22
|
-
description: 'The label for the textarea field',
|
|
23
|
-
table: {
|
|
24
|
-
category: 'Props',
|
|
25
|
-
type: {
|
|
26
|
-
summary: 'string',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
defaultValue: { summary: '' },
|
|
30
|
-
},
|
|
31
|
-
name: {
|
|
32
|
-
control: 'text',
|
|
33
|
-
description: 'The name for the textarea field',
|
|
34
|
-
table: {
|
|
35
|
-
category: 'Props',
|
|
36
|
-
type: {
|
|
37
|
-
summary: 'string',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
defaultValue: { summary: '' },
|
|
41
|
-
},
|
|
42
21
|
placeholder: {
|
|
43
22
|
control: 'text',
|
|
44
23
|
description: 'The placeholder for the textarea field',
|
|
@@ -61,17 +40,6 @@ const meta: Meta = {
|
|
|
61
40
|
},
|
|
62
41
|
defaultValue: { summary: '' },
|
|
63
42
|
},
|
|
64
|
-
isRequired: {
|
|
65
|
-
control: 'boolean',
|
|
66
|
-
description: 'Toggles the required astherisc on the label',
|
|
67
|
-
table: {
|
|
68
|
-
category: 'Props',
|
|
69
|
-
type: {
|
|
70
|
-
summary: 'boolean',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
defaultValue: { summary: 'false' },
|
|
74
|
-
},
|
|
75
43
|
isDisabled: {
|
|
76
44
|
control: 'boolean',
|
|
77
45
|
description: 'Toggles the disabled state of the textarea field',
|
|
@@ -105,17 +73,6 @@ const meta: Meta = {
|
|
|
105
73
|
},
|
|
106
74
|
defaultValue: { summary: '' },
|
|
107
75
|
},
|
|
108
|
-
hasHiddenLabel: {
|
|
109
|
-
control: 'boolean',
|
|
110
|
-
description: 'Hides the label visually (retains it for screen readers)',
|
|
111
|
-
table: {
|
|
112
|
-
category: 'Props',
|
|
113
|
-
type: {
|
|
114
|
-
summary: 'boolean',
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
defaultValue: { summary: 'false' },
|
|
118
|
-
},
|
|
119
76
|
autofocus: {
|
|
120
77
|
control: 'boolean',
|
|
121
78
|
description: ' Specifies that a text area should automatically get focus when the page loads',
|
|
@@ -198,6 +155,7 @@ const meta: Meta = {
|
|
|
198
155
|
disable: true,
|
|
199
156
|
},
|
|
200
157
|
},
|
|
158
|
+
...labelArgTypes,
|
|
201
159
|
},
|
|
202
160
|
};
|
|
203
161
|
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
import { withLabel, LabelProps, WithLabelProps } from '../subcomponents/Label';
|
|
3
5
|
import { DisplayFormError } from '../subcomponents/DisplayFormError';
|
|
4
6
|
|
|
5
|
-
export interface TextareaProps {
|
|
7
|
+
export interface TextareaProps extends WithLabelProps {
|
|
6
8
|
ref?: React.LegacyRef<HTMLTextAreaElement>;
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
placeholder: string;
|
|
9
|
+
placeholder?: string;
|
|
10
10
|
value?: string | undefined;
|
|
11
11
|
onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
12
|
-
isRequired?: boolean;
|
|
13
12
|
isDisabled?: boolean;
|
|
14
13
|
errorMessage?: string | undefined;
|
|
15
14
|
helpText?: string;
|
|
16
|
-
hasHiddenLabel?: boolean;
|
|
17
15
|
rows?: number;
|
|
18
16
|
cols?: number;
|
|
19
17
|
readonly?: boolean;
|
|
@@ -23,7 +21,7 @@ export interface TextareaProps {
|
|
|
23
21
|
autofocus?: boolean;
|
|
24
22
|
defaultValue?: string;
|
|
25
23
|
}
|
|
26
|
-
|
|
24
|
+
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
27
25
|
(
|
|
28
26
|
{
|
|
29
27
|
label,
|
|
@@ -49,9 +47,10 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
49
47
|
) => {
|
|
50
48
|
const hasErrors = errorMessage && errorMessage.length > 0;
|
|
51
49
|
|
|
50
|
+
const textareaClasses = classNames('textarea', { error: hasErrors });
|
|
51
|
+
|
|
52
52
|
return (
|
|
53
|
-
|
|
54
|
-
<Label label={label} name={name} isRequired={isRequired} hasHiddenLabel={hasHiddenLabel} />
|
|
53
|
+
<>
|
|
55
54
|
<div className="textarea-wrapper">
|
|
56
55
|
<textarea
|
|
57
56
|
ref={ref}
|
|
@@ -67,11 +66,10 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
67
66
|
disabled={isDisabled}
|
|
68
67
|
placeholder={placeholder}
|
|
69
68
|
onChange={onChange}
|
|
70
|
-
className={
|
|
69
|
+
className={textareaClasses}
|
|
71
70
|
aria-invalid={hasErrors ? true : undefined}
|
|
72
71
|
aria-describedby={hasErrors || helpText ? `${name}-helper` : undefined}
|
|
73
72
|
aria-required={isRequired}
|
|
74
|
-
aria-label={label}
|
|
75
73
|
{...rest}
|
|
76
74
|
/>
|
|
77
75
|
</div>
|
|
@@ -81,7 +79,11 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
81
79
|
{helpText}
|
|
82
80
|
</div>
|
|
83
81
|
)}
|
|
84
|
-
|
|
82
|
+
</>
|
|
85
83
|
);
|
|
86
84
|
},
|
|
87
85
|
);
|
|
86
|
+
|
|
87
|
+
const LabeledTextarea = withLabel(Textarea);
|
|
88
|
+
|
|
89
|
+
export { LabeledTextarea as Textarea };
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
:root [data-theme='dark'] {
|
|
5
5
|
// Typography
|
|
6
6
|
--pf-textarea-background-color: var(--pf-white-color);
|
|
7
|
-
--pf-textarea-border-color: var(--pf-gray-color);
|
|
8
7
|
--pf-textarea-text-color: var(--pf-gray-color);
|
|
9
8
|
--pf-textarea-placeholder-text-color: var(--pf-gray-color-300);
|
|
10
9
|
--pf-textarea-help-text-color: var(--pf-gray-color-400);
|
|
11
10
|
--pf-textarea-disabled-background-color: var(--pf-gray-color-100);
|
|
12
|
-
--pf-textarea-border-color: var(--pf-
|
|
11
|
+
--pf-textarea-border-color: var(--pf-form-input-border-color);
|
|
13
12
|
--pf-textarea-disabled-color: var(--pf-gray-color-400);
|
|
14
13
|
|
|
15
14
|
// textarea Radius
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
// Dark Theme Specific Variables
|
|
20
19
|
:root [data-theme='dark'] {
|
|
21
20
|
--pf-textarea-background-color: var(--pf-primary-color);
|
|
22
|
-
--pf-textarea-border-color: var(--pf-
|
|
21
|
+
--pf-textarea-border-color: var(--pf-form-input-border-color);
|
|
23
22
|
--pf-textarea-text-color: var(--pf-gray-color-100);
|
|
24
23
|
--pf-textarea-placeholder-text-color: var(--pf-gray-color);
|
|
25
24
|
--pf-textarea-help-text-color: var(--pf-gray-color-200);
|
|
@@ -85,17 +84,6 @@
|
|
|
85
84
|
color: var(--pf-textarea-help-text-color);
|
|
86
85
|
font-size: var(--pf-font-size-subtitle2);
|
|
87
86
|
}
|
|
88
|
-
.is-visually-hidden {
|
|
89
|
-
position: absolute;
|
|
90
|
-
width: 1px;
|
|
91
|
-
height: 1px;
|
|
92
|
-
padding: 0;
|
|
93
|
-
margin: -1px;
|
|
94
|
-
overflow: hidden;
|
|
95
|
-
clip: rect(0, 0, 0, 0);
|
|
96
|
-
white-space: nowrap;
|
|
97
|
-
border: 0;
|
|
98
|
-
}
|
|
99
87
|
.form-label {
|
|
100
88
|
margin-bottom: var(--pf-margin-2);
|
|
101
89
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:root [data-theme='dark'] {
|
|
5
5
|
--pf-toggle-background-color: var(--pf-gray-color-200);
|
|
6
6
|
--pf-toggle-circle-color: var(--pf-primary-color);
|
|
7
|
-
--pf-toggle-border-color: var(--pf-
|
|
7
|
+
--pf-toggle-border-color: var(--pf-form-input-border-color);
|
|
8
8
|
--pf-toggle-disabled-background-color: var(--pf-gray-color-400);
|
|
9
9
|
--pf-toggle-disabled-circle-color: var(--pf-gray-color-300);
|
|
10
10
|
--pf-toggle-checked-background-color: var(--pf-primary-color-200);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
:root [data-theme='dark'] {
|
|
15
15
|
--pf-toggle-background-color: var(--pf-primary-color-100);
|
|
16
16
|
--pf-toggle-circle-color: var(--pf-white-color);
|
|
17
|
-
--pf-toggle-border-color: var(--pf-
|
|
17
|
+
--pf-toggle-border-color: var(--pf-form-input-border-color);
|
|
18
18
|
--pf-toggle-disabled-background-color: var(--pf-gray-color-600);
|
|
19
19
|
--pf-toggle-disabled-circle-color: var(--pf-gray-color-900);
|
|
20
20
|
--pf-toggle-checked-background-color: var(--pf-secondary-color-400);
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
.rdp {
|
|
2
|
+
--rdp-cell-size: 40px;
|
|
3
|
+
--rdp-accent-color: #6833d0;
|
|
4
|
+
--rdp-background-color: #ffffff;
|
|
5
|
+
--rdp-accent-color-dark: #3003e1;
|
|
6
|
+
--rdp-background-color-dark: #180270;
|
|
7
|
+
--rdp-outline: 2px solid var(--rdp-accent-color); /* Outline border for focused elements */
|
|
8
|
+
--rdp-outline-selected: 3px solid var(--rdp-accent-color); /* Outline border for focused _and_ selected elements */
|
|
9
|
+
|
|
10
|
+
margin: 1em;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Hide elements for devices that are not screen readers */
|
|
14
|
+
.rdp-vhidden {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
padding: 0;
|
|
17
|
+
margin: 0;
|
|
18
|
+
background: transparent;
|
|
19
|
+
border: 0;
|
|
20
|
+
-moz-appearance: none;
|
|
21
|
+
-webkit-appearance: none;
|
|
22
|
+
appearance: none;
|
|
23
|
+
position: absolute !important;
|
|
24
|
+
top: 0;
|
|
25
|
+
width: 1px !important;
|
|
26
|
+
height: 1px !important;
|
|
27
|
+
padding: 0 !important;
|
|
28
|
+
overflow: hidden !important;
|
|
29
|
+
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
30
|
+
border: 0 !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Buttons */
|
|
34
|
+
.rdp-button_reset {
|
|
35
|
+
appearance: none;
|
|
36
|
+
position: relative;
|
|
37
|
+
margin: 0;
|
|
38
|
+
padding: 0;
|
|
39
|
+
cursor: default;
|
|
40
|
+
color: inherit;
|
|
41
|
+
background: none;
|
|
42
|
+
font: inherit;
|
|
43
|
+
|
|
44
|
+
-moz-appearance: none;
|
|
45
|
+
-webkit-appearance: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.rdp-button_reset:focus-visible {
|
|
49
|
+
/* Make sure to reset outline only when :focus-visible is supported */
|
|
50
|
+
outline: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.rdp-button {
|
|
54
|
+
border: 2px solid transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.rdp-button[disabled]:not(.rdp-day_selected) {
|
|
58
|
+
opacity: 0.25;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.rdp-button:not([disabled]) {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.rdp-button:focus-visible:not([disabled]) {
|
|
66
|
+
color: inherit;
|
|
67
|
+
background-color: var(--rdp-background-color);
|
|
68
|
+
border: var(--rdp-outline);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.rdp-months {
|
|
72
|
+
display: flex;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.rdp-month {
|
|
76
|
+
margin: 0 1em;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.rdp-month:first-child {
|
|
80
|
+
margin-left: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.rdp-month:last-child {
|
|
84
|
+
margin-right: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.rdp-table {
|
|
88
|
+
margin: 0;
|
|
89
|
+
max-width: calc(var(--rdp-cell-size) * 7);
|
|
90
|
+
border-collapse: collapse;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.rdp-with_weeknumber .rdp-table {
|
|
94
|
+
max-width: calc(var(--rdp-cell-size) * 8);
|
|
95
|
+
border-collapse: collapse;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.rdp-caption {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: space-between;
|
|
102
|
+
padding: 0;
|
|
103
|
+
text-align: left;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.rdp-multiple_months .rdp-caption {
|
|
107
|
+
position: relative;
|
|
108
|
+
display: block;
|
|
109
|
+
text-align: center;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.rdp-caption_dropdowns {
|
|
113
|
+
position: relative;
|
|
114
|
+
display: inline-flex;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.rdp-caption_label {
|
|
118
|
+
position: relative;
|
|
119
|
+
z-index: 1;
|
|
120
|
+
display: inline-flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
margin: 0;
|
|
123
|
+
padding: 0 0.25em;
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
color: currentColor;
|
|
126
|
+
border: 0;
|
|
127
|
+
border: 2px solid transparent;
|
|
128
|
+
font-family: inherit;
|
|
129
|
+
font-size: 140%;
|
|
130
|
+
font-weight: bold;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.rdp-nav {
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.rdp-multiple_months .rdp-caption_start .rdp-nav {
|
|
138
|
+
position: absolute;
|
|
139
|
+
top: 50%;
|
|
140
|
+
left: 0;
|
|
141
|
+
transform: translateY(-50%);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.rdp-multiple_months .rdp-caption_end .rdp-nav {
|
|
145
|
+
position: absolute;
|
|
146
|
+
top: 50%;
|
|
147
|
+
right: 0;
|
|
148
|
+
transform: translateY(-50%);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.rdp-nav_button {
|
|
152
|
+
display: inline-flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
width: var(--rdp-cell-size);
|
|
156
|
+
height: var(--rdp-cell-size);
|
|
157
|
+
padding: 0.25em;
|
|
158
|
+
border-radius: 100%;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* ---------- */
|
|
162
|
+
/* Dropdowns */
|
|
163
|
+
/* ---------- */
|
|
164
|
+
|
|
165
|
+
.rdp-dropdown_year,
|
|
166
|
+
.rdp-dropdown_month {
|
|
167
|
+
position: relative;
|
|
168
|
+
display: inline-flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.rdp-dropdown {
|
|
173
|
+
appearance: none;
|
|
174
|
+
position: absolute;
|
|
175
|
+
z-index: 2;
|
|
176
|
+
top: 0;
|
|
177
|
+
bottom: 0;
|
|
178
|
+
left: 0;
|
|
179
|
+
width: 100%;
|
|
180
|
+
margin: 0;
|
|
181
|
+
padding: 0;
|
|
182
|
+
cursor: inherit;
|
|
183
|
+
opacity: 0;
|
|
184
|
+
border: none;
|
|
185
|
+
background-color: transparent;
|
|
186
|
+
font-family: inherit;
|
|
187
|
+
font-size: inherit;
|
|
188
|
+
line-height: inherit;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.rdp-dropdown[disabled] {
|
|
192
|
+
opacity: unset;
|
|
193
|
+
color: unset;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.rdp-dropdown:focus-visible:not([disabled]) + .rdp-caption_label {
|
|
197
|
+
background-color: var(--rdp-background-color);
|
|
198
|
+
border: var(--rdp-outline);
|
|
199
|
+
border-radius: 6px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.rdp-dropdown_icon {
|
|
203
|
+
margin: 0 0 0 5px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.rdp-head {
|
|
207
|
+
border: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.rdp-head_row,
|
|
211
|
+
.rdp-row {
|
|
212
|
+
height: 100%;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.rdp-head_cell {
|
|
216
|
+
vertical-align: middle;
|
|
217
|
+
font-size: 0.75em;
|
|
218
|
+
font-weight: 700;
|
|
219
|
+
text-align: center;
|
|
220
|
+
height: 100%;
|
|
221
|
+
height: var(--rdp-cell-size);
|
|
222
|
+
padding: 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.rdp-tbody {
|
|
226
|
+
border: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.rdp-tfoot {
|
|
230
|
+
margin: 0.5em;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.rdp-cell {
|
|
234
|
+
width: var(--rdp-cell-size);
|
|
235
|
+
height: 100%;
|
|
236
|
+
height: var(--rdp-cell-size);
|
|
237
|
+
padding: 0;
|
|
238
|
+
text-align: center;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.rdp-weeknumber {
|
|
242
|
+
font-size: 0.75em;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.rdp-weeknumber,
|
|
246
|
+
.rdp-day {
|
|
247
|
+
display: flex;
|
|
248
|
+
overflow: hidden;
|
|
249
|
+
align-items: center;
|
|
250
|
+
justify-content: center;
|
|
251
|
+
box-sizing: border-box;
|
|
252
|
+
width: var(--rdp-cell-size);
|
|
253
|
+
max-width: var(--rdp-cell-size);
|
|
254
|
+
height: var(--rdp-cell-size);
|
|
255
|
+
margin: 0;
|
|
256
|
+
border: 2px solid transparent;
|
|
257
|
+
border-radius: 100%;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.rdp-day_today:not(.rdp-day_outside) {
|
|
261
|
+
font-weight: bold;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.rdp-day_selected,
|
|
265
|
+
.rdp-day_selected:focus-visible,
|
|
266
|
+
.rdp-day_selected:hover {
|
|
267
|
+
color: white;
|
|
268
|
+
opacity: 1;
|
|
269
|
+
background-color: var(--rdp-accent-color);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.rdp-day_outside {
|
|
273
|
+
opacity: 0.5;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.rdp-day_selected:focus-visible {
|
|
277
|
+
/* Since the background is the same use again the outline */
|
|
278
|
+
outline: var(--rdp-outline);
|
|
279
|
+
outline-offset: 2px;
|
|
280
|
+
z-index: 1;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.rdp:not([dir='rtl']) .rdp-day_range_start:not(.rdp-day_range_end) {
|
|
284
|
+
border-top-right-radius: 0;
|
|
285
|
+
border-bottom-right-radius: 0;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.rdp:not([dir='rtl']) .rdp-day_range_end:not(.rdp-day_range_start) {
|
|
289
|
+
border-top-left-radius: 0;
|
|
290
|
+
border-bottom-left-radius: 0;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.rdp[dir='rtl'] .rdp-day_range_start:not(.rdp-day_range_end) {
|
|
294
|
+
border-top-left-radius: 0;
|
|
295
|
+
border-bottom-left-radius: 0;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.rdp[dir='rtl'] .rdp-day_range_end:not(.rdp-day_range_start) {
|
|
299
|
+
border-top-right-radius: 0;
|
|
300
|
+
border-bottom-right-radius: 0;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.rdp-day_range_end.rdp-day_range_start {
|
|
304
|
+
border-radius: 100%;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.rdp-day_range_middle {
|
|
308
|
+
border-radius: 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/*# sourceMappingURL=style.css.map */
|
|
312
|
+
|
|
313
|
+
/******************************
|
|
314
|
+
* Indico Custom Styling For Insights
|
|
315
|
+
*******************************/
|
|
316
|
+
.rdp-button:hover:not([disabled]):not(.rdp-day_selected) {
|
|
317
|
+
background-color: #976cec;
|
|
318
|
+
}
|
|
319
|
+
.rdp-button,
|
|
320
|
+
.rdp-day {
|
|
321
|
+
box-shadow: none;
|
|
322
|
+
color: #000000;
|
|
323
|
+
&:hover {
|
|
324
|
+
background-color: #6833d0;
|
|
325
|
+
color: white;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.rdp-head_cell,
|
|
330
|
+
.rdp-cell {
|
|
331
|
+
border: none;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.DayPickerInput-Overlay {
|
|
335
|
+
border-radius: 4px;
|
|
336
|
+
z-index: 999;
|
|
337
|
+
.rdp {
|
|
338
|
+
background: white;
|
|
339
|
+
z-index: 999;
|
|
340
|
+
border: solid 1px #000000;
|
|
341
|
+
border-radius: 4px;
|
|
342
|
+
box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.4);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.rdp-caption_label {
|
|
347
|
+
font-weight: 400;
|
|
348
|
+
font-size: 14px;
|
|
349
|
+
color: #000000;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.rdp-day_today {
|
|
353
|
+
background-color: #dbd5e6;
|
|
354
|
+
color: #ffffff;
|
|
355
|
+
font-weight: 400;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.rdp-button_reset {
|
|
359
|
+
&.rdp-button {
|
|
360
|
+
&.rdp-day {
|
|
361
|
+
&.rdp-day_selected {
|
|
362
|
+
background-color: #6833d0;
|
|
363
|
+
color: white;
|
|
364
|
+
|
|
365
|
+
&:focus {
|
|
366
|
+
color: white;
|
|
367
|
+
}
|
|
368
|
+
&:active {
|
|
369
|
+
color: white;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.rdp-head_cell {
|
|
377
|
+
color: #6833d0;
|
|
378
|
+
font-weight: 400;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.date__picker__trigger {
|
|
382
|
+
color: #000000;
|
|
383
|
+
cursor: pointer;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.custom__caption {
|
|
387
|
+
display: flex;
|
|
388
|
+
justify-content: space-between;
|
|
389
|
+
align-items: center;
|
|
390
|
+
padding: 15px 5px 15px 5px;
|
|
391
|
+
|
|
392
|
+
.custom__caption__text {
|
|
393
|
+
font-size: 14px;
|
|
394
|
+
color: #000000;
|
|
395
|
+
margin: 0;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.custom__caption__action__button {
|
|
399
|
+
background: none;
|
|
400
|
+
border: none;
|
|
401
|
+
cursor: pointer;
|
|
402
|
+
box-shadow: none;
|
|
403
|
+
padding: 0 5px 0 5px;
|
|
404
|
+
|
|
405
|
+
border-radius: 60px;
|
|
406
|
+
color: #6833d0;
|
|
407
|
+
height: 20px;
|
|
408
|
+
width: 20px;
|
|
409
|
+
|
|
410
|
+
&:hover {
|
|
411
|
+
background-color: #6833d0;
|
|
412
|
+
color: #ffffff;
|
|
413
|
+
border-radius: 20px;
|
|
414
|
+
|
|
415
|
+
.rdp-nav_icon {
|
|
416
|
+
color: #ffffff;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.rdp-nav_icon {
|
|
421
|
+
color: #6833d0;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.visually-hidden,
|
|
427
|
+
.visually-hidden-focusable:not(:focus):not(:focus-within) {
|
|
428
|
+
border: 0 !important;
|
|
429
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
430
|
+
height: 1px !important;
|
|
431
|
+
margin: -1px !important;
|
|
432
|
+
overflow: hidden !important;
|
|
433
|
+
padding: 0 !important;
|
|
434
|
+
white-space: nowrap !important;
|
|
435
|
+
width: 1px !important;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.visually-hidden:not(caption),
|
|
439
|
+
.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption) {
|
|
440
|
+
position: absolute !important;
|
|
441
|
+
}
|
|
@@ -14,8 +14,6 @@ import { usePopper } from 'react-popper';
|
|
|
14
14
|
import { IconName, IconSizes, PermafrostComponent } from '@/types';
|
|
15
15
|
import { Icon } from '@/components';
|
|
16
16
|
|
|
17
|
-
import { StyledNoInputDatePicker } from './NoInputDatePicker.styles';
|
|
18
|
-
|
|
19
17
|
type Props = PermafrostComponent & {
|
|
20
18
|
ariaLabel?: string;
|
|
21
19
|
disableBeforeDate?: Date;
|
|
@@ -163,8 +161,9 @@ export const NoInputDatePicker = (props: Props) => {
|
|
|
163
161
|
onChange(range);
|
|
164
162
|
}
|
|
165
163
|
};
|
|
164
|
+
|
|
166
165
|
return (
|
|
167
|
-
<
|
|
166
|
+
<div
|
|
168
167
|
className={className}
|
|
169
168
|
aria-label={ariaLabel || 'date select'}
|
|
170
169
|
aria-describedby={`picker-label--${id}`}
|
|
@@ -241,6 +240,6 @@ export const NoInputDatePicker = (props: Props) => {
|
|
|
241
240
|
</div>
|
|
242
241
|
</FocusTrap>
|
|
243
242
|
)}
|
|
244
|
-
</
|
|
243
|
+
</div>
|
|
245
244
|
);
|
|
246
245
|
};
|
|
@@ -10,7 +10,6 @@ export type ModalBaseProps = PermafrostComponent & {
|
|
|
10
10
|
children: React.ReactNode | React.ReactNode[];
|
|
11
11
|
clickToDismiss?(): void;
|
|
12
12
|
describedBy?: string;
|
|
13
|
-
/** a selector representing the desired parent; defaults to `#root` */
|
|
14
13
|
node?: string;
|
|
15
14
|
open: boolean;
|
|
16
15
|
preventEscDismiss?: boolean;
|
|
@@ -51,6 +50,10 @@ export function ModalBase(props: ModalBaseProps) {
|
|
|
51
50
|
ariaProps['describedby'] = describedBy;
|
|
52
51
|
}
|
|
53
52
|
|
|
53
|
+
// Try to render modal within the theme-root, otherwise attach to the root
|
|
54
|
+
const parentSelector = () =>
|
|
55
|
+
document.getElementById('theme-root') || document.getElementById('root');
|
|
56
|
+
|
|
54
57
|
return (
|
|
55
58
|
<StyledModalBase
|
|
56
59
|
ariaHideApp={false}
|
|
@@ -62,6 +65,7 @@ export function ModalBase(props: ModalBaseProps) {
|
|
|
62
65
|
isOpen={open}
|
|
63
66
|
node={node}
|
|
64
67
|
onRequestClose={clickToDismiss}
|
|
68
|
+
parentSelector={parentSelector}
|
|
65
69
|
shouldCloseOnEsc={!preventEscDismiss}
|
|
66
70
|
shouldReturnFocusAfterClose={!preventReturnFocus}
|
|
67
71
|
maxWidth={maxWidth}
|