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

@arvinxu/layout-kit

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arvinxu/layout-kit - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0-beta.1

4

es/index.d.ts
import type { DetailedHTMLProps, FC, HTMLAttributes } from 'react';
import type { ContentDistribution, ContentPosition, FlexDirection } from './type';
declare type CommonSpaceNumber = 2 | 4 | 8 | 12 | 16 | 24;
export declare type CommonSpaceNumber = 2 | 4 | 8 | 12 | 16 | 24;
export interface IFlexbox {
horizontal?: boolean;
direction?: FlexDirection;

@@ -15,2 +16,1 @@ distribution?: ContentDistribution;

export declare const Flexbox: FC<FlexboxProps>;
export {};

@@ -12,3 +12,3 @@ var _templateObject;

})(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n justify-content: ", ";\n align-items: ", ";\n\n width: ", ";\n height: ", ";\n\n padding: ", ";\n\n > *:not(:last-child) {\n margin-right: ", ";\n margin-bottom: ", ";\n }\n"])), function (props) {
return getFlexDirection(props.direction);
return getFlexDirection(props.direction, props.horizontal);
}, function (props) {

@@ -25,5 +25,5 @@ return props.distribution;

}, function (props) {
return getFlexDirection(props.direction) === 'row' && calcValue(props.gap);
return getFlexDirection(props.direction, props.horizontal) === 'row' && calcValue(props.gap);
}, function (props) {
return getFlexDirection(props.direction) === 'column' && calcValue(props.gap);
return getFlexDirection(props.direction, props.horizontal) === 'column' && calcValue(props.gap);
});

@@ -1,3 +0,3 @@

export declare type ContentPosition = 'center' | 'end' | 'flex-end' | 'flex-start' | 'start' | 'stretch';
export declare type ContentPosition = 'center' | 'end' | 'flex-end' | 'flex-start' | 'start' | 'stretch' | 'baseline';
export declare type ContentDistribution = 'center' | 'space-around' | 'space-between' | 'space-evenly' | 'stretch';
export declare type FlexDirection = 'vertical' | 'vertical-reverse' | 'horizontal' | 'horizontal-reverse';
import type { FlexDirection } from './type';
export declare const getFlexDirection: (direction: FlexDirection) => "row" | "row-reverse" | "column" | "column-reverse";
export declare const getFlexDirection: (direction: FlexDirection, isHorizontal: boolean) => "row" | "row-reverse" | "column" | "column-reverse";
export declare const calcValue: (value: string | number) => string;

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

export var getFlexDirection = function getFlexDirection(direction) {
export var getFlexDirection = function getFlexDirection(direction, isHorizontal) {
if (isHorizontal) return 'row';
switch (direction) {

@@ -3,0 +5,0 @@ case 'horizontal':

import type { DetailedHTMLProps, FC, HTMLAttributes } from 'react';
import type { ContentDistribution, ContentPosition, FlexDirection } from './type';
declare type CommonSpaceNumber = 2 | 4 | 8 | 12 | 16 | 24;
export declare type CommonSpaceNumber = 2 | 4 | 8 | 12 | 16 | 24;
export interface IFlexbox {
horizontal?: boolean;
direction?: FlexDirection;

@@ -15,2 +16,1 @@ distribution?: ContentDistribution;

export declare const Flexbox: FC<FlexboxProps>;
export {};

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

})(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n justify-content: ", ";\n align-items: ", ";\n\n width: ", ";\n height: ", ";\n\n padding: ", ";\n\n > *:not(:last-child) {\n margin-right: ", ";\n margin-bottom: ", ";\n }\n"])), function (props) {
return (0, _utils.getFlexDirection)(props.direction);
return (0, _utils.getFlexDirection)(props.direction, props.horizontal);
}, function (props) {

@@ -36,7 +36,7 @@ return props.distribution;

}, function (props) {
return (0, _utils.getFlexDirection)(props.direction) === 'row' && (0, _utils.calcValue)(props.gap);
return (0, _utils.getFlexDirection)(props.direction, props.horizontal) === 'row' && (0, _utils.calcValue)(props.gap);
}, function (props) {
return (0, _utils.getFlexDirection)(props.direction) === 'column' && (0, _utils.calcValue)(props.gap);
return (0, _utils.getFlexDirection)(props.direction, props.horizontal) === 'column' && (0, _utils.calcValue)(props.gap);
});
exports.Flexbox = Flexbox;

@@ -1,3 +0,3 @@

export declare type ContentPosition = 'center' | 'end' | 'flex-end' | 'flex-start' | 'start' | 'stretch';
export declare type ContentPosition = 'center' | 'end' | 'flex-end' | 'flex-start' | 'start' | 'stretch' | 'baseline';
export declare type ContentDistribution = 'center' | 'space-around' | 'space-between' | 'space-evenly' | 'stretch';
export declare type FlexDirection = 'vertical' | 'vertical-reverse' | 'horizontal' | 'horizontal-reverse';
import type { FlexDirection } from './type';
export declare const getFlexDirection: (direction: FlexDirection) => "row" | "row-reverse" | "column" | "column-reverse";
export declare const getFlexDirection: (direction: FlexDirection, isHorizontal: boolean) => "row" | "row-reverse" | "column" | "column-reverse";
export declare const calcValue: (value: string | number) => string;

@@ -6,5 +6,7 @@ "use strict";

});
exports.calcValue = exports.getFlexDirection = void 0;
exports.getFlexDirection = exports.calcValue = void 0;
var getFlexDirection = function getFlexDirection(direction) {
var getFlexDirection = function getFlexDirection(direction, isHorizontal) {
if (isHorizontal) return 'row';
switch (direction) {

@@ -11,0 +13,0 @@ case 'horizontal':

{
"name": "@arvinxu/layout-kit",
"version": "1.0.0",
"version": "1.1.0-beta.1",
"files": [

@@ -16,4 +16,4 @@ "lib",

},
"peerDependencies": {
"styled-components": ">5"
"dependencies": {
"styled-components": "^5.3.3"
},

@@ -20,0 +20,0 @@ "devDependencies": {

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