@uniformdev/design-system 19.23.0 → 19.23.1-alpha.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.
package/dist/esm/index.js CHANGED
@@ -11152,11 +11152,13 @@ import { css as css20 } from "@emotion/react";
11152
11152
  var MenuGroupContainer = css20`
11153
11153
  display: flex;
11154
11154
  flex-direction: column;
11155
+ margin-top: var(--spacing-sm);
11155
11156
  `;
11156
11157
  var MenuTitle = css20`
11157
11158
  color: var(--gray-400);
11158
11159
  font-size: var(--fs-xs);
11159
11160
  font-weight: var(--fw-bold);
11161
+ padding: var(--spacing-xs) var(--spacing-sm);
11160
11162
  text-transform: uppercase;
11161
11163
  `;
11162
11164
 
@@ -11171,7 +11173,12 @@ var MenuGroup = ({ title, children }) => {
11171
11173
 
11172
11174
  // src/components/Menu/MenuItem.styles.ts
11173
11175
  import { css as css21 } from "@emotion/react";
11174
- var menuItem = (textTheme) => css21`
11176
+ var activeMenuItem = css21`
11177
+ box-shadow: none;
11178
+ background: var(--gray-200);
11179
+ outline: none;
11180
+ `;
11181
+ var menuItem = (textTheme, forceActive) => css21`
11175
11182
  align-items: center;
11176
11183
  border: none;
11177
11184
  border-radius: var(--rounded-base);
@@ -11182,9 +11189,10 @@ var menuItem = (textTheme) => css21`
11182
11189
  font-weight: var(--fw-regular);
11183
11190
  flex-grow: 1;
11184
11191
  gap: var(--spacing-xs);
11185
- line-height: 1.5;
11192
+
11186
11193
  white-space: nowrap;
11187
11194
  transition: background-color var(--duration-fast) var(--timing-ease-out);
11195
+ ${forceActive ? activeMenuItem : ""}
11188
11196
 
11189
11197
  &:disabled {
11190
11198
  color: var(--gray-300);
@@ -11192,9 +11200,7 @@ var menuItem = (textTheme) => css21`
11192
11200
 
11193
11201
  &:hover,
11194
11202
  &:focus {
11195
- box-shadow: none;
11196
- background: var(--gray-200);
11197
- outline: none;
11203
+ ${typeof forceActive === "undefined" ? activeMenuItem : ""}
11198
11204
  }
11199
11205
  `;
11200
11206
  var menuItemWithIcon = css21`
@@ -11323,14 +11329,15 @@ import * as React8 from "react";
11323
11329
  import { MenuItem as BaseMenuItem } from "reakit";
11324
11330
  import { jsx as jsx24, jsxs as jsxs13 } from "@emotion/react/jsx-runtime";
11325
11331
  var MenuItem = React8.forwardRef(
11326
- ({ children, className, hideMenuOnClick = true, icon, textColor = "base", ...props }, ref) => {
11332
+ ({ children, className, hideMenuOnClick = true, icon, textColor = "base", active, ...props }, ref) => {
11327
11333
  const menuState = useMenuContext();
11328
11334
  const resolveProps = (originalProps) => {
11329
11335
  const resolvedProps2 = { ...originalProps };
11330
11336
  if (resolvedProps2.onClick) {
11331
11337
  const origOnClick = resolvedProps2.onClick;
11332
11338
  resolvedProps2.onClick = (e) => {
11333
- menuState.hide();
11339
+ var _a;
11340
+ (_a = menuState == null ? void 0 : menuState.hide) == null ? void 0 : _a.call(menuState);
11334
11341
  origOnClick(e);
11335
11342
  };
11336
11343
  }
@@ -11346,7 +11353,7 @@ var MenuItem = React8.forwardRef(
11346
11353
  "data-test-id": "button-menu",
11347
11354
  ...menuState,
11348
11355
  ...resolvedProps,
11349
- css: [menuItem(textColor), typeof className === "object" ? className : void 0],
11356
+ css: [menuItem(textColor, active), typeof className === "object" ? className : void 0],
11350
11357
  className: typeof className === "string" ? className : void 0,
11351
11358
  children: icon ? renderWithIcon(resolvedChildren, icon) : resolvedChildren
11352
11359
  }
package/dist/index.d.ts CHANGED
@@ -20392,14 +20392,14 @@ type ChipSizeProp = 'xs' | 'sm' | 'md';
20392
20392
  type ChipThemeProps = 'accent-light' | 'accent-dark' | 'accent-alt-light' | 'accent-alt-dark' | 'neutral-light' | 'neutral-dark';
20393
20393
  type ChipProps = {
20394
20394
  icon?: IconType$1;
20395
- text: string;
20395
+ text: ReactNode;
20396
20396
  /** sets the size of the chip
20397
20397
  * @default 'sm'
20398
20398
  */
20399
20399
  theme?: ChipThemeProps;
20400
- chipAction?: React$1.ReactNode;
20400
+ chipAction?: React.ReactNode;
20401
20401
  size?: ChipSizeProp;
20402
- } & React$1.HTMLAttributes<HTMLSpanElement>;
20402
+ } & React.HTMLAttributes<HTMLSpanElement>;
20403
20403
  /**
20404
20404
  * @description Chips are used in a variety of ways
20405
20405
  * To represent tokens, where the value of the chip will be replaced with something dynamically.
@@ -21237,7 +21237,7 @@ interface MenuProps extends MenuHTMLProps {
21237
21237
  disableAutoSeparatorManagement?: boolean;
21238
21238
  }
21239
21239
  declare const MenuContext: React$1.Context<MenuStateReturn>;
21240
- declare const useMenuContext: () => MenuStateReturn;
21240
+ declare const useMenuContext: () => MenuStateReturn | undefined;
21241
21241
  /**
21242
21242
  * Component used for creating clickable menus
21243
21243
  * @example
@@ -21250,7 +21250,9 @@ declare const useMenuContext: () => MenuStateReturn;
21250
21250
  declare const Menu: ({ menuLabel, menuTrigger, placement, menuItemsContainerCssClasses, children, forceVisible, disableAutoSeparatorManagement, }: MenuProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
21251
21251
 
21252
21252
  type MenuGroupProps = {
21253
+ /** Title for the menu group */
21253
21254
  title: string;
21255
+ /** Menu items to render in the group */
21254
21256
  children: ReactNode;
21255
21257
  };
21256
21258
  declare const MenuGroup: ({ title, children }: MenuGroupProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
@@ -21269,6 +21271,11 @@ type MenuItemProps = MenuItemHTMLProps & {
21269
21271
  * @default 'base'
21270
21272
  */
21271
21273
  textColor?: MenuItemTextThemeProps;
21274
+ /**
21275
+ * Overrides the focus styles and forces this menu item to have highlighted/selected styles
21276
+ * Normally automatically managed.
21277
+ */
21278
+ active?: boolean;
21272
21279
  };
21273
21280
  type ChildFunction = (menuItemProps: MenuItemHTMLProps) => React$1.ReactElement | null;
21274
21281
  /**
package/dist/index.js CHANGED
@@ -11378,11 +11378,13 @@ var import_react27 = require("@emotion/react");
11378
11378
  var MenuGroupContainer = import_react27.css`
11379
11379
  display: flex;
11380
11380
  flex-direction: column;
11381
+ margin-top: var(--spacing-sm);
11381
11382
  `;
11382
11383
  var MenuTitle = import_react27.css`
11383
11384
  color: var(--gray-400);
11384
11385
  font-size: var(--fs-xs);
11385
11386
  font-weight: var(--fw-bold);
11387
+ padding: var(--spacing-xs) var(--spacing-sm);
11386
11388
  text-transform: uppercase;
11387
11389
  `;
11388
11390
 
@@ -11397,7 +11399,12 @@ var MenuGroup = ({ title, children }) => {
11397
11399
 
11398
11400
  // src/components/Menu/MenuItem.styles.ts
11399
11401
  var import_react28 = require("@emotion/react");
11400
- var menuItem = (textTheme) => import_react28.css`
11402
+ var activeMenuItem = import_react28.css`
11403
+ box-shadow: none;
11404
+ background: var(--gray-200);
11405
+ outline: none;
11406
+ `;
11407
+ var menuItem = (textTheme, forceActive) => import_react28.css`
11401
11408
  align-items: center;
11402
11409
  border: none;
11403
11410
  border-radius: var(--rounded-base);
@@ -11408,9 +11415,10 @@ var menuItem = (textTheme) => import_react28.css`
11408
11415
  font-weight: var(--fw-regular);
11409
11416
  flex-grow: 1;
11410
11417
  gap: var(--spacing-xs);
11411
- line-height: 1.5;
11418
+
11412
11419
  white-space: nowrap;
11413
11420
  transition: background-color var(--duration-fast) var(--timing-ease-out);
11421
+ ${forceActive ? activeMenuItem : ""}
11414
11422
 
11415
11423
  &:disabled {
11416
11424
  color: var(--gray-300);
@@ -11418,9 +11426,7 @@ var menuItem = (textTheme) => import_react28.css`
11418
11426
 
11419
11427
  &:hover,
11420
11428
  &:focus {
11421
- box-shadow: none;
11422
- background: var(--gray-200);
11423
- outline: none;
11429
+ ${typeof forceActive === "undefined" ? activeMenuItem : ""}
11424
11430
  }
11425
11431
  `;
11426
11432
  var menuItemWithIcon = import_react28.css`
@@ -11549,14 +11555,15 @@ var React8 = __toESM(require("react"));
11549
11555
  var import_reakit = require("reakit");
11550
11556
  var import_jsx_runtime23 = require("@emotion/react/jsx-runtime");
11551
11557
  var MenuItem = React8.forwardRef(
11552
- ({ children, className, hideMenuOnClick = true, icon, textColor = "base", ...props }, ref) => {
11558
+ ({ children, className, hideMenuOnClick = true, icon, textColor = "base", active, ...props }, ref) => {
11553
11559
  const menuState = useMenuContext();
11554
11560
  const resolveProps = (originalProps) => {
11555
11561
  const resolvedProps2 = { ...originalProps };
11556
11562
  if (resolvedProps2.onClick) {
11557
11563
  const origOnClick = resolvedProps2.onClick;
11558
11564
  resolvedProps2.onClick = (e) => {
11559
- menuState.hide();
11565
+ var _a;
11566
+ (_a = menuState == null ? void 0 : menuState.hide) == null ? void 0 : _a.call(menuState);
11560
11567
  origOnClick(e);
11561
11568
  };
11562
11569
  }
@@ -11572,7 +11579,7 @@ var MenuItem = React8.forwardRef(
11572
11579
  "data-test-id": "button-menu",
11573
11580
  ...menuState,
11574
11581
  ...resolvedProps,
11575
- css: [menuItem(textColor), typeof className === "object" ? className : void 0],
11582
+ css: [menuItem(textColor, active), typeof className === "object" ? className : void 0],
11576
11583
  className: typeof className === "string" ? className : void 0,
11577
11584
  children: icon ? renderWithIcon(resolvedChildren, icon) : resolvedChildren
11578
11585
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "19.23.0",
3
+ "version": "19.23.1-alpha.12+669adf812",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -23,8 +23,8 @@
23
23
  "@storybook/client-api": "6.5.16",
24
24
  "@storybook/react": "6.5.16",
25
25
  "@types/react": "18.2.7",
26
- "@uniformdev/canvas": "^19.23.0",
27
- "@uniformdev/richtext": "^19.23.0",
26
+ "@uniformdev/canvas": "^19.23.1-alpha.12+669adf812",
27
+ "@uniformdev/richtext": "^19.23.1-alpha.12+669adf812",
28
28
  "autoprefixer": "10.4.14",
29
29
  "hygen": "6.2.11",
30
30
  "postcss": "8.4.24",
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "35c696a78e1909a73bc290663603d015927bbe28"
70
+ "gitHead": "669adf812df13a7856fb9bc5c4332c77e0697f3f"
71
71
  }