@cerberus-design/react 0.1.3-next-9be4883 → 0.1.3-next-cb1c11b

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.
@@ -27,14 +27,14 @@ function Label(props) {
27
27
  ),
28
28
  children: [
29
29
  props.children,
30
- /* @__PURE__ */ jsx(Show, { when: !required, children: /* @__PURE__ */ jsx(
30
+ /* @__PURE__ */ jsx(Show, { when: required, children: /* @__PURE__ */ jsx(
31
31
  "span",
32
32
  {
33
33
  className: css({
34
34
  color: "neutral.text.100",
35
35
  fontSize: "inherit"
36
36
  }),
37
- children: "(optional)"
37
+ children: "(required)"
38
38
  }
39
39
  ) })
40
40
  ]
@@ -45,4 +45,4 @@ function Label(props) {
45
45
  export {
46
46
  Label
47
47
  };
48
- //# sourceMappingURL=chunk-46TCLT7U.js.map
48
+ //# sourceMappingURL=chunk-EYZ3S36P.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Label.tsx"],"sourcesContent":["'use client'\n\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { label } from '@cerberus/styled-system/recipes'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { useFieldContext } from '../context/field'\nimport { Show } from './Show'\nimport { hstack } from '@cerberus/styled-system/patterns'\n\n/**\n * This module contains the Label component.\n * @module\n */\n\nexport interface LabelProps extends HTMLAttributes<HTMLLabelElement> {\n htmlFor: string\n hidden?: boolean\n}\n\n/**\n * A screen ready friendly label component.\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @definition [Label docs](https://cerberus.digitalu.design/react/label)\n * @example\n * ```tsx\n * <Field required>\n * <Label htmlFor=\"test\">Test Label</Label>\n * </Field>\n * ```\n */\nexport function Label(props: PropsWithChildren<LabelProps>) {\n const { hidden, ...nativeProps } = props\n const { required } = useFieldContext()\n const usage = hidden ? 'hidden' : 'visible'\n\n return (\n <label\n {...nativeProps}\n className={cx(\n nativeProps.className,\n label({ usage }),\n hstack({\n justify: 'space-between',\n }),\n )}\n >\n {props.children}\n <Show when={!required}>\n <span\n className={css({\n color: 'neutral.text.100',\n fontSize: 'inherit',\n })}\n >\n (optional)\n </span>\n </Show>\n </label>\n )\n}\n"],"mappings":";;;;;;;;AAGA,SAAS,aAAa;AACtB,SAAS,KAAK,UAAU;AAGxB,SAAS,cAAc;AA6BnB,SAYI,KAZJ;AANG,SAAS,MAAM,OAAsC;AAC1D,QAAM,EAAE,QAAQ,GAAG,YAAY,IAAI;AACnC,QAAM,EAAE,SAAS,IAAI,gBAAgB;AACrC,QAAM,QAAQ,SAAS,WAAW;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,MAAM,EAAE,MAAM,CAAC;AAAA,QACf,OAAO;AAAA,UACL,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AAAA,MAEC;AAAA,cAAM;AAAA,QACP,oBAAC,QAAK,MAAM,CAAC,UACX;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,IAAI;AAAA,cACb,OAAO;AAAA,cACP,UAAU;AAAA,YACZ,CAAC;AAAA,YACF;AAAA;AAAA,QAED,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/Label.tsx"],"sourcesContent":["'use client'\n\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { label } from '@cerberus/styled-system/recipes'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { useFieldContext } from '../context/field'\nimport { Show } from './Show'\nimport { hstack } from '@cerberus/styled-system/patterns'\n\n/**\n * This module contains the Label component.\n * @module\n */\n\nexport interface LabelProps extends HTMLAttributes<HTMLLabelElement> {\n htmlFor: string\n hidden?: boolean\n}\n\n/**\n * A screen ready friendly label component.\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @definition [Label docs](https://cerberus.digitalu.design/react/label)\n * @example\n * ```tsx\n * <Field required>\n * <Label htmlFor=\"test\">Test Label</Label>\n * </Field>\n * ```\n */\nexport function Label(props: PropsWithChildren<LabelProps>) {\n const { hidden, ...nativeProps } = props\n const { required } = useFieldContext()\n const usage = hidden ? 'hidden' : 'visible'\n\n return (\n <label\n {...nativeProps}\n className={cx(\n nativeProps.className,\n label({ usage }),\n hstack({\n justify: 'space-between',\n }),\n )}\n >\n {props.children}\n <Show when={required}>\n <span\n className={css({\n color: 'neutral.text.100',\n fontSize: 'inherit',\n })}\n >\n (required)\n </span>\n </Show>\n </label>\n )\n}\n"],"mappings":";;;;;;;;AAGA,SAAS,aAAa;AACtB,SAAS,KAAK,UAAU;AAGxB,SAAS,cAAc;AA6BnB,SAYI,KAZJ;AANG,SAAS,MAAM,OAAsC;AAC1D,QAAM,EAAE,QAAQ,GAAG,YAAY,IAAI;AACnC,QAAM,EAAE,SAAS,IAAI,gBAAgB;AACrC,QAAM,QAAQ,SAAS,WAAW;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,MAAM,EAAE,MAAM,CAAC;AAAA,QACf,OAAO;AAAA,UACL,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AAAA,MAEC;AAAA,cAAM;AAAA,QACP,oBAAC,QAAK,MAAM,UACV;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,IAAI;AAAA,cACb,OAAO;AAAA,cACP,UAAU;AAAA,YACZ,CAAC;AAAA,YACF;AAAA;AAAA,QAED,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Label
4
- } from "../chunk-46TCLT7U.js";
4
+ } from "../chunk-EYZ3S36P.js";
5
5
  import "../chunk-R4H3352X.js";
6
6
  import "../chunk-KETL4ZJK.js";
7
7
  export {
@@ -34,7 +34,7 @@ import {
34
34
  } from "./chunk-BPIYUAYS.js";
35
35
  import {
36
36
  Label
37
- } from "./chunk-46TCLT7U.js";
37
+ } from "./chunk-EYZ3S36P.js";
38
38
  import {
39
39
  Show
40
40
  } from "./chunk-R4H3352X.js";
@@ -27,14 +27,14 @@ function Label(props) {
27
27
  ),
28
28
  children: [
29
29
  props.children,
30
- /* @__PURE__ */ jsx(Show, { when: !required, children: /* @__PURE__ */ jsx(
30
+ /* @__PURE__ */ jsx(Show, { when: required, children: /* @__PURE__ */ jsx(
31
31
  "span",
32
32
  {
33
33
  className: css({
34
34
  color: "neutral.text.100",
35
35
  fontSize: "inherit"
36
36
  }),
37
- children: "(optional)"
37
+ children: "(required)"
38
38
  }
39
39
  ) })
40
40
  ]
@@ -45,4 +45,4 @@ function Label(props) {
45
45
  export {
46
46
  Label
47
47
  };
48
- //# sourceMappingURL=chunk-46TCLT7U.js.map
48
+ //# sourceMappingURL=chunk-EYZ3S36P.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Label.tsx"],"sourcesContent":["'use client'\n\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { label } from '@cerberus/styled-system/recipes'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { useFieldContext } from '../context/field'\nimport { Show } from './Show'\nimport { hstack } from '@cerberus/styled-system/patterns'\n\n/**\n * This module contains the Label component.\n * @module\n */\n\nexport interface LabelProps extends HTMLAttributes<HTMLLabelElement> {\n htmlFor: string\n hidden?: boolean\n}\n\n/**\n * A screen ready friendly label component.\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @definition [Label docs](https://cerberus.digitalu.design/react/label)\n * @example\n * ```tsx\n * <Field required>\n * <Label htmlFor=\"test\">Test Label</Label>\n * </Field>\n * ```\n */\nexport function Label(props: PropsWithChildren<LabelProps>) {\n const { hidden, ...nativeProps } = props\n const { required } = useFieldContext()\n const usage = hidden ? 'hidden' : 'visible'\n\n return (\n <label\n {...nativeProps}\n className={cx(\n nativeProps.className,\n label({ usage }),\n hstack({\n justify: 'space-between',\n }),\n )}\n >\n {props.children}\n <Show when={!required}>\n <span\n className={css({\n color: 'neutral.text.100',\n fontSize: 'inherit',\n })}\n >\n (optional)\n </span>\n </Show>\n </label>\n )\n}\n"],"mappings":";;;;;;;;AAGA,SAAS,aAAa;AACtB,SAAS,KAAK,UAAU;AAGxB,SAAS,cAAc;AA6BnB,SAYI,KAZJ;AANG,SAAS,MAAM,OAAsC;AAC1D,QAAM,EAAE,QAAQ,GAAG,YAAY,IAAI;AACnC,QAAM,EAAE,SAAS,IAAI,gBAAgB;AACrC,QAAM,QAAQ,SAAS,WAAW;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,MAAM,EAAE,MAAM,CAAC;AAAA,QACf,OAAO;AAAA,UACL,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AAAA,MAEC;AAAA,cAAM;AAAA,QACP,oBAAC,QAAK,MAAM,CAAC,UACX;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,IAAI;AAAA,cACb,OAAO;AAAA,cACP,UAAU;AAAA,YACZ,CAAC;AAAA,YACF;AAAA;AAAA,QAED,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/Label.tsx"],"sourcesContent":["'use client'\n\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { label } from '@cerberus/styled-system/recipes'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { useFieldContext } from '../context/field'\nimport { Show } from './Show'\nimport { hstack } from '@cerberus/styled-system/patterns'\n\n/**\n * This module contains the Label component.\n * @module\n */\n\nexport interface LabelProps extends HTMLAttributes<HTMLLabelElement> {\n htmlFor: string\n hidden?: boolean\n}\n\n/**\n * A screen ready friendly label component.\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @definition [Label docs](https://cerberus.digitalu.design/react/label)\n * @example\n * ```tsx\n * <Field required>\n * <Label htmlFor=\"test\">Test Label</Label>\n * </Field>\n * ```\n */\nexport function Label(props: PropsWithChildren<LabelProps>) {\n const { hidden, ...nativeProps } = props\n const { required } = useFieldContext()\n const usage = hidden ? 'hidden' : 'visible'\n\n return (\n <label\n {...nativeProps}\n className={cx(\n nativeProps.className,\n label({ usage }),\n hstack({\n justify: 'space-between',\n }),\n )}\n >\n {props.children}\n <Show when={required}>\n <span\n className={css({\n color: 'neutral.text.100',\n fontSize: 'inherit',\n })}\n >\n (required)\n </span>\n </Show>\n </label>\n )\n}\n"],"mappings":";;;;;;;;AAGA,SAAS,aAAa;AACtB,SAAS,KAAK,UAAU;AAGxB,SAAS,cAAc;AA6BnB,SAYI,KAZJ;AANG,SAAS,MAAM,OAAsC;AAC1D,QAAM,EAAE,QAAQ,GAAG,YAAY,IAAI;AACnC,QAAM,EAAE,SAAS,IAAI,gBAAgB;AACrC,QAAM,QAAQ,SAAS,WAAW;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,MAAM,EAAE,MAAM,CAAC;AAAA,QACf,OAAO;AAAA,UACL,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AAAA,MAEC;AAAA,cAAM;AAAA,QACP,oBAAC,QAAK,MAAM,UACV;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,IAAI;AAAA,cACb,OAAO;AAAA,cACP,UAAU;AAAA,YACZ,CAAC;AAAA,YACF;AAAA;AAAA,QAED,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Label
4
- } from "../chunk-46TCLT7U.js";
4
+ } from "../chunk-EYZ3S36P.js";
5
5
  import "../chunk-R4H3352X.js";
6
6
  import "../chunk-KETL4ZJK.js";
7
7
  export {
@@ -34,7 +34,7 @@ import {
34
34
  } from "./chunk-BPIYUAYS.js";
35
35
  import {
36
36
  Label
37
- } from "./chunk-46TCLT7U.js";
37
+ } from "./chunk-EYZ3S36P.js";
38
38
  import {
39
39
  Show
40
40
  } from "./chunk-R4H3352X.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerberus-design/react",
3
- "version": "0.1.3-next-9be4883",
3
+ "version": "0.1.3-next-cb1c11b",
4
4
  "description": "The Cerberus Design React component library.",
5
5
  "browserslist": "> 0.25%, not dead",
6
6
  "sideEffects": false,
@@ -45,14 +45,14 @@ export function Label(props: PropsWithChildren<LabelProps>) {
45
45
  )}
46
46
  >
47
47
  {props.children}
48
- <Show when={!required}>
48
+ <Show when={required}>
49
49
  <span
50
50
  className={css({
51
51
  color: 'neutral.text.100',
52
52
  fontSize: 'inherit',
53
53
  })}
54
54
  >
55
- (optional)
55
+ (required)
56
56
  </span>
57
57
  </Show>
58
58
  </label>