@guardian/stand 0.0.37 → 0.0.38

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 (63) hide show
  1. package/dist/components/alert-banner/AlertBanner.js +1 -1
  2. package/dist/components/avatar/Avatar.js +1 -1
  3. package/dist/components/button/Button.js +1 -1
  4. package/dist/components/checkbox/Checkbox.js +1 -1
  5. package/dist/components/checkbox/CheckboxGroup.js +1 -1
  6. package/dist/components/date-picker/DatePicker.js +1 -1
  7. package/dist/components/grid/Grid.js +1 -1
  8. package/dist/components/grid/styles.cjs +59 -39
  9. package/dist/components/grid/styles.js +47 -35
  10. package/dist/components/icon/Icon.js +1 -1
  11. package/dist/components/icon-button/IconButton.js +1 -1
  12. package/dist/components/icon-button/styles.js +1 -1
  13. package/dist/components/icon-link-button/IconLinkButton.js +1 -1
  14. package/dist/components/icon-link-button/styles.js +1 -1
  15. package/dist/components/inline-message/InlineMessage.js +1 -1
  16. package/dist/components/intended-audience-signifier/IntendedAudienceSignifier.js +1 -1
  17. package/dist/components/layout/Layout.cjs +49 -84
  18. package/dist/components/layout/Layout.js +27 -76
  19. package/dist/components/layout/styles.cjs +5 -3
  20. package/dist/components/layout/styles.js +5 -4
  21. package/dist/components/link/Link.cjs +5 -5
  22. package/dist/components/link/Link.js +1 -1
  23. package/dist/components/link-button/LinkButton.js +1 -1
  24. package/dist/components/link-button/styles.js +1 -1
  25. package/dist/components/menu/Menu.js +1 -1
  26. package/dist/components/radio-group/RadioGroup.js +1 -1
  27. package/dist/components/select/Select.js +1 -1
  28. package/dist/components/text-area/TextArea.js +1 -1
  29. package/dist/components/text-input/TextInput.js +1 -1
  30. package/dist/components/topbar/TopBar.js +1 -1
  31. package/dist/components/topbar/topBarItem/TopBarItem.js +1 -1
  32. package/dist/components/topbar/topBarNavigation/TopBarNavigation.js +1 -1
  33. package/dist/components/topbar/topBarToolName/TopBarToolName.js +1 -1
  34. package/dist/components/typography/Typography.js +1 -1
  35. package/dist/components/typography/styles.cjs +5 -5
  36. package/dist/index.cjs +2 -0
  37. package/dist/index.js +1 -0
  38. package/dist/layout.cjs +0 -1
  39. package/dist/layout.js +1 -1
  40. package/dist/styleD/build/css/component/grid.css +9 -2
  41. package/dist/styleD/build/css/component/layout.css +4 -4
  42. package/dist/styleD/build/css/semantic/grid.css +15 -0
  43. package/dist/styleD/build/css/semantic/sizing.css +3 -0
  44. package/dist/styleD/build/typescript/component/grid.cjs +15 -2
  45. package/dist/styleD/build/typescript/component/grid.js +15 -2
  46. package/dist/styleD/build/typescript/component/layout.cjs +7 -5
  47. package/dist/styleD/build/typescript/component/layout.js +7 -5
  48. package/dist/styleD/build/typescript/semantic/grid.cjs +21 -0
  49. package/dist/styleD/build/typescript/semantic/grid.js +19 -0
  50. package/dist/styleD/build/typescript/semantic/sizing.cjs +7 -0
  51. package/dist/styleD/build/typescript/semantic/sizing.js +7 -0
  52. package/dist/types/components/grid/sandbox.d.ts +2 -2
  53. package/dist/types/components/layout/Layout.d.ts +11 -19
  54. package/dist/types/components/layout/sandbox.d.ts +1 -1
  55. package/dist/types/components/layout/styles.d.ts +5 -2
  56. package/dist/types/components/layout/types.d.ts +13 -3
  57. package/dist/types/index.d.ts +2 -0
  58. package/dist/types/layout.d.ts +3 -3
  59. package/dist/types/styleD/build/typescript/component/grid.d.ts +15 -2
  60. package/dist/types/styleD/build/typescript/component/layout.d.ts +5 -3
  61. package/dist/types/styleD/build/typescript/semantic/grid.d.ts +21 -0
  62. package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +7 -0
  63. package/package.json +2 -1
@@ -1,5 +1,5 @@
1
1
  export declare const componentName = "Grid";
2
2
  export declare const componentTsx = "import { Grid, Item } from '@guardian/stand/grid';\n\nexport const Component = () => (\n\t<Grid>\n\t\t<Item size={{ sm: 12, md: 8, lg: 6 }}>Main content - sm:12, md:8, lg:6</Item>\n\t\t<Item size={{ sm: 12, md: 4, lg: 3 }} offset={{ md: 1, lg: 2 }}>\n\t\t\tMore content - sm:12, md:4, lg:3, offset md:1, lg:2\n\t\t</Item>\n\t\t<Item size=\"auto\">Auto width</Item>\n\t\t<Item size=\"grow\">Grows to fill</Item>\n\t</Grid>\n);\n";
3
- export declare const componentCss = "\n/* import the grid styles */\n@import '@guardian/stand/component/grid.css';\n\n.stand-grid-container {\n\tdisplay: var(--component-grid-shared-display);\n\tflex-direction: row;\n\tflex-wrap: wrap;\n\tjustify-content: flex-start;\n\talign-items: stretch;\n\tgap: 16px;\n}\n\n.stand-grid-item {\n\tbox-sizing: border-box;\n\tpadding: 16px;\n\tbackground: #eff3ff;\n\tborder: 1px solid #b8c9ff;\n\tborder-radius: 6px;\n\ttext-align: center;\n}\n\n.stand-grid-item--main {\n\tflex: 0 0 calc(((100% - 11 * 16px) * 6 / 12) + 5 * 16px);\n}\n\n.stand-grid-item--sidebar {\n\tflex: 0 0 calc(((100% - 11 * 16px) * 3 / 12) + 2 * 16px);\n\tmargin-left: calc(((100% - 11 * 16px) * 1 / 12) + 1 * 16px);\n}\n\n.stand-grid-item--auto {\n\tflex: 0 0 auto;\n\twidth: auto;\n\tmax-width: none;\n\twhite-space: nowrap;\n}\n\n.stand-grid-item--grow {\n\tflex-basis: 0;\n\tflex-grow: 1;\n\tmax-width: 100%;\n}\n";
3
+ export declare const componentCss = "\n/* import the grid styles */\n@import '@guardian/stand/component/grid.css';\n\n.stand-grid-container {\n\t--gap: var(--component-grid-sm-gap);\n\tdisplay: var(--component-grid-shared-display);\n\tflex-direction: var(--component-grid-shared-direction);\n\tflex-wrap: var(--component-grid-shared-wrap);\n\tjustify-content: var(--component-grid-shared-justify-content);\n\talign-items: var(--component-grid-shared-align-items);\n\tgap: var(--gap);\n\tpadding: 0 var(--component-grid-sm-padding);\n}\n\n@media (min-width: 830px) {\n\t.stand-grid-container {\n\t\t--gap: var(--component-grid-md-gap);\n\t\tpadding: 0 var(--component-grid-md-padding);\n\t}\n}\n\n@media (min-width: 1056px) {\n\t.stand-grid-container {\n\t\t--gap: var(--component-grid-lg-gap);\n\t\tpadding: 0 var(--component-grid-lg-padding);\n\t}\n}\n\n.stand-grid-item {\n\tbox-sizing: border-box;\n\tpadding: 16px;\n\tbackground: #eff3ff;\n\tborder: 1px solid #b8c9ff;\n\tborder-radius: 6px;\n\ttext-align: center;\n}\n\n/* 6-column span: ((100% - 11 * gap) * 6 / 12) + 5 * gap */\n.stand-grid-item--main {\n\tflex: 0 0 calc(((100% - 11 * var(--gap)) * 6 / 12) + 5 * var(--gap));\n}\n\n/* 3-column span with 1-column offset */\n.stand-grid-item--sidebar {\n\tflex: 0 0 calc(((100% - 11 * var(--gap)) * 3 / 12) + 2 * var(--gap));\n\tmargin-left: calc(((100% - 11 * var(--gap)) * 1 / 12) + 1 * var(--gap));\n}\n\n.stand-grid-item--auto {\n\tflex: 0 0 auto;\n\twidth: auto;\n\tmax-width: none;\n\twhite-space: nowrap;\n}\n\n.stand-grid-item--grow {\n\tflex-basis: 0;\n\tflex-grow: 1;\n\tmax-width: 100%;\n}\n";
4
4
  export declare const componentHtml = "<div class=\"container\">\n\t<div class=\"stand-grid-container\">\n\t\t<div class=\"stand-grid-item stand-grid-item--main\">Main content</div>\n\t\t<div class=\"stand-grid-item stand-grid-item--sidebar\">Sidebar</div>\n\t\t<div class=\"stand-grid-item stand-grid-item--auto\">Auto width</div>\n\t\t<div class=\"stand-grid-item stand-grid-item--grow\">Grows to fill</div>\n\t</div>\n</div>\n";
5
- export declare const componentJs = "\nimport { componentGrid } from \"@guardian/stand\";\n\nconst containerStyle = `\n\tdisplay: ${componentGrid.shared.display};\n\tflex-direction: row;\n\tflex-wrap: wrap;\n\tjustify-content: flex-start;\n\talign-items: stretch;\n\tgap: 16px;\n`;\n\nconst itemStyle = `\n\tbox-sizing: border-box;\n\tpadding: 16px;\n\tbackground: #eff3ff;\n\tborder: 1px solid #b8c9ff;\n\tborder-radius: 6px;\n\ttext-align: center;\n`;\n\ndocument.getElementById(\"app\").innerHTML = `\n\t<div style=\"${containerStyle}\">\n\t\t<div style=\"${itemStyle}; flex: 0 0 calc(((100% - 11 * 16px) * 6 / 12) + 5 * 16px);\">Main content</div>\n\t\t<div style=\"${itemStyle}; flex: 0 0 calc(((100% - 11 * 16px) * 3 / 12) + 2 * 16px); margin-left: calc(((100% - 11 * 16px) * 1 / 12) + 1 * 16px);\">Sidebar</div>\n\t\t<div style=\"${itemStyle}; flex: 0 0 auto; width: auto; max-width: none; white-space: nowrap;\">Auto width</div>\n\t\t<div style=\"${itemStyle}; flex-basis: 0; flex-grow: 1; max-width: 100%;\">Grows to fill</div>\n\t</div>\n`;\n";
5
+ export declare const componentJs = "\nimport { componentGrid } from \"@guardian/stand\";\n\nconst { shared, sm } = componentGrid;\n\nconst containerStyle = `\n\tdisplay: ${shared.display};\n\tflex-direction: ${shared.direction};\n\tflex-wrap: ${shared.wrap};\n\tjustify-content: ${shared.justifyContent};\n\talign-items: ${shared.alignItems};\n\tgap: ${sm.gap};\n\tpadding: 0 ${sm.padding};\n`;\n\nconst itemStyle = `\n\tbox-sizing: border-box;\n\tpadding: 16px;\n\tbackground: #eff3ff;\n\tborder: 1px solid #b8c9ff;\n\tborder-radius: 6px;\n\ttext-align: center;\n`;\n\n// 6-column span: ((100% - (columns - 1) * gap) * size / columns) + (size - 1) * gap\nconst mainWidth = `calc(((100% - (${sm.columns} - 1) * ${sm.gap}) * 6 / ${sm.columns}) + 5 * ${sm.gap})`;\n// 3-column span with 1-column offset\nconst sidebarWidth = `calc(((100% - (${sm.columns} - 1) * ${sm.gap}) * 3 / ${sm.columns}) + 2 * ${sm.gap})`;\nconst sidebarOffset = `calc(((100% - (${sm.columns} - 1) * ${sm.gap}) * 1 / ${sm.columns}) + 1 * ${sm.gap})`;\n\ndocument.getElementById(\"app\").innerHTML = `\n\t<div style=\"${containerStyle}\">\n\t\t<div style=\"${itemStyle}; flex: 0 0 ${mainWidth};\">Main content</div>\n\t\t<div style=\"${itemStyle}; flex: 0 0 ${sidebarWidth}; margin-left: ${sidebarOffset};\">Sidebar</div>\n\t\t<div style=\"${itemStyle}; flex: 0 0 auto; width: auto; max-width: none; white-space: nowrap;\">Auto width</div>\n\t\t<div style=\"${itemStyle}; flex-basis: 0; flex-grow: 1; max-width: 100%;\">Grows to fill</div>\n\t</div>\n`;\n";
@@ -1,19 +1,11 @@
1
- import type { LayoutProps, SidebarProps } from './types';
2
- /**
3
- * Currently a WIP (Subject to change, but usable) sidebar that can be used in the Layout, it supports two different layout behaviors at the sm breakpoint,
4
- * either 'above-grid' which will place the sidebar above the grid content effectively making it a horizontal bar at the top of the page,
5
- * or 'hidden' which will hide the sidebar entirely at the sm breakpoint.
6
- *
7
- * The consumer can choose how to make the sidebar content accessible through other means (e.g. a collapsible menu in the TopBar) when using the 'hidden' option.
8
- */
9
- export declare function Sidebar({ children, layoutSmBreakpoint, theme, cssOverrides, ...props }: SidebarProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
- /**
11
- * A layout component that defines a grid structure for the page, it has specific areas for an AlertBanner, TopBar, Sidebar and Grid content.
12
- *
13
- * The layout adjusts based on the defined breakpoints in the theme, allowing for responsive design.
14
- *
15
- * The Layout component will look through its children and place them in the correct grid area based on their type (AlertBanner, TopBar, Sidebar, Grid), it ignores any children that are not of these types.
16
- *
17
- * Consumers can customize the layout by providing their own themes and CSS overrides for each of the components.
18
- */
19
- export declare function Layout({ children, fluid, theme, cssOverrides, ...props }: LayoutProps): import("@emotion/react/jsx-runtime").JSX.Element;
1
+ import type React from 'react';
2
+ import type { LayoutProps, LayoutSlotProps, MainProps, SidebarProps } from './types';
3
+ interface LayoutCompound {
4
+ (props: LayoutProps): React.ReactElement;
5
+ AlertBanner: (props: LayoutSlotProps) => React.ReactElement;
6
+ TopBar: (props: LayoutSlotProps) => React.ReactElement;
7
+ Sidebar: (props: SidebarProps) => React.ReactElement;
8
+ Main: (props: MainProps) => React.ReactElement;
9
+ }
10
+ export declare const Layout: LayoutCompound;
11
+ export {};
@@ -1,5 +1,5 @@
1
1
  export declare const componentName = "Layout";
2
- export declare const componentTsx = "import { Grid, Item } from '@guardian/stand/grid';\nimport { Layout, Sidebar } from '@guardian/stand/layout';\nimport { TopBar, TopBarToolName } from '@guardian/stand/TopBar';\n\nexport const Component = () => (\n\t<Layout>\n\t\t<TopBar>\n\t\t\t<TopBarToolName name=\"Layout Demo\" favicon={{ letter: 'L' }} />\n\t\t</TopBar>\n\t\t<Sidebar layoutSmBreakpoint=\"above-grid\">\n\t\t\t<div style={{ padding: '8px' }}>Sidebar content</div>\n\t\t</Sidebar>\n\t\t<Grid>\n\t\t\t<Item size={{ sm: 12, md: 8 }}>Main content</Item>\n\t\t\t<Item size={{ sm: 12, md: 4 }}>Secondary content</Item>\n\t\t</Grid>\n\t</Layout>\n);\n";
2
+ export declare const componentTsx = "import { Grid, Item } from '@guardian/stand/grid';\nimport { AlertBanner } from '@guardian/stand/alert-banner';\nimport { Layout } from '@guardian/stand/layout';\nimport { TopBar, TopBarToolName } from '@guardian/stand/TopBar';\n\nexport const Component = () => (\n\t<Layout aria-label=\"Page layout\">\n\t\t<Layout.AlertBanner as=\"div\" role=\"status\" aria-live=\"polite\">\n\t\t\t<AlertBanner level=\"information\">Layout banner message</AlertBanner>\n\t\t</Layout.AlertBanner>\n\t\t<Layout.TopBar>\n\t\t\t<TopBar>\n\t\t\t\t<TopBarToolName name=\"Layout Demo\" favicon={{ letter: 'L' }} />\n\t\t\t</TopBar>\n\t\t</Layout.TopBar>\n\t\t<Layout.Sidebar as=\"nav\" aria-label=\"Secondary navigation\" layoutSmBreakpoint=\"above-grid\">\n\t\t\t<div style={{ padding: '8px' }}>Sidebar content</div>\n\t\t</Layout.Sidebar>\n\t\t<Layout.Main fluid={false}>\n\t\t\t<Grid>\n\t\t\t\t<Item size={{ sm: 12, md: 8 }}>Main content</Item>\n\t\t\t\t<Item size={{ sm: 12, md: 4 }}>Secondary content</Item>\n\t\t\t</Grid>\n\t\t</Layout.Main>\n\t</Layout>\n);\n";
3
3
  export declare const componentCss = "\n/* import the layout styles */\n@import '@guardian/stand/component/layout.css';\n@import '@guardian/stand/semantic/breakpoints.css';\n\n/*\n * Use the TopBar and Grid/Item custom CSS examples from their respective\n * component docs to style the content placed inside these layout regions.\n */\n\n.stand-layout {\n\tdisplay: var(--component-layout-layout-shared-display);\n\tmin-height: var(--component-layout-layout-shared-min-height);\n\twidth: var(--component-layout-layout-shared-width);\n\tgrid-template-areas: var(--component-layout-layout-sm-grid-template-areas);\n\tgrid-template-columns: var(--component-layout-layout-sm-grid-template-columns);\n\tgrid-template-rows: var(--component-layout-layout-sm-grid-template-rows);\n}\n\n.stand-layout-alert-banner {\n\tgrid-area: alertbanner;\n}\n\n.stand-layout-top-bar {\n\tgrid-area: topbar;\n}\n\n.stand-layout-sidebar {\n\tgrid-area: sidebar;\n\tbackground: #f2f2f2;\n\tpadding: 8px;\n}\n\n.stand-layout-main {\n\tgrid-area: main;\n\tpadding: 8px;\n}\n\n@media (min-width: var(--semantic-breakpoints-md)) {\n\t.stand-layout {\n\t\tgrid-template-areas: var(--component-layout-layout-md-grid-template-areas);\n\t\tgrid-template-columns: var(--component-layout-layout-md-grid-template-columns);\n\t\tgrid-template-rows: var(--component-layout-layout-md-grid-template-rows);\n\t}\n\n\t.stand-layout-sidebar {\n\t\tdisplay: var(--component-layout-sidebar-md-display);\n\t\twidth: var(--component-layout-sidebar-md-width);\n\t}\n}\n";
4
4
  export declare const componentHtml = "<div class=\"container\">\n\t<div class=\"stand-layout\">\n\t\t<div class=\"stand-layout-alert-banner\">Alert banner area</div>\n\t\t<div class=\"stand-layout-top-bar\">Top bar area</div>\n\t\t<div class=\"stand-layout-sidebar\">Sidebar area</div>\n\t\t<div class=\"stand-layout-main\">Main content area</div>\n\t</div>\n</div>\n";
5
5
  export declare const componentJs = "\nimport { componentLayout, semanticBreakpoints } from \"@guardian/stand\";\n\n// Use the TopBar and Grid/Item custom JS examples from their respective\n// component docs to style the content placed inside these layout regions.\n\n\tconst sheet = new CSSStyleSheet();\n\n\tsheet.replaceSync(`\n\t .js-stand-layout {\n\t display: ${componentLayout.layout.shared.display};\n\t min-height: ${componentLayout.layout.shared.minHeight};\n\t width: ${componentLayout.layout.shared.width};\n\t grid-template-areas: ${componentLayout.layout.sm.gridTemplateAreas};\n\t grid-template-columns: ${componentLayout.layout.sm.gridTemplateColumns};\n\t grid-template-rows: ${componentLayout.layout.sm.gridTemplateRows};\n\t }\n\t .js-stand-layout-alert-banner {\n\t grid-area: alertbanner;\n\t }\n\t .js-stand-layout-top-bar {\n\t grid-area: topbar;\n\t }\n\t .js-stand-layout-sidebar {\n\t grid-area: sidebar;\n\t display: ${componentLayout.sidebar.sm.aboveGrid.display};\n\t background: #f2f2f2;\n\t padding: 8px;\n\t }\n\t .js-stand-layout-main {\n\t grid-area: main;\n\t padding: 8px;\n\t }\n\t @media (min-width: ${semanticBreakpoints.md}) {\n\t .js-stand-layout {\n\t grid-template-areas: ${componentLayout.layout.md.gridTemplateAreas};\n\t grid-template-columns: ${componentLayout.layout.md.gridTemplateColumns};\n\t grid-template-rows: ${componentLayout.layout.md.gridTemplateRows};\n\t }\n\t .js-stand-layout-sidebar {\n\t display: ${componentLayout.sidebar.md.display};\n\t width: ${componentLayout.sidebar.md.width};\n\t }\n\t }\n\t`);\n\n\tdocument.adoptedStyleSheets.push(sheet);\n\n\tdocument.getElementById(\"app\").innerHTML = `\n\t <div class=\"js-stand-layout\">\n\t <div class=\"js-stand-layout-alert-banner\">Alert banner area</div>\n\t <div class=\"js-stand-layout-top-bar\">Top bar area</div>\n\t <div class=\"js-stand-layout-sidebar\">Sidebar area</div>\n\t <div class=\"js-stand-layout-main\">Main content area</div>\n\t </div>\n\t`;\n";
@@ -1,16 +1,19 @@
1
1
  import type { SerializedStyles } from '@emotion/react';
2
2
  import type { ComponentLayout } from '../../styleD/build/typescript/component/layout';
3
3
  import type { DeepPartial, Prettify } from '../../util/types';
4
- import type { LayoutProps, SidebarProps } from './types';
4
+ import type { MainProps, SidebarProps } from './types';
5
5
  export type LayoutTheme = Prettify<ComponentLayout['layout']>;
6
6
  export type PartialLayoutTheme = Prettify<DeepPartial<LayoutTheme>>;
7
7
  export declare const defaultLayoutTheme: LayoutTheme;
8
8
  export type SidebarTheme = Prettify<ComponentLayout['sidebar']>;
9
9
  export type PartialSidebarTheme = Prettify<DeepPartial<SidebarTheme>>;
10
10
  export declare const defaultSidebarTheme: SidebarTheme;
11
+ export type MainTheme = Prettify<ComponentLayout['main']>;
12
+ export type PartialMainTheme = Prettify<DeepPartial<MainTheme>>;
13
+ export declare const defaultMainTheme: MainTheme;
11
14
  export declare const alertBannerLayoutStyles: () => SerializedStyles;
12
15
  export declare const topBarLayoutStyles: () => SerializedStyles;
13
16
  export declare const sidebarLayoutStyles: () => SerializedStyles;
14
- export declare const mainLayoutStyles: (theme: LayoutTheme, { fluid }: Required<Pick<LayoutProps, 'fluid'>>) => SerializedStyles;
17
+ export declare const mainLayoutStyles: (theme: MainTheme, { fluid }: Required<Pick<MainProps, 'fluid'>>) => SerializedStyles;
15
18
  export declare const layoutStyles: (theme: LayoutTheme) => SerializedStyles;
16
19
  export declare const sidebarStyles: (theme: SidebarTheme, { layoutSmBreakpoint }: Required<Pick<SidebarProps, 'layoutSmBreakpoint'>>) => SerializedStyles;
@@ -1,14 +1,18 @@
1
+ import type { SerializedStyles } from '@emotion/react';
2
+ import type React from 'react';
1
3
  import type { DefaultPropsWithChildren } from '../../util/types';
2
- import type { LayoutTheme, SidebarTheme } from './styles';
3
- export interface LayoutProps extends DefaultPropsWithChildren<LayoutTheme> {
4
+ import type { LayoutTheme, MainTheme, SidebarTheme } from './styles';
5
+ export type LayoutProps = DefaultPropsWithChildren<LayoutTheme>;
6
+ export interface MainProps extends DefaultPropsWithChildren<MainTheme>, React.HTMLAttributes<HTMLElement> {
4
7
  /**
5
8
  * When `true`, the layout will take up the full width of its container, enabled by default.
6
9
  * When `false`, the layout will have a max-width of 1584px and be centered within its container.
7
10
  * This can be used to prevent the layout from becoming too stretched on very wide screens.
8
11
  */
9
12
  fluid?: boolean;
13
+ as?: React.ElementType;
10
14
  }
11
- export interface SidebarProps extends DefaultPropsWithChildren<SidebarTheme> {
15
+ export interface SidebarProps extends DefaultPropsWithChildren<SidebarTheme>, React.HTMLAttributes<HTMLElement> {
12
16
  /**
13
17
  * Defines the layout behavior of the sidebar at the sm breakpoint.
14
18
  *
@@ -17,4 +21,10 @@ export interface SidebarProps extends DefaultPropsWithChildren<SidebarTheme> {
17
21
  *
18
22
  */
19
23
  layoutSmBreakpoint?: 'above-grid' | 'hidden';
24
+ as?: React.ElementType;
25
+ }
26
+ export interface LayoutSlotProps extends React.HTMLAttributes<HTMLElement> {
27
+ children?: React.ReactNode;
28
+ cssOverrides?: SerializedStyles | SerializedStyles[];
29
+ as?: React.ElementType;
20
30
  }
@@ -74,6 +74,8 @@ export type { BaseTypography } from './styleD/build/typescript/base/typography';
74
74
  */
75
75
  export { semanticColors } from './styleD/build/typescript/semantic/colors';
76
76
  export type { SemanticColors } from './styleD/build/typescript/semantic/colors';
77
+ export { semanticGrid } from './styleD/build/typescript/semantic/grid';
78
+ export type { SemanticGrid } from './styleD/build/typescript/semantic/grid';
77
79
  export { semanticTypography } from './styleD/build/typescript/semantic/typography';
78
80
  export type { SemanticTypography } from './styleD/build/typescript/semantic/typography';
79
81
  export { semanticSizing } from './styleD/build/typescript/semantic/sizing';
@@ -13,8 +13,8 @@
13
13
  * If you only need the built CSS (./component/layout.css),
14
14
  * you don't need to install these.
15
15
  */
16
- export { Layout, Sidebar } from './components/layout/Layout';
17
- export type { LayoutProps, SidebarProps } from './components/layout/types';
18
- export type { PartialLayoutTheme as LayoutTheme, PartialSidebarTheme as SidebarTheme, } from './components/layout/styles';
16
+ export { Layout } from './components/layout/Layout';
17
+ export type { LayoutProps, SidebarProps as LayoutSidebarProps, MainProps as LayoutMainProps, LayoutSlotProps as LayoutAlertBannerProps, LayoutSlotProps as LayoutTopBarProps, } from './components/layout/types';
18
+ export type { PartialLayoutTheme as LayoutTheme, PartialSidebarTheme as SidebarTheme, PartialMainTheme as MainTheme, } from './components/layout/styles';
19
19
  export { componentLayout } from './styleD/build/typescript/component/layout';
20
20
  export type { ComponentLayout } from './styleD/build/typescript/component/layout';
@@ -5,12 +5,25 @@ export declare const componentGrid: {
5
5
  shared: {
6
6
  display: string;
7
7
  width: string;
8
- columns: number;
9
- gap: string;
10
8
  direction: string;
11
9
  wrap: string;
12
10
  justifyContent: string;
13
11
  alignItems: string;
14
12
  };
13
+ sm: {
14
+ columns: number;
15
+ gap: string;
16
+ padding: string;
17
+ };
18
+ md: {
19
+ columns: number;
20
+ gap: string;
21
+ padding: string;
22
+ };
23
+ lg: {
24
+ columns: number;
25
+ gap: string;
26
+ padding: string;
27
+ };
15
28
  };
16
29
  export type ComponentGrid = typeof componentGrid;
@@ -7,9 +7,6 @@ export declare const componentLayout: {
7
7
  display: string;
8
8
  minHeight: string;
9
9
  width: string;
10
- 'max-width': string;
11
- 'margin-left': string;
12
- 'margin-right': string;
13
10
  };
14
11
  sm: {
15
12
  gridTemplateAreas: string;
@@ -44,5 +41,10 @@ export declare const componentLayout: {
44
41
  width: string;
45
42
  };
46
43
  };
44
+ main: {
45
+ 'max-width': string;
46
+ 'margin-left': string;
47
+ 'margin-right': string;
48
+ };
47
49
  };
48
50
  export type ComponentLayout = typeof componentLayout;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Do not edit directly, this file was auto-generated.
3
+ */
4
+ export declare const semanticGrid: {
5
+ gutter: {
6
+ 'lg-px': string;
7
+ 'md-px': string;
8
+ 'sm-px': string;
9
+ };
10
+ margin: {
11
+ 'lg-px': string;
12
+ 'md-px': string;
13
+ 'sm-px': string;
14
+ };
15
+ columns: {
16
+ lg: number;
17
+ md: number;
18
+ sm: number;
19
+ };
20
+ };
21
+ export type SemanticGrid = typeof semanticGrid;
@@ -20,5 +20,12 @@ export declare const semanticSizing: {
20
20
  md: string;
21
21
  'extra-wide': string;
22
22
  };
23
+ sidebar: {
24
+ 'md-px': string;
25
+ 'lg-px': string;
26
+ };
27
+ layout: {
28
+ 'max-width-px': string;
29
+ };
23
30
  };
24
31
  export type SemanticSizing = typeof semanticSizing;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/stand",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "repository": {
5
5
  "url": "https://github.com/guardian/stand"
6
6
  },
@@ -169,6 +169,7 @@
169
169
  "./base/radius.css": "./dist/styleD/build/css/base/radius.css",
170
170
  "./semantic/breakpoints.css": "./dist/styleD/build/css/semantic/breakpoints.css",
171
171
  "./semantic/colors.css": "./dist/styleD/build/css/semantic/colors.css",
172
+ "./semantic/grid.css": "./dist/styleD/build/css/semantic/grid.css",
172
173
  "./semantic/typography.css": "./dist/styleD/build/css/semantic/typography.css",
173
174
  "./semantic/sizing.css": "./dist/styleD/build/css/semantic/sizing.css",
174
175
  "./semantic/shadow.css": "./dist/styleD/build/css/semantic/shadow.css",