@guardian/stand 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/TopBar.cjs +9 -3
- package/dist/TopBar.js +4 -1
- package/dist/components/button/Button.cjs +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/icon-button/IconButton.cjs +1 -1
- package/dist/components/icon-button/IconButton.js +1 -1
- package/dist/components/icon-link-button/IconLinkButton.cjs +1 -1
- package/dist/components/icon-link-button/IconLinkButton.js +1 -1
- package/dist/components/link-button/LinkButton.cjs +1 -1
- package/dist/components/link-button/LinkButton.js +1 -1
- package/dist/components/menu/styles.cjs +1 -0
- package/dist/components/menu/styles.js +1 -0
- package/dist/components/topbar/TopBar.cjs +101 -0
- package/dist/components/topbar/TopBar.js +63 -0
- package/dist/components/topbar/styles.cjs +30 -0
- package/dist/components/topbar/styles.js +25 -0
- package/dist/components/topbar/topBarItem/TopBarItem.cjs +28 -0
- package/dist/components/topbar/topBarItem/TopBarItem.js +10 -0
- package/dist/components/topbar/topBarItem/styles.cjs +20 -0
- package/dist/components/topbar/topBarItem/styles.js +17 -0
- package/dist/components/topbar/topBarNavigation/TopBarNavigation.cjs +70 -0
- package/dist/components/topbar/topBarNavigation/TopBarNavigation.js +23 -0
- package/dist/components/topbar/topBarNavigation/styles.cjs +68 -0
- package/dist/components/topbar/topBarNavigation/styles.js +61 -0
- package/dist/components/topbar/{toolName → topBarToolName}/TopBarToolName.cjs +3 -2
- package/dist/components/topbar/topBarToolName/TopBarToolName.js +13 -0
- package/dist/styleD/build/css/base/typography.css +3 -3
- package/dist/styleD/build/css/component/TopBar.css +55 -1
- package/dist/styleD/build/css/component/avatar.css +1 -1
- package/dist/styleD/build/css/component/button.css +177 -255
- package/dist/styleD/build/css/component/favicon.css +1 -1
- package/dist/styleD/build/css/component/menu.css +5 -4
- package/dist/styleD/build/css/component/tagAutocomplete.css +1 -1
- package/dist/styleD/build/css/component/tagTable.css +1 -1
- package/dist/styleD/build/css/component/topBarItem.css +7 -0
- package/dist/styleD/build/css/component/userMenu.css +6 -6
- package/dist/styleD/build/css/semantic/colors.css +45 -46
- package/dist/styleD/build/css/semantic/sizing.css +1 -0
- package/dist/styleD/build/css/semantic/typography.css +30 -30
- package/dist/styleD/build/typescript/base/typography.cjs +3 -3
- package/dist/styleD/build/typescript/base/typography.js +3 -3
- package/dist/styleD/build/typescript/component/TopBar.cjs +94 -0
- package/dist/styleD/build/typescript/component/TopBar.js +94 -0
- package/dist/styleD/build/typescript/component/button.cjs +5 -130
- package/dist/styleD/build/typescript/component/button.js +5 -130
- package/dist/styleD/build/typescript/component/menu.cjs +2 -1
- package/dist/styleD/build/typescript/component/menu.js +2 -1
- package/dist/styleD/build/typescript/semantic/colors.cjs +47 -52
- package/dist/styleD/build/typescript/semantic/colors.js +47 -52
- package/dist/styleD/build/typescript/semantic/sizing.cjs +1 -0
- package/dist/styleD/build/typescript/semantic/sizing.js +1 -0
- package/dist/types/TopBar.d.ts +12 -3
- package/dist/types/components/button/sandbox.d.ts +4 -4
- package/dist/types/components/button/types.d.ts +1 -1
- package/dist/types/components/icon-button/sandbox.d.ts +4 -4
- package/dist/types/components/icon-button/styles.d.ts +3 -128
- package/dist/types/components/icon-button/types.d.ts +1 -1
- package/dist/types/components/icon-link-button/sandbox.d.ts +4 -4
- package/dist/types/components/icon-link-button/styles.d.ts +3 -128
- package/dist/types/components/icon-link-button/types.d.ts +1 -1
- package/dist/types/components/link-button/sandbox.d.ts +4 -4
- package/dist/types/components/link-button/styles.d.ts +3 -128
- package/dist/types/components/link-button/types.d.ts +1 -1
- package/dist/types/components/topbar/TopBar.d.ts +8 -0
- package/dist/types/components/topbar/sandbox.d.ts +5 -0
- package/dist/types/components/topbar/styles.d.ts +9 -0
- package/dist/types/components/topbar/topBarItem/TopBarItem.d.ts +2 -0
- package/dist/types/components/topbar/topBarItem/sandbox.d.ts +5 -0
- package/dist/types/components/topbar/topBarItem/styles.d.ts +8 -0
- package/dist/types/components/topbar/topBarItem/types.d.ts +14 -0
- package/dist/types/components/topbar/topBarNavigation/TopBarNavigation.d.ts +2 -0
- package/dist/types/components/topbar/topBarNavigation/sandbox.d.ts +5 -0
- package/dist/types/components/topbar/topBarNavigation/styles.d.ts +12 -0
- package/dist/types/components/topbar/topBarNavigation/types.d.ts +44 -0
- package/dist/types/components/topbar/types.d.ts +3 -0
- package/dist/types/styleD/build/typescript/base/typography.d.ts +3 -3
- package/dist/types/styleD/build/typescript/component/TopBar.d.ts +94 -0
- package/dist/types/styleD/build/typescript/component/button.d.ts +3 -128
- package/dist/types/styleD/build/typescript/component/menu.d.ts +1 -0
- package/dist/types/styleD/build/typescript/semantic/colors.d.ts +44 -49
- package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +1 -0
- package/dist/util/css/reset.css +10 -0
- package/dist/util/reset.css.cjs +1 -1
- package/dist/util/reset.css.js +1 -1
- package/package.json +14 -16
- package/dist/components/topbar/toolName/TopBarToolName.js +0 -12
- /package/dist/components/topbar/{toolName → topBarToolName}/styles.cjs +0 -0
- /package/dist/components/topbar/{toolName → topBarToolName}/styles.js +0 -0
- /package/dist/types/components/topbar/{toolName → topBarToolName}/TopBarToolName.d.ts +0 -0
- /package/dist/types/components/topbar/{toolName → topBarToolName}/sandbox.d.ts +0 -0
- /package/dist/types/components/topbar/{toolName → topBarToolName}/styles.d.ts +0 -0
- /package/dist/types/components/topbar/{toolName → topBarToolName}/types.d.ts +0 -0
|
@@ -20,7 +20,7 @@ export declare const linkButtonStyles: (theme: {
|
|
|
20
20
|
'outline-offset': string;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
primary: {
|
|
24
24
|
shared: {
|
|
25
25
|
color: string;
|
|
26
26
|
backgroundColor: string;
|
|
@@ -145,7 +145,7 @@ export declare const linkButtonStyles: (theme: {
|
|
|
145
145
|
};
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
|
-
|
|
148
|
+
secondary: {
|
|
149
149
|
shared: {
|
|
150
150
|
color: string;
|
|
151
151
|
backgroundColor: string;
|
|
@@ -270,132 +270,7 @@ export declare const linkButtonStyles: (theme: {
|
|
|
270
270
|
};
|
|
271
271
|
};
|
|
272
272
|
};
|
|
273
|
-
|
|
274
|
-
shared: {
|
|
275
|
-
color: string;
|
|
276
|
-
backgroundColor: string;
|
|
277
|
-
borderRadius: string;
|
|
278
|
-
border: string;
|
|
279
|
-
':hover': {
|
|
280
|
-
backgroundColor: string;
|
|
281
|
-
border: string;
|
|
282
|
-
};
|
|
283
|
-
':active': {
|
|
284
|
-
backgroundColor: string;
|
|
285
|
-
border: string;
|
|
286
|
-
};
|
|
287
|
-
':disabled': {
|
|
288
|
-
color: string;
|
|
289
|
-
backgroundColor: string;
|
|
290
|
-
border: string;
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
xs: {
|
|
294
|
-
height: string;
|
|
295
|
-
padding: {
|
|
296
|
-
top: string;
|
|
297
|
-
right: string;
|
|
298
|
-
bottom: string;
|
|
299
|
-
left: string;
|
|
300
|
-
withIcon: {
|
|
301
|
-
iconLeft: {
|
|
302
|
-
left: string;
|
|
303
|
-
};
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
typography: {
|
|
307
|
-
font: string;
|
|
308
|
-
letterSpacing: string;
|
|
309
|
-
fontWidth: number;
|
|
310
|
-
};
|
|
311
|
-
icon: {
|
|
312
|
-
size: string;
|
|
313
|
-
gap: string;
|
|
314
|
-
};
|
|
315
|
-
iconButton: {
|
|
316
|
-
width: string;
|
|
317
|
-
};
|
|
318
|
-
};
|
|
319
|
-
sm: {
|
|
320
|
-
height: string;
|
|
321
|
-
padding: {
|
|
322
|
-
top: string;
|
|
323
|
-
right: string;
|
|
324
|
-
bottom: string;
|
|
325
|
-
left: string;
|
|
326
|
-
withIcon: {
|
|
327
|
-
iconLeft: {
|
|
328
|
-
left: string;
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
};
|
|
332
|
-
typography: {
|
|
333
|
-
font: string;
|
|
334
|
-
letterSpacing: string;
|
|
335
|
-
fontWidth: number;
|
|
336
|
-
};
|
|
337
|
-
icon: {
|
|
338
|
-
size: string;
|
|
339
|
-
gap: string;
|
|
340
|
-
};
|
|
341
|
-
iconButton: {
|
|
342
|
-
width: string;
|
|
343
|
-
};
|
|
344
|
-
};
|
|
345
|
-
md: {
|
|
346
|
-
height: string;
|
|
347
|
-
padding: {
|
|
348
|
-
top: string;
|
|
349
|
-
right: string;
|
|
350
|
-
bottom: string;
|
|
351
|
-
left: string;
|
|
352
|
-
withIcon: {
|
|
353
|
-
iconLeft: {
|
|
354
|
-
left: string;
|
|
355
|
-
};
|
|
356
|
-
};
|
|
357
|
-
};
|
|
358
|
-
typography: {
|
|
359
|
-
font: string;
|
|
360
|
-
letterSpacing: string;
|
|
361
|
-
fontWidth: number;
|
|
362
|
-
};
|
|
363
|
-
icon: {
|
|
364
|
-
size: string;
|
|
365
|
-
gap: string;
|
|
366
|
-
};
|
|
367
|
-
iconButton: {
|
|
368
|
-
width: string;
|
|
369
|
-
};
|
|
370
|
-
};
|
|
371
|
-
lg: {
|
|
372
|
-
height: string;
|
|
373
|
-
padding: {
|
|
374
|
-
top: string;
|
|
375
|
-
right: string;
|
|
376
|
-
bottom: string;
|
|
377
|
-
left: string;
|
|
378
|
-
withIcon: {
|
|
379
|
-
iconLeft: {
|
|
380
|
-
left: string;
|
|
381
|
-
};
|
|
382
|
-
};
|
|
383
|
-
};
|
|
384
|
-
typography: {
|
|
385
|
-
font: string;
|
|
386
|
-
letterSpacing: string;
|
|
387
|
-
fontWidth: number;
|
|
388
|
-
};
|
|
389
|
-
icon: {
|
|
390
|
-
size: string;
|
|
391
|
-
gap: string;
|
|
392
|
-
};
|
|
393
|
-
iconButton: {
|
|
394
|
-
width: string;
|
|
395
|
-
};
|
|
396
|
-
};
|
|
397
|
-
};
|
|
398
|
-
'neutral-secondary': {
|
|
273
|
+
tertiary: {
|
|
399
274
|
shared: {
|
|
400
275
|
color: string;
|
|
401
276
|
backgroundColor: string;
|
|
@@ -6,7 +6,7 @@ export interface LinkButtonProps extends DefaultProps<LinkButtonTheme, RACLinkPr
|
|
|
6
6
|
/**
|
|
7
7
|
* Size variant of the link button
|
|
8
8
|
*/
|
|
9
|
-
size?: keyof Omit<LinkButtonTheme['
|
|
9
|
+
size?: keyof Omit<LinkButtonTheme['primary'], 'shared'>;
|
|
10
10
|
/**
|
|
11
11
|
* Variant of the button
|
|
12
12
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TopBarProps } from './types';
|
|
2
|
+
export declare function TopBarContainerRight({ children, }: {
|
|
3
|
+
children: TopBarProps['children'];
|
|
4
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function TopBarContainerLeft({ children, }: {
|
|
6
|
+
children: TopBarProps['children'];
|
|
7
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TopBar({ children, theme, cssOverrides, className, ...props }: TopBarProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "TopBar";
|
|
2
|
+
export declare const componentTsx = "import { TopBar, TopBarToolName } from '@guardian/stand/TopBar';\n\nexport const Component = () => (\n\t<TopBar><TopBarToolName name=\"Composer\" favicon={{ letter: \"C\" }} /></TopBar>\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the styles */\n@import '@guardian/stand/component/TopBar.css';\n@import '@guardian/stand/component/favicon.css';\n\n.stand-top-bar {\n\tdisplay: var(--component-top-bar-display);\n\tjustify-content: var(--component-top-bar-justify-content);\n\theight: var(--component-top-bar-height);\n\tborder: var(--component-top-bar-border);\n}\n\n.stand-top-bar-lhs {\n\tdisplay: var(--component-top-bar-display);\n}\n\n.stand-top-bar-tool-name {\n\tdisplay: var(--component-top-bar-tool-name-display);\n\talign-items: var(--component-top-bar-tool-name-align-items);\n\tgap: var(--component-top-bar-tool-name-gap);\n\tfont: var(--component-top-bar-tool-name-typography-font);\n\tletter-spacing: var(--component-top-bar-tool-name-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-top-bar-tool-name-typography-font-width);\n}\n\n.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}\n\n.stand-top-bar-item {\n\tdisplay: var(--component-top-bar-item-display);\n\talign-items: var(--component-top-bar-item-align-items);\n\theight: var(--component-top-bar-item-height);\n\tpadding: var(--component-top-bar-item-sm-padding-top) var(--component-top-bar-item-sm-padding-right) var(--component-top-bar-item-sm-padding-bottom) var(--component-top-bar-item-sm-padding-left);\n\tborder-right: var(--component-top-bar-item-border);\n}\n\n";
|
|
4
|
+
export declare const componentHtml = "\n\t<div class=\"stand-top-bar\">\n\t\t<div class=\"stand-top-bar-lhs\">\n\t\t\t<div class=\"stand-top-bar-tool-name stand-top-bar-item\">\n\t\t\t\t<div class=\"stand-favicon\">C</div>\n\t\t\t\t<div>Composer</div>\n\t\t\t</div>\n\t\t\t<div class=\"stand-top-bar-item\">Item 1</div>\n\t\t</div>\n\t</div>\n";
|
|
5
|
+
export declare const componentJs = "\nimport { componentTopBar } from \"@guardian/stand\";\nimport { componentFavicon } from \"@guardian/stand\";\nconst style = `\n\tdisplay: ${componentTopBar.display};\n\tjustify-content: ${componentTopBar['justify-content']};\n\theight: ${componentTopBar.height};\n\tborder: ${componentTopBar.border};\n`;\n\nconst lhsStyle = `\n\tdisplay: ${componentTopBar.display};\n`;\n\nconst toolNameStyle = `display: ${componentTopBar.ToolName.display};\n\talign-items: ${componentTopBar.ToolName['align-items']};\n\tgap: ${componentTopBar.ToolName.gap};\n\tfont: ${componentTopBar.ToolName.typography.font};\n\tletter-spacing: ${componentTopBar.ToolName.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentTopBar.ToolName.typography.fontWidth};\n`;\n\nconst faviconStyle = `\n\tbackground-color: ${componentFavicon.color.background};\n\tdisplay: ${componentFavicon.display};\n\talign-items: ${componentFavicon['align-items']};\n\tjustify-content: ${componentFavicon['justify-content']};\n\twidth: ${componentFavicon.size};\n\theight: ${componentFavicon.size};\n\tuser-select: ${componentFavicon.userSelect};\n\tcolor: ${componentFavicon.color.text};\n\tfont: ${componentFavicon.typography.font};\n\tletter-spacing: ${componentFavicon.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentFavicon.typography['font-width']};\n`;\n\nconst topBarItemStyle = `display: ${componentTopBar.Item.display};\n\talign-items: ${componentTopBar.Item['align-items']};\n\theight: ${componentTopBar.Item.height};\n\tpadding: ${componentTopBar.Item.sm.padding.top} ${componentTopBar.Item.sm.padding.right} ${componentTopBar.Item.sm.padding.bottom} ${componentTopBar.Item.sm.padding.left};\n\tborder-right: ${componentTopBar.Item.border};\n`;\n\ndocument.getElementById(\"app\").innerHTML = `\n\t<div style=\"${style}\">\n\t\t<div style=\"${lhsStyle}\">\n\t\t\t<div style=\"${topBarItemStyle}\">\n\t\t\t\t<div style=\"${toolNameStyle}\">\n\t\t\t\t\t<div style=\"${faviconStyle}\">C</div>\n\t\t\t\t\t<div>Composer</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div style=\"${topBarItemStyle}\">Item 1</div>\n\t\t</div>\n\t</div>\n`;\n";
|
|
@@ -0,0 +1,9 @@
|
|
|
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 TopBarTheme = Prettify<ComponentTopBar>;
|
|
5
|
+
export type PartialTopBarTheme = DeepPartial<TopBarTheme>;
|
|
6
|
+
export declare const defaultTopBarTheme: TopBarTheme;
|
|
7
|
+
export declare const topBarStyles: (theme: TopBarTheme) => SerializedStyles;
|
|
8
|
+
export declare const topBarContainerLeftStyles: (theme: TopBarTheme) => SerializedStyles;
|
|
9
|
+
export declare const topBarContainerRightStyles: (theme: TopBarTheme) => SerializedStyles;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "TopBarItem";
|
|
2
|
+
export declare const componentTsx = "import { TopBarItem } from '@guardian/stand/TopBar';\n\nexport const Component = () => (\n\t<TopBarItem>Hello</TopBarItem>\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the topbaritem styles */\n@import '@guardian/stand/component/TopBar.css';\n\n.stand-top-bar-item {\n\tdisplay: var(--component-top-bar-item-display);\n\talign-items: var(--component-top-bar-item-align-items);\n\theight: var(--component-top-bar-item-height);\n\tpadding: var(--component-top-bar-item-sm-padding-top) var(--component-top-bar-item-sm-padding-right) var(--component-top-bar-item-sm-padding-bottom) var(--component-top-bar-item-sm-padding-left);\n\tborder-right: var(--component-top-bar-item-border);\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container\">\n\t<div class=\"stand-top-bar-item\">Hello</div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\nimport { componentTopBar } from \"@guardian/stand\";\n\nconst style = `\n\tdisplay: ${componentTopBar.Item.display};\n\talign-items: ${componentTopBar.Item['align-items']};\n\theight: ${componentTopBar.Item.height};\n\tpadding: ${componentTopBar.Item.sm.padding.top} ${componentTopBar.Item.sm.padding.right} ${componentTopBar.Item.sm.padding.bottom} ${componentTopBar.Item.sm.padding.left};\n\tborder-right: ${componentTopBar.Item.border};\n`;\n\ndocument.getElementById(\"app\").innerHTML = `\n\t<div class=\"container\">\n\t\t<div style=\"${style}\">Hello</div>\n\t</div>\n`;\n";
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { TopBarItemProps } from './types';
|
|
5
|
+
export type TopBarItemTheme = Prettify<ComponentTopBar['Item']>;
|
|
6
|
+
export type PartialTopBarItemTheme = DeepPartial<TopBarItemTheme>;
|
|
7
|
+
export declare const defaultTopBarItemTheme: TopBarItemTheme;
|
|
8
|
+
export declare const topBarItemStyles: (theme: TopBarItemTheme, alignment: 'left' | 'right', { size }: Required<Pick<TopBarItemProps, 'size'>>) => SerializedStyles;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DefaultProps } from '../../../util/types';
|
|
3
|
+
import type { TopBarItemTheme } from './styles';
|
|
4
|
+
export interface TopBarItemProps extends DefaultProps<TopBarItemTheme> {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Determines the alignment of the item within the top bar
|
|
8
|
+
*/
|
|
9
|
+
alignment?: 'left' | 'right';
|
|
10
|
+
/**
|
|
11
|
+
* Determines how much width the item takes up in the top bar, defaults to `'md'`
|
|
12
|
+
*/
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { TopBarNavigationProps } from './types';
|
|
2
|
+
export declare function TopBarNavigation({ text, size, isSelected, icon, menuChildren, href, onPress, isDisabled, alignment, theme, cssOverrides, className, ...props }: TopBarNavigationProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "TopBarNavigation";
|
|
2
|
+
export declare const componentTsx = "import { TopBarNavigation } from '@guardian/stand/TopBar';\n\nexport const Component = () => (\n\t<TopBarNavigation text=\"Recipe\" icon=\"yakitori\" />\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the topbarnavigation styles */\n@import '@guardian/stand/component/TopBar.css';\n\n.stand-top-bar-navigation {\n\tdisplay: var(--component-top-bar-navigation-shared-display);\n\talign-items: var(--component-top-bar-navigation-shared-align-items);\n\tcolor: var(--component-top-bar-navigation-unselected-color);\n\theight: var(--component-top-bar-navigation-shared-height);\n\tpadding-top: var(--component-top-bar-navigation-shared-padding-top);\n\tpadding-right: var(--component-top-bar-navigation-shared-padding-right);\n\tpadding-bottom: var(--component-top-bar-navigation-shared-padding-bottom);\n\tpadding-left: var(--component-top-bar-navigation-shared-padding-left);\n\ttext-decoration: var(--component-top-bar-navigation-shared-text-decoration);\n\n\tborder-top: var(--component-top-bar-navigation-shared-border-top);\n\tborder-bottom: var(--component-top-bar-navigation-unselected-border-bottom);\n\n\t&[data-hovered],\n\t&:hover {\n\t\tborder-bottom: var(--component-top-bar-navigation-selected-border-bottom);\n\t\tcursor: var(--component-top-bar-navigation-shared-cursor);\n\t}\n\n\t&[data-focus-visible],\n\t&:focus-visible {\n\t\toutline: var(--component-top-bar-navigation-shared-focus-visible-outline);\n\t\tborder-bottom: var(--component-top-bar-navigation-selected-border-bottom);\n\t\toutline-offset: var(--component-top-bar-navigation-shared-focus-visible-outline-offset);\n\t}\n\n\t&[data-disabled] {\n\t\tcursor: var(--component-top-bar-navigation-shared-disabled-cursor);\n\t\tcolor: var(--component-top-bar-navigation-shared-disabled-color);\n\t}\n\n\tfont: var(--component-top-bar-navigation-md-typography-font);\n\tletter-spacing: var(--component-top-bar-navigation-md-typography-letter-spacing);\n\tfont-variation-settings: 'wdth'\n\t\tvar(--component-top-bar-navigation-md-typography-font-width);\n}\n\n.stand-navigation-text {\n\tmargin-left: var(--component-top-bar-navigation-text-margin-left);\n}\n\n.stand-expand-more {\n\tmargin-top: var(--component-top-bar-navigation-expand-more-padding-top);\n\tmargin-left: var(--component-top-bar-navigation-expand-more-padding-left);\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container\">\n\t<span class=\"stand-top-bar-navigation\">\n\t\t<span class=\"material-symbols \" >file_upload</span>\n\t\t<span class=\"stand-navigation-text\">Navigation</span>\n\t\t<div class=\"stand-expand-more\">\n\t\t\t<span class=\"material-symbols\" >keyboard_arrow_down</span>\n\t\t</div>\n\t</span>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\nimport { componentTopBar } from \"@guardian/stand\";\n\nconst style = `\n\tdisplay: ${componentTopBar.Navigation.shared.display};\n\talign-items: ${componentTopBar.Navigation.shared['align-items']};\n\tcolor: ${componentTopBar.Navigation.unselected.color};\n\theight: ${componentTopBar.Navigation.shared.height};\n\tpadding-top: ${componentTopBar.Navigation.shared.padding.top};\n\tpadding-right: ${componentTopBar.Navigation.shared.padding.right};\n\tpadding-bottom: ${componentTopBar.Navigation.shared.padding.bottom};\n\tpadding-left: ${componentTopBar.Navigation.shared.padding.left};\n\ttext-decoration: ${componentTopBar.Navigation.shared['text-decoration']};\n\n\tfont: ${componentTopBar.Navigation.md.typography.font};\n\tletter-spacing: ${componentTopBar.Navigation.md.typography.letterSpacing};\n\tfont-variation-settings: 'wdth'\n\t\t${componentTopBar.Navigation.md.typography.fontWidth};\n\n\t&:hover {\n\t\tborder-bottom: ${componentTopBar.Navigation.selected['border-bottom']};\n\t\tcursor: ${componentTopBar.Navigation.shared.cursor};\n\t}\n\n\t&:focus-visible {\n\t\toutline: ${componentTopBar.Navigation.shared[':focus-visible'].outline};\n\t\tborder-bottom: ${componentTopBar.Navigation.selected['border-bottom']};\n\t\toutline-offset: ${componentTopBar.Navigation.shared[':focus-visible']['outline-offset']};\n\t}\n\n\t&[data-disabled] {\n\t\tcursor: ${componentTopBar.Navigation.shared[':disabled'].cursor};\n\t\tcolor: ${componentTopBar.Navigation.shared[':disabled'].color};\n\t}\n`;\n\nconst textStyle = `margin-left: ${componentTopBar.Navigation.text.margin.left};\n`;\n\nconst expandMoreStyle = `\n\tmargin-top: ${componentTopBar.Navigation.menuIndicator.margin.top};\n\tmargin-left: ${componentTopBar.Navigation.menuIndicator.margin.left};\n`;\n\ndocument.getElementById(\"app\").innerHTML = `\n\t<span style=\"${style}\">\n\t\t<span class=\"material-symbols\">file_upload</span>\n\t\t<span style=\"${textStyle}\">Navigation</span>\n\t\t<div style=\"${expandMoreStyle}\">\n\t\t\t<span class=\"material-symbols\">keyboard_arrow_down</span>\n\t\t</div>\n\t</span>\n`;\n";
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
import type { TopBarNavigationProps } from './types';
|
|
5
|
+
export type TopBarNavigationTheme = Prettify<ComponentTopBar['Navigation']>;
|
|
6
|
+
export type PartialTopBarNavigationTheme = DeepPartial<TopBarNavigationTheme>;
|
|
7
|
+
export declare const defaultTopBarNavigationTheme: TopBarNavigationTheme;
|
|
8
|
+
export declare const topBarNavigationStyles: (theme: TopBarNavigationTheme, selected: boolean) => SerializedStyles;
|
|
9
|
+
export declare const topBarNavigationDividerStyles: (theme: TopBarNavigationTheme, { alignment }: Required<Pick<TopBarNavigationProps, 'alignment'>>) => SerializedStyles;
|
|
10
|
+
export declare const topBarNavigationTextStyles: (theme: TopBarNavigationTheme) => SerializedStyles;
|
|
11
|
+
export declare const topBarNavigationTypographyStyles: (theme: TopBarNavigationTheme, size: 'md' | 'sm') => SerializedStyles;
|
|
12
|
+
export declare const topBarMenuIndicatorStyles: (theme: TopBarNavigationTheme) => SerializedStyles;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PressEvent } from 'react-aria-components';
|
|
3
|
+
import type { DefaultProps } from '../../../util/types';
|
|
4
|
+
import type { IconProps } from '../../icon/types';
|
|
5
|
+
import type { TopBarNavigationTheme } from './styles';
|
|
6
|
+
export interface TopBarNavigationProps extends DefaultProps<TopBarNavigationTheme> {
|
|
7
|
+
/**
|
|
8
|
+
* Text to display in navigation
|
|
9
|
+
*/
|
|
10
|
+
text: string;
|
|
11
|
+
/**
|
|
12
|
+
* Size of the text and icons
|
|
13
|
+
*/
|
|
14
|
+
size?: 'md' | 'sm';
|
|
15
|
+
/**
|
|
16
|
+
* Whether the component is the currently selected navigation
|
|
17
|
+
*/
|
|
18
|
+
isSelected?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Icon to display in navigation
|
|
21
|
+
*/
|
|
22
|
+
icon?: IconProps['symbol'] | Exclude<IconProps['children'], string>;
|
|
23
|
+
/**
|
|
24
|
+
* Menu sections and items to render in the dropdown menu - only children of type MenuSection and MenuItem will be rendered.
|
|
25
|
+
* `href` and `onPress` will be ignored if this prop is supplied.
|
|
26
|
+
*/
|
|
27
|
+
menuChildren?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Link to navigate to
|
|
30
|
+
*/
|
|
31
|
+
href?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Handler for navigation on press
|
|
34
|
+
*/
|
|
35
|
+
onPress?: (e: PressEvent) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the navigation is disabled
|
|
38
|
+
*/
|
|
39
|
+
isDisabled?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Determines the alignment of the item within the top bar
|
|
42
|
+
*/
|
|
43
|
+
alignment?: 'left' | 'right';
|
|
44
|
+
}
|
|
@@ -33,13 +33,13 @@ export declare const baseTypography: {
|
|
|
33
33
|
readonly '48-rem': "3rem";
|
|
34
34
|
};
|
|
35
35
|
readonly weight: {
|
|
36
|
-
readonly 'Guardian Headline': {
|
|
37
|
-
readonly bold: 700;
|
|
38
|
-
};
|
|
39
36
|
readonly 'Guardian Text Egyptian': {
|
|
40
37
|
readonly normal: 400;
|
|
41
38
|
readonly bold: 700;
|
|
42
39
|
};
|
|
40
|
+
readonly 'Guardian Headline': {
|
|
41
|
+
readonly bold: 700;
|
|
42
|
+
};
|
|
43
43
|
readonly 'Open Sans': {
|
|
44
44
|
readonly light: 340;
|
|
45
45
|
readonly normal: 460;
|
|
@@ -2,6 +2,100 @@
|
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
3
|
*/
|
|
4
4
|
export declare const componentTopBar: {
|
|
5
|
+
'background-color': string;
|
|
6
|
+
display: string;
|
|
7
|
+
height: string;
|
|
8
|
+
'justify-content': string;
|
|
9
|
+
border: string;
|
|
10
|
+
Item: {
|
|
11
|
+
display: string;
|
|
12
|
+
'align-items': string;
|
|
13
|
+
height: string;
|
|
14
|
+
sm: {
|
|
15
|
+
padding: {
|
|
16
|
+
top: string;
|
|
17
|
+
right: string;
|
|
18
|
+
bottom: string;
|
|
19
|
+
left: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
md: {
|
|
23
|
+
padding: {
|
|
24
|
+
top: string;
|
|
25
|
+
right: string;
|
|
26
|
+
bottom: string;
|
|
27
|
+
left: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
lg: {
|
|
31
|
+
padding: {
|
|
32
|
+
top: string;
|
|
33
|
+
right: string;
|
|
34
|
+
bottom: string;
|
|
35
|
+
left: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
border: string;
|
|
39
|
+
};
|
|
40
|
+
Navigation: {
|
|
41
|
+
shared: {
|
|
42
|
+
display: string;
|
|
43
|
+
position: string;
|
|
44
|
+
'align-items': string;
|
|
45
|
+
cursor: string;
|
|
46
|
+
'text-decoration': string;
|
|
47
|
+
height: string;
|
|
48
|
+
':disabled': {
|
|
49
|
+
cursor: string;
|
|
50
|
+
color: string;
|
|
51
|
+
};
|
|
52
|
+
padding: {
|
|
53
|
+
top: string;
|
|
54
|
+
right: string;
|
|
55
|
+
bottom: string;
|
|
56
|
+
left: string;
|
|
57
|
+
};
|
|
58
|
+
':focus-visible': {
|
|
59
|
+
outline: string;
|
|
60
|
+
'outline-offset': string;
|
|
61
|
+
};
|
|
62
|
+
'border-top': string;
|
|
63
|
+
divider: string;
|
|
64
|
+
};
|
|
65
|
+
text: {
|
|
66
|
+
margin: {
|
|
67
|
+
left: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
menuIndicator: {
|
|
71
|
+
margin: {
|
|
72
|
+
top: string;
|
|
73
|
+
left: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
selected: {
|
|
77
|
+
color: string;
|
|
78
|
+
'border-bottom': string;
|
|
79
|
+
};
|
|
80
|
+
unselected: {
|
|
81
|
+
color: string;
|
|
82
|
+
'border-bottom': string;
|
|
83
|
+
};
|
|
84
|
+
md: {
|
|
85
|
+
typography: {
|
|
86
|
+
font: string;
|
|
87
|
+
letterSpacing: string;
|
|
88
|
+
fontWidth: number;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
sm: {
|
|
92
|
+
typography: {
|
|
93
|
+
font: string;
|
|
94
|
+
letterSpacing: string;
|
|
95
|
+
fontWidth: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
5
99
|
ToolName: {
|
|
6
100
|
display: string;
|
|
7
101
|
'align-items': string;
|
|
@@ -19,7 +19,7 @@ export declare const componentButton: {
|
|
|
19
19
|
'outline-offset': string;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
primary: {
|
|
23
23
|
shared: {
|
|
24
24
|
color: string;
|
|
25
25
|
backgroundColor: string;
|
|
@@ -144,7 +144,7 @@ export declare const componentButton: {
|
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
146
|
};
|
|
147
|
-
|
|
147
|
+
secondary: {
|
|
148
148
|
shared: {
|
|
149
149
|
color: string;
|
|
150
150
|
backgroundColor: string;
|
|
@@ -269,132 +269,7 @@ export declare const componentButton: {
|
|
|
269
269
|
};
|
|
270
270
|
};
|
|
271
271
|
};
|
|
272
|
-
|
|
273
|
-
shared: {
|
|
274
|
-
color: string;
|
|
275
|
-
backgroundColor: string;
|
|
276
|
-
borderRadius: string;
|
|
277
|
-
border: string;
|
|
278
|
-
':hover': {
|
|
279
|
-
backgroundColor: string;
|
|
280
|
-
border: string;
|
|
281
|
-
};
|
|
282
|
-
':active': {
|
|
283
|
-
backgroundColor: string;
|
|
284
|
-
border: string;
|
|
285
|
-
};
|
|
286
|
-
':disabled': {
|
|
287
|
-
color: string;
|
|
288
|
-
backgroundColor: string;
|
|
289
|
-
border: string;
|
|
290
|
-
};
|
|
291
|
-
};
|
|
292
|
-
xs: {
|
|
293
|
-
height: string;
|
|
294
|
-
padding: {
|
|
295
|
-
top: string;
|
|
296
|
-
right: string;
|
|
297
|
-
bottom: string;
|
|
298
|
-
left: string;
|
|
299
|
-
withIcon: {
|
|
300
|
-
iconLeft: {
|
|
301
|
-
left: string;
|
|
302
|
-
};
|
|
303
|
-
};
|
|
304
|
-
};
|
|
305
|
-
typography: {
|
|
306
|
-
font: string;
|
|
307
|
-
letterSpacing: string;
|
|
308
|
-
fontWidth: number;
|
|
309
|
-
};
|
|
310
|
-
icon: {
|
|
311
|
-
size: string;
|
|
312
|
-
gap: string;
|
|
313
|
-
};
|
|
314
|
-
iconButton: {
|
|
315
|
-
width: string;
|
|
316
|
-
};
|
|
317
|
-
};
|
|
318
|
-
sm: {
|
|
319
|
-
height: string;
|
|
320
|
-
padding: {
|
|
321
|
-
top: string;
|
|
322
|
-
right: string;
|
|
323
|
-
bottom: string;
|
|
324
|
-
left: string;
|
|
325
|
-
withIcon: {
|
|
326
|
-
iconLeft: {
|
|
327
|
-
left: string;
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
typography: {
|
|
332
|
-
font: string;
|
|
333
|
-
letterSpacing: string;
|
|
334
|
-
fontWidth: number;
|
|
335
|
-
};
|
|
336
|
-
icon: {
|
|
337
|
-
size: string;
|
|
338
|
-
gap: string;
|
|
339
|
-
};
|
|
340
|
-
iconButton: {
|
|
341
|
-
width: string;
|
|
342
|
-
};
|
|
343
|
-
};
|
|
344
|
-
md: {
|
|
345
|
-
height: string;
|
|
346
|
-
padding: {
|
|
347
|
-
top: string;
|
|
348
|
-
right: string;
|
|
349
|
-
bottom: string;
|
|
350
|
-
left: string;
|
|
351
|
-
withIcon: {
|
|
352
|
-
iconLeft: {
|
|
353
|
-
left: string;
|
|
354
|
-
};
|
|
355
|
-
};
|
|
356
|
-
};
|
|
357
|
-
typography: {
|
|
358
|
-
font: string;
|
|
359
|
-
letterSpacing: string;
|
|
360
|
-
fontWidth: number;
|
|
361
|
-
};
|
|
362
|
-
icon: {
|
|
363
|
-
size: string;
|
|
364
|
-
gap: string;
|
|
365
|
-
};
|
|
366
|
-
iconButton: {
|
|
367
|
-
width: string;
|
|
368
|
-
};
|
|
369
|
-
};
|
|
370
|
-
lg: {
|
|
371
|
-
height: string;
|
|
372
|
-
padding: {
|
|
373
|
-
top: string;
|
|
374
|
-
right: string;
|
|
375
|
-
bottom: string;
|
|
376
|
-
left: string;
|
|
377
|
-
withIcon: {
|
|
378
|
-
iconLeft: {
|
|
379
|
-
left: string;
|
|
380
|
-
};
|
|
381
|
-
};
|
|
382
|
-
};
|
|
383
|
-
typography: {
|
|
384
|
-
font: string;
|
|
385
|
-
letterSpacing: string;
|
|
386
|
-
fontWidth: number;
|
|
387
|
-
};
|
|
388
|
-
icon: {
|
|
389
|
-
size: string;
|
|
390
|
-
gap: string;
|
|
391
|
-
};
|
|
392
|
-
iconButton: {
|
|
393
|
-
width: string;
|
|
394
|
-
};
|
|
395
|
-
};
|
|
396
|
-
};
|
|
397
|
-
'neutral-secondary': {
|
|
272
|
+
tertiary: {
|
|
398
273
|
shared: {
|
|
399
274
|
color: string;
|
|
400
275
|
backgroundColor: string;
|