@workday/canvas-kit-docs 13.0.0-alpha.978-next.0 → 13.0.0-alpha.996-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 (46) 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 +2058 -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/tokens/Tokens.mdx +2 -1
  17. package/index.ts +0 -1
  18. package/package.json +6 -6
  19. package/dist/es6/lib/InformationHighlight/Base.d.ts +0 -5
  20. package/dist/es6/lib/InformationHighlight/Base.d.ts.map +0 -1
  21. package/dist/es6/lib/InformationHighlight/Base.js +0 -9
  22. package/dist/es6/lib/InformationHighlight/Body.d.ts +0 -2
  23. package/dist/es6/lib/InformationHighlight/Body.d.ts.map +0 -1
  24. package/dist/es6/lib/InformationHighlight/Body.js +0 -18
  25. package/dist/es6/lib/InformationHighlight/Heading.d.ts +0 -2
  26. package/dist/es6/lib/InformationHighlight/Heading.d.ts.map +0 -1
  27. package/dist/es6/lib/InformationHighlight/Heading.js +0 -17
  28. package/dist/es6/lib/InformationHighlight/Icon.d.ts +0 -13
  29. package/dist/es6/lib/InformationHighlight/Icon.d.ts.map +0 -1
  30. package/dist/es6/lib/InformationHighlight/Icon.js +0 -44
  31. package/dist/es6/lib/InformationHighlight/Link.d.ts +0 -2
  32. package/dist/es6/lib/InformationHighlight/Link.d.ts.map +0 -1
  33. package/dist/es6/lib/InformationHighlight/Link.js +0 -18
  34. package/dist/es6/lib/InformationHighlight/index.d.ts +0 -25
  35. package/dist/es6/lib/InformationHighlight/index.d.ts.map +0 -1
  36. package/dist/es6/lib/InformationHighlight/index.js +0 -44
  37. package/dist/es6/lib/InformationHighlight/modelHook.d.ts +0 -19
  38. package/dist/es6/lib/InformationHighlight/modelHook.d.ts.map +0 -1
  39. package/dist/es6/lib/InformationHighlight/modelHook.js +0 -13
  40. package/lib/InformationHighlight/Base.tsx +0 -12
  41. package/lib/InformationHighlight/Body.tsx +0 -21
  42. package/lib/InformationHighlight/Heading.tsx +0 -20
  43. package/lib/InformationHighlight/Icon.tsx +0 -65
  44. package/lib/InformationHighlight/Link.tsx +0 -20
  45. package/lib/InformationHighlight/index.tsx +0 -62
  46. package/lib/InformationHighlight/modelHook.ts +0 -16
@@ -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
- });