@uniformdev/design-system 20.39.1 → 20.39.3-alpha.11

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
@@ -2275,7 +2275,15 @@ var IconInner = ({ icon, iconColor = "default", size = "1.5rem", ...otherProps }
2275
2275
  );
2276
2276
  return null;
2277
2277
  }
2278
- return /* @__PURE__ */ jsx16(IconComponent, { role: "img", size, ...otherProps, css: [IconImg, customColor[iconColor]] });
2278
+ return /* @__PURE__ */ jsx16(
2279
+ IconComponent,
2280
+ {
2281
+ role: "img",
2282
+ size,
2283
+ ...otherProps,
2284
+ css: [IconImg, iconColor ? functionalColors : void 0, customColor[iconColor]]
2285
+ }
2286
+ );
2279
2287
  };
2280
2288
  var Icon = React3.memo(IconInner);
2281
2289
 
@@ -7103,12 +7111,13 @@ var Counter = ({
7103
7111
  if (typeof count === "undefined") {
7104
7112
  return null;
7105
7113
  }
7106
- const isTripleDigits = count > 99 ? /* @__PURE__ */ jsxs39("span", { css: counterTripleValue, title: `${count}`, children: [
7114
+ const isNumber = typeof count === "number";
7115
+ const isTripleDigits = isNumber && count > 99 ? /* @__PURE__ */ jsxs39("span", { css: counterTripleValue, title: `${count}`, children: [
7107
7116
  "99",
7108
7117
  /* @__PURE__ */ jsx60(Icon, { icon: "math-plus", iconColor: "currentColor", size: "0.5rem", css: counterIcon.tripleValue })
7109
7118
  ] }) : count;
7110
7119
  const formatCount = count === 0 ? /* @__PURE__ */ jsx60("span", { css: counterZeroValue, title: `${count}` }) : isTripleDigits;
7111
- return /* @__PURE__ */ jsxs39("div", { css: [counterContainer(bgColor, Boolean(icon)), sizeStyles[size]], ...props, children: [
7120
+ return /* @__PURE__ */ jsxs39("div", { css: [counterContainer(bgColor, Boolean(icon || !isNumber)), sizeStyles[size]], ...props, children: [
7112
7121
  icon ? /* @__PURE__ */ jsx60(
7113
7122
  "span",
7114
7123
  {
@@ -12323,7 +12332,7 @@ var ParameterLabel = ({ id, asSpan, children, testId, ...props }) => {
12323
12332
  import { forwardRef as forwardRef21 } from "react";
12324
12333
  import { jsx as jsx120 } from "@emotion/react/jsx-runtime";
12325
12334
  var ParameterMenuButton = forwardRef21(
12326
- ({ label: label2, children, disabled: disabled2 }, ref) => {
12335
+ ({ label: label2, children, disabled: disabled2, withoutPortal }, ref) => {
12327
12336
  return /* @__PURE__ */ jsx120(
12328
12337
  Menu,
12329
12338
  {
@@ -12340,6 +12349,7 @@ var ParameterMenuButton = forwardRef21(
12340
12349
  children: /* @__PURE__ */ jsx120(Icon, { icon: "more-alt", iconColor: "currentColor", size: "0.9rem" })
12341
12350
  }
12342
12351
  ),
12352
+ withoutPortal,
12343
12353
  children
12344
12354
  }
12345
12355
  );
@@ -12431,6 +12441,7 @@ var ParameterShell = ({
12431
12441
  title,
12432
12442
  children,
12433
12443
  isParameterGroup = false,
12444
+ menuWithoutPortal,
12434
12445
  ...props
12435
12446
  }) => {
12436
12447
  const [manualErrorMessage, setManualErrorMessage] = useState14(void 0);
@@ -12462,7 +12473,15 @@ var ParameterShell = ({
12462
12473
  children: actionItems
12463
12474
  }
12464
12475
  ) : null,
12465
- menuItems ? /* @__PURE__ */ jsx121(ParameterMenuButton, { label: `${label2} menu`, disabled: props.disabled, children: menuItems }) : null,
12476
+ menuItems ? /* @__PURE__ */ jsx121(
12477
+ ParameterMenuButton,
12478
+ {
12479
+ label: `${label2} menu`,
12480
+ disabled: props.disabled,
12481
+ withoutPortal: menuWithoutPortal,
12482
+ children: menuItems
12483
+ }
12484
+ ) : null,
12466
12485
  /* @__PURE__ */ jsx121(
12467
12486
  ParameterShellContext.Provider,
12468
12487
  {
package/dist/index.d.mts CHANGED
@@ -1502,8 +1502,10 @@ declare const MultilineChip: ({ children, onClick, ...props }: MultilineChipProp
1502
1502
  type CounterBgColors = 'var(--white)' | 'var(--gray-50)' | 'var(--accent-light)' | 'var(--accent-dark)' | 'transparent';
1503
1503
  type CounterIconColors = 'auto' | 'var(--utility-caution-icon)' | 'var(--utility-danger-icon)' | 'var(--utility-info-icon)' | 'var(--utility-success-icon)' | 'red';
1504
1504
  type CounterProps = {
1505
- /** sets the count value, a 0 will show a dot instead of a number. Undefined will cause the counter to disappear. */
1506
- count: number | undefined;
1505
+ /** sets the count value, a 0 will show a dot instead of a number. Undefined will cause the counter to disappear.
1506
+ * String can be used for formatting purposes, e.g. "1.2k" or regionalized number, e.g. "1,200"
1507
+ */
1508
+ count: number | string | undefined;
1507
1509
  /** sets the background color
1508
1510
  * @default 'transparent'
1509
1511
  */
@@ -3372,6 +3374,8 @@ type ParameterMenuButtonProps = {
3372
3374
  label: string;
3373
3375
  children?: ReactNode;
3374
3376
  disabled?: boolean;
3377
+ /** set to true to render the menu directly in the parent DOM */
3378
+ withoutPortal?: boolean;
3375
3379
  };
3376
3380
  /** @example <ParameterMenuButton label="label value"><MenuItem>menu option component</MenuItem></ParameterMenuButton> */
3377
3381
  declare const ParameterMenuButton: React$1.ForwardRefExoticComponent<ParameterMenuButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
@@ -3734,12 +3738,15 @@ type ParameterShellOverrideProps = {
3734
3738
  */
3735
3739
  isParameterGroup?: boolean;
3736
3740
  };
3737
- type ParameterShellProps = React.InputHTMLAttributes<HTMLDivElement> & CommonParameterInputProps & ParameterShellOverrideProps;
3741
+ type ParameterShellProps = React.InputHTMLAttributes<HTMLDivElement> & CommonParameterInputProps & ParameterShellOverrideProps & {
3742
+ /** set to true to render the menu directly in the parent DOM */
3743
+ menuWithoutPortal?: boolean;
3744
+ };
3738
3745
  /**
3739
3746
  * Uniform Parameter shell component
3740
3747
  * @example <ParameterShell label="my label" id="my-id"><ParameterInput onChange={() => {}} /></ParameterShell>
3741
3748
  */
3742
- declare const ParameterShell: ({ label, labelLeadingIcon, labelTrailingIcon, hiddenLabel, id, errorMessage, warningMessage, infoMessage, caption, errorTestId, captionTestId, menuItems, actionItems, hasOverriddenValue, onResetOverriddenValue, title, children, isParameterGroup, ...props }: ParameterShellProps) => _emotion_react_jsx_runtime.JSX.Element;
3749
+ declare const ParameterShell: ({ label, labelLeadingIcon, labelTrailingIcon, hiddenLabel, id, errorMessage, warningMessage, infoMessage, caption, errorTestId, captionTestId, menuItems, actionItems, hasOverriddenValue, onResetOverriddenValue, title, children, isParameterGroup, menuWithoutPortal, ...props }: ParameterShellProps) => _emotion_react_jsx_runtime.JSX.Element;
3743
3750
  declare const ParameterShellPlaceholder: ({ children }: {
3744
3751
  children?: ReactNode;
3745
3752
  }) => _emotion_react_jsx_runtime.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1502,8 +1502,10 @@ declare const MultilineChip: ({ children, onClick, ...props }: MultilineChipProp
1502
1502
  type CounterBgColors = 'var(--white)' | 'var(--gray-50)' | 'var(--accent-light)' | 'var(--accent-dark)' | 'transparent';
1503
1503
  type CounterIconColors = 'auto' | 'var(--utility-caution-icon)' | 'var(--utility-danger-icon)' | 'var(--utility-info-icon)' | 'var(--utility-success-icon)' | 'red';
1504
1504
  type CounterProps = {
1505
- /** sets the count value, a 0 will show a dot instead of a number. Undefined will cause the counter to disappear. */
1506
- count: number | undefined;
1505
+ /** sets the count value, a 0 will show a dot instead of a number. Undefined will cause the counter to disappear.
1506
+ * String can be used for formatting purposes, e.g. "1.2k" or regionalized number, e.g. "1,200"
1507
+ */
1508
+ count: number | string | undefined;
1507
1509
  /** sets the background color
1508
1510
  * @default 'transparent'
1509
1511
  */
@@ -3372,6 +3374,8 @@ type ParameterMenuButtonProps = {
3372
3374
  label: string;
3373
3375
  children?: ReactNode;
3374
3376
  disabled?: boolean;
3377
+ /** set to true to render the menu directly in the parent DOM */
3378
+ withoutPortal?: boolean;
3375
3379
  };
3376
3380
  /** @example <ParameterMenuButton label="label value"><MenuItem>menu option component</MenuItem></ParameterMenuButton> */
3377
3381
  declare const ParameterMenuButton: React$1.ForwardRefExoticComponent<ParameterMenuButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
@@ -3734,12 +3738,15 @@ type ParameterShellOverrideProps = {
3734
3738
  */
3735
3739
  isParameterGroup?: boolean;
3736
3740
  };
3737
- type ParameterShellProps = React.InputHTMLAttributes<HTMLDivElement> & CommonParameterInputProps & ParameterShellOverrideProps;
3741
+ type ParameterShellProps = React.InputHTMLAttributes<HTMLDivElement> & CommonParameterInputProps & ParameterShellOverrideProps & {
3742
+ /** set to true to render the menu directly in the parent DOM */
3743
+ menuWithoutPortal?: boolean;
3744
+ };
3738
3745
  /**
3739
3746
  * Uniform Parameter shell component
3740
3747
  * @example <ParameterShell label="my label" id="my-id"><ParameterInput onChange={() => {}} /></ParameterShell>
3741
3748
  */
3742
- declare const ParameterShell: ({ label, labelLeadingIcon, labelTrailingIcon, hiddenLabel, id, errorMessage, warningMessage, infoMessage, caption, errorTestId, captionTestId, menuItems, actionItems, hasOverriddenValue, onResetOverriddenValue, title, children, isParameterGroup, ...props }: ParameterShellProps) => _emotion_react_jsx_runtime.JSX.Element;
3749
+ declare const ParameterShell: ({ label, labelLeadingIcon, labelTrailingIcon, hiddenLabel, id, errorMessage, warningMessage, infoMessage, caption, errorTestId, captionTestId, menuItems, actionItems, hasOverriddenValue, onResetOverriddenValue, title, children, isParameterGroup, menuWithoutPortal, ...props }: ParameterShellProps) => _emotion_react_jsx_runtime.JSX.Element;
3743
3750
  declare const ParameterShellPlaceholder: ({ children }: {
3744
3751
  children?: ReactNode;
3745
3752
  }) => _emotion_react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -3989,7 +3989,15 @@ var IconInner = ({ icon, iconColor = "default", size = "1.5rem", ...otherProps }
3989
3989
  );
3990
3990
  return null;
3991
3991
  }
3992
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconComponent, { role: "img", size, ...otherProps, css: [IconImg, customColor[iconColor]] });
3992
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3993
+ IconComponent,
3994
+ {
3995
+ role: "img",
3996
+ size,
3997
+ ...otherProps,
3998
+ css: [IconImg, iconColor ? functionalColors : void 0, customColor[iconColor]]
3999
+ }
4000
+ );
3993
4001
  };
3994
4002
  var Icon = import_react24.default.memo(IconInner);
3995
4003
 
@@ -8900,12 +8908,13 @@ var Counter = ({
8900
8908
  if (typeof count === "undefined") {
8901
8909
  return null;
8902
8910
  }
8903
- const isTripleDigits = count > 99 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { css: counterTripleValue, title: `${count}`, children: [
8911
+ const isNumber = typeof count === "number";
8912
+ const isTripleDigits = isNumber && count > 99 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { css: counterTripleValue, title: `${count}`, children: [
8904
8913
  "99",
8905
8914
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { icon: "math-plus", iconColor: "currentColor", size: "0.5rem", css: counterIcon.tripleValue })
8906
8915
  ] }) : count;
8907
8916
  const formatCount = count === 0 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { css: counterZeroValue, title: `${count}` }) : isTripleDigits;
8908
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { css: [counterContainer(bgColor, Boolean(icon)), sizeStyles[size]], ...props, children: [
8917
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { css: [counterContainer(bgColor, Boolean(icon || !isNumber)), sizeStyles[size]], ...props, children: [
8909
8918
  icon ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8910
8919
  "span",
8911
8920
  {
@@ -14251,7 +14260,7 @@ init_emotion_jsx_shim();
14251
14260
  var import_react139 = require("react");
14252
14261
  var import_jsx_runtime120 = require("@emotion/react/jsx-runtime");
14253
14262
  var ParameterMenuButton = (0, import_react139.forwardRef)(
14254
- ({ label: label2, children, disabled: disabled2 }, ref) => {
14263
+ ({ label: label2, children, disabled: disabled2, withoutPortal }, ref) => {
14255
14264
  return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
14256
14265
  Menu,
14257
14266
  {
@@ -14268,6 +14277,7 @@ var ParameterMenuButton = (0, import_react139.forwardRef)(
14268
14277
  children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon, { icon: "more-alt", iconColor: "currentColor", size: "0.9rem" })
14269
14278
  }
14270
14279
  ),
14280
+ withoutPortal,
14271
14281
  children
14272
14282
  }
14273
14283
  );
@@ -14360,6 +14370,7 @@ var ParameterShell = ({
14360
14370
  title,
14361
14371
  children,
14362
14372
  isParameterGroup = false,
14373
+ menuWithoutPortal,
14363
14374
  ...props
14364
14375
  }) => {
14365
14376
  const [manualErrorMessage, setManualErrorMessage] = (0, import_react142.useState)(void 0);
@@ -14391,7 +14402,15 @@ var ParameterShell = ({
14391
14402
  children: actionItems
14392
14403
  }
14393
14404
  ) : null,
14394
- menuItems ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ParameterMenuButton, { label: `${label2} menu`, disabled: props.disabled, children: menuItems }) : null,
14405
+ menuItems ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
14406
+ ParameterMenuButton,
14407
+ {
14408
+ label: `${label2} menu`,
14409
+ disabled: props.disabled,
14410
+ withoutPortal: menuWithoutPortal,
14411
+ children: menuItems
14412
+ }
14413
+ ) : null,
14395
14414
  /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
14396
14415
  ParameterShellContext.Provider,
14397
14416
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "20.39.1",
3
+ "version": "20.39.3-alpha.11+b3ab5fb305",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "exports": {
@@ -38,8 +38,8 @@
38
38
  "@storybook/theming": "^8.3.3",
39
39
  "@types/react": "18.3.24",
40
40
  "@types/react-dom": "18.3.7",
41
- "@uniformdev/canvas": "^20.39.1",
42
- "@uniformdev/richtext": "^20.39.1",
41
+ "@uniformdev/canvas": "^20.39.3-alpha.11+b3ab5fb305",
42
+ "@uniformdev/richtext": "^20.39.3-alpha.11+b3ab5fb305",
43
43
  "@vitest/coverage-v8": "3.2.4",
44
44
  "autoprefixer": "10.4.21",
45
45
  "hygen": "6.2.11",
@@ -93,5 +93,5 @@
93
93
  "publishConfig": {
94
94
  "access": "public"
95
95
  },
96
- "gitHead": "b30fa1c0f65428db041678384bc2565fed1e34e6"
96
+ "gitHead": "b3ab5fb305533690de4bbd859a69196b6c26ee2f"
97
97
  }