@uniformdev/design-system 20.74.1 → 20.74.2-alpha.26

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
@@ -3034,13 +3034,13 @@ var ToastEntry = ({ toast: entry }) => {
3034
3034
  const duration = (_a = entry.timeout) != null ? _a : defaultTimeoutMs;
3035
3035
  const showCountdown = duration > 0 && entry.type !== "loading" && (data == null ? void 0 : data.kind) !== "progress";
3036
3036
  if ((data == null ? void 0 : data.kind) === "progress") {
3037
- return /* @__PURE__ */ jsxs6(BaseToast.Root, { toast: entry, css: toastRootStyles, children: [
3037
+ return /* @__PURE__ */ jsxs6(BaseToast.Root, { toast: entry, css: toastRootStyles, "data-testid": "toast", children: [
3038
3038
  /* @__PURE__ */ jsx14("div", { css: toastBodyStyles, "data-testid": "toast-body", children: /* @__PURE__ */ jsx14(BaseToast.Description, { css: toastDescriptionStyles, children: data.label }) }),
3039
3039
  /* @__PURE__ */ jsx14(Progress.Root, { value: Math.max(0, Math.min(1, data.progress)) * 100, css: toastProgressRootStyles, children: /* @__PURE__ */ jsx14(Progress.Track, { css: toastProgressTrackStyles, children: /* @__PURE__ */ jsx14(Progress.Indicator, { css: toastProgressIndicatorStyles }) }) })
3040
3040
  ] });
3041
3041
  }
3042
3042
  if ((data == null ? void 0 : data.kind) === "undoable") {
3043
- return /* @__PURE__ */ jsxs6(BaseToast.Root, { toast: entry, css: toastRootStyles, children: [
3043
+ return /* @__PURE__ */ jsxs6(BaseToast.Root, { toast: entry, css: toastRootStyles, "data-testid": "toast", children: [
3044
3044
  /* @__PURE__ */ jsx14(ToastTypeIcon, { type: entry.type }),
3045
3045
  /* @__PURE__ */ jsxs6("div", { css: toastBodyStyles, "data-testid": "toast-body", children: [
3046
3046
  /* @__PURE__ */ jsx14(BaseToast.Description, { css: toastDescriptionStyles, children: data.description }),
@@ -3049,6 +3049,7 @@ var ToastEntry = ({ toast: entry }) => {
3049
3049
  {
3050
3050
  type: "button",
3051
3051
  css: toastUndoButtonStyles,
3052
+ "data-testid": "toast-undo-button",
3052
3053
  onClick: () => {
3053
3054
  data.onUndo();
3054
3055
  toastManager.close(entry.id);
@@ -3057,14 +3058,14 @@ var ToastEntry = ({ toast: entry }) => {
3057
3058
  }
3058
3059
  )
3059
3060
  ] }),
3060
- /* @__PURE__ */ jsx14(BaseToast.Close, { css: toastCloseButtonStyles, "aria-label": "Close", children: /* @__PURE__ */ jsx14(Icon, { icon: CgClose, size: "1rem", iconColor: "currentColor" }) }),
3061
+ /* @__PURE__ */ jsx14(BaseToast.Close, { css: toastCloseButtonStyles, "aria-label": "Close", "data-testid": "toast-close-button", children: /* @__PURE__ */ jsx14(Icon, { icon: CgClose, size: "1rem", iconColor: "currentColor" }) }),
3061
3062
  showCountdown ? /* @__PURE__ */ jsx14(ToastCountdownBar, { duration }) : null
3062
3063
  ] });
3063
3064
  }
3064
- return /* @__PURE__ */ jsxs6(BaseToast.Root, { toast: entry, css: toastRootStyles, children: [
3065
+ return /* @__PURE__ */ jsxs6(BaseToast.Root, { toast: entry, css: toastRootStyles, "data-testid": "toast", children: [
3065
3066
  /* @__PURE__ */ jsx14(ToastTypeIcon, { type: entry.type }),
3066
3067
  /* @__PURE__ */ jsx14("div", { css: toastBodyStyles, "data-testid": "toast-body", children: /* @__PURE__ */ jsx14(BaseToast.Description, { css: toastDescriptionStyles, children: entry.description }) }),
3067
- /* @__PURE__ */ jsx14(BaseToast.Close, { css: toastCloseButtonStyles, "aria-label": "Close", children: /* @__PURE__ */ jsx14(Icon, { icon: CgClose, size: "1rem", iconColor: "currentColor" }) }),
3068
+ /* @__PURE__ */ jsx14(BaseToast.Close, { css: toastCloseButtonStyles, "aria-label": "Close", "data-testid": "toast-close-button", children: /* @__PURE__ */ jsx14(Icon, { icon: CgClose, size: "1rem", iconColor: "currentColor" }) }),
3068
3069
  showCountdown ? /* @__PURE__ */ jsx14(ToastCountdownBar, { duration }) : null
3069
3070
  ] });
3070
3071
  };
@@ -5729,11 +5730,6 @@ function fieldsetContainer(invert) {
5729
5730
  border: 1px solid var(--gray-300);
5730
5731
 
5731
5732
  padding: var(--spacing-base);
5732
-
5733
- // auto apply margins to child elements
5734
- > *:not(legend) {
5735
- margin-top: var(--spacing-base);
5736
- }
5737
5733
  `;
5738
5734
  return invert ? [
5739
5735
  css33`
@@ -5757,16 +5753,24 @@ var fieldsetLegend = css33`
5757
5753
  margin-bottom: var(--spacing-base);
5758
5754
  float: left; // allows the legend to be inside the fieldset and not sat on the border line
5759
5755
  `;
5756
+ var fieldsetAction = css33`
5757
+ float: right;
5758
+ margin-bottom: var(--spacing-base);
5759
+ margin-left: var(--spacing-sm);
5760
+ `;
5760
5761
  var fieldsetBody = css33`
5761
- clear: left;
5762
+ // Clears both so an actionButton floated right cannot spill into the fields.
5763
+ clear: both;
5764
+ margin-top: var(--spacing-base);
5762
5765
  `;
5763
5766
 
5764
5767
  // src/components/Input/Fieldset.tsx
5765
5768
  import { jsx as jsx37, jsxs as jsxs24 } from "@emotion/react/jsx-runtime";
5766
5769
  var Fieldset = React10.forwardRef(
5767
- ({ legend, disabled: disabled2, children, invert, ...props }, ref) => {
5770
+ ({ legend, disabled: disabled2, children, invert, actionButton, ...props }, ref) => {
5768
5771
  return /* @__PURE__ */ jsxs24("fieldset", { css: fieldsetContainer(Boolean(invert)), ref, disabled: disabled2, ...props, children: [
5769
5772
  legend,
5773
+ actionButton ? /* @__PURE__ */ jsx37("div", { css: fieldsetAction, children: actionButton }) : null,
5770
5774
  /* @__PURE__ */ jsx37("div", { css: fieldsetBody, children })
5771
5775
  ] });
5772
5776
  }
@@ -7701,18 +7705,38 @@ var Link = React13.forwardRef(
7701
7705
  );
7702
7706
  Link.displayName = "Link";
7703
7707
  var LinkWithRef = React13.forwardRef(
7704
- ({ linkManagerComponent: LinkManager, href, as, onClick, linkColor = "default", children, text, ...props }, ref) => /* @__PURE__ */ jsx55(
7705
- LinkManager,
7706
- {
7707
- ...props,
7708
- as,
7709
- href,
7710
- ref,
7711
- css: [link, textColor[linkColor]],
7712
- onClick,
7713
- children: text != null ? text : children
7714
- }
7715
- )
7708
+ ({
7709
+ linkManagerComponent: LinkManager,
7710
+ href,
7711
+ as,
7712
+ onClick,
7713
+ external,
7714
+ linkColor = "default",
7715
+ children,
7716
+ text,
7717
+ ...props
7718
+ }, ref) => {
7719
+ const externalAttrs = external ? {
7720
+ target: "_blank",
7721
+ rel: "noreferrer noopener"
7722
+ } : {};
7723
+ return /* @__PURE__ */ jsxs37(
7724
+ LinkManager,
7725
+ {
7726
+ ...props,
7727
+ ...externalAttrs,
7728
+ as,
7729
+ href,
7730
+ ref,
7731
+ css: [link, textColor[linkColor]],
7732
+ onClick,
7733
+ children: [
7734
+ text != null ? text : children,
7735
+ external ? /* @__PURE__ */ jsx55(Icon, { icon: CgExternal, iconColor: "currentColor", size: 20 }) : null
7736
+ ]
7737
+ }
7738
+ );
7739
+ }
7716
7740
  );
7717
7741
  LinkWithRef.displayName = "LinkWithRef";
7718
7742
 
@@ -9284,7 +9308,9 @@ var descriptionListLabelStyles = css55`
9284
9308
  `;
9285
9309
  var descriptionListValueStyles = css55`
9286
9310
  display: flex;
9311
+ min-width: 0;
9287
9312
  margin: 0;
9313
+ overflow-wrap: anywhere;
9288
9314
  `;
9289
9315
 
9290
9316
  // src/components/DescriptionList/DescriptionList.tsx
package/dist/index.d.mts CHANGED
@@ -2252,6 +2252,11 @@ type FieldsetProps = React$1.HTMLAttributes<HTMLFieldSetElement> & {
2252
2252
  legend: React$1.ReactElement;
2253
2253
  /** sets the disabled value and sets child inputs disabled */
2254
2254
  disabled?: boolean;
2255
+ /**
2256
+ * Optional control rendered on the legend's row, aligned to the right edge. Use it for an action that
2257
+ * applies to the group as a whole (remove, reset). Give it an accessible name: it sits inside the
2258
+ * fieldset, so it is also disabled along with the fields when `disabled` is set.
2259
+ */
2255
2260
  actionButton?: React$1.ReactElement;
2256
2261
  children: React$1.ReactNode;
2257
2262
  /** Inverts the background to white for use on forms that already have a gray background */
@@ -2263,6 +2268,11 @@ declare const Fieldset: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes
2263
2268
  legend: React$1.ReactElement;
2264
2269
  /** sets the disabled value and sets child inputs disabled */
2265
2270
  disabled?: boolean;
2271
+ /**
2272
+ * Optional control rendered on the legend's row, aligned to the right edge. Use it for an action that
2273
+ * applies to the group as a whole (remove, reset). Give it an accessible name: it sits inside the
2274
+ * fieldset, so it is also disabled along with the fields when `disabled` is set.
2275
+ */
2266
2276
  actionButton?: React$1.ReactElement;
2267
2277
  children: React$1.ReactNode;
2268
2278
  /** Inverts the background to white for use on forms that already have a gray background */
package/dist/index.d.ts CHANGED
@@ -2252,6 +2252,11 @@ type FieldsetProps = React$1.HTMLAttributes<HTMLFieldSetElement> & {
2252
2252
  legend: React$1.ReactElement;
2253
2253
  /** sets the disabled value and sets child inputs disabled */
2254
2254
  disabled?: boolean;
2255
+ /**
2256
+ * Optional control rendered on the legend's row, aligned to the right edge. Use it for an action that
2257
+ * applies to the group as a whole (remove, reset). Give it an accessible name: it sits inside the
2258
+ * fieldset, so it is also disabled along with the fields when `disabled` is set.
2259
+ */
2255
2260
  actionButton?: React$1.ReactElement;
2256
2261
  children: React$1.ReactNode;
2257
2262
  /** Inverts the background to white for use on forms that already have a gray background */
@@ -2263,6 +2268,11 @@ declare const Fieldset: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes
2263
2268
  legend: React$1.ReactElement;
2264
2269
  /** sets the disabled value and sets child inputs disabled */
2265
2270
  disabled?: boolean;
2271
+ /**
2272
+ * Optional control rendered on the legend's row, aligned to the right edge. Use it for an action that
2273
+ * applies to the group as a whole (remove, reset). Give it an accessible name: it sits inside the
2274
+ * fieldset, so it is also disabled along with the fields when `disabled` is set.
2275
+ */
2266
2276
  actionButton?: React$1.ReactElement;
2267
2277
  children: React$1.ReactNode;
2268
2278
  /** Inverts the background to white for use on forms that already have a gray background */
package/dist/index.js CHANGED
@@ -4795,13 +4795,13 @@ var ToastEntry = ({ toast: entry }) => {
4795
4795
  const duration = (_a = entry.timeout) != null ? _a : defaultTimeoutMs;
4796
4796
  const showCountdown = duration > 0 && entry.type !== "loading" && (data == null ? void 0 : data.kind) !== "progress";
4797
4797
  if ((data == null ? void 0 : data.kind) === "progress") {
4798
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_toast.Toast.Root, { toast: entry, css: toastRootStyles, children: [
4798
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_toast.Toast.Root, { toast: entry, css: toastRootStyles, "data-testid": "toast", children: [
4799
4799
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { css: toastBodyStyles, "data-testid": "toast-body", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_toast.Toast.Description, { css: toastDescriptionStyles, children: data.label }) }),
4800
4800
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_progress.Progress.Root, { value: Math.max(0, Math.min(1, data.progress)) * 100, css: toastProgressRootStyles, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_progress.Progress.Track, { css: toastProgressTrackStyles, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_progress.Progress.Indicator, { css: toastProgressIndicatorStyles }) }) })
4801
4801
  ] });
4802
4802
  }
4803
4803
  if ((data == null ? void 0 : data.kind) === "undoable") {
4804
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_toast.Toast.Root, { toast: entry, css: toastRootStyles, children: [
4804
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_toast.Toast.Root, { toast: entry, css: toastRootStyles, "data-testid": "toast", children: [
4805
4805
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToastTypeIcon, { type: entry.type }),
4806
4806
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { css: toastBodyStyles, "data-testid": "toast-body", children: [
4807
4807
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_toast.Toast.Description, { css: toastDescriptionStyles, children: data.description }),
@@ -4810,6 +4810,7 @@ var ToastEntry = ({ toast: entry }) => {
4810
4810
  {
4811
4811
  type: "button",
4812
4812
  css: toastUndoButtonStyles,
4813
+ "data-testid": "toast-undo-button",
4813
4814
  onClick: () => {
4814
4815
  data.onUndo();
4815
4816
  toastManager.close(entry.id);
@@ -4818,14 +4819,14 @@ var ToastEntry = ({ toast: entry }) => {
4818
4819
  }
4819
4820
  )
4820
4821
  ] }),
4821
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_toast.Toast.Close, { css: toastCloseButtonStyles, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { icon: import_CgClose2.CgClose, size: "1rem", iconColor: "currentColor" }) }),
4822
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_toast.Toast.Close, { css: toastCloseButtonStyles, "aria-label": "Close", "data-testid": "toast-close-button", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { icon: import_CgClose2.CgClose, size: "1rem", iconColor: "currentColor" }) }),
4822
4823
  showCountdown ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToastCountdownBar, { duration }) : null
4823
4824
  ] });
4824
4825
  }
4825
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_toast.Toast.Root, { toast: entry, css: toastRootStyles, children: [
4826
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_toast.Toast.Root, { toast: entry, css: toastRootStyles, "data-testid": "toast", children: [
4826
4827
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToastTypeIcon, { type: entry.type }),
4827
4828
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { css: toastBodyStyles, "data-testid": "toast-body", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_toast.Toast.Description, { css: toastDescriptionStyles, children: entry.description }) }),
4828
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_toast.Toast.Close, { css: toastCloseButtonStyles, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { icon: import_CgClose2.CgClose, size: "1rem", iconColor: "currentColor" }) }),
4829
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_toast.Toast.Close, { css: toastCloseButtonStyles, "aria-label": "Close", "data-testid": "toast-close-button", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { icon: import_CgClose2.CgClose, size: "1rem", iconColor: "currentColor" }) }),
4829
4830
  showCountdown ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToastCountdownBar, { duration }) : null
4830
4831
  ] });
4831
4832
  };
@@ -7558,11 +7559,6 @@ function fieldsetContainer(invert) {
7558
7559
  border: 1px solid var(--gray-300);
7559
7560
 
7560
7561
  padding: var(--spacing-base);
7561
-
7562
- // auto apply margins to child elements
7563
- > *:not(legend) {
7564
- margin-top: var(--spacing-base);
7565
- }
7566
7562
  `;
7567
7563
  return invert ? [
7568
7564
  import_react48.css`
@@ -7586,16 +7582,24 @@ var fieldsetLegend = import_react48.css`
7586
7582
  margin-bottom: var(--spacing-base);
7587
7583
  float: left; // allows the legend to be inside the fieldset and not sat on the border line
7588
7584
  `;
7585
+ var fieldsetAction = import_react48.css`
7586
+ float: right;
7587
+ margin-bottom: var(--spacing-base);
7588
+ margin-left: var(--spacing-sm);
7589
+ `;
7589
7590
  var fieldsetBody = import_react48.css`
7590
- clear: left;
7591
+ // Clears both so an actionButton floated right cannot spill into the fields.
7592
+ clear: both;
7593
+ margin-top: var(--spacing-base);
7591
7594
  `;
7592
7595
 
7593
7596
  // src/components/Input/Fieldset.tsx
7594
7597
  var import_jsx_runtime37 = require("@emotion/react/jsx-runtime");
7595
7598
  var Fieldset = React10.forwardRef(
7596
- ({ legend, disabled: disabled2, children, invert, ...props }, ref) => {
7599
+ ({ legend, disabled: disabled2, children, invert, actionButton, ...props }, ref) => {
7597
7600
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("fieldset", { css: fieldsetContainer(Boolean(invert)), ref, disabled: disabled2, ...props, children: [
7598
7601
  legend,
7602
+ actionButton ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { css: fieldsetAction, children: actionButton }) : null,
7599
7603
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { css: fieldsetBody, children })
7600
7604
  ] });
7601
7605
  }
@@ -9546,18 +9550,38 @@ var Link = React13.forwardRef(
9546
9550
  );
9547
9551
  Link.displayName = "Link";
9548
9552
  var LinkWithRef = React13.forwardRef(
9549
- ({ linkManagerComponent: LinkManager, href, as, onClick, linkColor = "default", children, text, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
9550
- LinkManager,
9551
- {
9552
- ...props,
9553
- as,
9554
- href,
9555
- ref,
9556
- css: [link, textColor[linkColor]],
9557
- onClick,
9558
- children: text != null ? text : children
9559
- }
9560
- )
9553
+ ({
9554
+ linkManagerComponent: LinkManager,
9555
+ href,
9556
+ as,
9557
+ onClick,
9558
+ external,
9559
+ linkColor = "default",
9560
+ children,
9561
+ text,
9562
+ ...props
9563
+ }, ref) => {
9564
+ const externalAttrs = external ? {
9565
+ target: "_blank",
9566
+ rel: "noreferrer noopener"
9567
+ } : {};
9568
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
9569
+ LinkManager,
9570
+ {
9571
+ ...props,
9572
+ ...externalAttrs,
9573
+ as,
9574
+ href,
9575
+ ref,
9576
+ css: [link, textColor[linkColor]],
9577
+ onClick,
9578
+ children: [
9579
+ text != null ? text : children,
9580
+ external ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { icon: import_CgExternal2.CgExternal, iconColor: "currentColor", size: 20 }) : null
9581
+ ]
9582
+ }
9583
+ );
9584
+ }
9561
9585
  );
9562
9586
  LinkWithRef.displayName = "LinkWithRef";
9563
9587
 
@@ -11166,7 +11190,9 @@ var descriptionListLabelStyles = import_react84.css`
11166
11190
  `;
11167
11191
  var descriptionListValueStyles = import_react84.css`
11168
11192
  display: flex;
11193
+ min-width: 0;
11169
11194
  margin: 0;
11195
+ overflow-wrap: anywhere;
11170
11196
  `;
11171
11197
 
11172
11198
  // src/components/DescriptionList/DescriptionList.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "20.74.1",
3
+ "version": "20.74.2-alpha.26+464c3f6dc2",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "exports": {
@@ -34,8 +34,8 @@
34
34
  "@storybook/react-vite": "10.4.6",
35
35
  "@types/react": "19.2.17",
36
36
  "@types/react-dom": "19.2.3",
37
- "@uniformdev/canvas": "^20.74.1",
38
- "@uniformdev/richtext": "^20.74.1",
37
+ "@uniformdev/canvas": "^20.74.2-alpha.26+464c3f6dc2",
38
+ "@uniformdev/richtext": "^20.74.2-alpha.26+464c3f6dc2",
39
39
  "autoprefixer": "10.5.0",
40
40
  "hygen": "6.2.11",
41
41
  "jsdom": "29.1.1",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "92f9b8945a45169eaa57d41dbb7ba8d3a32564cd"
85
+ "gitHead": "464c3f6dc27746f5e89e2f61542ed2c458c35cc5"
86
86
  }