@kaizen/components 1.26.0 → 1.27.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 (83) hide show
  1. package/dist/cjs/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.cjs +2 -2
  2. package/dist/cjs/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.cjs.map +1 -1
  3. package/dist/cjs/FilterMultiSelect/context/SelectionProvider/SelectionProvider.cjs +2 -2
  4. package/dist/cjs/FilterMultiSelect/context/SelectionProvider/SelectionProvider.cjs.map +1 -1
  5. package/dist/cjs/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.cjs +2 -2
  6. package/dist/cjs/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.cjs.map +1 -1
  7. package/dist/cjs/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.cjs +2 -2
  8. package/dist/cjs/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.cjs.map +1 -1
  9. package/dist/cjs/FilterMultiSelect/subcomponents/SelectionControlButton/ClearButton/ClearButton.cjs +2 -2
  10. package/dist/cjs/FilterMultiSelect/subcomponents/SelectionControlButton/ClearButton/ClearButton.cjs.map +1 -1
  11. package/dist/cjs/Input/InputRange/InputRange.cjs +2 -2
  12. package/dist/cjs/Input/InputRange/InputRange.cjs.map +1 -1
  13. package/dist/cjs/TextArea/TextArea.cjs +85 -0
  14. package/dist/cjs/TextArea/TextArea.cjs.map +1 -0
  15. package/dist/cjs/TextArea/TextArea.module.scss.cjs +14 -0
  16. package/dist/cjs/TextArea/TextArea.module.scss.cjs.map +1 -0
  17. package/dist/cjs/TextAreaField/TextAreaField.cjs +85 -0
  18. package/dist/cjs/TextAreaField/TextAreaField.cjs.map +1 -0
  19. package/dist/cjs/TextAreaField/TextAreaField.module.scss.cjs +10 -0
  20. package/dist/cjs/TextAreaField/TextAreaField.module.scss.cjs.map +1 -0
  21. package/dist/cjs/TextField/TextField.cjs +84 -0
  22. package/dist/cjs/TextField/TextField.cjs.map +1 -0
  23. package/dist/cjs/TextField/TextField.module.scss.cjs +14 -0
  24. package/dist/cjs/TextField/TextField.module.scss.cjs.map +1 -0
  25. package/dist/cjs/VisuallyHidden/VisuallyHidden.cjs +20 -0
  26. package/dist/cjs/VisuallyHidden/VisuallyHidden.cjs.map +1 -0
  27. package/dist/cjs/VisuallyHidden/VisuallyHidden.module.scss.cjs +7 -0
  28. package/dist/cjs/VisuallyHidden/VisuallyHidden.module.scss.cjs.map +1 -0
  29. package/dist/cjs/dts/TextArea/TextArea.d.ts +12 -0
  30. package/dist/cjs/dts/TextArea/index.d.ts +1 -0
  31. package/dist/cjs/dts/TextAreaField/TextAreaField.d.ts +17 -0
  32. package/dist/cjs/dts/TextAreaField/index.d.ts +1 -0
  33. package/dist/cjs/dts/TextField/TextField.d.ts +28 -0
  34. package/dist/cjs/dts/TextField/index.d.ts +1 -0
  35. package/dist/cjs/dts/VisuallyHidden/VisuallyHidden.d.ts +9 -0
  36. package/dist/cjs/dts/VisuallyHidden/index.d.ts +1 -0
  37. package/dist/cjs/dts/index.d.ts +3 -0
  38. package/dist/cjs/index.cjs +6 -0
  39. package/dist/cjs/index.cjs.map +1 -1
  40. package/dist/cjs/index.css +6 -2
  41. package/dist/esm/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.mjs +1 -1
  42. package/dist/esm/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.mjs.map +1 -1
  43. package/dist/esm/FilterMultiSelect/context/SelectionProvider/SelectionProvider.mjs +1 -1
  44. package/dist/esm/FilterMultiSelect/context/SelectionProvider/SelectionProvider.mjs.map +1 -1
  45. package/dist/esm/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.mjs +1 -1
  46. package/dist/esm/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.mjs.map +1 -1
  47. package/dist/esm/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.mjs +1 -1
  48. package/dist/esm/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.mjs.map +1 -1
  49. package/dist/esm/FilterMultiSelect/subcomponents/SelectionControlButton/ClearButton/ClearButton.mjs +1 -1
  50. package/dist/esm/FilterMultiSelect/subcomponents/SelectionControlButton/ClearButton/ClearButton.mjs.map +1 -1
  51. package/dist/esm/Input/InputRange/InputRange.mjs +1 -1
  52. package/dist/esm/Input/InputRange/InputRange.mjs.map +1 -1
  53. package/dist/esm/TextArea/TextArea.mjs +83 -0
  54. package/dist/esm/TextArea/TextArea.mjs.map +1 -0
  55. package/dist/esm/TextArea/TextArea.module.scss.mjs +12 -0
  56. package/dist/esm/TextArea/TextArea.module.scss.mjs.map +1 -0
  57. package/dist/esm/TextAreaField/TextAreaField.mjs +83 -0
  58. package/dist/esm/TextAreaField/TextAreaField.mjs.map +1 -0
  59. package/dist/esm/TextAreaField/TextAreaField.module.scss.mjs +8 -0
  60. package/dist/esm/TextAreaField/TextAreaField.module.scss.mjs.map +1 -0
  61. package/dist/esm/TextField/TextField.mjs +82 -0
  62. package/dist/esm/TextField/TextField.mjs.map +1 -0
  63. package/dist/esm/TextField/TextField.module.scss.mjs +12 -0
  64. package/dist/esm/TextField/TextField.module.scss.mjs.map +1 -0
  65. package/dist/esm/VisuallyHidden/VisuallyHidden.mjs +18 -0
  66. package/dist/esm/VisuallyHidden/VisuallyHidden.mjs.map +1 -0
  67. package/dist/esm/VisuallyHidden/VisuallyHidden.module.scss.mjs +5 -0
  68. package/dist/esm/VisuallyHidden/VisuallyHidden.module.scss.mjs.map +1 -0
  69. package/dist/esm/dts/TextArea/TextArea.d.ts +12 -0
  70. package/dist/esm/dts/TextArea/index.d.ts +1 -0
  71. package/dist/esm/dts/TextAreaField/TextAreaField.d.ts +17 -0
  72. package/dist/esm/dts/TextAreaField/index.d.ts +1 -0
  73. package/dist/esm/dts/TextField/TextField.d.ts +28 -0
  74. package/dist/esm/dts/TextField/index.d.ts +1 -0
  75. package/dist/esm/dts/VisuallyHidden/VisuallyHidden.d.ts +9 -0
  76. package/dist/esm/dts/VisuallyHidden/index.d.ts +1 -0
  77. package/dist/esm/dts/index.d.ts +3 -0
  78. package/dist/esm/index.css +7 -3
  79. package/dist/esm/index.mjs +3 -0
  80. package/dist/esm/index.mjs.map +1 -1
  81. package/dist/index.d.ts +55 -2
  82. package/dist/styles.css +1 -1
  83. package/package.json +5 -4
@@ -0,0 +1,84 @@
1
+ 'use strict';
2
+
3
+ var tslib = require('tslib');
4
+ var React = require('react');
5
+ var classnames = require('classnames');
6
+ var FieldGroup = require('../FieldGroup/FieldGroup.cjs');
7
+ var FieldMessage = require('../FieldMessage/FieldMessage.cjs');
8
+ var Input = require('../Input/Input/Input.cjs');
9
+ require('../Input/InputRange/InputRange.cjs');
10
+ require('../Input/InputSearch/InputSearch.cjs');
11
+ var Label = require('../Label/Label.cjs');
12
+ var TextField_module = require('./TextField.module.scss.cjs');
13
+ var SuccessIcon = require('../Icon/SuccessIcon.cjs');
14
+
15
+ /**
16
+ * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081928705/Text+Field Guidance} |
17
+ * {@link https://cultureamp.design/?path=/docs/components-text-field--docs Storybook}
18
+ */
19
+ const TextField = /*#__PURE__*/function () {
20
+ const TextField = function (_a) {
21
+ var propsId = _a.id,
22
+ labelText = _a.labelText,
23
+ _b = _a.inline,
24
+ inline = _b === void 0 ? false : _b,
25
+ icon = _a.icon,
26
+ validationMessage = _a.validationMessage,
27
+ description = _a.description,
28
+ status = _a.status,
29
+ _c = _a.reversed,
30
+ reversed = _c === void 0 ? false : _c,
31
+ disabled = _a.disabled,
32
+ restProps = tslib.__rest(_a, ["id", "labelText", "inline", "icon", "validationMessage", "description", "status", "reversed", "disabled"]);
33
+ var id = propsId !== null && propsId !== void 0 ? propsId : React.useId();
34
+ var validationMessageAria = validationMessage ? "".concat(id, "-field-validation-message") : "";
35
+ var descriptionAria = description ? "".concat(id, "-field-description") : "";
36
+ var ariaDescribedBy = [validationMessageAria, descriptionAria].reduce(function (prev, curr) {
37
+ return curr ? [curr, prev].join(" ") : prev;
38
+ }, "");
39
+ return React.createElement(FieldGroup.FieldGroup, {
40
+ id: "".concat(id, "-field-group"),
41
+ "data-testid": "".concat(id, "-field-group"),
42
+ inline: inline,
43
+ classNameOverride: classnames(TextField_module.withLabel, disabled && TextField_module.withDisabled)
44
+ }, React.createElement(Label.Label, {
45
+ id: "".concat(id, "-field-label"),
46
+ "data-testid": "".concat(id, "-field-label"),
47
+ htmlFor: "".concat(id, "-field-input"),
48
+ labelText: labelText,
49
+ reversed: reversed,
50
+ disabled: disabled
51
+ }), React.createElement(Input.Input, tslib.__assign({
52
+ id: "".concat(id, "-field-input"),
53
+ "data-testid": "".concat(id, "-field-input"),
54
+ "aria-describedby": ariaDescribedBy,
55
+ classNameOverride: TextField_module.input,
56
+ disabled: disabled,
57
+ reversed: reversed,
58
+ status: status,
59
+ startIconAdornment: icon,
60
+ endIconAdornment: status === "success" && React.createElement("div", {
61
+ className: classnames(TextField_module.success, disabled && TextField_module.disabled)
62
+ }, React.createElement(SuccessIcon.SuccessIcon, {
63
+ role: "presentation"
64
+ }))
65
+ }, restProps)), validationMessage && React.createElement("div", {
66
+ className: classnames(TextField_module.message, disabled && TextField_module.disabled)
67
+ }, React.createElement(FieldMessage.FieldMessage, {
68
+ id: validationMessageAria,
69
+ message: validationMessage,
70
+ status: status,
71
+ reversed: reversed
72
+ })), description && React.createElement("div", {
73
+ className: classnames(TextField_module.message, disabled && TextField_module.disabled)
74
+ }, React.createElement(FieldMessage.FieldMessage, {
75
+ id: descriptionAria,
76
+ message: description,
77
+ reversed: reversed
78
+ })));
79
+ };
80
+ TextField.displayName = "TextField";
81
+ return TextField;
82
+ }();
83
+ exports.TextField = TextField;
84
+ //# sourceMappingURL=TextField.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.cjs","sources":["../../../src/TextField/TextField.tsx"],"sourcesContent":["import React, { useId } from \"react\"\nimport classnames from \"classnames\"\nimport { FieldGroup } from \"~components/FieldGroup\"\nimport { FieldMessage } from \"~components/FieldMessage\"\nimport { Input, InputProps } from \"~components/Input\"\nimport { Label } from \"~components/Label\"\nimport { SuccessIcon } from \"..\"\nimport styles from \"./TextField.module.scss\"\n\ntype OmittedInputProps =\n | \"startIconAdornment\"\n | \"endIconAdornment\"\n | \"ariaDescribedBy\"\n | \"ariaLabel\"\n\nexport interface TextFieldProps extends Omit<InputProps, OmittedInputProps> {\n /**\n * A short example of input text. For context or additional information use the `description` prop\n */\n labelText: React.ReactNode\n inline?: boolean\n icon?: JSX.Element\n /**\n * A descriptive message for `error` or `caution` states\n */\n validationMessage?: string | React.ReactNode\n /**\n * A description that provides context for the text field\n */\n description?: string | React.ReactNode\n}\n\n/**\n * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081928705/Text+Field Guidance} |\n * {@link https://cultureamp.design/?path=/docs/components-text-field--docs Storybook}\n */\nexport const TextField = ({\n id: propsId,\n labelText,\n inline = false,\n icon,\n validationMessage,\n description,\n status,\n reversed = false,\n disabled,\n ...restProps\n}: TextFieldProps): JSX.Element => {\n const id = propsId ?? useId()\n const validationMessageAria = validationMessage\n ? `${id}-field-validation-message`\n : \"\"\n const descriptionAria = description ? `${id}-field-description` : \"\"\n\n const ariaDescribedBy = [validationMessageAria, descriptionAria].reduce(\n (prev, curr) => (curr ? [curr, prev].join(\" \") : prev),\n \"\"\n )\n\n return (\n <FieldGroup\n id={`${id}-field-group`}\n data-testid={`${id}-field-group`}\n inline={inline}\n classNameOverride={classnames(\n styles.withLabel,\n disabled && styles.withDisabled\n )}\n >\n <Label\n id={`${id}-field-label`}\n data-testid={`${id}-field-label`}\n htmlFor={`${id}-field-input`}\n labelText={labelText}\n reversed={reversed}\n disabled={disabled}\n />\n <Input\n id={`${id}-field-input`}\n data-testid={`${id}-field-input`}\n aria-describedby={ariaDescribedBy}\n classNameOverride={styles.input}\n disabled={disabled}\n reversed={reversed}\n status={status}\n startIconAdornment={icon}\n endIconAdornment={\n status === \"success\" && (\n <div\n className={classnames(\n styles.success,\n disabled && styles.disabled\n )}\n >\n <SuccessIcon role=\"presentation\" />\n </div>\n )\n }\n {...restProps}\n />\n\n {validationMessage && (\n <div\n className={classnames(styles.message, disabled && styles.disabled)}\n >\n <FieldMessage\n id={validationMessageAria}\n message={validationMessage}\n status={status}\n reversed={reversed}\n />\n </div>\n )}\n\n {description && (\n <div\n className={classnames(styles.message, disabled && styles.disabled)}\n >\n <FieldMessage\n id={descriptionAria}\n message={description}\n reversed={reversed}\n />\n </div>\n )}\n </FieldGroup>\n )\n}\n\nTextField.displayName = \"TextField\"\n"],"names":["TextField","_a","propsId","id","labelText","_b","inline","icon","validationMessage","description","status","_c","reversed","disabled","restProps","__rest","useId","validationMessageAria","concat","descriptionAria","ariaDescribedBy","reduce","prev","curr","join","React","createElement","FieldGroup","classNameOverride","classnames","styles","withLabel","withDisabled","Label","htmlFor","Input","__assign","input","startIconAdornment","endIconAdornment","className","success","SuccessIcon","role","message","FieldMessage","displayName"],"mappings":";;;;;;;;;;;;;;AAgCA;;;AAGG;AAHH,MAIaA,SAAS;EAAA,MAATA,SAAS,GAAG,SAAAA,CAACC,EAWT,EAAA;IAVf,IAAIC,OAAO,GAAAD,EAAA,CAAAE,EAAA;MACXC,SAAS,GAAAH,EAAA,CAAAG,SAAA;MACTC,EAAc,GAAAJ,EAAA,CAAAK,MAAA;MAAdA,MAAM,GAAAD,EAAA,KAAA,KAAA,CAAA,GAAG,KAAK,GAAAA,EAAA;MACdE,IAAI,GAAAN,EAAA,CAAAM,IAAA;MACJC,iBAAiB,GAAAP,EAAA,CAAAO,iBAAA;MACjBC,WAAW,GAAAR,EAAA,CAAAQ,WAAA;MACXC,MAAM,GAAAT,EAAA,CAAAS,MAAA;MACNC,EAAA,GAAAV,EAAA,CAAAW,QAAgB;MAAhBA,QAAQ,GAAAD,EAAA,KAAA,KAAA,CAAA,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AW,IACVgB,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;MACEc,SAAS,EAAEX,UAAU,CAACC,gBAAM,CAACc,OAAO,EAAE/B,QAAQ,IAAIiB,gBAAM,CAACjB,QAAQ;IAAC,CAAA,EAElEY,KAAA,CAAAC,aAAA,CAACmB,yBAAY,EACX;MAAA1C,EAAE,EAAEgB,eAAe;MACnByB,OAAO,EAAEnC,WAAW;MACpBG,QAAQ,EAAEA;KAAQ,CAClB,CAEL,CACU;EAEjB,CAAC;EAEDZ,SAAS,CAAC8C,WAAW,GAAG,WAAW;EAAA,OA7FtB9C,SAAS;AAAA;"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var styles = {
4
+ "input": "TextField-module_input__CEokl",
5
+ "success": "TextField-module_success__pMLcV",
6
+ "fade-0-to-1": "TextField-module_fade-0-to-1__Ac-99",
7
+ "withReversed": "TextField-module_withReversed__agi-Q",
8
+ "disabled": "TextField-module_disabled__gS8tk",
9
+ "error": "TextField-module_error__7S-f2",
10
+ "caution": "TextField-module_caution__3gzHk",
11
+ "message": "TextField-module_message__bQOgK"
12
+ };
13
+ module.exports = styles;
14
+ //# sourceMappingURL=TextField.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var tslib = require('tslib');
4
+ var React = require('react');
5
+ var classnames = require('classnames');
6
+ var VisuallyHidden_module = require('./VisuallyHidden.module.scss.cjs');
7
+ const VisuallyHidden = /*#__PURE__*/function () {
8
+ const VisuallyHidden = function (_a) {
9
+ var children = _a.children,
10
+ classNameOverride = _a.classNameOverride,
11
+ restProps = tslib.__rest(_a, ["children", "classNameOverride"]);
12
+ return React.createElement("span", tslib.__assign({
13
+ className: classnames(VisuallyHidden_module.srOnly, classNameOverride)
14
+ }, restProps), children);
15
+ };
16
+ VisuallyHidden.displayName = "VisuallyHidden";
17
+ return VisuallyHidden;
18
+ }();
19
+ exports.VisuallyHidden = VisuallyHidden;
20
+ //# sourceMappingURL=VisuallyHidden.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisuallyHidden.cjs","sources":["../../../src/VisuallyHidden/VisuallyHidden.tsx"],"sourcesContent":["import React, { ReactNode, HTMLAttributes } from \"react\"\nimport classnames from \"classnames\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport styles from \"./VisuallyHidden.module.scss\"\n\nexport type VisuallyHiddenProps = {\n children: ReactNode\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport const VisuallyHidden = ({\n children,\n classNameOverride,\n ...restProps\n}: VisuallyHiddenProps): JSX.Element => (\n <span className={classnames(styles.srOnly, classNameOverride)} {...restProps}>\n {children}\n </span>\n)\n\nVisuallyHidden.displayName = \"VisuallyHidden\"\n"],"names":["VisuallyHidden","_a","children","classNameOverride","restProps","__rest","React","createElement","__assign","className","classnames","styles","srOnly","displayName"],"mappings":";;;;;;MASaA,cAAc;EAAA,MAAdA,cAAc,GAAG,SAAAA,CAACC,EAIT,EAAA;IAHpB,IAAAC,QAAQ,cAAA;MACRC,iBAAiB,uBAAA;MACdC,SAAS,GAHiBC,KAAA,CAAAA,MAAA,CAAAJ,EAAA,EAAA,CAAA,UAAA,EAAA,mBAAA,CAI9B,CADa;IAC0B,OACtCK,KAAM,CAAAC,aAAA,CAAA,MAAA,EAAAC,KAAA,CAAAA,QAAA,CAAA;MAAAC,SAAS,EAAEC,UAAU,CAACC,qBAAM,CAACC,MAAM,EAAET,iBAAiB;IAAC,CAAM,EAAAC,SAAS,GACzEF,QAAQ,CACJ;GACR;EAEDF,cAAc,CAACa,WAAW,GAAG,gBAAgB;EAAA,OAVhCb,cAAc;AAAA;"}
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ var styles = {
4
+ "srOnly": "VisuallyHidden-module_srOnly__tTjOK"
5
+ };
6
+ module.exports = styles;
7
+ //# sourceMappingURL=VisuallyHidden.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisuallyHidden.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,12 @@
1
+ import React, { TextareaHTMLAttributes } from "react";
2
+ import { OverrideClassName } from "../types/OverrideClassName";
3
+ export type TextAreaProps = {
4
+ textAreaRef?: React.RefObject<HTMLTextAreaElement>;
5
+ status?: "default" | "error" | "caution";
6
+ autogrow?: boolean;
7
+ reversed?: boolean;
8
+ } & OverrideClassName<TextareaHTMLAttributes<HTMLTextAreaElement>>;
9
+ export declare const TextArea: {
10
+ ({ textAreaRef: propsTextAreaRef, status, autogrow, reversed, rows, defaultValue, value, disabled, onChange: propsOnChange, ...restProps }: TextAreaProps): JSX.Element;
11
+ displayName: string;
12
+ };
@@ -0,0 +1 @@
1
+ export * from "./TextArea";
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { TextAreaProps } from "../TextArea";
3
+ export type TextAreaFieldProps = {
4
+ labelText: string | React.ReactNode;
5
+ inline?: boolean;
6
+ validationMessage?: string | React.ReactNode;
7
+ description?: string | React.ReactNode;
8
+ variant?: "default" | "prominent";
9
+ } & TextAreaProps;
10
+ /**
11
+ * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081895966/Text+Area+Field Guidance} |
12
+ * {@link https://cultureamp.design/?path=/docs/components-text-area-field--docs Storybook}
13
+ */
14
+ export declare const TextAreaField: {
15
+ ({ labelText, inline, validationMessage, description, variant, id: propsId, reversed, status, disabled, ...restProps }: TextAreaFieldProps): JSX.Element;
16
+ displayName: string;
17
+ };
@@ -0,0 +1 @@
1
+ export * from "./TextAreaField";
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import { InputProps } from "../Input";
3
+ type OmittedInputProps = "startIconAdornment" | "endIconAdornment" | "ariaDescribedBy" | "ariaLabel";
4
+ export interface TextFieldProps extends Omit<InputProps, OmittedInputProps> {
5
+ /**
6
+ * A short example of input text. For context or additional information use the `description` prop
7
+ */
8
+ labelText: React.ReactNode;
9
+ inline?: boolean;
10
+ icon?: JSX.Element;
11
+ /**
12
+ * A descriptive message for `error` or `caution` states
13
+ */
14
+ validationMessage?: string | React.ReactNode;
15
+ /**
16
+ * A description that provides context for the text field
17
+ */
18
+ description?: string | React.ReactNode;
19
+ }
20
+ /**
21
+ * {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3081928705/Text+Field Guidance} |
22
+ * {@link https://cultureamp.design/?path=/docs/components-text-field--docs Storybook}
23
+ */
24
+ export declare const TextField: {
25
+ ({ id: propsId, labelText, inline, icon, validationMessage, description, status, reversed, disabled, ...restProps }: TextFieldProps): JSX.Element;
26
+ displayName: string;
27
+ };
28
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./TextField";
@@ -0,0 +1,9 @@
1
+ import { ReactNode, HTMLAttributes } from "react";
2
+ import { OverrideClassName } from "../types/OverrideClassName";
3
+ export type VisuallyHiddenProps = {
4
+ children: ReactNode;
5
+ } & OverrideClassName<HTMLAttributes<HTMLDivElement>>;
6
+ export declare const VisuallyHidden: {
7
+ ({ children, classNameOverride, ...restProps }: VisuallyHiddenProps): JSX.Element;
8
+ displayName: string;
9
+ };
@@ -0,0 +1 @@
1
+ export * from "./VisuallyHidden";
@@ -34,3 +34,6 @@ export * from "./SearchField";
34
34
  export * from "./Slider";
35
35
  export * from "./Text";
36
36
  export * from "./Workflow";
37
+ export * from "./TextField";
38
+ export * from "./TextArea";
39
+ export * from "./TextAreaField";
@@ -297,6 +297,9 @@ var SearchField = require('./SearchField/SearchField.cjs');
297
297
  var Slider = require('./Slider/Slider.cjs');
298
298
  var Text = require('./Text/Text.cjs');
299
299
  var Workflow = require('./Workflow/Workflow.cjs');
300
+ var TextField = require('./TextField/TextField.cjs');
301
+ var TextArea = require('./TextArea/TextArea.cjs');
302
+ var TextAreaField = require('./TextAreaField/TextAreaField.cjs');
300
303
  var heart = require('./KaizenProvider/ThemeProvider/themes/heart.cjs');
301
304
  exports.Avatar = Avatar.Avatar;
302
305
  exports.AvatarGroup = AvatarGroup.AvatarGroup;
@@ -603,5 +606,8 @@ exports.SearchField = SearchField.SearchField;
603
606
  exports.Slider = Slider.Slider;
604
607
  exports.Text = Text.Text;
605
608
  exports.Workflow = Workflow.Workflow;
609
+ exports.TextField = TextField.TextField;
610
+ exports.TextArea = TextArea.TextArea;
611
+ exports.TextAreaField = TextAreaField.TextAreaField;
606
612
  exports.heartTheme = heart.heartTheme;
607
613
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- .Tag-module_tag__tuT2O{align-items:center;border-radius:28px;display:inline-flex;font-family:var(--typography-paragraph-intro-lede-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-small-font-size,.875rem);font-weight:var(--typography-paragraph-small-font-weight,400);gap:var(--spacing-4,.25rem);line-height:var(--typography-paragraph-small-line-height,1.125rem);padding:var(--spacing-4,.25rem) var(--spacing-8,.5rem);white-space:nowrap}.Tag-module_iconContainer__OmQRU{display:inline-flex}.Tag-module_gray__VqJ2M{background-color:var(--color-gray-300,#eaeaec);color:var(--color-purple-800,#2f2438)}.Tag-module_blue__u3vnu{background-color:var(--color-blue-100,#e6f6ff);color:var(--color-blue-700,#003157)}.Tag-module_blue__u3vnu .Tag-module_iconContainer__OmQRU{color:var(--color-blue-500,#0168b3)}.Tag-module_green__7bcu7{background-color:var(--color-green-100,#e8f8f4);color:var(--color-green-700,#22594a)}.Tag-module_green__7bcu7 .Tag-module_iconContainer__OmQRU{color:var(--color-green-500,#44a289)}.Tag-module_yellow__Br-2V{background-color:var(--color-yellow-100,#fff9e4);color:var(--color-yellow-700,#876400)}.Tag-module_yellow__Br-2V .Tag-module_iconContainer__OmQRU{color:var(--color-yellow-500,#ffb600)}.Tag-module_orange__LdmPX{background-color:var(--color-orange-100,#fff0e8);color:var(--color-orange-700,#903c00)}.Tag-module_orange__LdmPX .Tag-module_iconContainer__OmQRU{color:var(--color-orange-500,#e96c2f)}.Tag-module_red__VB5dE{background-color:var(--color-red-100,#fdeaee);color:var(--color-red-700,#6c1e20)}.Tag-module_red__VB5dE .Tag-module_iconContainer__OmQRU{color:var(--color-red-500,#c93b55)}.Tag-module_purple__A3Uy5{background-color:var(--color-purple-100,#f4edf8);color:var(--color-purple-700,#4a234d)}.Tag-module_purple__A3Uy5 .Tag-module_iconContainer__OmQRU{color:var(--color-purple-500,#844587)}
2
1
  .Select-module_container__TaMKg{position:relative;width:100%}.Select-module_notFullWidth__Mr-3G{width:180px}
2
+ .Tag-module_tag__tuT2O{align-items:center;border-radius:28px;display:inline-flex;font-family:var(--typography-paragraph-intro-lede-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-small-font-size,.875rem);font-weight:var(--typography-paragraph-small-font-weight,400);gap:var(--spacing-4,.25rem);line-height:var(--typography-paragraph-small-line-height,1.125rem);padding:var(--spacing-4,.25rem) var(--spacing-8,.5rem);white-space:nowrap}.Tag-module_iconContainer__OmQRU{display:inline-flex}.Tag-module_gray__VqJ2M{background-color:var(--color-gray-300,#eaeaec);color:var(--color-purple-800,#2f2438)}.Tag-module_blue__u3vnu{background-color:var(--color-blue-100,#e6f6ff);color:var(--color-blue-700,#003157)}.Tag-module_blue__u3vnu .Tag-module_iconContainer__OmQRU{color:var(--color-blue-500,#0168b3)}.Tag-module_green__7bcu7{background-color:var(--color-green-100,#e8f8f4);color:var(--color-green-700,#22594a)}.Tag-module_green__7bcu7 .Tag-module_iconContainer__OmQRU{color:var(--color-green-500,#44a289)}.Tag-module_yellow__Br-2V{background-color:var(--color-yellow-100,#fff9e4);color:var(--color-yellow-700,#876400)}.Tag-module_yellow__Br-2V .Tag-module_iconContainer__OmQRU{color:var(--color-yellow-500,#ffb600)}.Tag-module_orange__LdmPX{background-color:var(--color-orange-100,#fff0e8);color:var(--color-orange-700,#903c00)}.Tag-module_orange__LdmPX .Tag-module_iconContainer__OmQRU{color:var(--color-orange-500,#e96c2f)}.Tag-module_red__VB5dE{background-color:var(--color-red-100,#fdeaee);color:var(--color-red-700,#6c1e20)}.Tag-module_red__VB5dE .Tag-module_iconContainer__OmQRU{color:var(--color-red-500,#c93b55)}.Tag-module_purple__A3Uy5{background-color:var(--color-purple-100,#f4edf8);color:var(--color-purple-700,#4a234d)}.Tag-module_purple__A3Uy5 .Tag-module_iconContainer__OmQRU{color:var(--color-purple-500,#844587)}
3
3
  .Main-module_main__hMyB1{z-index:0}
4
4
  .Popover-module_popover__B7k5I{background:var(--color-white,#fff);border-radius:var(--border-solid-border-radius,7px);box-shadow:var(--shadow-large-box-shadow,0 8px 40px rgba(0,0,0,.08),0 3px 9px rgba(0,0,0,.1));box-sizing:border-box;overflow:auto}
5
5
  .Wrapper-module_wrapper__89WmC{background:var(--color-gray-100,#f9f9f9);display:grid;grid-template-rows:min-content 1fr min-content;min-height:100vh;position:relative}
@@ -42,6 +42,7 @@
42
42
  .FilterDatePickerField-module_filterDatePickerField__KvWHu{display:grid;gap:var(--spacing-16,1rem);width:288px}
43
43
  .FilterButton-module_filterButton__Q2dMX{gap:var(--spacing-xs,.375rem)}.FilterButton-module_labelContainer__5G-MD{display:inline-flex}.FilterButton-module_hasSelectedValues__dyQkL{font-weight:var(--typography-button-primary-font-weight,700)}.FilterButton-module_labelSeparator__xrkAx{margin-inline-end:var(--spacing-xs,.375rem)}[dir=ltr] [dir=rtl] .FilterButton-module_labelSeparator__xrkAx{margin-right:0}
44
44
  .DateRangeDisplayLabel-module_dateRangeDisplayLabel__Gsq1R{display:inline-flex;gap:var(--spacing-6,.375rem)}
45
+ .VisuallyHidden-module_srOnly__tTjOK{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}
45
46
  .DateRangeValidationMessage-module_fieldMessageList__UluZx{margin:var(--spacing-0,0);padding-inline-start:var(--spacing-24,1.5rem)}
46
47
  .DateRangeInputField-module_dateRangeInputContainer__KGDB1{border:none;display:flex;margin:0;padding:0}.DateRangeInputField-module_inputStartDate__3nwlg{border-end-end-radius:0;border-start-end-radius:0}.DateRangeInputField-module_inputStartDate__3nwlg+[class*=focusRing]{border-end-end-radius:0!important;border-start-end-radius:0!important}.DateRangeInputField-module_inputEndDate__ZvUwZ{border-end-start-radius:0;border-start-start-radius:0;inset-inline-start:calc(var(--border-solid-border-width, 2px)*-1);position:relative}.DateRangeInputField-module_inputEndDate__ZvUwZ+[class*=focusRing]{border-end-start-radius:0!important;border-start-start-radius:0!important;inset-inline-end:-1px!important;inset-inline-start:calc(var(--border-solid-border-width, 2px)*2*-1 + -1px)!important}.DateRangeInputField-module_disabled__iPMZ-{opacity:.3}
47
48
  .FilterDateRangePickerField-module_filterDateRangePickerField__1gCr0{display:contents}.FilterDateRangePickerField-module_dateRangeInputField__XFvb-{margin-bottom:var(--spacing-24,1.5rem)}
@@ -83,4 +84,7 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs{all:unset;-webkit-ap
83
84
  .Branding-module_branding__Oayqr{display:flex;flex-grow:1;grid-area:branding;justify-content:center;padding-top:var(--spacing-4,.25rem)}@media (min-width:768px){.Branding-module_branding__Oayqr{justify-content:unset}}.Branding-module_logo__rTXU9{flex-basis:7.5rem}
84
85
  .Root-module_root__cfRZi{align-items:center;background-color:var(--color-white,#fff);box-shadow:var(--shadow-small-box-shadow,0 3px 16px rgba(0,0,0,.06),0 1px 3px rgba(0,0,0,.1));display:grid;flex-grow:1;gap:var(--spacing-16,1rem);grid-template:"branding" min-content "titles" max-content "actions" min-content/1fr;justify-content:center;padding:var(--spacing-24,1.5rem);text-align:center}@media (min-width:768px){.Root-module_root__cfRZi{align-items:start;grid-template:"branding titles actions" min-content/1fr max-content 1fr;position:sticky;top:0;z-index:1}}
85
86
  .Main-module_main__H-zGJ{z-index:0}
86
- .Wrapper-module_wrapper__EUUEZ{background:var(--color-gray-100,#f9f9f9);display:grid;grid-template-rows:min-content 1fr min-content;min-height:100vh;position:relative}
87
+ .Wrapper-module_wrapper__EUUEZ{background:var(--color-gray-100,#f9f9f9);display:grid;grid-template-rows:min-content 1fr min-content;min-height:100vh;position:relative}
88
+ .TextField-module_input__CEokl{margin-top:var(--spacing-6,.375rem)}.TextField-module_success__pMLcV{animation-duration:var(--animation-duration-slow,.4s);animation-fill-mode:forwards;animation-name:TextField-module_fade-0-to-1__Ac-99;color:var(--color-green-500,#44a289)}.TextField-module_withReversed__agi-Q .TextField-module_success__pMLcV{color:var(--color-green-400,#5dcbad)}.TextField-module_success__pMLcV.TextField-module_disabled__gS8tk{color:rgba(var(--color-green-500-rgb,68,162,137),.3)}.TextField-module_withReversed__agi-Q .TextField-module_success__pMLcV.TextField-module_disabled__gS8tk{color:rgba(var(--color-green-400-rgb,93,203,173),.3)}.TextField-module_error__7S-f2{animation-duration:var(--animation-duration-slow,.4s);animation-fill-mode:forwards;animation-name:TextField-module_fade-0-to-1__Ac-99;color:var(--color-red-100,#fdeaee)}.TextField-module_withReversed__agi-Q .TextField-module_error__7S-f2{color:var(--color-purple-700,#4a234d)}.TextField-module_caution__3gzHk{animation-duration:var(--animation-duration-slow,.4s);animation-fill-mode:forwards;animation-name:TextField-module_fade-0-to-1__Ac-99;color:var(--color-yellow-200,#ffeeb3)}.TextField-module_withReversed__agi-Q .TextField-module_caution__3gzHk{color:var(--color-purple-700,#4a234d)}@keyframes TextField-module_fade-0-to-1__Ac-99{0%{opacity:0}to{opacity:1}}.TextField-module_message__bQOgK.TextField-module_disabled__gS8tk{opacity:.3}
89
+ .TextArea-module_wrapper__ytS6M{position:relative}.TextArea-module_textarea__GeHn4{border:var(--border-solid-border-width,2px) var(--border-solid-border-style,solid) var(--color-gray-500,#8c8c97);border-radius:var(--border-solid-border-radius,7px);box-sizing:border-box;color:var(--color-purple-800-rgb,47,36,56);display:block;font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:var(--typography-paragraph-body-line-height,1.5rem);outline:0;padding:var(--spacing-sm,.75rem);position:static;resize:vertical;width:100%}.TextArea-module_textarea__GeHn4::-webkit-input-placeholder{color:rgba(var(--color-purple-800-rgb,47,36,56),.7);font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:var(--typography-paragraph-body-line-height,1.5rem);line-height:1.5;position:static}.TextArea-module_textarea__GeHn4:-moz-placeholder,.TextArea-module_textarea__GeHn4::-moz-placeholder{color:rgba(var(--color-purple-800-rgb,47,36,56),.7);font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:2.9rem;line-height:1.5;position:static}.TextArea-module_textarea__GeHn4:-ms-input-placeholder{color:rgba(var(--color-purple-800-rgb,47,36,56),.7);font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:2.9rem;line-height:1.5;position:static}.TextArea-module_textarea__GeHn4:disabled{resize:none}.TextArea-module_textarea__GeHn4:focus+.TextArea-module_focusRing__kECqH{background:transparent;border-color:transparent;border-radius:var(--border-focus-ring-border-radius,10px);border-style:var(--border-focus-ring-border-style,solid);border-width:var(--border-focus-ring-border-width,2px);inset:-3px;pointer-events:none;position:absolute}.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR:hover:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR:hover:not([disabled]){background-color:var(--color-gray-200,#f4f4f5);border-color:var(--color-gray-600,#524e56)}.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR:focus+.TextArea-module_focusRing__kECqH{border-color:var(--color-blue-500,#0168b3)}.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR:not(.TextArea-module_error__XOQRm,.TextArea-module_caution__9BGd0):disabled{border-color:rgba(var(--color-gray-500-rgb,140,140,151),.3)}.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_error__XOQRm,.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_error__XOQRm:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_error__XOQRm:hover:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_error__XOQRm:hover:not([disabled]){border-color:var(--color-red-500,#c93b55)}.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_caution__9BGd0,.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_caution__9BGd0:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_caution__9BGd0:hover:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_caution__9BGd0:hover:not([disabled]){border-color:var(--color-yellow-600,#c68600)}.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_disabled__N09tP{background-color:var(--color-white,#fff);border-color:rgba(var(--color-gray-500-rgb,140,140,151),.3);color:rgba(var(--color-purple-800-rgb,47,36,56),.3)}.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_disabled__N09tP::-webkit-input-placeholder{font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:var(--typography-paragraph-body-line-height,1.5rem);opacity:.3;position:static}.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_disabled__N09tP:-moz-placeholder,.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_disabled__N09tP::-moz-placeholder{font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:2.9rem;opacity:.3;position:static}.TextArea-module_textarea__GeHn4.TextArea-module_default__Z8jvR.TextArea-module_disabled__N09tP:-ms-input-placeholder{font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:2.9rem;opacity:.3;position:static}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq{background:transparent;border-color:rgba(var(--color-white-rgb,255,255,255),.65);color:var(--color-white,#fff)}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq:hover:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq:hover:not([disabled]){background:rgba(var(--color-white-rgb,255,255,255),.1);border-color:var(--color-white,#fff)}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq::-webkit-input-placeholder{color:var(--color-white,#fff);font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:var(--typography-paragraph-body-line-height,1.5rem);line-height:1.5;position:static}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq:-moz-placeholder,.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq::-moz-placeholder{color:var(--color-white,#fff);font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:2.9rem;line-height:1.5;position:static}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq:-ms-input-placeholder{color:var(--color-white,#fff);font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:2.9rem;line-height:1.5;position:static}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq:focus+.TextArea-module_focusRing__kECqH{border-color:var(--color-blue-300,#73c0e8)}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_error__XOQRm,.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_error__XOQRm:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_error__XOQRm:hover:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_error__XOQRm:hover:not([disabled]){border-color:var(--color-red-300,#f597a8)}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_caution__9BGd0,.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_caution__9BGd0:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_caution__9BGd0:hover:focus:not([disabled]),.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_caution__9BGd0:hover:not([disabled]){border-color:var(--color-yellow-400,#ffca4d)}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_disabled__N09tP{background:transparent;border-color:rgba(var(--color-white-rgb,255,255,255),.3);color:rgba(var(--color-white-rgb,255,255,255),.3)}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_disabled__N09tP::-webkit-input-placeholder{font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:var(--typography-paragraph-body-line-height,1.5rem);opacity:.3;position:static}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_disabled__N09tP:-moz-placeholder,.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_disabled__N09tP::-moz-placeholder{font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:2.9rem;opacity:.3;position:static}.TextArea-module_textarea__GeHn4.TextArea-module_reversed__-SoNq.TextArea-module_disabled__N09tP:-ms-input-placeholder{font-family:var(--typography-paragraph-body-font-family,"Inter","Noto Sans",Helvetica,Arial,sans-serif);font-size:var(--typography-paragraph-body-font-size,1rem);font-weight:var(--typography-paragraph-body-font-weight,400);letter-spacing:var(--typography-paragraph-body-letter-spacing,normal);line-height:2.9rem;opacity:.3;position:static}
90
+ .TextAreaField-module_message__hlao7.TextAreaField-module_disabled__twCef{opacity:.3}.TextAreaField-module_textareaLabel__sOTRj{margin-bottom:var(--spacing-xs,.375rem)}.TextAreaField-module_textareaLabelProminent__xqcY4{margin-bottom:0}
@@ -1,9 +1,9 @@
1
1
  import { __rest, __assign } from 'tslib';
2
2
  import React from 'react';
3
3
  import classnames from 'classnames';
4
- import { VisuallyHidden } from '@kaizen/a11y';
5
4
  import { DateInput } from '@kaizen/date-picker/src/_subcomponents/DateInput';
6
5
  import { FieldMessage } from '@kaizen/draft-form';
6
+ import { VisuallyHidden } from '../../../VisuallyHidden/VisuallyHidden.mjs';
7
7
  import { isRefObject } from '../../../utils/isRefObject.mjs';
8
8
  import { DateInputDescription } from '../DateInputDescription/DateInputDescription.mjs';
9
9
  import { DateRangeValidationMessage } from '../DateRangeValidationMessage/DateRangeValidationMessage.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangeInputField.mjs","sources":["../../../../../src/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport classnames from \"classnames\"\nimport { VisuallyHidden } from \"@kaizen/a11y\"\nimport {\n DateInput,\n DateInputProps,\n} from \"@kaizen/date-picker/src/_subcomponents/DateInput\"\nimport { FieldMessage } from \"@kaizen/draft-form\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport { isRefObject } from \"~utils/isRefObject\"\nimport {\n DateInputDescription,\n DateInputDescriptionProps,\n} from \"../DateInputDescription\"\nimport {\n DateRangeValidationMessage,\n DateRangeValidationMessageProps,\n} from \"../DateRangeValidationMessage\"\nimport styles from \"./DateRangeInputField.module.scss\"\n\nexport type DateRangeInputFieldProps = {\n id: string\n legend: string\n inputStartDateProps: Omit<DateInputProps, \"id\">\n inputEndDateProps: Omit<DateInputProps, \"id\">\n locale: Locale\n /**\n * A description that provides context for the text field\n */\n description?: DateInputDescriptionProps[\"description\"]\n isReversed?: boolean\n validationMessage?: DateRangeValidationMessageProps[\"validationMessage\"]\n disabled?: boolean\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport type DateRangeInputFieldRefs = {\n inputStartDateRef?: React.RefObject<HTMLInputElement>\n inputEndDateRef?: React.RefObject<HTMLInputElement>\n}\n\nexport const DateRangeInputField = React.forwardRef<\n DateRangeInputFieldRefs,\n DateRangeInputFieldProps\n>(\n (\n {\n id,\n legend,\n inputStartDateProps,\n inputEndDateProps,\n description,\n disabled,\n isReversed = false,\n validationMessage,\n locale,\n classNameOverride,\n ...restProps\n },\n ref\n ) => {\n const customRefObject = isRefObject(ref) ? ref.current : null\n const inputStartDateRef = customRefObject?.inputStartDateRef\n const inputEndDateRef = customRefObject?.inputEndDateRef\n\n const descriptionId = `${id}--field-message`\n\n // Date Start aria labels\n const dateStartErrorMessageId = validationMessage?.dateStart\n ? `${id}--date-start-error-message`\n : undefined\n\n const dateStartInputDescribedBy = dateStartErrorMessageId\n ? `${dateStartErrorMessageId} ${descriptionId}`\n : descriptionId\n\n const dateStartIsInvalid = dateStartErrorMessageId !== undefined\n\n // Date End aria labels\n const dateEndErrorMessageId = validationMessage?.dateEnd\n ? `${id}--date-end-error-message`\n : undefined\n\n const dateEndInputDescribedBy = dateEndErrorMessageId\n ? `${dateEndErrorMessageId} ${descriptionId}`\n : descriptionId\n\n const dateEndIsInvalid = dateEndErrorMessageId !== undefined\n\n return (\n <div className={classNameOverride} {...restProps}>\n <fieldset className={styles.dateRangeInputContainer}>\n <legend>\n <VisuallyHidden>{legend}</VisuallyHidden>\n </legend>\n <DateInput\n ref={inputStartDateRef}\n id={`${id}--from`}\n aria-describedby={dateStartInputDescribedBy}\n aria-errormessage={dateStartErrorMessageId}\n aria-invalid={dateStartIsInvalid}\n autoComplete=\"off\"\n disabled={disabled}\n status={validationMessage?.dateStart?.status}\n {...inputStartDateProps}\n classNameOverride={classnames(\n styles.inputStartDate,\n inputStartDateProps.classNameOverride\n )}\n />\n <DateInput\n ref={inputEndDateRef}\n id={`${id}--to`}\n aria-describedby={dateEndInputDescribedBy}\n aria-errormessage={dateEndErrorMessageId}\n aria-invalid={dateEndIsInvalid}\n autoComplete=\"off\"\n disabled={disabled}\n status={validationMessage?.dateEnd?.status}\n {...inputEndDateProps}\n classNameOverride={classnames(\n styles.inputEndDate,\n inputEndDateProps.classNameOverride\n )}\n />\n </fieldset>\n\n {validationMessage && (\n <DateRangeValidationMessage\n validationMessage={validationMessage}\n isReversed={isReversed}\n dateStartId={dateStartErrorMessageId}\n dateEndId={dateEndErrorMessageId}\n />\n )}\n\n <FieldMessage\n id={descriptionId}\n message={\n <DateInputDescription description={description} locale={locale} />\n }\n reversed={isReversed}\n classNameOverride={disabled ? styles.disabled : undefined}\n />\n </div>\n )\n }\n)\n\nDateRangeInputField.displayName = \"DateRangeInputField\"\n"],"names":["DateRangeInputField","React","forwardRef","_a","ref","id","legend","inputStartDateProps","inputEndDateProps","description","disabled","_d","isReversed","validationMessage","locale","classNameOverride","restProps","__rest","customRefObject","isRefObject","current","inputStartDateRef","inputEndDateRef","descriptionId","concat","dateStartErrorMessageId","dateStart","undefined","dateStartInputDescribedBy","dateStartIsInvalid","dateEndErrorMessageId","dateEnd","dateEndInputDescribedBy","dateEndIsInvalid","createElement","__assign","className","styles","dateRangeInputContainer","VisuallyHidden","DateInput","autoComplete","status","_b","classnames","inputStartDate","_c","inputEndDate","DateRangeValidationMessage","dateStartId","dateEndId","FieldMessage","message","DateInputDescription","reversed","displayName"],"mappings":";;;;;;;;;;MAwCaA,mBAAmB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CAAA,CAEnC,eAED7B,KAAA,CAAAiC,aAAA,CAACiB,YAAY,EACX;MAAA9C,EAAE,EAAEkB,aAAa;MACjB6B,OAAO,eACLnD,KAAA,CAAAiC,aAAA,CAACmB,oBAAoB,EAAA;QAAC5C,WAAW,EAAEA,WAAW;QAAEK,MAAM,EAAEA;MAAU,CAAA,CAAA;MAEpEwC,QAAQ,EAAE1C,UAAU;MACpBG,iBAAiB,EAAEL,QAAQ,GAAG2B,MAAM,CAAC3B,QAAQ,GAAGiB;IAAS,CACzD,CAAA,CACE;EAEV,CAAC,CACF;EAED3B,mBAAmB,CAACuD,WAAW,GAAG,qBAAqB;EAAA,OA5G1CvD,mBAAmB;AAAA;"}
1
+ {"version":3,"file":"DateRangeInputField.mjs","sources":["../../../../../src/FilterDateRangePicker/subcomponents/DateRangeInputField/DateRangeInputField.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\"\nimport classnames from \"classnames\"\nimport {\n DateInput,\n DateInputProps,\n} from \"@kaizen/date-picker/src/_subcomponents/DateInput\"\nimport { FieldMessage } from \"@kaizen/draft-form\"\nimport { VisuallyHidden } from \"~components/VisuallyHidden\"\nimport { OverrideClassName } from \"~types/OverrideClassName\"\nimport { isRefObject } from \"~utils/isRefObject\"\nimport {\n DateInputDescription,\n DateInputDescriptionProps,\n} from \"../DateInputDescription\"\nimport {\n DateRangeValidationMessage,\n DateRangeValidationMessageProps,\n} from \"../DateRangeValidationMessage\"\nimport styles from \"./DateRangeInputField.module.scss\"\n\nexport type DateRangeInputFieldProps = {\n id: string\n legend: string\n inputStartDateProps: Omit<DateInputProps, \"id\">\n inputEndDateProps: Omit<DateInputProps, \"id\">\n locale: Locale\n /**\n * A description that provides context for the text field\n */\n description?: DateInputDescriptionProps[\"description\"]\n isReversed?: boolean\n validationMessage?: DateRangeValidationMessageProps[\"validationMessage\"]\n disabled?: boolean\n} & OverrideClassName<HTMLAttributes<HTMLDivElement>>\n\nexport type DateRangeInputFieldRefs = {\n inputStartDateRef?: React.RefObject<HTMLInputElement>\n inputEndDateRef?: React.RefObject<HTMLInputElement>\n}\n\nexport const DateRangeInputField = React.forwardRef<\n DateRangeInputFieldRefs,\n DateRangeInputFieldProps\n>(\n (\n {\n id,\n legend,\n inputStartDateProps,\n inputEndDateProps,\n description,\n disabled,\n isReversed = false,\n validationMessage,\n locale,\n classNameOverride,\n ...restProps\n },\n ref\n ) => {\n const customRefObject = isRefObject(ref) ? ref.current : null\n const inputStartDateRef = customRefObject?.inputStartDateRef\n const inputEndDateRef = customRefObject?.inputEndDateRef\n\n const descriptionId = `${id}--field-message`\n\n // Date Start aria labels\n const dateStartErrorMessageId = validationMessage?.dateStart\n ? `${id}--date-start-error-message`\n : undefined\n\n const dateStartInputDescribedBy = dateStartErrorMessageId\n ? `${dateStartErrorMessageId} ${descriptionId}`\n : descriptionId\n\n const dateStartIsInvalid = dateStartErrorMessageId !== undefined\n\n // Date End aria labels\n const dateEndErrorMessageId = validationMessage?.dateEnd\n ? `${id}--date-end-error-message`\n : undefined\n\n const dateEndInputDescribedBy = dateEndErrorMessageId\n ? `${dateEndErrorMessageId} ${descriptionId}`\n : descriptionId\n\n const dateEndIsInvalid = dateEndErrorMessageId !== undefined\n\n return (\n <div className={classNameOverride} {...restProps}>\n <fieldset className={styles.dateRangeInputContainer}>\n <legend>\n <VisuallyHidden>{legend}</VisuallyHidden>\n </legend>\n <DateInput\n ref={inputStartDateRef}\n id={`${id}--from`}\n aria-describedby={dateStartInputDescribedBy}\n aria-errormessage={dateStartErrorMessageId}\n aria-invalid={dateStartIsInvalid}\n autoComplete=\"off\"\n disabled={disabled}\n status={validationMessage?.dateStart?.status}\n {...inputStartDateProps}\n classNameOverride={classnames(\n styles.inputStartDate,\n inputStartDateProps.classNameOverride\n )}\n />\n <DateInput\n ref={inputEndDateRef}\n id={`${id}--to`}\n aria-describedby={dateEndInputDescribedBy}\n aria-errormessage={dateEndErrorMessageId}\n aria-invalid={dateEndIsInvalid}\n autoComplete=\"off\"\n disabled={disabled}\n status={validationMessage?.dateEnd?.status}\n {...inputEndDateProps}\n classNameOverride={classnames(\n styles.inputEndDate,\n inputEndDateProps.classNameOverride\n )}\n />\n </fieldset>\n\n {validationMessage && (\n <DateRangeValidationMessage\n validationMessage={validationMessage}\n isReversed={isReversed}\n dateStartId={dateStartErrorMessageId}\n dateEndId={dateEndErrorMessageId}\n />\n )}\n\n <FieldMessage\n id={descriptionId}\n message={\n <DateInputDescription description={description} locale={locale} />\n }\n reversed={isReversed}\n classNameOverride={disabled ? styles.disabled : undefined}\n />\n </div>\n )\n }\n)\n\nDateRangeInputField.displayName = \"DateRangeInputField\"\n"],"names":["DateRangeInputField","React","forwardRef","_a","ref","id","legend","inputStartDateProps","inputEndDateProps","description","disabled","_d","isReversed","validationMessage","locale","classNameOverride","restProps","__rest","customRefObject","isRefObject","current","inputStartDateRef","inputEndDateRef","descriptionId","concat","dateStartErrorMessageId","dateStart","undefined","dateStartInputDescribedBy","dateStartIsInvalid","dateEndErrorMessageId","dateEnd","dateEndInputDescribedBy","dateEndIsInvalid","createElement","__assign","className","styles","dateRangeInputContainer","VisuallyHidden","DateInput","autoComplete","status","_b","classnames","inputStartDate","_c","inputEndDate","DateRangeValidationMessage","dateStartId","dateEndId","FieldMessage","message","DateInputDescription","reversed","displayName"],"mappings":";;;;;;;;;;MAwCaA,mBAAmB;EAAA,MAAnBA,mBAAmB,gBAAGC,KAAK,CAACC,UAAU,CAIjD,UACEC,EAYC,EACDC,GAAG,EAAA;;IAZD,IAAAC,EAAE,GAAAF,EAAA,CAAAE,EAAA;MACFC,MAAM,GAAAH,EAAA,CAAAG,MAAA;MACNC,mBAAmB,GAAAJ,EAAA,CAAAI,mBAAA;MACnBC,iBAAiB,uBAAA;MACjBC,WAAW,GAAAN,EAAA,CAAAM,WAAA;MACXC,QAAQ,GAAAP,EAAA,CAAAO,QAAA;MACRC,EAAkB,GAAAR,EAAA,CAAAS,UAAA;MAAlBA,UAAU,GAAGD,EAAA,KAAA,KAA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AqB;EAAA,OA5G1CvD,mBAAmB;AAAA;"}
@@ -3,7 +3,7 @@ import React, { useState, useCallback, useContext } from 'react';
3
3
  import { useListBox } from '@react-aria/listbox';
4
4
  import { Item } from '@react-stately/collections';
5
5
  import { useListState } from '@react-stately/list';
6
- import { VisuallyHidden } from '@kaizen/a11y';
6
+ import { VisuallyHidden } from '../../../VisuallyHidden/VisuallyHidden.mjs';
7
7
  import { useMenuTriggerContext } from '../MenuTriggerProvider/MenuTriggerProvider.mjs';
8
8
  var SelectionContext = /*#__PURE__*/React.createContext({});
9
9
  var SelectionProvider = function (props) {
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionProvider.mjs","sources":["../../../../../src/FilterMultiSelect/context/SelectionProvider/SelectionProvider.tsx"],"sourcesContent":["import React, { HTMLAttributes, useCallback, useContext, useState } from \"react\"\nimport { useListBox } from \"@react-aria/listbox\"\nimport { Item } from \"@react-stately/collections\"\nimport { ListState, useListState } from \"@react-stately/list\"\nimport { SelectionMode, Selection } from \"@react-types/shared\"\nimport { VisuallyHidden } from \"@kaizen/a11y\"\nimport { ItemType, MultiSelectItem } from \"../../types\"\nimport { useMenuTriggerContext } from \"../MenuTriggerProvider\"\n\nexport type SelectionProviderProps = {\n selectionMode: SelectionMode\n children: React.ReactNode // control how menu should look like\n items?: ItemType[]\n onSelectionChange?: (keys: Selection) => void\n /** The currently selected keys in the collection (controlled). */\n selectedKeys?: Selection\n /** The initial selected keys in the collection (uncontrolled). */\n defaultSelectedKeys?: Selection\n label: string\n disabledKeys?: Selection\n onSearchInputChange?: (searchInput: string) => void\n}\n\nexport type SelectionProviderContextType = {\n listBoxProps: HTMLAttributes<HTMLElement>\n labelProps: HTMLAttributes<HTMLElement>\n selectionState: ListState<ItemType>\n listRef: React.RefObject<HTMLUListElement>\n searchQuery?: string\n setSearchQuery: React.Dispatch<React.SetStateAction<string>>\n}\n\nconst SelectionContext = React.createContext<SelectionProviderContextType>(\n {} as SelectionProviderContextType\n)\n\nexport const SelectionProvider = (\n props: SelectionProviderProps\n): JSX.Element => {\n const { onSearchInputChange, ...otherProps } = props\n const [searchQuery, setSearchQuery] = useState<string>(\"\")\n const { menuProps } = useMenuTriggerContext()\n /**\n * While the onSearchInputChange is a side-effect, this useEffect should be fine.\n * If the search input state becomes controlled, this useEffect could cause synchronisation\n * issues and should be replaced.\n */\n\n React.useEffect(() => {\n if (onSearchInputChange) {\n onSearchInputChange(searchQuery)\n }\n }, [searchQuery, onSearchInputChange])\n\n const searchFilter = useCallback(\n (nodes: Iterable<MultiSelectItem>): Iterable<MultiSelectItem> =>\n searchQuery\n ? Array.from(nodes).filter(f =>\n f.textValue.toLowerCase().includes(searchQuery.toLowerCase())\n )\n : nodes,\n [searchQuery]\n )\n\n // Create state based on the incoming props to manage the selection\n const state = useListState({\n ...otherProps,\n children: item => <Item key={item.value}>{item.label}</Item>, // For initialising selection and determined item.renderer, can be only Item or Section\n filter: onSearchInputChange ? undefined : searchFilter, // If the user has passed an `onSearchInputChange` we opt them out of the default filtering\n })\n\n // Get A11y attributes and events for the listbox\n const ref = React.createRef<HTMLUListElement>()\n const { listBoxProps, labelProps } = useListBox(\n {\n ...menuProps,\n ...otherProps,\n disallowEmptySelection: true, // stop escape key from clearing selection\n },\n state,\n ref\n )\n\n return (\n <SelectionContext.Provider\n value={{\n listBoxProps,\n labelProps,\n selectionState: state,\n listRef: ref,\n setSearchQuery,\n searchQuery,\n }}\n >\n <VisuallyHidden {...labelProps}>{otherProps.label}</VisuallyHidden>\n {otherProps.children}\n </SelectionContext.Provider>\n )\n}\n\nexport const useSelectionContext = (): SelectionProviderContextType =>\n useContext(SelectionContext)\n\nexport const SelectionConsumer = ({\n children,\n}: React.ConsumerProps<SelectionProviderContextType>): JSX.Element => (\n <SelectionContext.Consumer>{children}</SelectionContext.Consumer>\n)\n"],"names":["SelectionContext","React","createContext","SelectionProvider","props","onSearchInputChange","otherProps","__rest","_a","useState","searchQuery","setSearchQuery","menuProps","useMenuTriggerContext","useEffect","searchFilter","useCallback","nodes","Array","from","filter","f","textValue","toLowerCase","includes","state","useListState","children","item","createElement","Item","key","value","label","undefined","ref","createRef","_b","useListBox","__assign","disallowEmptySelection","listBoxProps","labelProps","Provider","selectionState","listRef","VisuallyHidden","useSelectionContext","useContext","SelectionConsumer","Consumer"],"mappings":";;;;;;;AAgCA,IAAMA,gBAAgB,gBAAGC,KAAK,CAACC,aAAa,CAC1C,CAAA,CAAkC,CACnC;AAEM,IAAMC,iBAAiB,GAAG,SAAAA,CAC/BC,KAA6B,EAAA;EAErB,IAAAC,mBAAmB,GAAoBD,KAAK,CAAzBC,mBAAA;IAAKC,UAAU,GAAAC,MAAA,CAAKH,KAAK,EAA9C,CAAsC,qBAAA,CAAA,CAAF;EACpC,IAAAI,EAAA,GAAgCC,QAAQ,CAAS,EAAE,CAAC;IAAnDC,WAAW,GAAAF,EAAA,CAAA,CAAA,CAAA;IAAEG,cAAc,GAAAH,EAAA,CAAA,CAAA,CAAwB;EAClD,IAAAI,SAAS,GAAKC,qBAAqB,CAAE,CAAA,UAA5B;EACjB;;;;AAIG;EAEHZ,KAAK,CAACa,SAAS,CAAC,YAAA;IACd,IAAIT,mBAAmB,EAAE;MACvBA,mBAAmB,CAACK,WAAW,CAAC;IACjC;EACH,CAAC,EAAE,CAACA,WAAW,EAAEL,mBAAmB,CAAC,CAAC;EAEtC,IAAMU,YAAY,GAAGC,WAAW,CAC9B,UAACC,KAAgC,EAAA;IAC/B,OAAAP,WAAW,GACPQ,KAAK,CAACC,IAAI,CAACF,KAAK,CAAC,CAACG,MAAM,CAAC,UAAAC,CAAC,EAAA;MACxB,OAAAA,CAAC,CAACC,SAAS,CAACC,WAAW,CAAA,CAAE,CAACC,QAAQ,CAACd,WAAW,CAACa,WAAW,CAAA,CAAE,CAAC;IAA7D,CAA6D,CAC9D,GACDN,KAAK;EAJT,CAIS,EACX,CAACP,WAAW,CAAC,CACd;;EAGD,IAAMe,KAAK,GAAGC,YAAY,uBACrBpB,UAAU,CAAA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BACpE1B,oBAACD,gBAAgB,CAACkD,QAAQ,EAAE,IAAA,EAAAvB,QAAQ,CAA6B;AADG,CAAA;"}
1
+ {"version":3,"file":"SelectionProvider.mjs","sources":["../../../../../src/FilterMultiSelect/context/SelectionProvider/SelectionProvider.tsx"],"sourcesContent":["import React, { HTMLAttributes, useCallback, useContext, useState } from \"react\"\nimport { useListBox } from \"@react-aria/listbox\"\nimport { Item } from \"@react-stately/collections\"\nimport { ListState, useListState } from \"@react-stately/list\"\nimport { SelectionMode, Selection } from \"@react-types/shared\"\nimport { VisuallyHidden } from \"~components/VisuallyHidden\"\nimport { ItemType, MultiSelectItem } from \"../../types\"\nimport { useMenuTriggerContext } from \"../MenuTriggerProvider\"\n\nexport type SelectionProviderProps = {\n selectionMode: SelectionMode\n children: React.ReactNode // control how menu should look like\n items?: ItemType[]\n onSelectionChange?: (keys: Selection) => void\n /** The currently selected keys in the collection (controlled). */\n selectedKeys?: Selection\n /** The initial selected keys in the collection (uncontrolled). */\n defaultSelectedKeys?: Selection\n label: string\n disabledKeys?: Selection\n onSearchInputChange?: (searchInput: string) => void\n}\n\nexport type SelectionProviderContextType = {\n listBoxProps: HTMLAttributes<HTMLElement>\n labelProps: HTMLAttributes<HTMLElement>\n selectionState: ListState<ItemType>\n listRef: React.RefObject<HTMLUListElement>\n searchQuery?: string\n setSearchQuery: React.Dispatch<React.SetStateAction<string>>\n}\n\nconst SelectionContext = React.createContext<SelectionProviderContextType>(\n {} as SelectionProviderContextType\n)\n\nexport const SelectionProvider = (\n props: SelectionProviderProps\n): JSX.Element => {\n const { onSearchInputChange, ...otherProps } = props\n const [searchQuery, setSearchQuery] = useState<string>(\"\")\n const { menuProps } = useMenuTriggerContext()\n /**\n * While the onSearchInputChange is a side-effect, this useEffect should be fine.\n * If the search input state becomes controlled, this useEffect could cause synchronisation\n * issues and should be replaced.\n */\n\n React.useEffect(() => {\n if (onSearchInputChange) {\n onSearchInputChange(searchQuery)\n }\n }, [searchQuery, onSearchInputChange])\n\n const searchFilter = useCallback(\n (nodes: Iterable<MultiSelectItem>): Iterable<MultiSelectItem> =>\n searchQuery\n ? Array.from(nodes).filter(f =>\n f.textValue.toLowerCase().includes(searchQuery.toLowerCase())\n )\n : nodes,\n [searchQuery]\n )\n\n // Create state based on the incoming props to manage the selection\n const state = useListState({\n ...otherProps,\n children: item => <Item key={item.value}>{item.label}</Item>, // For initialising selection and determined item.renderer, can be only Item or Section\n filter: onSearchInputChange ? undefined : searchFilter, // If the user has passed an `onSearchInputChange` we opt them out of the default filtering\n })\n\n // Get A11y attributes and events for the listbox\n const ref = React.createRef<HTMLUListElement>()\n const { listBoxProps, labelProps } = useListBox(\n {\n ...menuProps,\n ...otherProps,\n disallowEmptySelection: true, // stop escape key from clearing selection\n },\n state,\n ref\n )\n\n return (\n <SelectionContext.Provider\n value={{\n listBoxProps,\n labelProps,\n selectionState: state,\n listRef: ref,\n setSearchQuery,\n searchQuery,\n }}\n >\n <VisuallyHidden {...labelProps}>{otherProps.label}</VisuallyHidden>\n {otherProps.children}\n </SelectionContext.Provider>\n )\n}\n\nexport const useSelectionContext = (): SelectionProviderContextType =>\n useContext(SelectionContext)\n\nexport const SelectionConsumer = ({\n children,\n}: React.ConsumerProps<SelectionProviderContextType>): JSX.Element => (\n <SelectionContext.Consumer>{children}</SelectionContext.Consumer>\n)\n"],"names":["SelectionContext","React","createContext","SelectionProvider","props","onSearchInputChange","otherProps","__rest","_a","useState","searchQuery","setSearchQuery","menuProps","useMenuTriggerContext","useEffect","searchFilter","useCallback","nodes","Array","from","filter","f","textValue","toLowerCase","includes","state","useListState","children","item","createElement","Item","key","value","label","undefined","ref","createRef","_b","useListBox","__assign","disallowEmptySelection","listBoxProps","labelProps","Provider","selectionState","listRef","VisuallyHidden","useSelectionContext","useContext","SelectionConsumer","Consumer"],"mappings":";;;;;;;AAgCA,IAAMA,gBAAgB,gBAAGC,KAAK,CAACC,aAAa,CAC1C,CAAA,CAAkC,CACnC;AAEM,IAAMC,iBAAi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,CAACmC,SAAS,EAAoB;EACzC,IAAAC,EAAA,GAA+BC,UAAU,CAExCC,QAAA,CAAAA,QAAA,CAAAA,QAAA,CAAA,CAAA,CAAA,EAAA3B,SAAS,GACTN,UAAU,CAAA,EAAA;MACbkC,sBAAsB,EAAE;QAE1Bf,KAAK,EACLU,GAAG,CACJ;IAROM,YAAY,GAAAJ,EAAA,CAAAI,YAAA;IAAEC,UAAU,GAAAL,EAAA,CAAAK,UAQ/B;EAED,oBACEzC,KAAC,CAAA4B,aAAA,CAAA7B,gBAAgB,CAAC2C,QAAQ,EAAA;IACxBX,KAAK,EAAE;MACLS,YAAY,EAAAA,YAAA;MACZC,UAAU,EAAAA,UAAA;MACVE,cAAc,EAAEnB,KAAK;MACrBoB,OAAO,EAAEV,GAAG;MACZxB,cAAc,EAAAA,cAAA;MACdD,WAAW,EAAAA;IACZ;EAAA,CAAA,eAEDT,KAAA,CAAA4B,aAAA,CAACiB,cAAc,EAAKP,QAAA,CAAA,CAAA,CAAA,EAAAG,UAAU,GAAGpC,UAAU,CAAC2B,KAAK,CAAkB,EAClE3B,UAAU,CAACqB,QAAQ,CACM;AAEhC,CAAC;AAEY,IAAAoB,mBAAmB,GAAG,SAAAA,CAAA,EAAA;EACjC,OAAAC,UAAU,CAAChD,gBAAgB,CAAC;AAA5B,CAA4B;AAEvB,IAAMiD,iBAAiB,GAAG,SAAAA,CAACzC,EAEkB,EAAA;EADlD,IAAAmB,QAAQ,GAAAnB,EAAA,CAAAmB,QAAA;EAC4D,oBACpE1B,oBAACD,gBAAgB,CAACkD,QAAQ,EAAE,IAAA,EAAAvB,QAAQ,CAA6B;AADG,CAAA;"}
@@ -1,7 +1,7 @@
1
1
  import { __rest } from 'tslib';
2
2
  import React, { useState } from 'react';
3
3
  import { v4 } from 'uuid';
4
- import { VisuallyHidden } from '@kaizen/a11y';
4
+ import { VisuallyHidden } from '../../../VisuallyHidden/VisuallyHidden.mjs';
5
5
  import styles from './ListBoxSection.module.scss.mjs';
6
6
  const ListBoxSection = /*#__PURE__*/function () {
7
7
  const ListBoxSection = function (_a) {
@@ -1 +1 @@
1
- {"version":3,"file":"ListBoxSection.mjs","sources":["../../../../../src/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.tsx"],"sourcesContent":["import React, { ReactNode, useState } from \"react\"\nimport { v4 } from \"uuid\"\nimport { VisuallyHidden } from \"@kaizen/a11y\"\nimport { MultiSelectItem } from \"../../types\"\nimport styles from \"./ListBoxSection.module.scss\"\n\ntype SectionNameProps = {\n /**\n * Becomes an aria-label on the section, informing\n * unsighted users\n */\n sectionName: string\n}\n\ntype SectionHeaderProps = {\n /**\n * Becomes an aria-label on the section, informing\n * unsighted users\n */\n sectionName?: string\n /**\n * Can be used for a visual title of the ListBoxSection or to provide addition information in a React node.\n * If this is the same title as sectionName, you should only pass in a sectionHeader to avoid duplicate descriptions.\n */\n sectionHeader: ReactNode\n}\n\nexport type ListBoxSectionProps = {\n items: MultiSelectItem[]\n children: (item: MultiSelectItem) => React.ReactNode\n} & (SectionHeaderProps | SectionNameProps)\n\nexport const ListBoxSection = ({\n items,\n children,\n sectionName,\n ...restProps\n}: ListBoxSectionProps): JSX.Element => {\n const [listSectionId] = useState<string>(v4())\n const hasSectionHeader = \"sectionHeader\" in restProps\n return (\n <li role=\"presentation\">\n <ul\n className={styles.listBoxSection}\n aria-label={!hasSectionHeader ? sectionName : undefined}\n aria-labelledby={hasSectionHeader ? listSectionId : undefined}\n role=\"group\"\n >\n {hasSectionHeader && (\n <li\n className={styles.listBoxSectionHeader}\n id={listSectionId}\n role=\"presentation\"\n >\n {sectionName && <VisuallyHidden>{sectionName}. </VisuallyHidden>}\n {restProps.sectionHeader}\n </li>\n )}\n {/*\n * This seems semantically strange but most closely aligns to WCAGs suggested pattern:\n https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-grouped/\n * the role=\"presentation\" will throw an error a11y warning \"Element has children which are not allowed\".\n This is expected and is an accepted issue / potential limitation with axe\n */}\n {Array.from(items).map(node => node != undefined && children(node))}\n </ul>\n </li>\n )\n}\nListBoxSection.displayName = \"ListBoxSection\"\n"],"names":["ListBoxSection","_a","items","children","sectionName","restProps","__rest","listSectionId","useState","v4","hasSectionHeader","React","createElement","role","className","styles","listBoxSection","undefined","listBoxSectionHeader","id","VisuallyHidden","sectionHeader","Array","from","map","node","displayName"],"mappings":";;;;;MAgCaA,cAAc;EAAA,MAAdA,cAAc,GAAG,SAAAA,CAACC,EAKT,EAAA;IAJpB,IAAAC,KAAK,GAAAD,EAAA,CAAAC,KAAA;MACLC,QAAQ,GAAAF,EAAA,CAAAE,QAAA;MACRC,WAAW,GAAAH,EAAA,CAAAG,WAAA;MACRC,SAAS,GAJiBC,MAAA,CAAAL,EAAA,EAAA,CAAA,OAAA,EAAA,UAAA,EAAA,aAAA,CAK9B,CADa;IAEL,IAAAM,aAAa,GAAIC,QAAQ,CAASC,EAAE,CAAA,CAAE,CAAC,GAA1B;IACpB,IAAMC,gBAAgB,IAAG,eAAe,IAAIL,SAAS;IACrD,oBACEM,KAAA,CAAAC,aAAA,CAAA,IAAA,EAAA;MAAIC,IAAI,EAAC;IAAc,CAAA,eACrBF,KAAA,CAAAC,aAAA,CAAA,IAAA,EAAA;MACEE,SAAS,EAAEC,MAAM,CAACC,cAAc;MAAA,YAAA,EACpB,CAACN,gBAAgB,GAAGN,WAAW,GAAGa,SAAS;MACtC,iBAAA,EAAAP,gBAAgB,GAAGH,aAAa,GAAGU,SAAS;MAC7DJ,IAAI,EAAC;IAAO,CAAA,EAEXH,gBAAgB,iBACfC,KACE,CAAAC,aAAA,CAAA,IAAA,EAAA;MAAAE,SAAS,EAAEC,MAAM,CAACG,oBAAoB;MACtCC,EAAE,EAAEZ,aAAa;MACjBM,IAAI,EAAC;IAAc,CAAA,EAElBT,WAAW,iBAAIO,oBAACS,cAAc,EAAA,IAAA,EAAEhB,WAAW,EAAoB,IAAA,CAAA,EAC/DC,SAAS,CAACgB,aAAa,CAE3B,EAOAC,KAAK,CAACC,IAAI,CAACrB,KAAK,CAAC,CAACsB,GAAG,CAAC,UAAAC,IAAI,EAAA;MAAI,OAAAA,IAAI,IAAIR,SAAS,IAAId,QAAQ,CAACsB,IAAI,CAAC;IAAA,CAAA,CAAC,CAChE,CACF;EAET,CAAC;EACDzB,cAAc,CAAC0B,WAAW,GAAG,gBAAgB;EAAA,OArChC1B,cAAc;AAAA;"}
1
+ {"version":3,"file":"ListBoxSection.mjs","sources":["../../../../../src/FilterMultiSelect/subcomponents/ListBoxSection/ListBoxSection.tsx"],"sourcesContent":["import React, { ReactNode, useState } from \"react\"\nimport { v4 } from \"uuid\"\nimport { VisuallyHidden } from \"~components/VisuallyHidden\"\nimport { MultiSelectItem } from \"../../types\"\nimport styles from \"./ListBoxSection.module.scss\"\n\ntype SectionNameProps = {\n /**\n * Becomes an aria-label on the section, informing\n * unsighted users\n */\n sectionName: string\n}\n\ntype SectionHeaderProps = {\n /**\n * Becomes an aria-label on the section, informing\n * unsighted users\n */\n sectionName?: string\n /**\n * Can be used for a visual title of the ListBoxSection or to provide addition information in a React node.\n * If this is the same title as sectionName, you should only pass in a sectionHeader to avoid duplicate descriptions.\n */\n sectionHeader: ReactNode\n}\n\nexport type ListBoxSectionProps = {\n items: MultiSelectItem[]\n children: (item: MultiSelectItem) => React.ReactNode\n} & (SectionHeaderProps | SectionNameProps)\n\nexport const ListBoxSection = ({\n items,\n children,\n sectionName,\n ...restProps\n}: ListBoxSectionProps): JSX.Element => {\n const [listSectionId] = useState<string>(v4())\n const hasSectionHeader = \"sectionHeader\" in restProps\n return (\n <li role=\"presentation\">\n <ul\n className={styles.listBoxSection}\n aria-label={!hasSectionHeader ? sectionName : undefined}\n aria-labelledby={hasSectionHeader ? listSectionId : undefined}\n role=\"group\"\n >\n {hasSectionHeader && (\n <li\n className={styles.listBoxSectionHeader}\n id={listSectionId}\n role=\"presentation\"\n >\n {sectionName && <VisuallyHidden>{sectionName}. </VisuallyHidden>}\n {restProps.sectionHeader}\n </li>\n )}\n {/*\n * This seems semantically strange but most closely aligns to WCAGs suggested pattern:\n https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-grouped/\n * the role=\"presentation\" will throw an error a11y warning \"Element has children which are not allowed\".\n This is expected and is an accepted issue / potential limitation with axe\n */}\n {Array.from(items).map(node => node != undefined && children(node))}\n </ul>\n </li>\n )\n}\nListBoxSection.displayName = \"ListBoxSection\"\n"],"names":["ListBoxSection","_a","items","children","sectionName","restProps","__rest","listSectionId","useState","v4","hasSectionHeader","React","createElement","role","className","styles","listBoxSection","undefined","listBoxSectionHeader","id","VisuallyHidden","sectionHeader","Array","from","map","node","displayName"],"mappings":";;;;;MAgCaA,cAAc;EAAA,MAAdA,cAAc,GAAG,SAAAA,CAACC,EAKT,EAAA;IAJpB,IAAAC,KAAK,GAAAD,EAAA,CAAAC,KAAA;MACLC,QAAQ,GAAAF,EAAA,CAAAE,QAAA;MACRC,WAAW,GAAAH,EAAA,CAAAG,WAAA;MACRC,SAAS,GAJiBC,MAAA,CAAAL,EAAA,EAAA,CAAA,OAAA,EAAA,UAAA,EAAA,aAAA,CAK9B,CADa;IAEL,IAAAM,aAAa,GAAIC,QAAQ,CAASC,EAAE,CAAA,CAAE,CAAC,GAA1B;IACpB,IAAMC,gBAAgB,IAAG,eAAe,IAAIL,SAAS;IACrD,oBACEM,KAAA,CAAAC,aAAA,CAAA,IAAA,EAAA;MAAIC,IAAI,EAAC;IAAc,CAAA,eACrBF,KAAA,CAAAC,aAAA,CAAA,IAAA,EAAA;MACEE,SAAS,EAAEC,MAAM,CAACC,cAAc;MAAA,YAAA,EACpB,CAACN,gBAAgB,GAAGN,WAAW,GAAGa,SAAS;MACtC,iBAAA,EAAAP,gBAAgB,GAAGH,aAAa,GAAGU,SAAS;MAC7DJ,IAAI,EAAC;IAAO,CAAA,EAEXH,gBAAgB,iBACfC,KACE,CAAAC,aAAA,CAAA,IAAA,EAAA;MAAAE,SAAS,EAAEC,MAAM,CAACG,oBAAoB;MACtCC,EAAE,EAAEZ,aAAa;MACjBM,IAAI,EAAC;IAAc,CAAA,EAElBT,WAAW,iBAAIO,oBAACS,cAAc,EAAA,IAAA,EAAEhB,WAAW,EAAoB,IAAA,CAAA,EAC/DC,SAAS,CAACgB,aAAa,CAE3B,EAOAC,KAAK,CAACC,IAAI,CAACrB,KAAK,CAAC,CAACsB,GAAG,CAAC,UAAAC,IAAI,EAAA;MAAI,OAAAA,IAAI,IAAIR,SAAS,IAAId,QAAQ,CAACsB,IAAI,CAAC;IAAA,CAAA,CAAC,CAChE,CACF;EAET,CAAC;EACDzB,cAAc,CAAC0B,WAAW,GAAG,gBAAgB;EAAA,OArChC1B,cAAc;AAAA;"}
@@ -5,10 +5,10 @@ import { useOption } from '@react-aria/listbox';
5
5
  import { mergeProps } from '@react-aria/utils';
6
6
  import classnames from 'classnames';
7
7
  import { v4 } from 'uuid';
8
- import { VisuallyHidden } from '@kaizen/a11y';
9
8
  import { Badge } from '@kaizen/draft-badge';
10
9
  import '../../../Icon/subcomponents/SVG/SVG.mjs';
11
10
  import { CheckIcon } from '../../../Icon/CheckIcon.mjs';
11
+ import { VisuallyHidden } from '../../../VisuallyHidden/VisuallyHidden.mjs';
12
12
  import '../../context/MenuTriggerProvider/MenuTriggerProvider.mjs';
13
13
  import { useSelectionContext } from '../../context/SelectionProvider/SelectionProvider.mjs';
14
14
  import styles from './MultiSelectOption.module.scss.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelectOption.mjs","sources":["../../../../../src/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.tsx"],"sourcesContent":["import React, { useMemo } from \"react\"\nimport { useFocusRing } from \"@react-aria/focus\"\nimport { useOption } from \"@react-aria/listbox\"\nimport { mergeProps } from \"@react-aria/utils\"\nimport classnames from \"classnames\"\nimport { v4 } from \"uuid\"\nimport { VisuallyHidden } from \"@kaizen/a11y\"\nimport { Badge } from \"@kaizen/draft-badge\"\nimport { CheckIcon } from \"~components/Icon\"\nimport { useSelectionContext } from \"../../context\"\nimport { MultiSelectItem } from \"../../types\"\nimport styles from \"./MultiSelectOption.module.scss\"\n\nexport interface MultiSelectOptionProps {\n classNameOverride?: string\n item: MultiSelectItem\n}\n\nexport const MultiSelectOption = ({\n classNameOverride,\n item,\n}: MultiSelectOptionProps): JSX.Element => {\n const { selectionState: state } = useSelectionContext()\n // Get props for the option element\n const ref = React.createRef<HTMLLIElement>()\n const { optionProps, isSelected, isDisabled } = useOption(\n { key: item.key },\n state,\n ref\n )\n\n // Determine whether we should show a keyboard\n // focus ring for accessibility\n const { isFocusVisible, focusProps } = useFocusRing()\n const countElementId = useMemo(() => v4(), [])\n\n return (\n <li\n {...mergeProps(optionProps, focusProps)}\n ref={ref}\n className={classnames(\n styles.option,\n classNameOverride,\n isSelected && styles.isSelected,\n isFocusVisible && styles.isFocusVisible,\n isDisabled && styles.isDisabled\n )}\n aria-label={item.value?.label}\n aria-describedby={item.value?.count ? countElementId : undefined}\n >\n <span\n className={classnames(styles.icon, isSelected && styles.isSelected)}\n >\n {isSelected && <CheckIcon role=\"presentation\" />}\n </span>\n {/* can also be item.value since 'rendered' is defined as item.value in SelectionProvider*/}\n {item.rendered}\n {item.value?.count && (\n <span id={countElementId} className={styles.badgeContainer}>\n <Badge classNameOverride={styles.badge}>{item.value.count}</Badge>\n <VisuallyHidden> available</VisuallyHidden>\n </span>\n )}\n </li>\n )\n}\n\nMultiSelectOption.displayName = \"FilterMultiSelect.Option\"\n"],"names":["MultiSelectOption","_a","classNameOverride","item","state","useSelectionContext","ref","React","createRef","_e","useOption","key","optionProps","isSelected","isDisabled","_f","useFocusRing","isFocusVisible","focusProps","countElementId","useMemo","v4","createElement","__assign","mergeProps","className","classnames","styles","option","_b","value","label","_c","count","undefined","icon","CheckIcon","role","rendered","_d","id","badgeContainer","Badge","badge","VisuallyHidden","displayName"],"mappings":";;;;;;;;;;;;;;MAkBaA,iBAAiB;EAAA,MAAjBA,iBAAiB,GAAG,SAAAA,CAACC,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K,MAAE,IAAA,IAAAE,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAAA,EAAA,CAAAC,KAAK,IAAGd,cAAc,GAAGe;IAAS,CAAA,CAAA,eAEhE3B,KACE,CAAAe,aAAA,CAAA,MAAA,EAAA;MAAAG,SAAS,EAAEC,UAAU,CAACC,MAAM,CAACQ,IAAI,EAAEtB,UAAU,IAAIc,MAAM,CAACd,UAAU;IAAC,CAAA,EAElEA,UAAU,iBAAIN,KAAC,CAAAe,aAAA,CAAAc,SAAS;MAACC,IAAI,EAAC;IAAc,CAAA,CAAG,CAC3C,EAENlC,IAAI,CAACmC,QAAQ,EACb,CAAA,MAAAnC,IAAI,CAAC2B,KAAK,MAAA,IAAA,IAAAS,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAAA,EAAA,CAAEN,KAAK,kBAChB1B,KAAM,CAAAe,aAAA,CAAA,MAAA,EAAA;MAAAkB,EAAE,EAAErB,cAAc;MAAEM,SAAS,EAAEE,MAAM,CAACc;IAAc,CAAA,eACxDlC,KAAA,CAAAe,aAAA,CAACoB,KAAK,EAAA;MAACxC,iBAAiB,EAAEyB,MAAM,CAACgB;KAAK,EAAGxC,IAAI,CAAC2B,KAAK,CAACG,KAAK,CAAS,eAClE1B,KAAA,CAAAe,aAAA,CAACsB,cAAc,EAA4B,IAAA,EAAA,YAAA,CAAA,CAE9C,CACE;EAET,CAAC;EAED5C,iBAAiB,CAAC6C,WAAW,GAAG,0BAA0B;EAAA,OAjD7C7C,iBAAiB;AAAA;"}
1
+ {"version":3,"file":"MultiSelectOption.mjs","sources":["../../../../../src/FilterMultiSelect/subcomponents/MultiSelectOption/MultiSelectOption.tsx"],"sourcesContent":["import React, { useMemo } from \"react\"\nimport { useFocusRing } from \"@react-aria/focus\"\nimport { useOption } from \"@react-aria/listbox\"\nimport { mergeProps } from \"@react-aria/utils\"\nimport classnames from \"classnames\"\nimport { v4 } from \"uuid\"\nimport { Badge } from \"@kaizen/draft-badge\"\nimport { CheckIcon } from \"~components/Icon\"\nimport { VisuallyHidden } from \"~components/VisuallyHidden\"\nimport { useSelectionContext } from \"../../context\"\nimport { MultiSelectItem } from \"../../types\"\nimport styles from \"./MultiSelectOption.module.scss\"\n\nexport interface MultiSelectOptionProps {\n classNameOverride?: string\n item: MultiSelectItem\n}\n\nexport const MultiSelectOption = ({\n classNameOverride,\n item,\n}: MultiSelectOptionProps): JSX.Element => {\n const { selectionState: state } = useSelectionContext()\n // Get props for the option element\n const ref = React.createRef<HTMLLIElement>()\n const { optionProps, isSelected, isDisabled } = useOption(\n { key: item.key },\n state,\n ref\n )\n\n // Determine whether we should show a keyboard\n // focus ring for accessibility\n const { isFocusVisible, focusProps } = useFocusRing()\n const countElementId = useMemo(() => v4(), [])\n\n return (\n <li\n {...mergeProps(optionProps, focusProps)}\n ref={ref}\n className={classnames(\n styles.option,\n classNameOverride,\n isSelected && styles.isSelected,\n isFocusVisible && styles.isFocusVisible,\n isDisabled && styles.isDisabled\n )}\n aria-label={item.value?.label}\n aria-describedby={item.value?.count ? countElementId : undefined}\n >\n <span\n className={classnames(styles.icon, isSelected && styles.isSelected)}\n >\n {isSelected && <CheckIcon role=\"presentation\" />}\n </span>\n {/* can also be item.value since 'rendered' is defined as item.value in SelectionProvider*/}\n {item.rendered}\n {item.value?.count && (\n <span id={countElementId} className={styles.badgeContainer}>\n <Badge classNameOverride={styles.badge}>{item.value.count}</Badge>\n <VisuallyHidden> available</VisuallyHidden>\n </span>\n )}\n </li>\n )\n}\n\nMultiSelectOption.displayName = \"FilterMultiSelect.Option\"\n"],"names":["MultiSelectOption","_a","classNameOverride","item","state","useSelectionContext","ref","React","createRef","_e","useOption","key","optionProps","isSelected","isDisabled","_f","useFocusRing","isFocusVisible","focusProps","countElementId","useMemo","v4","createElement","__assign","mergeProps","className","classnames","styles","option","_b","value","label","_c","count","undefined","icon","CheckIcon","role","rendered","_d","id","badgeContainer","Badge","badge","VisuallyHidden","displayName"],"mappings":";;;;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,KAAK;MACX,kBAAA,EAAA,CAAA,CAAAC,EAAA,GAAA7B,IAAI,CAAC2B,KAAK,MAAE,IAAA,IAAAE,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAAA,EAAA,CAAAC,KAAK,IAAGd,cAAc,GAAGe;IAAS,CAAA,CAAA,eAEhE3B,KACE,CAAAe,aAAA,CAAA,MAAA,EAAA;MAAAG,SAAS,EAAEC,UAAU,CAACC,MAAM,CAACQ,IAAI,EAAEtB,UAAU,IAAIc,MAAM,CAACd,UAAU;IAAC,CAAA,EAElEA,UAAU,iBAAIN,KAAC,CAAAe,aAAA,CAAAc,SAAS;MAACC,IAAI,EAAC;IAAc,CAAA,CAAG,CAC3C,EAENlC,IAAI,CAACmC,QAAQ,EACb,CAAA,MAAAnC,IAAI,CAAC2B,KAAK,MAAA,IAAA,IAAAS,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAAA,EAAA,CAAEN,KAAK,kBAChB1B,KAAM,CAAAe,aAAA,CAAA,MAAA,EAAA;MAAAkB,EAAE,EAAErB,cAAc;MAAEM,SAAS,EAAEE,MAAM,CAACc;IAAc,CAAA,eACxDlC,KAAA,CAAAe,aAAA,CAACoB,KAAK,EAAA;MAACxC,iBAAiB,EAAEyB,MAAM,CAACgB;KAAK,EAAGxC,IAAI,CAAC2B,KAAK,CAACG,KAAK,CAAS,eAClE1B,KAAA,CAAAe,aAAA,CAACsB,cAAc,EAA4B,IAAA,EAAA,YAAA,CAAA,CAE9C,CACE;EAET,CAAC;EAED5C,iBAAiB,CAAC6C,WAAW,GAAG,0BAA0B;EAAA,OAjD7C7C,iBAAiB;AAAA;"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import classnames from 'classnames';
3
- import { VisuallyHidden } from '@kaizen/a11y';
3
+ import { VisuallyHidden } from '../../../../VisuallyHidden/VisuallyHidden.mjs';
4
4
  import '../../../context/MenuTriggerProvider/MenuTriggerProvider.mjs';
5
5
  import { useSelectionContext } from '../../../context/SelectionProvider/SelectionProvider.mjs';
6
6
  import styles from '../SelectionControlButton.module.scss.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"ClearButton.mjs","sources":["../../../../../../src/FilterMultiSelect/subcomponents/SelectionControlButton/ClearButton/ClearButton.tsx"],"sourcesContent":["import React from \"react\"\nimport classnames from \"classnames\"\nimport { VisuallyHidden } from \"@kaizen/a11y\"\nimport { useSelectionContext } from \"../../../context\"\nimport styles from \"../SelectionControlButton.module.scss\"\n\nexport const ClearButton = (): JSX.Element => {\n const { selectionState } = useSelectionContext()\n const filteredOptions = Array.from(selectionState.collection.getKeys())\n const selectedOptions = Array.from(\n selectionState.selectionManager.selectedKeys\n )\n const isDisabled =\n filteredOptions.length === 0 ||\n !Boolean(\n filteredOptions.find(key =>\n selectionState.selectionManager.isSelected(key)\n )\n )\n\n return (\n <button\n type=\"button\"\n className={classnames(styles.button, isDisabled && styles.isDisabled)}\n aria-disabled={isDisabled}\n onClick={\n (): void => {\n !isDisabled &&\n selectionState.selectionManager.setSelectedKeys(\n selectedOptions.filter(\n option => !filteredOptions.includes(option)\n )\n )\n }\n // TODO: add announcement here to inform selection cleared\n }\n >\n Clear<VisuallyHidden> selections</VisuallyHidden>\n </button>\n )\n}\n\nClearButton.displayName = \"FilterMultiSelect.ClearButton\"\n"],"names":["ClearButton","selectionState","useSelectionContext","filteredOptions","Array","from","collection","getKeys","selectedOptions","selectionManager","selectedKeys","isDisabled","length","Boolean","find","key","isSelected","React","createElement","type","className","classnames","styles","button","onClick","setSelectedKeys","filter","option","includes","VisuallyHidden","displayName"],"mappings":";;;;;;MAMaA,WAAW;EAAA,MAAXA,WAAW,GAAG,SAAAA,CAAA,EAAA;IACjB,IAAAC,cAAc,GAAKC,mBAAmB,CAAE,CAAA,eAA1B;IACtB,IAAMC,eAAe,GAAGC,KAAK,CAACC,IAAI,CAACJ,cAAc,CAACK,UAAU,CAACC,OAAO,CAAA,CAAE,CAAC;IACvE,IAAMC,eAAe,GAAGJ,KAAK,CAACC,IAAI,CAChCJ,cAAc,CAACQ,gBAAgB,CAACC,YAAY,CAC7C;IACD,IAAMC,UAAU,GACdR,eAAe,CAACS,MAAM,KAAK,CAAC,IAC5B,CAACC,OAAO,CACNV,eAAe,CAACW,IAAI,CAAC,UAAAC,GAAG,EAAA;MACtB,OAAAd,cAAc,CAACQ,gBAAgB,CAACO,UAAU,CAACD,GAAG,CAAC;IAAA,CAAA,CAChD,CACF;IAEH,oBACEE,KACE,CAAAC,aAAA,CAAA,QAAA,EAAA;MAAAC,IAAI,EAAC,QAAQ;MACbC,SAAS,EAAEC,UAAU,CAACC,MAAM,CAACC,MAAM,EAAEZ,UAAU,IAAIW,MAAM,CAACX,UAAU,CAAC;MACtD,eAAA,EAAAA,UAAU;MACzBa,OAAO,EACL,SAAAA,CAAA,EAAA;QACE,CAACb,UAAU,IACTV,cAAc,CAACQ,gBAAgB,CAACgB,eAAe,CAC7CjB,eAAe,CAACkB,MAAM,CACpB,UAAAC,MAAM,EAAA;UAAI,OAAA,CAACxB,eAAe,CAACyB,QAAQ,CAACD,MAAM,CAAC;QAAjC,CAAiC,CAC5C,CACF;;IACJ,CAAA,wBAIEV,KAAA,CAAAC,aAAA,CAACW,cAAc,EAAA,IAAA,EAAA,aAAA,CAA6B,CAC1C;EAEb,CAAC;EAED7B,WAAW,CAAC8B,WAAW,GAAG,+BAA+B;EAAA,OApC5C9B,WAAW;AAAA;"}
1
+ {"version":3,"file":"ClearButton.mjs","sources":["../../../../../../src/FilterMultiSelect/subcomponents/SelectionControlButton/ClearButton/ClearButton.tsx"],"sourcesContent":["import React from \"react\"\nimport classnames from \"classnames\"\nimport { VisuallyHidden } from \"~components/VisuallyHidden\"\nimport { useSelectionContext } from \"../../../context\"\nimport styles from \"../SelectionControlButton.module.scss\"\n\nexport const ClearButton = (): JSX.Element => {\n const { selectionState } = useSelectionContext()\n const filteredOptions = Array.from(selectionState.collection.getKeys())\n const selectedOptions = Array.from(\n selectionState.selectionManager.selectedKeys\n )\n const isDisabled =\n filteredOptions.length === 0 ||\n !Boolean(\n filteredOptions.find(key =>\n selectionState.selectionManager.isSelected(key)\n )\n )\n\n return (\n <button\n type=\"button\"\n className={classnames(styles.button, isDisabled && styles.isDisabled)}\n aria-disabled={isDisabled}\n onClick={\n (): void => {\n !isDisabled &&\n selectionState.selectionManager.setSelectedKeys(\n selectedOptions.filter(\n option => !filteredOptions.includes(option)\n )\n )\n }\n // TODO: add announcement here to inform selection cleared\n }\n >\n Clear<VisuallyHidden> selections</VisuallyHidden>\n </button>\n )\n}\n\nClearButton.displayName = \"FilterMultiSelect.ClearButton\"\n"],"names":["ClearButton","selectionState","useSelectionContext","filteredOptions","Array","from","collection","getKeys","selectedOptions","selectionManager","selectedKeys","isDisabled","length","Boolean","find","key","isSelected","React","createElement","type","className","classnames","styles","button","onClick","setSelectedKeys","filter","option","includes","VisuallyHidden","displayName"],"mappings":";;;;;;MAMaA,WAAW;EAAA,MAAXA,WAAW,GAAG,SAAAA,CAAA,EAAA;IACjB,IAAAC,cAAc,GAAKC,mBAAmB,CAAE,CAAA,eAA1B;IACtB,IAAMC,eAAe,GAAGC,KAAK,CAACC,IAAI,CAACJ,cAAc,CAACK,UAAU,CAACC,OAAO,CAAA,CAAE,CAAC;IACvE,IAAMC,eAAe,GAAGJ,KAAK,CAACC,IAAI,CAChCJ,cAAc,CAACQ,gBAAgB,CAACC,YAAY,CAC7C;IACD,IAAMC,UAAU,GACdR,eAAe,CAACS,MAAM,KAAK,CAAC,IAC5B,CAACC,OAAO,CACNV,eAAe,CAACW,IAAI,CAAC,UAAAC,GAAG,EAAA;MACtB,OAAAd,cAAc,CAACQ,gBAAgB,CAACO,UAAU,CAACD,GAAG,CAAC;IAAA,CAAA,CAChD,CACF;IAEH,oBACEE,KACE,CAAAC,aAAA,CAAA,QAAA,EAAA;MAAAC,IAAI,EAAC,QAAQ;MACbC,SAAS,EAAEC,UAAU,CAACC,MAAM,CAACC,MAAM,EAAEZ,UAAU,IAAIW,MAAM,CAACX,UAAU,CAAC;MACtD,eAAA,EAAAA,UAAU;MACzBa,OAAO,EACL,SAAAA,CAAA,EAAA;QACE,CAACb,UAAU,IACTV,cAAc,CAACQ,gBAAgB,CAACgB,eAAe,CAC7CjB,eAAe,CAACkB,MAAM,CACpB,UAAAC,MAAM,EAAA;UAAI,OAAA,CAACxB,eAAe,CAACyB,QAAQ,CAACD,MAAM,CAAC;QAAjC,CAAiC,CAC5C,CACF;;IACJ,CAAA,wBAIEV,KAAA,CAAAC,aAAA,CAACW,cAAc,EAAA,IAAA,EAAA,aAAA,CAA6B,CAC1C;EAEb,CAAC;EAED7B,WAAW,CAAC8B,WAAW,GAAG,+BAA+B;EAAA,OApC5C9B,WAAW;AAAA;"}
@@ -1,8 +1,8 @@
1
1
  import { __rest, __assign, __spreadArray } from 'tslib';
2
2
  import React, { useState } from 'react';
3
3
  import classnames from 'classnames';
4
- import { VisuallyHidden } from '@kaizen/a11y';
5
4
  import { Text } from '../../Text/Text.mjs';
5
+ import { VisuallyHidden } from '../../VisuallyHidden/VisuallyHidden.mjs';
6
6
  import styles from './InputRange.module.scss.mjs';
7
7
 
8
8
  /**