New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@restart/ui

Package Overview
Dependencies
Maintainers
3
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@restart/ui - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

1

cjs/Anchor.d.ts
import * as React from 'react';
export declare function isTrivialHref(href?: string): boolean;
export interface AnchorProps extends React.HTMLAttributes<HTMLElement> {

@@ -3,0 +4,0 @@ href?: string;

"use strict";
exports.__esModule = true;
exports.isTrivialHref = isTrivialHref;
exports.default = void 0;

@@ -22,2 +23,6 @@

function isTrivialHref(href) {
return !href || href.trim() === '#';
}
/**

@@ -41,3 +46,3 @@ * An generic `<a>` component that covers a few A11y cases, ensuring that

if ((0, _Button.isTrivialHref)(props.href) && !props.role || props.role === 'button') {
if (isTrivialHref(props.href) && !props.role || props.role === 'button') {
return /*#__PURE__*/(0, _jsxRuntime.jsx)("a", Object.assign({

@@ -44,0 +49,0 @@ ref: ref

2

cjs/Button.js

@@ -54,3 +54,3 @@ "use strict";

const handleClick = event => {
if (disabled || isTrivialHref(href)) {
if (disabled || tagName === 'a' && isTrivialHref(href)) {
event.preventDefault();

@@ -57,0 +57,0 @@ }

import * as React from 'react';
export declare function isTrivialHref(href?: string): boolean;
export interface AnchorProps extends React.HTMLAttributes<HTMLElement> {

@@ -3,0 +4,0 @@ href?: string;

@@ -10,4 +10,7 @@ const _excluded = ["onKeyDown"];

import { useEventCallback } from '@restart/hooks';
import { useButtonProps, isTrivialHref } from './Button';
import { useButtonProps } from './Button';
import { jsx as _jsx } from "react/jsx-runtime";
export function isTrivialHref(href) {
return !href || href.trim() === '#';
}

@@ -14,0 +17,0 @@ /**

@@ -40,3 +40,3 @@ const _excluded = ["as", "disabled"];

const handleClick = event => {
if (disabled || isTrivialHref(href)) {
if (disabled || tagName === 'a' && isTrivialHref(href)) {
event.preventDefault();

@@ -43,0 +43,0 @@ }

{
"name": "@restart/ui",
"version": "0.2.1",
"version": "0.2.2",
"description": "Utilities for creating robust overlay components",

@@ -5,0 +5,0 @@ "author": {

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