@indico-data/design-system 2.36.4 → 2.38.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 +40 -408
- package/lib/index.d.ts +122 -84
- package/lib/index.esm.css +40 -408
- package/lib/index.esm.js +15631 -16559
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +14165 -15092
- package/lib/index.js.map +1 -1
- package/lib/src/components/forms/date/datePicker/DatePicker.d.ts +3 -0
- package/lib/src/components/forms/date/datePicker/DatePicker.stories.d.ts +9 -0
- package/lib/src/components/forms/date/datePicker/contants.d.ts +21 -0
- package/lib/src/components/forms/date/datePicker/types.d.ts +48 -0
- package/lib/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +22 -0
- package/lib/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.d.ts +6 -0
- package/lib/src/components/forms/date/iconTriggerDatePicker/index.d.ts +1 -0
- package/lib/src/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +23 -0
- package/lib/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.d.ts +6 -0
- package/lib/src/components/forms/date/inputDatePicker/index.d.ts +1 -0
- package/lib/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +23 -0
- package/lib/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.d.ts +6 -0
- package/lib/src/components/forms/date/inputDateRangePicker/index.d.ts +1 -0
- package/lib/src/components/forms/input/Input.d.ts +1 -0
- package/lib/src/components/index.d.ts +3 -0
- package/lib/src/components/skeleton/Skeleton.d.ts +2 -2
- package/lib/src/components/skeleton/Skeleton.stories.d.ts +1 -0
- package/lib/src/index.d.ts +4 -1
- package/lib/src/legacy/components/index.d.ts +1 -1
- package/lib/src/legacy/components/inputs/index.d.ts +0 -2
- package/package.json +2 -2
- package/src/components/forms/date/datePicker/DatePicker.mdx +41 -0
- package/src/components/forms/date/datePicker/DatePicker.stories.tsx +307 -0
- package/src/components/forms/date/datePicker/DatePicker.tsx +68 -0
- package/src/components/forms/date/datePicker/contants.ts +22 -0
- package/src/components/forms/date/datePicker/styles/DatePicker.scss +85 -0
- package/src/components/forms/date/datePicker/types.ts +59 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.mdx +17 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +201 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +89 -0
- package/src/components/forms/date/iconTriggerDatePicker/index.ts +1 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.mdx +18 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +208 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +117 -0
- package/src/components/forms/date/inputDatePicker/index.ts +1 -0
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.mdx +18 -0
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +208 -0
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +117 -0
- package/src/components/forms/date/inputDateRangePicker/index.ts +1 -0
- package/src/components/forms/input/Input.tsx +3 -0
- package/src/components/index.ts +3 -0
- package/src/components/skeleton/Skeleton.stories.tsx +24 -4
- package/src/components/skeleton/Skeleton.tsx +4 -4
- package/src/index.ts +3 -2
- package/src/legacy/components/index.ts +0 -2
- package/src/legacy/components/inputs/index.ts +0 -2
- package/src/styles/index.scss +2 -1
- package/lib/src/legacy/components/inputs/DatePicker/DatePicker.d.ts +0 -15
- package/lib/src/legacy/components/inputs/DatePicker/DatePicker.stories.d.ts +0 -6
- package/lib/src/legacy/components/inputs/DatePicker/DatePicker.styles.d.ts +0 -1
- package/lib/src/legacy/components/inputs/DatePicker/index.d.ts +0 -1
- package/lib/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.d.ts +0 -21
- package/lib/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.stories.d.ts +0 -7
- package/lib/src/legacy/components/inputs/NoInputDatePicker/index.d.ts +0 -1
- package/src/legacy/components/inputs/DatePicker/DatePicker.stories.tsx +0 -30
- package/src/legacy/components/inputs/DatePicker/DatePicker.styles.ts +0 -437
- package/src/legacy/components/inputs/DatePicker/DatePicker.tsx +0 -165
- package/src/legacy/components/inputs/DatePicker/index.ts +0 -1
- package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.scss +0 -441
- package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.stories.tsx +0 -52
- package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.tsx +0 -245
- package/src/legacy/components/inputs/NoInputDatePicker/index.ts +0 -1
- /package/src/{legacy/components/inputs/NoInputDatePicker/__tests__/NoInputDatePicker.test.tsx → components/forms/date/iconTriggerDatePicker/__tests__/IconTriggerDatePicker.test.tsx} +0 -0
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
import React, { ChangeEventHandler, useRef, useState } from 'react';
|
|
3
|
-
|
|
4
|
-
import { format, isValid, parse } from 'date-fns';
|
|
5
|
-
import FocusTrap from 'focus-trap-react';
|
|
6
|
-
import { DayPicker, SelectSingleEventHandler } from 'react-day-picker';
|
|
7
|
-
import { usePopper } from 'react-popper';
|
|
8
|
-
import { PermafrostComponent } from '@/types';
|
|
9
|
-
import { IconButton } from '@/index';
|
|
10
|
-
|
|
11
|
-
import { StyledDatePicker } from './DatePicker.styles';
|
|
12
|
-
|
|
13
|
-
type Props = PermafrostComponent & {
|
|
14
|
-
ariaLabel?: string;
|
|
15
|
-
disableBeforeDate?: Date;
|
|
16
|
-
disableAfterDate?: Date;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
id: string;
|
|
19
|
-
label?: string;
|
|
20
|
-
onChange: (value: Date | undefined) => void;
|
|
21
|
-
placeholder?: string;
|
|
22
|
-
selected?: Date | undefined;
|
|
23
|
-
value: Date | undefined;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const DatePicker = (props: Props) => {
|
|
27
|
-
const {
|
|
28
|
-
ariaLabel,
|
|
29
|
-
className,
|
|
30
|
-
disabled,
|
|
31
|
-
disableBeforeDate,
|
|
32
|
-
disableAfterDate,
|
|
33
|
-
id,
|
|
34
|
-
label,
|
|
35
|
-
onChange,
|
|
36
|
-
placeholder,
|
|
37
|
-
value,
|
|
38
|
-
selected,
|
|
39
|
-
} = props;
|
|
40
|
-
|
|
41
|
-
const [localSelected, setLocalSelected] = useState<Date | undefined>(selected || undefined);
|
|
42
|
-
const [inputValue, setInputValue] = useState<string>(
|
|
43
|
-
isValid(value) ? format(value as Date, 'y-MM-dd') : '',
|
|
44
|
-
);
|
|
45
|
-
const [isPopperOpen, setIsPopperOpen] = useState(false);
|
|
46
|
-
const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);
|
|
47
|
-
const popperRef = useRef<HTMLDivElement>(null);
|
|
48
|
-
const popper = usePopper(popperRef.current, popperElement, {
|
|
49
|
-
placement: 'bottom-start',
|
|
50
|
-
modifiers: [
|
|
51
|
-
{
|
|
52
|
-
name: 'offset',
|
|
53
|
-
options: {
|
|
54
|
-
offset: [0, 10],
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
});
|
|
59
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
|
60
|
-
|
|
61
|
-
const closePopper = () => {
|
|
62
|
-
setIsPopperOpen(false);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// TODO -- After discussing with product, we determined handling invalid would happen at a later date.
|
|
66
|
-
const handleInputChange: ChangeEventHandler<HTMLInputElement> = (e) => {
|
|
67
|
-
setInputValue(e.currentTarget.value);
|
|
68
|
-
const date = parse(e.currentTarget.value, 'y-MM-dd', new Date());
|
|
69
|
-
if (isValid(date)) {
|
|
70
|
-
setLocalSelected(date);
|
|
71
|
-
onChange(date);
|
|
72
|
-
} else if (e.currentTarget.value === '') {
|
|
73
|
-
setLocalSelected(undefined);
|
|
74
|
-
setInputValue('');
|
|
75
|
-
onChange(undefined);
|
|
76
|
-
} else {
|
|
77
|
-
setLocalSelected(undefined);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const handleDaySelect: SelectSingleEventHandler = (date) => {
|
|
82
|
-
setLocalSelected(date);
|
|
83
|
-
if (date) {
|
|
84
|
-
setInputValue(format(date, 'y-MM-dd'));
|
|
85
|
-
onChange(date);
|
|
86
|
-
closePopper();
|
|
87
|
-
} else {
|
|
88
|
-
setInputValue('');
|
|
89
|
-
onChange(date);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<StyledDatePicker
|
|
95
|
-
className={className}
|
|
96
|
-
aria-label={ariaLabel || 'date select'}
|
|
97
|
-
aria-describedby={`picker-label--${id}`}
|
|
98
|
-
data-cy={props['data-cy']}
|
|
99
|
-
data-testid={props['data-testid']}
|
|
100
|
-
id={id}
|
|
101
|
-
>
|
|
102
|
-
{label ? (
|
|
103
|
-
<div id={`picker-label--${id}`} className="datepicker-label">
|
|
104
|
-
{label}
|
|
105
|
-
</div>
|
|
106
|
-
) : null}
|
|
107
|
-
<div ref={popperRef} className="datepicker--inputParent">
|
|
108
|
-
<input
|
|
109
|
-
ref={inputRef}
|
|
110
|
-
data-testid={`datepicker-input-${id}`}
|
|
111
|
-
disabled={disabled}
|
|
112
|
-
type="text"
|
|
113
|
-
placeholder={placeholder || format(new Date(), 'y-MM-dd')}
|
|
114
|
-
value={inputValue}
|
|
115
|
-
onChange={handleInputChange}
|
|
116
|
-
className="datepicker--input"
|
|
117
|
-
onClick={() => setIsPopperOpen(!isPopperOpen)}
|
|
118
|
-
/>
|
|
119
|
-
<IconButton
|
|
120
|
-
className="remove-btn"
|
|
121
|
-
data-testid="button-remove-date-value"
|
|
122
|
-
iconName="x-close"
|
|
123
|
-
onPress={() => {
|
|
124
|
-
closePopper();
|
|
125
|
-
setInputValue('');
|
|
126
|
-
setLocalSelected(undefined);
|
|
127
|
-
onChange(undefined);
|
|
128
|
-
}}
|
|
129
|
-
/>
|
|
130
|
-
</div>
|
|
131
|
-
{isPopperOpen && (
|
|
132
|
-
<FocusTrap
|
|
133
|
-
active
|
|
134
|
-
focusTrapOptions={{
|
|
135
|
-
initialFocus: false,
|
|
136
|
-
allowOutsideClick: true,
|
|
137
|
-
clickOutsideDeactivates: true,
|
|
138
|
-
onDeactivate: closePopper,
|
|
139
|
-
fallbackFocus: inputRef.current || undefined,
|
|
140
|
-
}}
|
|
141
|
-
>
|
|
142
|
-
<div
|
|
143
|
-
tabIndex={-1}
|
|
144
|
-
style={popper.styles.popper}
|
|
145
|
-
className="DayPickerInput-Overlay"
|
|
146
|
-
{...popper.attributes.popper}
|
|
147
|
-
ref={setPopperElement}
|
|
148
|
-
role="dialog"
|
|
149
|
-
aria-label="DayPicker calendar"
|
|
150
|
-
>
|
|
151
|
-
<DayPicker
|
|
152
|
-
disabled={disabled}
|
|
153
|
-
mode="single"
|
|
154
|
-
defaultMonth={localSelected}
|
|
155
|
-
selected={localSelected}
|
|
156
|
-
onSelect={handleDaySelect}
|
|
157
|
-
fromDate={disableBeforeDate}
|
|
158
|
-
toDate={disableAfterDate}
|
|
159
|
-
/>
|
|
160
|
-
</div>
|
|
161
|
-
</FocusTrap>
|
|
162
|
-
)}
|
|
163
|
-
</StyledDatePicker>
|
|
164
|
-
);
|
|
165
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DatePicker } from './DatePicker';
|
|
@@ -1,441 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { NoInputDatePicker } from '@/legacy/components/inputs/NoInputDatePicker';
|
|
4
|
-
import { DateRange } from 'react-day-picker';
|
|
5
|
-
const meta: Meta<typeof NoInputDatePicker> = {
|
|
6
|
-
component: NoInputDatePicker,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
title: 'legacy/Inputs/NoInputDatePicker',
|
|
9
|
-
// decorators: [
|
|
10
|
-
// (Story) => (
|
|
11
|
-
// <div style={{ height: '500px' }}>
|
|
12
|
-
// <Story />
|
|
13
|
-
// </div>
|
|
14
|
-
// ),
|
|
15
|
-
// ],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
|
|
20
|
-
type Story = StoryObj<typeof NoInputDatePicker>;
|
|
21
|
-
|
|
22
|
-
const today = new Date();
|
|
23
|
-
|
|
24
|
-
export const Single: Story = {
|
|
25
|
-
args: {
|
|
26
|
-
id: 'date-picker',
|
|
27
|
-
label: 'Pick a date:',
|
|
28
|
-
value: today,
|
|
29
|
-
triggerIcon: 'calendar',
|
|
30
|
-
triggerIconSize: 'lg',
|
|
31
|
-
clearOnClose: true,
|
|
32
|
-
onChange: (date: Date | DateRange | undefined) => {
|
|
33
|
-
// eslint-disable-next-line no-console
|
|
34
|
-
console.log(date);
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const Range: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
id: 'date-picker',
|
|
42
|
-
label: 'Pick a date:',
|
|
43
|
-
value: today,
|
|
44
|
-
isRangePicker: true,
|
|
45
|
-
triggerIcon: 'calendar',
|
|
46
|
-
triggerIconSize: 'lg',
|
|
47
|
-
onChange: (date: Date | DateRange | undefined) => {
|
|
48
|
-
// eslint-disable-next-line no-console
|
|
49
|
-
console.log(date);
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
};
|