@ultraviolet/ui 1.87.0 → 1.87.2

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.
@@ -3,6 +3,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@emotion/react/jsx-runtime");
4
4
  const index = require("../Stack/index.cjs");
5
5
  const index$1 = require("../Text/index.cjs");
6
+ const LabelRequiredOrNot = ({
7
+ children,
8
+ required,
9
+ id,
10
+ size,
11
+ htmlFor
12
+ }) => required ? /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { direction: "row", gap: "0.5", alignItems: "start", children: [
13
+ /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "label", id, variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "neutral", htmlFor, prominence: "strong", children }),
14
+ /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "span", variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "danger", "aria-label": "required", children: "*" })
15
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "label", id, variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "neutral", htmlFor, prominence: "strong", children });
6
16
  const Label = ({
7
17
  children,
8
18
  labelDescription,
@@ -10,14 +20,8 @@ const Label = ({
10
20
  size = "large",
11
21
  htmlFor,
12
22
  id
13
- }) => {
14
- const LabelRequiredOrNot = () => required ? /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { direction: "row", gap: "0.5", alignItems: "start", children: [
15
- /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "label", id, variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "neutral", htmlFor, prominence: "strong", children }),
16
- /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "label", variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "danger", htmlFor, children: "*" })
17
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "label", id, variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "neutral", htmlFor, prominence: "strong", children });
18
- return labelDescription ? /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { direction: "row", gap: "1", alignItems: "center", children: [
19
- /* @__PURE__ */ jsxRuntime.jsx(LabelRequiredOrNot, {}),
20
- typeof labelDescription === "string" ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "label", variant: "bodySmall", children: labelDescription }) : labelDescription
21
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(LabelRequiredOrNot, {});
22
- };
23
+ }) => labelDescription ? /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { direction: "row", gap: "1", alignItems: "center", children: [
24
+ /* @__PURE__ */ jsxRuntime.jsx(LabelRequiredOrNot, { required, size, htmlFor, id, children }),
25
+ typeof labelDescription === "string" ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "span", variant: "bodySmall", children: labelDescription }) : labelDescription
26
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(LabelRequiredOrNot, { required, size, htmlFor, id, children });
23
27
  exports.Label = Label;
@@ -1,6 +1,16 @@
1
1
  import { jsxs, jsx } from "@emotion/react/jsx-runtime";
2
2
  import { Stack } from "../Stack/index.js";
3
3
  import { Text } from "../Text/index.js";
4
+ const LabelRequiredOrNot = ({
5
+ children,
6
+ required,
7
+ id,
8
+ size,
9
+ htmlFor
10
+ }) => required ? /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: "0.5", alignItems: "start", children: [
11
+ /* @__PURE__ */ jsx(Text, { as: "label", id, variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "neutral", htmlFor, prominence: "strong", children }),
12
+ /* @__PURE__ */ jsx(Text, { as: "span", variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "danger", "aria-label": "required", children: "*" })
13
+ ] }) : /* @__PURE__ */ jsx(Text, { as: "label", id, variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "neutral", htmlFor, prominence: "strong", children });
4
14
  const Label = ({
5
15
  children,
6
16
  labelDescription,
@@ -8,16 +18,10 @@ const Label = ({
8
18
  size = "large",
9
19
  htmlFor,
10
20
  id
11
- }) => {
12
- const LabelRequiredOrNot = () => required ? /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: "0.5", alignItems: "start", children: [
13
- /* @__PURE__ */ jsx(Text, { as: "label", id, variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "neutral", htmlFor, prominence: "strong", children }),
14
- /* @__PURE__ */ jsx(Text, { as: "label", variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "danger", htmlFor, children: "*" })
15
- ] }) : /* @__PURE__ */ jsx(Text, { as: "label", id, variant: size === "large" ? "bodyStrong" : "bodySmallStrong", sentiment: "neutral", htmlFor, prominence: "strong", children });
16
- return labelDescription ? /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: "1", alignItems: "center", children: [
17
- /* @__PURE__ */ jsx(LabelRequiredOrNot, {}),
18
- typeof labelDescription === "string" ? /* @__PURE__ */ jsx(Text, { as: "label", variant: "bodySmall", children: labelDescription }) : labelDescription
19
- ] }) : /* @__PURE__ */ jsx(LabelRequiredOrNot, {});
20
- };
21
+ }) => labelDescription ? /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: "1", alignItems: "center", children: [
22
+ /* @__PURE__ */ jsx(LabelRequiredOrNot, { required, size, htmlFor, id, children }),
23
+ typeof labelDescription === "string" ? /* @__PURE__ */ jsx(Text, { as: "span", variant: "bodySmall", children: labelDescription }) : labelDescription
24
+ ] }) : /* @__PURE__ */ jsx(LabelRequiredOrNot, { required, size, htmlFor, id, children });
21
25
  export {
22
26
  Label
23
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/ui",
3
- "version": "1.87.0",
3
+ "version": "1.87.2",
4
4
  "description": "Ultraviolet UI",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -85,7 +85,7 @@
85
85
  "react-toastify": "10.0.6",
86
86
  "react-use-clipboard": "1.0.9",
87
87
  "reakit": "1.3.11",
88
- "@ultraviolet/icons": "3.11.1",
88
+ "@ultraviolet/icons": "3.11.2",
89
89
  "@ultraviolet/themes": "1.16.0"
90
90
  },
91
91
  "scripts": {