@nextui-org/skeleton
Advanced tools
Comparing version 0.0.0-dev-v2-20230805022716 to 0.0.0-dev-v2-20230805220057
export { default as Skeleton, SkeletonProps } from './skeleton.js'; | ||
export { useSkeleton } from './use-skeleton.js'; | ||
import '@nextui-org/system'; | ||
import '@nextui-org/system/dist/types'; | ||
import 'tailwind-variants'; | ||
import 'react'; | ||
import '@nextui-org/theme'; | ||
import '@nextui-org/react-utils'; | ||
import '@nextui-org/system/types'; |
@@ -1,2 +0,1 @@ | ||
"use client"; | ||
"use strict"; | ||
@@ -30,15 +29,13 @@ var __defProp = Object.defineProperty; | ||
// src/skeleton.tsx | ||
var import_system2 = require("@nextui-org/system"); | ||
var import_utils2 = require("@nextui-org/system/utils"); | ||
// src/use-skeleton.ts | ||
var import_system = require("@nextui-org/system"); | ||
var import_utils = require("@nextui-org/system/utils"); | ||
var import_theme = require("@nextui-org/theme"); | ||
var import_react_utils = require("@nextui-org/react-utils"); | ||
var import_shared_utils = require("@nextui-org/shared-utils"); | ||
var import_react = require("react"); | ||
function useSkeleton(originalProps) { | ||
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.skeleton.variantKeys); | ||
const { ref, as, children, isLoaded = false, className, classNames, ...otherProps } = props; | ||
const [props, variantProps] = (0, import_utils.mapPropsVariants)(originalProps, import_theme.skeleton.variantKeys); | ||
const { as, children, isLoaded = false, className, classNames, ...otherProps } = props; | ||
const Component = as || "div"; | ||
const domRef = (0, import_react_utils.useDOMRef)(ref); | ||
const slots = (0, import_react.useMemo)( | ||
@@ -53,3 +50,2 @@ () => (0, import_theme.skeleton)({ | ||
return { | ||
ref: domRef, | ||
"data-loaded": (0, import_shared_utils.dataAttr)(isLoaded), | ||
@@ -65,3 +61,3 @@ className: slots.base({ class: (0, import_shared_utils.clsx)(baseStyles, props2 == null ? void 0 : props2.className) }), | ||
}; | ||
return { Component, domRef, children, slots, classNames, getSkeletonProps, getContentProps }; | ||
return { Component, children, slots, classNames, getSkeletonProps, getContentProps }; | ||
} | ||
@@ -71,5 +67,5 @@ | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var Skeleton = (0, import_system2.forwardRef)((props, ref) => { | ||
const { Component, children, getSkeletonProps, getContentProps } = useSkeleton({ ...props, ref }); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...getSkeletonProps(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...getContentProps(), children }) }); | ||
var Skeleton = (0, import_utils2.forwardRef)((props, ref) => { | ||
const { Component, children, getSkeletonProps, getContentProps } = useSkeleton({ ...props }); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref, ...getSkeletonProps(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...getContentProps(), children }) }); | ||
}); | ||
@@ -76,0 +72,0 @@ Skeleton.displayName = "NextUI.Skeleton"; |
@@ -1,2 +0,2 @@ | ||
import * as _nextui_org_system from '@nextui-org/system'; | ||
import * as _nextui_org_system_dist_types from '@nextui-org/system/dist/types'; | ||
import { UseSkeletonProps } from './use-skeleton.js'; | ||
@@ -6,8 +6,8 @@ import 'tailwind-variants'; | ||
import '@nextui-org/theme'; | ||
import '@nextui-org/react-utils'; | ||
import '@nextui-org/system/types'; | ||
interface SkeletonProps extends UseSkeletonProps { | ||
} | ||
declare const Skeleton: _nextui_org_system.InternalForwardRefRenderFunction<"div", SkeletonProps, never>; | ||
declare const Skeleton: _nextui_org_system_dist_types.InternalForwardRefRenderFunction<"div", SkeletonProps, never>; | ||
export { SkeletonProps, Skeleton as default }; |
@@ -1,2 +0,1 @@ | ||
"use client"; | ||
"use strict"; | ||
@@ -27,15 +26,13 @@ var __defProp = Object.defineProperty; | ||
module.exports = __toCommonJS(skeleton_exports); | ||
var import_system2 = require("@nextui-org/system"); | ||
var import_utils2 = require("@nextui-org/system/utils"); | ||
// src/use-skeleton.ts | ||
var import_system = require("@nextui-org/system"); | ||
var import_utils = require("@nextui-org/system/utils"); | ||
var import_theme = require("@nextui-org/theme"); | ||
var import_react_utils = require("@nextui-org/react-utils"); | ||
var import_shared_utils = require("@nextui-org/shared-utils"); | ||
var import_react = require("react"); | ||
function useSkeleton(originalProps) { | ||
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.skeleton.variantKeys); | ||
const { ref, as, children, isLoaded = false, className, classNames, ...otherProps } = props; | ||
const [props, variantProps] = (0, import_utils.mapPropsVariants)(originalProps, import_theme.skeleton.variantKeys); | ||
const { as, children, isLoaded = false, className, classNames, ...otherProps } = props; | ||
const Component = as || "div"; | ||
const domRef = (0, import_react_utils.useDOMRef)(ref); | ||
const slots = (0, import_react.useMemo)( | ||
@@ -50,3 +47,2 @@ () => (0, import_theme.skeleton)({ | ||
return { | ||
ref: domRef, | ||
"data-loaded": (0, import_shared_utils.dataAttr)(isLoaded), | ||
@@ -62,3 +58,3 @@ className: slots.base({ class: (0, import_shared_utils.clsx)(baseStyles, props2 == null ? void 0 : props2.className) }), | ||
}; | ||
return { Component, domRef, children, slots, classNames, getSkeletonProps, getContentProps }; | ||
return { Component, children, slots, classNames, getSkeletonProps, getContentProps }; | ||
} | ||
@@ -68,5 +64,5 @@ | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var Skeleton = (0, import_system2.forwardRef)((props, ref) => { | ||
const { Component, children, getSkeletonProps, getContentProps } = useSkeleton({ ...props, ref }); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...getSkeletonProps(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...getContentProps(), children }) }); | ||
var Skeleton = (0, import_utils2.forwardRef)((props, ref) => { | ||
const { Component, children, getSkeletonProps, getContentProps } = useSkeleton({ ...props }); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref, ...getSkeletonProps(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...getContentProps(), children }) }); | ||
}); | ||
@@ -73,0 +69,0 @@ Skeleton.displayName = "NextUI.Skeleton"; |
import * as tailwind_variants from 'tailwind-variants'; | ||
import * as react from 'react'; | ||
import * as _nextui_org_system from '@nextui-org/system'; | ||
import { PropGetter, HTMLNextUIProps } from '@nextui-org/system'; | ||
import { Ref } from 'react'; | ||
import * as _nextui_org_system_dist_types from '@nextui-org/system/dist/types'; | ||
import { SkeletonVariantProps, SlotsToClasses, SkeletonSlots } from '@nextui-org/theme'; | ||
import { ReactRef } from '@nextui-org/react-utils'; | ||
import { PropGetter, HTMLNextUIProps } from '@nextui-org/system/types'; | ||
@@ -12,3 +12,3 @@ interface Props extends HTMLNextUIProps<"div"> { | ||
*/ | ||
ref?: ReactRef<HTMLElement | null>; | ||
ref?: Ref<HTMLElement | null>; | ||
/** | ||
@@ -35,4 +35,3 @@ * The skeleton will be visible while isLoading is `false`. | ||
declare function useSkeleton(originalProps: UseSkeletonProps): { | ||
Component: _nextui_org_system.As<any>; | ||
domRef: react.RefObject<HTMLElement>; | ||
Component: _nextui_org_system_dist_types.As<any>; | ||
children: react.ReactNode; | ||
@@ -44,4 +43,4 @@ slots: { | ||
classNames: SlotsToClasses<"base" | "content"> | undefined; | ||
getSkeletonProps: PropGetter<Record<string, unknown>, _nextui_org_system.DOMAttributes<_nextui_org_system.DOMElement>>; | ||
getContentProps: PropGetter<Record<string, unknown>, _nextui_org_system.DOMAttributes<_nextui_org_system.DOMElement>>; | ||
getSkeletonProps: PropGetter<Record<string, unknown>, _nextui_org_system_dist_types.DOMAttributes<_nextui_org_system_dist_types.DOMElement>>; | ||
getContentProps: PropGetter<Record<string, unknown>, _nextui_org_system_dist_types.DOMAttributes<_nextui_org_system_dist_types.DOMElement>>; | ||
}; | ||
@@ -48,0 +47,0 @@ type UseSkeletonReturn = ReturnType<typeof useSkeleton>; |
@@ -1,2 +0,1 @@ | ||
"use client"; | ||
"use strict"; | ||
@@ -27,12 +26,10 @@ var __defProp = Object.defineProperty; | ||
module.exports = __toCommonJS(use_skeleton_exports); | ||
var import_system = require("@nextui-org/system"); | ||
var import_utils = require("@nextui-org/system/utils"); | ||
var import_theme = require("@nextui-org/theme"); | ||
var import_react_utils = require("@nextui-org/react-utils"); | ||
var import_shared_utils = require("@nextui-org/shared-utils"); | ||
var import_react = require("react"); | ||
function useSkeleton(originalProps) { | ||
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.skeleton.variantKeys); | ||
const { ref, as, children, isLoaded = false, className, classNames, ...otherProps } = props; | ||
const [props, variantProps] = (0, import_utils.mapPropsVariants)(originalProps, import_theme.skeleton.variantKeys); | ||
const { as, children, isLoaded = false, className, classNames, ...otherProps } = props; | ||
const Component = as || "div"; | ||
const domRef = (0, import_react_utils.useDOMRef)(ref); | ||
const slots = (0, import_react.useMemo)( | ||
@@ -47,3 +44,2 @@ () => (0, import_theme.skeleton)({ | ||
return { | ||
ref: domRef, | ||
"data-loaded": (0, import_shared_utils.dataAttr)(isLoaded), | ||
@@ -59,3 +55,3 @@ className: slots.base({ class: (0, import_shared_utils.clsx)(baseStyles, props2 == null ? void 0 : props2.className) }), | ||
}; | ||
return { Component, domRef, children, slots, classNames, getSkeletonProps, getContentProps }; | ||
return { Component, children, slots, classNames, getSkeletonProps, getContentProps }; | ||
} | ||
@@ -62,0 +58,0 @@ // Annotate the CommonJS export names for ESM import in node: |
{ | ||
"name": "@nextui-org/skeleton", | ||
"version": "0.0.0-dev-v2-20230805022716", | ||
"version": "0.0.0-dev-v2-20230805220057", | ||
"description": "Skeleton is used to display the loading state of some component.", | ||
@@ -31,6 +31,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@nextui-org/system": "0.0.0-dev-v2-20230805022716", | ||
"@nextui-org/theme": "0.0.0-dev-v2-20230805022716", | ||
"@nextui-org/system": "0.0.0-dev-v2-20230805220057", | ||
"@nextui-org/theme": "2.0.2", | ||
"@nextui-org/shared-utils": "2.0.1", | ||
"@nextui-org/react-utils": "2.0.1" | ||
"@nextui-org/react-utils": "0.0.0-dev-v2-20230805220057" | ||
}, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
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
16555
324
+ Added@nextui-org/react-rsc-utils@2.0.1(transitive)
+ Added@nextui-org/react-utils@0.0.0-dev-v2-20230805220057(transitive)
+ Added@nextui-org/system@0.0.0-dev-v2-20230805220057(transitive)
+ Added@nextui-org/theme@2.0.2(transitive)
- Removed@nextui-org/react-utils@2.0.1(transitive)
- Removed@nextui-org/system@0.0.0-dev-v2-20230805022716(transitive)
- Removed@nextui-org/theme@0.0.0-dev-v2-20230805022716(transitive)
Updated@nextui-org/theme@2.0.2