@kaizen/components 1.48.0 → 1.49.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 (69) hide show
  1. package/dist/cjs/DateInput/DateInput/DateInput.cjs +1 -0
  2. package/dist/cjs/DatePicker/DatePicker.cjs +7 -3
  3. package/dist/cjs/DateRangePicker/DateRangePicker.cjs +7 -2
  4. package/dist/cjs/RichTextEditor/EditableRichTextContent/EditableRichTextContent.cjs +1 -0
  5. package/dist/cjs/RichTextEditor/EditableRichTextContent/EditableRichTextContent.module.scss.cjs +1 -0
  6. package/dist/cjs/RichTextEditor/RichTextEditor/RichTextEditor.cjs +1 -0
  7. package/dist/cjs/RichTextEditor/RichTextEditor/RichTextEditor.module.scss.cjs +1 -0
  8. package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.cjs +5 -1
  9. package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.module.scss.cjs +6 -0
  10. package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/validation.cjs +8 -1
  11. package/dist/cjs/Select/Select.cjs +6 -2
  12. package/dist/cjs/__future__/Select/Select.cjs +12 -11
  13. package/dist/esm/DateInput/DateInput/DateInput.mjs +1 -0
  14. package/dist/esm/DatePicker/DatePicker.mjs +7 -3
  15. package/dist/esm/DateRangePicker/DateRangePicker.mjs +7 -2
  16. package/dist/esm/RichTextEditor/EditableRichTextContent/EditableRichTextContent.mjs +3 -2
  17. package/dist/esm/RichTextEditor/EditableRichTextContent/EditableRichTextContent.module.scss.mjs +1 -0
  18. package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.mjs +3 -2
  19. package/dist/esm/RichTextEditor/RichTextEditor/RichTextEditor.module.scss.mjs +1 -0
  20. package/dist/esm/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.mjs +5 -1
  21. package/dist/esm/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.module.scss.mjs +4 -0
  22. package/dist/esm/RichTextEditor/utils/plugins/LinkManager/validation.mjs +2 -1
  23. package/dist/esm/Select/Select.mjs +6 -2
  24. package/dist/esm/__future__/Select/Select.mjs +12 -11
  25. package/dist/styles.css +9 -8
  26. package/dist/types/Input/Input/Input.d.ts +5 -0
  27. package/dist/types/RichTextEditor/utils/plugins/LinkManager/validation.d.ts +1 -0
  28. package/dist/types/Select/Select.d.ts +10 -0
  29. package/dist/types/TextArea/TextArea.d.ts +5 -0
  30. package/dist/types/__future__/Select/Select.d.ts +5 -0
  31. package/dist/types/__future__/Select/subcomponents/SelectToggle/SelectToggle.d.ts +8 -0
  32. package/package.json +8 -8
  33. package/src/DateInput/DateInput/DateInput.tsx +1 -0
  34. package/src/DatePicker/DatePicker.spec.tsx +14 -14
  35. package/src/DatePicker/DatePicker.tsx +20 -11
  36. package/src/DateRangePicker/DateRangePicker.tsx +14 -2
  37. package/src/DateRangePicker/_docs/DateRangePicker.mdx +5 -1
  38. package/src/DateRangePicker/_docs/DateRangePicker.stories.tsx +99 -3
  39. package/src/FieldGroup/_docs/FieldGroup.stickersheet.stories.tsx +2 -12
  40. package/src/FieldGroup/_docs/FieldGroup.stories.tsx +4 -9
  41. package/src/Input/Input/Input.tsx +5 -0
  42. package/src/Input/InputSearch/InputSearch.spec.tsx +10 -7
  43. package/src/Notification/ToastNotification/ToastNotificationsList/ToastNotificationsList.module.scss +1 -1
  44. package/src/RichTextEditor/EditableRichTextContent/EditableRichTextContent.module.scss +25 -7
  45. package/src/RichTextEditor/EditableRichTextContent/EditableRichTextContent.tsx +3 -1
  46. package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.mdx +6 -4
  47. package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.stickersheet.stories.tsx +98 -0
  48. package/src/RichTextEditor/EditableRichTextContent/_docs/EditableRichTextContent.stories.tsx +8 -5
  49. package/src/RichTextEditor/EditableRichTextContent/_docs/defaultContent.json +11 -0
  50. package/src/RichTextEditor/EditableRichTextContent/_docs/dummyContent.json +44 -39
  51. package/src/RichTextEditor/RichTextContent/_docs/RichTextContent.mdx +11 -1
  52. package/src/RichTextEditor/RichTextContent/_docs/RichTextContent.stories.tsx +47 -2
  53. package/src/RichTextEditor/RichTextEditor/RichTextEditor.module.scss +6 -1
  54. package/src/RichTextEditor/RichTextEditor/RichTextEditor.spec.stories.tsx +48 -0
  55. package/src/RichTextEditor/RichTextEditor/RichTextEditor.tsx +7 -2
  56. package/src/RichTextEditor/RichTextEditor/_docs/RichTextEditor.mdx +66 -7
  57. package/src/RichTextEditor/RichTextEditor/_docs/RichTextEditor.stories.tsx +60 -7
  58. package/src/RichTextEditor/_mixins.scss +1 -0
  59. package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.module.scss +5 -0
  60. package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.spec.stories.tsx +37 -0
  61. package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.stories.tsx +33 -0
  62. package/src/RichTextEditor/utils/plugins/LinkManager/components/LinkModal/LinkModal.tsx +9 -1
  63. package/src/RichTextEditor/utils/plugins/LinkManager/{validation.ts → validation.tsx} +11 -1
  64. package/src/Select/Select.tsx +9 -1
  65. package/src/Select/_docs/Select.stories.tsx +0 -3
  66. package/src/TextArea/TextArea.tsx +5 -0
  67. package/src/__future__/Select/Select.tsx +6 -1
  68. package/src/__future__/Select/_docs/Select.stickersheet.stories.tsx +0 -9
  69. package/src/__future__/Select/subcomponents/SelectToggle/SelectToggle.tsx +4 -0
@@ -1,3 +1,5 @@
1
+ import React from "react"
2
+
1
3
  export type ValidationResponse = {
2
4
  status: "success" | "error" | "default"
3
5
  message?: React.ReactNode
@@ -9,7 +11,15 @@ export const validateLink = (href: string): ValidationResponse => {
9
11
  if (!isValidLink) {
10
12
  return {
11
13
  status: "error",
12
- message: "Please enter a valid URL",
14
+ message: (
15
+ <>
16
+ Empty or invalid link. Links must start with http or https, e.g:
17
+ <ul>
18
+ <li>https://google.com</li>
19
+ <li>http://www.google.com</li>
20
+ </ul>
21
+ </>
22
+ ),
13
23
  }
14
24
  }
15
25
 
@@ -35,6 +35,11 @@ export type SelectProps = {
35
35
  * @default false
36
36
  */
37
37
  fullWidth?: boolean
38
+ /**
39
+ * @deprecated Use of placeholder text goes against our a11y standards.
40
+ * Use the `labelText` prop to provide a concise name, and the `description` prop for any help text.
41
+ */
42
+ placeholder?: string
38
43
  } & ReactSelectProps<any, boolean>
39
44
 
40
45
  /**
@@ -53,6 +58,7 @@ export const Select = React.forwardRef<any, SelectProps>(
53
58
  fullWidth: propsFullWidth,
54
59
  className: propsClassName,
55
60
  isDisabled,
61
+ placeholder,
56
62
  ...props
57
63
  },
58
64
  ref
@@ -92,6 +98,7 @@ export const Select = React.forwardRef<any, SelectProps>(
92
98
  {...props}
93
99
  ref={ref}
94
100
  aria-labelledby={labelId}
101
+ placeholder={placeholder || ""}
95
102
  components={{
96
103
  Control,
97
104
  Placeholder,
@@ -126,12 +133,13 @@ interface AsyncProps
126
133
 
127
134
  export const AsyncSelect = React.forwardRef(
128
135
  (
129
- { className: propsClassName, ...props }: AsyncProps,
136
+ { className: propsClassName, placeholder, ...props }: AsyncProps,
130
137
  ref: React.Ref<any>
131
138
  ) => (
132
139
  <Async
133
140
  {...props}
134
141
  ref={ref}
142
+ placeholder={placeholder || ""}
135
143
  components={{
136
144
  Control,
137
145
  Placeholder,
@@ -96,7 +96,4 @@ export const Async: Story = {
96
96
  </>
97
97
  )
98
98
  },
99
- args: {
100
- placeholder: "Placeholder",
101
- },
102
99
  }
@@ -13,6 +13,11 @@ export type TextAreaProps = {
13
13
  status?: "default" | "error" | "caution"
14
14
  autogrow?: boolean
15
15
  reversed?: boolean
16
+ /**
17
+ * @deprecated Use of placeholder text goes against our a11y standards.
18
+ * Use the `labelText` prop to provide a concise name, and the `description` prop for any help text.
19
+ */
20
+ placeholder?: string
16
21
  } & OverrideClassName<TextareaHTMLAttributes<HTMLTextAreaElement>>
17
22
 
18
23
  export const TextArea = ({
@@ -71,6 +71,11 @@ export type SelectProps<Option extends SelectOption = SelectOption> = {
71
71
  * Creates a portal for the Popover to the matching element id
72
72
  */
73
73
  portalContainerId?: string
74
+ /**
75
+ * @deprecated Use of placeholder text goes against our a11y standards.
76
+ * Use the `labelText` prop to provide a concise name, and the `description` prop for any help text.
77
+ */
78
+ placeholder?: string
74
79
  } & OverrideClassName<Omit<AriaSelectProps<Option>, OmittedAriaSelectProps>>
75
80
 
76
81
  /**
@@ -91,7 +96,7 @@ export const Select = <Option extends SelectOption = SelectOption>({
91
96
  classNameOverride,
92
97
  selectedKey,
93
98
  description,
94
- placeholder,
99
+ placeholder = "",
95
100
  isDisabled,
96
101
  portalContainerId,
97
102
  ...restProps
@@ -35,7 +35,6 @@ const StickerSheetTemplate: StickerSheetStory = {
35
35
  <Select
36
36
  label="Label"
37
37
  items={singleMockItems}
38
- placeholder="Placeholder"
39
38
  isReversed={isReversed}
40
39
  />
41
40
  </StickerSheet.Cell>
@@ -69,28 +68,24 @@ const StickerSheetTemplate: StickerSheetStory = {
69
68
  <Select
70
69
  label="Label"
71
70
  items={singleMockItems}
72
- placeholder="Placeholder"
73
71
  isReversed={isReversed}
74
72
  data-sb-pseudo-styles="hover"
75
73
  />
76
74
  <Select
77
75
  label="Label"
78
76
  items={singleMockItems}
79
- placeholder="Placeholder"
80
77
  isReversed={isReversed}
81
78
  data-sb-pseudo-styles="active"
82
79
  />
83
80
  <Select
84
81
  label="Label"
85
82
  items={singleMockItems}
86
- placeholder="Placeholder"
87
83
  isReversed={isReversed}
88
84
  data-sb-pseudo-styles="focus"
89
85
  />
90
86
  <Select
91
87
  label="Label"
92
88
  items={singleMockItems}
93
- placeholder="Placeholder"
94
89
  isDisabled
95
90
  isReversed={isReversed}
96
91
  />
@@ -104,7 +99,6 @@ const StickerSheetTemplate: StickerSheetStory = {
104
99
  <Select
105
100
  label="Full width"
106
101
  items={singleMockItems}
107
- placeholder="Placeholder"
108
102
  isFullWidth
109
103
  isReversed={isReversed}
110
104
  />
@@ -115,7 +109,6 @@ const StickerSheetTemplate: StickerSheetStory = {
115
109
  label="Custom Width (50%)"
116
110
  items={singleMockItems}
117
111
  isFullWidth
118
- placeholder="Placeholder"
119
112
  isReversed={isReversed}
120
113
  />
121
114
  </div>
@@ -129,7 +122,6 @@ const StickerSheetTemplate: StickerSheetStory = {
129
122
  <Select
130
123
  label="Error"
131
124
  items={singleMockItems}
132
- placeholder="Placeholder"
133
125
  description="This is a description"
134
126
  status="error"
135
127
  validationMessage="This is an error"
@@ -138,7 +130,6 @@ const StickerSheetTemplate: StickerSheetStory = {
138
130
  <Select
139
131
  label="Caution"
140
132
  items={singleMockItems}
141
- placeholder="Placeholder"
142
133
  description="This is a description"
143
134
  status="caution"
144
135
  validationMessage="This is an error"
@@ -13,6 +13,10 @@ export type SelectToggleProps = {
13
13
  /** Props for the element representing the selected value. */
14
14
  valueProps: DOMAttributes<FocusableElement>
15
15
  isOpen?: boolean
16
+ /**
17
+ * @deprecated Use of placeholder text goes against our a11y standards.
18
+ * Use the `labelText` prop to provide a concise name, and the `description` prop for any help text.
19
+ */
16
20
  placeholder?: string
17
21
  /** Updates the styling of the validation. */
18
22
  status?: "error" | "caution"