@giro-ds/react 12.5.1 → 12.6.0

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/index.cjs CHANGED
@@ -2138,6 +2138,12 @@ class DateLib {
2138
2138
  * @param overrides Custom overrides for the date library functions.
2139
2139
  */
2140
2140
  constructor(options, overrides) {
2141
+ /**
2142
+ * Reference to the built-in Date constructor.
2143
+ *
2144
+ * @deprecated Use `newDate()` or `today()`.
2145
+ */
2146
+ this.Date = Date;
2141
2147
  /**
2142
2148
  * Creates a new `Date` object representing today's date.
2143
2149
  *
@@ -2151,8 +2157,7 @@ class DateLib {
2151
2157
  if (this.options.timeZone) {
2152
2158
  return TZDate.tz(this.options.timeZone);
2153
2159
  }
2154
- const DateCtor = this.options.Date ?? Date;
2155
- return new DateCtor();
2160
+ return new this.Date();
2156
2161
  };
2157
2162
  /**
2158
2163
  * Creates a new `Date` object with the specified year, month, and day.
@@ -2871,8 +2876,8 @@ const Callout = ({ variant = 'neutral', title, text, icon, onDismiss, dismiss, b
2871
2876
 
2872
2877
  var styles$p = {"card":"Card-module__card___LzN-3","card--hoverable":"Card-module__card--hoverable___orpJZ"};
2873
2878
 
2874
- function Card({ children, className, hoverable }) {
2875
- return (jsxRuntime.jsx("main", { className: clsx(styles$p['card'], hoverable && styles$p['card--hoverable'], className), children: children }));
2879
+ function Card({ children, className, hoverable, borderRadius }) {
2880
+ return (jsxRuntime.jsx("div", { className: clsx(styles$p['card'], hoverable && styles$p['card--hoverable'], className), style: borderRadius !== undefined ? { borderRadius: `var(--border-radius-${borderRadius})` } : undefined, children: children }));
2876
2881
  }
2877
2882
 
2878
2883
  const CheckSmall = ({ className = '', width = 12, height = 10, fill = 'white', ...restProps }) => {
@@ -3720,7 +3725,7 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value, onChange
3720
3725
  if (variant === 'native' && typeof document !== 'undefined') {
3721
3726
  return reactDom.createPortal(jsxRuntime.jsx("div", { id: id, className: clsx(styles$k.overlay, { [styles$k.overlayOpen]: isOpen }, styles$k[isNumpadLayout ? 'layout--numeric' : 'layout--default'], className), style: nativeHeight ? { '--vkeyboard-native-height': nativeHeight } : undefined, [DISMISS_OUTSIDE_IGNORE_ATTRIBUTE]: true, onPointerDownCapture: handleOverlayPointerDown, onPointerUpCapture: handleOverlayPointerUp, onPointerCancelCapture: handleOverlayPointerUp, children: keyboardEl }), document.body);
3722
3727
  }
3723
- return (jsxRuntime.jsxs("div", { id: id, className: clsx(styles$k.container, styles$k[`mode--${variant}`], styles$k[isNumpadLayout ? 'layout--numeric' : 'layout--default'], className), children: [variant === 'fixed' && (jsxRuntime.jsx("div", { className: styles$k.textFieldContainer, children: jsxRuntime.jsx(TextField, { placeholder: placeholder, value: effectiveValue, onChange: onChange, helperText: helperText, error: error, errorMessage: errorMessage, readOnly: true, disableAutoComplete: true, maxLength: maxLength, attachedToVirtualKeyboard: true, className: styles$k.textFieldWrapper, scale: textFieldScale }) })), keyboardEl] }));
3728
+ return (jsxRuntime.jsxs("div", { id: id, className: clsx(styles$k.container, styles$k[`mode--${variant}`], styles$k[isNumpadLayout ? 'layout--numeric' : 'layout--default'], className), children: [variant === 'fixed' && (jsxRuntime.jsx("div", { className: styles$k.textFieldContainer, children: jsxRuntime.jsx(TextField, { placeholder: placeholder, value: effectiveValue, onChange: onChange, helperText: helperText, error: error, errorMessage: errorMessage, disableAutoComplete: true, maxLength: maxLength, attachedToVirtualKeyboard: true, className: styles$k.textFieldWrapper, scale: textFieldScale }) })), keyboardEl] }));
3724
3729
  };
3725
3730
 
3726
3731
  var styles$j = {"container":"TextField-module__container___WJHFR","inputWrapper":"TextField-module__inputWrapper___INjfd","inputContainer":"TextField-module__inputContainer___3EsFJ","icon":"TextField-module__icon___p1vwi","clearButton":"TextField-module__clearButton___kgOot","inputWithIcon":"TextField-module__inputWithIcon___shqkL","helperText":"TextField-module__helperText___d5QGC","error":"TextField-module__error___IGQzp","disabled":"TextField-module__disabled___roIKP","attachedToVirtualKeyboard":"TextField-module__attachedToVirtualKeyboard___fuO2O","errorWithMessage":"TextField-module__errorWithMessage___m-5AA","clearButtonIcon":"TextField-module__clearButtonIcon___Z2iyc"};
@@ -3923,7 +3928,7 @@ function validatePartialDate(value, locale = 'pt-br') {
3923
3928
  return 'incomplete';
3924
3929
  }
3925
3930
 
3926
- const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign = 'start', helperText, required = false, label = 'Data', value, defaultValue, onChange, disabled = false, error: externalError, minDate, maxDate, 'data-testid': testId, scale = 1, id, className, style, ...rest }) => {
3931
+ const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign = 'start', helperText, required = false, label, value, defaultValue, onChange, disabled = false, error: externalError, minDate, maxDate, 'data-testid': testId, scale = 1, id, className, style, ...rest }) => {
3927
3932
  const fieldId = React.useId();
3928
3933
  const calendarId = `${fieldId}-calendar`;
3929
3934
  const containerStyle = { '--giro-scale': scale };