@workday/canvas-kit-docs 13.0.0-alpha.978-next.0 → 13.0.0-alpha.998-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/es6/index.d.ts +0 -1
  2. package/dist/es6/index.d.ts.map +1 -1
  3. package/dist/es6/index.js +0 -1
  4. package/dist/es6/lib/docs.js +2076 -189
  5. package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
  6. package/dist/es6/mdx/versionsTable.js +4 -0
  7. package/dist/mdx/preview-react/InformationHighlight/InformationHighlight.mdx +109 -0
  8. package/dist/mdx/preview-react/InformationHighlight/examples/Basic.tsx +18 -0
  9. package/dist/mdx/preview-react/InformationHighlight/examples/Body.tsx +13 -0
  10. package/dist/mdx/preview-react/InformationHighlight/examples/Caution.tsx +27 -0
  11. package/dist/mdx/preview-react/InformationHighlight/examples/Critical.tsx +33 -0
  12. package/dist/mdx/preview-react/InformationHighlight/examples/CustomIconCritical.tsx +28 -0
  13. package/dist/mdx/preview-react/InformationHighlight/examples/Heading.tsx +11 -0
  14. package/dist/mdx/preview-react/InformationHighlight/examples/Informational.tsx +27 -0
  15. package/dist/mdx/preview-react/InformationHighlight/examples/RTL.tsx +42 -0
  16. package/dist/mdx/react/button/button/Button.mdx +7 -0
  17. package/dist/mdx/react/button/button/examples/ThemeOverrides.tsx +73 -0
  18. package/dist/mdx/react/tokens/Tokens.mdx +2 -1
  19. package/index.ts +0 -1
  20. package/package.json +7 -7
  21. package/dist/es6/lib/InformationHighlight/Base.d.ts +0 -5
  22. package/dist/es6/lib/InformationHighlight/Base.d.ts.map +0 -1
  23. package/dist/es6/lib/InformationHighlight/Base.js +0 -9
  24. package/dist/es6/lib/InformationHighlight/Body.d.ts +0 -2
  25. package/dist/es6/lib/InformationHighlight/Body.d.ts.map +0 -1
  26. package/dist/es6/lib/InformationHighlight/Body.js +0 -18
  27. package/dist/es6/lib/InformationHighlight/Heading.d.ts +0 -2
  28. package/dist/es6/lib/InformationHighlight/Heading.d.ts.map +0 -1
  29. package/dist/es6/lib/InformationHighlight/Heading.js +0 -17
  30. package/dist/es6/lib/InformationHighlight/Icon.d.ts +0 -13
  31. package/dist/es6/lib/InformationHighlight/Icon.d.ts.map +0 -1
  32. package/dist/es6/lib/InformationHighlight/Icon.js +0 -44
  33. package/dist/es6/lib/InformationHighlight/Link.d.ts +0 -2
  34. package/dist/es6/lib/InformationHighlight/Link.d.ts.map +0 -1
  35. package/dist/es6/lib/InformationHighlight/Link.js +0 -18
  36. package/dist/es6/lib/InformationHighlight/index.d.ts +0 -25
  37. package/dist/es6/lib/InformationHighlight/index.d.ts.map +0 -1
  38. package/dist/es6/lib/InformationHighlight/index.js +0 -44
  39. package/dist/es6/lib/InformationHighlight/modelHook.d.ts +0 -19
  40. package/dist/es6/lib/InformationHighlight/modelHook.d.ts.map +0 -1
  41. package/dist/es6/lib/InformationHighlight/modelHook.js +0 -13
  42. package/lib/InformationHighlight/Base.tsx +0 -12
  43. package/lib/InformationHighlight/Body.tsx +0 -21
  44. package/lib/InformationHighlight/Heading.tsx +0 -20
  45. package/lib/InformationHighlight/Icon.tsx +0 -65
  46. package/lib/InformationHighlight/Link.tsx +0 -20
  47. package/lib/InformationHighlight/index.tsx +0 -62
  48. package/lib/InformationHighlight/modelHook.ts +0 -16
@@ -1,25 +0,0 @@
1
- import { BaseProps } from './Base';
2
- type Variant = 'emphasis' | 'caution' | 'attention';
3
- interface InformationHighlightProps extends BaseProps {
4
- variant?: Variant;
5
- }
6
- export declare const InformationHighlight: import("@workday/canvas-kit-react/common").ElementComponentM<"section", InformationHighlightProps & Partial<{
7
- variant: import("./modelHook").Variant;
8
- }> & {} & {}, {
9
- state: {
10
- variant: import("./modelHook").Variant;
11
- };
12
- events: {};
13
- }> & {
14
- Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", import("./Icon").IconProps, {
15
- state: {
16
- variant: import("./modelHook").Variant;
17
- };
18
- events: {};
19
- }>;
20
- Heading: import("@workday/canvas-kit-react/common").ElementComponent<"div", unknown>;
21
- Body: import("@workday/canvas-kit-react/common").ElementComponent<"p", unknown>;
22
- Link: import("@workday/canvas-kit-react/common").ElementComponent<"div", unknown>;
23
- };
24
- export {};
25
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/InformationHighlight/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAO,SAAS,EAAC,MAAM,QAAQ,CAAC;AAOvC,KAAK,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpD,UAAU,yBAA0B,SAAQ,SAAS;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA4BD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;CAiB/B,CAAC"}
@@ -1,44 +0,0 @@
1
- import * as React from 'react';
2
- import { createContainer } from '@workday/canvas-kit-react/common';
3
- import { createModifiers, createStyles, cssVar } from '@workday/canvas-kit-styling';
4
- import { base, system } from '@workday/canvas-tokens-web';
5
- import { Base } from './Base';
6
- import { Heading } from './Heading';
7
- import { Body } from './Body';
8
- import { Icon } from './Icon';
9
- import { Link } from './Link';
10
- import { useInformationHighlightModel } from './modelHook';
11
- const containerStyles = createStyles({
12
- backgroundColor: base.soap100,
13
- display: 'grid',
14
- gridTemplateColumns: 'min-content',
15
- columnGap: system.space.x4,
16
- rowGap: system.space.x2,
17
- padding: system.space.x4,
18
- borderRadius: system.shape.x1,
19
- });
20
- const containerModifiers = createModifiers({
21
- variant: {
22
- emphasis: createStyles({
23
- borderInlineStart: `solid ${cssVar(system.space.x1)} ${cssVar(base.blueberry400)}`,
24
- }),
25
- caution: createStyles({
26
- borderInlineStart: `solid ${cssVar(system.space.x1)} ${cssVar(base.cantaloupe400)}`,
27
- }),
28
- attention: createStyles({
29
- borderInlineStart: `solid ${cssVar(system.space.x1)} ${cssVar(base.cinnamon500)}`,
30
- }),
31
- },
32
- });
33
- export const InformationHighlight = createContainer('section')({
34
- displayName: 'InformationHighlight',
35
- modelHook: useInformationHighlightModel,
36
- subComponents: {
37
- Icon: Icon,
38
- Heading: Heading,
39
- Body: Body,
40
- Link: Link,
41
- },
42
- })((props, Element, model) => {
43
- return (React.createElement(Base, { as: Element, cs: [containerStyles, containerModifiers({ variant: model.state.variant })], ...props }));
44
- });
@@ -1,19 +0,0 @@
1
- export type Variant = 'emphasis' | 'caution' | 'attention';
2
- export declare const useInformationHighlightModel: (<TT_Special_Generic>(config?: (Partial<{
3
- variant: Variant;
4
- }> & {} & {}) | undefined) => {
5
- state: {
6
- variant: Variant;
7
- };
8
- events: {};
9
- }) & import("@workday/canvas-kit-react/common").ModelExtras<{
10
- variant: Variant;
11
- }, {}, {
12
- variant: Variant;
13
- }, {}, {
14
- state: {
15
- variant: Variant;
16
- };
17
- events: {};
18
- }>;
19
- //# sourceMappingURL=modelHook.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modelHook.d.ts","sourceRoot":"","sources":["../../../../lib/InformationHighlight/modelHook.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAE3D,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;EAWvC,CAAC"}
@@ -1,13 +0,0 @@
1
- import { createModelHook } from '@workday/canvas-kit-react/common';
2
- export const useInformationHighlightModel = createModelHook({
3
- defaultConfig: {
4
- variant: 'emphasis',
5
- },
6
- })(config => {
7
- return {
8
- state: {
9
- variant: config.variant,
10
- },
11
- events: {},
12
- };
13
- });
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import {createComponent} from '@workday/canvas-kit-react/common';
3
- import {CSProps, handleCsProp} from '@workday/canvas-kit-styling';
4
-
5
- export interface BaseProps extends CSProps {}
6
-
7
- export const Base = createComponent('div')({
8
- displayName: 'Base',
9
- Component: (props: BaseProps, ref, Element) => {
10
- return <Element ref={ref} {...handleCsProp(props)} />;
11
- },
12
- });
@@ -1,21 +0,0 @@
1
- import * as React from 'react';
2
- import {createComponent} from '@workday/canvas-kit-react/common';
3
- import {createStyles} from '@workday/canvas-kit-styling';
4
- import {base, system} from '@workday/canvas-tokens-web';
5
-
6
- import {Base} from './Base';
7
-
8
- const bodyStyles = createStyles({
9
- ...system.type.subtext.large,
10
- color: base.blackPepper300,
11
- gridColumn: '2',
12
- fontWeight: 400, // This is here to keep createStyle types from being angry
13
- margin: 0,
14
- });
15
-
16
- export const Body = createComponent('p')({
17
- displayName: 'Body',
18
- Component: (props, ref, Element) => {
19
- return <Base as={Element} ref={ref} cs={bodyStyles} {...props} />;
20
- },
21
- });
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import {createComponent} from '@workday/canvas-kit-react/common';
3
- import {createStyles} from '@workday/canvas-kit-styling';
4
- import {base, system} from '@workday/canvas-tokens-web';
5
-
6
- import {Base} from './Base';
7
-
8
- const headingStyles = createStyles({
9
- ...system.type.body.small,
10
- color: base.blackPepper400,
11
- gridColumn: '2',
12
- fontWeight: 700, // should use system.fontWeight.bold
13
- });
14
-
15
- export const Heading = createComponent('div')({
16
- displayName: 'Heading',
17
- Component: (props, ref, Element) => {
18
- return <Base as={Element} ref={ref} cs={headingStyles} {...props} />;
19
- },
20
- });
@@ -1,65 +0,0 @@
1
- import * as React from 'react';
2
- import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
3
- import {createSubcomponent} from '@workday/canvas-kit-react/common';
4
-
5
- import {cssVar} from '@workday/canvas-kit-styling';
6
- import {
7
- infoIcon,
8
- exclamationCircleIcon,
9
- exclamationTriangleIcon,
10
- } from '@workday/canvas-system-icons-web';
11
- import {base} from '@workday/canvas-tokens-web';
12
- import {useInformationHighlightModel} from './modelHook';
13
-
14
- type Variant = 'emphasis' | 'caution' | 'attention';
15
-
16
- const iconStyles = {
17
- emphasis: {
18
- accent: cssVar(base.blueberry400),
19
- fill: cssVar(base.blueberry400),
20
- background: 'none',
21
- accentHover: cssVar(base.blueberry400),
22
- fillHover: cssVar(base.blueberry400),
23
- backgroundHover: 'none',
24
- },
25
- caution: {
26
- accent: cssVar(base.blackPepper400),
27
- fill: cssVar(base.blackPepper400),
28
- background: 'none',
29
- accentHover: cssVar(base.blackPepper400),
30
- fillHover: cssVar(base.blackPepper400),
31
- backgroundHover: 'none',
32
- },
33
- attention: {
34
- accent: cssVar(base.cinnamon500),
35
- fill: cssVar(base.cinnamon500),
36
- background: 'none',
37
- accentHover: cssVar(base.cinnamon500),
38
- fillHover: cssVar(base.cinnamon500),
39
- backgroundHover: 'none',
40
- },
41
- };
42
-
43
- export interface IconProps extends SystemIconProps {
44
- variant: Variant;
45
- }
46
-
47
- const defaultIcons = {
48
- emphasis: infoIcon,
49
- caution: exclamationTriangleIcon,
50
- attention: exclamationCircleIcon,
51
- };
52
-
53
- export const Icon = createSubcomponent('span')({
54
- displayName: 'Icon',
55
- modelHook: useInformationHighlightModel,
56
- })(({icon, ...props}: IconProps, Element, model) => {
57
- return (
58
- <SystemIcon
59
- as={Element}
60
- icon={icon ? icon : defaultIcons[model.state.variant]}
61
- {...iconStyles[model.state.variant]}
62
- {...props}
63
- />
64
- );
65
- });
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import {ExternalHyperlink} from '@workday/canvas-kit-react/button';
3
- import {createComponent} from '@workday/canvas-kit-react/common';
4
- import {createStyles, cssVar} from '@workday/canvas-kit-styling';
5
- import {base, system} from '@workday/canvas-tokens-web';
6
-
7
- const linkStyles = createStyles({
8
- ...system.type.subtext.large,
9
- gridColumn: '2',
10
- justifySelf: 'start',
11
- color: `${cssVar(base.blueberry500)} !important`,
12
- fontWeight: 500, // should use system.fontWeight.bold
13
- });
14
-
15
- export const Link = createComponent('div')({
16
- displayName: 'Link',
17
- Component: (props, ref, Element) => {
18
- return <ExternalHyperlink as={Element} ref={ref} className={linkStyles} {...props} />;
19
- },
20
- });
@@ -1,62 +0,0 @@
1
- import * as React from 'react';
2
- import {createContainer} from '@workday/canvas-kit-react/common';
3
- import {createModifiers, createStyles, cssVar} from '@workday/canvas-kit-styling';
4
- import {base, system} from '@workday/canvas-tokens-web';
5
-
6
- import {Base, BaseProps} from './Base';
7
- import {Heading} from './Heading';
8
- import {Body} from './Body';
9
- import {Icon} from './Icon';
10
- import {Link} from './Link';
11
- import {useInformationHighlightModel} from './modelHook';
12
-
13
- type Variant = 'emphasis' | 'caution' | 'attention';
14
-
15
- interface InformationHighlightProps extends BaseProps {
16
- variant?: Variant;
17
- }
18
-
19
- const containerStyles = createStyles({
20
- backgroundColor: base.soap100,
21
- display: 'grid',
22
- gridTemplateColumns: 'min-content',
23
- columnGap: system.space.x4,
24
- rowGap: system.space.x2,
25
- padding: system.space.x4,
26
- borderRadius: system.shape.x1,
27
- });
28
-
29
- const containerModifiers = createModifiers({
30
- variant: {
31
- emphasis: createStyles({
32
- borderInlineStart: `solid ${cssVar(system.space.x1)} ${cssVar(base.blueberry400)}`,
33
- }),
34
- caution: createStyles({
35
- borderInlineStart: `solid ${cssVar(system.space.x1)} ${cssVar(
36
- base.cantaloupe400
37
- )}`,
38
- }),
39
- attention: createStyles({
40
- borderInlineStart: `solid ${cssVar(system.space.x1)} ${cssVar(base.cinnamon500)}`,
41
- }),
42
- },
43
- });
44
-
45
- export const InformationHighlight = createContainer('section')({
46
- displayName: 'InformationHighlight',
47
- modelHook: useInformationHighlightModel,
48
- subComponents: {
49
- Icon: Icon,
50
- Heading: Heading,
51
- Body: Body,
52
- Link: Link,
53
- },
54
- })((props: InformationHighlightProps, Element, model) => {
55
- return (
56
- <Base
57
- as={Element}
58
- cs={[containerStyles, containerModifiers({variant: model.state.variant})]}
59
- {...props}
60
- />
61
- );
62
- });
@@ -1,16 +0,0 @@
1
- import {createModelHook} from '@workday/canvas-kit-react/common';
2
-
3
- export type Variant = 'emphasis' | 'caution' | 'attention';
4
-
5
- export const useInformationHighlightModel = createModelHook({
6
- defaultConfig: {
7
- variant: 'emphasis' as Variant,
8
- },
9
- })(config => {
10
- return {
11
- state: {
12
- variant: config.variant,
13
- },
14
- events: {},
15
- };
16
- });