@uniformdev/design-system 19.24.0 → 19.25.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.
- package/dist/esm/index.js +15 -8
- package/dist/index.d.ts +13 -6
- package/dist/index.js +15 -8
- package/package.json +5 -5
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
20395
|
+
text: ReactNode;
|
|
20396
20396
|
/** sets the size of the chip
|
|
20397
20397
|
* @default 'sm'
|
|
20398
20398
|
*/
|
|
20399
20399
|
theme?: ChipThemeProps;
|
|
20400
|
-
chipAction?: React
|
|
20400
|
+
chipAction?: React.ReactNode;
|
|
20401
20401
|
size?: ChipSizeProp;
|
|
20402
|
-
} & React
|
|
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
|
/**
|
|
@@ -22135,8 +22142,8 @@ interface RouteProps {
|
|
|
22135
22142
|
as?: string;
|
|
22136
22143
|
href: string;
|
|
22137
22144
|
}
|
|
22138
|
-
type PageHeaderSectionProps = React$1.HTMLAttributes<
|
|
22139
|
-
title:
|
|
22145
|
+
type PageHeaderSectionProps = Omit<React$1.HTMLAttributes<HTMLHeadingElement>, 'title'> & {
|
|
22146
|
+
title: React$1.ReactNode;
|
|
22140
22147
|
desc?: React$1.ReactNode;
|
|
22141
22148
|
children?: React$1.ReactNode;
|
|
22142
22149
|
linkProps?: RouteProps;
|
package/dist/index.js
CHANGED
|
@@ -11377,11 +11377,13 @@ var import_react27 = require("@emotion/react");
|
|
|
11377
11377
|
var MenuGroupContainer = import_react27.css`
|
|
11378
11378
|
display: flex;
|
|
11379
11379
|
flex-direction: column;
|
|
11380
|
+
margin-top: var(--spacing-sm);
|
|
11380
11381
|
`;
|
|
11381
11382
|
var MenuTitle = import_react27.css`
|
|
11382
11383
|
color: var(--gray-400);
|
|
11383
11384
|
font-size: var(--fs-xs);
|
|
11384
11385
|
font-weight: var(--fw-bold);
|
|
11386
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
11385
11387
|
text-transform: uppercase;
|
|
11386
11388
|
`;
|
|
11387
11389
|
|
|
@@ -11396,7 +11398,12 @@ var MenuGroup = ({ title, children }) => {
|
|
|
11396
11398
|
|
|
11397
11399
|
// src/components/Menu/MenuItem.styles.ts
|
|
11398
11400
|
var import_react28 = require("@emotion/react");
|
|
11399
|
-
var
|
|
11401
|
+
var activeMenuItem = import_react28.css`
|
|
11402
|
+
box-shadow: none;
|
|
11403
|
+
background: var(--gray-200);
|
|
11404
|
+
outline: none;
|
|
11405
|
+
`;
|
|
11406
|
+
var menuItem = (textTheme, forceActive) => import_react28.css`
|
|
11400
11407
|
align-items: center;
|
|
11401
11408
|
border: none;
|
|
11402
11409
|
border-radius: var(--rounded-base);
|
|
@@ -11407,9 +11414,10 @@ var menuItem = (textTheme) => import_react28.css`
|
|
|
11407
11414
|
font-weight: var(--fw-regular);
|
|
11408
11415
|
flex-grow: 1;
|
|
11409
11416
|
gap: var(--spacing-xs);
|
|
11410
|
-
|
|
11417
|
+
|
|
11411
11418
|
white-space: nowrap;
|
|
11412
11419
|
transition: background-color var(--duration-fast) var(--timing-ease-out);
|
|
11420
|
+
${forceActive ? activeMenuItem : ""}
|
|
11413
11421
|
|
|
11414
11422
|
&:disabled {
|
|
11415
11423
|
color: var(--gray-300);
|
|
@@ -11417,9 +11425,7 @@ var menuItem = (textTheme) => import_react28.css`
|
|
|
11417
11425
|
|
|
11418
11426
|
&:hover,
|
|
11419
11427
|
&:focus {
|
|
11420
|
-
|
|
11421
|
-
background: var(--gray-200);
|
|
11422
|
-
outline: none;
|
|
11428
|
+
${typeof forceActive === "undefined" ? activeMenuItem : ""}
|
|
11423
11429
|
}
|
|
11424
11430
|
`;
|
|
11425
11431
|
var menuItemWithIcon = import_react28.css`
|
|
@@ -11548,14 +11554,15 @@ var React8 = __toESM(require("react"));
|
|
|
11548
11554
|
var import_reakit = require("reakit");
|
|
11549
11555
|
var import_jsx_runtime23 = require("@emotion/react/jsx-runtime");
|
|
11550
11556
|
var MenuItem = React8.forwardRef(
|
|
11551
|
-
({ children, className, hideMenuOnClick = true, icon, textColor = "base", ...props }, ref) => {
|
|
11557
|
+
({ children, className, hideMenuOnClick = true, icon, textColor = "base", active, ...props }, ref) => {
|
|
11552
11558
|
const menuState = useMenuContext();
|
|
11553
11559
|
const resolveProps = (originalProps) => {
|
|
11554
11560
|
const resolvedProps2 = { ...originalProps };
|
|
11555
11561
|
if (resolvedProps2.onClick) {
|
|
11556
11562
|
const origOnClick = resolvedProps2.onClick;
|
|
11557
11563
|
resolvedProps2.onClick = (e) => {
|
|
11558
|
-
|
|
11564
|
+
var _a;
|
|
11565
|
+
(_a = menuState == null ? void 0 : menuState.hide) == null ? void 0 : _a.call(menuState);
|
|
11559
11566
|
origOnClick(e);
|
|
11560
11567
|
};
|
|
11561
11568
|
}
|
|
@@ -11571,7 +11578,7 @@ var MenuItem = React8.forwardRef(
|
|
|
11571
11578
|
"data-test-id": "button-menu",
|
|
11572
11579
|
...menuState,
|
|
11573
11580
|
...resolvedProps,
|
|
11574
|
-
css: [menuItem(textColor), typeof className === "object" ? className : void 0],
|
|
11581
|
+
css: [menuItem(textColor, active), typeof className === "object" ? className : void 0],
|
|
11575
11582
|
className: typeof className === "string" ? className : void 0,
|
|
11576
11583
|
children: icon ? renderWithIcon(resolvedChildren, icon) : resolvedChildren
|
|
11577
11584
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/design-system",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.25.0",
|
|
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.
|
|
27
|
-
"@uniformdev/richtext": "^19.
|
|
26
|
+
"@uniformdev/canvas": "^19.25.0",
|
|
27
|
+
"@uniformdev/richtext": "^19.25.0",
|
|
28
28
|
"autoprefixer": "10.4.14",
|
|
29
29
|
"hygen": "6.2.11",
|
|
30
30
|
"postcss": "8.4.24",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@emotion/css": "^11.11.0",
|
|
37
|
-
"@emotion/react": "11.11.
|
|
37
|
+
"@emotion/react": "11.11.1",
|
|
38
38
|
"@lexical/code": "^0.11.1",
|
|
39
39
|
"@lexical/link": "^0.11.0",
|
|
40
40
|
"@lexical/list": "^0.11.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "cb76e00b562db60df1804aa968906f2297079ed2"
|
|
71
71
|
}
|