@workday/canvas-kit-docs 11.0.0-alpha.662-next.0 → 11.0.0-alpha.664-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 (85) hide show
  1. package/dist/es6/lib/docs.js +110 -144
  2. package/dist/mdx/preview-react/form-field/FormField.mdx +18 -0
  3. package/dist/mdx/preview-react/form-field/examples/AllFields.tsx +12 -12
  4. package/dist/mdx/preview-react/form-field/examples/Grow.tsx +21 -0
  5. package/dist/mdx/preview-react/form-field/examples/ThemedErrors.tsx +36 -0
  6. package/dist/mdx/preview-react/menu/Menu.mdx +10 -1
  7. package/dist/mdx/preview-react/radio/Radio.mdx +2 -5
  8. package/dist/mdx/preview-react/radio/examples/Basic.tsx +11 -4
  9. package/dist/mdx/preview-react/radio/examples/Custom.tsx +11 -4
  10. package/dist/mdx/preview-react/radio/examples/Disabled.tsx +5 -4
  11. package/dist/mdx/preview-react/radio/examples/Error.tsx +1 -1
  12. package/dist/mdx/preview-react/radio/examples/Inverse.tsx +7 -10
  13. package/dist/mdx/preview-react/radio/examples/LabelPosition.tsx +5 -8
  14. package/dist/mdx/preview-react/radio/examples/NoValue.tsx +5 -8
  15. package/dist/mdx/preview-react/radio/examples/RefForwarding.tsx +5 -4
  16. package/dist/mdx/preview-react/radio/examples/Required.tsx +7 -10
  17. package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +7 -4
  18. package/dist/mdx/preview-react/text-area/TextArea.mdx +9 -0
  19. package/dist/mdx/preview-react/text-input/TextInput.mdx +12 -2
  20. package/dist/mdx/react/checkbox/Checkbox.mdx +16 -6
  21. package/dist/mdx/react/checkbox/examples/Alert.tsx +11 -7
  22. package/dist/mdx/react/checkbox/examples/Error.tsx +11 -7
  23. package/dist/mdx/react/checkbox/examples/LabelPosition.tsx +9 -3
  24. package/dist/mdx/react/checkbox/examples/Required.tsx +9 -3
  25. package/dist/mdx/react/color-picker/color-input/ColorInput.mdx +16 -6
  26. package/dist/mdx/react/color-picker/color-input/examples/Alert.tsx +5 -8
  27. package/dist/mdx/react/color-picker/color-input/examples/Basic.tsx +4 -3
  28. package/dist/mdx/react/color-picker/color-input/examples/Checked.tsx +4 -3
  29. package/dist/mdx/react/color-picker/color-input/examples/Disabled.tsx +4 -3
  30. package/dist/mdx/react/color-picker/color-input/examples/Error.tsx +5 -8
  31. package/dist/mdx/react/color-picker/color-input/examples/Grow.tsx +4 -3
  32. package/dist/mdx/react/color-picker/color-input/examples/LabelPosition.tsx +4 -3
  33. package/dist/mdx/react/color-picker/color-input/examples/RefForwarding.tsx +4 -3
  34. package/dist/mdx/react/color-picker/color-input/examples/Required.tsx +4 -3
  35. package/dist/mdx/react/color-picker/color-input/examples/ValidColorChange.tsx +5 -3
  36. package/dist/mdx/react/color-picker/color-preview/ColorPreview.mdx +16 -6
  37. package/dist/mdx/react/color-picker/color-preview/examples/LabelPosition.tsx +4 -3
  38. package/dist/mdx/react/color-picker/color-preview/examples/RefForwarding.tsx +4 -3
  39. package/dist/mdx/react/common/examples/ResponsiveStyles.tsx +4 -3
  40. package/dist/mdx/react/dialog/examples/Basic.tsx +4 -3
  41. package/dist/mdx/react/dialog/examples/Focus.tsx +4 -3
  42. package/dist/mdx/react/form-field/FormField.mdx +9 -0
  43. package/dist/mdx/react/modal/examples/CustomFocus.tsx +9 -3
  44. package/dist/mdx/react/modal/examples/FormModal.tsx +7 -5
  45. package/dist/mdx/react/modal/examples/ReturnFocus.tsx +6 -4
  46. package/dist/mdx/react/radio/Radio.mdx +19 -8
  47. package/dist/mdx/react/radio/examples/Alert.tsx +6 -10
  48. package/dist/mdx/react/radio/examples/Basic.tsx +5 -4
  49. package/dist/mdx/react/radio/examples/Disabled.tsx +5 -4
  50. package/dist/mdx/react/radio/examples/Error.tsx +6 -10
  51. package/dist/mdx/react/radio/examples/LabelPosition.tsx +5 -8
  52. package/dist/mdx/react/radio/examples/NoValue.tsx +5 -4
  53. package/dist/mdx/react/radio/examples/RefForwarding.tsx +5 -4
  54. package/dist/mdx/react/radio/examples/Required.tsx +5 -4
  55. package/dist/mdx/react/select/Select.mdx +16 -7
  56. package/dist/mdx/react/select/examples/Alert.tsx +5 -7
  57. package/dist/mdx/react/select/examples/Basic.tsx +4 -3
  58. package/dist/mdx/react/select/examples/Complex.tsx +4 -3
  59. package/dist/mdx/react/select/examples/Disabled.tsx +4 -3
  60. package/dist/mdx/react/select/examples/DisabledOption.tsx +4 -3
  61. package/dist/mdx/react/select/examples/Error.tsx +5 -7
  62. package/dist/mdx/react/select/examples/Grow.tsx +4 -3
  63. package/dist/mdx/react/select/examples/HoistedModel.tsx +4 -3
  64. package/dist/mdx/react/select/examples/LabelPosition.tsx +4 -3
  65. package/dist/mdx/react/select/examples/MenuHeight.tsx +4 -3
  66. package/dist/mdx/react/select/examples/RefForwarding.tsx +8 -7
  67. package/dist/mdx/react/select/examples/Required.tsx +7 -6
  68. package/dist/mdx/react/select/examples/WithIcons.tsx +11 -6
  69. package/dist/mdx/react/skeleton/examples/Simulation.tsx +7 -5
  70. package/dist/mdx/react/status-indicator/StatusIndicator.mdx +10 -0
  71. package/dist/mdx/react/switch/Switch.mdx +16 -7
  72. package/dist/mdx/react/table/Table.mdx +7 -0
  73. package/dist/mdx/react/text-area/TextArea.mdx +18 -11
  74. package/dist/mdx/react/text-area/examples/Alert.tsx +5 -8
  75. package/dist/mdx/react/text-area/examples/Basic.tsx +4 -3
  76. package/dist/mdx/react/text-area/examples/Disabled.tsx +4 -3
  77. package/dist/mdx/react/text-area/examples/Error.tsx +5 -8
  78. package/dist/mdx/react/text-area/examples/Grow.tsx +4 -3
  79. package/dist/mdx/react/text-area/examples/LabelPosition.tsx +4 -3
  80. package/dist/mdx/react/text-area/examples/Placeholder.tsx +9 -3
  81. package/dist/mdx/react/text-area/examples/RefForwarding.tsx +4 -3
  82. package/dist/mdx/react/text-area/examples/Required.tsx +4 -3
  83. package/dist/mdx/react/text-area/examples/ResizeConstraints.tsx +9 -3
  84. package/dist/mdx/react/text-input/TextInput.mdx +16 -7
  85. package/package.json +6 -6
@@ -5690,7 +5690,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
5690
5690
  {
5691
5691
  "name": "FormField",
5692
5692
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/form-field/lib/FormField.tsx",
5693
- "description": "Use `FormField` to wrap input components to make them accessible. You can customize the field\nby passing in `TextInput`, `Select`, `RadioGroup` and other form elements to `FormField.Input`.\n\n```tsx\n<FormField>\n <FormField.Label>First Name</FormField.Label>\n <FormField.Input as={TextInput} value={value} onChange={(e) => console.log(e)} />\n </FormField>\n```",
5693
+ "description": "Use `FormField` to wrap input components to make them accessible. You can customize the field\nby passing in `TextInput`, `Select`, `RadioGroup` and other form elements to `FormField.Input` through the `as` prop.\n\n```tsx\n<FormField>\n <FormField.Label>First Name</FormField.Label>\n <FormField.Input as={TextInput} value={value} onChange={(e) => console.log(e)} />\n </FormField>\n```",
5694
5694
  "declarations": [
5695
5695
  {
5696
5696
  "name": "FormField",
@@ -5739,6 +5739,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
5739
5739
  ],
5740
5740
  "tags": {}
5741
5741
  },
5742
+ {
5743
+ "kind": "property",
5744
+ "name": "grow",
5745
+ "required": false,
5746
+ "type": {
5747
+ "kind": "primitive",
5748
+ "value": "boolean"
5749
+ },
5750
+ "description": "True if the component should grow to its container's width. False otherwise.",
5751
+ "declarations": [
5752
+ {
5753
+ "name": "grow",
5754
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/types.ts"
5755
+ }
5756
+ ],
5757
+ "tags": {}
5758
+ },
5742
5759
  {
5743
5760
  "kind": "property",
5744
5761
  "name": "as",
@@ -5846,7 +5863,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
5846
5863
  {
5847
5864
  "name": "Input",
5848
5865
  "symbol": "FormFieldInput",
5849
- "description": "`FormField.Input` will render any `inputs` passed to it including `TextInput`, `Select`, `Switch`, `TextArea`, `RadioGroup` or any custom input.\n`FromField.Input` will be associated with `FormField.Label` and `FormField.Hint` by a generated `id`. You can customize this `id` by passing `id` to `FormField`.\n\n```tsx\n <FormField id='my-unique-id'>\n <FormField.Label>My Label Text</FormField.Label>\n <FormField.Input as={TextInput} onChange={(e) => console.log(e)} />\n <FormField>\n```",
5866
+ "description": "`FormField.Input` will render any `inputs` passed to it via the `as` prop, including `TextInput`, `Select`, `Switch`, `TextArea`, `RadioGroup` or any custom input.\n`FromField.Input` will be associated with `FormField.Label` and `FormField.Hint` by a generated `id`. You can customize this `id` by passing `id` to `FormField`.\n\n**Note: If you pass in a custom input that is *not* as Canvas Kit input, you will have to handle the `error` prop, validation and styling. For a custom approach, reference our Custom storybook example.**\n\n```tsx\n <FormField id='my-unique-id'>\n <FormField.Label>My Label Text</FormField.Label>\n <FormField.Input as={TextInput} onChange={(e) => console.log(e)} />\n <FormField>\n```",
5850
5867
  "declarations": [
5851
5868
  {
5852
5869
  "name": "Input",
@@ -6448,72 +6465,6 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
6448
6465
  ],
6449
6466
  "tags": {}
6450
6467
  },
6451
- {
6452
- "kind": "property",
6453
- "name": "typeLevel",
6454
- "required": false,
6455
- "type": {
6456
- "kind": "union",
6457
- "value": [
6458
- {
6459
- "kind": "string",
6460
- "value": "body.medium"
6461
- },
6462
- {
6463
- "kind": "string",
6464
- "value": "body.large"
6465
- },
6466
- {
6467
- "kind": "string",
6468
- "value": "body.small"
6469
- },
6470
- {
6471
- "kind": "string",
6472
- "value": "title.medium"
6473
- },
6474
- {
6475
- "kind": "string",
6476
- "value": "title.large"
6477
- },
6478
- {
6479
- "kind": "string",
6480
- "value": "title.small"
6481
- },
6482
- {
6483
- "kind": "string",
6484
- "value": "subtext.medium"
6485
- },
6486
- {
6487
- "kind": "string",
6488
- "value": "subtext.large"
6489
- },
6490
- {
6491
- "kind": "string",
6492
- "value": "subtext.small"
6493
- },
6494
- {
6495
- "kind": "string",
6496
- "value": "heading.medium"
6497
- },
6498
- {
6499
- "kind": "string",
6500
- "value": "heading.large"
6501
- },
6502
- {
6503
- "kind": "string",
6504
- "value": "heading.small"
6505
- }
6506
- ]
6507
- },
6508
- "description": "",
6509
- "declarations": [
6510
- {
6511
- "name": "typeLevel",
6512
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/text/lib/LabelText.tsx"
6513
- }
6514
- ],
6515
- "tags": {}
6516
- },
6517
6468
  {
6518
6469
  "kind": "property",
6519
6470
  "name": "disabled",
@@ -6522,11 +6473,11 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
6522
6473
  "kind": "primitive",
6523
6474
  "value": "boolean"
6524
6475
  },
6525
- "description": "Disabled state as a boolean\n\n```tsx\n<LabelText disabled={true}>Error text</LabelText>\n```",
6476
+ "description": "Will style the text as disabled",
6526
6477
  "declarations": [
6527
6478
  {
6528
6479
  "name": "disabled",
6529
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/text/lib/LabelText.tsx"
6480
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/form-field/lib/FormFieldLabel.tsx"
6530
6481
  }
6531
6482
  ],
6532
6483
  "tags": {}
@@ -6552,29 +6503,11 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
6552
6503
  }
6553
6504
  ]
6554
6505
  },
6555
- "description": "Type variant token names: `error`, `hint` or `inverse`.\n\n```tsx\n<LabelText variant=\"error\">Error text</LabelText>\n```",
6506
+ "description": "Changes the color of the text",
6556
6507
  "declarations": [
6557
6508
  {
6558
6509
  "name": "variant",
6559
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/text/lib/LabelText.tsx"
6560
- }
6561
- ],
6562
- "tags": {}
6563
- },
6564
- {
6565
- "kind": "property",
6566
- "name": "cs",
6567
- "required": false,
6568
- "type": {
6569
- "kind": "symbol",
6570
- "name": "CSToPropsInput",
6571
- "value": "CSToPropsInput"
6572
- },
6573
- "description": "The `cs` prop takes in a single value or an array of values. You can pass the CSS class name\nreturned by {@link createStyles}, or the result of {@link createVars} and\n{@link createModifiers}. If you're extending a component already using `cs`, you can merge that\nprop in as well. Any style that is passed to the `cs` prop will override style props. If you\nwish to have styles that are overridden by the `css` prop, or styles added via the `styled`\nAPI, use {@link handleCsProp} wherever `elemProps` is used. If your component needs to also\nhandle style props, use {@link mergeStyles} instead.\n\n\n```tsx\nimport {handleCsProp} from '@workday/canvas-kit-styling';\nimport {mergeStyles} from '@workday/canvas-kit-react/layout';\n\n// ...\n\n// `handleCsProp` handles compat mode with Emotion's runtime APIs. `mergeStyles` has the same\n// function signature, but adds support for style props.\n\nreturn (\n <Element\n {...handleCsProp(elemProps, [\n myStyles,\n myModifiers({ size: 'medium' }),\n myVars({ backgroundColor: 'red' })\n ])}\n >\n {children}\n </Element>\n)\n```",
6574
- "declarations": [
6575
- {
6576
- "name": "cs",
6577
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/dist/es6/lib/cs.d.ts"
6510
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/form-field/lib/FormFieldLabel.tsx"
6578
6511
  }
6579
6512
  ],
6580
6513
  "tags": {}
@@ -6591,8 +6524,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
6591
6524
  "url": "https://developer.mozilla.org/en-US/docs/Web/API/element"
6592
6525
  },
6593
6526
  "defaultValue": {
6594
- "kind": "symbol",
6595
- "name": "LabelText"
6527
+ "kind": "external",
6528
+ "name": "label",
6529
+ "url": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label"
6596
6530
  }
6597
6531
  },
6598
6532
  {
@@ -6611,8 +6545,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
6611
6545
  "name": "R",
6612
6546
  "required": true,
6613
6547
  "defaultValue": {
6614
- "kind": "symbol",
6615
- "name": "LabelText"
6548
+ "kind": "external",
6549
+ "name": "label",
6550
+ "url": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label"
6616
6551
  }
6617
6552
  }
6618
6553
  ]
@@ -6671,12 +6606,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
6671
6606
  }
6672
6607
  ],
6673
6608
  "baseElement": {
6674
- "kind": "symbol",
6675
- "name": "LabelText"
6676
- },
6677
- "styleComponent": {
6678
- "kind": "symbol",
6679
- "name": "Box"
6609
+ "kind": "external",
6610
+ "name": "label",
6611
+ "url": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label"
6680
6612
  },
6681
6613
  "model": "FormFieldModel"
6682
6614
  }
@@ -31531,27 +31463,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
31531
31463
  },
31532
31464
  {
31533
31465
  "kind": "string",
31534
- "value": "subtext.medium"
31466
+ "value": "heading.medium"
31535
31467
  },
31536
31468
  {
31537
31469
  "kind": "string",
31538
- "value": "subtext.large"
31470
+ "value": "heading.large"
31539
31471
  },
31540
31472
  {
31541
31473
  "kind": "string",
31542
- "value": "subtext.small"
31474
+ "value": "heading.small"
31543
31475
  },
31544
31476
  {
31545
31477
  "kind": "string",
31546
- "value": "heading.medium"
31478
+ "value": "subtext.medium"
31547
31479
  },
31548
31480
  {
31549
31481
  "kind": "string",
31550
- "value": "heading.large"
31482
+ "value": "subtext.large"
31551
31483
  },
31552
31484
  {
31553
31485
  "kind": "string",
31554
- "value": "heading.small"
31486
+ "value": "subtext.small"
31555
31487
  }
31556
31488
  ]
31557
31489
  },
@@ -32652,7 +32584,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
32652
32584
  }
32653
32585
  ],
32654
32586
  "tags": {
32655
- "deprecated": "⚠️ `TextAreaProps` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
32587
+ "deprecated": "⚠️ `TextAreaProps` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
32656
32588
  },
32657
32589
  "type": {
32658
32590
  "kind": "alias",
@@ -32670,7 +32602,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
32670
32602
  }
32671
32603
  ],
32672
32604
  "tags": {
32673
- "deprecated": "⚠️ `TextArea` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
32605
+ "deprecated": "⚠️ `TextArea` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
32674
32606
  },
32675
32607
  "type": {
32676
32608
  "kind": "enhancedComponent",
@@ -32713,6 +32645,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
32713
32645
  ],
32714
32646
  "tags": {}
32715
32647
  },
32648
+ {
32649
+ "kind": "property",
32650
+ "name": "grow",
32651
+ "required": false,
32652
+ "type": {
32653
+ "kind": "primitive",
32654
+ "value": "boolean"
32655
+ },
32656
+ "description": "True if the component should grow to its container's width. False otherwise.",
32657
+ "declarations": [
32658
+ {
32659
+ "name": "grow",
32660
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/types.ts"
32661
+ }
32662
+ ],
32663
+ "tags": {}
32664
+ },
32716
32665
  {
32717
32666
  "kind": "property",
32718
32667
  "name": "as",
@@ -32847,7 +32796,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
32847
32796
  }
32848
32797
  ],
32849
32798
  "tags": {
32850
- "deprecated": "⚠️ `TextAreaField` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
32799
+ "deprecated": "⚠️ `TextAreaField` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
32851
32800
  },
32852
32801
  "type": {
32853
32802
  "kind": "enhancedComponent",
@@ -33000,7 +32949,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
33000
32949
  }
33001
32950
  ],
33002
32951
  "tags": {
33003
- "deprecated": "⚠️ `useTextInputField` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
32952
+ "deprecated": "⚠️ `useTextInputField` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
33004
32953
  },
33005
32954
  "type": {
33006
32955
  "kind": "function",
@@ -33077,7 +33026,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
33077
33026
  }
33078
33027
  ],
33079
33028
  "tags": {
33080
- "deprecated": "⚠️ `useTextInputModel` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
33029
+ "deprecated": "⚠️ `useTextInputModel` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
33081
33030
  },
33082
33031
  "type": {
33083
33032
  "kind": "symbol",
@@ -33095,7 +33044,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
33095
33044
  }
33096
33045
  ],
33097
33046
  "tags": {
33098
- "deprecated": "⚠️ `TextInputProps` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
33047
+ "deprecated": "⚠️ `TextInputProps` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
33099
33048
  },
33100
33049
  "type": {
33101
33050
  "kind": "alias",
@@ -33113,7 +33062,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
33113
33062
  }
33114
33063
  ],
33115
33064
  "tags": {
33116
- "deprecated": "⚠️ `TextInput` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
33065
+ "deprecated": "⚠️ `TextInput` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
33117
33066
  },
33118
33067
  "type": {
33119
33068
  "kind": "enhancedComponent",
@@ -33156,6 +33105,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
33156
33105
  ],
33157
33106
  "tags": {}
33158
33107
  },
33108
+ {
33109
+ "kind": "property",
33110
+ "name": "grow",
33111
+ "required": false,
33112
+ "type": {
33113
+ "kind": "primitive",
33114
+ "value": "boolean"
33115
+ },
33116
+ "description": "True if the component should grow to its container's width. False otherwise.",
33117
+ "declarations": [
33118
+ {
33119
+ "name": "grow",
33120
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/types.ts"
33121
+ }
33122
+ ],
33123
+ "tags": {}
33124
+ },
33159
33125
  {
33160
33126
  "kind": "property",
33161
33127
  "name": "as",
@@ -33290,7 +33256,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
33290
33256
  }
33291
33257
  ],
33292
33258
  "tags": {
33293
- "deprecated": "⚠️ `TextInputField` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
33259
+ "deprecated": "⚠️ `TextInputField` in Preview has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
33294
33260
  },
33295
33261
  "type": {
33296
33262
  "kind": "enhancedComponent",
@@ -44266,27 +44232,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
44266
44232
  },
44267
44233
  {
44268
44234
  "kind": "string",
44269
- "value": "subtext.medium"
44235
+ "value": "heading.medium"
44270
44236
  },
44271
44237
  {
44272
44238
  "kind": "string",
44273
- "value": "subtext.large"
44239
+ "value": "heading.large"
44274
44240
  },
44275
44241
  {
44276
44242
  "kind": "string",
44277
- "value": "subtext.small"
44243
+ "value": "heading.small"
44278
44244
  },
44279
44245
  {
44280
44246
  "kind": "string",
44281
- "value": "heading.medium"
44247
+ "value": "subtext.medium"
44282
44248
  },
44283
44249
  {
44284
44250
  "kind": "string",
44285
- "value": "heading.large"
44251
+ "value": "subtext.large"
44286
44252
  },
44287
44253
  {
44288
44254
  "kind": "string",
44289
- "value": "heading.small"
44255
+ "value": "subtext.small"
44290
44256
  }
44291
44257
  ]
44292
44258
  },
@@ -125146,7 +125112,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
125146
125112
  }
125147
125113
  ],
125148
125114
  "tags": {
125149
- "deprecated": "⚠️ `FormFieldProps` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
125115
+ "deprecated": "⚠️ `FormFieldProps` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
125150
125116
  },
125151
125117
  "type": {
125152
125118
  "kind": "alias",
@@ -125199,7 +125165,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
125199
125165
  }
125200
125166
  ],
125201
125167
  "tags": {
125202
- "deprecated": "⚠️ `FormField` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
125168
+ "deprecated": "⚠️ `FormField` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
125203
125169
  },
125204
125170
  "type": {
125205
125171
  "kind": "component",
@@ -125478,7 +125444,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
125478
125444
  }
125479
125445
  ],
125480
125446
  "tags": {
125481
- "deprecated": "⚠️ `HintProps` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
125447
+ "deprecated": "⚠️ `HintProps` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
125482
125448
  },
125483
125449
  "type": {
125484
125450
  "kind": "object",
@@ -125571,7 +125537,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
125571
125537
  }
125572
125538
  ],
125573
125539
  "tags": {
125574
- "deprecated": "⚠️ `LabelProps` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
125540
+ "deprecated": "⚠️ `LabelProps` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
125575
125541
  },
125576
125542
  "type": {
125577
125543
  "kind": "object",
@@ -125703,7 +125669,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
125703
125669
  }
125704
125670
  ],
125705
125671
  "tags": {
125706
- "deprecated": "⚠️ `FormFieldLabelPosition` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
125672
+ "deprecated": "⚠️ `FormFieldLabelPosition` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
125707
125673
  },
125708
125674
  "type": {
125709
125675
  "kind": "object",
@@ -125748,7 +125714,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
125748
125714
  }
125749
125715
  ],
125750
125716
  "tags": {
125751
- "deprecated": "⚠️ `FormFieldLabelPositionBehavior` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--custom) instead."
125717
+ "deprecated": "⚠️ `FormFieldLabelPositionBehavior` in Main has been deprecated and will be removed in a future major version. Please use [`FormField` in Preview](https://workday.github.io/canvas-kit/?path=/story/preview-inputs-form-field--basic) instead."
125752
125718
  },
125753
125719
  "type": {
125754
125720
  "kind": "object",
@@ -224206,27 +224172,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
224206
224172
  },
224207
224173
  {
224208
224174
  "kind": "string",
224209
- "value": "subtext.medium"
224175
+ "value": "heading.medium"
224210
224176
  },
224211
224177
  {
224212
224178
  "kind": "string",
224213
- "value": "subtext.large"
224179
+ "value": "heading.large"
224214
224180
  },
224215
224181
  {
224216
224182
  "kind": "string",
224217
- "value": "subtext.small"
224183
+ "value": "heading.small"
224218
224184
  },
224219
224185
  {
224220
224186
  "kind": "string",
224221
- "value": "heading.medium"
224187
+ "value": "subtext.medium"
224222
224188
  },
224223
224189
  {
224224
224190
  "kind": "string",
224225
- "value": "heading.large"
224191
+ "value": "subtext.large"
224226
224192
  },
224227
224193
  {
224228
224194
  "kind": "string",
224229
- "value": "heading.small"
224195
+ "value": "subtext.small"
224230
224196
  }
224231
224197
  ]
224232
224198
  },
@@ -228813,27 +228779,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
228813
228779
  },
228814
228780
  {
228815
228781
  "kind": "string",
228816
- "value": "subtext.medium"
228782
+ "value": "heading.medium"
228817
228783
  },
228818
228784
  {
228819
228785
  "kind": "string",
228820
- "value": "subtext.large"
228786
+ "value": "heading.large"
228821
228787
  },
228822
228788
  {
228823
228789
  "kind": "string",
228824
- "value": "subtext.small"
228790
+ "value": "heading.small"
228825
228791
  },
228826
228792
  {
228827
228793
  "kind": "string",
228828
- "value": "heading.medium"
228794
+ "value": "subtext.medium"
228829
228795
  },
228830
228796
  {
228831
228797
  "kind": "string",
228832
- "value": "heading.large"
228798
+ "value": "subtext.large"
228833
228799
  },
228834
228800
  {
228835
228801
  "kind": "string",
228836
- "value": "heading.small"
228802
+ "value": "subtext.small"
228837
228803
  }
228838
228804
  ]
228839
228805
  },
@@ -229047,27 +229013,27 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
229047
229013
  },
229048
229014
  {
229049
229015
  "kind": "string",
229050
- "value": "subtext.medium"
229016
+ "value": "heading.medium"
229051
229017
  },
229052
229018
  {
229053
229019
  "kind": "string",
229054
- "value": "subtext.large"
229020
+ "value": "heading.large"
229055
229021
  },
229056
229022
  {
229057
229023
  "kind": "string",
229058
- "value": "subtext.small"
229024
+ "value": "heading.small"
229059
229025
  },
229060
229026
  {
229061
229027
  "kind": "string",
229062
- "value": "heading.medium"
229028
+ "value": "subtext.medium"
229063
229029
  },
229064
229030
  {
229065
229031
  "kind": "string",
229066
- "value": "heading.large"
229032
+ "value": "subtext.large"
229067
229033
  },
229068
229034
  {
229069
229035
  "kind": "string",
229070
- "value": "heading.small"
229036
+ "value": "subtext.small"
229071
229037
  }
229072
229038
  ]
229073
229039
  },
@@ -14,6 +14,8 @@ import CustomId from './examples/CustomId';
14
14
  import AllFields from './examples/AllFields';
15
15
  import Hint from './examples/Hint';
16
16
  import FieldSet from './examples/FieldSet';
17
+ import Grow from './examples/Grow';
18
+ import ThemedError from './examples/ThemedErrors';
17
19
 
18
20
 
19
21
  # Canvas Kit Form Field
@@ -75,6 +77,15 @@ input component. By default, the orientation will be set to `vertical`.
75
77
 
76
78
  <ExampleCodeBlock code={LabelPositionHorizontal} />
77
79
 
80
+ ### Grow
81
+
82
+ Set the `grow` prop of the Form Field to `true` to configure it (including the wrapped input
83
+ component) to expand to the width of its container.
84
+
85
+ **Note: This Prop is deprecated and will be removed in a future major version.**
86
+
87
+ <ExampleCodeBlock code={Grow} />
88
+
78
89
  ### Ref Forwarding
79
90
 
80
91
  If you need full customization you can use the `FormField` behavior hooks to build your own
@@ -120,6 +131,13 @@ Form Field should allow you to use it with all `inputs` including `Select`, `Tex
120
131
 
121
132
  <ExampleCodeBlock code={AllFields} />
122
133
 
134
+ ### Themed Errors
135
+
136
+ You can theme your error rings by wrapping an input in a `CanvasProvider` and defining
137
+ `focusOutline` and `error` properties on the `theme`.
138
+
139
+ <ExampleCodeBlock code={ThemedError} />
140
+
123
141
  ## Component API
124
142
 
125
143
  <SymbolDoc name="FormField" fileName="/preview-react/" />
@@ -18,26 +18,26 @@ export default () => {
18
18
  borderRadius: '4px',
19
19
  }}
20
20
  >
21
- <FormField>
21
+ <FormField grow>
22
22
  <FormField.Label>First Name</FormField.Label>
23
- <FormField.Input width="100%" as={TextInput} />
23
+ <FormField.Input as={TextInput} />
24
24
  </FormField>
25
25
 
26
- <FormField isRequired={true} error="alert">
26
+ <FormField isRequired={true} error="alert" grow>
27
27
  <FormField.Label>Email</FormField.Label>
28
- <FormField.Container cs={{width: '100%'}}>
29
- <FormField.Input width="100%" as={TextInput} />
28
+ <FormField.Container>
29
+ <FormField.Input as={TextInput} />
30
30
  <FormField.Hint>Hint text for your input</FormField.Hint>
31
31
  </FormField.Container>
32
32
  </FormField>
33
- <FormField>
33
+ <FormField grow>
34
34
  <FormField.Label>Text Area Label</FormField.Label>
35
- <FormField.Input width="100%" as={TextArea} />
35
+ <FormField.Input as={TextArea} />
36
36
  </FormField>
37
- <FormField error="error" width="100%">
37
+ <FormField error="error" grow>
38
38
  <FormField.Label>Choose a Crust</FormField.Label>
39
39
  <Select items={['Pizza', 'Cheeseburger', 'Fries']}>
40
- <FormField.Input width="100%" as={Select.Input} />
40
+ <FormField.Input as={Select.Input} />
41
41
  <Select.Popper>
42
42
  <Select.Card>
43
43
  <Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
@@ -45,7 +45,7 @@ export default () => {
45
45
  </Select.Popper>
46
46
  </Select>
47
47
  </FormField>
48
- <FormField as="fieldset" isRequired={true} error={'error'} orientation="horizontal">
48
+ <FormField as="fieldset" isRequired={true} error={'error'} orientation="horizontal" grow>
49
49
  <FormField.Label as="legend">Radio Group Legend</FormField.Label>
50
50
  <FormField.Container>
51
51
  <FormField.Input as={RadioGroup}>
@@ -60,14 +60,14 @@ export default () => {
60
60
  <FormField.Hint>Error Message</FormField.Hint>
61
61
  </FormField.Container>
62
62
  </FormField>
63
- <FormField as="fieldset">
63
+ <FormField as="fieldset" grow>
64
64
  <FormField.Label as="legend">Checkbox Legend</FormField.Label>
65
65
  <FormField.Input checked={true} as={Checkbox} label="Checkbox Label" />
66
66
  <FormField.Input checked={false} as={Checkbox} label="Thin Crust" />
67
67
  <FormField.Input checked={false} as={Checkbox} label="Extra Cheese" />
68
68
  </FormField>
69
69
 
70
- <FormField orientation="horizontal">
70
+ <FormField orientation="horizontal" grow>
71
71
  <FormField.Label>Switch Label</FormField.Label>
72
72
  <FormField.Input as={Switch} />
73
73
  </FormField>