@welcome-ui/utils
Advanced tools
Comparing version 5.12.0 to 5.13.3-alpha.1
@@ -61,10 +61,10 @@ var __create = Object.create; | ||
// src/card-styles.ts | ||
var import_styled_components = require("@xstyled/styled-components"); | ||
var cardStyles = () => import_styled_components.css` | ||
${(0, import_styled_components.th)("defaultCards")}; | ||
var import_xstyled_styled_components = require("@wttj/xstyled-styled-components"); | ||
var cardStyles = () => import_xstyled_styled_components.css` | ||
${(0, import_xstyled_styled_components.th)("defaultCards")}; | ||
`; | ||
// src/center-content.ts | ||
var import_styled_components2 = require("@xstyled/styled-components"); | ||
var centerContent = import_styled_components2.css` | ||
var import_xstyled_styled_components2 = require("@wttj/xstyled-styled-components"); | ||
var centerContent = import_xstyled_styled_components2.css` | ||
display: flex; | ||
@@ -85,6 +85,6 @@ align-items: center; | ||
// src/field-styles.ts | ||
var import_styled_components4 = require("@xstyled/styled-components"); | ||
var import_xstyled_styled_components4 = require("@wttj/xstyled-styled-components"); | ||
// src/variants.ts | ||
var import_styled_components3 = require("@xstyled/styled-components"); | ||
var import_xstyled_styled_components3 = require("@wttj/xstyled-styled-components"); | ||
var VARIANTS = { | ||
@@ -99,3 +99,3 @@ error: "colors.danger-400", | ||
const key = VARIANTS[variant]; | ||
return key ? (0, import_styled_components3.th)(key) : null; | ||
return key ? (0, import_xstyled_styled_components3.th)(key) : null; | ||
}; | ||
@@ -118,4 +118,4 @@ | ||
const iconSize = FIELD_ICON_SIZE[size]; | ||
return import_styled_components4.css` | ||
${(0, import_styled_components4.th)("defaultFields.default")}; | ||
return import_xstyled_styled_components4.css` | ||
${(0, import_xstyled_styled_components4.th)("defaultFields.default")}; | ||
width: 100%; | ||
@@ -125,9 +125,9 @@ border-color: ${getVariantColor(variant)}; | ||
appearance: none; | ||
${size && (0, import_styled_components4.th)(`defaultFields.sizes.${size}`)}; | ||
${size && (0, import_xstyled_styled_components4.th)(`defaultFields.sizes.${size}`)}; | ||
${/* left icon or both */ | ||
(iconPlacement === "left" || iconPlacement === "both") && import_styled_components4.css` | ||
(iconPlacement === "left" || iconPlacement === "both") && import_xstyled_styled_components4.css` | ||
padding-left: calc( | ||
${(0, import_styled_components4.th)(`defaultFields.sizes.${size}.paddingLeft`)} + ${(0, import_styled_components4.th)(`icons.${iconSize}`)} + | ||
${(0, import_styled_components4.th)("space.sm")} | ||
${(0, import_xstyled_styled_components4.th)(`defaultFields.sizes.${size}.paddingLeft`)} + ${(0, import_xstyled_styled_components4.th)(`icons.${iconSize}`)} + | ||
${(0, import_xstyled_styled_components4.th)("space.sm")} | ||
); | ||
@@ -137,6 +137,6 @@ `}; | ||
${/* is clearable or right icon */ | ||
(isClearable || iconPlacement === "right" || iconPlacement === "both") && import_styled_components4.css` | ||
(isClearable || iconPlacement === "right" || iconPlacement === "both") && import_xstyled_styled_components4.css` | ||
padding-right: calc( | ||
${(0, import_styled_components4.th)(`defaultFields.sizes.${size}.paddingLeft`)} + ${(0, import_styled_components4.th)(`icons.${iconSize}`)} + | ||
${(0, import_styled_components4.th)("space.sm")} | ||
${(0, import_xstyled_styled_components4.th)(`defaultFields.sizes.${size}.paddingLeft`)} + ${(0, import_xstyled_styled_components4.th)(`icons.${iconSize}`)} + | ||
${(0, import_xstyled_styled_components4.th)("space.sm")} | ||
); | ||
@@ -146,10 +146,10 @@ `}; | ||
${/* is clearable and got a right/both icon */ | ||
isClearable && (iconPlacement === "right" || iconPlacement === "both") && import_styled_components4.css` | ||
isClearable && (iconPlacement === "right" || iconPlacement === "both") && import_xstyled_styled_components4.css` | ||
padding-right: calc( | ||
${(0, import_styled_components4.th)(`defaultFields.sizes.${size}.paddingLeft`)} + ${(0, import_styled_components4.th)(`icons.${iconSize}`)} + | ||
${(0, import_styled_components4.th)(`icons.${iconSize}`)} + ${(0, import_styled_components4.th)("space.sm")} + ${(0, import_styled_components4.th)("space.sm")} | ||
${(0, import_xstyled_styled_components4.th)(`defaultFields.sizes.${size}.paddingLeft`)} + ${(0, import_xstyled_styled_components4.th)(`icons.${iconSize}`)} + | ||
${(0, import_xstyled_styled_components4.th)(`icons.${iconSize}`)} + ${(0, import_xstyled_styled_components4.th)("space.sm")} + ${(0, import_xstyled_styled_components4.th)("space.sm")} | ||
); | ||
`}; | ||
${!variant && transparent && import_styled_components4.css` | ||
${!variant && transparent && import_xstyled_styled_components4.css` | ||
border-color: transparent; | ||
@@ -160,15 +160,15 @@ background-color: transparent; | ||
&::placeholder { | ||
${(0, import_styled_components4.th)("defaultFields.placeholder")}; | ||
${(0, import_xstyled_styled_components4.th)("defaultFields.placeholder")}; | ||
} | ||
&:focus { | ||
${(0, import_styled_components4.th)("defaultFields.focused.default")}; | ||
${variant === "error" && (0, import_styled_components4.th)("defaultFields.focused.error")}; | ||
${variant === "warning" && (0, import_styled_components4.th)("defaultFields.focused.warning")}; | ||
${variant === "success" && (0, import_styled_components4.th)("defaultFields.focused.success")}; | ||
${variant === "info" && (0, import_styled_components4.th)("defaultFields.focused.info")}; | ||
${(0, import_xstyled_styled_components4.th)("defaultFields.focused.default")}; | ||
${variant === "error" && (0, import_xstyled_styled_components4.th)("defaultFields.focused.error")}; | ||
${variant === "warning" && (0, import_xstyled_styled_components4.th)("defaultFields.focused.warning")}; | ||
${variant === "success" && (0, import_xstyled_styled_components4.th)("defaultFields.focused.success")}; | ||
${variant === "info" && (0, import_xstyled_styled_components4.th)("defaultFields.focused.info")}; | ||
} | ||
&[disabled] { | ||
${(0, import_styled_components4.th)("defaultFields.disabled")}; | ||
${(0, import_xstyled_styled_components4.th)("defaultFields.disabled")}; | ||
} | ||
@@ -198,5 +198,9 @@ | ||
var getMax = (width, height = width) => { | ||
const widthValue = parseInt(width, 10); | ||
const heightValue = parseInt(height, 10); | ||
const diff = widthValue - heightValue; | ||
const typeToValueExtractor = { | ||
string: (value) => parseInt(value, 10), | ||
number: (value) => value | ||
}; | ||
const widthNumber = typeToValueExtractor[typeof width]?.(width) || 0; | ||
const heightNumber = typeToValueExtractor[typeof width]?.(height) || 0; | ||
const diff = widthNumber - heightNumber; | ||
return diff >= 0 ? width : height; | ||
@@ -239,6 +243,6 @@ }; | ||
var import_react = __toESM(require("react")); | ||
var import_styled_components5 = require("@xstyled/styled-components"); | ||
var import_xstyled_styled_components5 = require("@wttj/xstyled-styled-components"); | ||
var hideFocusRingsDataAttribute = "data-wui-hidefocusrings"; | ||
var HideFocusRingGlobalStyles = (0, import_styled_components5.createGlobalStyle)( | ||
() => import_styled_components5.css` | ||
var HideFocusRingGlobalStyles = (0, import_xstyled_styled_components5.createGlobalStyle)( | ||
() => import_xstyled_styled_components5.css` | ||
[${hideFocusRingsDataAttribute}] *:focus { | ||
@@ -270,4 +274,4 @@ outline: none; | ||
// src/overflow-ellipsis.ts | ||
var import_styled_components6 = require("@xstyled/styled-components"); | ||
var overflowEllipsis = import_styled_components6.css` | ||
var import_xstyled_styled_components6 = require("@wttj/xstyled-styled-components"); | ||
var overflowEllipsis = import_xstyled_styled_components6.css` | ||
white-space: nowrap; | ||
@@ -274,0 +278,0 @@ overflow: hidden; |
@@ -1,2 +0,2 @@ | ||
import { css } from '@xstyled/styled-components'; | ||
import { css } from '@wttj/xstyled-styled-components'; | ||
export declare const cardStyles: () => ReturnType<typeof css>; |
@@ -1,1 +0,1 @@ | ||
export declare const centerContent: import("styled-components").FlattenSimpleInterpolation; | ||
export declare const centerContent: import("styled-components").RuleSet<import("styled-components/dist/types").BaseObject>; |
@@ -1,2 +0,2 @@ | ||
import { css } from '@xstyled/styled-components'; | ||
import { css } from '@wttj/xstyled-styled-components'; | ||
import { Variant } from './variants'; | ||
@@ -3,0 +3,0 @@ type FieldIconSizes = { |
@@ -1,1 +0,2 @@ | ||
export declare const getMax: (width: string, height?: string) => string; | ||
import { SystemProp, Theme } from '@wttj/xstyled-styled-components'; | ||
export declare const getMax: (width: SystemProp<string | number, Theme>, height?: SystemProp<string | number, Theme>) => SystemProp<string | number, Theme>; |
@@ -1,1 +0,1 @@ | ||
export declare const overflowEllipsis: import("styled-components").FlattenSimpleInterpolation; | ||
export declare const overflowEllipsis: import("styled-components").RuleSet<import("styled-components/dist/types").BaseObject>; |
@@ -1,4 +0,4 @@ | ||
import { th } from '@xstyled/styled-components'; | ||
import { th } from '@wttj/xstyled-styled-components'; | ||
export type Variant = 'error' | 'focused' | 'info' | 'success' | 'warning'; | ||
export declare const VARIANTS: Record<Variant, string>; | ||
export declare const getVariantColor: (variant: Variant) => ReturnType<typeof th>; |
{ | ||
"name": "@welcome-ui/utils", | ||
"version": "5.12.0", | ||
"version": "5.13.3-alpha.1", | ||
"description": "Customizable design system with react • styled-components • styled-system and ariakit.", | ||
@@ -46,9 +46,9 @@ "main": "dist/index.js", | ||
"peerDependencies": { | ||
"@xstyled/styled-components": "^3.7.3", | ||
"@wttj/xstyled-styled-components": "^4.0.0", | ||
"react": "^18.0.0", | ||
"styled-components": "^5.3.9" | ||
"styled-components": "^6.1.8" | ||
}, | ||
"gitHead": "57746ae1c5dd3cef664ce2eecec2ab3465242c0b", | ||
"gitHead": "706dc3b57025e553d802074c572676f2dcc89421", | ||
"sideEffects": false, | ||
"homepage": "https://welcome-ui.com" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29183
737
1