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

@launchpad-ui/progress

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@launchpad-ui/progress - npm Package Compare versions

Comparing version 0.5.25 to 0.5.26

80

dist/index.es.js
import './style.css';
import { useState, useEffect } from "react";
import { jsxs, jsx } from "react/jsx-runtime";
import { cx } from "classix";
import { jsxs, jsx } from "react/jsx-runtime";
const DelayedIndicator = ({
children,
delayMs = 250
}) => {
const DelayedIndicator = ({ children, delayMs = 250 }) => {
const [renderChildren, setRenderChildren] = useState(false);

@@ -62,32 +59,45 @@ useEffect(() => {

const circumference = 2 * Math.PI * radius;
const indicator = /* @__PURE__ */ jsxs("svg", {
className: cx(styles.Progress, isIndeterminate && styles["Progress--indeterminate"], className),
width: diameter,
height: diameter,
viewBox: `0 0 ${diameter} ${diameter}`,
"data-test-id": testId,
role: "progressbar",
"aria-valuemin": 0,
"aria-valuetext": "loading",
"aria-valuemax": 100,
children: [/* @__PURE__ */ jsx("circle", {
className: styles["Progress-track"],
cx: diameter / 2,
cy: diameter / 2,
r: radius,
strokeWidth
}), /* @__PURE__ */ jsx("circle", {
className: styles["Progress-head"],
cx: diameter / 2,
cy: diameter / 2,
r: radius,
strokeWidth,
strokeDasharray: circumference,
strokeDashoffset: circumference * (1 - (value === void 0 || value === null ? 0.25 : clamp(value, 0, 1)))
})]
});
return delayMs ? /* @__PURE__ */ jsx(DelayedIndicator, {
delayMs,
children: indicator
}) : indicator;
const indicator = /* @__PURE__ */ jsxs(
"svg",
{
className: cx(
styles.Progress,
isIndeterminate && styles["Progress--indeterminate"],
className
),
width: diameter,
height: diameter,
viewBox: `0 0 ${diameter} ${diameter}`,
"data-test-id": testId,
role: "progressbar",
"aria-valuemin": 0,
"aria-valuetext": "loading",
"aria-valuemax": 100,
children: [
/* @__PURE__ */ jsx(
"circle",
{
className: styles["Progress-track"],
cx: diameter / 2,
cy: diameter / 2,
r: radius,
strokeWidth
}
),
/* @__PURE__ */ jsx(
"circle",
{
className: styles["Progress-head"],
cx: diameter / 2,
cy: diameter / 2,
r: radius,
strokeWidth,
strokeDasharray: circumference,
strokeDashoffset: circumference * (1 - (value === void 0 || value === null ? 0.25 : clamp(value, 0, 1)))
}
)
]
}
);
return delayMs ? /* @__PURE__ */ jsx(DelayedIndicator, { delayMs, children: indicator }) : indicator;
};

@@ -94,0 +104,0 @@ export {

require('./style.css');
"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const react = require("react");
const jsxRuntime = require("react/jsx-runtime");
const classix = require("classix");
const jsxRuntime = require("react/jsx-runtime");
const DelayedIndicator = ({
children,
delayMs = 250
}) => {
const DelayedIndicator = ({ children, delayMs = 250 }) => {
const [renderChildren, setRenderChildren] = react.useState(false);

@@ -64,32 +61,45 @@ react.useEffect(() => {

const circumference = 2 * Math.PI * radius;
const indicator = /* @__PURE__ */ jsxRuntime.jsxs("svg", {
className: classix.cx(styles.Progress, isIndeterminate && styles["Progress--indeterminate"], className),
width: diameter,
height: diameter,
viewBox: `0 0 ${diameter} ${diameter}`,
"data-test-id": testId,
role: "progressbar",
"aria-valuemin": 0,
"aria-valuetext": "loading",
"aria-valuemax": 100,
children: [/* @__PURE__ */ jsxRuntime.jsx("circle", {
className: styles["Progress-track"],
cx: diameter / 2,
cy: diameter / 2,
r: radius,
strokeWidth
}), /* @__PURE__ */ jsxRuntime.jsx("circle", {
className: styles["Progress-head"],
cx: diameter / 2,
cy: diameter / 2,
r: radius,
strokeWidth,
strokeDasharray: circumference,
strokeDashoffset: circumference * (1 - (value === void 0 || value === null ? 0.25 : clamp(value, 0, 1)))
})]
});
return delayMs ? /* @__PURE__ */ jsxRuntime.jsx(DelayedIndicator, {
delayMs,
children: indicator
}) : indicator;
const indicator = /* @__PURE__ */ jsxRuntime.jsxs(
"svg",
{
className: classix.cx(
styles.Progress,
isIndeterminate && styles["Progress--indeterminate"],
className
),
width: diameter,
height: diameter,
viewBox: `0 0 ${diameter} ${diameter}`,
"data-test-id": testId,
role: "progressbar",
"aria-valuemin": 0,
"aria-valuetext": "loading",
"aria-valuemax": 100,
children: [
/* @__PURE__ */ jsxRuntime.jsx(
"circle",
{
className: styles["Progress-track"],
cx: diameter / 2,
cy: diameter / 2,
r: radius,
strokeWidth
}
),
/* @__PURE__ */ jsxRuntime.jsx(
"circle",
{
className: styles["Progress-head"],
cx: diameter / 2,
cy: diameter / 2,
r: radius,
strokeWidth,
strokeDasharray: circumference,
strokeDashoffset: circumference * (1 - (value === void 0 || value === null ? 0.25 : clamp(value, 0, 1)))
}
)
]
}
);
return delayMs ? /* @__PURE__ */ jsxRuntime.jsx(DelayedIndicator, { delayMs, children: indicator }) : indicator;
};

@@ -96,0 +106,0 @@ exports.DelayedIndicator = DelayedIndicator;

@@ -1,2 +0,1 @@

/// <reference types="react" />
import type { DelayedIndicatorProps } from './DelayedIndicator';

@@ -10,5 +9,5 @@ type ProgressProps = {

};
declare const Progress: ({ value, size, "data-test-id": testId, className, delayMs, }: ProgressProps) => JSX.Element;
declare const Progress: ({ value, size, "data-test-id": testId, className, delayMs, }: ProgressProps) => import("react/jsx-runtime").JSX.Element;
export { Progress };
export type { ProgressProps };
//# sourceMappingURL=Progress.d.ts.map
{
"name": "@launchpad-ui/progress",
"version": "0.5.25",
"version": "0.5.26",
"status": "beta",

@@ -30,3 +30,3 @@ "publishConfig": {

"classix": "2.1.17",
"@launchpad-ui/tokens": "~0.5.6"
"@launchpad-ui/tokens": "~0.5.7"
},

@@ -33,0 +33,0 @@ "peerDependencies": {

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