@humu-tech/ui 0.1.9 → 0.1.10

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.d.mts CHANGED
@@ -325,7 +325,7 @@ declare const DialogRoot: typeof DialogRootBase & {
325
325
  };
326
326
 
327
327
  type DocumentInputProps = Omit<MaskedInputProps, 'mask'>;
328
- declare function DocumentInput(props: DocumentInputProps): react.JSX.Element;
328
+ declare function DocumentInput({ normalizeRaw, ...props }: DocumentInputProps): react.JSX.Element;
329
329
 
330
330
  type DrawerSide = 'right' | 'left' | 'bottom';
331
331
  type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
package/dist/index.d.ts CHANGED
@@ -325,7 +325,7 @@ declare const DialogRoot: typeof DialogRootBase & {
325
325
  };
326
326
 
327
327
  type DocumentInputProps = Omit<MaskedInputProps, 'mask'>;
328
- declare function DocumentInput(props: DocumentInputProps): react.JSX.Element;
328
+ declare function DocumentInput({ normalizeRaw, ...props }: DocumentInputProps): react.JSX.Element;
329
329
 
330
330
  type DrawerSide = 'right' | 'left' | 'bottom';
331
331
  type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
package/dist/index.js CHANGED
@@ -2328,8 +2328,18 @@ DateRangeInput.displayName = "DateRangeInput";
2328
2328
 
2329
2329
  // src/primitives/DocumentInput/DocumentInput.tsx
2330
2330
  var import_jsx_runtime21 = require("react/jsx-runtime");
2331
- function DocumentInput(props) {
2332
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MaskedInput, { ...props, mask: ["000.000.000-00", "00.000.000/0000-00"] });
2331
+ function normalizeDocumentRaw(value) {
2332
+ return value.replace(/[^0-9a-zA-Z]/g, "").toUpperCase();
2333
+ }
2334
+ function DocumentInput({ normalizeRaw, ...props }) {
2335
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2336
+ MaskedInput,
2337
+ {
2338
+ ...props,
2339
+ normalizeRaw: normalizeRaw ?? normalizeDocumentRaw,
2340
+ mask: ["000.000.000-00", "**.***.***/****-**"]
2341
+ }
2342
+ );
2333
2343
  }
2334
2344
 
2335
2345
  // src/primitives/Drawer/Drawer.tsx
package/dist/index.mjs CHANGED
@@ -2220,8 +2220,18 @@ DateRangeInput.displayName = "DateRangeInput";
2220
2220
 
2221
2221
  // src/primitives/DocumentInput/DocumentInput.tsx
2222
2222
  import { jsx as jsx21 } from "react/jsx-runtime";
2223
- function DocumentInput(props) {
2224
- return /* @__PURE__ */ jsx21(MaskedInput, { ...props, mask: ["000.000.000-00", "00.000.000/0000-00"] });
2223
+ function normalizeDocumentRaw(value) {
2224
+ return value.replace(/[^0-9a-zA-Z]/g, "").toUpperCase();
2225
+ }
2226
+ function DocumentInput({ normalizeRaw, ...props }) {
2227
+ return /* @__PURE__ */ jsx21(
2228
+ MaskedInput,
2229
+ {
2230
+ ...props,
2231
+ normalizeRaw: normalizeRaw ?? normalizeDocumentRaw,
2232
+ mask: ["000.000.000-00", "**.***.***/****-**"]
2233
+ }
2234
+ );
2225
2235
  }
2226
2236
 
2227
2237
  // src/primitives/Drawer/Drawer.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humu-tech/ui",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",