@consumidor-positivo/aurora 0.0.67 → 0.0.68

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.
@@ -1,9 +1,9 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../../index-CweZ_OcN.js";
3
- import "../../index-DhUJjrgP.js";
3
+ import "../../index-BuHGuwbT.js";
4
4
  import "../Button/index.es.js";
5
5
  import "../PortalHolder/index.es.js";
6
- import { a } from "../../index-lcJ0CoDo.js";
6
+ import { a } from "../../index-EAEcmr1o.js";
7
7
  export {
8
8
  a as DatepickerCalendar
9
9
  };
@@ -3,8 +3,8 @@ import "../../index-CweZ_OcN.js";
3
3
  import "../Icon/index.es.js";
4
4
  import "../icons/IconChevronLeft/index.es.js";
5
5
  import "../icons/IconChevronRight/index.es.js";
6
- import "../../index-BnnDZOqb.js";
7
- import { C } from "../../index-DhUJjrgP.js";
6
+ import "../../index-CLq9qZyb.js";
7
+ import { C } from "../../index-BuHGuwbT.js";
8
8
  export {
9
9
  C as CalendarHeader
10
10
  };
@@ -2,8 +2,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { c as classNames } from "../../index-CweZ_OcN.js";
3
3
  import "../Icon/index.es.js";
4
4
  import { IconCheck } from "../icons/IconCheck/index.es.js";
5
- import { F as Field } from "../../index-DY3hp3Pl.js";
6
5
  import { k as COLOR_NEUTRAL_00 } from "../../tokens-TYOJv1j5.js";
6
+ import { F as Field } from "../../index-DY3hp3Pl.js";
7
7
  import './styles.css';const CheckboxField = ({
8
8
  label,
9
9
  error,
@@ -1,13 +1,13 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { B as BREAKPOINT_MD, g as COLOR_NEUTRAL_40 } from "../../tokens-TYOJv1j5.js";
2
3
  import "../../index-CweZ_OcN.js";
3
4
  import "../Icon/index.es.js";
4
5
  import { IconCalendar } from "../icons/IconCalendar/index.es.js";
5
6
  import { InputField } from "../InputField/index.es.js";
6
- import { g as getDefaultDate, D as DDMMYYYY, a as DatepickerCalendar, A as AUCalendarDate } from "../../index-lcJ0CoDo.js";
7
+ import { g as getDefaultDate, D as DDMMYYYY, a as DatepickerCalendar, A as AUCalendarDate } from "../../index-EAEcmr1o.js";
7
8
  import { useRef, useState, useMemo, useEffect } from "react";
8
9
  import { a as above } from "../../screen-DfYo7XQ_.js";
9
- import { u as useOutsideClick } from "../../index-BnnDZOqb.js";
10
- import { B as BREAKPOINT_MD, g as COLOR_NEUTRAL_40 } from "../../tokens-TYOJv1j5.js";
10
+ import { u as useOutsideClick } from "../../index-CLq9qZyb.js";
11
11
  import './styles.css';function useDatepicker({
12
12
  value,
13
13
  defaultValue = "empty",
@@ -12,6 +12,7 @@ import './styles.css';const RadioGroup = ({
12
12
  label,
13
13
  error,
14
14
  errorMessage,
15
+ required = false,
15
16
  children,
16
17
  onChange,
17
18
  onFocus
@@ -45,7 +46,11 @@ import './styles.css';const RadioGroup = ({
45
46
  Conditional,
46
47
  {
47
48
  condition: !!label,
48
- renderIf: /* @__PURE__ */ jsx(Text, { variant: "body-medium", weight: "semibold", color: "secondary", children: label })
49
+ renderIf: /* @__PURE__ */ jsxs(Text, { variant: "body-medium", weight: "semibold", color: "secondary", children: [
50
+ label,
51
+ " ",
52
+ !!required && /* @__PURE__ */ jsx("span", { className: "au-radio-group__label--required", children: "*" })
53
+ ] })
49
54
  }
50
55
  ),
51
56
  /* @__PURE__ */ jsx("div", { className: "au-radio-group__fields", children: childrenWithProps }),
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Radio/Group/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport './styles.scss'\nimport Field from '@components/form/Field'\nimport { Conditional } from '@components/misc'\nimport { Text } from '@components/Text'\nimport React, { useState } from 'react'\nimport { RadioField } from '../Field'\nimport { RadioFieldProps, RadioGroupProps } from '../types'\n\nexport const RadioGroup = ({\n name = '',\n defaultValue,\n orientation = 'vertical',\n label,\n error,\n errorMessage,\n children,\n onChange,\n onFocus,\n}: RadioGroupProps) => {\n const groupClass = classNames('au-radio-group', {\n 'au-radio-group--horizontal': orientation === 'horizontal',\n })\n\n const getSafeName = (name: string): string => {\n return name ? name : `au-radio-group-${Math.random()}`\n }\n\n const [safeName] = useState(getSafeName(name))\n\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n const childProps = child.props as RadioFieldProps\n\n return (\n <RadioField\n name={safeName}\n error={error}\n defaultChecked={defaultValue === childProps.value}\n onChange={onChange}\n onFocus={onFocus}\n {...child.props}\n />\n )\n }\n return child\n })\n\n return (\n <div className={groupClass}>\n <Conditional\n condition={!!label}\n renderIf={\n <Text variant=\"body-medium\" weight=\"semibold\" color=\"secondary\">\n {label}\n </Text>\n }\n />\n <div className=\"au-radio-group__fields\">{childrenWithProps}</div>\n <Field.ErrorMessage hasError={!!error} message={errorMessage} />\n </div>\n )\n}\n"],"names":["name","React"],"mappings":";;;;;;;AASO,MAAM,aAAa,CAAC;AAAA,EACzB,OAAO;AAAA,EACP;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACf,QAAA,aAAa,WAAW,kBAAkB;AAAA,IAC9C,8BAA8B,gBAAgB;AAAA,EAAA,CAC/C;AAEK,QAAA,cAAc,CAACA,UAAyB;AAC5C,WAAOA,QAAOA,QAAO,kBAAkB,KAAK,OAAQ,CAAA;AAAA,EAAA;AAGtD,QAAM,CAAC,QAAQ,IAAI,SAAS,YAAY,IAAI,CAAC;AAE7C,QAAM,oBAAoBC,sBAAM,SAAS,IAAI,UAAU,CAAC,UAAU;AAC5D,QAAAA,sBAAM,eAAe,KAAK,GAAG;AAC/B,YAAM,aAAa,MAAM;AAGvB,aAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN;AAAA,UACA,gBAAgB,iBAAiB,WAAW;AAAA,UAC5C;AAAA,UACA;AAAA,UACC,GAAG,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAGhB;AACO,WAAA;AAAA,EAAA,CACR;AAGC,SAAA,qBAAC,OAAI,EAAA,WAAW,YACd,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,CAAC,CAAC;AAAA,QACb,8BACG,MAAK,EAAA,SAAQ,eAAc,QAAO,YAAW,OAAM,aACjD,UACH,MAAA,CAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,IACC,oBAAA,OAAA,EAAI,WAAU,0BAA0B,UAAkB,mBAAA;AAAA,IAC3D,oBAAC,MAAM,cAAN,EAAmB,UAAU,CAAC,CAAC,OAAO,SAAS,cAAc;AAAA,EAChE,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Radio/Group/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport './styles.scss'\nimport Field from '@components/form/Field'\nimport { Conditional } from '@components/misc'\nimport { Text } from '@components/Text'\nimport React, { useState } from 'react'\nimport { RadioField } from '../Field'\nimport { RadioFieldProps, RadioGroupProps } from '../types'\n\nexport const RadioGroup = ({\n name = '',\n defaultValue,\n orientation = 'vertical',\n label,\n error,\n errorMessage,\n required = false,\n children,\n onChange,\n onFocus,\n}: RadioGroupProps) => {\n const groupClass = classNames('au-radio-group', {\n 'au-radio-group--horizontal': orientation === 'horizontal',\n })\n\n const getSafeName = (name: string): string => {\n return name ? name : `au-radio-group-${Math.random()}`\n }\n\n const [safeName] = useState(getSafeName(name))\n\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n const childProps = child.props as RadioFieldProps\n\n return (\n <RadioField\n name={safeName}\n error={error}\n defaultChecked={defaultValue === childProps.value}\n onChange={onChange}\n onFocus={onFocus}\n {...child.props}\n />\n )\n }\n return child\n })\n\n return (\n <div className={groupClass}>\n <Conditional\n condition={!!label}\n renderIf={\n <Text variant=\"body-medium\" weight=\"semibold\" color=\"secondary\">\n {label}{' '}\n {!!required && (\n <span className=\"au-radio-group__label--required\">*</span>\n )}\n </Text>\n }\n />\n <div className=\"au-radio-group__fields\">{childrenWithProps}</div>\n <Field.ErrorMessage hasError={!!error} message={errorMessage} />\n </div>\n )\n}\n"],"names":["name","React"],"mappings":";;;;;;;AASO,MAAM,aAAa,CAAC;AAAA,EACzB,OAAO;AAAA,EACP;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACf,QAAA,aAAa,WAAW,kBAAkB;AAAA,IAC9C,8BAA8B,gBAAgB;AAAA,EAAA,CAC/C;AAEK,QAAA,cAAc,CAACA,UAAyB;AAC5C,WAAOA,QAAOA,QAAO,kBAAkB,KAAK,OAAQ,CAAA;AAAA,EAAA;AAGtD,QAAM,CAAC,QAAQ,IAAI,SAAS,YAAY,IAAI,CAAC;AAE7C,QAAM,oBAAoBC,sBAAM,SAAS,IAAI,UAAU,CAAC,UAAU;AAC5D,QAAAA,sBAAM,eAAe,KAAK,GAAG;AAC/B,YAAM,aAAa,MAAM;AAGvB,aAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN;AAAA,UACA,gBAAgB,iBAAiB,WAAW;AAAA,UAC5C;AAAA,UACA;AAAA,UACC,GAAG,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAGhB;AACO,WAAA;AAAA,EAAA,CACR;AAGC,SAAA,qBAAC,OAAI,EAAA,WAAW,YACd,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,CAAC,CAAC;AAAA,QACb,+BACG,MAAK,EAAA,SAAQ,eAAc,QAAO,YAAW,OAAM,aACjD,UAAA;AAAA,UAAA;AAAA,UAAO;AAAA,UACP,CAAC,CAAC,gCACA,QAAK,EAAA,WAAU,mCAAkC,UAAC,KAAA;AAAA,QAAA,GAEvD;AAAA,MAAA;AAAA,IAEJ;AAAA,IACC,oBAAA,OAAA,EAAI,WAAU,0BAA0B,UAAkB,mBAAA;AAAA,IAC3D,oBAAC,MAAM,cAAN,EAAmB,UAAU,CAAC,CAAC,OAAO,SAAS,cAAc;AAAA,EAChE,EAAA,CAAA;AAEJ;"}
@@ -1 +1 @@
1
- .au-radio-group,.au-radio-group__fields{display:flex;flex-direction:column;gap:16px}.au-radio-group--horizontal .au-radio-group__fields{flex-direction:row}
1
+ .au-radio-group{display:flex;flex-direction:column;gap:16px}.au-radio-group__label--required{color:#991717}.au-radio-group__fields{display:flex;flex-direction:column;gap:16px}.au-radio-group--horizontal .au-radio-group__fields{flex-direction:row}
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import { a as above } from "../../screen-DfYo7XQ_.js";
3
- import { Portal } from "../Portal/index.es.js";
4
3
  import { B as BREAKPOINT_MD } from "../../tokens-TYOJv1j5.js";
4
+ import { Portal } from "../Portal/index.es.js";
5
5
  const PortalHolder = ({ withPortal, children }) => {
6
6
  const shouldUsePortal = !above(BREAKPOINT_MD) && withPortal;
7
7
  if (shouldUsePortal) return /* @__PURE__ */ jsx(Portal, { children });
@@ -4,7 +4,7 @@ import "../Icon/index.es.js";
4
4
  import "../icons/IconChevronDown/index.es.js";
5
5
  import "../icons/IconChevronLeft/index.es.js";
6
6
  import "../icons/IconX/index.es.js";
7
- import { S } from "../../index-BnnDZOqb.js";
7
+ import { S } from "../../index-CLq9qZyb.js";
8
8
  export {
9
9
  S as Segment
10
10
  };
@@ -1,3 +1,3 @@
1
1
  import { RadioGroupProps } from '../types';
2
2
 
3
- export declare const RadioGroup: ({ name, defaultValue, orientation, label, error, errorMessage, children, onChange, onFocus, }: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const RadioGroup: ({ name, defaultValue, orientation, label, error, errorMessage, required, children, onChange, onFocus, }: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -14,6 +14,7 @@ export type RadioGroupProps = {
14
14
  label?: string;
15
15
  error?: boolean;
16
16
  errorMessage?: string;
17
+ required?: boolean;
17
18
  onChange?: React.ChangeEventHandler<HTMLInputElement>;
18
19
  onFocus?: React.FocusEventHandler<HTMLInputElement>;
19
20
  };
@@ -3,7 +3,7 @@ import "./index-CweZ_OcN.js";
3
3
  import "./components/Icon/index.es.js";
4
4
  import { IconChevronLeft } from "./components/icons/IconChevronLeft/index.es.js";
5
5
  import { IconChevronRight } from "./components/icons/IconChevronRight/index.es.js";
6
- import { S as Segment } from "./index-BnnDZOqb.js";
6
+ import { S as Segment } from "./index-CLq9qZyb.js";
7
7
  import $dbSRa$react__default, { createContext, useContext, useState, useRef, useCallback, useEffect, useMemo, forwardRef } from "react";
8
8
  import "react-dom";
9
9
  createContext(null);
@@ -5686,4 +5686,4 @@ export {
5686
5686
  $dfd62f934fc76fed$export$e11f8ba65d857bff as e,
5687
5687
  $dfd62f934fc76fed$export$5d847498420df57b as f
5688
5688
  };
5689
- //# sourceMappingURL=index-DhUJjrgP.js.map
5689
+ //# sourceMappingURL=index-BuHGuwbT.js.map