@guardian/stand 0.0.15 → 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/avatar/Avatar.cjs +2 -2
- package/dist/components/button/Button.cjs +1 -1
- package/dist/components/button/Button.js +1 -1
- 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 +4 -4
- package/dist/components/icon-button/IconButton.js +1 -1
- package/dist/components/icon-link-button/IconLinkButton.cjs +4 -4
- 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/Menu.cjs +204 -0
- package/dist/components/menu/Menu.js +77 -0
- package/dist/components/menu/styles.cjs +104 -0
- package/dist/components/menu/styles.js +89 -0
- package/dist/components/tag-picker/TagTable.cjs +11 -11
- 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/index.cjs +4 -0
- package/dist/index.js +2 -0
- package/dist/menu.cjs +13 -0
- package/dist/menu.js +2 -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 +83 -0
- 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/shadow.css +7 -0
- 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 +141 -0
- package/dist/styleD/build/typescript/component/menu.js +139 -0
- 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/shadow.cjs +7 -0
- package/dist/styleD/build/typescript/semantic/shadow.js +5 -0
- 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/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/styles.d.ts +2 -1
- package/dist/types/components/button/sandbox.d.ts +4 -4
- package/dist/types/components/button/styles.d.ts +2 -1
- package/dist/types/components/button/types.d.ts +1 -1
- package/dist/types/components/favicon/styles.d.ts +2 -1
- package/dist/types/components/icon/styles.d.ts +2 -1
- package/dist/types/components/icon-button/sandbox.d.ts +4 -4
- package/dist/types/components/icon-button/styles.d.ts +5 -129
- 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 +5 -129
- 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 +5 -129
- package/dist/types/components/link-button/types.d.ts +1 -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/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/{toolName → topBarToolName}/styles.d.ts +2 -1
- package/dist/types/components/topbar/types.d.ts +3 -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 +4 -0
- package/dist/types/link-button.d.ts +1 -1
- package/dist/types/menu.d.ts +21 -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 +141 -0
- package/dist/types/styleD/build/typescript/semantic/colors.d.ts +44 -49
- package/dist/types/styleD/build/typescript/semantic/shadow.d.ts +7 -0
- package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +1 -0
- package/dist/types/styleD/stories/semantic/Shadow.d.ts +1 -0
- package/dist/types/typography.d.ts +1 -1
- 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 +30 -17
- 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}/types.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ButtonTheme } from '../button/styles';
|
|
1
|
+
import type { ButtonTheme, PartialButtonTheme } from '../button/styles';
|
|
2
2
|
export type IconLinkButtonTheme = ButtonTheme;
|
|
3
|
+
export type PartialIconLinkButtonTheme = PartialButtonTheme;
|
|
3
4
|
export declare const defaultIconLinkButtonTheme: ButtonTheme;
|
|
4
5
|
export declare const iconLinkButtonStyles: (theme: {
|
|
5
6
|
shared: {
|
|
@@ -19,7 +20,7 @@ export declare const iconLinkButtonStyles: (theme: {
|
|
|
19
20
|
'outline-offset': string;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
|
-
|
|
23
|
+
primary: {
|
|
23
24
|
shared: {
|
|
24
25
|
color: string;
|
|
25
26
|
backgroundColor: string;
|
|
@@ -144,7 +145,7 @@ export declare const iconLinkButtonStyles: (theme: {
|
|
|
144
145
|
};
|
|
145
146
|
};
|
|
146
147
|
};
|
|
147
|
-
|
|
148
|
+
secondary: {
|
|
148
149
|
shared: {
|
|
149
150
|
color: string;
|
|
150
151
|
backgroundColor: string;
|
|
@@ -269,132 +270,7 @@ export declare const iconLinkButtonStyles: (theme: {
|
|
|
269
270
|
};
|
|
270
271
|
};
|
|
271
272
|
};
|
|
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': {
|
|
273
|
+
tertiary: {
|
|
398
274
|
shared: {
|
|
399
275
|
color: string;
|
|
400
276
|
backgroundColor: string;
|
|
@@ -6,7 +6,7 @@ export interface IconLinkButtonProps extends DefaultPropsWithChildren<IconLinkBu
|
|
|
6
6
|
/**
|
|
7
7
|
* Size variant of the avatar
|
|
8
8
|
*/
|
|
9
|
-
size?: keyof Omit<IconLinkButtonTheme['
|
|
9
|
+
size?: keyof Omit<IconLinkButtonTheme['primary'], 'shared'>;
|
|
10
10
|
/**
|
|
11
11
|
* Variant of the button
|
|
12
12
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const componentName = "LinkButton";
|
|
2
|
-
export declare const componentTsx = "import { LinkButton } from '@guardian/stand/link-button';\n\nexport const Component = () => (\n\t<>\n\t\t<div className=\"container\">\n\t\t\t<LinkButton href=\"#\">\n \t\tLinkButton\n\t\t\t</LinkButton>\n\t\t\t<LinkButton isDisabled variant=\"
|
|
3
|
-
export declare const componentCss = "@import '@guardian/stand/component/button.css';\n\n /* shared button styles for all variants */\n .stand-button {\n \tdisplay: var(--component-button-shared-display);\n \t-webkit-appearance: var(--component-button-shared-webkit-appearance);\n \ttext-align: var(--component-button-shared-text-align);\n \tbox-shadow: var(--component-button-shared-box-shadow);\n \ttext-decoration: var(--component-button-shared-text-decoration);\n \tcursor: var(--component-button-shared-cursor);\n \tjustify-content: var(--component-button-shared-justify-content);\n \talign-items: var(--component-button-shared-align-items);\n }\n .stand-button:focus-visible {\n \toutline: var(--component-button-shared-focus-visible-outline);\n \toutline-offset: var(--component-button-shared-focus-visible-outline-offset);\n }\n .stand-button:disabled {\n \tcursor: var(--component-button-shared-disabled-cursor);\n }\n\n /* example setup of button/link button style using md size and emphasised primary variant */\n .stand-button-
|
|
4
|
-
export declare const componentHtml = "<div class=\"container flow-column\">\n <div class=\"container\">\n \t<a href=\"#\" class=\"stand-button stand-button-
|
|
5
|
-
export declare const componentJs = "\t// for ts/js\n\t\timport { componentButton } 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/* shared button styles for all variants */\n \t.js-stand-button {\n \t\tdisplay: ${componentButton.shared.display};\n \t\t-webkit-appearance: ${componentButton.shared[\"-webkit-appearance\"]};\n \t\ttext-align: ${componentButton.shared[\"text-align\"]};\n \t\tbox-shadow: ${componentButton.shared[\"box-shadow\"]};\n \t\ttext-decoration: ${componentButton.shared[\"text-decoration\"]};\n \t\tcursor: ${componentButton.shared.cursor};\n \t\tjustify-content: ${componentButton.shared[\"justify-content\"]};\n \t\talign-items: ${componentButton.shared[\"align-items\"]};\n \t}\n \t.js-stand-button:focus-visible {\n \t\toutline: ${componentButton.shared[\":focus-visible\"].outline};\n \t\toutline-offset: ${componentButton.shared[\":focus-visible\"][\"outline-offset\"]};\n \t}\n \t.js-stand-button:disabled {\n \t\tcursor: ${componentButton.shared[\":disabled\"].cursor};\n \t}\n\n \t/* example setup of button/link button style using md size and emphasised primary variant */\n \t.js-stand-button-
|
|
2
|
+
export declare const componentTsx = "import { LinkButton } from '@guardian/stand/link-button';\n\nexport const Component = () => (\n\t<>\n\t\t<div className=\"container\">\n\t\t\t<LinkButton href=\"#\">\n \t\tLinkButton\n\t\t\t</LinkButton>\n\t\t\t<LinkButton isDisabled variant=\"secondary\">\n\t\t\t\tDisabled LinkButton\n\t\t\t</LinkButton>\n\t\t</div>\n\t\t<div className=\"container\">\n\t\t\t<LinkButton\n\t\t\t\thref=\"#\"\n\t\t\t\ticon=\"raven\"\n\t\t\t>\n\t\t\t\tLinkButton with Icon\n\t\t\t</LinkButton>\n\t\t\t<LinkButton\n\t\t\t\tisDisabled\n\t\t\t\thref=\"#\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\ticon=\"owl\"\n\t\t\t>\n\t\t\t\tDisabled LinkButton with Icon\n\t\t\t</LinkButton>\n\t\t</div>\n\t</>\n);\n\n";
|
|
3
|
+
export declare const componentCss = "@import '@guardian/stand/component/button.css';\n\n /* shared button styles for all variants */\n .stand-button {\n \tdisplay: var(--component-button-shared-display);\n \t-webkit-appearance: var(--component-button-shared-webkit-appearance);\n \ttext-align: var(--component-button-shared-text-align);\n \tbox-shadow: var(--component-button-shared-box-shadow);\n \ttext-decoration: var(--component-button-shared-text-decoration);\n \tcursor: var(--component-button-shared-cursor);\n \tjustify-content: var(--component-button-shared-justify-content);\n \talign-items: var(--component-button-shared-align-items);\n }\n .stand-button:focus-visible {\n \toutline: var(--component-button-shared-focus-visible-outline);\n \toutline-offset: var(--component-button-shared-focus-visible-outline-offset);\n }\n .stand-button:disabled {\n \tcursor: var(--component-button-shared-disabled-cursor);\n }\n\n /* example setup of button/link button style using md size and emphasised primary variant */\n .stand-button-primary {\n \tcolor: var(--component-button-primary-shared-color);\n \tbackground: var(\n \t\t--component-button-primary-shared-background-color\n \t);\n \theight: var(--component-button-primary-md-height);\n \tpadding: var(--component-button-primary-md-padding-top)\n \tvar(--component-button-primary-md-padding-right)\n \tvar(--component-button-primary-md-padding-bottom)\n \tvar(--component-button-primary-md-padding-left);\n \tfont: var(--component-button-primary-md-typography-font);\n \tletter-spacing: var(\n \t\t--component-button-primary-md-typography-letter-spacing\n \t);\n \tfont-variation-settings: \"wdth\"\n \tvar(--component-button-primary-md-typography-font-width);\n \tborder: var(--component-button-primary-shared-border);\n \tborder-radius: var(\n \t\t--component-button-primary-shared-border-radius\n \t);\n }\n .stand-button-primary:hover {\n \tbackground: var(\n \t\t--component-button-primary-shared-hover-background-color\n \t);\n \tborder: var(--component-button-primary-shared-hover-border);\n }\n .stand-button-primary:active {\n \tbackground: var(\n \t\t--component-button-primary-shared-active-background-color\n \t);\n \tborder: var(--component-button-primary-shared-active-border);\n }\n .stand-button-primary:disabled, .stand-button-primary[data-disabled] {\n \tcolor: var(--component-button-primary-shared-disabled-color);\n \tbackground: var(\n \t\t--component-button-primary-shared-disabled-background-color\n \t);\n \tborder: var(--component-button-primary-shared-disabled-border);\n \t}\n \t.stand-button-primary > .material-symbols {\n \tfont-size: var(--component-button-primary-md-icon-size);\n \t}\n \t.stand-button-primary:has(> .material-symbols) {\n \tpadding-left: var(\n \t\t--component-button-primary-md-padding-with-icon-icon-left-left\n \t);\n \tgap: var(--component-button-primary-md-icon-gap);\n }\n\n /* example setup of button/link button style using md size and neutral secondary variant */\n .stand-button-tertiary {\n \tcolor: var(--component-button-tertiary-shared-color);\n \tbackground: var(--component-button-tertiary-shared-background-color);\n \theight: var(--component-button-tertiary-md-height);\n \tpadding: var(--component-button-tertiary-md-padding-top)\n \tvar(--component-button-tertiary-md-padding-right)\n \tvar(--component-button-tertiary-md-padding-bottom)\n \tvar(--component-button-tertiary-md-padding-left);\n \tfont: var(--component-button-tertiary-md-typography-font);\n \tletter-spacing: var(\n \t\t--component-button-tertiary-md-typography-letter-spacing\n \t);\n \tfont-variation-settings: \"wdth\"\n \tvar(--component-button-tertiary-md-typography-font-width);\n \tborder: var(--component-button-tertiary-shared-border);\n \tborder-radius: var(--component-button-tertiary-shared-border-radius);\n }\n .stand-button-tertiary:hover {\n \tbackground: var(\n \t\t--component-button-tertiary-shared-hover-background-color\n \t);\n \tborder: var(--component-button-tertiary-shared-hover-border);\n }\n .stand-button-tertiary:active {\n \tbackground: var(\n \t\t--component-button-tertiary-shared-active-background-color\n \t);\n \tborder: var(--component-button-tertiary-shared-active-border);\n }\n .stand-button-tertiary:disabled, .stand-button-tertiary[data-disabled] {\n \tcolor: var(--component-button-tertiary-shared-disabled-color);\n \tbackground: var(\n \t\t--component-button-tertiary-shared-disabled-background-color\n \t);\n \tborder: var(--component-button-tertiary-shared-disabled-border);\n }\n .stand-button-tertiary > .material-symbols {\n \tfont-size: var(--component-button-tertiary-md-icon-size);\n }\n .stand-button-tertiary:has(> .material-symbols) {\n \tpadding-left: var(\n \t\t--component-button-tertiary-md-padding-with-icon-icon-left-left\n \t);\n \tgap: var(--component-button-tertiary-md-icon-gap);\n }\n\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container flow-column\">\n <div class=\"container\">\n \t<a href=\"#\" class=\"stand-button stand-button-primary\">LinkButton</a>\n \t<a class=\"stand-button stand-button-tertiary\" data-disabled>Disabled LinkButton</a>\n </div>\n\n <div class=\"container\">\n \t<a href=\"#\" class=\"stand-button stand-button-primary\"><span class=\"material-symbols\">raven</span>LinkButton with Icon</a>\n \t<a class=\"stand-button stand-button-tertiary\" data-disabled><span class=\"material-symbols\">owl</span>Disabled LinkButton with Icon</a>\n </div>\n\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\t// for ts/js\n\t\timport { componentButton } 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/* shared button styles for all variants */\n \t.js-stand-button {\n \t\tdisplay: ${componentButton.shared.display};\n \t\t-webkit-appearance: ${componentButton.shared[\"-webkit-appearance\"]};\n \t\ttext-align: ${componentButton.shared[\"text-align\"]};\n \t\tbox-shadow: ${componentButton.shared[\"box-shadow\"]};\n \t\ttext-decoration: ${componentButton.shared[\"text-decoration\"]};\n \t\tcursor: ${componentButton.shared.cursor};\n \t\tjustify-content: ${componentButton.shared[\"justify-content\"]};\n \t\talign-items: ${componentButton.shared[\"align-items\"]};\n \t}\n \t.js-stand-button:focus-visible {\n \t\toutline: ${componentButton.shared[\":focus-visible\"].outline};\n \t\toutline-offset: ${componentButton.shared[\":focus-visible\"][\"outline-offset\"]};\n \t}\n \t.js-stand-button:disabled {\n \t\tcursor: ${componentButton.shared[\":disabled\"].cursor};\n \t}\n\n \t/* example setup of button/link button style using md size and emphasised primary variant */\n \t.js-stand-button-primary {\n \t\tcolor: ${componentButton[\"primary\"].shared.color};\n \t\tbackground: ${componentButton[\"primary\"].shared.backgroundColor};\n \t\theight: ${componentButton[\"primary\"].md.height};\n \t\tpadding: ${componentButton[\"primary\"].md.padding.top}\n \t\t${componentButton[\"primary\"].md.padding.right}\n \t\t${componentButton[\"primary\"].md.padding.bottom}\n \t\t${componentButton[\"primary\"].md.padding.left};\n \t\tfont: ${componentButton[\"primary\"].md.typography.font};\n \t\tletter-spacing: ${componentButton[\"primary\"].md.typography.letterSpacing};\n \t\tfont-variation-settings: 'wdth'\n \t\t${componentButton[\"primary\"].md.typography.fontWidth};\n \t\tborder: ${componentButton[\"primary\"].shared.border};\n \t\tborder-radius: ${componentButton[\"primary\"].shared.borderRadius};\n \t}\n \t.js-stand-button-primary:hover {\n \t\tbackground: ${componentButton[\"primary\"].shared[\":hover\"].backgroundColor};\n \t\tborder: ${componentButton[\"primary\"].shared[\":hover\"].border}\n \t}\n \t.js-stand-button-primary:active {\n \t\tbackground: ${componentButton[\"primary\"].shared[\":active\"].backgroundColor};\n \t\tborder: ${componentButton[\"primary\"].shared[\":active\"].border};\n \t}\n \t.js-stand-button-primary:disabled, .js-stand-button-primary[data-disabled] {\n \t\tcolor: ${componentButton[\"primary\"].shared[\":disabled\"].color};\n \t\tbackground: ${componentButton[\"primary\"].shared[\":disabled\"].backgroundColor};\n \t\tborder: ${componentButton[\"primary\"].shared[\":disabled\"].border};\n \t}\n \t.js-stand-button-primary > .material-symbols {\n \t\tfont-size: ${componentButton[\"primary\"].md.icon.size}\n \t}\n \t.js-stand-button-primary:has(> .material-symbols) {\n \t\tpadding-left: ${componentButton[\"primary\"].md.padding.withIcon.iconLeft.left};\n \t\tgap: ${componentButton[\"primary\"].md.icon.gap};\n \t}\n\n \t/* example setup of button/link button style using md size and neutral secondary variant */\n \t.js-stand-button-tertiary {\n \t\tcolor: ${componentButton[\"tertiary\"].shared.color};\n \t\tbackground: ${componentButton[\"tertiary\"].shared.backgroundColor};\n \t\theight: ${componentButton[\"tertiary\"].md.height};\n \t\tpadding: ${componentButton[\"tertiary\"].md.padding.top}\n \t\t${componentButton[\"tertiary\"].md.padding.right}\n \t\t${componentButton[\"tertiary\"].md.padding.bottom}\n \t\t${componentButton[\"tertiary\"].md.padding.left};\n \t\tfont: ${componentButton[\"tertiary\"].md.typography.font};\n \t\tletter-spacing: ${componentButton[\"tertiary\"].md.typography.letterSpacing};\n \t\tfont-variation-settings: 'wdth'\n \t\t${componentButton[\"tertiary\"].md.typography.fontWidth};\n \t\tborder: ${componentButton[\"tertiary\"].shared.border};\n \t\tborder-radius: ${componentButton[\"tertiary\"].shared.borderRadius};\n \t}\n \t.js-stand-button-tertiary:hover {\n \t\tbackground: ${componentButton[\"tertiary\"].shared[\":hover\"].backgroundColor};\n \t\tborder: ${componentButton[\"tertiary\"].shared[\":hover\"].border};\n \t}\n \t.js-stand-button-tertiary:active {\n \t\tbackground: ${componentButton[\"tertiary\"].shared[\":active\"].backgroundColor};\n \t\tborder: ${componentButton[\"tertiary\"].shared[\":active\"].border};\n \t}\n \t.js-stand-button-tertiary:disabled, .js-stand-button-tertiary[data-disabled] {\n \t\tcolor: ${componentButton[\"tertiary\"].shared[\":disabled\"].color};\n \t\tbackground: ${componentButton[\"tertiary\"].shared[\":disabled\"].backgroundColor};\n \t\tborder: ${componentButton[\"tertiary\"].shared[\":disabled\"].border};\n \t}\n \t.js-stand-button-tertiary > .material-symbols {\n \t\tfont-size: ${componentButton[\"tertiary\"].md.icon.size}\n \t}\n \t.js-stand-button-tertiary:has(> .material-symbols) {\n \t\tpadding-left: ${componentButton[\"tertiary\"].md.padding.withIcon.iconLeft.left};\n \t\tgap: ${componentButton[\"tertiary\"].md.icon.gap};\n \t}\n\n `);\n\n // update the document with the sheet\n document.adoptedStyleSheets.push(sheet);\n\n // modify the dom with the button components using the generated stylesheet\n document.getElementById(\"app\").innerHTML = `<div class=\"container flow-column\">\n \t<div class=\"container\">\n \t\t<a href=\"#\" class=\"js-stand-button js-stand-button-primary\">LinkButton</a>\n \t\t<a class=\"js-stand-button js-stand-button-tertiary\" data-disabled>Disabled LinkButton</a>\n \t</div>\n \t<div class=\"container\">\n \t\t<a href=\"#\" class=\"js-stand-button js-stand-button-primary\"><span class=\"material-symbols\">raven</span>LinkButton with Icon</a>\n \t\t<a class=\"js-stand-button js-stand-button-tertiary\" data-disabled><span class=\"material-symbols\">owl</span>Disabled LinkButton with Icon</a>\n \t</div>\n </div>`;\n\n";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ButtonTheme } from '../button/styles';
|
|
1
|
+
import type { ButtonTheme, PartialButtonTheme } from '../button/styles';
|
|
2
2
|
export type LinkButtonTheme = ButtonTheme;
|
|
3
|
+
export type PartialLinkButtonTheme = PartialButtonTheme;
|
|
3
4
|
export declare const defaultLinkButtonTheme: ButtonTheme;
|
|
4
5
|
export declare const linkButtonStyles: (theme: {
|
|
5
6
|
shared: {
|
|
@@ -19,7 +20,7 @@ export declare const linkButtonStyles: (theme: {
|
|
|
19
20
|
'outline-offset': string;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
|
-
|
|
23
|
+
primary: {
|
|
23
24
|
shared: {
|
|
24
25
|
color: string;
|
|
25
26
|
backgroundColor: string;
|
|
@@ -144,7 +145,7 @@ export declare const linkButtonStyles: (theme: {
|
|
|
144
145
|
};
|
|
145
146
|
};
|
|
146
147
|
};
|
|
147
|
-
|
|
148
|
+
secondary: {
|
|
148
149
|
shared: {
|
|
149
150
|
color: string;
|
|
150
151
|
backgroundColor: string;
|
|
@@ -269,132 +270,7 @@ export declare const linkButtonStyles: (theme: {
|
|
|
269
270
|
};
|
|
270
271
|
};
|
|
271
272
|
};
|
|
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': {
|
|
273
|
+
tertiary: {
|
|
398
274
|
shared: {
|
|
399
275
|
color: string;
|
|
400
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,7 @@
|
|
|
1
|
+
import type { DefaultPropsWithChildren } from '../../util/types';
|
|
2
|
+
import type { MenuItemProps, MenuProps, MenuSectionProps, MenuSeparatorProps } from './types';
|
|
3
|
+
export declare function MenuSeparator({ theme, cssOverrides, ...props }: MenuSeparatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function MenuToggle({ children }: DefaultPropsWithChildren<unknown>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function MenuSection({ name, size, theme, cssOverrides, children, ...props }: MenuSectionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function MenuItem({ label, description, aside, icon, size, theme, cssOverrides, ...props }: MenuItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function Menu({ theme, size, popoverProps, menuTriggerProps, children, cssOverrides, ...props }: MenuProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "Menu";
|
|
2
|
+
export declare const componentTsx = "import {\n\tMenu,\n\tMenuToggle,\n\tMenuSection,\n\tMenuItem,\n\tMenuSeparator,\n} from '@guardian/stand/menu';\nimport { IconButton } from '@guardian/stand/icon-button';\n\nexport const Component = () => (\n\t<Menu>\n\t\t<MenuToggle>\n\t\t\t<IconButton symbol=\"settings\" ariaLabel=\"Open menu\" />\n\t\t</MenuToggle>\n\n\t\t<MenuSection name=\"File actions\">\n\t\t\t<MenuItem\n\t\t\t\ticon=\"open_in_new\"\n\t\t\t\tlabel=\"Open\"\n\t\t\t\tdescription=\"Open in a new tab\"\n\t\t\t\tonAction={() => alert('open')}\n\t\t\t/>\n\t\t\t<MenuItem\n\t\t\t\ticon=\"edit\"\n\t\t\t\tlabel=\"Rename\"\n\t\t\t\tdescription=\"Rename the file\"\n\t\t\t\tonAction={() => alert('rename')}\n\t\t\t/>\n\t\t\t<MenuItem label=\"Delete\" onAction={() => alert('delete')} />\n\t\t</MenuSection>\n\n\t\t<MenuSeparator />\n\n\t\t<MenuSection>\n\t\t\t<MenuItem id=\"files\" label=\"Show files\" />\n\t\t\t<MenuItem id=\"folders\" label=\"Show folders\" />\n\t\t</MenuSection>\n\t</Menu>\n);\n";
|
|
3
|
+
export declare const componentCss = "@import '@guardian/stand/component/menu.css';\n@import \"@guardian/stand/fonts/MaterialSymbolsOutlined.css\";\n\n/* Popover container */\n.stand-popover {\n\toverflow: var(--component-menu-popover-shared-overflow);\n\tmax-width: var(--component-menu-popover-md-max-width);\n\twidth: var(--component-menu-popover-md-width);\n\tbox-shadow: var(--component-menu-popover-shared-shadow);\n}\n\n/* Menu list */\n.stand-menu {\n\tdisplay: var(--component-menu-menu-shared-display);\n\tflex-direction: var(--component-menu-menu-shared-flex-direction);\n\tbackground: var(--component-menu-menu-shared-background-color);\n\tborder: var(--component-menu-menu-shared-border);\n}\n\n/* Menu section header */\n.stand-menu-section-header {\n\tdisplay: var(--component-menu-menu-section-header-shared-display);\n\talign-items: var(--component-menu-menu-section-header-shared-align-items);\n\tpadding: var(--component-menu-menu-section-header-shared-padding-top)\n\t\tvar(--component-menu-menu-section-header-shared-padding-right)\n\t\tvar(--component-menu-menu-section-header-shared-padding-bottom)\n\t\tvar(--component-menu-menu-section-header-shared-padding-left);\n\theight: var(--component-menu-menu-section-header-md-height);\n\tbackground: var(--component-menu-menu-section-header-shared-background-color);\n\tfont: var(--component-menu-menu-section-header-md-typography-font);\n\tletter-spacing: var(--component-menu-menu-section-header-md-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-menu-menu-section-header-md-typography-font-width);\n}\n\n/* Menu item */\n.stand-menu-item {\n\tdisplay: var(--component-menu-menu-item-shared-display);\n\tgrid-template-columns: var(--component-menu-menu-item-shared-grid-template-columns);\n\tgrid-template-areas: var(--component-menu-menu-item-shared-grid-template-areas);\n\tgap: var(--component-menu-menu-item-shared-gap);\n\talign-items: var(--component-menu-menu-item-shared-align-items);\n\tpadding: var(--component-menu-menu-item-shared-padding-top)\n\t\tvar(--component-menu-menu-item-shared-padding-right)\n\t\tvar(--component-menu-menu-item-shared-padding-bottom)\n\t\tvar(--component-menu-menu-item-shared-padding-left);\n\tborder-bottom: var(--component-menu-menu-item-shared-border-bottom);\n\tcursor: pointer;\n}\n.stand-menu-item-with-description {\n\tgrid-template-areas: var(--component-menu-menu-item-shared-grid-template-areas-with-description);\n}\n.stand-menu-item:last-child {\n\tborder-bottom: var(--component-menu-menu-item-shared-last-child-border-bottom);\n}\n.stand-menu-item:hover {\n\tbackground: var(--component-menu-menu-item-shared-hover-background-color);\n}\n.stand-menu-item:focus-visible {\n\toutline: var(--component-menu-menu-item-shared-focus-visible-outline);\n\toutline-offset: var(--component-menu-menu-item-shared-focus-visible-outline-offset);\n\tbackground: var(--component-menu-menu-item-shared-hover-background-color);\n}\n\n.stand-menu-item-icon {\n\tgrid-area: var(--component-menu-menu-item-shared-icon-grid-area);\n\talign-self: var(--component-menu-menu-item-shared-icon-align-self);\n\tcolor: var(--component-menu-menu-item-shared-icon-color);\n\tfont-size: var(--component-menu-menu-item-md-icon-size);\n\tline-height: var(--component-menu-menu-item-md-icon-line-height);\n}\n.stand-menu-item-label {\n\tgrid-area: var(--component-menu-menu-item-shared-label-grid-area);\n\tcolor: var(--component-menu-menu-item-shared-label-color);\n\tfont: var(--component-menu-menu-item-shared-label-typography-font);\n\tletter-spacing: var(--component-menu-menu-item-shared-label-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-menu-menu-item-shared-label-typography-font-width);\n}\n.stand-menu-item-description {\n\tgrid-area: var(--component-menu-menu-item-shared-description-grid-area);\n\tcolor: var(--component-menu-menu-item-shared-description-color);\n\tfont: var(--component-menu-menu-item-shared-description-typography-font);\n\tletter-spacing: var(--component-menu-menu-item-shared-description-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-menu-menu-item-shared-description-typography-font-width);\n}\n.stand-menu-item-aside {\n\tgrid-area: var(--component-menu-menu-item-shared-aside-grid-area);\n\tjustify-self: var(--component-menu-menu-item-shared-aside-justify-self);\n\tcolor: var(--component-menu-menu-item-shared-aside-color);\n\tfont: var(--component-menu-menu-item-shared-aside-typography-font);\n\tletter-spacing: var(--component-menu-menu-item-shared-aside-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-menu-menu-item-shared-aside-typography-font-width);\n}\n\n/* Separator */\n.stand-menu-separator {\n\tbackground-color: var(--component-menu-menu-separator-shared-background-color);\n\theight: var(--component-menu-menu-separator-shared-height);\n\twidth: var(--component-menu-menu-separator-shared-width);\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"stand-popover\">\n\t<div class=\"stand-menu\">\n\t\t<div>\n\t\t\t<div class=\"stand-menu-section-header\">File actions</div>\n\t\t\t<div class=\"stand-menu-item stand-menu-item-with-description\" tabindex=\"0\">\n\t\t\t\t<span class=\"stand-menu-item-icon material-symbols\">open_in_new</span>\n\t\t\t\t<span class=\"stand-menu-item-label\">Open</span>\n\t\t\t\t<span class=\"stand-menu-item-description\">Open in a new tab</span>\n\t\t\t\t<span class=\"stand-menu-item-aside\">\u2318O</span>\n\t\t\t</div>\n\t\t\t<div class=\"stand-menu-item stand-menu-item-with-description\" tabindex=\"0\">\n\t\t\t\t<span class=\"stand-menu-item-label\">Rename</span>\n\t\t\t\t<span class=\"stand-menu-item-description\">Rename the file</span>\n\t\t\t</div>\n\t\t\t<div class=\"stand-menu-item\" tabindex=\"0\">\n\t\t\t\t<span class=\"stand-menu-item-label\">Delete</span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"stand-menu-separator\"></div>\n\t\t<div>\n\t\t\t<div class=\"stand-menu-item\" tabindex=\"0\">\n\t\t\t\t<span class=\"stand-menu-item-label\">Show files</span>\n\t\t\t</div>\n\t\t\t<div class=\"stand-menu-item\" tabindex=\"0\">\n\t\t\t\t<span class=\"stand-menu-item-label\">Show folders</span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "import { componentMenu } from \"@guardian/stand\";\n\nconst { menu, menuItem, menuSection, menuSeparator, popover } = componentMenu;\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n\t/* Popover container */\n\t.js-stand-popover {\n\t\toverflow: ${popover.shared.overflow};\n\t\tmax-width: ${popover.md['max-width']};\n\t\twidth: ${popover.md.width};\n\t\tbox-shadow: ${popover.shared.shadow};\n\t}\n\n\t/* Menu list */\n\t.js-stand-menu {\n\t\tdisplay: ${menu.shared.display};\n\t\tflex-direction: ${menu.shared['flex-direction']};\n\t\tbackground: ${menu.shared['background-color']};\n\t\tborder: ${menu.shared.border};\n\t}\n\n\t/* Menu section header */\n\t.js-stand-menu-section-header {\n\t\tdisplay: ${menuSection.header.shared.display};\n\t\talign-items: ${menuSection.header.shared['align-items']};\n\t\theight: ${menuSection.header.md.height};\n\t\tbackground: ${menuSection.header.shared['background-color']};\n\t\tpadding: ${menuSection.header.shared.padding.top} ${menuSection.header.shared.padding.right} ${menuSection.header.shared.padding.bottom} ${menuSection.header.shared.padding.left};\n\t\tfont: ${menuSection.header.md.typography.font};\n\t\tletter-spacing: ${menuSection.header.md.typography.letterSpacing};\n\t\tfont-variation-settings: 'wdth' ${menuSection.header.md.typography.fontWidth};\n\t}\n\n\t/* Menu item */\n\t.js-stand-menu-item {\n\t\tdisplay: ${menuItem.shared.display};\n\t\tgrid-template-columns: ${menuItem.shared['grid-template-columns']};\n\t\tgrid-template-areas: ${menuItem.shared['grid-template-areas']};\n\t\tgap: ${menuItem.shared.gap};\n\t\talign-items: ${menuItem.shared['align-items']};\n\t\tpadding: ${menuItem.shared.padding.top} ${menuItem.shared.padding.right} ${menuItem.shared.padding.bottom} ${menuItem.shared.padding.left};\n\t\tborder-bottom: ${menuItem.shared['border-bottom']};\n\t\tcursor: pointer;\n\t}\n\t.js-stand-menu-item-with-description {\n\t\tgrid-template-areas: ${menuItem.shared['grid-template-areas-with-description']};\n\t}\n\t.js-stand-menu-item:last-child {\n\t\tborder-bottom: ${menuItem.shared[':last-child']['border-bottom']};\n\t}\n\t.js-stand-menu-item:hover {\n\t\tbackground: ${menuItem.shared[':hover']['background-color']};\n\t}\n\t.js-stand-menu-item:focus-visible {\n\t\toutline: ${menuItem.shared[':focus-visible'].outline};\n\t\toutline-offset: ${menuItem.shared[':focus-visible']['outline-offset']};\n\t\tbackground: ${menuItem.shared[':hover']['background-color']};\n\t}\n\n\t.js-stand-menu-item-icon {\n\t\tgrid-area: ${menuItem.shared.icon['grid-area']};\n\t\talign-self: ${menuItem.shared.icon['align-self']};\n\t\tcolor: ${menuItem.shared.icon.color};\n\t\tfont-size: ${menuItem.md.icon.size};\n\t\tline-height: ${menuItem.md.icon['line-height']};\n\t}\n\t.js-stand-menu-item-label {\n\t\tgrid-area: ${menuItem.shared.label['grid-area']};\n\t\tcolor: ${menuItem.shared.label.color};\n\t\tfont: ${menuItem.shared.label.typography.font};\n\t\tletter-spacing: ${menuItem.shared.label.typography.letterSpacing};\n\t\tfont-variation-settings: 'wdth' ${menuItem.shared.label.typography.fontWidth};\n\t}\n\t.js-stand-menu-item-description {\n\t\tgrid-area: ${menuItem.shared.description['grid-area']};\n\t\tcolor: ${menuItem.shared.description.color};\n\t\tfont: ${menuItem.shared.description.typography.font};\n\t\tletter-spacing: ${menuItem.shared.description.typography.letterSpacing};\n\t\tfont-variation-settings: 'wdth' ${menuItem.shared.description.typography.fontWidth};\n\t}\n\t.js-stand-menu-item-aside {\n\t\tgrid-area: ${menuItem.shared.aside['grid-area']};\n\t\tjustify-self: ${menuItem.shared.aside['justify-self']};\n\t\tcolor: ${menuItem.shared.aside.color};\n\t\tfont: ${menuItem.shared.aside.typography.font};\n\t\tletter-spacing: ${menuItem.shared.aside.typography.letterSpacing};\n\t\tfont-variation-settings: 'wdth' ${menuItem.shared.aside.typography.fontWidth};\n\t}\n\n\t/* Separator */\n\t.js-stand-menu-separator {\n\t\tbackground-color: ${menuSeparator.shared['background-color']};\n\t\theight: ${menuSeparator.shared.height};\n\t\twidth: ${menuSeparator.shared.width};\n\t}\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\n// modify the dom with the menu components using the generated stylesheet\ndocument.getElementById(\"app\").innerHTML = `\n\t<div class=\"js-stand-popover\">\n\t\t<div class=\"js-stand-menu\">\n\t\t\t<div>\n\t\t\t\t<div class=\"js-stand-menu-section-header\">File actions</div>\n\t\t\t\t<div class=\"js-stand-menu-item js-stand-menu-item-with-description\" tabindex=\"0\">\n\t\t\t\t\t<span class=\"js-stand-menu-item-icon material-symbols\">open_in_new</span>\n\t\t\t\t\t<span class=\"js-stand-menu-item-label\">Open</span>\n\t\t\t\t\t<span class=\"js-stand-menu-item-description\">Open in a new tab</span>\n\t\t\t\t\t<span class=\"js-stand-menu-item-aside\">\u2318O</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"js-stand-menu-item js-stand-menu-item-with-description\" tabindex=\"0\">\n\t\t\t\t\t<span class=\"js-stand-menu-item-label\">Rename</span>\n\t\t\t\t\t<span class=\"js-stand-menu-item-description\">Rename the file</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"js-stand-menu-item\" tabindex=\"0\">\n\t\t\t\t\t<span class=\"js-stand-menu-item-label\">Delete</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"js-stand-menu-separator\"></div>\n\t\t\t<div>\n\t\t\t\t<div class=\"js-stand-menu-item\" tabindex=\"0\">\n\t\t\t\t\t<span class=\"js-stand-menu-item-label\">Show files</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"js-stand-menu-item\" tabindex=\"0\">\n\t\t\t\t\t<span class=\"js-stand-menu-item-label\">Show folders</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n`;\n";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { ComponentMenu } from '../../styleD/build/typescript/component/menu';
|
|
3
|
+
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
|
+
import type { MenuItemProps, MenuPopoverProps, MenuSectionProps } from './types';
|
|
5
|
+
export type MenuTheme = Prettify<ComponentMenu['menu']>;
|
|
6
|
+
export type PartialMenuTheme = DeepPartial<MenuTheme>;
|
|
7
|
+
export declare const defaultMenuTheme: MenuTheme;
|
|
8
|
+
export declare const menuStyles: (theme: MenuTheme) => SerializedStyles;
|
|
9
|
+
export type MenuSectionTheme = Prettify<ComponentMenu['menuSection']>;
|
|
10
|
+
export type PartialMenuSectionTheme = DeepPartial<MenuSectionTheme>;
|
|
11
|
+
export declare const defaultMenuSectionTheme: MenuSectionTheme;
|
|
12
|
+
export declare const menuSectionHeaderStyles: (theme: MenuSectionTheme, { size }: Required<Pick<MenuSectionProps, 'size'>>) => SerializedStyles;
|
|
13
|
+
export type MenuItemTheme = Prettify<ComponentMenu['menuItem']>;
|
|
14
|
+
export type PartialMenuItemTheme = DeepPartial<MenuItemTheme>;
|
|
15
|
+
export declare const defaultMenuItemTheme: MenuItemTheme;
|
|
16
|
+
export declare const menuItemStyles: (theme: MenuItemTheme, { description }: Pick<MenuItemProps, 'description'>, isFocusVisible?: boolean) => SerializedStyles;
|
|
17
|
+
export declare const menuItemIconStyles: (theme: MenuItemTheme, { size }: Required<Pick<MenuItemProps, 'size'>>) => SerializedStyles;
|
|
18
|
+
export declare const menuItemLabelStyles: (theme: MenuItemTheme) => SerializedStyles;
|
|
19
|
+
export declare const menuItemDescriptionStyles: (theme: MenuItemTheme) => SerializedStyles;
|
|
20
|
+
export declare const menuItemAsideStyles: (theme: MenuItemTheme) => SerializedStyles;
|
|
21
|
+
export type MenuSeparatorTheme = Prettify<ComponentMenu['menuSeparator']>;
|
|
22
|
+
export type PartialMenuSeparatorTheme = DeepPartial<MenuSeparatorTheme>;
|
|
23
|
+
export declare const defaultMenuSeparatorTheme: MenuSeparatorTheme;
|
|
24
|
+
export declare const menuSeparatorStyles: (theme: MenuSeparatorTheme) => SerializedStyles;
|
|
25
|
+
export type MenuPopoverTheme = Prettify<ComponentMenu['menuPopover']>;
|
|
26
|
+
export type PartialMenuPopoverTheme = DeepPartial<MenuPopoverTheme>;
|
|
27
|
+
export declare const defaultMenuPopoverTheme: MenuPopoverTheme;
|
|
28
|
+
export declare const menuPopoverStyles: (theme: MenuPopoverTheme, { size }: Required<Pick<MenuPopoverProps, 'size'>>) => SerializedStyles;
|
|
@@ -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,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;
|