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

@uswitch/spark.type

Package Overview
Dependencies
Maintainers
21
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uswitch/spark.type - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11-alpha.0

140

lib/cjs/index.js

@@ -1,50 +0,96 @@

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Type = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _themeUi = require("theme-ui");
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var browserTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
var getTag = function getTag(tag) {
return browserTags.includes(tag) ? tag : 'span';
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value;
var __objSpread = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 's1', 's2', 's3', 'body1', 'body2', 'body3', 'bold1', 'bold2', 'bold3', 'button1', 'button2', 'button3', 'input1', 'input2', 'input3', 'hyperlink1', 'hyperlink2', 'hyperlink3', 'caption', 'overline'];
var BaseType = function BaseType(tag) {
return /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
var _ref$as = _ref.as,
as = _ref$as === void 0 ? getTag(tag) : _ref$as,
props = (0, _objectWithoutProperties2.default)(_ref, ["as"]);
return (0, _themeUi.jsx)(as, _objectSpread(_objectSpread({}, props), {}, {
sx: {
variant: "spark.element.type.".concat(tag),
ref: ref
}
}));
});
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
BaseType.displayName = 'Type';
var Type = {};
exports.Type = Type;
tags.forEach(function (tag) {
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, {get: all[name], enumerable: true});
};
var __reExport = (target, module2, desc) => {
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
for (let key of __getOwnPropNames(module2))
if (!__hasOwnProp.call(target, key) && key !== "default")
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
}
return target;
};
var __toModule = (module2) => {
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
};
__markAsModule(exports);
__export(exports, {
Type: () => Type
});
var import_react = __toModule(require("react"));
var import_theme_ui = __toModule(require("theme-ui"));
const browserTags = ["h1", "h2", "h3", "h4", "h5", "h6"];
const getTag = (tag) => browserTags.includes(tag) ? tag : "span";
const tags = [
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"s1",
"s2",
"s3",
"body1",
"body2",
"body3",
"bold1",
"bold2",
"bold3",
"button1",
"button2",
"button3",
"input1",
"input2",
"input3",
"hyperlink1",
"hyperlink2",
"hyperlink3",
"caption",
"overline"
];
const BaseType = (tag) => import_react.default.forwardRef((_a, ref) => {
var _b = _a, {as = getTag(tag)} = _b, props = __objRest(_b, ["as"]);
return (0, import_theme_ui.jsx)(as, __objSpread(__objSpread({}, props), {
sx: {variant: `spark.element.type.${tag}`, ref}
}));
});
BaseType.displayName = "Type";
const Type = {};
tags.forEach((tag) => {
Type[tag] = BaseType(tag);
Type[tag].displayName = "Type.".concat(tag);
});
Type[tag].displayName = `Type.${tag}`;
});

@@ -1,38 +0,75 @@

import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/** @jsxRuntime classic */
/** @jsx jsx */
import React from 'react';
import { jsx } from 'theme-ui';
var browserTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
var getTag = tag => browserTags.includes(tag) ? tag : 'span';
var tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 's1', 's2', 's3', 'body1', 'body2', 'body3', 'bold1', 'bold2', 'bold3', 'button1', 'button2', 'button3', 'input1', 'input2', 'input3', 'hyperlink1', 'hyperlink2', 'hyperlink3', 'caption', 'overline'];
var BaseType = tag => /*#__PURE__*/React.forwardRef((_ref, ref) => {
var {
as = getTag(tag)
} = _ref,
props = _objectWithoutProperties(_ref, ["as"]);
return jsx(as, _objectSpread(_objectSpread({}, props), {}, {
sx: {
variant: "spark.element.type.".concat(tag),
ref
var __defProp = Object.defineProperty;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value;
var __objSpread = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
import React from "react";
import {jsx} from "theme-ui";
const browserTags = ["h1", "h2", "h3", "h4", "h5", "h6"];
const getTag = (tag) => browserTags.includes(tag) ? tag : "span";
const tags = [
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"s1",
"s2",
"s3",
"body1",
"body2",
"body3",
"bold1",
"bold2",
"bold3",
"button1",
"button2",
"button3",
"input1",
"input2",
"input3",
"hyperlink1",
"hyperlink2",
"hyperlink3",
"caption",
"overline"
];
const BaseType = (tag) => React.forwardRef((_a, ref) => {
var _b = _a, {as = getTag(tag)} = _b, props = __objRest(_b, ["as"]);
return jsx(as, __objSpread(__objSpread({}, props), {
sx: {variant: `spark.element.type.${tag}`, ref}
}));
});
BaseType.displayName = 'Type';
export var Type = {};
tags.forEach(tag => {
BaseType.displayName = "Type";
const Type = {};
tags.forEach((tag) => {
Type[tag] = BaseType(tag);
Type[tag].displayName = "Type.".concat(tag);
});
Type[tag].displayName = `Type.${tag}`;
});
export {
Type
};
{
"name": "@uswitch/spark.type",
"version": "0.0.10",
"version": "0.0.11-alpha.0",
"description": "",

@@ -15,9 +15,3 @@ "sideEffects": false,

"module": "lib/esm/index.js",
"scripts": {
"build": "run-s build:esm build:cjs",
"build:esm": "BABEL_ENV=esm babel --root-mode upward src -d lib/esm --copy-files",
"build:cjs": "BABEL_ENV=cjs babel --root-mode upward src -d lib/cjs --copy-files",
"clean": "rimraf lib",
"watch": "BABEL_ENV=esm babel --root-mode upward src -d lib/esm --copy-files --watch"
},
"scripts": {},
"peerDependencies": {

@@ -24,0 +18,0 @@ "react": ">=16",

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