@royaloperahouse/chord 2.5.0 → 2.5.1-a-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.
Files changed (33) hide show
  1. package/CHANGELOG.md +210 -7
  2. package/README.md +250 -40
  3. package/dist/chord.cjs.development.js +521 -269
  4. package/dist/chord.cjs.development.js.map +1 -1
  5. package/dist/chord.cjs.production.min.js +1 -1
  6. package/dist/chord.cjs.production.min.js.map +1 -1
  7. package/dist/chord.esm.js +519 -270
  8. package/dist/chord.esm.js.map +1 -1
  9. package/dist/components/atoms/AriaAlternativeDescription/AriaAlternative.d.ts +5 -0
  10. package/dist/components/atoms/AriaAlternativeDescription/AriaAlternative.style.d.ts +3 -0
  11. package/dist/components/atoms/AriaAlternativeDescription/index.d.ts +2 -0
  12. package/dist/components/atoms/Grid/GridItemLegacy.d.ts +8 -0
  13. package/dist/components/atoms/Grid/index.d.ts +2 -1
  14. package/dist/components/atoms/ToggleButton/ToggleButton.d.ts +29 -0
  15. package/dist/components/atoms/ToggleButton/ToggleButton.style.d.ts +5 -0
  16. package/dist/components/atoms/Typography/Typography.d.ts +2 -2
  17. package/dist/components/atoms/index.d.ts +3 -2
  18. package/dist/components/index.d.ts +3 -3
  19. package/dist/components/molecules/PageHeading/index.d.ts +1 -1
  20. package/dist/components/molecules/PeopleListing/CreditListing/CreditListing.style.d.ts +1 -0
  21. package/dist/components/molecules/Table/Table.style.d.ts +1 -1
  22. package/dist/components/molecules/index.d.ts +1 -1
  23. package/dist/components/organisms/FilterToggles/FilterToggles.d.ts +26 -0
  24. package/dist/components/organisms/FilterToggles/FilterToggles.style.d.ts +2 -0
  25. package/dist/components/organisms/FilterToggles/index.d.ts +23 -0
  26. package/dist/components/organisms/index.d.ts +2 -1
  27. package/dist/index.d.ts +3 -2
  28. package/dist/types/ariaAlternative.d.ts +34 -0
  29. package/dist/types/formTypes.d.ts +12 -9
  30. package/dist/types/toggleButtonTypes.d.ts +26 -0
  31. package/dist/types/typography.d.ts +4 -0
  32. package/package.json +1 -1
  33. package/README.GIT +0 -277
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { IAriaAlternativeProps, IAriaHideProps } from '../../../types/ariaAlternative';
3
+ /** A temporary screen-reader accessibility workaround for components with issues that can't be resolved quickly. Allows us to use aria-hidden on components with stuctural HTML markup issues until they can be rebuilt to be screen-reader compatible, or on components whose data does not translate well to screen-reader users. **/
4
+ export declare const AriaHide: FunctionComponent<IAriaHideProps>;
5
+ export declare const AriaAlternative: FunctionComponent<IAriaAlternativeProps>;
@@ -0,0 +1,3 @@
1
+ import { IAriaHideProps } from '../../../types/ariaAlternative';
2
+ export declare const AriaAlternativeDescription: import("styled-components").StyledComponent<"a", any, {}, never>;
3
+ export declare const AriaHideOnDevice: import("styled-components").StyledComponent<"div", any, IAriaHideProps, never>;
@@ -0,0 +1,2 @@
1
+ import { AriaAlternative, AriaHide } from './AriaAlternative';
2
+ export { AriaAlternative, AriaHide };
@@ -0,0 +1,8 @@
1
+ import { IGridItemProps } from '../../../types/types';
2
+ /**
3
+ * # IMPORTANT
4
+ * Please use the `<GridItem />` component instead of this component if possible.
5
+ * This component was introduced due to incompatibilities between versions of the Chord library.
6
+ */
7
+ declare const GridItemLegacy: import("styled-components").StyledComponent<"div", any, IGridItemProps, never>;
8
+ export default GridItemLegacy;
@@ -1,3 +1,4 @@
1
1
  import Grid from './Grid';
2
2
  import GridItem from './GridItem';
3
- export { Grid, GridItem };
3
+ import GridItemLegacy from './GridItemLegacy';
4
+ export { Grid, GridItem, GridItemLegacy };
@@ -0,0 +1,29 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { IToggleProps } from '../../../types/toggleButtonTypes';
3
+ /**
4
+ * A ToggleButton component that renders a toggleable button with an icon and label.
5
+ *
6
+ * # Usage
7
+ * The primary use case this component was written for is to be used within a group of
8
+ * toggles for filtering content displayed on page. One such implementation can be found in
9
+ * Filter Toggles component. However, this component can be used anywhere a toggle
10
+ * button is needed.
11
+ * Toggle Button requires the toggling logic to be handled by the parent component
12
+ * and passed down to it as isToggleOn, onFilterItemClick, and onKeyDownHandler props.
13
+ *
14
+ * # Props
15
+ * - `isToggleOn`: Boolean indicating if the toggle is on.
16
+ * - `onFilterItemClick`: Function to handle the click event on the toggle button.
17
+ * - `onKeyDownHandler`: Function to handle the keydown event on the toggle button.
18
+ * - `item`: Object representing the item associated with the toggle button.
19
+ * - `ariaLabelledBy`: Recommended when used as part of a group of toggles under a common
20
+ * label or title. A string which should be identical to the id of the label or title.
21
+ *
22
+ * # Design and Accessibility
23
+ * - aria-labelledby is used to associate the toggle button with a label or title when
24
+ * used as part of a group of toggles.
25
+ * - The component is designed to be keyboard-navigable.
26
+ * - aria-selected is used to indicate the selected state of the toggle button.
27
+ */
28
+ declare const ToggleButton: FunctionComponent<IToggleProps>;
29
+ export default ToggleButton;
@@ -0,0 +1,5 @@
1
+ interface SelectionProps {
2
+ isSelected: boolean;
3
+ }
4
+ declare const Tile: import("styled-components").StyledComponent<"div", any, SelectionProps, never>;
5
+ export default Tile;
@@ -1,7 +1,7 @@
1
1
  import { IAltHeaderProps, IBodyTextProps, IHeaderProps, IOverlineProps, IStyledTag, ISubtitleProps } from '../../../types/typography';
2
- export declare const StyledTag: ({ tag, typography, children, level }: IStyledTag) => JSX.Element;
2
+ export declare const StyledTag: ({ tag, typography, children, level, id }: IStyledTag) => JSX.Element;
3
3
  export declare const AltHeader: ({ semanticLevel, level, children }: IAltHeaderProps) => JSX.Element;
4
4
  export declare const BodyText: ({ level, children, tag }: IBodyTextProps) => JSX.Element;
5
5
  export declare const Header: ({ semanticLevel, level, children }: IHeaderProps) => JSX.Element;
6
- export declare const Overline: ({ level, children, tag }: IOverlineProps) => JSX.Element;
6
+ export declare const Overline: ({ level, children, tag, id }: IOverlineProps) => JSX.Element;
7
7
  export declare const Subtitle: ({ level, children, tag }: ISubtitleProps) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { CinemaBadge, StreamBadge } from './Badge';
2
2
  import { PrimaryButton, SecondaryButton, TertiaryButton } from './Buttons';
3
3
  import ControlledDropdown from './ControlledDropdown';
4
- import { Grid, GridItem } from './Grid';
4
+ import { Grid, GridItem, GridItemLegacy } from './Grid';
5
5
  import { Icon } from './Icons';
6
6
  import ImageAspectRatioWrapper from './ImageAspectRatioWrapper';
7
7
  import Progress from './Progress';
@@ -25,4 +25,5 @@ import TypeTags from './TypeTags';
25
25
  import { AltHeader, BodyText, Header, Overline, Subtitle } from './Typography';
26
26
  import VideoControls from './VideoControls';
27
27
  import { Stepper } from './Stepper';
28
- export { AltHeader, BodyText, CinemaBadge, ControlledDropdown, Grid, GridItem, Header, Icon, ImageAspectRatioWrapper, Overline, Progress, PrimaryButton, Radio, Radio2, RotatorButtons, SecondaryButton, SecondaryLogo, SectionSplitter, SponsorLogo, Sponsorship, Stepper, StreamBadge, Subtitle, Tab, TabLink, TertiaryButton, TextArea, TextField, TextFieldLegacy, TextLink, TextLogo, Tickbox, Tickbox2, Timer, TypeTags, VideoControls, };
28
+ import ToggleButton from './ToggleButton/ToggleButton';
29
+ export { AltHeader, BodyText, CinemaBadge, ControlledDropdown, Grid, GridItem, GridItemLegacy, Header, Icon, ImageAspectRatioWrapper, Overline, Progress, PrimaryButton, Radio, Radio2, RotatorButtons, SecondaryButton, SecondaryLogo, SectionSplitter, SponsorLogo, Sponsorship, Stepper, StreamBadge, Subtitle, Tab, TabLink, TertiaryButton, TextArea, TextField, TextFieldLegacy, TextLink, TextLogo, Tickbox, Tickbox2, Timer, TypeTags, VideoControls, ToggleButton, };
@@ -1,6 +1,6 @@
1
- import { AltHeader, BodyText, CinemaBadge, ControlledDropdown, Grid, GridItem, Header, Icon, ImageAspectRatioWrapper, Overline, PrimaryButton, Progress, Radio, Radio2, RotatorButtons, SecondaryButton, SecondaryLogo, TertiaryButton, SectionSplitter, Sponsorship, Stepper, StreamBadge, Subtitle, Tab, TabLink, TextLogo, TextArea, TextField, TextFieldLegacy, TextLink, Tickbox, Tickbox2, Timer, TypeTags, VideoControls } from './atoms';
2
- import { AnchorTabBar, Footer, LiveChat, Navigation, StickyBar, TitleWithCTA, UpsellSection } from './organisms';
1
+ import { AltHeader, BodyText, CinemaBadge, ControlledDropdown, Grid, GridItem, GridItemLegacy, Header, Icon, ImageAspectRatioWrapper, Overline, PrimaryButton, Progress, Radio, Radio2, RotatorButtons, SecondaryButton, SecondaryLogo, TertiaryButton, SectionSplitter, Sponsorship, Stepper, StreamBadge, Subtitle, Tab, TabLink, TextLogo, TextArea, TextField, TextFieldLegacy, TextLink, Tickbox, Tickbox2, Timer, TypeTags, VideoControls, ToggleButton } from './atoms';
2
+ import { AnchorTabBar, Footer, LiveChat, Navigation, StickyBar, TitleWithCTA, UpsellSection, FilterToggles } from './organisms';
3
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, RadioGroup2, ReadMore, StatusBanner, SearchBar, SectionTitle, Select, Select2, Select2Async, Table, Tabs, TextOnly, UpsellCard, Quote, VideoWithControls } from './molecules';
4
4
  import ThemeProvider from '../styles/ThemeProvider';
5
5
  import GlobalStyles from '../styles/GlobalStyles';
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, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, SecondaryButton, SecondaryLogo, StatusBanner, SearchBar, SectionTitle, Select, Select2, Select2Async, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, TertiaryButton, TextOnly, ThemeProvider, TitleWithCTA, SectionSplitter, Tab, TabLink, Table, Tabs, TextArea, TextField, TextFieldLegacy, TextLink, TextLogo, Tickbox, Tickbox2, Timer, TypeTags, UpsellCard, UpsellSection, Quote, LiveChat, VideoControls, VideoWithControls, };
6
+ export { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, BodyText, Card, Cards, ContactCard, ContentSummary, CinemaBadge, ControlledDropdown, CreditListing, Editorial, Footer, GlobalStyles, Grid, GridItem, GridItemLegacy, Header, Icon, ImageAspectRatioWrapper, ImageWithCaption, Information, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, SecondaryButton, SecondaryLogo, StatusBanner, SearchBar, SectionTitle, Select, Select2, Select2Async, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, TertiaryButton, TextOnly, ThemeProvider, TitleWithCTA, SectionSplitter, Tab, TabLink, Table, Tabs, TextArea, TextField, TextFieldLegacy, TextLink, TextLogo, Tickbox, Tickbox2, Timer, TypeTags, UpsellCard, UpsellSection, Quote, LiveChat, VideoControls, VideoWithControls, FilterToggles, ToggleButton, };
@@ -4,4 +4,4 @@ import PageHeadingImpact from './Impact';
4
4
  import PageHeadingPanel from './Panel';
5
5
  import PageHeadingStream from './Stream';
6
6
  import PageHeadingCompact from './Compact/Compact';
7
- export { PageHeadingCinema, PageHeadingCore, PageHeadingImpact, PageHeadingStream, PageHeadingCompact, PageHeadingPanel, };
7
+ export { PageHeadingCinema, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, PageHeadingCompact, };
@@ -5,3 +5,4 @@ export declare const CreditListingWrapper: import("styled-components").StyledCom
5
5
  export declare const DescriptionWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
6
6
  export declare const RoleWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
7
7
  export declare const CreditWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const CreditBodyWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -16,4 +16,4 @@ export declare const PageNumber: import("styled-components").StyledComponent<"bu
16
16
  }, never>;
17
17
  export declare const Next: import("styled-components").StyledComponent<"span", any, {}, never>;
18
18
  export declare const ScrollButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
19
- export declare const AriaDescription: import("styled-components").StyledComponent<"span", any, {}, never>;
19
+ export declare const AriaDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -27,8 +27,8 @@ import ImageWithCaption from './ImageWithCaption';
27
27
  import Quote from './Quote';
28
28
  import MiniCard from './MiniCard';
29
29
  import ReadMore from './ReadMore';
30
- import AuxiliaryNav from './AuxiliaryNav';
31
30
  import PasswordStrength from './PasswordStrength';
31
+ import AuxiliaryNav from './AuxiliaryNav';
32
32
  import Table from './Table';
33
33
  import VideoWithControls from './VideoWithControls';
34
34
  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, RadioGroup2, ReadMore, Quote, StatusBanner, SectionTitle, SearchBar, Select, Select2, Select2Async, Tabs, Table, TextOnly, UpsellCard, VideoWithControls, };
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { Props } from '.';
3
+ /**
4
+ * A FilterToggles component that renders a labelled group of toggle buttons
5
+ * for filtering page content.
6
+ *
7
+ * # Usage
8
+ * This component is designed to be used within a filter context, where multiple items
9
+ * can be toggled on or off. The parent component should handle the toggling and filtering logic.
10
+ * toggling logic and state should be passed to filter Toggles as onclickHandler and selectedItems props.
11
+ *
12
+ * # Props
13
+ * - `filterItems`: Array of filter items to be displayed as toggle buttons. Each item should
14
+ * be an object with a param string, label string, and disableIfActive array containing
15
+ * params of items to be untoggled when the given item is toggled on.
16
+ * - `onClickHandler`: Function to handle the click event on each toggle button.
17
+ * - `selectedItems`: Array of selected filter item parameters. Likely to be a piece of state
18
+ * mutated by onClickHandler in the parent component.
19
+ * - `title`: String for the title of the filter section.
20
+ *
21
+ * # Design and Accessibility
22
+ * - aria-labelledby is used to associate the filter section with a label.
23
+ * - The component is designed to be keyboard-navigable.
24
+ */
25
+ export declare const FilterToggles: ({ filterItems, onClickHandler, selectedItems, title, }: Props) => React.ReactElement;
26
+ export default FilterToggles;
@@ -0,0 +1,2 @@
1
+ export declare const FiltersWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const FilterItemsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,23 @@
1
+ import FilterToggles from './FilterToggles';
2
+ import { FilterConfig } from '../../../types/toggleButtonTypes';
3
+ export interface Props {
4
+ /**
5
+ * Array of filter configurations.
6
+ * @type {FilterConfig[]}
7
+ */
8
+ filterItems: FilterConfig[];
9
+ /**
10
+ * Handler function to be called when a filter item is clicked.
11
+ * @param filter - The filter configuration that was clicked.
12
+ */
13
+ onClickHandler: (filter: FilterConfig) => void;
14
+ /**
15
+ * Array of selected item identifiers.
16
+ */
17
+ selectedItems: string[];
18
+ /**
19
+ * Optional title for the component.
20
+ */
21
+ title?: string;
22
+ }
23
+ export default FilterToggles;
@@ -6,4 +6,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 };
9
+ import FilterToggles from './FilterToggles';
10
+ export { AnchorTabBar, Footer, LiveChat, ModalWindow, Navigation, StickyBar, TitleWithCTA, UpsellSection, FilterToggles, };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, 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, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Select2, Select2Async, Sponsorship, StickyBar, Stepper, StreamBadge, Subtitle, TertiaryButton, TextOnly, ThemeProvider, TitleWithCTA, Tab, Table, TabLink, Tabs, TextArea, TextField, TextFieldLegacy, TextLink, Tickbox, Tickbox2, Timer, TypeTags, UpsellCard, UpsellSection, Quote, VideoControls, VideoWithControls } from './components';
1
+ import { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryNav, BodyText, Card, Cards, CinemaBadge, ContactCard, ContentSummary, ControlledDropdown, CreditListing, Editorial, Footer, GlobalStyles, Grid, GridItem, GridItemLegacy, Header, Icon, ImageAspectRatioWrapper, ImageWithCaption, Information, LiveChat, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Select2, Select2Async, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, TertiaryButton, TextOnly, ThemeProvider, TitleWithCTA, Tab, Table, TabLink, Tabs, TextArea, TextField, TextFieldLegacy, TextLink, Tickbox, Tickbox2, Timer, TypeTags, UpsellCard, UpsellSection, Quote, VideoControls, VideoWithControls, FilterToggles, ToggleButton } from './components';
2
2
  import { devices, breakpoints } from './styles/viewports';
3
3
  import zIndexes from './styles/zIndexes';
4
4
  import { AspectRatio, ButtonType, CarouselType, Colors, IconNameType, IntegratedTimerProps, ITimerProps, TickboxMode, ThemeType, EditorialLink, IInformationTitleProps, IInformationCTAProps, IInformationBackgroundColour } from './types';
5
5
  import { MiniCard } from './components/molecules';
6
+ import { BrandingStyle } from './types/impactHeader';
6
7
  import { ModalWindow } from './components/organisms';
7
8
  import AuxiliaryButton from './components/atoms/Buttons/Auxiliary/AuxiliaryButton';
8
- export { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryButton, AuxiliaryNav, AspectRatio, BodyText, breakpoints, ButtonType, Card, Cards, CarouselType, CinemaBadge, Colors, ContactCard, ContentSummary, ControlledDropdown, CreditListing, devices, Editorial, EditorialLink, Footer, GlobalStyles, Grid, GridItem, Header, Icon, IconNameType, ImageAspectRatioWrapper, ImageWithCaption, Information, IInformationBackgroundColour, IInformationCTAProps, IInformationTitleProps, ITimerProps, IntegratedTimerProps, LiveChat, MiniCard, ModalWindow, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Select2, Select2Async, Sponsorship, StickyBar, Stepper, StreamBadge, Subtitle, Tab, Table, TabLink, Tabs, TertiaryButton, TextArea, TextField, TextFieldLegacy, TextLink, TextOnly, ThemeProvider, ThemeType, TitleWithCTA, Tickbox, Tickbox2, TickboxMode, Timer, TypeTags, UpsellCard, UpsellSection, Quote, VideoControls, VideoWithControls, zIndexes, };
9
+ export { Accordion, Accordions, AnnouncementBanner, AltHeader, AnchorTabBar, AuxiliaryButton, AuxiliaryNav, AspectRatio, BodyText, BrandingStyle, breakpoints, ButtonType, Card, Cards, CarouselType, CinemaBadge, Colors, ContactCard, ContentSummary, ControlledDropdown, CreditListing, devices, Editorial, EditorialLink, Footer, GlobalStyles, Grid, GridItem, GridItemLegacy, Header, Icon, IconNameType, ImageAspectRatioWrapper, ImageWithCaption, Information, IInformationBackgroundColour, IInformationCTAProps, IInformationTitleProps, ITimerProps, IntegratedTimerProps, LiveChat, MiniCard, ModalWindow, Navigation, Overline, PageHeadingCinema, PageHeadingCompact, PageHeadingCore, PageHeadingImpact, PageHeadingPanel, PageHeadingStream, Pagination, PasswordStrength, PeopleListing, PrimaryButton, Progress, PromoWithTags, PromoWithTitle, Radio, Radio2, RadioGroup, RadioGroup2, ReadMore, RotatorButtons, StatusBanner, SearchBar, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Select, Select2, Select2Async, Sponsorship, Stepper, StickyBar, StreamBadge, Subtitle, Tab, Table, TabLink, Tabs, TertiaryButton, TextArea, TextField, TextFieldLegacy, TextLink, TextOnly, ThemeProvider, ThemeType, TitleWithCTA, Tickbox, Tickbox2, TickboxMode, Timer, TypeTags, UpsellCard, UpsellSection, Quote, VideoControls, VideoWithControls, zIndexes, FilterToggles, ToggleButton, };
@@ -0,0 +1,34 @@
1
+ export interface IAriaAlternativeProps {
2
+ /**
3
+ * A temporary screen-reader accessibility workaround for components with issues that can't be resolved quickly.
4
+ * Allows us to use aria-hidden on components with stuctural HTML markup issues until they can be rebuilt to be screen-reader compatible.
5
+ */
6
+ /**
7
+ * Description of the content being communicated by this component.
8
+ */
9
+ description: string;
10
+ /**
11
+ * originalContent - parse in the data from the original component / response object.
12
+ */
13
+ originalContent: Array<{
14
+ key: string;
15
+ value: string;
16
+ }>;
17
+ /**
18
+ * speechValues - input contextual speech values here to build a sentence, e.g. "you have" , "tickets for" , etc.
19
+ */
20
+ speechValues: Array<{
21
+ key: string;
22
+ value: string;
23
+ }>;
24
+ /**
25
+ * Disable this component (for testing purposes).
26
+ */
27
+ disabled?: boolean;
28
+ }
29
+ export interface IAriaHideProps {
30
+ /**
31
+ * Inert - disables all focusable child elements, necessary if using aria-hidden
32
+ */
33
+ inert: boolean;
34
+ }
@@ -265,17 +265,8 @@ export interface IStepperProps {
265
265
  step?: number;
266
266
  /** An error message to be shown below the stepper.
267
267
  *
268
- * Default: `undefined`
269
268
  */
270
269
  error?: string;
271
- /**
272
- * A style prop that allows us to change what colours to
273
- * use for light or dark mode (e.g. text color, border color, etc...)
274
- * based on the background color.
275
- *
276
- * Defaults to `false`.
277
- */
278
- darkMode?: boolean;
279
270
  /**
280
271
  * Set disapled state
281
272
  */
@@ -284,6 +275,18 @@ export interface IStepperProps {
284
275
  * Minimum value allowed in the stepper
285
276
  */
286
277
  min?: number;
278
+ /**
279
+ * A style prop that allows us to change what colours to
280
+ * use for light or dark mode (e.g. text color, border color, etc...)
281
+ * based on the background color.
282
+ *
283
+ * Defaults to `false`.
284
+ * Specify whether or not the containing element has a dark background.
285
+ * This property affects the border colours for focused and error states.
286
+ *
287
+ * Default: `false`
288
+ */
289
+ darkMode?: boolean;
287
290
  /**
288
291
  * Maximum value allowed in the stepper
289
292
  */
@@ -0,0 +1,26 @@
1
+ import { AnchorHTMLAttributes } from 'react';
2
+ export interface FilterConfig {
3
+ /**
4
+ * Parameter associated with the filter item. Won't be displayed to the user.
5
+ */
6
+ param: string;
7
+ /**
8
+ * Label for the filter. Will be displayed to the user.
9
+ */
10
+ label: string;
11
+ /**
12
+ * Array of params of fitler items which will be disabled when this item is toggled on.
13
+ */
14
+ disableIfActive: string[];
15
+ /**
16
+ * Optional: id for use in filtering logic in parent component. Not used in the component itself.
17
+ */
18
+ id?: string;
19
+ }
20
+ export interface IToggleProps extends AnchorHTMLAttributes<HTMLElement> {
21
+ isToggleOn: boolean;
22
+ onFilterItemClick: (filter: FilterConfig) => void;
23
+ onKeyDownHandler: (e: React.KeyboardEvent<HTMLElement>, filter: FilterConfig) => void;
24
+ item: FilterConfig;
25
+ ariaLabelledBy?: string;
26
+ }
@@ -85,5 +85,9 @@ export interface IOverlineProps extends IGenericTypography {
85
85
  * HTML tag to use to render Overline, by default div.
86
86
  */
87
87
  tag?: React.ElementType;
88
+ /**
89
+ * Id for Overline component.
90
+ */
91
+ id?: string;
88
92
  }
89
93
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@royaloperahouse/chord",
3
- "version": "2.5.0",
3
+ "version": "2.5.1-a-chord-development",
4
4
  "author": "Royal Opera House",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
package/README.GIT DELETED
@@ -1,277 +0,0 @@
1
- # Royal Opera House Chord - Front End Design System
2
-
3
- Welcome to The Royal Opera House Front End Design System, `@royaloperahouse/chord`
4
-
5
- This package is a library of UI components intended to be used in the ROH website.
6
-
7
- It uses React, TypeScript, TSDX and Storybook.
8
-
9
- The NPM packages are published at [https://www.npmjs.com/package/@royaloperahouse/chord](https://www.npmjs.com/package/@royaloperahouse/chord)
10
-
11
- The Storybook for the latest version of the library is hosted at [chord.roh.org.uk](chord.roh.org.uk)
12
-
13
-
14
- ## Prerequisites
15
- ---
16
-
17
- * Make sure the required package dependencies are installed using `yarn install`
18
-
19
- * If this is the first time you are working on Chord, make sure to run `yarn build` to build all the modules.
20
-
21
- * **To deploy the storybook publicly** you will need credentials for the **parent** 'Royal Opera House' AWS account in your `~/.aws/credentials` file.
22
- * The deploy script expects these to be called `[parent]`.
23
-
24
- * You can find these values at:
25
-
26
- *AWS 'Your Applications' page -> 'Royal Opera House' -> 'Developer Access' -> 'Command line or programmatic access'*
27
-
28
- * **To deploy a preview** for demo / QA you will need the `CHROMATIC_PROJECT_TOKEN` -- find this in 1Password
29
-
30
-
31
- * **To publish the NPM package** you will need the ROH `NPM_TOKEN` -- find this in 1Password
32
-
33
-
34
- ## Versioning
35
- ---
36
-
37
- We use [Semantic Versioning](https://semver.org/) for Chord.
38
-
39
- Given a version number MAJOR.MINOR.PATCH, increment the:
40
-
41
- * MAJOR version when you make incompatible library changes
42
- * MINOR version when you add functionality in a backwards compatible manner
43
- * PATCH version when you make backwards compatible bug fixes
44
-
45
- When you create a new release always update the `CHANGELOG` and `package.json`
46
-
47
- Increment your version from the latest stable version on `chord-releases`
48
-
49
-
50
- ## Deploying the Storybook
51
- ---
52
-
53
- ### **1. To build and deploy locally**
54
-
55
- You can quickly build and serve the contents of `/storybook-static` from your local machine, for development and manual testing. To do this run:
56
-
57
- ```bash
58
- yarn storybook
59
- ```
60
-
61
- By default the storybook will be accessible at
62
- [http://localhost:6006/]()
63
-
64
- The server will hot-reload on most changes.
65
-
66
- ### **2. To deploy a preview version remotely**
67
-
68
- You can deploy a release candidate, or work-in-progress to [Chromatic](https://www.chromatic.com/) for showcase or QA.
69
-
70
- **NOTE:** you will need the `CHROMATIC_PROJECT_TOKEN` as described in *Prerequisites* above.
71
-
72
- Either set the token as a shell variable or use a `.env` file in the chord root directory containing the token, as so:
73
-
74
- ```
75
- CHROMATIC_PROJECT_TOKEN=tokengoeshere
76
- ```
77
-
78
- Run:
79
-
80
- ```
81
- yarn deploy-storybook-dev
82
- ```
83
-
84
- to build and deploy the storybook from your repo to Chromatic.
85
-
86
- You will find the address of your deployed storybook in the console output, looking something like this:
87
-
88
- `→ View your Storybook at https://randomHexString-randomAlphabeticalString.chromatic.com`
89
-
90
- ### **3. To deploy a release version**
91
-
92
- You can deploy the contents of `./storybook-static` to S3 as a static site, which is permanently accessible at [chord.roh.org.uk](chord.roh.org.uk)
93
-
94
- **NOTE:** To do this you will need the correct `AWS` credentials set up, as described in *Prerequisites* above.
95
-
96
- First build the storybook using:
97
-
98
- ```
99
- yarn build-storybook
100
- ```
101
-
102
- then run:
103
-
104
- ```bash
105
- yarn deploy-storybook
106
- ```
107
-
108
- > **IMPORTANT:** This URL is intended to showcase the latest stable version of Chord, it should be kept up to date with the main `chord-releases` branch and should **only** be used for release versions. If you want to deploy a development version follow the steps above under *To deploy a preview version remotely*.
109
-
110
-
111
- ## Releasing a New Package Version
112
- ---
113
-
114
- This is the procedure for releasing a new Chord NPM package.
115
-
116
- There are two types of package:
117
-
118
- A **snapshot** can be published to use a development version of the Chord library in our frontend staging environments, to perform integrated, manual testing.
119
-
120
- A **stable** package is published for use in production.
121
-
122
- **NOTE:** You will need the `NPM_TOKEN`, as described in 'Prerequisites' above.
123
-
124
- ### **1. To release a snapshot version**
125
-
126
- > **IMPORTANT:** Make sure you always publish your **snapshots** from `chord-development` after merging in your feature branch.
127
-
128
- For snapshots, `RELEASE_VERSION` should be the same as the latest **stable** version of the Chord Library, as found in `chord-releases`, followed by an **unused** lowercase letter.
129
-
130
- For example, if the latest stable release was 1.42.0, and the last snapshot published to NPM was 1.42.0-w, you would use RELEASE_VERSION `1.42.0-x`
131
-
132
- To publish a snapshot use:
133
-
134
- ```bash
135
- NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-snapshot
136
- ```
137
-
138
- The version published to NPM will be named, e.g. `1.42.0-a-chord-development`, use this to install the snapshot package in the frontend repos.
139
-
140
- ### **2. To release a stable version**
141
-
142
- > **IMPORTANT:** Make sure you always publish your **stable** packages from `chord-releases` after merging in your feature branch.
143
-
144
- For stable releases, increment your version from the latest **stable** version found on `chord-releases`, following the rules described in *Versioning* above, and use this as `RELEASE_VERSION`. (Make sure it matches the version in your `package.json` and `CHANGELOG.md`!)
145
-
146
- To publish a stable package use:
147
-
148
- ```bash
149
- NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
150
- ```
151
-
152
-
153
- ## Using the Package
154
- ---
155
-
156
- The package is deployed to NPM, and can be installed using yarn or npm:
157
-
158
- ```bash
159
- npm i --save @royaloperahouse/chord
160
- ```
161
- ```bash
162
- yarn add @royaloperahouse/chord
163
- ```
164
-
165
-
166
- ## Testing
167
- ---
168
-
169
- To **Lint** the package use:
170
-
171
- ```bash
172
- yarn lint
173
- # Use the --fix option to perform automatic fixes
174
- ```
175
-
176
- To run the **unit tests** (using Jest) use:
177
-
178
- ```bash
179
- yarn test
180
-
181
- # Use the -u option to update snapshots if needed
182
- # Run `yarn test:watch` to re-run tests on changes
183
- ```
184
-
185
- To **run and and store the unit tests** for display in storybook use:
186
-
187
- ```bash
188
- yarn test-storybook
189
- # Use the -u option to update snapshots if needed
190
- ```
191
-
192
-
193
- ## Development Process
194
- ---
195
-
196
- ### **1. Branching Model**
197
- * The Chord project lives in the `roh-components` *monorepo*
198
- * When working on Chord, treat the `roh-components/packages/chord` directory as your root
199
- * The Chord **development** branch is currently `chord-development`
200
- * The Chord **main** branch is currently `chord-releases`
201
- * All work should be done on a correctly named **feature branch** of the format: `issueType/ticketNumber-short-description-of-feature`, e.g. `feature/RD-1234-update-chord-documentation`
202
- * Always create your feature branch FROM, and submit pull requests TO, the **main** branch
203
- * For **QA / UAT** of a Chord component in isolation: following review you should deploy a preview version to Chromatic straight from your **feature branch** _without_ merging to development
204
- * For releasing an **NPM snapshot**: merge your feature branch into the **development** branch and publish the NPM snapshot from there
205
-
206
- ### **2. Detailed Workflow**
207
-
208
- #### **Before review:**
209
-
210
- * Git pull the latest version of `chord-releases`
211
- * Checkout a new, correctly-named feature branch from `chord releases`
212
- * Do your work on this feature branch
213
- * Run: `yarn lint`
214
- * Run: `yarn test`
215
- * Commit your changes
216
- * Create a pull request from your feature branch to `chord-releases`
217
- * Add the appropriate reviewers
218
-
219
- #### **Before QA / UAT:**
220
-
221
- After your PR is approved, you have two options:
222
-
223
- **i.** For QA of a component in isolation:
224
-
225
- * Follow the steps above in *Deploying the Storybook -> 2. Deploying a preview version remotely*
226
- * Share the generated Chromatic URL with the appropriate people for QA / UAT
227
-
228
- **ii.** For integrated testing of a component in the frontend staging environments:
229
-
230
- * Check out the `chord-development` branch
231
- * Merge your work in to `chord-development`
232
- * Follow the steps above under *Publishing a New Package Version -> 1. To release a snapshot version*
233
- * Git push the updated `chord-development` branch to remote
234
- * Finally, in the frontend repo:
235
-
236
- 1. Update the `package.json` to reference the new snapshot version
237
- 2. Run: `yarn install`
238
- 3. Deploy the frontend to a staging environment
239
-
240
- #### **When ready for production:**
241
-
242
- * Return to your chord **feature branch**
243
- * Update the chord version in `package.json`, incrementing from the last **stable** release, found in `chord-releases`, and following the rules described in the *Versioning* section
244
- * Update `CHANGELOG.md`, adding the new version number and a short description of your changes
245
- * Run: `yarn lint`
246
- * Run: `yarn test`
247
- * Run: `yarn test-storybook -u`
248
- * Run: `yarn build-storybook`
249
- * Git commit, push, and update your PR for final approval
250
- * Merge your approved PR to `chord-releases`
251
- * Follow the steps in *Publishing a New Package Version -> 2. To release a stable version* to publish the NPM package
252
- * Finally, follow the steps in *Deploying The Storybook -> 3. To deploy a release version*, to update the public Chord Storybook page
253
-
254
- Once you have successfully published a new release version, you can open a ticket to update to this version in any of the frontend repos.
255
-
256
-
257
- ## Notes
258
- ---
259
- ### The `storybook-static` folder
260
-
261
- This folder contains all the HTML / JS required to deploy the Storybook as a static site. It's autogenerated whenever the Storybook is built and therefore will show up a lot of merge conflicts when you merge other branches into your feature branch. It is best to leave generating the storybook until the later part of your workflow, but in case you run into conflicts earlier, it's ok to just delete the folder and regenerate using:
262
-
263
- ```bash
264
- yarn build-storybook
265
- ```
266
-
267
- For the same reason changes to this folder will cause a lot of big diffs, when looking at a PR, but can mostly be skimmed over unless something looks unusual.
268
-
269
- ---
270
- ### Examples
271
-
272
- There is an example implementation in the example folder. Alternatively there are also integration examples in storybook. Make sure to keep these updated so as to showcase the current components available.
273
-
274
- ---
275
- ### Bundle analysis
276
-
277
- Calculate the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `yarn size` and visualize it with `yarn analyze`.