@navikt/ds-react 2.1.1-next.1 → 2.1.2
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/_docs.json +480 -312
- package/esm/accordion/Accordion.d.ts +17 -0
- package/esm/accordion/AccordionContent.d.ts +10 -0
- package/esm/accordion/AccordionHeader.d.ts +10 -0
- package/esm/accordion/AccordionItem.d.ts +26 -0
- package/esm/accordion/index.d.ts +1 -0
- package/esm/alert/Alert.d.ts +31 -0
- package/esm/alert/index.d.ts +2 -0
- package/esm/button/Button.d.ts +39 -0
- package/esm/button/index.d.ts +2 -0
- package/esm/chat/Bubble.d.ts +26 -0
- package/esm/chat/Chat.d.ts +43 -0
- package/esm/chat/index.d.ts +1 -0
- package/esm/chips/Chips.d.ts +17 -0
- package/esm/chips/Removable.d.ts +23 -0
- package/esm/chips/Toggle.d.ts +13 -0
- package/esm/chips/index.d.ts +1 -0
- package/esm/date/DateInput.d.ts +25 -0
- package/esm/date/datepicker/DatePicker.d.ts +97 -0
- package/esm/date/datepicker/DatePickerStandalone.d.ts +12 -0
- package/esm/date/datepicker/DayButton.d.ts +3 -0
- package/esm/date/datepicker/Head.d.ts +3 -0
- package/esm/date/datepicker/caption/Caption.d.ts +4 -0
- package/esm/date/datepicker/caption/DropdownCaption.d.ts +4 -0
- package/esm/date/datepicker/caption/index.d.ts +2 -0
- package/esm/date/hooks/index.d.ts +8 -0
- package/esm/date/hooks/useDateInputContext.d.ts +18 -0
- package/esm/date/hooks/useDatepicker.d.ts +73 -0
- package/esm/date/hooks/useMonthPicker.d.ts +68 -0
- package/esm/date/hooks/useRangeDatepicker.d.ts +58 -0
- package/esm/date/hooks/useSharedMonthContext.d.ts +21 -0
- package/esm/date/index.d.ts +6 -0
- package/esm/date/monthpicker/MonthButton.d.ts +11 -0
- package/esm/date/monthpicker/MonthCaption.d.ts +3 -0
- package/esm/date/monthpicker/MonthPicker.d.ts +92 -0
- package/esm/date/monthpicker/MonthPickerStandalone.d.ts +11 -0
- package/esm/date/monthpicker/MonthSelector.d.ts +3 -0
- package/esm/date/utils/check-dates.d.ts +4 -0
- package/esm/date/utils/dates-disabled.d.ts +1 -0
- package/esm/date/utils/format-date.d.ts +1 -0
- package/esm/date/utils/get-dates.d.ts +2 -0
- package/esm/date/utils/get-initial-year.d.ts +5 -0
- package/esm/date/utils/index.d.ts +10 -0
- package/esm/date/utils/is-match.d.ts +4 -0
- package/esm/date/utils/labels.d.ts +6 -0
- package/esm/date/utils/locale.d.ts +2 -0
- package/esm/date/utils/navigation.d.ts +2 -0
- package/esm/date/utils/parse-date.d.ts +3 -0
- package/esm/form/ConfirmationPanel.d.ts +22 -0
- package/esm/form/Fieldset/Fieldset.d.ts +42 -0
- package/esm/form/Fieldset/index.d.ts +1 -0
- package/esm/form/Fieldset/useFieldset.d.ts +14 -0
- package/esm/form/Select.d.ts +26 -0
- package/esm/form/Switch.d.ts +27 -0
- package/esm/form/TextField.d.ts +31 -0
- package/esm/form/Textarea.d.ts +48 -0
- package/esm/form/checkbox/Checkbox.d.ts +36 -0
- package/esm/form/checkbox/CheckboxGroup.d.ts +28 -0
- package/esm/form/checkbox/index.d.ts +2 -0
- package/esm/form/checkbox/useCheckbox.d.ts +21 -0
- package/esm/form/error-summary/ErrorSummary.d.ts +27 -0
- package/esm/form/error-summary/ErrorSummaryItem.d.ts +11 -0
- package/esm/form/error-summary/index.d.ts +2 -0
- package/esm/form/index.d.ts +10 -0
- package/esm/form/radio/Radio.d.ts +18 -0
- package/esm/form/radio/RadioGroup.d.ts +38 -0
- package/esm/form/radio/index.d.ts +2 -0
- package/esm/form/radio/useRadio.d.ts +23 -0
- package/esm/form/search/Search.d.ts +57 -0
- package/esm/form/search/SearchButton.d.ts +11 -0
- package/esm/form/search/index.d.ts +1 -0
- package/esm/form/useFormField.d.ts +44 -0
- package/esm/grid/Cell.d.ts +26 -0
- package/esm/grid/ContentContainer.d.ts +9 -0
- package/esm/grid/Grid.d.ts +9 -0
- package/esm/grid/index.d.ts +3 -0
- package/esm/guide-panel/Guide.d.ts +14 -0
- package/esm/guide-panel/GuidePanel.d.ts +18 -0
- package/esm/guide-panel/Illustration.d.ts +8 -0
- package/esm/guide-panel/index.d.ts +3 -0
- package/esm/help-text/HelpText.d.ts +17 -0
- package/esm/help-text/index.d.ts +2 -0
- package/esm/index.d.ts +27 -0
- package/esm/link/Link.d.ts +10 -0
- package/esm/link/index.d.ts +2 -0
- package/esm/link-panel/LinkPanel.d.ts +22 -0
- package/esm/link-panel/LinkPanelDescription.d.ts +7 -0
- package/esm/link-panel/LinkPanelTitle.d.ts +8 -0
- package/esm/link-panel/index.d.ts +2 -0
- package/esm/loader/Loader.d.ts +27 -0
- package/esm/loader/index.d.ts +2 -0
- package/esm/modal/Modal.d.ts +63 -0
- package/esm/modal/ModalContent.d.ts +10 -0
- package/esm/modal/index.d.ts +2 -0
- package/esm/pagination/Pagination.d.ts +53 -0
- package/esm/pagination/PaginationItem.d.ts +22 -0
- package/esm/pagination/index.d.ts +1 -0
- package/esm/panel/Panel.d.ts +16 -0
- package/esm/panel/index.d.ts +2 -0
- package/esm/popover/Popover.d.ts +47 -0
- package/esm/popover/PopoverContent.d.ts +10 -0
- package/esm/popover/index.d.ts +2 -0
- package/esm/provider/Provider.d.ts +20 -0
- package/esm/provider/index.d.ts +1 -0
- package/esm/read-more/ReadMore.d.ts +28 -0
- package/esm/read-more/index.d.ts +2 -0
- package/esm/stepper/Step.d.ts +28 -0
- package/esm/stepper/Stepper.d.ts +41 -0
- package/esm/stepper/index.d.ts +1 -0
- package/esm/table/Body.d.ts +7 -0
- package/esm/table/ColumnHeader.d.ts +17 -0
- package/esm/table/DataCell.d.ts +12 -0
- package/esm/table/ExpandableRow.d.ts +41 -0
- package/esm/table/Header.d.ts +7 -0
- package/esm/table/HeaderCell.d.ts +13 -0
- package/esm/table/Row.d.ts +17 -0
- package/esm/table/Table.d.ts +49 -0
- package/esm/table/index.d.ts +8 -0
- package/esm/tabs/Tab.d.ts +19 -0
- package/esm/tabs/TabList.d.ts +10 -0
- package/esm/tabs/TabPanel.d.ts +14 -0
- package/esm/tabs/Tabs.d.ts +52 -0
- package/esm/tabs/index.d.ts +4 -0
- package/esm/tag/Tag.d.ts +14 -0
- package/esm/tag/index.d.ts +1 -0
- package/esm/toggle-group/ToggleGroup.d.ts +38 -0
- package/esm/toggle-group/ToggleItem.d.ts +14 -0
- package/esm/toggle-group/index.d.ts +2 -0
- package/esm/tooltip/Tooltip.d.ts +53 -0
- package/esm/tooltip/index.d.ts +1 -0
- package/esm/typography/BodyLong.d.ts +19 -0
- package/esm/typography/BodyShort.d.ts +19 -0
- package/esm/typography/Detail.d.ts +22 -0
- package/esm/typography/ErrorMessage.d.ts +19 -0
- package/esm/typography/Heading.d.ts +24 -0
- package/esm/typography/Ingress.d.ts +14 -0
- package/esm/typography/Label.d.ts +19 -0
- package/esm/typography/index.d.ts +7 -0
- package/esm/util/AnimateHeight.d.ts +10 -0
- package/esm/util/OverridableComponent.d.ts +7 -0
- package/esm/util/TextareaAutoSize.d.ts +14 -0
- package/esm/util/debounce.d.ts +4 -0
- package/esm/util/index.d.ts +13 -0
- package/esm/util/mergeRefs.d.ts +2 -0
- package/esm/util/useId.d.ts +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import { PopoverContentType } from "./PopoverContent";
|
|
3
|
+
export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Popover content
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Element popover anchors to
|
|
10
|
+
*/
|
|
11
|
+
anchorEl: Element | null;
|
|
12
|
+
/**
|
|
13
|
+
* Open state
|
|
14
|
+
*/
|
|
15
|
+
open: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* onClose callback
|
|
18
|
+
*/
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Orientation for popover
|
|
22
|
+
* @note Try to keep general usage to "top", "bottom", "left", "right"
|
|
23
|
+
* @default "top"
|
|
24
|
+
*/
|
|
25
|
+
placement?: "top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end";
|
|
26
|
+
/**
|
|
27
|
+
* Adds a arrow from dialog to anchor when true
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
arrow?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Distance from anchor to popover
|
|
33
|
+
* @default 16 w/arrow, 4 w/no-arrow
|
|
34
|
+
*/
|
|
35
|
+
offset?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Changes what CSS position property to use
|
|
38
|
+
* You want to use "fixed" if reference element is inside a fixed container, but popover is not
|
|
39
|
+
* @default "absolute"
|
|
40
|
+
*/
|
|
41
|
+
strategy?: "absolute" | "fixed";
|
|
42
|
+
}
|
|
43
|
+
interface PopoverComponent extends React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>> {
|
|
44
|
+
Content: PopoverContentType;
|
|
45
|
+
}
|
|
46
|
+
export declare const Popover: PopoverComponent;
|
|
47
|
+
export default Popover;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PopoverContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Modal.Content content
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export type PopoverContentType = React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const PopoverContent: PopoverContentType;
|
|
10
|
+
export default PopoverContent;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ProviderContextType {
|
|
3
|
+
/**
|
|
4
|
+
* Global root-element to attach portals to (Modal, Tooltip)
|
|
5
|
+
*/
|
|
6
|
+
rootElement?: HTMLElement;
|
|
7
|
+
/**
|
|
8
|
+
* Global config for appElement (Modal)
|
|
9
|
+
*/
|
|
10
|
+
appElement?: HTMLElement;
|
|
11
|
+
}
|
|
12
|
+
export declare const ProviderContext: React.Context<ProviderContextType | undefined>;
|
|
13
|
+
export interface ProviderProps {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
rootElement?: HTMLElement;
|
|
16
|
+
appElement?: HTMLElement;
|
|
17
|
+
}
|
|
18
|
+
export declare const useProvider: () => ProviderContextType | undefined;
|
|
19
|
+
export declare const Provider: ({ children, ...rest }: ProviderProps) => JSX.Element;
|
|
20
|
+
export default Provider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Provider, useProvider } from "./Provider";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ReadMoreProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Content inside ReadMore
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* ReadMore header content
|
|
9
|
+
*/
|
|
10
|
+
header: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Opens component if 'true', closes if 'false'
|
|
13
|
+
* Using this props removes automatic control of open-state
|
|
14
|
+
*/
|
|
15
|
+
open?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Defaults the accordion to opened state
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
defaultOpen?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Changes fontsize for content
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
size?: "medium" | "small";
|
|
26
|
+
}
|
|
27
|
+
export declare const ReadMore: React.ForwardRefExoticComponent<ReadMoreProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
export default ReadMore;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface StepperStepProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Text content by indicator
|
|
6
|
+
*/
|
|
7
|
+
children: string;
|
|
8
|
+
/**
|
|
9
|
+
* Handled by Stepper, overwriting may break component logic
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
unsafe_index?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Makes step-indicator a checkmark
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
completed?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Makes step non-interactive if false. Step will be set to a <div>, overriding `as`-prop
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
interactive?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface StepperStepType extends OverridableComponent<StepperStepProps, HTMLAnchorElement> {
|
|
25
|
+
}
|
|
26
|
+
export declare const StepComponent: OverridableComponent<StepperStepProps, HTMLAnchorElement>;
|
|
27
|
+
declare const Step: StepperStepType;
|
|
28
|
+
export default Step;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StepperStepType } from "./Step";
|
|
3
|
+
export interface StepperProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
4
|
+
/**
|
|
5
|
+
* <Stepper.Step /> elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The direction the component grows.
|
|
10
|
+
* @default "vertical"
|
|
11
|
+
*/
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
/**
|
|
14
|
+
* Current active step.
|
|
15
|
+
* @note Stepper index starts at 1, not 0
|
|
16
|
+
*/
|
|
17
|
+
activeStep: number;
|
|
18
|
+
/**
|
|
19
|
+
* Callback for next activeStep
|
|
20
|
+
* @note Stepper index starts at 1, not 0
|
|
21
|
+
*/
|
|
22
|
+
onStepChange?: (step: number) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Makes stepper non-interactive if false
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
interactive?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface StepperComponent extends React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<HTMLOListElement>> {
|
|
30
|
+
Step: StepperStepType;
|
|
31
|
+
}
|
|
32
|
+
interface StepperContextProps {
|
|
33
|
+
activeStep: number;
|
|
34
|
+
onStepChange: (step: number) => void;
|
|
35
|
+
lastIndex: number;
|
|
36
|
+
orientation: "horizontal" | "vertical";
|
|
37
|
+
interactive: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const StepperContext: React.Context<StepperContextProps | null>;
|
|
40
|
+
export declare const Stepper: StepperComponent;
|
|
41
|
+
export default Stepper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Stepper, StepperProps } from "./Stepper";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface BodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
}
|
|
4
|
+
export interface BodyType extends React.ForwardRefExoticComponent<BodyProps & React.RefAttributes<HTMLTableSectionElement>> {
|
|
5
|
+
}
|
|
6
|
+
export declare const Body: BodyType;
|
|
7
|
+
export default Body;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HeaderCellProps } from "./HeaderCell";
|
|
3
|
+
export interface ColumnHeaderProps extends HeaderCellProps {
|
|
4
|
+
/**
|
|
5
|
+
* Key to sort by
|
|
6
|
+
*/
|
|
7
|
+
sortKey?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Column is sortable, adds indicators to show sorting
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
sortable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ColumnHeaderType extends React.ForwardRefExoticComponent<ColumnHeaderProps & React.RefAttributes<HTMLTableCellElement>> {
|
|
15
|
+
}
|
|
16
|
+
export declare const ColumnHeader: ColumnHeaderType;
|
|
17
|
+
export default ColumnHeader;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DataCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Content alignment inside cell
|
|
5
|
+
* @default "left"
|
|
6
|
+
*/
|
|
7
|
+
align?: "left" | "center" | "right";
|
|
8
|
+
}
|
|
9
|
+
export interface DataCellType extends React.ForwardRefExoticComponent<DataCellProps & React.RefAttributes<HTMLTableCellElement>> {
|
|
10
|
+
}
|
|
11
|
+
export declare const DataCell: DataCellType;
|
|
12
|
+
export default DataCell;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { RowProps } from "./Row";
|
|
3
|
+
export interface ExpandableRowProps extends RowProps {
|
|
4
|
+
/**
|
|
5
|
+
* Content of the expanded row
|
|
6
|
+
*/
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Placement of toggle button
|
|
10
|
+
* @default "left"
|
|
11
|
+
*/
|
|
12
|
+
togglePlacement?: "left" | "right";
|
|
13
|
+
/**
|
|
14
|
+
* Opens component if 'true', closes if 'false'
|
|
15
|
+
* Using this props removes automatic control of open-state
|
|
16
|
+
*/
|
|
17
|
+
open?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Opened state default
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Change handler for open
|
|
25
|
+
*/
|
|
26
|
+
onOpenChange?: (open: boolean) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Disable expansio
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
expansionDisabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The width of the expanded row's internal cell
|
|
34
|
+
* @default 999
|
|
35
|
+
*/
|
|
36
|
+
colSpan?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface ExpandableRowType extends React.ForwardRefExoticComponent<ExpandableRowProps & React.RefAttributes<HTMLTableRowElement>> {
|
|
39
|
+
}
|
|
40
|
+
export declare const ExpandableRow: ExpandableRowType;
|
|
41
|
+
export default ExpandableRow;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface HeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
}
|
|
4
|
+
export interface HeaderType extends React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<HTMLTableSectionElement>> {
|
|
5
|
+
}
|
|
6
|
+
export declare const Header: HeaderType;
|
|
7
|
+
export default Header;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface HeaderCellProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
3
|
+
scope?: string;
|
|
4
|
+
/**
|
|
5
|
+
* Content alignment inside cell
|
|
6
|
+
* @default "left"
|
|
7
|
+
*/
|
|
8
|
+
align?: "left" | "center" | "right";
|
|
9
|
+
}
|
|
10
|
+
export interface HeaderCellType extends React.ForwardRefExoticComponent<HeaderCellProps & React.RefAttributes<HTMLTableCellElement>> {
|
|
11
|
+
}
|
|
12
|
+
export declare const HeaderCell: HeaderCellType;
|
|
13
|
+
export default HeaderCell;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Row is selected
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Shade the table row on hover.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
shadeOnHover?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface RowType extends React.ForwardRefExoticComponent<RowProps & React.RefAttributes<HTMLTableRowElement>> {
|
|
15
|
+
}
|
|
16
|
+
export declare const Row: RowType;
|
|
17
|
+
export default Row;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HeaderType } from "./Header";
|
|
3
|
+
import { BodyType } from "./Body";
|
|
4
|
+
import { RowType } from "./Row";
|
|
5
|
+
import { ColumnHeaderType } from "./ColumnHeader";
|
|
6
|
+
import { HeaderCellType } from "./HeaderCell";
|
|
7
|
+
import { DataCellType } from "./DataCell";
|
|
8
|
+
import { ExpandableRowType } from "./ExpandableRow";
|
|
9
|
+
export interface SortState {
|
|
10
|
+
orderBy: string;
|
|
11
|
+
direction: "ascending" | "descending";
|
|
12
|
+
}
|
|
13
|
+
export interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
14
|
+
/**
|
|
15
|
+
* Changes padding
|
|
16
|
+
* @default "medium"
|
|
17
|
+
*/
|
|
18
|
+
size?: "medium" | "small";
|
|
19
|
+
/**
|
|
20
|
+
* Zebra striped table
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
zebraStripes?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Sort state
|
|
26
|
+
*/
|
|
27
|
+
sort?: SortState;
|
|
28
|
+
/**
|
|
29
|
+
* Callback whens sort state changes
|
|
30
|
+
*/
|
|
31
|
+
onSortChange?: (sortKey?: string) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface TableType extends React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>> {
|
|
34
|
+
Header: HeaderType;
|
|
35
|
+
Body: BodyType;
|
|
36
|
+
Row: RowType;
|
|
37
|
+
DataCell: DataCellType;
|
|
38
|
+
HeaderCell: HeaderCellType;
|
|
39
|
+
ColumnHeader: ColumnHeaderType;
|
|
40
|
+
ExpandableRow: ExpandableRowType;
|
|
41
|
+
}
|
|
42
|
+
export interface TableContextProps {
|
|
43
|
+
size: "medium" | "small";
|
|
44
|
+
onSortChange?: (sortKey: string) => void;
|
|
45
|
+
sort?: SortState;
|
|
46
|
+
}
|
|
47
|
+
export declare const TableContext: React.Context<TableContextProps | null>;
|
|
48
|
+
export declare const Table: TableType;
|
|
49
|
+
export default Table;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { BodyProps } from "./Body";
|
|
2
|
+
export { ColumnHeaderProps } from "./ColumnHeader";
|
|
3
|
+
export { DataCellProps } from "./DataCell";
|
|
4
|
+
export { ExpandableRowProps } from "./ExpandableRow";
|
|
5
|
+
export { HeaderProps } from "./Header";
|
|
6
|
+
export { HeaderCellProps } from "./HeaderCell";
|
|
7
|
+
export { RowProps } from "./Row";
|
|
8
|
+
export { default as Table, TableProps, SortState } from "./Table";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface TabProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, "children"> {
|
|
4
|
+
/**
|
|
5
|
+
* Tab label
|
|
6
|
+
*/
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Tab Icon
|
|
10
|
+
*/
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Value for state-handling
|
|
14
|
+
*/
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
export type TabType = OverridableComponent<TabProps, HTMLButtonElement>;
|
|
18
|
+
export declare const Tab: TabType;
|
|
19
|
+
export default Tab;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TabListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* <Tabs.Tab /> elements
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export type TabListType = React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const TabList: TabListType;
|
|
10
|
+
export default TabList;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Tab panel content
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Value for state-handling
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
export type TabPanelType = React.ForwardRefExoticComponent<TabPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const TabPanel: TabPanelType;
|
|
14
|
+
export default TabPanel;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import { TabType } from "./Tab";
|
|
3
|
+
import { TabListType } from "./TabList";
|
|
4
|
+
import { TabPanelType } from "./TabPanel";
|
|
5
|
+
export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "dir"> {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Changes padding and font-size
|
|
9
|
+
* @default "medium"
|
|
10
|
+
*/
|
|
11
|
+
size?: "medium" | "small";
|
|
12
|
+
/**
|
|
13
|
+
* onChange callback for selected Tab
|
|
14
|
+
*/
|
|
15
|
+
onChange?: (value: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Controlled selected value
|
|
18
|
+
*/
|
|
19
|
+
value?: string;
|
|
20
|
+
/**
|
|
21
|
+
* If not controlled, a default-value needs to be set
|
|
22
|
+
*/
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Automatically activates tab on focus/navigation
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
selectionFollowsFocus?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Loops back to start when navigating past last item
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
loop?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Icon position in Tab
|
|
36
|
+
* @default "left"
|
|
37
|
+
*/
|
|
38
|
+
iconPosition?: "left" | "top";
|
|
39
|
+
}
|
|
40
|
+
interface TabsComponent extends React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>> {
|
|
41
|
+
Tab: TabType;
|
|
42
|
+
List: TabListType;
|
|
43
|
+
Panel: TabPanelType;
|
|
44
|
+
}
|
|
45
|
+
interface TabsContextProps {
|
|
46
|
+
size: "medium" | "small";
|
|
47
|
+
loop: boolean;
|
|
48
|
+
iconPosition: "left" | "top";
|
|
49
|
+
}
|
|
50
|
+
export declare const TabsContext: React.Context<TabsContextProps | null>;
|
|
51
|
+
export declare const Tabs: TabsComponent;
|
|
52
|
+
export default Tabs;
|
package/esm/tag/Tag.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Changes visual profile of tag
|
|
6
|
+
*/
|
|
7
|
+
variant: "warning" | "warning-filled" | "error" | "error-filled" | "info" | "info-filled" | "success" | "success-filled" | "neutral" | "neutral-filled" | "alt1" | "alt1-filled" | "alt2" | "alt2-filled" | "alt3" | "alt3-filled";
|
|
8
|
+
/**
|
|
9
|
+
* @default "medium"
|
|
10
|
+
*/
|
|
11
|
+
size?: "medium" | "small" | "xsmall";
|
|
12
|
+
}
|
|
13
|
+
export declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLSpanElement>>;
|
|
14
|
+
export default Tag;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Tag, TagProps } from "./Tag";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import { ToggleItemType } from "./ToggleItem";
|
|
3
|
+
export interface ToggleGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "dir"> {
|
|
4
|
+
/**
|
|
5
|
+
* Toggles.Item elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Changes padding and font-size
|
|
10
|
+
* @default "medium"
|
|
11
|
+
*/
|
|
12
|
+
size?: "medium" | "small";
|
|
13
|
+
/**
|
|
14
|
+
* Controlled selected value
|
|
15
|
+
*/
|
|
16
|
+
value?: string;
|
|
17
|
+
/**
|
|
18
|
+
* If not controlled, a default-value needs to be set
|
|
19
|
+
*/
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Callback for selected toggle
|
|
23
|
+
*/
|
|
24
|
+
onChange: (value: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Label describing ToggleGroup
|
|
27
|
+
*/
|
|
28
|
+
label?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
interface ToggleGroupComponent extends React.ForwardRefExoticComponent<ToggleGroupProps & React.RefAttributes<HTMLDivElement>> {
|
|
31
|
+
Item: ToggleItemType;
|
|
32
|
+
}
|
|
33
|
+
interface ToggleContextProps {
|
|
34
|
+
size: "medium" | "small";
|
|
35
|
+
}
|
|
36
|
+
export declare const ToggleGroupContext: React.Context<ToggleContextProps | null>;
|
|
37
|
+
export declare const ToggleGroup: ToggleGroupComponent;
|
|
38
|
+
export default ToggleGroup;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ToggleItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Content
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Value for state-handling
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
export type ToggleItemType = React.ForwardRefExoticComponent<ToggleItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
declare const ToggleItem: ToggleItemType;
|
|
14
|
+
export default ToggleItem;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Element tooltip anchors to
|
|
5
|
+
* @note Needs to be React.ReactElement, does not support multiple children/react fragment
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
8
|
+
/**
|
|
9
|
+
* Open state for contolled tooltip
|
|
10
|
+
*/
|
|
11
|
+
open?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Tells tooltip to start in open state.
|
|
14
|
+
* Use sparingly synce hover/focus on other elements will close it
|
|
15
|
+
* @note "open"-prop overwrites this
|
|
16
|
+
*/
|
|
17
|
+
defaultOpen?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Orientation for tooltip
|
|
20
|
+
* @default "top"
|
|
21
|
+
*/
|
|
22
|
+
placement?: "top" | "right" | "bottom" | "left";
|
|
23
|
+
/**
|
|
24
|
+
* Toggles rendering of arrow
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
arrow?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Distance from anchor to tooltip
|
|
30
|
+
* @default 10px with arrow, 2px without arrow
|
|
31
|
+
*/
|
|
32
|
+
offset?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Text-content inside tooltip
|
|
35
|
+
*/
|
|
36
|
+
content: string;
|
|
37
|
+
/**
|
|
38
|
+
* Sets max allowed character length.
|
|
39
|
+
* @default 80
|
|
40
|
+
*/
|
|
41
|
+
maxChar?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Adds a delay in milliseconds before opening tooltip
|
|
44
|
+
* @default 150
|
|
45
|
+
*/
|
|
46
|
+
delay?: number;
|
|
47
|
+
/**
|
|
48
|
+
* List of Keyboard-keys for shortcuts
|
|
49
|
+
*/
|
|
50
|
+
keys?: string[];
|
|
51
|
+
}
|
|
52
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
export default Tooltip;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Tooltip, TooltipProps } from "./Tooltip";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface BodyLongProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
4
|
+
/**
|
|
5
|
+
* medium: 18px, small: 16px
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*/
|
|
8
|
+
size?: "medium" | "small";
|
|
9
|
+
/**
|
|
10
|
+
* Paragraph text
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Adds margin-bottom
|
|
15
|
+
*/
|
|
16
|
+
spacing?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const BodyLong: OverridableComponent<BodyLongProps, HTMLParagraphElement>;
|
|
19
|
+
export default BodyLong;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface BodyShortProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
4
|
+
/**
|
|
5
|
+
* medium: 18px, small: 16px
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*/
|
|
8
|
+
size?: "medium" | "small";
|
|
9
|
+
/**
|
|
10
|
+
* Paragraph text
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Adds margin-bottom
|
|
15
|
+
*/
|
|
16
|
+
spacing?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const BodyShort: OverridableComponent<BodyShortProps, HTMLParagraphElement>;
|
|
19
|
+
export default BodyShort;
|