@kuma-ui/system
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -1,3 +0,6 @@ | ||
import { CSSValue, ResponsiveStyle } from "./types"; | ||
export type BorderProps = Partial<{ | ||
import { CSSValue, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
type BorderProps = Partial<{ | ||
borderTop: CSSValue<"borderTop">; | ||
@@ -11,2 +14,4 @@ borderRight: CSSValue<"borderRight">; | ||
}>; | ||
export declare const border: (props: BorderProps) => ResponsiveStyle; | ||
declare const border: (props: BorderProps) => ResponsiveStyle; | ||
export { BorderProps, border }; |
@@ -1,3 +0,6 @@ | ||
import { CSSValue, ResponsiveStyle } from "./types"; | ||
export type ColorProps = Partial<{ | ||
import { CSSValue, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
type ColorProps = Partial<{ | ||
bg: CSSValue<"backgroundColor">; | ||
@@ -7,2 +10,4 @@ color: CSSValue<"color">; | ||
}>; | ||
export declare const color: (props: ColorProps) => ResponsiveStyle; | ||
declare const color: (props: ColorProps) => ResponsiveStyle; | ||
export { ColorProps, color }; |
@@ -1,13 +0,16 @@ | ||
import { SpaceProps } from "./space"; | ||
import { TypographyProps } from "./typography"; | ||
import { LayoutProps } from "./layout"; | ||
import { ColorProps } from "./color"; | ||
import { FlexProps } from "./flex"; | ||
import { BorderProps } from "./border"; | ||
import { PositionProps } from "./position"; | ||
import { ShadowProps } from "./shadow"; | ||
import { ResponsiveStyle } from "./types"; | ||
import { GridProps } from "./grid"; | ||
export type StyledProps = SpaceProps & TypographyProps & LayoutProps & ColorProps & FlexProps & BorderProps & PositionProps & ShadowProps & GridProps; | ||
export type StyleFunction = (props: StyledProps) => ResponsiveStyle; | ||
import { SpaceProps } from './space.js'; | ||
import { TypographyProps } from './typography.js'; | ||
import { LayoutProps } from './layout.js'; | ||
import { ColorProps } from './color.js'; | ||
import { FlexProps } from './flex.js'; | ||
import { BorderProps } from './border.js'; | ||
import { PositionProps } from './position.js'; | ||
import { ShadowProps } from './shadow.js'; | ||
import { ResponsiveStyle } from './types.js'; | ||
import { GridProps } from './grid.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
type StyledProps = SpaceProps & TypographyProps & LayoutProps & ColorProps & FlexProps & BorderProps & PositionProps & ShadowProps & GridProps; | ||
type StyleFunction = (props: StyledProps) => ResponsiveStyle; | ||
/** | ||
@@ -26,2 +29,4 @@ * Composes multiple style functions into a single style function. | ||
*/ | ||
export declare const compose: (...styleFunctions: StyleFunction[]) => StyleFunction; | ||
declare const compose: (...styleFunctions: StyleFunction[]) => StyleFunction; | ||
export { StyleFunction, StyledProps, compose }; |
@@ -31,3 +31,3 @@ "use strict"; | ||
let outputProps = { ...props }; | ||
const cachedStyles = import_sheet.sheet.getFromCache(cacheKey); | ||
const cachedStyles = import_sheet.styleCache.get(cacheKey); | ||
if (cachedStyles) { | ||
@@ -60,3 +60,3 @@ return cachedStyles; | ||
); | ||
import_sheet.sheet.addToCache(cacheKey, combinedStyles); | ||
import_sheet.styleCache.set(cacheKey, combinedStyles); | ||
return combinedStyles; | ||
@@ -63,0 +63,0 @@ }; |
@@ -1,3 +0,6 @@ | ||
import { CSSValue, ResponsiveStyle } from "./types"; | ||
export type FlexProps = Partial<{ | ||
import { CSSValue, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
type FlexProps = Partial<{ | ||
flexDir: CSSValue<"flexDirection">; | ||
@@ -13,2 +16,4 @@ justify: CSSValue<"justifyContent">; | ||
}>; | ||
export declare const flex: (props: FlexProps) => ResponsiveStyle; | ||
declare const flex: (props: FlexProps) => ResponsiveStyle; | ||
export { FlexProps, flex }; |
@@ -1,7 +0,10 @@ | ||
import { GridKeys } from "./keys"; | ||
import { CSSValue, ResponsiveStyle } from "./types"; | ||
import { GridKeys } from './keys.js'; | ||
import { CSSValue, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
declare const unitKeys: readonly ["gridGap", "gridColumnGap", "gridRowGap"]; | ||
type UnitKeys = (typeof unitKeys)[number]; | ||
export type GridProps = Partial<Record<Exclude<GridKeys, UnitKeys>, CSSValue<GridKeys>>> & Partial<Record<UnitKeys, CSSValue<GridKeys, true>>>; | ||
export declare const grid: (props: GridProps) => ResponsiveStyle; | ||
export {}; | ||
type GridProps = Partial<Record<Exclude<GridKeys, UnitKeys>, CSSValue<GridKeys>>> & Partial<Record<UnitKeys, CSSValue<GridKeys, true>>>; | ||
declare const grid: (props: GridProps) => ResponsiveStyle; | ||
export { GridProps, grid }; |
@@ -1,16 +0,19 @@ | ||
import { SpaceProps } from "./space"; | ||
import { TypographyProps } from "./typography"; | ||
import { LayoutProps } from "./layout"; | ||
import { ColorProps } from "./color"; | ||
import { FlexProps } from "./flex"; | ||
import { BorderProps } from "./border"; | ||
import { PositionProps } from "./position"; | ||
import { ShadowProps } from "./shadow"; | ||
import { StyledProps } from "./compose"; | ||
import { ResponsiveStyle } from "./types"; | ||
import { PseudoProps, pseudoMappings, isPseudoProps } from "./pseudo"; | ||
export { StyledKeyType, isStyledProp } from "./keys"; | ||
export * from "./types"; | ||
export declare const all: import("./compose").StyleFunction; | ||
export { pseudoMappings, isPseudoProps }; | ||
export type { SpaceProps, TypographyProps, LayoutProps, ColorProps, FlexProps, BorderProps, PositionProps, ShadowProps, StyledProps, ResponsiveStyle, PseudoProps, }; | ||
import { StyleFunction } from './compose.js'; | ||
export { StyledProps } from './compose.js'; | ||
export { SpaceProps } from './space.js'; | ||
export { TypographyProps } from './typography.js'; | ||
export { LayoutProps } from './layout.js'; | ||
export { ColorProps } from './color.js'; | ||
export { FlexProps } from './flex.js'; | ||
export { BorderProps } from './border.js'; | ||
export { PositionProps } from './position.js'; | ||
export { ShadowProps } from './shadow.js'; | ||
export { CSSProperty, CSSValue, ResponsiveStyle, UtilityCSSMapping } from './types.js'; | ||
export { PseudoProps, isPseudoProps, pseudoMappings } from './pseudo.js'; | ||
export { StyledKeyType, isStyledProp } from './keys.js'; | ||
import './grid.js'; | ||
import 'csstype'; | ||
declare const all: StyleFunction; | ||
export { all }; |
@@ -353,3 +353,3 @@ "use strict"; | ||
let outputProps = { ...props }; | ||
const cachedStyles = import_sheet2.sheet.getFromCache(cacheKey); | ||
const cachedStyles = import_sheet2.styleCache.get(cacheKey); | ||
if (cachedStyles) { | ||
@@ -382,3 +382,3 @@ return cachedStyles; | ||
); | ||
import_sheet2.sheet.addToCache(cacheKey, combinedStyles); | ||
import_sheet2.styleCache.set(cacheKey, combinedStyles); | ||
return combinedStyles; | ||
@@ -390,4 +390,8 @@ }; | ||
var pseudoMappings = { | ||
_active: ":active", | ||
_disabled: ":disabled", | ||
_hover: ":hover", | ||
_focus: ":focus" | ||
_focus: ":focus", | ||
_focusVisible: ":focus_visible", | ||
_focusWithin: ":focus-within" | ||
}; | ||
@@ -394,0 +398,0 @@ var isPseudoProps = (_props) => { |
@@ -1,2 +0,2 @@ | ||
export declare const styleKeys: { | ||
declare const styleKeys: { | ||
space: readonly ["m", "mt", "mb", "ml", "mr", "mx", "my", "p", "pt", "pb", "pl", "pr", "px", "py"]; | ||
@@ -12,12 +12,14 @@ typography: readonly ["fontSize", "fontWeight", "lineHeight", "letterSpacing", "textAlign", "fontFamily"]; | ||
}; | ||
export type SpaceKeys = (typeof styleKeys.space)[number]; | ||
export type TypographyKeys = (typeof styleKeys.typography)[number]; | ||
export type LayoutKeys = (typeof styleKeys.layout)[number]; | ||
export type ColorKeys = (typeof styleKeys.color)[number]; | ||
export type FlexKeys = (typeof styleKeys.flex)[number]; | ||
export type BorderKeys = (typeof styleKeys.border)[number]; | ||
export type PositionKeys = (typeof styleKeys.position)[number]; | ||
export type ShadowKeys = (typeof styleKeys.shadow)[number]; | ||
export type GridKeys = (typeof styleKeys.grid)[number]; | ||
export type StyledKeyType = SpaceKeys | TypographyKeys | LayoutKeys | ColorKeys | FlexKeys | BorderKeys | PositionKeys | ShadowKeys | GridKeys; | ||
export declare const isStyledProp: (_prop: string) => _prop is StyledKeyType; | ||
type SpaceKeys = (typeof styleKeys.space)[number]; | ||
type TypographyKeys = (typeof styleKeys.typography)[number]; | ||
type LayoutKeys = (typeof styleKeys.layout)[number]; | ||
type ColorKeys = (typeof styleKeys.color)[number]; | ||
type FlexKeys = (typeof styleKeys.flex)[number]; | ||
type BorderKeys = (typeof styleKeys.border)[number]; | ||
type PositionKeys = (typeof styleKeys.position)[number]; | ||
type ShadowKeys = (typeof styleKeys.shadow)[number]; | ||
type GridKeys = (typeof styleKeys.grid)[number]; | ||
type StyledKeyType = SpaceKeys | TypographyKeys | LayoutKeys | ColorKeys | FlexKeys | BorderKeys | PositionKeys | ShadowKeys | GridKeys; | ||
declare const isStyledProp: (_prop: string) => _prop is StyledKeyType; | ||
export { BorderKeys, ColorKeys, FlexKeys, GridKeys, LayoutKeys, PositionKeys, ShadowKeys, SpaceKeys, StyledKeyType, TypographyKeys, isStyledProp, styleKeys }; |
@@ -1,3 +0,6 @@ | ||
import { CSSValue, ResponsiveStyle } from "./types"; | ||
export type LayoutProps = Partial<{ | ||
import { CSSValue, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
type LayoutProps = Partial<{ | ||
width: CSSValue<"width", true>; | ||
@@ -14,2 +17,4 @@ minWidth: CSSValue<"minWidth", true>; | ||
}>; | ||
export declare const layout: (props: LayoutProps) => ResponsiveStyle; | ||
declare const layout: (props: LayoutProps) => ResponsiveStyle; | ||
export { LayoutProps, layout }; |
@@ -1,3 +0,6 @@ | ||
import { CSSValue, ResponsiveStyle } from "./types"; | ||
export type PositionProps = Partial<{ | ||
import { CSSValue, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
type PositionProps = Partial<{ | ||
top: CSSValue<"top", true>; | ||
@@ -9,2 +12,4 @@ right: CSSValue<"right", true>; | ||
}>; | ||
export declare const position: (props: PositionProps) => ResponsiveStyle; | ||
declare const position: (props: PositionProps) => ResponsiveStyle; | ||
export { PositionProps, position }; |
@@ -1,9 +0,28 @@ | ||
import { StyledProps } from "./compose"; | ||
export declare const pseudoMappings: { | ||
import { StyledProps } from './compose.js'; | ||
import './space.js'; | ||
import './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
import './typography.js'; | ||
import './layout.js'; | ||
import './color.js'; | ||
import './flex.js'; | ||
import './border.js'; | ||
import './position.js'; | ||
import './shadow.js'; | ||
import './grid.js'; | ||
declare const pseudoMappings: { | ||
readonly _active: ":active"; | ||
readonly _disabled: ":disabled"; | ||
readonly _hover: ":hover"; | ||
readonly _focus: ":focus"; | ||
readonly _focusVisible: ":focus_visible"; | ||
readonly _focusWithin: ":focus-within"; | ||
}; | ||
export type PseudoProps = { | ||
type PseudoProps = { | ||
[key in keyof typeof pseudoMappings]?: StyledProps; | ||
}; | ||
export declare const isPseudoProps: (_props: unknown) => _props is "_hover" | "_focus"; | ||
declare const isPseudoProps: (_props: unknown) => _props is "_active" | "_disabled" | "_hover" | "_focus" | "_focusVisible" | "_focusWithin"; | ||
export { PseudoProps, isPseudoProps, pseudoMappings }; |
@@ -28,4 +28,8 @@ "use strict"; | ||
var pseudoMappings = { | ||
_active: ":active", | ||
_disabled: ":disabled", | ||
_hover: ":hover", | ||
_focus: ":focus" | ||
_focus: ":focus", | ||
_focusVisible: ":focus_visible", | ||
_focusWithin: ":focus-within" | ||
}; | ||
@@ -32,0 +36,0 @@ var isPseudoProps = (_props) => { |
@@ -1,2 +0,7 @@ | ||
import { CSSProperty, ResponsiveStyle } from "./types"; | ||
export declare const applyResponsiveStyles: (cssProperty: string, cssValues: CSSProperty | number | (CSSProperty | number)[], convertFn?: (value: CSSProperty | number) => string | number) => ResponsiveStyle; | ||
import { CSSProperty, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
declare const applyResponsiveStyles: (cssProperty: string, cssValues: CSSProperty | number | (CSSProperty | number)[], convertFn?: (value: CSSProperty | number) => string | number) => ResponsiveStyle; | ||
export { applyResponsiveStyles }; |
@@ -1,6 +0,11 @@ | ||
import { CSSValue, ResponsiveStyle } from "./types"; | ||
export type ShadowProps = Partial<{ | ||
import { CSSValue, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
type ShadowProps = Partial<{ | ||
boxShadow: CSSValue<"boxShadow">; | ||
textShadow: CSSValue<"textShadow">; | ||
}>; | ||
export declare const shadow: (props: ShadowProps) => ResponsiveStyle; | ||
declare const shadow: (props: ShadowProps) => ResponsiveStyle; | ||
export { ShadowProps, shadow }; |
@@ -1,3 +0,6 @@ | ||
import { CSSValue, ResponsiveStyle } from "./types"; | ||
export type SpaceProps = Partial<{ | ||
import { CSSValue, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
type SpaceProps = Partial<{ | ||
m: CSSValue<"margin", true>; | ||
@@ -18,2 +21,4 @@ mt: CSSValue<"marginTop", true>; | ||
}>; | ||
export declare const space: (props: SpaceProps) => ResponsiveStyle; | ||
declare const space: (props: SpaceProps) => ResponsiveStyle; | ||
export { SpaceProps, space }; |
@@ -1,1 +0,3 @@ | ||
export declare const toCssUnit: (token: string | number) => string; | ||
declare const toCssUnit: (token: string | number) => string; | ||
export { toCssUnit }; |
@@ -1,10 +0,11 @@ | ||
import * as CSS from "csstype"; | ||
import { StyledKeyType } from "./keys"; | ||
export type CSSProperty = Exclude<CSS.Properties[keyof CSS.Properties], undefined>; | ||
import * as CSS from 'csstype'; | ||
import { StyledKeyType } from './keys.js'; | ||
type CSSProperty = Exclude<CSS.Properties[keyof CSS.Properties], undefined>; | ||
type ConditionalNumber<Q, DefaultValue> = Q extends true ? number : DefaultValue; | ||
export type CSSValue<P extends keyof CSS.Properties, Q extends boolean = false> = CSS.Properties[P] | ConditionalNumber<Q, never> | Array<NonNullable<CSS.Properties[P] | ConditionalNumber<Q, never>>>; | ||
export type UtilityCSSMapping<K extends StyledKeyType> = { | ||
type CSSValue<P extends keyof CSS.Properties, Q extends boolean = false> = CSS.Properties[P] | ConditionalNumber<Q, never> | Array<NonNullable<CSS.Properties[P] | ConditionalNumber<Q, never>>>; | ||
type UtilityCSSMapping<K extends StyledKeyType> = { | ||
[key in K]: keyof CSS.Properties; | ||
}; | ||
export type ResponsiveStyle = { | ||
type ResponsiveStyle = { | ||
base: string; | ||
@@ -15,2 +16,3 @@ media: { | ||
}; | ||
export {}; | ||
export { CSSProperty, CSSValue, ResponsiveStyle, UtilityCSSMapping }; |
@@ -1,3 +0,6 @@ | ||
import { ResponsiveStyle, CSSValue } from "./types"; | ||
export type TypographyProps = Partial<{ | ||
import { CSSValue, ResponsiveStyle } from './types.js'; | ||
import 'csstype'; | ||
import './keys.js'; | ||
type TypographyProps = Partial<{ | ||
fontSize?: CSSValue<"fontSize", true>; | ||
@@ -10,2 +13,4 @@ fontWeight?: CSSValue<"fontWeight">; | ||
}>; | ||
export declare const typography: (props: TypographyProps) => ResponsiveStyle; | ||
declare const typography: (props: TypographyProps) => ResponsiveStyle; | ||
export { TypographyProps, typography }; |
{ | ||
"name": "@kuma-ui/system", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "🐻 Kuma UI is a utility-first, zero-runtime CSS-in-JS library that offers an outstanding developer experience and optimized performance.", | ||
@@ -24,6 +24,10 @@ "repository": { | ||
"dependencies": { | ||
"@kuma-ui/sheet": "0.0.3" | ||
"@kuma-ui/sheet": "0.1.0" | ||
}, | ||
"devDependencies": { | ||
"csstype": "^3.1.2" | ||
"@jest/globals": "^29.5.0", | ||
"@jest/types": "^29.1.0", | ||
"csstype": "^3.1.2", | ||
"jest": "^29.1.0", | ||
"@kuma-ui/jest-preset": "0.0.0" | ||
}, | ||
@@ -34,5 +38,4 @@ "publishConfig": { | ||
"scripts": { | ||
"build": "yarn build:dist && yarn build:declarations", | ||
"build:declarations": "tsc --emitDeclarationOnly --outDir dist", | ||
"build:dist": "tsup src --format cjs,esm --config ../../rollup.config.js", | ||
"build": "tsup --config ../../tsup.config.ts", | ||
"test": "jest", | ||
"typecheck": "tsc --noEmit --composite false", | ||
@@ -39,0 +42,0 @@ "lint": "eslint './src/**/*.{js,ts,jsx,tsx}'", |
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
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
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
80446
5
66
2616
+ Added@kuma-ui/sheet@0.1.0(transitive)
- Removed@kuma-ui/sheet@0.0.3(transitive)
Updated@kuma-ui/sheet@0.1.0