@workday/canvas-kit-docs 13.0.0-alpha.950-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 (77) 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/es6/mdx/welcomePage.js +1 -1
  8. package/dist/mdx/10.0-UPGRADE-GUIDE.mdx +1 -1
  9. package/dist/mdx/11.0-UPGRADE-GUIDE.mdx +6 -6
  10. package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +6 -6
  11. package/dist/mdx/CONTRIBUTING.mdx +1 -1
  12. package/dist/mdx/CREATING_COMPOUND_COMPONENTS.mdx +31 -0
  13. package/dist/mdx/preview-react/InformationHighlight/InformationHighlight.mdx +109 -0
  14. package/dist/mdx/preview-react/InformationHighlight/examples/Basic.tsx +18 -0
  15. package/dist/mdx/preview-react/InformationHighlight/examples/Body.tsx +13 -0
  16. package/dist/mdx/preview-react/InformationHighlight/examples/Caution.tsx +27 -0
  17. package/dist/mdx/preview-react/InformationHighlight/examples/Critical.tsx +33 -0
  18. package/dist/mdx/preview-react/InformationHighlight/examples/CustomIconCritical.tsx +28 -0
  19. package/dist/mdx/preview-react/InformationHighlight/examples/Heading.tsx +11 -0
  20. package/dist/mdx/preview-react/InformationHighlight/examples/Informational.tsx +27 -0
  21. package/dist/mdx/preview-react/InformationHighlight/examples/RTL.tsx +42 -0
  22. package/dist/mdx/preview-react/radio/Radio.mdx +2 -2
  23. package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +1 -1
  24. package/dist/mdx/preview-react/status-indicator/StatusIndicator.mdx +2 -2
  25. package/dist/mdx/react/_examples/GlobalHeader.mdx +36 -0
  26. package/dist/mdx/react/_examples/mdx/CompoundComponent.mdx +2 -2
  27. package/dist/mdx/react/_examples/mdx/Headers.mdx +26 -0
  28. package/dist/mdx/react/_examples/mdx/examples/GlobalHeader.tsx +267 -37
  29. package/dist/mdx/react/badge/CountBadge.mdx +2 -2
  30. package/dist/mdx/react/breadcrumbs/examples/Overflow.tsx +13 -4
  31. package/dist/mdx/react/button/button/Button.mdx +5 -5
  32. package/dist/mdx/react/card/card.mdx +2 -2
  33. package/dist/mdx/react/checkbox/Checkbox.mdx +5 -5
  34. package/dist/mdx/react/combobox/Combobox.mdx +2 -2
  35. package/dist/mdx/react/form-field/FormField.mdx +2 -2
  36. package/dist/mdx/react/modal/examples/IframeTest.tsx +4 -1
  37. package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +102 -53
  38. package/dist/mdx/react/select/Select.mdx +6 -6
  39. package/dist/mdx/react/switch/Switch.mdx +5 -5
  40. package/dist/mdx/react/table/Table.mdx +2 -2
  41. package/dist/mdx/react/text/BodyText.mdx +2 -2
  42. package/dist/mdx/react/text/Heading.mdx +2 -2
  43. package/dist/mdx/react/text/Subtext.mdx +2 -2
  44. package/dist/mdx/react/text/Text.mdx +2 -2
  45. package/dist/mdx/react/text/Title.mdx +2 -2
  46. package/dist/mdx/react/tokens/Tokens.mdx +2 -1
  47. package/dist/mdx/welcome.mdx +3 -3
  48. package/index.ts +0 -1
  49. package/package.json +7 -7
  50. package/dist/es6/lib/InformationHighlight/Base.d.ts +0 -5
  51. package/dist/es6/lib/InformationHighlight/Base.d.ts.map +0 -1
  52. package/dist/es6/lib/InformationHighlight/Base.js +0 -9
  53. package/dist/es6/lib/InformationHighlight/Body.d.ts +0 -2
  54. package/dist/es6/lib/InformationHighlight/Body.d.ts.map +0 -1
  55. package/dist/es6/lib/InformationHighlight/Body.js +0 -18
  56. package/dist/es6/lib/InformationHighlight/Heading.d.ts +0 -2
  57. package/dist/es6/lib/InformationHighlight/Heading.d.ts.map +0 -1
  58. package/dist/es6/lib/InformationHighlight/Heading.js +0 -17
  59. package/dist/es6/lib/InformationHighlight/Icon.d.ts +0 -13
  60. package/dist/es6/lib/InformationHighlight/Icon.d.ts.map +0 -1
  61. package/dist/es6/lib/InformationHighlight/Icon.js +0 -44
  62. package/dist/es6/lib/InformationHighlight/Link.d.ts +0 -2
  63. package/dist/es6/lib/InformationHighlight/Link.d.ts.map +0 -1
  64. package/dist/es6/lib/InformationHighlight/Link.js +0 -18
  65. package/dist/es6/lib/InformationHighlight/index.d.ts +0 -25
  66. package/dist/es6/lib/InformationHighlight/index.d.ts.map +0 -1
  67. package/dist/es6/lib/InformationHighlight/index.js +0 -44
  68. package/dist/es6/lib/InformationHighlight/modelHook.d.ts +0 -19
  69. package/dist/es6/lib/InformationHighlight/modelHook.d.ts.map +0 -1
  70. package/dist/es6/lib/InformationHighlight/modelHook.js +0 -13
  71. package/lib/InformationHighlight/Base.tsx +0 -12
  72. package/lib/InformationHighlight/Body.tsx +0 -21
  73. package/lib/InformationHighlight/Heading.tsx +0 -20
  74. package/lib/InformationHighlight/Icon.tsx +0 -65
  75. package/lib/InformationHighlight/Link.tsx +0 -20
  76. package/lib/InformationHighlight/index.tsx +0 -62
  77. package/lib/InformationHighlight/modelHook.ts +0 -16
@@ -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
- });