uikit-react-public 0.17.4 → 0.21.8
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 +2 -4
- package/dist/components/Accordion/Accordion.Heading.d.ts +1 -0
- package/dist/components/AppHeader/AppHeader.d.ts +1 -1
- package/dist/components/AppHeader/AppHeaderBottom.d.ts +1 -1
- package/dist/components/AppHeader/AppHeaderNav.d.ts +1 -1
- package/dist/components/AppHeader/AppHeaderTop.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumb.d.ts +3 -4
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +7 -3
- package/dist/components/Button/Button.stories.d.ts +17 -7
- package/dist/components/Button/style/buttonAccentStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonPrimaryDestructiveStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonPrimaryStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonPrimarySubtleStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonPrimaryWarningStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonSecondaryDestructiveStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonSecondaryStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonSecondarySubtleStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonTertiaryDestructiveStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonTertiaryNoPaddingStyle.d.ts +4 -0
- package/dist/components/Button/style/buttonTertiaryStyle.d.ts +4 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/FooterNew/BackToTop.d.ts +8 -0
- package/dist/components/FooterNew/Footer.d.ts +23 -0
- package/dist/components/FooterNew/FooterColumn.d.ts +8 -0
- package/dist/components/FooterNew/FooterLinks.d.ts +7 -0
- package/dist/components/FooterNew/FooterNavLink.d.ts +8 -0
- package/dist/components/FooterNew/LegalAndCopyright.d.ts +14 -0
- package/dist/components/FooterNew/LogoAddressAndSocial.d.ts +10 -0
- package/dist/components/FooterNew/SocialLink.d.ts +8 -0
- package/dist/components/FooterNew/__tests__/Footer.test.d.ts +1 -0
- package/dist/components/FooterNew/index.d.ts +2 -0
- package/dist/components/HeaderNew/Header.d.ts +18 -0
- package/dist/components/HeaderNew/HeaderBorder.d.ts +7 -0
- package/dist/components/HeaderNew/HeaderLogo.d.ts +9 -0
- package/dist/components/HeaderNew/HeaderMenuContainer.d.ts +7 -0
- package/dist/components/HeaderNew/HeaderTitle.d.ts +9 -0
- package/dist/components/HeaderNew/__tests__/Header.test.d.ts +1 -0
- package/dist/components/HeaderNew/constants.d.ts +3 -0
- package/dist/components/HeaderNew/index.d.ts +3 -0
- package/dist/components/HeadingNew/Heading.d.ts +13 -0
- package/dist/components/HeadingNew/index.d.ts +2 -0
- package/dist/components/Icon/svgImports.d.ts +7 -881
- package/dist/components/Link/BaseLink.d.ts +14 -5
- package/dist/components/Link/Link.d.ts +8 -3
- package/dist/components/Link/Link.stories.d.ts +3 -1
- package/dist/components/MenuNew/Menu.context.d.ts +14 -0
- package/dist/components/MenuNew/Menu.d.ts +20 -0
- package/dist/components/MenuNew/MenuContent.d.ts +9 -0
- package/dist/components/MenuNew/MenuItem.d.ts +10 -0
- package/dist/components/MenuNew/MenuSection.d.ts +7 -0
- package/dist/components/MenuNew/index.d.ts +6 -0
- package/dist/components/MenuNew/trigger/ButtonMenuTrigger.d.ts +8 -0
- package/dist/components/MenuNew/trigger/IconMenuTrigger.d.ts +8 -0
- package/dist/components/Overlay/Overlay.stories.d.ts +12 -12
- package/dist/components/ParagraphNew/Paragraph.d.ts +13 -0
- package/dist/components/ParagraphNew/index.d.ts +4 -0
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.stories.d.ts +13 -1
- package/dist/components/Select/Select.types.d.ts +40 -13
- package/dist/components/Select/subcomponents/CustomSelect.d.ts +3 -3
- package/dist/components/Select/subcomponents/FilterInput.d.ts +3 -1
- package/dist/components/Select/subcomponents/NativeSelect.d.ts +2 -2
- package/dist/components/Select/subcomponents/VisibleField.d.ts +4 -1
- package/dist/components/Spinner/Spinner.d.ts +2 -0
- package/dist/components/StandaloneLink/StandaloneLink.d.ts +8 -5
- package/dist/components/StandaloneLink/StandaloneLink.stories.d.ts +3 -1
- package/dist/components/Table/Table.d.ts +3 -3
- package/dist/components/Table/Table.stories.d.ts +3 -3
- package/dist/components/Table/Table.types.d.ts +1 -0
- package/dist/components/Table/subcomponents/Cell/Cell.d.ts +5 -1
- package/dist/components/Table/subcomponents/Cell/Cell.stories.d.ts +15 -13
- package/dist/components/Table/subcomponents/Cell/CellContent.d.ts +5 -1
- package/dist/components/Table/subcomponents/HeadCell/HeadCell.d.ts +2 -1
- package/dist/components/Table/subcomponents/HeadCell/HeadCell.stories.d.ts +14 -13
- package/dist/components/Table/subcomponents/HeadCell/HeadCellContent.d.ts +2 -1
- package/dist/components/Table/subcomponents/__tests__/Row.test.d.ts +1 -0
- package/dist/components/UclLogoNew/UclLogo.d.ts +8 -0
- package/dist/components/UclLogoNew/index.d.ts +2 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/index.js +20909 -16022
- package/dist/theme/__tests__/fonts.test.d.ts +1 -0
- package/dist/theme/common/themeCommon.d.ts +904 -0
- package/dist/theme/fonts.d.ts +18 -0
- package/dist/theme/index.d.ts +6 -3
- package/dist/theme/light/lightColour.d.ts +126 -0
- package/dist/theme/light/lightTheme.d.ts +3 -0
- package/dist/theme/original/color.d.ts +166 -0
- package/dist/theme/original/defaultTheme.d.ts +1340 -0
- package/dist/theme/original/originalColourNewStructure.d.ts +126 -0
- package/dist/theme/useTheme.d.ts +2174 -0
- package/dist/utils/addAlphaToHex.d.ts +5 -0
- package/dist/utils/scrollToTop.d.ts +2 -0
- package/lib/components/Accordion/Accordion.Heading.tsx +51 -39
- package/lib/components/Accordion/Accordion.Panel.tsx +0 -4
- package/lib/components/Accordion/Accordion.tsx +34 -28
- package/lib/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap +12 -10
- package/lib/components/Alert/Alert.tsx +12 -12
- package/lib/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +13 -39
- package/lib/components/AppHeader/AppHeader.tsx +6 -11
- package/lib/components/AppHeader/AppHeaderBottom.tsx +2 -3
- package/lib/components/AppHeader/AppHeaderNav.tsx +2 -3
- package/lib/components/AppHeader/AppHeaderTop.tsx +1 -1
- package/lib/components/AppHeader/__tests__/__snapshots__/AppHeader.test.tsx.snap +2 -2
- package/lib/components/AppMenu/__tests__/__snapshots__/AppMenu.test.tsx.snap +6 -19
- package/lib/components/Badge/Badge.stories.tsx +1 -1
- package/lib/components/Breadcrumbs/Breadcrumb.tsx +26 -12
- package/lib/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/lib/components/Breadcrumbs/__tests__/Breadcrumbs.test.tsx +9 -27
- package/lib/components/Breadcrumbs/__tests__/__snapshots__/Breadcrumbs.test.tsx.snap +24 -20
- package/lib/components/Button/Button.mdx +32 -279
- package/lib/components/Button/Button.stories.tsx +43 -50
- package/lib/components/Button/Button.tsx +165 -25
- package/lib/components/Button/__tests__/Button.test.tsx +49 -15
- package/lib/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +80 -73
- package/lib/components/Button/style/buttonAccentStyle.ts +53 -0
- package/lib/components/Button/style/buttonPrimaryDestructiveStyle.ts +55 -0
- package/lib/components/Button/style/buttonPrimaryStyle.ts +53 -0
- package/lib/components/Button/style/buttonPrimarySubtleStyle.ts +64 -0
- package/lib/components/Button/style/buttonPrimaryWarningStyle.ts +56 -0
- package/lib/components/Button/style/buttonSecondaryDestructiveStyle.ts +63 -0
- package/lib/components/Button/style/buttonSecondaryStyle.ts +62 -0
- package/lib/components/Button/style/buttonSecondarySubtleStyle.ts +72 -0
- package/lib/components/Button/style/buttonTertiaryDestructiveStyle.ts +65 -0
- package/lib/components/Button/style/buttonTertiaryNoPaddingStyle.ts +52 -0
- package/lib/components/Button/style/buttonTertiaryStyle.ts +62 -0
- package/lib/components/Calendar/Calendar.stories.tsx +33 -13
- package/lib/components/Calendar/Calendar.tsx +2 -2
- package/lib/components/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +99 -95
- package/lib/components/Calendar/subcomponents/AcademicWeek.tsx +2 -1
- package/lib/components/Calendar/subcomponents/AcademicWeeks.tsx +2 -3
- package/lib/components/Calendar/subcomponents/ColumnHeading.tsx +3 -7
- package/lib/components/Calendar/subcomponents/Controls.tsx +1 -1
- package/lib/components/Calendar/subcomponents/Day.stories.tsx +1 -1
- package/lib/components/Calendar/subcomponents/Day.tsx +7 -9
- package/lib/components/Calendar/subcomponents/EventDot.tsx +4 -8
- package/lib/components/Checkbox/Checkbox.stories.tsx +1 -1
- package/lib/components/Checkbox/Checkbox.tsx +12 -10
- package/lib/components/Checkbox/__tests__/Checkbox.test.tsx +29 -0
- package/lib/components/Checkbox/__tests__/__snapshots__/Checkbox.test.tsx.snap +4 -4
- package/lib/components/Datepicker/__tests__/Datepicker.test.tsx +117 -0
- package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +16 -44
- package/lib/components/Datepicker/subcomponents/CustomDatepicker.tsx +10 -1
- package/lib/components/Datepicker/subcomponents/VisibleField.tsx +24 -23
- package/lib/components/Dialog/BaseDialog.tsx +2 -2
- package/lib/components/Dialog/Dialog.stories.tsx +1 -1
- package/lib/components/Divider/__tests__/__snapshots__/Breadcrumbs.test.tsx.snap +12 -12
- package/lib/components/FeedbackDialog/FeedbackDialog.stories.tsx +1 -1
- package/lib/components/FeedbackDialog/FeedbackDialog.tsx +4 -6
- package/lib/components/Field/CharacterCount.tsx +2 -2
- package/lib/components/Field/ErrorText.tsx +1 -1
- package/lib/components/Field/Field.tsx +1 -1
- package/lib/components/Field/HelperText.tsx +3 -1
- package/lib/components/FileInput/FileInput.stories.tsx +1 -1
- package/lib/components/FileInput/__tests__/__snapshots__/FileInput.test.tsx.snap +4 -20
- package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +70 -79
- package/lib/components/FooterNew/BackToTop.tsx +83 -0
- package/lib/components/FooterNew/Footer.tsx +110 -0
- package/lib/components/FooterNew/FooterColumn.tsx +79 -0
- package/lib/components/FooterNew/FooterLinks.tsx +44 -0
- package/lib/components/FooterNew/FooterNavLink.tsx +63 -0
- package/lib/components/FooterNew/LegalAndCopyright.tsx +150 -0
- package/lib/components/FooterNew/LogoAddressAndSocial.tsx +154 -0
- package/lib/components/FooterNew/SocialLink.tsx +108 -0
- package/lib/components/FooterNew/__tests__/Footer.test.tsx +51 -0
- package/lib/components/FooterNew/__tests__/__snapshots__/Footer.test.tsx.snap +1107 -0
- package/lib/components/FooterNew/index.ts +2 -0
- package/lib/components/HeaderDraft/__tests__/__snapshots__/Header.test.tsx.snap +3 -2
- package/lib/components/HeaderNew/Header.tsx +93 -0
- package/lib/components/HeaderNew/HeaderBorder.tsx +55 -0
- package/lib/components/HeaderNew/HeaderLogo.tsx +70 -0
- package/lib/components/HeaderNew/HeaderMenuContainer.tsx +35 -0
- package/lib/components/HeaderNew/HeaderTitle.tsx +53 -0
- package/lib/components/HeaderNew/__tests__/Header.test.tsx +42 -0
- package/lib/components/HeaderNew/__tests__/__snapshots__/Header.test.tsx.snap +79 -0
- package/lib/components/HeaderNew/constants.ts +3 -0
- package/lib/components/HeaderNew/index.ts +7 -0
- package/lib/components/HeadingNew/Heading.tsx +208 -0
- package/lib/components/HeadingNew/index.ts +2 -0
- package/lib/components/Icon/__tests__/__snapshots__/Icon.test.tsx.snap +16 -12
- package/lib/components/Icon/svgImports.ts +318 -296
- package/lib/components/IconButton/IconButton.tsx +3 -4
- package/lib/components/IconButton/__tests__/__snapshots__/IconButton.test.tsx.snap +12 -9
- package/lib/components/Link/BaseLink.tsx +114 -71
- package/lib/components/Link/Link.stories.tsx +1 -1
- package/lib/components/Link/Link.tsx +120 -109
- package/lib/components/Link/__tests__/__snapshots__/link.test.tsx.snap +2 -2
- package/lib/components/MenuNew/Menu.context.tsx +149 -0
- package/lib/components/MenuNew/Menu.tsx +75 -0
- package/lib/components/MenuNew/MenuContent.tsx +140 -0
- package/lib/components/MenuNew/MenuItem.tsx +101 -0
- package/lib/components/MenuNew/MenuSection.tsx +47 -0
- package/lib/components/MenuNew/index.ts +8 -0
- package/lib/components/MenuNew/trigger/ButtonMenuTrigger.tsx +42 -0
- package/lib/components/MenuNew/trigger/IconMenuTrigger.tsx +40 -0
- package/lib/components/Pagination/Pagination.stories.tsx +1 -1
- package/lib/components/Pagination/PaginationControls.tsx +4 -5
- package/lib/components/Pagination/PaginationInfo.tsx +2 -3
- package/lib/components/ParagraphNew/Paragraph.tsx +200 -0
- package/lib/components/ParagraphNew/index.ts +6 -0
- package/lib/components/Radio/Radio.stories.tsx +1 -1
- package/lib/components/Radio/Radio.tsx +8 -8
- package/lib/components/Radio/__tests__/__snapshots__/Radio.test.tsx.snap +4 -4
- package/lib/components/Search/__tests__/__snapshots__/Search.test.tsx.snap +12 -32
- package/lib/components/Select/Select.mdx +23 -0
- package/lib/components/Select/Select.stories.tsx +43 -10
- package/lib/components/Select/Select.tsx +14 -3
- package/lib/components/Select/Select.types.ts +53 -16
- package/lib/components/Select/__tests__/Select.test.tsx +250 -1
- package/lib/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +5 -4
- package/lib/components/Select/subcomponents/CustomOption.tsx +10 -3
- package/lib/components/Select/subcomponents/CustomSelect.tsx +110 -10
- package/lib/components/Select/subcomponents/FilterInput.tsx +13 -3
- package/lib/components/Select/subcomponents/NativeSelect.tsx +10 -18
- package/lib/components/Select/subcomponents/Panel.tsx +2 -2
- package/lib/components/Select/subcomponents/VisibleField.tsx +48 -3
- package/lib/components/Snackbar/__tests__/__snapshots__/Snackbar.test.tsx.snap +9 -15
- package/lib/components/Spinner/Spinner.tsx +24 -5
- package/lib/components/Spinner/__tests__/Spinner.test.tsx +35 -5
- package/lib/components/Spinner/__tests__/__snapshots__/Spinner.test.tsx.snap +40 -16
- package/lib/components/StandaloneLink/StandaloneLink.stories.tsx +1 -1
- package/lib/components/StandaloneLink/StandaloneLink.tsx +180 -163
- package/lib/components/StandaloneLink/__tests__/__snapshots__/StandaloneLink.test.tsx.snap +2 -2
- package/lib/components/Table/Table.stories.tsx +1 -1
- package/lib/components/Table/Table.tsx +2 -0
- package/lib/components/Table/Table.types.ts +1 -0
- package/lib/components/Table/__tests__/Table.test.tsx +19 -0
- package/lib/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +7 -3
- package/lib/components/Table/subcomponents/Cell/Cell.stories.tsx +1 -1
- package/lib/components/Table/subcomponents/Cell/Cell.tsx +23 -2
- package/lib/components/Table/subcomponents/Cell/CellContent.tsx +12 -1
- package/lib/components/Table/subcomponents/Cell/__tests__/Cell.test.tsx +106 -0
- package/lib/components/Table/subcomponents/Cell/__tests__/__snapshots__/Cell.test.tsx.snap +4 -3
- package/lib/components/Table/subcomponents/HeadCell/HeadCell.stories.tsx +1 -1
- package/lib/components/Table/subcomponents/HeadCell/HeadCell.tsx +28 -6
- package/lib/components/Table/subcomponents/HeadCell/HeadCellContent.tsx +3 -0
- package/lib/components/Table/subcomponents/HeadCell/__tests__/HeadCell.test.tsx +221 -2
- package/lib/components/Table/subcomponents/HeadCell/__tests__/__snapshots__/HeadCell.test.tsx.snap +6 -4
- package/lib/components/Table/subcomponents/Row.tsx +2 -2
- package/lib/components/Table/subcomponents/SortIcon.tsx +1 -0
- package/lib/components/Table/subcomponents/__tests__/Row.test.tsx +59 -0
- package/lib/components/Tabs/Tab.tsx +3 -3
- package/lib/components/Tabs/Tabs.stories.tsx +1 -1
- package/lib/components/Tabs/Tabs.tsx +5 -3
- package/lib/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +4 -4
- package/lib/components/Timepicker/Timepicker.stories.tsx +1 -1
- package/lib/components/Toggle/Toggle.tsx +5 -5
- package/lib/components/Toggle/ToggleHandle.tsx +2 -3
- package/lib/components/Tooltip/Tooltip.tsx +2 -2
- package/lib/components/Tooltip/__tests__/__snapshots__/tooltip.test.tsx.snap +2 -2
- package/lib/components/UclLogoNew/UclLogo.tsx +42 -0
- package/lib/components/UclLogoNew/index.ts +2 -0
- package/lib/components/WeekPicker/WeekPicker.stories.tsx +3 -5
- package/lib/components/common/Common.mdx +0 -1
- package/lib/components/index.ts +19 -1
- package/lib/theme/Colours.mdx +1 -1
- package/lib/theme/Theme.mdx +1 -1
- package/lib/theme/Typography.mdx +1 -1
- package/lib/theme/__tests__/fonts.test.ts +37 -0
- package/lib/theme/common/themeCommon.ts +515 -0
- package/lib/theme/fonts.ts +110 -0
- package/lib/theme/index.ts +6 -6
- package/lib/theme/light/lightColour.ts +232 -0
- package/lib/theme/light/lightTheme.ts +37 -0
- package/lib/theme/{defaultTheme.ts → original/color.ts} +17 -199
- package/lib/theme/original/defaultTheme.ts +207 -0
- package/lib/theme/original/originalColourNewStructure.ts +185 -0
- package/lib/theme/useTheme.tsx +72 -15
- package/lib/types/assets.d.ts +10 -0
- package/lib/utils/addAlphaToHex.ts +29 -0
- package/lib/utils/scrollToTop.ts +5 -0
- package/package.json +11 -6
- package/dist/components/Button/buttonPrimaryStyle.d.ts +0 -4
- package/dist/components/Button/buttonSecondaryStyle.d.ts +0 -4
- package/dist/components/Button/buttonTertiaryStyle.d.ts +0 -4
- package/dist/theme/defaultTheme.d.ts +0 -274
- package/lib/components/Button/buttonPrimaryStyle.ts +0 -62
- package/lib/components/Button/buttonSecondaryStyle.ts +0 -65
- package/lib/components/Button/buttonTertiaryStyle.ts +0 -54
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { default as React,
|
|
2
|
-
|
|
3
|
-
component?: ElementType;
|
|
1
|
+
import { default as React, ComponentPropsWithoutRef, ElementType } from 'react';
|
|
2
|
+
type BaseLinkOwnProps = {
|
|
4
3
|
size?: 'small' | 'default';
|
|
5
4
|
noVisited?: boolean;
|
|
6
5
|
disabled?: boolean;
|
|
7
6
|
testId?: string;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
to?: string;
|
|
10
|
+
};
|
|
11
|
+
type PolymorphicRef<C extends ElementType> = React.ComponentPropsWithRef<C>['ref'];
|
|
12
|
+
export type BaseLinkProps<C extends ElementType = 'a'> = BaseLinkOwnProps & {
|
|
13
|
+
component?: C;
|
|
14
|
+
} & Omit<ComponentPropsWithoutRef<C>, keyof BaseLinkOwnProps | 'component' | 'disabled'>;
|
|
15
|
+
type BaseLinkComponent = <C extends ElementType = 'a'>(props: BaseLinkProps<C> & {
|
|
16
|
+
ref?: PolymorphicRef<C>;
|
|
17
|
+
}) => React.JSX.Element;
|
|
18
|
+
declare const BaseLink: BaseLinkComponent;
|
|
10
19
|
export default BaseLink;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { default as React, ComponentPropsWithoutRef, ElementType } from 'react';
|
|
1
2
|
import { BaseLinkProps } from './BaseLink';
|
|
2
|
-
|
|
3
|
+
type LinkOwnProps = {
|
|
3
4
|
variant?: 'primary' | 'secondary';
|
|
4
|
-
}
|
|
5
|
-
|
|
5
|
+
};
|
|
6
|
+
export type LinkProps<C extends ElementType = 'a'> = LinkOwnProps & BaseLinkProps<C> & Omit<ComponentPropsWithoutRef<C>, keyof LinkOwnProps>;
|
|
7
|
+
type LinkComponent = <C extends ElementType = 'a'>(props: LinkProps<C> & {
|
|
8
|
+
ref?: React.ComponentPropsWithRef<C>['ref'];
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
declare const Link: LinkComponent;
|
|
6
11
|
export default Link;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import('react').
|
|
4
|
+
component: <C extends import('react').ElementType = "a">(props: import('./Link').LinkProps<C> & {
|
|
5
|
+
ref?: React.ComponentPropsWithRef<C>["ref"];
|
|
6
|
+
}) => React.JSX.Element;
|
|
5
7
|
args: {
|
|
6
8
|
children: string;
|
|
7
9
|
href: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface IContext {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
toggleMenu: () => void;
|
|
5
|
+
triggerRef: React.RefObject<HTMLButtonElement | null>;
|
|
6
|
+
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AppMenuContext: React.Context<IContext>;
|
|
9
|
+
export declare const useAppMenu: () => IContext;
|
|
10
|
+
declare const MenuProvider: ({ defaultOpen, children, }: {
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default MenuProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { default as MenuItem } from './MenuItem';
|
|
3
|
+
import { default as MenuSection } from './MenuSection';
|
|
4
|
+
import { ButtonMenuTriggerProps } from './trigger/ButtonMenuTrigger';
|
|
5
|
+
export declare const NAME = "ucl-uikit-menu";
|
|
6
|
+
export interface MenuProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
title?: string;
|
|
9
|
+
menuId?: string;
|
|
10
|
+
position?: 'left' | 'right';
|
|
11
|
+
trigger?: React.ComponentType<ButtonMenuTriggerProps>;
|
|
12
|
+
testId?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IMenuSubComponents {
|
|
15
|
+
Section: typeof MenuSection;
|
|
16
|
+
Item: typeof MenuItem;
|
|
17
|
+
}
|
|
18
|
+
declare const MemoMenu: import('react').MemoExoticComponent<({ defaultOpen, title, position, trigger, menuId, testId, children, className, ...props }: MenuProps) => import("react/jsx-runtime").JSX.Element>;
|
|
19
|
+
declare const MenuWithSubComponents: typeof MemoMenu & IMenuSubComponents;
|
|
20
|
+
export default MenuWithSubComponents;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes } from 'react';
|
|
2
|
+
export declare const NAME = "ucl-uikit-menu__content";
|
|
3
|
+
export interface MenuContentProps extends HTMLAttributes<HTMLUListElement> {
|
|
4
|
+
title?: string;
|
|
5
|
+
testId?: string;
|
|
6
|
+
position?: 'left' | 'right';
|
|
7
|
+
}
|
|
8
|
+
declare const _default: React.NamedExoticComponent<MenuContentProps>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React, LiHTMLAttributes } from 'react';
|
|
2
|
+
export declare const NAME = "ucl-uikit-menu__item";
|
|
3
|
+
export interface MenuItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
4
|
+
testId?: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
secondary?: boolean;
|
|
7
|
+
externalLink?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.NamedExoticComponent<MenuItemProps>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes } from 'react';
|
|
2
|
+
export declare const NAME = "ucl-uikit-menu__section";
|
|
3
|
+
export interface MenuSectionProps extends HTMLAttributes<HTMLLIElement> {
|
|
4
|
+
testId?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const MenuSection: React.FC<MenuSectionProps>;
|
|
7
|
+
export default MenuSection;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default } from './Menu';
|
|
2
|
+
export type { MenuProps } from './Menu';
|
|
3
|
+
export { default as MenuContent } from './MenuContent';
|
|
4
|
+
export type { MenuContentProps } from './MenuContent';
|
|
5
|
+
export { default as ButtonMenuTrigger } from './trigger/ButtonMenuTrigger';
|
|
6
|
+
export type { ButtonMenuTriggerProps } from './trigger/ButtonMenuTrigger';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IconButtonProps } from '../../IconButton';
|
|
2
|
+
export declare const NAME = "ucl-uikit-menu__trigger--button";
|
|
3
|
+
export declare const DEFAULT_ARIA_LABEL = "Menu button";
|
|
4
|
+
export interface ButtonMenuTriggerProps extends IconButtonProps {
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import('react').MemoExoticComponent<({ id, ariaLabel, className, ...props }: ButtonMenuTriggerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IconButtonProps } from '../../IconButton';
|
|
2
|
+
export declare const NAME = "ucl-uikit-menu__trigger--icon";
|
|
3
|
+
export declare const DEFAULT_ARIA_LABEL = "Menu button";
|
|
4
|
+
export interface IconMenuTriggerProps extends IconButtonProps {
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import('react').MemoExoticComponent<({ id, ariaLabel, className, ...props }: IconMenuTriggerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
export default _default;
|
|
@@ -96,7 +96,7 @@ declare const meta: {
|
|
|
96
96
|
results?: number | undefined | undefined;
|
|
97
97
|
security?: string | undefined | undefined;
|
|
98
98
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
99
|
-
popover?: "" | "auto" | "manual" | undefined | undefined;
|
|
99
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined | undefined;
|
|
100
100
|
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
101
101
|
popoverTarget?: string | undefined | undefined;
|
|
102
102
|
inert?: boolean | undefined | undefined;
|
|
@@ -177,18 +177,18 @@ declare const meta: {
|
|
|
177
177
|
onFocusCapture?: import('react').FocusEventHandler<HTMLDivElement> | undefined;
|
|
178
178
|
onBlur?: import('react').FocusEventHandler<HTMLDivElement> | undefined;
|
|
179
179
|
onBlurCapture?: import('react').FocusEventHandler<HTMLDivElement> | undefined;
|
|
180
|
-
onChange?: import('react').
|
|
181
|
-
onChangeCapture?: import('react').
|
|
180
|
+
onChange?: import('react').ChangeEventHandler<HTMLDivElement, Element> | undefined;
|
|
181
|
+
onChangeCapture?: import('react').ChangeEventHandler<HTMLDivElement, Element> | undefined;
|
|
182
182
|
onBeforeInput?: import('react').InputEventHandler<HTMLDivElement> | undefined;
|
|
183
|
-
onBeforeInputCapture?: import('react').
|
|
184
|
-
onInput?: import('react').
|
|
185
|
-
onInputCapture?: import('react').
|
|
186
|
-
onReset?: import('react').
|
|
187
|
-
onResetCapture?: import('react').
|
|
188
|
-
onSubmit?: import('react').
|
|
189
|
-
onSubmitCapture?: import('react').
|
|
190
|
-
onInvalid?: import('react').
|
|
191
|
-
onInvalidCapture?: import('react').
|
|
183
|
+
onBeforeInputCapture?: import('react').InputEventHandler<HTMLDivElement> | undefined;
|
|
184
|
+
onInput?: import('react').InputEventHandler<HTMLDivElement> | undefined;
|
|
185
|
+
onInputCapture?: import('react').InputEventHandler<HTMLDivElement> | undefined;
|
|
186
|
+
onReset?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
187
|
+
onResetCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
188
|
+
onSubmit?: import('react').SubmitEventHandler<HTMLDivElement> | undefined;
|
|
189
|
+
onSubmitCapture?: import('react').SubmitEventHandler<HTMLDivElement> | undefined;
|
|
190
|
+
onInvalid?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
191
|
+
onInvalidCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
192
192
|
onLoad?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
193
193
|
onLoadCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
194
194
|
onError?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { MarginProps } from '../common/marginsStyle';
|
|
3
|
+
export declare const NAME = "ucl-uikit-paragrah";
|
|
4
|
+
export type ParagraphLevel = 'lg' | 'lg-medium' | 'lg-semibold' | 'lg-bold' | 'md' | 'md-medium' | 'md-semibold' | 'md-semibold' | 'md-medium-numeric' | 'sm' | 'sm-medium' | 'sm-semibold' | 'xs' | 'xs-medium';
|
|
5
|
+
export interface ParagraphBaseProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
6
|
+
level?: ParagraphLevel;
|
|
7
|
+
as?: 'p' | 'div' | 'span';
|
|
8
|
+
testId?: string;
|
|
9
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
10
|
+
}
|
|
11
|
+
export type ParagraphProps = ParagraphBaseProps & MarginProps;
|
|
12
|
+
declare const _default: import('react').MemoExoticComponent<({ level, as, testId, className, ref, ...props }: ParagraphProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
|
+
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { SelectProps } from './Select.types';
|
|
2
|
-
|
|
2
|
+
type SelectComponent = <T extends string | number = string>(props: SelectProps<T>) => React.JSX.Element;
|
|
3
|
+
declare const Select: SelectComponent;
|
|
3
4
|
export default Select;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: <T extends string | number = string>(props: import('./Select.types').SelectProps<T>) =>
|
|
4
|
+
component: <T extends string | number = string>(props: import('./Select.types').SelectProps<T>) => React.JSX.Element;
|
|
5
5
|
argTypes: {
|
|
6
6
|
selectionBehaviour: {
|
|
7
7
|
description: string;
|
|
@@ -99,6 +99,17 @@ declare const meta: {
|
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
|
+
clearable: {
|
|
103
|
+
description: string;
|
|
104
|
+
control: {
|
|
105
|
+
type: "boolean";
|
|
106
|
+
};
|
|
107
|
+
table: {
|
|
108
|
+
type: {
|
|
109
|
+
summary: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
102
113
|
filterInputProps: {
|
|
103
114
|
description: string;
|
|
104
115
|
control: {
|
|
@@ -202,4 +213,5 @@ export declare const WithPlaceholder: Story;
|
|
|
202
213
|
export declare const SingleLongOption: Story;
|
|
203
214
|
export declare const ManyOptions: Story;
|
|
204
215
|
export declare const filterable: Story;
|
|
216
|
+
export declare const Clearable: Story;
|
|
205
217
|
export declare const SelectionBehaviourCommit: Story;
|
|
@@ -26,10 +26,7 @@ export type OptionData<T> = {
|
|
|
26
26
|
* Additional props forwarded to the filter input when `filterable` is true
|
|
27
27
|
*/
|
|
28
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.
|
|
31
|
-
*/
|
|
32
|
-
export interface SelectProps<T = string | number> extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
29
|
+
type SelectBaseProps<T = string | number> = Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {
|
|
33
30
|
/**
|
|
34
31
|
* Controls keyboard selection behaviour in the custom select variant.
|
|
35
32
|
* - `focus` (default): arrow keys move focus and commit value immediately.
|
|
@@ -72,10 +69,6 @@ export interface SelectProps<T = string | number> extends Omit<React.HTMLAttribu
|
|
|
72
69
|
* Extra attributes forwarded to the native <select> when `native` is true
|
|
73
70
|
*/
|
|
74
71
|
nativeHtmlAttributes?: React.SelectHTMLAttributes<HTMLSelectElement>;
|
|
75
|
-
/**
|
|
76
|
-
* Current value (controlled)
|
|
77
|
-
*/
|
|
78
|
-
value?: T;
|
|
79
72
|
/**
|
|
80
73
|
* Disable interaction
|
|
81
74
|
*/
|
|
@@ -92,16 +85,49 @@ export interface SelectProps<T = string | number> extends Omit<React.HTMLAttribu
|
|
|
92
85
|
* Custom className for the options panel
|
|
93
86
|
*/
|
|
94
87
|
panelClassName?: string;
|
|
95
|
-
/**
|
|
96
|
-
* Change handler for the custom variant
|
|
97
|
-
*/
|
|
98
|
-
onValueChange?: (value: T, ev: React.UIEvent) => void;
|
|
99
88
|
/**
|
|
100
89
|
* Ref forwarded to the rendered element
|
|
101
90
|
* (div for custom, select for native)
|
|
102
91
|
*/
|
|
103
92
|
ref?: React.Ref<HTMLDivElement | HTMLSelectElement | null>;
|
|
104
|
-
}
|
|
93
|
+
};
|
|
94
|
+
export type NonClearableSelectProps<T = string | number> = SelectBaseProps<T> & {
|
|
95
|
+
/**
|
|
96
|
+
* Current value (controlled)
|
|
97
|
+
*/
|
|
98
|
+
value?: T;
|
|
99
|
+
/**
|
|
100
|
+
* Show a clear action in the custom variant when a value is selected
|
|
101
|
+
*/
|
|
102
|
+
clearable?: false | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Change handler for the custom variant
|
|
105
|
+
*/
|
|
106
|
+
onValueChange?: (value: T, ev: React.SyntheticEvent) => void;
|
|
107
|
+
};
|
|
108
|
+
export type ClearableSelectProps<T = string | number> = SelectBaseProps<T> & {
|
|
109
|
+
/**
|
|
110
|
+
* Current value (controlled)
|
|
111
|
+
*/
|
|
112
|
+
value?: T | null;
|
|
113
|
+
/**
|
|
114
|
+
* Show a clear action in the custom variant when a value is selected
|
|
115
|
+
*/
|
|
116
|
+
clearable: true;
|
|
117
|
+
/**
|
|
118
|
+
* Change handler for the custom variant
|
|
119
|
+
*/
|
|
120
|
+
onValueChange?: (value: T | null, ev: React.SyntheticEvent) => void;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Public props for <Select>, used by both custom and native render paths.
|
|
124
|
+
*/
|
|
125
|
+
export type SelectProps<T = string | number> = NonClearableSelectProps<T> | ClearableSelectProps<T>;
|
|
126
|
+
export type InternalSelectProps<T = string | number> = SelectBaseProps<T> & {
|
|
127
|
+
value?: T | null;
|
|
128
|
+
clearable?: boolean;
|
|
129
|
+
onValueChange?: (value: T | null, ev: React.SyntheticEvent) => void;
|
|
130
|
+
};
|
|
105
131
|
/**
|
|
106
132
|
* Each option as displayed in the Panel of <CustomSelect>
|
|
107
133
|
* Roughly equivalent to a custom version of <option>
|
|
@@ -114,3 +140,4 @@ export interface CustomOptionProps<T> extends Omit<React.HTMLAttributes<HTMLDivE
|
|
|
114
140
|
onSelect: (event: React.MouseEvent, value: T, optionIndex?: number) => void;
|
|
115
141
|
lineBreak?: boolean;
|
|
116
142
|
}
|
|
143
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type CustomSelectProps<T> = Omit<
|
|
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;
|
|
1
|
+
import { InternalSelectProps } from '../Select.types';
|
|
2
|
+
type CustomSelectProps<T> = Omit<InternalSelectProps<T>, 'native' | 'nativeHtmlAttributes'>;
|
|
3
|
+
declare const CustomSelect: <T extends string | number>({ selectionBehaviour, value, options, onValueChange, disabled, clearable, placeholder, lineBreak, filterInputProps, width, testId, className, panelClassName, filterable, ref, ...props }: CustomSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default CustomSelect;
|
|
@@ -2,6 +2,8 @@ import { FilterInputProps } from '../Select.types';
|
|
|
2
2
|
type FilterInputComponentProps = {
|
|
3
3
|
value: string;
|
|
4
4
|
onChange: (value: string) => void;
|
|
5
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
6
|
+
onTabOut?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
5
7
|
placeholder?: string;
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
inputRef?: React.RefObject<HTMLInputElement | null>;
|
|
@@ -10,5 +12,5 @@ type FilterInputComponentProps = {
|
|
|
10
12
|
ariaExpanded?: boolean;
|
|
11
13
|
ariaActiveDescendant?: string;
|
|
12
14
|
} & FilterInputProps;
|
|
13
|
-
declare const FilterInput: ({ value, onChange, placeholder, disabled, inputRef, className, ariaControls, ariaExpanded, ariaActiveDescendant, ...rest }: FilterInputComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const FilterInput: ({ value, onChange, onBlur, onTabOut, placeholder, disabled, inputRef, className, ariaControls, ariaExpanded, ariaActiveDescendant, ...rest }: FilterInputComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export default FilterInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type NativeSelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'defaultValue'> & Omit<
|
|
1
|
+
import { InternalSelectProps } from '../Select.types';
|
|
2
|
+
type NativeSelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'defaultValue'> & Omit<InternalSelectProps, 'native' | 'filterable' | 'nativeHtmlAttributes' | 'onValueChange' | 'ref'> & {
|
|
3
3
|
value?: string | number;
|
|
4
4
|
ref?: React.Ref<HTMLSelectElement>;
|
|
5
5
|
};
|
|
@@ -5,7 +5,10 @@ interface VisibleFieldProps<T> {
|
|
|
5
5
|
selectedOption: OptionData<T> | null | undefined;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
filterable?: boolean;
|
|
8
|
+
clearable?: boolean;
|
|
9
|
+
onClear?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
10
|
+
clearButtonRef?: React.RefObject<HTMLButtonElement | null>;
|
|
8
11
|
children?: React.ReactNode;
|
|
9
12
|
}
|
|
10
|
-
declare const VisibleField: <T extends string | number>({ selectedOption, isOpen, placeholder, disabled, filterable, children, }: VisibleFieldProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const VisibleField: <T extends string | number>({ selectedOption, isOpen, placeholder, disabled, filterable, clearable, onClear, clearButtonRef, children, }: VisibleFieldProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
export default VisibleField;
|
|
@@ -2,7 +2,9 @@ import { SVGAttributes } from 'react';
|
|
|
2
2
|
export declare const NAME = "ucl-uikit-spinner";
|
|
3
3
|
export interface SpinnerProps extends SVGAttributes<SVGSVGElement> {
|
|
4
4
|
size?: number;
|
|
5
|
+
strokeWidth?: number;
|
|
5
6
|
testId?: string;
|
|
7
|
+
inheritColour?: boolean;
|
|
6
8
|
}
|
|
7
9
|
declare const _default: import('react').NamedExoticComponent<SpinnerProps & import('react').RefAttributes<SVGSVGElement>>;
|
|
8
10
|
export default _default;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { default as React, ComponentPropsWithoutRef, ElementType, ReactElement } from 'react';
|
|
2
2
|
import { IconProps } from '../Icon';
|
|
3
3
|
import { BaseLinkProps } from '../Link/BaseLink';
|
|
4
4
|
import { MarginProps } from '../common/marginsStyle';
|
|
5
|
-
|
|
5
|
+
type StandaloneLinkOwnProps = {
|
|
6
6
|
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
7
7
|
icon?: ReactElement<IconProps>;
|
|
8
8
|
iconPosition?: 'left' | 'right';
|
|
9
|
-
}
|
|
10
|
-
export type StandaloneLinkProps =
|
|
11
|
-
|
|
9
|
+
};
|
|
10
|
+
export type StandaloneLinkProps<C extends ElementType = 'a'> = StandaloneLinkOwnProps & BaseLinkProps<C> & MarginProps & Omit<ComponentPropsWithoutRef<C>, keyof StandaloneLinkOwnProps>;
|
|
11
|
+
type StandaloneLinkComponent = <C extends ElementType = 'a'>(props: StandaloneLinkProps<C> & {
|
|
12
|
+
ref?: React.ComponentPropsWithRef<C>['ref'];
|
|
13
|
+
}) => React.JSX.Element;
|
|
14
|
+
declare const StandaloneLink: StandaloneLinkComponent;
|
|
12
15
|
export default StandaloneLink;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import('react').
|
|
4
|
+
component: <C extends import('react').ElementType = "a">(props: import('./StandaloneLink').StandaloneLinkProps<C> & {
|
|
5
|
+
ref?: React.ComponentPropsWithRef<C>["ref"];
|
|
6
|
+
}) => React.JSX.Element;
|
|
5
7
|
args: {
|
|
6
8
|
children: string;
|
|
7
9
|
href: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TableProps } from './Table.types';
|
|
2
2
|
declare const Table: {
|
|
3
|
-
({ testId, className, children, ref, ...props }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ testId, className, children, ref, ariaLabel, ...props }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
Head: ({ className, children, ...props }: import('./subcomponents').TableHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
HeadCell: ({ variant, accessor, sort, onSortChange, showSortIcon, checked, onCheck, testId, className, children, ...props }: import('./subcomponents').TableHeadCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
HeadCell: ({ variant, accessor, sort, onSortChange, showSortIcon, checked, onCheck, testId, className, children, checkboxAriaLabel, ...props }: import('./subcomponents').TableHeadCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Body: ({ className, children, ...props }: import('./subcomponents').TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
Row: ({ selected, className, children, ...props }: import('./subcomponents').TableRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
Cell: ({ variant, icon, onCheck, checked, onButtonClick, testId, className, children, ...props }: import('./subcomponents').TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Cell: ({ variant, icon, onCheck, checked, onButtonClick, testId, className, children, checkboxProps, buttonProps, ...props }: import('./subcomponents').TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
};
|
|
10
10
|
export default Table;
|
|
@@ -2,12 +2,12 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: {
|
|
5
|
-
({ testId, className, children, ref, ...props }: import('./Table.types').TableProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
({ testId, className, children, ref, ariaLabel, ...props }: import('./Table.types').TableProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Head: ({ className, children, ...props }: import('./subcomponents').TableHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
HeadCell: ({ variant, accessor, sort, onSortChange, showSortIcon, checked, onCheck, testId, className, children, ...props }: import('./subcomponents').TableHeadCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
HeadCell: ({ variant, accessor, sort, onSortChange, showSortIcon, checked, onCheck, testId, className, children, checkboxAriaLabel, ...props }: import('./subcomponents').TableHeadCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
Body: ({ className, children, ...props }: import('./subcomponents').TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
Row: ({ selected, className, children, ...props }: import('./subcomponents').TableRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
Cell: ({ variant, icon, onCheck, checked, onButtonClick, testId, className, children, ...props }: import('./subcomponents').TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Cell: ({ variant, icon, onCheck, checked, onButtonClick, testId, className, children, checkboxProps, buttonProps, ...props }: import('./subcomponents').TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
};
|
|
12
12
|
parameters: {
|
|
13
13
|
layout: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ColumnVariant } from '../../Table.types';
|
|
2
|
+
import { CheckboxProps } from '../../../Checkbox/Checkbox';
|
|
3
|
+
import { ButtonProps } from '../../../Button';
|
|
2
4
|
export interface TableCellProps extends React.HTMLAttributes<HTMLTableCellElement> {
|
|
3
5
|
variant?: ColumnVariant;
|
|
4
6
|
icon?: React.ReactNode;
|
|
@@ -7,6 +9,8 @@ export interface TableCellProps extends React.HTMLAttributes<HTMLTableCellElemen
|
|
|
7
9
|
onButtonClick?: (event: React.UIEvent) => void;
|
|
8
10
|
className?: string;
|
|
9
11
|
testId?: string;
|
|
12
|
+
checkboxProps?: Omit<CheckboxProps, 'checked' | 'onChange'>;
|
|
13
|
+
buttonProps?: Omit<ButtonProps<'button'>, 'variant' | 'onClick' | 'className'>;
|
|
10
14
|
}
|
|
11
|
-
declare const Cell: ({ variant, icon, onCheck, checked, onButtonClick, testId, className, children, ...props }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const Cell: ({ variant, icon, onCheck, checked, onButtonClick, testId, className, children, checkboxProps, buttonProps, ...props }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
16
|
export default Cell;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ variant, icon, onCheck, checked, onButtonClick, testId, className, children, ...props }: import('./Cell').TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ variant, icon, onCheck, checked, onButtonClick, testId, className, children, checkboxProps, buttonProps, ...props }: import('./Cell').TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
@@ -17,6 +17,8 @@ declare const meta: {
|
|
|
17
17
|
onButtonClick?: ((event: React.UIEvent) => void) | undefined;
|
|
18
18
|
className?: string | undefined;
|
|
19
19
|
testId?: string | undefined;
|
|
20
|
+
checkboxProps?: Omit<import('../../..').CheckboxProps, "checked" | "onChange"> | undefined;
|
|
21
|
+
buttonProps?: Omit<import('../../..').ButtonProps<"button">, "variant" | "onClick" | "className"> | undefined;
|
|
20
22
|
defaultChecked?: boolean | undefined | undefined;
|
|
21
23
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
22
24
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
@@ -63,7 +65,7 @@ declare const meta: {
|
|
|
63
65
|
results?: number | undefined | undefined;
|
|
64
66
|
security?: string | undefined | undefined;
|
|
65
67
|
unselectable?: "on" | "off" | undefined | undefined;
|
|
66
|
-
popover?: "" | "auto" | "manual" | undefined | undefined;
|
|
68
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined | undefined;
|
|
67
69
|
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
68
70
|
popoverTarget?: string | undefined | undefined;
|
|
69
71
|
inert?: boolean | undefined | undefined;
|
|
@@ -144,18 +146,18 @@ declare const meta: {
|
|
|
144
146
|
onFocusCapture?: import('react').FocusEventHandler<HTMLTableCellElement> | undefined;
|
|
145
147
|
onBlur?: import('react').FocusEventHandler<HTMLTableCellElement> | undefined;
|
|
146
148
|
onBlurCapture?: import('react').FocusEventHandler<HTMLTableCellElement> | undefined;
|
|
147
|
-
onChange?: import('react').
|
|
148
|
-
onChangeCapture?: import('react').
|
|
149
|
+
onChange?: import('react').ChangeEventHandler<HTMLTableCellElement, Element> | undefined;
|
|
150
|
+
onChangeCapture?: import('react').ChangeEventHandler<HTMLTableCellElement, Element> | undefined;
|
|
149
151
|
onBeforeInput?: import('react').InputEventHandler<HTMLTableCellElement> | undefined;
|
|
150
|
-
onBeforeInputCapture?: import('react').
|
|
151
|
-
onInput?: import('react').
|
|
152
|
-
onInputCapture?: import('react').
|
|
153
|
-
onReset?: import('react').
|
|
154
|
-
onResetCapture?: import('react').
|
|
155
|
-
onSubmit?: import('react').
|
|
156
|
-
onSubmitCapture?: import('react').
|
|
157
|
-
onInvalid?: import('react').
|
|
158
|
-
onInvalidCapture?: import('react').
|
|
152
|
+
onBeforeInputCapture?: import('react').InputEventHandler<HTMLTableCellElement> | undefined;
|
|
153
|
+
onInput?: import('react').InputEventHandler<HTMLTableCellElement> | undefined;
|
|
154
|
+
onInputCapture?: import('react').InputEventHandler<HTMLTableCellElement> | undefined;
|
|
155
|
+
onReset?: import('react').ReactEventHandler<HTMLTableCellElement> | undefined;
|
|
156
|
+
onResetCapture?: import('react').ReactEventHandler<HTMLTableCellElement> | undefined;
|
|
157
|
+
onSubmit?: import('react').SubmitEventHandler<HTMLTableCellElement> | undefined;
|
|
158
|
+
onSubmitCapture?: import('react').SubmitEventHandler<HTMLTableCellElement> | undefined;
|
|
159
|
+
onInvalid?: import('react').ReactEventHandler<HTMLTableCellElement> | undefined;
|
|
160
|
+
onInvalidCapture?: import('react').ReactEventHandler<HTMLTableCellElement> | undefined;
|
|
159
161
|
onLoad?: import('react').ReactEventHandler<HTMLTableCellElement> | undefined;
|
|
160
162
|
onLoadCapture?: import('react').ReactEventHandler<HTMLTableCellElement> | undefined;
|
|
161
163
|
onError?: import('react').ReactEventHandler<HTMLTableCellElement> | undefined;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { CheckboxProps } from '../../../Checkbox/Checkbox';
|
|
2
|
+
import { ButtonProps } from '../../../Button';
|
|
1
3
|
import { ColumnVariant } from '../../Table.types';
|
|
2
4
|
interface CellContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
5
|
variant: ColumnVariant;
|
|
4
6
|
icon?: React.ReactNode;
|
|
5
7
|
checked?: boolean;
|
|
8
|
+
checkboxProps?: Omit<CheckboxProps, 'checked' | 'onChange'>;
|
|
9
|
+
buttonProps?: Omit<ButtonProps<'button'>, 'variant' | 'onClick' | 'className'>;
|
|
6
10
|
handleCheckboxChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
11
|
handleButtonClick: (event: React.UIEvent) => void;
|
|
8
12
|
}
|
|
9
|
-
declare const CellContent: ({ variant, icon, checked, handleCheckboxChange, handleButtonClick, children, }: CellContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const CellContent: ({ variant, icon, checked, checkboxProps, buttonProps, handleCheckboxChange, handleButtonClick, children, }: CellContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
export default CellContent;
|
|
@@ -8,6 +8,7 @@ export interface TableHeadCellProps extends React.HTMLAttributes<HTMLTableCellEl
|
|
|
8
8
|
checked?: boolean;
|
|
9
9
|
onCheck?: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
10
|
testId?: string;
|
|
11
|
+
checkboxAriaLabel?: string;
|
|
11
12
|
}
|
|
12
|
-
declare const HeadCell: ({ variant, accessor, sort, onSortChange, showSortIcon, checked, onCheck, testId, className, children, ...props }: TableHeadCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const HeadCell: ({ variant, accessor, sort, onSortChange, showSortIcon, checked, onCheck, testId, className, children, checkboxAriaLabel, ...props }: TableHeadCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export default HeadCell;
|