@kaizen/components 1.67.10 → 1.67.12

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 (63) hide show
  1. package/codemods/migrateBrandMomentMoodToVariant/index.ts +1 -2
  2. package/codemods/migrateBrandMomentMoodToVariant/transformBrandMomentMoodToVariant.spec.ts +7 -3
  3. package/codemods/migrateCardVariantToColor/index.ts +1 -2
  4. package/codemods/migrateCardVariantToColor/transformCardVariantToColor.spec.ts +9 -3
  5. package/codemods/migrateConfirmationModalMoodsToVariant/index.ts +1 -2
  6. package/codemods/migrateConfirmationModalMoodsToVariant/transformConfirmationModalMoodsToVariant.spec.ts +8 -8
  7. package/codemods/migrateEmptyStateIllustrationTypeToVariant/index.ts +1 -2
  8. package/codemods/migrateEmptyStateIllustrationTypeToVariant/transformEmptyStateIllustrationTypeToVariant.spec.ts +7 -3
  9. package/codemods/migrateGlobalNotificationTypeToVariant/index.ts +2 -3
  10. package/codemods/migrateInformationTileMoodToVariant/index.ts +1 -2
  11. package/codemods/migrateInformationTileMoodToVariant/transformInformationTileMoodToVariant.spec.ts +7 -3
  12. package/codemods/migrateInlineNotificationTypeToVariant/index.ts +2 -3
  13. package/codemods/migrateMultiActionTileMoodToVariant/index.ts +0 -1
  14. package/codemods/migrateMultiActionTileMoodToVariant/transformMultiActionTileMoodToVariant.spec.ts +7 -3
  15. package/codemods/migrateNotificationTypeToVariant/migrateNotificationTypeToVariant.spec.ts +8 -8
  16. package/codemods/migrateProgressBarMoodToColor/index.ts +0 -1
  17. package/codemods/migrateProgressBarMoodToColor/transformProgressBarMoodToColor.spec.ts +7 -3
  18. package/codemods/migrateToastNotificationTypeToVariant/index.ts +1 -2
  19. package/codemods/migrateWellVariantToColor/index.ts +1 -2
  20. package/codemods/migrateWellVariantToColor/transformWellVariantToColor.spec.ts +12 -12
  21. package/codemods/migrateWellVariantToColor/transformWellVariantToColor.ts +2 -3
  22. package/codemods/removeInputEditModalMood/index.ts +1 -2
  23. package/codemods/removeInputEditModalMood/removeInputEditModalMood.spec.ts +4 -4
  24. package/codemods/removePopoverVariant/index.ts +1 -2
  25. package/codemods/removePopoverVariant/removePopoverVariant.spec.ts +5 -5
  26. package/codemods/upgradeIconV1/index.ts +5 -5
  27. package/codemods/upgradeIconV1/upgradeIconV1.spec.ts +5 -6
  28. package/codemods/upgradeIconV1/upgradeIconV1.ts +7 -5
  29. package/codemods/utils/__fixtures__/KaioComponent.tsx +2 -3
  30. package/codemods/utils/__snapshots__/emptyLineEncoder.spec.ts.snap +19 -0
  31. package/codemods/utils/__snapshots__/transformSource.spec.ts.snap +14 -4
  32. package/codemods/utils/createEncodedSourceFile.ts +15 -0
  33. package/codemods/utils/createProp.spec.ts +6 -8
  34. package/codemods/utils/emptyLineEncoder.spec.ts +25 -0
  35. package/codemods/utils/emptyLineEncoder.ts +18 -0
  36. package/codemods/utils/migrateStringProp.spec.ts +7 -3
  37. package/codemods/utils/migrateStringProp.ts +2 -3
  38. package/codemods/utils/printAst.ts +1 -0
  39. package/codemods/utils/removeProps.spec.ts +5 -5
  40. package/codemods/utils/removeProps.ts +2 -2
  41. package/codemods/utils/transformComponentsInDir.ts +14 -15
  42. package/codemods/utils/transformSource.spec.ts +63 -34
  43. package/codemods/utils/transformSource.ts +32 -19
  44. package/codemods/utils/updateKaioImports.ts +6 -3
  45. package/dist/cjs/__actions__/Menu/v3/Menu.cjs +1 -1
  46. package/dist/cjs/__actions__/Menu/v3/{Menu.module.scss.cjs → Menu.module.css.cjs} +1 -1
  47. package/dist/cjs/__actions__/Menu/v3/MenuItem.cjs +10 -5
  48. package/dist/cjs/__actions__/Menu/v3/MenuItem.module.css.cjs +8 -0
  49. package/dist/esm/__actions__/Menu/v3/Menu.mjs +1 -1
  50. package/dist/esm/__actions__/Menu/v3/{Menu.module.scss.mjs → Menu.module.css.mjs} +1 -1
  51. package/dist/esm/__actions__/Menu/v3/MenuItem.mjs +10 -5
  52. package/dist/esm/__actions__/Menu/v3/MenuItem.module.css.mjs +6 -0
  53. package/dist/styles.css +103 -94
  54. package/package.json +3 -3
  55. package/src/__actions__/Menu/v3/Menu.tsx +1 -1
  56. package/src/__actions__/Menu/v3/{MenuItem.module.scss → MenuItem.module.css} +7 -3
  57. package/src/__actions__/Menu/v3/MenuItem.tsx +24 -13
  58. package/src/__actions__/Menu/v3/_docs/ApiSpecification.mdx +10 -1
  59. package/src/__actions__/Menu/v3/_docs/Menu.docs.stories.tsx +0 -5
  60. package/src/__actions__/Menu/v3/_docs/Menu.stories.tsx +33 -1
  61. package/dist/cjs/__actions__/Menu/v3/MenuItem.module.scss.cjs +0 -7
  62. package/dist/esm/__actions__/Menu/v3/MenuItem.module.scss.mjs +0 -5
  63. /package/src/__actions__/Menu/v3/{Menu.module.scss → Menu.module.css} +0 -0
@@ -2,7 +2,7 @@ import { __rest, __assign } from 'tslib';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { Menu as Menu$1 } from 'react-aria-components';
4
4
  import { mergeClassNames } from '../../../utils/mergeClassNames.mjs';
5
- import styles from './Menu.module.scss.mjs';
5
+ import styles from './Menu.module.css.mjs';
6
6
 
7
7
  /**
8
8
  * A menu displays a list of actions or options that a user can choose.
@@ -1,4 +1,4 @@
1
1
  var styles = {
2
- "menu": "Menu-module_menu__iHYqh"
2
+ "menu": "Menu-module_menu__AowD8"
3
3
  };
4
4
  export { styles as default };
@@ -2,7 +2,7 @@ import { __rest, __assign } from 'tslib';
2
2
  import React, { forwardRef } from 'react';
3
3
  import { MenuItem as MenuItem$1 } from 'react-aria-components';
4
4
  import { mergeClassNames } from '../../../utils/mergeClassNames.mjs';
5
- import styles from './MenuItem.module.scss.mjs';
5
+ import styles from './MenuItem.module.css.mjs';
6
6
 
7
7
  /**
8
8
  * A MenuItem represents an individual action in a Menu.
@@ -11,12 +11,17 @@ var MenuItem = /*#__PURE__*/forwardRef(function (_a, ref) {
11
11
  var className = _a.className,
12
12
  icon = _a.icon,
13
13
  children = _a.children,
14
- props = __rest(_a, ["className", "icon", "children"]);
14
+ textValue = _a.textValue,
15
+ props = __rest(_a, ["className", "icon", "children", "textValue"]);
16
+ var determinedTextValue = textValue || (typeof children === "string" ? children : undefined);
15
17
  return /*#__PURE__*/React.createElement(MenuItem$1, __assign({
16
18
  ref: ref,
17
- className: mergeClassNames(styles.item, className)
18
- }, props), /*#__PURE__*/React.createElement(React.Fragment, null, icon && /*#__PURE__*/React.createElement("span", {
19
+ className: mergeClassNames(styles.item, className),
20
+ textValue: determinedTextValue
21
+ }, props), /*#__PURE__*/React.createElement(React.Fragment, null, typeof children === "string" && icon ? ( /*#__PURE__*/React.createElement("div", {
22
+ className: styles.flexWrapper
23
+ }, /*#__PURE__*/React.createElement("span", {
19
24
  className: styles.iconWrapper
20
- }, icon), children));
25
+ }, icon), children)) : ( /*#__PURE__*/React.createElement(React.Fragment, null, children))));
21
26
  });
22
27
  export { MenuItem };
@@ -0,0 +1,6 @@
1
+ var styles = {
2
+ "item": "MenuItem-module_item__uImZI",
3
+ "flexWrapper": "MenuItem-module_flexWrapper__hiXro",
4
+ "iconWrapper": "MenuItem-module_iconWrapper__QoZgd"
5
+ };
6
+ export { styles as default };
package/dist/styles.css CHANGED
@@ -1,5 +1,39 @@
1
1
  @layer tokens, normalize, reset;@layer tokens{:root{--theme-key:heart;--animation-easing-function-ease-in-out:cubic-bezier(0.455,0.03,0.515,0.955);--animation-easing-function-ease-in:cubic-bezier(0.55,0.085,0.68,0.53);--animation-easing-function-ease-out:cubic-bezier(0.25,0.46,0.45,0.94);--animation-easing-function-linear:linear;--animation-easing-function-bounce-in:cubic-bezier(0.485,0.155,0.24,1.245);--animation-easing-function-bounce-out:cubic-bezier(0.485,0.155,0.515,0.845);--animation-easing-function-bounce-in-out:cubic-bezier(0.76,-0.245,0.24,1.245);--animation-duration-instant:0ms;--animation-duration-immediate:100ms;--animation-duration-rapid:200ms;--animation-duration-fast:300ms;--animation-duration-slow:400ms;--animation-duration-deliberate:700ms;--border-solid-border-width:2px;--border-solid-border-radius:7px;--border-solid-border-style:solid;--border-solid-border-color:#e1e2ea;--border-solid-border-color-rgb:225,226,234;--border-dashed-border-width:2px;--border-dashed-border-radius:7px;--border-dashed-border-style:dashed;--border-borderless-border-width:2px;--border-borderless-border-radius:7px;--border-borderless-border-style:solid;--border-borderless-border-color:transparent;--border-borderless-border-color-rgb:0,0,0;--border-focus-ring-border-width:2px;--border-focus-ring-border-radius:10px;--border-focus-ring-border-style:solid;--border-width-1:1px;--color-purple-100:#f4edf8;--color-purple-100-rgb:244,237,248;--color-purple-200:#dfc9ea;--color-purple-200-rgb:223,201,234;--color-purple-300:#c9a5dd;--color-purple-300-rgb:201,165,221;--color-purple-400:#ae67b1;--color-purple-400-rgb:174,103,177;--color-purple-500:#844587;--color-purple-500-rgb:132,69,135;--color-purple-600:#5f3361;--color-purple-600-rgb:95,51,97;--color-purple-700:#4a234d;--color-purple-700-rgb:74,35,77;--color-purple-800:#2f2438;--color-purple-800-rgb:47,36,56;--color-blue-100:#e6f6ff;--color-blue-100-rgb:230,246,255;--color-blue-200:#bde2f5;--color-blue-200-rgb:189,226,245;--color-blue-300:#73c0e8;--color-blue-300-rgb:115,192,232;--color-blue-400:#008bd6;--color-blue-400-rgb:0,139,214;--color-blue-500:#0168b3;--color-blue-500-rgb:1,104,179;--color-blue-600:#004970;--color-blue-600-rgb:0,73,112;--color-blue-700:#003157;--color-blue-700-rgb:0,49,87;--color-green-100:#e8f8f4;--color-green-100-rgb:232,248,244;--color-green-200:#c4ede2;--color-green-200-rgb:196,237,226;--color-green-300:#8fdbc7;--color-green-300-rgb:143,219,199;--color-green-400:#5dcaad;--color-green-400-rgb:93,202,173;--color-green-500:#3f9a86;--color-green-500-rgb:63,154,134;--color-green-600:#2c7d67;--color-green-600-rgb:44,125,103;--color-green-700:#22594a;--color-green-700-rgb:34,89,74;--color-yellow-100:#fff9e4;--color-yellow-100-rgb:255,249,228;--color-yellow-200:#ffeeb3;--color-yellow-200-rgb:255,238,179;--color-yellow-300:#ffe36e;--color-yellow-300-rgb:255,227,110;--color-yellow-400:#ffca4d;--color-yellow-400-rgb:255,202,77;--color-yellow-500:#ffb600;--color-yellow-500-rgb:255,182,0;--color-yellow-600:#c68600;--color-yellow-600-rgb:198,134,0;--color-yellow-700:#876400;--color-yellow-700-rgb:135,100,0;--color-red-100:#fdeaee;--color-red-100-rgb:253,234,238;--color-red-200:#f9c2cb;--color-red-200-rgb:249,194,203;--color-red-300:#f597a8;--color-red-300-rgb:245,151,168;--color-red-400:#e0707d;--color-red-400-rgb:224,112,125;--color-red-500:#c93b55;--color-red-500-rgb:201,59,85;--color-red-600:#a82433;--color-red-600-rgb:168,36,51;--color-red-700:#6c1e20;--color-red-700-rgb:108,30,32;--color-orange-100:#fff0e8;--color-orange-100-rgb:255,240,232;--color-orange-200:#ffd1b9;--color-orange-200-rgb:255,209,185;--color-orange-300:#ffb08a;--color-orange-300-rgb:255,176,138;--color-orange-400:#ff9461;--color-orange-400-rgb:255,148,97;--color-orange-500:#e96c2f;--color-orange-500-rgb:233,108,47;--color-orange-600:#b74302;--color-orange-600-rgb:183,67,2;--color-orange-700:#903c00;--color-orange-700-rgb:144,60,0;--color-gray-100:#f9f9f9;--color-gray-100-rgb:249,249,249;--color-gray-200:#f4f4f5;--color-gray-200-rgb:244,244,245;--color-gray-300:#eaeaec;--color-gray-300-rgb:234,234,236;--color-gray-400:#cdcdd0;--color-gray-400-rgb:205,205,208;--color-gray-500:#878792;--color-gray-500-rgb:135,135,146;--color-gray-600:#524e56;--color-gray-600-rgb:82,78,86;--color-white:#fff;--color-white-rgb:255,255,255;--color-black:#000;--color-black-rgb:0,0,0;--data-viz-favorable:#7dd5bd;--data-viz-favorable-rgb:125,213,189;--data-viz-unfavorable:#e68d97;--data-viz-unfavorable-rgb:230,141,151;--layout-content-max-width:1392px;--layout-content-max-width-with-sidebar:1080px;--layout-content-side-margin:72px;--layout-mobile-actions-drawer-height:60px;--layout-navigation-bar-height:72px;--layout-breakpoints-medium:768px;--layout-breakpoints-large:1080px;--shadow-small-box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 3px 16px 0 rgba(0,0,0,.06);--shadow-large-box-shadow:0 3px 9px 0 rgba(0,0,0,.1),0 8px 40px 0 rgba(0,0,0,.08);--spacing-0:0;--spacing-1:.0625rem;--spacing-2:.125rem;--spacing-4:.25rem;--spacing-6:.375rem;--spacing-8:.5rem;--spacing-12:.75rem;--spacing-16:1rem;--spacing-20:1.25rem;--spacing-24:1.5rem;--spacing-32:2rem;--spacing-40:2.5rem;--spacing-48:3rem;--spacing-56:3.5rem;--spacing-64:4rem;--spacing-72:4.5rem;--spacing-80:5rem;--spacing-96:6rem;--spacing-112:7rem;--spacing-128:8rem;--spacing-160:10rem;--spacing-200:12.5rem;--spacing-240:15rem;--spacing-280:17.5rem;--spacing-320:20rem;--spacing-xs:0.375rem;--spacing-sm:0.75rem;--spacing-md:1.5rem;--spacing-lg:2.25rem;--spacing-xl:3rem;--spacing-xxl:3.75rem;--spacing-xxxl:4.5rem;--spacing-xxxxl:5.25rem;--spacing-xxxxxl:6rem;--typography-data-large-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-large-font-weight:700;--typography-data-large-font-size:5.25rem;--typography-data-large-line-height:5.25rem;--typography-data-large-letter-spacing:normal;--typography-data-large-units-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-large-units-font-weight:700;--typography-data-large-units-font-size:2.625rem;--typography-data-large-units-line-height:5.25rem;--typography-data-large-units-letter-spacing:normal;--typography-data-medium-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-medium-font-weight:700;--typography-data-medium-font-size:3rem;--typography-data-medium-line-height:5rem;--typography-data-medium-letter-spacing:normal;--typography-data-medium-units-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-medium-units-font-weight:700;--typography-data-medium-units-font-size:1.5rem;--typography-data-medium-units-line-height:5rem;--typography-data-medium-units-letter-spacing:normal;--typography-data-small-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-small-font-weight:700;--typography-data-small-font-size:1.5rem;--typography-data-small-line-height:1.5rem;--typography-data-small-letter-spacing:normal;--typography-data-small-units-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-data-small-units-font-weight:700;--typography-data-small-units-font-size:1.125rem;--typography-data-small-units-line-height:1.5rem;--typography-data-small-units-letter-spacing:normal;--typography-display-0-font-family:"Tiempos Headline",Georgia,serif;--typography-display-0-font-weight:800;--typography-display-0-font-size:4.5rem;--typography-display-0-line-height:5.25rem;--typography-display-0-letter-spacing:0em;--typography-heading-1-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-1-font-weight:500;--typography-heading-1-font-size:2.125rem;--typography-heading-1-line-height:2.625rem;--typography-heading-1-letter-spacing:normal;--typography-heading-2-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-2-font-weight:600;--typography-heading-2-font-size:1.75rem;--typography-heading-2-line-height:2.25rem;--typography-heading-2-letter-spacing:normal;--typography-heading-3-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-3-font-weight:600;--typography-heading-3-font-size:1.375rem;--typography-heading-3-line-height:1.875rem;--typography-heading-3-letter-spacing:normal;--typography-heading-4-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-4-font-weight:600;--typography-heading-4-font-size:1.125rem;--typography-heading-4-line-height:1.5rem;--typography-heading-4-letter-spacing:normal;--typography-heading-5-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-5-font-weight:600;--typography-heading-5-font-size:1rem;--typography-heading-5-line-height:1.5rem;--typography-heading-5-letter-spacing:normal;--typography-heading-6-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-heading-6-font-weight:600;--typography-heading-6-font-size:0.875rem;--typography-heading-6-line-height:1.5rem;--typography-heading-6-letter-spacing:normal;--typography-paragraph-intro-lede-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-intro-lede-font-weight:400;--typography-paragraph-intro-lede-font-size:1.25rem;--typography-paragraph-intro-lede-line-height:1.875rem;--typography-paragraph-intro-lede-letter-spacing:0;--typography-paragraph-intro-lede-max-width:975px;--typography-paragraph-body-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-body-font-weight:400;--typography-paragraph-body-font-size:1rem;--typography-paragraph-body-line-height:1.5rem;--typography-paragraph-body-letter-spacing:normal;--typography-paragraph-body-max-width:780px;--typography-paragraph-small-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-small-font-weight:400;--typography-paragraph-small-font-size:0.875rem;--typography-paragraph-small-line-height:1.125rem;--typography-paragraph-small-letter-spacing:normal;--typography-paragraph-small-max-width:680px;--typography-paragraph-extra-small-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-paragraph-extra-small-font-weight:400;--typography-paragraph-extra-small-font-size:0.75rem;--typography-paragraph-extra-small-line-height:1.125rem;--typography-paragraph-extra-small-letter-spacing:normal;--typography-paragraph-extra-small-max-width:600px;--typography-paragraph-bold-font-weight:600;--typography-button-primary-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-button-primary-font-weight:500;--typography-button-primary-font-size:1.125rem;--typography-button-primary-line-height:1.5rem;--typography-button-primary-letter-spacing:normal;--typography-button-secondary-font-family:"Inter","Noto Sans",Helvetica,Arial,sans-serif;--typography-button-secondary-font-weight:500;--typography-button-secondary-font-size:1rem;--typography-button-secondary-line-height:1.5rem;--typography-button-secondary-letter-spacing:normal}}@layer normalize{html{text-size-adjust:100%;line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}}@layer reset{@font-face{font-family:Tiempos Headline;font-weight:800;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-bold.woff)}@font-face{font-family:Tiempos Headline;font-weight:500;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-medium.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-medium.woff)}@font-face{font-family:Greycliff CF;font-weight:300;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-light.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:400;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-regular.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:500;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-medium.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:600;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-demi-bold.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:700;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-bold.woff) format("woff")}@font-face{font-family:Greycliff CF;font-weight:800;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/greycliff/greycliff-cf-extra-bold.woff) format("woff")}@font-face{font-family:Inter;font-weight:300;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-light.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-light.woff)}@font-face{font-family:Inter;font-weight:400;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-regular.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-regular.woff)}@font-face{font-family:Inter;font-weight:500;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-medium.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-medium.woff)}@font-face{font-family:Inter;font-weight:600;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-demi-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-demi-bold.woff)}@font-face{font-family:Inter;font-weight:700;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-bold.woff)}@font-face{font-family:Inter;font-weight:800;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-extra-bold.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-extra-bold.woff)}@font-face{font-family:IBM Plex Mono;src:url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff2),url(https://d1e7r7b0lb8p4d.cloudfront.net/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff)}}@layer reset{*,:after,:before{border-color:var(--border-solid-border-color,"currentColor");border-style:solid;border-width:0}}
2
- .MenuItem-module_item__DPerF {
2
+ .Menu-module_menu__AowD8 {
3
+ background-color: var(--color-white);
4
+ color: var(--color-purple-800);
5
+ width: 248px;
6
+ max-height: 22rem;
7
+ overflow: auto;
8
+ padding-block: var(--spacing-6);
9
+ outline: none;
10
+ border-radius: var(--border-solid-border-radius);
11
+ box-shadow: var(--shadow-large-box-shadow);
12
+ }
13
+
14
+ .Menu-module_menu__AowD8 .react-aria-Header {
15
+ font-family: var(--typography-heading-6-font-family);
16
+ font-size: var(--typography-heading-6-font-size);
17
+ letter-spacing: var(--typography-heading-6-letter-spacing);
18
+ font-weight: var(--typography-heading-6-font-weight);
19
+ line-height: var(--typography-heading-6-line-height);
20
+ padding: var(--spacing-6) 10px;
21
+ margin-inline: var(--spacing-6);
22
+ }
23
+
24
+ .Menu-module_menu__AowD8 section:not(:last-of-type) {
25
+ &::after {
26
+ width: 100%;
27
+ height: 1px;
28
+ background-color: var(--border-solid-border-color);
29
+ content: "";
30
+ display: block;
31
+ margin-block: var(--spacing-6);
32
+ }
33
+ }
34
+
35
+ .MenuItem-module_item__uImZI {
36
+ display: block;
3
37
  font-family: var(--typography-paragraph-body-font-family);
4
38
  font-size: var(--typography-paragraph-body-font-size);
5
39
  letter-spacing: var(--typography-paragraph-body-letter-spacing);
@@ -7,32 +41,93 @@
7
41
  line-height: var(--typography-paragraph-body-line-height);
8
42
  color: rgba(var(--color-purple-800-rgb), 0.7);
9
43
  padding: var(--spacing-6) var(--spacing-8);
10
- border: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style) transparent;
44
+ border: var(--border-focus-ring-border-width)
45
+ var(--border-focus-ring-border-style) transparent;
11
46
  border-radius: 4px;
12
- display: flex;
13
- gap: 0 var(--spacing-8);
14
- align-items: center;
15
47
  margin-inline: var(--spacing-6);
16
48
  text-decoration: none;
17
49
  cursor: pointer;
18
50
  }
19
51
 
20
- .MenuItem-module_iconWrapper__bRdQN {
52
+ .MenuItem-module_flexWrapper__hiXro {
53
+ display: flex;
54
+ gap: 0 var(--spacing-8);
55
+ align-items: center;
56
+ }
57
+
58
+ .MenuItem-module_iconWrapper__QoZgd {
21
59
  flex-shrink: 0;
22
60
  display: flex;
23
61
  align-items: center;
24
62
  }
25
63
 
26
- .MenuItem-module_item__DPerF[data-focused] {
64
+ .MenuItem-module_item__uImZI[data-focused] {
27
65
  background-color: var(--color-blue-100);
28
66
  color: var(--color-blue-500);
29
67
  outline: none;
30
68
  border-color: var(--color-blue-500);
31
69
  }
32
70
 
33
- .MenuItem-module_item__DPerF[data-disabled] {
71
+ .MenuItem-module_item__uImZI[data-disabled] {
34
72
  opacity: 0.3;
35
73
  }
74
+
75
+ /** THIS IS AN AUTOGENERATED FILE **/
76
+ /** THIS IS AN AUTOGENERATED FILE **/
77
+ /** THIS IS AN AUTOGENERATED FILE **/
78
+ /** THIS IS AN AUTOGENERATED FILE **/
79
+ /** THIS IS AN AUTOGENERATED FILE **/
80
+ /** THIS IS AN AUTOGENERATED FILE **/
81
+ .Tooltip-module_tooltip__efL1m {
82
+ max-width: 200px;
83
+ padding: var(--spacing-8, 0.5rem) var(--spacing-12, 0.75rem);
84
+ color: var(--color-white, #ffffff);
85
+ text-align: center;
86
+ font-family: var(--typography-paragraph-extra-small-font-family, "Inter", "Noto Sans", Helvetica, Arial, sans-serif);
87
+ font-size: var(--typography-paragraph-extra-small-font-size, 0.75rem);
88
+ font-weight: var(--typography-paragraph-extra-small-font-weight, 400);
89
+ letter-spacing: var(--typography-paragraph-extra-small-letter-spacing, normal);
90
+ line-height: var(--typography-paragraph-extra-small-line-height, 1.125rem);
91
+ border-radius: var(--border-solid-border-radius, 7px);
92
+ box-shadow: var(--shadow-small-box-shadow, 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 3px 16px 0 rgba(0, 0, 0, 0.06));
93
+ background-color: var(--color-purple-800, #2f2438);
94
+ text-wrap: pretty;
95
+ /* fixes FF gap */
96
+ transform: translate3d(0, 0, 0);
97
+ }
98
+ .Tooltip-module_tooltip__efL1m.Tooltip-module_reversed__NnCbZ {
99
+ background-color: var(--color-white, #ffffff);
100
+ color: var(--color-purple-800, #2f2438);
101
+ }
102
+ .Tooltip-module_tooltip__efL1m[data-placement=top] {
103
+ --origin: translateY(4px);
104
+ }
105
+ .Tooltip-module_tooltip__efL1m[data-placement=bottom] {
106
+ --origin: translateY(-4px);
107
+ }
108
+ .Tooltip-module_tooltip__efL1m[data-placement=right] {
109
+ --origin: translateX(-4px);
110
+ }
111
+ .Tooltip-module_tooltip__efL1m[data-placement=left] {
112
+ --origin: translateX(4px);
113
+ }
114
+ .Tooltip-module_tooltip__efL1m[data-entering] {
115
+ animation: Tooltip-module_slide__lFdGA var(--animation-duration-fast, 300ms);
116
+ }
117
+ .Tooltip-module_tooltip__efL1m[data-exiting] {
118
+ animation: Tooltip-module_slide__lFdGA var(--animation-duration-fast, 300ms) reverse var(--animation-easing-function-ease-in, cubic-bezier(0.55, 0.085, 0.68, 0.53));
119
+ }
120
+
121
+ @keyframes Tooltip-module_slide__lFdGA {
122
+ from {
123
+ transform: var(--origin);
124
+ opacity: 0;
125
+ }
126
+ to {
127
+ transform: translateY(0);
128
+ opacity: 1;
129
+ }
130
+ }
36
131
  .Button-module_button__QOSYH {
37
132
  --button-min-height-width: var(--spacing-48);
38
133
  --button-padding-x: calc(
@@ -124,92 +219,6 @@
124
219
  .Focusable-module_focusableWrapper__NfuIi {
125
220
  display: inline-flex;
126
221
  }
127
- .Menu-module_menu__iHYqh {
128
- background-color: var(--color-white);
129
- color: var(--color-purple-800);
130
- width: 248px;
131
- max-height: 22rem;
132
- overflow: auto;
133
- padding-block: var(--spacing-6);
134
- outline: none;
135
- border-radius: var(--border-solid-border-radius);
136
- box-shadow: var(--shadow-large-box-shadow);
137
- }
138
-
139
- .Menu-module_menu__iHYqh .react-aria-Header {
140
- font-family: var(--typography-heading-6-font-family);
141
- font-size: var(--typography-heading-6-font-size);
142
- letter-spacing: var(--typography-heading-6-letter-spacing);
143
- font-weight: var(--typography-heading-6-font-weight);
144
- line-height: var(--typography-heading-6-line-height);
145
- padding: var(--spacing-6) 10px;
146
- margin-inline: var(--spacing-6);
147
- }
148
-
149
- .Menu-module_menu__iHYqh section:not(:last-of-type)::after {
150
- width: 100%;
151
- height: 1px;
152
- background-color: var(--border-solid-border-color);
153
- content: "";
154
- display: block;
155
- margin-block: var(--spacing-6);
156
- }
157
- /** THIS IS AN AUTOGENERATED FILE **/
158
- /** THIS IS AN AUTOGENERATED FILE **/
159
- /** THIS IS AN AUTOGENERATED FILE **/
160
- /** THIS IS AN AUTOGENERATED FILE **/
161
- /** THIS IS AN AUTOGENERATED FILE **/
162
- /** THIS IS AN AUTOGENERATED FILE **/
163
- .Tooltip-module_tooltip__efL1m {
164
- max-width: 200px;
165
- padding: var(--spacing-8, 0.5rem) var(--spacing-12, 0.75rem);
166
- color: var(--color-white, #ffffff);
167
- text-align: center;
168
- font-family: var(--typography-paragraph-extra-small-font-family, "Inter", "Noto Sans", Helvetica, Arial, sans-serif);
169
- font-size: var(--typography-paragraph-extra-small-font-size, 0.75rem);
170
- font-weight: var(--typography-paragraph-extra-small-font-weight, 400);
171
- letter-spacing: var(--typography-paragraph-extra-small-letter-spacing, normal);
172
- line-height: var(--typography-paragraph-extra-small-line-height, 1.125rem);
173
- border-radius: var(--border-solid-border-radius, 7px);
174
- box-shadow: var(--shadow-small-box-shadow, 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 3px 16px 0 rgba(0, 0, 0, 0.06));
175
- background-color: var(--color-purple-800, #2f2438);
176
- text-wrap: pretty;
177
- /* fixes FF gap */
178
- transform: translate3d(0, 0, 0);
179
- }
180
- .Tooltip-module_tooltip__efL1m.Tooltip-module_reversed__NnCbZ {
181
- background-color: var(--color-white, #ffffff);
182
- color: var(--color-purple-800, #2f2438);
183
- }
184
- .Tooltip-module_tooltip__efL1m[data-placement=top] {
185
- --origin: translateY(4px);
186
- }
187
- .Tooltip-module_tooltip__efL1m[data-placement=bottom] {
188
- --origin: translateY(-4px);
189
- }
190
- .Tooltip-module_tooltip__efL1m[data-placement=right] {
191
- --origin: translateX(-4px);
192
- }
193
- .Tooltip-module_tooltip__efL1m[data-placement=left] {
194
- --origin: translateX(4px);
195
- }
196
- .Tooltip-module_tooltip__efL1m[data-entering] {
197
- animation: Tooltip-module_slide__lFdGA var(--animation-duration-fast, 300ms);
198
- }
199
- .Tooltip-module_tooltip__efL1m[data-exiting] {
200
- animation: Tooltip-module_slide__lFdGA var(--animation-duration-fast, 300ms) reverse var(--animation-easing-function-ease-in, cubic-bezier(0.55, 0.085, 0.68, 0.53));
201
- }
202
-
203
- @keyframes Tooltip-module_slide__lFdGA {
204
- from {
205
- transform: var(--origin);
206
- opacity: 0;
207
- }
208
- to {
209
- transform: translateY(0);
210
- opacity: 1;
211
- }
212
- }
213
222
  /** THIS IS AN AUTOGENERATED FILE **/
214
223
  /** THIS IS AN AUTOGENERATED FILE **/
215
224
  .OverlayArrow-module_overlayArrow__hoDyK {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "1.67.10",
3
+ "version": "1.67.12",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -118,8 +118,8 @@
118
118
  "svgo": "^3.3.2",
119
119
  "tslib": "^2.8.0",
120
120
  "tsx": "^4.19.2",
121
- "@kaizen/package-bundler": "1.1.9",
122
- "@kaizen/design-tokens": "10.8.1"
121
+ "@kaizen/design-tokens": "10.8.2",
122
+ "@kaizen/package-bundler": "1.1.11"
123
123
  },
124
124
  "devDependenciesComments": {
125
125
  "sass": "Prevent deprecation warnings introduced in 1.80 as we plan to move away from sass",
@@ -4,7 +4,7 @@ import {
4
4
  MenuProps as RACMenuProps,
5
5
  } from "react-aria-components"
6
6
  import { mergeClassNames } from "~components/utils/mergeClassNames"
7
- import styles from "./Menu.module.scss"
7
+ import styles from "./Menu.module.css"
8
8
 
9
9
  export type MenuProps = Omit<
10
10
  RACMenuProps<HTMLDivElement>,
@@ -1,4 +1,5 @@
1
1
  .item {
2
+ display: block;
2
3
  font-family: var(--typography-paragraph-body-font-family);
3
4
  font-size: var(--typography-paragraph-body-font-size);
4
5
  letter-spacing: var(--typography-paragraph-body-letter-spacing);
@@ -9,14 +10,17 @@
9
10
  border: var(--border-focus-ring-border-width)
10
11
  var(--border-focus-ring-border-style) transparent;
11
12
  border-radius: 4px;
12
- display: flex;
13
- gap: 0 var(--spacing-8);
14
- align-items: center;
15
13
  margin-inline: var(--spacing-6);
16
14
  text-decoration: none;
17
15
  cursor: pointer;
18
16
  }
19
17
 
18
+ .flexWrapper {
19
+ display: flex;
20
+ gap: 0 var(--spacing-8);
21
+ align-items: center;
22
+ }
23
+
20
24
  .iconWrapper {
21
25
  flex-shrink: 0;
22
26
  display: flex;
@@ -4,7 +4,7 @@ import {
4
4
  MenuItemProps as RACMenuItemProps,
5
5
  } from "react-aria-components"
6
6
  import { mergeClassNames } from "~components/utils/mergeClassNames"
7
- import styles from "./MenuItem.module.scss"
7
+ import styles from "./MenuItem.module.css"
8
8
 
9
9
  export type MenuItemProps = RACMenuItemProps & {
10
10
  /**
@@ -17,16 +17,27 @@ export type MenuItemProps = RACMenuItemProps & {
17
17
  * A MenuItem represents an individual action in a Menu.
18
18
  */
19
19
  export const MenuItem = forwardRef<HTMLDivElement, MenuItemProps>(
20
- ({ className, icon, children, ...props }, ref): JSX.Element => (
21
- <RACMenuItem
22
- ref={ref}
23
- className={mergeClassNames(styles.item, className)}
24
- {...props}
25
- >
26
- <>
27
- {icon && <span className={styles.iconWrapper}>{icon}</span>}
28
- {children}
29
- </>
30
- </RACMenuItem>
31
- )
20
+ ({ className, icon, children, textValue, ...props }, ref): JSX.Element => {
21
+ const determinedTextValue =
22
+ textValue || (typeof children === "string" ? children : undefined)
23
+ return (
24
+ <RACMenuItem
25
+ ref={ref}
26
+ className={mergeClassNames(styles.item, className)}
27
+ textValue={determinedTextValue}
28
+ {...props}
29
+ >
30
+ <>
31
+ {typeof children === "string" && icon ? (
32
+ <div className={styles.flexWrapper}>
33
+ <span className={styles.iconWrapper}>{icon}</span>
34
+ {children}
35
+ </div>
36
+ ) : (
37
+ <>{children}</>
38
+ )}
39
+ </>
40
+ </RACMenuItem>
41
+ )
42
+ }
32
43
  )
@@ -71,12 +71,21 @@ import * as exampleStories from "./Menu.stories"
71
71
 
72
72
  ## Actions and Next.js routing
73
73
 
74
- Use the `href` prop when an action navigates to a new page. Wrapping your app in `FrontendServices` from `@cultureamp/next-services` will automatically turn these into Next.js links.
74
+ Use the `href` prop when an action navigates to a new page.
75
+ [Work in progress] Eventually, wrapping your app in `FrontendServices` from `@cultureamp/next-services` will automatically turn these into Next.js links.
75
76
 
76
77
  Otherwise, use the `onAction` prop to trigger an action within the page.
77
78
 
78
79
  <Canvas className="mb-24" of={docsStories.Actions} />
79
80
 
81
+ ## Typeahead
82
+
83
+ Typeahead (the ability to quickly skip to an item by typing a few characters after opening) will automatically work when `MenuItem` `children` is a `string`.
84
+
85
+ If you're passing `ReactNode` into `MenuItem` `children`, you'll need to specify the `textValue` prop manually on `MenuItem` in order for typeahead to work.
86
+
87
+ <Canvas className="mb-24" of={exampleStories.RichContent} />
88
+
80
89
  ## Sections
81
90
 
82
91
  Sections can be added with the `Section` and `Header` component from `react-aria-components`.
@@ -110,7 +110,6 @@ export const SelectionDont: Story = {
110
110
  export const LabelChevronDo: Story = {
111
111
  render: ({ defaultOpen, ...args }) => (
112
112
  <MenuTrigger defaultOpen={defaultOpen} {...args}>
113
- {/* Replace with Kaizen Button once we have v3 or backwards compatibility */}
114
113
  <Button className="[--icon-size:24]">
115
114
  Edit item
116
115
  <Icon name="keyboard_arrow_down" isPresentational />
@@ -211,7 +210,6 @@ export const MenuItemLabelsDont: Story = {
211
210
  export const SentenceCaseDo: Story = {
212
211
  render: ({ defaultOpen, ...args }) => (
213
212
  <MenuTrigger defaultOpen={defaultOpen}>
214
- {/* Replace with Kaizen Button once we have v3 or backwards compatibility */}
215
213
  <Button className="[--icon-size:24]">
216
214
  <Icon name="more_horiz" alt="Additional actions" />
217
215
  </Button>
@@ -229,7 +227,6 @@ export const SentenceCaseDo: Story = {
229
227
  export const SentenceCaseDont: Story = {
230
228
  render: ({ defaultOpen, ...args }) => (
231
229
  <MenuTrigger defaultOpen={defaultOpen}>
232
- {/* Replace with Kaizen Button once we have v3 or backwards compatibility */}
233
230
  <Button className="[--icon-size:24]">
234
231
  <Icon name="more_horiz" alt="Additional actions" />
235
232
  </Button>
@@ -247,7 +244,6 @@ export const SentenceCaseDont: Story = {
247
244
  export const ElipsesDo: Story = {
248
245
  render: ({ defaultOpen, ...args }) => (
249
246
  <MenuTrigger defaultOpen={defaultOpen}>
250
- {/* Replace with Kaizen Button once we have v3 or backwards compatibility */}
251
247
  <Button className="[--icon-size:24]">
252
248
  <Icon name="more_horiz" alt="Additional actions" />
253
249
  </Button>
@@ -265,7 +261,6 @@ export const ElipsesDo: Story = {
265
261
  export const ElipsesDont: Story = {
266
262
  render: ({ defaultOpen, ...args }) => (
267
263
  <MenuTrigger defaultOpen={defaultOpen}>
268
- {/* Replace with Kaizen Button once we have v3 or backwards compatibility */}
269
264
  <Button className="[--icon-size:24]">
270
265
  <Icon name="more_horiz" alt="Additional actions" />
271
266
  </Button>
@@ -2,6 +2,7 @@ import React, { FunctionComponent } from "react"
2
2
  import { Meta, StoryObj } from "@storybook/react"
3
3
  import isChromatic from "chromatic"
4
4
  import { Popover } from "react-aria-components"
5
+ import { Text } from "~components/Text"
5
6
  import { Button } from "~components/__actions__/v3"
6
7
  import { Icon } from "~components/__future__/Icon"
7
8
  import { Menu, MenuTrigger, MenuItem } from "../index"
@@ -24,7 +25,6 @@ type Story = StoryObj<typeof meta>
24
25
  export const Playground: Story = {
25
26
  render: ({ defaultOpen: _, ...args }) => (
26
27
  <MenuTrigger {...args}>
27
- {/* Replace with Kaizen Button once we have v3 or backwards compatibility */}
28
28
  <Button className="[--icon-size:24]">
29
29
  <Icon name="more_horiz" alt="Additional actions" />
30
30
  </Button>
@@ -64,3 +64,35 @@ export const Controlled: Story = {
64
64
  ...testStories.Controlled,
65
65
  play: undefined,
66
66
  }
67
+
68
+ export const RichContent: Story = {
69
+ render: ({ defaultOpen: _, ...args }) => (
70
+ <MenuTrigger {...args}>
71
+ <Button className="[--icon-size:24]">
72
+ <Icon name="more_horiz" alt="Additional actions" />
73
+ </Button>
74
+ <Popover>
75
+ <Menu>
76
+ <MenuItem textValue="Save">
77
+ <div>Save</div>
78
+ <Text tag="div" variant="extra-small">
79
+ Saves all data
80
+ </Text>
81
+ </MenuItem>
82
+ <MenuItem textValue="Edit">
83
+ <div>Edit</div>
84
+ <Text tag="div" variant="extra-small">
85
+ Adjust the name and description
86
+ </Text>
87
+ </MenuItem>
88
+ <MenuItem textValue="Delete">
89
+ Delete
90
+ <Text tag="div" variant="extra-small">
91
+ Completely remove, cannot be undone
92
+ </Text>
93
+ </MenuItem>
94
+ </Menu>
95
+ </Popover>
96
+ </MenuTrigger>
97
+ ),
98
+ }
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var styles = {
4
- "item": "MenuItem-module_item__DPerF",
5
- "iconWrapper": "MenuItem-module_iconWrapper__bRdQN"
6
- };
7
- module.exports = styles;
@@ -1,5 +0,0 @@
1
- var styles = {
2
- "item": "MenuItem-module_item__DPerF",
3
- "iconWrapper": "MenuItem-module_iconWrapper__bRdQN"
4
- };
5
- export { styles as default };