@guardian/stand 0.0.14 → 0.0.16
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/TopBar.cjs +9 -0
- package/dist/TopBar.js +2 -0
- package/dist/components/avatar/Avatar.cjs +2 -2
- package/dist/components/button/styles.cjs +7 -4
- package/dist/components/button/styles.js +7 -4
- package/dist/components/byline/Byline.cjs +15 -15
- package/dist/components/favicon/Favicon.cjs +2 -2
- package/dist/components/icon-button/IconButton.cjs +3 -3
- package/dist/components/icon-link-button/IconLinkButton.cjs +3 -3
- package/dist/components/menu/Menu.cjs +204 -0
- package/dist/components/menu/Menu.js +77 -0
- package/dist/components/menu/styles.cjs +103 -0
- package/dist/components/menu/styles.js +88 -0
- package/dist/components/tag-picker/TagTable.cjs +11 -11
- package/dist/components/topbar/toolName/TopBarToolName.cjs +31 -0
- package/dist/components/topbar/toolName/TopBarToolName.js +12 -0
- package/dist/components/topbar/toolName/styles.cjs +44 -0
- package/dist/components/topbar/toolName/styles.js +37 -0
- package/dist/index.cjs +6 -0
- package/dist/index.js +3 -0
- package/dist/menu.cjs +13 -0
- package/dist/menu.js +2 -0
- package/dist/styleD/build/css/component/TopBar.css +20 -0
- package/dist/styleD/build/css/component/menu.css +82 -0
- package/dist/styleD/build/css/semantic/shadow.css +7 -0
- package/dist/styleD/build/typescript/component/TopBar.cjs +28 -0
- package/dist/styleD/build/typescript/component/TopBar.js +26 -0
- package/dist/styleD/build/typescript/component/menu.cjs +140 -0
- package/dist/styleD/build/typescript/component/menu.js +138 -0
- package/dist/styleD/build/typescript/semantic/shadow.cjs +7 -0
- package/dist/styleD/build/typescript/semantic/shadow.js +5 -0
- package/dist/types/TopBar.d.ts +19 -0
- package/dist/types/avatar.d.ts +1 -1
- package/dist/types/button.d.ts +1 -1
- package/dist/types/byline.d.ts +1 -1
- package/dist/types/components/avatar/sandbox.d.ts +5 -0
- package/dist/types/components/avatar/styles.d.ts +2 -1
- package/dist/types/components/button/sandbox.d.ts +5 -0
- package/dist/types/components/button/styles.d.ts +2 -1
- package/dist/types/components/favicon/sandbox.d.ts +5 -0
- package/dist/types/components/favicon/styles.d.ts +2 -1
- package/dist/types/components/icon/sandbox.d.ts +5 -0
- package/dist/types/components/icon/styles.d.ts +2 -1
- package/dist/types/components/icon-button/sandbox.d.ts +5 -0
- package/dist/types/components/icon-button/styles.d.ts +2 -1
- package/dist/types/components/icon-link-button/sandbox.d.ts +5 -0
- package/dist/types/components/icon-link-button/styles.d.ts +2 -1
- package/dist/types/components/link-button/sandbox.d.ts +5 -0
- package/dist/types/components/link-button/styles.d.ts +2 -1
- package/dist/types/components/menu/Menu.d.ts +7 -0
- package/dist/types/components/menu/sandbox.d.ts +5 -0
- package/dist/types/components/menu/styles.d.ts +28 -0
- package/dist/types/components/menu/types.d.ts +63 -0
- package/dist/types/components/topbar/toolName/TopBarToolName.d.ts +2 -0
- package/dist/types/components/topbar/toolName/sandbox.d.ts +5 -0
- package/dist/types/components/topbar/toolName/styles.d.ts +11 -0
- package/dist/types/components/topbar/toolName/types.d.ts +22 -0
- package/dist/types/components/typography/sandbox.d.ts +5 -0
- package/dist/types/components/typography/styles.d.ts +2 -1
- package/dist/types/favicon.d.ts +1 -1
- package/dist/types/icon-button.d.ts +1 -1
- package/dist/types/icon-link-button.d.ts +1 -1
- package/dist/types/icon.d.ts +1 -1
- package/dist/types/index.d.ts +6 -0
- package/dist/types/link-button.d.ts +1 -1
- package/dist/types/menu.d.ts +21 -0
- package/dist/types/styleD/build/typescript/component/TopBar.d.ts +28 -0
- package/dist/types/styleD/build/typescript/component/menu.d.ts +140 -0
- package/dist/types/styleD/build/typescript/semantic/shadow.d.ts +7 -0
- package/dist/types/styleD/stories/semantic/Shadow.d.ts +1 -0
- package/dist/types/typography.d.ts +1 -1
- package/dist/types/util/storybook/sandbox/Sandbox.d.ts +14 -0
- package/package.json +34 -9
- /package/dist/types/util/{storybookStyles.d.ts → storybook/styles.d.ts} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { MenuItemProps as RACMenuItemProps, MenuProps as RACMenuProps, MenuSectionProps as RACMenuSectionProps, MenuTriggerProps as RACMenuTriggerProps, PopoverProps as RACPopoverProps, SeparatorProps as RACSeparatorProps } from 'react-aria-components';
|
|
3
|
+
import type { DefaultProps, DefaultPropsWithChildren } from '../../util/types';
|
|
4
|
+
import type { IconProps } from '../icon/types';
|
|
5
|
+
import type { MenuItemTheme, MenuPopoverTheme, MenuSectionTheme, MenuSeparatorTheme, MenuTheme } from './styles';
|
|
6
|
+
export interface MenuProps extends DefaultPropsWithChildren<MenuTheme, RACMenuProps<object>['className']>, Omit<RACMenuProps<object>, 'children'> {
|
|
7
|
+
/**
|
|
8
|
+
* Size variant of the Menu
|
|
9
|
+
*/
|
|
10
|
+
size?: MenuPopoverProps['size'];
|
|
11
|
+
/**
|
|
12
|
+
* Props to pass to the underlying React Aria Popover component
|
|
13
|
+
*/
|
|
14
|
+
popoverProps?: Omit<MenuPopoverProps, 'children' | 'size'>;
|
|
15
|
+
/**
|
|
16
|
+
* Props to pass to the underlying React Aria MenuTrigger component
|
|
17
|
+
*/
|
|
18
|
+
menuTriggerProps?: Omit<MenuTriggerProps, 'children'>;
|
|
19
|
+
}
|
|
20
|
+
export interface MenuSectionProps extends DefaultPropsWithChildren<MenuSectionTheme, RACMenuSectionProps<object>['className']>, Omit<RACMenuSectionProps<object>, 'children'> {
|
|
21
|
+
/**
|
|
22
|
+
* The (optional) name of the section to be displayed in a header
|
|
23
|
+
*/
|
|
24
|
+
name?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Size variant of the MenuSection, this doesn't need to be passed if the MenuSection is a child of Menu, as it will inherit the size of the Menu.
|
|
27
|
+
*/
|
|
28
|
+
size?: MenuPopoverProps['size'];
|
|
29
|
+
/**
|
|
30
|
+
* Disable the selectionMode option for the time being, as we currently don't have a checkbox or radio button component to use for the selectable menu items that this would require. This can be added in the future when we have these components available.
|
|
31
|
+
*/
|
|
32
|
+
selectionMode?: 'none';
|
|
33
|
+
}
|
|
34
|
+
export interface MenuItemProps extends DefaultProps<MenuItemTheme, RACMenuItemProps['className']>, Omit<RACMenuItemProps, 'children'> {
|
|
35
|
+
/**
|
|
36
|
+
* The main label of the menu item, this can be a string or any React node if more complex layout is needed.
|
|
37
|
+
*/
|
|
38
|
+
label: React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Optional description text for the menu item, this can be a string or any React node if more complex layout is needed. The description will be rendered below the label in a smaller font size.
|
|
41
|
+
*/
|
|
42
|
+
description?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Optional content to be rendered on the right side of the menu item, this can be used for things like keyboard shortcuts or badges. This can be a string or any React node if more complex layout is needed.
|
|
45
|
+
*/
|
|
46
|
+
aside?: React.ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* Icon to be rendered within the left side of the menu item. Passed to the Icon component, so can be either a string (for material symbols) or an SVG element.
|
|
49
|
+
*/
|
|
50
|
+
icon?: IconProps['symbol'] | Exclude<IconProps['children'], string>;
|
|
51
|
+
/**
|
|
52
|
+
* Size variant of the MenuItem, this doesn't need to be passed if the MenuItem is a child of Menu, as it will inherit the size of the Menu.
|
|
53
|
+
*/
|
|
54
|
+
size?: MenuPopoverProps['size'];
|
|
55
|
+
}
|
|
56
|
+
export type MenuSeparatorProps = DefaultProps<MenuSeparatorTheme, RACSeparatorProps['className']>;
|
|
57
|
+
export interface MenuPopoverProps extends DefaultProps<MenuPopoverTheme, RACPopoverProps['className']>, RACPopoverProps {
|
|
58
|
+
/**
|
|
59
|
+
* Size variant of the Popover, this doesn't need to be passed if the Popover is a child of Menu, as it will inherit the size of the Menu.
|
|
60
|
+
*/
|
|
61
|
+
size?: keyof Omit<MenuPopoverTheme, 'shared'>;
|
|
62
|
+
}
|
|
63
|
+
export type MenuTriggerProps = RACMenuTriggerProps;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "TopBarToolName";
|
|
2
|
+
export declare const componentTsx = "import { TopBarToolName } from '@guardian/stand/TopBar';\n\nexport const Component = () => {\n\treturn (\n\t\t<>\n\t\t\t<TopBarToolName\n\t\t\t\tname=\"Songwriter\"\n\t\t\t\tfavicon={{ type: 'letter', letter: 'S' }}\n\t\t\t\tsubsection=\"Article\"\n\t\t\t\tsubsectionIcon=\"menu\"\n\t\t\t/>\n\t\t</>\n\t);\n};\n";
|
|
3
|
+
export declare const componentCss = "@import \"@guardian/stand/component/TopBar.css\";\n\t/* import the favicon styles */\n\t@import '@guardian/stand/component/favicon.css';\n\n /* example setup of tool name */\n .stand-topbar-toolname {\n\t\tdisplay: var(--component-top-bar-tool-name-display);\n\t\talign-items: var(--component-top-bar-tool-name-align-items);\n\t\tgap: var(--component-top-bar-tool-name-gap);\n\t\tfont: var(--component-top-bar-tool-name-typography-font);\n\t\tletter-spacing: var(--component-top-bar-tool-name-typography-letter-spacing);\n\t\tfont-variation-settings: \"wdth\" var(--component-top-bar-tool-name-typography-font-width);\n }\n\n\t.stand-topbar-toolname-divider {\n\t\tborder-right: var(--component-top-bar-tool-name-divider-border);\n\t\theight: var(--component-top-bar-tool-name-divider-height);\n\t}\n\n\t.stand-topbar-toolname-subsection {\n\t\tdisplay: var(--component-top-bar-tool-name-display);\n\t\talign-items: var(--component-top-bar-tool-name-align-items);\n\t\tgap: var(--component-top-bar-tool-name-subsection-gap);\n\t\tfont: var(--component-top-bar-tool-name-subsection-typography-font);\n\t\tletter-spacing: var(--component-top-bar-tool-name-subsection-typography-letter-spacing);\n\t\tfont-variation-settings: \"wdth\" var(--component-top-bar-tool-name-subsection-typography-font-width)\n\t}\n\n\t.stand-favicon {\n\t\tbackground-color: var(--component-favicon-color-background);\n\t\tdisplay: var(--component-favicon-display);\n\t\talign-items: var(--component-favicon-align-items);\n\t\tjustify-content: var(--component-favicon-justify-content);\n\t\twidth: var(--component-favicon-size);\n\t\theight: var(--component-favicon-size);\n\t\tuser-select: var(--component-favicon-user-select);\n\t\tcolor: var(--component-favicon-color-text);\n\t\tfont: var(--component-favicon-typography-font);\n\t\tletter-spacing: var(--component-favicon-typography-letter-spacing);\n\t\tfont-variation-settings: \"wdth\" var(--component-favicon-typography-font-width);\n\t}\n\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container\">\n\t<div class=\"stand-topbar-toolname\">\n\t\t<div class=\"stand-favicon\">S</div>\n\t\t<div>Songwriter</div>\n\t\t<div class=\"stand-topbar-toolname-divider\"> </div>\n\t\t <div class=\"stand-topbar-toolname-subsection\">\n\t\t\t <div><svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z\"></path></svg></div>\n\t\t\t <div>Article</div>\n\t\t</div>\n\t</div>\n</div>";
|
|
5
|
+
export declare const componentJs = "\n\t// for ts/js\n\timport { componentFavicon, componentTopBar, baseColors } from '@guardian/stand';\n\n\tconst style = `\n\t\tdisplay: ${componentTopBar.ToolName.display};\n\t\talign-items: ${componentTopBar.ToolName[\"align-items\"]};\n\t\tgap: ${componentTopBar.ToolName.gap};\n\t\tfont: ${componentTopBar.ToolName.typography.font};\n\t\tletter-spacing: ${componentTopBar.ToolName.typography.letterSpacing};\n\t\tfont-variation-settings: \"wdth\" ${componentTopBar.ToolName.typography.fontWidth};\n\t`;\n\n\tconst dividerStyle = `\n\t\tborder-right: ${componentTopBar.ToolName.divider.border};\n\t\theight: ${componentTopBar.ToolName.divider.height};\n\t`;\n\n\tconst subsectionStyle = `\n\t\tdisplay: ${componentTopBar.ToolName.display};\n\t\talign-items: ${componentTopBar.ToolName[\"align-items\"]};\n\t\tgap: ${componentTopBar.ToolName.subsection.gap};\n\t\tfont: ${componentTopBar.ToolName.subsection.typography.font};\n\t\tletter-spacing: ${componentTopBar.ToolName.subsection.typography.letterSpacing};\n\t\tfont-variation-settings: \"wdth\" ${componentTopBar.ToolName.subsection.typography.fontWidth};\n\t`;\n\n\tconst faviconStyle = `\n\t\tbackground-color: ${componentFavicon.color.background};\n\t\tdisplay: ${componentFavicon.display};\n\t\talign-items: ${componentFavicon[\"align-items\"]};\n\t\tjustify-content: ${componentFavicon[\"justify-content\"]};\n\t\twidth: ${componentFavicon.size};\n\t\theight: ${componentFavicon.size};\n\t\tuser-select: ${componentFavicon[\"user-select\"]};\n\t\tcolor: ${componentFavicon.color.text};\n\t\tfont: ${componentFavicon.typography.font};\n\t\tletter-spacing: ${componentFavicon.typography.letterSpacing};\n\t\tfont-variation-settings: \"wdth\" ${componentFavicon.typography.fontWidth};\n\t`;\n\n\t// e.g. adding to DOM using vanilla JS styles\n\tdocument.getElementById(\"app\").innerHTML = `\n\n\t<div class=\"container\">\n\t\t<div style=\"${style}\">\n\t\t\t<div style=\"${faviconStyle}>S</div>\n\t\t\t<div>Songwriter</div>\n\t\t\t<div style=\"${dividerStyle}\"> </div>\n\t\t\t<div style=\"${subsectionStyle}\">\n\t\t\t\t<div><svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z\"></path></svg></div>\n\t\t\t\t<div>Article</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n`;\n";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import { type ComponentTopBar } from '../../..//styleD/build/typescript/component/TopBar';
|
|
3
|
+
import type { DeepPartial, Prettify } from '../../../util/types';
|
|
4
|
+
export type TopBarToolNameTheme = Prettify<ComponentTopBar['ToolName']>;
|
|
5
|
+
export type PartialTopBarToolNameTheme = DeepPartial<TopBarToolNameTheme>;
|
|
6
|
+
export declare const defaultToolNameTheme: TopBarToolNameTheme;
|
|
7
|
+
export declare const toolNameStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
8
|
+
export declare const toolNameTypography: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
9
|
+
export declare const dividerStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
10
|
+
export declare const subsectionStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
11
|
+
export declare const subsectionTypography: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DefaultProps } from '../../../util/types';
|
|
2
|
+
import type { FaviconProps } from '../../favicon/types';
|
|
3
|
+
import type { IconProps } from '../../icon/types';
|
|
4
|
+
import type { TopBarToolNameTheme } from './styles';
|
|
5
|
+
export interface TopBarToolNameProps extends DefaultProps<TopBarToolNameTheme> {
|
|
6
|
+
/**
|
|
7
|
+
* Name of the tool to display
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Icon to display
|
|
12
|
+
*/
|
|
13
|
+
favicon: FaviconProps;
|
|
14
|
+
/**
|
|
15
|
+
* The subsection or type of content that is represented on the page (optional)
|
|
16
|
+
* */
|
|
17
|
+
subsection?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Icon that represents the content type (optional)
|
|
20
|
+
* */
|
|
21
|
+
subsectionIcon?: IconProps['symbol'] | Exclude<IconProps['children'], string>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "Typography";
|
|
2
|
+
export declare const componentTsx = "import { Typography } from '@guardian/stand/typography';\n\nexport const Component = () => (\n\t<>\n\t\t{/* Paragraph element with default body-md preset and text children */}\n\t\t<Typography element=\"h2\" variant=\"heading-compact-xl\">Wow! A heading!</Typography>\n\n\t\t{/* Paragraph element with default body-md preset and text children */}\n\t\t<Typography>Body text here</Typography>\n\n\t\t{/* Div with an italic text wrapped inside */}\n\t\t<Typography element=\"div\" variant=\"body-md\">Some text, with <Typography element=\"i\" variant=\"body-italic-md\">even more text</Typography></Typography>\n\t</>\n);\n\n";
|
|
3
|
+
export declare const componentCss = "@import '@guardian/stand/component/typography.css';\n\t@import '@guardian/stand/semantic/typography.css';\n\n /* shared typography styles for all variants */\n .stand-typography {\n \tcolor: var(--component-typography-color);\n }\n\n /* example setup of heading-compact-xl */\n .stand-typography-heading-compact-xl {\n\t\tfont: var(--semantic-typography-heading-compact-xl-font);\n\t\tletter-spacing: var(--semantic-typography-heading-compact-xl-letter-spacing);\n\t\tfont-variation-settings: \"wdth\" var(--semantic-typography-heading-compact-xl-font-width);\n\t}\n\n /* example setup of standard body text */\n .stand-typography-body-md {\n\t\tfont: var(--semantic-typography-body-md-font);\n\t\tletter-spacing: var(--semantic-typography-body-md-letter-spacing);\n\t\tfont-variation-settings: \"wdth\" var(--semantic-typography-body-md-font-width);\n\t}\n\n\t/* example setup of italic body text */\n\t.stand-typography-body-italic-md {\n\t\tfont: var(--semantic-typography-body-italic-md-font);\n\t\tletter-spacing: var(--semantic-typography-body-italic-md-letter-spacing);\n\t\tfont-variation-settings: \"wdth\" var(--semantic-typography-body-italic-md-font-width);\n\t}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container flow-column\">\n <h2 class=\"stand-typography stand-typography-heading-compact-xl\">Wow! A heading!</h2>\n\n\t<p class=\"stand-typography stand-typography-body-md\">Body text here</p>\n\n\t<div class=\"stand-typography stand-typography-body-md\">Some text, with <i class=\"stand-typography stand-typography-body-italic-md\">even more text</i></div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\t// for ts/js\n\t\timport { componentTypography, semanticTypography } from \"@guardian/stand\";\n\n \t// example of creating a stylesheet in js\n \tconst sheet = new CSSStyleSheet();\n\n \t// apply the rules to the sheet\n \tsheet.replaceSync(`\n\t\t\t.js-stand-typography {\n\t\t\t\tcolor: ${componentTypography.color};\n\t\t\t}\n\t\t\t.js-stand-typography-heading-compact-xl {\n\t\t\t\tfont: ${semanticTypography['heading-compact-xl'].font};\n\t\t\t\tletter-spacing: ${semanticTypography['heading-compact-xl'].letterSpacing};\n\t\t\t\tfont-variation-settings: \"wdth\" ${semanticTypography['heading-compact-xl'].fontWidth};\n\t\t\t}\n\t\t\t.js-stand-typography-body-md {\n\t\t\t\tfont: ${semanticTypography['body-md'].font};\n\t\t\t\tletter-spacing: ${semanticTypography['body-md'].letterSpacing};\n\t\t\t\tfont-variation-settings: \"wdth\" ${semanticTypography['body-md'].fontWidth};\n\t\t\t}\n\t\t\t.js-stand-typography-body-italic-md {\n\t\t\t\tfont: ${semanticTypography['body-italic-md'].font};\n\t\t\t\tletter-spacing: ${semanticTypography['body-italic-md'].letterSpacing};\n\t\t\t\tfont-variation-settings: \"wdth\" ${semanticTypography['body-italic-md'].fontWidth};\n\t\t\t}\n \t`);\n\n // update the document with the sheet\n document.adoptedStyleSheets.push(sheet);\n\n // modify the dom with the typography components using the generated stylesheet\n document.getElementById(\"app\").innerHTML = `<div class=\"container flow-column\">\n\t\t<h2 class=\"js-stand-typography js-stand-typography-heading-compact-xl\">Wow! A heading!</h2>\n\t\t<p class=\"js-stand-typography js-stand-typography-body-md\">Body text here</p>\n\t\t<div class=\"js-stand-typography js-stand-typography-body-md\">Some text, with <i class=\"js-stand-typography js-stand-typography-body-italic-md\">even more text</i></div>\n </div>`;\n\n";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { SerializedStyles } from '@emotion/react';
|
|
2
2
|
import { type ComponentTypography } from '../../styleD/build/typescript/component/typography';
|
|
3
|
-
import type { Prettify } from '../../util/types';
|
|
3
|
+
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
4
|
import type { TypographyProps } from './types';
|
|
5
5
|
export type TypographyTheme = Prettify<ComponentTypography>;
|
|
6
|
+
export type PartialTypographyTheme = DeepPartial<TypographyTheme>;
|
|
6
7
|
export declare const defaultTypographyTheme: TypographyTheme;
|
|
7
8
|
export declare const typographyStyles: (theme: TypographyTheme, { variant }: Required<Pick<TypographyProps, 'variant'>>) => SerializedStyles;
|
package/dist/types/favicon.d.ts
CHANGED
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export { Favicon } from './components/favicon/Favicon';
|
|
16
16
|
export type { FaviconProps } from './components/favicon/types';
|
|
17
|
-
export type { FaviconTheme } from './components/favicon/styles';
|
|
17
|
+
export type { PartialFaviconTheme as FaviconTheme } from './components/favicon/styles';
|
|
18
18
|
export { componentFavicon } from './styleD/build/typescript/component/favicon';
|
|
19
19
|
export type { ComponentFavicon } from './styleD/build/typescript/component/favicon';
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export { IconButton } from './components/icon-button/IconButton';
|
|
19
19
|
export type { IconButtonProps } from './components/icon-button/types';
|
|
20
|
-
export type { IconButtonTheme } from './components/icon-button/styles';
|
|
20
|
+
export type { PartialIconButtonTheme as IconButtonTheme } from './components/icon-button/styles';
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export { IconLinkButton } from './components/icon-link-button/IconLinkButton';
|
|
19
19
|
export type { IconLinkButtonProps } from './components/icon-link-button/types';
|
|
20
|
-
export type { IconLinkButtonTheme } from './components/icon-link-button/styles';
|
|
20
|
+
export type { PartialIconLinkButtonTheme as IconLinkButtonTheme } from './components/icon-link-button/styles';
|
package/dist/types/icon.d.ts
CHANGED
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
*/
|
|
23
23
|
export { Icon } from './components/icon/Icon';
|
|
24
24
|
export type { IconProps } from './components/icon/types';
|
|
25
|
-
export type { IconTheme } from './components/icon/styles';
|
|
25
|
+
export type { PartialIconTheme as IconTheme } from './components/icon/styles';
|
|
26
26
|
export { componentIcon } from './styleD/build/typescript/component/icon';
|
|
27
27
|
export type { ComponentIcon } from './styleD/build/typescript/component/icon';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ export { componentIcon } from './styleD/build/typescript/component/icon';
|
|
|
26
26
|
export type { ComponentIcon } from './styleD/build/typescript/component/icon';
|
|
27
27
|
export { componentFavicon } from './styleD/build/typescript/component/favicon';
|
|
28
28
|
export type { ComponentFavicon } from './styleD/build/typescript/component/favicon';
|
|
29
|
+
export { componentMenu } from './styleD/build/typescript/component/menu';
|
|
30
|
+
export type { ComponentMenu } from './styleD/build/typescript/component/menu';
|
|
31
|
+
export { componentTopBar } from './styleD/build/typescript/component/TopBar';
|
|
32
|
+
export type { ComponentTopBar } from './styleD/build/typescript/component/TopBar';
|
|
29
33
|
/**
|
|
30
34
|
* style dictionary exports - base
|
|
31
35
|
*/
|
|
@@ -48,3 +52,5 @@ export { semanticTypography } from './styleD/build/typescript/semantic/typograph
|
|
|
48
52
|
export type { SemanticTypography } from './styleD/build/typescript/semantic/typography';
|
|
49
53
|
export { semanticSizing } from './styleD/build/typescript/semantic/sizing';
|
|
50
54
|
export type { SemanticSizing } from './styleD/build/typescript/semantic/sizing';
|
|
55
|
+
export { semanticShadow } from './styleD/build/typescript/semantic/shadow';
|
|
56
|
+
export type { SemanticShadow } from './styleD/build/typescript/semantic/shadow';
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export { LinkButton } from './components/link-button/LinkButton';
|
|
19
19
|
export type { LinkButtonProps } from './components/link-button/types';
|
|
20
|
-
export type { LinkButtonTheme } from './components/link-button/styles';
|
|
20
|
+
export type { PartialLinkButtonTheme as LinkButtonTheme } from './components/link-button/styles';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Menu component entry point
|
|
3
|
+
*
|
|
4
|
+
* Peer dependencies required to use these components:
|
|
5
|
+
* - `@emotion/react`
|
|
6
|
+
* - `react`
|
|
7
|
+
* - `react-dom`
|
|
8
|
+
* - `typescript`
|
|
9
|
+
* - `react-aria-components`
|
|
10
|
+
* - `@react-aria/focus`
|
|
11
|
+
*
|
|
12
|
+
* See the `peerDependencies` section of package.json for compatible versions.
|
|
13
|
+
*
|
|
14
|
+
* If you only need the built CSS (./component/menu.css),
|
|
15
|
+
* you don't need to install these.
|
|
16
|
+
*/
|
|
17
|
+
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuToggle, } from './components/menu/Menu';
|
|
18
|
+
export type { MenuProps, MenuItemProps, MenuSectionProps, MenuSeparatorProps, MenuTriggerProps, MenuPopoverProps as PopoverProps, } from './components/menu/types';
|
|
19
|
+
export type { PartialMenuTheme as MenuTheme, PartialMenuItemTheme as MenuItemTheme, PartialMenuSectionTheme as MenuSectionTheme, PartialMenuSeparatorTheme as MenuSeparatorTheme, PartialMenuPopoverTheme as MenuPopoverTheme, } from './components/menu/styles';
|
|
20
|
+
export { componentMenu } from './styleD/build/typescript/component/menu';
|
|
21
|
+
export type { ComponentMenu } from './styleD/build/typescript/component/menu';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export declare const componentTopBar: {
|
|
5
|
+
ToolName: {
|
|
6
|
+
display: string;
|
|
7
|
+
'align-items': string;
|
|
8
|
+
gap: string;
|
|
9
|
+
typography: {
|
|
10
|
+
font: string;
|
|
11
|
+
letterSpacing: string;
|
|
12
|
+
fontWidth: number;
|
|
13
|
+
};
|
|
14
|
+
divider: {
|
|
15
|
+
border: string;
|
|
16
|
+
height: string;
|
|
17
|
+
};
|
|
18
|
+
subsection: {
|
|
19
|
+
gap: string;
|
|
20
|
+
typography: {
|
|
21
|
+
font: string;
|
|
22
|
+
letterSpacing: string;
|
|
23
|
+
fontWidth: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type ComponentTopBar = typeof componentTopBar;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export declare const componentMenu: {
|
|
5
|
+
menu: {
|
|
6
|
+
shared: {
|
|
7
|
+
display: string;
|
|
8
|
+
'flex-direction': string;
|
|
9
|
+
'background-color': string;
|
|
10
|
+
border: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
menuSection: {
|
|
14
|
+
header: {
|
|
15
|
+
shared: {
|
|
16
|
+
display: string;
|
|
17
|
+
'align-items': string;
|
|
18
|
+
padding: {
|
|
19
|
+
top: string;
|
|
20
|
+
right: string;
|
|
21
|
+
bottom: string;
|
|
22
|
+
left: string;
|
|
23
|
+
};
|
|
24
|
+
'background-color': string;
|
|
25
|
+
color: string;
|
|
26
|
+
};
|
|
27
|
+
sm: {
|
|
28
|
+
height: string;
|
|
29
|
+
typography: {
|
|
30
|
+
font: string;
|
|
31
|
+
letterSpacing: string;
|
|
32
|
+
fontWidth: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
md: {
|
|
36
|
+
height: string;
|
|
37
|
+
typography: {
|
|
38
|
+
font: string;
|
|
39
|
+
letterSpacing: string;
|
|
40
|
+
fontWidth: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
menuItem: {
|
|
46
|
+
shared: {
|
|
47
|
+
display: string;
|
|
48
|
+
'grid-template-areas': string;
|
|
49
|
+
'grid-template-areas-with-description': string;
|
|
50
|
+
'grid-template-columns': string;
|
|
51
|
+
gap: string;
|
|
52
|
+
'align-items': string;
|
|
53
|
+
padding: {
|
|
54
|
+
top: string;
|
|
55
|
+
right: string;
|
|
56
|
+
bottom: string;
|
|
57
|
+
left: string;
|
|
58
|
+
};
|
|
59
|
+
'border-bottom': string;
|
|
60
|
+
icon: {
|
|
61
|
+
'grid-area': string;
|
|
62
|
+
'align-self': string;
|
|
63
|
+
color: string;
|
|
64
|
+
};
|
|
65
|
+
label: {
|
|
66
|
+
'grid-area': string;
|
|
67
|
+
color: string;
|
|
68
|
+
typography: {
|
|
69
|
+
font: string;
|
|
70
|
+
letterSpacing: string;
|
|
71
|
+
fontWidth: number;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
description: {
|
|
75
|
+
'grid-area': string;
|
|
76
|
+
color: string;
|
|
77
|
+
typography: {
|
|
78
|
+
font: string;
|
|
79
|
+
letterSpacing: string;
|
|
80
|
+
fontWidth: number;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
aside: {
|
|
84
|
+
'grid-area': string;
|
|
85
|
+
'justify-self': string;
|
|
86
|
+
'align-self': string;
|
|
87
|
+
color: string;
|
|
88
|
+
typography: {
|
|
89
|
+
font: string;
|
|
90
|
+
letterSpacing: string;
|
|
91
|
+
fontWidth: number;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
':last-child': {
|
|
95
|
+
'border-bottom': string;
|
|
96
|
+
};
|
|
97
|
+
':hover': {
|
|
98
|
+
'background-color': string;
|
|
99
|
+
};
|
|
100
|
+
':focus-visible': {
|
|
101
|
+
outline: string;
|
|
102
|
+
'outline-offset': string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
sm: {
|
|
106
|
+
icon: {
|
|
107
|
+
size: string;
|
|
108
|
+
'line-height': number;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
md: {
|
|
112
|
+
icon: {
|
|
113
|
+
size: string;
|
|
114
|
+
'line-height': number;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
menuSeparator: {
|
|
119
|
+
shared: {
|
|
120
|
+
'background-color': string;
|
|
121
|
+
height: string;
|
|
122
|
+
width: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
menuPopover: {
|
|
126
|
+
shared: {
|
|
127
|
+
overflow: string;
|
|
128
|
+
shadow: string;
|
|
129
|
+
};
|
|
130
|
+
sm: {
|
|
131
|
+
'max-width': string;
|
|
132
|
+
width: string;
|
|
133
|
+
};
|
|
134
|
+
md: {
|
|
135
|
+
'max-width': string;
|
|
136
|
+
width: string;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
export type ComponentMenu = typeof componentMenu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SemanticShadowTokens: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export { Typography } from './components/typography/Typography';
|
|
16
16
|
export type { TypographyProps } from './components/typography/types';
|
|
17
|
-
export type { TypographyTheme } from './components/typography/styles';
|
|
17
|
+
export type { PartialTypographyTheme as TypographyTheme } from './components/typography/styles';
|
|
18
18
|
export { componentTypography } from './styleD/build/typescript/component/typography';
|
|
19
19
|
export type { ComponentTypography } from './styleD/build/typescript/component/typography';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const SandboxReact: ({ componentTsx, componentName, flowColumn, }: {
|
|
2
|
+
componentTsx: string;
|
|
3
|
+
componentName: string;
|
|
4
|
+
flowColumn?: boolean | undefined;
|
|
5
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const SandboxCss: ({ componentCss, componentHtml, componentName, }: {
|
|
7
|
+
componentCss: string;
|
|
8
|
+
componentHtml: string;
|
|
9
|
+
componentName: string;
|
|
10
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const SandboxJs: ({ componentJs, componentName, }: {
|
|
12
|
+
componentJs: string;
|
|
13
|
+
componentName: string;
|
|
14
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/stand",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"//exports": "Each component has its own entry point for optimal tree-shaking. Main entry point only includes design tokens and utilities. New components/foundations should follow the same pattern.",
|
|
6
6
|
"exports": {
|
|
@@ -49,6 +49,16 @@
|
|
|
49
49
|
"import": "./dist/favicon.js",
|
|
50
50
|
"require": "./dist/favicon.cjs"
|
|
51
51
|
},
|
|
52
|
+
"./menu": {
|
|
53
|
+
"types": "./dist/types/menu.d.ts",
|
|
54
|
+
"import": "./dist/menu.js",
|
|
55
|
+
"require": "./dist/menu.cjs"
|
|
56
|
+
},
|
|
57
|
+
"./TopBar": {
|
|
58
|
+
"types": "./dist/types/TopBar.d.ts",
|
|
59
|
+
"import": "./dist/TopBar.js",
|
|
60
|
+
"require": "./dist/TopBar.cjs"
|
|
61
|
+
},
|
|
52
62
|
"./byline": {
|
|
53
63
|
"types": "./dist/types/byline.d.ts",
|
|
54
64
|
"import": "./dist/byline.js",
|
|
@@ -82,6 +92,7 @@
|
|
|
82
92
|
"./semantic/colors.css": "./dist/styleD/build/css/semantic/colors.css",
|
|
83
93
|
"./semantic/typography.css": "./dist/styleD/build/css/semantic/typography.css",
|
|
84
94
|
"./semantic/sizing.css": "./dist/styleD/build/css/semantic/sizing.css",
|
|
95
|
+
"./semantic/shadow.css": "./dist/styleD/build/css/semantic/shadow.css",
|
|
85
96
|
"./component/byline.css": "./dist/styleD/build/css/component/byline.css",
|
|
86
97
|
"./component/tagAutocomplete.css": "./dist/styleD/build/css/component/tagAutocomplete.css",
|
|
87
98
|
"./component/tagTable.css": "./dist/styleD/build/css/component/tagTable.css",
|
|
@@ -90,7 +101,9 @@
|
|
|
90
101
|
"./component/button.css": "./dist/styleD/build/css/component/button.css",
|
|
91
102
|
"./component/typography.css": "./dist/styleD/build/css/component/typography.css",
|
|
92
103
|
"./component/icon.css": "./dist/styleD/build/css/component/icon.css",
|
|
93
|
-
"./component/favicon.css": "./dist/styleD/build/css/component/favicon.css"
|
|
104
|
+
"./component/favicon.css": "./dist/styleD/build/css/component/favicon.css",
|
|
105
|
+
"./component/menu.css": "./dist/styleD/build/css/component/menu.css",
|
|
106
|
+
"./component/TopBar.css": "./dist/styleD/build/css/component/TopBar.css"
|
|
94
107
|
},
|
|
95
108
|
"//typesVersions": "Provides backward compatibility for TypeScript moduleResolution: node - maps subpath imports to correct type definition files. When adding new components with their own entry points, ensure to add them here.",
|
|
96
109
|
"typesVersions": {
|
|
@@ -119,6 +132,9 @@
|
|
|
119
132
|
"favicon": [
|
|
120
133
|
"./dist/types/favicon.d.ts"
|
|
121
134
|
],
|
|
135
|
+
"TopBar": [
|
|
136
|
+
"./dist/types/TopBar.d.ts"
|
|
137
|
+
],
|
|
122
138
|
"byline": [
|
|
123
139
|
"./dist/types/byline.d.ts"
|
|
124
140
|
],
|
|
@@ -130,6 +146,9 @@
|
|
|
130
146
|
],
|
|
131
147
|
"utils": [
|
|
132
148
|
"./dist/types/utils.d.ts"
|
|
149
|
+
],
|
|
150
|
+
"menu": [
|
|
151
|
+
"./dist/types/menu.d.ts"
|
|
133
152
|
]
|
|
134
153
|
}
|
|
135
154
|
},
|
|
@@ -145,20 +164,22 @@
|
|
|
145
164
|
"sideEffects": false,
|
|
146
165
|
"devDependencies": {
|
|
147
166
|
"@changesets/cli": "^2.29.8",
|
|
167
|
+
"@codesandbox/sandpack-react": "^2.20.0",
|
|
148
168
|
"@emotion/react": "11.11.4",
|
|
149
169
|
"@figma/rest-api-spec": "^0.36.0",
|
|
150
|
-
"@guardian/eslint-config": "
|
|
170
|
+
"@guardian/eslint-config": "14.0.0",
|
|
151
171
|
"@guardian/prettier": "10.0.0",
|
|
152
172
|
"@guardian/prosemirror-invisibles": "3.1.1",
|
|
153
173
|
"@guardian/tsconfig": "1.0.1",
|
|
154
174
|
"@material-design-icons/svg": "^0.14.15",
|
|
155
175
|
"@playwright/experimental-ct-react17": "^1.58.2",
|
|
176
|
+
"@react-aria/focus": "3.21.5",
|
|
156
177
|
"@rollup/plugin-commonjs": "29.0.0",
|
|
157
178
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
158
179
|
"@rollup/plugin-typescript": "12.3.0",
|
|
159
|
-
"@storybook/addon-docs": "^10.2.
|
|
160
|
-
"@storybook/addon-themes": "^10.2.
|
|
161
|
-
"@storybook/react-vite": "^10.2.
|
|
180
|
+
"@storybook/addon-docs": "^10.2.14",
|
|
181
|
+
"@storybook/addon-themes": "^10.2.14",
|
|
182
|
+
"@storybook/react-vite": "^10.2.14",
|
|
162
183
|
"@terrazzo/cli": "^0.10.5",
|
|
163
184
|
"@testing-library/jest-dom": "^6.9.1",
|
|
164
185
|
"@types/jest": "30.0.0",
|
|
@@ -167,7 +188,7 @@
|
|
|
167
188
|
"@types/react-dom": "17.0.25",
|
|
168
189
|
"change-case": "^5.4.4",
|
|
169
190
|
"eslint": "9.39.3",
|
|
170
|
-
"eslint-plugin-storybook": "^10.2.
|
|
191
|
+
"eslint-plugin-storybook": "^10.2.14",
|
|
171
192
|
"husky": "^9.1.7",
|
|
172
193
|
"jest": "30.2.0",
|
|
173
194
|
"jest-environment-jsdom": "^30.1.2",
|
|
@@ -188,7 +209,7 @@
|
|
|
188
209
|
"rollup-plugin-esbuild": "6.2.1",
|
|
189
210
|
"rollup-plugin-import-css": "^4.2.0",
|
|
190
211
|
"rollup-plugin-node-externals": "8.1.2",
|
|
191
|
-
"storybook": "^10.2.
|
|
212
|
+
"storybook": "^10.2.14",
|
|
192
213
|
"style-dictionary": "^5.3.2",
|
|
193
214
|
"ts-jest": "29.4.6",
|
|
194
215
|
"tslib": "2.8.1",
|
|
@@ -199,6 +220,7 @@
|
|
|
199
220
|
"peerDependencies": {
|
|
200
221
|
"@emotion/react": ">=11.11.4 <=11.14.0",
|
|
201
222
|
"@guardian/prosemirror-invisibles": "3.1.1",
|
|
223
|
+
"@react-aria/focus": "^3.21.5",
|
|
202
224
|
"prosemirror-dropcursor": "1.8.2",
|
|
203
225
|
"prosemirror-history": "1.4.1",
|
|
204
226
|
"prosemirror-keymap": "1.2.2",
|
|
@@ -206,7 +228,7 @@
|
|
|
206
228
|
"prosemirror-state": "1.4.3",
|
|
207
229
|
"prosemirror-view": "1.37.2",
|
|
208
230
|
"react": "^17.0.2 || ^18.0.0 || ^19.0.0",
|
|
209
|
-
"react-aria-components": ">= 1.13.0 <= 1.
|
|
231
|
+
"react-aria-components": ">= 1.13.0 <= 1.16.0",
|
|
210
232
|
"react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0",
|
|
211
233
|
"typescript": ">=5.0.0 <=5.9.3"
|
|
212
234
|
},
|
|
@@ -217,6 +239,9 @@
|
|
|
217
239
|
"@guardian/prosemirror-invisibles": {
|
|
218
240
|
"optional": true
|
|
219
241
|
},
|
|
242
|
+
"@react-aria/focus": {
|
|
243
|
+
"optional": true
|
|
244
|
+
},
|
|
220
245
|
"prosemirror-dropcursor": {
|
|
221
246
|
"optional": true
|
|
222
247
|
},
|
|
File without changes
|