uikit-react-public 0.11.24 → 0.17.4
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/README.md +4 -2
- package/dist/components/Accordion/Accordion.Heading.d.ts +4 -4
- package/dist/components/Accordion/Accordion.Panel.d.ts +2 -2
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.stories.d.ts +57 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +107 -1
- package/dist/components/Badge/Badge.d.ts +6 -0
- package/dist/components/Badge/Badge.stories.d.ts +15 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +3 -1
- package/dist/components/Calendar/index.d.ts +1 -1
- package/dist/components/CookieNotice/CookieNotice.d.ts +16 -0
- package/dist/components/CookieNotice/index.d.ts +2 -0
- package/dist/components/Datepicker/Datepicker.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.stories.d.ts +4 -3
- package/dist/components/Datepicker/Datepicker.types.d.ts +4 -5
- package/dist/components/Datepicker/subcomponents/CustomDatepicker.d.ts +4 -1
- package/dist/components/Datepicker/subcomponents/DatepickerInput.d.ts +15 -2
- package/dist/components/Datepicker/subcomponents/Panel.d.ts +1 -1
- package/dist/components/Datepicker/subcomponents/VisibleField.d.ts +6 -1
- package/dist/components/Datepicker/subcomponents/index.d.ts +0 -1
- package/dist/components/Datepicker/utils/index.d.ts +0 -1
- package/dist/components/Dialog/BaseDialog.d.ts +8 -2
- package/dist/components/Dialog/Dialog.d.ts +2 -0
- package/dist/components/FileInput/FileInput.d.ts +8 -0
- package/dist/components/FileInput/FileInput.stories.d.ts +16 -0
- package/dist/components/FileInput/index.d.ts +2 -0
- package/dist/components/Header/Header.d.ts +7 -1
- package/dist/components/Header/Header.stories.d.ts +40 -0
- package/dist/components/Heading/Heading.d.ts +1 -1
- package/dist/components/Link/BaseLink.d.ts +10 -0
- package/dist/components/Link/Link.d.ts +5 -10
- package/dist/components/Link/Link.stories.d.ts +1 -1
- package/dist/components/Link/index.d.ts +1 -1
- package/dist/components/Main/Main.d.ts +21 -0
- package/dist/components/Main/Main.stories.d.ts +15 -0
- package/dist/components/Main/__tests__/Main.test.d.ts +1 -0
- package/dist/components/Main/index.d.ts +2 -0
- package/dist/components/Menu/MenuContent.d.ts +1 -1
- package/dist/components/Menu/MenuItem.d.ts +2 -0
- package/dist/components/Menu/MenuSection.d.ts +1 -1
- package/dist/components/NativeDatepicker/NativeDatepicker.d.ts +3 -0
- package/dist/components/NativeDatepicker/NativeDatepicker.stories.d.ts +36 -0
- package/dist/components/NativeDatepicker/NativeDatepicker.types.d.ts +10 -0
- package/dist/components/NativeDatepicker/index.d.ts +2 -0
- package/dist/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.d.ts +1 -1
- package/dist/components/NativeDatepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts +1 -0
- package/dist/components/NativeDatepicker/utils/index.d.ts +1 -0
- package/dist/components/Search/Search.d.ts +16 -0
- package/dist/components/Search/Search.stories.d.ts +34 -0
- package/dist/components/Search/__tests__/Search.test.d.ts +1 -0
- package/dist/components/Search/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.stories.d.ts +157 -9
- package/dist/components/Select/Select.types.d.ts +66 -32
- package/dist/components/Select/subcomponents/CustomOption.d.ts +1 -1
- package/dist/components/Select/subcomponents/CustomSelect.d.ts +3 -3
- package/dist/components/Select/subcomponents/FilterInput.d.ts +14 -0
- package/dist/components/Select/subcomponents/NativeSelect.d.ts +5 -1
- package/dist/components/Select/subcomponents/Panel.d.ts +1 -1
- package/dist/components/Select/subcomponents/VisibleField.d.ts +6 -4
- package/dist/components/Select/subcomponents/index.d.ts +1 -0
- package/dist/components/StandaloneLink/StandaloneLink.d.ts +12 -0
- package/dist/components/StandaloneLink/StandaloneLink.stories.d.ts +13 -0
- package/dist/components/StandaloneLink/__tests__/StandaloneLink.test.d.ts +1 -0
- package/dist/components/StandaloneLink/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +10 -8
- package/dist/components/Table/Table.stories.d.ts +21 -0
- package/dist/components/Table/Table.types.d.ts +11 -0
- package/dist/components/Table/__tests__/Table.test.d.ts +1 -0
- package/dist/components/Table/index.d.ts +2 -1
- package/dist/components/Table/subcomponents/Body.d.ts +4 -0
- package/dist/components/Table/subcomponents/Cell/Cell.d.ts +12 -0
- package/dist/components/Table/subcomponents/Cell/Cell.stories.d.ts +313 -0
- package/dist/components/Table/subcomponents/Cell/CellContent.d.ts +10 -0
- package/dist/components/Table/subcomponents/Cell/__tests__/Cell.test.d.ts +1 -0
- package/dist/components/Table/subcomponents/Head.d.ts +4 -0
- package/dist/components/Table/subcomponents/HeadCell/HeadCell.d.ts +13 -0
- package/dist/components/Table/subcomponents/HeadCell/HeadCell.stories.d.ts +312 -0
- package/dist/components/Table/subcomponents/HeadCell/HeadCellContent.d.ts +10 -0
- package/dist/components/Table/subcomponents/HeadCell/__tests__/HeadCell.test.d.ts +1 -0
- package/dist/components/Table/subcomponents/Row.d.ts +5 -0
- package/dist/components/Table/subcomponents/SortIcon.d.ts +7 -0
- package/dist/components/Table/subcomponents/index.d.ts +10 -0
- package/dist/components/Tabs/Tab.d.ts +1 -1
- package/dist/components/Tabs/TabContext.d.ts +1 -0
- package/dist/components/Tabs/Tabs.d.ts +3 -1
- package/dist/components/Tabs/Tabs.stories.d.ts +3 -0
- package/dist/components/Timepicker/Timepicker.d.ts +10 -0
- package/dist/components/Timepicker/Timepicker.stories.d.ts +7 -0
- package/dist/components/Timepicker/__tests__/Timepicker.test.d.ts +1 -0
- package/dist/components/Timepicker/index.d.ts +2 -0
- package/dist/components/Timepicker/utils/convertDateToTimeString.d.ts +2 -0
- package/dist/components/Timepicker/utils/convertDateToTimeString.test.d.ts +1 -0
- package/dist/components/Timepicker/utils/index.d.ts +1 -0
- package/dist/components/WeekPicker/WeekPicker.d.ts +3 -0
- package/dist/components/WeekPicker/WeekPicker.stories.d.ts +41 -0
- package/dist/components/WeekPicker/WeekPicker.types.d.ts +16 -0
- package/dist/components/WeekPicker/index.d.ts +2 -0
- package/dist/components/WeekPicker/subcomponents/CustomDatepicker.d.ts +17 -0
- package/dist/components/WeekPicker/subcomponents/DatepickerInput.d.ts +13 -0
- package/dist/components/WeekPicker/subcomponents/VisibleField.d.ts +15 -0
- package/dist/components/WeekPicker/subcomponents/index.d.ts +3 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useFocusTrap.d.ts +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6460 -4607
- package/dist/theme/defaultTheme.d.ts +7 -0
- package/dist/theme/useTheme.d.ts +14 -0
- package/dist/utils/__tests__/announce.test.d.ts +1 -0
- package/dist/utils/__tests__/capitalise.test.d.ts +1 -0
- package/dist/utils/announce.d.ts +6 -0
- package/dist/utils/capitalise.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/lib/components/Accordion/Accordion.Heading.tsx +27 -8
- package/lib/components/Accordion/Accordion.Panel.tsx +11 -3
- package/lib/components/Accordion/Accordion.stories.tsx +139 -0
- package/lib/components/Accordion/Accordion.tsx +10 -8
- package/lib/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap +7 -7
- package/lib/components/Accordion/index.ts +2 -0
- package/lib/components/Alert/Alert.stories.tsx +1 -1
- package/lib/components/Alert/Alert.tsx +7 -1
- package/lib/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +4 -0
- package/lib/components/Avatar/Avatar.mdx +117 -0
- package/lib/components/Avatar/Avatar.stories.tsx +110 -2
- package/lib/components/Badge/Badge.stories.tsx +19 -0
- package/lib/components/Badge/Badge.tsx +48 -0
- package/lib/components/Badge/index.ts +2 -0
- package/lib/components/Blanket/Blanket.stories.tsx +1 -1
- package/lib/components/Breadcrumbs/__tests__/__snapshots__/Breadcrumbs.test.tsx.snap +4 -4
- package/lib/components/Button/Button.stories.tsx +1 -1
- package/lib/components/Button/Button.tsx +6 -2
- package/lib/components/Calendar/Calendar.stories.tsx +12 -32
- package/lib/components/Calendar/__tests__/Calendar.test.tsx +23 -15
- package/lib/components/Calendar/index.ts +1 -5
- package/lib/components/Calendar/subcomponents/AcademicWeeks.tsx +2 -1
- package/lib/components/Calendar/subcomponents/ColumnHeading.tsx +5 -1
- package/lib/components/Calendar/subcomponents/EventDot.tsx +2 -1
- package/lib/components/Calendar/subcomponents/Grid.tsx +0 -1
- package/lib/components/Calendar/subcomponents/index.ts +1 -1
- package/lib/components/Calendar/utils/getDatesForCalendarGrid/getDatesForCalendarGrid.ts +43 -11
- package/lib/components/Calendar/utils/normaliseMonth/normaliseMonth.test.ts +5 -5
- package/lib/components/CookieNotice/CookieNotice.tsx +114 -0
- package/lib/components/CookieNotice/index.ts +2 -0
- package/lib/components/Datepicker/Datepicker.lld.md +108 -0
- package/lib/components/Datepicker/Datepicker.stories.tsx +44 -5
- package/lib/components/Datepicker/Datepicker.tsx +14 -36
- package/lib/components/Datepicker/Datepicker.types.ts +5 -14
- package/lib/components/Datepicker/__tests__/Datepicker.test.tsx +150 -8
- package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +10 -4
- package/lib/components/Datepicker/subcomponents/CustomDatepicker.tsx +39 -5
- package/lib/components/Datepicker/subcomponents/DatepickerInput.tsx +30 -17
- package/lib/components/Datepicker/subcomponents/Panel.tsx +6 -2
- package/lib/components/Datepicker/subcomponents/VisibleField.tsx +40 -3
- package/lib/components/Datepicker/subcomponents/index.ts +0 -1
- package/lib/components/Datepicker/utils/index.ts +0 -1
- package/lib/components/Dialog/BaseDialog.tsx +55 -4
- package/lib/components/Dialog/Dialog.tsx +8 -1
- package/lib/components/Dialog/DialogBody.tsx +5 -1
- package/lib/components/Dialog/DialogHeader.tsx +2 -1
- package/lib/components/Divider/Divider.stories.tsx +1 -1
- package/lib/components/Field/ErrorText.tsx +1 -0
- package/lib/components/Field/Field.stories.tsx +1 -1
- package/lib/components/Field/__tests__/Field.test.tsx +161 -148
- package/lib/components/FileInput/FileInput.stories.tsx +70 -0
- package/lib/components/FileInput/FileInput.tsx +68 -0
- package/lib/components/FileInput/__tests__/FileInput.test.tsx +99 -0
- package/lib/components/FileInput/__tests__/__snapshots__/FileInput.test.tsx.snap +91 -0
- package/lib/components/FileInput/index.ts +2 -0
- package/lib/components/Footer/Footer.stories.tsx +1 -1
- package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +28 -28
- package/lib/components/Header/Header.mdx +52 -0
- package/lib/components/Header/Header.stories.tsx +98 -0
- package/lib/components/Header/Header.tsx +65 -3
- package/lib/components/Header/__tests__/Header.test.tsx +17 -1
- package/lib/components/Header/__tests__/__snapshots__/Header.test.tsx.snap +4 -4
- package/lib/components/Heading/Documentation.mdx +1 -1
- package/lib/components/Heading/Heading.stories.tsx +1 -1
- package/lib/components/Heading/Heading.tsx +1 -1
- package/lib/components/Heading/__tests__/Heading.test.tsx +7 -19
- package/lib/components/Heading/__tests__/__snapshots__/Heading.test.tsx.snap +7 -7
- package/lib/components/Icon/Icon.stories.tsx +1 -1
- package/lib/components/IconButton/IconButton.stories.tsx +1 -1
- package/lib/components/Input/Input.stories.tsx +1 -1
- package/lib/components/Label/Label.stories.tsx +1 -1
- package/lib/components/Label/Label.tsx +0 -2
- package/lib/components/Label/__tests__/__snapshots__/Label.test.tsx.snap +7 -7
- package/lib/components/Link/BaseLink.tsx +84 -0
- package/lib/components/Link/Link.tsx +72 -32
- package/lib/components/Link/__tests__/__snapshots__/link.test.tsx.snap +3 -3
- package/lib/components/Link/__tests__/link.test.tsx +6 -13
- package/lib/components/Link/index.ts +1 -1
- package/lib/components/Main/Main.stories.tsx +36 -0
- package/lib/components/Main/Main.tsx +46 -0
- package/lib/components/Main/__tests__/Main.test.tsx +80 -0
- package/lib/components/Main/__tests__/__snapshots__/Main.test.tsx.snap +33 -0
- package/lib/components/Main/index.ts +2 -0
- package/lib/components/Menu/Menu.context.tsx +3 -1
- package/lib/components/Menu/Menu.tsx +2 -2
- package/lib/components/Menu/MenuContent.tsx +5 -5
- package/lib/components/Menu/MenuItem.tsx +20 -3
- package/lib/components/Menu/MenuSection.tsx +4 -3
- package/lib/components/NativeDatepicker/NativeDatepicker.stories.tsx +100 -0
- package/lib/components/{Datepicker/subcomponents → NativeDatepicker}/NativeDatepicker.tsx +14 -15
- package/lib/components/NativeDatepicker/NativeDatepicker.types.ts +19 -0
- package/lib/components/NativeDatepicker/index.ts +2 -0
- package/lib/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.ts +1 -1
- package/lib/components/NativeDatepicker/utils/index.ts +1 -0
- package/lib/components/Pagination/PaginationControls.tsx +56 -15
- package/lib/components/Pagination/PaginationInfo.tsx +5 -1
- package/lib/components/Paragraph/Paragraph.stories.tsx +1 -1
- package/lib/components/Search/Search.stories.tsx +41 -0
- package/lib/components/Search/Search.tsx +170 -0
- package/lib/components/Search/__tests__/Search.test.tsx +112 -0
- package/lib/components/Search/__tests__/__snapshots__/Search.test.tsx.snap +179 -0
- package/lib/components/Search/index.ts +2 -0
- package/lib/components/Select/Select.mdx +169 -0
- package/lib/components/Select/Select.stories.tsx +198 -77
- package/lib/components/Select/Select.tsx +37 -13
- package/lib/components/Select/Select.types.ts +77 -54
- package/lib/components/Select/__tests__/Select.test.tsx +448 -7
- package/lib/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +3 -3
- package/lib/components/Select/subcomponents/CustomOption.tsx +24 -10
- package/lib/components/Select/subcomponents/CustomSelect.tsx +333 -52
- package/lib/components/Select/subcomponents/FilterInput.tsx +80 -0
- package/lib/components/Select/subcomponents/NativeSelect.tsx +13 -1
- package/lib/components/Select/subcomponents/Panel.tsx +4 -5
- package/lib/components/Select/subcomponents/VisibleField.tsx +36 -24
- package/lib/components/Select/subcomponents/index.tsx +1 -0
- package/lib/components/Snackbar/Snackbar.stories.tsx +1 -1
- package/lib/components/Spinner/Spinner.stories.tsx +1 -1
- package/lib/components/StandaloneLink/StandaloneLink.stories.tsx +32 -0
- package/lib/components/StandaloneLink/StandaloneLink.tsx +183 -0
- package/lib/components/StandaloneLink/__tests__/StandaloneLink.test.tsx +57 -0
- package/lib/components/StandaloneLink/__tests__/__snapshots__/StandaloneLink.test.tsx.snap +19 -0
- package/lib/components/StandaloneLink/index.ts +2 -0
- package/lib/components/Table/Table.stories.tsx +337 -0
- package/lib/components/Table/Table.tsx +42 -67
- package/lib/components/Table/Table.types.ts +14 -0
- package/lib/components/Table/__tests__/Table.test.tsx +121 -0
- package/lib/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +210 -0
- package/lib/components/Table/index.ts +8 -1
- package/lib/components/Table/subcomponents/Body.tsx +18 -0
- package/lib/components/Table/subcomponents/Cell/Cell.stories.tsx +151 -0
- package/lib/components/Table/subcomponents/Cell/Cell.tsx +72 -0
- package/lib/components/Table/subcomponents/Cell/CellContent.tsx +91 -0
- package/lib/components/Table/subcomponents/Cell/__tests__/Cell.test.tsx +115 -0
- package/lib/components/Table/subcomponents/Cell/__tests__/__snapshots__/Cell.test.tsx.snap +107 -0
- package/lib/components/Table/subcomponents/Head.tsx +34 -0
- package/lib/components/Table/subcomponents/HeadCell/HeadCell.stories.tsx +85 -0
- package/lib/components/Table/subcomponents/HeadCell/HeadCell.tsx +99 -0
- package/lib/components/Table/subcomponents/HeadCell/HeadCellContent.tsx +61 -0
- package/lib/components/Table/subcomponents/HeadCell/__tests__/HeadCell.test.tsx +137 -0
- package/lib/components/Table/subcomponents/HeadCell/__tests__/__snapshots__/HeadCell.test.tsx.snap +110 -0
- package/lib/components/Table/subcomponents/Row.tsx +49 -0
- package/lib/components/Table/subcomponents/SortIcon.tsx +63 -0
- package/lib/components/Table/subcomponents/index.ts +14 -0
- package/lib/components/Tabs/Tab.tsx +3 -3
- package/lib/components/Tabs/TabContext.tsx +1 -0
- package/lib/components/Tabs/Tabs.stories.tsx +9 -3
- package/lib/components/Tabs/Tabs.tsx +10 -32
- package/lib/components/Tabs/__tests__/Tabs.test.tsx +10 -4
- package/lib/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +32 -32
- package/lib/components/Textarea/Textarea.stories.tsx +1 -1
- package/lib/components/Timepicker/Timepicker.stories.tsx +43 -0
- package/lib/components/Timepicker/Timepicker.tsx +100 -0
- package/lib/components/Timepicker/__tests__/Timepicker.test.tsx +55 -0
- package/lib/components/Timepicker/__tests__/__snapshots__/Timepicker.test.tsx.snap +19 -0
- package/lib/components/Timepicker/index.tsx +2 -0
- package/lib/components/Timepicker/utils/convertDateToTimeString.test.ts +54 -0
- package/lib/components/Timepicker/utils/convertDateToTimeString.ts +10 -0
- package/lib/components/Timepicker/utils/index.ts +1 -0
- package/lib/components/Toggle/Toggle.stories.tsx +1 -1
- package/lib/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/lib/components/WeekPicker/WeekPicker.stories.tsx +147 -0
- package/lib/components/WeekPicker/WeekPicker.tsx +26 -0
- package/lib/components/WeekPicker/WeekPicker.types.ts +21 -0
- package/lib/components/WeekPicker/index.ts +2 -0
- package/lib/components/WeekPicker/subcomponents/CustomDatepicker.tsx +298 -0
- package/lib/components/WeekPicker/subcomponents/DatepickerInput.tsx +111 -0
- package/lib/components/WeekPicker/subcomponents/VisibleField.tsx +126 -0
- package/lib/components/WeekPicker/subcomponents/index.ts +3 -0
- package/lib/components/common/Common.mdx +1 -1
- package/lib/components/index.ts +28 -2
- package/lib/hooks/index.ts +2 -0
- package/lib/hooks/useFocusTrap.ts +159 -0
- package/lib/index.ts +2 -0
- package/lib/theme/defaultTheme.ts +7 -0
- package/lib/utils/__tests__/announce.test.ts +121 -0
- package/lib/utils/__tests__/capitalise.test.ts +40 -0
- package/lib/utils/announce.ts +134 -0
- package/lib/utils/capitalise.ts +4 -0
- package/lib/utils/index.ts +1 -0
- package/package.json +3 -6
- package/dist/components/Datepicker/subcomponents/NativeDatepicker.d.ts +0 -6
- package/lib/components/Accordion/Accordion.stories.tsx.NOT_READY +0 -93
- package/lib/components/Field/__tests__/__snapshots__/Field.test.tsx.snap +0 -300
- /package/dist/components/{Datepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts → FileInput/__tests__/FileInput.test.d.ts} +0 -0
- /package/lib/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.test.ts +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Main } from './Main';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ layout, testId, className, children, ...props }: import('./Main').MainProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof Main>;
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
export declare const WithLayout: Story;
|
|
15
|
+
export declare const WithChildren: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React, HTMLAttributes } from 'react';
|
|
2
2
|
export declare const NAME = "ucl-uikit-menu__content";
|
|
3
|
-
export interface MenuContentProps extends HTMLAttributes<
|
|
3
|
+
export interface MenuContentProps extends HTMLAttributes<HTMLUListElement> {
|
|
4
4
|
title?: string;
|
|
5
5
|
testId?: string;
|
|
6
6
|
position?: 'left' | 'right';
|
|
@@ -3,6 +3,8 @@ export declare const NAME = "ucl-uikit-menu__item";
|
|
|
3
3
|
export interface MenuItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
4
4
|
testId?: string;
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
|
+
secondary?: boolean;
|
|
7
|
+
externalLink?: boolean;
|
|
6
8
|
}
|
|
7
9
|
declare const _default: React.NamedExoticComponent<MenuItemProps>;
|
|
8
10
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React, HTMLAttributes } from 'react';
|
|
2
2
|
export declare const NAME = "ucl-uikit-menu__section";
|
|
3
|
-
export interface MenuSectionProps extends HTMLAttributes<
|
|
3
|
+
export interface MenuSectionProps extends HTMLAttributes<HTMLLIElement> {
|
|
4
4
|
testId?: string;
|
|
5
5
|
}
|
|
6
6
|
declare const MenuSection: React.FC<MenuSectionProps>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { NativeDatepickerProps } from './NativeDatepicker.types';
|
|
2
|
+
declare const NativeDatepicker: ({ value, onValueChange, minDate, maxDate, className, disabled, testId, ref, ...props }: NativeDatepickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default NativeDatepicker;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ value, onValueChange, minDate, maxDate, className, disabled, testId, ref, ...props }: import('./NativeDatepicker.types').NativeDatepickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
argTypes: {
|
|
9
|
+
value: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "date";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
minDate: {
|
|
15
|
+
control: {
|
|
16
|
+
type: "date";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
maxDate: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "date";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
disabled: {
|
|
25
|
+
control: {
|
|
26
|
+
type: "boolean";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
tags: string[];
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
34
|
+
export declare const Default: Story;
|
|
35
|
+
export declare const Disabled: Story;
|
|
36
|
+
export declare const WithMinMaxDates: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputHTMLAttributes, RefObject } from 'react';
|
|
2
|
+
export type DatepickerValue = Date | null;
|
|
3
|
+
export interface NativeDatepickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'min' | 'max'> {
|
|
4
|
+
value?: DatepickerValue;
|
|
5
|
+
onValueChange?: (value: DatepickerValue, event?: React.SyntheticEvent) => void;
|
|
6
|
+
minDate?: string | null;
|
|
7
|
+
maxDate?: string | null;
|
|
8
|
+
testId?: string;
|
|
9
|
+
ref?: RefObject<HTMLInputElement>;
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a Date object to a `YYYY-MM-DD` string based on the user's local timezone.
|
|
3
3
|
*
|
|
4
|
-
* Used for passing dates to <NativeDatepicker>
|
|
4
|
+
* Used for passing dates to <NativeDatepicker>
|
|
5
5
|
*
|
|
6
6
|
* This function uses the Swedish (`sv-SE`) locale with `toLocaleDateString`
|
|
7
7
|
* as it conveniently defaults to the ISO 8601 `YYYY-MM-DD` format, while respecting
|
package/dist/components/NativeDatepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as dateToLocaleISOString } from './dateToLocaleISOString/dateToLocaleISOString';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { InputProps, IconButtonProps } from '../..';
|
|
3
|
+
import { MarginProps } from '../common/marginsStyle';
|
|
4
|
+
export interface SearchBaseProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
onSearch?: (searchTerms: string) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
inputProps?: InputProps;
|
|
9
|
+
clearButtonProps?: IconButtonProps;
|
|
10
|
+
submitButtonProps?: IconButtonProps;
|
|
11
|
+
testId?: string;
|
|
12
|
+
}
|
|
13
|
+
export type SearchProps = SearchBaseProps & MarginProps;
|
|
14
|
+
export declare const NAME = "ucl-uikit-search";
|
|
15
|
+
declare const Search: ({ placeholder, testId, onSearch, disabled, m, mv, mh, mt, mb, ml, mr, noMargins, inputProps, clearButtonProps, submitButtonProps, className, ...props }: SearchProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default Search;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ placeholder, testId, onSearch, disabled, m, mv, mh, mt, mb, ml, mr, noMargins, inputProps, clearButtonProps, submitButtonProps, className, ...props }: import('./Search').SearchProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
argTypes: {
|
|
9
|
+
placeholder: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "text";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
disabled: {
|
|
15
|
+
control: {
|
|
16
|
+
type: "boolean";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
testId: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "text";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
onSearch: {
|
|
25
|
+
action: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
tags: string[];
|
|
29
|
+
};
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
export declare const Default: Story;
|
|
33
|
+
export declare const Disabled: Story;
|
|
34
|
+
export declare const WithPlaceholder: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectProps } from './Select.types';
|
|
2
|
-
declare const Select: (props: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Select: <T extends string | number = string>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Select;
|
|
@@ -1,57 +1,205 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: (props: import('./Select.types').SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: <T extends string | number = string>(props: import('./Select.types').SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
argTypes: {
|
|
6
|
+
selectionBehaviour: {
|
|
7
|
+
description: string;
|
|
8
|
+
control: {
|
|
9
|
+
type: "radio";
|
|
10
|
+
};
|
|
11
|
+
options: string[];
|
|
12
|
+
table: {
|
|
13
|
+
type: {
|
|
14
|
+
summary: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
options: {
|
|
19
|
+
description: string;
|
|
20
|
+
control: {
|
|
21
|
+
type: "object";
|
|
22
|
+
};
|
|
23
|
+
table: {
|
|
24
|
+
type: {
|
|
25
|
+
summary: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
6
29
|
value: {
|
|
30
|
+
description: string;
|
|
7
31
|
control: {
|
|
8
32
|
type: "text";
|
|
9
33
|
};
|
|
34
|
+
table: {
|
|
35
|
+
type: {
|
|
36
|
+
summary: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
onValueChange: {
|
|
41
|
+
description: string;
|
|
42
|
+
control: false;
|
|
43
|
+
table: {
|
|
44
|
+
type: {
|
|
45
|
+
summary: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
10
48
|
};
|
|
11
49
|
native: {
|
|
50
|
+
description: string;
|
|
12
51
|
control: {
|
|
13
52
|
type: "boolean";
|
|
14
53
|
};
|
|
54
|
+
table: {
|
|
55
|
+
type: {
|
|
56
|
+
summary: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
nativeHtmlAttributes: {
|
|
61
|
+
description: string;
|
|
62
|
+
control: false;
|
|
63
|
+
table: {
|
|
64
|
+
type: {
|
|
65
|
+
summary: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
15
68
|
};
|
|
16
69
|
disabled: {
|
|
70
|
+
description: string;
|
|
17
71
|
control: {
|
|
18
72
|
type: "boolean";
|
|
19
73
|
};
|
|
74
|
+
table: {
|
|
75
|
+
type: {
|
|
76
|
+
summary: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
20
79
|
};
|
|
21
80
|
placeholder: {
|
|
81
|
+
description: string;
|
|
22
82
|
control: {
|
|
23
83
|
type: "text";
|
|
24
84
|
};
|
|
85
|
+
table: {
|
|
86
|
+
type: {
|
|
87
|
+
summary: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
25
90
|
};
|
|
26
|
-
|
|
91
|
+
filterable: {
|
|
92
|
+
description: string;
|
|
93
|
+
control: {
|
|
94
|
+
type: "boolean";
|
|
95
|
+
};
|
|
96
|
+
table: {
|
|
97
|
+
type: {
|
|
98
|
+
summary: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
filterInputProps: {
|
|
103
|
+
description: string;
|
|
104
|
+
control: {
|
|
105
|
+
type: "object";
|
|
106
|
+
};
|
|
107
|
+
table: {
|
|
108
|
+
type: {
|
|
109
|
+
summary: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
id: {
|
|
114
|
+
description: string;
|
|
27
115
|
control: {
|
|
28
116
|
type: "text";
|
|
29
117
|
};
|
|
118
|
+
table: {
|
|
119
|
+
type: {
|
|
120
|
+
summary: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
title: {
|
|
125
|
+
description: string;
|
|
126
|
+
control: {
|
|
127
|
+
type: "text";
|
|
128
|
+
};
|
|
129
|
+
table: {
|
|
130
|
+
type: {
|
|
131
|
+
summary: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
lineBreak: {
|
|
136
|
+
description: string;
|
|
137
|
+
control: {
|
|
138
|
+
type: "boolean";
|
|
139
|
+
};
|
|
140
|
+
table: {
|
|
141
|
+
type: {
|
|
142
|
+
summary: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
30
145
|
};
|
|
31
|
-
|
|
146
|
+
panelClassName: {
|
|
147
|
+
description: string;
|
|
32
148
|
control: {
|
|
33
|
-
type: "
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
149
|
+
type: "text";
|
|
150
|
+
};
|
|
151
|
+
table: {
|
|
152
|
+
type: {
|
|
153
|
+
summary: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
className: {
|
|
158
|
+
description: string;
|
|
159
|
+
control: {
|
|
160
|
+
type: "text";
|
|
161
|
+
};
|
|
162
|
+
table: {
|
|
163
|
+
type: {
|
|
164
|
+
summary: string;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
testId: {
|
|
169
|
+
description: string;
|
|
170
|
+
control: {
|
|
171
|
+
type: "text";
|
|
172
|
+
};
|
|
173
|
+
table: {
|
|
174
|
+
type: {
|
|
175
|
+
summary: string;
|
|
176
|
+
};
|
|
37
177
|
};
|
|
38
178
|
};
|
|
39
179
|
};
|
|
40
180
|
args: {
|
|
181
|
+
selectionBehaviour: "focus";
|
|
41
182
|
value: undefined;
|
|
42
|
-
onChange: () => void;
|
|
43
183
|
options: {
|
|
44
184
|
label: string;
|
|
45
185
|
value: string;
|
|
46
186
|
}[];
|
|
47
187
|
};
|
|
188
|
+
parameters: {
|
|
189
|
+
docs: {
|
|
190
|
+
story: {
|
|
191
|
+
inline: boolean;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
};
|
|
48
195
|
};
|
|
49
196
|
export default meta;
|
|
50
197
|
type Story = StoryObj<typeof meta>;
|
|
51
198
|
export declare const Default: Story;
|
|
52
199
|
export declare const Native: Story;
|
|
53
|
-
export declare const OptionsWithIcons: Story;
|
|
54
200
|
export declare const Disabled: Story;
|
|
55
201
|
export declare const WithPlaceholder: Story;
|
|
56
202
|
export declare const SingleLongOption: Story;
|
|
57
203
|
export declare const ManyOptions: Story;
|
|
204
|
+
export declare const filterable: Story;
|
|
205
|
+
export declare const SelectionBehaviourCommit: Story;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Maps to a native <option> element in <NativeSelect>
|
|
4
4
|
* or a <CustomOption> in <CustomSelect>
|
|
5
5
|
*/
|
|
6
|
-
export type OptionData = {
|
|
6
|
+
export type OptionData<T> = {
|
|
7
7
|
/**
|
|
8
8
|
* Display text shown to the user
|
|
9
9
|
*/
|
|
@@ -12,22 +12,34 @@ export type OptionData = {
|
|
|
12
12
|
* Data-friendly value that is returned when the option is selected
|
|
13
13
|
* We assume this will be submitted to a server or used in some other way
|
|
14
14
|
*/
|
|
15
|
-
value:
|
|
15
|
+
value: T;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* Only used by <CustomOption>
|
|
19
|
-
* Takes in an actual <Icon> component
|
|
17
|
+
* Apply additional props to a select option component.
|
|
20
18
|
*/
|
|
19
|
+
optionProps?: Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
Deprecated
|
|
22
|
+
*/
|
|
21
23
|
icon?: React.ReactNode;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
|
-
*
|
|
26
|
+
* Additional props forwarded to the filter input when `filterable` is true
|
|
27
|
+
*/
|
|
28
|
+
export type FilterInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'disabled' | 'ref' | 'role' | 'aria-autocomplete' | 'aria-label'>;
|
|
29
|
+
/**
|
|
30
|
+
* Public props for <Select>, used by both custom and native render paths.
|
|
25
31
|
*/
|
|
26
|
-
interface
|
|
32
|
+
export interface SelectProps<T = string | number> extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
33
|
+
/**
|
|
34
|
+
* Controls keyboard selection behaviour in the custom select variant.
|
|
35
|
+
* - `focus` (default): arrow keys move focus and commit value immediately.
|
|
36
|
+
* - `commit`: arrow keys only move focus; Enter or click commits value.
|
|
37
|
+
*/
|
|
38
|
+
selectionBehaviour?: 'focus' | 'commit';
|
|
27
39
|
/**
|
|
28
40
|
* An array of option data, to be rendered either natively or custom
|
|
29
41
|
*/
|
|
30
|
-
options: OptionData[];
|
|
42
|
+
options: OptionData<T>[];
|
|
31
43
|
/**
|
|
32
44
|
* Placeholder text shown when no option is selected
|
|
33
45
|
* Displayed in visible field of custom implementation
|
|
@@ -48,35 +60,57 @@ interface BaseSelectProps {
|
|
|
48
60
|
* Native flag determines which implementation to use
|
|
49
61
|
*/
|
|
50
62
|
native?: boolean;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Adds a text input to filter options in the custom variant; ignored for native
|
|
65
|
+
*/
|
|
66
|
+
filterable?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Extra props to apply to the filter input when `filterable` is true
|
|
69
|
+
*/
|
|
70
|
+
filterInputProps?: FilterInputProps;
|
|
71
|
+
/**
|
|
72
|
+
* Extra attributes forwarded to the native <select> when `native` is true
|
|
73
|
+
*/
|
|
74
|
+
nativeHtmlAttributes?: React.SelectHTMLAttributes<HTMLSelectElement>;
|
|
75
|
+
/**
|
|
76
|
+
* Current value (controlled)
|
|
77
|
+
*/
|
|
78
|
+
value?: T;
|
|
79
|
+
/**
|
|
80
|
+
* Disable interaction
|
|
81
|
+
*/
|
|
59
82
|
disabled?: boolean;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Allow long option labels to wrap instead of truncating
|
|
85
|
+
*/
|
|
86
|
+
lineBreak?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Custom className for the root element
|
|
89
|
+
*/
|
|
90
|
+
className?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Custom className for the options panel
|
|
93
|
+
*/
|
|
94
|
+
panelClassName?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Change handler for the custom variant
|
|
97
|
+
*/
|
|
98
|
+
onValueChange?: (value: T, ev: React.UIEvent) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Ref forwarded to the rendered element
|
|
101
|
+
* (div for custom, select for native)
|
|
102
|
+
*/
|
|
103
|
+
ref?: React.Ref<HTMLDivElement | HTMLSelectElement | null>;
|
|
104
|
+
}
|
|
72
105
|
/**
|
|
73
106
|
* Each option as displayed in the Panel of <CustomSelect>
|
|
74
107
|
* Roughly equivalent to a custom version of <option>
|
|
75
108
|
*/
|
|
76
|
-
export interface CustomOptionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
77
|
-
value:
|
|
109
|
+
export interface CustomOptionProps<T> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
110
|
+
value: T;
|
|
111
|
+
optionIndex?: number;
|
|
78
112
|
testId?: string;
|
|
79
113
|
isSelected?: boolean;
|
|
80
|
-
onSelect: (event: React.MouseEvent, value:
|
|
114
|
+
onSelect: (event: React.MouseEvent, value: T, optionIndex?: number) => void;
|
|
115
|
+
lineBreak?: boolean;
|
|
81
116
|
}
|
|
82
|
-
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CustomOptionProps } from '../Select.types';
|
|
2
|
-
declare const CustomOption: ({ value, isSelected, onSelect, testId, className, children, ...props }: CustomOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const CustomOption: <T extends string | number>({ value, optionIndex, isSelected, onSelect, lineBreak, testId, className, children, ...props }: CustomOptionProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default CustomOption;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare const CustomSelect: ({ value, options, onValueChange, disabled, placeholder, width, testId, className, ref, ...props }: CustomSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { SelectProps } from '../Select.types';
|
|
2
|
+
type CustomSelectProps<T> = Omit<SelectProps<T>, 'native' | 'nativeHtmlAttributes'>;
|
|
3
|
+
declare const CustomSelect: <T extends string | number>({ selectionBehaviour, value, options, onValueChange, disabled, placeholder, lineBreak, filterInputProps, width, testId, className, panelClassName, filterable, ref, ...props }: CustomSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default CustomSelect;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FilterInputProps } from '../Select.types';
|
|
2
|
+
type FilterInputComponentProps = {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
inputRef?: React.RefObject<HTMLInputElement | null>;
|
|
8
|
+
className?: string;
|
|
9
|
+
ariaControls?: string;
|
|
10
|
+
ariaExpanded?: boolean;
|
|
11
|
+
ariaActiveDescendant?: string;
|
|
12
|
+
} & FilterInputProps;
|
|
13
|
+
declare const FilterInput: ({ value, onChange, placeholder, disabled, inputRef, className, ariaControls, ariaExpanded, ariaActiveDescendant, ...rest }: FilterInputComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default FilterInput;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SelectProps } from '../Select.types';
|
|
2
|
+
type NativeSelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'defaultValue'> & Omit<SelectProps, 'native' | 'filterable' | 'nativeHtmlAttributes' | 'onValueChange' | 'ref'> & {
|
|
3
|
+
value?: string | number;
|
|
4
|
+
ref?: React.Ref<HTMLSelectElement>;
|
|
5
|
+
};
|
|
2
6
|
declare const NativeSelect: ({ options, width, disabled, placeholder, testId, className, ...props }: NativeSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
7
|
export default NativeSelect;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { OptionData } from '../Select.types';
|
|
2
|
-
interface VisibleFieldProps {
|
|
2
|
+
interface VisibleFieldProps<T> {
|
|
3
3
|
isOpen?: boolean;
|
|
4
4
|
disabled?: boolean;
|
|
5
|
-
selectedOption: OptionData | null | undefined;
|
|
5
|
+
selectedOption: OptionData<T> | null | undefined;
|
|
6
6
|
placeholder?: string;
|
|
7
|
+
filterable?: boolean;
|
|
8
|
+
children?: React.ReactNode;
|
|
7
9
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
10
|
+
declare const VisibleField: <T extends string | number>({ selectedOption, isOpen, placeholder, disabled, filterable, children, }: VisibleFieldProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default VisibleField;
|
|
@@ -3,3 +3,4 @@ export { default as NativeSelect } from './NativeSelect';
|
|
|
3
3
|
export { default as CustomOption } from './CustomOption';
|
|
4
4
|
export { default as Panel } from './Panel';
|
|
5
5
|
export { default as VisibleField } from './VisibleField';
|
|
6
|
+
export { default as FilterInput } from './FilterInput';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { IconProps } from '../Icon';
|
|
3
|
+
import { BaseLinkProps } from '../Link/BaseLink';
|
|
4
|
+
import { MarginProps } from '../common/marginsStyle';
|
|
5
|
+
export interface StandaloneLinkBaseProps extends BaseLinkProps {
|
|
6
|
+
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
7
|
+
icon?: ReactElement<IconProps>;
|
|
8
|
+
iconPosition?: 'left' | 'right';
|
|
9
|
+
}
|
|
10
|
+
export type StandaloneLinkProps = StandaloneLinkBaseProps & MarginProps;
|
|
11
|
+
declare const StandaloneLink: import('react').ForwardRefExoticComponent<StandaloneLinkBaseProps & MarginProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
12
|
+
export default StandaloneLink;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('./StandaloneLink').StandaloneLinkBaseProps & import('../common/marginsStyle').MarginProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
5
|
+
args: {
|
|
6
|
+
children: string;
|
|
7
|
+
href: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const NewTab: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|