@workday/canvas-kit-docs 9.2.0-526-next.0 → 9.2.0-528-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.
@@ -993,7 +993,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
993
993
  {
994
994
  "name": "useThemeRTL",
995
995
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/labs-react/common/lib/theming/useThemeRTL.ts",
996
- "description": "",
996
+ "description": "A helpful hook for supporting bidirectional styles.\n* Read below for more detail or [view the docs](https://github.com/Workday/canvas-kit/blob/master/modules/labs-react/common/README.md#useThemeRTL).",
997
997
  "declarations": [
998
998
  {
999
999
  "name": "useThemeRTL",
@@ -1001,9 +1001,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
1001
1001
  }
1002
1002
  ],
1003
1003
  "tags": {
1004
- "deprecated": "Now that IE11 is no longer supported, we encourage consumers to use [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties)\n\n\nA helpful hook for supporting bidirectional styles.\n* Read below for more detail or [view the docs](https://github.com/Workday/canvas-kit/blob/master/modules/labs-react/common/README.md#useThemeRTL).",
1005
1004
  "returns": "* `themeRTL` - a function to transform bidirectional styles\n* `theme` - the Canvas theme object (optional, provided for convenience)\n\n`themeRTL` allows you to support bidirectionality with a single set of styles and pass them along to a component.\nIt accepts CSS object styles and transforms CSS attributes based on the content direction set in the theme (LTR or RTL).",
1006
- "example": "import { type } from '@workday/canvas-kit-react/tokens';\nimport { useThemeRTL } from '@workday/canvas-kit-labs-react/common';\n\nconst ErrorText: React.FC = (props) => {\n const { themeRTL, theme } = useThemeRTL();\n // `borderLeft` will be converted to `borderRight`\n // when the theme direction is `RTL`.\n // All other styles will remain unchanged.\n const errorTextStyles = themeRTL({\n ...type.levels.subtext.medium,\n color: theme.canvas.palette.error.main,\n borderLeft: `solid 2px ${theme.canvas.palette.error.main}`,\n });\n\n return <span css={errorTextStyles} {...props} />;\n}"
1005
+ "example": "import { type } from '@workday/canvas-kit-react/tokens';\nimport { useThemeRTL } from '@workday/canvas-kit-labs-react/common';\n\nconst ErrorText: React.FC = (props) => {\n const { themeRTL, theme } = useThemeRTL();\n // `borderLeft` will be converted to `borderRight`\n // when the theme direction is `RTL`.\n // All other styles will remain unchanged.\n const errorTextStyles = themeRTL({\n ...type.levels.subtext.medium,\n color: theme.canvas.palette.error.main,\n borderLeft: `solid 2px ${theme.canvas.palette.error.main}`,\n });\n\n return <span css={errorTextStyles} {...props} />;\n}",
1006
+ "deprecated": "⚠️ `useThemeRTL` has been deprecated and will be removed in a future major version. Now that IE11 is no longer supported, we encourage consumers to use [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties)."
1007
1007
  },
1008
1008
  "type": {
1009
1009
  "kind": "function",
@@ -7155,14 +7155,16 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
7155
7155
  {
7156
7156
  "name": "DeprecatedMenuProps",
7157
7157
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/menu/lib/Menu.tsx",
7158
- "description": "### Deprecated Menu\n\nAs of Canvas Kit v8, Menu is being deprecated.\nIt will be removed in v10. Please see the\n[upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)\nfor more information.",
7158
+ "description": "",
7159
7159
  "declarations": [
7160
7160
  {
7161
7161
  "name": "DeprecatedMenuProps",
7162
7162
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/menu/lib/Menu.tsx"
7163
7163
  }
7164
7164
  ],
7165
- "tags": {},
7165
+ "tags": {
7166
+ "deprecated": "⚠️ `DeprecatedMenuProps` has been deprecated and will be removed in a future major version. Please use [Menu in Main](https://workday.github.io/canvas-kit/?path=/docs/components-popups-menu--basic) instead."
7167
+ },
7166
7168
  "type": {
7167
7169
  "kind": "alias",
7168
7170
  "name": "DeprecatedMenu"
@@ -7171,14 +7173,16 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
7171
7173
  {
7172
7174
  "name": "DeprecatedMenuState",
7173
7175
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/menu/lib/Menu.tsx",
7174
- "description": "### Deprecated Menu State\n\nAs of Canvas Kit v8, Menu is being deprecated.\nIt will be removed in v10. Please see the\n[upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)\nfor more information.",
7176
+ "description": "",
7175
7177
  "declarations": [
7176
7178
  {
7177
7179
  "name": "DeprecatedMenuState",
7178
7180
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/menu/lib/Menu.tsx"
7179
7181
  }
7180
7182
  ],
7181
- "tags": {},
7183
+ "tags": {
7184
+ "deprecated": "⚠️ `DeprecatedMenuState` has been deprecated and will be removed in a future major version. Please use [Menu in Main](https://workday.github.io/canvas-kit/?path=/docs/components-popups-menu--basic) instead."
7185
+ },
7182
7186
  "type": {
7183
7187
  "kind": "object",
7184
7188
  "properties": [
@@ -7205,7 +7209,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
7205
7209
  {
7206
7210
  "name": "DeprecatedMenu",
7207
7211
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/menu/lib/Menu.tsx",
7208
- "description": "As of Canvas Kit v8, Menu is being deprecated.\nIt will be removed in v10. Please see the [upgrade\nguide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page) for\nmore information.\n\n`DeprecatedMenu` renders a styled `<ul role=\"menu\">` element within a {@link Card} and follows\nthe [Active Menu\npattern](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/examples/menu-button-actions-active-descendant/)\nusing `aria-activedescendant`.\n\nUndocumented props are spread to the underlying `<ul>` element.",
7212
+ "description": "`DeprecatedMenu` renders a styled `<ul role=\"menu\">` element within a {@link Card} and follows\nthe [Active Menu\npattern](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/examples/menu-button-actions-active-descendant/)\nusing `aria-activedescendant`.\n\nUndocumented props are spread to the underlying `<ul>` element.",
7209
7213
  "declarations": [
7210
7214
  {
7211
7215
  "name": "DeprecatedMenu",
@@ -7213,7 +7217,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
7213
7217
  }
7214
7218
  ],
7215
7219
  "tags": {
7216
- "deprecated": ""
7220
+ "deprecated": "⚠️ Deprecated Menu has been deprecated and will be removed in a future major version. Please use [Menu in Main](https://workday.github.io/canvas-kit/?path=/docs/components-popups-menu--basic) instead."
7217
7221
  },
7218
7222
  "type": {
7219
7223
  "kind": "component",
@@ -7430,14 +7434,16 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
7430
7434
  {
7431
7435
  "name": "DeprecatedMenuItemProps",
7432
7436
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/menu/lib/MenuItem.tsx",
7433
- "description": "### Deprecated Menu Item Props\n\nAs of Canvas Kit v8, Menu is being deprecated.\nIt will be removed in v10. Please see the\n[upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)\nfor more information.",
7437
+ "description": "",
7434
7438
  "declarations": [
7435
7439
  {
7436
7440
  "name": "DeprecatedMenuItemProps",
7437
7441
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/menu/lib/MenuItem.tsx"
7438
7442
  }
7439
7443
  ],
7440
- "tags": {},
7444
+ "tags": {
7445
+ "deprecated": "⚠️ `DeprecatedMenuItemProps` has been deprecated and will be removed in a future major version. Please use [Menu in Main](https://workday.github.io/canvas-kit/?path=/docs/components-popups-menu--basic) instead."
7446
+ },
7441
7447
  "type": {
7442
7448
  "kind": "alias",
7443
7449
  "name": "DeprecatedMenuItem"
@@ -7446,7 +7452,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
7446
7452
  {
7447
7453
  "name": "DeprecatedMenuItem",
7448
7454
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/menu/lib/MenuItem.tsx",
7449
- "description": "`DeprecatedMenuItem` renders an `<li>` element with the correct attributes to ensure it is\naccessible. If you choose to implement your own custom menu items, be sure to use semantic `<li>`\nelements with the following attributes:\n\n- `role=\"menuitem\"`\n- `tabindex={-1}`\n- `id`s following this pattern: `${MenuId}-${index}`\n\nAs of Canvas Kit v8, Menu is being deprecated.\nIt will be removed in v10. Please see the [upgrade\nguide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page) for\nmore information.\n\nUndocumented props are spread to the underlying `<li>` element.",
7455
+ "description": "`DeprecatedMenuItem` renders an `<li>` element with the correct attributes to ensure it is\naccessible. If you choose to implement your own custom menu items, be sure to use semantic `<li>`\nelements with the following attributes:\n\n- `role=\"menuitem\"`\n- `tabindex={-1}`\n- `id`s following this pattern: `${MenuId}-${index}`\n\nUndocumented props are spread to the underlying `<li>` element.",
7450
7456
  "declarations": [
7451
7457
  {
7452
7458
  "name": "DeprecatedMenuItem",
@@ -7454,7 +7460,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
7454
7460
  }
7455
7461
  ],
7456
7462
  "tags": {
7457
- "deprecated": ""
7463
+ "deprecated": "⚠️ `DeprecatedMenuItem` has been deprecated and will be removed in a future major version. Please use [Menu in Main](https://workday.github.io/canvas-kit/?path=/docs/components-popups-menu--basic) instead."
7458
7464
  },
7459
7465
  "type": {
7460
7466
  "kind": "component",
@@ -31771,7 +31777,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
31771
31777
  }
31772
31778
  ],
31773
31779
  "tags": {
31774
- "deprecated": "Please use `useFormFieldModel` instead"
31780
+ "deprecated": "⚠️ `useTextInputModel` is deprecated and will be removed in a future major version. Please use `useFormFieldModel` instead."
31775
31781
  },
31776
31782
  "type": {
31777
31783
  "kind": "symbol",
@@ -111825,7 +111831,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
111825
111831
  }
111826
111832
  ],
111827
111833
  "tags": {
111828
- "deprecated": "You no longer need to use displayName. A `displayName` will be automatically added if it belongs to a container"
111834
+ "deprecated": "⚠️ `displayName` has been deprecated and will be removed in a future major version. You no longer need to use `displayName`. A `displayName` will be automatically added if it belongs to a container."
111829
111835
  }
111830
111836
  },
111831
111837
  {
@@ -112778,7 +112784,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
112778
112784
  }
112779
112785
  ],
112780
112786
  "tags": {
112781
- "deprecated": "use `createSubModelElemPropsHook` instead"
112787
+ "deprecated": "⚠️ `subModelHook` has been deprecated and will be removed in a future major version. Please use `createSubModelElemPropsHook` instead."
112782
112788
  },
112783
112789
  "type": {
112784
112790
  "kind": "function",
@@ -115356,7 +115362,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
115356
115362
  }
115357
115363
  ],
115358
115364
  "tags": {
115359
- "deprecated": "The returned model is now inferred from `createModelHook`"
115365
+ "deprecated": "⚠️ `Model` has been deprecated and will be removed in a future major version. The returned model is now inferred from `createModelHook`."
115360
115366
  },
115361
115367
  "type": {
115362
115368
  "kind": "object",
@@ -115463,7 +115469,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
115463
115469
  ],
115464
115470
  "tags": {
115465
115471
  "example": "type ModelConfig = {\n // additional config your model requires goes here\n id?: string\n} & Partial<ToModelConfig<State, Events, typeof eventMap>>",
115466
- "deprecated": "`createModelHook` now infers the config type"
115472
+ "deprecated": "⚠️ `ToModelConfig` has been deprecated and will be removed in a future major version. Please use `createModelHook` instead since it infers the config type."
115467
115473
  },
115468
115474
  "type": {
115469
115475
  "kind": "type",
@@ -115662,7 +115668,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
115662
115668
  ],
115663
115669
  "tags": {
115664
115670
  "example": "type Events = {\n open(data: { eventData: string }): void\n}\n\nconst eventMap = createEventMap<Events>()({\n guards: {\n shouldOpen: 'open'\n },\n callbacks: {\n onOpen: 'open'\n }\n})",
115665
- "deprecated": "`createModelHook` uses Template Literal Types to create event map types"
115671
+ "deprecated": "⚠️ `createEventMap` has been deprecated and will be removed in a future major version. Please use `createModelHook` instead. It uses Template Literal Types to create event map types."
115666
115672
  },
115667
115673
  "type": {
115668
115674
  "kind": "function",
@@ -115914,7 +115920,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
115914
115920
  "tags": {
115915
115921
  "param": "eventMap\nstate\nconfig\nevents",
115916
115922
  "example": "const useDiscloseModel = (config: ModelConfig = {}): DiscloseModel => {\n const events = useEventMap(eventMap, state, config, {\n open() {\n // do something\n }\n }\n})",
115917
- "deprecated": "Use `createModelHook` instead"
115923
+ "deprecated": "⚠️ `useEventMap` has been deprecated and will be removed in a future major version. Please use `createModelHook` instead."
115918
115924
  },
115919
115925
  "type": {
115920
115926
  "kind": "function",
@@ -118036,7 +118042,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
118036
118042
  }
118037
118043
  ],
118038
118044
  "tags": {
118039
- "deprecated": "TODO: Remove in major release"
118045
+ "deprecated": "⚠️ `uniqueId` has been deprecated and will be removed in a future major version. Please use `useUniqueId` instead."
118040
118046
  },
118041
118047
  "type": {
118042
118048
  "kind": "symbol",
@@ -188815,7 +188821,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
188815
188821
  {
188816
188822
  "name": "StatusIndicatorType",
188817
188823
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/status-indicator/lib/StatusIndicator.tsx",
188818
- "description": "### ⚠️ Status Indicator has been deprecated and will be removed in v11 ⚠️\n- Please consider using [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in preview",
188824
+ "description": "",
188819
188825
  "declarations": [
188820
188826
  {
188821
188827
  "name": "StatusIndicatorType",
@@ -188823,7 +188829,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
188823
188829
  }
188824
188830
  ],
188825
188831
  "tags": {
188826
- "deprecated": ""
188832
+ "deprecated": "⚠️ Status Indicator has been deprecated and will be removed in a future major version. Please use [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in Preview instead."
188827
188833
  },
188828
188834
  "type": {
188829
188835
  "kind": "object",
@@ -188884,7 +188890,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
188884
188890
  {
188885
188891
  "name": "StatusIndicatorEmphasis",
188886
188892
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/status-indicator/lib/StatusIndicator.tsx",
188887
- "description": "### ⚠️ Status Indicator has been deprecated and will be removed in v11 ⚠️\n- Please consider using [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in preview",
188893
+ "description": "",
188888
188894
  "declarations": [
188889
188895
  {
188890
188896
  "name": "StatusIndicatorEmphasis",
@@ -188892,7 +188898,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
188892
188898
  }
188893
188899
  ],
188894
188900
  "tags": {
188895
- "deprecated": ""
188901
+ "deprecated": "⚠️ Status Indicator has been deprecated and will be removed in a future major version. Please use [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in Preview instead."
188896
188902
  },
188897
188903
  "type": {
188898
188904
  "kind": "object",
@@ -188921,7 +188927,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
188921
188927
  {
188922
188928
  "name": "StatusIndicatorGenericStyle",
188923
188929
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/status-indicator/lib/StatusIndicator.tsx",
188924
- "description": "### ⚠️ Status Indicator has been deprecated and will be removed in v11 ⚠️\n- Please consider using [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in preview",
188930
+ "description": "",
188925
188931
  "declarations": [
188926
188932
  {
188927
188933
  "name": "StatusIndicatorGenericStyle",
@@ -188929,7 +188935,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
188929
188935
  }
188930
188936
  ],
188931
188937
  "tags": {
188932
- "deprecated": ""
188938
+ "deprecated": "⚠️ Status Indicator has been deprecated and will be removed in a future major version. Please use [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in Preview instead."
188933
188939
  },
188934
188940
  "type": {
188935
188941
  "kind": "object",
@@ -189017,7 +189023,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
189017
189023
  {
189018
189024
  "name": "statusIndicatorStyles",
189019
189025
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/status-indicator/lib/StatusIndicator.tsx",
189020
- "description": "### ⚠️ Status Indicator has been deprecated and will be removed in v11 ⚠️\n- Please consider using [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in preview",
189026
+ "description": "",
189021
189027
  "declarations": [
189022
189028
  {
189023
189029
  "name": "statusIndicatorStyles",
@@ -189025,7 +189031,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
189025
189031
  }
189026
189032
  ],
189027
189033
  "tags": {
189028
- "deprecated": ""
189034
+ "deprecated": "⚠️ Status Indicator has been deprecated and will be removed in a future major version. Please use [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in Preview instead."
189029
189035
  },
189030
189036
  "type": {
189031
189037
  "kind": "symbol",
@@ -189036,7 +189042,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
189036
189042
  {
189037
189043
  "name": "StatusIndicatorProps",
189038
189044
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/status-indicator/lib/StatusIndicator.tsx",
189039
- "description": "### ⚠️ Status Indicator has been deprecated and will be removed in v11 ⚠️\n- Please consider using [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in preview",
189045
+ "description": "",
189040
189046
  "declarations": [
189041
189047
  {
189042
189048
  "name": "StatusIndicatorProps",
@@ -189044,7 +189050,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
189044
189050
  }
189045
189051
  ],
189046
189052
  "tags": {
189047
- "deprecated": ""
189053
+ "deprecated": "⚠️ Status Indicator has been deprecated and will be removed in a future major version. Please use [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in Preview instead."
189048
189054
  },
189049
189055
  "type": {
189050
189056
  "kind": "alias",
@@ -189054,7 +189060,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
189054
189060
  {
189055
189061
  "name": "StatusIndicator",
189056
189062
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/status-indicator/lib/StatusIndicator.tsx",
189057
- "description": "### ⚠️ Status Indicator has been deprecated and will be removed in v11 ⚠️\n- Please consider using [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in preview",
189063
+ "description": "",
189058
189064
  "declarations": [
189059
189065
  {
189060
189066
  "name": "StatusIndicator",
@@ -189062,7 +189068,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
189062
189068
  }
189063
189069
  ],
189064
189070
  "tags": {
189065
- "deprecated": ""
189071
+ "deprecated": "⚠️ Status Indicator has been deprecated and will be removed in a future major version. Please use [`Status Indicator`](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) in Preview instead."
189066
189072
  },
189067
189073
  "type": {
189068
189074
  "kind": "component",
@@ -189946,7 +189952,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
189946
189952
  }
189947
189953
  ],
189948
189954
  "tags": {
189949
- "deprecated": "Use `Tabs.Menu.Popper` instead"
189955
+ "deprecated": "⚠️ `MenuPopper` has been deprecated and will be removed in a future major version. Please use `Tabs.Menu.Popper` instead."
189950
189956
  }
189951
189957
  },
189952
189958
  {
@@ -27,6 +27,7 @@ Kit!
27
27
  - [Canary Releases](#canary-releases)
28
28
  - [Codemods](#codemods)
29
29
  - [Add a New Codemod](#add-a-new-codemod)
30
+ - [Deprecations](#deprecations)
30
31
 
31
32
  ## Branches
32
33
 
@@ -270,12 +271,13 @@ last release tag. So for example, a V8 canary would look something like this:
270
271
  ## Codemods
271
272
 
272
273
  We use codemods to reduce friction for consumers as they make changes and do upgrades. Codemods are
273
- accompany major version releases since v5, and can also be released in minor releases if users want to apply some changes sooner.
274
+ accompany major version releases since v5, and can also be released in minor releases if users want
275
+ to apply some changes sooner.
274
276
 
275
277
  ### Add a New Codemod
276
278
 
277
- Adding a new codemod is pretty straightforward, but this guide will make sure you don't miss any steps
278
- along the way.
279
+ Adding a new codemod is pretty straightforward, but this guide will make sure you don't miss any
280
+ steps along the way.
279
281
 
280
282
  First, you need to add a new command to the root CLI. For this example, we'll pretend you're adding
281
283
  a new v10 codemod.
@@ -379,4 +381,81 @@ describe('Example Codemod', () => {
379
381
  });
380
382
  ```
381
383
 
382
- And that's it! You're done. Stage your changes, commit, and push up a PR.
384
+ And that's it! You're done. Stage your changes, commit, and push up a PR.
385
+
386
+ ## Deprecations
387
+
388
+ We add the [@deprecated](https://jsdoc.app/tags-deprecated.html) JSDoc tag to code we plan to remove
389
+ in a future major release. This signals consumers to migrate to a more stable alternative before the
390
+ deprecated code is removed.
391
+
392
+ Add the `@deprecated` tag to the JSDoc comment directly above all exported declarations you wish to
393
+ deprecate. Create a new JSDoc comment if one doesn't already exist.
394
+
395
+ ```tsx
396
+ /**
397
+ * ...existing JSDoc comment, if present...
398
+ *
399
+ * @deprecated ⚠️ ${Deprecated Name} has been deprecated and will be removed in a future major release. ${Provide a migration strategy}
400
+ */
401
+ export...
402
+ ```
403
+
404
+ The provided migration strategy can take on any form as long as it gives the consumer a path forward
405
+ once the deprecated code is removed.
406
+
407
+ For example, we'll deprecate a component in our Main package before replacing it with an updated
408
+ version of the component in our Preview or Labs packages. Note the inclusion of package names
409
+ (Main/Preview/Labs) for disambiguation as well as the optional Storybook link to the updated
410
+ component.
411
+
412
+ ```tsx
413
+ /**
414
+ * @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) instead.
415
+ */
416
+ export class StatusIndicator...
417
+ ```
418
+
419
+ Here's an example of a deprecated utility function.
420
+
421
+ ```tsx
422
+ /**
423
+ * @deprecated ⚠️ `subModelHook` has been deprecated and will be removed in a future major release. Please use `createSubModelElemPropsHook` instead.
424
+ */
425
+ export const subModelHook...
426
+ ```
427
+
428
+ You may share the same `@deprecation` note for multiple deprecations related to the same component.
429
+
430
+ ```tsx
431
+ /**
432
+ * @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) instead.
433
+ */
434
+ export enum StatusIndicatorType...
435
+
436
+ /**
437
+ * @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) instead.
438
+ */
439
+ export interface StatusIndicatorProps...
440
+
441
+ /**
442
+ * @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--basic) instead.
443
+ */
444
+ export class StatusIndicator...
445
+ ```
446
+
447
+ Finally, be sure to notify users of the deprecation in the corresponding
448
+ [Upgrade Guide](https://github.com/Workday/canvas-kit/tree/master/modules/docs/mdx) MDX.
449
+
450
+ ```md
451
+ ## Deprecations
452
+
453
+ ...
454
+
455
+ ### ${Deprecated Name}
456
+
457
+ **PR:** [#${PR number where the deprecation took place}](https://github.com/Workday/canvas-kit/pull/${PR number})
458
+
459
+ We've deprecated ${Deprecated Name} ${Optional: Include package name to disambiguate (e.g., "from Labs")} ${Provide a
460
+ migration strategy}
461
+ ```
@@ -6,7 +6,7 @@ import {colors} from '@workday/canvas-kit-react/tokens';
6
6
 
7
7
  // Extend Heading Props and omitting size since we've added a default
8
8
  interface CardHeadingProps extends Omit<ExtractProps<typeof Heading>, 'size'> {}
9
- export const CardHeading = createComponent('h2')({
9
+ export default createComponent('h2')({
10
10
  displayName: 'CardHeading',
11
11
  Component: ({children, ...elemProps}: CardHeadingProps, ref, Element) => {
12
12
  return (
@@ -19,7 +19,7 @@ export const CardHeading = createComponent('h2')({
19
19
 
20
20
  // Extend Box Props for customization
21
21
  interface CardProps extends BoxProps {}
22
- export const Card = createComponent('div')({
22
+ export default createComponent('div')({
23
23
  displayName: 'Card',
24
24
  subComponents: {
25
25
  Heading: CardHeading,
@@ -33,7 +33,7 @@ export const Card = createComponent('div')({
33
33
  },
34
34
  });
35
35
 
36
- export const CreateComponent = () => {
36
+ export default () => {
37
37
  return (
38
38
  <Card depth={2} border={`1px solid ${colors.soap400}`} padding="s" as="section">
39
39
  <Card.Heading>Card Heading</Card.Heading>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "9.2.0-526-next.0",
3
+ "version": "9.2.0-528-next.0",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -44,9 +44,9 @@
44
44
  "dependencies": {
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@storybook/csf": "0.0.1",
47
- "@workday/canvas-kit-labs-react": "^9.2.0-526-next.0",
48
- "@workday/canvas-kit-preview-react": "^9.2.0-526-next.0",
49
- "@workday/canvas-kit-react": "^9.2.0-526-next.0",
47
+ "@workday/canvas-kit-labs-react": "^9.2.0-528-next.0",
48
+ "@workday/canvas-kit-preview-react": "^9.2.0-528-next.0",
49
+ "@workday/canvas-kit-react": "^9.2.0-528-next.0",
50
50
  "@workday/canvas-system-icons-web": "^3.0.0",
51
51
  "markdown-to-jsx": "^6.10.3",
52
52
  "ts-node": "^10.9.1"
@@ -57,5 +57,5 @@
57
57
  "mkdirp": "^1.0.3",
58
58
  "typescript": "4.2"
59
59
  },
60
- "gitHead": "9faea8962499ab9229f6050bfcedf8da179bb20b"
60
+ "gitHead": "32899ba334066e6b0f021de22fd0ae933108462c"
61
61
  }