Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yamada-ui/utils

Package Overview
Dependencies
Maintainers
1
Versions
548
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yamada-ui/utils - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1-dev-20231230014952

dist/chunk-PWY4SZ6A.mjs

3

dist/dom.d.ts

@@ -17,2 +17,3 @@ import React__default from 'react';

declare const isContains: (parent: HTMLElement | null, child: HTMLElement | null) => boolean | undefined;
declare const getPx: (value: string | number | undefined) => number;
declare const getEventRelatedTarget: (ev: React__default.FocusEvent | React__default.MouseEvent) => HTMLElement | null;

@@ -34,2 +35,2 @@ type Booleanish = boolean | "true" | "false";

export { type FocusableElement, ariaAttr, createdDom, dataAttr, getActiveElement, getAllFocusable, getEventRelatedTarget, getOwnerDocument, getOwnerWindow, getPlatform, hasNegativeTabIndex, hasTabIndex, isActiveElement, isApple, isContains, isContentEditable, isDisabled, isElement, isFocusable, isHTMLElement, isHidden, isMac, isSafari, isTabbable, platform, vendor };
export { type FocusableElement, ariaAttr, createdDom, dataAttr, getActiveElement, getAllFocusable, getEventRelatedTarget, getOwnerDocument, getOwnerWindow, getPlatform, getPx, hasNegativeTabIndex, hasTabIndex, isActiveElement, isApple, isContains, isContentEditable, isDisabled, isElement, isFocusable, isHTMLElement, isHidden, isMac, isSafari, isTabbable, platform, vendor };

@@ -32,2 +32,3 @@ "use strict";

getPlatform: () => getPlatform,
getPx: () => getPx,
hasNegativeTabIndex: () => hasNegativeTabIndex,

@@ -51,2 +52,8 @@ hasTabIndex: () => hasTabIndex,

module.exports = __toCommonJS(dom_exports);
// src/assertion.ts
var isNumber = (value) => typeof value === "number";
var isUndefined = (value) => typeof value === "undefined" && value === void 0;
// src/dom.ts
var createdDom = () => !!(typeof window !== "undefined" && window.document && window.document.createElement);

@@ -85,2 +92,17 @@ var getPlatform = () => {

};
var getPx = (value) => {
if (isNumber(value))
return value;
if (isUndefined(value))
return 0;
if (value.includes("px"))
return parseFloat(value);
const isBrowser = createdDom();
let fontSize = 16;
if (isBrowser) {
const style = window.getComputedStyle(document.documentElement);
fontSize = parseFloat(style.fontSize);
}
return parseFloat(value) * fontSize;
};
var getEventRelatedTarget = (ev) => {

@@ -157,2 +179,3 @@ var _a;

getPlatform,
getPx,
hasNegativeTabIndex,

@@ -159,0 +182,0 @@ hasTabIndex,

@@ -6,3 +6,3 @@ export { Dict, Length, Merge, Path, Primitive, StringLiteral, Union } from './index.types.js';

export { AsyncFnReturn, AsyncState, AsyncStateRetry, DOMAttributes, FunctionReturningPromise, MaybeRenderProp, PromiseType, PropGetter, RequiredPropGetter, UseIsMountedProps, UseIsMountedReturn, assignRef, createContext, createId, cx, findChildren, getValidChildren, includesChildren, isRefObject, isValidElement, mergeRefs, omitChildren, pickChildren, useAsync, useAsyncFunc, useAsyncRetry, useCallbackRef, useIsMounted, useMergeRefs, useSafeLayoutEffect, useUnmountEffect, useUpdateEffect } from './react.js';
export { FocusableElement, ariaAttr, createdDom, dataAttr, getActiveElement, getAllFocusable, getEventRelatedTarget, getOwnerDocument, getOwnerWindow, getPlatform, hasNegativeTabIndex, hasTabIndex, isActiveElement, isApple, isContains, isContentEditable, isDisabled, isElement, isFocusable, isHTMLElement, isHidden, isMac, isSafari, isTabbable, platform, vendor } from './dom.js';
export { FocusableElement, ariaAttr, createdDom, dataAttr, getActiveElement, getAllFocusable, getEventRelatedTarget, getOwnerDocument, getOwnerWindow, getPlatform, getPx, hasNegativeTabIndex, hasTabIndex, isActiveElement, isApple, isContains, isContentEditable, isDisabled, isElement, isFocusable, isHTMLElement, isHidden, isMac, isSafari, isTabbable, platform, vendor } from './dom.js';
export { escape } from './string.js';

@@ -9,0 +9,0 @@ export { Operand, calc } from './calc.js';

@@ -66,2 +66,3 @@ "use strict";

getPlatform: () => getPlatform,
getPx: () => getPx,
getValidChildren: () => getValidChildren,

@@ -514,2 +515,17 @@ handlerAll: () => handlerAll,

};
var getPx = (value) => {
if (isNumber(value))
return value;
if (isUndefined(value))
return 0;
if (value.includes("px"))
return parseFloat(value);
const isBrowser = createdDom();
let fontSize = 16;
if (isBrowser) {
const style = window.getComputedStyle(document.documentElement);
fontSize = parseFloat(style.fontSize);
}
return parseFloat(value) * fontSize;
};
var getEventRelatedTarget = (ev) => {

@@ -847,2 +863,3 @@ var _a;

getPlatform,
getPx,
getValidChildren,

@@ -849,0 +866,0 @@ handlerAll,

@@ -10,6 +10,4 @@ type Primitive = null | undefined | string | number | boolean | symbol | bigint;

type Length = string | 0 | number;
type Merge<T extends object> = {
[K in keyof T]: T[K];
};
type Merge<Y, M> = M extends undefined ? Y : Omit<Y, keyof M> & M;
export type { Dict, Length, Merge, Path, Primitive, StringLiteral, Union };
import * as React from 'react';
import { Merge } from './index.types.js';
type DOMElement = Element & HTMLOrSVGElement;
type DataAttributes = {
[dataAttr: string]: any;
};
type DOMAttributes<Y = DOMElement> = React.AriaAttributes & React.DOMAttributes<Y> & DataAttributes & {
type DOMAttributes<Y = DOMElement> = React.HTMLAttributes<Y> & React.AriaAttributes & React.DOMAttributes<Y> & {
id?: string;

@@ -13,5 +11,4 @@ role?: React.AriaRole;

};
type Merge<Y, M> = M extends Record<string, unknown> ? Y : Omit<Y, keyof M> & M;
type PropGetter<Y = Record<string, unknown>, M = DOMAttributes> = (props?: Merge<DOMAttributes, Y>, ref?: React.Ref<any>) => M & React.RefAttributes<any>;
type RequiredPropGetter<Y = Record<string, unknown>, M = DOMAttributes> = (props: Merge<DOMAttributes, Y>, ref?: React.Ref<any>) => M & React.RefAttributes<any>;
type PropGetter<Y = undefined, M = DOMAttributes> = (props?: Merge<DOMAttributes, Y>, ref?: React.Ref<any>) => M & React.RefAttributes<any>;
type RequiredPropGetter<Y = undefined, M = DOMAttributes> = (props: Merge<DOMAttributes, Y>, ref?: React.Ref<any>) => M & React.RefAttributes<any>;
type MaybeRenderProp<Y> = React.ReactNode | ((props: Y) => React.ReactNode);

@@ -18,0 +15,0 @@ type Options = {

{
"name": "@yamada-ui/utils",
"version": "1.0.0",
"version": "1.0.1-dev-20231230014952",
"description": "Yamada UI utils",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc