@royaloperahouse/chord 2.2.3-chord-development → 2.2.3-e-chord-development-chord-development
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/dist/chord.cjs.development.js +255 -106
- package/dist/chord.cjs.development.js.map +1 -1
- package/dist/chord.cjs.production.min.js +1 -1
- package/dist/chord.cjs.production.min.js.map +1 -1
- package/dist/chord.esm.js +256 -108
- package/dist/chord.esm.js.map +1 -1
- package/dist/components/atoms/TextField/TextField.d.ts +21 -20
- package/dist/components/atoms/TextField/TextField.style.d.ts +6 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/molecules/AuxiliaryNav/AuxiliaryNav.d.ts +21 -0
- package/dist/components/molecules/AuxiliaryNav/AuxiliaryNav.styles.d.ts +10 -0
- package/dist/components/molecules/AuxiliaryNav/index.d.ts +2 -0
- package/dist/components/molecules/PasswordStrength/PasswordStrength.d.ts +33 -0
- package/dist/components/molecules/PasswordStrength/PasswordStrength.styles.d.ts +13 -0
- package/dist/components/molecules/PasswordStrength/index.d.ts +2 -0
- package/dist/components/molecules/index.d.ts +3 -1
- package/dist/components/organisms/ModalWindow/ModalWindow.d.ts +68 -0
- package/dist/components/organisms/ModalWindow/ModalWindow.style.d.ts +4 -0
- package/dist/components/organisms/ModalWindow/index.d.ts +2 -0
- package/dist/components/organisms/index.d.ts +2 -1
- package/dist/index.d.ts +3 -2
- package/dist/types/auxiliaryNav.d.ts +21 -0
- package/dist/types/formTypes.d.ts +16 -4
- package/dist/types/index.d.ts +2 -1
- package/dist/types/modalWindow.d.ts +20 -0
- package/dist/types/passwordStrength.d.ts +51 -0
- package/package.json +5 -2
|
@@ -1,41 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ITextFieldProps } from '../../../types/formTypes';
|
|
2
3
|
/**
|
|
3
4
|
* A text field component, that wraps around the native `<input />` element
|
|
4
|
-
* and adds some extra information around it (i.e. a text
|
|
5
|
+
* and adds some extra states and information around it (i.e. a text and an error labels,
|
|
6
|
+
* error state, show/hide button for password field).
|
|
5
7
|
*
|
|
6
|
-
* #
|
|
8
|
+
* # Label
|
|
7
9
|
* You can use this component just like you would use a regular `<input />` element,
|
|
8
10
|
* just with the extra `label` prop, to set the label of the content. For example:
|
|
9
11
|
* ```tsx
|
|
10
12
|
* <TextField label="This is a label" />
|
|
11
13
|
* ```
|
|
12
14
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* ```
|
|
15
|
+
* # Error state
|
|
16
|
+
* An error label will be shown below the text input field if the `error` prop exists.
|
|
17
|
+
* Also input will be rendered with a red border. An empty string can be passed to
|
|
18
|
+
* render only error state without error message.
|
|
18
19
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
20
|
+
* # Password mode
|
|
21
|
+
* If type `password` provided this will be rendered with the `Show/Hide` button over the input field.
|
|
22
|
+
* Clicking on that changes type to `text` and back to `password`.
|
|
21
23
|
*
|
|
22
24
|
* # Light / Dark mode
|
|
23
25
|
* The component can also adapt its styles for light / dark mode. If you want this component
|
|
24
26
|
* to be rendered on a dark / coloured background, you can use the `darkMode` prop.
|
|
25
27
|
* ```tsx
|
|
26
28
|
* <div>
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* <
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* <
|
|
35
|
-
*
|
|
36
|
-
* </BlueBackgroundContainer>
|
|
29
|
+
* <WhiteBackgroundContainer>
|
|
30
|
+
* <TextField label="..." />
|
|
31
|
+
* </WhiteBackgroundContainer>
|
|
32
|
+
* <BlackBackgroundContainer>
|
|
33
|
+
* <TextField darkMode label="..." />
|
|
34
|
+
* </BlackBackgroundContainer>
|
|
35
|
+
* <BlueBackgroundContainer>
|
|
36
|
+
* <TextField darkMode label="..." />
|
|
37
|
+
* </BlueBackgroundContainer>
|
|
37
38
|
* </div>
|
|
38
39
|
* ```
|
|
39
40
|
*/
|
|
40
|
-
declare const TextField:
|
|
41
|
+
declare const TextField: React.ForwardRefExoticComponent<ITextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
41
42
|
export default TextField;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ITextFieldProps } from '../../../types/formTypes';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const InputWrapper: import("styled-components").StyledComponent<"div", any, Pick<ITextFieldProps, "width">, never>;
|
|
4
|
+
export declare const Input: import("styled-components").StyledComponent<"input", any, Pick<ITextFieldProps, "error" | "darkMode"> & {
|
|
5
|
+
isPasswordField: boolean;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const ShowHideButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
4
8
|
export declare const TextLabel: import("styled-components").StyledComponent<"p", any, Pick<ITextFieldProps, "darkMode">, never>;
|
|
5
9
|
export declare const ErrorLabel: import("styled-components").StyledComponent<"p", any, Pick<ITextFieldProps, "darkMode">, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AltHeader, BodyText, CinemaBadge, ControlledDropdown, Grid, GridItem, Header, Icon, ImageAspectRatioWrapper, Overline, PrimaryButton, Progress, Radio, RotatorButtons, SecondaryButton, SecondaryLogo, TertiaryButton, SectionSplitter, Sponsorship, Stepper, StreamBadge, Subtitle, Tab, TabLink, TextLogo, TextArea, TextField, TextLink, Tickbox, Timer, TypeTags, VideoControls } from './atoms';
|
|
2
2
|
import { AnchorTabBar, Footer, LiveChat, Navigation, StickyBar, TitleWithCTA, UpsellSection } from './organisms';
|
|
3
|
-
import { Accordion, Accordions, AnnouncementBanner, Card, Cards, ContactCard, ContentSummary, CreditListing, Editorial, ImageWithCaption, Information, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PeopleListing, PromoWithTags, PromoWithTitle, RadioGroup, ReadMore, SearchBar, SectionTitle, Select, Tabs, TextOnly, UpsellCard, Quote } from './molecules';
|
|
3
|
+
import { Accordion, Accordions, AnnouncementBanner, AuxiliaryNav, Card, Cards, ContactCard, ContentSummary, CreditListing, Editorial, ImageWithCaption, Information, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, PasswordStrength, Pagination, PeopleListing, PromoWithTags, PromoWithTitle, RadioGroup, ReadMore, SearchBar, SectionTitle, Select, Tabs, TextOnly, UpsellCard, Quote } from './molecules';
|
|
4
4
|
import ThemeProvider from '../styles/ThemeProvider';
|
|
5
5
|
import GlobalStyles from '../styles/GlobalStyles';
|
|
6
|
-
export { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, BodyText, Card, Cards, ContactCard, ContentSummary, CinemaBadge, ControlledDropdown, CreditListing, Editorial, Footer, GlobalStyles, Grid, GridItem, Header, Icon, ImageAspectRatioWrapper, ImageWithCaption, Information, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, RadioGroup, ReadMore, RotatorButtons, SecondaryButton, SecondaryLogo, SearchBar, SectionTitle, Select, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, TertiaryButton, TextOnly, ThemeProvider, TitleWithCTA, SectionSplitter, Tab, TabLink, Tabs, TextArea, TextField, TextLink, TextLogo, Tickbox, Timer, TypeTags, UpsellCard, UpsellSection, Quote, LiveChat, VideoControls, };
|
|
6
|
+
export { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, BodyText, Card, Cards, ContactCard, ContentSummary, CinemaBadge, ControlledDropdown, CreditListing, Editorial, Footer, GlobalStyles, Grid, GridItem, Header, Icon, ImageAspectRatioWrapper, ImageWithCaption, Information, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, RadioGroup, ReadMore, RotatorButtons, SecondaryButton, SecondaryLogo, SearchBar, SectionTitle, Select, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, TertiaryButton, TextOnly, ThemeProvider, TitleWithCTA, SectionSplitter, Tab, TabLink, Tabs, TextArea, TextField, TextLink, TextLogo, Tickbox, Timer, TypeTags, UpsellCard, UpsellSection, Quote, LiveChat, VideoControls, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { IAuxiliaryNavProps } from '../../../types/auxiliaryNav';
|
|
3
|
+
/**
|
|
4
|
+
* Vertical menu component uses for navigation
|
|
5
|
+
* inside website chapter. It looks like a vertical
|
|
6
|
+
* list with clickable items on desktop and dropdown
|
|
7
|
+
* list on mobile.
|
|
8
|
+
*
|
|
9
|
+
* ## Menu items
|
|
10
|
+
* Menu items should be passed as `items` prop. This
|
|
11
|
+
* should be an array of objects. Each object should
|
|
12
|
+
* have `text` (text displayed as a menu item) and
|
|
13
|
+
* `onClick` (click handler function)
|
|
14
|
+
*
|
|
15
|
+
* ## Active menu item
|
|
16
|
+
* Active menu item should be passed as component `activeItem`
|
|
17
|
+
* prop. This indicates on which menu item should be highlighted
|
|
18
|
+
* as active one. Should be equal to `text` prop from one of the `items`
|
|
19
|
+
*/
|
|
20
|
+
declare const AuxiliaryNav: FunctionComponent<IAuxiliaryNavProps>;
|
|
21
|
+
export default AuxiliaryNav;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const MenuContainer: import("styled-components").StyledComponent<"menu", any, {}, never>;
|
|
2
|
+
export declare const MenuList: import("styled-components").StyledComponent<"ul", any, {
|
|
3
|
+
mobileOpen: boolean;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const MenuItem: import("styled-components").StyledComponent<"button", any, {
|
|
6
|
+
active: boolean;
|
|
7
|
+
}, never>;
|
|
8
|
+
export declare const MobileButton: import("styled-components").StyledComponent<"button", any, {
|
|
9
|
+
mobileOpen: boolean;
|
|
10
|
+
}, never>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { IPasswordStrengthProps } from '../../../types/passwordStrength';
|
|
3
|
+
/**
|
|
4
|
+
* Password strength indicator component.
|
|
5
|
+
* This renders some number of lines (6 by default)
|
|
6
|
+
* which should become active when the user improves
|
|
7
|
+
* the strength of the entered password.
|
|
8
|
+
*
|
|
9
|
+
* ## Sections
|
|
10
|
+
* To set number of sections it should be passed
|
|
11
|
+
* as `sections` prop.
|
|
12
|
+
*
|
|
13
|
+
* ## Active section
|
|
14
|
+
* To set number of active sections it should be passed
|
|
15
|
+
* as `activeSections` prop.
|
|
16
|
+
*
|
|
17
|
+
* ## Colors
|
|
18
|
+
* Color of every element can be controlled by properties:
|
|
19
|
+
* `sectionsColor`, `activeSectionsColor`,
|
|
20
|
+
* `textColor`, `strengthLabelColor`.
|
|
21
|
+
*
|
|
22
|
+
* ## Text
|
|
23
|
+
* `text` prop is used to render some message.
|
|
24
|
+
* For example error (together with proper red color)
|
|
25
|
+
* or some password requirement. It can be empty.
|
|
26
|
+
*
|
|
27
|
+
* ## Strength label
|
|
28
|
+
* `strengthLabel` prop is used to render strength characteristic
|
|
29
|
+
* of entered password. For example: `weak`, `normal`, `strong`, etc.
|
|
30
|
+
* It can be empty.
|
|
31
|
+
*/
|
|
32
|
+
declare const PasswordStrength: FunctionComponent<IPasswordStrengthProps>;
|
|
33
|
+
export default PasswordStrength;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Colors } from '../../../types/types';
|
|
2
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const Sections: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const Section: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
color: Colors;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const BottomLine: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const Text: import("styled-components").StyledComponent<"div", any, {
|
|
9
|
+
color: Colors;
|
|
10
|
+
}, never>;
|
|
11
|
+
export declare const LabelText: import("styled-components").StyledComponent<"div", any, {
|
|
12
|
+
color: Colors;
|
|
13
|
+
}, never>;
|
|
@@ -23,4 +23,6 @@ import ImageWithCaption from './ImageWithCaption';
|
|
|
23
23
|
import Quote from './Quote';
|
|
24
24
|
import MiniCard from './MiniCard';
|
|
25
25
|
import ReadMore from './ReadMore';
|
|
26
|
-
|
|
26
|
+
import PasswordStrength from './PasswordStrength';
|
|
27
|
+
import AuxiliaryNav from './AuxiliaryNav';
|
|
28
|
+
export { Accordion, Accordions, AnnouncementBanner, AuxiliaryNav, Card, Cards, ContactCard, ContentSummary, CreditListing, Editorial, ImageWithCaption, Information, MiniCard, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, PasswordStrength, Pagination, PeopleListing, PromoWithTags, PromoWithTitle, RadioGroup, ReadMore, Quote, SectionTitle, SearchBar, Select, Tabs, TextOnly, UpsellCard, };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { ModalWindowProps } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* A ModalWindow component, leveraging React Modal for rendering modals with enhanced accessibility
|
|
5
|
+
* and styling customization. This component is designed to be flexible for various use cases, with
|
|
6
|
+
* support for mobile responsiveness, custom z-indexes, and a close button.
|
|
7
|
+
*
|
|
8
|
+
* # Usage
|
|
9
|
+
* This component is intended to be used in React applications where modal functionality is required.
|
|
10
|
+
* It supports a range of props for customization, including isOpen, setIsOpen, children, appElementId,
|
|
11
|
+
* and accepts all additional props supported by React Modal for further configuration.
|
|
12
|
+
*
|
|
13
|
+
* ## Basic Example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import React, { useState } from 'react';
|
|
16
|
+
* import ModalWindow from './ModalWindow';
|
|
17
|
+
*
|
|
18
|
+
* const App = () => {
|
|
19
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
20
|
+
*
|
|
21
|
+
* const toggleModal = () => setIsOpen(!isOpen);
|
|
22
|
+
*
|
|
23
|
+
* return (
|
|
24
|
+
* <>
|
|
25
|
+
* <button onClick={toggleModal}>Open Modal</button>
|
|
26
|
+
* <ModalWindow
|
|
27
|
+
* isOpen={isOpen}
|
|
28
|
+
* setIsOpen={setIsOpen}
|
|
29
|
+
* appElementId="root"
|
|
30
|
+
* >
|
|
31
|
+
* <div>Modal Content Here</div>
|
|
32
|
+
* </ModalWindow>
|
|
33
|
+
* </>
|
|
34
|
+
* );
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* ## Advanced Usage
|
|
39
|
+
* You can further customize the modal by directly passing props supported by React Modal.
|
|
40
|
+
* This component adapts its z-index based on the device type (mobile or desktop) and allows for an
|
|
41
|
+
* accessible close functionality.
|
|
42
|
+
*
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <ModalWindow
|
|
45
|
+
* isOpen={isOpen}
|
|
46
|
+
* setIsOpen={setIsOpen}
|
|
47
|
+
* appElementId="root"
|
|
48
|
+
* shouldCloseOnOverlayClick={true}
|
|
49
|
+
* >
|
|
50
|
+
* <YourCustomComponent />
|
|
51
|
+
* </ModalWindow>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* # Props
|
|
55
|
+
* - `isOpen`: Boolean indicating if the modal is open.
|
|
56
|
+
* - `setIsOpen`: Function to set the open state of the modal.
|
|
57
|
+
* - `children`: Content to be displayed within the modal.
|
|
58
|
+
* - `appElementId`: ID of the app element to assist with accessibility.
|
|
59
|
+
* - All other props are passed directly to the underlying React Modal component, allowing for extensive customization.
|
|
60
|
+
*
|
|
61
|
+
* # Design and Accessibility
|
|
62
|
+
* This component automatically applies a `ScrollLock` when the modal is open to prevent background
|
|
63
|
+
* scrolling and sets appropriate z-index values to ensure the modal is layered correctly on the page.
|
|
64
|
+
* It also configures the modal for accessibility, including support for closing on ESC and setting
|
|
65
|
+
* `aria-modal` to true.
|
|
66
|
+
*/
|
|
67
|
+
declare const ModalWindow: FunctionComponent<ModalWindowProps>;
|
|
68
|
+
export default ModalWindow;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const InnerModal: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const CloseButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
3
|
+
export declare const ContentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const Overlay: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -5,4 +5,5 @@ import TitleWithCTA from './TitleWithCTA';
|
|
|
5
5
|
import UpsellSection from './UpsellSection';
|
|
6
6
|
import { LiveChat } from './LiveChat';
|
|
7
7
|
import StickyBar from './StickyBar';
|
|
8
|
-
|
|
8
|
+
import ModalWindow from './ModalWindow';
|
|
9
|
+
export { AnchorTabBar, Footer, LiveChat, ModalWindow, Navigation, StickyBar, TitleWithCTA, UpsellSection };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, BodyText, Card, Cards, CinemaBadge, ContactCard, ContentSummary, ControlledDropdown, CreditListing, Editorial, Footer, GlobalStyles, Grid, GridItem, Header, Icon, ImageAspectRatioWrapper, ImageWithCaption, Information, LiveChat, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, RadioGroup, ReadMore, RotatorButtons, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, TertiaryButton, TextOnly, ThemeProvider, TitleWithCTA, Tab, TabLink, Tabs, TextArea, TextField, TextLink, Tickbox, Timer, TypeTags, UpsellCard, UpsellSection, Quote } from './components';
|
|
2
2
|
import { devices, breakpoints } from './styles/viewports';
|
|
3
3
|
import zIndexes from './styles/zIndexes';
|
|
4
|
-
import { AspectRatio, ButtonType, CarouselType, Colors, IconNameType, IntegratedTimerProps, ITimerProps, TickboxMode, ThemeType } from './types';
|
|
4
|
+
import { AspectRatio, ButtonType, CarouselType, Colors, IconNameType, IntegratedTimerProps, ITimerProps, TickboxMode, ThemeType, EditorialLink } from './types';
|
|
5
5
|
import { MiniCard } from './components/molecules';
|
|
6
6
|
import { BrandingStyle } from './types/impactHeader';
|
|
7
|
-
|
|
7
|
+
import { ModalWindow } from './components/organisms';
|
|
8
|
+
export { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AspectRatio, BodyText, BrandingStyle, breakpoints, ButtonType, Card, Cards, CarouselType, CinemaBadge, Colors, ContactCard, ContentSummary, ControlledDropdown, CreditListing, devices, Editorial, EditorialLink, Footer, GlobalStyles, Grid, GridItem, Header, Icon, IconNameType, ImageAspectRatioWrapper, ImageWithCaption, Information, ITimerProps, IntegratedTimerProps, LiveChat, MiniCard, ModalWindow, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, RadioGroup, ReadMore, RotatorButtons, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, Tab, TabLink, Tabs, TertiaryButton, TextArea, TextField, TextLink, TextOnly, ThemeProvider, ThemeType, TitleWithCTA, Tickbox, TickboxMode, Timer, TypeTags, UpsellCard, UpsellSection, Quote, zIndexes, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface IAuxiliaryNavProps {
|
|
2
|
+
/**
|
|
3
|
+
* Menu items
|
|
4
|
+
*/
|
|
5
|
+
items: IItem[];
|
|
6
|
+
/**
|
|
7
|
+
* Item will be marked as active.
|
|
8
|
+
* Should be equal to text prop from one of the items
|
|
9
|
+
*/
|
|
10
|
+
activeItem: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IItem {
|
|
13
|
+
/**
|
|
14
|
+
* Item text
|
|
15
|
+
*/
|
|
16
|
+
text: string;
|
|
17
|
+
/**
|
|
18
|
+
* Item on click action
|
|
19
|
+
*/
|
|
20
|
+
onClick: () => void;
|
|
21
|
+
}
|
|
@@ -33,15 +33,28 @@ export interface ITextAreaProps extends Partial<IGridItemProps>, InputHTMLAttrib
|
|
|
33
33
|
*/
|
|
34
34
|
darkMode?: boolean;
|
|
35
35
|
}
|
|
36
|
+
export declare type ITextFieldType = 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url';
|
|
36
37
|
export interface ITextFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
37
38
|
/**
|
|
38
39
|
* A text label to be shown above the text input field.
|
|
39
40
|
*/
|
|
40
|
-
label
|
|
41
|
+
label?: string;
|
|
41
42
|
/**
|
|
42
43
|
* An error label to be shown below the text input field.
|
|
44
|
+
* Input will be rendered with a red border if this prop exist.
|
|
45
|
+
* Empty string can be passed to render only error state without
|
|
46
|
+
* error message.
|
|
43
47
|
*/
|
|
44
48
|
error?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Type of text field.
|
|
51
|
+
* It can be one of: `text`, `email`, `password`,
|
|
52
|
+
* `number`, `search`, `tel`, `url`.
|
|
53
|
+
* `password` type adds `Show/Hide` button over the input element.
|
|
54
|
+
* Any other types don't change the view of the element, just change
|
|
55
|
+
* accessibility stuff
|
|
56
|
+
*/
|
|
57
|
+
type?: ITextFieldType;
|
|
45
58
|
/**
|
|
46
59
|
* A style prop that allows us to change what colours to
|
|
47
60
|
* use for light or dark mode (e.g. text color, border color, etc...)
|
|
@@ -52,9 +65,8 @@ export interface ITextFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
52
65
|
darkMode?: boolean;
|
|
53
66
|
/**
|
|
54
67
|
* Width in pixels.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
68
|
+
* This will limit the maximum width of input element.
|
|
69
|
+
* By default it will take all available space.
|
|
58
70
|
*/
|
|
59
71
|
width?: number;
|
|
60
72
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ import { EditorialLink } from './editorial';
|
|
|
10
10
|
import { IPageHeadingCompactProps } from './impactHeader';
|
|
11
11
|
import { IntegratedTimerProps, ITimerProps } from './timer';
|
|
12
12
|
import { ICreditListing } from './creditListing';
|
|
13
|
-
|
|
13
|
+
import { ModalWindowProps } from './modalWindow';
|
|
14
|
+
export { AspectRatio, ButtonType, CarouselType, Colors, ICreditListing, EditorialLink, FooterData, IconNameType, IPageHeadingCompactProps, INavigationProps, INavTopProps, IntegratedTimerProps, ITimerProps, ModalWindowProps, TickboxMode, ThemeType, };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import Modal from 'react-modal';
|
|
3
|
+
export interface ModalWindowProps extends Modal.Props {
|
|
4
|
+
/**
|
|
5
|
+
* Boolean indicating if the modal is open.
|
|
6
|
+
*/
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Function to set the open state of the modal.
|
|
10
|
+
*/
|
|
11
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Content to be displayed within the modal.
|
|
14
|
+
*/
|
|
15
|
+
children: ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* ID of the app element to assist with accessibility.
|
|
18
|
+
*/
|
|
19
|
+
appElementId: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Colors } from './types';
|
|
2
|
+
export interface IPasswordStrengthProps {
|
|
3
|
+
/**
|
|
4
|
+
* Number of sections to show
|
|
5
|
+
*
|
|
6
|
+
* Default: 6
|
|
7
|
+
*/
|
|
8
|
+
sections?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Number of active sections
|
|
11
|
+
*
|
|
12
|
+
* Default: 0
|
|
13
|
+
*/
|
|
14
|
+
activeSections?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Color of non-active sections
|
|
17
|
+
*
|
|
18
|
+
* Default: Colors.MidGrey
|
|
19
|
+
*/
|
|
20
|
+
sectionsColor?: Colors;
|
|
21
|
+
/**
|
|
22
|
+
* Color of active sections
|
|
23
|
+
*
|
|
24
|
+
* Default: Colors.Black
|
|
25
|
+
*/
|
|
26
|
+
activeSectionsColor?: Colors;
|
|
27
|
+
/**
|
|
28
|
+
* Text
|
|
29
|
+
*
|
|
30
|
+
* Default: ""
|
|
31
|
+
*/
|
|
32
|
+
text?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Text color
|
|
35
|
+
*
|
|
36
|
+
* Default: Colors.Black
|
|
37
|
+
*/
|
|
38
|
+
textColor?: Colors;
|
|
39
|
+
/**
|
|
40
|
+
* Strength label text
|
|
41
|
+
*
|
|
42
|
+
* Default: ""
|
|
43
|
+
*/
|
|
44
|
+
strengthLabel?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Strength label text
|
|
47
|
+
*
|
|
48
|
+
* Default: Colors.Black
|
|
49
|
+
*/
|
|
50
|
+
strengthLabelColor?: Colors;
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@royaloperahouse/chord",
|
|
3
|
-
"version": "2.2.3-chord-development",
|
|
3
|
+
"version": "2.2.3-e-chord-development-chord-development",
|
|
4
4
|
"author": "Royal Opera House",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"@types/jest": "^27.0.2",
|
|
92
92
|
"@types/react": "^17.0.34",
|
|
93
93
|
"@types/react-dom": "^17.0.11",
|
|
94
|
+
"@types/react-modal": "^3.16.3",
|
|
94
95
|
"@types/react-test-renderer": "^17.0.1",
|
|
95
96
|
"@types/styled-components": "^5.1.15",
|
|
96
97
|
"@types/testing-library__jest-dom": "^5.14.1",
|
|
@@ -110,6 +111,8 @@
|
|
|
110
111
|
"typescript": "^4.4.4"
|
|
111
112
|
},
|
|
112
113
|
"dependencies": {
|
|
113
|
-
"moment": "^2.29.4"
|
|
114
|
+
"moment": "^2.29.4",
|
|
115
|
+
"react-modal": "^3.16.1",
|
|
116
|
+
"react-scrolllock": "^5.0.1"
|
|
114
117
|
}
|
|
115
118
|
}
|