@kaizen/components 0.0.0-canary-codemod-blank-lines-20241111103937 → 0.0.0-canary-codemod-retain-blank-lines-20241111104224

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.
@@ -4,7 +4,7 @@ var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var reactAriaComponents = require('react-aria-components');
6
6
  var mergeClassNames = require('../../../utils/mergeClassNames.cjs');
7
- var Menu_module = require('./Menu.module.scss.cjs');
7
+ var Menu_module = require('./Menu.module.css.cjs');
8
8
  function _interopDefault(e) {
9
9
  return e && e.__esModule ? e : {
10
10
  default: e
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var styles = {
4
- "menu": "Menu-module_menu__iHYqh"
4
+ "menu": "Menu-module_menu__AowD8"
5
5
  };
6
6
  module.exports = styles;
@@ -4,7 +4,7 @@ var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var reactAriaComponents = require('react-aria-components');
6
6
  var mergeClassNames = require('../../../utils/mergeClassNames.cjs');
7
- var MenuItem_module = require('./MenuItem.module.scss.cjs');
7
+ var MenuItem_module = require('./MenuItem.module.css.cjs');
8
8
  function _interopDefault(e) {
9
9
  return e && e.__esModule ? e : {
10
10
  default: e
@@ -19,12 +19,17 @@ var MenuItem = React.forwardRef(function (_a, ref) {
19
19
  var className = _a.className,
20
20
  icon = _a.icon,
21
21
  children = _a.children,
22
- props = tslib.__rest(_a, ["className", "icon", "children"]);
22
+ textValue = _a.textValue,
23
+ props = tslib.__rest(_a, ["className", "icon", "children", "textValue"]);
24
+ var determinedTextValue = textValue || (typeof children === "string" ? children : undefined);
23
25
  return React__default.default.createElement(reactAriaComponents.MenuItem, tslib.__assign({
24
26
  ref: ref,
25
- className: mergeClassNames.mergeClassNames(MenuItem_module.item, className)
26
- }, props), React__default.default.createElement(React__default.default.Fragment, null, icon && React__default.default.createElement("span", {
27
+ className: mergeClassNames.mergeClassNames(MenuItem_module.item, className),
28
+ textValue: determinedTextValue
29
+ }, props), React__default.default.createElement(React__default.default.Fragment, null, typeof children === "string" && icon ? React__default.default.createElement("div", {
30
+ className: MenuItem_module.flexWrapper
31
+ }, React__default.default.createElement("span", {
27
32
  className: MenuItem_module.iconWrapper
28
- }, icon), children));
33
+ }, icon), children) : React__default.default.createElement(React__default.default.Fragment, null, children)));
29
34
  });
30
35
  exports.MenuItem = MenuItem;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var styles = {
4
+ "item": "MenuItem-module_item__uImZI",
5
+ "flexWrapper": "MenuItem-module_flexWrapper__hiXro",
6
+ "iconWrapper": "MenuItem-module_iconWrapper__QoZgd"
7
+ };
8
+ module.exports = styles;
@@ -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,6 @@
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
+ .MenuItem-module_item__uImZI {
3
+ display: block;
3
4
  font-family: var(--typography-paragraph-body-font-family);
4
5
  font-size: var(--typography-paragraph-body-font-size);
5
6
  letter-spacing: var(--typography-paragraph-body-letter-spacing);
@@ -7,33 +8,38 @@
7
8
  line-height: var(--typography-paragraph-body-line-height);
8
9
  color: rgba(var(--color-purple-800-rgb), 0.7);
9
10
  padding: var(--spacing-6) var(--spacing-8);
10
- border: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style) transparent;
11
+ border: var(--border-focus-ring-border-width)
12
+ var(--border-focus-ring-border-style) transparent;
11
13
  border-radius: 4px;
12
- display: flex;
13
- gap: 0 var(--spacing-8);
14
- align-items: center;
15
14
  margin-inline: var(--spacing-6);
16
15
  text-decoration: none;
17
16
  cursor: pointer;
18
17
  }
19
18
 
20
- .MenuItem-module_iconWrapper__bRdQN {
19
+ .MenuItem-module_flexWrapper__hiXro {
20
+ display: flex;
21
+ gap: 0 var(--spacing-8);
22
+ align-items: center;
23
+ }
24
+
25
+ .MenuItem-module_iconWrapper__QoZgd {
21
26
  flex-shrink: 0;
22
27
  display: flex;
23
28
  align-items: center;
24
29
  }
25
30
 
26
- .MenuItem-module_item__DPerF[data-focused] {
31
+ .MenuItem-module_item__uImZI[data-focused] {
27
32
  background-color: var(--color-blue-100);
28
33
  color: var(--color-blue-500);
29
34
  outline: none;
30
35
  border-color: var(--color-blue-500);
31
36
  }
32
37
 
33
- .MenuItem-module_item__DPerF[data-disabled] {
38
+ .MenuItem-module_item__uImZI[data-disabled] {
34
39
  opacity: 0.3;
35
40
  }
36
- .Menu-module_menu__iHYqh {
41
+
42
+ .Menu-module_menu__AowD8 {
37
43
  background-color: var(--color-white);
38
44
  color: var(--color-purple-800);
39
45
  width: 248px;
@@ -45,7 +51,7 @@
45
51
  box-shadow: var(--shadow-large-box-shadow);
46
52
  }
47
53
 
48
- .Menu-module_menu__iHYqh .react-aria-Header {
54
+ .Menu-module_menu__AowD8 .react-aria-Header {
49
55
  font-family: var(--typography-heading-6-font-family);
50
56
  font-size: var(--typography-heading-6-font-size);
51
57
  letter-spacing: var(--typography-heading-6-letter-spacing);
@@ -55,13 +61,44 @@
55
61
  margin-inline: var(--spacing-6);
56
62
  }
57
63
 
58
- .Menu-module_menu__iHYqh section:not(:last-of-type)::after {
59
- width: 100%;
60
- height: 1px;
61
- background-color: var(--border-solid-border-color);
62
- content: "";
63
- display: block;
64
- margin-block: var(--spacing-6);
64
+ .Menu-module_menu__AowD8 section:not(:last-of-type) {
65
+ &::after {
66
+ width: 100%;
67
+ height: 1px;
68
+ background-color: var(--border-solid-border-color);
69
+ content: "";
70
+ display: block;
71
+ margin-block: var(--spacing-6);
72
+ }
73
+ }
74
+
75
+ /** THIS IS AN AUTOGENERATED FILE **/
76
+ /** THIS IS AN AUTOGENERATED FILE **/
77
+ .OverlayArrow-module_overlayArrow__hoDyK {
78
+ display: flex;
79
+ padding: 8px;
80
+ }
81
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=top], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] {
82
+ padding: 0 8px;
83
+ }
84
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=left], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] {
85
+ padding: 8px 0;
86
+ }
87
+ .OverlayArrow-module_overlayArrow__hoDyK path {
88
+ fill: var(--color-purple-800, #2f2438);
89
+ 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));
90
+ }
91
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] svg {
92
+ transform: rotate(90deg);
93
+ }
94
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] svg {
95
+ transform: rotate(180deg);
96
+ }
97
+ .OverlayArrow-module_overlayArrow__hoDyK[data-placement=left] svg {
98
+ transform: rotate(270deg);
99
+ }
100
+ .OverlayArrow-module_overlayArrow__hoDyK.OverlayArrow-module_reversed__-WGcR path {
101
+ fill: var(--color-white, #ffffff);
65
102
  }
66
103
  .Button-module_button__QOSYH {
67
104
  --button-min-height-width: var(--spacing-48);
@@ -156,34 +193,6 @@
156
193
  }
157
194
  /** THIS IS AN AUTOGENERATED FILE **/
158
195
  /** THIS IS AN AUTOGENERATED FILE **/
159
- .OverlayArrow-module_overlayArrow__hoDyK {
160
- display: flex;
161
- padding: 8px;
162
- }
163
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=top], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] {
164
- padding: 0 8px;
165
- }
166
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=left], .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] {
167
- padding: 8px 0;
168
- }
169
- .OverlayArrow-module_overlayArrow__hoDyK path {
170
- fill: var(--color-purple-800, #2f2438);
171
- 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));
172
- }
173
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=right] svg {
174
- transform: rotate(90deg);
175
- }
176
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=bottom] svg {
177
- transform: rotate(180deg);
178
- }
179
- .OverlayArrow-module_overlayArrow__hoDyK[data-placement=left] svg {
180
- transform: rotate(270deg);
181
- }
182
- .OverlayArrow-module_overlayArrow__hoDyK.OverlayArrow-module_reversed__-WGcR path {
183
- fill: var(--color-white, #ffffff);
184
- }
185
- /** THIS IS AN AUTOGENERATED FILE **/
186
- /** THIS IS AN AUTOGENERATED FILE **/
187
196
  /** THIS IS AN AUTOGENERATED FILE **/
188
197
  /** THIS IS AN AUTOGENERATED FILE **/
189
198
  /** THIS IS AN AUTOGENERATED FILE **/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "0.0.0-canary-codemod-blank-lines-20241111103937",
3
+ "version": "0.0.0-canary-codemod-retain-blank-lines-20241111104224",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -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 };