@oslokommune/punkt-react 16.25.1 → 16.26.3
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/CHANGELOG.md +28 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +1 -1
- package/dist/components/accordion/Accordion.d.ts +21 -0
- package/dist/components/accordion/Accordion.test.d.ts +0 -0
- package/dist/components/accordion/AccordionItem.d.ts +17 -0
- package/dist/components/alert/Alert.d.ts +14 -0
- package/dist/components/alert/Alert.test.d.ts +0 -0
- package/dist/components/backlink/BackLink.d.ts +14 -0
- package/dist/components/backlink/BackLink.test.d.ts +0 -0
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +16 -0
- package/dist/components/breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/dist/components/button/Button.d.ts +24 -0
- package/dist/components/button/Button.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.accessibility.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.constraints.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.core.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.d.ts +3 -0
- package/dist/components/calendar/Calendar.interaction.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.selection.test.d.ts +0 -0
- package/dist/components/calendar/CalendarGrid.d.ts +4 -0
- package/dist/components/calendar/CalendarNav.d.ts +2 -0
- package/dist/components/calendar/calendar-utils.d.ts +20 -0
- package/dist/components/calendar/types.d.ts +104 -0
- package/dist/components/calendar/useCalendarState.d.ts +2 -0
- package/dist/components/card/Card.d.ts +37 -0
- package/dist/components/card/Card.test.d.ts +0 -0
- package/dist/components/checkbox/Checkbox.d.ts +23 -0
- package/dist/components/checkbox/Checkbox.test.d.ts +0 -0
- package/dist/components/combobox/Combobox.accessibility.test.d.ts +0 -0
- package/dist/components/combobox/Combobox.core.test.d.ts +0 -0
- package/dist/components/combobox/Combobox.d.ts +3 -0
- package/dist/components/combobox/Combobox.interaction.test.d.ts +0 -0
- package/dist/components/combobox/Combobox.selection.test.d.ts +0 -0
- package/dist/components/combobox/ComboboxInput.d.ts +6 -0
- package/dist/components/combobox/ComboboxTags.d.ts +11 -0
- package/dist/components/combobox/Listbox.d.ts +6 -0
- package/dist/components/combobox/types.d.ts +104 -0
- package/dist/components/combobox/useComboboxState.d.ts +2 -0
- package/dist/components/consent/Consent.d.ts +51 -0
- package/dist/components/consent/Consent.test.d.ts +0 -0
- package/dist/components/consent/strings.d.ts +85 -0
- package/dist/components/datepicker/DateTags.d.ts +10 -0
- package/dist/components/datepicker/Datepicker.accessibility.test.d.ts +0 -0
- package/dist/components/datepicker/Datepicker.core.test.d.ts +0 -0
- package/dist/components/datepicker/Datepicker.d.ts +3 -0
- package/dist/components/datepicker/Datepicker.input.test.d.ts +0 -0
- package/dist/components/datepicker/Datepicker.selection.test.d.ts +0 -0
- package/dist/components/datepicker/Datepicker.validation.test.d.ts +0 -0
- package/dist/components/datepicker/DatepickerInputs.d.ts +4 -0
- package/dist/components/datepicker/DatepickerPopup.d.ts +21 -0
- package/dist/components/datepicker/types.d.ts +109 -0
- package/dist/components/datepicker/useDatepickerState.d.ts +2 -0
- package/dist/components/fileupload/DropZone.d.ts +42 -0
- package/dist/components/fileupload/FileUpload.d.ts +84 -0
- package/dist/components/fileupload/FileUpload.test.d.ts +0 -0
- package/dist/components/fileupload/QueueDisplay.d.ts +19 -0
- package/dist/components/fileupload/QueueDisplay.test.d.ts +0 -0
- package/dist/components/fileupload/QueueItemContent.d.ts +44 -0
- package/dist/components/fileupload/Subcomponents.d.ts +36 -0
- package/dist/components/fileupload/Truncate.d.ts +20 -0
- package/dist/components/fileupload/Truncate.test.d.ts +0 -0
- package/dist/components/fileupload/extensions/Comments.d.ts +6 -0
- package/dist/components/fileupload/extensions/Remove.d.ts +2 -0
- package/dist/components/fileupload/extensions/Rename.d.ts +2 -0
- package/dist/components/fileupload/hooks/index.d.ts +4 -0
- package/dist/components/fileupload/hooks/useFileAttributes.d.ts +10 -0
- package/dist/components/fileupload/hooks/useImagePreview.d.ts +9 -0
- package/dist/components/fileupload/hooks/useOperationState.d.ts +6 -0
- package/dist/components/fileupload/hooks/useRequiredFormValidation.d.ts +16 -0
- package/dist/components/fileupload/hooks.d.ts +4 -0
- package/dist/components/fileupload/types.d.ts +88 -0
- package/dist/components/fileupload/utils.d.ts +5 -0
- package/dist/components/footer/Footer.d.ts +36 -0
- package/dist/components/footer/Footer.test.d.ts +0 -0
- package/dist/components/footerSimple/FooterSimple.d.ts +21 -0
- package/dist/components/footerSimple/FooterSimple.test.d.ts +0 -0
- package/dist/components/header/Header.d.ts +15 -0
- package/dist/components/header/Header.test.d.ts +0 -0
- package/dist/components/header/HeaderService.d.ts +9 -0
- package/dist/components/header/HeaderService.test.d.ts +0 -0
- package/dist/components/header/types.d.ts +93 -0
- package/dist/components/header-menu/HeaderMenu.d.ts +26 -0
- package/dist/components/header-menu/HeaderMenu.test.d.ts +0 -0
- package/dist/components/headerUserMenu/UserMenu.d.ts +11 -0
- package/dist/components/headerUserMenu/UserMenu.test.d.ts +0 -0
- package/dist/components/heading/Heading.d.ts +14 -0
- package/dist/components/heading/Heading.test.d.ts +0 -0
- package/dist/components/helptext/Helptext.d.ts +9 -0
- package/dist/components/helptext/Helptext.test.d.ts +0 -0
- package/dist/components/icon/Icon.d.ts +10 -0
- package/dist/components/icon/Icon.test.d.ts +9 -0
- package/dist/components/index.d.ts +50 -0
- package/dist/components/input/Input.d.ts +21 -0
- package/dist/components/inputwrapper/InputWrapper.d.ts +28 -0
- package/dist/components/interfaces.d.ts +30 -0
- package/dist/components/link/Link.d.ts +17 -0
- package/dist/components/link/Link.test.d.ts +1 -0
- package/dist/components/linkcard/LinkCard.d.ts +14 -0
- package/dist/components/linkcard/LinkCard.test.d.ts +0 -0
- package/dist/components/loader/Loader.d.ts +41 -0
- package/dist/components/loader/Loader.test.d.ts +0 -0
- package/dist/components/messagebox/Messagebox.d.ts +11 -0
- package/dist/components/messagebox/Messagebox.test.d.ts +1 -0
- package/dist/components/modal/Modal.d.ts +17 -0
- package/dist/components/modal/Modal.test.d.ts +0 -0
- package/dist/components/progressbar/Progressbar.d.ts +21 -0
- package/dist/components/progressbar/Progressbar.test.d.ts +0 -0
- package/dist/components/radio/RadioButton.d.ts +20 -0
- package/dist/components/radio/RadioButton.test.d.ts +0 -0
- package/dist/components/searchinput/SearchInput.d.ts +36 -0
- package/dist/components/searchinput/SearchInput.test.d.ts +0 -0
- package/dist/components/select/Select.d.ts +30 -0
- package/dist/components/select/Select.test.d.ts +0 -0
- package/dist/components/stepper/Step.d.ts +21 -0
- package/dist/components/stepper/Stepper.d.ts +32 -0
- package/dist/components/stepper/Stepper.test.d.ts +0 -0
- package/dist/components/table/Table.d.ts +11 -0
- package/dist/components/table/Table.test.d.ts +0 -0
- package/dist/components/table/TableBody.d.ts +7 -0
- package/dist/components/table/TableData.d.ts +7 -0
- package/dist/components/table/TableDataCell.d.ts +8 -0
- package/dist/components/table/TableHeader.d.ts +7 -0
- package/dist/components/table/TableHeaderCell.d.ts +7 -0
- package/dist/components/table/TableRow.d.ts +7 -0
- package/dist/components/tabs/TabItem.d.ts +15 -0
- package/dist/components/tabs/Tabs.d.ts +33 -0
- package/dist/components/tabs/Tabs.test.d.ts +0 -0
- package/dist/components/tag/Tag.d.ts +24 -0
- package/dist/components/tag/Tag.test.d.ts +0 -0
- package/dist/components/textarea/Textarea.d.ts +35 -0
- package/dist/components/textarea/Textarea.test.d.ts +0 -0
- package/dist/components/textinput/Textinput.d.ts +44 -0
- package/dist/components/textinput/Textinput.test.d.ts +0 -0
- package/dist/components/timepicker/Timepicker.d.ts +3 -0
- package/dist/components/timepicker/Timepicker.test.d.ts +0 -0
- package/dist/components/timepicker/types.d.ts +81 -0
- package/dist/components/timepicker/useTimepickerState.d.ts +58 -0
- package/dist/components/types.d.ts +2 -0
- package/dist/index.d.ts +1 -1366
- package/dist/punkt-react.cjs +1 -1
- package/dist/punkt-react.js +698 -684
- package/package.json +33 -32
- package/src/components/calendar/types.ts +1 -1
- package/src/components/card/Card.tsx +1 -1
- package/src/components/combobox/types.ts +5 -5
- package/src/components/datepicker/types.ts +5 -5
- package/src/components/fileupload/FileUpload.tsx +1 -1
- package/src/components/fileupload/Subcomponents.tsx +1 -1
- package/src/components/fileupload/Truncate.tsx +1 -1
- package/src/components/fileupload/hooks/useRequiredFormValidation.ts +1 -1
- package/src/components/header/HeaderService.tsx +1 -1
- package/src/components/tabs/Tabs.tsx +1 -0
- package/src/components/tag/Tag.tsx +1 -1
- package/src/components/timepicker/Timepicker.tsx +1 -2
- package/src/components/timepicker/types.ts +2 -5
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { TAriaLive, TProgressbarRole, TProgressbarSkin, TProgressbarStatusPlacement, TProgressbarStatusType, TProgressbarTitlePosition } from '../../shared-types';
|
|
3
|
+
export type { TProgressbarRole, TProgressbarSkin, TProgressbarStatusPlacement, TProgressbarStatusType, TProgressbarTitlePosition };
|
|
4
|
+
export interface IPktProgressbar extends Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'title'> {
|
|
5
|
+
ariaLabel?: string | null;
|
|
6
|
+
ariaLabelledby?: string | null;
|
|
7
|
+
ariaLive?: TAriaLive;
|
|
8
|
+
ariaValueText?: string | null;
|
|
9
|
+
id?: string;
|
|
10
|
+
role?: TProgressbarRole;
|
|
11
|
+
skin?: TProgressbarSkin;
|
|
12
|
+
statusPlacement?: TProgressbarStatusPlacement;
|
|
13
|
+
statusType?: TProgressbarStatusType;
|
|
14
|
+
title?: string | null;
|
|
15
|
+
titlePosition?: TProgressbarTitlePosition;
|
|
16
|
+
valueCurrent: number;
|
|
17
|
+
valueMax?: number;
|
|
18
|
+
valueMin?: number;
|
|
19
|
+
ref?: Ref<HTMLDivElement>;
|
|
20
|
+
}
|
|
21
|
+
export declare const PktProgressbar: import('react').ForwardRefExoticComponent<Omit<IPktProgressbar, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ChangeEventHandler, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface IPktRadioButton extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
hasTile?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
checkHelptext?: ReactNode | ReactNode[] | string;
|
|
9
|
+
defaultChecked?: boolean;
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
hasError?: boolean;
|
|
12
|
+
value?: string;
|
|
13
|
+
optionalTag?: boolean;
|
|
14
|
+
optionalText?: string;
|
|
15
|
+
requiredTag?: boolean;
|
|
16
|
+
requiredText?: string;
|
|
17
|
+
tagText?: string | null;
|
|
18
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
19
|
+
}
|
|
20
|
+
export declare const PktRadioButton: import('react').ForwardRefExoticComponent<IPktRadioButton & import('react').RefAttributes<HTMLInputElement>>;
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ChangeEvent, HTMLProps, ReactNode } from 'react';
|
|
2
|
+
import { IPktSearchInputSuggestion } from '../../shared-types/searchinput';
|
|
3
|
+
/**
|
|
4
|
+
* React suggestion item: portable fields from {@link IPktSearchInputSuggestion}
|
|
5
|
+
* plus optional rich content and per-row handler.
|
|
6
|
+
*/
|
|
7
|
+
export type PktSearchInputSuggestion = Omit<IPktSearchInputSuggestion, 'title' | 'text'> & {
|
|
8
|
+
title?: string | ReactNode;
|
|
9
|
+
text?: string | ReactNode;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
};
|
|
12
|
+
interface ISearch extends HTMLProps<HTMLInputElement> {
|
|
13
|
+
appearance?: 'local' | 'local-with-button' | 'global';
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
fullwidth?: boolean;
|
|
16
|
+
id: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
suggestions?: PktSearchInputSuggestion[];
|
|
21
|
+
value?: string | undefined;
|
|
22
|
+
onSearch?: (value: string) => void;
|
|
23
|
+
onSuggestionClick?: (index: number) => void;
|
|
24
|
+
action?: string;
|
|
25
|
+
method?: 'get' | 'post' | 'dialog';
|
|
26
|
+
}
|
|
27
|
+
interface ISearchForm extends ISearch {
|
|
28
|
+
action?: string;
|
|
29
|
+
method?: 'get' | 'post' | 'dialog';
|
|
30
|
+
}
|
|
31
|
+
interface ISearchInput extends ISearch {
|
|
32
|
+
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare const PktSearchInput: import('react').ForwardRefExoticComponent<(Omit<ISearchForm, "ref"> | Omit<ISearchInput, "ref">) & import('react').RefAttributes<HTMLInputElement>>;
|
|
36
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode, SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { TSelectOption } from '../../shared-types';
|
|
3
|
+
export type { TSelectOption };
|
|
4
|
+
export interface IPktSelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
5
|
+
ariaDescribedby?: string;
|
|
6
|
+
ariaLabelledby?: string;
|
|
7
|
+
children?: ReactNode | ReactNode[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
errorMessage?: string | ReactNode | ReactNode[];
|
|
10
|
+
hasError?: boolean;
|
|
11
|
+
helptext?: string | ReactNode | ReactNode[];
|
|
12
|
+
helptextDropdown?: string | ReactNode | ReactNode[];
|
|
13
|
+
helptextDropdownButton?: string;
|
|
14
|
+
id: string;
|
|
15
|
+
inline?: boolean;
|
|
16
|
+
fullwidth?: boolean;
|
|
17
|
+
label: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
optionalTag?: boolean;
|
|
20
|
+
optionalText?: string;
|
|
21
|
+
requiredTag?: boolean;
|
|
22
|
+
requiredText?: string;
|
|
23
|
+
tagText?: string | null;
|
|
24
|
+
options?: Array<{
|
|
25
|
+
value: string;
|
|
26
|
+
label: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
export declare const PktSelect: import('react').ForwardRefExoticComponent<IPktSelectProps & import('react').RefAttributes<HTMLSelectElement>>;
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type TStepStatus = 'completed' | 'incomplete' | 'current';
|
|
3
|
+
export interface IPktStep {
|
|
4
|
+
/**
|
|
5
|
+
* Step content. Can be a string, a React component or an element.
|
|
6
|
+
*/
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional class names
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Step status. Can be 'completed', 'incomplete' or 'current'
|
|
14
|
+
*/
|
|
15
|
+
status: TStepStatus;
|
|
16
|
+
/**
|
|
17
|
+
* Title of the step
|
|
18
|
+
*/
|
|
19
|
+
title: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const PktStep: ({ children, className, status, title }: IPktStep) => import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactElement } from 'react';
|
|
2
|
+
import { IPktStep } from './Step';
|
|
3
|
+
export interface IPktStepper extends HTMLAttributes<HTMLOListElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The index of the current active step
|
|
6
|
+
*/
|
|
7
|
+
activeStep: number;
|
|
8
|
+
/**
|
|
9
|
+
* Children of the Stepper must be Step items. Either an Array of Step items or a single Step item.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactElement<IPktStep>[] | ReactElement<IPktStep>;
|
|
12
|
+
/**
|
|
13
|
+
* Additional class names
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Boolean to hide the content of non-active steps content
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
hideNonActiveStepsContent?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Boolean to hide the content and title of non-active steps
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
hideNonActiveSteps?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Orientation of the stepper.
|
|
28
|
+
* @default vertical
|
|
29
|
+
*/
|
|
30
|
+
orientation?: 'horizontal' | 'vertical';
|
|
31
|
+
}
|
|
32
|
+
export declare const PktStepper: import('react').ForwardRefExoticComponent<IPktStepper & import('react').RefAttributes<HTMLOListElement>>;
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type TTableSkin = 'basic' | 'zebra-blue';
|
|
3
|
+
interface ITableProps extends HTMLAttributes<HTMLTableElement> {
|
|
4
|
+
compact?: boolean;
|
|
5
|
+
skin?: 'basic' | 'zebra-blue';
|
|
6
|
+
responsiveView?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const PktTable: ({ className, compact, skin, responsiveView, children, ...props }: ITableProps) => import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface ITableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const PktTableBody: ({ id, children, className, ...props }: ITableBodyProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface TableDataProps extends HTMLAttributes<HTMLTableCellElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
children: ReactNode | ReactNode[];
|
|
5
|
+
}
|
|
6
|
+
export declare const PktTableData: ({ children, className, ...props }: TableDataProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface ITableDataCellProps extends HTMLAttributes<HTMLTableCellElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
dataLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const PktTableDataCell: ({ children, className, dataLabel, ...props }: ITableDataCellProps) => import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface ITableHeaderProps extends HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const PktTableHeader: ({ className, children, ...props }: ITableHeaderProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface ITableHeaderCellProps extends HTMLAttributes<HTMLTableCellElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const PktTableHeaderCell: ({ className, children, ...props }: ITableHeaderCellProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface ITableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const PktTableRow: ({ className, children, ...props }: ITableRowProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { TTagSkin } from '../../shared-types';
|
|
3
|
+
export interface IPktTabItem {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
href?: string;
|
|
8
|
+
onClick?: (event: MouseEvent) => void;
|
|
9
|
+
icon?: string;
|
|
10
|
+
controls?: string;
|
|
11
|
+
tag?: string;
|
|
12
|
+
tagSkin?: TTagSkin;
|
|
13
|
+
index?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const PktTabItem: import('react').ForwardRefExoticComponent<IPktTabItem & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { KeyboardEvent, ReactNode } from 'react';
|
|
2
|
+
import { TTagSkin } from '../../shared-types';
|
|
3
|
+
interface ITabsContext {
|
|
4
|
+
arrowNav: boolean;
|
|
5
|
+
registerTabRef: (index: number, el: HTMLAnchorElement | HTMLButtonElement | null, disabled?: boolean) => void;
|
|
6
|
+
handleKeyPress: (index: number, event: KeyboardEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
7
|
+
selectTab: (index: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const useTabsContext: () => ITabsContext;
|
|
10
|
+
export interface IPktTab {
|
|
11
|
+
text: string;
|
|
12
|
+
href?: string;
|
|
13
|
+
action?: (index: number) => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
icon?: string;
|
|
16
|
+
controls?: string;
|
|
17
|
+
tag?: {
|
|
18
|
+
text: string;
|
|
19
|
+
skin: TTagSkin | undefined;
|
|
20
|
+
};
|
|
21
|
+
active?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface IPktTabs {
|
|
24
|
+
arrowNav?: boolean;
|
|
25
|
+
disableArrowNav?: boolean;
|
|
26
|
+
separatorIconName?: string;
|
|
27
|
+
separatorIconPath?: string;
|
|
28
|
+
tabs?: IPktTab[];
|
|
29
|
+
onTabSelected?: (index: number) => void;
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export declare const PktTabs: import('react').ForwardRefExoticComponent<IPktTabs & import('react').RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export { PktTabItem } from './TabItem';
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { TTagSkin } from '../../shared-types';
|
|
3
|
+
interface BasePktTagProps {
|
|
4
|
+
skin?: TTagSkin;
|
|
5
|
+
textStyle?: 'normal-text' | 'thin-text';
|
|
6
|
+
size?: 'small' | 'medium' | 'large';
|
|
7
|
+
closeTag?: boolean;
|
|
8
|
+
iconName?: string;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
interface ButtonPktTagProps extends BasePktTagProps, HTMLAttributes<HTMLButtonElement> {
|
|
14
|
+
closeTag: true;
|
|
15
|
+
type?: 'button' | 'submit' | 'reset';
|
|
16
|
+
}
|
|
17
|
+
interface SpanPktTagProps extends BasePktTagProps, HTMLAttributes<HTMLSpanElement> {
|
|
18
|
+
closeTag?: false | undefined;
|
|
19
|
+
onClose?: undefined;
|
|
20
|
+
type?: undefined;
|
|
21
|
+
}
|
|
22
|
+
export type IPktTag = ButtonPktTagProps | SpanPktTagProps;
|
|
23
|
+
export declare const PktTag: import('react').ForwardRefExoticComponent<(ButtonPktTagProps | SpanPktTagProps) & import('react').RefAttributes<HTMLSpanElement | HTMLButtonElement>>;
|
|
24
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ChangeEventHandler, ReactNode, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export interface IPktTextarea extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
id: string;
|
|
4
|
+
ariaDescribedby?: string;
|
|
5
|
+
ariaLabelledby?: string;
|
|
6
|
+
counter?: boolean;
|
|
7
|
+
counterMaxLength?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
errorMessage?: string | ReactNode | ReactNode[];
|
|
10
|
+
hasError?: boolean;
|
|
11
|
+
helptext?: string | ReactNode | ReactNode[];
|
|
12
|
+
helptextDropdown?: string | ReactNode | ReactNode[];
|
|
13
|
+
helptextDropdownButton?: string;
|
|
14
|
+
inline?: boolean;
|
|
15
|
+
fullwidth?: boolean;
|
|
16
|
+
label: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
optionalTag?: boolean;
|
|
19
|
+
optionalText?: string;
|
|
20
|
+
requiredTag?: boolean;
|
|
21
|
+
requiredText?: string;
|
|
22
|
+
tagText?: string | null;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
rows?: number;
|
|
25
|
+
useWrapper?: boolean;
|
|
26
|
+
value?: string;
|
|
27
|
+
autocomplete?: string;
|
|
28
|
+
minLength?: number;
|
|
29
|
+
maxLength?: number;
|
|
30
|
+
readOnly?: boolean;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
skipForwardTestid?: boolean;
|
|
33
|
+
onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
34
|
+
}
|
|
35
|
+
export declare const PktTextarea: import('react').ForwardRefExoticComponent<IPktTextarea & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ChangeEventHandler, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface IPktTextinput extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
id: string;
|
|
4
|
+
ariaDescribedby?: string;
|
|
5
|
+
ariaLabelledby?: string;
|
|
6
|
+
autocomplete?: string;
|
|
7
|
+
counter?: boolean;
|
|
8
|
+
counterMaxLength?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
errorMessage?: string | ReactNode | ReactNode[];
|
|
11
|
+
hasError?: boolean;
|
|
12
|
+
helptext?: string | ReactNode | ReactNode[];
|
|
13
|
+
helptextDropdown?: string | ReactNode | ReactNode[];
|
|
14
|
+
helptextDropdownButton?: string;
|
|
15
|
+
iconNameRight?: string;
|
|
16
|
+
inline?: boolean;
|
|
17
|
+
fullwidth?: boolean;
|
|
18
|
+
label: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
optionalTag?: boolean;
|
|
21
|
+
optionalText?: string;
|
|
22
|
+
requiredTag?: boolean;
|
|
23
|
+
requiredText?: string;
|
|
24
|
+
tagText?: string | null;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
prefix?: string;
|
|
27
|
+
suffix?: string;
|
|
28
|
+
type?: string;
|
|
29
|
+
useWrapper?: boolean;
|
|
30
|
+
value?: string;
|
|
31
|
+
omitSearchIcon?: boolean;
|
|
32
|
+
min?: number | string;
|
|
33
|
+
max?: number | string;
|
|
34
|
+
minLength?: number;
|
|
35
|
+
maxLength?: number;
|
|
36
|
+
step?: string;
|
|
37
|
+
size?: number;
|
|
38
|
+
readonly?: boolean;
|
|
39
|
+
required?: boolean;
|
|
40
|
+
dataTestid?: string;
|
|
41
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
42
|
+
skipForwardTestid?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare const PktTextinput: import('react').ForwardRefExoticComponent<IPktTextinput & import('react').RefAttributes<HTMLInputElement>>;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ChangeEvent, FocusEvent, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ITimepickerStrings } from '../../shared-types/timepicker';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link PktTimepicker}: a React time picker with `HH:MM`, aligned with Elements `pkt-timepicker`.
|
|
5
|
+
*
|
|
6
|
+
* The value is submitted via a hidden `input type="time"`; hour/minute fields are the editing UI. Use `value`
|
|
7
|
+
* or `defaultValue` for controlled vs. uncontrolled mode.
|
|
8
|
+
*/
|
|
9
|
+
export interface IPktTimepicker extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'onInput' | 'min' | 'max' | 'step' | 'onFocus' | 'onBlur'> {
|
|
10
|
+
/** Unique id; used for hour, minute, popup, and hidden input ids. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Visible label (InputWrapper). */
|
|
13
|
+
label: string;
|
|
14
|
+
/** Controlled value (`HH:MM`). */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** Initial value when the component is uncontrolled. */
|
|
17
|
+
defaultValue?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Earliest valid time (`HH:MM`). May be a number or string (HTML attribute / RHF).
|
|
20
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time}
|
|
21
|
+
*/
|
|
22
|
+
min?: string | number;
|
|
23
|
+
/**
|
|
24
|
+
* Latest valid time (`HH:MM`). May be a number or string (HTML attribute / RHF).
|
|
25
|
+
*/
|
|
26
|
+
max?: string | number;
|
|
27
|
+
/**
|
|
28
|
+
* Step in **seconds** (e.g. `60` = 1 min, `300` = 5 min). Must be a valid multiple (same rules as Elements).
|
|
29
|
+
* @default 60
|
|
30
|
+
*/
|
|
31
|
+
step?: number;
|
|
32
|
+
/** Hides the clock button and popup; shows a static clock icon. */
|
|
33
|
+
hidePicker?: boolean;
|
|
34
|
+
/** Shows previous/next step buttons instead of the popup. */
|
|
35
|
+
stepArrows?: boolean;
|
|
36
|
+
/** Full width (`pkt-timepicker--fullwidth`). */
|
|
37
|
+
fullwidth?: boolean;
|
|
38
|
+
/** Form field name on the hidden `input`; falls back to `id` if omitted. */
|
|
39
|
+
name?: string;
|
|
40
|
+
/** Help text above the field. */
|
|
41
|
+
helptext?: string | ReactNode;
|
|
42
|
+
/** Expandable help text (dropdown). */
|
|
43
|
+
helptextDropdown?: string | ReactNode;
|
|
44
|
+
/** Button label for expandable help text. */
|
|
45
|
+
helptextDropdownButton?: string;
|
|
46
|
+
/** Forces error state on the wrapper. */
|
|
47
|
+
hasError?: boolean;
|
|
48
|
+
/** Error message below the field. */
|
|
49
|
+
errorMessage?: string | ReactNode;
|
|
50
|
+
/** Shows an "optional" tag. */
|
|
51
|
+
optionalTag?: boolean;
|
|
52
|
+
/** Label text for the optional tag. */
|
|
53
|
+
optionalText?: string;
|
|
54
|
+
/** Shows a "required" tag. */
|
|
55
|
+
requiredTag?: boolean;
|
|
56
|
+
/** Label text for the required tag. */
|
|
57
|
+
requiredText?: string;
|
|
58
|
+
/** Extra tag next to the label. */
|
|
59
|
+
tagText?: string | null;
|
|
60
|
+
/** Inline layout in InputWrapper. */
|
|
61
|
+
inline?: boolean;
|
|
62
|
+
/** Show visible label and help text (`false` = screen-reader-only label). */
|
|
63
|
+
useWrapper?: boolean;
|
|
64
|
+
/** Passed through to InputWrapper as `aria-describedby`. */
|
|
65
|
+
ariaDescribedby?: string;
|
|
66
|
+
/** Copy for hours, minutes, buttons, and popup. */
|
|
67
|
+
strings?: ITimepickerStrings;
|
|
68
|
+
/** Change event from the hidden input (`e.target.value` is `HH:MM`). In React, `onChange` already fires on input. */
|
|
69
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
70
|
+
/** Callback with the committed `HH:MM` string. */
|
|
71
|
+
onValueChange?: (value: string) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Fires when focus enters this control from outside (not when moving only between hour and minute).
|
|
74
|
+
* Implemented on the root wrapper; spinbuttons must allow focus to bubble so this runs.
|
|
75
|
+
*/
|
|
76
|
+
onFocus?: (e: FocusEvent<Element>) => void;
|
|
77
|
+
/** Focus leaves the whole component. */
|
|
78
|
+
onBlur?: (e: FocusEvent<Element>) => void;
|
|
79
|
+
/** Extra class names on the root (`pkt-timepicker`). */
|
|
80
|
+
className?: string;
|
|
81
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
import { IPktTimepicker } from './types';
|
|
3
|
+
export declare function useTimepickerState(props: IPktTimepicker, ref: React.ForwardedRef<HTMLDivElement>): {
|
|
4
|
+
id: string;
|
|
5
|
+
containerRef: import('react').RefObject<HTMLDivElement | null>;
|
|
6
|
+
outerClasses: string;
|
|
7
|
+
strings: import('../../../../../shared-types').ITimepickerStrings;
|
|
8
|
+
label: string;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
required: boolean;
|
|
11
|
+
helptext: import('react').ReactNode;
|
|
12
|
+
helptextDropdown: import('react').ReactNode;
|
|
13
|
+
helptextDropdownButton: string | undefined;
|
|
14
|
+
hasError: boolean;
|
|
15
|
+
isInvalid: boolean;
|
|
16
|
+
errorMessage: import('react').ReactNode;
|
|
17
|
+
optionalTag: boolean;
|
|
18
|
+
optionalText: string | undefined;
|
|
19
|
+
requiredTag: boolean;
|
|
20
|
+
requiredText: string | undefined;
|
|
21
|
+
tagText: string | null | undefined;
|
|
22
|
+
inline: boolean;
|
|
23
|
+
useWrapper: boolean;
|
|
24
|
+
ariaDescribedby: string | undefined;
|
|
25
|
+
hidePicker: boolean;
|
|
26
|
+
stepArrows: boolean;
|
|
27
|
+
min: string | number | undefined;
|
|
28
|
+
max: string | number | undefined;
|
|
29
|
+
step: number;
|
|
30
|
+
hours: string;
|
|
31
|
+
minutes: string;
|
|
32
|
+
hoursId: string;
|
|
33
|
+
minutesId: string;
|
|
34
|
+
popupId: string;
|
|
35
|
+
hiddenInputId: string;
|
|
36
|
+
name: string;
|
|
37
|
+
isOpen: boolean;
|
|
38
|
+
hourOptions: number[];
|
|
39
|
+
minuteOptions: number[];
|
|
40
|
+
hoursInputRef: import('react').RefObject<HTMLInputElement | null>;
|
|
41
|
+
minutesInputRef: import('react').RefObject<HTMLInputElement | null>;
|
|
42
|
+
buttonRef: import('react').RefObject<HTMLButtonElement | null>;
|
|
43
|
+
popupRef: import('react').RefObject<HTMLDivElement | null>;
|
|
44
|
+
changeInputRef: import('react').RefObject<HTMLInputElement | null>;
|
|
45
|
+
handleHoursKeydown: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
46
|
+
handleHoursBlur: () => void;
|
|
47
|
+
handleMinutesKeydown: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
48
|
+
handleMinutesBlur: () => void;
|
|
49
|
+
handlePopupKeydown: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
50
|
+
handlePopupFocusOut: (e: React.FocusEvent<HTMLDivElement>) => void;
|
|
51
|
+
handleFocusIn: (e: React.FocusEvent<HTMLDivElement>) => void;
|
|
52
|
+
handleFocusOut: (e: React.FocusEvent<HTMLDivElement>) => void;
|
|
53
|
+
handleOptionClick: (optionValue: number, type: "hour" | "minute") => void;
|
|
54
|
+
handleClockButtonClick: () => void;
|
|
55
|
+
closePopup: () => void;
|
|
56
|
+
stepTimeDelta: (direction: 1 | -1) => void;
|
|
57
|
+
effectiveValue: string;
|
|
58
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { FileItem } from './fileupload/types';
|
|
2
|
+
export type { TFileAndTransfer, TFileAttribute, TFileAttributes, TFileId, TFileItemList, TFileTransfer, TItemRenderer, TQueueItemOperation, TQueueOperationContext, TTransferItemInProgress, TUploadStrategy, } from './fileupload/types';
|