@indico-data/design-system 3.0.8 → 3.0.10
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/components/floatUI/FloatUI.d.ts +1 -1
- package/lib/components/floatUI/types.d.ts +1 -0
- package/lib/components/forms/date/datePicker/types.d.ts +7 -0
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +5 -0
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +8 -0
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +10 -0
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +10 -0
- package/lib/components/forms/input/Input.d.ts +1 -0
- package/lib/components/forms/textarea/Textarea.d.ts +1 -0
- package/lib/components/forms/timePicker/TimePicker.d.ts +7 -1
- package/lib/index.css +10 -0
- package/lib/index.d.ts +43 -2
- package/lib/index.esm.css +10 -0
- package/lib/index.esm.js +130 -124
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +130 -124
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/floatUI/FloatUI.tsx +2 -1
- package/src/components/floatUI/types.ts +1 -0
- package/src/components/forms/date/datePicker/DatePicker.tsx +11 -1
- package/src/components/forms/date/datePicker/styles/DatePicker.scss +10 -0
- package/src/components/forms/date/datePicker/types.ts +8 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +30 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +15 -1
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +51 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +24 -2
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +58 -0
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +31 -2
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +59 -0
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +40 -5
- package/src/components/forms/input/Input.tsx +3 -0
- package/src/components/forms/textarea/Textarea.tsx +3 -0
- package/src/components/forms/timePicker/TimePicker.tsx +39 -1
- package/src/components/forms/timePicker/__tests__/TimePicker.test.tsx +4 -2
- package/src/storybook/formArgTypes.ts +14 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FloatUIProps } from './types';
|
|
2
|
-
export declare function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal, portalOptions, floatingOptions, }: FloatUIProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal, portalOptions, floatingOptions, className, }: FloatUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CustomComponents, DateRange, DayEventHandler, Formatters, Matcher, Mode, MonthChangeEventHandler, OnSelectHandler } from 'react-day-picker';
|
|
2
2
|
export interface DatePickerProps {
|
|
3
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
3
4
|
selected?: Date | DateRange | undefined;
|
|
4
5
|
onSelect?: OnSelectHandler<Date> | OnSelectHandler<DateRange>;
|
|
5
6
|
mode?: Mode;
|
|
@@ -27,6 +28,9 @@ export interface DatePickerProps {
|
|
|
27
28
|
onNextClick?: MonthChangeEventHandler;
|
|
28
29
|
onPrevClick?: MonthChangeEventHandler;
|
|
29
30
|
onDayClick?: DayEventHandler<React.MouseEvent>;
|
|
31
|
+
isReadOnly?: boolean;
|
|
32
|
+
timeTabIndex?: number;
|
|
33
|
+
dateTabIndex?: number;
|
|
30
34
|
}
|
|
31
35
|
export interface CommonProps {
|
|
32
36
|
className?: string;
|
|
@@ -49,3 +53,6 @@ export interface CommonProps {
|
|
|
49
53
|
onPrevClick?: MonthChangeEventHandler;
|
|
50
54
|
onDayClick?: DayEventHandler<React.MouseEvent>;
|
|
51
55
|
}
|
|
56
|
+
export interface PortalOptions {
|
|
57
|
+
rootId?: string;
|
|
58
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { DateRange, Mode } from 'react-day-picker';
|
|
2
2
|
import { IconName, IconSizes } from '../../../icons/types';
|
|
3
|
+
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
4
|
+
import { PortalOptions } from '../datePicker/types';
|
|
3
5
|
interface Props {
|
|
4
6
|
mode?: Mode;
|
|
5
7
|
ariaLabel: string;
|
|
@@ -17,6 +19,9 @@ interface Props {
|
|
|
17
19
|
className?: string;
|
|
18
20
|
initialMonth?: Date;
|
|
19
21
|
'data-testid'?: string;
|
|
22
|
+
portalOptions?: PortalOptions;
|
|
23
|
+
isPortal?: boolean;
|
|
24
|
+
floatingOptions?: UseFloatingOptions;
|
|
20
25
|
}
|
|
21
26
|
export declare const IconTriggerDatePicker: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
27
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { IconName } from '../../../icons/types';
|
|
2
|
+
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
3
|
+
import { PortalOptions } from '../datePicker/types';
|
|
2
4
|
export interface SingleInputDatePickerProps {
|
|
3
5
|
ariaLabel: string;
|
|
4
6
|
disableBeforeDate?: Date;
|
|
@@ -19,5 +21,11 @@ export interface SingleInputDatePickerProps {
|
|
|
19
21
|
errorMessage?: string | undefined;
|
|
20
22
|
hasHiddenLabel?: boolean;
|
|
21
23
|
'data-testid'?: string;
|
|
24
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
25
|
+
isReadOnly?: boolean;
|
|
26
|
+
tabIndex?: number;
|
|
27
|
+
portalOptions?: PortalOptions;
|
|
28
|
+
floatingOptions?: UseFloatingOptions;
|
|
29
|
+
isPortal?: boolean;
|
|
22
30
|
}
|
|
23
31
|
export declare function SingleInputDatePicker(props: SingleInputDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { IconName } from '../../../icons/types';
|
|
2
2
|
import { DateRange } from 'react-day-picker';
|
|
3
|
+
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
4
|
+
import { PortalOptions } from '../datePicker/types';
|
|
3
5
|
interface InputDateRangePickerProps {
|
|
4
6
|
ariaLabel: string;
|
|
5
7
|
disableBeforeDate?: Date;
|
|
@@ -24,6 +26,14 @@ interface InputDateRangePickerProps {
|
|
|
24
26
|
closeOnSelect?: boolean;
|
|
25
27
|
clearOnClose?: boolean;
|
|
26
28
|
hasHiddenLabel?: boolean;
|
|
29
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
30
|
+
isFromReadOnly?: boolean;
|
|
31
|
+
isToReadOnly?: boolean;
|
|
32
|
+
toTabIndex?: number;
|
|
33
|
+
fromTabIndex?: number;
|
|
34
|
+
portalOptions?: PortalOptions;
|
|
35
|
+
floatingOptions?: UseFloatingOptions;
|
|
36
|
+
isPortal?: boolean;
|
|
27
37
|
}
|
|
28
38
|
export declare function InputDateRangePicker(props: InputDateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
29
39
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { IconName } from '../../../icons/types';
|
|
2
|
+
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
3
|
+
import { PortalOptions } from '../datePicker/types';
|
|
2
4
|
export interface SingleInputDateTimePickerProps {
|
|
3
5
|
ariaLabel: string;
|
|
4
6
|
disableBeforeDate?: Date;
|
|
@@ -21,5 +23,13 @@ export interface SingleInputDateTimePickerProps {
|
|
|
21
23
|
hasHiddenLabel?: boolean;
|
|
22
24
|
timeValue?: string;
|
|
23
25
|
onTimeChange?: (time: string) => void;
|
|
26
|
+
isReadOnly?: boolean;
|
|
27
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
28
|
+
timePickerRef?: React.LegacyRef<HTMLInputElement>;
|
|
29
|
+
dateTabIndex?: number;
|
|
30
|
+
timeTabIndex?: number;
|
|
31
|
+
portalOptions?: PortalOptions;
|
|
32
|
+
floatingOptions?: UseFloatingOptions;
|
|
33
|
+
isPortal?: boolean;
|
|
24
34
|
}
|
|
25
35
|
export declare function SingleInputDateTimePicker(props: SingleInputDateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -17,6 +17,7 @@ export interface TextareaProps extends LabelProps {
|
|
|
17
17
|
maxLength?: number;
|
|
18
18
|
autofocus?: boolean;
|
|
19
19
|
defaultValue?: string;
|
|
20
|
+
tabIndex?: number;
|
|
20
21
|
}
|
|
21
22
|
declare const LabeledTextarea: React.ForwardRefExoticComponent<Omit<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement> & LabelProps, "ref"> & React.RefAttributes<any>>;
|
|
22
23
|
export { LabeledTextarea as Textarea };
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
interface TimePickerProps {
|
|
2
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
2
3
|
timeValue?: string;
|
|
3
4
|
label?: string;
|
|
4
5
|
name?: string;
|
|
5
6
|
hasHiddenLabel?: boolean;
|
|
6
7
|
onTimeChange?: (time: string) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
isReadOnly?: boolean;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
tabIndex?: number;
|
|
12
|
+
[key: string]: unknown;
|
|
7
13
|
}
|
|
8
|
-
export declare const TimePicker: ({ timeValue, label, name, hasHiddenLabel, onTimeChange, }: TimePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const TimePicker: ({ ref, timeValue, label, name, hasHiddenLabel, onTimeChange, className, isDisabled, isReadOnly, tabIndex, ...rest }: TimePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
15
|
export {};
|
package/lib/index.css
CHANGED
|
@@ -2235,6 +2235,16 @@ body div[class*=select__single-value] {
|
|
|
2235
2235
|
width: 348px;
|
|
2236
2236
|
}
|
|
2237
2237
|
|
|
2238
|
+
.time-validation-error {
|
|
2239
|
+
background-color: var(--pf-tooltip-background-color);
|
|
2240
|
+
color: var(--pf-tooltip-font-color);
|
|
2241
|
+
padding: var(--pf-padding-2);
|
|
2242
|
+
border-radius: var(--pf-rounded);
|
|
2243
|
+
width: 200px;
|
|
2244
|
+
box-shadow: var(--pf-dropshadow);
|
|
2245
|
+
font-size: var(--pf-font-size-overline);
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2238
2248
|
:root [data-theme=light] {
|
|
2239
2249
|
--pf-badge-background-color: var(--pf-page-background-color);
|
|
2240
2250
|
--pf-badge-font-color: var(--pf-font-color);
|
package/lib/index.d.ts
CHANGED
|
@@ -284,6 +284,7 @@ interface BaseInputProps {
|
|
|
284
284
|
isClearable?: boolean;
|
|
285
285
|
className?: string;
|
|
286
286
|
defaultValue?: string;
|
|
287
|
+
tabIndex?: number;
|
|
287
288
|
}
|
|
288
289
|
interface InputProps extends BaseInputProps, LabelProps {
|
|
289
290
|
}
|
|
@@ -345,6 +346,7 @@ interface TextareaProps extends LabelProps {
|
|
|
345
346
|
maxLength?: number;
|
|
346
347
|
autofocus?: boolean;
|
|
347
348
|
defaultValue?: string;
|
|
349
|
+
tabIndex?: number;
|
|
348
350
|
}
|
|
349
351
|
declare const LabeledTextarea: React$1.ForwardRefExoticComponent<Omit<Omit<TextareaProps, "ref"> & React$1.RefAttributes<HTMLTextAreaElement> & LabelProps, "ref"> & React$1.RefAttributes<any>>;
|
|
350
352
|
|
|
@@ -372,6 +374,7 @@ interface SelectProps<OptionType extends SelectOption> extends Props$4<OptionTyp
|
|
|
372
374
|
declare const LabeledSelect: React$1.ForwardRefExoticComponent<SelectProps<SelectOption> & LabelProps & React$1.RefAttributes<any>>;
|
|
373
375
|
|
|
374
376
|
interface DatePickerProps {
|
|
377
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
375
378
|
selected?: Date | DateRange | undefined;
|
|
376
379
|
onSelect?: OnSelectHandler<Date> | OnSelectHandler<DateRange>;
|
|
377
380
|
mode?: Mode;
|
|
@@ -399,18 +402,30 @@ interface DatePickerProps {
|
|
|
399
402
|
onNextClick?: MonthChangeEventHandler;
|
|
400
403
|
onPrevClick?: MonthChangeEventHandler;
|
|
401
404
|
onDayClick?: DayEventHandler<React.MouseEvent>;
|
|
405
|
+
isReadOnly?: boolean;
|
|
406
|
+
timeTabIndex?: number;
|
|
407
|
+
dateTabIndex?: number;
|
|
408
|
+
}
|
|
409
|
+
interface PortalOptions {
|
|
410
|
+
rootId?: string;
|
|
402
411
|
}
|
|
403
412
|
|
|
404
413
|
declare const DatePicker: (props: DatePickerProps) => react_jsx_runtime.JSX.Element;
|
|
405
414
|
|
|
406
415
|
interface TimePickerProps {
|
|
416
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
407
417
|
timeValue?: string;
|
|
408
418
|
label?: string;
|
|
409
419
|
name?: string;
|
|
410
420
|
hasHiddenLabel?: boolean;
|
|
411
421
|
onTimeChange?: (time: string) => void;
|
|
422
|
+
className?: string;
|
|
423
|
+
isReadOnly?: boolean;
|
|
424
|
+
isDisabled?: boolean;
|
|
425
|
+
tabIndex?: number;
|
|
426
|
+
[key: string]: unknown;
|
|
412
427
|
}
|
|
413
|
-
declare const TimePicker: ({ timeValue, label, name, hasHiddenLabel, onTimeChange, }: TimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
428
|
+
declare const TimePicker: ({ ref, timeValue, label, name, hasHiddenLabel, onTimeChange, className, isDisabled, isReadOnly, tabIndex, ...rest }: TimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
414
429
|
|
|
415
430
|
interface Props$3 {
|
|
416
431
|
mode?: Mode;
|
|
@@ -429,6 +444,9 @@ interface Props$3 {
|
|
|
429
444
|
className?: string;
|
|
430
445
|
initialMonth?: Date;
|
|
431
446
|
'data-testid'?: string;
|
|
447
|
+
portalOptions?: PortalOptions;
|
|
448
|
+
isPortal?: boolean;
|
|
449
|
+
floatingOptions?: UseFloatingOptions;
|
|
432
450
|
}
|
|
433
451
|
declare const IconTriggerDatePicker: (props: Props$3) => react_jsx_runtime.JSX.Element;
|
|
434
452
|
|
|
@@ -452,6 +470,12 @@ interface SingleInputDatePickerProps {
|
|
|
452
470
|
errorMessage?: string | undefined;
|
|
453
471
|
hasHiddenLabel?: boolean;
|
|
454
472
|
'data-testid'?: string;
|
|
473
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
474
|
+
isReadOnly?: boolean;
|
|
475
|
+
tabIndex?: number;
|
|
476
|
+
portalOptions?: PortalOptions;
|
|
477
|
+
floatingOptions?: UseFloatingOptions;
|
|
478
|
+
isPortal?: boolean;
|
|
455
479
|
}
|
|
456
480
|
declare function SingleInputDatePicker(props: SingleInputDatePickerProps): react_jsx_runtime.JSX.Element;
|
|
457
481
|
|
|
@@ -479,6 +503,14 @@ interface InputDateRangePickerProps {
|
|
|
479
503
|
closeOnSelect?: boolean;
|
|
480
504
|
clearOnClose?: boolean;
|
|
481
505
|
hasHiddenLabel?: boolean;
|
|
506
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
507
|
+
isFromReadOnly?: boolean;
|
|
508
|
+
isToReadOnly?: boolean;
|
|
509
|
+
toTabIndex?: number;
|
|
510
|
+
fromTabIndex?: number;
|
|
511
|
+
portalOptions?: PortalOptions;
|
|
512
|
+
floatingOptions?: UseFloatingOptions;
|
|
513
|
+
isPortal?: boolean;
|
|
482
514
|
}
|
|
483
515
|
declare function InputDateRangePicker(props: InputDateRangePickerProps): react_jsx_runtime.JSX.Element;
|
|
484
516
|
|
|
@@ -504,6 +536,14 @@ interface SingleInputDateTimePickerProps {
|
|
|
504
536
|
hasHiddenLabel?: boolean;
|
|
505
537
|
timeValue?: string;
|
|
506
538
|
onTimeChange?: (time: string) => void;
|
|
539
|
+
isReadOnly?: boolean;
|
|
540
|
+
ref?: React.LegacyRef<HTMLInputElement>;
|
|
541
|
+
timePickerRef?: React.LegacyRef<HTMLInputElement>;
|
|
542
|
+
dateTabIndex?: number;
|
|
543
|
+
timeTabIndex?: number;
|
|
544
|
+
portalOptions?: PortalOptions;
|
|
545
|
+
floatingOptions?: UseFloatingOptions;
|
|
546
|
+
isPortal?: boolean;
|
|
507
547
|
}
|
|
508
548
|
declare function SingleInputDateTimePicker(props: SingleInputDateTimePickerProps): react_jsx_runtime.JSX.Element;
|
|
509
549
|
|
|
@@ -544,6 +584,7 @@ type FloatUIProps = {
|
|
|
544
584
|
ariaLabel: string;
|
|
545
585
|
floatingOptions?: UseFloatingOptions;
|
|
546
586
|
isOpen?: boolean;
|
|
587
|
+
className?: string;
|
|
547
588
|
isPortal?: boolean;
|
|
548
589
|
portalOptions?: {
|
|
549
590
|
rootId?: string;
|
|
@@ -551,7 +592,7 @@ type FloatUIProps = {
|
|
|
551
592
|
setIsOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
552
593
|
};
|
|
553
594
|
|
|
554
|
-
declare function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal, portalOptions, floatingOptions, }: FloatUIProps): react_jsx_runtime.JSX.Element;
|
|
595
|
+
declare function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal, portalOptions, floatingOptions, className, }: FloatUIProps): react_jsx_runtime.JSX.Element;
|
|
555
596
|
|
|
556
597
|
type MenuProps = {
|
|
557
598
|
children: React$1.ReactNode;
|
package/lib/index.esm.css
CHANGED
|
@@ -2235,6 +2235,16 @@ body div[class*=select__single-value] {
|
|
|
2235
2235
|
width: 348px;
|
|
2236
2236
|
}
|
|
2237
2237
|
|
|
2238
|
+
.time-validation-error {
|
|
2239
|
+
background-color: var(--pf-tooltip-background-color);
|
|
2240
|
+
color: var(--pf-tooltip-font-color);
|
|
2241
|
+
padding: var(--pf-padding-2);
|
|
2242
|
+
border-radius: var(--pf-rounded);
|
|
2243
|
+
width: 200px;
|
|
2244
|
+
box-shadow: var(--pf-dropshadow);
|
|
2245
|
+
font-size: var(--pf-font-size-overline);
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2238
2248
|
:root [data-theme=light] {
|
|
2239
2249
|
--pf-badge-background-color: var(--pf-page-background-color);
|
|
2240
2250
|
--pf-badge-font-color: var(--pf-font-color);
|